GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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  std::string title() const;
55  std::string unit(int which) const;
56  float factor(int which) const;
57 
58 public slots:
59  void mousePressEvent(QMouseEvent * e);
60  void customEvent(QEvent * e);
61  void setStop(bool on);
62  void setStop();
63  void setGraphType(const gr::qtgui::graph_t type);
64  void setColor(int which, const QColor &min, const QColor &max);
65  void setColorMin(int which, QString min);
66  void setColorMax(int which, QString max);
67  void setLabel(int which, const std::string &label);
68  void setLabel(int which, QString label);
69  void setAverage(const float avg);
70  void setUpdateTime(const float time);
71  void setUpdateTime(QString time);
72  void saveFigure();
73  void setScale(int which, int min, int max);
74  void setScaleMin(int which, int min);
75  void setScaleMax(int which, int max);
76  void autoScale(bool on);
77  void setTitle(const std::string &title);
78  void setUnit(int which, const std::string &unit);
79  void setFactor(int which, float factor);
80 
81 private slots:
82  void newData(const QEvent*);
83 
84 private:
85  int d_nplots;
86  QGridLayout *d_layout;
87  std::vector<QLabel*> d_label;
88  std::vector<QLabel*> d_text_box;
89  std::vector<QwtThermo*> d_indicator;
90  gr::qtgui::graph_t d_graph_type;
91  float d_avg, d_update_time;
92  std::vector<float> d_max, d_min;
93 
94  bool d_menu_on;
95  bool d_stop_state;
96  bool d_autoscale_state;
97 
98  QMenu *d_menu;
99  QAction *d_stop_act;
100  QList<QMenu*> d_label_menu;
101  std::vector<LineTitleAction*> d_label_act;
102  std::vector<ItemFloatAct*> d_factor_act;
103  FFTAverageMenu *d_avg_menu;
104  NumberLayoutMenu *d_layout_menu;
105  std::vector<NumberColorMapMenu*> d_color_menu;
106  PopupMenu *d_maxcolor_menu;
107  QAction *d_autoscale_act;
108  PopupMenu *d_update_time_menu;
109  QAction *d_save_act;
110 
111  QLabel *d_title;
112  std::vector<std::string> d_unit;
113  std::vector<float> d_factor;
114 };
115 
116 #endif /* NUMBER_DISPLAY_FORM_H */
Definition: form_menus.h:1333
Definition: qtgui_types.h:144
float factor(int which) const
Definition: form_menus.h:1494
QColor colorMin(int which) const
float min(float a, float b)
int scaleMin(int which)
void setTitle(const std::string &title)
graph_t
Definition: qtgui_types.h:142
Definition: form_menus.h:864
void setColorMax(int which, QString max)
void setAverage(const float avg)
gr::qtgui::graph_t graphType() const
std::string title() 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 setUnit(int which, const std::string &unit)
void autoScale(bool on)
QColor colorMax(int which) const
void setFactor(int which, float factor)
void customEvent(QEvent *e)
std::string unit(int which) const
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