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.
kiwisdrgui.h
Go to the documentation of this file.
1 // Copyright (C) 2019 Vort //
3 // Copyright (C) 2019 Edouard Griffiths, F4EXB //
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 _KIWISDR_KIWISDRGUI_H_
20 #define _KIWISDR_KIWISDRGUI_H_
21 
23 #include <QTimer>
24 #include <QWidget>
25 
26 #include "util/messagequeue.h"
27 
28 #include "kiwisdrsettings.h"
29 #include "kiwisdrinput.h"
30 
31 class DeviceUISet;
32 
33 namespace Ui {
34  class KiwiSDRGui;
35 }
36 
37 class KiwiSDRGui : public QWidget, public PluginInstanceGUI {
38  Q_OBJECT
39 
40 public:
41  explicit KiwiSDRGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
42  virtual ~KiwiSDRGui();
43  virtual void destroy();
44 
45  void setName(const QString& name);
46  QString getName() const;
47 
48  void resetToDefaults();
49  virtual qint64 getCenterFrequency() const;
50  virtual void setCenterFrequency(qint64 centerFrequency);
51  QByteArray serialize() const;
52  bool deserialize(const QByteArray& data);
53  virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
54  virtual bool handleMessage(const Message& message);
55 
56 private:
57  Ui::KiwiSDRGui* ui;
58 
61  QTimer m_updateTimer;
62  QTimer m_statusTimer;
66  std::size_t m_tickCount;
71  std::vector<QString> m_statusColors;
72  std::vector<QString> m_statusTooltips;
73 
74  void blockApplySettings(bool block) { m_doApplySettings = !block; }
75  void displaySettings();
76  void sendSettings();
77  void updateSampleRateAndFrequency();
78 
79 private slots:
80  void handleInputMessages();
81  void on_startStop_toggled(bool checked);
82  void on_centerFrequency_changed(quint64 value);
83  void on_record_toggled(bool checked);
84  void on_gain_valueChanged(int value);
85  void on_agc_toggled(bool checked);
86  void on_serverAddress_returnPressed();
87  void on_serverAddressApplyButton_clicked();
88  void on_dcBlock_toggled(bool checked);
89  void openDeviceSettingsDialog(const QPoint& p);
90  void updateStatus();
91  void updateHardware();
92 };
93 
94 #endif // _KIWISDR_KIWISDRGUI_H_
KiwiSDRSettings m_settings
Definition: kiwisdrgui.h:60
QTimer m_statusTimer
Definition: kiwisdrgui.h:62
std::size_t m_tickCount
Definition: kiwisdrgui.h:66
std::vector< QString > m_statusTooltips
Definition: kiwisdrgui.h:72
bool m_doApplySettings
Definition: kiwisdrgui.h:63
void blockApplySettings(bool block)
Definition: kiwisdrgui.h:74
bool m_forceSettings
Definition: kiwisdrgui.h:64
DeviceUISet * m_deviceUISet
Definition: kiwisdrgui.h:59
QTimer m_updateTimer
Definition: kiwisdrgui.h:61
DeviceSampleSource * m_sampleSource
Definition: kiwisdrgui.h:65
int m_deviceSampleRate
Definition: kiwisdrgui.h:67
std::vector< QString > m_statusColors
Definition: kiwisdrgui.h:71
int m_lastEngineState
Definition: kiwisdrgui.h:69
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: kiwisdrgui.h:68
Ui::KiwiSDRGui * ui
Definition: kiwisdrgui.h:57
virtual MessageQueue * getInputMessageQueue()
Definition: kiwisdrgui.h:53
MessageQueue m_inputMessageQueue
Definition: kiwisdrgui.h:70