mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-16 05:11:49 -05:00
Aaronia RSA Rx: renamings for output plugin provision
This commit is contained in:
parent
bf1558071e
commit
b38385b07b
@ -73,4 +73,4 @@ endif()
|
||||
add_subdirectory(audioinput)
|
||||
add_subdirectory(kiwisdr)
|
||||
add_subdirectory(remotetcpinput)
|
||||
add_subdirectory(aaroniartsa)
|
||||
add_subdirectory(aaroniartsainput)
|
||||
|
@ -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}
|
@ -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<QString>{"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<QString>& settingsKeys, bool force)
|
||||
bool AaroniaRTSAInput::applySettings(const AaroniaRTSAInputSettings& settings, const QList<QString>& 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<QString>& deviceSettingsKeys, const AaroniaRTSASettings& settings, bool force)
|
||||
void AaroniaRTSAInput::webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const AaroniaRTSAInputSettings& settings, bool force)
|
||||
{
|
||||
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||
swgDeviceSettings->setDirection(0); // single Rx
|
@ -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 <QNetworkRequest>
|
||||
|
||||
#include <dsp/devicesamplesource.h>
|
||||
#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<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
||||
bool getForce() const { return m_force; }
|
||||
|
||||
static MsgConfigureAaroniaRTSA* create(const AaroniaRTSASettings& settings, const QList<QString>& settingsKeys, bool force)
|
||||
static MsgConfigureAaroniaRTSA* create(const AaroniaRTSAInputSettings& settings, const QList<QString>& settingsKeys, bool force)
|
||||
{
|
||||
return new MsgConfigureAaroniaRTSA(settings, settingsKeys, force);
|
||||
}
|
||||
|
||||
private:
|
||||
AaroniaRTSASettings m_settings;
|
||||
AaroniaRTSAInputSettings m_settings;
|
||||
QList<QString> m_settingsKeys;
|
||||
bool m_force;
|
||||
|
||||
MsgConfigureAaroniaRTSA(const AaroniaRTSASettings& settings, const QList<QString>& settingsKeys, bool force) :
|
||||
MsgConfigureAaroniaRTSA(const AaroniaRTSAInputSettings& settings, const QList<QString>& 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<QString>& settingsKeys, bool force);
|
||||
bool applySettings(const AaroniaRTSAInputSettings& settings, const QList<QString>& settingsKeys, bool force);
|
||||
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
|
||||
void webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const AaroniaRTSASettings& settings, bool force);
|
||||
void webapiReverseSendSettings(const QList<QString>& deviceSettingsKeys, const AaroniaRTSAInputSettings& settings, bool force);
|
||||
void webapiReverseSendStartStop(bool start);
|
||||
|
||||
signals:
|
@ -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 <QMessageBox>
|
||||
#include <QFileDialog>
|
||||
|
||||
#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);
|
||||
}
|
@ -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 <device/devicegui.h>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
#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<QString> m_settingsKeys;
|
||||
QTimer m_updateTimer;
|
||||
QTimer m_statusTimer;
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AaroniaRTSAGui</class>
|
||||
<widget class="QWidget" name="AaroniaRTSAGui">
|
||||
<class>AaroniaRTSAInputGui</class>
|
||||
<widget class="QWidget" name="AaroniaRTSAInputGui">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
@ -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();
|
||||
}
|
@ -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);
|
@ -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;
|
||||
|
@ -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 <QString>
|
||||
#include <QByteArray>
|
||||
|
||||
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;
|
||||
};
|
||||
|
@ -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
|
@ -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;
|
||||
AaroniaRTSAInputSettings m_settings;
|
||||
};
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user