28 #include <QtGui/QtGui>
29 #include <QtGui/QIntValidator>
30 #include <QtGui/QDoubleValidator>
31 #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);
91 if(which < d_act.size())
94 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.\n");
116 QList<QAction *> d_act;
130 : QMenu(
"Line Width", parent), d_which(which)
132 d_grp =
new QActionGroup(
this);
134 d_act.push_back(
new QAction(
"1",
this));
135 d_act.push_back(
new QAction(
"2",
this));
136 d_act.push_back(
new QAction(
"3",
this));
137 d_act.push_back(
new QAction(
"4",
this));
138 d_act.push_back(
new QAction(
"5",
this));
139 d_act.push_back(
new QAction(
"6",
this));
140 d_act.push_back(
new QAction(
"7",
this));
141 d_act.push_back(
new QAction(
"8",
this));
142 d_act.push_back(
new QAction(
"9",
this));
143 d_act.push_back(
new QAction(
"10",
this));
145 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOne()));
146 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getTwo()));
147 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getThree()));
148 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getFour()));
149 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getFive()));
150 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getSix()));
151 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getSeven()));
152 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getEight()));
153 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getNine()));
154 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getTen()));
156 QListIterator<QAction*> i(d_act);
158 QAction *a = i.next();
159 a->setCheckable(
true);
160 a->setActionGroup(d_grp);
175 if(which < d_act.size())
178 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.\n");
198 QList<QAction *> d_act;
212 : QMenu(
"Line Style", parent), d_which(which)
214 d_grp =
new QActionGroup(
this);
216 d_act.push_back(
new QAction(
"None",
this));
217 d_act.push_back(
new QAction(
"Solid",
this));
218 d_act.push_back(
new QAction(
"Dash",
this));
219 d_act.push_back(
new QAction(
"Dots",
this));
220 d_act.push_back(
new QAction(
"Dash-Dot",
this));
221 d_act.push_back(
new QAction(
"Dash-Dot-Dot",
this));
223 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
224 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getSolid()));
225 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getDash()));
226 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDots()));
227 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getDashDot()));
228 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDashDotDot()));
230 QListIterator<QAction*> i(d_act);
232 QAction *a = i.next();
233 a->setCheckable(
true);
234 a->setActionGroup(d_grp);
249 if(which < d_act.size())
252 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.\n");
268 QList<QAction *> d_act;
282 : QMenu(
"Line Marker", parent), d_which(which)
284 d_grp =
new QActionGroup(
this);
286 d_act.push_back(
new QAction(
"None",
this));
287 d_act.push_back(
new QAction(
"Circle",
this));
288 d_act.push_back(
new QAction(
"Rectangle",
this));
289 d_act.push_back(
new QAction(
"Diamond",
this));
290 d_act.push_back(
new QAction(
"Triangle",
this));
291 d_act.push_back(
new QAction(
"Down Triangle",
this));
292 d_act.push_back(
new QAction(
"Left Triangle",
this));
293 d_act.push_back(
new QAction(
"Right Triangle",
this));
294 d_act.push_back(
new QAction(
"Cross",
this));
295 d_act.push_back(
new QAction(
"X-Cross",
this));
296 d_act.push_back(
new QAction(
"Horiz. Line",
this));
297 d_act.push_back(
new QAction(
"Vert. Line",
this));
298 d_act.push_back(
new QAction(
"Star 1",
this));
299 d_act.push_back(
new QAction(
"Star 2",
this));
300 d_act.push_back(
new QAction(
"Hexagon",
this));
302 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
303 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getCircle()));
304 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getRect()));
305 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDiamond()));
306 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getTriangle()));
307 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDTriangle()));
308 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getLTriangle()));
309 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getRTriangle()));
310 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getCross()));
311 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getXCross()));
312 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getHLine()));
313 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getVLine()));
314 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(
getStar1()));
315 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(
getStar2()));
316 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(
getHexagon()));
318 QListIterator<QAction*> i(d_act);
320 QAction *a = i.next();
321 a->setCheckable(
true);
322 a->setActionGroup(d_grp);
337 if(which < d_act.size())
340 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.\n");
365 QList<QAction *> d_act;
379 : QMenu(
"Line Transparency", parent), d_which(which)
381 d_grp =
new QActionGroup(
this);
383 d_act.push_back(
new QAction(
"None",
this));
384 d_act.push_back(
new QAction(
"Low",
this));
385 d_act.push_back(
new QAction(
"Medium",
this));
386 d_act.push_back(
new QAction(
"High",
this));
387 d_act.push_back(
new QAction(
"Off",
this));
389 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
390 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getLow()));
391 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
392 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getHigh()));
393 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getOff()));
395 QListIterator<QAction*> i(d_act);
397 QAction *a = i.next();
398 a->setCheckable(
true);
399 a->setActionGroup(d_grp);
414 if(which < d_act.size())
417 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.\n");
432 QList<QAction *> d_act;
446 : QAction(
"Line Title", parent), d_which(which)
448 d_diag =
new QDialog(parent);
449 d_diag->setModal(
true);
451 d_text =
new QLineEdit();
453 QGridLayout *layout =
new QGridLayout(d_diag);
454 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
455 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
457 layout->addWidget(d_text, 0, 0, 1, 2);
458 layout->addWidget(btn_ok, 1, 0);
459 layout->addWidget(btn_cancel, 1, 1);
461 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
462 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
464 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
503 : QAction(
"Other", parent)
505 d_diag =
new QDialog(parent);
506 d_diag->setWindowTitle(
"Other");
507 d_diag->setModal(
true);
509 d_text =
new QLineEdit();
511 QGridLayout *layout =
new QGridLayout(d_diag);
512 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
513 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
515 layout->addWidget(d_text, 0, 0, 1, 2);
516 layout->addWidget(btn_ok, 1, 0);
517 layout->addWidget(btn_cancel, 1, 1);
519 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
520 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
522 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
530 d_text->setValidator(v);
535 d_text->setText(text);
568 : QAction(
"Other", parent)
570 d_diag =
new QDialog(parent);
571 d_diag->setWindowTitle(
"Other");
572 d_diag->setModal(
true);
574 d_text0 =
new QLineEdit();
575 d_text1 =
new QLineEdit();
577 QLabel *_label0 =
new QLabel(label0);
578 QLabel *_label1 =
new QLabel(label1);
580 QGridLayout *layout =
new QGridLayout(d_diag);
581 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
582 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
584 layout->addWidget(_label0, 0, 0, 1, 2);
585 layout->addWidget(_label1, 1, 0, 1, 2);
587 layout->addWidget(d_text0, 0, 1, 1, 2);
588 layout->addWidget(d_text1, 1, 1, 1, 2);
589 layout->addWidget(btn_ok, 2, 0);
590 layout->addWidget(btn_cancel, 2, 1);
592 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
593 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
595 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
602 void whichTrigger(
const QString &text0,
const QString &text1);
633 : QMenu(
"FFT Size", parent)
635 d_grp =
new QActionGroup(
this);
637 d_act.push_back(
new QAction(
"32",
this));
638 d_act.push_back(
new QAction(
"64",
this));
639 d_act.push_back(
new QAction(
"128",
this));
640 d_act.push_back(
new QAction(
"256",
this));
641 d_act.push_back(
new QAction(
"512",
this));
642 d_act.push_back(
new QAction(
"1024",
this));
643 d_act.push_back(
new QAction(
"2048",
this));
644 d_act.push_back(
new QAction(
"4096",
this));
650 d_grp =
new QActionGroup(
this);
651 for(
int t = 0; t < d_act.size(); t++) {
652 d_act[t]->setCheckable(
true);
653 d_act[t]->setActionGroup(d_grp);
656 QIntValidator *valid =
new QIntValidator(32, 4096,
this);
657 ((
OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
659 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
get05()));
660 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
get06()));
661 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
get07()));
662 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
get08()));
663 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
get09()));
664 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
get10()));
665 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
get11()));
666 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
get12()));
671 this, SLOT(
getOther(
const QString&)));
673 QListIterator<QAction*> i(d_act);
675 QAction *a = i.next();
676 a->setCheckable(
true);
677 a->setActionGroup(d_grp);
692 if(which < d_act.size())
695 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
701 float which = logf(static_cast<float>(size))/logf(2.0) - 5;
703 if(modff(which,&ipt) == 0) {
704 if(which < d_act.size()-1)
705 return d_act[static_cast<int>(which)];
707 throw std::runtime_error(
"FFTSizeMenu::getActionFromString: which out of range.\n");
711 ((
OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(size));
712 return d_act[d_act.size()-1];
733 int value = str.toInt();
738 QList<QAction *> d_act;
751 : QMenu(menuTitle.c_str(), parent)
753 d_grp =
new QActionGroup(
this);
760 d_act.push_back(
new QAction(
"Off",
this));
761 d_act.push_back(
new QAction(
"High",
this));
762 d_act.push_back(
new QAction(
"Medium",
this));
763 d_act.push_back(
new QAction(
"Low",
this));
766 d_grp =
new QActionGroup(
this);
767 for(
int t = 0; t < d_act.size(); t++) {
768 d_act[t]->setCheckable(
true);
769 d_act[t]->setActionGroup(d_grp);
771 d_act[0]->setChecked(
true);
773 QDoubleValidator *valid =
new QDoubleValidator(0.0, 1.0, 3,
this);
774 ((
OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
776 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOff()));
777 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHigh()));
778 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
779 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getLow()));
781 this, SLOT(
getOther(
const QString&)));
783 QListIterator<QAction*> i(d_act);
785 QAction *a = i.next();
786 a->setCheckable(
true);
787 a->setActionGroup(d_grp);
802 if(which < d_act.size())
805 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
813 else if(avg == d_high)
815 else if(avg == d_medium)
817 else if(avg == d_low)
820 ((
OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(avg));
823 return d_act[
static_cast<int>(which)];
851 float value = str.toFloat();
856 QList<QAction *> d_act;
859 float d_off, d_high, d_medium, d_low;
884 : QMenu(
"FFT Window", parent)
886 d_act.push_back(
new QAction(
"None",
this));
887 d_act.push_back(
new QAction(
"Hamming",
this));
888 d_act.push_back(
new QAction(
"Hann",
this));
889 d_act.push_back(
new QAction(
"Blackman",
this));
890 d_act.push_back(
new QAction(
"Blackman-harris",
this));
891 d_act.push_back(
new QAction(
"Rectangular",
this));
892 d_act.push_back(
new QAction(
"Kaiser",
this));
893 d_act.push_back(
new QAction(
"Flat-top",
this));
895 d_grp =
new QActionGroup(
this);
896 for(
int t = 0; t < d_act.size(); t++) {
897 d_act[t]->setCheckable(
true);
898 d_act[t]->setActionGroup(d_grp);
901 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
902 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHamming()));
903 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getHann()));
904 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackman()));
906 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getRectangular()));
907 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getKaiser()));
908 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getFlattop()));
910 QListIterator<QAction*> i(d_act);
912 QAction *a = i.next();
927 if(which < d_act.size())
930 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
936 switch(static_cast<int>(type)) {
963 QList<QAction *> d_act;
978 : QAction(
"Number of Points", parent)
980 d_diag =
new QDialog(parent);
981 d_diag->setWindowTitle(
"Number of Points");
982 d_diag->setModal(
true);
984 d_text =
new QLineEdit();
986 QGridLayout *layout =
new QGridLayout(d_diag);
987 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
988 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
990 layout->addWidget(d_text, 0, 0, 1, 2);
991 layout->addWidget(btn_ok, 1, 0);
992 layout->addWidget(btn_cancel, 1, 1);
994 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
995 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
997 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1009 d_text->setText(QString().setNum(npts));
1039 : QMenu(
"Color Map", parent), d_which(which)
1041 d_grp =
new QActionGroup(
this);
1043 d_act.push_back(
new QAction(
"Multi-Color",
this));
1044 d_act.push_back(
new QAction(
"White Hot",
this));
1045 d_act.push_back(
new QAction(
"Black Hot",
this));
1046 d_act.push_back(
new QAction(
"Incandescent",
this));
1047 d_act.push_back(
new QAction(
"Sunset",
this));
1048 d_act.push_back(
new QAction(
"Cool",
this));
1049 d_act.push_back(
new QAction(
"Other",
this));
1052 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getMultiColor()));
1053 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1054 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1055 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getIncandescent()));
1056 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getSunset()));
1057 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getCool()));
1058 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getOther()));
1060 QListIterator<QAction*> i(d_act);
1061 while(i.hasNext()) {
1062 QAction *a = i.next();
1063 a->setCheckable(
true);
1064 a->setActionGroup(d_grp);
1068 d_max_value = QColor(
"white");
1069 d_min_value = QColor(
"white");
1077 return d_act.size();
1082 if(which < d_act.size())
1083 return d_act[which];
1085 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1090 const QColor &min_color=QColor(),
1091 const QColor &max_color=QColor());
1103 QMessageBox::information(
this,
"Set low and high intensities",
1104 "In the next windows, select the low and then the high intensity colors.",
1106 d_min_value = QColorDialog::getColor(d_min_value,
this);
1107 d_max_value = QColorDialog::getColor(d_max_value,
this);
1110 d_min_value, d_max_value);
1114 QActionGroup *d_grp;
1115 QList<QAction *> d_act;
1117 QColor d_max_value, d_min_value;
1131 : QMenu(
"Mode", parent)
1133 d_grp =
new QActionGroup(
this);
1134 d_act.push_back(
new QAction(
"Free",
this));
1135 d_act.push_back(
new QAction(
"Auto",
this));
1136 d_act.push_back(
new QAction(
"Normal",
this));
1137 d_act.push_back(
new QAction(
"Tag",
this));
1139 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getFree()));
1140 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getAuto()));
1141 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNorm()));
1142 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getTag()));
1144 QListIterator<QAction*> i(d_act);
1145 while(i.hasNext()) {
1146 QAction *a = i.next();
1147 a->setCheckable(
true);
1148 a->setActionGroup(d_grp);
1158 return d_act.size();
1163 if(which < d_act.size())
1164 return d_act[which];
1166 throw std::runtime_error(
"TriggerModeMenu::getAction: which out of range.\n");
1185 throw std::runtime_error(
"TriggerModeMenu::getAction: unknown trigger mode.\n");
1199 QList<QAction *> d_act;
1200 QActionGroup *d_grp;
1213 : QMenu(
"Slope", parent)
1215 d_grp =
new QActionGroup(
this);
1216 d_act.push_back(
new QAction(
"Positive",
this));
1217 d_act.push_back(
new QAction(
"Negative",
this));
1219 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getPos()));
1220 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getNeg()));
1222 QListIterator<QAction*> i(d_act);
1223 while(i.hasNext()) {
1224 QAction *a = i.next();
1225 a->setCheckable(
true);
1226 a->setActionGroup(d_grp);
1236 return d_act.size();
1241 if(which < d_act.size())
1242 return d_act[which];
1244 throw std::runtime_error(
"TriggerSlopeMenu::getAction: which out of range.\n");
1257 throw std::runtime_error(
"TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1269 QList<QAction *> d_act;
1270 QActionGroup *d_grp;
1283 : QMenu(
"Channel", parent)
1285 d_grp =
new QActionGroup(
this);
1286 for(
int i = 0; i < nchans; i++) {
1287 d_act.push_back(
new QAction(QString().setNum(i),
this));
1288 d_act[i]->setCheckable(
true);
1289 d_act[i]->setActionGroup(d_grp);
1291 addAction(d_act[i]);
1292 connect(d_act[i], SIGNAL(triggered()),
this, SLOT(
getChannel()));
1301 return d_act.size();
1306 if(which < d_act.size())
1307 return d_act[which];
1309 throw std::runtime_error(
"TriggerChannelMenu::getAction: which out of range.\n");
1319 QAction *a = d_grp->checkedAction();
1320 int which = a->text().toInt();
1325 QList<QAction *> d_act;
1326 QActionGroup *d_grp;
1339 : QMenu(
"Layout", parent)
1341 d_grp =
new QActionGroup(
this);
1342 d_act.push_back(
new QAction(
"Horizontal",
this));
1343 d_act.push_back(
new QAction(
"Vertical",
this));
1344 d_act.push_back(
new QAction(
"None",
this));
1346 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getHoriz()));
1347 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getVert()));
1348 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getNone()));
1350 QListIterator<QAction*> i(d_act);
1351 while(i.hasNext()) {
1352 QAction *a = i.next();
1353 a->setCheckable(
true);
1354 a->setActionGroup(d_grp);
1364 return d_act.size();
1369 if(which < d_act.size())
1370 return d_act[which];
1372 throw std::runtime_error(
"NumberLayoutMenu::getAction: which out of range.\n");
1388 throw std::runtime_error(
"NumberLayoutMenu::getAction: unknown layout type.\n");
1401 QList<QAction *> d_act;
1402 QActionGroup *d_grp;
1415 : QMenu(
"Color Map", parent), d_which(which)
1417 d_grp =
new QActionGroup(
this);
1419 d_act.push_back(
new QAction(
"Black",
this));
1420 d_act.push_back(
new QAction(
"Blue-Red",
this));
1421 d_act.push_back(
new QAction(
"White Hot",
this));
1422 d_act.push_back(
new QAction(
"Black Hot",
this));
1423 d_act.push_back(
new QAction(
"Black-Red",
this));
1424 d_act.push_back(
new QAction(
"Other",
this));
1426 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlack()));
1427 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getBlueRed()));
1428 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
1429 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
1430 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getBlackRed()));
1431 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getOther()));
1433 QListIterator<QAction*> i(d_act);
1434 while(i.hasNext()) {
1435 QAction *a = i.next();
1436 a->setCheckable(
true);
1437 a->setActionGroup(d_grp);
1441 d_max_value = QColor(
"black");
1442 d_min_value = QColor(
"black");
1450 return d_act.size();
1455 if(which < d_act.size())
1456 return d_act[which];
1458 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
1463 const QColor &min_color,
1464 const QColor &max_color);
1474 QMessageBox::information(
this,
"Set low and high intensities",
1475 "In the next windows, select the low and then the high intensity colors.",
1477 d_min_value = QColorDialog::getColor(d_min_value,
this);
1478 d_max_value = QColorDialog::getColor(d_max_value,
this);
1484 QActionGroup *d_grp;
1485 QList<QAction *> d_act;
1486 QColor d_max_value, d_min_value;
1500 : QAction(desc, parent)
1502 d_diag =
new QDialog(parent);
1503 d_diag->setWindowTitle(desc);
1504 d_diag->setModal(
true);
1506 d_text =
new QLineEdit();
1508 QGridLayout *layout =
new QGridLayout(d_diag);
1509 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
1510 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
1512 layout->addWidget(d_text, 0, 0, 1, 2);
1513 layout->addWidget(btn_ok, 1, 0);
1514 layout->addWidget(btn_cancel, 1, 1);
1516 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1517 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1519 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1561 : QAction(title, parent), d_which(which)
1563 d_diag =
new QDialog(parent);
1564 d_diag->setWindowTitle(title);
1565 d_diag->setModal(
true);
1567 d_text =
new QLineEdit();
1569 QGridLayout *layout =
new QGridLayout(d_diag);
1570 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
1571 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
1573 layout->addWidget(d_text, 0, 0, 1, 2);
1574 layout->addWidget(btn_ok, 1, 0);
1575 layout->addWidget(btn_cancel, 1, 1);
1577 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
1578 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1580 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
1588 d_text->setText(QString(
"%1").arg(f));
OtherAction(QWidget *parent)
Definition: form_menus.h:502
Definition: qtgui_types.h:144
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:38
~OtherAction()
Definition: form_menus.h:525
void getTextDiag()
Definition: form_menus.h:605
void getTextDiag()
Definition: form_menus.h:1596
Definition: qtgui_types.h:158
Definition: form_menus.h:440
~LineTitleAction()
Definition: form_menus.h:467
Kaiser window; max attenuation a function of beta, google it.
Definition: firdes.h:51
Definition: form_menus.h:497
Definition: qtgui_types.h:155
void setValidator(QValidator *v)
Definition: form_menus.h:528
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:37
graph_t
Definition: qtgui_types.h:142
Definition: form_menus.h:562
void whichTrigger(int which, float data)
void getTextDiag()
Definition: form_menus.h:542
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:31
Definition: cc_common.h:45
Definition: qtgui_types.h:157
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:567
Definition: qtgui_types.h:159
void setDiagText(QString text)
Definition: form_menus.h:533
~ItemFloatAct()
Definition: form_menus.h:1583
don't use a window
Definition: firdes.h:46
Definition: qtgui_types.h:154
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:30
void whichTrigger(const QString &text0, const QString &text1)
Definition: qtgui_types.h:156
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:1560
void whichTrigger(const QString &text)
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:33
Definition: qtgui_types.h:145
Basic rectangular window.
Definition: firdes.h:50
Hamming window; max attenuation 53 dB.
Definition: firdes.h:47
void whichTrigger(int which, const QString &text)
win_type
Definition: firdes.h:45
Hann window; max attenuation 44 dB.
Definition: firdes.h:48
Blackman window; max attenuation 74 dB.
Definition: firdes.h:49
~OtherDualAction()
Definition: form_menus.h:598
LineTitleAction(int which, QWidget *parent)
Definition: form_menus.h:445
void setText(float f)
Definition: form_menus.h:1586
Definition: qtgui_types.h:153
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:32
Definition: form_menus.h:1555
void getTextDiag()
Definition: form_menus.h:474
flat top window; useful in FFTs
Definition: firdes.h:55
Definition: qtgui_types.h:143
Blackman-harris window.
Definition: firdes.h:52