From 23cebe596f650934897c91fab51e35664da9207e Mon Sep 17 00:00:00 2001 From: f4exb Date: Tue, 27 Oct 2020 06:29:24 +0100 Subject: [PATCH] Frequency Tracker: REST API: added spectrum span log2 control: generated code --- sdrbase/resources/webapi/doc/html2/index.html | 5 +++- .../doc/swagger/include/FreqTracker.yaml | 2 ++ swagger/sdrangel/code/html2/index.html | 5 +++- .../qt5/client/SWGFreqTrackerSettings.cpp | 23 +++++++++++++++++++ .../code/qt5/client/SWGFreqTrackerSettings.h | 6 +++++ 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 0b2415c55..e643b84ad 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3871,6 +3871,9 @@ margin-bottom: 20px; "title" : { "type" : "string" }, + "spanLog2" : { + "type" : "integer" + }, "alphaEMA" : { "type" : "number", "format" : "float", @@ -40052,7 +40055,7 @@ except ApiException as e:
- Generated 2020-10-27T06:18:18.403+01:00 + Generated 2020-10-27T06:29:00.746+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/FreqTracker.yaml b/sdrbase/resources/webapi/doc/swagger/include/FreqTracker.yaml index 68a029cd5..5d507b162 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/FreqTracker.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/FreqTracker.yaml @@ -19,6 +19,8 @@ FreqTrackerSettings: type: integer title: type: string + spanLog2: + type: integer alphaEMA: description: Alpha factor for delta frequency EMA type: number diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 0b2415c55..e643b84ad 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3871,6 +3871,9 @@ margin-bottom: 20px; "title" : { "type" : "string" }, + "spanLog2" : { + "type" : "integer" + }, "alphaEMA" : { "type" : "number", "format" : "float", @@ -40052,7 +40055,7 @@ except ApiException as e:
- Generated 2020-10-27T06:18:18.403+01:00 + Generated 2020-10-27T06:29:00.746+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.cpp index 1b4304d41..ecac0e393 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.cpp @@ -40,6 +40,8 @@ SWGFreqTrackerSettings::SWGFreqTrackerSettings() { m_rgb_color_isSet = false; title = nullptr; m_title_isSet = false; + span_log2 = 0; + m_span_log2_isSet = false; alpha_ema = 0.0f; m_alpha_ema_isSet = false; tracking = 0; @@ -86,6 +88,8 @@ SWGFreqTrackerSettings::init() { m_rgb_color_isSet = false; title = new QString(""); m_title_isSet = false; + span_log2 = 0; + m_span_log2_isSet = false; alpha_ema = 0.0f; m_alpha_ema_isSet = false; tracking = 0; @@ -133,6 +137,7 @@ SWGFreqTrackerSettings::cleanup() { + if(reverse_api_address != nullptr) { delete reverse_api_address; } @@ -164,6 +169,8 @@ SWGFreqTrackerSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString"); + ::SWGSDRangel::setValue(&span_log2, pJson["spanLog2"], "qint32", ""); + ::SWGSDRangel::setValue(&alpha_ema, pJson["alphaEMA"], "float", ""); ::SWGSDRangel::setValue(&tracking, pJson["tracking"], "qint32", ""); @@ -224,6 +231,9 @@ SWGFreqTrackerSettings::asJsonObject() { if(title != nullptr && *title != QString("")){ toJsonValue(QString("title"), title, obj, QString("QString")); } + if(m_span_log2_isSet){ + obj->insert("spanLog2", QJsonValue(span_log2)); + } if(m_alpha_ema_isSet){ obj->insert("alphaEMA", QJsonValue(alpha_ema)); } @@ -327,6 +337,16 @@ SWGFreqTrackerSettings::setTitle(QString* title) { this->m_title_isSet = true; } +qint32 +SWGFreqTrackerSettings::getSpanLog2() { + return span_log2; +} +void +SWGFreqTrackerSettings::setSpanLog2(qint32 span_log2) { + this->span_log2 = span_log2; + this->m_span_log2_isSet = true; +} + float SWGFreqTrackerSettings::getAlphaEma() { return alpha_ema; @@ -480,6 +500,9 @@ SWGFreqTrackerSettings::isSet(){ if(title && *title != QString("")){ isObjectUpdated = true; break; } + if(m_span_log2_isSet){ + isObjectUpdated = true; break; + } if(m_alpha_ema_isSet){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.h b/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.h index a6855ff80..fee0e0247 100644 --- a/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGFreqTrackerSettings.h @@ -60,6 +60,9 @@ public: QString* getTitle(); void setTitle(QString* title); + qint32 getSpanLog2(); + void setSpanLog2(qint32 span_log2); + float getAlphaEma(); void setAlphaEma(float alpha_ema); @@ -121,6 +124,9 @@ private: QString* title; bool m_title_isSet; + qint32 span_log2; + bool m_span_log2_isSet; + float alpha_ema; bool m_alpha_ema_isSet;