2016-06-19 03:56:49 -04:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2016 Edouard Griffiths, F4EXB //
|
|
|
|
// //
|
|
|
|
// 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. //
|
2016-06-19 03:56:49 -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-02-02 18:26:26 -05:00
|
|
|
#ifndef INCLUDE_REMOTEINPUTGUI_H
|
|
|
|
#define INCLUDE_REMOTEINPUTGUI_H
|
2016-06-19 03:56:49 -04:00
|
|
|
|
|
|
|
#include <QTimer>
|
2020-04-19 00:13:32 -04:00
|
|
|
#include <QElapsedTimer>
|
2017-09-03 11:26:32 -04:00
|
|
|
#include <QWidget>
|
2017-09-16 16:23:31 -04:00
|
|
|
|
2020-10-05 13:23:13 -04:00
|
|
|
#include "device/devicegui.h"
|
2017-09-16 16:23:31 -04:00
|
|
|
#include "util/messagequeue.h"
|
|
|
|
|
2019-02-02 18:26:26 -05:00
|
|
|
#include "remoteinput.h"
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-10-29 19:02:28 -04:00
|
|
|
class DeviceUISet;
|
2018-09-08 17:30:22 -04:00
|
|
|
class QNetworkAccessManager;
|
|
|
|
class QNetworkReply;
|
|
|
|
class QJsonObject;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
|
|
|
namespace Ui {
|
2019-02-02 18:26:26 -05:00
|
|
|
class RemoteInputGui;
|
2016-06-19 03:56:49 -04:00
|
|
|
}
|
|
|
|
|
2020-10-05 13:23:13 -04:00
|
|
|
class RemoteInputGui : public DeviceGUI {
|
2016-06-19 03:56:49 -04:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2019-02-02 18:26:26 -05:00
|
|
|
explicit RemoteInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
|
|
|
virtual ~RemoteInputGui();
|
2017-09-16 04:45:08 -04:00
|
|
|
virtual void destroy();
|
2016-06-19 03:56:49 -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; }
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2022-04-21 01:53:36 -04:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent* size);
|
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
private:
|
2019-02-02 18:26:26 -05:00
|
|
|
Ui::RemoteInputGui* ui;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-10-29 19:02:28 -04:00
|
|
|
DeviceUISet* m_deviceUISet;
|
2019-02-02 18:26:26 -05:00
|
|
|
RemoteInputSettings m_settings; //!< current settings
|
2021-12-24 15:06:15 -05:00
|
|
|
RemoteInput::RemoteChannelSettings m_remoteChannelSettings;
|
|
|
|
double m_remoteShiftFrequencyFactor; //!< Remote channel frequency shift factor
|
2019-02-02 18:26:26 -05:00
|
|
|
RemoteInput* m_sampleSource;
|
2017-12-25 20:18:30 -05:00
|
|
|
bool m_acquisition;
|
|
|
|
int m_streamSampleRate; //!< Sample rate of received stream
|
|
|
|
quint64 m_streamCenterFrequency; //!< Center frequency of received stream
|
2016-06-19 03:56:49 -04:00
|
|
|
QTimer m_updateTimer;
|
2021-12-26 05:56:37 -05:00
|
|
|
QTimer m_remoteUpdateTimer;
|
2016-06-19 03:56:49 -04:00
|
|
|
QTimer m_statusTimer;
|
|
|
|
int m_lastEngineState;
|
2017-09-16 16:23:31 -04:00
|
|
|
MessageQueue m_inputMessageQueue;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2017-12-25 20:18:30 -05:00
|
|
|
// int m_sampleRate;
|
|
|
|
// quint64 m_centerFrequency;
|
2018-11-13 07:45:55 -05:00
|
|
|
uint64_t m_startingTimeStampms;
|
2016-07-24 05:09:11 -04:00
|
|
|
int m_framesDecodingStatus;
|
2016-07-27 22:49:33 -04:00
|
|
|
bool m_allBlocksReceived;
|
2016-06-19 03:56:49 -04:00
|
|
|
float m_bufferLengthInSecs;
|
|
|
|
int32_t m_bufferGauge;
|
2016-07-17 18:39:35 -04:00
|
|
|
int m_minNbBlocks;
|
2016-07-27 12:49:17 -04:00
|
|
|
int m_minNbOriginalBlocks;
|
2016-07-17 18:39:35 -04:00
|
|
|
int m_maxNbRecovery;
|
2016-06-19 19:18:21 -04:00
|
|
|
float m_avgNbBlocks;
|
2016-07-27 12:49:17 -04:00
|
|
|
float m_avgNbOriginalBlocks;
|
2016-06-19 19:18:21 -04:00
|
|
|
float m_avgNbRecovery;
|
2016-07-24 05:09:11 -04:00
|
|
|
int m_nbOriginalBlocks;
|
|
|
|
int m_nbFECBlocks;
|
2018-09-09 11:39:36 -04:00
|
|
|
int m_sampleBits;
|
2018-09-09 15:26:47 -04:00
|
|
|
int m_sampleBytes;
|
2016-06-19 19:18:21 -04:00
|
|
|
|
2016-06-19 03:56:49 -04:00
|
|
|
int m_samplesCount;
|
|
|
|
std::size_t m_tickCount;
|
|
|
|
|
|
|
|
bool m_addressEdited;
|
|
|
|
bool m_dataPortEdited;
|
2017-06-08 09:31:24 -04:00
|
|
|
|
|
|
|
uint32_t m_countUnrecoverable;
|
|
|
|
uint32_t m_countRecovered;
|
2020-04-19 00:13:32 -04:00
|
|
|
QElapsedTimer m_eventsTime;
|
2017-06-08 09:31:24 -04:00
|
|
|
|
|
|
|
bool m_doApplySettings;
|
2017-06-07 20:06:36 -04:00
|
|
|
bool m_forceSettings;
|
2016-06-19 03:56:49 -04:00
|
|
|
|
2016-07-27 23:57:59 -04:00
|
|
|
QPalette m_paletteGreenText;
|
|
|
|
QPalette m_paletteWhiteText;
|
|
|
|
|
2017-06-07 20:06:36 -04:00
|
|
|
void blockApplySettings(bool block);
|
2016-06-19 03:56:49 -04:00
|
|
|
void displaySettings();
|
2021-12-24 15:06:15 -05:00
|
|
|
void displayRemoteSettings();
|
|
|
|
void displayRemoteShift();
|
2016-06-19 03:56:49 -04:00
|
|
|
void displayTime();
|
2021-12-25 06:54:33 -05:00
|
|
|
void displayRemoteFixedData(const RemoteInput::MsgReportRemoteFixedData::RemoteData& remoteData);
|
2017-06-07 20:06:36 -04:00
|
|
|
void sendSettings();
|
2016-06-19 03:56:49 -04:00
|
|
|
void updateWithAcquisition();
|
|
|
|
void updateWithStreamTime();
|
2018-09-08 17:30:22 -04:00
|
|
|
void updateSampleRateAndFrequency();
|
2017-06-08 09:31:24 -04:00
|
|
|
void displayEventCounts();
|
|
|
|
void displayEventTimer();
|
2021-12-24 15:06:15 -05:00
|
|
|
void applyDecimation();
|
|
|
|
void applyPosition();
|
|
|
|
void applyRemoteSettings();
|
2020-10-03 13:51:14 -04:00
|
|
|
bool handleMessage(const Message& message);
|
2022-04-07 10:32:03 -04:00
|
|
|
void makeUIConnections();
|
2016-06-19 03:56:49 -04:00
|
|
|
|
|
|
|
private slots:
|
2017-09-16 19:23:54 -04:00
|
|
|
void handleInputMessages();
|
2021-12-24 15:06:15 -05:00
|
|
|
void on_remoteDeviceFrequency_changed(quint64 value);
|
|
|
|
void on_decimationFactor_currentIndexChanged(int index);
|
|
|
|
void on_position_valueChanged(int value);
|
2018-09-08 17:30:22 -04:00
|
|
|
void on_apiApplyButton_clicked(bool checked);
|
|
|
|
void on_dataApplyButton_clicked(bool checked);
|
2016-06-19 03:56:49 -04:00
|
|
|
void on_dcOffset_toggled(bool checked);
|
|
|
|
void on_iqImbalance_toggled(bool checked);
|
2021-11-02 07:20:30 -04:00
|
|
|
void on_apiAddress_editingFinished();
|
|
|
|
void on_apiPort_editingFinished();
|
|
|
|
void on_dataAddress_editingFinished();
|
|
|
|
void on_dataPort_editingFinished();
|
|
|
|
void on_multicastAddress_editingFinished();
|
2020-08-26 12:52:36 -04:00
|
|
|
void on_multicastJoin_toggled(bool checked);
|
2016-06-19 03:56:49 -04:00
|
|
|
void on_startStop_toggled(bool checked);
|
2017-06-08 09:31:24 -04:00
|
|
|
void on_eventCountsReset_clicked(bool checked);
|
2017-06-07 20:06:36 -04:00
|
|
|
void updateHardware();
|
2021-12-26 05:56:37 -05:00
|
|
|
void updateRemote();
|
2016-06-19 03:56:49 -04:00
|
|
|
void updateStatus();
|
2018-12-26 11:08:21 -05:00
|
|
|
void openDeviceSettingsDialog(const QPoint& p);
|
2016-06-19 03:56:49 -04:00
|
|
|
};
|
|
|
|
|
2019-02-02 18:26:26 -05:00
|
|
|
#endif // INCLUDE_REMOTEINPUTGUI_H
|