You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
119 lines
5.2 KiB
119 lines
5.2 KiB
/////////////////////////////////////////////////////////////////////////////////// |
|
// Copyright (C) 2026 Dan Chokola, KD2HSG // |
|
// Based on the packet modulator plugin: // |
|
// Copyright (C) 2020-2023 Jon Beniston, M7RCE <jon@beniston.com> // |
|
// Copyright (C) 2020-2022 Edouard Griffiths, F4EXB <f4exb06@gmail.com> // |
|
// // |
|
// 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_CHIRPMODEMMODGUI_H |
|
#define INCLUDE_CHIRPMODEMMODGUI_H |
|
|
|
#include "channel/channelgui.h" |
|
#include "dsp/channelmarker.h" |
|
#include "settings/rollupstate.h" |
|
#include "util/messagequeue.h" |
|
|
|
#include "chirpmodemmodsettings.h" |
|
#include "chirpmodemmodmessages.h" |
|
|
|
class PluginAPI; |
|
class DeviceUISet; |
|
class BasebandSampleSource; |
|
class ChirpModemMod; |
|
class SpectrumVis; |
|
|
|
namespace Ui { |
|
class ChirpModemModGUI; |
|
} |
|
|
|
class ChirpModemModGUI : public ChannelGUI { |
|
Q_OBJECT |
|
|
|
public: |
|
static ChirpModemModGUI *create(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel); |
|
virtual void destroy(); |
|
|
|
void resetToDefaults(); |
|
QByteArray serialize() const; |
|
bool deserialize(const QByteArray& data); |
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } |
|
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; } |
|
virtual QString getTitle() const { return m_settings.m_title; } |
|
virtual QColor getTitleColor() const { return m_settings.m_rgbColor; } |
|
virtual void zetHidden(bool hidden) { m_settings.m_hidden = hidden; } |
|
virtual bool getHidden() const { return m_settings.m_hidden; } |
|
virtual ChannelMarker& getChannelMarker() { return m_channelMarker; } |
|
virtual int getStreamIndex() const { return m_settings.m_streamIndex; } |
|
virtual void setStreamIndex(int streamIndex) { m_settings.m_streamIndex = streamIndex; } |
|
|
|
public slots: |
|
void channelMarkerChangedByCursor(); |
|
void channelMarkerHighlightedByCursor(); |
|
|
|
private: |
|
Ui::ChirpModemModGUI *ui; |
|
DeviceUISet *m_deviceUISet; |
|
ChannelMarker m_channelMarker; |
|
RollupState m_rollupState; |
|
ChirpModemModSettings m_settings; |
|
ChirpModemMod *m_chirpModemMod; |
|
SpectrumVis *m_spectrumVis; |
|
MessageQueue m_inputMessageQueue; |
|
qint64 m_deviceCenterFrequency = 0; |
|
int m_basebandSampleRate = 48000; |
|
int m_spectrumSampleRate = 0; |
|
bool m_doApplySettings = true; |
|
|
|
explicit ChirpModemModGUI(PluginAPI *pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSource *txChannel, QWidget *parent = nullptr); |
|
~ChirpModemModGUI() override; |
|
void applySettings(const QStringList& keys, bool force = false); |
|
void displaySettings(); |
|
void displayBandwidth(); |
|
void displayFrameInfo(); |
|
void makeUIConnections(); |
|
void updateAbsoluteCenterFrequency(); |
|
void updateChannelMarker(); |
|
void statusReceived(const ChirpModemModMessages::Status& status); |
|
void log(const QString& text); |
|
|
|
private slots: |
|
void on_deltaFrequency_changed(qint64 value); |
|
void on_spreadFactor_currentIndexChanged(int index); |
|
void on_bandwidth_currentIndexChanged(int index); |
|
void on_mode_currentIndexChanged(int index); |
|
void on_profile_currentIndexChanged(int index); |
|
void on_source_editingFinished(); |
|
void on_destination_editingFinished(); |
|
void on_message_textEdited(const QString& text); |
|
void on_message_editingFinished(); |
|
void on_message_returnPressed(); |
|
void on_repeat_valueChanged(int value); |
|
void on_gap_valueChanged(double value); |
|
void on_amplitude_valueChanged(double value); |
|
void on_cwId_toggled(bool checked); |
|
void on_cwWpm_valueChanged(int value); |
|
void on_txButton_clicked(); |
|
void on_clearLog_clicked(); |
|
void handleInputMessages(); |
|
void tick(); |
|
void onMenuDialogCalled(const QPoint& point); |
|
void onWidgetRolled(QWidget *widget, bool rollDown); |
|
}; |
|
|
|
#endif // INCLUDE_CHIRPMODEMMODGUI_H
|
|
|