The Inspector (GNU Radio module gr-inspector)
qtgui_inspector_sink_vf_impl.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_IMPL_H
22 #define INCLUDED_INSPECTOR_QTGUI_INSPECTOR_SINK_VF_IMPL_H
23 
26 
27 namespace gr {
28 namespace inspector {
29 
31 {
32 private:
33  int d_argc, d_rf_unit, d_fft_len;
34  bool d_manual, d_auto_sent;
35  float d_cfreq;
36  double d_samp_rate;
37  char* d_argv;
38  QWidget* d_parent;
39  pmt::pmt_t d_tmp_msg;
40  inspector_form* d_main_gui;
41  QApplication* d_qApplication;
42  std::vector<double> d_buffer;
43  std::vector<std::vector<float>> d_rf_map;
44  gr::msg_queue* d_msg_queue;
45 
46 public:
47  qtgui_inspector_sink_vf_impl(double samp_rate,
48  int fft_len,
49  float cfreq,
50  int rf_unit,
51  int msgports,
52  bool manual,
53  QWidget* parent);
55 
56 #ifdef ENABLE_PYTHON
57  PyObject* pyqwidget();
58 #else
59  void* pyqwidget();
60 #endif
61 
62 
63  void handle_msg(pmt::pmt_t msg);
64  void handle_analysis(pmt::pmt_t msg);
65  void unpack_message(pmt::pmt_t msg);
66  void send_manual_message(float center, float bw);
67  void set_rf_unit(int unit);
68  void set_samp_rate(double d_samp_rate);
69 
70  void initialize();
71 
72  // Where all the action really happens
73  int work(int noutput_items,
74  gr_vector_const_void_star& input_items,
75  gr_vector_void_star& output_items);
76 
77 
78  void set_cfreq(float cfreq)
79  {
80  d_cfreq = cfreq;
81  d_main_gui->set_cfreq(cfreq);
82  d_main_gui->set_axis_x(-d_samp_rate / 2, d_samp_rate / 2 - 1);
83  }
84 };
85 
86 } // namespace inspector
87 } // namespace gr
88 
89 #endif /* INCLUDED_INSPECTOR_QTGUI_INSPECTOR_SINK_VF_IMPL_H */
void set_cfreq(float cfreq)
Definition: qtgui_inspector_sink_vf_impl.h:78
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
Definition: inspector_form.h:72
void send_manual_message(float center, float bw)
GUI for the inspector toolkit.
Definition: qtgui_inspector_sink_vf.h:65
void set_axis_x(float start, float stop)
Definition: qtgui_inspector_sink_vf_impl.h:30
Definition: inspector_form.h:40
qtgui_inspector_sink_vf_impl(double samp_rate, int fft_len, float cfreq, int rf_unit, int msgports, bool manual, QWidget *parent)