GNU Radio v3.7.0-113-g523a53ac C++ API
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 setSemilogx(bool en);
51  void setSemilogy(bool en);
52  void setAccumulate(bool en);
53 
54  void setMarkerAlpha(int which, int alpha);
55  int getMarkerAlpha(int which) const;
56  void setLineColor(int which, QColor color);
57 
58  void setNumBins(int bins);
59 
60 private:
61  void _resetXAxisPoints(double bottom, double top);
62  void _autoScale(double bottom, double top);
63 
64  double* _xAxisPoints;
65  std::vector<double*> _yDataPoints;
66 
67  int _bins;
68  bool _accum;
69 
70  bool d_semilogx;
71  bool d_semilogy;
72 };
73 
74 #endif /* HISTOGRAM_DISPLAY_PLOT_H */