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