GNU Radio C++ API Reference: HistogramDisplayPlot.h Source File

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
HistogramDisplayPlot.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2013 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 HISTOGRAM_DISPLAY_PLOT_H
12#define HISTOGRAM_DISPLAY_PLOT_H
13
14#include <gnuradio/qtgui/DisplayPlot.h>
15#include <cstdint>
16#include <cstdio>
17#include <vector>
18
19/*!
20 * \brief QWidget for displaying time domain plots.
21 * \ingroup qtgui_blk
22 */
23 class HistogramDisplayPlot : public DisplayPlot
24{
25 Q_OBJECT
26
27public:
28 HistogramDisplayPlot(unsigned int nplots, QWidget*);
29 ~HistogramDisplayPlot() override;
30
31 // Disallow copy/move because of the raw QT pointers.
32 // They are handled by QT.
33 HistogramDisplayPlot(const HistogramDisplayPlot&) = delete;
34 HistogramDisplayPlot(HistogramDisplayPlot&&) = delete;
35 HistogramDisplayPlot& operator=(const HistogramDisplayPlot&) = delete;
36 HistogramDisplayPlot& operator=(HistogramDisplayPlot&&) = delete;
37
38 void plotNewData(const std::vector<const double*> dataPoints,
39 const uint64_t numDataPoints,
40 const double timeInterval);
41
42 void replot() override;
43
44public slots:
45 void setAutoScale(bool state);
46 void setAutoScaleX();
47 void setSemilogx(bool en);
48 void setSemilogy(bool en);
49 void setAccumulate(bool en);
50 bool getAccumulate() const;
51
52 void setMarkerAlpha(unsigned int which, int alpha) override;
53 int getMarkerAlpha(unsigned int which) const override;
54 void setLineColor(unsigned int which, QColor color) override;
55
56 void setNumBins(unsigned int bins);
57 void setXaxis(double min, double max) override;
58
59 void clear();
60
61private:
62 void _resetXAxisPoints(double left, double right);
63 void _autoScaleY(double bottom, double top);
64
65 unsigned int d_bins = 100;
66 bool d_accum = false;
67 double d_xmin, d_xmax, d_left, d_right;
68 double d_width;
69
70 std::vector<double> d_xdata;
71 std::vector<std::vector<double>> d_ydata;
72
73 bool d_semilogx = false;
74 bool d_semilogy = false;
75 bool d_autoscalex_state = false;
76};
77
78#endif /* HISTOGRAM_DISPLAY_PLOT_H */
DisplayPlot.h
DisplayPlot::DisplayPlot
DisplayPlot(int nplots, QWidget *)
HistogramDisplayPlot::getAccumulate
bool getAccumulate() const
HistogramDisplayPlot::HistogramDisplayPlot
HistogramDisplayPlot(const HistogramDisplayPlot &)=delete
HistogramDisplayPlot::setSemilogx
void setSemilogx(bool en)
HistogramDisplayPlot::setAccumulate
void setAccumulate(bool en)
HistogramDisplayPlot::operator=
HistogramDisplayPlot & operator=(HistogramDisplayPlot &&)=delete
HistogramDisplayPlot::setAutoScaleX
void setAutoScaleX()
HistogramDisplayPlot::HistogramDisplayPlot
HistogramDisplayPlot(unsigned int nplots, QWidget *)
HistogramDisplayPlot::plotNewData
void plotNewData(const std::vector< const double * > dataPoints, const uint64_t numDataPoints, const double timeInterval)
HistogramDisplayPlot::replot
void replot() override
HistogramDisplayPlot::setLineColor
void setLineColor(unsigned int which, QColor color) override
HistogramDisplayPlot::setAutoScale
void setAutoScale(bool state)
HistogramDisplayPlot::~HistogramDisplayPlot
~HistogramDisplayPlot() override
HistogramDisplayPlot::HistogramDisplayPlot
HistogramDisplayPlot(HistogramDisplayPlot &&)=delete
HistogramDisplayPlot::setSemilogy
void setSemilogy(bool en)
HistogramDisplayPlot::setNumBins
void setNumBins(unsigned int bins)
HistogramDisplayPlot::getMarkerAlpha
int getMarkerAlpha(unsigned int which) const override
HistogramDisplayPlot::setMarkerAlpha
void setMarkerAlpha(unsigned int which, int alpha) override
HistogramDisplayPlot::setXaxis
void setXaxis(double min, double max) override
HistogramDisplayPlot::operator=
HistogramDisplayPlot & operator=(const HistogramDisplayPlot &)=delete
HistogramDisplayPlot::clear
void clear()