SoapySDR support: REST API: input: format settings and report

This commit is contained in:
f4exb 2018-11-14 02:06:36 +01:00
parent 89899a48d3
commit 7a171aed1d
17 changed files with 946 additions and 128 deletions

View File

@ -18,6 +18,12 @@
#include "util/simpleserializer.h"
#include "SWGDeviceSettings.h"
#include "SWGSoapySDRInputSettings.h"
#include "SWGDeviceState.h"
#include "SWGDeviceReport.h"
#include "SWGSoapySDRReport.h"
#include "device/devicesourceapi.h"
#include "device/devicesinkapi.h"
#include "dsp/dspcommands.h"
@ -1241,3 +1247,257 @@ bool SoapySDRInput::applySettings(const SoapySDRInputSettings& settings, bool fo
return true;
}
void SoapySDRInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const SoapySDRInputSettings& settings)
{
response.getSoapySdrInputSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getSoapySdrInputSettings()->setLOppmTenths(settings.m_LOppmTenths);
response.getSoapySdrInputSettings()->setDevSampleRate(settings.m_devSampleRate);
response.getSoapySdrInputSettings()->setLog2Decim(settings.m_log2Decim);
response.getSoapySdrInputSettings()->setFcPos((int) settings.m_fcPos);
response.getSoapySdrInputSettings()->setSoftDcCorrection(settings.m_softDCCorrection ? 1 : 0);
response.getSoapySdrInputSettings()->setSoftIqCorrection(settings.m_softIQCorrection ? 1 : 0);
response.getSoapySdrInputSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getSoapySdrInputSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getSoapySdrInputSettings()->getFileRecordName()) {
*response.getSoapySdrInputSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getSoapySdrInputSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
if (response.getSoapySdrInputSettings()->getAntenna()) {
*response.getSoapySdrInputSettings()->getAntenna() = settings.m_antenna;
} else {
response.getSoapySdrInputSettings()->setAntenna(new QString(settings.m_antenna));
}
if (response.getSoapySdrInputSettings()->getTunableElements()) {
response.getSoapySdrInputSettings()->getTunableElements()->clear();
} else {
response.getSoapySdrInputSettings()->setTunableElements(new QList<SWGSDRangel::SWGArgValue*>);
}
for (const auto itName : settings.m_tunableElements.keys())
{
response.getSoapySdrInputSettings()->getTunableElements()->append(new SWGSDRangel::SWGArgValue);
response.getSoapySdrInputSettings()->getTunableElements()->back()->setKey(new QString( itName));
double value = settings.m_tunableElements.value(itName);
response.getSoapySdrInputSettings()->getTunableElements()->back()->setValueString(new QString(tr("%1").arg(value)));
response.getSoapySdrInputSettings()->getTunableElements()->back()->setValueType(new QString("float"));
}
response.getSoapySdrInputSettings()->setBandwidth(settings.m_bandwidth);
response.getSoapySdrInputSettings()->setGlobalGain(settings.m_globalGain);
if (response.getSoapySdrInputSettings()->getIndividualGains()) {
response.getSoapySdrInputSettings()->getIndividualGains()->clear();
} else {
response.getSoapySdrInputSettings()->setIndividualGains(new QList<SWGSDRangel::SWGArgValue*>);
}
for (const auto itName : settings.m_individualGains.keys())
{
response.getSoapySdrInputSettings()->getIndividualGains()->append(new SWGSDRangel::SWGArgValue);
response.getSoapySdrInputSettings()->getIndividualGains()->back()->setKey(new QString(itName));
double value = settings.m_individualGains.value(itName);
response.getSoapySdrInputSettings()->getIndividualGains()->back()->setValueString(new QString(tr("%1").arg(value)));
response.getSoapySdrInputSettings()->getIndividualGains()->back()->setValueType(new QString("float"));
}
response.getSoapySdrInputSettings()->setAutoGain(settings.m_autoGain ? 1 : 0);
response.getSoapySdrInputSettings()->setAutoDcCorrection(settings.m_autoDCCorrection ? 1 : 0);
response.getSoapySdrInputSettings()->setAutoIqCorrection(settings.m_autoIQCorrection ? 1 : 0);
if (!response.getSoapySdrInputSettings()->getDcCorrection()) {
response.getSoapySdrInputSettings()->setDcCorrection(new SWGSDRangel::SWGComplex());
}
response.getSoapySdrInputSettings()->getDcCorrection()->setReal(settings.m_dcCorrection.real());
response.getSoapySdrInputSettings()->getDcCorrection()->setImag(settings.m_dcCorrection.imag());
if (!response.getSoapySdrInputSettings()->getIqCorrection()) {
response.getSoapySdrInputSettings()->setIqCorrection(new SWGSDRangel::SWGComplex());
}
response.getSoapySdrInputSettings()->getIqCorrection()->setReal(settings.m_iqCorrection.real());
response.getSoapySdrInputSettings()->getIqCorrection()->setImag(settings.m_iqCorrection.imag());
if (response.getSoapySdrInputSettings()->getStreamArgSettings()) {
response.getSoapySdrInputSettings()->getStreamArgSettings()->clear();
} else {
response.getSoapySdrInputSettings()->setStreamArgSettings(new QList<SWGSDRangel::SWGArgValue*>);
}
for (const auto itName : settings.m_streamArgSettings.keys())
{
response.getSoapySdrInputSettings()->getStreamArgSettings()->append(new SWGSDRangel::SWGArgValue);
response.getSoapySdrInputSettings()->getStreamArgSettings()->back()->setKey(new QString(itName));
const QVariant& v = settings.m_streamArgSettings.value(itName);
webapiFormatArgValue(v, response.getSoapySdrInputSettings()->getStreamArgSettings()->back());
}
if (response.getSoapySdrInputSettings()->getDeviceArgSettings()) {
response.getSoapySdrInputSettings()->getDeviceArgSettings()->clear();
} else {
response.getSoapySdrInputSettings()->setDeviceArgSettings(new QList<SWGSDRangel::SWGArgValue*>);
}
for (const auto itName : settings.m_deviceArgSettings.keys())
{
response.getSoapySdrInputSettings()->getDeviceArgSettings()->append(new SWGSDRangel::SWGArgValue);
response.getSoapySdrInputSettings()->getDeviceArgSettings()->back()->setKey(new QString(itName));
const QVariant& v = settings.m_deviceArgSettings.value(itName);
webapiFormatArgValue(v, response.getSoapySdrInputSettings()->getDeviceArgSettings()->back());
}
}
void SoapySDRInput::webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response)
{
const DeviceSoapySDRParams::ChannelSettings* channelSettings = m_deviceShared.m_deviceParams->getRxChannelSettings(m_deviceShared.m_channel);
response.getSoapySdrInputReport()->setDeviceSettingsArgs(new QList<SWGSDRangel::SWGArgInfo*>);
for (const auto itArg : m_deviceShared.m_deviceParams->getDeviceArgs())
{
response.getSoapySdrInputReport()->getDeviceSettingsArgs()->append(new SWGSDRangel::SWGArgInfo);
webapiFormatArgInfo(itArg, response.getSoapySdrInputReport()->getDeviceSettingsArgs()->back());
}
response.getSoapySdrInputReport()->setStreamSettingsArgs(new QList<SWGSDRangel::SWGArgInfo*>);
for (const auto itArg : channelSettings->m_streamSettingsArgs)
{
response.getSoapySdrInputReport()->getStreamSettingsArgs()->append(new SWGSDRangel::SWGArgInfo);
webapiFormatArgInfo(itArg, response.getSoapySdrInputReport()->getStreamSettingsArgs()->back());
}
response.getSoapySdrInputReport()->setFrequencySettingsArgs(new QList<SWGSDRangel::SWGArgInfo*>);
for (const auto itArg : channelSettings->m_frequencySettingsArgs)
{
response.getSoapySdrInputReport()->getFrequencySettingsArgs()->append(new SWGSDRangel::SWGArgInfo);
webapiFormatArgInfo(itArg, response.getSoapySdrInputReport()->getFrequencySettingsArgs()->back());
}
response.getSoapySdrInputReport()->setHasAgc(channelSettings->m_hasAGC ? 1 : 0);
response.getSoapySdrInputReport()->setHasDcAutoCorrection(channelSettings->m_hasDCAutoCorrection ? 1 : 0);
response.getSoapySdrInputReport()->setHasDcOffsetValue(channelSettings->m_hasDCOffsetValue ? 1 : 0);
response.getSoapySdrInputReport()->setHasFrequencyCorrectionValue(channelSettings->m_hasFrequencyCorrectionValue ? 1 : 0);
response.getSoapySdrInputReport()->setHasIqBalanceValue(channelSettings->m_hasIQBalanceValue ? 1 : 0);
if (channelSettings->m_antennas.size() != 0)
{
response.getSoapySdrInputReport()->setAntennas(new QList<QString *>);
for (const auto itAntenna : channelSettings->m_antennas) {
response.getSoapySdrInputReport()->getAntennas()->append(new QString(itAntenna.c_str()));
}
}
if ((channelSettings->m_gainRange.maximum() != 0.0) || (channelSettings->m_gainRange.minimum() != 0.0))
{
response.getSoapySdrInputReport()->setGainRange(new SWGSDRangel::SWGRangeFloat());
response.getSoapySdrInputReport()->getGainRange()->setMin(channelSettings->m_gainRange.minimum());
response.getSoapySdrInputReport()->getGainRange()->setMax(channelSettings->m_gainRange.maximum());
}
if (channelSettings->m_gainSettings.size() != 0)
{
response.getSoapySdrInputReport()->setGainSettings(new QList<SWGSDRangel::SWGSoapySDRGainSetting*>);
for (const auto itGain : channelSettings->m_gainSettings)
{
response.getSoapySdrInputReport()->getGainSettings()->append(new SWGSDRangel::SWGSoapySDRGainSetting());
response.getSoapySdrInputReport()->getGainSettings()->back()->setRange(new SWGSDRangel::SWGRangeFloat());
response.getSoapySdrInputReport()->getGainSettings()->back()->getRange()->setMin(itGain.m_range.minimum());
response.getSoapySdrInputReport()->getGainSettings()->back()->getRange()->setMax(itGain.m_range.maximum());
response.getSoapySdrInputReport()->getGainSettings()->back()->setName(new QString(itGain.m_name.c_str()));
}
}
if (channelSettings->m_frequencySettings.size() != 0)
{
response.getSoapySdrInputReport()->setFrequencySettings(new QList<SWGSDRangel::SWGSoapySDRFrequencySetting*>);
for (const auto itFreq : channelSettings->m_frequencySettings)
{
response.getSoapySdrInputReport()->getFrequencySettings()->append(new SWGSDRangel::SWGSoapySDRFrequencySetting());
response.getSoapySdrInputReport()->getFrequencySettings()->back()->setRanges(new QList<SWGSDRangel::SWGRangeFloat*>);
for (const auto itRange : itFreq.m_ranges)
{
response.getSoapySdrInputReport()->getFrequencySettings()->back()->getRanges()->append(new SWGSDRangel::SWGRangeFloat());
response.getSoapySdrInputReport()->getFrequencySettings()->back()->getRanges()->back()->setMin(itRange.minimum());
response.getSoapySdrInputReport()->getFrequencySettings()->back()->getRanges()->back()->setMax(itRange.maximum());
}
response.getSoapySdrInputReport()->getFrequencySettings()->back()->setName(new QString(itFreq.m_name.c_str()));
}
}
if (channelSettings->m_ratesRanges.size() != 0)
{
response.getSoapySdrInputReport()->setRatesRanges(new QList<SWGSDRangel::SWGRangeFloat*>);
for (const auto itRange : channelSettings->m_ratesRanges)
{
response.getSoapySdrInputReport()->getRatesRanges()->append(new SWGSDRangel::SWGRangeFloat());
response.getSoapySdrInputReport()->getRatesRanges()->back()->setMin(itRange.minimum());
response.getSoapySdrInputReport()->getRatesRanges()->back()->setMax(itRange.maximum());
}
}
if (channelSettings->m_bandwidthsRanges.size() != 0)
{
response.getSoapySdrInputReport()->setBandwidthsRanges(new QList<SWGSDRangel::SWGRangeFloat*>);
for (const auto itBandwidth : channelSettings->m_bandwidthsRanges)
{
response.getSoapySdrInputReport()->getBandwidthsRanges()->append(new SWGSDRangel::SWGRangeFloat());
response.getSoapySdrInputReport()->getBandwidthsRanges()->back()->setMin(itBandwidth.minimum());
response.getSoapySdrInputReport()->getBandwidthsRanges()->back()->setMax(itBandwidth.maximum());
}
}
}
void SoapySDRInput::webapiFormatArgValue(const QVariant& v, SWGSDRangel::SWGArgValue *argValue)
{
if (v.type() == QVariant::Bool)
{
argValue->setValueType(new QString("bool"));
argValue->setValueString(new QString(v.toBool() ? "1" : "0"));
}
else if (v.type() == QVariant::Int)
{
argValue->setValueType(new QString("int"));
argValue->setValueString(new QString(tr("%1").arg(v.toInt())));
}
else if (v.type() == QVariant::Double)
{
argValue->setValueType(new QString("float"));
argValue->setValueString(new QString(tr("%1").arg(v.toDouble())));
}
else
{
argValue->setValueType(new QString("string"));
argValue->setValueString(new QString(v.toString()));
}
}
void SoapySDRInput::webapiFormatArgInfo(const SoapySDR::ArgInfo& arg, SWGSDRangel::SWGArgInfo *argInfo)
{
argInfo->setKey(new QString(arg.key.c_str()));
if (arg.type == SoapySDR::ArgInfo::BOOL) {
argInfo->setValueType(new QString("bool"));
} else if (arg.type == SoapySDR::ArgInfo::INT) {
argInfo->setValueType(new QString("int"));
} else if (arg.type == SoapySDR::ArgInfo::FLOAT) {
argInfo->setValueType(new QString("float"));
} else {
argInfo->setValueType(new QString("string"));
}
argInfo->setValueString(new QString(arg.value.c_str()));
}

