GNU Radio 3.7.2 C++ API
sink_c.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008,2009,2011,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 INCLUDED_QTGUI_SINK_C_H
24 #define INCLUDED_QTGUI_SINK_C_H
25 
26 #include <Python.h>
27 #include <gnuradio/qtgui/api.h>
28 #include <gnuradio/block.h>
29 #include <qapplication.h>
30 #include <qwt_symbol.h>
31 
32 
33 namespace gr {
34  namespace qtgui {
35 
36  /*!
37  * \brief A graphical sink to display freq, spec, time, and const plots.
38  * \ingroup instrumentation_blk
39  * \ingroup qtgui_blk
40  *
41  * \details
42  * This is a QT-based graphical sink the takes a complex stream and
43  * plots it. The default action is to plot the signal as a PSD (FFT),
44  * spectrogram (waterfall), time domain I&Q, and constellation (I
45  * vs. Q) plots. The plots may be turned off by setting the
46  * appropriate boolean value in the constructor to False.
47  */
48 
49  class QTGUI_API sink_c : virtual public block
50  {
51  public:
52  // gr::qtgui::sink_c::sptr
54 
55  /*!
56  * \brief Build a complex qtgui sink.
57  *
58  * \param fftsize size of the FFT to compute and display
59  * \param wintype type of window to apply (see gnuradio/filter/firdes.h)
60  * \param fc center frequency of signal (use for x-axis labels)
61  * \param bw bandwidth of signal (used to set x-axis labels)
62  * \param name title for the plot
63  * \param plotfreq Toggle frequency plot on/off
64  * \param plotwaterfall Toggle waterfall plot on/off
65  * \param plottime Toggle time plot on/off
66  * \param plotconst Toggle constellation plot on/off
67  * \param parent a QWidget parent object, if any
68  */
69  static sptr make(int fftsize, int wintype,
70  double fc, double bw,
71  const std::string &name,
72  bool plotfreq, bool plotwaterfall,
73  bool plottime, bool plotconst,
74  QWidget *parent=NULL);
75 
76  virtual void exec_() = 0;
77  virtual PyObject* pyqwidget() = 0;
78 
79  virtual void set_fft_size(const int fftsize) = 0;
80  virtual int fft_size() const = 0;
81 
82  virtual void set_frequency_range(const double centerfreq,
83  const double bandwidth) = 0;
84  virtual void set_fft_power_db(double min, double max) = 0;
85 
86  //void set_time_domain_axis(double min, double max);
87  //void set_constellation_axis(double xmin, double xmax,
88  // double ymin, double ymax);
89  //void set_constellation_pen_size(int size);
90 
91  virtual void set_update_time(double t) = 0;
92 
93  QApplication *d_qApplication;
94  };
95 
96  } /* namespace qtgui */
97 } /* namespace gr */
98 
99 #endif /* INCLUDED_QTGUI_SINK_C_H */
float min(float a, float b)
QApplication * d_qApplication
Definition: sink_c.h:93
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
boost::shared_ptr< sink_c > sptr
Definition: sink_c.h:53
VOLK_API $kern pname $kern name
A function pointer to the dispatcher implementation.
The abstract base class for all 'terminal' processing blocks.A signal processing flow is constructed ...
Definition: block.h:60
A graphical sink to display freq, spec, time, and const plots.
Definition: sink_c.h:49