28 #include <QtGui/QtGui> 29 #include <QtGui/QIntValidator> 30 #include <QtGui/QDoubleValidator> 32 #if QT_VERSION >= 0x050000 33 #include <QtWidgets/QtWidgets> 36 #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);
96 if(which < d_act.size())
99 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.\n");
121 QList<QAction *> d_act;
135 : QMenu(
"Line Width", parent), d_which(which)
137 d_grp =
new QActionGroup(
this);
139 d_act.push_back(
new QAction(
"1",
this));
140 d_act.push_back(
new QAction(
"2",
this));
141 d_act.push_back(
new QAction(
"3",
this));
142 d_act.push_back(
new QAction(
"4",
this));
143 d_act.push_back(
new QAction(
"5",
this));
144 d_act.push_back(
new QAction(
"6",
this));
145 d_act.push_back(
new QAction(
"7",
this));
146 d_act.push_back(
new QAction(
"8",
this));
147 d_act.push_back(
new QAction(
"9",
this));
148 d_act.push_back(
new QAction(
"10",
this));
150 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getOne()));
151 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getTwo()));
152 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getThree()));
153 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getFour()));
154 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getFive()));
155 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getSix()));
156 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getSeven()));
157 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getEight()));
158 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(getNine()));
159 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(getTen()));
161 QListIterator<QAction*> i(d_act);
163 QAction *a = i.next();
164 a->setCheckable(
true);
165 a->setActionGroup(d_grp);
180 if(which < d_act.size())
183 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.\n");
203 QList<QAction *> d_act;
217 : QMenu(
"Line Style", parent), d_which(which)
219 d_grp =
new QActionGroup(
this);
221 d_act.push_back(
new QAction(
"None",
this));
222 d_act.push_back(
new QAction(
"Solid",
this));
223 d_act.push_back(
new QAction(
"Dash",
this));
224 d_act.push_back(
new QAction(
"Dots",
this));
225 d_act.push_back(
new QAction(
"Dash-Dot",
this));
226 d_act.push_back(
new QAction(
"Dash-Dot-Dot",
this));
228 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
229 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getSolid()));
230 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getDash()));
231 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getDots()));
232 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getDashDot()));
233 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getDashDotDot()));
235 QListIterator<QAction*> i(d_act);
237 QAction *a = i.next();
238 a->setCheckable(
true);
239 a->setActionGroup(d_grp);
254 if(which < d_act.size())
257 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.\n");
273 QList<QAction *> d_act;
287 : QMenu(
"Line Marker", parent), d_which(which)
289 d_grp =
new QActionGroup(
this);
291 d_act.push_back(
new QAction(
"None",
this));
292 d_act.push_back(
new QAction(
"Circle",
this));
293 d_act.push_back(
new QAction(
"Rectangle",
this));
294 d_act.push_back(
new QAction(
"Diamond",
this));
295 d_act.push_back(
new QAction(
"Triangle",
this));
296 d_act.push_back(
new QAction(
"Down Triangle",
this));
297 d_act.push_back(
new QAction(
"Left Triangle",
this));
298 d_act.push_back(
new QAction(
"Right Triangle",
this));
299 d_act.push_back(
new QAction(
"Cross",
this));
300 d_act.push_back(
new QAction(
"X-Cross",
this));
301 d_act.push_back(
new QAction(
"Horiz. Line",
this));
302 d_act.push_back(
new QAction(
"Vert. Line",
this));
303 d_act.push_back(
new QAction(
"Star 1",
this));
304 d_act.push_back(
new QAction(
"Star 2",
this));
305 d_act.push_back(
new QAction(
"Hexagon",
this));
307 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
308 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getCircle()));
309 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getRect()));
310 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getDiamond()));
311 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getTriangle()));
312 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getDTriangle()));
313 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getLTriangle()));
314 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getRTriangle()));
315 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(getCross()));
316 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(getXCross()));
317 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(getHLine()));
318 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(getVLine()));
319 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(getStar1()));
320 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(getStar2()));
321 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(getHexagon()));
323 QListIterator<QAction*> i(d_act);
325 QAction *a = i.next();
326 a->setCheckable(
true);
327 a->setActionGroup(d_grp);
342 if(which < d_act.size())
345 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.\n");
370 QList<QAction *> d_act;
384 : QMenu(
"Line Transparency", parent), d_which(which)
386 d_grp =
new QActionGroup(
this);
388 d_act.push_back(
new QAction(
"None",
this));
389 d_act.push_back(
new QAction(
"Low",
this));
390 d_act.push_back(
new QAction(
"Medium",
this));
391 d_act.push_back(
new QAction(
"High",
this));
392 d_act.push_back(
new QAction(
"Off",
this));
394 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
395 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getLow()));
396 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getMedium()));
397 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getHigh()));
398 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getOff()));
400 QListIterator<QAction*> i(d_act);
402 QAction *a = i.next();
403 a->setCheckable(
true);
404 a->setActionGroup(d_grp);
419 if(which < d_act.size())
422 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.\n");
437 QList<QAction *> d_act;
451 : QAction(
"Line Title", parent), d_which(which)
453 d_diag =
new QDialog(parent);
454 d_diag->setModal(
true);
456 d_text =
new QLineEdit();
458 QGridLayout *layout =
new QGridLayout(d_diag);
459 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
460 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
462 layout->addWidget(d_text, 0, 0, 1, 2);
463 layout->addWidget(btn_ok, 1, 0);
464 layout->addWidget(btn_cancel, 1, 1);
466 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
467 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
469 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
508 : QAction(
"Other", parent)
510 d_diag =
new QDialog(parent);
511 d_diag->setWindowTitle(
"Other");
512 d_diag->setModal(
true);
514 d_text =
new QLineEdit();
516 QGridLayout *layout =
new QGridLayout(d_diag);
517 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
518 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
520 layout->addWidget(d_text, 0, 0, 1, 2);
521 layout->addWidget(btn_ok, 1, 0);
522 layout->addWidget(btn_cancel, 1, 1);
524 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
525 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
527 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
535 d_text->setValidator(v);
540 d_text->setText(text);
573 : QAction(
"Other", parent)
575 d_diag =
new QDialog(parent);
576 d_diag->setWindowTitle(
"Other");
577 d_diag->setModal(
true);
579 d_text0 =
new QLineEdit();
580 d_text1 =
new QLineEdit();
582 QLabel *_label0 =
new QLabel(label0);
583 QLabel *_label1 =
new QLabel(label1);
585 QGridLayout *layout =
new QGridLayout(d_diag);
586 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
587 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
589 layout->addWidget(_label0, 0, 0, 1, 2);
590 layout->addWidget(_label1, 1, 0, 1, 2);
592 layout->addWidget(d_text0, 0, 1, 1, 2);
593 layout->addWidget(d_text1, 1, 1, 1, 2);
594 layout->addWidget(btn_ok, 2, 0);
595 layout->addWidget(btn_cancel, 2, 1);
597 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
598 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
600 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
607 void whichTrigger(
const QString &text0,
const QString &text1);
638 : QMenu(
"FFT Size", parent)
640 d_grp =
new QActionGroup(
this);
642 d_act.push_back(
new QAction(
"32",
this));
643 d_act.push_back(
new QAction(
"64",
this));
644 d_act.push_back(
new QAction(
"128",
this));
645 d_act.push_back(
new QAction(
"256",
this));
646 d_act.push_back(
new QAction(
"512",
this));
647 d_act.push_back(
new QAction(
"1024",
this));
648 d_act.push_back(
new QAction(
"2048",
this));
649 d_act.push_back(
new QAction(
"4096",
this));
655 d_grp =
new QActionGroup(
this);
656 for(
int t = 0; t < d_act.size(); t++) {
657 d_act[t]->setCheckable(
true);
658 d_act[t]->setActionGroup(d_grp);
661 QIntValidator *valid =
new QIntValidator(32, 4096,
this);
662 ((
OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
664 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(get05()));
665 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(get06()));
666 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(get07()));
667 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(get08()));
668 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(get09()));
669 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(get10()));
670 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(get11()));
671 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(get12()));
676 this, SLOT(getOther(
const QString&)));
678 QListIterator<QAction*> i(d_act);
680 QAction *a = i.next();
681 a->setCheckable(
true);
682 a->setActionGroup(d_grp);
697 if(which < d_act.size())
700 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
706 float which = std::log(static_cast<float>(size))/std::log(2.0f) - 5;
708 if(std::modf(which,&ipt) == 0) {
709 if(which < d_act.size()-1)
710 return d_act[static_cast<int>(which)];
712 throw std::runtime_error(
"FFTSizeMenu::getActionFromString: which out of range.\n");
716 ((
OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(size));
717 return d_act[d_act.size()-1];
738 int value = str.toInt();
743 QList<QAction *> d_act;
756 : QMenu(menuTitle.c_str(), parent)
758 d_grp =
new QActionGroup(
this);
765 d_act.push_back(
new QAction(
"Off",
this));
766 d_act.push_back(
new QAction(
"High",
this));
767 d_act.push_back(
new QAction(
"Medium",
this));
768 d_act.push_back(
new QAction(
"Low",
this));
771 d_grp =
new QActionGroup(
this);
772 for(
int t = 0; t < d_act.size(); t++) {
773 d_act[t]->setCheckable(
true);
774 d_act[t]->setActionGroup(d_grp);
776 d_act[0]->setChecked(
true);
778 QDoubleValidator *valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
779 ((
OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
781 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getOff()));
782 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getHigh()));
783 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getMedium()));
784 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getLow()));
786 this, SLOT(getOther(
const QString&)));
788 QListIterator<QAction*> i(d_act);
790 QAction *a = i.next();
791 a->setCheckable(
true);
792 a->setActionGroup(d_grp);
807 if(which < d_act.size())
810 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
818 else if(avg == d_high)
820 else if(avg == d_medium)
822 else if(avg == d_low)
825 ((
OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(avg));
828 return d_act[
static_cast<int>(which)];
856 float value = str.toFloat();
861 QList<QAction *> d_act;
864 float d_off, d_high, d_medium, d_low;
889 : QMenu(
"FFT Window", parent)
891 d_act.push_back(
new QAction(
"None",
this));
892 d_act.push_back(
new QAction(
"Hamming",
this));
893 d_act.push_back(
new QAction(
"Hann",
this));
894 d_act.push_back(
new QAction(
"Blackman",
this));
895 d_act.push_back(
new QAction(
"Blackman-harris",
this));
896 d_act.push_back(
new QAction(
"Rectangular",
this));
897 d_act.push_back(
new QAction(
"Kaiser",
this));
898 d_act.push_back(
new QAction(
"Flat-top",
this));
900 d_grp =
new QActionGroup(
this);
901 for(
int t = 0; t < d_act.size(); t++) {
902 d_act[t]->setCheckable(
true);
903 d_act[t]->setActionGroup(d_grp);
906 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getNone()));
907 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getHamming()));
908 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getHann()));
909 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getBlackman()));
910 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getBlackmanharris()));
911 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getRectangular()));
912 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getKaiser()));
913 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(getFlattop()));
915 QListIterator<QAction*> i(d_act);
917 QAction *a = i.next();
932 if(which < d_act.size())
935 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
941 switch(static_cast<int>(type)) {
968 QList<QAction *> d_act;
983 : QAction(
"Number of Points", parent)
985 d_diag =
new QDialog(parent);
986 d_diag->setWindowTitle(
"Number of Points");
987 d_diag->setModal(
true);
989 d_text =
new QLineEdit();
991 QGridLayout *layout =
new QGridLayout(d_diag);
992 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
993 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
995 layout->addWidget(d_text, 0, 0, 1, 2);
996 layout->addWidget(btn_ok, 1, 0);
997 layout->addWidget(btn_cancel, 1, 1);
999 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1000 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1002 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
1014 d_text->setText(QString().setNum(npts));
1044 : QMenu(
"Color Map", parent), d_which(which)
1046 d_grp =
new QActionGroup(
this);
1048 d_act.push_back(
new QAction(
"Multi-Color",
this));
1049 d_act.push_back(
new QAction(
"White Hot",
this));
1050 d_act.push_back(
new QAction(
"Black Hot",
this));
1051 d_act.push_back(
new QAction(
"Incandescent",
this));
1052 d_act.push_back(
new QAction(
"Sunset",
this));
1053 d_act.push_back(
new QAction(
"Cool",
this));
1054 d_act.push_back(
new QAction(
"Other",
this));
1057 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getMultiColor()));
1058 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getWhiteHot()));
1059 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getBlackHot()));
1060 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getIncandescent()));
1061 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getSunset()));
1062 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getCool()));
1063 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(getOther()));
1065 QListIterator<QAction*> i(d_act);
1066 while(i.hasNext()) {
1067 QAction *a = i.next();
1068 a->setCheckable(
true);
1069 a->setActionGroup(d_grp);
1073 d_max_value = QColor(
"white");
1074 d_min_value = QColor(
"white");
1082 return d_act.size();
1087 if(which < d_act.size())
1088 return d_act[which];
1090 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1095 const QColor &min_color=QColor(),
1096 const QColor &max_color=QColor());
1108 QMessageBox::information(
this,
"Set low and high intensities",
1109 "In the next windows, select the low and then the high intensity colors.",
1111 d_min_value = QColorDialog::getColor(d_min_value,
this);
1112 d_max_value = QColorDialog::getColor(d_max_value,
this);
1115 d_min_value, d_max_value);
1119 QActionGroup *d_grp;
1120 QList<QAction *> d_act;
1122 QColor d_max_value, d_min_value;
1136 : QMenu(
"Mode", parent)
1138 d_grp =
new QActionGroup(
this);
1139 d_act.push_back(
new QAction(
"Free",
this));
1140 d_act.push_back(
new QAction(
"Auto",
this));
1141 d_act.push_back(
new QAction(
"Normal",
this));
1142 d_act.push_back(
new QAction(
"Tag",
this));
1144 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getFree()));
1145 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getAuto()));
1146 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getNorm()));
1147 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getTag()));
1149 QListIterator<QAction*> i(d_act);
1150 while(i.hasNext()) {
1151 QAction *a = i.next();
1152 a->setCheckable(
true);
1153 a->setActionGroup(d_grp);
1163 return d_act.size();
1168 if(which < d_act.size())
1169 return d_act[which];
1171 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.\n");
1190 throw std::runtime_error(
"TriggerModeMenu::getAction: unknown trigger mode.\n");
1204 QList<QAction *> d_act;
1205 QActionGroup *d_grp;
1218 : QMenu(
"Slope", parent)
1220 d_grp =
new QActionGroup(
this);
1221 d_act.push_back(
new QAction(
"Positive",
this));
1222 d_act.push_back(
new QAction(
"Negative",
this));
1224 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getPos()));
1225 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getNeg()));
1227 QListIterator<QAction*> i(d_act);
1228 while(i.hasNext()) {
1229 QAction *a = i.next();
1230 a->setCheckable(
true);
1231 a->setActionGroup(d_grp);
1241 return d_act.size();
1246 if(which < d_act.size())
1247 return d_act[which];
1249 throw std::runtime_error(
"TriggerSlopeMenu::getAction: which out of range.\n");
1262 throw std::runtime_error(
"TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1274 QList<QAction *> d_act;
1275 QActionGroup *d_grp;
1288 : QMenu(
"Channel", parent)
1290 d_grp =
new QActionGroup(
this);
1291 for(
int i = 0; i < nchans; i++) {
1292 d_act.push_back(
new QAction(QString().setNum(i),
this));
1293 d_act[i]->setCheckable(
true);
1294 d_act[i]->setActionGroup(d_grp);
1296 addAction(d_act[i]);
1297 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(getChannel()));
1306 return d_act.size();
1311 if(which < d_act.size())
1312 return d_act[which];
1314 throw std::runtime_error(
"TriggerChannelMenu::getAction: which out of range.\n");
1324 QAction *a = d_grp->checkedAction();
1325 int which = a->text().toInt();
1330 QList<QAction *> d_act;
1331 QActionGroup *d_grp;
1344 : QMenu(
"Layout", parent)
1346 d_grp =
new QActionGroup(
this);
1347 d_act.push_back(
new QAction(
"Horizontal",
this));
1348 d_act.push_back(
new QAction(
"Vertical",
this));
1349 d_act.push_back(
new QAction(
"None",
this));
1351 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(getHoriz()));
1352 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getVert()));
1353 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getNone()));
1355 QListIterator<QAction*> i(d_act);
1356 while(i.hasNext()) {
1357 QAction *a = i.next();
1358 a->setCheckable(
true);
1359 a->setActionGroup(d_grp);
1369 return d_act.size();
1374 if(which < d_act.size())
1375 return d_act[which];
1377 throw std::runtime_error(
"NumberLayoutMenu::getAction: which out of range.\n");
1393 throw std::runtime_error(
"NumberLayoutMenu::getAction: unknown layout type.\n");
1406 QList<QAction *> d_act;
1407 QActionGroup *d_grp;
1420 : QMenu(
"Color Map", parent), d_which(which)
1422 d_grp =
new QActionGroup(
this);
1424 d_act.push_back(
new QAction(
"Black",
this));
1425 d_act.push_back(
new QAction(
"Blue-Red",
this));
1426 d_act.push_back(
new QAction(
"White Hot",
this));
1427 d_act.push_back(
new QAction(
"Black Hot",
this));
1428 d_act.push_back(
new QAction(
"Black-Red",
this));
1429 d_act.push_back(
new QAction(
"Other",
this));
1431 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1432 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(getBlueRed()));
1433 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(getWhiteHot()));
1434 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(getBlackHot()));
1435 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(getBlackRed()));
1436 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(getOther()));
1438 QListIterator<QAction*> i(d_act);
1439 while(i.hasNext()) {
1440 QAction *a = i.next();
1441 a->setCheckable(
true);
1442 a->setActionGroup(d_grp);
1446 d_max_value = QColor(
"black");
1447 d_min_value = QColor(
"black");
1455 return d_act.size();
1460 if(which < d_act.size())
1461 return d_act[which];
1463 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1468 const QColor &min_color,
1469 const QColor &max_color);
1479 QMessageBox::information(
this,
"Set low and high intensities",
1480 "In the next windows, select the low and then the high intensity colors.",
1482 d_min_value = QColorDialog::getColor(d_min_value,
this);
1483 d_max_value = QColorDialog::getColor(d_max_value,
this);
1489 QActionGroup *d_grp;
1490 QList<QAction *> d_act;
1491 QColor d_max_value, d_min_value;
1505 : QAction(desc, parent)
1507 d_diag =
new QDialog(parent);
1508 d_diag->setWindowTitle(desc);
1509 d_diag->setModal(
true);
1511 d_text =
new QLineEdit();
1513 QGridLayout *layout =
new QGridLayout(d_diag);
1514 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
1515 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
1517 layout->addWidget(d_text, 0, 0, 1, 2);
1518 layout->addWidget(btn_ok, 1, 0);
1519 layout->addWidget(btn_cancel, 1, 1);
1521 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1522 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1524 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
1566 : QAction(title, parent), d_which(which)
1568 d_diag =
new QDialog(parent);
1569 d_diag->setWindowTitle(title);
1570 d_diag->setModal(
true);
1572 d_text =
new QLineEdit();
1574 QGridLayout *layout =
new QGridLayout(d_diag);
1575 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
1576 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
1578 layout->addWidget(d_text, 0, 0, 1, 2);
1579 layout->addWidget(btn_ok, 1, 0);
1580 layout->addWidget(btn_cancel, 1, 1);
1582 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1583 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1585 connect(
this, SIGNAL(triggered()),
this, SLOT(getTextDiag()));
1593 d_text->setText(QString(
"%1").arg(f));
OtherAction(QWidget *parent)
Definition: form_menus.h:507
Definition: qtgui_types.h:162
Definition: gr-qtgui/include/gnuradio/qtgui/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:530
void getTextDiag()
Definition: form_menus.h:610
void getTextDiag()
Definition: form_menus.h:1601
Definition: qtgui_types.h:176
Definition: form_menus.h:445
Basic rectangular window.
Definition: firdes.h:50
~LineTitleAction()
Definition: form_menus.h:472
Definition: form_menus.h:502
Definition: qtgui_types.h:173
void setValidator(QValidator *v)
Definition: form_menus.h:533
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:37
Kaiser window; max attenuation a function of beta, google it.
Definition: firdes.h:51
graph_t
Definition: qtgui_types.h:160
Definition: form_menus.h:567
void getTextDiag()
Definition: form_menus.h:547
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:31
Definition: cc_common.h:45
Definition: qtgui_types.h:175
don't use a window
Definition: firdes.h:46
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:572
Definition: qtgui_types.h:177
void setDiagText(QString text)
Definition: form_menus.h:538
flat top window; useful in FFTs
Definition: firdes.h:55
~ItemFloatAct()
Definition: form_menus.h:1588
Definition: qtgui_types.h:172
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:30
Definition: qtgui_types.h:174
trigger_slope
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:36
trigger_mode
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:29
ItemFloatAct(int which, QString title, QWidget *parent)
Definition: form_menus.h:1565
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:33
Definition: qtgui_types.h:163
Blackman window; max attenuation 74 dB.
Definition: firdes.h:49
~OtherDualAction()
Definition: form_menus.h:603
LineTitleAction(int which, QWidget *parent)
Definition: form_menus.h:450
void setText(float f)
Definition: form_menus.h:1591
Definition: qtgui_types.h:171
Blackman-harris window.
Definition: firdes.h:52
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:32
Definition: form_menus.h:1560
void getTextDiag()
Definition: form_menus.h:479
win_type
Definition: firdes.h:45
Definition: qtgui_types.h:161