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(audioinput)
|
||||||
add_subdirectory(kiwisdr)
|
add_subdirectory(kiwisdr)
|
||||||
add_subdirectory(remotetcpinput)
|
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
|
aaroniartsainput.cpp
|
||||||
aaroniartsaplugin.cpp
|
aaroniartsainputplugin.cpp
|
||||||
aaroniartsaworker.cpp
|
aaroniartsainputworker.cpp
|
||||||
aaroniartsasettings.cpp
|
aaroniartsainputsettings.cpp
|
||||||
aaroniartsawebapiadapter.cpp
|
aaroniartsainputwebapiadapter.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(aaroniartsa_HEADERS
|
set(aaroniartsainput_HEADERS
|
||||||
aaroniartsainput.h
|
aaroniartsainput.h
|
||||||
aaroniartsaplugin.h
|
aaroniartsainputplugin.h
|
||||||
aaroniartsaworker.h
|
aaroniartsainputworker.h
|
||||||
aaroniartsasettings.h
|
aaroniartsainputsettings.h
|
||||||
aaroniartsawebapiadapter.h
|
aaroniartsainputwebapiadapter.h
|
||||||
)
|
)
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
@ -22,14 +22,14 @@ include_directories(
|
|||||||
)
|
)
|
||||||
|
|
||||||
if(NOT SERVER_MODE)
|
if(NOT SERVER_MODE)
|
||||||
set(aaroniartsa_SOURCES
|
set(aaroniartsainput_SOURCES
|
||||||
${aaroniartsa_SOURCES}
|
${aaroniartsainput_SOURCES}
|
||||||
aaroniartsagui.cpp
|
aaroniartsainputgui.cpp
|
||||||
aaroniartsagui.ui
|
aaroniartsainputgui.ui
|
||||||
)
|
)
|
||||||
set(aaroniartsa_HEADERS
|
set(aaroniartsainput_HEADERS
|
||||||
${aaroniartsa_HEADERS}
|
${aaroniartsainput_HEADERS}
|
||||||
aaroniartsagui.h
|
aaroniartsainputgui.h
|
||||||
)
|
)
|
||||||
|
|
||||||
set(TARGET_NAME inputaaroniartsa)
|
set(TARGET_NAME inputaaroniartsa)
|
||||||
@ -44,7 +44,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(${TARGET_NAME} SHARED
|
add_library(${TARGET_NAME} SHARED
|
||||||
${aaroniartsa_SOURCES}
|
${aaroniartsainput_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${TARGET_NAME}
|
target_link_libraries(${TARGET_NAME}
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -32,7 +31,7 @@
|
|||||||
|
|
||||||
#include "aaroniartsainput.h"
|
#include "aaroniartsainput.h"
|
||||||
#include "device/deviceapi.h"
|
#include "device/deviceapi.h"
|
||||||
#include "aaroniartsaworker.h"
|
#include "aaroniartsainputworker.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
#include "dsp/dspengine.h"
|
#include "dsp/dspengine.h"
|
||||||
|
|
||||||
@ -102,17 +101,17 @@ bool AaroniaRTSAInput::start()
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_aaroniaRTSAWorkerThread = new QThread();
|
m_aaroniaRTSAWorkerThread = new QThread();
|
||||||
m_aaroniaRTSAWorker = new AaroniaRTSAWorker(&m_sampleFifo);
|
m_aaroniaRTSAWorker = new AaroniaRTSAInputWorker(&m_sampleFifo);
|
||||||
m_aaroniaRTSAWorker->setInputMessageQueue(getInputMessageQueue());
|
m_aaroniaRTSAWorker->setInputMessageQueue(getInputMessageQueue());
|
||||||
m_aaroniaRTSAWorker->moveToThread(m_aaroniaRTSAWorkerThread);
|
m_aaroniaRTSAWorker->moveToThread(m_aaroniaRTSAWorkerThread);
|
||||||
|
|
||||||
QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorker, &QObject::deleteLater);
|
QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorker, &QObject::deleteLater);
|
||||||
QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorkerThread, &QThread::deleteLater);
|
QObject::connect(m_aaroniaRTSAWorkerThread, &QThread::finished, m_aaroniaRTSAWorkerThread, &QThread::deleteLater);
|
||||||
|
|
||||||
connect(this, &AaroniaRTSAInput::setWorkerCenterFrequency, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onCenterFrequencyChanged);
|
connect(this, &AaroniaRTSAInput::setWorkerCenterFrequency, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onCenterFrequencyChanged);
|
||||||
connect(this, &AaroniaRTSAInput::setWorkerSampleRate, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onSampleRateChanged);
|
connect(this, &AaroniaRTSAInput::setWorkerSampleRate, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onSampleRateChanged);
|
||||||
connect(this, &AaroniaRTSAInput::setWorkerServerAddress, m_aaroniaRTSAWorker, &AaroniaRTSAWorker::onServerAddressChanged);
|
connect(this, &AaroniaRTSAInput::setWorkerServerAddress, m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::onServerAddressChanged);
|
||||||
connect(m_aaroniaRTSAWorker, &AaroniaRTSAWorker::updateStatus, this, &AaroniaRTSAInput::setWorkerStatus);
|
connect(m_aaroniaRTSAWorker, &AaroniaRTSAInputWorker::updateStatus, this, &AaroniaRTSAInput::setWorkerStatus);
|
||||||
|
|
||||||
m_aaroniaRTSAWorkerThread->start();
|
m_aaroniaRTSAWorkerThread->start();
|
||||||
m_running = true;
|
m_running = true;
|
||||||
@ -187,7 +186,7 @@ quint64 AaroniaRTSAInput::getCenterFrequency() const
|
|||||||
|
|
||||||
void AaroniaRTSAInput::setCenterFrequency(qint64 centerFrequency)
|
void AaroniaRTSAInput::setCenterFrequency(qint64 centerFrequency)
|
||||||
{
|
{
|
||||||
AaroniaRTSASettings settings = m_settings;
|
AaroniaRTSAInputSettings settings = m_settings;
|
||||||
settings.m_centerFrequency = centerFrequency;
|
settings.m_centerFrequency = centerFrequency;
|
||||||
|
|
||||||
MsgConfigureAaroniaRTSA* message = MsgConfigureAaroniaRTSA::create(settings, QList<QString>{"centerFrequency"}, false);
|
MsgConfigureAaroniaRTSA* message = MsgConfigureAaroniaRTSA::create(settings, QList<QString>{"centerFrequency"}, false);
|
||||||
@ -222,12 +221,12 @@ bool AaroniaRTSAInput::handleMessage(const Message& message)
|
|||||||
|
|
||||||
return true;
|
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_sampleRate = report.getSampleRate();
|
||||||
m_centerFrequency = report.getCenterFrequency();
|
m_centerFrequency = report.getCenterFrequency();
|
||||||
qDebug() << "AaroniaRTSAInput::handleMessage: AaroniaRTSAWorker::MsgReportSampleRateAndFrequency:"
|
qDebug() << "AaroniaRTSAInput::handleMessage: AaroniaRTSAInputWorker::MsgReportSampleRateAndFrequency:"
|
||||||
<< " m_sampleRate: " << m_sampleRate
|
<< " m_sampleRate: " << m_sampleRate
|
||||||
<< " m-centerFrequency" << m_centerFrequency;
|
<< " 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);
|
qDebug() << "AaroniaRTSAInput::applySettings: force: "<< force << settings.getDebugString(settingsKeys, force);
|
||||||
|
|
||||||
@ -364,7 +363,7 @@ int AaroniaRTSAInput::webapiSettingsPutPatch(
|
|||||||
QString& errorMessage)
|
QString& errorMessage)
|
||||||
{
|
{
|
||||||
(void) errorMessage;
|
(void) errorMessage;
|
||||||
AaroniaRTSASettings settings = m_settings;
|
AaroniaRTSAInputSettings settings = m_settings;
|
||||||
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
webapiUpdateDeviceSettings(settings, deviceSettingsKeys, response);
|
||||||
|
|
||||||
MsgConfigureAaroniaRTSA *msg = MsgConfigureAaroniaRTSA::create(settings, deviceSettingsKeys, force);
|
MsgConfigureAaroniaRTSA *msg = MsgConfigureAaroniaRTSA::create(settings, deviceSettingsKeys, force);
|
||||||
@ -381,7 +380,7 @@ int AaroniaRTSAInput::webapiSettingsPutPatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAInput::webapiUpdateDeviceSettings(
|
void AaroniaRTSAInput::webapiUpdateDeviceSettings(
|
||||||
AaroniaRTSASettings& settings,
|
AaroniaRTSAInputSettings& settings,
|
||||||
const QStringList& deviceSettingsKeys,
|
const QStringList& deviceSettingsKeys,
|
||||||
SWGSDRangel::SWGDeviceSettings& response)
|
SWGSDRangel::SWGDeviceSettings& response)
|
||||||
{
|
{
|
||||||
@ -419,7 +418,7 @@ int AaroniaRTSAInput::webapiReportGet(
|
|||||||
return 200;
|
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()->setCenterFrequency(settings.m_centerFrequency);
|
||||||
response.getAaroniaRtsaSettings()->setSampleRate(settings.m_sampleRate);
|
response.getAaroniaRtsaSettings()->setSampleRate(settings.m_sampleRate);
|
||||||
@ -447,7 +446,7 @@ void AaroniaRTSAInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& re
|
|||||||
response.getAaroniaSdrReport()->setStatus(getStatus());
|
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();
|
SWGSDRangel::SWGDeviceSettings *swgDeviceSettings = new SWGSDRangel::SWGDeviceSettings();
|
||||||
swgDeviceSettings->setDirection(0); // single Rx
|
swgDeviceSettings->setDirection(0); // single Rx
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -25,10 +24,10 @@
|
|||||||
#include <QNetworkRequest>
|
#include <QNetworkRequest>
|
||||||
|
|
||||||
#include <dsp/devicesamplesource.h>
|
#include <dsp/devicesamplesource.h>
|
||||||
#include "aaroniartsasettings.h"
|
#include "aaroniartsainputsettings.h"
|
||||||
|
|
||||||
class DeviceAPI;
|
class DeviceAPI;
|
||||||
class AaroniaRTSAWorker;
|
class AaroniaRTSAInputWorker;
|
||||||
class QNetworkAccessManager;
|
class QNetworkAccessManager;
|
||||||
class QNetworkReply;
|
class QNetworkReply;
|
||||||
class QThread;
|
class QThread;
|
||||||
@ -40,21 +39,21 @@ public:
|
|||||||
MESSAGE_CLASS_DECLARATION
|
MESSAGE_CLASS_DECLARATION
|
||||||
|
|
||||||
public:
|
public:
|
||||||
const AaroniaRTSASettings& getSettings() const { return m_settings; }
|
const AaroniaRTSAInputSettings& getSettings() const { return m_settings; }
|
||||||
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
const QList<QString>& getSettingsKeys() const { return m_settingsKeys; }
|
||||||
bool getForce() const { return m_force; }
|
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);
|
return new MsgConfigureAaroniaRTSA(settings, settingsKeys, force);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AaroniaRTSASettings m_settings;
|
AaroniaRTSAInputSettings m_settings;
|
||||||
QList<QString> m_settingsKeys;
|
QList<QString> m_settingsKeys;
|
||||||
bool m_force;
|
bool m_force;
|
||||||
|
|
||||||
MsgConfigureAaroniaRTSA(const AaroniaRTSASettings& settings, const QList<QString>& settingsKeys, bool force) :
|
MsgConfigureAaroniaRTSA(const AaroniaRTSAInputSettings& settings, const QList<QString>& settingsKeys, bool force) :
|
||||||
Message(),
|
Message(),
|
||||||
m_settings(settings),
|
m_settings(settings),
|
||||||
m_settingsKeys(settingsKeys),
|
m_settingsKeys(settingsKeys),
|
||||||
@ -145,10 +144,10 @@ public:
|
|||||||
|
|
||||||
static void webapiFormatDeviceSettings(
|
static void webapiFormatDeviceSettings(
|
||||||
SWGSDRangel::SWGDeviceSettings& response,
|
SWGSDRangel::SWGDeviceSettings& response,
|
||||||
const AaroniaRTSASettings& settings);
|
const AaroniaRTSAInputSettings& settings);
|
||||||
|
|
||||||
static void webapiUpdateDeviceSettings(
|
static void webapiUpdateDeviceSettings(
|
||||||
AaroniaRTSASettings& settings,
|
AaroniaRTSAInputSettings& settings,
|
||||||
const QStringList& deviceSettingsKeys,
|
const QStringList& deviceSettingsKeys,
|
||||||
SWGSDRangel::SWGDeviceSettings& response);
|
SWGSDRangel::SWGDeviceSettings& response);
|
||||||
|
|
||||||
@ -157,8 +156,8 @@ private:
|
|||||||
QMutex m_mutex;
|
QMutex m_mutex;
|
||||||
int m_sampleRate;
|
int m_sampleRate;
|
||||||
quint64 m_centerFrequency;
|
quint64 m_centerFrequency;
|
||||||
AaroniaRTSASettings m_settings;
|
AaroniaRTSAInputSettings m_settings;
|
||||||
AaroniaRTSAWorker* m_aaroniaRTSAWorker;
|
AaroniaRTSAInputWorker* m_aaroniaRTSAWorker;
|
||||||
QThread *m_aaroniaRTSAWorkerThread;
|
QThread *m_aaroniaRTSAWorkerThread;
|
||||||
QString m_deviceDescription;
|
QString m_deviceDescription;
|
||||||
bool m_running;
|
bool m_running;
|
||||||
@ -167,9 +166,9 @@ private:
|
|||||||
QNetworkRequest m_networkRequest;
|
QNetworkRequest m_networkRequest;
|
||||||
|
|
||||||
int getStatus() const;
|
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 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);
|
void webapiReverseSendStartStop(bool start);
|
||||||
|
|
||||||
signals:
|
signals:
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -24,7 +23,7 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
|
||||||
#include "ui_aaroniartsagui.h"
|
#include "ui_aaroniartsainputgui.h"
|
||||||
#include "plugin/pluginapi.h"
|
#include "plugin/pluginapi.h"
|
||||||
#include "gui/colormapper.h"
|
#include "gui/colormapper.h"
|
||||||
#include "gui/glspectrum.h"
|
#include "gui/glspectrum.h"
|
||||||
@ -36,13 +35,13 @@
|
|||||||
|
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
|
||||||
#include "aaroniartsagui.h"
|
#include "aaroniartsainputgui.h"
|
||||||
#include "device/deviceapi.h"
|
#include "device/deviceapi.h"
|
||||||
#include "device/deviceuiset.h"
|
#include "device/deviceuiset.h"
|
||||||
|
|
||||||
AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
AaroniaRTSAInputGui::AaroniaRTSAInputGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
||||||
DeviceGUI(parent),
|
DeviceGUI(parent),
|
||||||
ui(new Ui::AaroniaRTSAGui),
|
ui(new Ui::AaroniaRTSAInputGui),
|
||||||
m_settings(),
|
m_settings(),
|
||||||
m_doApplySettings(true),
|
m_doApplySettings(true),
|
||||||
m_forceSettings(true),
|
m_forceSettings(true),
|
||||||
@ -50,7 +49,7 @@ AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
|||||||
m_tickCount(0),
|
m_tickCount(0),
|
||||||
m_lastEngineState(DeviceAPI::StNotStarted)
|
m_lastEngineState(DeviceAPI::StNotStarted)
|
||||||
{
|
{
|
||||||
qDebug("AaroniaRTSAGui::AaroniaRTSAGui");
|
qDebug("AaroniaRTSAInputGui::AaroniaRTSAInputGui");
|
||||||
m_deviceUISet = deviceUISet;
|
m_deviceUISet = deviceUISet;
|
||||||
setAttribute(Qt::WA_DeleteOnClose, true);
|
setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
m_sampleSource = m_deviceUISet->m_deviceAPI->getSampleSource();
|
m_sampleSource = m_deviceUISet->m_deviceAPI->getSampleSource();
|
||||||
@ -69,7 +68,7 @@ AaroniaRTSAGui::AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent) :
|
|||||||
|
|
||||||
ui->setupUi(getContents());
|
ui->setupUi(getContents());
|
||||||
sizeToContents();
|
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";
|
m_helpURL = "plugins/samplesource/aaroniartsa/readme.md";
|
||||||
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
ui->centerFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold));
|
||||||
ui->centerFrequency->setValueRange(9, 0, 999999999);
|
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 &)));
|
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(openDeviceSettingsDialog(const QPoint &)));
|
||||||
}
|
}
|
||||||
|
|
||||||
AaroniaRTSAGui::~AaroniaRTSAGui()
|
AaroniaRTSAInputGui::~AaroniaRTSAInputGui()
|
||||||
{
|
{
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::destroy()
|
void AaroniaRTSAInputGui::destroy()
|
||||||
{
|
{
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::resetToDefaults()
|
void AaroniaRTSAInputGui::resetToDefaults()
|
||||||
{
|
{
|
||||||
m_settings.resetToDefaults();
|
m_settings.resetToDefaults();
|
||||||
displaySettings();
|
displaySettings();
|
||||||
@ -108,12 +107,12 @@ void AaroniaRTSAGui::resetToDefaults()
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AaroniaRTSAGui::serialize() const
|
QByteArray AaroniaRTSAInputGui::serialize() const
|
||||||
{
|
{
|
||||||
return m_settings.serialize();
|
return m_settings.serialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AaroniaRTSAGui::deserialize(const QByteArray& data)
|
bool AaroniaRTSAInputGui::deserialize(const QByteArray& data)
|
||||||
{
|
{
|
||||||
if(m_settings.deserialize(data)) {
|
if(m_settings.deserialize(data)) {
|
||||||
displaySettings();
|
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)
|
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_settings.m_centerFrequency = value * 1000;
|
||||||
m_settingsKeys.append("centerFrequency");
|
m_settingsKeys.append("centerFrequency");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::on_sampleRate_changed(quint64 value)
|
void AaroniaRTSAInputGui::on_sampleRate_changed(quint64 value)
|
||||||
{
|
{
|
||||||
m_settings.m_sampleRate = value;
|
m_settings.m_sampleRate = value;
|
||||||
m_settingsKeys.append("sampleRate");
|
m_settingsKeys.append("sampleRate");
|
||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::on_serverAddress_returnPressed()
|
void AaroniaRTSAInputGui::on_serverAddress_returnPressed()
|
||||||
{
|
{
|
||||||
on_serverAddressApplyButton_clicked();
|
on_serverAddressApplyButton_clicked();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::on_serverAddressApplyButton_clicked()
|
void AaroniaRTSAInputGui::on_serverAddressApplyButton_clicked()
|
||||||
{
|
{
|
||||||
QString serverAddress = ui->serverAddress->text();
|
QString serverAddress = ui->serverAddress->text();
|
||||||
QUrl url(serverAddress);
|
QUrl url(serverAddress);
|
||||||
@ -169,7 +168,7 @@ void AaroniaRTSAGui::on_serverAddressApplyButton_clicked()
|
|||||||
sendSettings();
|
sendSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::displaySettings()
|
void AaroniaRTSAInputGui::displaySettings()
|
||||||
{
|
{
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
|
|
||||||
@ -179,14 +178,14 @@ void AaroniaRTSAGui::displaySettings()
|
|||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::sendSettings()
|
void AaroniaRTSAInputGui::sendSettings()
|
||||||
{
|
{
|
||||||
if (!m_updateTimer.isActive()) {
|
if (!m_updateTimer.isActive()) {
|
||||||
m_updateTimer.start(100);
|
m_updateTimer.start(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::updateHardware()
|
void AaroniaRTSAInputGui::updateHardware()
|
||||||
{
|
{
|
||||||
if (m_doApplySettings)
|
if (m_doApplySettings)
|
||||||
{
|
{
|
||||||
@ -198,7 +197,7 @@ void AaroniaRTSAGui::updateHardware()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::updateStatus()
|
void AaroniaRTSAInputGui::updateStatus()
|
||||||
{
|
{
|
||||||
int state = m_deviceUISet->m_deviceAPI->state();
|
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))
|
if (AaroniaRTSAInput::MsgConfigureAaroniaRTSA::match(message))
|
||||||
{
|
{
|
||||||
qDebug("AaroniaRTSAGui::handleMessage: MsgConfigureAaroniaRTSA");
|
qDebug("AaroniaRTSAInputGui::handleMessage: MsgConfigureAaroniaRTSA");
|
||||||
const AaroniaRTSAInput::MsgConfigureAaroniaRTSA& cfg = (AaroniaRTSAInput::MsgConfigureAaroniaRTSA&) message;
|
const AaroniaRTSAInput::MsgConfigureAaroniaRTSA& cfg = (AaroniaRTSAInput::MsgConfigureAaroniaRTSA&) message;
|
||||||
|
|
||||||
if (cfg.getForce()) {
|
if (cfg.getForce()) {
|
||||||
@ -245,7 +244,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message)
|
|||||||
}
|
}
|
||||||
else if (AaroniaRTSAInput::MsgStartStop::match(message))
|
else if (AaroniaRTSAInput::MsgStartStop::match(message))
|
||||||
{
|
{
|
||||||
qDebug("AaroniaRTSAGui::handleMessage: MsgStartStop");
|
qDebug("AaroniaRTSAInputGui::handleMessage: MsgStartStop");
|
||||||
AaroniaRTSAInput::MsgStartStop& notif = (AaroniaRTSAInput::MsgStartStop&) message;
|
AaroniaRTSAInput::MsgStartStop& notif = (AaroniaRTSAInput::MsgStartStop&) message;
|
||||||
blockApplySettings(true);
|
blockApplySettings(true);
|
||||||
ui->startStop->setChecked(notif.getStartStop());
|
ui->startStop->setChecked(notif.getStartStop());
|
||||||
@ -255,7 +254,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message)
|
|||||||
}
|
}
|
||||||
else if (AaroniaRTSAInput::MsgSetStatus::match(message))
|
else if (AaroniaRTSAInput::MsgSetStatus::match(message))
|
||||||
{
|
{
|
||||||
qDebug("AaroniaRTSAGui::handleMessage: MsgSetStatus");
|
qDebug("AaroniaRTSAInputGui::handleMessage: MsgSetStatus");
|
||||||
AaroniaRTSAInput::MsgSetStatus& notif = (AaroniaRTSAInput::MsgSetStatus&) message;
|
AaroniaRTSAInput::MsgSetStatus& notif = (AaroniaRTSAInput::MsgSetStatus&) message;
|
||||||
int status = notif.getStatus();
|
int status = notif.getStatus();
|
||||||
ui->statusIndicator->setToolTip(m_statusTooltips[status]);
|
ui->statusIndicator->setToolTip(m_statusTooltips[status]);
|
||||||
@ -269,7 +268,7 @@ bool AaroniaRTSAGui::handleMessage(const Message& message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::handleInputMessages()
|
void AaroniaRTSAInputGui::handleInputMessages()
|
||||||
{
|
{
|
||||||
Message* message;
|
Message* message;
|
||||||
|
|
||||||
@ -280,7 +279,7 @@ void AaroniaRTSAGui::handleInputMessages()
|
|||||||
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
DSPSignalNotification* notif = (DSPSignalNotification*) message;
|
||||||
m_deviceSampleRate = notif->getSampleRate();
|
m_deviceSampleRate = notif->getSampleRate();
|
||||||
m_deviceCenterFrequency = notif->getCenterFrequency();
|
m_deviceCenterFrequency = notif->getCenterFrequency();
|
||||||
qDebug("AaroniaRTSAGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu",
|
qDebug("AaroniaRTSAInputGui::handleInputMessages: DSPSignalNotification: SampleRate:%d, CenterFrequency:%llu",
|
||||||
notif->getSampleRate(),
|
notif->getSampleRate(),
|
||||||
notif->getCenterFrequency());
|
notif->getCenterFrequency());
|
||||||
updateSampleRateAndFrequency();
|
updateSampleRateAndFrequency();
|
||||||
@ -297,7 +296,7 @@ void AaroniaRTSAGui::handleInputMessages()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::updateSampleRateAndFrequency()
|
void AaroniaRTSAInputGui::updateSampleRateAndFrequency()
|
||||||
{
|
{
|
||||||
m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate);
|
m_deviceUISet->getSpectrum()->setSampleRate(m_deviceSampleRate);
|
||||||
m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
m_deviceUISet->getSpectrum()->setCenterFrequency(m_deviceCenterFrequency);
|
||||||
@ -309,7 +308,7 @@ void AaroniaRTSAGui::updateSampleRateAndFrequency()
|
|||||||
blockApplySettings(false);
|
blockApplySettings(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::openDeviceSettingsDialog(const QPoint& p)
|
void AaroniaRTSAInputGui::openDeviceSettingsDialog(const QPoint& p)
|
||||||
{
|
{
|
||||||
if (m_contextMenuType == ContextMenuDeviceSettings)
|
if (m_contextMenuType == ContextMenuDeviceSettings)
|
||||||
{
|
{
|
||||||
@ -338,11 +337,11 @@ void AaroniaRTSAGui::openDeviceSettingsDialog(const QPoint& p)
|
|||||||
resetContextMenuType();
|
resetContextMenuType();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAGui::makeUIConnections()
|
void AaroniaRTSAInputGui::makeUIConnections()
|
||||||
{
|
{
|
||||||
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AaroniaRTSAGui::on_startStop_toggled);
|
QObject::connect(ui->startStop, &ButtonSwitch::toggled, this, &AaroniaRTSAInputGui::on_startStop_toggled);
|
||||||
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AaroniaRTSAGui::on_centerFrequency_changed);
|
QObject::connect(ui->centerFrequency, &ValueDial::changed, this, &AaroniaRTSAInputGui::on_centerFrequency_changed);
|
||||||
QObject::connect(ui->sampleRate, &ValueDial::changed, this, &AaroniaRTSAGui::on_sampleRate_changed);
|
QObject::connect(ui->sampleRate, &ValueDial::changed, this, &AaroniaRTSAInputGui::on_sampleRate_changed);
|
||||||
QObject::connect(ui->serverAddress, &QLineEdit::returnPressed, this, &AaroniaRTSAGui::on_serverAddress_returnPressed);
|
QObject::connect(ui->serverAddress, &QLineEdit::returnPressed, this, &AaroniaRTSAInputGui::on_serverAddress_returnPressed);
|
||||||
QObject::connect(ui->serverAddressApplyButton, &QPushButton::clicked, this, &AaroniaRTSAGui::on_serverAddressApplyButton_clicked);
|
QObject::connect(ui->serverAddressApplyButton, &QPushButton::clicked, this, &AaroniaRTSAInputGui::on_serverAddressApplyButton_clicked);
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -19,27 +18,27 @@
|
|||||||
#ifndef _AARONIARTSA_AARONIARTSAGUI_H_
|
#ifndef _AARONIARTSA_AARONIARTSAGUI_H_
|
||||||
#define _AARONIARTSA_AARONIARTSAGUI_H_
|
#define _AARONIARTSA_AARONIARTSAGUI_H_
|
||||||
|
|
||||||
#include <device/devicegui.h>
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
|
#include "device/devicegui.h"
|
||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
|
|
||||||
#include "aaroniartsasettings.h"
|
#include "aaroniartsainputsettings.h"
|
||||||
#include "aaroniartsainput.h"
|
#include "aaroniartsainput.h"
|
||||||
|
|
||||||
class DeviceUISet;
|
class DeviceUISet;
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class AaroniaRTSAGui;
|
class AaroniaRTSAInputGui;
|
||||||
}
|
}
|
||||||
|
|
||||||
class AaroniaRTSAGui : public DeviceGUI {
|
class AaroniaRTSAInputGui : public DeviceGUI {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AaroniaRTSAGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
explicit AaroniaRTSAInputGui(DeviceUISet *deviceUISet, QWidget* parent = 0);
|
||||||
virtual ~AaroniaRTSAGui();
|
virtual ~AaroniaRTSAInputGui();
|
||||||
virtual void destroy();
|
virtual void destroy();
|
||||||
|
|
||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
@ -48,9 +47,9 @@ public:
|
|||||||
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
virtual MessageQueue *getInputMessageQueue() { return &m_inputMessageQueue; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AaroniaRTSAGui* ui;
|
Ui::AaroniaRTSAInputGui* ui;
|
||||||
|
|
||||||
AaroniaRTSASettings m_settings;
|
AaroniaRTSAInputSettings m_settings;
|
||||||
QList<QString> m_settingsKeys;
|
QList<QString> m_settingsKeys;
|
||||||
QTimer m_updateTimer;
|
QTimer m_updateTimer;
|
||||||
QTimer m_statusTimer;
|
QTimer m_statusTimer;
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>AaroniaRTSAGui</class>
|
<class>AaroniaRTSAInputGui</class>
|
||||||
<widget class="QWidget" name="AaroniaRTSAGui">
|
<widget class="QWidget" name="AaroniaRTSAInputGui">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -24,16 +23,16 @@
|
|||||||
#ifdef SERVER_MODE
|
#ifdef SERVER_MODE
|
||||||
#include "aaroniartsainput.h"
|
#include "aaroniartsainput.h"
|
||||||
#else
|
#else
|
||||||
#include "aaroniartsagui.h"
|
#include "aaroniartsainputgui.h"
|
||||||
#endif
|
#endif
|
||||||
#include "aaroniartsaplugin.h"
|
#include "aaroniartsainputplugin.h"
|
||||||
#include "aaroniartsawebapiadapter.h"
|
#include "aaroniartsainputwebapiadapter.h"
|
||||||
|
|
||||||
const PluginDescriptor AaroniaRTSAPlugin::m_pluginDescriptor = {
|
const PluginDescriptor AaroniaRTSAInputPlugin::m_pluginDescriptor = {
|
||||||
QStringLiteral("AaroniaRTSA"),
|
QStringLiteral("AaroniaRTSA"),
|
||||||
QStringLiteral("AaroniaRTSA input"),
|
QStringLiteral("AaroniaRTSA input"),
|
||||||
QStringLiteral("7.8.4"),
|
QStringLiteral("7.12.0"),
|
||||||
QStringLiteral("(c) Vort (c) Edouard Griffiths, F4EXB"),
|
QStringLiteral("(c) Edouard Griffiths, F4EXB"),
|
||||||
QStringLiteral("https://github.com/f4exb/sdrangel"),
|
QStringLiteral("https://github.com/f4exb/sdrangel"),
|
||||||
true,
|
true,
|
||||||
QStringLiteral("https://github.com/f4exb/sdrangel")
|
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_hardwareID = "AaroniaRTSA";
|
||||||
static constexpr const char* const m_deviceTypeID = AARONIARTSA_DEVICE_TYPE_ID;
|
static constexpr const char* const m_deviceTypeID = AARONIARTSA_DEVICE_TYPE_ID;
|
||||||
|
|
||||||
AaroniaRTSAPlugin::AaroniaRTSAPlugin(QObject* parent) :
|
AaroniaRTSAInputPlugin::AaroniaRTSAInputPlugin(QObject* parent) :
|
||||||
QObject(parent)
|
QObject(parent)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
const PluginDescriptor& AaroniaRTSAPlugin::getPluginDescriptor() const
|
const PluginDescriptor& AaroniaRTSAInputPlugin::getPluginDescriptor() const
|
||||||
{
|
{
|
||||||
return m_pluginDescriptor;
|
return m_pluginDescriptor;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAPlugin::initPlugin(PluginAPI* pluginAPI)
|
void AaroniaRTSAInputPlugin::initPlugin(PluginAPI* pluginAPI)
|
||||||
{
|
{
|
||||||
pluginAPI->registerSampleSource(m_deviceTypeID, this);
|
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
|
if (listedHwIds.contains(m_hardwareID)) { // check if it was done
|
||||||
return;
|
return;
|
||||||
@ -75,7 +74,7 @@ void AaroniaRTSAPlugin::enumOriginDevices(QStringList& listedHwIds, OriginDevice
|
|||||||
listedHwIds.append(m_hardwareID);
|
listedHwIds.append(m_hardwareID);
|
||||||
}
|
}
|
||||||
|
|
||||||
PluginInterface::SamplingDevices AaroniaRTSAPlugin::enumSampleSources(const OriginDevices& originDevices)
|
PluginInterface::SamplingDevices AaroniaRTSAInputPlugin::enumSampleSources(const OriginDevices& originDevices)
|
||||||
{
|
{
|
||||||
SamplingDevices result;
|
SamplingDevices result;
|
||||||
|
|
||||||
@ -101,7 +100,7 @@ PluginInterface::SamplingDevices AaroniaRTSAPlugin::enumSampleSources(const Orig
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SERVER_MODE
|
#ifdef SERVER_MODE
|
||||||
DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI(
|
DeviceGUI* AaroniaRTSAInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
@ -112,13 +111,13 @@ DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI(
|
DeviceGUI* AaroniaRTSAInputPlugin::createSampleSourcePluginInstanceGUI(
|
||||||
const QString& sourceId,
|
const QString& sourceId,
|
||||||
QWidget **widget,
|
QWidget **widget,
|
||||||
DeviceUISet *deviceUISet)
|
DeviceUISet *deviceUISet)
|
||||||
{
|
{
|
||||||
if(sourceId == m_deviceTypeID) {
|
if(sourceId == m_deviceTypeID) {
|
||||||
AaroniaRTSAGui* gui = new AaroniaRTSAGui(deviceUISet);
|
AaroniaRTSAInputGui* gui = new AaroniaRTSAInputGui(deviceUISet);
|
||||||
*widget = gui;
|
*widget = gui;
|
||||||
return gui;
|
return gui;
|
||||||
} else {
|
} else {
|
||||||
@ -127,7 +126,7 @@ DeviceGUI* AaroniaRTSAPlugin::createSampleSourcePluginInstanceGUI(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
DeviceSampleSource *AaroniaRTSAPlugin::createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI)
|
DeviceSampleSource *AaroniaRTSAInputPlugin::createSampleSourcePluginInstance(const QString& sourceId, DeviceAPI *deviceAPI)
|
||||||
{
|
{
|
||||||
if (sourceId == m_deviceTypeID)
|
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) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// 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"
|
#define AARONIARTSA_DEVICE_TYPE_ID "sdrangel.samplesource.aaroniartsasource"
|
||||||
|
|
||||||
class AaroniaRTSAPlugin : public QObject, public PluginInterface {
|
class AaroniaRTSAInputPlugin : public QObject, public PluginInterface {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_INTERFACES(PluginInterface)
|
Q_INTERFACES(PluginInterface)
|
||||||
Q_PLUGIN_METADATA(IID AARONIARTSA_DEVICE_TYPE_ID)
|
Q_PLUGIN_METADATA(IID AARONIARTSA_DEVICE_TYPE_ID)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit AaroniaRTSAPlugin(QObject* parent = NULL);
|
explicit AaroniaRTSAInputPlugin(QObject* parent = NULL);
|
||||||
|
|
||||||
const PluginDescriptor& getPluginDescriptor() const;
|
const PluginDescriptor& getPluginDescriptor() const;
|
||||||
void initPlugin(PluginAPI* pluginAPI);
|
void initPlugin(PluginAPI* pluginAPI);
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -17,14 +16,14 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "util/simpleserializer.h"
|
#include "util/simpleserializer.h"
|
||||||
#include "aaroniartsasettings.h"
|
#include "aaroniartsainputsettings.h"
|
||||||
|
|
||||||
AaroniaRTSASettings::AaroniaRTSASettings()
|
AaroniaRTSAInputSettings::AaroniaRTSAInputSettings()
|
||||||
{
|
{
|
||||||
resetToDefaults();
|
resetToDefaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSASettings::resetToDefaults()
|
void AaroniaRTSAInputSettings::resetToDefaults()
|
||||||
{
|
{
|
||||||
m_centerFrequency = 1450000;
|
m_centerFrequency = 1450000;
|
||||||
m_sampleRate = 200000;
|
m_sampleRate = 200000;
|
||||||
@ -35,7 +34,7 @@ void AaroniaRTSASettings::resetToDefaults()
|
|||||||
m_reverseAPIDeviceIndex = 0;
|
m_reverseAPIDeviceIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
QByteArray AaroniaRTSASettings::serialize() const
|
QByteArray AaroniaRTSAInputSettings::serialize() const
|
||||||
{
|
{
|
||||||
SimpleSerializer s(2);
|
SimpleSerializer s(2);
|
||||||
|
|
||||||
@ -49,7 +48,7 @@ QByteArray AaroniaRTSASettings::serialize() const
|
|||||||
return s.final();
|
return s.final();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AaroniaRTSASettings::deserialize(const QByteArray& data)
|
bool AaroniaRTSAInputSettings::deserialize(const QByteArray& data)
|
||||||
{
|
{
|
||||||
SimpleDeserializer d(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")) {
|
if (settingsKeys.contains("centerFrequency")) {
|
||||||
m_centerFrequency = settings.m_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;
|
std::ostringstream ostr;
|
||||||
|
|
@ -1,6 +1,5 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
// Copyright (C) 2019 Vort //
|
// Copyright (C) 2023 Edouard Griffiths, F4EXB //
|
||||||
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
|
|
||||||
// //
|
// //
|
||||||
// This program is free software; you can redistribute it and/or modify //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -22,7 +21,7 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
|
|
||||||
struct AaroniaRTSASettings {
|
struct AaroniaRTSAInputSettings {
|
||||||
|
|
||||||
enum ConnectionStatus
|
enum ConnectionStatus
|
||||||
{
|
{
|
||||||
@ -42,11 +41,11 @@ struct AaroniaRTSASettings {
|
|||||||
uint16_t m_reverseAPIPort;
|
uint16_t m_reverseAPIPort;
|
||||||
uint16_t m_reverseAPIDeviceIndex;
|
uint16_t m_reverseAPIDeviceIndex;
|
||||||
|
|
||||||
AaroniaRTSASettings();
|
AaroniaRTSAInputSettings();
|
||||||
void resetToDefaults();
|
void resetToDefaults();
|
||||||
QByteArray serialize() const;
|
QByteArray serialize() const;
|
||||||
bool deserialize(const QByteArray& data);
|
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;
|
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 //
|
// Implementation of static web API adapters used for preset serialization and //
|
||||||
// deserialization //
|
// deserialization //
|
||||||
@ -20,15 +20,15 @@
|
|||||||
|
|
||||||
#include "SWGDeviceSettings.h"
|
#include "SWGDeviceSettings.h"
|
||||||
#include "aaroniartsainput.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,
|
SWGSDRangel::SWGDeviceSettings& response,
|
||||||
QString& errorMessage)
|
QString& errorMessage)
|
||||||
{
|
{
|
||||||
@ -39,7 +39,7 @@ int AaroniaRTSAWebAPIAdapter::webapiSettingsGet(
|
|||||||
return 200;
|
return 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AaroniaRTSAWebAPIAdapter::webapiSettingsPutPatch(
|
int AaroniaRTSAInputWebAPIAdapter::webapiSettingsPutPatch(
|
||||||
bool force,
|
bool force,
|
||||||
const QStringList& deviceSettingsKeys,
|
const QStringList& deviceSettingsKeys,
|
||||||
SWGSDRangel::SWGDeviceSettings& response, // query + response
|
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 //
|
// Implementation of static web API adapters used for preset serialization and //
|
||||||
// deserialization //
|
// deserialization //
|
||||||
@ -19,13 +19,13 @@
|
|||||||
///////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#include "device/devicewebapiadapter.h"
|
#include "device/devicewebapiadapter.h"
|
||||||
#include "aaroniartsasettings.h"
|
#include "aaroniartsainputsettings.h"
|
||||||
|
|
||||||
class AaroniaRTSAWebAPIAdapter : public DeviceWebAPIAdapter
|
class AaroniaRTSAInputWebAPIAdapter : public DeviceWebAPIAdapter
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AaroniaRTSAWebAPIAdapter();
|
AaroniaRTSAInputWebAPIAdapter();
|
||||||
virtual ~AaroniaRTSAWebAPIAdapter();
|
virtual ~AaroniaRTSAInputWebAPIAdapter();
|
||||||
virtual QByteArray serialize() { return m_settings.serialize(); }
|
virtual QByteArray serialize() { return m_settings.serialize(); }
|
||||||
virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); }
|
virtual bool deserialize(const QByteArray& data) { return m_settings.deserialize(data); }
|
||||||
|
|
||||||
@ -40,5 +40,5 @@ public:
|
|||||||
QString& errorMessage);
|
QString& errorMessage);
|
||||||
|
|
||||||
private:
|
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 //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -24,12 +24,12 @@
|
|||||||
#include "util/messagequeue.h"
|
#include "util/messagequeue.h"
|
||||||
#include "dsp/dspcommands.h"
|
#include "dsp/dspcommands.h"
|
||||||
|
|
||||||
#include "aaroniartsasettings.h"
|
#include "aaroniartsainputsettings.h"
|
||||||
#include "aaroniartsaworker.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(),
|
QObject(),
|
||||||
m_timer(this),
|
m_timer(this),
|
||||||
m_samplesBuf(),
|
m_samplesBuf(),
|
||||||
@ -37,7 +37,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) :
|
|||||||
m_centerFrequency(0),
|
m_centerFrequency(0),
|
||||||
m_sampleRate(1),
|
m_sampleRate(1),
|
||||||
m_inputMessageQueue(nullptr),
|
m_inputMessageQueue(nullptr),
|
||||||
m_status(AaroniaRTSASettings::ConnectionIdle),
|
m_status(AaroniaRTSAInputSettings::ConnectionIdle),
|
||||||
mReply(nullptr),
|
mReply(nullptr),
|
||||||
m_convertBuffer(64e6)
|
m_convertBuffer(64e6)
|
||||||
{
|
{
|
||||||
@ -48,7 +48,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) :
|
|||||||
m_networkAccessManagerConfig,
|
m_networkAccessManagerConfig,
|
||||||
&QNetworkAccessManager::finished,
|
&QNetworkAccessManager::finished,
|
||||||
this,
|
this,
|
||||||
&AaroniaRTSAWorker::handleConfigReply
|
&AaroniaRTSAInputWorker::handleConfigReply
|
||||||
);
|
);
|
||||||
|
|
||||||
// Request 16bit raw samples
|
// Request 16bit raw samples
|
||||||
@ -67,7 +67,7 @@ AaroniaRTSAWorker::AaroniaRTSAWorker(SampleSinkFifo* sampleFifo) :
|
|||||||
mPacketSamples = 0;
|
mPacketSamples = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AaroniaRTSAWorker::~AaroniaRTSAWorker()
|
AaroniaRTSAInputWorker::~AaroniaRTSAInputWorker()
|
||||||
{
|
{
|
||||||
if (mReply)
|
if (mReply)
|
||||||
{
|
{
|
||||||
@ -86,25 +86,25 @@ AaroniaRTSAWorker::~AaroniaRTSAWorker()
|
|||||||
m_networkAccessManagerConfig,
|
m_networkAccessManagerConfig,
|
||||||
&QNetworkAccessManager::finished,
|
&QNetworkAccessManager::finished,
|
||||||
this,
|
this,
|
||||||
&AaroniaRTSAWorker::handleConfigReply
|
&AaroniaRTSAInputWorker::handleConfigReply
|
||||||
);
|
);
|
||||||
m_networkAccessManagerConfig->deleteLater();
|
m_networkAccessManagerConfig->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::onSocketError(QAbstractSocket::SocketError error)
|
void AaroniaRTSAInputWorker::onSocketError(QAbstractSocket::SocketError error)
|
||||||
{
|
{
|
||||||
(void) error;
|
(void) error;
|
||||||
m_status = AaroniaRTSASettings::ConnectionError;
|
m_status = AaroniaRTSAInputSettings::ConnectionError;
|
||||||
emit updateStatus(m_status);
|
emit updateStatus(m_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate()
|
void AaroniaRTSAInputWorker::sendCenterFrequencyAndSampleRate()
|
||||||
{
|
{
|
||||||
if (m_iqDemodName.size() == 0) {
|
if (m_iqDemodName.size() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qDebug("AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate: %llu samplerate: %d", m_centerFrequency, m_sampleRate);
|
qDebug("AaroniaRTSAInputWorker::sendCenterFrequencyAndSampleRate: %llu samplerate: %d", m_centerFrequency, m_sampleRate);
|
||||||
|
|
||||||
QJsonObject object {
|
QJsonObject object {
|
||||||
{"receiverName", m_iqDemodName},
|
{"receiverName", m_iqDemodName},
|
||||||
@ -125,14 +125,14 @@ void AaroniaRTSAWorker::sendCenterFrequencyAndSampleRate()
|
|||||||
m_networkAccessManagerConfig->put(request, document.toJson());
|
m_networkAccessManagerConfig->put(request, document.toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::getConfig()
|
void AaroniaRTSAInputWorker::getConfig()
|
||||||
{
|
{
|
||||||
QUrl url(tr("http://%1/remoteconfig").arg(m_serverAddress));
|
QUrl url(tr("http://%1/remoteconfig").arg(m_serverAddress));
|
||||||
QNetworkRequest request(url);
|
QNetworkRequest request(url);
|
||||||
m_networkAccessManagerConfig->get(request);
|
m_networkAccessManagerConfig->get(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::onCenterFrequencyChanged(quint64 centerFrequency)
|
void AaroniaRTSAInputWorker::onCenterFrequencyChanged(quint64 centerFrequency)
|
||||||
{
|
{
|
||||||
if (m_centerFrequency == centerFrequency) {
|
if (m_centerFrequency == centerFrequency) {
|
||||||
return;
|
return;
|
||||||
@ -142,7 +142,7 @@ void AaroniaRTSAWorker::onCenterFrequencyChanged(quint64 centerFrequency)
|
|||||||
sendCenterFrequencyAndSampleRate();
|
sendCenterFrequencyAndSampleRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::onSampleRateChanged(int sampleRate)
|
void AaroniaRTSAInputWorker::onSampleRateChanged(int sampleRate)
|
||||||
{
|
{
|
||||||
if (m_sampleRate == sampleRate) {
|
if (m_sampleRate == sampleRate) {
|
||||||
return;
|
return;
|
||||||
@ -152,9 +152,9 @@ void AaroniaRTSAWorker::onSampleRateChanged(int sampleRate)
|
|||||||
sendCenterFrequencyAndSampleRate();
|
sendCenterFrequencyAndSampleRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::onServerAddressChanged(QString serverAddress)
|
void AaroniaRTSAInputWorker::onServerAddressChanged(QString serverAddress)
|
||||||
{
|
{
|
||||||
m_status = AaroniaRTSASettings::ConnectionDisconnected;
|
m_status = AaroniaRTSAInputSettings::ConnectionDisconnected;
|
||||||
updateStatus(m_status);
|
updateStatus(m_status);
|
||||||
|
|
||||||
if (mReply)
|
if (mReply)
|
||||||
@ -184,34 +184,34 @@ void AaroniaRTSAWorker::onServerAddressChanged(QString serverAddress)
|
|||||||
getConfig();
|
getConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::tick()
|
void AaroniaRTSAInputWorker::tick()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************CPY ********************************* */
|
/**************************CPY ********************************* */
|
||||||
|
|
||||||
void AaroniaRTSAWorker::onError(QNetworkReply::NetworkError code)
|
void AaroniaRTSAInputWorker::onError(QNetworkReply::NetworkError code)
|
||||||
{
|
{
|
||||||
(void) code;
|
(void) code;
|
||||||
qWarning() << "AaroniaRTSAWorker::onError: network Error: " << mReply->errorString();
|
qWarning() << "AaroniaRTSAInputWorker::onError: network Error: " << mReply->errorString();
|
||||||
m_status = 3;
|
m_status = 3;
|
||||||
emit updateStatus(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());
|
mBuffer.append(mReply->readAll());
|
||||||
mReply->deleteLater();
|
mReply->deleteLater();
|
||||||
mReply = nullptr;
|
mReply = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// bytes received from the socket
|
// 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);
|
emit updateStatus(m_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,16 +291,16 @@ void AaroniaRTSAWorker::onReadyRead()
|
|||||||
// Dump packet loss
|
// Dump packet loss
|
||||||
// if (startTime != mPrevTime)
|
// if (startTime != mPrevTime)
|
||||||
// {
|
// {
|
||||||
// qDebug() << "AaroniaRTSAWorker::onReadyRead: packet loss: "
|
// qDebug() << "AaroniaRTSAInputWorker::onReadyRead: packet loss: "
|
||||||
// << QDateTime::fromMSecsSinceEpoch(startTime * 1000).toString()
|
// << QDateTime::fromMSecsSinceEpoch(startTime * 1000).toString()
|
||||||
// << " D " << endTime - startTime
|
// << " D " << endTime - startTime
|
||||||
// << " O " << startTime - mPrevTime
|
// << " O " << startTime - mPrevTime
|
||||||
// << " S " << samples
|
// << " S " << samples
|
||||||
// << " L " << QDateTime::currentMSecsSinceEpoch() / 1000.0 - startTime;
|
// << " 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);
|
// emit updateStatus(m_status);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
@ -344,7 +344,7 @@ void AaroniaRTSAWorker::onReadyRead()
|
|||||||
mBuffer.remove(0, offset);
|
mBuffer.remove(0, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::handleConfigReply(QNetworkReply* reply)
|
void AaroniaRTSAInputWorker::handleConfigReply(QNetworkReply* reply)
|
||||||
{
|
{
|
||||||
if (reply->operation() == QNetworkAccessManager::GetOperation) // return from GET to /remoteconfig
|
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();
|
int httpStatusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
||||||
|
|
||||||
if ((httpStatusCode / 100) == 2) {
|
if ((httpStatusCode / 100) == 2) {
|
||||||
qDebug("AaroniaRTSAWorker::handleConfigReply: remoteconfig OK (%d)", httpStatusCode);
|
qDebug("AaroniaRTSAInputWorker::handleConfigReply: remoteconfig OK (%d)", httpStatusCode);
|
||||||
} else {
|
} else {
|
||||||
qWarning("AaroniaRTSAWorker::handleConfigReply: remoteconfig ended with error (%d)", httpStatusCode);
|
qWarning("AaroniaRTSAInputWorker::handleConfigReply: remoteconfig ended with error (%d)", httpStatusCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reply->deleteLater();
|
reply->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AaroniaRTSAWorker::parseConfig(QByteArray bytes)
|
void AaroniaRTSAInputWorker::parseConfig(QByteArray bytes)
|
||||||
{
|
{
|
||||||
QJsonDocument document = QJsonDocument::fromJson(bytes);
|
QJsonDocument document = QJsonDocument::fromJson(bytes);
|
||||||
m_iqDemodName = "";
|
m_iqDemodName = "";
|
||||||
@ -399,25 +399,24 @@ void AaroniaRTSAWorker::parseConfig(QByteArray bytes)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "AaroniaRTSAWorker::parseConfig: config has no items: " << config;
|
qDebug() << "AaroniaRTSAInputWorker::parseConfig: config has no items: " << config;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "AaroniaRTSAWorker::parseConfig: document has no config obhect: " << documentObject;
|
qDebug() << "AaroniaRTSAInputWorker::parseConfig: document has no config obhect: " << documentObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qDebug() << "AaroniaRTSAWorker::parseConfig: Document is not an object: " << document;
|
qDebug() << "AaroniaRTSAInputWorker::parseConfig: Document is not an object: " << document;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_iqDemodName == "") {
|
if (m_iqDemodName == "") {
|
||||||
qWarning("AaroniaRTSAWorker.parseConfig: could not find IQ demdulator");
|
qWarning("AaroniaRTSAInputWorker.parseConfig: could not find IQ demdulator");
|
||||||
} else {
|
} 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 //
|
// 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 //
|
// it under the terms of the GNU General Public License as published by //
|
||||||
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
class MessageQueue;
|
class MessageQueue;
|
||||||
|
|
||||||
class AaroniaRTSAWorker : public QObject {
|
class AaroniaRTSAInputWorker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -62,8 +62,8 @@ public:
|
|||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
AaroniaRTSAWorker(SampleSinkFifo* sampleFifo);
|
AaroniaRTSAInputWorker(SampleSinkFifo* sampleFifo);
|
||||||
~AaroniaRTSAWorker();
|
~AaroniaRTSAInputWorker();
|
||||||
int getStatus() const { return m_status; }
|
int getStatus() const { return m_status; }
|
||||||
void setInputMessageQueue(MessageQueue *messageQueue) { m_inputMessageQueue = messageQueue; }
|
void setInputMessageQueue(MessageQueue *messageQueue) { m_inputMessageQueue = messageQueue; }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user