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