14 #include <QtGui/QDoubleValidator>
15 #include <QtGui/QIntValidator>
16 #include <QtGui/QtGui>
20 #if QT_VERSION >= 0x050000
21 #include <QtWidgets/QtWidgets>
27 #include <qwt_symbol.h>
35 : QMenu(
"Line Color", parent), d_which(which)
37 d_grp =
new QActionGroup(
this);
39 d_act.push_back(
new QAction(
"Blue",
this));
40 d_act.push_back(
new QAction(
"Red",
this));
41 d_act.push_back(
new QAction(
"Green",
this));
42 d_act.push_back(
new QAction(
"Black",
this));
43 d_act.push_back(
new QAction(
"Cyan",
this));
44 d_act.push_back(
new QAction(
"Magenta",
this));
45 d_act.push_back(
new QAction(
"Yellow",
this));
46 d_act.push_back(
new QAction(
"Gray",
this));
47 d_act.push_back(
new QAction(
"Dark Red",
this));
48 d_act.push_back(
new QAction(
"Dark Green",
this));
49 d_act.push_back(
new QAction(
"Dark Blue",
this));
50 d_act.push_back(
new QAction(
"Dark Gray",
this));
52 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlue()));
53 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getRed()));
54 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getGreen()));
55 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlack()));
56 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getCyan()));
57 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getMagenta()));
58 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getYellow()));
59 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getGray()));
60 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getDarkRed()));
61 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getDarkGreen()));
62 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getDarkBlue()));
63 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getDarkGray()));
65 QListIterator<QAction*> i(d_act);
67 QAction* a = i.next();
68 a->setCheckable(
true);
69 a->setActionGroup(d_grp);
80 if (which <
static_cast<unsigned int>(d_act.size()))
83 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.");
105 QList<QAction*> d_act;
119 : QMenu(
"Line Width", parent), d_which(which)
121 d_grp =
new QActionGroup(
this);
123 d_act.push_back(
new QAction(
"1",
this));
124 d_act.push_back(
new QAction(
"2",
this));
125 d_act.push_back(
new QAction(
"3",
this));
126 d_act.push_back(
new QAction(
"4",
this));
127 d_act.push_back(
new QAction(
"5",
this));
128 d_act.push_back(
new QAction(
"6",
this));
129 d_act.push_back(
new QAction(
"7",
this));
130 d_act.push_back(
new QAction(
"8",
this));
131 d_act.push_back(
new QAction(
"9",
this));
132 d_act.push_back(
new QAction(
"10",
this));
134 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOne()));
135 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getTwo()));
136 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getThree()));
137 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getFour()));
138 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getFive()));
139 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getSix()));
140 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getSeven()));
141 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getEight()));
142 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getNine()));
143 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getTen()));
145 QListIterator<QAction*> i(d_act);
146 while (i.hasNext()) {
147 QAction* a = i.next();
148 a->setCheckable(
true);
149 a->setActionGroup(d_grp);
160 if (which <
static_cast<unsigned int>(d_act.size()))
163 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.");
183 QList<QAction*> d_act;
197 : QMenu(
"Line Style", parent), d_which(which)
199 d_grp =
new QActionGroup(
this);
201 d_act.push_back(
new QAction(
"None",
this));
202 d_act.push_back(
new QAction(
"Solid",
this));
203 d_act.push_back(
new QAction(
"Dash",
this));
204 d_act.push_back(
new QAction(
"Dots",
this));
205 d_act.push_back(
new QAction(
"Dash-Dot",
this));
206 d_act.push_back(
new QAction(
"Dash-Dot-Dot",
this));
208 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
209 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getSolid()));
210 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getDash()));
211 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDots()));
212 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getDashDot()));
213 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDashDotDot()));
215 QListIterator<QAction*> i(d_act);
216 while (i.hasNext()) {
217 QAction* a = i.next();
218 a->setCheckable(
true);
219 a->setActionGroup(d_grp);
230 if (which <
static_cast<unsigned int>(d_act.size()))
233 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.");
249 QList<QAction*> d_act;
263 : QMenu(
"Line Marker", parent), d_which(which)
265 d_grp =
new QActionGroup(
this);
267 d_act.push_back(
new QAction(
"None",
this));
268 d_act.push_back(
new QAction(
"Circle",
this));
269 d_act.push_back(
new QAction(
"Rectangle",
this));
270 d_act.push_back(
new QAction(
"Diamond",
this));
271 d_act.push_back(
new QAction(
"Triangle",
this));
272 d_act.push_back(
new QAction(
"Down Triangle",
this));
273 d_act.push_back(
new QAction(
"Left Triangle",
this));
274 d_act.push_back(
new QAction(
"Right Triangle",
this));
275 d_act.push_back(
new QAction(
"Cross",
this));
276 d_act.push_back(
new QAction(
"X-Cross",
this));
277 d_act.push_back(
new QAction(
"Horiz. Line",
this));
278 d_act.push_back(
new QAction(
"Vert. Line",
this));
279 d_act.push_back(
new QAction(
"Star 1",
this));
280 d_act.push_back(
new QAction(
"Star 2",
this));
281 d_act.push_back(
new QAction(
"Hexagon",
this));
283 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
284 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getCircle()));
285 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getRect()));
286 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDiamond()));
287 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getTriangle()));
288 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDTriangle()));
289 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getLTriangle()));
290 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getRTriangle()));
291 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getCross()));
292 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getXCross()));
293 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getHLine()));
294 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getVLine()));
295 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(
getStar1()));
296 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(
getStar2()));
297 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(
getHexagon()));
299 QListIterator<QAction*> i(d_act);
300 while (i.hasNext()) {
301 QAction* a = i.next();
302 a->setCheckable(
true);
303 a->setActionGroup(d_grp);
314 if (which <
static_cast<unsigned int>(d_act.size()))
317 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.");
342 QList<QAction*> d_act;
356 : QMenu(
"Line Transparency", parent), d_which(which)
358 d_grp =
new QActionGroup(
this);
360 d_act.push_back(
new QAction(
"None",
this));
361 d_act.push_back(
new QAction(
"Low",
this));
362 d_act.push_back(
new QAction(
"Medium",
this));
363 d_act.push_back(
new QAction(
"High",
this));
364 d_act.push_back(
new QAction(
"Off",
this));
366 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
367 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getLow()));
368 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
369 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getHigh()));
370 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getOff()));
372 QListIterator<QAction*> i(d_act);
373 while (i.hasNext()) {
374 QAction* a = i.next();
375 a->setCheckable(
true);
376 a->setActionGroup(d_grp);
387 if (which <
static_cast<unsigned int>(d_act.size()))
390 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.");
405 QList<QAction*> d_act;
419 : QAction(
"Line Title", parent), d_which(which)
421 d_diag =
new QDialog(parent);
422 d_diag->setModal(
true);
424 d_text =
new QLineEdit();
426 QGridLayout* layout =
new QGridLayout(d_diag);
427 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
428 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
430 layout->addWidget(d_text, 0, 0, 1, 2);
431 layout->addWidget(btn_ok, 1, 0);
432 layout->addWidget(btn_cancel, 1, 1);
434 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
435 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
437 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
473 d_diag =
new QDialog(parent);
474 d_diag->setWindowTitle(
"Other");
475 d_diag->setModal(
true);
477 d_text =
new QLineEdit();
479 QGridLayout* layout =
new QGridLayout(d_diag);
480 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
481 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
483 layout->addWidget(d_text, 0, 0, 1, 2);
484 layout->addWidget(btn_ok, 1, 0);
485 layout->addWidget(btn_cancel, 1, 1);
487 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
488 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
490 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
526 : QAction(
"Other", parent)
528 d_diag =
new QDialog(parent);
529 d_diag->setWindowTitle(
"Other");
530 d_diag->setModal(
true);
532 d_text0 =
new QLineEdit();
533 d_text1 =
new QLineEdit();
535 QLabel* _label0 =
new QLabel(label0);
536 QLabel* _label1 =
new QLabel(label1);
538 QGridLayout* layout =
new QGridLayout(d_diag);
539 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
540 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
542 layout->addWidget(_label0, 0, 0, 1, 2);
543 layout->addWidget(_label1, 1, 0, 1, 2);
545 layout->addWidget(d_text0, 0, 1, 1, 2);
546 layout->addWidget(d_text1, 1, 1, 1, 2);
547 layout->addWidget(btn_ok, 2, 0);
548 layout->addWidget(btn_cancel, 2, 1);
550 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
551 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
553 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
588 d_grp =
new QActionGroup(
this);
590 d_act.push_back(
new QAction(
"32",
this));
591 d_act.push_back(
new QAction(
"64",
this));
592 d_act.push_back(
new QAction(
"128",
this));
593 d_act.push_back(
new QAction(
"256",
this));
594 d_act.push_back(
new QAction(
"512",
this));
595 d_act.push_back(
new QAction(
"1024",
this));
596 d_act.push_back(
new QAction(
"2048",
this));
597 d_act.push_back(
new QAction(
"4096",
this));
603 d_grp =
new QActionGroup(
this);
604 for (
int t = 0; t < d_act.size(); t++) {
605 d_act[t]->setCheckable(
true);
606 d_act[t]->setActionGroup(d_grp);
609 QIntValidator* valid =
new QIntValidator(32, 4096,
this);
610 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
612 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
get05()));
613 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
get06()));
614 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
get07()));
615 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
get08()));
616 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
get09()));
617 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
get10()));
618 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
get11()));
619 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
get12()));
628 QListIterator<QAction*> i(d_act);
629 while (i.hasNext()) {
630 QAction* a = i.next();
631 a->setCheckable(
true);
632 a->setActionGroup(d_grp);
643 if (which <
static_cast<unsigned int>(d_act.size()))
646 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.");
652 float which = std::log(
static_cast<float>(size)) / std::log(2.0f) - 5;
654 if (std::modf(which, &ipt) == 0) {
655 if (which <
static_cast<unsigned int>(d_act.size()) - 1)
656 return d_act[
static_cast<int>(which)];
658 throw std::runtime_error(
659 "FFTSizeMenu::getActionFromString: which out of range.");
663 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(size));
664 return d_act[d_act.size() - 1];
685 int value = str.toInt();
690 QList<QAction*> d_act;
702 : QMenu(menuTitle.c_str(), parent)
704 d_grp =
new QActionGroup(
this);
711 d_act.push_back(
new QAction(
"Off",
this));
712 d_act.push_back(
new QAction(
"High",
this));
713 d_act.push_back(
new QAction(
"Medium",
this));
714 d_act.push_back(
new QAction(
"Low",
this));
717 d_grp =
new QActionGroup(
this);
718 for (
int t = 0; t < d_act.size(); t++) {
719 d_act[t]->setCheckable(
true);
720 d_act[t]->setActionGroup(d_grp);
722 d_act[0]->setChecked(
true);
724 QDoubleValidator* valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
725 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
727 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOff()));
728 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHigh()));
729 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
730 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getLow()));
736 QListIterator<QAction*> i(d_act);
737 while (i.hasNext()) {
738 QAction* a = i.next();
739 a->setCheckable(
true);
740 a->setActionGroup(d_grp);
751 if (which <
static_cast<unsigned int>(d_act.size()))
754 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.");
762 else if (avg == d_high)
764 else if (avg == d_medium)
766 else if (avg == d_low)
769 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(avg));
772 return d_act[
static_cast<int>(which)];
791 float value = str.toFloat();
796 QList<QAction*> d_act;
798 float d_off, d_high, d_medium, d_low;
824 d_act.push_back(
new QAction(
"None",
this));
825 d_act.push_back(
new QAction(
"Hamming",
this));
826 d_act.push_back(
new QAction(
"Hann",
this));
827 d_act.push_back(
new QAction(
"Blackman",
this));
828 d_act.push_back(
new QAction(
"Blackman-harris",
this));
829 d_act.push_back(
new QAction(
"Rectangular",
this));
830 d_act.push_back(
new QAction(
"Kaiser",
this));
831 d_act.push_back(
new QAction(
"Flat-top",
this));
833 d_grp =
new QActionGroup(
this);
834 for (
int t = 0; t < d_act.size(); t++) {
835 d_act[t]->setCheckable(
true);
836 d_act[t]->setActionGroup(d_grp);
839 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
840 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHamming()));
841 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getHann()));
842 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackman()));
844 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getRectangular()));
845 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getKaiser()));
846 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getFlattop()));
848 QListIterator<QAction*> i(d_act);
849 while (i.hasNext()) {
850 QAction* a = i.next();
861 if (which <
static_cast<unsigned int>(d_act.size()))
864 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.");
870 switch (
static_cast<int>(type)) {
913 QList<QAction*> d_act;
926 NPointsMenu(QWidget* parent) : QAction(
"Number of Points", parent)
928 d_diag =
new QDialog(parent);
929 d_diag->setWindowTitle(
"Number of Points");
930 d_diag->setModal(
true);
932 d_text =
new QLineEdit();
934 QGridLayout* layout =
new QGridLayout(d_diag);
935 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
936 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
938 layout->addWidget(d_text, 0, 0, 1, 2);
939 layout->addWidget(btn_ok, 1, 0);
940 layout->addWidget(btn_cancel, 1, 1);
942 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
943 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
945 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
954 void setDiagText(
const int npts) { d_text->setText(QString().setNum(npts)); }
980 : QMenu(
"Color Map", parent), d_which(which)
982 d_grp =
new QActionGroup(
this);
984 d_act.push_back(
new QAction(
"Multi-Color",
this));
985 d_act.push_back(
new QAction(
"White Hot",
this));
986 d_act.push_back(
new QAction(
"Black Hot",
this));
987 d_act.push_back(
new QAction(
"Incandescent",
this));
988 d_act.push_back(
new QAction(
"Sunset",
this));
989 d_act.push_back(
new QAction(
"Cool",
this));
990 d_act.push_back(
new QAction(
"Other",
this));
994 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getMultiColor()));
995 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
996 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
998 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getSunset()));
999 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getCool()));
1000 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getOther()));
1002 QListIterator<QAction*> i(d_act);
1003 while (i.hasNext()) {
1004 QAction* a = i.next();
1005 a->setCheckable(
true);
1006 a->setActionGroup(d_grp);
1010 d_max_value = QColor(
"white");
1011 d_min_value = QColor(
"white");
1020 if (which <
static_cast<unsigned int>(d_act.size()))
1021 return d_act[which];
1023 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.");
1029 const QColor& min_color = QColor(),
1030 const QColor& max_color = QColor());
1060 QMessageBox::information(
1062 "Set low and high intensities",
1063 "In the next windows, select the low and then the high intensity colors.",
1065 d_min_value = QColorDialog::getColor(d_min_value,
this);
1066 d_max_value = QColorDialog::getColor(d_max_value,
this);
1075 QActionGroup* d_grp;
1076 QList<QAction*> d_act;
1077 QColor d_max_value, d_min_value;
1092 d_grp =
new QActionGroup(
this);
1093 d_act.push_back(
new QAction(
"Free",
this));
1094 d_act.push_back(
new QAction(
"Auto",
this));
1095 d_act.push_back(
new QAction(
"Normal",
this));
1096 d_act.push_back(
new QAction(
"Tag",
this));
1098 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getFree()));
1099 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getAuto()));
1100 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNorm()));
1101 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getTag()));
1103 QListIterator<QAction*> i(d_act);
1104 while (i.hasNext()) {
1105 QAction* a = i.next();
1106 a->setCheckable(
true);
1107 a->setActionGroup(d_grp);
1118 if (which <
static_cast<unsigned int>(d_act.size()))
1119 return d_act[which];
1121 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.");
1140 throw std::runtime_error(
"TriggerModeMenu::getAction: unknown trigger mode.");
1154 QList<QAction*> d_act;
1155 QActionGroup* d_grp;
1169 d_grp =
new QActionGroup(
this);
1170 d_act.push_back(
new QAction(
"Positive",
this));
1171 d_act.push_back(
new QAction(
"Negative",
this));
1173 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getPos()));
1174 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getNeg()));
1176 QListIterator<QAction*> i(d_act);
1177 while (i.hasNext()) {
1178 QAction* a = i.next();
1179 a->setCheckable(
true);
1180 a->setActionGroup(d_grp);
1191 if (which <
static_cast<unsigned int>(d_act.size()))
1192 return d_act[which];
1194 throw std::runtime_error(
"TriggerSlopeMenu::getAction: which out of range.");
1207 throw std::runtime_error(
1208 "TriggerSlopeMenu::getAction: unknown trigger slope.");
1220 QList<QAction*> d_act;
1221 QActionGroup* d_grp;
1235 d_grp =
new QActionGroup(
this);
1236 for (
int i = 0; i < nchans; i++) {
1237 d_act.push_back(
new QAction(QString().setNum(i),
this));
1238 d_act[i]->setCheckable(
true);
1239 d_act[i]->setActionGroup(d_grp);
1241 addAction(d_act[i]);
1242 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(
getChannel()));
1252 if (which <
static_cast<unsigned int>(d_act.size()))
1253 return d_act[which];
1255 throw std::runtime_error(
1256 "TriggerChannelMenu::getAction: which out of range.");
1266 QAction* a = d_grp->checkedAction();
1267 int which = a->text().toInt();
1272 QList<QAction*> d_act;
1273 QActionGroup* d_grp;
1287 d_grp =
new QActionGroup(
this);
1288 d_act.push_back(
new QAction(
"Horizontal",
this));
1289 d_act.push_back(
new QAction(
"Vertical",
this));
1290 d_act.push_back(
new QAction(
"None",
this));
1292 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getHoriz()));
1293 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getVert()));
1294 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNone()));
1296 QListIterator<QAction*> i(d_act);
1297 while (i.hasNext()) {
1298 QAction* a = i.next();
1299 a->setCheckable(
true);
1300 a->setActionGroup(d_grp);
1311 if (which <
static_cast<unsigned int>(d_act.size()))
1312 return d_act[which];
1314 throw std::runtime_error(
"NumberLayoutMenu::getAction: which out of range.");
1330 throw std::runtime_error(
"NumberLayoutMenu::getAction: unknown layout type.");
1343 QList<QAction*> d_act;
1344 QActionGroup* d_grp;
1357 : QMenu(
"Color Map", parent), d_which(which)
1359 d_grp =
new QActionGroup(
this);
1361 d_act.push_back(
new QAction(
"Black",
this));
1362 d_act.push_back(
new QAction(
"Blue-Red",
this));
1363 d_act.push_back(
new QAction(
"White Hot",
this));
1364 d_act.push_back(
new QAction(
"Black Hot",
this));
1365 d_act.push_back(
new QAction(
"Black-Red",
this));
1366 d_act.push_back(
new QAction(
"Other",
this));
1368 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1369 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getBlueRed()));
1370 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1371 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1372 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getBlackRed()));
1373 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getOther()));
1375 QListIterator<QAction*> i(d_act);
1376 while (i.hasNext()) {
1377 QAction* a = i.next();
1378 a->setCheckable(
true);
1379 a->setActionGroup(d_grp);
1383 d_max_value = QColor(
"black");
1384 d_min_value = QColor(
"black");
1393 if (which <
static_cast<unsigned int>(d_act.size()))
1394 return d_act[which];
1396 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.");
1401 whichTrigger(
unsigned int which,
const QColor& min_color,
const QColor& max_color);
1411 QMessageBox::information(
1413 "Set low and high intensities",
1414 "In the next windows, select the low and then the high intensity colors.",
1416 d_min_value = QColorDialog::getColor(d_min_value,
this);
1417 d_max_value = QColorDialog::getColor(d_max_value,
this);
1423 QActionGroup* d_grp;
1424 QList<QAction*> d_act;
1425 QColor d_max_value, d_min_value;
1438 PopupMenu(QString desc, QWidget* parent) : QAction(desc, parent)
1440 d_diag =
new QDialog(parent);
1441 d_diag->setWindowTitle(desc);
1442 d_diag->setModal(
true);
1444 d_text =
new QLineEdit();
1446 QGridLayout* layout =
new QGridLayout(d_diag);
1447 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1448 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1450 layout->addWidget(d_text, 0, 0, 1, 2);
1451 layout->addWidget(btn_ok, 1, 0);
1452 layout->addWidget(btn_cancel, 1, 1);
1454 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1455 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1457 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1492 : QAction(title, parent), d_which(which)
1494 d_diag =
new QDialog(parent);
1495 d_diag->setWindowTitle(title);
1496 d_diag->setModal(
true);
1498 d_text =
new QLineEdit();
1500 QGridLayout* layout =
new QGridLayout(d_diag);
1501 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1502 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1504 layout->addWidget(d_text, 0, 0, 1, 2);
1505 layout->addWidget(btn_ok, 1, 0);
1506 layout->addWidget(btn_cancel, 1, 1);
1508 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1509 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1511 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1516 void setText(
float f) { d_text->setText(QString(
"%1").arg(f)); }
Definition: form_menus.h:1487
void whichTrigger(unsigned int which, float data)
~ItemFloatAct() override
Definition: form_menus.h:1514
void getTextDiag()
Definition: form_menus.h:1523
ItemFloatAct(unsigned int which, QString title, QWidget *parent)
Definition: form_menus.h:1491
void setText(float f)
Definition: form_menus.h:1516
Definition: form_menus.h:414
void getTextDiag()
Definition: form_menus.h:446
LineTitleAction(unsigned int which, QWidget *parent)
Definition: form_menus.h:418
void whichTrigger(unsigned int which, const QString &text)
~LineTitleAction() override
Definition: form_menus.h:440
Definition: form_menus.h:467
OtherAction(QWidget *parent)
Definition: form_menus.h:471
void setDiagText(QString text)
Definition: form_menus.h:497
void whichTrigger(const QString &text)
void getTextDiag()
Definition: form_menus.h:503
~OtherAction() override
Definition: form_menus.h:493
void setValidator(QValidator *v)
Definition: form_menus.h:495
Definition: form_menus.h:521
~OtherDualAction() override
Definition: form_menus.h:556
void whichTrigger(const QString &text0, const QString &text1)
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:525
void getTextDiag()
Definition: form_menus.h:562
win_type
Definition: window.h:25
@ WIN_HANN
Hann window; max attenuation 44 dB.
Definition: window.h:28
@ WIN_RECTANGULAR
Basic rectangular window; max attenuation 21 dB.
Definition: window.h:31
@ WIN_BLACKMAN_hARRIS
Blackman-harris window; max attenuation 92 dB.
Definition: window.h:33
@ WIN_KAISER
Kaiser window; max attenuation see window::max_attenuation.
Definition: window.h:32
@ WIN_NONE
don't use a window
Definition: window.h:26
@ WIN_BLACKMAN
Blackman window; max attenuation 74 dB.
Definition: window.h:30
@ WIN_FLATTOP
flat top window; useful in FFTs; max attenuation 93 dB
Definition: window.h:37
@ WIN_HAMMING
Hamming window; max attenuation 53 dB.
Definition: window.h:27
@ INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR
Definition: qtgui_types.h:125
@ INTENSITY_COLOR_MAP_TYPE_USER_DEFINED
Definition: qtgui_types.h:129
@ INTENSITY_COLOR_MAP_TYPE_WHITE_HOT
Definition: qtgui_types.h:126
@ INTENSITY_COLOR_MAP_TYPE_SUNSET
Definition: qtgui_types.h:130
@ INTENSITY_COLOR_MAP_TYPE_COOL
Definition: qtgui_types.h:131
@ INTENSITY_COLOR_MAP_TYPE_BLACK_HOT
Definition: qtgui_types.h:127
@ INTENSITY_COLOR_MAP_TYPE_INCANDESCENT
Definition: qtgui_types.h:128
trigger_mode
Definition: trigger_mode.h:17
@ TRIG_MODE_FREE
Definition: trigger_mode.h:18
@ TRIG_MODE_NORM
Definition: trigger_mode.h:20
@ TRIG_MODE_AUTO
Definition: trigger_mode.h:19
@ TRIG_MODE_TAG
Definition: trigger_mode.h:21
trigger_slope
Definition: trigger_mode.h:24
@ TRIG_SLOPE_NEG
Definition: trigger_mode.h:26
@ TRIG_SLOPE_POS
Definition: trigger_mode.h:25
graph_t
Definition: qtgui_types.h:118
@ NUM_GRAPH_VERT
Definition: qtgui_types.h:121
@ NUM_GRAPH_NONE
Definition: qtgui_types.h:119
@ NUM_GRAPH_HORIZ
Definition: qtgui_types.h:120
Definition: cc_common.h:35