26 #include <QtGui/QDoubleValidator> 27 #include <QtGui/QIntValidator> 28 #include <QtGui/QtGui> 32 #if QT_VERSION >= 0x050000 33 #include <QtWidgets/QtWidgets> 39 #include <qwt_symbol.h> 47 : QMenu(
"Line Color", parent), d_which(which)
49 d_grp =
new QActionGroup(
this);
51 d_act.push_back(
new QAction(
"Blue",
this));
52 d_act.push_back(
new QAction(
"Red",
this));
53 d_act.push_back(
new QAction(
"Green",
this));
54 d_act.push_back(
new QAction(
"Black",
this));
55 d_act.push_back(
new QAction(
"Cyan",
this));
56 d_act.push_back(
new QAction(
"Magenta",
this));
57 d_act.push_back(
new QAction(
"Yellow",
this));
58 d_act.push_back(
new QAction(
"Gray",
this));
59 d_act.push_back(
new QAction(
"Dark Red",
this));
60 d_act.push_back(
new QAction(
"Dark Green",
this));
61 d_act.push_back(
new QAction(
"Dark Blue",
this));
62 d_act.push_back(
new QAction(
"Dark Gray",
this));
64 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlue()));
65 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getRed()));
66 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getGreen()));
67 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlack()));
68 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getCyan()));
69 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getMagenta()));
70 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getYellow()));
71 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getGray()));
72 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getDarkRed()));
73 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getDarkGreen()));
74 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getDarkBlue()));
75 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getDarkGray()));
77 QListIterator<QAction*> i(d_act);
79 QAction* a = i.next();
80 a->setCheckable(
true);
81 a->setActionGroup(d_grp);
92 if (which < static_cast<unsigned int>(d_act.size()))
95 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.\n");
99 void whichTrigger(
unsigned int which,
const QString& name);
117 QList<QAction*> d_act;
131 : QMenu(
"Line Width", parent), d_which(which)
133 d_grp =
new QActionGroup(
this);
135 d_act.push_back(
new QAction(
"1",
this));
136 d_act.push_back(
new QAction(
"2",
this));
137 d_act.push_back(
new QAction(
"3",
this));
138 d_act.push_back(
new QAction(
"4",
this));
139 d_act.push_back(
new QAction(
"5",
this));
140 d_act.push_back(
new QAction(
"6",
this));
141 d_act.push_back(
new QAction(
"7",
this));
142 d_act.push_back(
new QAction(
"8",
this));
143 d_act.push_back(
new QAction(
"9",
this));
144 d_act.push_back(
new QAction(
"10",
this));
146 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getOne()));
147 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getTwo()));
148 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getThree()));
149 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getFour()));
150 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getFive()));
151 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getSix()));
152 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getSeven()));
153 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getEight()));
154 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(getNine()));
155 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(getTen()));
157 QListIterator<QAction*> i(d_act);
158 while (i.hasNext()) {
159 QAction* a = i.next();
160 a->setCheckable(
true);
161 a->setActionGroup(d_grp);
172 if (which < static_cast<unsigned int>(d_act.size()))
175 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.\n");
179 void whichTrigger(
unsigned int which,
unsigned int width);
195 QList<QAction*> d_act;
209 : QMenu(
"Line Style", parent), d_which(which)
211 d_grp =
new QActionGroup(
this);
213 d_act.push_back(
new QAction(
"None",
this));
214 d_act.push_back(
new QAction(
"Solid",
this));
215 d_act.push_back(
new QAction(
"Dash",
this));
216 d_act.push_back(
new QAction(
"Dots",
this));
217 d_act.push_back(
new QAction(
"Dash-Dot",
this));
218 d_act.push_back(
new QAction(
"Dash-Dot-Dot",
this));
220 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
221 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getSolid()));
222 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getDash()));
223 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getDots()));
224 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getDashDot()));
225 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getDashDotDot()));
227 QListIterator<QAction*> i(d_act);
228 while (i.hasNext()) {
229 QAction* a = i.next();
230 a->setCheckable(
true);
231 a->setActionGroup(d_grp);
242 if (which < static_cast<unsigned int>(d_act.size()))
245 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.\n");
261 QList<QAction*> d_act;
275 : QMenu(
"Line Marker", parent), d_which(which)
277 d_grp =
new QActionGroup(
this);
279 d_act.push_back(
new QAction(
"None",
this));
280 d_act.push_back(
new QAction(
"Circle",
this));
281 d_act.push_back(
new QAction(
"Rectangle",
this));
282 d_act.push_back(
new QAction(
"Diamond",
this));
283 d_act.push_back(
new QAction(
"Triangle",
this));
284 d_act.push_back(
new QAction(
"Down Triangle",
this));
285 d_act.push_back(
new QAction(
"Left Triangle",
this));
286 d_act.push_back(
new QAction(
"Right Triangle",
this));
287 d_act.push_back(
new QAction(
"Cross",
this));
288 d_act.push_back(
new QAction(
"X-Cross",
this));
289 d_act.push_back(
new QAction(
"Horiz. Line",
this));
290 d_act.push_back(
new QAction(
"Vert. Line",
this));
291 d_act.push_back(
new QAction(
"Star 1",
this));
292 d_act.push_back(
new QAction(
"Star 2",
this));
293 d_act.push_back(
new QAction(
"Hexagon",
this));
295 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
296 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getCircle()));
297 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getRect()));
298 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getDiamond()));
299 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getTriangle()));
300 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getDTriangle()));
301 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getLTriangle()));
302 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getRTriangle()));
303 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(getCross()));
304 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(getXCross()));
305 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(getHLine()));
306 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(getVLine()));
307 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(getStar1()));
308 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(getStar2()));
309 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(getHexagon()));
311 QListIterator<QAction*> i(d_act);
312 while (i.hasNext()) {
313 QAction* a = i.next();
314 a->setCheckable(
true);
315 a->setActionGroup(d_grp);
326 if (which < static_cast<unsigned int>(d_act.size()))
329 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.\n");
333 void whichTrigger(
unsigned int which, QwtSymbol::Style);
354 QList<QAction*> d_act;
368 : QMenu(
"Line Transparency", parent), d_which(which)
370 d_grp =
new QActionGroup(
this);
372 d_act.push_back(
new QAction(
"None",
this));
373 d_act.push_back(
new QAction(
"Low",
this));
374 d_act.push_back(
new QAction(
"Medium",
this));
375 d_act.push_back(
new QAction(
"High",
this));
376 d_act.push_back(
new QAction(
"Off",
this));
378 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
379 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getLow()));
380 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getMedium()));
381 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getHigh()));
382 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getOff()));
384 QListIterator<QAction*> i(d_act);
385 while (i.hasNext()) {
386 QAction* a = i.next();
387 a->setCheckable(
true);
388 a->setActionGroup(d_grp);
399 if (which < static_cast<unsigned int>(d_act.size()))
402 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.\n");
417 QList<QAction*> d_act;
431 : QAction(
"Line Title", parent), d_which(which)
433 d_diag =
new QDialog(parent);
434 d_diag->setModal(
true);
436 d_text =
new QLineEdit();
438 QGridLayout* layout =
new QGridLayout(d_diag);
439 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
440 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
442 layout->addWidget(d_text, 0, 0, 1, 2);
443 layout->addWidget(btn_ok, 1, 0);
444 layout->addWidget(btn_cancel, 1, 1);
446 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
447 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
449 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
455 void whichTrigger(
unsigned int which,
const QString& text);
485 d_diag =
new QDialog(parent);
486 d_diag->setWindowTitle(
"Other");
487 d_diag->setModal(
true);
489 d_text =
new QLineEdit();
491 QGridLayout* layout =
new QGridLayout(d_diag);
492 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
493 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
495 layout->addWidget(d_text, 0, 0, 1, 2);
496 layout->addWidget(btn_ok, 1, 0);
497 layout->addWidget(btn_cancel, 1, 1);
499 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
500 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
502 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
538 : QAction(
"Other", parent)
540 d_diag =
new QDialog(parent);
541 d_diag->setWindowTitle(
"Other");
542 d_diag->setModal(
true);
544 d_text0 =
new QLineEdit();
545 d_text1 =
new QLineEdit();
547 QLabel* _label0 =
new QLabel(label0);
548 QLabel* _label1 =
new QLabel(label1);
550 QGridLayout* layout =
new QGridLayout(d_diag);
551 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
552 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
554 layout->addWidget(_label0, 0, 0, 1, 2);
555 layout->addWidget(_label1, 1, 0, 1, 2);
557 layout->addWidget(d_text0, 0, 1, 1, 2);
558 layout->addWidget(d_text1, 1, 1, 1, 2);
559 layout->addWidget(btn_ok, 2, 0);
560 layout->addWidget(btn_cancel, 2, 1);
562 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
563 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
565 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
571 void whichTrigger(
const QString& text0,
const QString& text1);
600 d_grp =
new QActionGroup(
this);
602 d_act.push_back(
new QAction(
"32",
this));
603 d_act.push_back(
new QAction(
"64",
this));
604 d_act.push_back(
new QAction(
"128",
this));
605 d_act.push_back(
new QAction(
"256",
this));
606 d_act.push_back(
new QAction(
"512",
this));
607 d_act.push_back(
new QAction(
"1024",
this));
608 d_act.push_back(
new QAction(
"2048",
this));
609 d_act.push_back(
new QAction(
"4096",
this));
615 d_grp =
new QActionGroup(
this);
616 for (
int t = 0; t < d_act.size(); t++) {
617 d_act[t]->setCheckable(
true);
618 d_act[t]->setActionGroup(d_grp);
621 QIntValidator* valid =
new QIntValidator(32, 4096,
this);
622 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
624 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(get05()));
625 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(get06()));
626 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(get07()));
627 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(get08()));
628 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(get09()));
629 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(get10()));
630 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(get11()));
631 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(get12()));
638 SLOT(getOther(
const QString&)));
640 QListIterator<QAction*> i(d_act);
641 while (i.hasNext()) {
642 QAction* a = i.next();
643 a->setCheckable(
true);
644 a->setActionGroup(d_grp);
655 if (which < static_cast<unsigned int>(d_act.size()))
658 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
664 float which = std::log(static_cast<float>(size)) / std::log(2.0f) - 5;
666 if (std::modf(which, &ipt) == 0) {
667 if (which < static_cast<unsigned int>(d_act.size()) - 1)
668 return d_act[
static_cast<int>(which)];
670 throw std::runtime_error(
671 "FFTSizeMenu::getActionFromString: which out of range.\n");
675 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(size));
676 return d_act[d_act.size() - 1];
697 int value = str.toInt();
702 QList<QAction*> d_act;
714 : QMenu(menuTitle.c_str(), parent)
716 d_grp =
new QActionGroup(
this);
723 d_act.push_back(
new QAction(
"Off",
this));
724 d_act.push_back(
new QAction(
"High",
this));
725 d_act.push_back(
new QAction(
"Medium",
this));
726 d_act.push_back(
new QAction(
"Low",
this));
729 d_grp =
new QActionGroup(
this);
730 for (
int t = 0; t < d_act.size(); t++) {
731 d_act[t]->setCheckable(
true);
732 d_act[t]->setActionGroup(d_grp);
734 d_act[0]->setChecked(
true);
736 QDoubleValidator* valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
737 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
739 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getOff()));
740 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getHigh()));
741 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getMedium()));
742 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getLow()));
746 SLOT(getOther(
const QString&)));
748 QListIterator<QAction*> i(d_act);
749 while (i.hasNext()) {
750 QAction* a = i.next();
751 a->setCheckable(
true);
752 a->setActionGroup(d_grp);
763 if (which < static_cast<unsigned int>(d_act.size()))
766 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
774 else if (avg == d_high)
776 else if (avg == d_medium)
778 else if (avg == d_low)
781 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(avg));
784 return d_act[
static_cast<int>(which)];
803 float value = str.toFloat();
808 QList<QAction*> d_act;
810 float d_off, d_high, d_medium, d_low;
836 d_act.push_back(
new QAction(
"None",
this));
837 d_act.push_back(
new QAction(
"Hamming",
this));
838 d_act.push_back(
new QAction(
"Hann",
this));
839 d_act.push_back(
new QAction(
"Blackman",
this));
840 d_act.push_back(
new QAction(
"Blackman-harris",
this));
841 d_act.push_back(
new QAction(
"Rectangular",
this));
842 d_act.push_back(
new QAction(
"Kaiser",
this));
843 d_act.push_back(
new QAction(
"Flat-top",
this));
845 d_grp =
new QActionGroup(
this);
846 for (
int t = 0; t < d_act.size(); t++) {
847 d_act[t]->setCheckable(
true);
848 d_act[t]->setActionGroup(d_grp);
851 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
852 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getHamming()));
853 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getHann()));
854 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getBlackman()));
855 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getBlackmanharris()));
856 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getRectangular()));
857 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getKaiser()));
858 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getFlattop()));
860 QListIterator<QAction*> i(d_act);
861 while (i.hasNext()) {
862 QAction* a = i.next();
873 if (which < static_cast<unsigned int>(d_act.size()))
876 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
882 switch (static_cast<int>(type)) {
928 QList<QAction*> d_act;
941 NPointsMenu(QWidget* parent) : QAction(
"Number of Points", parent)
943 d_diag =
new QDialog(parent);
944 d_diag->setWindowTitle(
"Number of Points");
945 d_diag->setModal(
true);
947 d_text =
new QLineEdit();
949 QGridLayout* layout =
new QGridLayout(d_diag);
950 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
951 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
953 layout->addWidget(d_text, 0, 0, 1, 2);
954 layout->addWidget(btn_ok, 1, 0);
955 layout->addWidget(btn_cancel, 1, 1);
957 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
958 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
960 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
969 void setDiagText(
const int npts) { d_text->setText(QString().setNum(npts)); }
995 : QMenu(
"Color Map", parent), d_which(which)
997 d_grp =
new QActionGroup(
this);
999 d_act.push_back(
new QAction(
"Multi-Color",
this));
1000 d_act.push_back(
new QAction(
"White Hot",
this));
1001 d_act.push_back(
new QAction(
"Black Hot",
this));
1002 d_act.push_back(
new QAction(
"Incandescent",
this));
1003 d_act.push_back(
new QAction(
"Sunset",
this));
1004 d_act.push_back(
new QAction(
"Cool",
this));
1005 d_act.push_back(
new QAction(
"Other",
this));
1009 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getMultiColor()));
1010 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getWhiteHot()));
1011 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getBlackHot()));
1012 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getIncandescent()));
1013 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getSunset()));
1014 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getCool()));
1015 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getOther()));
1017 QListIterator<QAction*> i(d_act);
1018 while (i.hasNext()) {
1019 QAction* a = i.next();
1020 a->setCheckable(
true);
1021 a->setActionGroup(d_grp);
1025 d_max_value = QColor(
"white");
1026 d_min_value = QColor(
"white");
1035 if (which < static_cast<unsigned int>(d_act.size()))
1036 return d_act[which];
1038 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1044 const QColor& min_color = QColor(),
1045 const QColor& max_color = QColor());
1063 QMessageBox::information(
1065 "Set low and high intensities",
1066 "In the next windows, select the low and then the high intensity colors.",
1068 d_min_value = QColorDialog::getColor(d_min_value,
this);
1069 d_max_value = QColorDialog::getColor(d_max_value,
this);
1076 QActionGroup* d_grp;
1077 QList<QAction*> d_act;
1078 QColor d_max_value, d_min_value;
1093 d_grp =
new QActionGroup(
this);
1094 d_act.push_back(
new QAction(
"Free",
this));
1095 d_act.push_back(
new QAction(
"Auto",
this));
1096 d_act.push_back(
new QAction(
"Normal",
this));
1097 d_act.push_back(
new QAction(
"Tag",
this));
1099 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getFree()));
1100 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getAuto()));
1101 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getNorm()));
1102 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getTag()));
1104 QListIterator<QAction*> i(d_act);
1105 while (i.hasNext()) {
1106 QAction* a = i.next();
1107 a->setCheckable(
true);
1108 a->setActionGroup(d_grp);
1119 if (which < static_cast<unsigned int>(d_act.size()))
1120 return d_act[which];
1122 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.\n");
1141 throw std::runtime_error(
1142 "TriggerModeMenu::getAction: unknown trigger mode.\n");
1156 QList<QAction*> d_act;
1157 QActionGroup* d_grp;
1171 d_grp =
new QActionGroup(
this);
1172 d_act.push_back(
new QAction(
"Positive",
this));
1173 d_act.push_back(
new QAction(
"Negative",
this));
1175 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getPos()));
1176 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getNeg()));
1178 QListIterator<QAction*> i(d_act);
1179 while (i.hasNext()) {
1180 QAction* a = i.next();
1181 a->setCheckable(
true);
1182 a->setActionGroup(d_grp);
1193 if (which < static_cast<unsigned int>(d_act.size()))
1194 return d_act[which];
1196 throw std::runtime_error(
1197 "TriggerSlopeMenu::getAction: which out of range.\n");
1210 throw std::runtime_error(
1211 "TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1223 QList<QAction*> d_act;
1224 QActionGroup* d_grp;
1238 d_grp =
new QActionGroup(
this);
1239 for (
int i = 0; i < nchans; i++) {
1240 d_act.push_back(
new QAction(QString().setNum(i),
this));
1241 d_act[i]->setCheckable(
true);
1242 d_act[i]->setActionGroup(d_grp);
1244 addAction(d_act[i]);
1245 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(getChannel()));
1255 if (which < static_cast<unsigned int>(d_act.size()))
1256 return d_act[which];
1258 throw std::runtime_error(
1259 "TriggerChannelMenu::getAction: which out of range.\n");
1269 QAction* a = d_grp->checkedAction();
1270 int which = a->text().toInt();
1275 QList<QAction*> d_act;
1276 QActionGroup* d_grp;
1290 d_grp =
new QActionGroup(
this);
1291 d_act.push_back(
new QAction(
"Horizontal",
this));
1292 d_act.push_back(
new QAction(
"Vertical",
this));
1293 d_act.push_back(
new QAction(
"None",
this));
1295 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getHoriz()));
1296 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getVert()));
1297 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getNone()));
1299 QListIterator<QAction*> i(d_act);
1300 while (i.hasNext()) {
1301 QAction* a = i.next();
1302 a->setCheckable(
true);
1303 a->setActionGroup(d_grp);
1314 if (which < static_cast<unsigned int>(d_act.size()))
1315 return d_act[which];
1317 throw std::runtime_error(
1318 "NumberLayoutMenu::getAction: which out of range.\n");
1334 throw std::runtime_error(
1335 "NumberLayoutMenu::getAction: unknown layout type.\n");
1348 QList<QAction*> d_act;
1349 QActionGroup* d_grp;
1362 : QMenu(
"Color Map", parent), d_which(which)
1364 d_grp =
new QActionGroup(
this);
1366 d_act.push_back(
new QAction(
"Black",
this));
1367 d_act.push_back(
new QAction(
"Blue-Red",
this));
1368 d_act.push_back(
new QAction(
"White Hot",
this));
1369 d_act.push_back(
new QAction(
"Black Hot",
this));
1370 d_act.push_back(
new QAction(
"Black-Red",
this));
1371 d_act.push_back(
new QAction(
"Other",
this));
1373 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1374 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getBlueRed()));
1375 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getWhiteHot()));
1376 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getBlackHot()));
1377 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getBlackRed()));
1378 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getOther()));
1380 QListIterator<QAction*> i(d_act);
1381 while (i.hasNext()) {
1382 QAction* a = i.next();
1383 a->setCheckable(
true);
1384 a->setActionGroup(d_grp);
1388 d_max_value = QColor(
"black");
1389 d_min_value = QColor(
"black");
1398 if (which < static_cast<unsigned int>(d_act.size()))
1399 return d_act[which];
1401 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1406 whichTrigger(
unsigned int which,
const QColor& min_color,
const QColor& max_color);
1416 QMessageBox::information(
1418 "Set low and high intensities",
1419 "In the next windows, select the low and then the high intensity colors.",
1421 d_min_value = QColorDialog::getColor(d_min_value,
this);
1422 d_max_value = QColorDialog::getColor(d_max_value,
this);
1428 QActionGroup* d_grp;
1429 QList<QAction*> d_act;
1430 QColor d_max_value, d_min_value;
1443 PopupMenu(QString desc, QWidget* parent) : QAction(desc, parent)
1445 d_diag =
new QDialog(parent);
1446 d_diag->setWindowTitle(desc);
1447 d_diag->setModal(
true);
1449 d_text =
new QLineEdit();
1451 QGridLayout* layout =
new QGridLayout(d_diag);
1452 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1453 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1455 layout->addWidget(d_text, 0, 0, 1, 2);
1456 layout->addWidget(btn_ok, 1, 0);
1457 layout->addWidget(btn_cancel, 1, 1);
1459 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1460 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1462 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
1497 : QAction(title, parent), d_which(which)
1499 d_diag =
new QDialog(parent);
1500 d_diag->setWindowTitle(title);
1501 d_diag->setModal(
true);
1503 d_text =
new QLineEdit();
1505 QGridLayout* layout =
new QGridLayout(d_diag);
1506 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1507 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1509 layout->addWidget(d_text, 0, 0, 1, 2);
1510 layout->addWidget(btn_ok, 1, 0);
1511 layout->addWidget(btn_cancel, 1, 1);
1513 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1514 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1516 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
1521 void setText(
float f) { d_text->setText(QString(
"%1").arg(f)); }
OtherAction(QWidget *parent)
Definition: form_menus.h:483
Definition: qtgui_types.h:132
Definition: trigger_mode.h:38
Hann window; max attenuation 44 dB.
Definition: firdes.h:48
Hamming window; max attenuation 53 dB.
Definition: firdes.h:47
~OtherAction()
Definition: form_menus.h:505
void getTextDiag()
Definition: form_menus.h:574
void getTextDiag()
Definition: form_menus.h:1528
Definition: qtgui_types.h:146
Definition: form_menus.h:425
Basic rectangular window.
Definition: firdes.h:50
~LineTitleAction()
Definition: form_menus.h:452
ItemFloatAct(unsigned int which, QString title, QWidget *parent)
Definition: form_menus.h:1496
Definition: form_menus.h:478
Definition: qtgui_types.h:143
void setValidator(QValidator *v)
Definition: form_menus.h:507
Definition: trigger_mode.h:37
Kaiser window; max attenuation a function of beta, google it.
Definition: firdes.h:51
graph_t
Definition: qtgui_types.h:130
Definition: form_menus.h:532
void getTextDiag()
Definition: form_menus.h:515
Definition: trigger_mode.h:31
Definition: cc_common.h:45
Definition: qtgui_types.h:145
don't use a window
Definition: firdes.h:46
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:537
Definition: qtgui_types.h:147
void setDiagText(QString text)
Definition: form_menus.h:509
flat top window; useful in FFTs
Definition: firdes.h:56
~ItemFloatAct()
Definition: form_menus.h:1519
Definition: qtgui_types.h:142
Definition: trigger_mode.h:30
Definition: qtgui_types.h:144
trigger_slope
Definition: trigger_mode.h:36
trigger_mode
Definition: trigger_mode.h:29
Definition: trigger_mode.h:33
Definition: qtgui_types.h:133
Blackman window; max attenuation 74 dB.
Definition: firdes.h:49
~OtherDualAction()
Definition: form_menus.h:568
void setText(float f)
Definition: form_menus.h:1521
Definition: qtgui_types.h:141
Blackman-harris window.
Definition: firdes.h:52
Definition: trigger_mode.h:32
Definition: form_menus.h:1491
void getTextDiag()
Definition: form_menus.h:458
win_type
Definition: firdes.h:45
Definition: qtgui_types.h:131
LineTitleAction(unsigned int which, QWidget *parent)
Definition: form_menus.h:430