GNU Radio 3.7.1.1 C++ API
TimeDomainDisplayPlot.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008-2012 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 TIME_DOMAIN_DISPLAY_PLOT_H
24 #define TIME_DOMAIN_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  TimeDomainDisplayPlot(int nplots, QWidget*);
41  virtual ~TimeDomainDisplayPlot();
42 
43  void plotNewData(const std::vector<double*> dataPoints,
44  const int64_t numDataPoints, const double timeInterval);
45 
46  void replot();
47 
48  void stemPlot(bool en);
49 
50 public slots:
51  void setSampleRate(double sr, double units,
52  const std::string &strunits);
53 
54  void setAutoScale(bool state);
55  void setSemilogx(bool en);
56  void setSemilogy(bool en);
57 
58 private:
59  void _resetXAxisPoints();
60  void _autoScale(double bottom, double top);
61 
62  std::vector<double*> _dataPoints;
63  double* _xAxisPoints;
64 
65  double _sampleRate;
66 
67  bool d_semilogx;
68  bool d_semilogy;
69 };
70 
71 #endif /* TIME_DOMAIN_DISPLAY_PLOT_H */