From 1168eefcc994a535e750c446d0347e415f4a74c5 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 12 Dec 2021 19:54:57 +0100 Subject: [PATCH] Remote Source: use fixed sample rate set to baseband sample rate. Remote Output: use sample rate from remote --- .../remotesource/remotesourcesource.cpp | 41 --------- .../remotesource/remotesourcesource.h | 7 -- .../samplesink/remoteoutput/remoteoutput.cpp | 80 +++++++++-------- .../samplesink/remoteoutput/remoteoutput.h | 3 + .../remoteoutput/remoteoutputgui.cpp | 28 +++--- .../samplesink/remoteoutput/remoteoutputgui.h | 2 +- .../remoteoutput/remoteoutputgui.ui | 85 ++++--------------- .../remoteoutput/remoteoutputsettings.cpp | 3 - .../remoteoutput/remoteoutputsettings.h | 1 - sdrbase/resources/webapi/doc/html2/index.html | 8 +- .../doc/swagger/include/RemoteOutput.yaml | 4 +- .../api/swagger/include/RemoteOutput.yaml | 4 +- swagger/sdrangel/code/html2/index.html | 8 +- .../code/qt5/client/SWGRemoteOutputReport.cpp | 23 +++++ .../code/qt5/client/SWGRemoteOutputReport.h | 6 ++ .../qt5/client/SWGRemoteOutputSettings.cpp | 23 ----- .../code/qt5/client/SWGRemoteOutputSettings.h | 6 -- 17 files changed, 120 insertions(+), 212 deletions(-) diff --git a/plugins/channeltx/remotesource/remotesourcesource.cpp b/plugins/channeltx/remotesource/remotesourcesource.cpp index 7458320cc..a25172de2 100644 --- a/plugins/channeltx/remotesource/remotesourcesource.cpp +++ b/plugins/channeltx/remotesource/remotesourcesource.cpp @@ -54,36 +54,6 @@ void RemoteSourceSource::pull(SampleVector::iterator begin, unsigned int nbSampl void RemoteSourceSource::pullOne(Sample& sample) { m_dataReadQueue.readSample(sample, true); // true is scale for Tx - return; - - Complex ci; - - if (m_interpolatorDistance > 1.0f) // decimate - { - getSample(); - - while (!m_interpolator.decimate(&m_interpolatorDistanceRemain, m_modSample, &ci)) { - getSample(); - } - } - else - { - if (m_interpolator.interpolate(&m_interpolatorDistanceRemain, m_modSample, &ci)) { - getSample(); - } - } - - m_interpolatorDistanceRemain += m_interpolatorDistance; - sample.m_real = (FixReal) ci.real(); - sample.m_imag = (FixReal) ci.imag(); -} - -void RemoteSourceSource::getSample() -{ - Sample s; - m_dataReadQueue.readSample(s, true); // true is scale for Tx - m_modSample.real(s.m_real); - m_modSample.imag(s.m_imag); } void RemoteSourceSource::start() @@ -267,17 +237,6 @@ void RemoteSourceSource::applyChannelSettings(int channelSampleRate, bool force) { qDebug() << "RemoteSourceSource::applyChannelSettings:" << " channelSampleRate: " << channelSampleRate - << " m_currentMeta.m_sampleRate: " << m_currentMeta.m_sampleRate << " force: " << force; - - if ((channelSampleRate != m_channelSampleRate) || force) - { - uint32_t metaSampleRate = m_currentMeta.m_sampleRate == 0 ? channelSampleRate : m_currentMeta.m_sampleRate; - m_interpolatorDistanceRemain = 0; - m_interpolatorConsumed = false; - m_interpolatorDistance = (Real) metaSampleRate / (Real) channelSampleRate; - m_interpolator.create(48, metaSampleRate, metaSampleRate / 2.2, 3.0); - } - m_channelSampleRate = channelSampleRate; } diff --git a/plugins/channeltx/remotesource/remotesourcesource.h b/plugins/channeltx/remotesource/remotesourcesource.h index 637144bb4..6d23d217f 100644 --- a/plugins/channeltx/remotesource/remotesourcesource.h +++ b/plugins/channeltx/remotesource/remotesourcesource.h @@ -24,7 +24,6 @@ #include "cm256cc/cm256.h" #include "dsp/channelsamplesource.h" -#include "dsp/interpolator.h" #include "channel/remotedatablock.h" #include "channel/remotedataqueue.h" #include "channel/remotedatareadqueue.h" @@ -72,17 +71,11 @@ private: uint32_t m_nbUncorrectableErrors; //!< count of uncorrectable errors in number of blocks int m_channelSampleRate; - Interpolator m_interpolator; - Real m_interpolatorDistance; - Real m_interpolatorDistanceRemain; - bool m_interpolatorConsumed; - Complex m_modSample; void startWorker(); void stopWorker(); void handleDataFrame(RemoteDataFrame *dataFrame); void printMeta(const QString& header, RemoteMetaDataFEC *metaData); - void getSample(); private slots: void handleData(); diff --git a/plugins/samplesink/remoteoutput/remoteoutput.cpp b/plugins/samplesink/remoteoutput/remoteoutput.cpp index cc6e6c17e..b5742ddd2 100644 --- a/plugins/samplesink/remoteoutput/remoteoutput.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutput.cpp @@ -51,7 +51,8 @@ const uint32_t RemoteOutput::NbSamplesForRateCorrection = 5000000; RemoteOutput::RemoteOutput(DeviceAPI *deviceAPI) : m_deviceAPI(deviceAPI), m_settings(), - m_centerFrequency(0), + m_centerFrequency(435000000), + m_sampleRate(48000), m_remoteOutputWorker(nullptr), m_deviceDescription("RemoteOutput"), m_startingTimeStamp(0), @@ -72,6 +73,8 @@ RemoteOutput::RemoteOutput(DeviceAPI *deviceAPI) : m_networkManager = new QNetworkAccessManager(); connect(m_networkManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(networkManagerFinished(QNetworkReply*))); connect(&m_masterTimer, SIGNAL(timeout()), this, SLOT(tick())); + applyCenterFrequency(); + applySampleRate(); } RemoteOutput::~RemoteOutput() @@ -94,7 +97,7 @@ bool RemoteOutput::start() m_remoteOutputWorker = new RemoteOutputWorker(&m_sampleSourceFifo); m_remoteOutputWorker->moveToThread(&m_remoteOutputWorkerThread); m_remoteOutputWorker->setDataAddress(m_settings.m_dataAddress, m_settings.m_dataPort); - m_remoteOutputWorker->setSamplerate(m_settings.m_sampleRate); + m_remoteOutputWorker->setSamplerate(m_sampleRate); m_remoteOutputWorker->setNbBlocksFEC(m_settings.m_nbFECBlocks); m_remoteOutputWorker->connectTimer(m_masterTimer); startWorker(); @@ -177,7 +180,7 @@ const QString& RemoteOutput::getDeviceDescription() const int RemoteOutput::getSampleRate() const { - return m_settings.m_sampleRate; + return m_sampleRate; } quint64 RemoteOutput::getCenterFrequency() const @@ -270,7 +273,6 @@ bool RemoteOutput::handleMessage(const Message& message) void RemoteOutput::applySettings(const RemoteOutputSettings& settings, bool force) { QMutexLocker mutexLocker(&m_mutex); - bool forwardChange = false; QList reverseAPIKeys; if ((m_settings.m_dataAddress != settings.m_dataAddress) || force) { @@ -293,20 +295,6 @@ void RemoteOutput::applySettings(const RemoteOutputSettings& settings, bool forc } } - if (force || (m_settings.m_sampleRate != settings.m_sampleRate)) - { - reverseAPIKeys.append("sampleRate"); - - if (m_remoteOutputWorker != 0) { - m_remoteOutputWorker->setSamplerate(settings.m_sampleRate); - } - - m_tickMultiplier = (21*NbSamplesForRateCorrection) / (2*settings.m_sampleRate); // two times per sample filling period plus small extension - m_tickMultiplier /= 20; // greter tick (one per second) - m_tickMultiplier = m_tickMultiplier < 1 ? 1 : m_tickMultiplier; // not below 1 second - forwardChange = true; - } - if (force || (m_settings.m_nbFECBlocks != settings.m_nbFECBlocks)) { reverseAPIKeys.append("nbFECBlocks"); @@ -319,19 +307,12 @@ void RemoteOutput::applySettings(const RemoteOutputSettings& settings, bool forc mutexLocker.unlock(); qDebug() << "RemoteOutput::applySettings:" - << " m_sampleRate: " << settings.m_sampleRate << " m_nbFECBlocks: " << settings.m_nbFECBlocks << " m_apiAddress: " << settings.m_apiAddress << " m_apiPort: " << settings.m_apiPort << " m_dataAddress: " << settings.m_dataAddress << " m_dataPort: " << settings.m_dataPort; - if (forwardChange) - { - DSPSignalNotification *notif = new DSPSignalNotification(settings.m_sampleRate, m_centerFrequency); - m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif); - } - if (settings.m_useReverseAPI) { bool fullUpdate = ((m_settings.m_useReverseAPI != settings.m_useReverseAPI) && settings.m_useReverseAPI) || @@ -344,6 +325,26 @@ void RemoteOutput::applySettings(const RemoteOutputSettings& settings, bool forc m_settings = settings; } +void RemoteOutput::applyCenterFrequency() +{ + DSPSignalNotification *notif = new DSPSignalNotification(m_sampleRate, m_centerFrequency); + m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif); +} + +void RemoteOutput::applySampleRate() +{ + if (m_remoteOutputWorker) { + m_remoteOutputWorker->setSamplerate(m_sampleRate); + } + + m_tickMultiplier = (21*NbSamplesForRateCorrection) / (2*m_sampleRate); // two times per sample filling period plus small extension + m_tickMultiplier /= 20; // greter tick (one per second) + m_tickMultiplier = m_tickMultiplier < 1 ? 1 : m_tickMultiplier; // not below 1 second + + DSPSignalNotification *notif = new DSPSignalNotification(m_sampleRate, m_centerFrequency); + m_deviceAPI->getDeviceEngineInputMessageQueue()->push(notif); +} + int RemoteOutput::webapiRunGet( SWGSDRangel::SWGDeviceState& response, QString& errorMessage) @@ -411,9 +412,6 @@ void RemoteOutput::webapiUpdateDeviceSettings( const QStringList& deviceSettingsKeys, SWGSDRangel::SWGDeviceSettings& response) { - if (deviceSettingsKeys.contains("sampleRate")) { - settings.m_sampleRate = response.getRemoteOutputSettings()->getSampleRate(); - } if (deviceSettingsKeys.contains("nbFECBlocks")) { settings.m_nbFECBlocks = response.getRemoteOutputSettings()->getNbFecBlocks(); } @@ -462,7 +460,6 @@ int RemoteOutput::webapiReportGet( void RemoteOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RemoteOutputSettings& settings) { - response.getRemoteOutputSettings()->setSampleRate(settings.m_sampleRate); response.getRemoteOutputSettings()->setNbFecBlocks(settings.m_nbFECBlocks); response.getRemoteOutputSettings()->setApiAddress(new QString(settings.m_apiAddress)); response.getRemoteOutputSettings()->setApiPort(settings.m_apiPort); @@ -485,6 +482,7 @@ void RemoteOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re void RemoteOutput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { response.getRemoteOutputReport()->setCenterFrequency(m_centerFrequency); + response.getRemoteOutputReport()->setSampleRate(m_sampleRate); response.getRemoteOutputReport()->setBufferRwBalance(m_sampleSourceFifo.getRWBalance()); response.getRemoteOutputReport()->setSampleCount(m_remoteOutputWorker ? (int) m_remoteOutputWorker->getSamplesCount() : 0); } @@ -550,8 +548,25 @@ void RemoteOutput::analyzeApiReply(const QJsonObject& jsonObject, const QString& { MsgReportRemoteData::RemoteData msgRemoteData; QJsonObject report = jsonObject["RemoteSourceReport"].toObject(); - m_centerFrequency = report["deviceCenterFreq"].toInt(); + uint64_t centerFrequency = report["deviceCenterFreq"].toInt(); + + if (centerFrequency != m_centerFrequency) + { + m_centerFrequency = centerFrequency; + applyCenterFrequency(); + } + + int remoteRate = report["deviceSampleRate"].toInt(); + + if (remoteRate != m_sampleRate) + { + m_sampleRate = remoteRate; + applySampleRate(); + } + msgRemoteData.m_centerFrequency = m_centerFrequency; + msgRemoteData.m_sampleRate = m_sampleRate; + int queueSize = report["queueSize"].toInt(); queueSize = queueSize == 0 ? 20 : queueSize; msgRemoteData.m_queueSize = queueSize; @@ -563,8 +578,6 @@ void RemoteOutput::analyzeApiReply(const QJsonObject& jsonObject, const QString& int intRemoteSampleCount = report["samplesCount"].toInt(); uint32_t remoteSampleCount = intRemoteSampleCount < 0 ? 0 : intRemoteSampleCount; msgRemoteData.m_sampleCount = remoteSampleCount; - int remoteRate = report["deviceSampleRate"].toInt(); - msgRemoteData.m_sampleRate = remoteRate; int unrecoverableCount = report["uncorrectableErrorsCount"].toInt(); msgRemoteData.m_unrecoverableCount = unrecoverableCount; int recoverableCount = report["correctableErrorsCount"].toInt(); @@ -696,9 +709,6 @@ void RemoteOutput::webapiReverseSendSettings(QList& deviceSettingsKeys, // transfer data that has been modified. When force is on transfer all data except reverse API data - if (deviceSettingsKeys.contains("sampleRate") || force) { - swgRemoteOutputSettings->setSampleRate(settings.m_sampleRate); - } if (deviceSettingsKeys.contains("nbFECBlocks") || force) { swgRemoteOutputSettings->setNbFecBlocks(settings.m_nbFECBlocks); } diff --git a/plugins/samplesink/remoteoutput/remoteoutput.h b/plugins/samplesink/remoteoutput/remoteoutput.h index 4ce97a2bc..1fbe5aaad 100644 --- a/plugins/samplesink/remoteoutput/remoteoutput.h +++ b/plugins/samplesink/remoteoutput/remoteoutput.h @@ -275,6 +275,7 @@ private: QMutex m_mutex; RemoteOutputSettings m_settings; uint64_t m_centerFrequency; + int m_sampleRate; RemoteOutputWorker* m_remoteOutputWorker; QThread m_remoteOutputWorkerThread; QString m_deviceDescription; @@ -300,6 +301,8 @@ private: void startWorker(); void stopWorker(); void applySettings(const RemoteOutputSettings& settings, bool force = false); + void applyCenterFrequency(); + void applySampleRate(); void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response); void analyzeApiReply(const QJsonObject& jsonObject, const QString& answer); diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp index 13e8ac835..0e011c194 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp @@ -55,7 +55,8 @@ RemoteOutputSinkGui::RemoteOutputSinkGui(DeviceUISet *deviceUISet, QWidget* pare m_nbSinceLastFlowCheck(0), m_lastEngineState(DeviceAPI::StNotStarted), m_doApplySettings(true), - m_forceSettings(true) + m_forceSettings(true), + m_remoteAPIConnected(false) { m_countUnrecoverable = 0; m_countRecovered = 0; @@ -69,11 +70,6 @@ RemoteOutputSinkGui::RemoteOutputSinkGui(DeviceUISet *deviceUISet, QWidget* pare ui->setupUi(this); - ui->sampleRate->setColorMapper(ColorMapper(ColorMapper::GrayGreenYellow)); - ui->sampleRate->setValueRange(7, 32000U, 9000000U); - - ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); - connect(&(m_deviceUISet->m_deviceAPI->getMasterTimer()), SIGNAL(timeout()), this, SLOT(tick())); connect(&m_updateTimer, SIGNAL(timeout()), this, SLOT(updateHardware())); connect(&m_statusTimer, SIGNAL(timeout()), this, SLOT(updateStatus())); @@ -215,7 +211,6 @@ void RemoteOutputSinkGui::displaySettings() { blockApplySettings(true); ui->centerFrequency->setText(QString("%L1").arg(m_deviceCenterFrequency)); - ui->sampleRate->setValue(m_settings.m_sampleRate); ui->nbFECBlocks->setValue(m_settings.m_nbFECBlocks); QString s0 = QString::number(128 + m_settings.m_nbFECBlocks, 'f', 0); @@ -276,12 +271,6 @@ void RemoteOutputSinkGui::updateStatus() } } -void RemoteOutputSinkGui::on_sampleRate_changed(quint64 value) -{ - m_settings.m_sampleRate = value; - sendSettings(); -} - void RemoteOutputSinkGui::on_nbFECBlocks_valueChanged(int value) { m_settings.m_nbFECBlocks = value; @@ -457,6 +446,17 @@ void RemoteOutputSinkGui::displayEventTimer() void RemoteOutputSinkGui::tick() { + if (++m_tickCount == 20) + { + if (m_remoteAPIConnected) { + ui->apiAddressLabel->setStyleSheet("QLabel { background-color: green; }"); + } else { + ui->apiAddressLabel->setStyleSheet("QLabel { background:rgb(79,79,79); }"); + } + + m_remoteAPIConnected = false; + m_tickCount = 0; + } } void RemoteOutputSinkGui::displayRemoteData(const RemoteOutput::MsgReportRemoteData::RemoteData& remoteData) @@ -476,6 +476,7 @@ void RemoteOutputSinkGui::displayRemoteData(const RemoteOutput::MsgReportRemoteD m_countUnrecoverable += unrecoverableCountDelta; displayEventCounts(); displayEventTimer(); + m_remoteAPIConnected = true; uint32_t sampleCountDelta; @@ -509,6 +510,7 @@ void RemoteOutputSinkGui::displayRemoteFixedData(const RemoteOutput::MsgReportRe infoLine += " " + remoteData.m_architecture; infoLine += " " + remoteData.m_os; infoLine += QString(" %1/%2b").arg(remoteData.m_rxBits).arg(remoteData.m_txBits); + m_remoteAPIConnected = true; if (infoLine.size() > 0) { ui->infoText->setText(infoLine); diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.h b/plugins/samplesink/remoteoutput/remoteoutputgui.h index 071e879fc..af1bd8c78 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.h +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.h @@ -95,6 +95,7 @@ private: int m_lastEngineState; bool m_doApplySettings; bool m_forceSettings; + bool m_remoteAPIConnected; uint32_t m_countUnrecoverable; uint32_t m_countRecovered; @@ -125,7 +126,6 @@ private: private slots: void handleInputMessages(); - void on_sampleRate_changed(quint64 value); void on_nbFECBlocks_valueChanged(int value); void on_deviceIndex_returnPressed(); void on_channelIndex_returnPressed(); diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.ui b/plugins/samplesink/remoteoutput/remoteoutputgui.ui index 30ad1d696..9c2e5deea 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.ui +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.ui @@ -118,14 +118,14 @@ - 140 + 170 0 Liberation Sans - 14 + 16 @@ -188,68 +188,6 @@ 2 - - - - SR - - - - - - - - 0 - 0 - - - - - 32 - 16 - - - - - Liberation Mono - 12 - - - - PointingHandCursor - - - Remote device sample rate - - - - - - - S/s - - - - - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - @@ -302,6 +240,19 @@ + + + + Qt::Horizontal + + + + 40 + 20 + + + + @@ -754,12 +705,6 @@ - - ValueDial - QWidget -
gui/valuedial.h
- 1 -
ButtonSwitch QToolButton diff --git a/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp b/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp index a1598518a..e615e8672 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp @@ -25,7 +25,6 @@ RemoteOutputSettings::RemoteOutputSettings() void RemoteOutputSettings::resetToDefaults() { - m_sampleRate = 48000; m_nbFECBlocks = 0; m_apiAddress = "127.0.0.1"; m_apiPort = 9091; @@ -43,7 +42,6 @@ QByteArray RemoteOutputSettings::serialize() const { SimpleSerializer s(1); - s.writeU32(2, m_sampleRate); s.writeU32(4, m_nbFECBlocks); s.writeString(5, m_apiAddress); s.writeU32(6, m_apiPort); @@ -73,7 +71,6 @@ bool RemoteOutputSettings::deserialize(const QByteArray& data) { quint32 uintval; - d.readU32(2, &m_sampleRate, 48000); d.readU32(4, &m_nbFECBlocks, 0); d.readString(5, &m_apiAddress, "127.0.0.1"); d.readU32(6, &uintval, 9090); diff --git a/plugins/samplesink/remoteoutput/remoteoutputsettings.h b/plugins/samplesink/remoteoutput/remoteoutputsettings.h index d733cd6cd..cf61d20c0 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputsettings.h +++ b/plugins/samplesink/remoteoutput/remoteoutputsettings.h @@ -22,7 +22,6 @@ #include struct RemoteOutputSettings { - quint32 m_sampleRate; quint32 m_nbFECBlocks; QString m_apiAddress; quint16 m_apiPort; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index d5141889d..752aac43e 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -9824,6 +9824,9 @@ margin-bottom: 20px; "type" : "integer", "format" : "int64" }, + "sampleRate" : { + "type" : "integer" + }, "bufferRWBalance" : { "type" : "number", "format" : "float", @@ -9838,9 +9841,6 @@ margin-bottom: 20px; }; defs.RemoteOutputSettings = { "properties" : { - "sampleRate" : { - "type" : "integer" - }, "nbFECBlocks" : { "type" : "integer" }, @@ -51597,7 +51597,7 @@ except ApiException as e:
- Generated 2021-12-12T13:16:20.821+01:00 + Generated 2021-12-12T19:10:03.240+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml b/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml index f43917e81..44e917694 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml @@ -1,8 +1,6 @@ RemoteOutputSettings: description: RemoteOutput properties: - sampleRate: - type: integer nbFECBlocks: type: integer apiAddress: @@ -35,6 +33,8 @@ RemoteOutputReport: centerFrequency: type: integer format: int64 + sampleRate: + type: integer bufferRWBalance: description: ratio off the mid buffer (positive read leads) type: number diff --git a/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml b/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml index f43917e81..44e917694 100644 --- a/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml +++ b/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml @@ -1,8 +1,6 @@ RemoteOutputSettings: description: RemoteOutput properties: - sampleRate: - type: integer nbFECBlocks: type: integer apiAddress: @@ -35,6 +33,8 @@ RemoteOutputReport: centerFrequency: type: integer format: int64 + sampleRate: + type: integer bufferRWBalance: description: ratio off the mid buffer (positive read leads) type: number diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index d5141889d..752aac43e 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -9824,6 +9824,9 @@ margin-bottom: 20px; "type" : "integer", "format" : "int64" }, + "sampleRate" : { + "type" : "integer" + }, "bufferRWBalance" : { "type" : "number", "format" : "float", @@ -9838,9 +9841,6 @@ margin-bottom: 20px; }; defs.RemoteOutputSettings = { "properties" : { - "sampleRate" : { - "type" : "integer" - }, "nbFECBlocks" : { "type" : "integer" }, @@ -51597,7 +51597,7 @@ except ApiException as e:
- Generated 2021-12-12T13:16:20.821+01:00 + Generated 2021-12-12T19:10:03.240+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp index c5a921747..cc2df2a34 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp @@ -30,6 +30,8 @@ SWGRemoteOutputReport::SWGRemoteOutputReport(QString* json) { SWGRemoteOutputReport::SWGRemoteOutputReport() { center_frequency = 0L; m_center_frequency_isSet = false; + sample_rate = 0; + m_sample_rate_isSet = false; buffer_rw_balance = 0.0f; m_buffer_rw_balance_isSet = false; sample_count = 0; @@ -44,6 +46,8 @@ void SWGRemoteOutputReport::init() { center_frequency = 0L; m_center_frequency_isSet = false; + sample_rate = 0; + m_sample_rate_isSet = false; buffer_rw_balance = 0.0f; m_buffer_rw_balance_isSet = false; sample_count = 0; @@ -55,6 +59,7 @@ SWGRemoteOutputReport::cleanup() { + } SWGRemoteOutputReport* @@ -70,6 +75,8 @@ void SWGRemoteOutputReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", ""); + ::SWGSDRangel::setValue(&buffer_rw_balance, pJson["bufferRWBalance"], "float", ""); ::SWGSDRangel::setValue(&sample_count, pJson["sampleCount"], "qint32", ""); @@ -93,6 +100,9 @@ SWGRemoteOutputReport::asJsonObject() { if(m_center_frequency_isSet){ obj->insert("centerFrequency", QJsonValue(center_frequency)); } + if(m_sample_rate_isSet){ + obj->insert("sampleRate", QJsonValue(sample_rate)); + } if(m_buffer_rw_balance_isSet){ obj->insert("bufferRWBalance", QJsonValue(buffer_rw_balance)); } @@ -113,6 +123,16 @@ SWGRemoteOutputReport::setCenterFrequency(qint64 center_frequency) { this->m_center_frequency_isSet = true; } +qint32 +SWGRemoteOutputReport::getSampleRate() { + return sample_rate; +} +void +SWGRemoteOutputReport::setSampleRate(qint32 sample_rate) { + this->sample_rate = sample_rate; + this->m_sample_rate_isSet = true; +} + float SWGRemoteOutputReport::getBufferRwBalance() { return buffer_rw_balance; @@ -141,6 +161,9 @@ SWGRemoteOutputReport::isSet(){ if(m_center_frequency_isSet){ isObjectUpdated = true; break; } + if(m_sample_rate_isSet){ + isObjectUpdated = true; break; + } if(m_buffer_rw_balance_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h index 8513986ac..74665f179 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h @@ -44,6 +44,9 @@ public: qint64 getCenterFrequency(); void setCenterFrequency(qint64 center_frequency); + qint32 getSampleRate(); + void setSampleRate(qint32 sample_rate); + float getBufferRwBalance(); void setBufferRwBalance(float buffer_rw_balance); @@ -57,6 +60,9 @@ private: qint64 center_frequency; bool m_center_frequency_isSet; + qint32 sample_rate; + bool m_sample_rate_isSet; + float buffer_rw_balance; bool m_buffer_rw_balance_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.cpp index ebcc73744..64a4143a1 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.cpp @@ -28,8 +28,6 @@ SWGRemoteOutputSettings::SWGRemoteOutputSettings(QString* json) { } SWGRemoteOutputSettings::SWGRemoteOutputSettings() { - sample_rate = 0; - m_sample_rate_isSet = false; nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; api_address = nullptr; @@ -60,8 +58,6 @@ SWGRemoteOutputSettings::~SWGRemoteOutputSettings() { void SWGRemoteOutputSettings::init() { - sample_rate = 0; - m_sample_rate_isSet = false; nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; api_address = new QString(""); @@ -89,7 +85,6 @@ SWGRemoteOutputSettings::init() { void SWGRemoteOutputSettings::cleanup() { - if(api_address != nullptr) { delete api_address; } @@ -119,8 +114,6 @@ SWGRemoteOutputSettings::fromJson(QString &json) { void SWGRemoteOutputSettings::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", ""); - ::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", ""); ::SWGSDRangel::setValue(&api_address, pJson["apiAddress"], "QString", "QString"); @@ -159,9 +152,6 @@ SWGRemoteOutputSettings::asJson () QJsonObject* SWGRemoteOutputSettings::asJsonObject() { QJsonObject* obj = new QJsonObject(); - if(m_sample_rate_isSet){ - obj->insert("sampleRate", QJsonValue(sample_rate)); - } if(m_nb_fec_blocks_isSet){ obj->insert("nbFECBlocks", QJsonValue(nb_fec_blocks)); } @@ -199,16 +189,6 @@ SWGRemoteOutputSettings::asJsonObject() { return obj; } -qint32 -SWGRemoteOutputSettings::getSampleRate() { - return sample_rate; -} -void -SWGRemoteOutputSettings::setSampleRate(qint32 sample_rate) { - this->sample_rate = sample_rate; - this->m_sample_rate_isSet = true; -} - qint32 SWGRemoteOutputSettings::getNbFecBlocks() { return nb_fec_blocks; @@ -324,9 +304,6 @@ bool SWGRemoteOutputSettings::isSet(){ bool isObjectUpdated = false; do{ - if(m_sample_rate_isSet){ - isObjectUpdated = true; break; - } if(m_nb_fec_blocks_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h index 0aee8f0b2..f29c094bf 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h @@ -42,9 +42,6 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGRemoteOutputSettings* fromJson(QString &jsonString) override; - qint32 getSampleRate(); - void setSampleRate(qint32 sample_rate); - qint32 getNbFecBlocks(); void setNbFecBlocks(qint32 nb_fec_blocks); @@ -82,9 +79,6 @@ public: virtual bool isSet() override; private: - qint32 sample_rate; - bool m_sample_rate_isSet; - qint32 nb_fec_blocks; bool m_nb_fec_blocks_isSet;