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.
perseusgui.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_PERSEUS_PERSEUSGUI_H_
19 #define PLUGINS_SAMPLESOURCE_PERSEUS_PERSEUSGUI_H_
20 
22 #include <QTimer>
23 #include <QWidget>
24 
25 #include "util/messagequeue.h"
26 
27 #include "perseusinput.h"
28 
29 class DeviceUISet;
30 
31 namespace Ui {
32  class PerseusGui;
33 }
34 
35 class PerseusGui : public QWidget, public PluginInstanceGUI {
36  Q_OBJECT
37 
38 public:
39  explicit PerseusGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
40  virtual ~PerseusGui();
41  virtual void destroy();
42 
43  void setName(const QString& name);
44  QString getName() const;
45 
46  void resetToDefaults();
47  virtual qint64 getCenterFrequency() const;
48  virtual void setCenterFrequency(qint64 centerFrequency);
49  QByteArray serialize() const;
50  bool deserialize(const QByteArray& data);
51  virtual MessageQueue* getInputMessageQueue() { return &m_inputMessageQueue; }
52  virtual bool handleMessage(const Message& message);
53  uint32_t getDevSampleRate(unsigned int index);
54  int getDevSampleRateIndex(uint32_t sampleRate);
55 
56 private:
57  Ui::PerseusGui* ui;
58 
63  QTimer m_updateTimer;
64  QTimer m_statusTimer;
65  std::vector<uint32_t> m_rates;
71 
72  void blockApplySettings(bool block) { m_doApplySettings = !block; }
73  void displaySettings();
74  void displaySampleRates();
75  void updateFrequencyLimits();
76  void sendSettings();
77  void updateSampleRateAndFrequency();
78 
79 private slots:
80  void on_centerFrequency_changed(quint64 value);
81  void on_LOppm_valueChanged(int value);
82  void on_resetLOppm_clicked();
83  void on_sampleRate_currentIndexChanged(int index);
84  void on_wideband_toggled(bool checked);
85  void on_decim_currentIndexChanged(int index);
86  void on_startStop_toggled(bool checked);
87  void on_record_toggled(bool checked);
88  void on_transverter_clicked();
89  void on_attenuator_currentIndexChanged(int index);
90  void on_adcDither_toggled(bool checked);
91  void on_adcPreamp_toggled(bool checked);
92  void updateHardware();
93  void updateStatus();
94  void handleInputMessages();
95  void openDeviceSettingsDialog(const QPoint& p);
96 };
97 
98 #endif /* PLUGINS_SAMPLESOURCE_PERSEUS_PERSEUSGUI_H_ */
QTimer m_statusTimer
Definition: perseusgui.h:64
bool m_forceSettings
Definition: perseusgui.h:61
bool m_doApplySettings
Definition: perseusgui.h:60
DeviceUISet * m_deviceUISet
Definition: perseusgui.h:59
std::vector< uint32_t > m_rates
Definition: perseusgui.h:65
virtual MessageQueue * getInputMessageQueue()
Definition: perseusgui.h:51
unsigned int uint32_t
Definition: rtptypes_win.h:46
Ui::PerseusGui * ui
Definition: perseusgui.h:57
void blockApplySettings(bool block)
Definition: perseusgui.h:72
PerseusInput * m_sampleSource
Definition: perseusgui.h:66
PerseusSettings m_settings
Definition: perseusgui.h:62
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: perseusgui.h:68
int m_lastEngineState
Definition: perseusgui.h:69
int m_sampleRate
Definition: perseusgui.h:67
QTimer m_updateTimer
Definition: perseusgui.h:63
MessageQueue m_inputMessageQueue
Definition: perseusgui.h:70