diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 68713b806..7d1698367 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -3633,6 +3633,9 @@ margin-bottom: 20px; "testMISettings" : { "$ref" : "#/definitions/TestMISettings" }, + "testMOSyncSettings" : { + "$ref" : "#/definitions/TestMOSyncSettings" + }, "testSourceSettings" : { "$ref" : "#/definitions/TestSourceSettings" }, @@ -8131,6 +8134,26 @@ margin-bottom: 20px; } }, "description" : "TestMISettings" +}; + defs.TestMOSyncSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "sampleRate" : { + "type" : "integer", + "format" : "int64" + }, + "log2Interp" : { + "type" : "integer" + }, + "fcPosTx" : { + "type" : "integer", + "description" : "See BladeRF2MIMO::fcPos_t" + } + }, + "description" : "TestMOSync" }; defs.TestMiStreamSettings = { "properties" : { @@ -41087,7 +41110,7 @@ except ApiException as e:
- Generated 2020-11-10T17:44:38.740+01:00 + Generated 2020-11-10T19:50:40.958+01:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml b/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml index b78b61673..fdeaab6a4 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/DeviceSettings.yaml @@ -72,6 +72,8 @@ DeviceSettings: $ref: "/doc/swagger/include/SoapySDR.yaml#/SoapySDROutputSettings" testMISettings: $ref: "/doc/swagger/include/TestMI.yaml#/TestMISettings" + testMOSyncSettings: + $ref: "/doc/swagger/include/TestMOSync.yaml#/TestMOSyncSettings" testSourceSettings: $ref: "/doc/swagger/include/TestSource.yaml#/TestSourceSettings" usrpInputSettings: diff --git a/sdrbase/resources/webapi/doc/swagger/include/TestMOSync.yaml b/sdrbase/resources/webapi/doc/swagger/include/TestMOSync.yaml new file mode 100644 index 000000000..ba5fe28c3 --- /dev/null +++ b/sdrbase/resources/webapi/doc/swagger/include/TestMOSync.yaml @@ -0,0 +1,14 @@ +TestMOSyncSettings: + description: TestMOSync + properties: + centerFrequency: + type: integer + format: int64 + sampleRate: + type: integer + format: int64 + log2Interp: + type: integer + fcPosTx: + description: See BladeRF2MIMO::fcPos_t + type: integer diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index a38e1b7b8..a92e9ac84 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -3933,6 +3933,15 @@ bool WebAPIRequestMapper::getDeviceSettings( deviceSettings->setTestMiSettings(new SWGSDRangel::SWGTestMISettings()); deviceSettings->getTestMiSettings()->fromJsonObject(settingsJsonObject); } + else if (deviceSettingsKey == "testMOSyncSettings") + { + if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) { + appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys); + } + + deviceSettings->setTestMoSyncSettings(new SWGSDRangel::SWGTestMOSyncSettings()); + deviceSettings->getTestMoSyncSettings()->fromJsonObject(settingsJsonObject); + } else if (deviceSettingsKey == "usrpInputSettings") { deviceSettings->setUsrpInputSettings(new SWGSDRangel::SWGUSRPInputSettings()); diff --git a/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml b/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml index 34a83ae66..23dcfd483 100644 --- a/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml +++ b/swagger/sdrangel/api/swagger/include/DeviceSettings.yaml @@ -72,6 +72,8 @@ DeviceSettings: $ref: "http://swgserver:8081/api/swagger/include/SoapySDR.yaml#/SoapySDROutputSettings" testMISettings: $ref: "http://swgserver:8081/api/swagger/include/TestMI.yaml#/TestMISettings" + testMOSyncSettings: + $ref: "http://swgserver:8081/api/swagger/include/TestMOSync.yaml#/TestMOSyncSettings" testSourceSettings: $ref: "http://swgserver:8081/api/swagger/include/TestSource.yaml#/TestSourceSettings" usrpInputSettings: diff --git a/swagger/sdrangel/api/swagger/include/TestMOSync.yaml b/swagger/sdrangel/api/swagger/include/TestMOSync.yaml new file mode 100644 index 000000000..ba5fe28c3 --- /dev/null +++ b/swagger/sdrangel/api/swagger/include/TestMOSync.yaml @@ -0,0 +1,14 @@ +TestMOSyncSettings: + description: TestMOSync + properties: + centerFrequency: + type: integer + format: int64 + sampleRate: + type: integer + format: int64 + log2Interp: + type: integer + fcPosTx: + description: See BladeRF2MIMO::fcPos_t + type: integer diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 68713b806..7d1698367 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -3633,6 +3633,9 @@ margin-bottom: 20px; "testMISettings" : { "$ref" : "#/definitions/TestMISettings" }, + "testMOSyncSettings" : { + "$ref" : "#/definitions/TestMOSyncSettings" + }, "testSourceSettings" : { "$ref" : "#/definitions/TestSourceSettings" }, @@ -8131,6 +8134,26 @@ margin-bottom: 20px; } }, "description" : "TestMISettings" +}; + defs.TestMOSyncSettings = { + "properties" : { + "centerFrequency" : { + "type" : "integer", + "format" : "int64" + }, + "sampleRate" : { + "type" : "integer", + "format" : "int64" + }, + "log2Interp" : { + "type" : "integer" + }, + "fcPosTx" : { + "type" : "integer", + "description" : "See BladeRF2MIMO::fcPos_t" + } + }, + "description" : "TestMOSync" }; defs.TestMiStreamSettings = { "properties" : { @@ -41087,7 +41110,7 @@ except ApiException as e:
- Generated 2020-11-10T17:44:38.740+01:00 + Generated 2020-11-10T19:50:40.958+01:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp index fa741291c..c7997f8c5 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.cpp @@ -92,6 +92,8 @@ SWGDeviceSettings::SWGDeviceSettings() { m_soapy_sdr_output_settings_isSet = false; test_mi_settings = nullptr; m_test_mi_settings_isSet = false; + test_mo_sync_settings = nullptr; + m_test_mo_sync_settings_isSet = false; test_source_settings = nullptr; m_test_source_settings_isSet = false; usrp_input_settings = nullptr; @@ -174,6 +176,8 @@ SWGDeviceSettings::init() { m_soapy_sdr_output_settings_isSet = false; test_mi_settings = new SWGTestMISettings(); m_test_mi_settings_isSet = false; + test_mo_sync_settings = new SWGTestMOSyncSettings(); + m_test_mo_sync_settings_isSet = false; test_source_settings = new SWGTestSourceSettings(); m_test_source_settings_isSet = false; usrp_input_settings = new SWGUSRPInputSettings(); @@ -280,6 +284,9 @@ SWGDeviceSettings::cleanup() { if(test_mi_settings != nullptr) { delete test_mi_settings; } + if(test_mo_sync_settings != nullptr) { + delete test_mo_sync_settings; + } if(test_source_settings != nullptr) { delete test_source_settings; } @@ -372,6 +379,8 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) { ::SWGSDRangel::setValue(&test_mi_settings, pJson["testMISettings"], "SWGTestMISettings", "SWGTestMISettings"); + ::SWGSDRangel::setValue(&test_mo_sync_settings, pJson["testMOSyncSettings"], "SWGTestMOSyncSettings", "SWGTestMOSyncSettings"); + ::SWGSDRangel::setValue(&test_source_settings, pJson["testSourceSettings"], "SWGTestSourceSettings", "SWGTestSourceSettings"); ::SWGSDRangel::setValue(&usrp_input_settings, pJson["usrpInputSettings"], "SWGUSRPInputSettings", "SWGUSRPInputSettings"); @@ -494,6 +503,9 @@ SWGDeviceSettings::asJsonObject() { if((test_mi_settings != nullptr) && (test_mi_settings->isSet())){ toJsonValue(QString("testMISettings"), test_mi_settings, obj, QString("SWGTestMISettings")); } + if((test_mo_sync_settings != nullptr) && (test_mo_sync_settings->isSet())){ + toJsonValue(QString("testMOSyncSettings"), test_mo_sync_settings, obj, QString("SWGTestMOSyncSettings")); + } if((test_source_settings != nullptr) && (test_source_settings->isSet())){ toJsonValue(QString("testSourceSettings"), test_source_settings, obj, QString("SWGTestSourceSettings")); } @@ -833,6 +845,16 @@ SWGDeviceSettings::setTestMiSettings(SWGTestMISettings* test_mi_settings) { this->m_test_mi_settings_isSet = true; } +SWGTestMOSyncSettings* +SWGDeviceSettings::getTestMoSyncSettings() { + return test_mo_sync_settings; +} +void +SWGDeviceSettings::setTestMoSyncSettings(SWGTestMOSyncSettings* test_mo_sync_settings) { + this->test_mo_sync_settings = test_mo_sync_settings; + this->m_test_mo_sync_settings_isSet = true; +} + SWGTestSourceSettings* SWGDeviceSettings::getTestSourceSettings() { return test_source_settings; @@ -984,6 +1006,9 @@ SWGDeviceSettings::isSet(){ if(test_mi_settings && test_mi_settings->isSet()){ isObjectUpdated = true; break; } + if(test_mo_sync_settings && test_mo_sync_settings->isSet()){ + isObjectUpdated = true; break; + } if(test_source_settings && test_source_settings->isSet()){ isObjectUpdated = true; break; } diff --git a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h index e384ee256..0d96e61e6 100644 --- a/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h +++ b/swagger/sdrangel/code/qt5/client/SWGDeviceSettings.h @@ -51,6 +51,7 @@ #include "SWGSoapySDRInputSettings.h" #include "SWGSoapySDROutputSettings.h" #include "SWGTestMISettings.h" +#include "SWGTestMOSyncSettings.h" #include "SWGTestSourceSettings.h" #include "SWGUSRPInputSettings.h" #include "SWGUSRPOutputSettings.h" @@ -172,6 +173,9 @@ public: SWGTestMISettings* getTestMiSettings(); void setTestMiSettings(SWGTestMISettings* test_mi_settings); + SWGTestMOSyncSettings* getTestMoSyncSettings(); + void setTestMoSyncSettings(SWGTestMOSyncSettings* test_mo_sync_settings); + SWGTestSourceSettings* getTestSourceSettings(); void setTestSourceSettings(SWGTestSourceSettings* test_source_settings); @@ -287,6 +291,9 @@ private: SWGTestMISettings* test_mi_settings; bool m_test_mi_settings_isSet; + SWGTestMOSyncSettings* test_mo_sync_settings; + bool m_test_mo_sync_settings_isSet; + SWGTestSourceSettings* test_source_settings; bool m_test_source_settings_isSet; diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index bd763d3d9..d4469a4d4 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h @@ -201,6 +201,7 @@ #include "SWGSoapySDRReport.h" #include "SWGSuccessResponse.h" #include "SWGTestMISettings.h" +#include "SWGTestMOSyncSettings.h" #include "SWGTestMiStreamSettings.h" #include "SWGTestSourceSettings.h" #include "SWGTraceData.h" @@ -786,6 +787,9 @@ namespace SWGSDRangel { if(QString("SWGTestMISettings").compare(type) == 0) { return new SWGTestMISettings(); } + if(QString("SWGTestMOSyncSettings").compare(type) == 0) { + return new SWGTestMOSyncSettings(); + } if(QString("SWGTestMiStreamSettings").compare(type) == 0) { return new SWGTestMiStreamSettings(); } diff --git a/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.cpp b/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.cpp new file mode 100644 index 000000000..f02e5f88e --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.cpp @@ -0,0 +1,177 @@ +/** + * 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, USRP 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 "SWGTestMOSyncSettings.h" + +#include "SWGHelpers.h" + +#include +#include +#include +#include + +namespace SWGSDRangel { + +SWGTestMOSyncSettings::SWGTestMOSyncSettings(QString* json) { + init(); + this->fromJson(*json); +} + +SWGTestMOSyncSettings::SWGTestMOSyncSettings() { + center_frequency = 0L; + m_center_frequency_isSet = false; + sample_rate = 0L; + m_sample_rate_isSet = false; + log2_interp = 0; + m_log2_interp_isSet = false; + fc_pos_tx = 0; + m_fc_pos_tx_isSet = false; +} + +SWGTestMOSyncSettings::~SWGTestMOSyncSettings() { + this->cleanup(); +} + +void +SWGTestMOSyncSettings::init() { + center_frequency = 0L; + m_center_frequency_isSet = false; + sample_rate = 0L; + m_sample_rate_isSet = false; + log2_interp = 0; + m_log2_interp_isSet = false; + fc_pos_tx = 0; + m_fc_pos_tx_isSet = false; +} + +void +SWGTestMOSyncSettings::cleanup() { + + + + +} + +SWGTestMOSyncSettings* +SWGTestMOSyncSettings::fromJson(QString &json) { + QByteArray array (json.toStdString().c_str()); + QJsonDocument doc = QJsonDocument::fromJson(array); + QJsonObject jsonObject = doc.object(); + this->fromJsonObject(jsonObject); + return this; +} + +void +SWGTestMOSyncSettings::fromJsonObject(QJsonObject &pJson) { + ::SWGSDRangel::setValue(¢er_frequency, pJson["centerFrequency"], "qint64", ""); + + ::SWGSDRangel::setValue(&sample_rate, pJson["sampleRate"], "qint64", ""); + + ::SWGSDRangel::setValue(&log2_interp, pJson["log2Interp"], "qint32", ""); + + ::SWGSDRangel::setValue(&fc_pos_tx, pJson["fcPosTx"], "qint32", ""); + +} + +QString +SWGTestMOSyncSettings::asJson () +{ + QJsonObject* obj = this->asJsonObject(); + + QJsonDocument doc(*obj); + QByteArray bytes = doc.toJson(); + delete obj; + return QString(bytes); +} + +QJsonObject* +SWGTestMOSyncSettings::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)); + } + if(m_log2_interp_isSet){ + obj->insert("log2Interp", QJsonValue(log2_interp)); + } + if(m_fc_pos_tx_isSet){ + obj->insert("fcPosTx", QJsonValue(fc_pos_tx)); + } + + return obj; +} + +qint64 +SWGTestMOSyncSettings::getCenterFrequency() { + return center_frequency; +} +void +SWGTestMOSyncSettings::setCenterFrequency(qint64 center_frequency) { + this->center_frequency = center_frequency; + this->m_center_frequency_isSet = true; +} + +qint64 +SWGTestMOSyncSettings::getSampleRate() { + return sample_rate; +} +void +SWGTestMOSyncSettings::setSampleRate(qint64 sample_rate) { + this->sample_rate = sample_rate; + this->m_sample_rate_isSet = true; +} + +qint32 +SWGTestMOSyncSettings::getLog2Interp() { + return log2_interp; +} +void +SWGTestMOSyncSettings::setLog2Interp(qint32 log2_interp) { + this->log2_interp = log2_interp; + this->m_log2_interp_isSet = true; +} + +qint32 +SWGTestMOSyncSettings::getFcPosTx() { + return fc_pos_tx; +} +void +SWGTestMOSyncSettings::setFcPosTx(qint32 fc_pos_tx) { + this->fc_pos_tx = fc_pos_tx; + this->m_fc_pos_tx_isSet = true; +} + + +bool +SWGTestMOSyncSettings::isSet(){ + bool isObjectUpdated = false; + do{ + if(m_center_frequency_isSet){ + isObjectUpdated = true; break; + } + if(m_sample_rate_isSet){ + isObjectUpdated = true; break; + } + if(m_log2_interp_isSet){ + isObjectUpdated = true; break; + } + if(m_fc_pos_tx_isSet){ + isObjectUpdated = true; break; + } + }while(false); + return isObjectUpdated; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.h b/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.h new file mode 100644 index 000000000..c31b64609 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGTestMOSyncSettings.h @@ -0,0 +1,76 @@ +/** + * 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, USRP 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. + */ + +/* + * SWGTestMOSyncSettings.h + * + * TestMOSync + */ + +#ifndef SWGTestMOSyncSettings_H_ +#define SWGTestMOSyncSettings_H_ + +#include + + + +#include "SWGObject.h" +#include "export.h" + +namespace SWGSDRangel { + +class SWG_API SWGTestMOSyncSettings: public SWGObject { +public: + SWGTestMOSyncSettings(); + SWGTestMOSyncSettings(QString* json); + virtual ~SWGTestMOSyncSettings(); + void init(); + void cleanup(); + + virtual QString asJson () override; + virtual QJsonObject* asJsonObject() override; + virtual void fromJsonObject(QJsonObject &json) override; + virtual SWGTestMOSyncSettings* fromJson(QString &jsonString) override; + + qint64 getCenterFrequency(); + void setCenterFrequency(qint64 center_frequency); + + qint64 getSampleRate(); + void setSampleRate(qint64 sample_rate); + + qint32 getLog2Interp(); + void setLog2Interp(qint32 log2_interp); + + qint32 getFcPosTx(); + void setFcPosTx(qint32 fc_pos_tx); + + + virtual bool isSet() override; + +private: + qint64 center_frequency; + bool m_center_frequency_isSet; + + qint64 sample_rate; + bool m_sample_rate_isSet; + + qint32 log2_interp; + bool m_log2_interp_isSet; + + qint32 fc_pos_tx; + bool m_fc_pos_tx_isSet; + +}; + +} + +#endif /* SWGTestMOSyncSettings_H_ */