GNU Radio Manual and C++ API Reference  3.7.4
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
55  void setMarkerAlpha(int which, int alpha);
56  int getMarkerAlpha(int which) const;
57  void setLineColor(int which, QColor color);
58 
59  void setNumBins(int bins);
60  void setXaxis(double min, double max);
61 
62 private:
63  void _resetXAxisPoints(double left, double right);
64  void _autoScaleY(double bottom, double top);
65 
66  double* d_xdata;
67  std::vector<double*> d_ydata;
68 
69  int d_bins;
70  bool d_accum;
71  double d_xmin, d_xmax, d_left, d_right;
72  double d_width;
73 
74  bool d_semilogx;
75  bool d_semilogy;
76  bool d_autoscalex_state;
77 };
78 
79 #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:53
int getMarkerAlpha(int which) const
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)
void setNumBins(int bins)
void setXaxis(double min, double max)
signed __int64 int64_t
Definition: stdint.h:89
void setSemilogx(bool en)
void setLineColor(int which, QColor color)