Radio Control  Control Software and GUI for the Panoradio SDR, by DC9ST 2016
mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3 
4 #include <fstream>
5 #include <QMainWindow>
6 #include "stipcores.h"
7 #include <qwt_plot_curve.h>
8 #include <qwt_plot_grid.h>
9 #include <qwt_color_map.h>
10 #include "audio_rx/audiorx.h"
11 #include "waterfall_rx/waterfallddc.h"
12 #include "testgenerator.h"
13 #include "dialogdebugmonitor.h"
14 #include "frontend.h"
15 
16 #include <fft/fft_avg_complex.h>
17 #include <fft/fft_avg_real.h>
18 
19 #include <QMouseEvent>
20 
21 
22 namespace Ui {
23 class MainWindow;
24 }
25 
27 class MainWindow : public QMainWindow
28 {
29  Q_OBJECT
30 
31 public:
32  explicit MainWindow(QWidget *parent = 0);
33  ~MainWindow();
34 
35 
36 signals:
37  // Frontend Signals
39  void send_frontend_scaler_setting(int scaler_value_db);
40 
42  void send_frontend_auto_setting(bool auto_setting);
43 
44 
45  // Debug Signals
48  void send_debug_single(double frequency);
49 
54  void send_debug_sweep(double start_f, double stop_f, double step_f);
55 
56 
57  // Audio Signals
59  void send_audio_rx_frequency(double frequency, int ddc_number);
60 
62  void send_audio_ddc_selection(int ddc_number, bool active);
63 
68  void send_audio_output_properties(int bandwidth, bool inverted, bool binaural);
69 
71  void send_audio_output_scaler_setting (int scaling_value_db);
72 
74  void send_audio_output_scaler_auto_setting(bool autos_setting);
75 
76 
77 private slots:
78 
80  void on_connect_pushButton_clicked();
81 
83  void update_waterfall();
84 
85 
86  // Frontend Slots
88  void get_frontend_rf_value(int rf_level, int rf_level_dbfs);
89 
91  void get_frontend_scaling_value(int true_scaler_value_db);
92 
94  void on_rfscaling_horizontalSlider_sliderMoved(int position);
95 
97  void on_checkBox_rf_scale_auto_clicked(bool checked);
98 
99 
100 
101  // Debug Slots
103  void debug_single_selected();
104 
106  void debug_sweep_selected();
107 
109  void get_debug_true_frequency(double frequency);
110 
112  void on_debugmonitor_pushButton_clicked();
113 
115  void correct_plots();
116 
118  void waterfall_reset();
119 
121  void audio_reset();
122 
123 
124 
125  //Audio Slots
127  void get_audio_out_level(int audio_level, int audio_level_dbfs);
128 
130  void get_audio_properties();
131 
133  void on_select_audio_ddc0_Button_clicked();
134 
136  void on_select_audio_ddc1_Button_clicked();
137 
139  void on_audio_ddc0_freq_lineEdit_textChanged();
140 
142  void on_audio_ddc1_freq_lineEdit_textChanged();
143 
146  void get_audio_frequency_clicked(double frequency);
147 
149  void get_audio_ddc0_new_frequency(double frequency);
150 
152  void get_audio_ddc1_new_frequency(double frequency);
153 
154 
156  void on_audioscaling_horizontalSlider_sliderMoved(int position);
157 
159  void on_checkBox_audio_scale_auto_clicked(bool checked);
160 
162  void get_audio_scaling_value(int true_scaler_value_db);
163 
164 
165 
166 
167  // Waterfall settings
169  void on_update_rate_comboBox_currentIndexChanged(int index);
170 
172  void on_avg_ffts_comboBox_currentIndexChanged(const QString &arg1);
173 
175  void update_waterfall_color_map();
176 
177 
178 
179  // low level debug stuff
181  void on_record_pushButton_clicked();
182 
183 private:
184  Ui::MainWindow *ui;
185  DialogDebugMonitor *ui_debug_monitor;
186 
188  void set_bandwidth_bars();
189 
190  AD9467 *adc;
191  AudioRX *audio_rx_;
192  Frontend *rx_frontend_; // SDR Frontend Hardware Control
193  Testgenerator *testgenerator_; // SDR Hardware Testgen. Control
194  IP_Driver *iq_reset; // reset module (hardware reset) for waterfall DDC
195 
196  WaterfallDDC *waterfall_ddc_; // Main Waterfall RX
197  WaterfallDDC *waterfall_1a_ddc_; // Left Waterfall RX
198  WaterfallDDC *waterfall_1b_ddc_; // Right Waterfall RX
199 
200  QTimer *timer_; // timer for updating the waterfall
201 
202  double power_level_min_; // lowest and highest power levels in waterfalls, set in constructor
203  double power_level_max_;
204  double gain_mixer; // gain in db introduced by the mixer
205  int gain_scaler_rf; // gain in db introduced by the rf scaler
206  double gain_cic; // gain in db introduced by the CIC filter
207  double gain_fir; // gain in db introduced by the FIR filter
208  double gain_fir_audio; // gain in db introduced by the audio FIR filter
209 
210  bool debug_monitor_activated_; // radio in debug mode, i.e. normal radio operation stopped
211 
212  fstream record_file_; // file recording variables
213  bool currently_recording_; // in recording mode (writes FFT result of main waterfall in a file)
214 };
215 
216 #endif // MAINWINDOW_H
Class for controlling the RF test generator and selecting the input source (RF/ADC, test generator or step/impulse stimulus)
Definition: testgenerator.h:9
Class for controlling the SDR frontend, i.e. the input select relais (GPIO IP core) and the rf scaler...
Definition: frontend.h:10
Definition: dialogdebugmonitor.h:15
Toplevel class for an audio receiver with two audio DDCs with IQ Reset (DDC)
Definition: audiorx.h:22
Qt Dialog GUI with debug functionalities.
Definition: dialogdebugmonitor.h:22
Class for controlling the Waterfall DDC .
Definition: waterfallddc.h:15
Main class for controlling the Panoradio SDR.
Definition: mainwindow.h:27