The Inspector (GNU Radio module gr-inspector)
qtgui_inspector_sink_vf.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2019 Free Software Foundation, Inc..
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef INCLUDED_INSPECTOR_QTGUI_INSPECTOR_SINK_VF_H
22 #define INCLUDED_INSPECTOR_QTGUI_INSPECTOR_SINK_VF_H
23 
24 #ifdef ENABLE_PYTHON
25 #include <Python.h>
26 #endif
27 
28 #include <gnuradio/sync_block.h>
29 #include <inspector/api.h>
30 #include <qapplication.h>
31 
32 namespace gr {
33 namespace inspector {
34 
35 /*!
36  * \brief GUI for the inspector toolkit
37  * \ingroup inspector
38  *
39  * \details
40  * This GUI uses QT and QWT to create a graphical interface to control the
41  * inspector and get feedback about the detected and analyzed signals.
42  *
43  * The PSD estimation of the Signal Detector block gets displayed here along
44  * with signal markers and informations. Manual signal selection can be done
45  * within the GUI created by this block.
46  *
47  * Analysis blocks can pass information to the GUI block by providing
48  * messages in the tuple format
49  *
50  * <code>((pmt::intern("signal"), pmt::from_uint64(signal_no)),
51  * (pmt::intern("description1"), pmt::from_float(value1)), ...)</code>
52  *
53  * Controls: Use CTRL+LeftMouse to zoom, RightMouse to zoom out.
54  * This prevents confusion when in manual selection mode, where the
55  * signals are selected with LeftMouse.
56  *
57  * Message ports:
58  * - map in: takes RF map from Signal Detector block and visualizes the included
59  * information in the plot
60  * - analysis_in: takes messages of analysis blocks and displays their content
61  * in the GUI plot.
62  * - map out: passes either the input message when manual selection is deactivated
63  * or passes RF map according to the user's manual settings.
64  */
65 class INSPECTOR_API qtgui_inspector_sink_vf : virtual public gr::sync_block
66 {
67 public:
68  typedef boost::shared_ptr<qtgui_inspector_sink_vf> sptr;
69 
70  /*!
71  * \brief Build a GUI sink instance.
72  *
73  * \param samp_rate Sample rate of the input signal.
74  * \param fft_len Vector input size and number of PSD sample points
75  * \param cfreq Center frequency of source. Set to 0 if only relative frequencies are
76  * desired downstream. \param rf_unit Determine which unit the GUI uses to display
77  * frequencies \param msgports Number of message ports for analysis feedback \param
78  * manual Enable manual signal selection \param parent QWidget parent
79  */
80  static sptr make(double samp_rate,
81  int fft_len,
82  float cfreq = 0,
83  int rf_unit = 1000000,
84  int msgports = 1,
85  bool manual = false,
86  QWidget* parent = nullptr);
87  virtual void set_rf_unit(int unit) = 0;
88  virtual void set_samp_rate(double d_samp_rate) = 0;
89  virtual void set_cfreq(float cfreq) = 0;
90 #ifdef ENABLE_PYTHON
91  virtual PyObject* pyqwidget() = 0;
92 #else
93  virtual void* pyqwidget() = 0;
94 #endif
95 };
96 
97 } // namespace inspector
98 } // namespace gr
99 
100 #endif /* INCLUDED_INSPECTOR_QTGUI_INSPECTOR_SINK_VF_H */
boost::shared_ptr< qtgui_inspector_sink_vf > sptr
Definition: qtgui_inspector_sink_vf.h:68
#define INSPECTOR_API
Definition: api.h:31
GUI for the inspector toolkit.
Definition: qtgui_inspector_sink_vf.h:65
Definition: inspector_form.h:40