28 #include <QtGui/QtGui>
29 #include <qwt_symbol.h>
39 : QMenu(
"Line Color", parent), d_which(which)
41 d_act.push_back(
new QAction(
"Blue",
this));
42 d_act.push_back(
new QAction(
"Red",
this));
43 d_act.push_back(
new QAction(
"Green",
this));
44 d_act.push_back(
new QAction(
"Black",
this));
45 d_act.push_back(
new QAction(
"Cyan",
this));
46 d_act.push_back(
new QAction(
"Magenta",
this));
47 d_act.push_back(
new QAction(
"Yellow",
this));
48 d_act.push_back(
new QAction(
"Gray",
this));
49 d_act.push_back(
new QAction(
"Dark Red",
this));
50 d_act.push_back(
new QAction(
"Dark Green",
this));
51 d_act.push_back(
new QAction(
"Dark Blue",
this));
52 d_act.push_back(
new QAction(
"Dark Gray",
this));
54 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getBlue()));
55 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getRed()));
56 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getGreen()));
57 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlack()));
58 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getCyan()));
59 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getMagenta()));
60 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getYellow()));
61 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getGray()));
62 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getDarkRed()));
63 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getDarkGreen()));
64 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getDarkBlue()));
65 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getDarkGray()));
67 QListIterator<QAction*> i(d_act);
69 QAction *a = i.next();
84 if(which < d_act.size())
87 throw std::runtime_error(
"LineColorMenu::getAction: which out of range.\n");
108 QList<QAction *> d_act;
122 : QMenu(
"Line Width", parent), d_which(which)
124 d_act.push_back(
new QAction(
"1",
this));
125 d_act.push_back(
new QAction(
"2",
this));
126 d_act.push_back(
new QAction(
"3",
this));
127 d_act.push_back(
new QAction(
"4",
this));
128 d_act.push_back(
new QAction(
"5",
this));
129 d_act.push_back(
new QAction(
"6",
this));
130 d_act.push_back(
new QAction(
"7",
this));
131 d_act.push_back(
new QAction(
"8",
this));
132 d_act.push_back(
new QAction(
"9",
this));
133 d_act.push_back(
new QAction(
"10",
this));
135 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOne()));
136 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getTwo()));
137 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getThree()));
138 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getFour()));
139 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getFive()));
140 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getSix()));
141 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getSeven()));
142 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getEight()));
143 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getNine()));
144 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getTen()));
146 QListIterator<QAction*> i(d_act);
148 QAction *a = i.next();
163 if(which < d_act.size())
166 throw std::runtime_error(
"LineWidthMenu::getAction: which out of range.\n");
185 QList<QAction *> d_act;
199 : QMenu(
"Line Style", parent), d_which(which)
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);
217 QAction *a = i.next();
232 if(which < d_act.size())
235 throw std::runtime_error(
"LineStyleMenu::getAction: which out of range.\n");
250 QList<QAction *> d_act;
264 : QMenu(
"Line Marker", parent), d_which(which)
266 d_act.push_back(
new QAction(
"None",
this));
267 d_act.push_back(
new QAction(
"Circle",
this));
268 d_act.push_back(
new QAction(
"Rectangle",
this));
269 d_act.push_back(
new QAction(
"Diamond",
this));
270 d_act.push_back(
new QAction(
"Triangle",
this));
271 d_act.push_back(
new QAction(
"Down Triangle",
this));
272 d_act.push_back(
new QAction(
"Left Triangle",
this));
273 d_act.push_back(
new QAction(
"Right Triangle",
this));
274 d_act.push_back(
new QAction(
"Cross",
this));
275 d_act.push_back(
new QAction(
"X-Cross",
this));
276 d_act.push_back(
new QAction(
"Horiz. Line",
this));
277 d_act.push_back(
new QAction(
"Vert. Line",
this));
278 d_act.push_back(
new QAction(
"Star 1",
this));
279 d_act.push_back(
new QAction(
"Star 2",
this));
280 d_act.push_back(
new QAction(
"Hexagon",
this));
282 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
283 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getCircle()));
284 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getRect()));
285 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getDiamond()));
286 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getTriangle()));
287 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getDTriangle()));
288 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getLTriangle()));
289 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
getRTriangle()));
290 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
getCross()));
291 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
getXCross()));
292 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
getHLine()));
293 connect(d_act[11], SIGNAL(triggered()),
this, SLOT(
getVLine()));
294 connect(d_act[12], SIGNAL(triggered()),
this, SLOT(
getStar1()));
295 connect(d_act[13], SIGNAL(triggered()),
this, SLOT(
getStar2()));
296 connect(d_act[14], SIGNAL(triggered()),
this, SLOT(
getHexagon()));
298 QListIterator<QAction*> i(d_act);
300 QAction *a = i.next();
315 if(which < d_act.size())
318 throw std::runtime_error(
"LineMarkerMenu::getAction: which out of range.\n");
342 QList<QAction *> d_act;
356 : QMenu(
"Line Transparency", parent), d_which(which)
358 d_act.push_back(
new QAction(
"None",
this));
359 d_act.push_back(
new QAction(
"Low",
this));
360 d_act.push_back(
new QAction(
"Medium",
this));
361 d_act.push_back(
new QAction(
"High",
this));
362 d_act.push_back(
new QAction(
"Off",
this));
364 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
365 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getLow()));
366 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
367 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getHigh()));
368 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getOff()));
370 QListIterator<QAction*> i(d_act);
372 QAction *a = i.next();
387 if(which < d_act.size())
390 throw std::runtime_error(
"MarkerAlphaMenu::getAction: which out of range.\n");
404 QList<QAction *> d_act;
418 : QAction(
"Line Title", parent), d_which(which)
420 d_diag =
new QDialog(parent);
421 d_diag->setModal(
true);
423 d_text =
new QLineEdit();
425 QGridLayout *layout =
new QGridLayout(d_diag);
426 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
427 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
429 layout->addWidget(d_text, 0, 0, 1, 2);
430 layout->addWidget(btn_ok, 1, 0);
431 layout->addWidget(btn_cancel, 1, 1);
433 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
434 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
436 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
475 : QAction(
"Other", parent)
477 d_diag =
new QDialog(parent);
478 d_diag->setModal(
true);
480 d_text =
new QLineEdit();
482 QGridLayout *layout =
new QGridLayout(d_diag);
483 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
484 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
486 layout->addWidget(d_text, 0, 0, 1, 2);
487 layout->addWidget(btn_ok, 1, 0);
488 layout->addWidget(btn_cancel, 1, 1);
490 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
491 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
493 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
529 : QAction(
"Other", parent)
531 d_diag =
new QDialog(parent);
532 d_diag->setModal(
true);
534 d_text0 =
new QLineEdit();
535 d_text1 =
new QLineEdit();
537 QLabel *_label0 =
new QLabel(label0);
538 QLabel *_label1 =
new QLabel(label1);
540 QGridLayout *layout =
new QGridLayout(d_diag);
541 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
542 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
544 layout->addWidget(_label0, 0, 0, 1, 2);
545 layout->addWidget(_label1, 1, 0, 1, 2);
547 layout->addWidget(d_text0, 0, 1, 1, 2);
548 layout->addWidget(d_text1, 1, 1, 1, 2);
549 layout->addWidget(btn_ok, 2, 0);
550 layout->addWidget(btn_cancel, 2, 1);
552 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
553 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
555 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
562 void whichTrigger(
const QString &text0,
const QString &text1);
593 : QMenu(
"FFT Size", parent)
595 d_act.push_back(
new QAction(
"32",
this));
596 d_act.push_back(
new QAction(
"64",
this));
597 d_act.push_back(
new QAction(
"128",
this));
598 d_act.push_back(
new QAction(
"256",
this));
599 d_act.push_back(
new QAction(
"512",
this));
600 d_act.push_back(
new QAction(
"1024",
this));
601 d_act.push_back(
new QAction(
"2048",
this));
602 d_act.push_back(
new QAction(
"4096",
this));
603 d_act.push_back(
new QAction(
"8192",
this));
604 d_act.push_back(
new QAction(
"16384",
this));
605 d_act.push_back(
new QAction(
"32768",
this));
608 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
get05()));
609 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
get06()));
610 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
get07()));
611 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
get08()));
612 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
get09()));
613 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
get10()));
614 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
get11()));
615 connect(d_act[7], SIGNAL(triggered()),
this, SLOT(
get12()));
616 connect(d_act[8], SIGNAL(triggered()),
this, SLOT(
get13()));
617 connect(d_act[9], SIGNAL(triggered()),
this, SLOT(
get14()));
618 connect(d_act[10], SIGNAL(triggered()),
this, SLOT(
get15()));
619 connect(d_act[11], SIGNAL(
whichTrigger(
const QString&)),
620 this, SLOT(
getOther(
const QString&)));
622 QListIterator<QAction*> i(d_act);
624 QAction *a = i.next();
639 if(which < d_act.size())
642 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
662 int value = str.toInt();
667 QList<QAction *> d_act;
681 : QMenu(
"FFT Average", parent)
683 d_act.push_back(
new QAction(
"Off",
this));
684 d_act.push_back(
new QAction(
"High",
this));
685 d_act.push_back(
new QAction(
"Medium",
this));
686 d_act.push_back(
new QAction(
"Low",
this));
689 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getOff()));
690 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHigh()));
691 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getMedium()));
692 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getLow()));
694 this, SLOT(
getOther(
const QString&)));
696 QListIterator<QAction*> i(d_act);
698 QAction *a = i.next();
713 if(which < d_act.size())
716 throw std::runtime_error(
"FFTSizeMenu::getAction: which out of range.\n");
729 float value = str.toFloat();
734 QList<QAction *> d_act;
748 : QMenu(
"FFT Window", parent)
750 d_act.push_back(
new QAction(
"None",
this));
751 d_act.push_back(
new QAction(
"Hamming",
this));
752 d_act.push_back(
new QAction(
"Hann",
this));
753 d_act.push_back(
new QAction(
"Blackman",
this));
754 d_act.push_back(
new QAction(
"Blackman-harris",
this));
755 d_act.push_back(
new QAction(
"Rectangular",
this));
756 d_act.push_back(
new QAction(
"Kaiser",
this));
758 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getNone()));
759 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getHamming()));
760 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getHann()));
761 connect(d_act[3], SIGNAL(triggered()),
this, SLOT(
getBlackman()));
763 connect(d_act[5], SIGNAL(triggered()),
this, SLOT(
getRectangular()));
764 connect(d_act[6], SIGNAL(triggered()),
this, SLOT(
getKaiser()));
766 QListIterator<QAction*> i(d_act);
768 QAction *a = i.next();
783 if(which < d_act.size())
786 throw std::runtime_error(
"FFTWindowMenu::getAction: which out of range.\n");
802 QList<QAction *> d_act;
816 : QAction(
"Number of Points", parent)
818 d_diag =
new QDialog(parent);
819 d_diag->setModal(
true);
821 d_text =
new QLineEdit();
823 QGridLayout *layout =
new QGridLayout(d_diag);
824 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
825 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
827 layout->addWidget(d_text, 0, 0, 1, 2);
828 layout->addWidget(btn_ok, 1, 0);
829 layout->addWidget(btn_cancel, 1, 1);
831 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
832 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
834 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));
871 : QMenu(
"Color Map", parent), d_which(which)
873 d_act.push_back(
new QAction(
"Multi-Color",
this));
874 d_act.push_back(
new QAction(
"White Hot",
this));
875 d_act.push_back(
new QAction(
"Black Hot",
this));
876 d_act.push_back(
new QAction(
"Incandescent",
this));
877 d_act.push_back(
new QAction(
"Other",
this));
880 connect(d_act[0], SIGNAL(triggered()),
this, SLOT(
getMultiColor()));
881 connect(d_act[1], SIGNAL(triggered()),
this, SLOT(
getWhiteHot()));
882 connect(d_act[2], SIGNAL(triggered()),
this, SLOT(
getBlackHot()));
884 connect(d_act[4], SIGNAL(triggered()),
this, SLOT(
getOther()));
886 QListIterator<QAction*> i(d_act);
888 QAction *a = i.next();
892 d_max_value = QColor(
"white");
893 d_min_value = QColor(
"white");
906 if(which < d_act.size())
909 throw std::runtime_error(
"ColorMapMenu::getAction: which out of range.\n");
914 const QColor &min_color=QColor(),
915 const QColor &max_color=QColor());
925 QMessageBox::information(
this,
"Set low and high intensities",
926 "In the next windows, select the low and then the high intensity colors.",
928 d_min_value = QColorDialog::getColor(d_min_value,
this);
929 d_max_value = QColorDialog::getColor(d_max_value,
this);
932 d_min_value, d_max_value);
936 QList<QAction *> d_act;
938 QColor d_max_value, d_min_value;
952 : QAction(desc, parent)
954 d_diag =
new QDialog(parent);
955 d_diag->setModal(
true);
957 d_text =
new QLineEdit();
959 QGridLayout *layout =
new QGridLayout(d_diag);
960 QPushButton *btn_ok =
new QPushButton(tr(
"OK"));
961 QPushButton *btn_cancel =
new QPushButton(tr(
"Cancel"));
963 layout->addWidget(d_text, 0, 0, 1, 2);
964 layout->addWidget(btn_ok, 1, 0);
965 layout->addWidget(btn_cancel, 1, 1);
967 connect(btn_ok, SIGNAL(clicked()),
this, SLOT(getText()));
968 connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
970 connect(
this, SIGNAL(triggered()),
this, SLOT(
getTextDiag()));