GNU Radio Manual and C++ API Reference 3.9.8.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
TimeDomainDisplayPlot.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2008-2012 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 TIME_DOMAIN_DISPLAY_PLOT_H
12#define TIME_DOMAIN_DISPLAY_PLOT_H
13
15#include <gnuradio/tags.h>
16#include <cstdint>
17#include <cstdio>
18#include <vector>
19
20/*!
21 * \brief QWidget for displaying time domain plots.
22 * \ingroup qtgui_blk
23 */
25{
26 Q_OBJECT
27
28 Q_PROPERTY(QColor tag_text_color READ getTagTextColor WRITE setTagTextColor)
29 Q_PROPERTY(QColor tag_background_color READ getTagBackgroundColor WRITE
31 Q_PROPERTY(Qt::BrushStyle tag_background_style READ getTagBackgroundStyle WRITE
33
34public:
35 TimeDomainDisplayPlot(int nplots, QWidget*);
37
38 void plotNewData(const std::vector<double*> dataPoints,
39 const int64_t numDataPoints,
40 const double timeInterval,
41 const std::vector<std::vector<gr::tag_t>>& tags =
42 std::vector<std::vector<gr::tag_t>>());
43
44 void replot() override;
45
46 void stemPlot(bool en);
47
48 double sampleRate() const;
49
50 const QColor getTagTextColor();
51 const QColor getTagBackgroundColor();
52 const Qt::BrushStyle getTagBackgroundStyle();
53
54public slots:
55 void setSampleRate(double sr, double units, const std::string& strunits);
56
57 void setAutoScale(bool state);
59 void setSemilogx(bool en);
60 void setSemilogy(bool en);
61
62 void legendEntryChecked(QwtPlotItem* plotItem, bool on) override;
63 void legendEntryChecked(const QVariant& plotItem, bool on, int index) override;
64
65 void enableTagMarker(unsigned int which, bool en);
66
67 void setYLabel(const std::string& label, const std::string& unit = "");
68
69 void attachTriggerLines(bool en);
70 void setTriggerLines(double x, double y);
71
72 void setTagTextColor(QColor c);
73 void setTagBackgroundColor(QColor c);
74 void setTagBackgroundStyle(Qt::BrushStyle b);
75
76private:
77 void _resetXAxisPoints();
78 void _autoScale(double bottom, double top);
79
80 std::vector<double*> d_ydata;
81 double* d_xdata;
82
83 double d_sample_rate;
84
85 bool d_semilogx;
86 bool d_semilogy;
87 bool d_autoscale_shot;
88
89 std::vector<std::vector<QwtPlotMarker*>> d_tag_markers;
90 std::vector<bool> d_tag_markers_en;
91
92 QColor d_tag_text_color;
93 QColor d_tag_background_color;
94 Qt::BrushStyle d_tag_background_style;
95
96 QwtPlotMarker* d_trigger_lines[2];
97};
98
99#endif /* TIME_DOMAIN_DISPLAY_PLOT_H */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:53
QWidget for displaying time domain plots.
Definition: TimeDomainDisplayPlot.h:25
void enableTagMarker(unsigned int which, bool en)
double sampleRate() const
void legendEntryChecked(QwtPlotItem *plotItem, bool on) override
void plotNewData(const std::vector< double * > dataPoints, const int64_t numDataPoints, const double timeInterval, const std::vector< std::vector< gr::tag_t > > &tags=std::vector< std::vector< gr::tag_t > >())
void setSemilogy(bool en)
void setYLabel(const std::string &label, const std::string &unit="")
void stemPlot(bool en)
const QColor getTagTextColor()
void setSemilogx(bool en)
void setTagTextColor(QColor c)
TimeDomainDisplayPlot(int nplots, QWidget *)
void setTriggerLines(double x, double y)
QColor tag_text_color
Definition: TimeDomainDisplayPlot.h:28
void setSampleRate(double sr, double units, const std::string &strunits)
void legendEntryChecked(const QVariant &plotItem, bool on, int index) override
void setAutoScale(bool state)
void replot() override
QColor tag_background_color
Definition: TimeDomainDisplayPlot.h:30
void setTagBackgroundColor(QColor c)
~TimeDomainDisplayPlot() override
void attachTriggerLines(bool en)
void setTagBackgroundStyle(Qt::BrushStyle b)
const QColor getTagBackgroundColor()
const Qt::BrushStyle getTagBackgroundStyle()
Qt::BrushStyle tag_background_style
Definition: TimeDomainDisplayPlot.h:32