From 5f43ace8108bb2285c0b8052daa1efbad4591ce0 Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 28 Sep 2020 13:57:26 +0200 Subject: [PATCH] Feature plugins framework: presets REST API generated code --- sdrbase/resources/webapi/doc/html2/index.html | 40 ++++- .../resources/webapi/doc/swagger/swagger.yaml | 6 + swagger/sdrangel/code/html2/index.html | 40 ++++- .../code/qt5/client/SWGFeatureConfig.cpp | 135 ++++++++++++++ .../code/qt5/client/SWGFeatureConfig.h | 66 +++++++ .../code/qt5/client/SWGFeatureSetPreset.cpp | 164 ++++++++++++++++++ .../code/qt5/client/SWGFeatureSetPreset.h | 73 ++++++++ .../qt5/client/SWGInstanceConfigResponse.cpp | 54 ++++++ .../qt5/client/SWGInstanceConfigResponse.h | 13 ++ .../code/qt5/client/SWGModelFactory.h | 8 + 10 files changed, 597 insertions(+), 2 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGFeatureConfig.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFeatureConfig.h create mode 100644 swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.h diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 00f0c9695..6f64aea60 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3000,6 +3000,18 @@ margin-bottom: 20px; } }, "description" : "Base feature actions. Only the feature actions corresponding to the feature specified in the featureType field is or should be present." +}; + defs.FeatureConfig = { + "properties" : { + "featureIdURI" : { + "type" : "string", + "description" : "Feature type ID in URI form" + }, + "config" : { + "$ref" : "#/definitions/FeatureSettings" + } + }, + "description" : "Represents a FeatureSetPreset::FeatureConfig object" }; defs.FeatureReport = { "required" : [ "featureType" ], @@ -3047,6 +3059,23 @@ margin-bottom: 20px; } }, "description" : "List of feature sets opened in this instance" +}; + defs.FeatureSetPreset = { + "properties" : { + "group" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "featureConfigs" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/FeatureConfig" + } + } + }, + "description" : "Represents a Feature Set Preset object" }; defs.FeatureSettings = { "required" : [ "featureType" ], @@ -3838,6 +3867,9 @@ margin-bottom: 20px; "workingPreset" : { "$ref" : "#/definitions/Preset" }, + "workingFeatureSetPreset" : { + "$ref" : "#/definitions/FeatureSetPreset" + }, "presets" : { "type" : "array", "items" : { @@ -3849,6 +3881,12 @@ margin-bottom: 20px; "items" : { "$ref" : "#/definitions/Command" } + }, + "featuresetpresets" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/FeatureSetPreset" + } } }, "description" : "Preferences, Presets and Commands of the MainSettings saved by Qt" @@ -38907,7 +38945,7 @@ except ApiException as e:
- Generated 2020-09-28T13:34:44.975+02:00 + Generated 2020-09-28T13:50:10.100+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/swagger.yaml b/sdrbase/resources/webapi/doc/swagger/swagger.yaml index bd3768c5d..885cbc624 100644 --- a/sdrbase/resources/webapi/doc/swagger/swagger.yaml +++ b/sdrbase/resources/webapi/doc/swagger/swagger.yaml @@ -2150,6 +2150,8 @@ definitions: $ref: "/doc/swagger/include/Preferences.yaml#/Preferences" workingPreset: $ref: "/doc/swagger/include/Preset.yaml#/Preset" + workingFeatureSetPreset: + $ref: "/doc/swagger/include/FeatureSetPreset.yaml#/FeatureSetPreset" presets: type: array items: @@ -2158,6 +2160,10 @@ definitions: type: array items: $ref: "/doc/swagger/include/Command.yaml#/Command" + featuresetpresets: + type: array + items: + $ref: "/doc/swagger/include/FeatureSetPreset.yaml#/FeatureSetPreset" InstanceDevicesResponse: description: "Summarized information about logical devices from hardware devices attached to this SDRangel instance" diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 00f0c9695..6f64aea60 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3000,6 +3000,18 @@ margin-bottom: 20px; } }, "description" : "Base feature actions. Only the feature actions corresponding to the feature specified in the featureType field is or should be present." +}; + defs.FeatureConfig = { + "properties" : { + "featureIdURI" : { + "type" : "string", + "description" : "Feature type ID in URI form" + }, + "config" : { + "$ref" : "#/definitions/FeatureSettings" + } + }, + "description" : "Represents a FeatureSetPreset::FeatureConfig object" }; defs.FeatureReport = { "required" : [ "featureType" ], @@ -3047,6 +3059,23 @@ margin-bottom: 20px; } }, "description" : "List of feature sets opened in this instance" +}; + defs.FeatureSetPreset = { + "properties" : { + "group" : { + "type" : "string" + }, + "description" : { + "type" : "string" + }, + "featureConfigs" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/FeatureConfig" + } + } + }, + "description" : "Represents a Feature Set Preset object" }; defs.FeatureSettings = { "required" : [ "featureType" ], @@ -3838,6 +3867,9 @@ margin-bottom: 20px; "workingPreset" : { "$ref" : "#/definitions/Preset" }, + "workingFeatureSetPreset" : { + "$ref" : "#/definitions/FeatureSetPreset" + }, "presets" : { "type" : "array", "items" : { @@ -3849,6 +3881,12 @@ margin-bottom: 20px; "items" : { "$ref" : "#/definitions/Command" } + }, + "featuresetpresets" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/FeatureSetPreset" + } } }, "description" : "Preferences, Presets and Commands of the MainSettings saved by Qt" @@ -38907,7 +38945,7 @@ except ApiException as e:
- Generated 2020-09-28T13:34:44.975+02:00 + Generated 2020-09-28T13:50:10.100+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.cpp new file mode 100644 index 000000000..94eda6b07 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.cpp @@ -0,0 +1,135 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 4.15.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGFeatureConfig.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFeatureConfig::SWGFeatureConfig(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFeatureConfig::SWGFeatureConfig() { + feature_id_uri = nullptr; + m_feature_id_uri_isSet = false; + config = nullptr; + m_config_isSet = false; +} + +SWGFeatureConfig::~SWGFeatureConfig() { + this->cleanup(); +} + +void +SWGFeatureConfig::init() { + feature_id_uri = new QString(""); + m_feature_id_uri_isSet = false; + config = new SWGFeatureSettings(); + m_config_isSet = false; +} + +void +SWGFeatureConfig::cleanup() { + if(feature_id_uri != nullptr) { + delete feature_id_uri; + } + if(config != nullptr) { + delete config; + } +} + +SWGFeatureConfig* +SWGFeatureConfig::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFeatureConfig::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&feature_id_uri, pJson["featureIdURI"], "QString", "QString"); + + ::SWGSDRangel::setValue(&config, pJson["config"], "SWGFeatureSettings", "SWGFeatureSettings"); + +} + +QString +SWGFeatureConfig::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFeatureConfig::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(feature_id_uri != nullptr && *feature_id_uri != QString("")){ + toJsonValue(QString("featureIdURI"), feature_id_uri, obj, QString("QString")); + } + if((config != nullptr) && (config->isSet())){ + toJsonValue(QString("config"), config, obj, QString("SWGFeatureSettings")); + } + + return obj; +} + +QString* +SWGFeatureConfig::getFeatureIdUri() { + return feature_id_uri; +} +void +SWGFeatureConfig::setFeatureIdUri(QString* feature_id_uri) { + this->feature_id_uri = feature_id_uri; + this->m_feature_id_uri_isSet = true; +} + +SWGFeatureSettings* +SWGFeatureConfig::getConfig() { + return config; +} +void +SWGFeatureConfig::setConfig(SWGFeatureSettings* config) { + this->config = config; + this->m_config_isSet = true; +} + + +bool +SWGFeatureConfig::isSet(){ + bool isObjectUpdated = false; + do{ + if(feature_id_uri && *feature_id_uri != QString("")){ + isObjectUpdated = true; break; + } + if(config && config->isSet()){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.h b/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.h new file mode 100644 index 000000000..9a28f7407 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureConfig.h @@ -0,0 +1,66 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 4.15.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGFeatureConfig.h + * + * Represents a FeatureSetPreset::FeatureConfig object + */ + +#ifndef SWGFeatureConfig_H_ +#define SWGFeatureConfig_H_ + +#include + + +#include "SWGFeatureSettings.h" +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFeatureConfig: public SWGObject { +public: + SWGFeatureConfig(); + SWGFeatureConfig(QString* json); + virtual ~SWGFeatureConfig(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFeatureConfig* fromJson(QString &jsonString) override; + + QString* getFeatureIdUri(); + void setFeatureIdUri(QString* feature_id_uri); + + SWGFeatureSettings* getConfig(); + void setConfig(SWGFeatureSettings* config); + + + virtual bool isSet() override; + +private: + QString* feature_id_uri; + bool m_feature_id_uri_isSet; + + SWGFeatureSettings* config; + bool m_config_isSet; + +}; + +} + +#endif /* SWGFeatureConfig_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.cpp b/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.cpp new file mode 100644 index 000000000..76d005564 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.cpp @@ -0,0 +1,164 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 4.15.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +#include "SWGFeatureSetPreset.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGFeatureSetPreset::SWGFeatureSetPreset(QString* json) { + init(); + this->fromJson(*json); +} + +SWGFeatureSetPreset::SWGFeatureSetPreset() { + group = nullptr; + m_group_isSet = false; + description = nullptr; + m_description_isSet = false; + feature_configs = nullptr; + m_feature_configs_isSet = false; +} + +SWGFeatureSetPreset::~SWGFeatureSetPreset() { + this->cleanup(); +} + +void +SWGFeatureSetPreset::init() { + group = new QString(""); + m_group_isSet = false; + description = new QString(""); + m_description_isSet = false; + feature_configs = new QList(); + m_feature_configs_isSet = false; +} + +void +SWGFeatureSetPreset::cleanup() { + if(group != nullptr) { + delete group; + } + if(description != nullptr) { + delete description; + } + if(feature_configs != nullptr) { + auto arr = feature_configs; + for(auto o: *arr) { + delete o; + } + delete feature_configs; + } +} + +SWGFeatureSetPreset* +SWGFeatureSetPreset::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGFeatureSetPreset::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(&group, pJson["group"], "QString", "QString"); + + ::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString"); + + + ::SWGSDRangel::setValue(&feature_configs, pJson["featureConfigs"], "QList", "SWGFeatureConfig"); +} + +QString +SWGFeatureSetPreset::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGFeatureSetPreset::asJsonObject() { + QJsonObject* obj = new QJsonObject(); + if(group != nullptr && *group != QString("")){ + toJsonValue(QString("group"), group, obj, QString("QString")); + } + if(description != nullptr && *description != QString("")){ + toJsonValue(QString("description"), description, obj, QString("QString")); + } + if(feature_configs && feature_configs->size() > 0){ + toJsonArray((QList*)feature_configs, obj, "featureConfigs", "SWGFeatureConfig"); + } + + return obj; +} + +QString* +SWGFeatureSetPreset::getGroup() { + return group; +} +void +SWGFeatureSetPreset::setGroup(QString* group) { + this->group = group; + this->m_group_isSet = true; +} + +QString* +SWGFeatureSetPreset::getDescription() { + return description; +} +void +SWGFeatureSetPreset::setDescription(QString* description) { + this->description = description; + this->m_description_isSet = true; +} + +QList* +SWGFeatureSetPreset::getFeatureConfigs() { + return feature_configs; +} +void +SWGFeatureSetPreset::setFeatureConfigs(QList* feature_configs) { + this->feature_configs = feature_configs; + this->m_feature_configs_isSet = true; +} + + +bool +SWGFeatureSetPreset::isSet(){ + bool isObjectUpdated = false; + do{ + if(group && *group != QString("")){ + isObjectUpdated = true; break; + } + if(description && *description != QString("")){ + isObjectUpdated = true; break; + } + if(feature_configs && (feature_configs->size() > 0)){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.h b/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.h new file mode 100644 index 000000000..cc62be948 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGFeatureSetPreset.h @@ -0,0 +1,73 @@ +/** + * SDRangel + * This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time --- + * + * OpenAPI spec version: 4.15.0 + * Contact: f4exb06@gmail.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + +/* + * SWGFeatureSetPreset.h + * + * Represents a Feature Set Preset object + */ + +#ifndef SWGFeatureSetPreset_H_ +#define SWGFeatureSetPreset_H_ + +#include + + +#include "SWGFeatureConfig.h" +#include +#include + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGFeatureSetPreset: public SWGObject { +public: + SWGFeatureSetPreset(); + SWGFeatureSetPreset(QString* json); + virtual ~SWGFeatureSetPreset(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGFeatureSetPreset* fromJson(QString &jsonString) override; + + QString* getGroup(); + void setGroup(QString* group); + + QString* getDescription(); + void setDescription(QString* description); + + QList* getFeatureConfigs(); + void setFeatureConfigs(QList* feature_configs); + + + virtual bool isSet() override; + +private: + QString* group; + bool m_group_isSet; + + QString* description; + bool m_description_isSet; + + QList* feature_configs; + bool m_feature_configs_isSet; + +}; + +} + +#endif /* SWGFeatureSetPreset_H_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.cpp b/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.cpp index 11288c7f6..53280df27 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.cpp @@ -32,10 +32,14 @@ SWGInstanceConfigResponse::SWGInstanceConfigResponse() { m_preferences_isSet = false; working_preset = nullptr; m_working_preset_isSet = false; + working_feature_set_preset = nullptr; + m_working_feature_set_preset_isSet = false; presets = nullptr; m_presets_isSet = false; commands = nullptr; m_commands_isSet = false; + featuresetpresets = nullptr; + m_featuresetpresets_isSet = false; } SWGInstanceConfigResponse::~SWGInstanceConfigResponse() { @@ -48,10 +52,14 @@ SWGInstanceConfigResponse::init() { m_preferences_isSet = false; working_preset = new SWGPreset(); m_working_preset_isSet = false; + working_feature_set_preset = new SWGFeatureSetPreset(); + m_working_feature_set_preset_isSet = false; presets = new QList(); m_presets_isSet = false; commands = new QList(); m_commands_isSet = false; + featuresetpresets = new QList(); + m_featuresetpresets_isSet = false; } void @@ -62,6 +70,9 @@ SWGInstanceConfigResponse::cleanup() { if(working_preset != nullptr) { delete working_preset; } + if(working_feature_set_preset != nullptr) { + delete working_feature_set_preset; + } if(presets != nullptr) { auto arr = presets; for(auto o: *arr) { @@ -76,6 +87,13 @@ SWGInstanceConfigResponse::cleanup() { } delete commands; } + if(featuresetpresets != nullptr) { + auto arr = featuresetpresets; + for(auto o: *arr) { + delete o; + } + delete featuresetpresets; + } } SWGInstanceConfigResponse* @@ -93,10 +111,14 @@ SWGInstanceConfigResponse::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&working_preset, pJson["workingPreset"], "SWGPreset", "SWGPreset"); + ::SWGSDRangel::setValue(&working_feature_set_preset, pJson["workingFeatureSetPreset"], "SWGFeatureSetPreset", "SWGFeatureSetPreset"); + ::SWGSDRangel::setValue(&presets, pJson["presets"], "QList", "SWGPreset"); ::SWGSDRangel::setValue(&commands, pJson["commands"], "QList", "SWGCommand"); + + ::SWGSDRangel::setValue(&featuresetpresets, pJson["featuresetpresets"], "QList", "SWGFeatureSetPreset"); } QString @@ -119,12 +141,18 @@ SWGInstanceConfigResponse::asJsonObject() { if((working_preset != nullptr) && (working_preset->isSet())){ toJsonValue(QString("workingPreset"), working_preset, obj, QString("SWGPreset")); } + if((working_feature_set_preset != nullptr) && (working_feature_set_preset->isSet())){ + toJsonValue(QString("workingFeatureSetPreset"), working_feature_set_preset, obj, QString("SWGFeatureSetPreset")); + } if(presets && presets->size() > 0){ toJsonArray((QList*)presets, obj, "presets", "SWGPreset"); } if(commands && commands->size() > 0){ toJsonArray((QList*)commands, obj, "commands", "SWGCommand"); } + if(featuresetpresets && featuresetpresets->size() > 0){ + toJsonArray((QList*)featuresetpresets, obj, "featuresetpresets", "SWGFeatureSetPreset"); + } return obj; } @@ -149,6 +177,16 @@ SWGInstanceConfigResponse::setWorkingPreset(SWGPreset* working_preset) { this->m_working_preset_isSet = true; } +SWGFeatureSetPreset* +SWGInstanceConfigResponse::getWorkingFeatureSetPreset() { + return working_feature_set_preset; +} +void +SWGInstanceConfigResponse::setWorkingFeatureSetPreset(SWGFeatureSetPreset* working_feature_set_preset) { + this->working_feature_set_preset = working_feature_set_preset; + this->m_working_feature_set_preset_isSet = true; +} + QList* SWGInstanceConfigResponse::getPresets() { return presets; @@ -169,6 +207,16 @@ SWGInstanceConfigResponse::setCommands(QList* commands) { this->m_commands_isSet = true; } +QList* +SWGInstanceConfigResponse::getFeaturesetpresets() { + return featuresetpresets; +} +void +SWGInstanceConfigResponse::setFeaturesetpresets(QList* featuresetpresets) { + this->featuresetpresets = featuresetpresets; + this->m_featuresetpresets_isSet = true; +} + bool SWGInstanceConfigResponse::isSet(){ @@ -180,12 +228,18 @@ SWGInstanceConfigResponse::isSet(){ if(working_preset && working_preset->isSet()){ isObjectUpdated = true; break; } + if(working_feature_set_preset && working_feature_set_preset->isSet()){ + isObjectUpdated = true; break; + } if(presets && (presets->size() > 0)){ isObjectUpdated = true; break; } if(commands && (commands->size() > 0)){ isObjectUpdated = true; break; } + if(featuresetpresets && (featuresetpresets->size() > 0)){ + isObjectUpdated = true; break; + } }while(false); return isObjectUpdated; } diff --git a/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.h b/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.h index 7326d5696..9cbcdf060 100644 --- a/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.h +++ b/swagger/sdrangel/code/qt5/client/SWGInstanceConfigResponse.h @@ -23,6 +23,7 @@ #include "SWGCommand.h" +#include "SWGFeatureSetPreset.h" #include "SWGPreferences.h" #include "SWGPreset.h" #include @@ -51,12 +52,18 @@ public: SWGPreset* getWorkingPreset(); void setWorkingPreset(SWGPreset* working_preset); + SWGFeatureSetPreset* getWorkingFeatureSetPreset(); + void setWorkingFeatureSetPreset(SWGFeatureSetPreset* working_feature_set_preset); + QList* getPresets(); void setPresets(QList* presets); QList* getCommands(); void setCommands(QList* commands); + QList* getFeaturesetpresets(); + void setFeaturesetpresets(QList* featuresetpresets); + virtual bool isSet() override; @@ -67,12 +74,18 @@ private: SWGPreset* working_preset; bool m_working_preset_isSet; + SWGFeatureSetPreset* working_feature_set_preset; + bool m_working_feature_set_preset_isSet; + QList* presets; bool m_presets_isSet; QList* commands; bool m_commands_isSet; + QList* featuresetpresets; + bool m_featuresetpresets_isSet; + }; } diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index b4bb78ddf..e564d0b30 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -64,9 +64,11 @@ #include "SWGFCDProSettings.h" #include "SWGFeature.h" #include "SWGFeatureActions.h" +#include "SWGFeatureConfig.h" #include "SWGFeatureReport.h" #include "SWGFeatureSet.h" #include "SWGFeatureSetList.h" +#include "SWGFeatureSetPreset.h" #include "SWGFeatureSettings.h" #include "SWGFileInputSettings.h" #include "SWGFileSinkActions.h" @@ -309,6 +311,9 @@ namespace SWGSDRangel { if(QString("SWGFeatureActions").compare(type) == 0) { return new SWGFeatureActions(); } + if(QString("SWGFeatureConfig").compare(type) == 0) { + return new SWGFeatureConfig(); + } if(QString("SWGFeatureReport").compare(type) == 0) { return new SWGFeatureReport(); } @@ -318,6 +323,9 @@ namespace SWGSDRangel { if(QString("SWGFeatureSetList").compare(type) == 0) { return new SWGFeatureSetList(); } + if(QString("SWGFeatureSetPreset").compare(type) == 0) { + return new SWGFeatureSetPreset(); + } if(QString("SWGFeatureSettings").compare(type) == 0) { return new SWGFeatureSettings(); }