GNU Radio Manual and C++ API Reference  3.10.9.1
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_QTGUI_SINK_F_H
12 #define INCLUDED_QTGUI_SINK_F_H
13 
14 #include <gnuradio/block.h>
15 #include <gnuradio/qtgui/api.h>
16 #include <qapplication.h>
17 #include <qwt_symbol.h>
18 
19 
20 namespace gr {
21 namespace qtgui {
22 
23 /*!
24  * \brief A graphical sink to display freq, spec, and time.
25  * \ingroup instrumentation_blk
26  * \ingroup qtgui_blk
27  *
28  * \details
29  * This is a QT-based graphical sink the takes a float stream and
30  * plots it. The default action is to plot the signal as a PSD (FFT),
31  * spectrogram (waterfall), and time domain plots. The plots may be
32  * turned off by setting the appropriate boolean value in the
33  * constructor to False.
34  *
35  * Message Ports:
36  *
37  * - freq (input):
38  * Receives a PMT pair: (intern("freq"), double(frequency).
39  * This is used to retune the center frequency of the
40  * display's x-axis.
41  *
42  * - freq (output):
43  * Produces a PMT pair with (intern("freq"), double(frequency).
44  * When a user double-clicks on the display, the block
45  * produces and emits a message containing the frequency of
46  * where on the x-axis the user clicked. This value can be
47  * used by other blocks to update their frequency setting.
48  *
49  * To perform click-to-tune behavior, this output 'freq'
50  * port can be redirected to this block's input 'freq' port
51  * to catch the message and update the center frequency of
52  * the display.
53  */
54 class QTGUI_API sink_f : virtual public block
55 {
56 public:
57  // gr::qtgui::sink_f::sptr
58  typedef std::shared_ptr<sink_f> sptr;
59 
60  /*!
61  * \brief Build a floating point qtgui sink.
62  *
63  * \param fftsize size of the FFT to compute and display
64  * \param wintype type of window to apply (see gnuradio/filter/firdes.h)
65  * \param fc center frequency of signal (use for x-axis labels)
66  * \param bw bandwidth of signal (used to set x-axis labels)
67  * \param name title for the plot
68  * \param plotfreq Toggle frequency plot on/off
69  * \param plotwaterfall Toggle waterfall plot on/off
70  * \param plottime Toggle time plot on/off
71  * \param plotconst Toggle constellation plot on/off
72  * \param parent a QWidget parent object, if any
73  */
74  static sptr make(int fftsize,
75  int wintype,
76  double fc,
77  double bw,
78  const std::string& name,
79  bool plotfreq,
80  bool plotwaterfall,
81  bool plottime,
82  bool plotconst,
83  QWidget* parent = NULL);
84 
85  virtual void exec_() = 0;
86  virtual QWidget* qwidget() = 0;
87 
88  virtual void set_fft_size(const int fftsize) = 0;
89  virtual int fft_size() const = 0;
90 
91  virtual void set_frequency_range(const double centerfreq, const double bandwidth) = 0;
92  virtual void set_fft_power_db(double min, double max) = 0;
93  virtual void enable_rf_freq(bool en) = 0;
94 
95  // void set_time_domain_axis(double min, double max);
96  // void set_constellation_axis(double xmin, double xmax,
97  // double ymin, double ymax);
98  // void set_constellation_pen_size(int size);
99 
100  virtual void set_update_time(double t) = 0;
101 
102  QApplication* d_qApplication;
103 };
104 
105 } /* namespace qtgui */
106 } /* namespace gr */
107 
108 #endif /* INCLUDED_QTGUI_SINK_F_H */
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
A graphical sink to display freq, spec, and time.
Definition: sink_f.h:55
virtual void set_frequency_range(const double centerfreq, const double bandwidth)=0
virtual void exec_()=0
virtual void set_update_time(double t)=0
static sptr make(int fftsize, int wintype, double fc, double bw, const std::string &name, bool plotfreq, bool plotwaterfall, bool plottime, bool plotconst, QWidget *parent=NULL)
Build a floating point qtgui sink.
virtual void set_fft_power_db(double min, double max)=0
std::shared_ptr< sink_f > sptr
Definition: sink_f.h:58
virtual int fft_size() const =0
virtual void enable_rf_freq(bool en)=0
virtual void set_fft_size(const int fftsize)=0
virtual QWidget * qwidget()=0
QApplication * d_qApplication
Definition: sink_f.h:102
#define QTGUI_API
Definition: gr-qtgui/include/gnuradio/qtgui/api.h:18
float min(float a, float b)
GNU Radio logging wrapper.
Definition: basic_block.h:29