GNU Radio C++ API Reference  gf8e89b7
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 
38  void enableMenu(bool en = true);
39 
40 public slots:
41  void resizeEvent(QResizeEvent* e) override;
42  void mousePressEvent(QMouseEvent* e) override;
43  void customEvent(QEvent* e) override = 0;
44 
45  void closeEvent(QCloseEvent* e) override;
46 
47  void setUpdateTime(double t);
48  void setSamplesPerSymbol(int64_t sps);
49  void setTitle(const QString& title);
50  void setLineLabel(unsigned int which, const QString& label);
51  void setLineColor(unsigned int which, const QString& color);
52  void setLineWidth(unsigned int which, unsigned int width);
53  void setLineStyle(unsigned int which, Qt::PenStyle style);
54  void setLineMarker(unsigned int which, QwtSymbol::Style style);
55  void setMarkerAlpha(unsigned int which, unsigned int alpha);
56 
57  QString title();
58  QString lineLabel(unsigned int which);
59  QString lineColor(unsigned int which);
60  int lineWidth(unsigned int which);
61  Qt::PenStyle lineStyle(unsigned int which);
62  QwtSymbol::Style lineMarker(unsigned int which);
63  int markerAlpha(unsigned int which);
64 
65  virtual void setSampleRate(const QString& rate);
66 
67  void setStop(bool on);
68  void setStop();
69 
70  void setGrid(bool on);
71  void setAxisLabels(bool en);
72 
73  void saveFigure();
74 
75  void disableLegend();
76 
77 private slots:
78  virtual void newData(const QEvent*) = 0;
79  virtual void autoScale(bool) = 0;
80  void updateGuiTimer();
81 
82  virtual void onPlotPointSelected(const QPointF p);
83 
84 signals:
85  void plotPointSelected(const QPointF p, int type);
86  void toggleGrid(bool en);
87 
88 protected:
89  unsigned int d_nplots;
90  int d_sps;
91 
92  QGridLayout* d_layout;
94  std::vector<DisplayPlot*> d_displays_plot;
96 
97  std::vector<QwtPlotGrid*> d_grids;
98 
99  bool d_menu_on;
100  QMenu* d_menu;
101 
102  QAction* d_stop_act;
104  QAction* d_grid_act;
108 
109  QAction* d_autoscale_act;
111 
112  QList<QMenu*> d_lines_menu;
113  QList<LineTitleAction*> d_line_title_act;
114  QList<LineColorMenu*> d_line_color_menu;
115  QList<LineWidthMenu*> d_line_width_menu;
116  QList<LineStyleMenu*> d_line_style_menu;
117  QList<LineMarkerMenu*> d_line_marker_menu;
118  QList<MarkerAlphaMenu*> d_marker_alpha_menu;
119 
121  QAction* d_save_act;
122 
124 };
125 
126 #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:94
bool d_stop_state
Definition: eyedisplaysform.h:103
void disableLegend()
void setMarkerAlpha(unsigned int which, unsigned int alpha)
bool d_autoscale_state
Definition: eyedisplaysform.h:110
QList< MarkerAlphaMenu * > d_marker_alpha_menu
Definition: eyedisplaysform.h:118
QGridLayout * d_layout
Definition: eyedisplaysform.h:92
QMenu * d_menu
Definition: eyedisplaysform.h:100
void setLineColor(unsigned int which, const QString &color)
bool d_axislabels
Definition: eyedisplaysform.h:107
PopupMenu * d_samp_rate_act
Definition: eyedisplaysform.h:120
QList< LineStyleMenu * > d_line_style_menu
Definition: eyedisplaysform.h:116
Qt::PenStyle lineStyle(unsigned int which)
QList< LineTitleAction * > d_line_title_act
Definition: eyedisplaysform.h:113
QAction * d_autoscale_act
Definition: eyedisplaysform.h:109
EyeDisplaysForm(int nplots=1, QWidget *parent=0)
QString lineColor(unsigned int which)
std::vector< QwtPlotGrid * > d_grids
Definition: eyedisplaysform.h:97
QList< LineColorMenu * > d_line_color_menu
Definition: eyedisplaysform.h:114
void setLineStyle(unsigned int which, Qt::PenStyle style)
void setSamplesPerSymbol(int64_t sps)
QAction * d_axislabelsmenu
Definition: eyedisplaysform.h:106
QList< QMenu * > d_lines_menu
Definition: eyedisplaysform.h:112
void enableMenu(bool en=true)
void resizeEvent(QResizeEvent *e) override
QAction * d_grid_act
Definition: eyedisplaysform.h:104
int lineWidth(unsigned int which)
QList< LineMarkerMenu * > d_line_marker_menu
Definition: eyedisplaysform.h:117
void mousePressEvent(QMouseEvent *e) override
QList< LineWidthMenu * > d_line_width_menu
Definition: eyedisplaysform.h:115
double d_update_time
Definition: eyedisplaysform.h:123
void setAxisLabels(bool en)
void setLineWidth(unsigned int which, unsigned int width)
QAction * d_save_act
Definition: eyedisplaysform.h:121
~EyeDisplaysForm() override
DisplayPlot * d_display_plot
Definition: eyedisplaysform.h:93
QAction * d_stop_act
Definition: eyedisplaysform.h:102
unsigned int d_nplots
Definition: eyedisplaysform.h:89
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:105
bool d_menu_on
Definition: eyedisplaysform.h:99
int d_sps
Definition: eyedisplaysform.h:90
void plotPointSelected(const QPointF p, int type)
void setTitle(const QString &title)
bool d_system_specified_flag
Definition: eyedisplaysform.h:95
void closeEvent(QCloseEvent *e) override
Definition: form_menus.h:1191
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:18