1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-11-16 13:13:41 -05:00

REST API: TestMOSyncSettings and BladeRF2MIMOSettings handling

This commit is contained in:
f4exb 2019-12-29 06:03:37 +01:00
parent 2ff3af110d
commit c9219ec8ea
8 changed files with 66 additions and 4 deletions

View File

@ -70,6 +70,8 @@ DeviceSettings:
$ref: "/doc/swagger/include/TestSource.yaml#/TestSourceSettings"
testMISettings:
$ref: "/doc/swagger/include/TestMI.yaml#/TestMISettings"
testMOSyncSettings:
$ref: "/doc/swagger/include/TestMOSync.yaml#/TestMOSyncSettings"
xtrxInputSettings:
$ref: "/doc/swagger/include/Xtrx.yaml#/XtrxInputSettings"
xtrxOutputSettings:

View File

@ -94,6 +94,7 @@ const QMap<QString, QString> WebAPIRequestMapper::m_deviceIdToSettingsKey = {
{"sdrangel.samplesource.bladerf2input", "bladeRF2InputSettings"},
{"sdrangel.samplesink.bladerf2output", "bladeRF2OutputSettings"},
{"sdrangel.samplesource.bladerf2output", "bladeRF2OutputSettings"}, // remap
{"sdrangel.samplemimo.bladerf2mimo", "bladeRF2MIMOSettings"},
{"sdrangel.samplesource.fcdpro", "fcdProSettings"},
{"sdrangel.samplesource.fcdproplus", "fcdProPlusSettings"},
{"sdrangel.samplesource.fileinput", "fileInputSettings"},
@ -118,6 +119,7 @@ const QMap<QString, QString> WebAPIRequestMapper::m_deviceIdToSettingsKey = {
{"sdrangel.samplesink.soapysdroutput", "soapySDROutputSettings"},
{"sdrangel.samplesource.testsource", "testSourceSettings"},
{"sdrangel.samplemimo.testmi", "testMISettings"},
{"sdrangel.samplemimo.testmosync", "testMOSyncSettings"},
{"sdrangel.samplesource.xtrx", "XtrxInputSettings"},
{"sdrangel.samplesink.xtrx", "XtrxOutputSettings"}
};
@ -184,7 +186,9 @@ const QMap<QString, QString> WebAPIRequestMapper::m_sinkDeviceHwIdToSettingsKey
};
const QMap<QString, QString> WebAPIRequestMapper::m_mimoDeviceHwIdToSettingsKey= {
{"TestMI", "testMISettings"}
{"BladeRF2", "BladeRF2MIMOSettings"},
{"TestMI", "testMISettings"},
{"TestMOSync", "TestMOSyncSettings"}
};
WebAPIRequestMapper::WebAPIRequestMapper(QObject* parent) :
@ -2737,11 +2741,20 @@ bool WebAPIRequestMapper::getDevice(
deviceSettings->setBladeRf2InputSettings(new SWGSDRangel::SWGBladeRF2InputSettings());
deviceSettings->getBladeRf2InputSettings()->fromJsonObject(settingsJsonObject);
}
else if (deviceSettingsKey == "bladeRF2InputSettings")
else if (deviceSettingsKey == "bladeRF2OutputSettings")
{
deviceSettings->setBladeRf2OutputSettings(new SWGSDRangel::SWGBladeRF2OutputSettings());
deviceSettings->getBladeRf2OutputSettings()->fromJsonObject(settingsJsonObject);
}
else if (deviceSettingsKey == "bladeRF2MIMOSettings")
{
if (deviceSettingsKeys.contains("streams") && settingsJsonObject["streams"].isArray()) {
appendSettingsArrayKeys(settingsJsonObject, "streams", deviceSettingsKeys);
}
deviceSettings->setBladeRf2MimoSettings(new SWGSDRangel::SWGBladeRF2MIMOSettings());
deviceSettings->getBladeRf2MimoSettings()->fromJsonObject(settingsJsonObject);
}
else if (deviceSettingsKey == "fcdProSettings")
{
deviceSettings->setFcdProSettings(new SWGSDRangel::SWGFCDProSettings());
@ -2835,6 +2848,15 @@ bool WebAPIRequestMapper::getDevice(
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 == "XtrxInputSettings")
{
deviceSettings->setXtrxInputSettings(new SWGSDRangel::SWGXtrxInputSettings());

View File

@ -70,6 +70,8 @@ DeviceSettings:
$ref: "http://localhost:8081/api/swagger/include/TestSource.yaml#/TestSourceSettings"
testMISettings:
$ref: "http://localhost:8081/api/swagger/include/TestMI.yaml#/TestMISettings"
testMOSyncSettings:
$ref: "http://localhost:8081/api/swagger/include/TestMOSync.yaml#/TestMOSyncSettings"
xtrxInputSettings:
$ref: "http://localhost:8081/api/swagger/include/Xtrx.yaml#/XtrxInputSettings"
xtrxOutputSettings:

View File

@ -90,6 +90,8 @@ SWGDeviceSettings::SWGDeviceSettings() {
m_test_source_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;
xtrx_input_settings = nullptr;
m_xtrx_input_settings_isSet = false;
xtrx_output_settings = nullptr;
@ -164,6 +166,8 @@ SWGDeviceSettings::init() {
m_test_source_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;
xtrx_input_settings = new SWGXtrxInputSettings();
m_xtrx_input_settings_isSet = false;
xtrx_output_settings = new SWGXtrxOutputSettings();
@ -261,6 +265,9 @@ SWGDeviceSettings::cleanup() {
if(test_mi_settings != nullptr) {
delete test_mi_settings;
}
if(test_mo_sync_settings != nullptr) {
delete test_mo_sync_settings;
}
if(xtrx_input_settings != nullptr) {
delete xtrx_input_settings;
}
@ -342,6 +349,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(&xtrx_input_settings, pJson["xtrxInputSettings"], "SWGXtrxInputSettings", "SWGXtrxInputSettings");
::SWGSDRangel::setValue(&xtrx_output_settings, pJson["xtrxOutputSettings"], "SWGXtrxOutputSettings", "SWGXtrxOutputSettings");
@ -455,6 +464,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((xtrx_input_settings != nullptr) && (xtrx_input_settings->isSet())){
toJsonValue(QString("xtrxInputSettings"), xtrx_input_settings, obj, QString("SWGXtrxInputSettings"));
}
@ -775,6 +787,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;
}
SWGXtrxInputSettings*
SWGDeviceSettings::getXtrxInputSettings() {
return xtrx_input_settings;
@ -893,6 +915,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(xtrx_input_settings && xtrx_input_settings->isSet()){
isObjectUpdated = true; break;
}

View File

@ -49,6 +49,7 @@
#include "SWGSoapySDRInputSettings.h"
#include "SWGSoapySDROutputSettings.h"
#include "SWGTestMISettings.h"
#include "SWGTestMOSyncSettings.h"
#include "SWGTestSourceSettings.h"
#include "SWGXtrxInputSettings.h"
#include "SWGXtrxOutputSettings.h"
@ -165,6 +166,9 @@ public:
SWGTestMISettings* getTestMiSettings();
void setTestMiSettings(SWGTestMISettings* test_mi_settings);
SWGTestMOSyncSettings* getTestMoSyncSettings();
void setTestMoSyncSettings(SWGTestMOSyncSettings* test_mo_sync_settings);
SWGXtrxInputSettings* getXtrxInputSettings();
void setXtrxInputSettings(SWGXtrxInputSettings* xtrx_input_settings);
@ -268,6 +272,9 @@ private:
SWGTestMISettings* test_mi_settings;
bool m_test_mi_settings_isSet;
SWGTestMOSyncSettings* test_mo_sync_settings;
bool m_test_mo_sync_settings_isSet;
SWGXtrxInputSettings* xtrx_input_settings;
bool m_xtrx_input_settings_isSet;

View File

@ -153,6 +153,7 @@
#include "SWGSoapySDRReport.h"
#include "SWGSuccessResponse.h"
#include "SWGTestMISettings.h"
#include "SWGTestMOSyncSettings.h"
#include "SWGTestMiStreamSettings.h"
#include "SWGTestSourceSettings.h"
#include "SWGTraceData.h"
@ -590,6 +591,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();
}

View File

@ -2,7 +2,7 @@
* 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: 5.0.0
* OpenAPI spec version: 4.11.6
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.

View File

@ -2,7 +2,7 @@
* 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: 5.0.0
* OpenAPI spec version: 4.11.6
* Contact: f4exb06@gmail.com
*
* NOTE: This class is auto generated by the swagger code generator program.