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