GNU Radio C++ API Reference: eyedisplaysform.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
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>
14#include <gnuradio/qtgui/spectrumUpdateEvents.h>
15#include <QtGui/QtGui>
16#include <vector>
17
18#include <qwt_plot_grid.h>
19#include <qwt_plot_layout.h>
20
21#include <gnuradio/qtgui/DisplayPlot.h>
22#include <gnuradio/qtgui/form_menus.h>
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
32public:
33 EyeDisplaysForm(int nplots = 1, QWidget* parent = 0);
34 ~EyeDisplaysForm() override;
35
36 void Reset();
37
38 void enableMenu(bool en = true);
39
40public 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
77private 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
84signals:
85 void plotPointSelected(const QPointF p, int type);
86 void toggleGrid(bool en);
87
88protected:
89 unsigned int d_nplots;
90 int d_sps;
91
92 QGridLayout* d_layout;
93 DisplayPlot* d_display_plot;
94 std::vector<DisplayPlot*> d_displays_plot;
95 bool d_system_specified_flag;
96
97 std::vector<QwtPlotGrid*> d_grids;
98
99 bool d_menu_on;
100 QMenu* d_menu;
101
102 QAction* d_stop_act;
103 bool d_stop_state;
104 QAction* d_grid_act;
105 bool d_grid_state;
106 QAction* d_axislabelsmenu;
107 bool d_axislabels;
108
109 QAction* d_autoscale_act;
110 bool d_autoscale_state;
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
120 PopupMenu* d_samp_rate_act;
121 QAction* d_save_act;
122
123 double d_update_time;
124};
125
126#endif /* EYE_DISPLAYS_FORM_H */
DisplayPlot.h
DisplayPlot
QWidget base plot to build QTGUI plotting tools.
Definition DisplayPlot.h:42
EyeDisplaysForm::title
QString title()
EyeDisplaysForm::lineMarker
QwtSymbol::Style lineMarker(unsigned int which)
EyeDisplaysForm::toggleGrid
void toggleGrid(bool en)
EyeDisplaysForm::setUpdateTime
void setUpdateTime(double t)
EyeDisplaysForm::saveFigure
void saveFigure()
EyeDisplaysForm::d_displays_plot
std::vector< DisplayPlot * > d_displays_plot
Definition eyedisplaysform.h:94
EyeDisplaysForm::d_stop_state
bool d_stop_state
Definition eyedisplaysform.h:103
EyeDisplaysForm::disableLegend
void disableLegend()
EyeDisplaysForm::setMarkerAlpha
void setMarkerAlpha(unsigned int which, unsigned int alpha)
EyeDisplaysForm::d_autoscale_state
bool d_autoscale_state
Definition eyedisplaysform.h:110
EyeDisplaysForm::d_marker_alpha_menu
QList< MarkerAlphaMenu * > d_marker_alpha_menu
Definition eyedisplaysform.h:118
EyeDisplaysForm::d_layout
QGridLayout * d_layout
Definition eyedisplaysform.h:92
EyeDisplaysForm::d_menu
QMenu * d_menu
Definition eyedisplaysform.h:100
EyeDisplaysForm::setLineColor
void setLineColor(unsigned int which, const QString &color)
EyeDisplaysForm::d_axislabels
bool d_axislabels
Definition eyedisplaysform.h:107
EyeDisplaysForm::d_samp_rate_act
PopupMenu * d_samp_rate_act
Definition eyedisplaysform.h:120
EyeDisplaysForm::d_line_style_menu
QList< LineStyleMenu * > d_line_style_menu
Definition eyedisplaysform.h:116
EyeDisplaysForm::lineStyle
Qt::PenStyle lineStyle(unsigned int which)
EyeDisplaysForm::d_line_title_act
QList< LineTitleAction * > d_line_title_act
Definition eyedisplaysform.h:113
EyeDisplaysForm::d_autoscale_act
QAction * d_autoscale_act
Definition eyedisplaysform.h:109
EyeDisplaysForm::EyeDisplaysForm
EyeDisplaysForm(int nplots=1, QWidget *parent=0)
EyeDisplaysForm::lineColor
QString lineColor(unsigned int which)
EyeDisplaysForm::d_grids
std::vector< QwtPlotGrid * > d_grids
Definition eyedisplaysform.h:97
EyeDisplaysForm::d_line_color_menu
QList< LineColorMenu * > d_line_color_menu
Definition eyedisplaysform.h:114
EyeDisplaysForm::setLineStyle
void setLineStyle(unsigned int which, Qt::PenStyle style)
EyeDisplaysForm::setSamplesPerSymbol
void setSamplesPerSymbol(int64_t sps)
EyeDisplaysForm::d_axislabelsmenu
QAction * d_axislabelsmenu
Definition eyedisplaysform.h:106
EyeDisplaysForm::d_lines_menu
QList< QMenu * > d_lines_menu
Definition eyedisplaysform.h:112
EyeDisplaysForm::enableMenu
void enableMenu(bool en=true)
EyeDisplaysForm::resizeEvent
void resizeEvent(QResizeEvent *e) override
EyeDisplaysForm::d_grid_act
QAction * d_grid_act
Definition eyedisplaysform.h:104
EyeDisplaysForm::lineWidth
int lineWidth(unsigned int which)
EyeDisplaysForm::d_line_marker_menu
QList< LineMarkerMenu * > d_line_marker_menu
Definition eyedisplaysform.h:117
EyeDisplaysForm::mousePressEvent
void mousePressEvent(QMouseEvent *e) override
EyeDisplaysForm::setStop
void setStop()
EyeDisplaysForm::d_line_width_menu
QList< LineWidthMenu * > d_line_width_menu
Definition eyedisplaysform.h:115
EyeDisplaysForm::d_update_time
double d_update_time
Definition eyedisplaysform.h:123
EyeDisplaysForm::setAxisLabels
void setAxisLabels(bool en)
EyeDisplaysForm::setLineWidth
void setLineWidth(unsigned int which, unsigned int width)
EyeDisplaysForm::Reset
void Reset()
EyeDisplaysForm::d_save_act
QAction * d_save_act
Definition eyedisplaysform.h:121
EyeDisplaysForm::~EyeDisplaysForm
~EyeDisplaysForm() override
EyeDisplaysForm::d_display_plot
DisplayPlot * d_display_plot
Definition eyedisplaysform.h:93
EyeDisplaysForm::d_stop_act
QAction * d_stop_act
Definition eyedisplaysform.h:102
EyeDisplaysForm::d_nplots
unsigned int d_nplots
Definition eyedisplaysform.h:89
EyeDisplaysForm::lineLabel
QString lineLabel(unsigned int which)
EyeDisplaysForm::customEvent
void customEvent(QEvent *e) override=0
EyeDisplaysForm::setGrid
void setGrid(bool on)
EyeDisplaysForm::markerAlpha
int markerAlpha(unsigned int which)
EyeDisplaysForm::setLineMarker
void setLineMarker(unsigned int which, QwtSymbol::Style style)
EyeDisplaysForm::setStop
void setStop(bool on)
EyeDisplaysForm::setSampleRate
virtual void setSampleRate(const QString &rate)
EyeDisplaysForm::setLineLabel
void setLineLabel(unsigned int which, const QString &label)
EyeDisplaysForm::d_grid_state
bool d_grid_state
Definition eyedisplaysform.h:105
EyeDisplaysForm::d_menu_on
bool d_menu_on
Definition eyedisplaysform.h:99
EyeDisplaysForm::d_sps
int d_sps
Definition eyedisplaysform.h:90
EyeDisplaysForm::plotPointSelected
void plotPointSelected(const QPointF p, int type)
EyeDisplaysForm::setTitle
void setTitle(const QString &title)
EyeDisplaysForm::d_system_specified_flag
bool d_system_specified_flag
Definition eyedisplaysform.h:95
EyeDisplaysForm::closeEvent
void closeEvent(QCloseEvent *e) override
PopupMenu
Definition form_menus.h:1191
form_menus.h
api.h
QTGUI_API
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:18
spectrumUpdateEvents.h