2020-10-16 17:20:55 +00:00
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Copyright (C) 2020 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 //
|
|
|
|
// (at your option) any later version. //
|
|
|
|
// //
|
|
|
|
// 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/>. //
|
|
|
|
///////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef INCLUDE_FEATURE_AFCGUI_H_
|
|
|
|
#define INCLUDE_FEATURE_AFCGUI_H_
|
|
|
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
|
|
|
#include "feature/featuregui.h"
|
|
|
|
#include "util/messagequeue.h"
|
2022-01-09 04:27:12 +00:00
|
|
|
#include "settings/rollupstate.h"
|
|
|
|
|
2020-10-16 17:20:55 +00:00
|
|
|
#include "afcsettings.h"
|
2022-02-27 08:58:16 +00:00
|
|
|
#include "afc.h"
|
2020-10-16 17:20:55 +00:00
|
|
|
|
|
|
|
class PluginAPI;
|
|
|
|
class FeatureUISet;
|
|
|
|
namespace Ui {
|
|
|
|
class AFCGUI;
|
|
|
|
}
|
|
|
|
|
|
|
|
class AFCGUI : public FeatureGUI {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
static AFCGUI* create(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature);
|
|
|
|
virtual void destroy();
|
|
|
|
|
|
|
|
void resetToDefaults();
|
|
|
|
QByteArray serialize() const;
|
|
|
|
bool deserialize(const QByteArray& data);
|
|
|
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
2022-04-05 14:26:57 +00:00
|
|
|
virtual void setWorkspaceIndex(int index) { m_settings.m_workspaceIndex = index; }
|
|
|
|
virtual int getWorkspaceIndex() const { return m_settings.m_workspaceIndex; }
|
|
|
|
virtual void setGeometryBytes(const QByteArray& blob) { m_settings.m_geometryBytes = blob; }
|
|
|
|
virtual QByteArray getGeometryBytes() const { return m_settings.m_geometryBytes; }
|
2020-10-16 17:20:55 +00:00
|
|
|
|
2022-04-21 21:31:01 +00:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent* size);
|
|
|
|
|
2020-10-16 17:20:55 +00:00
|
|
|
private:
|
|
|
|
Ui::AFCGUI* ui;
|
|
|
|
PluginAPI* m_pluginAPI;
|
|
|
|
FeatureUISet* m_featureUISet;
|
|
|
|
AFCSettings m_settings;
|
2022-01-09 04:27:12 +00:00
|
|
|
RollupState m_rollupState;
|
2020-10-16 17:20:55 +00:00
|
|
|
bool m_doApplySettings;
|
|
|
|
|
2020-10-17 21:43:20 +00:00
|
|
|
AFC* m_afc;
|
2020-10-16 17:20:55 +00:00
|
|
|
MessageQueue m_inputMessageQueue;
|
|
|
|
QTimer m_statusTimer;
|
2020-10-26 12:48:19 +00:00
|
|
|
QTimer m_autoTargetStatusTimer;
|
2020-10-16 17:20:55 +00:00
|
|
|
int m_lastFeatureState;
|
|
|
|
|
|
|
|
explicit AFCGUI(PluginAPI* pluginAPI, FeatureUISet *featureUISet, Feature *feature, QWidget* parent = nullptr);
|
|
|
|
virtual ~AFCGUI();
|
|
|
|
|
|
|
|
void blockApplySettings(bool block);
|
|
|
|
void applySettings(bool force = false);
|
|
|
|
void displaySettings();
|
2022-02-27 08:58:16 +00:00
|
|
|
void requestDeviceSetLists();
|
|
|
|
void updateDeviceSetLists(const AFC::MsgDeviceSetListsReport& report);
|
2020-10-16 17:20:55 +00:00
|
|
|
bool handleMessage(const Message& message);
|
2022-04-04 08:23:52 +00:00
|
|
|
void makeUIConnections();
|
2020-10-16 17:20:55 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void onMenuDialogCalled(const QPoint &p);
|
|
|
|
void onWidgetRolled(QWidget* widget, bool rollDown);
|
|
|
|
void handleInputMessages();
|
|
|
|
void on_startStop_toggled(bool checked);
|
2020-10-17 21:43:20 +00:00
|
|
|
void on_hasTargetFrequency_toggled(bool checked);
|
|
|
|
void on_targetFrequency_changed(quint64 value);
|
2020-10-24 08:35:07 +00:00
|
|
|
void on_transverterTarget_toggled(bool checked);
|
|
|
|
void on_toleranceFrequency_changed(quint64 value);
|
|
|
|
void on_deviceTrack_clicked();
|
|
|
|
void on_devicesRefresh_clicked();
|
2020-10-17 21:43:20 +00:00
|
|
|
void on_trackerDevice_currentIndexChanged(int index);
|
|
|
|
void on_trackedDevice_currentIndexChanged(int index);
|
2020-10-24 08:35:07 +00:00
|
|
|
void on_devicesApply_clicked();
|
2020-10-25 10:34:47 +00:00
|
|
|
void on_targetPeriod_valueChanged(int value);
|
2020-10-16 17:20:55 +00:00
|
|
|
void updateStatus();
|
2020-10-26 12:48:19 +00:00
|
|
|
void resetAutoTargetStatus();
|
2020-10-16 17:20:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // INCLUDE_FEATURE_AFCGUI_H_
|