GNU Radio Manual and C++ API Reference  3.7.4.1
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
form_menus.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef FORM_MENUS_H
24 #define FORM_MENUS_H
25 
26 #include <stdexcept>
27 #include <vector>
28 #include <QtGui/QtGui>
29 #include <QtGui/QIntValidator>
30 #include <QtGui/QDoubleValidator>
31 #include <qwt_symbol.h>
32 #include <gnuradio/filter/firdes.h>
35 
36 class LineColorMenu: public QMenu
37 {
38  Q_OBJECT
39 
40 public:
41  LineColorMenu(int which, QWidget *parent)
42  : QMenu("Line Color", parent), d_which(which)
43  {
44  d_grp = new QActionGroup(this);
45 
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));
58 
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()));
71 
72  QListIterator<QAction*> i(d_act);
73  while(i.hasNext()) {
74  QAction *a = i.next();
75  a->setCheckable(true);
76  a->setActionGroup(d_grp);
77  addAction(a);
78  }
79  }
80 
82  {}
83 
84  int getNumActions() const
85  {
86  return d_act.size();
87  }
88 
89  QAction * getAction(int which)
90  {
91  if(which < d_act.size())
92  return d_act[which];
93  else
94  throw std::runtime_error("LineColorMenu::getAction: which out of range.\n");
95  }
96 
97 signals:
98  void whichTrigger(int which, const QString &name);
99 
100 public slots:
101  void getBlue() { emit whichTrigger(d_which, "blue"); }
102  void getRed() { emit whichTrigger(d_which, "red"); }
103  void getGreen() { emit whichTrigger(d_which, "green"); }
104  void getBlack() { emit whichTrigger(d_which, "black"); }
105  void getCyan() { emit whichTrigger(d_which, "cyan"); }
106  void getMagenta() { emit whichTrigger(d_which, "magenta"); }
107  void getYellow() { emit whichTrigger(d_which, "yellow"); }
108  void getGray() { emit whichTrigger(d_which, "gray"); }
109  void getDarkRed() { emit whichTrigger(d_which, "darkred"); }
110  void getDarkGreen() { emit whichTrigger(d_which, "darkgreen"); }
111  void getDarkBlue() { emit whichTrigger(d_which, "darkblue"); }
112  void getDarkGray() { emit whichTrigger(d_which, "darkgray"); }
113 
114 private:
115  QActionGroup *d_grp;
116  QList<QAction *> d_act;
117  int d_which;
118 };
119 
120 
121 /********************************************************************/
122 
123 
124 class LineWidthMenu: public QMenu
125 {
126  Q_OBJECT
127 
128 public:
129  LineWidthMenu(int which, QWidget *parent)
130  : QMenu("Line Width", parent), d_which(which)
131  {
132  d_grp = new QActionGroup(this);
133 
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));
144 
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()));
155 
156  QListIterator<QAction*> i(d_act);
157  while(i.hasNext()) {
158  QAction *a = i.next();
159  a->setCheckable(true);
160  a->setActionGroup(d_grp);
161  addAction(a);
162  }
163  }
164 
166  {}
167 
168  int getNumActions() const
169  {
170  return d_act.size();
171  }
172 
173  QAction * getAction(int which)
174  {
175  if(which < d_act.size())
176  return d_act[which];
177  else
178  throw std::runtime_error("LineWidthMenu::getAction: which out of range.\n");
179  }
180 
181 signals:
182  void whichTrigger(int which, int width);
183 
184 public slots:
185  void getOne() { emit whichTrigger(d_which, 1); }
186  void getTwo() { emit whichTrigger(d_which, 2); }
187  void getThree() { emit whichTrigger(d_which, 3); }
188  void getFour() { emit whichTrigger(d_which, 4); }
189  void getFive() { emit whichTrigger(d_which, 5); }
190  void getSix() { emit whichTrigger(d_which, 6); }
191  void getSeven() { emit whichTrigger(d_which, 7); }
192  void getEight() { emit whichTrigger(d_which, 8); }
193  void getNine() { emit whichTrigger(d_which, 9); }
194  void getTen() { emit whichTrigger(d_which, 10); }
195 
196 private:
197  QActionGroup *d_grp;
198  QList<QAction *> d_act;
199  int d_which;
200 };
201 
202 
203 /********************************************************************/
204 
205 
206 class LineStyleMenu: public QMenu
207 {
208  Q_OBJECT
209 
210 public:
211  LineStyleMenu(int which, QWidget *parent)
212  : QMenu("Line Style", parent), d_which(which)
213  {
214  d_grp = new QActionGroup(this);
215 
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));
222 
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()));
229 
230  QListIterator<QAction*> i(d_act);
231  while(i.hasNext()) {
232  QAction *a = i.next();
233  a->setCheckable(true);
234  a->setActionGroup(d_grp);
235  addAction(a);
236  }
237  }
238 
240  {}
241 
242  int getNumActions() const
243  {
244  return d_act.size();
245  }
246 
247  QAction * getAction(int which)
248  {
249  if(which < d_act.size())
250  return d_act[which];
251  else
252  throw std::runtime_error("LineStyleMenu::getAction: which out of range.\n");
253  }
254 
255 signals:
256  void whichTrigger(int which, Qt::PenStyle);
257 
258 public slots:
259  void getNone() { emit whichTrigger(d_which, Qt::NoPen); }
260  void getSolid() { emit whichTrigger(d_which, Qt::SolidLine); }
261  void getDash() { emit whichTrigger(d_which, Qt::DashLine); }
262  void getDots() { emit whichTrigger(d_which, Qt::DotLine); }
263  void getDashDot() { emit whichTrigger(d_which, Qt::DashDotLine); }
264  void getDashDotDot() { emit whichTrigger(d_which, Qt::DashDotDotLine); }
265 
266 private:
267  QActionGroup *d_grp;
268  QList<QAction *> d_act;
269  int d_which;
270 };
271 
272 
273 /********************************************************************/
274 
275 
276 class LineMarkerMenu: public QMenu
277 {
278  Q_OBJECT
279 
280 public:
281  LineMarkerMenu(int which, QWidget *parent)
282  : QMenu("Line Marker", parent), d_which(which)
283  {
284  d_grp = new QActionGroup(this);
285 
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));
301 
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()));
317 
318  QListIterator<QAction*> i(d_act);
319  while(i.hasNext()) {
320  QAction *a = i.next();
321  a->setCheckable(true);
322  a->setActionGroup(d_grp);
323  addAction(a);
324  }
325  }
326 
328  {}
329 
330  int getNumActions() const
331  {
332  return d_act.size();
333  }
334 
335  QAction * getAction(int which)
336  {
337  if(which < d_act.size())
338  return d_act[which];
339  else
340  throw std::runtime_error("LineMarkerMenu::getAction: which out of range.\n");
341  }
342 
343 signals:
344  void whichTrigger(int which, QwtSymbol::Style);
345 
346 public slots:
347  void getNone() { emit whichTrigger(d_which, QwtSymbol::NoSymbol); }
348  void getCircle() { emit whichTrigger(d_which, QwtSymbol::Ellipse); }
349  void getRect() { emit whichTrigger(d_which, QwtSymbol::Rect); }
350  void getDiamond() { emit whichTrigger(d_which, QwtSymbol::Diamond); }
351  void getTriangle() { emit whichTrigger(d_which, QwtSymbol::Triangle); }
352  void getDTriangle() { emit whichTrigger(d_which, QwtSymbol::DTriangle); }
353  void getLTriangle() { emit whichTrigger(d_which, QwtSymbol::LTriangle); }
354  void getRTriangle() { emit whichTrigger(d_which, QwtSymbol::RTriangle); }
355  void getCross() { emit whichTrigger(d_which, QwtSymbol::Cross); }
356  void getXCross() { emit whichTrigger(d_which, QwtSymbol::XCross); }
357  void getHLine() { emit whichTrigger(d_which, QwtSymbol::HLine); }
358  void getVLine() { emit whichTrigger(d_which, QwtSymbol::VLine); }
359  void getStar1() { emit whichTrigger(d_which, QwtSymbol::Star1); }
360  void getStar2() { emit whichTrigger(d_which, QwtSymbol::Star2); }
361  void getHexagon() { emit whichTrigger(d_which, QwtSymbol::Hexagon); }
362 
363 private:
364  QActionGroup *d_grp;
365  QList<QAction *> d_act;
366  int d_which;
367 };
368 
369 
370 /********************************************************************/
371 
372 
373 class MarkerAlphaMenu: public QMenu
374 {
375  Q_OBJECT
376 
377 public:
378  MarkerAlphaMenu(int which, QWidget *parent)
379  : QMenu("Line Transparency", parent), d_which(which)
380  {
381  d_grp = new QActionGroup(this);
382 
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));
388 
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()));
394 
395  QListIterator<QAction*> i(d_act);
396  while(i.hasNext()) {
397  QAction *a = i.next();
398  a->setCheckable(true);
399  a->setActionGroup(d_grp);
400  addAction(a);
401  }
402  }
403 
405  {}
406 
407  int getNumActions() const
408  {
409  return d_act.size();
410  }
411 
412  QAction * getAction(int which)
413  {
414  if(which < d_act.size())
415  return d_act[which];
416  else
417  throw std::runtime_error("MarkerAlphaMenu::getAction: which out of range.\n");
418  }
419 
420 signals:
421  void whichTrigger(int which, int);
422 
423 public slots:
424  void getNone() { emit whichTrigger(d_which, 255); }
425  void getLow() { emit whichTrigger(d_which, 200); }
426  void getMedium() { emit whichTrigger(d_which, 125); }
427  void getHigh() { emit whichTrigger(d_which, 50); }
428  void getOff() { emit whichTrigger(d_which, 0); }
429 
430 private:
431  QActionGroup *d_grp;
432  QList<QAction *> d_act;
433  int d_which;
434 };
435 
436 
437 /********************************************************************/
438 
439 
440 class LineTitleAction: public QAction
441 {
442  Q_OBJECT
443 
444 public:
445  LineTitleAction(int which, QWidget *parent)
446  : QAction("Line Title", parent), d_which(which)
447  {
448  d_diag = new QDialog(parent);
449  d_diag->setModal(true);
450 
451  d_text = new QLineEdit();
452 
453  QGridLayout *layout = new QGridLayout(d_diag);
454  QPushButton *btn_ok = new QPushButton(tr("OK"));
455  QPushButton *btn_cancel = new QPushButton(tr("Cancel"));
456 
457  layout->addWidget(d_text, 0, 0, 1, 2);
458  layout->addWidget(btn_ok, 1, 0);
459  layout->addWidget(btn_cancel, 1, 1);
460 
461  connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText()));
462  connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
463 
464  connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag()));
465  }
466 
468  {}
469 
470 signals:
471  void whichTrigger(int which, const QString &text);
472 
473 public slots:
474  void getTextDiag()
475  {
476  d_diag->exec();
477  }
478 
479 private slots:
480  void getText()
481  {
482  emit whichTrigger(d_which, d_text->text());
483  d_diag->accept();
484  }
485 
486 private:
487  int d_which;
488 
489  QDialog *d_diag;
490  QLineEdit *d_text;
491 };
492 
493 
494 /********************************************************************/
495 
496 
497 class OtherAction: public QAction
498 {
499  Q_OBJECT
500 
501 public:
502  OtherAction(QWidget *parent)
503  : QAction("Other", parent)
504  {
505  d_diag = new QDialog(parent);
506  d_diag->setWindowTitle("Other");
507  d_diag->setModal(true);
508 
509  d_text = new QLineEdit();
510 
511  QGridLayout *layout = new QGridLayout(d_diag);
512  QPushButton *btn_ok = new QPushButton(tr("OK"));
513  QPushButton *btn_cancel = new QPushButton(tr("Cancel"));
514 
515  layout->addWidget(d_text, 0, 0, 1, 2);
516  layout->addWidget(btn_ok, 1, 0);
517  layout->addWidget(btn_cancel, 1, 1);
518 
519  connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText()));
520  connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
521 
522  connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag()));
523  }
524 
526  {}
527 
528  void setValidator(QValidator *v)
529  {
530  d_text->setValidator(v);
531  }
532 
533  void setDiagText(QString text)
534  {
535  d_text->setText(text);
536  }
537 
538 signals:
539  void whichTrigger(const QString &text);
540 
541 public slots:
542  void getTextDiag()
543  {
544  d_diag->exec();
545  }
546 
547 private slots:
548  void getText()
549  {
550  emit whichTrigger(d_text->text());
551  d_diag->accept();
552  }
553 
554 private:
555  QDialog *d_diag;
556  QLineEdit *d_text;
557 };
558 
559 /********************************************************************/
560 
561 
562 class OtherDualAction: public QAction
563 {
564  Q_OBJECT
565 
566 public:
567  OtherDualAction(QString label0, QString label1, QWidget *parent)
568  : QAction("Other", parent)
569  {
570  d_diag = new QDialog(parent);
571  d_diag->setWindowTitle("Other");
572  d_diag->setModal(true);
573 
574  d_text0 = new QLineEdit();
575  d_text1 = new QLineEdit();
576 
577  QLabel *_label0 = new QLabel(label0);
578  QLabel *_label1 = new QLabel(label1);
579 
580  QGridLayout *layout = new QGridLayout(d_diag);
581  QPushButton *btn_ok = new QPushButton(tr("OK"));
582  QPushButton *btn_cancel = new QPushButton(tr("Cancel"));
583 
584  layout->addWidget(_label0, 0, 0, 1, 2);
585  layout->addWidget(_label1, 1, 0, 1, 2);
586 
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);
591 
592  connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText()));
593  connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
594 
595  connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag()));
596  }
597 
599  {}
600 
601 signals:
602  void whichTrigger(const QString &text0, const QString &text1);
603 
604 public slots:
605  void getTextDiag()
606  {
607  d_diag->exec();
608  }
609 
610 private slots:
611  void getText()
612  {
613  emit whichTrigger(d_text0->text(), d_text1->text());
614  d_diag->accept();
615  }
616 
617 private:
618  QDialog *d_diag;
619  QLineEdit *d_text0;
620  QLineEdit *d_text1;
621 };
622 
623 
624 /********************************************************************/
625 
626 
627 class FFTSizeMenu: public QMenu
628 {
629  Q_OBJECT
630 
631 public:
632  FFTSizeMenu(QWidget *parent)
633  : QMenu("FFT Size", parent)
634  {
635  d_grp = new QActionGroup(this);
636 
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));
645  //d_act.push_back(new QAction("8192", this));
646  //d_act.push_back(new QAction("16384", this));
647  //d_act.push_back(new QAction("32768", this));
648  d_act.push_back(new OtherAction(this));
649 
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);
654  }
655 
656  QIntValidator *valid = new QIntValidator(32, 4096, this);
657  ((OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
658 
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()));
667  //connect(d_act[8], SIGNAL(triggered()), this, SLOT(get13()));
668  //connect(d_act[9], SIGNAL(triggered()), this, SLOT(get14()));
669  //connect(d_act[10], SIGNAL(triggered()), this, SLOT(get15()));
670  connect(d_act[8], SIGNAL(whichTrigger(const QString&)),
671  this, SLOT(getOther(const QString&)));
672 
673  QListIterator<QAction*> i(d_act);
674  while(i.hasNext()) {
675  QAction *a = i.next();
676  a->setCheckable(true);
677  a->setActionGroup(d_grp);
678  addAction(a);
679  }
680  }
681 
683  {}
684 
685  int getNumActions() const
686  {
687  return d_act.size();
688  }
689 
690  QAction * getAction(int which)
691  {
692  if(which < d_act.size())
693  return d_act[which];
694  else
695  throw std::runtime_error("FFTSizeMenu::getAction: which out of range.\n");
696  }
697 
698  QAction * getActionFromSize(int size)
699  {
700  float ipt;
701  float which = logf(static_cast<float>(size))/logf(2.0) - 5;
702  // If we're a predefined value
703  if(modff(which,&ipt) == 0) {
704  if(which < d_act.size()-1)
705  return d_act[static_cast<int>(which)];
706  else
707  throw std::runtime_error("FFTSizeMenu::getActionFromString: which out of range.\n");
708  }
709  // Or a non-predefined value, return Other
710  else {
711  ((OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(size));
712  return d_act[d_act.size()-1];
713  }
714  }
715 
716 signals:
717  void whichTrigger(int size);
718 
719 public slots:
720  void get05() { emit whichTrigger(32); }
721  void get06() { emit whichTrigger(64); }
722  void get07() { emit whichTrigger(128); }
723  void get08() { emit whichTrigger(256); }
724  void get09() { emit whichTrigger(512); }
725  void get10() { emit whichTrigger(1024); }
726  void get11() { emit whichTrigger(2048); }
727  void get12() { emit whichTrigger(4096); }
728  //void get13() { emit whichTrigger(8192); }
729  //void get14() { emit whichTrigger(16384); }
730  //void get15() { emit whichTrigger(32768); }
731  void getOther(const QString &str)
732  {
733  int value = str.toInt();
734  emit whichTrigger(value);
735  }
736 
737 private:
738  QList<QAction *> d_act;
739  OtherAction *d_other;
740  QActionGroup *d_grp;
741 };
742 
743 
744 /********************************************************************/
745 
746 
747 class FFTAverageMenu: public QMenu
748 {
749  Q_OBJECT
750 
751 public:
752  FFTAverageMenu(QWidget *parent)
753  : QMenu("FFT Average", parent)
754  {
755  d_grp = new QActionGroup(this);
756 
757  d_off = 1.0;
758  d_high = 0.05;
759  d_medium = 0.1;
760  d_low = 0.2;
761 
762  d_act.push_back(new QAction("Off", this));
763  d_act.push_back(new QAction("High", this));
764  d_act.push_back(new QAction("Medium", this));
765  d_act.push_back(new QAction("Low", this));
766  d_act.push_back(new OtherAction(this));
767 
768  d_grp = new QActionGroup(this);
769  for(int t = 0; t < d_act.size(); t++) {
770  d_act[t]->setCheckable(true);
771  d_act[t]->setActionGroup(d_grp);
772  }
773  d_act[0]->setChecked(true);
774 
775  QDoubleValidator *valid = new QDoubleValidator(0.0, 1.0, 3, this);
776  ((OtherAction*)d_act[d_act.size()-1])->setValidator(valid);
777 
778  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getOff()));
779  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getHigh()));
780  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getMedium()));
781  connect(d_act[3], SIGNAL(triggered()), this, SLOT(getLow()));
782  connect(d_act[4], SIGNAL(whichTrigger(const QString&)),
783  this, SLOT(getOther(const QString&)));
784 
785  QListIterator<QAction*> i(d_act);
786  while(i.hasNext()) {
787  QAction *a = i.next();
788  a->setCheckable(true);
789  a->setActionGroup(d_grp);
790  addAction(a);
791  }
792  }
793 
795  {}
796 
797  int getNumActions() const
798  {
799  return d_act.size();
800  }
801 
802  QAction * getAction(int which)
803  {
804  if(which < d_act.size())
805  return d_act[which];
806  else
807  throw std::runtime_error("FFTSizeMenu::getAction: which out of range.\n");
808  }
809 
810  QAction * getActionFromAvg(float avg)
811  {
812  int which = 0;
813  if(avg == d_off)
814  which = 0;
815  else if(avg == d_high)
816  which = 1;
817  else if(avg == d_medium)
818  which = 2;
819  else if(avg == d_low)
820  which = 3;
821  else {
822  ((OtherAction*)d_act[d_act.size()-1])->setDiagText(QString().setNum(avg));
823  which = 4;
824  }
825  return d_act[static_cast<int>(which)];
826  }
827 
828  void setHigh(float x)
829  {
830  d_high = x;
831  }
832 
833  void setMedium(float x)
834  {
835  d_medium = x;
836  }
837 
838  void setLow(float x)
839  {
840  d_low = x;
841  }
842 
843  signals:
844  void whichTrigger(float alpha);
845 
846  public slots:
847  void getOff() { emit whichTrigger(d_off); }
848  void getHigh() { emit whichTrigger(d_high); }
849  void getMedium() { emit whichTrigger(d_medium); }
850  void getLow() { emit whichTrigger(d_low); }
851  void getOther(const QString &str)
852  {
853  float value = str.toFloat();
854  emit whichTrigger(value);
855  }
856 
857 private:
858  QList<QAction *> d_act;
859  OtherAction *d_other;
860  QActionGroup *d_grp;
861  float d_off, d_high, d_medium, d_low;
862 };
863 
864 
865 /********************************************************************/
866 
867 
868 class FFTWindowMenu: public QMenu
869 {
870  Q_OBJECT
871 
872 public:
873  FFTWindowMenu(QWidget *parent)
874  : QMenu("FFT Window", parent)
875  {
876  d_act.push_back(new QAction("None", this));
877  d_act.push_back(new QAction("Hamming", this));
878  d_act.push_back(new QAction("Hann", this));
879  d_act.push_back(new QAction("Blackman", this));
880  d_act.push_back(new QAction("Blackman-harris", this));
881  d_act.push_back(new QAction("Rectangular", this));
882  d_act.push_back(new QAction("Kaiser", this));
883  d_act.push_back(new QAction("Flat-top", this));
884 
885  d_grp = new QActionGroup(this);
886  for(int t = 0; t < d_act.size(); t++) {
887  d_act[t]->setCheckable(true);
888  d_act[t]->setActionGroup(d_grp);
889  }
890 
891  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getNone()));
892  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getHamming()));
893  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getHann()));
894  connect(d_act[3], SIGNAL(triggered()), this, SLOT(getBlackman()));
895  connect(d_act[4], SIGNAL(triggered()), this, SLOT(getBlackmanharris()));
896  connect(d_act[5], SIGNAL(triggered()), this, SLOT(getRectangular()));
897  connect(d_act[6], SIGNAL(triggered()), this, SLOT(getKaiser()));
898  connect(d_act[7], SIGNAL(triggered()), this, SLOT(getFlattop()));
899 
900  QListIterator<QAction*> i(d_act);
901  while(i.hasNext()) {
902  QAction *a = i.next();
903  addAction(a);
904  }
905  }
906 
908  {}
909 
910  int getNumActions() const
911  {
912  return d_act.size();
913  }
914 
915  QAction * getAction(int which)
916  {
917  if(which < d_act.size())
918  return d_act[which];
919  else
920  throw std::runtime_error("FFTWindowMenu::getAction: which out of range.\n");
921  }
922 
924  {
925  int which = 0;
926  switch(static_cast<int>(type)) {
927  case((gr::filter::firdes::WIN_NONE)): which = 0; break;
928  case((gr::filter::firdes::WIN_HAMMING)): which = 1; break;
929  case((gr::filter::firdes::WIN_HANN)): which = 2; break;
930  case((gr::filter::firdes::WIN_BLACKMAN)): which = 3; break;
931  case((gr::filter::firdes::WIN_BLACKMAN_hARRIS)): which = 4; break;
932  case((gr::filter::firdes::WIN_RECTANGULAR)): which = 5; break;
933  case((gr::filter::firdes::WIN_KAISER)): which = 6; break;
934  case((gr::filter::firdes::WIN_FLATTOP)): which = 7; break;
935  }
936  return d_act[which];
937  }
938 
939 signals:
941 
942 public slots:
951 
952 private:
953  QList<QAction *> d_act;
954  QActionGroup *d_grp;
955  int d_which;
956 };
957 
958 
959 /********************************************************************/
960 
961 
962 class NPointsMenu: public QAction
963 {
964  Q_OBJECT
965 
966 public:
967  NPointsMenu(QWidget *parent)
968  : QAction("Number of Points", parent)
969  {
970  d_diag = new QDialog(parent);
971  d_diag->setWindowTitle("Number of Points");
972  d_diag->setModal(true);
973 
974  d_text = new QLineEdit();
975 
976  QGridLayout *layout = new QGridLayout(d_diag);
977  QPushButton *btn_ok = new QPushButton(tr("OK"));
978  QPushButton *btn_cancel = new QPushButton(tr("Cancel"));
979 
980  layout->addWidget(d_text, 0, 0, 1, 2);
981  layout->addWidget(btn_ok, 1, 0);
982  layout->addWidget(btn_cancel, 1, 1);
983 
984  connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText()));
985  connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
986 
987  connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag()));
988  }
989 
991  {}
992 
993  void setDiagText(const int npts)
994  {
995  d_text->setText(QString().setNum(npts));
996  }
997 
998 signals:
999  void whichTrigger(const int npts);
1000 
1001 public slots:
1003  {
1004  d_diag->show();
1005  }
1006 
1007 private slots:
1008  void getText()
1009  {
1010  emit whichTrigger(d_text->text().toInt());
1011  d_diag->accept();
1012  }
1013 
1014 private:
1015  QDialog *d_diag;
1016  QLineEdit *d_text;
1017 };
1018 
1019 
1020 /********************************************************************/
1021 
1022 
1023 class ColorMapMenu: public QMenu
1024 {
1025  Q_OBJECT
1026 
1027 public:
1028  ColorMapMenu(int which, QWidget *parent)
1029  : QMenu("Color Map", parent), d_which(which)
1030  {
1031  d_grp = new QActionGroup(this);
1032 
1033  d_act.push_back(new QAction("Multi-Color", this));
1034  d_act.push_back(new QAction("White Hot", this));
1035  d_act.push_back(new QAction("Black Hot", this));
1036  d_act.push_back(new QAction("Incandescent", this));
1037  d_act.push_back(new QAction("Sunset", this));
1038  d_act.push_back(new QAction("Cool", this));
1039  d_act.push_back(new QAction("Other", this));
1040  //d_act.push_back(new OtherDualAction("Min Intensity: ", "Max Intensity: ", this));
1041 
1042  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getMultiColor()));
1043  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getWhiteHot()));
1044  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getBlackHot()));
1045  connect(d_act[3], SIGNAL(triggered()), this, SLOT(getIncandescent()));
1046  connect(d_act[4], SIGNAL(triggered()), this, SLOT(getSunset()));
1047  connect(d_act[5], SIGNAL(triggered()), this, SLOT(getCool()));
1048  connect(d_act[6], SIGNAL(triggered()), this, SLOT(getOther()));
1049 
1050  QListIterator<QAction*> i(d_act);
1051  while(i.hasNext()) {
1052  QAction *a = i.next();
1053  a->setCheckable(true);
1054  a->setActionGroup(d_grp);
1055  addAction(a);
1056  }
1057 
1058  d_max_value = QColor("white");
1059  d_min_value = QColor("white");
1060  }
1061 
1063  {}
1064 
1065  int getNumActions() const
1066  {
1067  return d_act.size();
1068  }
1069 
1070  QAction * getAction(int which)
1071  {
1072  if(which < d_act.size())
1073  return d_act[which];
1074  else
1075  throw std::runtime_error("ColorMapMenu::getAction: which out of range.\n");
1076  }
1077 
1078  signals:
1079  void whichTrigger(int which, const int type,
1080  const QColor &min_color=QColor(),
1081  const QColor &max_color=QColor());
1082 
1083  public slots:
1090  //void getOther(d_which, const QString &min_str, const QString &max_str)
1091  void getOther()
1092  {
1093  QMessageBox::information(this, "Set low and high intensities",
1094  "In the next windows, select the low and then the high intensity colors.",
1095  QMessageBox::Ok);
1096  d_min_value = QColorDialog::getColor(d_min_value, this);
1097  d_max_value = QColorDialog::getColor(d_max_value, this);
1098 
1100  d_min_value, d_max_value);
1101  }
1102 
1103 private:
1104  QActionGroup *d_grp;
1105  QList<QAction *> d_act;
1106  OtherDualAction *d_other;
1107  QColor d_max_value, d_min_value;
1108  int d_which;
1109 };
1110 
1111 
1112 /********************************************************************/
1113 
1114 
1115 class TriggerModeMenu: public QMenu
1116 {
1117  Q_OBJECT
1118 
1119 public:
1120  TriggerModeMenu(QWidget *parent)
1121  : QMenu("Mode", parent)
1122  {
1123  d_grp = new QActionGroup(this);
1124  d_act.push_back(new QAction("Free", this));
1125  d_act.push_back(new QAction("Auto", this));
1126  d_act.push_back(new QAction("Normal", this));
1127  d_act.push_back(new QAction("Tag", this));
1128 
1129  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getFree()));
1130  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getAuto()));
1131  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getNorm()));
1132  connect(d_act[3], SIGNAL(triggered()), this, SLOT(getTag()));
1133 
1134  QListIterator<QAction*> i(d_act);
1135  while(i.hasNext()) {
1136  QAction *a = i.next();
1137  a->setCheckable(true);
1138  a->setActionGroup(d_grp);
1139  addAction(a);
1140  }
1141  }
1142 
1144  {}
1145 
1146  int getNumActions() const
1147  {
1148  return d_act.size();
1149  }
1150 
1151  QAction * getAction(int which)
1152  {
1153  if(which < d_act.size())
1154  return d_act[which];
1155  else
1156  throw std::runtime_error("TriggerModeMenu::getAction: which out of range.\n");
1157  }
1158 
1160  {
1161  switch(mode) {
1163  return d_act[0];
1164  break;
1166  return d_act[1];
1167  break;
1169  return d_act[2];
1170  break;
1172  return d_act[3];
1173  break;
1174  default:
1175  throw std::runtime_error("TriggerModeMenu::getAction: unknown trigger mode.\n");
1176  }
1177  }
1178 
1179 signals:
1181 
1182 public slots:
1187 
1188 private:
1189  QList<QAction *> d_act;
1190  QActionGroup *d_grp;
1191 };
1192 
1193 
1194 /********************************************************************/
1195 
1196 
1197 class TriggerSlopeMenu: public QMenu
1198 {
1199  Q_OBJECT
1200 
1201 public:
1202  TriggerSlopeMenu(QWidget *parent)
1203  : QMenu("Slope", parent)
1204  {
1205  d_grp = new QActionGroup(this);
1206  d_act.push_back(new QAction("Positive", this));
1207  d_act.push_back(new QAction("Negative", this));
1208 
1209  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getPos()));
1210  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getNeg()));
1211 
1212  QListIterator<QAction*> i(d_act);
1213  while(i.hasNext()) {
1214  QAction *a = i.next();
1215  a->setCheckable(true);
1216  a->setActionGroup(d_grp);
1217  addAction(a);
1218  }
1219  }
1220 
1222  {}
1223 
1224  int getNumActions() const
1225  {
1226  return d_act.size();
1227  }
1228 
1229  QAction * getAction(int which)
1230  {
1231  if(which < d_act.size())
1232  return d_act[which];
1233  else
1234  throw std::runtime_error("TriggerSlopeMenu::getAction: which out of range.\n");
1235  }
1236 
1238  {
1239  switch(slope) {
1241  return d_act[0];
1242  break;
1244  return d_act[1];
1245  break;
1246  default:
1247  throw std::runtime_error("TriggerSlopeMenu::getAction: unknown trigger slope.\n");
1248  }
1249  }
1250 
1251 signals:
1253 
1254 public slots:
1257 
1258 private:
1259  QList<QAction *> d_act;
1260  QActionGroup *d_grp;
1261 };
1262 
1263 
1264 /********************************************************************/
1265 
1266 
1267 class TriggerChannelMenu: public QMenu
1268 {
1269  Q_OBJECT
1270 
1271 public:
1272  TriggerChannelMenu(int nchans, QWidget *parent)
1273  : QMenu("Channel", parent)
1274  {
1275  d_grp = new QActionGroup(this);
1276  for(int i = 0; i < nchans; i++) {
1277  d_act.push_back(new QAction(QString().setNum(i), this));
1278  d_act[i]->setCheckable(true);
1279  d_act[i]->setActionGroup(d_grp);
1280 
1281  addAction(d_act[i]);
1282  connect(d_act[i], SIGNAL(triggered()), this, SLOT(getChannel()));
1283  }
1284  }
1285 
1287  {}
1288 
1289  int getNumActions() const
1290  {
1291  return d_act.size();
1292  }
1293 
1294  QAction * getAction(int which)
1295  {
1296  if(which < d_act.size())
1297  return d_act[which];
1298  else
1299  throw std::runtime_error("TriggerChannelMenu::getAction: which out of range.\n");
1300  }
1301 
1302 
1303 signals:
1304  void whichTrigger(int n);
1305 
1306 public slots:
1307  void getChannel()
1308  {
1309  QAction *a = d_grp->checkedAction();
1310  int which = a->text().toInt();
1311  emit whichTrigger(which);
1312  }
1313 
1314 private:
1315  QList<QAction *> d_act;
1316  QActionGroup *d_grp;
1317 };
1318 
1319 
1320 /********************************************************************/
1321 
1322 
1323 class NumberLayoutMenu: public QMenu
1324 {
1325  Q_OBJECT
1326 
1327 public:
1328  NumberLayoutMenu(QWidget *parent)
1329  : QMenu("Layout", parent)
1330  {
1331  d_grp = new QActionGroup(this);
1332  d_act.push_back(new QAction("Horizontal", this));
1333  d_act.push_back(new QAction("Vertical", this));
1334  d_act.push_back(new QAction("None", this));
1335 
1336  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getHoriz()));
1337  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getVert()));
1338  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getNone()));
1339 
1340  QListIterator<QAction*> i(d_act);
1341  while(i.hasNext()) {
1342  QAction *a = i.next();
1343  a->setCheckable(true);
1344  a->setActionGroup(d_grp);
1345  addAction(a);
1346  }
1347  }
1348 
1350  {}
1351 
1352  int getNumActions() const
1353  {
1354  return d_act.size();
1355  }
1356 
1357  QAction * getAction(int which)
1358  {
1359  if(which < d_act.size())
1360  return d_act[which];
1361  else
1362  throw std::runtime_error("NumberLayoutMenu::getAction: which out of range.\n");
1363  }
1364 
1365  QAction * getAction(gr::qtgui::graph_t layout)
1366  {
1367  switch(layout) {
1369  return d_act[0];
1370  break;
1372  return d_act[1];
1373  break;
1375  return d_act[1];
1376  break;
1377  default:
1378  throw std::runtime_error("NumberLayoutMenu::getAction: unknown layout type.\n");
1379  }
1380  }
1381 
1382 signals:
1383  void whichTrigger(gr::qtgui::graph_t layout);
1384 
1385 public slots:
1389 
1390 private:
1391  QList<QAction *> d_act;
1392  QActionGroup *d_grp;
1393 };
1394 
1395 
1396 /********************************************************************/
1397 
1398 
1399 class NumberColorMapMenu: public QMenu
1400 {
1401  Q_OBJECT
1402 
1403 public:
1404  NumberColorMapMenu(int which, QWidget *parent)
1405  : QMenu("Color Map", parent), d_which(which)
1406  {
1407  d_grp = new QActionGroup(this);
1408 
1409  d_act.push_back(new QAction("Black", this));
1410  d_act.push_back(new QAction("Blue-Red", this));
1411  d_act.push_back(new QAction("White Hot", this));
1412  d_act.push_back(new QAction("Black Hot", this));
1413  d_act.push_back(new QAction("Black-Red", this));
1414  d_act.push_back(new QAction("Other", this));
1415 
1416  connect(d_act[0], SIGNAL(triggered()), this, SLOT(getBlack()));
1417  connect(d_act[1], SIGNAL(triggered()), this, SLOT(getBlueRed()));
1418  connect(d_act[2], SIGNAL(triggered()), this, SLOT(getWhiteHot()));
1419  connect(d_act[3], SIGNAL(triggered()), this, SLOT(getBlackHot()));
1420  connect(d_act[4], SIGNAL(triggered()), this, SLOT(getBlackRed()));
1421  connect(d_act[5], SIGNAL(triggered()), this, SLOT(getOther()));
1422 
1423  QListIterator<QAction*> i(d_act);
1424  while(i.hasNext()) {
1425  QAction *a = i.next();
1426  a->setCheckable(true);
1427  a->setActionGroup(d_grp);
1428  addAction(a);
1429  }
1430 
1431  d_max_value = QColor("black");
1432  d_min_value = QColor("black");
1433  }
1434 
1436  {}
1437 
1438  int getNumActions() const
1439  {
1440  return d_act.size();
1441  }
1442 
1443  QAction * getAction(int which)
1444  {
1445  if(which < d_act.size())
1446  return d_act[which];
1447  else
1448  throw std::runtime_error("ColorMapMenu::getAction: which out of range.\n");
1449  }
1450 
1451  signals:
1452  void whichTrigger(int which,
1453  const QColor &min_color,
1454  const QColor &max_color);
1455 
1456  public slots:
1457  void getBlack() { emit whichTrigger(d_which, QColor("black"), QColor("black")); }
1458  void getBlueRed() { emit whichTrigger(d_which, QColor("blue"), QColor("red")); }
1459  void getWhiteHot() { emit whichTrigger(d_which, QColor("black"), QColor("white")); }
1460  void getBlackHot() { emit whichTrigger(d_which, QColor("white"), QColor("black")); }
1461  void getBlackRed() { emit whichTrigger(d_which, QColor("black"), QColor("red")); }
1462  void getOther()
1463  {
1464  QMessageBox::information(this, "Set low and high intensities",
1465  "In the next windows, select the low and then the high intensity colors.",
1466  QMessageBox::Ok);
1467  d_min_value = QColorDialog::getColor(d_min_value, this);
1468  d_max_value = QColorDialog::getColor(d_max_value, this);
1469 
1470  emit whichTrigger(d_which, d_min_value, d_max_value);
1471  }
1472 
1473 private:
1474  QActionGroup *d_grp;
1475  QList<QAction *> d_act;
1476  QColor d_max_value, d_min_value;
1477  int d_which;
1478 };
1479 
1480 
1481 /********************************************************************/
1482 
1483 
1484 class PopupMenu: public QAction
1485 {
1486  Q_OBJECT
1487 
1488 public:
1489  PopupMenu(QString desc, QWidget *parent)
1490  : QAction(desc, parent)
1491  {
1492  d_diag = new QDialog(parent);
1493  d_diag->setWindowTitle(desc);
1494  d_diag->setModal(true);
1495 
1496  d_text = new QLineEdit();
1497 
1498  QGridLayout *layout = new QGridLayout(d_diag);
1499  QPushButton *btn_ok = new QPushButton(tr("OK"));
1500  QPushButton *btn_cancel = new QPushButton(tr("Cancel"));
1501 
1502  layout->addWidget(d_text, 0, 0, 1, 2);
1503  layout->addWidget(btn_ok, 1, 0);
1504  layout->addWidget(btn_cancel, 1, 1);
1505 
1506  connect(btn_ok, SIGNAL(clicked()), this, SLOT(getText()));
1507  connect(btn_cancel, SIGNAL(clicked()), d_diag, SLOT(close()));
1508 
1509  connect(this, SIGNAL(triggered()), this, SLOT(getTextDiag()));
1510  }
1511 
1513  {}
1514 
1515  void setText(QString s)
1516  {
1517  d_text->setText(s);
1518  }
1519 
1520 signals:
1521  void whichTrigger(const QString data);
1522 
1523 public slots:
1525  {
1526  d_diag->show();
1527  }
1528 
1529 private slots:
1530  void getText()
1531  {
1532  emit whichTrigger(d_text->text());
1533  d_diag->accept();
1534  }
1535 
1536 private:
1537  QDialog *d_diag;
1538  QLineEdit *d_text;
1539 };
1540 
1541 
1542 /********************************************************************/
1543 
1544 
1545 #endif /* FORM_MENUS_H */
void getYellow()
Definition: form_menus.h:107
QAction * getAction(int which)
Definition: form_menus.h:915
void getNone()
Definition: form_menus.h:1388
OtherAction(QWidget *parent)
Definition: form_menus.h:502
Definition: form_menus.h:1323
void getDarkRed()
Definition: form_menus.h:109
void whichTrigger(const int npts)
Definition: qtgui_types.h:144
void whichTrigger(int which, QwtSymbol::Style)
QAction * getAction(int which)
Definition: form_menus.h:1151
void getDarkBlue()
Definition: form_menus.h:111
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:38
void getLow()
Definition: form_menus.h:425
Hann window; max attenuation 44 dB.
Definition: firdes.h:48
void getBlue()
Definition: form_menus.h:101
QAction * getAction(int which)
Definition: form_menus.h:1294
QAction * getAction(int which)
Definition: form_menus.h:412
void getEight()
Definition: form_menus.h:192
TriggerModeMenu(QWidget *parent)
Definition: form_menus.h:1120
Definition: form_menus.h:1115
void whichTrigger(int which, const QString &name)
Hamming window; max attenuation 53 dB.
Definition: firdes.h:47
~OtherAction()
Definition: form_menus.h:525
int getNumActions() const
Definition: form_menus.h:168
void getTextDiag()
Definition: form_menus.h:605
void getDash()
Definition: form_menus.h:261
void getDiamond()
Definition: form_menus.h:350
void get05()
Definition: form_menus.h:720
QAction * getAction(gr::qtgui::trigger_slope slope)
Definition: form_menus.h:1237
Definition: form_menus.h:1484
QAction * getAction(int which)
Definition: form_menus.h:1070
void getNone()
Definition: form_menus.h:943
LineWidthMenu(int which, QWidget *parent)
Definition: form_menus.h:129
PopupMenu(QString desc, QWidget *parent)
Definition: form_menus.h:1489
void getOne()
Definition: form_menus.h:185
void getOther(const QString &str)
Definition: form_menus.h:731
~FFTWindowMenu()
Definition: form_menus.h:907
Definition: qtgui_types.h:158
~PopupMenu()
Definition: form_menus.h:1512
void getPos()
Definition: form_menus.h:1255
void whichTrigger(gr::qtgui::graph_t layout)
NumberLayoutMenu(QWidget *parent)
Definition: form_menus.h:1328
void getTen()
Definition: form_menus.h:194
void get10()
Definition: form_menus.h:725
int getNumActions() const
Definition: form_menus.h:84
TriggerSlopeMenu(QWidget *parent)
Definition: form_menus.h:1202
void getNorm()
Definition: form_menus.h:1185
Definition: form_menus.h:440
void getBlack()
Definition: form_menus.h:104
void getTag()
Definition: form_menus.h:1186
Basic rectangular window.
Definition: firdes.h:50
~LineTitleAction()
Definition: form_menus.h:467
void whichTrigger(gr::qtgui::trigger_mode mode)
Definition: form_menus.h:962
FFTSizeMenu(QWidget *parent)
Definition: form_menus.h:632
int getNumActions() const
Definition: form_menus.h:330
void whichTrigger(const QString data)
void get08()
Definition: form_menus.h:723
void getCircle()
Definition: form_menus.h:348
void getSix()
Definition: form_menus.h:190
~LineStyleMenu()
Definition: form_menus.h:239
int getNumActions() const
Definition: form_menus.h:1289
int getNumActions() const
Definition: form_menus.h:1224
QAction * getActionFromWindow(gr::filter::firdes::win_type type)
Definition: form_menus.h:923
Definition: form_menus.h:497
void getDots()
Definition: form_menus.h:262
void getBlueRed()
Definition: form_menus.h:1458
QAction * getAction(int which)
Definition: form_menus.h:1229
QAction * getAction(int which)
Definition: form_menus.h:690
Definition: qtgui_types.h:155
void setValidator(QValidator *v)
Definition: form_menus.h:528
void getDarkGray()
Definition: form_menus.h:112
void getHann()
Definition: form_menus.h:945
Definition: form_menus.h:206
void getGray()
Definition: form_menus.h:108
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:37
void getHoriz()
Definition: form_menus.h:1386
Kaiser window; max attenuation a function of beta, google it.
Definition: firdes.h:51
void setHigh(float x)
Definition: form_menus.h:828
QAction * getActionFromAvg(float avg)
Definition: form_menus.h:810
graph_t
Definition: qtgui_types.h:142
void getFree()
Definition: form_menus.h:1183
Definition: form_menus.h:373
LineStyleMenu(int which, QWidget *parent)
Definition: form_menus.h:211
int getNumActions() const
Definition: form_menus.h:1146
Definition: form_menus.h:1197
QAction * getAction(int which)
Definition: form_menus.h:89
Definition: form_menus.h:747
void getCross()
Definition: form_menus.h:355
void get06()
Definition: form_menus.h:721
void getGreen()
Definition: form_menus.h:103
void getFlattop()
Definition: form_menus.h:950
void getVert()
Definition: form_menus.h:1387
Definition: form_menus.h:562
~NPointsMenu()
Definition: form_menus.h:990
void getBlack()
Definition: form_menus.h:1457
void getTextDiag()
Definition: form_menus.h:542
int getNumActions() const
Definition: form_menus.h:1352
int getNumActions() const
Definition: form_menus.h:1065
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:31
void getNine()
Definition: form_menus.h:193
void getBlackman()
Definition: form_menus.h:946
Definition: cc_common.h:45
QAction * getActionFromSize(int size)
Definition: form_menus.h:698
~MarkerAlphaMenu()
Definition: form_menus.h:404
TriggerChannelMenu(int nchans, QWidget *parent)
Definition: form_menus.h:1272
void getWhiteHot()
Definition: form_menus.h:1085
void getNone()
Definition: form_menus.h:424
void get11()
Definition: form_menus.h:726
void whichTrigger(int which, int)
Definition: qtgui_types.h:157
don't use a window
Definition: firdes.h:46
OtherDualAction(QString label0, QString label1, QWidget *parent)
Definition: form_menus.h:567
~LineMarkerMenu()
Definition: form_menus.h:327
~LineWidthMenu()
Definition: form_menus.h:165
QAction * getAction(gr::qtgui::trigger_mode mode)
Definition: form_menus.h:1159
Definition: qtgui_types.h:159
void getOff()
Definition: form_menus.h:847
void getOther(const QString &str)
Definition: form_menus.h:851
int getNumActions() const
Definition: form_menus.h:685
void getVLine()
Definition: form_menus.h:358
void setDiagText(QString text)
Definition: form_menus.h:533
Definition: form_menus.h:627
~FFTAverageMenu()
Definition: form_menus.h:794
~ColorMapMenu()
Definition: form_menus.h:1062
flat top window; useful in FFTs
Definition: firdes.h:55
Definition: form_menus.h:868
void whichTrigger(int which, Qt::PenStyle)
void getWhiteHot()
Definition: form_menus.h:1459
void setDiagText(const int npts)
Definition: form_menus.h:993
void getBlackHot()
Definition: form_menus.h:1460
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
void getRectangular()
Definition: form_menus.h:948
~TriggerSlopeMenu()
Definition: form_menus.h:1221
void whichTrigger(const QString &text)
void getMedium()
Definition: form_menus.h:849
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:33
void getTextDiag()
Definition: form_menus.h:1524
NPointsMenu(QWidget *parent)
Definition: form_menus.h:967
Definition: qtgui_types.h:145
void getFour()
Definition: form_menus.h:188
void getNone()
Definition: form_menus.h:259
Blackman window; max attenuation 74 dB.
Definition: firdes.h:49
QAction * getAction(int which)
Definition: form_menus.h:1443
void getTriangle()
Definition: form_menus.h:351
void whichTrigger(int n)
void getOther()
Definition: form_menus.h:1091
~TriggerChannelMenu()
Definition: form_menus.h:1286
LineMarkerMenu(int which, QWidget *parent)
Definition: form_menus.h:281
void whichTrigger(int which, const int type, const QColor &min_color=QColor(), const QColor &max_color=QColor())
void getKaiser()
Definition: form_menus.h:949
int getNumActions() const
Definition: form_menus.h:797
void getCyan()
Definition: form_menus.h:105
void whichTrigger(int which, const QString &text)
QAction * getAction(int which)
Definition: form_menus.h:247
void getNone()
Definition: form_menus.h:347
void getMedium()
Definition: form_menus.h:426
QAction * getAction(int which)
Definition: form_menus.h:173
void getXCross()
Definition: form_menus.h:356
void getHigh()
Definition: form_menus.h:848
void getNeg()
Definition: form_menus.h:1256
int getNumActions() const
Definition: form_menus.h:242
void whichTrigger(float alpha)
void getAuto()
Definition: form_menus.h:1184
void getSolid()
Definition: form_menus.h:260
void getMultiColor()
Definition: form_menus.h:1084
~LineColorMenu()
Definition: form_menus.h:81
void getDashDot()
Definition: form_menus.h:263
void getBlackHot()
Definition: form_menus.h:1086
void getRed()
Definition: form_menus.h:102
FFTWindowMenu(QWidget *parent)
Definition: form_menus.h:873
void getDashDotDot()
Definition: form_menus.h:264
void getDTriangle()
Definition: form_menus.h:352
void getOther()
Definition: form_menus.h:1462
void getCool()
Definition: form_menus.h:1089
int getNumActions() const
Definition: form_menus.h:407
void getTextDiag()
Definition: form_menus.h:1002
MarkerAlphaMenu(int which, QWidget *parent)
Definition: form_menus.h:378
void getHamming()
Definition: form_menus.h:944
void getSeven()
Definition: form_menus.h:191
void get09()
Definition: form_menus.h:724
void whichTrigger(int which, const QColor &min_color, const QColor &max_color)
void getRTriangle()
Definition: form_menus.h:354
void getIncandescent()
Definition: form_menus.h:1087
Definition: form_menus.h:124
int getNumActions() const
Definition: form_menus.h:910
void getHLine()
Definition: form_menus.h:357
void getStar2()
Definition: form_menus.h:360
void getFive()
Definition: form_menus.h:189
~OtherDualAction()
Definition: form_menus.h:598
void getStar1()
Definition: form_menus.h:359
Definition: form_menus.h:276
Definition: form_menus.h:36
LineTitleAction(int which, QWidget *parent)
Definition: form_menus.h:445
void getBlackmanharris()
Definition: form_menus.h:947
VOLK_API $kern pname $kern name
A function pointer to the dispatcher implementation.
void getRect()
Definition: form_menus.h:349
void getChannel()
Definition: form_menus.h:1307
NumberColorMapMenu(int which, QWidget *parent)
Definition: form_menus.h:1404
void getThree()
Definition: form_menus.h:187
void getDarkGreen()
Definition: form_menus.h:110
void getTwo()
Definition: form_menus.h:186
~NumberLayoutMenu()
Definition: form_menus.h:1349
~TriggerModeMenu()
Definition: form_menus.h:1143
LineColorMenu(int which, QWidget *parent)
Definition: form_menus.h:41
void whichTrigger(const gr::filter::firdes::win_type type)
void setText(QString s)
Definition: form_menus.h:1515
void getMagenta()
Definition: form_menus.h:106
void getHigh()
Definition: form_menus.h:427
Definition: qtgui_types.h:153
void get07()
Definition: form_menus.h:722
Blackman-harris window.
Definition: firdes.h:52
Definition: gr-qtgui/include/gnuradio/qtgui/trigger_mode.h:32
void getLTriangle()
Definition: form_menus.h:353
Definition: form_menus.h:1023
QAction * getAction(int which)
Definition: form_menus.h:1357
~FFTSizeMenu()
Definition: form_menus.h:682
void getBlackRed()
Definition: form_menus.h:1461
void setLow(float x)
Definition: form_menus.h:838
void whichTrigger(int size)
void getOff()
Definition: form_menus.h:428
void getTextDiag()
Definition: form_menus.h:474
Definition: form_menus.h:1267
QAction * getAction(int which)
Definition: form_menus.h:335
~NumberColorMapMenu()
Definition: form_menus.h:1435
win_type
Definition: firdes.h:45
void getLow()
Definition: form_menus.h:850
ColorMapMenu(int which, QWidget *parent)
Definition: form_menus.h:1028
Definition: qtgui_types.h:143
void setMedium(float x)
Definition: form_menus.h:833
QAction * getAction(int which)
Definition: form_menus.h:802
void whichTrigger(gr::qtgui::trigger_slope slope)
FFTAverageMenu(QWidget *parent)
Definition: form_menus.h:752
Definition: form_menus.h:1399
void getSunset()
Definition: form_menus.h:1088
void getHexagon()
Definition: form_menus.h:361
void get12()
Definition: form_menus.h:727
int getNumActions() const
Definition: form_menus.h:1438
void whichTrigger(int which, int width)
QAction * getAction(gr::qtgui::graph_t layout)
Definition: form_menus.h:1365