Loading...
Searching...
No Matches
eyedisplaysform.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2020 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef EYE_DISPLAYS_FORM_H
#define EYE_DISPLAYS_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 EyeDisplaysForm : public QWidget
{
Q_OBJECT
public:
EyeDisplaysForm(int nplots = 1, QWidget* parent = 0);
~EyeDisplaysForm() override;
void Reset();
void enableMenu(bool en = true);
public slots:
void resizeEvent(QResizeEvent* e) override;
void mousePressEvent(QMouseEvent* e) override;
void customEvent(QEvent* e) override = 0;
void closeEvent(QCloseEvent* e) override;
void setUpdateTime(double t);
void setSamplesPerSymbol(int64_t sps);
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;
int d_sps;
QGridLayout* d_layout;
DisplayPlot* d_display_plot;
std::vector<DisplayPlot*> d_displays_plot;
bool d_system_specified_flag;
std::vector<QwtPlotGrid*> d_grids;
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 /* 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
form_menus.h
api.h
QTGUI_API
#define QTGUI_API
Definition gr-qtgui/include/gnuradio/qtgui/api.h:18
spectrumUpdateEvents.h