GNU Radio Manual and C++ API Reference 3.10.5.1
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 * SPDX-License-Identifier: GPL-3.0-or-later
8 *
9 */
10
11#ifndef NUMBER_DISPLAY_FORM_H
12#define NUMBER_DISPLAY_FORM_H
13
16#include <QtGui/QtGui>
17#include <qwt_thermo.h>
18#include <vector>
19
20/*!
21 * \brief DisplayForm child for managing number sink plots.
22 * \ingroup qtgui_blk
23 */
24class NumberDisplayForm : public QWidget
25{
26 Q_OBJECT
27
28public:
29 NumberDisplayForm(int nplots = 1,
31 QWidget* parent = 0);
33
35 QColor colorMin(unsigned int which) const;
36 QColor colorMax(unsigned int which) const;
37 std::string label(unsigned int which) const;
38 float average() const;
39 float updateTime() const;
40 int scaleMin(unsigned int which);
41 int scaleMax(unsigned int which);
42 std::string title() const;
43 std::string unit(unsigned int which) const;
44 float factor(unsigned int which) const;
45
46public slots:
47 void mousePressEvent(QMouseEvent* e) override;
48 void customEvent(QEvent* e) override;
49 void setStop(bool on);
50 void setStop();
52 void setColor(unsigned int which, const QColor& min, const QColor& max);
53 void setColorMin(unsigned int which, QString min);
54 void setColorMax(unsigned int which, QString max);
55 void setLabel(unsigned int which, const std::string& label);
56 void setLabel(unsigned int which, QString label);
57 void setAverage(const float avg);
58 void setUpdateTime(const float time);
59 void setUpdateTime(QString time);
60 void saveFigure();
61 void setScale(unsigned int which, int min, int max);
62 void setScaleMin(unsigned int which, int min);
63 void setScaleMax(unsigned int which, int max);
64 void autoScale(bool on);
65 void setTitle(const std::string& title);
66 void setUnit(unsigned int which, const std::string& unit);
67 void setFactor(unsigned int which, float factor);
68
69private slots:
70 void newData(const QEvent*);
71
72private:
73 unsigned int d_nplots;
74 QGridLayout* d_layout;
75 std::vector<QLabel*> d_label;
76 std::vector<QLabel*> d_text_box;
77 std::vector<QwtThermo*> d_indicator;
78 gr::qtgui::graph_t d_graph_type;
79 float d_avg, d_update_time;
80 std::vector<float> d_max, d_min;
81
82 bool d_menu_on;
83 bool d_stop_state;
84 bool d_autoscale_state;
85
86 QMenu* d_menu;
87 QAction* d_stop_act;
88 QList<QMenu*> d_label_menu;
89 std::vector<LineTitleAction*> d_label_act;
90 std::vector<ItemFloatAct*> d_factor_act;
91 FFTAverageMenu* d_avg_menu;
92 NumberLayoutMenu* d_layout_menu;
93 std::vector<NumberColorMapMenu*> d_color_menu;
94 PopupMenu* d_maxcolor_menu;
95 QAction* d_autoscale_act;
96 PopupMenu* d_update_time_menu;
97 QAction* d_save_act;
98
99 QLabel* d_title;
100 std::vector<std::string> d_unit;
101 std::vector<float> d_factor;
102};
103
104#endif /* NUMBER_DISPLAY_FORM_H */
Definition: form_menus.h:561
DisplayForm child for managing number sink plots.
Definition: numberdisplayform.h:25
void setColor(unsigned int which, const QColor &min, const QColor &max)
NumberDisplayForm(int nplots=1, gr::qtgui::graph_t type=gr::qtgui::NUM_GRAPH_HORIZ, QWidget *parent=0)
QColor colorMin(unsigned int which) const
void mousePressEvent(QMouseEvent *e) override
std::string title() const
int scaleMin(unsigned int which)
void setUpdateTime(QString time)
void setStop(bool on)
void setColorMax(unsigned int which, QString max)
void setUpdateTime(const float time)
void setColorMin(unsigned int which, QString min)
void customEvent(QEvent *e) override
void autoScale(bool on)
~NumberDisplayForm() override
void setAverage(const float avg)
gr::qtgui::graph_t graphType() const
void setScaleMax(unsigned int which, int max)
void setScaleMin(unsigned int which, int min)
void setLabel(unsigned int which, const std::string &label)
float updateTime() const
std::string unit(unsigned int which) const
void setFactor(unsigned int which, float factor)
void setLabel(unsigned int which, QString label)
QColor colorMax(unsigned int which) const
void setUnit(unsigned int which, const std::string &unit)
void setScale(unsigned int which, int min, int max)
void setGraphType(const gr::qtgui::graph_t type)
void setTitle(const std::string &title)
std::string label(unsigned int which) const
float factor(unsigned int which) const
float average() const
int scaleMax(unsigned int which)
Definition: form_menus.h:1038
Definition: form_menus.h:1191
graph_t
Definition: qtgui_types.h:119
@ NUM_GRAPH_HORIZ
Definition: qtgui_types.h:121
float min(float a, float b)