GNU Radio Manual and C++ API Reference  3.8.1.0
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 
27 #include <stdint.h>
28 #include <cstdio>
29 #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(unsigned int nplots, QWidget*);
41  virtual ~HistogramDisplayPlot();
42 
43  void plotNewData(const std::vector<double*> dataPoints,
44  const uint64_t numDataPoints,
45  const double timeInterval);
46 
47  void replot();
48 
49 public slots:
50  void setAutoScale(bool state);
51  void setAutoScaleX();
52  void setSemilogx(bool en);
53  void setSemilogy(bool en);
54  void setAccumulate(bool en);
55  bool getAccumulate() const;
56 
57  void setMarkerAlpha(unsigned int which, int alpha);
58  int getMarkerAlpha(unsigned int which) const;
59  void setLineColor(unsigned int which, QColor color);
60 
61  void setNumBins(unsigned int bins);
62  void setXaxis(double min, double max);
63 
64  void clear();
65 
66 private:
67  void _resetXAxisPoints(double left, double right);
68  void _autoScaleY(double bottom, double top);
69 
70  double* d_xdata;
71  std::vector<double*> d_ydata;
72 
73  unsigned int d_bins;
74  bool d_accum;
75  double d_xmin, d_xmax, d_left, d_right;
76  double d_width;
77 
78  bool d_semilogx;
79  bool d_semilogy;
80  bool d_autoscalex_state;
81 };
82 
83 #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)
void plotNewData(const std::vector< double *> dataPoints, const uint64_t numDataPoints, const double timeInterval)
void setAutoScale(bool state)
virtual ~HistogramDisplayPlot()
void setLineColor(unsigned int which, QColor color)
void setAccumulate(bool en)
void setNumBins(unsigned int bins)
void setSemilogy(bool en)
int getMarkerAlpha(unsigned int which) const
bool getAccumulate() const
void setXaxis(double min, double max)
HistogramDisplayPlot(unsigned int nplots, QWidget *)
void setSemilogx(bool en)
void setMarkerAlpha(unsigned int which, int alpha)