GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
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(unsigned int which) const;
48  QColor colorMax(unsigned int which) const;
49  std::string label(unsigned int which) const;
50  float average() const;
51  float updateTime() const;
52  int scaleMin(unsigned int which);
53  int scaleMax(unsigned int which);
54  std::string title() const;
55  std::string unit(unsigned int which) const;
56  float factor(unsigned 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(unsigned int which, const QColor& min, const QColor& max);
65  void setColorMin(unsigned int which, QString min);
66  void setColorMax(unsigned int which, QString max);
67  void setLabel(unsigned int which, const std::string& label);
68  void setLabel(unsigned 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(unsigned int which, int min, int max);
74  void setScaleMin(unsigned int which, int min);
75  void setScaleMax(unsigned int which, int max);
76  void autoScale(bool on);
77  void setTitle(const std::string& title);
78  void setUnit(unsigned int which, const std::string& unit);
79  void setFactor(unsigned int which, float factor);
80 
81 private slots:
82  void newData(const QEvent*);
83 
84 private:
85  unsigned 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 */
QColor colorMin(unsigned int which) const
Definition: form_menus.h:1283
Definition: qtgui_types.h:132
void setScale(unsigned int which, int min, int max)
Definition: form_menus.h:1438
void setScaleMin(unsigned int which, int min)
void setLabel(unsigned int which, const std::string &label)
float min(float a, float b)
float factor(unsigned int which) const
void setTitle(const std::string &title)
graph_t
Definition: qtgui_types.h:130
void setColor(unsigned int which, const QColor &min, const QColor &max)
Definition: form_menus.h:815
std::string label(unsigned int which) const
void setColorMin(unsigned int which, QString min)
void setUnit(unsigned int which, const std::string &unit)
QColor colorMax(unsigned int which) const
int scaleMin(unsigned int which)
std::string title() const
void setAverage(const float avg)
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)
std::string unit(unsigned int which) const
void setColorMax(unsigned int which, QString max)
gr::qtgui::graph_t graphType() const
void autoScale(bool on)
int scaleMax(unsigned int which)
void customEvent(QEvent *e)
float updateTime() const
NumberDisplayForm(int nplots=1, gr::qtgui::graph_t type=gr::qtgui::NUM_GRAPH_HORIZ, QWidget *parent=0)
void setFactor(unsigned int which, float factor)
void setScaleMax(unsigned int which, int max)
float average() const