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

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

Loading...
Searching...
No Matches
displayform.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2012 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 DISPLAY_FORM_H
12#define DISPLAY_FORM_H
13
14#include <gnuradio/qtgui/api.h>
15#include <gnuradio/qtgui/spectrumUpdateEvents.h>
16#include <QtGui/QtGui>
17#include <vector>
18
19#include <qwt_plot_grid.h>
20#include <qwt_plot_layout.h>
21
22#include <gnuradio/qtgui/DisplayPlot.h>
23#include <gnuradio/qtgui/form_menus.h>
24
25/*!
26 * \brief Base class for setting up and managing QTGUI plot forms.
27 * \ingroup qtgui_blk
28 */
29 class QTGUI_API DisplayForm : public QWidget
30{
31 Q_OBJECT
32
33public:
34 DisplayForm(int nplots = 1, QWidget* parent = 0);
35 ~DisplayForm() override;
36
37 virtual DisplayPlot* getPlot() = 0;
38 void Reset();
39
40 void enableMenu(bool en = true);
41
42public slots:
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
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
78private 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
85signals:
86 void plotPointSelected(const QPointF p, int type);
87 void toggleGrid(bool en);
88
89protected:
90 unsigned int d_nplots;
91
92 QGridLayout* d_layout;
93 DisplayPlot* d_display_plot;
94 bool d_system_specified_flag;
95
96 QwtPlotGrid* d_grid;
97
98 bool d_menu_on;
99 QMenu* d_menu;
100
101 QAction* d_stop_act;
102 bool d_stop_state;
103 QAction* d_grid_act;
104 bool d_grid_state;
105 QAction* d_axislabelsmenu;
106 bool d_axislabels;
107
108 QAction* d_autoscale_act;
109 bool d_autoscale_state;
110
111 QList<QMenu*> d_lines_menu;
112 QList<LineTitleAction*> d_line_title_act;
113 QList<LineColorMenu*> d_line_color_menu;
114 QList<LineWidthMenu*> d_line_width_menu;
115 QList<LineStyleMenu*> d_line_style_menu;
116 QList<LineMarkerMenu*> d_line_marker_menu;
117 QList<MarkerAlphaMenu*> d_marker_alpha_menu;
118
119 PopupMenu* d_samp_rate_act;
120 QAction* d_save_act;
121
122 double d_update_time;
123};
124
125#endif /* DISPLAY_FORM_H */
DisplayPlot.h
DisplayForm::lineMarker
QwtSymbol::Style lineMarker(unsigned int which)
DisplayForm::d_menu_on
bool d_menu_on
Definition displayform.h:98
DisplayForm::setAxisLabels
void setAxisLabels(bool en)
DisplayForm::d_stop_act
QAction * d_stop_act
Definition displayform.h:101
DisplayForm::setLineStyle
void setLineStyle(unsigned int which, Qt::PenStyle style)
DisplayForm::enableMenu
void enableMenu(bool en=true)
DisplayForm::d_line_style_menu
QList< LineStyleMenu * > d_line_style_menu
Definition displayform.h:115
DisplayForm::markerAlpha
int markerAlpha(unsigned int which)
DisplayForm::d_line_title_act
QList< LineTitleAction * > d_line_title_act
Definition displayform.h:112
DisplayForm::d_stop_state
bool d_stop_state
Definition displayform.h:102
DisplayForm::customEvent
void customEvent(QEvent *e) override=0
DisplayForm::setTitle
void setTitle(const QString &title)
DisplayForm::d_grid_act
QAction * d_grid_act
Definition displayform.h:103
DisplayForm::d_grid
QwtPlotGrid * d_grid
Definition displayform.h:96
DisplayForm::setGrid
void setGrid(bool on)
DisplayForm::disableLegend
void disableLegend()
DisplayForm::d_marker_alpha_menu
QList< MarkerAlphaMenu * > d_marker_alpha_menu
Definition displayform.h:117
DisplayForm::setLineWidth
void setLineWidth(unsigned int which, unsigned int width)
DisplayForm::getPlot
virtual DisplayPlot * getPlot()=0
DisplayForm::setStop
void setStop(bool on)
DisplayForm::d_update_time
double d_update_time
Definition displayform.h:122
DisplayForm::title
QString title()
DisplayForm::d_axislabels
bool d_axislabels
Definition displayform.h:106
DisplayForm::setMarkerAlpha
void setMarkerAlpha(unsigned int which, unsigned int alpha)
DisplayForm::lineStyle
Qt::PenStyle lineStyle(unsigned int which)
DisplayForm::d_line_marker_menu
QList< LineMarkerMenu * > d_line_marker_menu
Definition displayform.h:116
DisplayForm::closeEvent
void closeEvent(QCloseEvent *e) override
DisplayForm::~DisplayForm
~DisplayForm() override
DisplayForm::setLineColor
void setLineColor(unsigned int which, const QString &color)
DisplayForm::mousePressEvent
void mousePressEvent(QMouseEvent *e) override
DisplayForm::d_axislabelsmenu
QAction * d_axislabelsmenu
Definition displayform.h:105
DisplayForm::d_line_color_menu
QList< LineColorMenu * > d_line_color_menu
Definition displayform.h:113
DisplayForm::d_menu
QMenu * d_menu
Definition displayform.h:99
DisplayForm::setUpdateTime
void setUpdateTime(double t)
DisplayForm::saveFigure
void saveFigure()
DisplayForm::d_save_act
QAction * d_save_act
Definition displayform.h:120
DisplayForm::setSampleRate
virtual void setSampleRate(const QString &rate)
DisplayForm::toggleGrid
void toggleGrid(bool en)
DisplayForm::setLineMarker
void setLineMarker(unsigned int which, QwtSymbol::Style style)
DisplayForm::d_grid_state
bool d_grid_state
Definition displayform.h:104
DisplayForm::lineLabel
QString lineLabel(unsigned int which)
DisplayForm::Reset
void Reset()
DisplayForm::d_display_plot
DisplayPlot * d_display_plot
Definition displayform.h:93
DisplayForm::lineWidth
int lineWidth(unsigned int which)
DisplayForm::d_autoscale_state
bool d_autoscale_state
Definition displayform.h:109
DisplayForm::d_lines_menu
QList< QMenu * > d_lines_menu
Definition displayform.h:111
DisplayForm::DisplayForm
DisplayForm(int nplots=1, QWidget *parent=0)
DisplayForm::plotPointSelected
void plotPointSelected(const QPointF p, int type)
DisplayForm::lineColor
QString lineColor(unsigned int which)
DisplayForm::d_samp_rate_act
PopupMenu * d_samp_rate_act
Definition displayform.h:119
DisplayForm::d_system_specified_flag
bool d_system_specified_flag
Definition displayform.h:94
DisplayForm::d_autoscale_act
QAction * d_autoscale_act
Definition displayform.h:108
DisplayForm::setLineLabel
void setLineLabel(unsigned int which, const QString &label)
DisplayForm::setStop
void setStop()
DisplayForm::d_line_width_menu
QList< LineWidthMenu * > d_line_width_menu
Definition displayform.h:114
DisplayForm::d_layout
QGridLayout * d_layout
Definition displayform.h:92
DisplayForm::d_nplots
unsigned int d_nplots
Definition displayform.h:90
DisplayPlot
QWidget base plot to build QTGUI plotting tools.
Definition DisplayPlot.h:42
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