diff --git a/plugins/channeltx/remotesource/remotesource.cpp b/plugins/channeltx/remotesource/remotesource.cpp index 2c410da9c..5dbc85caa 100644 --- a/plugins/channeltx/remotesource/remotesource.cpp +++ b/plugins/channeltx/remotesource/remotesource.cpp @@ -369,7 +369,7 @@ void RemoteSource::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& resp response.getRemoteSourceReport()->setNbFecBlocks(currentMeta.m_nbFECBlocks); response.getRemoteSourceReport()->setCenterFreq(currentMeta.m_centerFrequency); response.getRemoteSourceReport()->setSampleRate(currentMeta.m_sampleRate); - response.getRemoteSourceReport()->setDeviceCenterFreq(m_deviceAPI->getSampleSink()->getCenterFrequency()/1000); + response.getRemoteSourceReport()->setDeviceCenterFreq(m_deviceAPI->getSampleSink()->getCenterFrequency()); response.getRemoteSourceReport()->setDeviceSampleRate(m_deviceAPI->getSampleSink()->getSampleRate()); } diff --git a/plugins/samplesink/remoteoutput/remoteoutput.cpp b/plugins/samplesink/remoteoutput/remoteoutput.cpp index 50393200a..cc6e6c17e 100644 --- a/plugins/samplesink/remoteoutput/remoteoutput.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutput.cpp @@ -462,7 +462,6 @@ int RemoteOutput::webapiReportGet( void RemoteOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const RemoteOutputSettings& settings) { - response.getRemoteOutputSettings()->setCenterFrequency(settings.m_centerFrequency); response.getRemoteOutputSettings()->setSampleRate(settings.m_sampleRate); response.getRemoteOutputSettings()->setNbFecBlocks(settings.m_nbFECBlocks); response.getRemoteOutputSettings()->setApiAddress(new QString(settings.m_apiAddress)); @@ -485,6 +484,7 @@ void RemoteOutput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& re void RemoteOutput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response) { + response.getRemoteOutputReport()->setCenterFrequency(m_centerFrequency); response.getRemoteOutputReport()->setBufferRwBalance(m_sampleSourceFifo.getRWBalance()); response.getRemoteOutputReport()->setSampleCount(m_remoteOutputWorker ? (int) m_remoteOutputWorker->getSamplesCount() : 0); } @@ -550,8 +550,7 @@ void RemoteOutput::analyzeApiReply(const QJsonObject& jsonObject, const QString& { MsgReportRemoteData::RemoteData msgRemoteData; QJsonObject report = jsonObject["RemoteSourceReport"].toObject(); - m_settings.m_centerFrequency = report["deviceCenterFreq"].toInt(); - m_centerFrequency = m_settings.m_centerFrequency * 1000; + m_centerFrequency = report["deviceCenterFreq"].toInt(); msgRemoteData.m_centerFrequency = m_centerFrequency; int queueSize = report["queueSize"].toInt(); queueSize = queueSize == 0 ? 20 : queueSize; diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp index c48861a54..13e8ac835 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.cpp @@ -62,7 +62,6 @@ RemoteOutputSinkGui::RemoteOutputSinkGui(DeviceUISet *deviceUISet, QWidget* pare m_lastCountUnrecoverable = 0; m_lastCountRecovered = 0; m_lastSampleCount = 0; - m_resetCounts = true; m_paletteGreenText.setColor(QPalette::WindowText, Qt::green); m_paletteRedText.setColor(QPalette::WindowText, Qt::red); @@ -470,16 +469,13 @@ void RemoteOutputSinkGui::displayRemoteData(const RemoteOutput::MsgReportRemoteD ui->queueLengthText->setText(queueLengthText); int queueLengthPercent = (remoteData.m_queueLength*100)/remoteData.m_queueSize; ui->queueLengthGauge->setValue(queueLengthPercent); - - if (!m_resetCounts) - { - int recoverableCountDelta = remoteData.m_recoverableCount - m_lastCountRecovered; - int unrecoverableCountDelta = remoteData.m_unrecoverableCount - m_lastCountUnrecoverable; - displayEventStatus(recoverableCountDelta, unrecoverableCountDelta); - m_countRecovered += recoverableCountDelta; - m_countUnrecoverable += unrecoverableCountDelta; - displayEventCounts(); - } + int recoverableCountDelta = remoteData.m_recoverableCount - m_lastCountRecovered; + int unrecoverableCountDelta = remoteData.m_unrecoverableCount - m_lastCountUnrecoverable; + displayEventStatus(recoverableCountDelta, unrecoverableCountDelta); + m_countRecovered += recoverableCountDelta; + m_countUnrecoverable += unrecoverableCountDelta; + displayEventCounts(); + displayEventTimer(); uint32_t sampleCountDelta; @@ -500,7 +496,6 @@ void RemoteOutputSinkGui::displayRemoteData(const RemoteOutput::MsgReportRemoteD ui->remoteStreamRateText->setText(QString("%1").arg(remoteStreamRate, 0, 'f', 0)); } - m_resetCounts = false; m_lastCountRecovered = remoteData.m_recoverableCount; m_lastCountUnrecoverable = remoteData.m_unrecoverableCount; m_lastSampleCount = remoteData.m_sampleCount; diff --git a/plugins/samplesink/remoteoutput/remoteoutputgui.h b/plugins/samplesink/remoteoutput/remoteoutputgui.h index a60d400df..071e879fc 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputgui.h +++ b/plugins/samplesink/remoteoutput/remoteoutputgui.h @@ -102,7 +102,6 @@ private: uint32_t m_lastCountRecovered; uint32_t m_lastSampleCount; uint64_t m_lastTimestampUs; - bool m_resetCounts; QElapsedTimer m_time; QPalette m_paletteGreenText; diff --git a/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp b/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp index ddd2735b7..a1598518a 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp +++ b/plugins/samplesink/remoteoutput/remoteoutputsettings.cpp @@ -25,7 +25,6 @@ RemoteOutputSettings::RemoteOutputSettings() void RemoteOutputSettings::resetToDefaults() { - m_centerFrequency = 435000*1000; m_sampleRate = 48000; m_nbFECBlocks = 0; m_apiAddress = "127.0.0.1"; @@ -44,7 +43,6 @@ QByteArray RemoteOutputSettings::serialize() const { SimpleSerializer s(1); - s.writeU64(1, m_centerFrequency); s.writeU32(2, m_sampleRate); s.writeU32(4, m_nbFECBlocks); s.writeString(5, m_apiAddress); @@ -75,7 +73,6 @@ bool RemoteOutputSettings::deserialize(const QByteArray& data) { quint32 uintval; - d.readU64(1, &m_centerFrequency, 435000*1000); d.readU32(2, &m_sampleRate, 48000); d.readU32(4, &m_nbFECBlocks, 0); d.readString(5, &m_apiAddress, "127.0.0.1"); diff --git a/plugins/samplesink/remoteoutput/remoteoutputsettings.h b/plugins/samplesink/remoteoutput/remoteoutputsettings.h index 52a9aa6d2..d733cd6cd 100644 --- a/plugins/samplesink/remoteoutput/remoteoutputsettings.h +++ b/plugins/samplesink/remoteoutput/remoteoutputsettings.h @@ -22,7 +22,6 @@ #include struct RemoteOutputSettings { - quint64 m_centerFrequency; quint32 m_sampleRate; quint32 m_nbFECBlocks; QString m_apiAddress; diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 25b083a87..d5141889d 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -9820,6 +9820,10 @@ margin-bottom: 20px; }; defs.RemoteOutputReport = { "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, "bufferRWBalance" : { "type" : "number", "format" : "float", @@ -9834,10 +9838,6 @@ margin-bottom: 20px; }; defs.RemoteOutputSettings = { "properties" : { - "centerFrequency" : { - "type" : "integer", - "format" : "int64" - }, "sampleRate" : { "type" : "integer" }, @@ -9970,6 +9970,7 @@ margin-bottom: 20px; }, "centerFreq" : { "type" : "integer", + "format" : "int64", "description" : "Stream center frequency setting in kHz" }, "sampleRate" : { @@ -51596,7 +51597,7 @@ except ApiException as e:
- Generated 2021-12-07T06:38:29.681+01:00 + Generated 2021-12-12T13:16:20.821+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml b/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml index 614c074d1..f43917e81 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/RemoteOutput.yaml @@ -1,9 +1,6 @@ RemoteOutputSettings: description: RemoteOutput properties: - centerFrequency: - type: integer - format: int64 sampleRate: type: integer nbFECBlocks: @@ -35,6 +32,9 @@ RemoteOutputSettings: RemoteOutputReport: description: RemoteOutput properties: + centerFrequency: + type: integer + format: int64 bufferRWBalance: description: ratio off the mid buffer (positive read leads) type: number diff --git a/sdrbase/resources/webapi/doc/swagger/include/RemoteSource.yaml b/sdrbase/resources/webapi/doc/swagger/include/RemoteSource.yaml index 42d9e0f3a..04023bb2d 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/RemoteSource.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/RemoteSource.yaml @@ -61,6 +61,7 @@ RemoteSourceReport: centerFreq: description: "Stream center frequency setting in kHz" type: integer + format: int64 sampleRate: description: "Stream nominal sample rate in S/s" type: integer diff --git a/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml b/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml index 614c074d1..f43917e81 100644 --- a/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml +++ b/swagger/sdrangel/api/swagger/include/RemoteOutput.yaml @@ -1,9 +1,6 @@ RemoteOutputSettings: description: RemoteOutput properties: - centerFrequency: - type: integer - format: int64 sampleRate: type: integer nbFECBlocks: @@ -35,6 +32,9 @@ RemoteOutputSettings: RemoteOutputReport: description: RemoteOutput properties: + centerFrequency: + type: integer + format: int64 bufferRWBalance: description: ratio off the mid buffer (positive read leads) type: number diff --git a/swagger/sdrangel/api/swagger/include/RemoteSource.yaml b/swagger/sdrangel/api/swagger/include/RemoteSource.yaml index 21e544e65..752d44862 100644 --- a/swagger/sdrangel/api/swagger/include/RemoteSource.yaml +++ b/swagger/sdrangel/api/swagger/include/RemoteSource.yaml @@ -61,6 +61,7 @@ RemoteSourceReport: centerFreq: description: "Stream center frequency setting in kHz" type: integer + format: int64 sampleRate: description: "Stream nominal sample rate in S/s" type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 25b083a87..d5141889d 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -9820,6 +9820,10 @@ margin-bottom: 20px; }; defs.RemoteOutputReport = { "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, "bufferRWBalance" : { "type" : "number", "format" : "float", @@ -9834,10 +9838,6 @@ margin-bottom: 20px; }; defs.RemoteOutputSettings = { "properties" : { - "centerFrequency" : { - "type" : "integer", - "format" : "int64" - }, "sampleRate" : { "type" : "integer" }, @@ -9970,6 +9970,7 @@ margin-bottom: 20px; }, "centerFreq" : { "type" : "integer", + "format" : "int64", "description" : "Stream center frequency setting in kHz" }, "sampleRate" : { @@ -51596,7 +51597,7 @@ except ApiException as e:
- Generated 2021-12-07T06:38:29.681+01:00 + Generated 2021-12-12T13:16:20.821+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp index dcd2140d9..c5a921747 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.cpp @@ -28,6 +28,8 @@ SWGRemoteOutputReport::SWGRemoteOutputReport(QString* json) { } SWGRemoteOutputReport::SWGRemoteOutputReport() { + center_frequency = 0L; + m_center_frequency_isSet = false; buffer_rw_balance = 0.0f; m_buffer_rw_balance_isSet = false; sample_count = 0; @@ -40,6 +42,8 @@ SWGRemoteOutputReport::~SWGRemoteOutputReport() { void SWGRemoteOutputReport::init() { + center_frequency = 0L; + m_center_frequency_isSet = false; buffer_rw_balance = 0.0f; m_buffer_rw_balance_isSet = false; sample_count = 0; @@ -50,6 +54,7 @@ void SWGRemoteOutputReport::cleanup() { + } SWGRemoteOutputReport* @@ -63,6 +68,8 @@ SWGRemoteOutputReport::fromJson(QString &json) { void SWGRemoteOutputReport::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + ::SWGSDRangel::setValue(&buffer_rw_balance, pJson["bufferRWBalance"], "float", ""); ::SWGSDRangel::setValue(&sample_count, pJson["sampleCount"], "qint32", ""); @@ -83,6 +90,9 @@ SWGRemoteOutputReport::asJson () QJsonObject* SWGRemoteOutputReport::asJsonObject() { QJsonObject* obj = new QJsonObject(); + if(m_center_frequency_isSet){ + obj->insert("centerFrequency", QJsonValue(center_frequency)); + } if(m_buffer_rw_balance_isSet){ obj->insert("bufferRWBalance", QJsonValue(buffer_rw_balance)); } @@ -93,6 +103,16 @@ SWGRemoteOutputReport::asJsonObject() { return obj; } +qint64 +SWGRemoteOutputReport::getCenterFrequency() { + return center_frequency; +} +void +SWGRemoteOutputReport::setCenterFrequency(qint64 center_frequency) { + this->center_frequency = center_frequency; + this->m_center_frequency_isSet = true; +} + float SWGRemoteOutputReport::getBufferRwBalance() { return buffer_rw_balance; @@ -118,6 +138,9 @@ bool SWGRemoteOutputReport::isSet(){ bool isObjectUpdated = false; do{ + if(m_center_frequency_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 1203a9e2a..8513986ac 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputReport.h @@ -41,6 +41,9 @@ public: virtual void fromJsonObject(QJsonObject &json) override; virtual SWGRemoteOutputReport* fromJson(QString &jsonString) override; + qint64 getCenterFrequency(); + void setCenterFrequency(qint64 center_frequency); + float getBufferRwBalance(); void setBufferRwBalance(float buffer_rw_balance); @@ -51,6 +54,9 @@ public: virtual bool isSet() override; private: + qint64 center_frequency; + bool m_center_frequency_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 b0793564c..ebcc73744 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() { - center_frequency = 0L; - m_center_frequency_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; nb_fec_blocks = 0; @@ -62,8 +60,6 @@ SWGRemoteOutputSettings::~SWGRemoteOutputSettings() { void SWGRemoteOutputSettings::init() { - center_frequency = 0L; - m_center_frequency_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; nb_fec_blocks = 0; @@ -94,7 +90,6 @@ void SWGRemoteOutputSettings::cleanup() { - if(api_address != nullptr) { delete api_address; } @@ -124,8 +119,6 @@ SWGRemoteOutputSettings::fromJson(QString &json) { void SWGRemoteOutputSettings::fromJsonObject(QJsonObject &pJson) { - ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); - ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", ""); ::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", ""); @@ -166,9 +159,6 @@ SWGRemoteOutputSettings::asJson () QJsonObject* SWGRemoteOutputSettings::asJsonObject() { QJsonObject* obj = new QJsonObject(); - if(m_center_frequency_isSet){ - obj->insert("centerFrequency", QJsonValue(center_frequency)); - } if(m_sample_rate_isSet){ obj->insert("sampleRate", QJsonValue(sample_rate)); } @@ -209,16 +199,6 @@ SWGRemoteOutputSettings::asJsonObject() { return obj; } -qint64 -SWGRemoteOutputSettings::getCenterFrequency() { - return center_frequency; -} -void -SWGRemoteOutputSettings::setCenterFrequency(qint64 center_frequency) { - this->center_frequency = center_frequency; - this->m_center_frequency_isSet = true; -} - qint32 SWGRemoteOutputSettings::getSampleRate() { return sample_rate; @@ -344,9 +324,6 @@ bool SWGRemoteOutputSettings::isSet(){ bool isObjectUpdated = false; do{ - if(m_center_frequency_isSet){ - isObjectUpdated = true; break; - } if(m_sample_rate_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h b/swagger/sdrangel/code/qt5/client/SWGRemoteOutputSettings.h index 3e595b914..0aee8f0b2 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; - qint64 getCenterFrequency(); - void setCenterFrequency(qint64 center_frequency); - qint32 getSampleRate(); void setSampleRate(qint32 sample_rate); @@ -85,9 +82,6 @@ public: virtual bool isSet() override; private: - qint64 center_frequency; - bool m_center_frequency_isSet; - qint32 sample_rate; bool m_sample_rate_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.cpp b/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.cpp index c603bcf52..a5b533140 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.cpp @@ -46,7 +46,7 @@ SWGRemoteSourceReport::SWGRemoteSourceReport() { m_nb_original_blocks_isSet = false; nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; - center_freq = 0; + center_freq = 0L; m_center_freq_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; @@ -80,7 +80,7 @@ SWGRemoteSourceReport::init() { m_nb_original_blocks_isSet = false; nb_fec_blocks = 0; m_nb_fec_blocks_isSet = false; - center_freq = 0; + center_freq = 0L; m_center_freq_isSet = false; sample_rate = 0; m_sample_rate_isSet = false; @@ -136,7 +136,7 @@ SWGRemoteSourceReport::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&nb_fec_blocks, pJson["nbFECBlocks"], "qint32", ""); - ::SWGSDRangel::setValue(¢er_freq, pJson["centerFreq"], "qint32", ""); + ::SWGSDRangel::setValue(¢er_freq, pJson["centerFreq"], "qint64", ""); ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint32", ""); @@ -293,12 +293,12 @@ SWGRemoteSourceReport::setNbFecBlocks(qint32 nb_fec_blocks) { this->m_nb_fec_blocks_isSet = true; } -qint32 +qint64 SWGRemoteSourceReport::getCenterFreq() { return center_freq; } void -SWGRemoteSourceReport::setCenterFreq(qint32 center_freq) { +SWGRemoteSourceReport::setCenterFreq(qint64 center_freq) { this->center_freq = center_freq; this->m_center_freq_isSet = true; } diff --git a/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.h b/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.h index 7498a5527..4dd3df910 100644 --- a/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGRemoteSourceReport.h @@ -68,8 +68,8 @@ public: qint32 getNbFecBlocks(); void setNbFecBlocks(qint32 nb_fec_blocks); - qint32 getCenterFreq(); - void setCenterFreq(qint32 center_freq); + qint64 getCenterFreq(); + void setCenterFreq(qint64 center_freq); qint32 getSampleRate(); void setSampleRate(qint32 sample_rate); @@ -111,7 +111,7 @@ private: qint32 nb_fec_blocks; bool m_nb_fec_blocks_isSet; - qint32 center_freq; + qint64 center_freq; bool m_center_freq_isSet; qint32 sample_rate;