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()));
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;
715 : QMenu(menuTitle.c_str(), parent)
717 d_grp =
new QActionGroup(
this);
724 d_act.push_back(
new QAction(
"Off",
this));
725 d_act.push_back(
new QAction(
"High",
this));
726 d_act.push_back(
new QAction(
"Medium",
this));
727 d_act.push_back(
new QAction(
"Low",
this));
730 d_grp =
new QActionGroup(
this);
731 for (
int t = 0; t < d_act.size(); t++) {
732 d_act[t]->setCheckable(
true);
733 d_act[t]->setActionGroup(d_grp);
735 d_act[0]->setChecked(
true);
737 QDoubleValidator* valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
738 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
740 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOff()));
741 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHigh()));
742 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
743 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getLow()));
749 QListIterator<QAction*> i(d_act);
750 while (i.hasNext()) {
751 QAction* a = i.next();
752 a->setCheckable(
true);
753 a->setActionGroup(d_grp);
764 if (which < static_cast<unsigned int>(d_act.size()))
767 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
775 else if (avg == d_high)
777 else if (avg == d_medium)
779 else if (avg == d_low)
782 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(avg));
785 return d_act[
static_cast<int>(which)];
804 float value = str.toFloat();
809 QList<QAction*> d_act;
812 float d_off, d_high, d_medium, d_low;
838 d_act.push_back(
new QAction(
"None",
this));
839 d_act.push_back(
new QAction(
"Hamming",
this));
840 d_act.push_back(
new QAction(
"Hann",
this));
841 d_act.push_back(
new QAction(
"Blackman",
this));
842 d_act.push_back(
new QAction(
"Blackman-harris",
this));
843 d_act.push_back(
new QAction(
"Rectangular",
this));
844 d_act.push_back(
new QAction(
"Kaiser",
this));
845 d_act.push_back(
new QAction(
"Flat-top",
this));
847 d_grp =
new QActionGroup(
this);
848 for (
int t = 0; t < d_act.size(); t++) {
849 d_act[t]->setCheckable(
true);
850 d_act[t]->setActionGroup(d_grp);
853 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
854 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHamming()));
855 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getHann()));
856 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackman()));
858 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getRectangular()));
859 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getKaiser()));
860 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getFlattop()));
862 QListIterator<QAction*> i(d_act);
863 while (i.hasNext()) {
864 QAction* a = i.next();
875 if (which < static_cast<unsigned int>(d_act.size()))
878 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
884 switch (static_cast<int>(type)) {
930 QList<QAction*> d_act;
944 NPointsMenu(QWidget* parent) : QAction(
"Number of Points", parent)
946 d_diag =
new QDialog(parent);
947 d_diag->setWindowTitle(
"Number of Points");
948 d_diag->setModal(
true);
950 d_text =
new QLineEdit();
952 QGridLayout* layout =
new QGridLayout(d_diag);
953 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
954 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
956 layout->addWidget(d_text, 0, 0, 1, 2);
957 layout->addWidget(btn_ok, 1, 0);
958 layout->addWidget(btn_cancel, 1, 1);
960 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
961 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
963 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
972 void setDiagText(
const int npts) { d_text->setText(QString().setNum(npts)); }
998 : QMenu(
"Color Map", parent), d_which(which)
1000 d_grp =
new QActionGroup(
this);
1002 d_act.push_back(
new QAction(
"Multi-Color",
this));
1003 d_act.push_back(
new QAction(
"White Hot",
this));
1004 d_act.push_back(
new QAction(
"Black Hot",
this));
1005 d_act.push_back(
new QAction(
"Incandescent",
this));
1006 d_act.push_back(
new QAction(
"Sunset",
this));
1007 d_act.push_back(
new QAction(
"Cool",
this));
1008 d_act.push_back(
new QAction(
"Other",
this));
1012 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getMultiColor()));
1013 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1014 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1015 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getIncandescent()));
1016 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getSunset()));
1017 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getCool()));
1018 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getOther()));
1020 QListIterator<QAction*> i(d_act);
1021 while (i.hasNext()) {
1022 QAction* a = i.next();
1023 a->setCheckable(
true);
1024 a->setActionGroup(d_grp);
1028 d_max_value = QColor(
"white");
1029 d_min_value = QColor(
"white");
1038 if (which < static_cast<unsigned int>(d_act.size()))
1039 return d_act[which];
1041 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1047 const QColor& min_color = QColor(),
1048 const QColor& max_color = QColor());
1066 QMessageBox::information(
1068 "Set low and high intensities",
1069 "In the next windows, select the low and then the high intensity colors.",
1071 d_min_value = QColorDialog::getColor(d_min_value,
this);
1072 d_max_value = QColorDialog::getColor(d_max_value,
this);
1079 QActionGroup* d_grp;
1080 QList<QAction*> d_act;
1082 QColor d_max_value, d_min_value;
1097 d_grp =
new QActionGroup(
this);
1098 d_act.push_back(
new QAction(
"Free",
this));
1099 d_act.push_back(
new QAction(
"Auto",
this));
1100 d_act.push_back(
new QAction(
"Normal",
this));
1101 d_act.push_back(
new QAction(
"Tag",
this));
1103 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getFree()));
1104 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getAuto()));
1105 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNorm()));
1106 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getTag()));
1108 QListIterator<QAction*> i(d_act);
1109 while (i.hasNext()) {
1110 QAction* a = i.next();
1111 a->setCheckable(
true);
1112 a->setActionGroup(d_grp);
1123 if (which < static_cast<unsigned int>(d_act.size()))
1124 return d_act[which];
1126 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.\n");
1145 throw std::runtime_error(
1146 "TriggerModeMenu::getAction: unknown trigger mode.\n");
1160 QList<QAction*> d_act;
1161 QActionGroup* d_grp;
1175 d_grp =
new QActionGroup(
this);
1176 d_act.push_back(
new QAction(
"Positive",
this));
1177 d_act.push_back(
new QAction(
"Negative",
this));
1179 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getPos()));
1180 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getNeg()));
1182 QListIterator<QAction*> i(d_act);
1183 while (i.hasNext()) {
1184 QAction* a = i.next();
1185 a->setCheckable(
true);
1186 a->setActionGroup(d_grp);
1197 if (which < static_cast<unsigned int>(d_act.size()))
1198 return d_act[which];
1200 throw std::runtime_error(
1201 "TriggerSlopeMenu::getAction: which out of range.\n");
1214 throw std::runtime_error(
1215 "TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1227 QList<QAction*> d_act;
1228 QActionGroup* d_grp;
1242 d_grp =
new QActionGroup(
this);
1243 for (
int i = 0; i < nchans; i++) {
1244 d_act.push_back(
new QAction(QString().setNum(i),
this));
1245 d_act[i]->setCheckable(
true);
1246 d_act[i]->setActionGroup(d_grp);
1248 addAction(d_act[i]);
1249 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(
getChannel()));
1259 if (which < static_cast<unsigned int>(d_act.size()))
1260 return d_act[which];
1262 throw std::runtime_error(
1263 "TriggerChannelMenu::getAction: which out of range.\n");
1273 QAction* a = d_grp->checkedAction();
1274 int which = a->text().toInt();
1279 QList<QAction*> d_act;
1280 QActionGroup* d_grp;
1294 d_grp =
new QActionGroup(
this);
1295 d_act.push_back(
new QAction(
"Horizontal",
this));
1296 d_act.push_back(
new QAction(
"Vertical",
this));
1297 d_act.push_back(
new QAction(
"None",
this));
1299 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getHoriz()));
1300 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getVert()));
1301 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNone()));
1303 QListIterator<QAction*> i(d_act);
1304 while (i.hasNext()) {
1305 QAction* a = i.next();
1306 a->setCheckable(
true);
1307 a->setActionGroup(d_grp);
1318 if (which < static_cast<unsigned int>(d_act.size()))
1319 return d_act[which];
1321 throw std::runtime_error(
1322 "NumberLayoutMenu::getAction: which out of range.\n");
1338 throw std::runtime_error(
1339 "NumberLayoutMenu::getAction: unknown layout type.\n");
1352 QList<QAction*> d_act;
1353 QActionGroup* d_grp;
1366 : QMenu(
"Color Map", parent), d_which(which)
1368 d_grp =
new QActionGroup(
this);
1370 d_act.push_back(
new QAction(
"Black",
this));
1371 d_act.push_back(
new QAction(
"Blue-Red",
this));
1372 d_act.push_back(
new QAction(
"White Hot",
this));
1373 d_act.push_back(
new QAction(
"Black Hot",
this));
1374 d_act.push_back(
new QAction(
"Black-Red",
this));
1375 d_act.push_back(
new QAction(
"Other",
this));
1377 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1378 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getBlueRed()));
1379 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1380 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1381 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getBlackRed()));
1382 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getOther()));
1384 QListIterator<QAction*> i(d_act);
1385 while (i.hasNext()) {
1386 QAction* a = i.next();
1387 a->setCheckable(
true);
1388 a->setActionGroup(d_grp);
1392 d_max_value = QColor(
"black");
1393 d_min_value = QColor(
"black");
1402 if (which < static_cast<unsigned int>(d_act.size()))
1403 return d_act[which];
1405 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1410 whichTrigger(
unsigned int which,
const QColor& min_color,
const QColor& max_color);
1420 QMessageBox::information(
1422 "Set low and high intensities",
1423 "In the next windows, select the low and then the high intensity colors.",
1425 d_min_value = QColorDialog::getColor(d_min_value,
this);
1426 d_max_value = QColorDialog::getColor(d_max_value,
this);
1432 QActionGroup* d_grp;
1433 QList<QAction*> d_act;
1434 QColor d_max_value, d_min_value;
1447 PopupMenu(QString desc, QWidget* parent) : QAction(desc, parent)
1449 d_diag =
new QDialog(parent);
1450 d_diag->setWindowTitle(desc);
1451 d_diag->setModal(
true);
1453 d_text =
new QLineEdit();
1455 QGridLayout* layout =
new QGridLayout(d_diag);
1456 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1457 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1459 layout->addWidget(d_text, 0, 0, 1, 2);
1460 layout->addWidget(btn_ok, 1, 0);
1461 layout->addWidget(btn_cancel, 1, 1);
1463 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1464 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1466 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1501 : QAction(title, parent), d_which(which)
1503 d_diag =
new QDialog(parent);
1504 d_diag->setWindowTitle(title);
1505 d_diag->setModal(
true);
1507 d_text =
new QLineEdit();
1509 QGridLayout* layout =
new QGridLayout(d_diag);
1510 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1511 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1513 layout->addWidget(d_text, 0, 0, 1, 2);
1514 layout->addWidget(btn_ok, 1, 0);
1515 layout->addWidget(btn_cancel, 1, 1);
1517 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1518 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1520 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1525 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:1532
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:1500
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:1523
Definition: qtgui_types.h:142
Definition: trigger_mode.h:30
void whichTrigger(const QString &text0, const QString &text1)
Definition: qtgui_types.h:144
trigger_slope
Definition: trigger_mode.h:36
trigger_mode
Definition: trigger_mode.h:29
void whichTrigger(const QString &text)
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:1525
Definition: qtgui_types.h:141
Blackman-harris window.
Definition: firdes.h:52
Definition: trigger_mode.h:32
Definition: form_menus.h:1495
void getTextDiag()
Definition: form_menus.h:458
win_type
Definition: firdes.h:45
Definition: qtgui_types.h:131
void whichTrigger(unsigned int which, float data)
LineTitleAction(unsigned int which, QWidget *parent)
Definition: form_menus.h:430
void whichTrigger(unsigned int which, const QString &text)