GNU Radio Manual and C++ API Reference 3.9.8.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
VectorDisplayPlot.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2014 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 VECTOR_DISPLAY_PLOT_HPP
12#define VECTOR_DISPLAY_PLOT_HPP
13
15#include <cstdint>
16#include <cstdio>
17#include <vector>
18
19/*!
20 * \brief QWidget for displaying 1D-vector plots.
21 * \ingroup qtgui_blk
22 */
24{
25 Q_OBJECT
26
27 Q_PROPERTY(QColor min_vec_color READ getMinVecColor WRITE setMinVecColor)
28 Q_PROPERTY(QColor max_vec_color READ getMaxVecColor WRITE setMaxVecColor)
29 Q_PROPERTY(bool min_vec_visible READ getMinVecVisible WRITE setMinVecVisible)
30 Q_PROPERTY(bool max_vec_visible READ getMaxVecVisible WRITE setMaxVecVisible)
43
44public:
45 VectorDisplayPlot(int nplots, QWidget*);
47
48 void setXAxisValues(const double start, const double step = 1.0);
49
50 void plotNewData(const std::vector<double*> dataPoints,
51 const int64_t numDataPoints,
52 const double refLevel,
53 const double timeInterval);
54
57
58 void replot() override;
59
60 void setYaxis(double min, double max) override;
61 double getYMin() const;
62 double getYMax() const;
63
64 void setXAxisLabel(const QString& label);
65 void setYAxisLabel(const QString& label);
66
67 void setXAxisUnit(const QString& unit);
68 void setYAxisUnit(const QString& unit);
69
70 void setTraceColour(QColor);
71 void setBGColour(QColor c);
72
73 const bool getMaxVecVisible() const;
74 const bool getMinVecVisible() const;
75 const QColor getMinVecColor() const;
76 const QColor getMaxVecColor() const;
77 const QColor getMarkerLowerIntensityColor() const;
79 const QColor getMarkerUpperIntensityColor() const;
82 const QColor getMarkerRefLevelAmplitudeColor() const;
83
84public slots:
85 void setMaxVecVisible(const bool);
86 void setMinVecVisible(const bool);
87 void setMinVecColor(QColor c);
88 void setMaxVecColor(QColor c);
95
96 void setLowerIntensityLevel(const double);
97 void setUpperIntensityLevel(const double);
98
99 void onPickerPointSelected(const QwtDoublePoint& p);
100 void onPickerPointSelected6(const QPointF& p);
101
102 void setAutoScale(bool state);
103
104private:
105 void _resetXAxisPoints();
106 void _autoScale(double bottom, double top);
107
108 std::vector<double*> d_ydata;
109
110 QwtPlotCurve* d_min_vec_plot_curve;
111 QwtPlotCurve* d_max_vec_plot_curve;
112 QColor d_min_vec_color;
113 bool d_min_vec_visible;
114 QColor d_max_vec_color;
115 bool d_max_vec_visible;
116 QColor d_marker_lower_intensity_color;
117 bool d_marker_lower_intensity_visible;
118 QColor d_marker_upper_intensity_color;
119 bool d_marker_upper_intensity_visible;
120 QColor d_marker_ref_level_color;
121 bool d_marker_ref_level_visible;
122
123 double d_x_axis_start;
124 double d_x_axis_step;
125
126 double d_ymax;
127 double d_ymin;
128
129 QwtPlotMarker* d_lower_intensity_marker;
130 QwtPlotMarker* d_upper_intensity_marker;
131
132 QwtPlotMarker* d_marker_ref_level;
133
134 double* d_xdata;
135
136 QString d_x_axis_label;
137 QString d_y_axis_label;
138
139 double* d_min_vec_data;
140 double* d_max_vec_data;
141
142 double d_ref_level;
143};
144
145#endif /* VECTOR_DISPLAY_PLOT_HPP */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:53
QWidget for displaying 1D-vector plots.
Definition: VectorDisplayPlot.h:24
QColor marker_upper_intensity_color
Definition: VectorDisplayPlot.h:36
void replot() override
void plotNewData(const std::vector< double * > dataPoints, const int64_t numDataPoints, const double refLevel, const double timeInterval)
void setUpperIntensityLevel(const double)
double getYMax() const
const bool getMarkerUpperIntensityVisible() const
void setYAxisLabel(const QString &label)
void setMinVecColor(QColor c)
~VectorDisplayPlot() override
void setYAxisUnit(const QString &unit)
void setMarkerRefLevelAmplitudeVisible(bool visible)
bool min_vec_visible
Definition: VectorDisplayPlot.h:29
double getYMin() const
const QColor getMarkerUpperIntensityColor() const
void onPickerPointSelected6(const QPointF &p)
QColor marker_lower_intensity_color
Definition: VectorDisplayPlot.h:32
void setMarkerLowerIntensityColor(QColor c)
void setMaxVecColor(QColor c)
void setLowerIntensityLevel(const double)
bool max_vec_visible
Definition: VectorDisplayPlot.h:30
void setXAxisValues(const double start, const double step=1.0)
void setXAxisLabel(const QString &label)
QColor min_vec_color
Definition: VectorDisplayPlot.h:27
void setAutoScale(bool state)
void setMinVecVisible(const bool)
void setMaxVecVisible(const bool)
void onPickerPointSelected(const QwtDoublePoint &p)
void setXAxisUnit(const QString &unit)
VectorDisplayPlot(int nplots, QWidget *)
void setTraceColour(QColor)
const bool getMarkerRefLevelAmplitudeVisible() const
const QColor getMinVecColor() const
void setMarkerUpperIntensityVisible(bool visible)
const bool getMaxVecVisible() const
bool marker_ref_level_visible
Definition: VectorDisplayPlot.h:42
const bool getMinVecVisible() const
void setMarkerLowerIntensityVisible(bool visible)
const bool getMarkerLowerIntensityVisible() const
void setMarkerUpperIntensityColor(QColor c)
void setMarkerRefLevelAmplitudeColor(QColor c)
void setBGColour(QColor c)
QColor max_vec_color
Definition: VectorDisplayPlot.h:28
QColor marker_ref_level_color
Definition: VectorDisplayPlot.h:40
const QColor getMarkerRefLevelAmplitudeColor() const
const QColor getMaxVecColor() const
bool marker_lower_intensity_visible
Definition: VectorDisplayPlot.h:34
const QColor getMarkerLowerIntensityColor() const
void setYaxis(double min, double max) override
bool marker_upper_intensity_visible
Definition: VectorDisplayPlot.h:38