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();
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:
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::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
form_menus.h
api.h
QTGUI_API
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:18
spectrumUpdateEvents.h