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.
fileinputgui.h
Go to the documentation of this file.
1 // Copyright (C) 2015-2019 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 INCLUDE_FILEINPUTGUI_H
19 #define INCLUDE_FILEINPUTGUI_H
20 
22 #include <QTimer>
23 #include <QWidget>
24 
25 #include "util/messagequeue.h"
26 
27 #include "fileinputsettings.h"
28 #include "fileinput.h"
29 
30 class DeviceUISet;
31 
32 namespace Ui {
33  class FileInputGUI;
34 }
35 
36 class FileInputGUI : public QWidget, public PluginInstanceGUI {
37  Q_OBJECT
38 
39 public:
40  explicit FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent = 0);
41  virtual ~FileInputGUI();
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::FileInputGUI* ui;
57 
61  QTimer m_statusTimer;
62  std::vector<int> m_gains;
65  QString m_fileName;
67  quint32 m_sampleSize;
69  quint64 m_recordLength;
71  quint64 m_samplesCount;
72  std::size_t m_tickCount;
78 
79  void blockApplySettings(bool block) { m_doApplySettings = !block; }
80  void displaySettings();
81  void displayTime();
82  void sendSettings();
83  void updateSampleRateAndFrequency();
84  void configureFileName();
85  void updateWithAcquisition();
86  void updateWithStreamData();
87  void updateWithStreamTime();
88  void setAccelerationCombo();
89  void setNumberStr(int n, QString& s);
90 
91 private slots:
92  void handleInputMessages();
93  void on_startStop_toggled(bool checked);
94  void on_playLoop_toggled(bool checked);
95  void on_play_toggled(bool checked);
96  void on_navTimeSlider_valueChanged(int value);
97  void on_showFileDialog_clicked(bool checked);
98  void on_acceleration_currentIndexChanged(int index);
99  void updateStatus();
100  void tick();
101  void openDeviceSettingsDialog(const QPoint& p);
102 };
103 
104 #endif // INCLUDE_FILEINPUTGUI_H
std::vector< int > m_gains
Definition: fileinputgui.h:62
quint64 m_centerFrequency
Definition: fileinputgui.h:68
virtual MessageQueue * getInputMessageQueue()
Definition: fileinputgui.h:52
void blockApplySettings(bool block)
Definition: fileinputgui.h:79
bool m_doApplySettings
Definition: fileinputgui.h:60
FileInputSettings m_settings
Definition: fileinputgui.h:59
int m_lastEngineState
Definition: fileinputgui.h:76
quint64 m_startingTimeStamp
Definition: fileinputgui.h:70
quint32 m_sampleSize
Definition: fileinputgui.h:67
DeviceUISet * m_deviceUISet
Definition: fileinputgui.h:58
std::size_t m_tickCount
Definition: fileinputgui.h:72
int m_deviceSampleRate
Definition: fileinputgui.h:74
Ui::FileInputGUI * ui
Definition: fileinputgui.h:56
quint64 m_samplesCount
Definition: fileinputgui.h:71
QString m_fileName
Definition: fileinputgui.h:65
MessageQueue m_inputMessageQueue
Definition: fileinputgui.h:77
QTimer m_statusTimer
Definition: fileinputgui.h:61
quint64 m_deviceCenterFrequency
Center frequency in device.
Definition: fileinputgui.h:75
bool m_acquisition
Definition: fileinputgui.h:64
quint64 m_recordLength
Definition: fileinputgui.h:69
DeviceSampleSource * m_sampleSource
Definition: fileinputgui.h:63
bool m_enableNavTime
Definition: fileinputgui.h:73