GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
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  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 */
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:50
QWidget for displaying time domain plots.
Definition: HistogramDisplayPlot.h:24
bool getAccumulate() const
void setSemilogx(bool en)
void setAccumulate(bool en)
void plotNewData(const std::vector< double * > dataPoints, const uint64_t numDataPoints, const double timeInterval)
HistogramDisplayPlot(unsigned int nplots, QWidget *)
void replot() override
void setLineColor(unsigned int which, QColor color) override
void setAutoScale(bool state)
~HistogramDisplayPlot() override
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
float min(float a, float b)