SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
rtlsdrgui.h
Go to the documentation of this file.
1 // Copyright (C) 2015 Edouard Griffiths, F4EXB //
3 // //
4 // This program is free software; you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation as version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // This program is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License V3 for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
17 
18 #ifndef INCLUDE_RTLSDRGUI_H
19 #define INCLUDE_RTLSDRGUI_H
20 
22 #include <QTimer>
23 #include <QWidget>
24 
25 #include "util/messagequeue.h"
26 
27 #include "rtlsdrinput.h"
28 
29 class DeviceUISet;
30 
31 namespace Ui {
32  class RTLSDRGui;
33  class RTLSDRSampleRates;
34 }
35 
36 class RTLSDRGui : public QWidget, public PluginInstanceGUI {
37  Q_OBJECT
38 
39 public:
40  explicit RTLSDRGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
41  virtual ~RTLSDRGui();
42  virtual void destroy();
43 
44  void setName(const QString& name);
45  QString getName() const;
46 
47  void resetToDefaults();
48  virtual qint64 getCenterFrequency() const;
49  virtual void setCenterFrequency(qint64 centerFrequency);
50  QByteArray serialize() const;
51  bool deserialize(const QByteArray& data);
52  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
53  virtual bool handleMessage(const Message& message);
54 
55 private:
56  Ui::RTLSDRGui* ui;
57 
63  QTimer m_updateTimer;
64  QTimer m_statusTimer;
65  std::vector<int> m_gains;
71 
72  void displayGains();
73  void displaySampleRate();
74  void displayFcTooltip();
75  void displaySettings();
76  void sendSettings();
77  void updateSampleRateAndFrequency();
78  void updateFrequencyLimits();
79  void blockApplySettings(bool block);
80 
81 private slots:
82  void handleInputMessages();
83  void on_centerFrequency_changed(quint64 value);
84  void on_sampleRate_changed(quint64 value);
85  void on_offsetTuning_toggled(bool checked);
86  void on_rfBW_changed(quint64 value);
87  void on_lowSampleRate_toggled(bool checked);
88  void on_dcOffset_toggled(bool checked);
89  void on_iqImbalance_toggled(bool checked);
90  void on_decim_currentIndexChanged(int index);
91  void on_fcPos_currentIndexChanged(int index);
92  void on_ppm_valueChanged(int value);
93  void on_gain_valueChanged(int value);
94  void on_checkBox_stateChanged(int state);
95  void on_agc_stateChanged(int state);
96  void on_startStop_toggled(bool checked);
97  void on_record_toggled(bool checked);
98  void on_transverter_clicked();
99  void on_sampleRateMode_toggled(bool checked);
100  void openDeviceSettingsDialog(const QPoint& p);
101  void updateHardware();
102  void updateStatus();
103 };
104 
105 #endif // INCLUDE_RTLSDRGUI_H
bool m_forceSettings
Definition: rtlsdrgui.h:60
int m_sampleRate
Definition: rtlsdrgui.h:67
QTimer m_statusTimer
Definition: rtlsdrgui.h:64
DeviceUISet * m_deviceUISet
Definition: rtlsdrgui.h:58
QTimer m_updateTimer
Definition: rtlsdrgui.h:63
virtual MessageQueue * getInputMessageQueue()
Definition: rtlsdrgui.h:52
int m_lastEngineState
Definition: rtlsdrgui.h:69
RTLSDRSettings m_settings
Definition: rtlsdrgui.h:61
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: rtlsdrgui.h:62
RTLSDRInput * m_sampleSource
Definition: rtlsdrgui.h:66
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: rtlsdrgui.h:68
bool m_doApplySettings
Definition: rtlsdrgui.h:59
std::vector< int > m_gains
Definition: rtlsdrgui.h:65
MessageQueue m_inputMessageQueue
Definition: rtlsdrgui.h:70
Ui::RTLSDRGui * ui
Definition: rtlsdrgui.h:56