1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-17 23:28:50 -05:00

FCD Pro Plus input: implemeted WEB API

This commit is contained in:
f4exb 2018-05-26 10:54:31 +02:00
parent 4a5369c1b4
commit 268ad2b33f
18 changed files with 872 additions and 25 deletions

View File

@ -880,7 +880,7 @@ void FCDProInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& res
response.getFcdProSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getFcdProSettings()->setLOppmTenths(settings.m_LOppmTenths);
response.getFcdProSettings()->setLnaGainIndex(settings.m_lnaGainIndex);
response.getFcdProSettings()->setRfFilterIndex(settings.m_lnaGainIndex);
response.getFcdProSettings()->setRfFilterIndex(settings.m_rfFilterIndex);
response.getFcdProSettings()->setLnaEnhanceIndex(settings.m_lnaEnhanceIndex);
response.getFcdProSettings()->setBandIndex(settings.m_bandIndex);
response.getFcdProSettings()->setMixerGainIndex(settings.m_mixerGainIndex);

View File

@ -129,9 +129,9 @@ bool FCDProPlusGui::deserialize(const QByteArray& data)
bool FCDProPlusGui::handleMessage(const Message& message __attribute__((unused)))
{
if (FCDProPlusInput::MsgConfigureFCD::match(message))
if (FCDProPlusInput::MsgConfigureFCDProPlus::match(message))
{
const FCDProPlusInput::MsgConfigureFCD& cfg = (FCDProPlusInput::MsgConfigureFCD&) message;
const FCDProPlusInput::MsgConfigureFCDProPlus& cfg = (FCDProPlusInput::MsgConfigureFCDProPlus&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
@ -241,7 +241,7 @@ void FCDProPlusGui::on_iqImbalance_toggled(bool checked)
void FCDProPlusGui::updateHardware()
{
FCDProPlusInput::MsgConfigureFCD* message = FCDProPlusInput::MsgConfigureFCD::create(m_settings, m_forceSettings);
FCDProPlusInput::MsgConfigureFCDProPlus* message = FCDProPlusInput::MsgConfigureFCDProPlus::create(m_settings, m_forceSettings);
m_sampleSource->getInputMessageQueue()->push(message);
m_forceSettings = false;
m_updateTimer.stop();

View File

@ -35,7 +35,7 @@
#include "fcdtraits.h"
#include "fcdproplusconst.h"
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCD, Message)
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCDProPlus, Message)
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgStartStop, Message)
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgFileRecord, Message)
@ -164,12 +164,12 @@ bool FCDProPlusInput::deserialize(const QByteArray& data)
success = false;
}
MsgConfigureFCD* message = MsgConfigureFCD::create(m_settings, true);
MsgConfigureFCDProPlus* message = MsgConfigureFCDProPlus::create(m_settings, true);
m_inputMessageQueue.push(message);
if (m_guiMessageQueue)
{
MsgConfigureFCD* messageToGUI = MsgConfigureFCD::create(m_settings, true);
MsgConfigureFCDProPlus* messageToGUI = MsgConfigureFCDProPlus::create(m_settings, true);
m_guiMessageQueue->push(messageToGUI);
}
@ -196,22 +196,22 @@ void FCDProPlusInput::setCenterFrequency(qint64 centerFrequency)
FCDProPlusSettings settings = m_settings;
settings.m_centerFrequency = centerFrequency;
MsgConfigureFCD* message = MsgConfigureFCD::create(settings, false);
MsgConfigureFCDProPlus* message = MsgConfigureFCDProPlus::create(settings, false);
m_inputMessageQueue.push(message);
if (m_guiMessageQueue)
{
MsgConfigureFCD* messageToGUI = MsgConfigureFCD::create(settings, false);
MsgConfigureFCDProPlus* messageToGUI = MsgConfigureFCDProPlus::create(settings, false);
m_guiMessageQueue->push(messageToGUI);
}
}
bool FCDProPlusInput::handleMessage(const Message& message)
{
if(MsgConfigureFCD::match(message))
if(MsgConfigureFCDProPlus::match(message))
{
qDebug() << "FCDProPlusInput::handleMessage: MsgConfigureFCD";
MsgConfigureFCD& conf = (MsgConfigureFCD&) message;
MsgConfigureFCDProPlus& conf = (MsgConfigureFCDProPlus&) message;
applySettings(conf.getSettings(), conf.getForce());
return true;
}
@ -485,5 +485,101 @@ int FCDProPlusInput::webapiRun(
return 200;
}
int FCDProPlusInput::webapiSettingsGet(
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage __attribute__((unused)))
{
response.setFcdProPlusSettings(new SWGSDRangel::SWGFCDProPlusSettings());
response.getFcdProPlusSettings()->init();
webapiFormatDeviceSettings(response, m_settings);
return 200;
}
int FCDProPlusInput::webapiSettingsPutPatch(
bool force,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response, // query + response
QString& errorMessage __attribute__((unused)))
{
FCDProPlusSettings settings = m_settings;
if (deviceSettingsKeys.contains("centerFrequency")) {
settings.m_centerFrequency = response.getFcdProPlusSettings()->getCenterFrequency();
}
if (deviceSettingsKeys.contains("rangeLow")) {
settings.m_rangeLow = response.getFcdProPlusSettings()->getRangeLow() != 0;
}
if (deviceSettingsKeys.contains("lnaGain")) {
settings.m_lnaGain = response.getFcdProPlusSettings()->getLnaGain() != 0;
}
if (deviceSettingsKeys.contains("mixGain")) {
settings.m_mixGain = response.getFcdProPlusSettings()->getMixGain() != 0;
}
if (deviceSettingsKeys.contains("biasT")) {
settings.m_biasT = response.getFcdProPlusSettings()->getBiasT() != 0;
}
if (deviceSettingsKeys.contains("ifGain")) {
settings.m_ifGain = response.getFcdProPlusSettings()->getIfGain();
}
if (deviceSettingsKeys.contains("ifFilterIndex")) {
settings.m_ifFilterIndex = response.getFcdProPlusSettings()->getIfFilterIndex();
}
if (deviceSettingsKeys.contains("rfFilterIndex")) {
settings.m_rfFilterIndex = response.getFcdProPlusSettings()->getRfFilterIndex();
}
if (deviceSettingsKeys.contains("LOppmTenths")) {
settings.m_LOppmTenths = response.getFcdProPlusSettings()->getLOppmTenths();
}
if (deviceSettingsKeys.contains("dcBlock")) {
settings.m_dcBlock = response.getFcdProPlusSettings()->getDcBlock() != 0;
}
if (deviceSettingsKeys.contains("iqImbalance")) {
settings.m_iqImbalance = response.getFcdProPlusSettings()->getIqImbalance() != 0;
}
if (deviceSettingsKeys.contains("transverterDeltaFrequency")) {
settings.m_transverterDeltaFrequency = response.getFcdProPlusSettings()->getTransverterDeltaFrequency();
}
if (deviceSettingsKeys.contains("transverterMode")) {
settings.m_transverterMode = response.getFcdProPlusSettings()->getTransverterMode() != 0;
}
if (deviceSettingsKeys.contains("fileRecordName")) {
settings.m_fileRecordName = *response.getFcdProPlusSettings()->getFileRecordName();
}
MsgConfigureFCDProPlus *msg = MsgConfigureFCDProPlus::create(settings, force);
m_inputMessageQueue.push(msg);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureFCDProPlus *msgToGUI = MsgConfigureFCDProPlus::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatDeviceSettings(response, settings);
return 200;
}
void FCDProPlusInput::webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const FCDProPlusSettings& settings)
{
response.getFcdProPlusSettings()->setCenterFrequency(settings.m_centerFrequency);
response.getFcdProPlusSettings()->setRangeLow(settings.m_rangeLow ? 1 : 0);
response.getFcdProPlusSettings()->setLnaGain(settings.m_lnaGain ? 1 : 0);
response.getFcdProPlusSettings()->setMixGain(settings.m_mixGain ? 1 : 0);
response.getFcdProPlusSettings()->setBiasT(settings.m_biasT ? 1 : 0);
response.getFcdProPlusSettings()->setIfGain(settings.m_ifGain);
response.getFcdProPlusSettings()->setIfFilterIndex(settings.m_ifFilterIndex);
response.getFcdProPlusSettings()->setRfFilterIndex(settings.m_rfFilterIndex);
response.getFcdProPlusSettings()->setLOppmTenths(settings.m_LOppmTenths);
response.getFcdProPlusSettings()->setDcBlock(settings.m_dcBlock ? 1 : 0);
response.getFcdProPlusSettings()->setIqImbalance(settings.m_iqImbalance ? 1 : 0);
response.getFcdProPlusSettings()->setTransverterDeltaFrequency(settings.m_transverterDeltaFrequency);
response.getFcdProPlusSettings()->setTransverterMode(settings.m_transverterMode ? 1 : 0);
if (response.getFcdProPlusSettings()->getFileRecordName()) {
*response.getFcdProPlusSettings()->getFileRecordName() = settings.m_fileRecordName;
} else {
response.getFcdProPlusSettings()->setFileRecordName(new QString(settings.m_fileRecordName));
}
}

