GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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 * 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 VECTOR_DISPLAY_PLOT_HPP
24#define VECTOR_DISPLAY_PLOT_HPP
25
27#include <stdint.h>
28#include <cstdio>
29#include <vector>
30
31/*!
32 * \brief QWidget for displaying 1D-vector plots.
33 * \ingroup qtgui_blk
34 */
36{
37 Q_OBJECT
38
39 Q_PROPERTY(QColor min_vec_color READ getMinVecColor WRITE setMinVecColor)
40 Q_PROPERTY(QColor max_vec_color READ getMaxVecColor WRITE setMaxVecColor)
41 Q_PROPERTY(bool min_vec_visible READ getMinVecVisible WRITE setMinVecVisible)
42 Q_PROPERTY(bool max_vec_visible READ getMaxVecVisible WRITE setMaxVecVisible)
55
56public:
57 VectorDisplayPlot(int nplots, QWidget*);
59
60 void setXAxisValues(const double start, const double step = 1.0);
61
62 void plotNewData(const std::vector<double*> dataPoints,
63 const int64_t numDataPoints,
64 const double refLevel,
65 const double timeInterval);
66
69
70 void replot();
71
72 void setYaxis(double min, double max);
73 double getYMin() const;
74 double getYMax() const;
75
76 void setXAxisLabel(const QString& label);
77 void setYAxisLabel(const QString& label);
78
79 void setXAxisUnit(const QString& unit);
80 void setYAxisUnit(const QString& unit);
81
82 void setTraceColour(QColor);
83 void setBGColour(QColor c);
84
85 const bool getMaxVecVisible() const;
86 const bool getMinVecVisible() const;
87 const QColor getMinVecColor() const;
88 const QColor getMaxVecColor() const;
89 const QColor getMarkerLowerIntensityColor() const;
91 const QColor getMarkerUpperIntensityColor() const;
94 const QColor getMarkerRefLevelAmplitudeColor() const;
95
96public slots:
97 void setMaxVecVisible(const bool);
98 void setMinVecVisible(const bool);
99 void setMinVecColor(QColor c);
100 void setMaxVecColor(QColor c);
107
108 void setLowerIntensityLevel(const double);
109 void setUpperIntensityLevel(const double);
110
111 void onPickerPointSelected(const QwtDoublePoint& p);
112 void onPickerPointSelected6(const QPointF& p);
113
114 void setAutoScale(bool state);
115
116private:
117 void _resetXAxisPoints();
118 void _autoScale(double bottom, double top);
119
120 std::vector<double*> d_ydata;
121
122 QwtPlotCurve* d_min_vec_plot_curve;
123 QwtPlotCurve* d_max_vec_plot_curve;
124 QColor d_min_vec_color;
125 bool d_min_vec_visible;
126 QColor d_max_vec_color;
127 bool d_max_vec_visible;
128 QColor d_marker_lower_intensity_color;
129 bool d_marker_lower_intensity_visible;
130 QColor d_marker_upper_intensity_color;
131 bool d_marker_upper_intensity_visible;
132 QColor d_marker_ref_level_color;
133 bool d_marker_ref_level_visible;
134
135 double d_x_axis_start;
136 double d_x_axis_step;
137
138 double d_ymax;
139 double d_ymin;
140
141 QwtPlotMarker* d_lower_intensity_marker;
142 QwtPlotMarker* d_upper_intensity_marker;
143
144 QwtPlotMarker* d_marker_ref_level;
145
146 double* d_xdata;
147
148 QString d_x_axis_label;
149 QString d_y_axis_label;
150
151 double* d_min_vec_data;
152 double* d_max_vec_data;
153
154 double d_ref_level;
155};
156
157#endif /* VECTOR_DISPLAY_PLOT_HPP */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:65
QWidget for displaying 1D-vector plots.
Definition: VectorDisplayPlot.h:36
QColor marker_upper_intensity_color
Definition: VectorDisplayPlot.h:48
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)
void setYAxisUnit(const QString &unit)
void setMarkerRefLevelAmplitudeVisible(bool visible)
bool min_vec_visible
Definition: VectorDisplayPlot.h:41
double getYMin() const
const QColor getMarkerUpperIntensityColor() const
void setYaxis(double min, double max)
void onPickerPointSelected6(const QPointF &p)
QColor marker_lower_intensity_color
Definition: VectorDisplayPlot.h:44
void setMarkerLowerIntensityColor(QColor c)
void setMaxVecColor(QColor c)
void setLowerIntensityLevel(const double)
bool max_vec_visible
Definition: VectorDisplayPlot.h:42
virtual ~VectorDisplayPlot()
void setXAxisValues(const double start, const double step=1.0)
void setXAxisLabel(const QString &label)
QColor min_vec_color
Definition: VectorDisplayPlot.h:39
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:54
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:40
QColor marker_ref_level_color
Definition: VectorDisplayPlot.h:52
const QColor getMarkerRefLevelAmplitudeColor() const
const QColor getMaxVecColor() const
bool marker_lower_intensity_visible
Definition: VectorDisplayPlot.h:46
const QColor getMarkerLowerIntensityColor() const
bool marker_upper_intensity_visible
Definition: VectorDisplayPlot.h:50
float min(float a, float b)