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.
xtrxinputgui.h
Go to the documentation of this file.
1 // Copyright (C) 2017, 2018 Edouard Griffiths, F4EXB //
3 // Copyright (C) 2017 Sergey Kostanbaev, Fairwaves Inc. //
4 // //
5 // This program 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 as version 3 of the License, or //
8 // (at your option) any later version. //
9 // //
10 // This program 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 V3 for more details. //
14 // //
15 // You should have received a copy of the GNU General Public License //
16 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
18 
19 #ifndef PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTGUI_H_
20 #define PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTGUI_H_
21 
23 #include <QTimer>
24 #include <QWidget>
25 
26 #include "util/messagequeue.h"
27 
28 #include "xtrxinput.h"
29 
30 class DeviceUISet;
31 
32 namespace Ui {
33 class XTRXInputGUI;
34 }
35 
36 class XTRXInputGUI : public QWidget, public PluginInstanceGUI {
37  Q_OBJECT
38 
39 public:
40  explicit XTRXInputGUI(DeviceUISet *deviceUISet, QWidget* parent = 0);
41  virtual ~XTRXInputGUI();
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::XTRXInputGUI* ui;
57 
62  QTimer m_updateTimer;
63  QTimer m_statusTimer;
72 
73  void displaySettings();
74  void displaySampleRate();
75  void setNCODisplay();
76  void setCenterFrequencyDisplay();
77  void setCenterFrequencySetting(uint64_t kHzValue);
78  void sendSettings();
79  void updateSampleRateAndFrequency();
80  void updateADCRate();
81  void blockApplySettings(bool block);
82 
83 private slots:
84  void handleInputMessages();
85  void on_startStop_toggled(bool checked);
86  void on_record_toggled(bool checked);
87  void on_centerFrequency_changed(quint64 value);
88  void on_ncoFrequency_changed(qint64 value);
89  void on_ncoEnable_toggled(bool checked);
90  void on_dcOffset_toggled(bool checked);
91  void on_iqImbalance_toggled(bool checked);
92  void on_sampleRate_changed(quint64 value);
93  void on_hwDecim_currentIndexChanged(int index);
94  void on_swDecim_currentIndexChanged(int index);
95  void on_lpf_changed(quint64 value);
96  void on_gainMode_currentIndexChanged(int index);
97  void on_gain_valueChanged(int value);
98  void on_lnaGain_valueChanged(int value);
99  void on_tiaGain_currentIndexChanged(int index);
100  void on_pgaGain_valueChanged(int value);
101  void on_antenna_currentIndexChanged(int index);
102  void on_extClock_clicked();
103  void on_pwrmode_currentIndexChanged(int index);
104  void on_sampleRateMode_toggled(bool checked);
105 
106  void updateHardware();
107  void updateStatus();
108  void openDeviceSettingsDialog(const QPoint& p);
109 };
110 
111 #endif /* PLUGINS_SAMPLESOURCE_XTRXINPUT_XTRXINPUTGUI_H_ */
QTimer m_statusTimer
Definition: xtrxinputgui.h:63
MessageQueue m_inputMessageQueue
Definition: xtrxinputgui.h:71
QTimer m_updateTimer
Definition: xtrxinputgui.h:62
virtual MessageQueue * getInputMessageQueue()
Definition: xtrxinputgui.h:52
XTRXInput * m_XTRXInput
Same object as above but gives easy access to XTRXInput methods and attributes that are used intensiv...
Definition: xtrxinputgui.h:59
XTRXInputSettings m_settings
Definition: xtrxinputgui.h:60
bool m_doApplySettings
Definition: xtrxinputgui.h:67
DeviceUISet * m_deviceUISet
Definition: xtrxinputgui.h:58
bool m_forceSettings
Definition: xtrxinputgui.h:68
int m_lastEngineState
Definition: xtrxinputgui.h:66
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: xtrxinputgui.h:65
int m_statusCounter
Definition: xtrxinputgui.h:69
int m_deviceStatusCounter
Definition: xtrxinputgui.h:70
Ui::XTRXInputGUI * ui
Definition: xtrxinputgui.h:56
bool m_sampleRateMode
true: device, false: base band sample rate update mode
Definition: xtrxinputgui.h:61
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48