GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
eyedisplaysform.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2020 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 #ifndef EYE_DISPLAYS_FORM_H
11 #define EYE_DISPLAYS_FORM_H
12 
13 #include <gnuradio/qtgui/api.h>
15 #include <QtGui/QtGui>
16 #include <vector>
17 
18 #include <qwt_plot_grid.h>
19 #include <qwt_plot_layout.h>
20 
23 
24 /*!
25  * \brief Base class for setting up and managing QTGUI plot forms.
26  * \ingroup qtgui_blk
27  */
28 class QTGUI_API EyeDisplaysForm : public QWidget
29 {
30  Q_OBJECT
31 
32 public:
33  EyeDisplaysForm(int nplots = 1, QWidget* parent = 0);
34  ~EyeDisplaysForm() override;
35 
36  void Reset();
37  bool isClosed() const;
38 
39  void enableMenu(bool en = true);
40 
41 public slots:
42  void resizeEvent(QResizeEvent* e) override;
43  void mousePressEvent(QMouseEvent* e) override;
44  void customEvent(QEvent* e) override = 0;
45 
46  void closeEvent(QCloseEvent* e) override;
47 
48  void setUpdateTime(double t);
49  void setSamplesPerSymbol(int64_t sps);
50  void setTitle(const QString& title);
51  void setLineLabel(unsigned int which, const QString& label);
52  void setLineColor(unsigned int which, const QString& color);
53  void setLineWidth(unsigned int which, unsigned int width);
54  void setLineStyle(unsigned int which, Qt::PenStyle style);
55  void setLineMarker(unsigned int which, QwtSymbol::Style style);
56  void setMarkerAlpha(unsigned int which, unsigned int alpha);
57 
58  QString title();
59  QString lineLabel(unsigned int which);
60  QString lineColor(unsigned int which);
61  int lineWidth(unsigned int which);
62  Qt::PenStyle lineStyle(unsigned int which);
63  QwtSymbol::Style lineMarker(unsigned int which);
64  int markerAlpha(unsigned int which);
65 
66  virtual void setSampleRate(const QString& rate);
67 
68  void setStop(bool on);
69  void setStop();
70 
71  void setGrid(bool on);
72  void setAxisLabels(bool en);
73 
74  void saveFigure();
75 
76  void disableLegend();
77 
78 private slots:
79  virtual void newData(const QEvent*) = 0;
80  virtual void autoScale(bool) = 0;
81  void updateGuiTimer();
82 
83  virtual void onPlotPointSelected(const QPointF p);
84 
85 signals:
86  void plotPointSelected(const QPointF p, int type);
87  void toggleGrid(bool en);
88 
89 protected:
90  bool d_isclosed;
91 
92  unsigned int d_nplots;
93  int d_sps;
94 
95  QGridLayout* d_layout;
97  std::vector<DisplayPlot*> d_displays_plot;
99 
100  std::vector<QwtPlotGrid*> d_grids;
101 
102  bool d_menu_on;
103  QMenu* d_menu;
104 
105  QAction* d_stop_act;
107  QAction* d_grid_act;
111 
112  QAction* d_autoscale_act;
114 
115  QList<QMenu*> d_lines_menu;
116  QList<LineTitleAction*> d_line_title_act;
117  QList<LineColorMenu*> d_line_color_menu;
118  QList<LineWidthMenu*> d_line_width_menu;
119  QList<LineStyleMenu*> d_line_style_menu;
120  QList<LineMarkerMenu*> d_line_marker_menu;
121  QList<MarkerAlphaMenu*> d_marker_alpha_menu;
122 
124  QAction* d_save_act;
125 
127 };
128 
129 #endif /* EYE_DISPLAYS_FORM_H */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:42
Base class for setting up and managing QTGUI plot forms.
Definition: eyedisplaysform.h:29
QString title()
QwtSymbol::Style lineMarker(unsigned int which)
void toggleGrid(bool en)
void setUpdateTime(double t)
std::vector< DisplayPlot * > d_displays_plot
Definition: eyedisplaysform.h:97
bool d_stop_state
Definition: eyedisplaysform.h:106
void disableLegend()
void setMarkerAlpha(unsigned int which, unsigned int alpha)
bool d_autoscale_state
Definition: eyedisplaysform.h:113
QList< MarkerAlphaMenu * > d_marker_alpha_menu
Definition: eyedisplaysform.h:121
QGridLayout * d_layout
Definition: eyedisplaysform.h:95
QMenu * d_menu
Definition: eyedisplaysform.h:103
void setLineColor(unsigned int which, const QString &color)
bool d_axislabels
Definition: eyedisplaysform.h:110
PopupMenu * d_samp_rate_act
Definition: eyedisplaysform.h:123
QList< LineStyleMenu * > d_line_style_menu
Definition: eyedisplaysform.h:119
Qt::PenStyle lineStyle(unsigned int which)
QList< LineTitleAction * > d_line_title_act
Definition: eyedisplaysform.h:116
bool isClosed() const
QAction * d_autoscale_act
Definition: eyedisplaysform.h:112
EyeDisplaysForm(int nplots=1, QWidget *parent=0)
QString lineColor(unsigned int which)
std::vector< QwtPlotGrid * > d_grids
Definition: eyedisplaysform.h:100
QList< LineColorMenu * > d_line_color_menu
Definition: eyedisplaysform.h:117
void setLineStyle(unsigned int which, Qt::PenStyle style)
void setSamplesPerSymbol(int64_t sps)
QAction * d_axislabelsmenu
Definition: eyedisplaysform.h:109
QList< QMenu * > d_lines_menu
Definition: eyedisplaysform.h:115
void enableMenu(bool en=true)
void resizeEvent(QResizeEvent *e) override
QAction * d_grid_act
Definition: eyedisplaysform.h:107
int lineWidth(unsigned int which)
QList< LineMarkerMenu * > d_line_marker_menu
Definition: eyedisplaysform.h:120
void mousePressEvent(QMouseEvent *e) override
QList< LineWidthMenu * > d_line_width_menu
Definition: eyedisplaysform.h:118
double d_update_time
Definition: eyedisplaysform.h:126
void setAxisLabels(bool en)
void setLineWidth(unsigned int which, unsigned int width)
bool d_isclosed
Definition: eyedisplaysform.h:90
QAction * d_save_act
Definition: eyedisplaysform.h:124
~EyeDisplaysForm() override
DisplayPlot * d_display_plot
Definition: eyedisplaysform.h:96
QAction * d_stop_act
Definition: eyedisplaysform.h:105
unsigned int d_nplots
Definition: eyedisplaysform.h:92
QString lineLabel(unsigned int which)
void customEvent(QEvent *e) override=0
void setGrid(bool on)
int markerAlpha(unsigned int which)
void setLineMarker(unsigned int which, QwtSymbol::Style style)
void setStop(bool on)
virtual void setSampleRate(const QString &rate)
void setLineLabel(unsigned int which, const QString &label)
bool d_grid_state
Definition: eyedisplaysform.h:108
bool d_menu_on
Definition: eyedisplaysform.h:102
int d_sps
Definition: eyedisplaysform.h:93
void plotPointSelected(const QPointF p, int type)
void setTitle(const QString &title)
bool d_system_specified_flag
Definition: eyedisplaysform.h:98
void closeEvent(QCloseEvent *e) override
Definition: form_menus.h:1191
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:18