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.
soapysdrinputgui.h
Go to the documentation of this file.
1 // Copyright (C) 2018 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 PLUGINS_SAMPLESOURCE_SOAPYSDRINPUT_SOAPYSDRINPUTGUI_H_
19 #define PLUGINS_SAMPLESOURCE_SOAPYSDRINPUT_SOAPYSDRINPUTGUI_H_
20 
21 #include <QTimer>
22 #include <QWidget>
23 
25 #include "util/messagequeue.h"
26 
27 #include "soapysdrinput.h"
28 
29 class DeviceUISet;
30 class ItemSettingGUI;
31 class StringRangeGUI;
34 class IntervalSliderGUI;
35 class QCheckBox;
36 class ComplexFactorGUI;
37 
38 namespace Ui {
39  class SoapySDRInputGui;
40 }
41 
42 class SoapySDRInputGui : public QWidget, public PluginInstanceGUI {
43  Q_OBJECT
44 
45 public:
46  explicit SoapySDRInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
47  virtual ~SoapySDRInputGui();
48  virtual void destroy();
49 
50  void setName(const QString& name);
51  QString getName() const;
52 
53  virtual void resetToDefaults();
54  virtual qint64 getCenterFrequency() const;
55  virtual void setCenterFrequency(qint64 centerFrequency);
56  virtual QByteArray serialize() const;
57  virtual bool deserialize(const QByteArray& data);
58  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
59  virtual bool handleMessage(const Message& message);
60 
61 private:
62  void createRangesControl(
63  ItemSettingGUI **settingGUI,
64  const SoapySDR::RangeList& rangeList,
65  const QString& text,
66  const QString& unit);
67  void createAntennasControl(const std::vector<std::string>& antennaList);
68  void createTunableElementsControl(const std::vector<DeviceSoapySDRParams::FrequencySetting>& tunableElementsList);
69  void createGlobalGainControl();
70  void createIndividualGainsControl(const std::vector<DeviceSoapySDRParams::GainSetting>& individualGainsList);
71  void createCorrectionsControl();
72  void createArgumentsControl(const SoapySDR::ArgInfoList& argInfoList, bool deviceArguments);
73 
74  Ui::SoapySDRInputGui* ui;
75 
80  QTimer m_updateTimer;
81  QTimer m_statusTimer;
87 
91  std::vector<DynamicItemSettingGUI*> m_tunableElementsGUIs;
93  std::vector<DynamicItemSettingGUI*> m_individualGainsGUIs;
94  QCheckBox *m_autoGain;
97  QCheckBox *m_autoDCCorrection;
98  QCheckBox *m_autoIQCorrection;
99  std::vector<DynamicArgSettingGUI*> m_streamArgsGUIs;
100  std::vector<DynamicArgSettingGUI*> m_deviceArgsGUIs;
101 
102  void displaySettings();
103  void displayTunableElementsControlSettings();
104  void displayIndividualGainsControlSettings();
105  void displayCorrectionsSettings();
106  void displayStreamArgsSettings();
107  void displayDeviceArgsSettings();
108  void sendSettings();
109  void updateSampleRateAndFrequency();
110  void updateFrequencyLimits();
111  void setCenterFrequencySetting(uint64_t kHzValue);
112  void blockApplySettings(bool block);
113 
114 private slots:
115  void handleInputMessages();
116  void antennasChanged();
117  void sampleRateChanged(double sampleRate);
118  void bandwidthChanged(double bandwidth);
119  void tunableElementChanged(QString name, double value);
120  void globalGainChanged(double gain);
121  void autoGainChanged(bool set);
122  void individualGainChanged(QString name, double value);
123  void autoDCCorrectionChanged(bool set);
124  void autoIQCorrectionChanged(bool set);
125  void dcCorrectionModuleChanged(double value);
126  void dcCorrectionArgumentChanged(double value);
127  void iqCorrectionModuleChanged(double value);
128  void iqCorrectionArgumentChanged(double value);
129  void streamArgChanged(QString itemName, QVariant value);
130  void deviceArgChanged(QString itemName, QVariant value);
131 
132  void on_centerFrequency_changed(quint64 value);
133  void on_LOppm_valueChanged(int value);
134  void on_dcOffset_toggled(bool checked);
135  void on_iqImbalance_toggled(bool checked);
136  void on_decim_currentIndexChanged(int index);
137  void on_fcPos_currentIndexChanged(int index);
138  void on_transverter_clicked();
139  void on_startStop_toggled(bool checked);
140  void on_record_toggled(bool checked);
141  void updateHardware();
142  void updateStatus();
143  void openDeviceSettingsDialog(const QPoint& p);
144 };
145 
146 
147 
148 #endif /* PLUGINS_SAMPLESOURCE_SOAPYSDRINPUT_SOAPYSDRINPUTGUI_H_ */
ItemSettingGUI * m_bandwidthGUI
Ui::SoapySDRInputGui * ui
QCheckBox * m_autoGain
std::vector< DynamicArgSettingGUI * > m_deviceArgsGUIs
QCheckBox * m_autoDCCorrection
SoapySDRInputSettings m_settings
ComplexFactorGUI * m_dcCorrectionGUI
ComplexFactorGUI * m_iqCorrectionGUI
QCheckBox * m_autoIQCorrection
ItemSettingGUI * m_sampleRateGUI
DeviceUISet * m_deviceUISet
std::vector< DynamicItemSettingGUI * > m_tunableElementsGUIs
quint64 m_deviceCenterFrequency
Center frequency in device.
StringRangeGUI * m_antennas
std::vector< DynamicItemSettingGUI * > m_individualGainsGUIs
MessageQueue m_inputMessageQueue
SoapySDRInput * m_sampleSource
std::vector< DynamicArgSettingGUI * > m_streamArgsGUIs
virtual MessageQueue * getInputMessageQueue()
IntervalSliderGUI * m_gainSliderGUI
unsigned __int64 uint64_t
Definition: rtptypes_win.h:48