GNU Radio Manual and C++ API Reference  3.10.9.1
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*);
30 
31  // Disallow copy/move because of the raw QT pointers.
32  // They are handled by QT.
37 
38  void plotNewData(const std::vector<double*> dataPoints,
39  const uint64_t numDataPoints,
40  const double timeInterval);
41 
42  void replot() override;
43 
44 public 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 
61 private:
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 */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:42
QWidget for displaying time domain plots.
Definition: HistogramDisplayPlot.h:24
bool getAccumulate() const
HistogramDisplayPlot(const HistogramDisplayPlot &)=delete
void setSemilogx(bool en)
void setAccumulate(bool en)
void plotNewData(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const double timeInterval)
HistogramDisplayPlot & operator=(HistogramDisplayPlot &&)=delete
HistogramDisplayPlot(unsigned int nplots, QWidget *)
void replot() override
void setLineColor(unsigned int which, QColor color) override
void setAutoScale(bool state)
~HistogramDisplayPlot() override
HistogramDisplayPlot(HistogramDisplayPlot &&)=delete
void setSemilogy(bool en)
void setNumBins(unsigned int bins)
int getMarkerAlpha(unsigned int which) const override
void setMarkerAlpha(unsigned int which, int alpha) override
void setXaxis(double min, double max) override
HistogramDisplayPlot & operator=(const HistogramDisplayPlot &)=delete
float min(float a, float b)