GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
numberdisplayform.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 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 NUMBER_DISPLAY_FORM_H
24 #define NUMBER_DISPLAY_FORM_H
25 
28 #include <QtGui/QtGui>
29 #include <qwt_thermo.h>
30 #include <vector>
31 
32 /*!
33  * \brief DisplayForm child for managing number sink plots.
34  * \ingroup qtgui_blk
35  */
36 class NumberDisplayForm : public QWidget
37 {
38  Q_OBJECT
39 
40  public:
41  NumberDisplayForm(int nplots=1,
43  QWidget* parent = 0);
45 
47  QColor colorMin(int which) const;
48  QColor colorMax(int which) const;
49  std::string label(int which) const;
50  float average() const;
51  float updateTime() const;
52  int scaleMin(int which);
53  int scaleMax(int which);
54 
55 public slots:
56  void mousePressEvent(QMouseEvent * e);
57  void customEvent(QEvent * e);
58  void setStop(bool on);
59  void setStop();
60  void setGraphType(const gr::qtgui::graph_t type);
61  void setColor(int which, const QColor &min, const QColor &max);
62  void setColorMin(int which, QString min);
63  void setColorMax(int which, QString max);
64  void setLabel(int which, const std::string &label);
65  void setLabel(int which, QString label);
66  void setAverage(const float avg);
67  void setUpdateTime(const float time);
68  void setUpdateTime(QString time);
69  void saveFigure();
70  void setScale(int which, int min, int max);
71  void setScaleMin(int which, int min);
72  void setScaleMax(int which, int max);
73  void autoScale(bool on);
74 
75 private slots:
76  void newData(const QEvent*);
77 
78 private:
79  int d_nplots;
80  QGridLayout *d_layout;
81  std::vector<QLabel*> d_label;
82  std::vector<QLabel*> d_text_box;
83  std::vector<QwtThermo*> d_indicator;
84  gr::qtgui::graph_t d_graph_type;
85  float d_avg, d_update_time;
86  std::vector<float> d_max, d_min;
87 
88  bool d_menu_on;
89  bool d_stop_state;
90  bool d_autoscale_state;
91 
92  QMenu *d_menu;
93  QAction *d_stop_act;
94  QList<QMenu*> d_label_menu;
95  std::vector<LineTitleAction*> d_label_act;
96  FFTAverageMenu *d_avg_menu;
97  NumberLayoutMenu *d_layout_menu;
98  std::vector<NumberColorMapMenu*> d_color_menu;
99  PopupMenu *d_maxcolor_menu;
100  QAction *d_autoscale_act;
101  PopupMenu *d_update_time_menu;
102  QAction *d_save_act;
103 };
104 
105 #endif /* NUMBER_DISPLAY_FORM_H */
Definition: form_menus.h:1323
Definition: qtgui_types.h:144
Definition: form_menus.h:1484
QColor colorMin(int which) const
float min(float a, float b)
int scaleMin(int which)
graph_t
Definition: qtgui_types.h:142
Definition: form_menus.h:747
void setColorMax(int which, QString max)
void setAverage(const float avg)
gr::qtgui::graph_t graphType() const
void setColor(int which, const QColor &min, const QColor &max)
std::string label(int which) const
DisplayForm child for managing number sink plots.
Definition: numberdisplayform.h:36
void mousePressEvent(QMouseEvent *e)
void setGraphType(const gr::qtgui::graph_t type)
void setUpdateTime(const float time)
void setScaleMin(int which, int min)
void setColorMin(int which, QString min)
void setLabel(int which, const std::string &label)
int scaleMax(int which)
void autoScale(bool on)
QColor colorMax(int which) const
void customEvent(QEvent *e)
NumberDisplayForm(int nplots=1, gr::qtgui::graph_t type=gr::qtgui::NUM_GRAPH_HORIZ, QWidget *parent=0)
float average() const
void setScaleMax(int which, int max)
void setScale(int which, int min, int max)
float updateTime() const