29#include <QtGui/QDoubleValidator>
30#include <QtGui/QIntValidator>
32#include <qwt_symbol.h>
42 : QMenu(
"Line Color", parent), d_which(which)
44 d_grp =
new QActionGroup(
this);
46 d_act.push_back(
new QAction(
"Blue",
this));
47 d_act.push_back(
new QAction(
"Red",
this));
48 d_act.push_back(
new QAction(
"Green",
this));
49 d_act.push_back(
new QAction(
"Black",
this));
50 d_act.push_back(
new QAction(
"Cyan",
this));
51 d_act.push_back(
new QAction(
"Magenta",
this));
52 d_act.push_back(
new QAction(
"Yellow",
this));
53 d_act.push_back(
new QAction(
"Gray",
this));
54 d_act.push_back(
new QAction(
"Dark Red",
this));
55 d_act.push_back(
new QAction(
"Dark Green",
this));
56 d_act.push_back(
new QAction(
"Dark Blue",
this));
57 d_act.push_back(
new QAction(
"Dark Gray",
this));
59 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlue()));
60 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getRed()));
61 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getGreen()));
62 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlack()));
63 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getCyan()));
64 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getMagenta()));
65 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getYellow()));
66 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getGray()));
67 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getDarkRed()));
68 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getDarkGreen()));
69 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getDarkBlue()));
70 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getDarkGray()));
72 QListIterator<QAction*> i(d_act);
74 QAction* a = i.next();
75 a->setCheckable(
true);
76 a->setActionGroup(d_grp);
87 if (which < d_act.size())
90 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.\n");
112 QList<QAction*> d_act;
126 : QMenu(
"Line Width", parent), d_which(which)
128 d_grp =
new QActionGroup(
this);
130 d_act.push_back(
new QAction(
"1",
this));
131 d_act.push_back(
new QAction(
"2",
this));
132 d_act.push_back(
new QAction(
"3",
this));
133 d_act.push_back(
new QAction(
"4",
this));
134 d_act.push_back(
new QAction(
"5",
this));
135 d_act.push_back(
new QAction(
"6",
this));
136 d_act.push_back(
new QAction(
"7",
this));
137 d_act.push_back(
new QAction(
"8",
this));
138 d_act.push_back(
new QAction(
"9",
this));
139 d_act.push_back(
new QAction(
"10",
this));
141 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOne()));
142 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getTwo()));
143 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getThree()));
144 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getFour()));
145 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getFive()));
146 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getSix()));
147 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getSeven()));
148 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getEight()));
149 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getNine()));
150 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getTen()));
152 QListIterator<QAction*> i(d_act);
153 while (i.hasNext()) {
154 QAction* a = i.next();
155 a->setCheckable(
true);
156 a->setActionGroup(d_grp);
167 if (which < d_act.size())
170 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.\n");
190 QList<QAction*> d_act;
204 : QMenu(
"Line Style", parent), d_which(which)
206 d_grp =
new QActionGroup(
this);
208 d_act.push_back(
new QAction(
"None",
this));
209 d_act.push_back(
new QAction(
"Solid",
this));
210 d_act.push_back(
new QAction(
"Dash",
this));
211 d_act.push_back(
new QAction(
"Dots",
this));
212 d_act.push_back(
new QAction(
"Dash-Dot",
this));
213 d_act.push_back(
new QAction(
"Dash-Dot-Dot",
this));
215 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
216 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getSolid()));
217 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getDash()));
218 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDots()));
219 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getDashDot()));
220 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDashDotDot()));
222 QListIterator<QAction*> i(d_act);
223 while (i.hasNext()) {
224 QAction* a = i.next();
225 a->setCheckable(
true);
226 a->setActionGroup(d_grp);
237 if (which < d_act.size())
240 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.\n");
256 QList<QAction*> d_act;
270 : QMenu(
"Line Marker", parent), d_which(which)
272 d_grp =
new QActionGroup(
this);
274 d_act.push_back(
new QAction(
"None",
this));
275 d_act.push_back(
new QAction(
"Circle",
this));
276 d_act.push_back(
new QAction(
"Rectangle",
this));
277 d_act.push_back(
new QAction(
"Diamond",
this));
278 d_act.push_back(
new QAction(
"Triangle",
this));
279 d_act.push_back(
new QAction(
"Down Triangle",
this));
280 d_act.push_back(
new QAction(
"Left Triangle",
this));
281 d_act.push_back(
new QAction(
"Right Triangle",
this));
282 d_act.push_back(
new QAction(
"Cross",
this));
283 d_act.push_back(
new QAction(
"X-Cross",
this));
284 d_act.push_back(
new QAction(
"Horiz. Line",
this));
285 d_act.push_back(
new QAction(
"Vert. Line",
this));
286 d_act.push_back(
new QAction(
"Star 1",
this));
287 d_act.push_back(
new QAction(
"Star 2",
this));
288 d_act.push_back(
new QAction(
"Hexagon",
this));
290 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
291 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getCircle()));
292 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getRect()));
293 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDiamond()));
294 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getTriangle()));
295 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDTriangle()));
296 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getLTriangle()));
297 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getRTriangle()));
298 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getCross()));
299 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getXCross()));
300 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getHLine()));
301 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getVLine()));
302 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(
getStar1()));
303 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(
getStar2()));
304 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(
getHexagon()));
306 QListIterator<QAction*> i(d_act);
307 while (i.hasNext()) {
308 QAction* a = i.next();
309 a->setCheckable(
true);
310 a->setActionGroup(d_grp);
321 if (which < d_act.size())
324 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.\n");
349 QList<QAction*> d_act;
363 : QMenu(
"Line Transparency", parent), d_which(which)
365 d_grp =
new QActionGroup(
this);
367 d_act.push_back(
new QAction(
"None",
this));
368 d_act.push_back(
new QAction(
"Low",
this));
369 d_act.push_back(
new QAction(
"Medium",
this));
370 d_act.push_back(
new QAction(
"High",
this));
371 d_act.push_back(
new QAction(
"Off",
this));
373 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
374 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getLow()));
375 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
376 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getHigh()));
377 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getOff()));
379 QListIterator<QAction*> i(d_act);
380 while (i.hasNext()) {
381 QAction* a = i.next();
382 a->setCheckable(
true);
383 a->setActionGroup(d_grp);
394 if (which < d_act.size())
397 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.\n");
412 QList<QAction*> d_act;
426 : QAction(
"Line Title", parent), d_which(which)
428 d_diag =
new QDialog(parent);
429 d_diag->setModal(
true);
431 d_text =
new QLineEdit();
433 QGridLayout* layout =
new QGridLayout(d_diag);
434 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
435 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
437 layout->addWidget(d_text, 0, 0, 1, 2);
438 layout->addWidget(btn_ok, 1, 0);
439 layout->addWidget(btn_cancel, 1, 1);
441 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
442 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
444 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
480 d_diag =
new QDialog(parent);
481 d_diag->setWindowTitle(
"Other");
482 d_diag->setModal(
true);
484 d_text =
new QLineEdit();
486 QGridLayout* layout =
new QGridLayout(d_diag);
487 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
488 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
490 layout->addWidget(d_text, 0, 0, 1, 2);
491 layout->addWidget(btn_ok, 1, 0);
492 layout->addWidget(btn_cancel, 1, 1);
494 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
495 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
497 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
533 : QAction(
"Other", parent)
535 d_diag =
new QDialog(parent);
536 d_diag->setWindowTitle(
"Other");
537 d_diag->setModal(
true);
539 d_text0 =
new QLineEdit();
540 d_text1 =
new QLineEdit();
542 QLabel* _label0 =
new QLabel(label0);
543 QLabel* _label1 =
new QLabel(label1);
545 QGridLayout* layout =
new QGridLayout(d_diag);
546 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
547 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
549 layout->addWidget(_label0, 0, 0, 1, 2);
550 layout->addWidget(_label1, 1, 0, 1, 2);
552 layout->addWidget(d_text0, 0, 1, 1, 2);
553 layout->addWidget(d_text1, 1, 1, 1, 2);
554 layout->addWidget(btn_ok, 2, 0);
555 layout->addWidget(btn_cancel, 2, 1);
557 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
558 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
560 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
595 d_grp =
new QActionGroup(
this);
597 d_act.push_back(
new QAction(
"32",
this));
598 d_act.push_back(
new QAction(
"64",
this));
599 d_act.push_back(
new QAction(
"128",
this));
600 d_act.push_back(
new QAction(
"256",
this));
601 d_act.push_back(
new QAction(
"512",
this));
602 d_act.push_back(
new QAction(
"1024",
this));
603 d_act.push_back(
new QAction(
"2048",
this));
604 d_act.push_back(
new QAction(
"4096",
this));
610 d_grp =
new QActionGroup(
this);
611 for (
int t = 0; t < d_act.size(); t++) {
612 d_act[t]->setCheckable(
true);
613 d_act[t]->setActionGroup(d_grp);
616 QIntValidator* valid =
new QIntValidator(32, 4096,
this);
617 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
619 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
get05()));
620 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
get06()));
621 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
get07()));
622 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
get08()));
623 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
get09()));
624 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
get10()));
625 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
get11()));
626 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
get12()));
635 QListIterator<QAction*> i(d_act);
636 while (i.hasNext()) {
637 QAction* a = i.next();
638 a->setCheckable(
true);
639 a->setActionGroup(d_grp);
650 if (which < d_act.size())
653 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
659 float which = std::log(
static_cast<float>(size)) / std::log(2.0f) - 5;
661 if (std::modf(which, &ipt) == 0) {
662 if (which < d_act.size() - 1)
663 return d_act[
static_cast<int>(which)];
665 throw std::runtime_error(
666 "FFTSizeMenu::getActionFromString: which out of range.\n");
670 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(size));
671 return d_act[d_act.size() - 1];
692 int value = str.toInt();
697 QList<QAction*> d_act;
710 : QMenu(menuTitle.c_str(), parent)
712 d_grp =
new QActionGroup(
this);
719 d_act.push_back(
new QAction(
"Off",
this));
720 d_act.push_back(
new QAction(
"High",
this));
721 d_act.push_back(
new QAction(
"Medium",
this));
722 d_act.push_back(
new QAction(
"Low",
this));
725 d_grp =
new QActionGroup(
this);
726 for (
int t = 0; t < d_act.size(); t++) {
727 d_act[t]->setCheckable(
true);
728 d_act[t]->setActionGroup(d_grp);
730 d_act[0]->setChecked(
true);
732 QDoubleValidator* valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
733 ((
OtherAction*)d_act[d_act.size() - 1])->setValidator(valid);
735 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOff()));
736 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHigh()));
737 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
738 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getLow()));
744 QListIterator<QAction*> i(d_act);
745 while (i.hasNext()) {
746 QAction* a = i.next();
747 a->setCheckable(
true);
748 a->setActionGroup(d_grp);
759 if (which < d_act.size())
762 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
770 else if (avg == d_high)
772 else if (avg == d_medium)
774 else if (avg == d_low)
777 ((
OtherAction*)d_act[d_act.size() - 1])->setDiagText(QString().setNum(avg));
780 return d_act[
static_cast<int>(which)];
799 float value = str.toFloat();
804 QList<QAction*> d_act;
807 float d_off, d_high, d_medium, d_low;
833 d_act.push_back(
new QAction(
"None",
this));
834 d_act.push_back(
new QAction(
"Hamming",
this));
835 d_act.push_back(
new QAction(
"Hann",
this));
836 d_act.push_back(
new QAction(
"Blackman",
this));
837 d_act.push_back(
new QAction(
"Blackman-harris",
this));
838 d_act.push_back(
new QAction(
"Rectangular",
this));
839 d_act.push_back(
new QAction(
"Kaiser",
this));
840 d_act.push_back(
new QAction(
"Flat-top",
this));
842 d_grp =
new QActionGroup(
this);
843 for (
int t = 0; t < d_act.size(); t++) {
844 d_act[t]->setCheckable(
true);
845 d_act[t]->setActionGroup(d_grp);
848 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
849 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHamming()));
850 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getHann()));
851 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackman()));
853 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getRectangular()));
854 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getKaiser()));
855 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getFlattop()));
857 QListIterator<QAction*> i(d_act);
858 while (i.hasNext()) {
859 QAction* a = i.next();
870 if (which < d_act.size())
873 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
879 switch (
static_cast<int>(type)) {
925 QList<QAction*> d_act;
939 NPointsMenu(QWidget* parent) : QAction(
"Number of Points", parent)
941 d_diag =
new QDialog(parent);
942 d_diag->setWindowTitle(
"Number of Points");
943 d_diag->setModal(
true);
945 d_text =
new QLineEdit();
947 QGridLayout* layout =
new QGridLayout(d_diag);
948 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
949 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
951 layout->addWidget(d_text, 0, 0, 1, 2);
952 layout->addWidget(btn_ok, 1, 0);
953 layout->addWidget(btn_cancel, 1, 1);
955 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
956 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
958 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
967 void setDiagText(
const int npts) { d_text->setText(QString().setNum(npts)); }
992 ColorMapMenu(
int which, QWidget* parent) : QMenu(
"Color Map", parent), d_which(which)
994 d_grp =
new QActionGroup(
this);
996 d_act.push_back(
new QAction(
"Multi-Color",
this));
997 d_act.push_back(
new QAction(
"White Hot",
this));
998 d_act.push_back(
new QAction(
"Black Hot",
this));
999 d_act.push_back(
new QAction(
"Incandescent",
this));
1000 d_act.push_back(
new QAction(
"Sunset",
this));
1001 d_act.push_back(
new QAction(
"Cool",
this));
1002 d_act.push_back(
new QAction(
"Other",
this));
1006 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getMultiColor()));
1007 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1008 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1009 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getIncandescent()));
1010 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getSunset()));
1011 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getCool()));
1012 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getOther()));
1014 QListIterator<QAction*> i(d_act);
1015 while (i.hasNext()) {
1016 QAction* a = i.next();
1017 a->setCheckable(
true);
1018 a->setActionGroup(d_grp);
1022 d_max_value = QColor(
"white");
1023 d_min_value = QColor(
"white");
1032 if (which < d_act.size())
1033 return d_act[which];
1035 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1041 const QColor& min_color = QColor(),
1042 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);
1073 QActionGroup* d_grp;
1074 QList<QAction*> d_act;
1076 QColor d_max_value, d_min_value;
1091 d_grp =
new QActionGroup(
this);
1092 d_act.push_back(
new QAction(
"Free",
this));
1093 d_act.push_back(
new QAction(
"Auto",
this));
1094 d_act.push_back(
new QAction(
"Normal",
this));
1095 d_act.push_back(
new QAction(
"Tag",
this));
1097 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getFree()));
1098 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getAuto()));
1099 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNorm()));
1100 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getTag()));
1102 QListIterator<QAction*> i(d_act);
1103 while (i.hasNext()) {
1104 QAction* a = i.next();
1105 a->setCheckable(
true);
1106 a->setActionGroup(d_grp);
1117 if (which < d_act.size())
1118 return d_act[which];
1120 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.\n");
1139 throw std::runtime_error(
1140 "TriggerModeMenu::getAction: unknown trigger mode.\n");
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 < d_act.size())
1192 return d_act[which];
1194 throw std::runtime_error(
1195 "TriggerSlopeMenu::getAction: which out of range.\n");
1208 throw std::runtime_error(
1209 "TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1221 QList<QAction*> d_act;
1222 QActionGroup* d_grp;
1236 d_grp =
new QActionGroup(
this);
1237 for (
int i = 0; i < nchans; i++) {
1238 d_act.push_back(
new QAction(QString().setNum(i),
this));
1239 d_act[i]->setCheckable(
true);
1240 d_act[i]->setActionGroup(d_grp);
1242 addAction(d_act[i]);
1243 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(
getChannel()));
1253 if (which < d_act.size())
1254 return d_act[which];
1256 throw std::runtime_error(
1257 "TriggerChannelMenu::getAction: which out of range.\n");
1267 QAction* a = d_grp->checkedAction();
1268 int which = a->text().toInt();
1273 QList<QAction*> d_act;
1274 QActionGroup* d_grp;
1288 d_grp =
new QActionGroup(
this);
1289 d_act.push_back(
new QAction(
"Horizontal",
this));
1290 d_act.push_back(
new QAction(
"Vertical",
this));
1291 d_act.push_back(
new QAction(
"None",
this));
1293 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getHoriz()));
1294 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getVert()));
1295 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNone()));
1297 QListIterator<QAction*> i(d_act);
1298 while (i.hasNext()) {
1299 QAction* a = i.next();
1300 a->setCheckable(
true);
1301 a->setActionGroup(d_grp);
1312 if (which < d_act.size())
1313 return d_act[which];
1315 throw std::runtime_error(
1316 "NumberLayoutMenu::getAction: which out of range.\n");
1332 throw std::runtime_error(
1333 "NumberLayoutMenu::getAction: unknown layout type.\n");
1346 QList<QAction*> d_act;
1347 QActionGroup* d_grp;
1360 : QMenu(
"Color Map", parent), d_which(which)
1362 d_grp =
new QActionGroup(
this);
1364 d_act.push_back(
new QAction(
"Black",
this));
1365 d_act.push_back(
new QAction(
"Blue-Red",
this));
1366 d_act.push_back(
new QAction(
"White Hot",
this));
1367 d_act.push_back(
new QAction(
"Black Hot",
this));
1368 d_act.push_back(
new QAction(
"Black-Red",
this));
1369 d_act.push_back(
new QAction(
"Other",
this));
1371 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1372 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getBlueRed()));
1373 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1374 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1375 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getBlackRed()));
1376 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getOther()));
1378 QListIterator<QAction*> i(d_act);
1379 while (i.hasNext()) {
1380 QAction* a = i.next();
1381 a->setCheckable(
true);
1382 a->setActionGroup(d_grp);
1386 d_max_value = QColor(
"black");
1387 d_min_value = QColor(
"black");
1396 if (which < d_act.size())
1397 return d_act[which];
1399 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1403 void whichTrigger(
int which,
const QColor& min_color,
const QColor& max_color);
1413 QMessageBox::information(
1415 "Set low and high intensities",
1416 "In the next windows, select the low and then the high intensity colors.",
1418 d_min_value = QColorDialog::getColor(d_min_value,
this);
1419 d_max_value = QColorDialog::getColor(d_max_value,
this);
1425 QActionGroup* d_grp;
1426 QList<QAction*> d_act;
1427 QColor d_max_value, d_min_value;
1440 PopupMenu(QString desc, QWidget* parent) : QAction(desc, parent)
1442 d_diag =
new QDialog(parent);
1443 d_diag->setWindowTitle(desc);
1444 d_diag->setModal(
true);
1446 d_text =
new QLineEdit();
1448 QGridLayout* layout =
new QGridLayout(d_diag);
1449 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1450 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1452 layout->addWidget(d_text, 0, 0, 1, 2);
1453 layout->addWidget(btn_ok, 1, 0);
1454 layout->addWidget(btn_cancel, 1, 1);
1456 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1457 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1459 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1494 : QAction(title, parent), d_which(which)
1496 d_diag =
new QDialog(parent);
1497 d_diag->setWindowTitle(title);
1498 d_diag->setModal(
true);
1500 d_text =
new QLineEdit();
1502 QGridLayout* layout =
new QGridLayout(d_diag);
1503 QPushButton* btn_ok =
new QPushButton(tr(
"OK"));
1504 QPushButton* btn_cancel =
new QPushButton(tr(
"Cancel"));
1506 layout->addWidget(d_text, 0, 0, 1, 2);
1507 layout->addWidget(btn_ok, 1, 0);
1508 layout->addWidget(btn_cancel, 1, 1);
1510 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1511 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1513 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1518 void setText(
float f) { d_text->setText(QString(
"%1").arg(f)); }
Definition: form_menus.h:1489
~ItemFloatAct()
Definition: form_menus.h:1516
ItemFloatAct(int which, QString title, QWidget *parent)
Definition: form_menus.h:1493
void whichTrigger(int which, float data)
void getTextDiag()
Definition: form_menus.h:1525
void setText(float f)
Definition: form_menus.h:1518
Definition: form_menus.h:421
void getTextDiag()
Definition: form_menus.h:453
LineTitleAction(int which, QWidget *parent)
Definition: form_menus.h:425
~LineTitleAction()
Definition: form_menus.h:447
void whichTrigger(int which, const QString &text)
Definition: form_menus.h:474
~OtherAction()
Definition: form_menus.h:500
OtherAction(QWidget *parent)
Definition: form_menus.h:478
void setDiagText(QString text)
Definition: form_menus.h:504
void whichTrigger(const QString &text)
void getTextDiag()
Definition: form_menus.h:510
void setValidator(QValidator *v)
Definition: form_menus.h:502
Definition: form_menus.h:528
~OtherDualAction()
Definition: form_menus.h:563
void whichTrigger(const QString &text0, const QString &text1)
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:532
void getTextDiag()
Definition: form_menus.h:569
win_type
Definition: firdes.h:45
@ WIN_HANN
Hann window; max attenuation 44 dB.
Definition: firdes.h:48
@ WIN_RECTANGULAR
Basic rectangular window.
Definition: firdes.h:50
@ WIN_KAISER
Kaiser window; max attenuation a function of beta, google it.
Definition: firdes.h:51
@ WIN_HAMMING
Hamming window; max attenuation 53 dB.
Definition: firdes.h:47
@ WIN_BLACKMAN
Blackman window; max attenuation 74 dB.
Definition: firdes.h:49
@ WIN_BLACKMAN_hARRIS
Blackman-harris window.
Definition: firdes.h:52
@ WIN_NONE
don't use a window
Definition: firdes.h:46
@ WIN_FLATTOP
flat top window; useful in FFTs
Definition: firdes.h:56
trigger_mode
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:29
@ TRIG_MODE_FREE
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:30
@ TRIG_MODE_NORM
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:32
@ TRIG_MODE_AUTO
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:31
@ TRIG_MODE_TAG
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:33
trigger_slope
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:36
@ TRIG_SLOPE_NEG
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:38
@ TRIG_SLOPE_POS
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:37
graph_t
Definition: qtgui_types.h:130
@ NUM_GRAPH_VERT
Definition: qtgui_types.h:133
@ NUM_GRAPH_NONE
Definition: qtgui_types.h:131
@ NUM_GRAPH_HORIZ
Definition: qtgui_types.h:132
@ INTENSITY_COLOR_MAP_TYPE_BLACK_HOT
Definition: qtgui_types.h:143
@ INTENSITY_COLOR_MAP_TYPE_WHITE_HOT
Definition: qtgui_types.h:142
@ INTENSITY_COLOR_MAP_TYPE_USER_DEFINED
Definition: qtgui_types.h:145
@ INTENSITY_COLOR_MAP_TYPE_INCANDESCENT
Definition: qtgui_types.h:144
@ INTENSITY_COLOR_MAP_TYPE_COOL
Definition: qtgui_types.h:147
@ INTENSITY_COLOR_MAP_TYPE_SUNSET
Definition: qtgui_types.h:146
@ INTENSITY_COLOR_MAP_TYPE_MULTI_COLOR
Definition: qtgui_types.h:141
Definition: cc_common.h:45