View File

@ -33,6 +33,13 @@ class FileRecord;
namespace SoapySDR
{
class Device;
class ArgInfo;
}
namespace SWGSDRangel
{
class SWGArgValue;
class SWGArgInfo;
}
class SoapySDRInput : public DeviceSampleSource
@ -182,6 +189,10 @@ private:
bool applySettings(const SoapySDRInputSettings& settings, bool force = false);
bool setDeviceCenterFrequency(SoapySDR::Device *dev, int requestedChannel, quint64 freq_hz, int loPpmTenths);
void updateGains(SoapySDR::Device *dev, int requestedChannel, SoapySDRInputSettings& settings);
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const SoapySDRInputSettings& settings);
void webapiFormatDeviceReport(SWGSDRangel::SWGDeviceReport& response);
void webapiFormatArgValue(const QVariant& v, SWGSDRangel::SWGArgValue *argValue);
void webapiFormatArgInfo(const SoapySDR::ArgInfo& arg, SWGSDRangel::SWGArgInfo *argInfo);
};

View File

@ -1033,6 +1033,44 @@ margin-bottom: 20px;
"description" : "Airspy"
};
defs.ArgInfo = {
"properties" : {
"key" : {
"type" : "string"
},
"valueType" : {
"type" : "string",
"enum" : [ "bool", "int", "float", "string" ]
},
"valueString" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"units" : {
"type" : "string"
},
"range" : {
"$ref" : "#/definitions/RangeFloat"
},
"valueOptions" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"optionNames" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
};
defs.ArgValue = {
"properties" : {
"key" : {
"type" : "string"
@ -3956,7 +3994,7 @@ margin-bottom: 20px;
"tunableElements" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"globalGain" : {
@ -3965,7 +4003,7 @@ margin-bottom: 20px;
"individualGains" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"autoGain" : {
@ -3989,13 +4027,13 @@ margin-bottom: 20px;
"streamArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"deviceArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
}
},
@ -4033,7 +4071,7 @@ margin-bottom: 20px;
"tunableElements" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"globalGain" : {
@ -4042,7 +4080,7 @@ margin-bottom: 20px;
"individualGains" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"autoGain" : {
@ -4066,13 +4104,13 @@ margin-bottom: 20px;
"streamArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"deviceArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
}
},
@ -23576,7 +23614,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-11-13T23:30:05.952+01:00
Generated 2018-11-14T01:13:54.986+01:00
</div>
</div>
</div>

View File

@ -33,13 +33,13 @@ SoapySDRInputSettings:
tunableElements:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
globalGain:
type: integer
individualGains:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
autoGain:
description: boolean not zero for true
type: integer
@ -56,11 +56,11 @@ SoapySDRInputSettings:
streamArgSettings:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
deviceArgSettings:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
SoapySDROutputSettings:
description: SoapySDR
@ -87,13 +87,13 @@ SoapySDROutputSettings:
tunableElements:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
globalGain:
type: integer
individualGains:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
autoGain:
description: boolean not zero for true
type: integer
@ -110,11 +110,11 @@ SoapySDROutputSettings:
streamArgSettings:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
deviceArgSettings:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
SoapySDRReport:
description: SoapySDR
@ -122,11 +122,11 @@ SoapySDRReport:
deviceSettingsArgs:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
streamSettingsArgs:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
hasDCAutoCorrection:
description: boolean not zero for true
type: integer
@ -159,7 +159,7 @@ SoapySDRReport:
frequencySettingsArgs:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
ratesRanges:
type: array
items:
@ -188,4 +188,44 @@ definitions:
type: array
items:
$ref: "/doc/swagger/include/Structs.yaml#/RangeFloat"
ArgValue:
descripion: Generic argument value
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
ArgInfo:
descripion: Generic argument information
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
name:
type: string
description:
type: string
units:
type: string
range:
$ref: "/doc/swagger/include/Structs.yaml#/RangeFloat"
valueOptions:
type: array
items:
type: string
optionNames:
type: array
items:
type: string

View File

@ -75,17 +75,6 @@ NamedEnum:
value:
type: integer
ArgInfo:
descripion: Argument information used in SoapySDR
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
Complex:
description: A complex number
properties:

View File

@ -33,13 +33,13 @@ SoapySDRInputSettings:
tunableElements:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
globalGain:
type: integer
individualGains:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
autoGain:
description: boolean not zero for true
type: integer
@ -56,11 +56,11 @@ SoapySDRInputSettings:
streamArgSettings:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
deviceArgSettings:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
SoapySDROutputSettings:
description: SoapySDR
@ -87,13 +87,13 @@ SoapySDROutputSettings:
tunableElements:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
globalGain:
type: integer
individualGains:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
autoGain:
description: boolean not zero for true
type: integer
@ -110,11 +110,11 @@ SoapySDROutputSettings:
streamArgSettings:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
deviceArgSettings:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgValue"
SoapySDRReport:
description: SoapySDR
@ -122,11 +122,11 @@ SoapySDRReport:
deviceSettingsArgs:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
streamSettingsArgs:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
hasDCAutoCorrection:
description: boolean not zero for true
type: integer
@ -159,7 +159,7 @@ SoapySDRReport:
frequencySettingsArgs:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/ArgInfo"
$ref: "#/definitions/ArgInfo"
ratesRanges:
type: array
items:
@ -188,4 +188,44 @@ definitions:
type: array
items:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/RangeFloat"
ArgValue:
descripion: Generic argument value
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
ArgInfo:
descripion: Generic argument information
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
name:
type: string
description:
type: string
units:
type: string
range:
$ref: "http://localhost:8081/api/swagger/include/Structs.yaml#/RangeFloat"
valueOptions:
type: array
items:
type: string
optionNames:
type: array
items:
type: string

View File

@ -75,17 +75,6 @@ NamedEnum:
value:
type: integer
ArgInfo:
descripion: Argument information used in SoapySDR
properties:
key:
type: string
valueType:
type: string
enum: [bool, int, float, string]
valueString:
type: string
Complex:
description: A complex number
properties:

View File

@ -1033,6 +1033,44 @@ margin-bottom: 20px;
"description" : "Airspy"
};
defs.ArgInfo = {
"properties" : {
"key" : {
"type" : "string"
},
"valueType" : {
"type" : "string",
"enum" : [ "bool", "int", "float", "string" ]
},
"valueString" : {
"type" : "string"
},
"name" : {
"type" : "string"
},
"description" : {
"type" : "string"
},
"units" : {
"type" : "string"
},
"range" : {
"$ref" : "#/definitions/RangeFloat"
},
"valueOptions" : {
"type" : "array",
"items" : {
"type" : "string"
}
},
"optionNames" : {
"type" : "array",
"items" : {
"type" : "string"
}
}
}
};
defs.ArgValue = {
"properties" : {
"key" : {
"type" : "string"
@ -3956,7 +3994,7 @@ margin-bottom: 20px;
"tunableElements" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"globalGain" : {
@ -3965,7 +4003,7 @@ margin-bottom: 20px;
"individualGains" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"autoGain" : {
@ -3989,13 +4027,13 @@ margin-bottom: 20px;
"streamArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"deviceArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
}
},
@ -4033,7 +4071,7 @@ margin-bottom: 20px;
"tunableElements" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"globalGain" : {
@ -4042,7 +4080,7 @@ margin-bottom: 20px;
"individualGains" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"autoGain" : {
@ -4066,13 +4104,13 @@ margin-bottom: 20px;
"streamArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
},
"deviceArgSettings" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/ArgInfo"
"$ref" : "#/definitions/ArgValue"
}
}
},
@ -23576,7 +23614,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-11-13T23:30:05.952+01:00
Generated 2018-11-14T01:13:54.986+01:00
</div>
</div>
</div>

View File

@ -34,6 +34,18 @@ SWGArgInfo::SWGArgInfo() {
m_value_type_isSet = false;
value_string = nullptr;
m_value_string_isSet = false;
name = nullptr;
m_name_isSet = false;
description = nullptr;
m_description_isSet = false;
units = nullptr;
m_units_isSet = false;
range = nullptr;
m_range_isSet = false;
value_options = nullptr;
m_value_options_isSet = false;
option_names = nullptr;
m_option_names_isSet = false;
}
SWGArgInfo::~SWGArgInfo() {
@ -48,6 +60,18 @@ SWGArgInfo::init() {
m_value_type_isSet = false;
value_string = new QString("");
m_value_string_isSet = false;
name = new QString("");
m_name_isSet = false;
description = new QString("");
m_description_isSet = false;
units = new QString("");
m_units_isSet = false;
range = new SWGRangeFloat();
m_range_isSet = false;
value_options = new QList<QString*>();
m_value_options_isSet = false;
option_names = new QList<QString*>();
m_option_names_isSet = false;
}
void
@ -61,6 +85,32 @@ SWGArgInfo::cleanup() {
if(value_string != nullptr) {
delete value_string;
}
if(name != nullptr) {
delete name;
}
if(description != nullptr) {
delete description;
}
if(units != nullptr) {
delete units;
}
if(range != nullptr) {
delete range;
}
if(value_options != nullptr) {
auto arr = value_options;
for(auto o: *arr) {
delete o;
}
delete value_options;
}
if(option_names != nullptr) {
auto arr = option_names;
for(auto o: *arr) {
delete o;
}
delete option_names;
}
}
SWGArgInfo*
@ -80,6 +130,18 @@ SWGArgInfo::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&value_string, pJson["valueString"], "QString", "QString");
::SWGSDRangel::setValue(&name, pJson["name"], "QString", "QString");
::SWGSDRangel::setValue(&description, pJson["description"], "QString", "QString");
::SWGSDRangel::setValue(&units, pJson["units"], "QString", "QString");
::SWGSDRangel::setValue(&range, pJson["range"], "SWGRangeFloat", "SWGRangeFloat");
::SWGSDRangel::setValue(&value_options, pJson["valueOptions"], "QList", "QString");
::SWGSDRangel::setValue(&option_names, pJson["optionNames"], "QList", "QString");
}
QString
@ -105,6 +167,24 @@ SWGArgInfo::asJsonObject() {
if(value_string != nullptr && *value_string != QString("")){
toJsonValue(QString("valueString"), value_string, obj, QString("QString"));
}
if(name != nullptr && *name != QString("")){
toJsonValue(QString("name"), name, obj, QString("QString"));
}
if(description != nullptr && *description != QString("")){
toJsonValue(QString("description"), description, obj, QString("QString"));
}
if(units != nullptr && *units != QString("")){
toJsonValue(QString("units"), units, obj, QString("QString"));
}
if((range != nullptr) && (range->isSet())){
toJsonValue(QString("range"), range, obj, QString("SWGRangeFloat"));
}
if(value_options->size() > 0){
toJsonArray((QList<void*>*)value_options, obj, "valueOptions", "QString");
}
if(option_names->size() > 0){
toJsonArray((QList<void*>*)option_names, obj, "optionNames", "QString");
}
return obj;
}
@ -139,6 +219,66 @@ SWGArgInfo::setValueString(QString* value_string) {
this->m_value_string_isSet = true;
}
QString*
SWGArgInfo::getName() {
return name;
}
void
SWGArgInfo::setName(QString* name) {
this->name = name;
this->m_name_isSet = true;
}
QString*
SWGArgInfo::getDescription() {
return description;
}
void
SWGArgInfo::setDescription(QString* description) {
this->description = description;
this->m_description_isSet = true;
}
QString*
SWGArgInfo::getUnits() {
return units;
}
void
SWGArgInfo::setUnits(QString* units) {
this->units = units;
this->m_units_isSet = true;
}
SWGRangeFloat*
SWGArgInfo::getRange() {
return range;
}
void
SWGArgInfo::setRange(SWGRangeFloat* range) {
this->range = range;
this->m_range_isSet = true;
}
QList<QString*>*
SWGArgInfo::getValueOptions() {
return value_options;
}
void
SWGArgInfo::setValueOptions(QList<QString*>* value_options) {
this->value_options = value_options;
this->m_value_options_isSet = true;
}
QList<QString*>*
SWGArgInfo::getOptionNames() {
return option_names;
}
void
SWGArgInfo::setOptionNames(QList<QString*>* option_names) {
this->option_names = option_names;
this->m_option_names_isSet = true;
}
bool
SWGArgInfo::isSet(){
@ -147,6 +287,12 @@ SWGArgInfo::isSet(){
if(key != nullptr && *key != QString("")){ isObjectUpdated = true; break;}
if(value_type != nullptr && *value_type != QString("")){ isObjectUpdated = true; break;}
if(value_string != nullptr && *value_string != QString("")){ isObjectUpdated = true; break;}
if(name != nullptr && *name != QString("")){ isObjectUpdated = true; break;}
if(description != nullptr && *description != QString("")){ isObjectUpdated = true; break;}
if(units != nullptr && *units != QString("")){ isObjectUpdated = true; break;}
if(range != nullptr && range->isSet()){ isObjectUpdated = true; break;}
if(value_options->size() > 0){ isObjectUpdated = true; break;}
if(option_names->size() > 0){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}

View File

@ -22,6 +22,8 @@
#include <QJsonObject>
#include "SWGRangeFloat.h"
#include <QList>
#include <QString>
#include "SWGObject.h"
@ -51,6 +53,24 @@ public:
QString* getValueString();
void setValueString(QString* value_string);
QString* getName();
void setName(QString* name);
QString* getDescription();
void setDescription(QString* description);
QString* getUnits();
void setUnits(QString* units);
SWGRangeFloat* getRange();
void setRange(SWGRangeFloat* range);
QList<QString*>* getValueOptions();
void setValueOptions(QList<QString*>* value_options);
QList<QString*>* getOptionNames();
void setOptionNames(QList<QString*>* option_names);
virtual bool isSet() override;
@ -64,6 +84,24 @@ private:
QString* value_string;
bool m_value_string_isSet;
QString* name;
bool m_name_isSet;
QString* description;
bool m_description_isSet;
QString* units;
bool m_units_isSet;
SWGRangeFloat* range;
bool m_range_isSet;
QList<QString*>* value_options;
bool m_value_options_isSet;
QList<QString*>* option_names;
bool m_option_names_isSet;
};
}

View File

@ -0,0 +1,154 @@
/**
* 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.3.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 "SWGArgValue.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGArgValue::SWGArgValue(QString* json) {
init();
this->fromJson(*json);
}
SWGArgValue::SWGArgValue() {
key = nullptr;
m_key_isSet = false;
value_type = nullptr;
m_value_type_isSet = false;
value_string = nullptr;
m_value_string_isSet = false;
}
SWGArgValue::~SWGArgValue() {
this->cleanup();
}
void
SWGArgValue::init() {
key = new QString("");
m_key_isSet = false;
value_type = new QString("");
m_value_type_isSet = false;
value_string = new QString("");
m_value_string_isSet = false;
}
void
SWGArgValue::cleanup() {
if(key != nullptr) {
delete key;
}
if(value_type != nullptr) {
delete value_type;
}
if(value_string != nullptr) {
delete value_string;
}
}
SWGArgValue*
SWGArgValue::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGArgValue::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&key, pJson["key"], "QString", "QString");
::SWGSDRangel::setValue(&value_type, pJson["valueType"], "QString", "QString");
::SWGSDRangel::setValue(&value_string, pJson["valueString"], "QString", "QString");
}
QString
SWGArgValue::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGArgValue::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(key != nullptr && *key != QString("")){
toJsonValue(QString("key"), key, obj, QString("QString"));
}
if(value_type != nullptr && *value_type != QString("")){
toJsonValue(QString("valueType"), value_type, obj, QString("QString"));
}
if(value_string != nullptr && *value_string != QString("")){
toJsonValue(QString("valueString"), value_string, obj, QString("QString"));
}
return obj;
}
QString*
SWGArgValue::getKey() {
return key;
}
void
SWGArgValue::setKey(QString* key) {
this->key = key;
this->m_key_isSet = true;
}
QString*
SWGArgValue::getValueType() {
return value_type;
}
void
SWGArgValue::setValueType(QString* value_type) {
this->value_type = value_type;
this->m_value_type_isSet = true;
}
QString*
SWGArgValue::getValueString() {
return value_string;
}
void
SWGArgValue::setValueString(QString* value_string) {
this->value_string = value_string;
this->m_value_string_isSet = true;
}
bool
SWGArgValue::isSet(){
bool isObjectUpdated = false;
do{
if(key != nullptr && *key != QString("")){ isObjectUpdated = true; break;}
if(value_type != nullptr && *value_type != QString("")){ isObjectUpdated = true; break;}
if(value_string != nullptr && *value_string != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,71 @@
/**
* 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.3.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.
*/
/*
* SWGArgValue.h
*
*
*/
#ifndef SWGArgValue_H_
#define SWGArgValue_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGArgValue: public SWGObject {
public:
SWGArgValue();
SWGArgValue(QString* json);
virtual ~SWGArgValue();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGArgValue* fromJson(QString &jsonString) override;
QString* getKey();
void setKey(QString* key);
QString* getValueType();
void setValueType(QString* value_type);
QString* getValueString();
void setValueString(QString* value_string);
virtual bool isSet() override;
private:
QString* key;
bool m_key_isSet;
QString* value_type;
bool m_value_type_isSet;
QString* value_string;
bool m_value_string_isSet;
};
}
#endif /* SWGArgValue_H_ */

View File

@ -25,6 +25,7 @@
#include "SWGAirspyReport.h"
#include "SWGAirspySettings.h"
#include "SWGArgInfo.h"
#include "SWGArgValue.h"
#include "SWGAudioDevices.h"
#include "SWGAudioInputDevice.h"
#include "SWGAudioOutputDevice.h"
@ -165,6 +166,9 @@ namespace SWGSDRangel {
if(QString("SWGArgInfo").compare(type) == 0) {
return new SWGArgInfo();
}
if(QString("SWGArgValue").compare(type) == 0) {
return new SWGArgValue();
}
if(QString("SWGAudioDevices").compare(type) == 0) {
return new SWGAudioDevices();
}

View File

@ -104,11 +104,11 @@ SWGSoapySDRInputSettings::init() {
m_antenna_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
tunable_elements = new QList<SWGArgInfo*>();
tunable_elements = new QList<SWGArgValue*>();
m_tunable_elements_isSet = false;
global_gain = 0;
m_global_gain_isSet = false;
individual_gains = new QList<SWGArgInfo*>();
individual_gains = new QList<SWGArgValue*>();
m_individual_gains_isSet = false;
auto_gain = 0;
m_auto_gain_isSet = false;
@ -120,9 +120,9 @@ SWGSoapySDRInputSettings::init() {
m_dc_correction_isSet = false;
iq_correction = new SWGComplex();
m_iq_correction_isSet = false;
stream_arg_settings = new QList<SWGArgInfo*>();
stream_arg_settings = new QList<SWGArgValue*>();
m_stream_arg_settings_isSet = false;
device_arg_settings = new QList<SWGArgInfo*>();
device_arg_settings = new QList<SWGArgValue*>();
m_device_arg_settings_isSet = false;
}
@ -220,11 +220,11 @@ SWGSoapySDRInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::SWGSDRangel::setValue(&tunable_elements, pJson["tunableElements"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&tunable_elements, pJson["tunableElements"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&global_gain, pJson["globalGain"], "qint32", "");
::SWGSDRangel::setValue(&individual_gains, pJson["individualGains"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&individual_gains, pJson["individualGains"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&auto_gain, pJson["autoGain"], "qint32", "");
::SWGSDRangel::setValue(&auto_dc_correction, pJson["autoDCCorrection"], "qint32", "");
@ -236,9 +236,9 @@ SWGSoapySDRInputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "SWGComplex", "SWGComplex");
::SWGSDRangel::setValue(&stream_arg_settings, pJson["streamArgSettings"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&stream_arg_settings, pJson["streamArgSettings"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&device_arg_settings, pJson["deviceArgSettings"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&device_arg_settings, pJson["deviceArgSettings"], "QList", "SWGArgValue");
}
QString
@ -292,13 +292,13 @@ SWGSoapySDRInputSettings::asJsonObject() {
obj->insert("bandwidth", QJsonValue(bandwidth));
}
if(tunable_elements->size() > 0){
toJsonArray((QList<void*>*)tunable_elements, obj, "tunableElements", "SWGArgInfo");
toJsonArray((QList<void*>*)tunable_elements, obj, "tunableElements", "SWGArgValue");
}
if(m_global_gain_isSet){
obj->insert("globalGain", QJsonValue(global_gain));
}
if(individual_gains->size() > 0){
toJsonArray((QList<void*>*)individual_gains, obj, "individualGains", "SWGArgInfo");
toJsonArray((QList<void*>*)individual_gains, obj, "individualGains", "SWGArgValue");
}
if(m_auto_gain_isSet){
obj->insert("autoGain", QJsonValue(auto_gain));
@ -316,10 +316,10 @@ SWGSoapySDRInputSettings::asJsonObject() {
toJsonValue(QString("iqCorrection"), iq_correction, obj, QString("SWGComplex"));
}
if(stream_arg_settings->size() > 0){
toJsonArray((QList<void*>*)stream_arg_settings, obj, "streamArgSettings", "SWGArgInfo");
toJsonArray((QList<void*>*)stream_arg_settings, obj, "streamArgSettings", "SWGArgValue");
}
if(device_arg_settings->size() > 0){
toJsonArray((QList<void*>*)device_arg_settings, obj, "deviceArgSettings", "SWGArgInfo");
toJsonArray((QList<void*>*)device_arg_settings, obj, "deviceArgSettings", "SWGArgValue");
}
return obj;
@ -445,12 +445,12 @@ SWGSoapySDRInputSettings::setBandwidth(qint32 bandwidth) {
this->m_bandwidth_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDRInputSettings::getTunableElements() {
return tunable_elements;
}
void
SWGSoapySDRInputSettings::setTunableElements(QList<SWGArgInfo*>* tunable_elements) {
SWGSoapySDRInputSettings::setTunableElements(QList<SWGArgValue*>* tunable_elements) {
this->tunable_elements = tunable_elements;
this->m_tunable_elements_isSet = true;
}
@ -465,12 +465,12 @@ SWGSoapySDRInputSettings::setGlobalGain(qint32 global_gain) {
this->m_global_gain_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDRInputSettings::getIndividualGains() {
return individual_gains;
}
void
SWGSoapySDRInputSettings::setIndividualGains(QList<SWGArgInfo*>* individual_gains) {
SWGSoapySDRInputSettings::setIndividualGains(QList<SWGArgValue*>* individual_gains) {
this->individual_gains = individual_gains;
this->m_individual_gains_isSet = true;
}
@ -525,22 +525,22 @@ SWGSoapySDRInputSettings::setIqCorrection(SWGComplex* iq_correction) {
this->m_iq_correction_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDRInputSettings::getStreamArgSettings() {
return stream_arg_settings;
}
void
SWGSoapySDRInputSettings::setStreamArgSettings(QList<SWGArgInfo*>* stream_arg_settings) {
SWGSoapySDRInputSettings::setStreamArgSettings(QList<SWGArgValue*>* stream_arg_settings) {
this->stream_arg_settings = stream_arg_settings;
this->m_stream_arg_settings_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDRInputSettings::getDeviceArgSettings() {
return device_arg_settings;
}
void
SWGSoapySDRInputSettings::setDeviceArgSettings(QList<SWGArgInfo*>* device_arg_settings) {
SWGSoapySDRInputSettings::setDeviceArgSettings(QList<SWGArgValue*>* device_arg_settings) {
this->device_arg_settings = device_arg_settings;
this->m_device_arg_settings_isSet = true;
}

View File

@ -22,7 +22,7 @@
#include <QJsonObject>
#include "SWGArgInfo.h"
#include "SWGArgValue.h"
#include "SWGComplex.h"
#include <QList>
#include <QString>
@ -81,14 +81,14 @@ public:
qint32 getBandwidth();
void setBandwidth(qint32 bandwidth);
QList<SWGArgInfo*>* getTunableElements();
void setTunableElements(QList<SWGArgInfo*>* tunable_elements);
QList<SWGArgValue*>* getTunableElements();
void setTunableElements(QList<SWGArgValue*>* tunable_elements);
qint32 getGlobalGain();
void setGlobalGain(qint32 global_gain);
QList<SWGArgInfo*>* getIndividualGains();
void setIndividualGains(QList<SWGArgInfo*>* individual_gains);
QList<SWGArgValue*>* getIndividualGains();
void setIndividualGains(QList<SWGArgValue*>* individual_gains);
qint32 getAutoGain();
void setAutoGain(qint32 auto_gain);
@ -105,11 +105,11 @@ public:
SWGComplex* getIqCorrection();
void setIqCorrection(SWGComplex* iq_correction);
QList<SWGArgInfo*>* getStreamArgSettings();
void setStreamArgSettings(QList<SWGArgInfo*>* stream_arg_settings);
QList<SWGArgValue*>* getStreamArgSettings();
void setStreamArgSettings(QList<SWGArgValue*>* stream_arg_settings);
QList<SWGArgInfo*>* getDeviceArgSettings();
void setDeviceArgSettings(QList<SWGArgInfo*>* device_arg_settings);
QList<SWGArgValue*>* getDeviceArgSettings();
void setDeviceArgSettings(QList<SWGArgValue*>* device_arg_settings);
virtual bool isSet() override;
@ -151,13 +151,13 @@ private:
qint32 bandwidth;
bool m_bandwidth_isSet;
QList<SWGArgInfo*>* tunable_elements;
QList<SWGArgValue*>* tunable_elements;
bool m_tunable_elements_isSet;
qint32 global_gain;
bool m_global_gain_isSet;
QList<SWGArgInfo*>* individual_gains;
QList<SWGArgValue*>* individual_gains;
bool m_individual_gains_isSet;
qint32 auto_gain;
@ -175,10 +175,10 @@ private:
SWGComplex* iq_correction;
bool m_iq_correction_isSet;
QList<SWGArgInfo*>* stream_arg_settings;
QList<SWGArgValue*>* stream_arg_settings;
bool m_stream_arg_settings_isSet;
QList<SWGArgInfo*>* device_arg_settings;
QList<SWGArgValue*>* device_arg_settings;
bool m_device_arg_settings_isSet;
};

View File

@ -88,11 +88,11 @@ SWGSoapySDROutputSettings::init() {
m_antenna_isSet = false;
bandwidth = 0;
m_bandwidth_isSet = false;
tunable_elements = new QList<SWGArgInfo*>();
tunable_elements = new QList<SWGArgValue*>();
m_tunable_elements_isSet = false;
global_gain = 0;
m_global_gain_isSet = false;
individual_gains = new QList<SWGArgInfo*>();
individual_gains = new QList<SWGArgValue*>();
m_individual_gains_isSet = false;
auto_gain = 0;
m_auto_gain_isSet = false;
@ -104,9 +104,9 @@ SWGSoapySDROutputSettings::init() {
m_dc_correction_isSet = false;
iq_correction = new SWGComplex();
m_iq_correction_isSet = false;
stream_arg_settings = new QList<SWGArgInfo*>();
stream_arg_settings = new QList<SWGArgValue*>();
m_stream_arg_settings_isSet = false;
device_arg_settings = new QList<SWGArgInfo*>();
device_arg_settings = new QList<SWGArgValue*>();
m_device_arg_settings_isSet = false;
}
@ -190,11 +190,11 @@ SWGSoapySDROutputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&bandwidth, pJson["bandwidth"], "qint32", "");
::SWGSDRangel::setValue(&tunable_elements, pJson["tunableElements"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&tunable_elements, pJson["tunableElements"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&global_gain, pJson["globalGain"], "qint32", "");
::SWGSDRangel::setValue(&individual_gains, pJson["individualGains"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&individual_gains, pJson["individualGains"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&auto_gain, pJson["autoGain"], "qint32", "");
::SWGSDRangel::setValue(&auto_dc_correction, pJson["autoDCCorrection"], "qint32", "");
@ -206,9 +206,9 @@ SWGSoapySDROutputSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&iq_correction, pJson["iqCorrection"], "SWGComplex", "SWGComplex");
::SWGSDRangel::setValue(&stream_arg_settings, pJson["streamArgSettings"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&stream_arg_settings, pJson["streamArgSettings"], "QList", "SWGArgValue");
::SWGSDRangel::setValue(&device_arg_settings, pJson["deviceArgSettings"], "QList", "SWGArgInfo");
::SWGSDRangel::setValue(&device_arg_settings, pJson["deviceArgSettings"], "QList", "SWGArgValue");
}
QString
@ -250,13 +250,13 @@ SWGSoapySDROutputSettings::asJsonObject() {
obj->insert("bandwidth", QJsonValue(bandwidth));
}
if(tunable_elements->size() > 0){
toJsonArray((QList<void*>*)tunable_elements, obj, "tunableElements", "SWGArgInfo");
toJsonArray((QList<void*>*)tunable_elements, obj, "tunableElements", "SWGArgValue");
}
if(m_global_gain_isSet){
obj->insert("globalGain", QJsonValue(global_gain));
}
if(individual_gains->size() > 0){
toJsonArray((QList<void*>*)individual_gains, obj, "individualGains", "SWGArgInfo");
toJsonArray((QList<void*>*)individual_gains, obj, "individualGains", "SWGArgValue");
}
if(m_auto_gain_isSet){
obj->insert("autoGain", QJsonValue(auto_gain));
@ -274,10 +274,10 @@ SWGSoapySDROutputSettings::asJsonObject() {
toJsonValue(QString("iqCorrection"), iq_correction, obj, QString("SWGComplex"));
}
if(stream_arg_settings->size() > 0){
toJsonArray((QList<void*>*)stream_arg_settings, obj, "streamArgSettings", "SWGArgInfo");
toJsonArray((QList<void*>*)stream_arg_settings, obj, "streamArgSettings", "SWGArgValue");
}
if(device_arg_settings->size() > 0){
toJsonArray((QList<void*>*)device_arg_settings, obj, "deviceArgSettings", "SWGArgInfo");
toJsonArray((QList<void*>*)device_arg_settings, obj, "deviceArgSettings", "SWGArgValue");
}
return obj;
@ -363,12 +363,12 @@ SWGSoapySDROutputSettings::setBandwidth(qint32 bandwidth) {
this->m_bandwidth_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDROutputSettings::getTunableElements() {
return tunable_elements;
}
void
SWGSoapySDROutputSettings::setTunableElements(QList<SWGArgInfo*>* tunable_elements) {
SWGSoapySDROutputSettings::setTunableElements(QList<SWGArgValue*>* tunable_elements) {
this->tunable_elements = tunable_elements;
this->m_tunable_elements_isSet = true;
}
@ -383,12 +383,12 @@ SWGSoapySDROutputSettings::setGlobalGain(qint32 global_gain) {
this->m_global_gain_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDROutputSettings::getIndividualGains() {
return individual_gains;
}
void
SWGSoapySDROutputSettings::setIndividualGains(QList<SWGArgInfo*>* individual_gains) {
SWGSoapySDROutputSettings::setIndividualGains(QList<SWGArgValue*>* individual_gains) {
this->individual_gains = individual_gains;
this->m_individual_gains_isSet = true;
}
@ -443,22 +443,22 @@ SWGSoapySDROutputSettings::setIqCorrection(SWGComplex* iq_correction) {
this->m_iq_correction_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDROutputSettings::getStreamArgSettings() {
return stream_arg_settings;
}
void
SWGSoapySDROutputSettings::setStreamArgSettings(QList<SWGArgInfo*>* stream_arg_settings) {
SWGSoapySDROutputSettings::setStreamArgSettings(QList<SWGArgValue*>* stream_arg_settings) {
this->stream_arg_settings = stream_arg_settings;
this->m_stream_arg_settings_isSet = true;
}
QList<SWGArgInfo*>*
QList<SWGArgValue*>*
SWGSoapySDROutputSettings::getDeviceArgSettings() {
return device_arg_settings;
}
void
SWGSoapySDROutputSettings::setDeviceArgSettings(QList<SWGArgInfo*>* device_arg_settings) {
SWGSoapySDROutputSettings::setDeviceArgSettings(QList<SWGArgValue*>* device_arg_settings) {
this->device_arg_settings = device_arg_settings;
this->m_device_arg_settings_isSet = true;
}

View File

@ -22,7 +22,7 @@
#include <QJsonObject>
#include "SWGArgInfo.h"
#include "SWGArgValue.h"
#include "SWGComplex.h"
#include <QList>
#include <QString>
@ -69,14 +69,14 @@ public:
qint32 getBandwidth();
void setBandwidth(qint32 bandwidth);
QList<SWGArgInfo*>* getTunableElements();
void setTunableElements(QList<SWGArgInfo*>* tunable_elements);
QList<SWGArgValue*>* getTunableElements();
void setTunableElements(QList<SWGArgValue*>* tunable_elements);
qint32 getGlobalGain();
void setGlobalGain(qint32 global_gain);
QList<SWGArgInfo*>* getIndividualGains();
void setIndividualGains(QList<SWGArgInfo*>* individual_gains);
QList<SWGArgValue*>* getIndividualGains();
void setIndividualGains(QList<SWGArgValue*>* individual_gains);
qint32 getAutoGain();
void setAutoGain(qint32 auto_gain);
@ -93,11 +93,11 @@ public:
SWGComplex* getIqCorrection();
void setIqCorrection(SWGComplex* iq_correction);
QList<SWGArgInfo*>* getStreamArgSettings();
void setStreamArgSettings(QList<SWGArgInfo*>* stream_arg_settings);
QList<SWGArgValue*>* getStreamArgSettings();
void setStreamArgSettings(QList<SWGArgValue*>* stream_arg_settings);
QList<SWGArgInfo*>* getDeviceArgSettings();
void setDeviceArgSettings(QList<SWGArgInfo*>* device_arg_settings);
QList<SWGArgValue*>* getDeviceArgSettings();
void setDeviceArgSettings(QList<SWGArgValue*>* device_arg_settings);
virtual bool isSet() override;
@ -127,13 +127,13 @@ private:
qint32 bandwidth;
bool m_bandwidth_isSet;
QList<SWGArgInfo*>* tunable_elements;
QList<SWGArgValue*>* tunable_elements;
bool m_tunable_elements_isSet;
qint32 global_gain;
bool m_global_gain_isSet;
QList<SWGArgInfo*>* individual_gains;
QList<SWGArgValue*>* individual_gains;
bool m_individual_gains_isSet;
qint32 auto_gain;
@ -151,10 +151,10 @@ private:
SWGComplex* iq_correction;
bool m_iq_correction_isSet;
QList<SWGArgInfo*>* stream_arg_settings;
QList<SWGArgValue*>* stream_arg_settings;
bool m_stream_arg_settings_isSet;
QList<SWGArgInfo*>* device_arg_settings;
QList<SWGArgValue*>* device_arg_settings;
bool m_device_arg_settings_isSet;
};