View File

@ -36,23 +36,23 @@ class FileRecord;
class FCDProPlusInput : public DeviceSampleSource {
public:
class MsgConfigureFCD : public Message {
class MsgConfigureFCDProPlus : public Message {
MESSAGE_CLASS_DECLARATION
public:
const FCDProPlusSettings& getSettings() const { return m_settings; }
bool getForce() const { return m_force; }
static MsgConfigureFCD* create(const FCDProPlusSettings& settings, bool force)
static MsgConfigureFCDProPlus* create(const FCDProPlusSettings& settings, bool force)
{
return new MsgConfigureFCD(settings, force);
return new MsgConfigureFCDProPlus(settings, force);
}
private:
FCDProPlusSettings m_settings;
bool m_force;
MsgConfigureFCD(const FCDProPlusSettings& settings, bool force) :
MsgConfigureFCDProPlus(const FCDProPlusSettings& settings, bool force) :
Message(),
m_settings(settings),
m_force(force)
@ -125,6 +125,16 @@ public:
SWGSDRangel::SWGDeviceState& response,
QString& errorMessage);
virtual int webapiSettingsGet(
SWGSDRangel::SWGDeviceSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& deviceSettingsKeys,
SWGSDRangel::SWGDeviceSettings& response, // query + response
QString& errorMessage);
void set_center_freq(double freq);
void set_bias_t(bool on);
void set_lna_gain(bool on);
@ -138,6 +148,7 @@ private:
bool openDevice();
void closeDevice();
void applySettings(const FCDProPlusSettings& settings, bool force);
void webapiFormatDeviceSettings(SWGSDRangel::SWGDeviceSettings& response, const FCDProPlusSettings& settings);
DeviceSourceAPI *m_deviceAPI;
hid_device *m_dev;

View File

@ -28,7 +28,7 @@
#include "fcdtraits.h"
#include "fcdproplusconst.h"
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCD, Message)
MESSAGE_CLASS_DEFINITION(FCDProPlusInput::MsgConfigureFCDProPlus, Message)
FCDProPlusInput::FCDProPlusInput() :
m_dev(0),
@ -115,10 +115,10 @@ quint64 FCDProPlusInput::getCenterFrequency() const
bool FCDProPlusInput::handleMessage(const Message& message)
{
if(MsgConfigureFCD::match(message))
if(MsgConfigureFCDProPlus::match(message))
{
qDebug() << "FCDProPlusInput::handleMessage: MsgConfigureFCD";
MsgConfigureFCD& conf = (MsgConfigureFCD&) message;
MsgConfigureFCDProPlus& conf = (MsgConfigureFCDProPlus&) message;
applySettings(conf.getSettings(), false);
return true;
}

View File

@ -35,15 +35,15 @@ class FCDProPlusReader;
class FCDProPlusInput : public DeviceSampleSource {
public:
class MsgConfigureFCD : public Message {
class MsgConfigureFCDProPlus : public Message {
MESSAGE_CLASS_DECLARATION
public:
const FCDProPlusSettings& getSettings() const { return m_settings; }
static MsgConfigureFCD* create(const FCDProPlusSettings& settings)
static MsgConfigureFCDProPlus* create(const FCDProPlusSettings& settings)
{
return new MsgConfigureFCD(settings);
return new MsgConfigureFCDProPlus(settings);
}
private:

View File

@ -1782,6 +1782,9 @@ margin-bottom: 20px;
"fcdProSettings" : {
"$ref" : "#/definitions/FCDProSettings"
},
"fcdProPlusSettings" : {
"$ref" : "#/definitions/FCDProPlusSettings"
},
"fileSourceSettings" : {
"$ref" : "#/definitions/FileSourceSettings"
},
@ -1821,6 +1824,59 @@ margin-bottom: 20px;
"example" : "KO"
}
}
};
defs.FCDProPlusSettings = {
"properties" : {
"centerFrequency" : {
"type" : "integer",
"format" : "int64"
},
"rangeLow" : {
"type" : "integer",
"description" : "Range select (1 if low else 0)"
},
"lnaGain" : {
"type" : "integer",
"description" : "LNA select (1 if selected else 0)"
},
"mixGain" : {
"type" : "integer",
"description" : "Mixer amplifier select (1 if selected else 0)"
},
"biasT" : {
"type" : "integer",
"description" : "Bias tee select (1 if selected else 0)"
},
"ifGain" : {
"type" : "integer"
},
"ifFilterIndex" : {
"type" : "integer"
},
"rfFilterIndex" : {
"type" : "integer"
},
"LOppmTenths" : {
"type" : "integer"
},
"dcBlock" : {
"type" : "integer"
},
"iqImbalance" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "FCDProPlus"
};
defs.FCDProSettings = {
"properties" : {
@ -21774,7 +21830,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-05-26T10:03:22.430+02:00
Generated 2018-05-26T10:50:36.916+02:00
</div>
</div>
</div>

View File

@ -26,8 +26,6 @@ FCDProSettings:
type: integer
rcFilterIndex:
type: integer
rcFilterIndex:
type: integer
gain2Index:
type: integer
gain3Index:

View File

@ -0,0 +1,37 @@
FCDProPlusSettings:
description: FCDProPlus
properties:
centerFrequency:
type: integer
format: int64
rangeLow:
description: Range select (1 if low else 0)
type: integer
lnaGain:
description: LNA select (1 if selected else 0)
type: integer
mixGain:
description: Mixer amplifier select (1 if selected else 0)
type: integer
biasT:
description: Bias tee select (1 if selected else 0)
type: integer
ifGain:
type: integer
ifFilterIndex:
type: integer
rfFilterIndex:
type: integer
LOppmTenths:
type: integer
dcBlock:
type: integer
iqImbalance:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
fileRecordName:
type: string

View File

@ -1755,6 +1755,8 @@ definitions:
$ref: "/doc/swagger/include/BladeRF.yaml#/BladeRFOutputSettings"
fcdProSettings:
$ref: "/doc/swagger/include/FCDPro.yaml#/FCDProSettings"
fcdProPlusSettings:
$ref: "/doc/swagger/include/FCDProPlus.yaml#/FCDProPlusSettings"
fileSourceSettings:
$ref: "/doc/swagger/include/FileSource.yaml#/FileSourceSettings"
hackRFInputSettings:

View File

@ -0,0 +1,37 @@
FCDProPlusSettings:
description: FCDProPlus
properties:
centerFrequency:
type: integer
format: int64
rangeLow:
description: Range select (1 if low else 0)
type: integer
lnaGain:
description: LNA select (1 if selected else 0)
type: integer
mixGain:
description: Mixer amplifier select (1 if selected else 0)
type: integer
biasT:
description: Bias tee select (1 if selected else 0)
type: integer
ifGain:
type: integer
ifFilterIndex:
type: integer
rfFilterIndex:
type: integer
LOppmTenths:
type: integer
dcBlock:
type: integer
iqImbalance:
type: integer
transverterMode:
type: integer
transverterDeltaFrequency:
type: integer
format: int64
fileRecordName:
type: string

View File

@ -1755,6 +1755,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/BladeRF.yaml#/BladeRFOutputSettings"
fcdProSettings:
$ref: "http://localhost:8081/api/swagger/include/FCDPro.yaml#/FCDProSettings"
fcdProPlusSettings:
$ref: "http://localhost:8081/api/swagger/include/FCDProPlus.yaml#/FCDProPlusSettings"
fileSourceSettings:
$ref: "http://localhost:8081/api/swagger/include/FileSource.yaml#/FileSourceSettings"
hackRFInputSettings:

View File

@ -1782,6 +1782,9 @@ margin-bottom: 20px;
"fcdProSettings" : {
"$ref" : "#/definitions/FCDProSettings"
},
"fcdProPlusSettings" : {
"$ref" : "#/definitions/FCDProPlusSettings"
},
"fileSourceSettings" : {
"$ref" : "#/definitions/FileSourceSettings"
},
@ -1821,6 +1824,59 @@ margin-bottom: 20px;
"example" : "KO"
}
}
};
defs.FCDProPlusSettings = {
"properties" : {
"centerFrequency" : {
"type" : "integer",
"format" : "int64"
},
"rangeLow" : {
"type" : "integer",
"description" : "Range select (1 if low else 0)"
},
"lnaGain" : {
"type" : "integer",
"description" : "LNA select (1 if selected else 0)"
},
"mixGain" : {
"type" : "integer",
"description" : "Mixer amplifier select (1 if selected else 0)"
},
"biasT" : {
"type" : "integer",
"description" : "Bias tee select (1 if selected else 0)"
},
"ifGain" : {
"type" : "integer"
},
"ifFilterIndex" : {
"type" : "integer"
},
"rfFilterIndex" : {
"type" : "integer"
},
"LOppmTenths" : {
"type" : "integer"
},
"dcBlock" : {
"type" : "integer"
},
"iqImbalance" : {
"type" : "integer"
},
"transverterMode" : {
"type" : "integer"
},
"transverterDeltaFrequency" : {
"type" : "integer",
"format" : "int64"
},
"fileRecordName" : {
"type" : "string"
}
},
"description" : "FCDProPlus"
};
defs.FCDProSettings = {
"properties" : {
@ -21774,7 +21830,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-05-26T10:03:22.430+02:00
Generated 2018-05-26T10:50:36.916+02:00
</div>
</div>
</div>

View File

@ -42,6 +42,8 @@ SWGDeviceSettings::SWGDeviceSettings() {
m_blade_rf_output_settings_isSet = false;
fcd_pro_settings = nullptr;
m_fcd_pro_settings_isSet = false;
fcd_pro_plus_settings = nullptr;
m_fcd_pro_plus_settings_isSet = false;
file_source_settings = nullptr;
m_file_source_settings_isSet = false;
hack_rf_input_settings = nullptr;
@ -76,6 +78,8 @@ SWGDeviceSettings::init() {
m_blade_rf_output_settings_isSet = false;
fcd_pro_settings = new SWGFCDProSettings();
m_fcd_pro_settings_isSet = false;
fcd_pro_plus_settings = new SWGFCDProPlusSettings();
m_fcd_pro_plus_settings_isSet = false;
file_source_settings = new SWGFileSourceSettings();
m_file_source_settings_isSet = false;
hack_rf_input_settings = new SWGHackRFInputSettings();
@ -111,6 +115,9 @@ SWGDeviceSettings::cleanup() {
if(fcd_pro_settings != nullptr) {
delete fcd_pro_settings;
}
if(fcd_pro_plus_settings != nullptr) {
delete fcd_pro_plus_settings;
}
if(file_source_settings != nullptr) {
delete file_source_settings;
}
@ -156,6 +163,8 @@ SWGDeviceSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&fcd_pro_settings, pJson["fcdProSettings"], "SWGFCDProSettings", "SWGFCDProSettings");
::SWGSDRangel::setValue(&fcd_pro_plus_settings, pJson["fcdProPlusSettings"], "SWGFCDProPlusSettings", "SWGFCDProPlusSettings");
::SWGSDRangel::setValue(&file_source_settings, pJson["fileSourceSettings"], "SWGFileSourceSettings", "SWGFileSourceSettings");
::SWGSDRangel::setValue(&hack_rf_input_settings, pJson["hackRFInputSettings"], "SWGHackRFInputSettings", "SWGHackRFInputSettings");
@ -205,6 +214,9 @@ SWGDeviceSettings::asJsonObject() {
if((fcd_pro_settings != nullptr) && (fcd_pro_settings->isSet())){
toJsonValue(QString("fcdProSettings"), fcd_pro_settings, obj, QString("SWGFCDProSettings"));
}
if((fcd_pro_plus_settings != nullptr) && (fcd_pro_plus_settings->isSet())){
toJsonValue(QString("fcdProPlusSettings"), fcd_pro_plus_settings, obj, QString("SWGFCDProPlusSettings"));
}
if((file_source_settings != nullptr) && (file_source_settings->isSet())){
toJsonValue(QString("fileSourceSettings"), file_source_settings, obj, QString("SWGFileSourceSettings"));
}
@ -297,6 +309,16 @@ SWGDeviceSettings::setFcdProSettings(SWGFCDProSettings* fcd_pro_settings) {
this->m_fcd_pro_settings_isSet = true;
}
SWGFCDProPlusSettings*
SWGDeviceSettings::getFcdProPlusSettings() {
return fcd_pro_plus_settings;
}
void
SWGDeviceSettings::setFcdProPlusSettings(SWGFCDProPlusSettings* fcd_pro_plus_settings) {
this->fcd_pro_plus_settings = fcd_pro_plus_settings;
this->m_fcd_pro_plus_settings_isSet = true;
}
SWGFileSourceSettings*
SWGDeviceSettings::getFileSourceSettings() {
return file_source_settings;
@ -369,6 +391,7 @@ SWGDeviceSettings::isSet(){
if(blade_rf_input_settings != nullptr && blade_rf_input_settings->isSet()){ isObjectUpdated = true; break;}
if(blade_rf_output_settings != nullptr && blade_rf_output_settings->isSet()){ isObjectUpdated = true; break;}
if(fcd_pro_settings != nullptr && fcd_pro_settings->isSet()){ isObjectUpdated = true; break;}
if(fcd_pro_plus_settings != nullptr && fcd_pro_plus_settings->isSet()){ isObjectUpdated = true; break;}
if(file_source_settings != nullptr && file_source_settings->isSet()){ isObjectUpdated = true; break;}
if(hack_rf_input_settings != nullptr && hack_rf_input_settings->isSet()){ isObjectUpdated = true; break;}
if(hack_rf_output_settings != nullptr && hack_rf_output_settings->isSet()){ isObjectUpdated = true; break;}

View File

@ -26,6 +26,7 @@
#include "SWGAirspySettings.h"
#include "SWGBladeRFInputSettings.h"
#include "SWGBladeRFOutputSettings.h"
#include "SWGFCDProPlusSettings.h"
#include "SWGFCDProSettings.h"
#include "SWGFileSourceSettings.h"
#include "SWGHackRFInputSettings.h"
@ -74,6 +75,9 @@ public:
SWGFCDProSettings* getFcdProSettings();
void setFcdProSettings(SWGFCDProSettings* fcd_pro_settings);
SWGFCDProPlusSettings* getFcdProPlusSettings();
void setFcdProPlusSettings(SWGFCDProPlusSettings* fcd_pro_plus_settings);
SWGFileSourceSettings* getFileSourceSettings();
void setFileSourceSettings(SWGFileSourceSettings* file_source_settings);
@ -117,6 +121,9 @@ private:
SWGFCDProSettings* fcd_pro_settings;
bool m_fcd_pro_settings_isSet;
SWGFCDProPlusSettings* fcd_pro_plus_settings;
bool m_fcd_pro_plus_settings_isSet;
SWGFileSourceSettings* file_source_settings;
bool m_file_source_settings_isSet;

View File

@ -0,0 +1,381 @@
/**
* 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* OpenAPI spec version: 4.0.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 "SWGFCDProPlusSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGFCDProPlusSettings::SWGFCDProPlusSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGFCDProPlusSettings::SWGFCDProPlusSettings() {
center_frequency = 0L;
m_center_frequency_isSet = false;
range_low = 0;
m_range_low_isSet = false;
lna_gain = 0;
m_lna_gain_isSet = false;
mix_gain = 0;
m_mix_gain_isSet = false;
bias_t = 0;
m_bias_t_isSet = false;
if_gain = 0;
m_if_gain_isSet = false;
if_filter_index = 0;
m_if_filter_index_isSet = false;
rf_filter_index = 0;
m_rf_filter_index_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
iq_imbalance = 0;
m_iq_imbalance_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = nullptr;
m_file_record_name_isSet = false;
}
SWGFCDProPlusSettings::~SWGFCDProPlusSettings() {
this->cleanup();
}
void
SWGFCDProPlusSettings::init() {
center_frequency = 0L;
m_center_frequency_isSet = false;
range_low = 0;
m_range_low_isSet = false;
lna_gain = 0;
m_lna_gain_isSet = false;
mix_gain = 0;
m_mix_gain_isSet = false;
bias_t = 0;
m_bias_t_isSet = false;
if_gain = 0;
m_if_gain_isSet = false;
if_filter_index = 0;
m_if_filter_index_isSet = false;
rf_filter_index = 0;
m_rf_filter_index_isSet = false;
l_oppm_tenths = 0;
m_l_oppm_tenths_isSet = false;
dc_block = 0;
m_dc_block_isSet = false;
iq_imbalance = 0;
m_iq_imbalance_isSet = false;
transverter_mode = 0;
m_transverter_mode_isSet = false;
transverter_delta_frequency = 0L;
m_transverter_delta_frequency_isSet = false;
file_record_name = new QString("");
m_file_record_name_isSet = false;
}
void
SWGFCDProPlusSettings::cleanup() {
if(file_record_name != nullptr) {
delete file_record_name;
}
}
SWGFCDProPlusSettings*
SWGFCDProPlusSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGFCDProPlusSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&center_frequency, pJson["centerFrequency"], "qint64", "");
::SWGSDRangel::setValue(&range_low, pJson["rangeLow"], "qint32", "");
::SWGSDRangel::setValue(&lna_gain, pJson["lnaGain"], "qint32", "");
::SWGSDRangel::setValue(&mix_gain, pJson["mixGain"], "qint32", "");
::SWGSDRangel::setValue(&bias_t, pJson["biasT"], "qint32", "");
::SWGSDRangel::setValue(&if_gain, pJson["ifGain"], "qint32", "");
::SWGSDRangel::setValue(&if_filter_index, pJson["ifFilterIndex"], "qint32", "");
::SWGSDRangel::setValue(&rf_filter_index, pJson["rfFilterIndex"], "qint32", "");
::SWGSDRangel::setValue(&l_oppm_tenths, pJson["LOppmTenths"], "qint32", "");
::SWGSDRangel::setValue(&dc_block, pJson["dcBlock"], "qint32", "");
::SWGSDRangel::setValue(&iq_imbalance, pJson["iqImbalance"], "qint32", "");
::SWGSDRangel::setValue(&transverter_mode, pJson["transverterMode"], "qint32", "");
::SWGSDRangel::setValue(&transverter_delta_frequency, pJson["transverterDeltaFrequency"], "qint64", "");
::SWGSDRangel::setValue(&file_record_name, pJson["fileRecordName"], "QString", "QString");
}
QString
SWGFCDProPlusSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGFCDProPlusSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_center_frequency_isSet){
obj->insert("centerFrequency", QJsonValue(center_frequency));
}
if(m_range_low_isSet){
obj->insert("rangeLow", QJsonValue(range_low));
}
if(m_lna_gain_isSet){
obj->insert("lnaGain", QJsonValue(lna_gain));
}
if(m_mix_gain_isSet){
obj->insert("mixGain", QJsonValue(mix_gain));
}
if(m_bias_t_isSet){
obj->insert("biasT", QJsonValue(bias_t));
}
if(m_if_gain_isSet){
obj->insert("ifGain", QJsonValue(if_gain));
}
if(m_if_filter_index_isSet){
obj->insert("ifFilterIndex", QJsonValue(if_filter_index));
}
if(m_rf_filter_index_isSet){
obj->insert("rfFilterIndex", QJsonValue(rf_filter_index));
}
if(m_l_oppm_tenths_isSet){
obj->insert("LOppmTenths", QJsonValue(l_oppm_tenths));
}
if(m_dc_block_isSet){
obj->insert("dcBlock", QJsonValue(dc_block));
}
if(m_iq_imbalance_isSet){
obj->insert("iqImbalance", QJsonValue(iq_imbalance));
}
if(m_transverter_mode_isSet){
obj->insert("transverterMode", QJsonValue(transverter_mode));
}
if(m_transverter_delta_frequency_isSet){
obj->insert("transverterDeltaFrequency", QJsonValue(transverter_delta_frequency));
}
if(file_record_name != nullptr && *file_record_name != QString("")){
toJsonValue(QString("fileRecordName"), file_record_name, obj, QString("QString"));
}
return obj;
}
qint64
SWGFCDProPlusSettings::getCenterFrequency() {
return center_frequency;
}
void
SWGFCDProPlusSettings::setCenterFrequency(qint64 center_frequency) {
this->center_frequency = center_frequency;
this->m_center_frequency_isSet = true;
}
qint32
SWGFCDProPlusSettings::getRangeLow() {
return range_low;
}
void
SWGFCDProPlusSettings::setRangeLow(qint32 range_low) {
this->range_low = range_low;
this->m_range_low_isSet = true;
}
qint32
SWGFCDProPlusSettings::getLnaGain() {
return lna_gain;
}
void
SWGFCDProPlusSettings::setLnaGain(qint32 lna_gain) {
this->lna_gain = lna_gain;
this->m_lna_gain_isSet = true;
}
qint32
SWGFCDProPlusSettings::getMixGain() {
return mix_gain;
}
void
SWGFCDProPlusSettings::setMixGain(qint32 mix_gain) {
this->mix_gain = mix_gain;
this->m_mix_gain_isSet = true;
}
qint32
SWGFCDProPlusSettings::getBiasT() {
return bias_t;
}
void
SWGFCDProPlusSettings::setBiasT(qint32 bias_t) {
this->bias_t = bias_t;
this->m_bias_t_isSet = true;
}
qint32
SWGFCDProPlusSettings::getIfGain() {
return if_gain;
}
void
SWGFCDProPlusSettings::setIfGain(qint32 if_gain) {
this->if_gain = if_gain;
this->m_if_gain_isSet = true;
}
qint32
SWGFCDProPlusSettings::getIfFilterIndex() {
return if_filter_index;
}
void
SWGFCDProPlusSettings::setIfFilterIndex(qint32 if_filter_index) {
this->if_filter_index = if_filter_index;
this->m_if_filter_index_isSet = true;
}
qint32
SWGFCDProPlusSettings::getRfFilterIndex() {
return rf_filter_index;
}
void
SWGFCDProPlusSettings::setRfFilterIndex(qint32 rf_filter_index) {
this->rf_filter_index = rf_filter_index;
this->m_rf_filter_index_isSet = true;
}
qint32
SWGFCDProPlusSettings::getLOppmTenths() {
return l_oppm_tenths;
}
void
SWGFCDProPlusSettings::setLOppmTenths(qint32 l_oppm_tenths) {
this->l_oppm_tenths = l_oppm_tenths;
this->m_l_oppm_tenths_isSet = true;
}
qint32
SWGFCDProPlusSettings::getDcBlock() {
return dc_block;
}
void
SWGFCDProPlusSettings::setDcBlock(qint32 dc_block) {
this->dc_block = dc_block;
this->m_dc_block_isSet = true;
}
qint32
SWGFCDProPlusSettings::getIqImbalance() {
return iq_imbalance;
}
void
SWGFCDProPlusSettings::setIqImbalance(qint32 iq_imbalance) {
this->iq_imbalance = iq_imbalance;
this->m_iq_imbalance_isSet = true;
}
qint32
SWGFCDProPlusSettings::getTransverterMode() {
return transverter_mode;
}
void
SWGFCDProPlusSettings::setTransverterMode(qint32 transverter_mode) {
this->transverter_mode = transverter_mode;
this->m_transverter_mode_isSet = true;
}
qint64
SWGFCDProPlusSettings::getTransverterDeltaFrequency() {
return transverter_delta_frequency;
}
void
SWGFCDProPlusSettings::setTransverterDeltaFrequency(qint64 transverter_delta_frequency) {
this->transverter_delta_frequency = transverter_delta_frequency;
this->m_transverter_delta_frequency_isSet = true;
}
QString*
SWGFCDProPlusSettings::getFileRecordName() {
return file_record_name;
}
void
SWGFCDProPlusSettings::setFileRecordName(QString* file_record_name) {
this->file_record_name = file_record_name;
this->m_file_record_name_isSet = true;
}
bool
SWGFCDProPlusSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_center_frequency_isSet){ isObjectUpdated = true; break;}
if(m_range_low_isSet){ isObjectUpdated = true; break;}
if(m_lna_gain_isSet){ isObjectUpdated = true; break;}
if(m_mix_gain_isSet){ isObjectUpdated = true; break;}
if(m_bias_t_isSet){ isObjectUpdated = true; break;}
if(m_if_gain_isSet){ isObjectUpdated = true; break;}
if(m_if_filter_index_isSet){ isObjectUpdated = true; break;}
if(m_rf_filter_index_isSet){ isObjectUpdated = true; break;}
if(m_l_oppm_tenths_isSet){ isObjectUpdated = true; break;}
if(m_dc_block_isSet){ isObjectUpdated = true; break;}
if(m_iq_imbalance_isSet){ isObjectUpdated = true; break;}
if(m_transverter_mode_isSet){ isObjectUpdated = true; break;}
if(m_transverter_delta_frequency_isSet){ isObjectUpdated = true; break;}
if(file_record_name != nullptr && *file_record_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,137 @@
/**
* 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. * Stopping instance i.e. /sdrangel with DELETE method is a server only feature. It allows stopping the instance nicely. * 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 demodulator, Channel Analyzer, Channel Analyzer NG, LoRa demodulator, TCP source * The content type returned is always application/json except in the following cases: * An incorrect URL was specified: this document is returned as text/html with a status 400 ---
*
* OpenAPI spec version: 4.0.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.
*/
/*
* SWGFCDProPlusSettings.h
*
* FCDProPlus
*/
#ifndef SWGFCDProPlusSettings_H_
#define SWGFCDProPlusSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGFCDProPlusSettings: public SWGObject {
public:
SWGFCDProPlusSettings();
SWGFCDProPlusSettings(QString* json);
virtual ~SWGFCDProPlusSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGFCDProPlusSettings* fromJson(QString &jsonString) override;
qint64 getCenterFrequency();
void setCenterFrequency(qint64 center_frequency);
qint32 getRangeLow();
void setRangeLow(qint32 range_low);
qint32 getLnaGain();
void setLnaGain(qint32 lna_gain);
qint32 getMixGain();
void setMixGain(qint32 mix_gain);
qint32 getBiasT();
void setBiasT(qint32 bias_t);
qint32 getIfGain();
void setIfGain(qint32 if_gain);
qint32 getIfFilterIndex();
void setIfFilterIndex(qint32 if_filter_index);
qint32 getRfFilterIndex();
void setRfFilterIndex(qint32 rf_filter_index);
qint32 getLOppmTenths();
void setLOppmTenths(qint32 l_oppm_tenths);
qint32 getDcBlock();
void setDcBlock(qint32 dc_block);
qint32 getIqImbalance();
void setIqImbalance(qint32 iq_imbalance);
qint32 getTransverterMode();
void setTransverterMode(qint32 transverter_mode);
qint64 getTransverterDeltaFrequency();
void setTransverterDeltaFrequency(qint64 transverter_delta_frequency);
QString* getFileRecordName();
void setFileRecordName(QString* file_record_name);
virtual bool isSet() override;
private:
qint64 center_frequency;
bool m_center_frequency_isSet;
qint32 range_low;
bool m_range_low_isSet;
qint32 lna_gain;
bool m_lna_gain_isSet;
qint32 mix_gain;
bool m_mix_gain_isSet;
qint32 bias_t;
bool m_bias_t_isSet;
qint32 if_gain;
bool m_if_gain_isSet;
qint32 if_filter_index;
bool m_if_filter_index_isSet;
qint32 rf_filter_index;
bool m_rf_filter_index_isSet;
qint32 l_oppm_tenths;
bool m_l_oppm_tenths_isSet;
qint32 dc_block;
bool m_dc_block_isSet;
qint32 iq_imbalance;
bool m_iq_imbalance_isSet;
qint32 transverter_mode;
bool m_transverter_mode_isSet;
qint64 transverter_delta_frequency;
bool m_transverter_delta_frequency_isSet;
QString* file_record_name;
bool m_file_record_name_isSet;
};
}
#endif /* SWGFCDProPlusSettings_H_ */

View File

@ -49,6 +49,7 @@
#include "SWGDeviceSettings.h"
#include "SWGDeviceState.h"
#include "SWGErrorResponse.h"
#include "SWGFCDProPlusSettings.h"
#include "SWGFCDProSettings.h"
#include "SWGFileSourceSettings.h"
#include "SWGHackRFInputSettings.h"
@ -195,6 +196,9 @@ namespace SWGSDRangel {
if(QString("SWGErrorResponse").compare(type) == 0) {
return new SWGErrorResponse();
}
if(QString("SWGFCDProPlusSettings").compare(type) == 0) {
return new SWGFCDProPlusSettings();
}
if(QString("SWGFCDProSettings").compare(type) == 0) {
return new SWGFCDProSettings();
}