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.
testsourcegui.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 _TESTSOURCE_TESTSOURCEGUI_H_
19 #define _TESTSOURCE_TESTSOURCEGUI_H_
20 
22 #include <QTimer>
23 #include <QWidget>
24 
25 #include "util/messagequeue.h"
26 
27 #include "testsourcesettings.h"
28 #include "testsourceinput.h"
29 
30 class DeviceUISet;
31 
32 namespace Ui {
33  class TestSourceGui;
34 }
35 
36 class TestSourceGui : public QWidget, public PluginInstanceGUI {
37  Q_OBJECT
38 
39 public:
40  explicit TestSourceGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
41  virtual ~TestSourceGui();
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::TestSourceGui* ui;
57 
60  QTimer m_updateTimer;
61  QTimer m_statusTimer;
65  std::size_t m_tickCount;
70 
71  void blockApplySettings(bool block) { m_doApplySettings = !block; }
72  void displaySettings();
73  void sendSettings();
74  void updateSampleRateAndFrequency();
75  void displayAmplitude();
76  void updateAmpCoarseLimit();
77  void updateAmpFineLimit();
78  void updateFrequencyShiftLimit();
79 
80 private slots:
81  void handleInputMessages();
82  void on_startStop_toggled(bool checked);
83  void on_centerFrequency_changed(quint64 value);
84  void on_autoCorr_currentIndexChanged(int index);
85  void on_frequencyShift_changed(qint64 value);
86  void on_decimation_currentIndexChanged(int index);
87  void on_fcPos_currentIndexChanged(int index);
88  void on_sampleRate_changed(quint64 value);
89  void on_sampleSize_currentIndexChanged(int index);
90  void on_amplitudeCoarse_valueChanged(int value);
91  void on_amplitudeFine_valueChanged(int value);
92  void on_modulation_currentIndexChanged(int index);
93  void on_modulationFrequency_valueChanged(int value);
94  void on_amModulation_valueChanged(int value);
95  void on_fmDeviation_valueChanged(int value);
96  void on_dcBias_valueChanged(int value);
97  void on_iBias_valueChanged(int value);
98  void on_qBias_valueChanged(int value);
99  void on_phaseImbalance_valueChanged(int value);
100  void on_record_toggled(bool checked);
101  void openDeviceSettingsDialog(const QPoint& p);
102  void updateStatus();
103  void updateHardware();
104 };
105 
106 #endif // _TESTSOURCE_TESTSOURCEGUI_H_
MessageQueue m_inputMessageQueue
Definition: testsourcegui.h:69
void blockApplySettings(bool block)
Definition: testsourcegui.h:71
std::size_t m_tickCount
Definition: testsourcegui.h:65
Ui::TestSourceGui * ui
Definition: testsourcegui.h:56
QTimer m_updateTimer
Definition: testsourcegui.h:60
DeviceSampleSource * m_sampleSource
Definition: testsourcegui.h:64
int m_deviceSampleRate
Definition: testsourcegui.h:66
virtual MessageQueue * getInputMessageQueue()
Definition: testsourcegui.h:52
DeviceUISet * m_deviceUISet
Definition: testsourcegui.h:58
QTimer m_statusTimer
Definition: testsourcegui.h:61
bool m_doApplySettings
Definition: testsourcegui.h:62
bool m_forceSettings
Definition: testsourcegui.h:63
TestSourceSettings m_settings
Definition: testsourcegui.h:59
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: testsourcegui.h:67