GNU Radio Manual and C++ API Reference  3.7.13.4
The Free & Open Software Radio Ecosystem
sink_f.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008,2009,2011,2012,2014 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  * Message Ports:
52  *
53  * - freq (input):
54  * Receives a PMT pair: (intern("freq"), double(frequency).
55  * This is used to retune the center frequency of the
56  * display's x-axis.
57  *
58  * - freq (output):
59  * Produces a PMT pair with (intern("freq"), double(frequency).
60  * When a user double-clicks on the display, the block
61  * produces and emits a message containing the frequency of
62  * where on the x-axis the user clicked. This value can be
63  * used by other blocks to update their frequency setting.
64  *
65  * To perform click-to-tune behavior, this output 'freq'
66  * port can be redirected to this block's input 'freq' port
67  * to catch the message and update the center frequency of
68  * the display.
69  */
70  class QTGUI_API sink_f : virtual public block
71  {
72  public:
73  // gr::qtgui::sink_f::sptr
74  typedef boost::shared_ptr<sink_f> sptr;
75 
76  /*!
77  * \brief Build a floating point qtgui sink.
78  *
79  * \param fftsize size of the FFT to compute and display
80  * \param wintype type of window to apply (see gnuradio/filter/firdes.h)
81  * \param fc center frequency of signal (use for x-axis labels)
82  * \param bw bandwidth of signal (used to set x-axis labels)
83  * \param name title for the plot
84  * \param plotfreq Toggle frequency plot on/off
85  * \param plotwaterfall Toggle waterfall plot on/off
86  * \param plottime Toggle time plot on/off
87  * \param plotconst Toggle constellation plot on/off
88  * \param parent a QWidget parent object, if any
89  */
90  static sptr make(int fftsize, int wintype,
91  double fc, double bw,
92  const std::string &name,
93  bool plotfreq, bool plotwaterfall,
94  bool plottime, bool plotconst,
95  QWidget *parent=NULL);
96 
97  virtual void exec_() = 0;
98  virtual QWidget* qwidget() = 0;
99 
100 #ifdef ENABLE_PYTHON
101  virtual PyObject* pyqwidget() = 0;
102 #else
103  virtual void* pyqwidget() = 0;
104 #endif
105 
106  virtual void set_fft_size(const int fftsize) = 0;
107  virtual int fft_size() const = 0;
108 
109  virtual void set_frequency_range(const double centerfreq,
110  const double bandwidth) = 0;
111  virtual void set_fft_power_db(double min, double max) = 0;
112  virtual void enable_rf_freq(bool en) = 0;
113 
114  //void set_time_domain_axis(double min, double max);
115  //void set_constellation_axis(double xmin, double xmax,
116  // double ymin, double ymax);
117  //void set_constellation_pen_size(int size);
118 
119  virtual void set_update_time(double t) = 0;
120 
121  QApplication *d_qApplication;
122  };
123 
124  } /* namespace qtgui */
125 } /* namespace gr */
126 
127 #endif /* INCLUDED_QTGUI_SINK_F_H */
float min(float a, float b)
boost::shared_ptr< sink_f > sptr
Definition: sink_f.h:74
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:30
Include this header to use the message passing features.
Definition: logger.h:695
QApplication * d_qApplication
Definition: sink_f.h:121
A graphical sink to display freq, spec, and time.
Definition: sink_f.h:70
The abstract base class for all &#39;terminal&#39; processing blocks.A signal processing flow is constructed ...
Definition: block.h:65