GNU Radio Manual and C++ API Reference  3.7.13.4
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  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef HISTOGRAM_DISPLAY_PLOT_H
24 #define HISTOGRAM_DISPLAY_PLOT_H
25 
26 #include <stdint.h>
27 #include <cstdio>
28 #include <vector>
30 
31 /*!
32  * \brief QWidget for displaying time domain plots.
33  * \ingroup qtgui_blk
34  */
36 {
37  Q_OBJECT
38 
39 public:
40  HistogramDisplayPlot(int nplots, QWidget*);
41  virtual ~HistogramDisplayPlot();
42 
43  void plotNewData(const std::vector<double*> dataPoints,
44  const int64_t numDataPoints, const double timeInterval);
45 
46  void replot();
47 
48 public slots:
49  void setAutoScale(bool state);
50  void setAutoScaleX();
51  void setSemilogx(bool en);
52  void setSemilogy(bool en);
53  void setAccumulate(bool en);
54  bool getAccumulate() const;
55 
56  void setMarkerAlpha(int which, int alpha);
57  int getMarkerAlpha(int which) const;
58  void setLineColor(int which, QColor color);
59 
60  void setNumBins(int bins);
61  void setXaxis(double min, double max);
62 
63  void clear();
64 
65 private:
66  void _resetXAxisPoints(double left, double right);
67  void _autoScaleY(double bottom, double top);
68 
69  double* d_xdata;
70  std::vector<double*> d_ydata;
71 
72  int d_bins;
73  bool d_accum;
74  double d_xmin, d_xmax, d_left, d_right;
75  double d_width;
76 
77  bool d_semilogx;
78  bool d_semilogy;
79  bool d_autoscalex_state;
80 };
81 
82 #endif /* HISTOGRAM_DISPLAY_PLOT_H */
QWidget for displaying time domain plots.
Definition: HistogramDisplayPlot.h:35
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:61
float min(float a, float b)
HistogramDisplayPlot(int nplots, QWidget *)
void setMarkerAlpha(int which, int alpha)
void setAutoScale(bool state)
virtual ~HistogramDisplayPlot()
void plotNewData(const std::vector< double *> dataPoints, const int64_t numDataPoints, const double timeInterval)
void setAccumulate(bool en)
void setSemilogy(bool en)
bool getAccumulate() const
void setNumBins(int bins)
void setXaxis(double min, double max)
int getMarkerAlpha(int which) const
void setSemilogx(bool en)
void setLineColor(int which, QColor color)