GNU Radio 3.7.2 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 #include <gnuradio/tags.h>
31 
32 /*!
33  * \brief QWidget for displaying time domain plots.
34  * \ingroup qtgui_blk
35  */
37 {
38  Q_OBJECT
39 
40 public:
41  TimeDomainDisplayPlot(int nplots, QWidget*);
42  virtual ~TimeDomainDisplayPlot();
43 
44  void plotNewData(const std::vector<double*> dataPoints,
45  const int64_t numDataPoints, const double timeInterval,
46  const std::vector< std::vector<gr::tag_t> > &tags \
47  = std::vector< std::vector<gr::tag_t> >());
48 
49  void replot();
50 
51  void stemPlot(bool en);
52 
53 public slots:
54  void setSampleRate(double sr, double units,
55  const std::string &strunits);
56 
57  void setAutoScale(bool state);
58  void setSemilogx(bool en);
59  void setSemilogy(bool en);
60 
61  void legendEntryChecked(QwtPlotItem *plotItem, bool on);
62 
63  void enableTagMarker(int which, bool en);
64 
65 private:
66  void _resetXAxisPoints();
67  void _autoScale(double bottom, double top);
68 
69  std::vector<double*> d_ydata;
70  double* d_xdata;
71 
72  double d_sample_rate;
73 
74  bool d_semilogx;
75  bool d_semilogy;
76 
77  std::vector< std::vector<QwtPlotMarker*> > d_tag_markers;
78  std::vector<bool> d_tag_markers_en;
79 };
80 
81 #endif /* TIME_DOMAIN_DISPLAY_PLOT_H */
void setAutoScale(bool state)
void setSemilogx(bool en)
void plotNewData(const std::vector< double * > dataPoints, const int64_t numDataPoints, const double timeInterval, const std::vector< std::vector< gr::tag_t > > &tags=std::vector< std::vector< gr::tag_t > >())
virtual ~TimeDomainDisplayPlot()
QWidget base plot to build QTGUI plotting tools.
Definition: DisplayPlot.h:53
TimeDomainDisplayPlot(int nplots, QWidget *)
void setSampleRate(double sr, double units, const std::string &strunits)
void stemPlot(bool en)
QWidget for displaying time domain plots.
Definition: TimeDomainDisplayPlot.h:36
signed __int64 int64_t
Definition: stdint.h:89
void enableTagMarker(int which, bool en)
void setSemilogy(bool en)
void legendEntryChecked(QwtPlotItem *plotItem, bool on)