From b38385b07b06d1a9ab44c73c587681ccc7a12ed5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Fri, 24 Mar 2023 18:26:26 +0100 Subject: [PATCH] Aaronia RSA Rx: renamings for output plugin provision --- plugins/samplesource/CMakeLists.txt | 2 +- .../CMakeLists.txt | 38 ++++----- .../aaroniartsainput.cpp | 33 ++++---- .../aaroniartsainput.h | 27 ++++--- .../aaroniartsainputgui.cpp} | 71 +++++++++-------- .../aaroniartsainputgui.h} | 19 +++-- .../aaroniartsainputgui.ui} | 4 +- .../aaroniartsainputplugin.cpp} | 37 +++++---- .../aaroniartsainputplugin.h} | 7 +- .../aaroniartsainputsettings.cpp} | 17 ++-- .../aaroniartsainputsettings.h} | 9 +-- .../aaroniartsainputwebapiadapter.cpp} | 12 +-- .../aaroniartsainputwebapiadapter.h} | 14 ++-- .../aaroniartsainputworker.cpp} | 77 +++++++++---------- .../aaroniartsainputworker.h} | 8 +- .../readme.md | 0 16 files changed, 183 insertions(+), 192 deletions(-) rename plugins/samplesource/{aaroniartsa => aaroniartsainput}/CMakeLists.txt (59%) rename plugins/samplesource/{aaroniartsa => aaroniartsainput}/aaroniartsainput.cpp (93%) rename plugins/samplesource/{aaroniartsa => aaroniartsainput}/aaroniartsainput.h (85%) rename plugins/samplesource/{aaroniartsa/aaroniartsagui.cpp => aaroniartsainput/aaroniartsainputgui.cpp} (83%) rename plugins/samplesource/{aaroniartsa/aaroniartsagui.h => aaroniartsainput/aaroniartsainputgui.h} (86%) rename plugins/samplesource/{aaroniartsa/aaroniartsagui.ui => aaroniartsainput/aaroniartsainputgui.ui} (98%) rename plugins/samplesource/{aaroniartsa/aaroniartsaplugin.cpp => aaroniartsainput/aaroniartsainputplugin.cpp} (73%) rename plugins/samplesource/{aaroniartsa/aaroniartsaplugin.h => aaroniartsainput/aaroniartsainputplugin.h} (89%) rename plugins/samplesource/{aaroniartsa/aaroniartsasettings.cpp => aaroniartsainput/aaroniartsainputsettings.cpp} (88%) rename plugins/samplesource/{aaroniartsa/aaroniartsasettings.h => aaroniartsainput/aaroniartsainputsettings.h} (90%) rename plugins/samplesource/{aaroniartsa/aaroniartsawebapiadapter.cpp => aaroniartsainput/aaroniartsainputwebapiadapter.cpp} (86%) rename plugins/samplesource/{aaroniartsa/aaroniartsawebapiadapter.h => aaroniartsainput/aaroniartsainputwebapiadapter.h} (87%) rename plugins/samplesource/{aaroniartsa/aaroniartsaworker.cpp => aaroniartsainput/aaroniartsainputworker.cpp} (80%) rename plugins/samplesource/{aaroniartsa/aaroniartsaworker.h => aaroniartsainput/aaroniartsainputworker.h} (95%) rename plugins/samplesource/{aaroniartsa => aaroniartsainput}/readme.md (100%) diff --git a/plugins/samplesource/CMakeLists.txt b/plugins/samplesource/CMakeLists.txt index 0e8bbf3db..0f5f805a4 100644 --- a/plugins/samplesource/CMakeLists.txt +++ b/plugins/samplesource/CMakeLists.txt @@ -73,4 +73,4 @@ endif() add_subdirectory(audioinput) add_subdirectory(kiwisdr) add_subdirectory(remotetcpinput) -add_subdirectory(aaroniartsa) +add_subdirectory(aaroniartsainput) diff --git a/plugins/samplesource/aaroniartsa/CMakeLists.txt b/plugins/samplesource/aaroniartsainput/CMakeLists.txt similarity index 59% rename from plugins/samplesource/aaroniartsa/CMakeLists.txt rename to plugins/samplesource/aaroniartsainput/CMakeLists.txt index 005597f0c..8336c83fa 100644 --- a/plugins/samplesource/aaroniartsa/CMakeLists.txt +++ b/plugins/samplesource/aaroniartsainput/CMakeLists.txt @@ -1,19 +1,19 @@ -project(aaroniartsa) +project(aaroniartsainput) -set(aaroniartsa_SOURCES +set(aaroniartsainput_SOURCES aaroniartsainput.cpp - aaroniartsaplugin.cpp - aaroniartsaworker.cpp - aaroniartsasettings.cpp - aaroniartsawebapiadapter.cpp + aaroniartsainputplugin.cpp + aaroniartsainputworker.cpp + aaroniartsainputsettings.cpp + aaroniartsainputwebapiadapter.cpp ) -set(aaroniartsa_HEADERS +set(aaroniartsainput_HEADERS aaroniartsainput.h - aaroniartsaplugin.h - aaroniartsaworker.h - aaroniartsasettings.h - aaroniartsawebapiadapter.h + aaroniartsainputplugin.h + aaroniartsainputworker.h + aaroniartsainputsettings.h + aaroniartsainputwebapiadapter.h ) include_directories( @@ -22,14 +22,14 @@ include_directories( ) if(NOT SERVER_MODE) - set(aaroniartsa_SOURCES - ${aaroniartsa_SOURCES} - aaroniartsagui.cpp - aaroniartsagui.ui + set(aaroniartsainput_SOURCES + ${aaroniartsainput_SOURCES} + aaroniartsainputgui.cpp + aaroniartsainputgui.ui ) - set(aaroniartsa_HEADERS - ${aaroniartsa_HEADERS} - aaroniartsagui.h + set(aaroniartsainput_HEADERS + ${aaroniartsainput_HEADERS} + aaroniartsainputgui.h ) set(TARGET_NAME inputaaroniartsa) @@ -44,7 +44,7 @@ else() endif() add_library(${TARGET_NAME} SHARED - ${aaroniartsa_SOURCES} + ${aaroniartsainput_SOURCES} ) target_link_libraries(${TARGET_NAME} diff --git a/plugins/samplesource/aaroniartsa/aaroniartsainput.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainput.cpp similarity index 93% rename from plugins/samplesource/aaroniartsa/aaroniartsainput.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainput.cpp index 88f394fc7..6b629e382 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsainput.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainput.cpp @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -32,7 +31,7 @@ #include "aaroniartsainput.h" #include "device/deviceapi.h" -#include "aaroniartsaworker.h" +#include "aaroniartsainputworker.h" #include "dsp/dspcommands.h" #include "dsp/dspengine.h" @@ -102,17 +101,17 @@ bool AaroniaRTSAInput::start() } m_aaroniaRTSAWorkerThread = new QThread(); - m_aaroniaRTSAWorker = new AaroniaRTSAWorker(&m_sampleFifo); + m_aaroniaRTSAWorker = new AaroniaRTSAInputWorker(&m_sampleFifo); m_aaroniaRTSAWorker->setInputMessageQueue(getInputMessageQueue()); m_aaroniaRTSAWorker->moveToThread(m_aaroniaRTSAWorkerThread); QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorker, &QObject::deleteLater); QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorkerThread, &QThread::deleteLater); - connect(this, &AaroniaRTSAInput::setWorkerCenterFrequency, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onCenterFrequencyChanged); - connect(this, &AaroniaRTSAInput::setWorkerSampleRate, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onSampleRateChanged); - connect(this, &AaroniaRTSAInput::setWorkerServerAddress, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onServerAddressChanged); - connect(m_aaroniaRTSAWorker, &AaroniaRTSAWorker::updateStatus, this, &AaroniaRTSAInput::setWorkerStatus); + connect(this, &AaroniaRTSAInput::setWorkerCenterFrequency, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onCenterFrequencyChanged); + connect(this, &AaroniaRTSAInput::setWorkerSampleRate, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onSampleRateChanged); + connect(this, &AaroniaRTSAInput::setWorkerServerAddress, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onServerAddressChanged); + connect(m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::updateStatus, this, &AaroniaRTSAInput::setWorkerStatus); m_aaroniaRTSAWorkerThread->start(); m_running = true; @@ -187,7 +186,7 @@ quint64 AaroniaRTSAInput::getCenterFrequency() const void AaroniaRTSAInput::setCenterFrequency(qint64 centerFrequency) { - AaroniaRTSASettings settings = m_settings; + AaroniaRTSAInputSettings settings = m_settings; settings.m_centerFrequency = centerFrequency; MsgConfigureAaroniaRTSA* message = MsgConfigureAaroniaRTSA::create(settings, QList{"centerFrequency"}, false); @@ -222,12 +221,12 @@ bool AaroniaRTSAInput::handleMessage(const Message& message) return true; } - else if (AaroniaRTSAWorker::MsgReportSampleRateAndFrequency::match(message)) + else if (AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency::match(message)) { - AaroniaRTSAWorker::MsgReportSampleRateAndFrequency& report = (AaroniaRTSAWorker::MsgReportSampleRateAndFrequency&) message; + AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency& report = (AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency&) message; m_sampleRate = report.getSampleRate(); m_centerFrequency = report.getCenterFrequency(); - qDebug() << "AaroniaRTSAInput::handleMessage: AaroniaRTSAWorker::MsgReportSampleRateAndFrequency:" + qDebug() << "AaroniaRTSAInput::handleMessage: AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency:" << " m_sampleRate: " << m_sampleRate << " m-centerFrequency" << m_centerFrequency; @@ -278,7 +277,7 @@ int AaroniaRTSAInput::getStatus() const } } -bool AaroniaRTSAInput::applySettings(const AaroniaRTSASettings& settings, const QList& settingsKeys, bool force) +bool AaroniaRTSAInput::applySettings(const AaroniaRTSAInputSettings& settings, const QList& settingsKeys, bool force) { qDebug() << "AaroniaRTSAInput::applySettings: force: "<< force << settings.getDebugString(settingsKeys, force); @@ -364,7 +363,7 @@ int AaroniaRTSAInput::webapiSettingsPutPatch( QString& errorMessage) { (void) errorMessage; - AaroniaRTSASettings settings = m_settings; + AaroniaRTSAInputSettings settings = m_settings; webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response); MsgConfigureAaroniaRTSA *msg = MsgConfigureAaroniaRTSA::create(settings, deviceSettingsKeys, force); @@ -381,7 +380,7 @@ int AaroniaRTSAInput::webapiSettingsPutPatch( } void AaroniaRTSAInput::webapiUpdateDeviceSettings( - AaroniaRTSASettings& settings, + AaroniaRTSAInputSettings& settings, const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response) { @@ -419,7 +418,7 @@ int AaroniaRTSAInput::webapiReportGet( return 200; } -void AaroniaRTSAInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const AaroniaRTSASettings& settings) +void AaroniaRTSAInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const AaroniaRTSAInputSettings& settings) { response.getAaroniaRtsaSettings()->setCenterFrequency(settings.m_centerFrequency); response.getAaroniaRtsaSettings()->setSampleRate(settings.m_sampleRate); @@ -447,7 +446,7 @@ void AaroniaRTSAInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& re response.getAaroniaSdrReport()->setStatus(getStatus()); } -void AaroniaRTSAInput::webapiReverseSendSettings(const QList& deviceSettingsKeys, const AaroniaRTSASettings& settings, bool force) +void AaroniaRTSAInput::webapiReverseSendSettings(const QList& deviceSettingsKeys, const AaroniaRTSAInputSettings& settings, bool force) { SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings(); swgDeviceSettings->setDirection(0); // single Rx diff --git a/plugins/samplesource/aaroniartsa/aaroniartsainput.h b/plugins/samplesource/aaroniartsainput/aaroniartsainput.h similarity index 85% rename from plugins/samplesource/aaroniartsa/aaroniartsainput.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainput.h index 05640488c..5dc05aa72 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsainput.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainput.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -25,10 +24,10 @@ #include #include -#include "aaroniartsasettings.h" +#include "aaroniartsainputsettings.h" class DeviceAPI; -class AaroniaRTSAWorker; +class AaroniaRTSAInputWorker; class QNetworkAccessManager; class QNetworkReply; class QThread; @@ -40,21 +39,21 @@ public: MESSAGE_CLASS_DECLARATION public: - const AaroniaRTSASettings& getSettings() const { return m_settings; } + const AaroniaRTSAInputSettings& getSettings() const { return m_settings; } const QList& getSettingsKeys() const { return m_settingsKeys; } bool getForce() const { return m_force; } - static MsgConfigureAaroniaRTSA* create(const AaroniaRTSASettings& settings, const QList& settingsKeys, bool force) + static MsgConfigureAaroniaRTSA* create(const AaroniaRTSAInputSettings& settings, const QList& settingsKeys, bool force) { return new MsgConfigureAaroniaRTSA(settings, settingsKeys, force); } private: - AaroniaRTSASettings m_settings; + AaroniaRTSAInputSettings m_settings; QList m_settingsKeys; bool m_force; - MsgConfigureAaroniaRTSA(const AaroniaRTSASettings& settings, const QList& settingsKeys, bool force) : + MsgConfigureAaroniaRTSA(const AaroniaRTSAInputSettings& settings, const QList& settingsKeys, bool force) : Message(), m_settings(settings), m_settingsKeys(settingsKeys), @@ -145,10 +144,10 @@ public: static void webapiFormatDeviceSettings( SWGSDRangel::SWGDeviceSettings& response, - const AaroniaRTSASettings& settings); + const AaroniaRTSAInputSettings& settings); static void webapiUpdateDeviceSettings( - AaroniaRTSASettings& settings, + AaroniaRTSAInputSettings& settings, const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response); @@ -157,8 +156,8 @@ private: QMutex m_mutex; int m_sampleRate; quint64 m_centerFrequency; - AaroniaRTSASettings m_settings; - AaroniaRTSAWorker* m_aaroniaRTSAWorker; + AaroniaRTSAInputSettings m_settings; + AaroniaRTSAInputWorker* m_aaroniaRTSAWorker; QThread *m_aaroniaRTSAWorkerThread; QString m_deviceDescription; bool m_running; @@ -167,9 +166,9 @@ private: QNetworkRequest m_networkRequest; int getStatus() const; - bool applySettings(const AaroniaRTSASettings& settings, const QList& settingsKeys, bool force); + bool applySettings(const AaroniaRTSAInputSettings& settings, const QList& settingsKeys, bool force); void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response); - void webapiReverseSendSettings(const QList& deviceSettingsKeys, const AaroniaRTSASettings& settings, bool force); + void webapiReverseSendSettings(const QList& deviceSettingsKeys, const AaroniaRTSAInputSettings& settings, bool force); void webapiReverseSendStartStop(bool start); signals: diff --git a/plugins/samplesource/aaroniartsa/aaroniartsagui.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.cpp similarity index 83% rename from plugins/samplesource/aaroniartsa/aaroniartsagui.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainputgui.cpp index de48ce2d2..c7aa84b51 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsagui.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.cpp @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -24,7 +23,7 @@ #include #include -#include "ui_aaroniartsagui.h" +#include "ui_aaroniartsainputgui.h" #include "plugin/pluginapi.h" #include "gui/colormapper.h" #include "gui/glspectrum.h" @@ -36,13 +35,13 @@ #include "mainwindow.h" -#include "aaroniartsagui.h" +#include "aaroniartsainputgui.h" #include "device/deviceapi.h" #include "device/deviceuiset.h" -AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) : +AaroniaRTSAInputGui::AaroniaRTSAInputGui(DeviceUISet *deviceUISet, QWidget* parent) : DeviceGUI(parent), - ui(new Ui::AaroniaRTSAGui), + ui(new Ui::AaroniaRTSAInputGui), m_settings(), m_doApplySettings(true), m_forceSettings(true), @@ -50,7 +49,7 @@ AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) : m_tickCount(0), m_lastEngineState(DeviceAPI::StNotStarted) { - qDebug("AaroniaRTSAGui::AaroniaRTSAGui"); + qDebug("AaroniaRTSAInputGui::AaroniaRTSAInputGui"); m_deviceUISet = deviceUISet; setAttribute(Qt::WA_DeleteOnClose, true); m_sampleSource = m_deviceUISet->m_deviceAPI->getSampleSource(); @@ -69,7 +68,7 @@ AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) : ui->setupUi(getContents()); sizeToContents(); - getContents()->setStyleSheet("#AaroniaRTSAGui { background-color: rgb(64, 64, 64); }"); + getContents()->setStyleSheet("#AaroniaRTSAInputGui { background-color: rgb(64, 64, 64); }"); m_helpURL = "plugins/samplesource/aaroniartsa/readme.md"; ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); ui->centerFrequency->setValueRange(9, 0, 999999999); @@ -90,17 +89,17 @@ AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) : connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &))); } -AaroniaRTSAGui::~AaroniaRTSAGui() +AaroniaRTSAInputGui::~AaroniaRTSAInputGui() { delete ui; } -void AaroniaRTSAGui::destroy() +void AaroniaRTSAInputGui::destroy() { delete this; } -void AaroniaRTSAGui::resetToDefaults() +void AaroniaRTSAInputGui::resetToDefaults() { m_settings.resetToDefaults(); displaySettings(); @@ -108,12 +107,12 @@ void AaroniaRTSAGui::resetToDefaults() sendSettings(); } -QByteArray AaroniaRTSAGui::serialize() const +QByteArray AaroniaRTSAInputGui::serialize() const { return m_settings.serialize(); } -bool AaroniaRTSAGui::deserialize(const QByteArray& data) +bool AaroniaRTSAInputGui::deserialize(const QByteArray& data) { if(m_settings.deserialize(data)) { displaySettings(); @@ -126,7 +125,7 @@ bool AaroniaRTSAGui::deserialize(const QByteArray& data) } } -void AaroniaRTSAGui::on_startStop_toggled(bool checked) +void AaroniaRTSAInputGui::on_startStop_toggled(bool checked) { if (m_doApplySettings) { @@ -135,26 +134,26 @@ void AaroniaRTSAGui::on_startStop_toggled(bool checked) } } -void AaroniaRTSAGui::on_centerFrequency_changed(quint64 value) +void AaroniaRTSAInputGui::on_centerFrequency_changed(quint64 value) { m_settings.m_centerFrequency = value * 1000; m_settingsKeys.append("centerFrequency"); sendSettings(); } -void AaroniaRTSAGui::on_sampleRate_changed(quint64 value) +void AaroniaRTSAInputGui::on_sampleRate_changed(quint64 value) { m_settings.m_sampleRate = value; m_settingsKeys.append("sampleRate"); sendSettings(); } -void AaroniaRTSAGui::on_serverAddress_returnPressed() +void AaroniaRTSAInputGui::on_serverAddress_returnPressed() { on_serverAddressApplyButton_clicked(); } -void AaroniaRTSAGui::on_serverAddressApplyButton_clicked() +void AaroniaRTSAInputGui::on_serverAddressApplyButton_clicked() { QString serverAddress = ui->serverAddress->text(); QUrl url(serverAddress); @@ -169,7 +168,7 @@ void AaroniaRTSAGui::on_serverAddressApplyButton_clicked() sendSettings(); } -void AaroniaRTSAGui::displaySettings() +void AaroniaRTSAInputGui::displaySettings() { blockApplySettings(true); @@ -179,14 +178,14 @@ void AaroniaRTSAGui::displaySettings() blockApplySettings(false); } -void AaroniaRTSAGui::sendSettings() +void AaroniaRTSAInputGui::sendSettings() { if (!m_updateTimer.isActive()) { m_updateTimer.start(100); } } -void AaroniaRTSAGui::updateHardware() +void AaroniaRTSAInputGui::updateHardware() { if (m_doApplySettings) { @@ -198,7 +197,7 @@ void AaroniaRTSAGui::updateHardware() } } -void AaroniaRTSAGui::updateStatus() +void AaroniaRTSAInputGui::updateStatus() { int state = m_deviceUISet->m_deviceAPI->state(); @@ -227,11 +226,11 @@ void AaroniaRTSAGui::updateStatus() } } -bool AaroniaRTSAGui::handleMessage(const Message& message) +bool AaroniaRTSAInputGui::handleMessage(const Message& message) { if (AaroniaRTSAInput::MsgConfigureAaroniaRTSA::match(message)) { - qDebug("AaroniaRTSAGui::handleMessage: MsgConfigureAaroniaRTSA"); + qDebug("AaroniaRTSAInputGui::handleMessage: MsgConfigureAaroniaRTSA"); const AaroniaRTSAInput::MsgConfigureAaroniaRTSA& cfg = (AaroniaRTSAInput::MsgConfigureAaroniaRTSA&) message; if (cfg.getForce()) { @@ -245,7 +244,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message) } else if (AaroniaRTSAInput::MsgStartStop::match(message)) { - qDebug("AaroniaRTSAGui::handleMessage: MsgStartStop"); + qDebug("AaroniaRTSAInputGui::handleMessage: MsgStartStop"); AaroniaRTSAInput::MsgStartStop& notif = (AaroniaRTSAInput::MsgStartStop&) message; blockApplySettings(true); ui->startStop->setChecked(notif.getStartStop()); @@ -255,7 +254,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message) } else if (AaroniaRTSAInput::MsgSetStatus::match(message)) { - qDebug("AaroniaRTSAGui::handleMessage: MsgSetStatus"); + qDebug("AaroniaRTSAInputGui::handleMessage: MsgSetStatus"); AaroniaRTSAInput::MsgSetStatus& notif = (AaroniaRTSAInput::MsgSetStatus&) message; int status = notif.getStatus(); ui->statusIndicator->setToolTip(m_statusTooltips[status]); @@ -269,7 +268,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message) } } -void AaroniaRTSAGui::handleInputMessages() +void AaroniaRTSAInputGui::handleInputMessages() { Message* message; @@ -280,7 +279,7 @@ void AaroniaRTSAGui::handleInputMessages() DSPSignalNotification* notif = (DSPSignalNotification*) message; m_deviceSampleRate = notif->getSampleRate(); m_deviceCenterFrequency = notif->getCenterFrequency(); - qDebug("AaroniaRTSAGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", + qDebug("AaroniaRTSAInputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu", notif->getSampleRate(), notif->getCenterFrequency()); updateSampleRateAndFrequency(); @@ -297,7 +296,7 @@ void AaroniaRTSAGui::handleInputMessages() } } -void AaroniaRTSAGui::updateSampleRateAndFrequency() +void AaroniaRTSAInputGui::updateSampleRateAndFrequency() { m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate); m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency); @@ -309,7 +308,7 @@ void AaroniaRTSAGui::updateSampleRateAndFrequency() blockApplySettings(false); } -void AaroniaRTSAGui::openDeviceSettingsDialog(const QPoint& p) +void AaroniaRTSAInputGui::openDeviceSettingsDialog(const QPoint& p) { if (m_contextMenuType == ContextMenuDeviceSettings) { @@ -338,11 +337,11 @@ void AaroniaRTSAGui::openDeviceSettingsDialog(const QPoint& p) resetContextMenuType(); } -void AaroniaRTSAGui::makeUIConnections() +void AaroniaRTSAInputGui::makeUIConnections() { - QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AaroniaRTSAGui::on_startStop_toggled); - QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AaroniaRTSAGui::on_centerFrequency_changed); - QObject::connect(ui->sampleRate, &ValueDial::changed, this, &AaroniaRTSAGui::on_sampleRate_changed); - QObject::connect(ui->serverAddress, &QLineEdit::returnPressed, this, &AaroniaRTSAGui::on_serverAddress_returnPressed); - QObject::connect(ui->serverAddressApplyButton, &QPushButton::clicked, this, &AaroniaRTSAGui::on_serverAddressApplyButton_clicked); + QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AaroniaRTSAInputGui::on_startStop_toggled); + QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AaroniaRTSAInputGui::on_centerFrequency_changed); + QObject::connect(ui->sampleRate, &ValueDial::changed, this, &AaroniaRTSAInputGui::on_sampleRate_changed); + QObject::connect(ui->serverAddress, &QLineEdit::returnPressed, this, &AaroniaRTSAInputGui::on_serverAddress_returnPressed); + QObject::connect(ui->serverAddressApplyButton, &QPushButton::clicked, this, &AaroniaRTSAInputGui::on_serverAddressApplyButton_clicked); } diff --git a/plugins/samplesource/aaroniartsa/aaroniartsagui.h b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.h similarity index 86% rename from plugins/samplesource/aaroniartsa/aaroniartsagui.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainputgui.h index f06a3a5b5..e523a6e85 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsagui.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -19,27 +18,27 @@ #ifndef _AARONIARTSA_AARONIARTSAGUI_H_ #define _AARONIARTSA_AARONIARTSAGUI_H_ -#include #include #include +#include "device/devicegui.h" #include "util/messagequeue.h" -#include "aaroniartsasettings.h" +#include "aaroniartsainputsettings.h" #include "aaroniartsainput.h" class DeviceUISet; namespace Ui { - class AaroniaRTSAGui; + class AaroniaRTSAInputGui; } -class AaroniaRTSAGui : public DeviceGUI { +class AaroniaRTSAInputGui : public DeviceGUI { Q_OBJECT public: - explicit AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent = 0); - virtual ~AaroniaRTSAGui(); + explicit AaroniaRTSAInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0); + virtual ~AaroniaRTSAInputGui(); virtual void destroy(); void resetToDefaults(); @@ -48,9 +47,9 @@ public: virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; } private: - Ui::AaroniaRTSAGui* ui; + Ui::AaroniaRTSAInputGui* ui; - AaroniaRTSASettings m_settings; + AaroniaRTSAInputSettings m_settings; QList m_settingsKeys; QTimer m_updateTimer; QTimer m_statusTimer; diff --git a/plugins/samplesource/aaroniartsa/aaroniartsagui.ui b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.ui similarity index 98% rename from plugins/samplesource/aaroniartsa/aaroniartsagui.ui rename to plugins/samplesource/aaroniartsainput/aaroniartsainputgui.ui index 60e4b4bf2..15adc7968 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsagui.ui +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputgui.ui @@ -1,7 +1,7 @@ - AaroniaRTSAGui - + AaroniaRTSAInputGui + 0 diff --git a/plugins/samplesource/aaroniartsa/aaroniartsaplugin.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.cpp similarity index 73% rename from plugins/samplesource/aaroniartsa/aaroniartsaplugin.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.cpp index 9f6522dac..a1bafcae7 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsaplugin.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.cpp @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -24,16 +23,16 @@ #ifdef SERVER_MODE #include "aaroniartsainput.h" #else -#include "aaroniartsagui.h" +#include "aaroniartsainputgui.h" #endif -#include "aaroniartsaplugin.h" -#include "aaroniartsawebapiadapter.h" +#include "aaroniartsainputplugin.h" +#include "aaroniartsainputwebapiadapter.h" -const PluginDescriptor AaroniaRTSAPlugin::m_pluginDescriptor = { +const PluginDescriptor AaroniaRTSAInputPlugin::m_pluginDescriptor = { QStringLiteral("AaroniaRTSA"), QStringLiteral("AaroniaRTSA input"), - QStringLiteral("7.8.4"), - QStringLiteral("(c) Vort (c) Edouard Griffiths, F4EXB"), + QStringLiteral("7.12.0"), + QStringLiteral("(c) Edouard Griffiths, F4EXB"), QStringLiteral("https://github.com/f4exb/sdrangel"), true, QStringLiteral("https://github.com/f4exb/sdrangel") @@ -42,22 +41,22 @@ const PluginDescriptor AaroniaRTSAPlugin::m_pluginDescriptor = { static constexpr const char* const m_hardwareID = "AaroniaRTSA"; static constexpr const char* const m_deviceTypeID = AARONIARTSA_DEVICE_TYPE_ID; -AaroniaRTSAPlugin::AaroniaRTSAPlugin(QObject* parent) : +AaroniaRTSAInputPlugin::AaroniaRTSAInputPlugin(QObject* parent) : QObject(parent) { } -const PluginDescriptor& AaroniaRTSAPlugin::getPluginDescriptor() const +const PluginDescriptor& AaroniaRTSAInputPlugin::getPluginDescriptor() const { return m_pluginDescriptor; } -void AaroniaRTSAPlugin::initPlugin(PluginAPI* pluginAPI) +void AaroniaRTSAInputPlugin::initPlugin(PluginAPI* pluginAPI) { pluginAPI->registerSampleSource(m_deviceTypeID, this); } -void AaroniaRTSAPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices) +void AaroniaRTSAInputPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevices& originDevices) { if (listedHwIds.contains(m_hardwareID)) { // check if it was done return; @@ -75,7 +74,7 @@ void AaroniaRTSAPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevice listedHwIds.append(m_hardwareID); } -PluginInterface::SamplingDevices AaroniaRTSAPlugin::enumSampleSources(const OriginDevices& originDevices) +PluginInterface::SamplingDevices AaroniaRTSAInputPlugin::enumSampleSources(const OriginDevices& originDevices) { SamplingDevices result; @@ -101,7 +100,7 @@ PluginInterface::SamplingDevices AaroniaRTSAPlugin::enumSampleSources(const Orig } #ifdef SERVER_MODE -DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI( +DeviceGUI* AaroniaRTSAInputPlugin::createSampleSourcePluginInstanceGUI( const QString& sourceId, QWidget **widget, DeviceUISet *deviceUISet) @@ -112,13 +111,13 @@ DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI( return 0; } #else -DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI( +DeviceGUI* AaroniaRTSAInputPlugin::createSampleSourcePluginInstanceGUI( const QString& sourceId, QWidget **widget, DeviceUISet *deviceUISet) { if(sourceId == m_deviceTypeID) { - AaroniaRTSAGui* gui = new AaroniaRTSAGui(deviceUISet); + AaroniaRTSAInputGui* gui = new AaroniaRTSAInputGui(deviceUISet); *widget = gui; return gui; } else { @@ -127,7 +126,7 @@ DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI( } #endif -DeviceSampleSource *AaroniaRTSAPlugin::createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI) +DeviceSampleSource *AaroniaRTSAInputPlugin::createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI) { if (sourceId == m_deviceTypeID) { @@ -140,7 +139,7 @@ DeviceSampleSource *AaroniaRTSAPlugin::createSampleSourcePluginInstance(const QS } } -DeviceWebAPIAdapter *AaroniaRTSAPlugin::createDeviceWebAPIAdapter() const +DeviceWebAPIAdapter *AaroniaRTSAInputPlugin::createDeviceWebAPIAdapter() const { - return new AaroniaRTSAWebAPIAdapter(); + return new AaroniaRTSAInputWebAPIAdapter(); } diff --git a/plugins/samplesource/aaroniartsa/aaroniartsaplugin.h b/plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.h similarity index 89% rename from plugins/samplesource/aaroniartsa/aaroniartsaplugin.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.h index a40bf5b0a..13ab5d3fa 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsaplugin.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputplugin.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -26,13 +25,13 @@ class PluginAPI; #define AARONIARTSA_DEVICE_TYPE_ID "sdrangel.samplesource.aaroniartsasource" -class AaroniaRTSAPlugin : public QObject, public PluginInterface { +class AaroniaRTSAInputPlugin : public QObject, public PluginInterface { Q_OBJECT Q_INTERFACES(PluginInterface) Q_PLUGIN_METADATA(IID AARONIARTSA_DEVICE_TYPE_ID) public: - explicit AaroniaRTSAPlugin(QObject* parent = NULL); + explicit AaroniaRTSAInputPlugin(QObject* parent = NULL); const PluginDescriptor& getPluginDescriptor() const; void initPlugin(PluginAPI* pluginAPI); diff --git a/plugins/samplesource/aaroniartsa/aaroniartsasettings.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.cpp similarity index 88% rename from plugins/samplesource/aaroniartsa/aaroniartsasettings.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.cpp index 48755d199..8a8937945 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsasettings.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.cpp @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -17,14 +16,14 @@ /////////////////////////////////////////////////////////////////////////////////// #include "util/simpleserializer.h" -#include "aaroniartsasettings.h" +#include "aaroniartsainputsettings.h" -AaroniaRTSASettings::AaroniaRTSASettings() +AaroniaRTSAInputSettings::AaroniaRTSAInputSettings() { resetToDefaults(); } -void AaroniaRTSASettings::resetToDefaults() +void AaroniaRTSAInputSettings::resetToDefaults() { m_centerFrequency = 1450000; m_sampleRate = 200000; @@ -35,7 +34,7 @@ void AaroniaRTSASettings::resetToDefaults() m_reverseAPIDeviceIndex = 0; } -QByteArray AaroniaRTSASettings::serialize() const +QByteArray AaroniaRTSAInputSettings::serialize() const { SimpleSerializer s(2); @@ -49,7 +48,7 @@ QByteArray AaroniaRTSASettings::serialize() const return s.final(); } -bool AaroniaRTSASettings::deserialize(const QByteArray& data) +bool AaroniaRTSAInputSettings::deserialize(const QByteArray& data) { SimpleDeserializer d(data); @@ -88,7 +87,7 @@ bool AaroniaRTSASettings::deserialize(const QByteArray& data) } } -void AaroniaRTSASettings::applySettings(const QStringList& settingsKeys, const AaroniaRTSASettings& settings) +void AaroniaRTSAInputSettings::applySettings(const QStringList& settingsKeys, const AaroniaRTSAInputSettings& settings) { if (settingsKeys.contains("centerFrequency")) { m_centerFrequency = settings.m_centerFrequency; @@ -113,7 +112,7 @@ void AaroniaRTSASettings::applySettings(const QStringList& settingsKeys, const A } } -QString AaroniaRTSASettings::getDebugString(const QStringList& settingsKeys, bool force) const +QString AaroniaRTSAInputSettings::getDebugString(const QStringList& settingsKeys, bool force) const { std::ostringstream ostr; diff --git a/plugins/samplesource/aaroniartsa/aaroniartsasettings.h b/plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.h similarity index 90% rename from plugins/samplesource/aaroniartsa/aaroniartsasettings.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.h index 58c733513..122a33147 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsasettings.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputsettings.h @@ -1,6 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 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 // @@ -22,7 +21,7 @@ #include #include -struct AaroniaRTSASettings { +struct AaroniaRTSAInputSettings { enum ConnectionStatus { @@ -42,11 +41,11 @@ struct AaroniaRTSASettings { uint16_t m_reverseAPIPort; uint16_t m_reverseAPIDeviceIndex; - AaroniaRTSASettings(); + AaroniaRTSAInputSettings(); void resetToDefaults(); QByteArray serialize() const; bool deserialize(const QByteArray& data); - void applySettings(const QStringList& settingsKeys, const AaroniaRTSASettings& settings); + void applySettings(const QStringList& settingsKeys, const AaroniaRTSAInputSettings& settings); QString getDebugString(const QStringList& settingsKeys, bool force=false) const; }; diff --git a/plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.cpp similarity index 86% rename from plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.cpp index 031211eeb..2a71e593d 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 Edouard Griffiths, F4EXB // // // // Implementation of static web API adapters used for preset serialization and // // deserialization // @@ -20,15 +20,15 @@ #include "SWGDeviceSettings.h" #include "aaroniartsainput.h" -#include "aaroniartsawebapiadapter.h" +#include "aaroniartsainputwebapiadapter.h" -AaroniaRTSAWebAPIAdapter::AaroniaRTSAWebAPIAdapter() +AaroniaRTSAInputWebAPIAdapter::AaroniaRTSAInputWebAPIAdapter() {} -AaroniaRTSAWebAPIAdapter::~AaroniaRTSAWebAPIAdapter() +AaroniaRTSAInputWebAPIAdapter::~AaroniaRTSAInputWebAPIAdapter() {} -int AaroniaRTSAWebAPIAdapter::webapiSettingsGet( +int AaroniaRTSAInputWebAPIAdapter::webapiSettingsGet( SWGSDRangel::SWGDeviceSettings& response, QString& errorMessage) { @@ -39,7 +39,7 @@ int AaroniaRTSAWebAPIAdapter::webapiSettingsGet( return 200; } -int AaroniaRTSAWebAPIAdapter::webapiSettingsPutPatch( +int AaroniaRTSAInputWebAPIAdapter::webapiSettingsPutPatch( bool force, const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response, // query + response diff --git a/plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.h b/plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.h similarity index 87% rename from plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.h index ba9cd3d42..c97148886 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsawebapiadapter.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputwebapiadapter.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Edouard Griffiths, F4EXB // +// Copyright (C) 2023 Edouard Griffiths, F4EXB // // // // Implementation of static web API adapters used for preset serialization and // // deserialization // @@ -19,13 +19,13 @@ /////////////////////////////////////////////////////////////////////////////////// #include "device/devicewebapiadapter.h" -#include "aaroniartsasettings.h" +#include "aaroniartsainputsettings.h" -class AaroniaRTSAWebAPIAdapter : public DeviceWebAPIAdapter +class AaroniaRTSAInputWebAPIAdapter : public DeviceWebAPIAdapter { public: - AaroniaRTSAWebAPIAdapter(); - virtual ~AaroniaRTSAWebAPIAdapter(); + AaroniaRTSAInputWebAPIAdapter(); + virtual ~AaroniaRTSAInputWebAPIAdapter(); virtual QByteArray serialize() { return m_settings.serialize(); } virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); } @@ -40,5 +40,5 @@ public: QString& errorMessage); private: - AaroniaRTSASettings m_settings; -}; \ No newline at end of file + AaroniaRTSAInputSettings m_settings; +}; diff --git a/plugins/samplesource/aaroniartsa/aaroniartsaworker.cpp b/plugins/samplesource/aaroniartsainput/aaroniartsainputworker.cpp similarity index 80% rename from plugins/samplesource/aaroniartsa/aaroniartsaworker.cpp rename to plugins/samplesource/aaroniartsainput/aaroniartsainputworker.cpp index 805d52316..b0f6f40b5 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsaworker.cpp +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputworker.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // +// Copyright (C) 2023 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 // @@ -24,12 +24,12 @@ #include "util/messagequeue.h" #include "dsp/dspcommands.h" -#include "aaroniartsasettings.h" -#include "aaroniartsaworker.h" +#include "aaroniartsainputsettings.h" +#include "aaroniartsainputworker.h" -MESSAGE_CLASS_DEFINITION(AaroniaRTSAWorker::MsgReportSampleRateAndFrequency, Message) +MESSAGE_CLASS_DEFINITION(AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency, Message) -AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) : +AaroniaRTSAInputWorker::AaroniaRTSAInputWorker(SampleSinkFifo* sampleFifo) : QObject(), m_timer(this), m_samplesBuf(), @@ -37,7 +37,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) : m_centerFrequency(0), m_sampleRate(1), m_inputMessageQueue(nullptr), - m_status(AaroniaRTSASettings::ConnectionIdle), + m_status(AaroniaRTSAInputSettings::ConnectionIdle), mReply(nullptr), m_convertBuffer(64e6) { @@ -48,7 +48,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) : m_networkAccessManagerConfig, &QNetworkAccessManager::finished, this, - &AaroniaRTSAWorker::handleConfigReply + &AaroniaRTSAInputWorker::handleConfigReply ); // Request 16bit raw samples @@ -67,7 +67,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) : mPacketSamples = 0; } -AaroniaRTSAWorker::~AaroniaRTSAWorker() +AaroniaRTSAInputWorker::~AaroniaRTSAInputWorker() { if (mReply) { @@ -86,25 +86,25 @@ AaroniaRTSAWorker::~AaroniaRTSAWorker() m_networkAccessManagerConfig, &QNetworkAccessManager::finished, this, - &AaroniaRTSAWorker::handleConfigReply + &AaroniaRTSAInputWorker::handleConfigReply ); m_networkAccessManagerConfig->deleteLater(); } -void AaroniaRTSAWorker::onSocketError(QAbstractSocket::SocketError error) +void AaroniaRTSAInputWorker::onSocketError(QAbstractSocket::SocketError error) { (void) error; - m_status = AaroniaRTSASettings::ConnectionError; + m_status = AaroniaRTSAInputSettings::ConnectionError; emit updateStatus(m_status); } -void AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate() +void AaroniaRTSAInputWorker::sendCenterFrequencyAndSampleRate() { if (m_iqDemodName.size() == 0) { return; } - qDebug("AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate: %llu samplerate: %d", m_centerFrequency, m_sampleRate); + qDebug("AaroniaRTSAInputWorker::sendCenterFrequencyAndSampleRate: %llu samplerate: %d", m_centerFrequency, m_sampleRate); QJsonObject object { {"receiverName", m_iqDemodName}, @@ -125,14 +125,14 @@ void AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate() m_networkAccessManagerConfig->put(request, document.toJson()); } -void AaroniaRTSAWorker::getConfig() +void AaroniaRTSAInputWorker::getConfig() { QUrl url(tr("http://%1/remoteconfig").arg(m_serverAddress)); QNetworkRequest request(url); m_networkAccessManagerConfig->get(request); } -void AaroniaRTSAWorker::onCenterFrequencyChanged(quint64 centerFrequency) +void AaroniaRTSAInputWorker::onCenterFrequencyChanged(quint64 centerFrequency) { if (m_centerFrequency == centerFrequency) { return; @@ -142,7 +142,7 @@ void AaroniaRTSAWorker::onCenterFrequencyChanged(quint64 centerFrequency) sendCenterFrequencyAndSampleRate(); } -void AaroniaRTSAWorker::onSampleRateChanged(int sampleRate) +void AaroniaRTSAInputWorker::onSampleRateChanged(int sampleRate) { if (m_sampleRate == sampleRate) { return; @@ -152,9 +152,9 @@ void AaroniaRTSAWorker::onSampleRateChanged(int sampleRate) sendCenterFrequencyAndSampleRate(); } -void AaroniaRTSAWorker::onServerAddressChanged(QString serverAddress) +void AaroniaRTSAInputWorker::onServerAddressChanged(QString serverAddress) { - m_status = AaroniaRTSASettings::ConnectionDisconnected; + m_status = AaroniaRTSAInputSettings::ConnectionDisconnected; updateStatus(m_status); if (mReply) @@ -184,34 +184,34 @@ void AaroniaRTSAWorker::onServerAddressChanged(QString serverAddress) getConfig(); } -void AaroniaRTSAWorker::tick() +void AaroniaRTSAInputWorker::tick() { } /**************************CPY ********************************* */ -void AaroniaRTSAWorker::onError(QNetworkReply::NetworkError code) +void AaroniaRTSAInputWorker::onError(QNetworkReply::NetworkError code) { (void) code; - qWarning() << "AaroniaRTSAWorker::onError: network Error: " << mReply->errorString(); + qWarning() << "AaroniaRTSAInputWorker::onError: network Error: " << mReply->errorString(); m_status = 3; emit updateStatus(3); } -void AaroniaRTSAWorker::onFinished() +void AaroniaRTSAInputWorker::onFinished() { - qDebug() << "AaroniaRTSAWorker::onFinished(: finished: " << mReply->errorString(); + qDebug() << "AaroniaRTSAInputWorker::onFinished(: finished: " << mReply->errorString(); mBuffer.append(mReply->readAll()); mReply->deleteLater(); mReply = nullptr; } // bytes received from the socket -void AaroniaRTSAWorker::onReadyRead() +void AaroniaRTSAInputWorker::onReadyRead() { - if (m_status != AaroniaRTSASettings::ConnectionOK) + if (m_status != AaroniaRTSAInputSettings::ConnectionOK) { - m_status = AaroniaRTSASettings::ConnectionOK; + m_status = AaroniaRTSAInputSettings::ConnectionOK; emit updateStatus(m_status); } @@ -291,16 +291,16 @@ void AaroniaRTSAWorker::onReadyRead() // Dump packet loss // if (startTime != mPrevTime) // { - // qDebug() << "AaroniaRTSAWorker::onReadyRead: packet loss: " + // qDebug() << "AaroniaRTSAInputWorker::onReadyRead: packet loss: " // << QDateTime::fromMSecsSinceEpoch(startTime * 1000).toString() // << " D " << endTime - startTime // << " O " << startTime - mPrevTime // << " S " << samples // << " L " << QDateTime::currentMSecsSinceEpoch() / 1000.0 - startTime; - // if (m_status != AaroniaRTSASettings::ConnectionUnstable) + // if (m_status != AaroniaRTSAInputSettings::ConnectionUnstable) // { - // m_status = AaroniaRTSASettings::ConnectionUnstable; + // m_status = AaroniaRTSAInputSettings::ConnectionUnstable; // emit updateStatus(m_status); // } // } @@ -344,7 +344,7 @@ void AaroniaRTSAWorker::onReadyRead() mBuffer.remove(0, offset); } -void AaroniaRTSAWorker::handleConfigReply(QNetworkReply* reply) +void AaroniaRTSAInputWorker::handleConfigReply(QNetworkReply* reply) { if (reply->operation() == QNetworkAccessManager::GetOperation) // return from GET to /remoteconfig { @@ -355,16 +355,16 @@ void AaroniaRTSAWorker::handleConfigReply(QNetworkReply* reply) int httpStatusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); if ((httpStatusCode / 100) == 2) { - qDebug("AaroniaRTSAWorker::handleConfigReply: remoteconfig OK (%d)", httpStatusCode); + qDebug("AaroniaRTSAInputWorker::handleConfigReply: remoteconfig OK (%d)", httpStatusCode); } else { - qWarning("AaroniaRTSAWorker::handleConfigReply: remoteconfig ended with error (%d)", httpStatusCode); + qWarning("AaroniaRTSAInputWorker::handleConfigReply: remoteconfig ended with error (%d)", httpStatusCode); } } reply->deleteLater(); } -void AaroniaRTSAWorker::parseConfig(QByteArray bytes) +void AaroniaRTSAInputWorker::parseConfig(QByteArray bytes) { QJsonDocument document = QJsonDocument::fromJson(bytes); m_iqDemodName = ""; @@ -399,25 +399,24 @@ void AaroniaRTSAWorker::parseConfig(QByteArray bytes) } else { - qDebug() << "AaroniaRTSAWorker::parseConfig: config has no items: " << config; + qDebug() << "AaroniaRTSAInputWorker::parseConfig: config has no items: " << config; } } else { - qDebug() << "AaroniaRTSAWorker::parseConfig: document has no config obhect: " << documentObject; + qDebug() << "AaroniaRTSAInputWorker::parseConfig: document has no config obhect: " << documentObject; } } else { - qDebug() << "AaroniaRTSAWorker::parseConfig: Document is not an object: " << document; + qDebug() << "AaroniaRTSAInputWorker::parseConfig: Document is not an object: " << document; } if (m_iqDemodName == "") { - qWarning("AaroniaRTSAWorker.parseConfig: could not find IQ demdulator"); + qWarning("AaroniaRTSAInputWorker.parseConfig: could not find IQ demdulator"); } else { - qDebug("AaroniaRTSAWorker::parseConfig: IQ demdulator name: %s", qPrintable(m_iqDemodName)); + qDebug("AaroniaRTSAInputWorker::parseConfig: IQ demdulator name: %s", qPrintable(m_iqDemodName)); } } - diff --git a/plugins/samplesource/aaroniartsa/aaroniartsaworker.h b/plugins/samplesource/aaroniartsainput/aaroniartsainputworker.h similarity index 95% rename from plugins/samplesource/aaroniartsa/aaroniartsaworker.h rename to plugins/samplesource/aaroniartsainput/aaroniartsainputworker.h index d4c410b77..24109f067 100644 --- a/plugins/samplesource/aaroniartsa/aaroniartsaworker.h +++ b/plugins/samplesource/aaroniartsainput/aaroniartsainputworker.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////////// -// Copyright (C) 2019 Vort // +// Copyright (C) 2023 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 // @@ -36,7 +36,7 @@ class MessageQueue; -class AaroniaRTSAWorker : public QObject { +class AaroniaRTSAInputWorker : public QObject { Q_OBJECT public: @@ -62,8 +62,8 @@ public: { } }; - AaroniaRTSAWorker(SampleSinkFifo* sampleFifo); - ~AaroniaRTSAWorker(); + AaroniaRTSAInputWorker(SampleSinkFifo* sampleFifo); + ~AaroniaRTSAInputWorker(); int getStatus() const { return m_status; } void setInputMessageQueue(MessageQueue *messageQueue) { m_inputMessageQueue = messageQueue; } diff --git a/plugins/samplesource/aaroniartsa/readme.md b/plugins/samplesource/aaroniartsainput/readme.md similarity index 100% rename from plugins/samplesource/aaroniartsa/readme.md rename to plugins/samplesource/aaroniartsainput/readme.md