GNU Radio Manual and C++ API Reference  3.9.1.0
The Free & Open Software Radio Ecosystem
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 
15 #include <cstdint>
16 #include <cstdio>
17 #include <vector>
18 
19 /*!
20  * \brief QWidget for displaying time domain plots.
21  * \ingroup qtgui_blk
22  */
24 {
25  Q_OBJECT
26 
27 public:
28  HistogramDisplayPlot(unsigned int nplots, QWidget*);
29  ~HistogramDisplayPlot() override;
30 
31  void plotNewData(const std::vector<double*> dataPoints,
32  const uint64_t numDataPoints,
33  const double timeInterval);
34 
35  void replot() override;
36 
37 public slots:
38  void setAutoScale(bool state);
39  void setAutoScaleX();
40  void setSemilogx(bool en);
41  void setSemilogy(bool en);
42  void setAccumulate(bool en);
43  bool getAccumulate() const;
44 
45  void setMarkerAlpha(unsigned int which, int alpha) override;
46  int getMarkerAlpha(unsigned int which) const override;
47  void setLineColor(unsigned int which, QColor color) override;
48 
49  void setNumBins(unsigned int bins);
50  void setXaxis(double min, double max) override;
51 
52  void clear();
53 
54 private:
55  void _resetXAxisPoints(double left, double right);
56  void _autoScaleY(double bottom, double top);
57 
58  double* d_xdata;
59  std::vector<double*> d_ydata;
60 
61  unsigned int d_bins;
62  bool d_accum;
63  double d_xmin, d_xmax, d_left, d_right;
64  double d_width;
65 
66  bool d_semilogx;
67  bool d_semilogy;
68  bool d_autoscalex_state;
69 };
70 
71 #endif /* HISTOGRAM_DISPLAY_PLOT_H */
HistogramDisplayPlot
QWidget for displaying time domain plots.
Definition: HistogramDisplayPlot.h:23
DisplayPlot.h
gr::trellis::min
float min(float a, float b)
HistogramDisplayPlot::setAutoScale
void setAutoScale(bool state)
HistogramDisplayPlot::setLineColor
void setLineColor(unsigned int which, QColor color) override
HistogramDisplayPlot::getMarkerAlpha
int getMarkerAlpha(unsigned int which) const override
HistogramDisplayPlot::~HistogramDisplayPlot
~HistogramDisplayPlot() override
HistogramDisplayPlot::getAccumulate
bool getAccumulate() const
DisplayPlot
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:49
HistogramDisplayPlot::plotNewData
void plotNewData(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const double timeInterval)
HistogramDisplayPlot::setSemilogx
void setSemilogx(bool en)
HistogramDisplayPlot::setMarkerAlpha
void setMarkerAlpha(unsigned int which, int alpha) override
HistogramDisplayPlot::setNumBins
void setNumBins(unsigned int bins)
HistogramDisplayPlot::clear
void clear()
HistogramDisplayPlot::setSemilogy
void setSemilogy(bool en)
HistogramDisplayPlot::setXaxis
void setXaxis(double min, double max) override
HistogramDisplayPlot::replot
void replot() override
HistogramDisplayPlot::HistogramDisplayPlot
HistogramDisplayPlot(unsigned int nplots, QWidget *)
HistogramDisplayPlot::setAutoScaleX
void setAutoScaleX()
HistogramDisplayPlot::setAccumulate
void setAccumulate(bool en)