Loading...
Searching...
No Matches
displayform.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef DISPLAY_FORM_H
#define DISPLAY_FORM_H
#include <gnuradio/qtgui/api.h>
#include <gnuradio/qtgui/spectrumUpdateEvents.h>
#include <QtGui/QtGui>
#include <vector>
#include <qwt_plot_grid.h>
#include <qwt_plot_layout.h>
#include <gnuradio/qtgui/DisplayPlot.h>
#include <gnuradio/qtgui/form_menus.h>
/*!
* \brief Base class for setting up and managing QTGUI plot forms.
* \ingroup qtgui_blk
*/
class QTGUI_API DisplayForm : public QWidget
{
Q_OBJECT
public:
DisplayForm(int nplots = 1, QWidget* parent = 0);
~DisplayForm() override;
virtual DisplayPlot* getPlot() = 0;
void Reset();
bool isClosed() const;
void enableMenu(bool en = true);
public slots:
void mousePressEvent(QMouseEvent* e) override;
void customEvent(QEvent* e) override = 0;
void closeEvent(QCloseEvent* e) override;
void setUpdateTime(double t);
void setTitle(const QString& title);
void setLineLabel(unsigned int which, const QString& label);
void setLineColor(unsigned int which, const QString& color);
void setLineWidth(unsigned int which, unsigned int width);
void setLineStyle(unsigned int which, Qt::PenStyle style);
void setLineMarker(unsigned int which, QwtSymbol::Style style);
void setMarkerAlpha(unsigned int which, unsigned int alpha);
QString title();
QString lineLabel(unsigned int which);
QString lineColor(unsigned int which);
int lineWidth(unsigned int which);
Qt::PenStyle lineStyle(unsigned int which);
QwtSymbol::Style lineMarker(unsigned int which);
int markerAlpha(unsigned int which);
virtual void setSampleRate(const QString& rate);
void setStop(bool on);
void setStop();
void setGrid(bool on);
void setAxisLabels(bool en);
void saveFigure();
void disableLegend();
private slots:
virtual void newData(const QEvent*) = 0;
virtual void autoScale(bool) = 0;
void updateGuiTimer();
virtual void onPlotPointSelected(const QPointF p);
signals:
void plotPointSelected(const QPointF p, int type);
void toggleGrid(bool en);
protected:
bool d_isclosed;
unsigned int d_nplots;
QGridLayout* d_layout;
DisplayPlot* d_display_plot;
bool d_system_specified_flag;
QwtPlotGrid* d_grid;
bool d_menu_on;
QMenu* d_menu;
QAction* d_stop_act;
bool d_stop_state;
QAction* d_grid_act;
bool d_grid_state;
QAction* d_axislabelsmenu;
bool d_axislabels;
QAction* d_autoscale_act;
bool d_autoscale_state;
QList<QMenu*> d_lines_menu;
QList<LineTitleAction*> d_line_title_act;
QList<LineColorMenu*> d_line_color_menu;
QList<LineWidthMenu*> d_line_width_menu;
QList<LineStyleMenu*> d_line_style_menu;
QList<LineMarkerMenu*> d_line_marker_menu;
QList<MarkerAlphaMenu*> d_marker_alpha_menu;
PopupMenu* d_samp_rate_act;
QAction* d_save_act;
double d_update_time;
};
#endif /* DISPLAY_FORM_H */
DisplayPlot.h
DisplayForm
Base class for setting up and managing QTGUI plot forms.
Definition displayform.h:30
DisplayForm::lineMarker
QwtSymbol::Style lineMarker(unsigned int which)
DisplayForm::d_menu_on
bool d_menu_on
Definition displayform.h:101
DisplayForm::setAxisLabels
void setAxisLabels(bool en)
DisplayForm::d_stop_act
QAction * d_stop_act
Definition displayform.h:104
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:118
DisplayForm::markerAlpha
int markerAlpha(unsigned int which)
DisplayForm::d_line_title_act
QList< LineTitleAction * > d_line_title_act
Definition displayform.h:115
DisplayForm::d_stop_state
bool d_stop_state
Definition displayform.h:105
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:106
DisplayForm::d_grid
QwtPlotGrid * d_grid
Definition displayform.h:99
DisplayForm::setGrid
void setGrid(bool on)
DisplayForm::disableLegend
void disableLegend()
DisplayForm::d_marker_alpha_menu
QList< MarkerAlphaMenu * > d_marker_alpha_menu
Definition displayform.h:120
DisplayForm::setLineWidth
void setLineWidth(unsigned int which, unsigned int width)
DisplayForm::getPlot
virtual DisplayPlot * getPlot()=0
DisplayForm::isClosed
bool isClosed() const
DisplayForm::setStop
void setStop(bool on)
DisplayForm::d_update_time
double d_update_time
Definition displayform.h:125
DisplayForm::title
QString title()
DisplayForm::d_axislabels
bool d_axislabels
Definition displayform.h:109
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:119
DisplayForm::closeEvent
void closeEvent(QCloseEvent *e) override
DisplayForm::~DisplayForm
~DisplayForm() override
DisplayForm::d_isclosed
bool d_isclosed
Definition displayform.h:91
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:108
DisplayForm::d_line_color_menu
QList< LineColorMenu * > d_line_color_menu
Definition displayform.h:116
DisplayForm::d_menu
QMenu * d_menu
Definition displayform.h:102
DisplayForm::setUpdateTime
void setUpdateTime(double t)
DisplayForm::saveFigure
void saveFigure()
DisplayForm::d_save_act
QAction * d_save_act
Definition displayform.h:123
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:107
DisplayForm::lineLabel
QString lineLabel(unsigned int which)
DisplayForm::Reset
void Reset()
DisplayForm::d_display_plot
DisplayPlot * d_display_plot
Definition displayform.h:96
DisplayForm::lineWidth
int lineWidth(unsigned int which)
DisplayForm::d_autoscale_state
bool d_autoscale_state
Definition displayform.h:112
DisplayForm::d_lines_menu
QList< QMenu * > d_lines_menu
Definition displayform.h:114
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:122
DisplayForm::d_system_specified_flag
bool d_system_specified_flag
Definition displayform.h:97
DisplayForm::d_autoscale_act
QAction * d_autoscale_act
Definition displayform.h:111
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:117
DisplayForm::d_layout
QGridLayout * d_layout
Definition displayform.h:95
DisplayForm::d_nplots
unsigned int d_nplots
Definition displayform.h:93
DisplayPlot
QWidget base plot to build QTGUI plotting tools.
Definition DisplayPlot.h:42
form_menus.h
api.h
QTGUI_API
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:18
spectrumUpdateEvents.h