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