2015-08-02 19:04:20 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
2019-07-07 18:59:04 -04:00
|
|
|
// Copyright (C) 2015-2019 Edouard Griffiths, F4EXB //
|
2015-08-02 19:04:20 -04:00
|
|
|
// //
|
|
|
|
// This program is free software; you can redistribute it and/or modify //
|
|
|
|
// it under the terms of the GNU General Public License as published by //
|
|
|
|
// the Free Software Foundation as version 3 of the License, or //
|
2019-04-11 00:57:41 -04:00
|
|
|
// (at your option) any later version. //
|
2015-08-02 19:04:20 -04:00
|
|
|
// //
|
|
|
|
// This program is distributed in the hope that it will be useful, //
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
|
|
|
// GNU General Public License V3 for more details. //
|
|
|
|
// //
|
|
|
|
// You should have received a copy of the GNU General Public License //
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2019-07-07 18:59:04 -04:00
|
|
|
#ifndef INCLUDE_FILEINPUTGUI_H
|
|
|
|
#define INCLUDE_FILEINPUTGUI_H
|
2015-08-02 19:04:20 -04:00
|
|
|
|
2020-10-05 13:23:13 -04:00
|
|
|
#include <device/devicegui.h>
|
2015-08-02 19:04:20 -04:00
|
|
|
#include <QTimer>
|
2017-09-03 11:26:32 -04:00
|
|
|
#include <QWidget>
|
|
|
|
|
2017-09-16 16:23:31 -04:00
|
|
|
#include "util/messagequeue.h"
|
|
|
|
|
2019-07-07 18:59:04 -04:00
|
|
|
#include "fileinputsettings.h"
|
|
|
|
#include "fileinput.h"
|
2015-08-02 19:04:20 -04:00
|
|
|
|
2017-10-29 19:02:28 -04:00
|
|
|
class DeviceUISet;
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
2019-07-07 18:59:04 -04:00
|
|
|
class FileInputGUI;
|
2015-08-02 19:04:20 -04:00
|
|
|
}
|
|
|
|
|
2020-10-05 13:23:13 -04:00
|
|
|
class FileInputGUI : public DeviceGUI {
|
2015-08-02 19:04:20 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2022-04-07 10:32:03 -04:00
|
|
|
explicit FileInputGUI(DeviceUISet *deviceUISet, QWidget* parent = nullptr);
|
2019-07-07 18:59:04 -04:00
|
|
|
virtual ~FileInputGUI();
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
2017-09-16 16:23:31 -04:00
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2015-08-17 02:29:34 -04:00
|
|
|
virtual bool handleMessage(const Message& message);
|
2015-08-02 19:04:20 -04:00
|
|
|
|
2022-04-21 01:53:36 -04:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent* size);
|
|
|
|
|
2015-08-02 19:04:20 -04:00
|
|
|
private:
|
2019-07-07 18:59:04 -04:00
|
|
|
Ui::FileInputGUI* ui;
|
2015-08-02 19:04:20 -04:00
|
|
|
|
2019-07-07 18:59:04 -04:00
|
|
|
FileInputSettings m_settings;
|
2017-12-14 12:02:49 -05:00
|
|
|
bool m_doApplySettings;
|
2016-05-11 17:35:16 -04:00
|
|
|
QTimer m_statusTimer;
|
2015-08-02 19:04:20 -04:00
|
|
|
std::vector<int> m_gains;
|
2016-10-02 17:16:40 -04:00
|
|
|
DeviceSampleSource* m_sampleSource;
|
2015-08-03 22:17:24 -04:00
|
|
|
bool m_acquisition;
|
|
|
|
int m_sampleRate;
|
2018-01-25 17:52:36 -05:00
|
|
|
quint32 m_sampleSize;
|
2015-08-03 22:17:24 -04:00
|
|
|
quint64 m_centerFrequency;
|
2020-08-25 18:12:30 -04:00
|
|
|
quint64 m_recordLengthMuSec;
|
2018-10-12 11:05:03 -04:00
|
|
|
quint64 m_startingTimeStamp;
|
|
|
|
quint64 m_samplesCount;
|
2015-08-05 19:43:35 -04:00
|
|
|
std::size_t m_tickCount;
|
2016-02-25 08:07:39 -05:00
|
|
|
bool m_enableNavTime;
|
2016-05-12 06:29:12 -04:00
|
|
|
int m_deviceSampleRate;
|
|
|
|
quint64 m_deviceCenterFrequency; //!< Center frequency in device
|
2016-05-11 17:35:16 -04:00
|
|
|
int m_lastEngineState;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2015-08-02 19:04:20 -04:00
|
|
|
|
2017-12-14 12:02:49 -05:00
|
|
|
void blockApplySettings(bool block) { m_doApplySettings = !block; }
|
2015-08-02 19:04:20 -04:00
|
|
|
void displaySettings();
|
2015-08-03 22:17:24 -04:00
|
|
|
void displayTime();
|
2015-08-02 19:04:20 -04:00
|
|
|
void sendSettings();
|
2016-05-12 06:29:12 -04:00
|
|
|
void updateSampleRateAndFrequency();
|
2015-08-04 21:25:06 -04:00
|
|
|
void configureFileName();
|
|
|
|
void updateWithAcquisition();
|
|
|
|
void updateWithStreamData();
|
|
|
|
void updateWithStreamTime();
|
2018-10-13 19:16:39 -04:00
|
|
|
void setAccelerationCombo();
|
|
|
|
void setNumberStr(int n, QString& s);
|
2022-04-07 10:32:03 -04:00
|
|
|
void makeUIConnections();
|
2015-08-02 19:04:20 -04:00
|
|
|
|
|
|
|
private slots:
|
2017-09-16 19:23:54 -04:00
|
|
|
void handleInputMessages();
|
2016-05-11 17:35:16 -04:00
|
|
|
void on_startStop_toggled(bool checked);
|
2015-08-02 19:04:20 -04:00
|
|
|
void on_playLoop_toggled(bool checked);
|
|
|
|
void on_play_toggled(bool checked);
|
2016-02-25 08:07:39 -05:00
|
|
|
void on_navTimeSlider_valueChanged(int value);
|
2015-08-04 19:43:30 -04:00
|
|
|
void on_showFileDialog_clicked(bool checked);
|
2018-10-13 19:16:39 -04:00
|
|
|
void on_acceleration_currentIndexChanged(int index);
|
2016-05-11 17:35:16 -04:00
|
|
|
void updateStatus();
|
2015-08-05 19:43:35 -04:00
|
|
|
void tick();
|
2018-12-26 05:06:37 -05:00
|
|
|
void openDeviceSettingsDialog(const QPoint& p);
|
2015-08-02 19:04:20 -04:00
|
|
|
};
|
|
|
|
|
2019-07-07 18:59:04 -04:00
|
|
|
#endif // INCLUDE_FILEINPUTGUI_H
|