WFM demod: implemeted WEB API

This commit is contained in:
f4exb 2018-05-25 10:08:47 +02:00
parent 111b3da5ce
commit 0c328546b0
26 changed files with 1131 additions and 22 deletions

View File

@ -605,7 +605,7 @@ int BFMDemod::webapiSettingsPutPatch(
if (frequencyOffsetChanged)
{
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
requiredBW(settings.m_rfBandwidth), settings.m_inputFrequencyOffset); // FIXME
requiredBW(settings.m_rfBandwidth), settings.m_inputFrequencyOffset);
m_inputMessageQueue.push(channelConfigMsg);
}

View File

@ -25,7 +25,7 @@
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
QString("DSD Demodulator"),
QString("3.14.5"),
QString("4.0.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -8,7 +8,7 @@
const PluginDescriptor SSBPlugin::m_pluginDescriptor = {
QString("SSB Demodulator"),
QString("3.14.5"),
QString("4.0.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,

View File

@ -23,6 +23,7 @@ set(wfm_FORMS
include_directories(
.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
)
#include(${QT_USE_FILE})

View File

@ -21,12 +21,18 @@
#include <stdio.h>
#include <complex.h>
#include "SWGChannelSettings.h"
#include "SWGWFMDemodSettings.h"
#include "SWGChannelReport.h"
#include "SWGWFMDemodReport.h"
#include <dsp/downchannelizer.h>
#include "dsp/threadedbasebandsamplesink.h"
#include "device/devicesourceapi.h"
#include "audio/audiooutput.h"
#include "dsp/dspengine.h"
#include "dsp/dspcommands.h"
#include "util/db.h"
#include "wfmdemod.h"
@ -375,3 +381,119 @@ bool WFMDemod::deserialize(const QByteArray& data)
}
}
int WFMDemod::webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
response.setWfmDemodSettings(new SWGSDRangel::SWGWFMDemodSettings());
response.getWfmDemodSettings()->init();
webapiFormatChannelSettings(response, m_settings);
return 200;
}
int WFMDemod::webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage __attribute__((unused)))
{
WFMDemodSettings settings = m_settings;
bool frequencyOffsetChanged = false;
if (channelSettingsKeys.contains("inputFrequencyOffset"))
{
settings.m_inputFrequencyOffset = response.getWfmDemodSettings()->getInputFrequencyOffset();
frequencyOffsetChanged = true;
}
if (channelSettingsKeys.contains("rfBandwidth")) {
settings.m_rfBandwidth = response.getWfmDemodSettings()->getRfBandwidth();
}
if (channelSettingsKeys.contains("afBandwidth")) {
settings.m_afBandwidth = response.getWfmDemodSettings()->getAfBandwidth();
}
if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getWfmDemodSettings()->getVolume();
}
if (channelSettingsKeys.contains("squelch")) {
settings.m_squelch = response.getWfmDemodSettings()->getSquelch();
}
if (channelSettingsKeys.contains("audioMute")) {
settings.m_audioMute = response.getWfmDemodSettings()->getAudioMute() != 0;
}
if (channelSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getWfmDemodSettings()->getRgbColor();
}
if (channelSettingsKeys.contains("title")) {
settings.m_title = *response.getWfmDemodSettings()->getTitle();
}
if (channelSettingsKeys.contains("audioDeviceName")) {
settings.m_audioDeviceName = *response.getWfmDemodSettings()->getAudioDeviceName();
}
if (frequencyOffsetChanged)
{
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
requiredBW(settings.m_rfBandwidth), settings.m_inputFrequencyOffset);
m_inputMessageQueue.push(channelConfigMsg);
}
MsgConfigureWFMDemod *msg = MsgConfigureWFMDemod::create(settings, force);
m_inputMessageQueue.push(msg);
qDebug("WFMDemod::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureWFMDemod *msgToGUI = MsgConfigureWFMDemod::create(settings, force);
m_guiMessageQueue->push(msgToGUI);
}
webapiFormatChannelSettings(response, settings);
return 200;
}
int WFMDemod::webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage __attribute__((unused)))
{
response.setWfmDemodReport(new SWGSDRangel::SWGWFMDemodReport());
response.getWfmDemodReport()->init();
webapiFormatChannelReport(response);
return 200;
}
void WFMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const WFMDemodSettings& settings)
{
response.getWfmDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getWfmDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getWfmDemodSettings()->setAfBandwidth(settings.m_afBandwidth);
response.getWfmDemodSettings()->setVolume(settings.m_volume);
response.getWfmDemodSettings()->setSquelch(settings.m_squelch);
response.getWfmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getWfmDemodSettings()->setRgbColor(settings.m_rgbColor);
if (response.getWfmDemodSettings()->getTitle()) {
*response.getWfmDemodSettings()->getTitle() = settings.m_title;
} else {
response.getWfmDemodSettings()->setTitle(new QString(settings.m_title));
}
if (response.getWfmDemodSettings()->getAudioDeviceName()) {
*response.getWfmDemodSettings()->getAudioDeviceName() = settings.m_audioDeviceName;
} else {
response.getWfmDemodSettings()->setAudioDeviceName(new QString(settings.m_audioDeviceName));
}
}
void WFMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
{
double magsqAvg, magsqPeak;
int nbMagsqSamples;
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
response.getWfmDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
response.getWfmDemodReport()->setSquelch(m_squelchState > 0 ? 1 : 0);
response.getWfmDemodReport()->setAudioSampleRate(m_audioSampleRate);
response.getWfmDemodReport()->setChannelSampleRate(m_inputSampleRate);
}

View File

@ -118,6 +118,29 @@ public:
m_magsqCount = 0;
}
virtual int webapiSettingsGet(
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiSettingsPutPatch(
bool force,
const QStringList& channelSettingsKeys,
SWGSDRangel::SWGChannelSettings& response,
QString& errorMessage);
virtual int webapiReportGet(
SWGSDRangel::SWGChannelReport& response,
QString& errorMessage);
static int requiredBW(int rfBW)
{
if (rfBW <= 48000) {
return 48000;
} else {
return (3*rfBW)/2;
}
}
static const QString m_channelIdURI;
static const QString m_channelId;
@ -167,6 +190,9 @@ private:
void applyAudioSampleRate(int sampleRate);
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
void applySettings(const WFMDemodSettings& settings, bool force = false);
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const WFMDemodSettings& settings);
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
};
#endif // INCLUDE_WFMDEMOD_H

View File

@ -77,7 +77,33 @@ bool WFMDemodGUI::deserialize(const QByteArray& data)
bool WFMDemodGUI::handleMessage(const Message& message __attribute__((unused)))
{
return false;
if (WFMDemod::MsgConfigureWFMDemod::match(message))
{
qDebug("WFMDemodGUI::handleMessage: WFMDemod::MsgConfigureWFMDemod");
const WFMDemod::MsgConfigureWFMDemod& cfg = (WFMDemod::MsgConfigureWFMDemod&) message;
m_settings = cfg.getSettings();
blockApplySettings(true);
displaySettings();
blockApplySettings(false);
return true;
}
else
{
return false;
}
}
void WFMDemodGUI::handleInputMessages()
{
Message* message;
while ((message = getInputMessageQueue()->pop()) != 0)
{
if (handleMessage(*message))
{
delete message;
}
}
}
void WFMDemodGUI::channelMarkerChangedByCursor()
@ -165,8 +191,10 @@ WFMDemodGUI::WFMDemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
setAttribute(Qt::WA_DeleteOnClose, true);
connect(this, SIGNAL(widgetRolled(QWidget*,bool)), this, SLOT(onWidgetRolled(QWidget*,bool)));
connect(this, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(onMenuDialogCalled(const QPoint &)));
connect(getInputMessageQueue(), SIGNAL(messageEnqueued()), this, SLOT(handleInputMessages()));
m_wfmDemod = (WFMDemod*) rxChannel; //new WFMDemod(m_deviceUISet->m_deviceSourceAPI);
m_wfmDemod->setMessageQueueToGUI(getInputMessageQueue());
connect(&MainWindow::getInstance()->getMasterTimer(), SIGNAL(timeout()), this, SLOT(tick()));
@ -226,7 +254,7 @@ void WFMDemodGUI::applySettings(bool force)
if (m_doApplySettings)
{
WFMDemod::MsgConfigureChannelizer *msgChan = WFMDemod::MsgConfigureChannelizer::create(
requiredBW(WFMDemodSettings::getRFBW(ui->rfBW->currentIndex())),
WFMDemod::requiredBW(WFMDemodSettings::getRFBW(ui->rfBW->currentIndex())),
m_channelMarker.getCenterFrequency());
m_wfmDemod->getInputMessageQueue()->push(msgChan);

View File

@ -63,15 +63,6 @@ private:
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
static int requiredBW(int rfBW)
{
if (rfBW <= 48000) {
return 48000;
} else {
return (3*rfBW)/2;
}
}
private slots:
void on_deltaFrequency_changed(qint64 value);
void on_rfBW_currentIndexChanged(int index);
@ -81,6 +72,7 @@ private slots:
void on_audioMute_toggled(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();
void audioSelect();
void tick();
};

View File

@ -1322,6 +1322,9 @@ margin-bottom: 20px;
"UDPSinkReport" : {
"$ref" : "#/definitions/UDPSinkReport"
},
"WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport"
},
"WFMModReport" : {
"$ref" : "#/definitions/WFMModReport"
}
@ -1367,6 +1370,9 @@ margin-bottom: 20px;
"UDPSinkSettings" : {
"$ref" : "#/definitions/UDPSinkSettings"
},
"WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings"
},
"WFMModSettings" : {
"$ref" : "#/definitions/WFMModSettings"
}
@ -1413,11 +1419,11 @@ margin-bottom: 20px;
},
"slot1On" : {
"type" : "integer",
"description" : "slot 1 status (1 if active else 0)"
"description" : "slot 1 status (1 if voice active else 0)"
},
"slot2On" : {
"type" : "integer",
"description" : "slot 2 status (1 if active else 0)"
"description" : "slot 2 status (1 if voice active else 0)"
},
"syncType" : {
"type" : "string",
@ -2653,6 +2659,64 @@ margin-bottom: 20px;
}
},
"description" : "UDPSink"
};
defs.WFMDemodReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"audioSampleRate" : {
"type" : "integer"
},
"channelSampleRate" : {
"type" : "integer"
}
},
"description" : "WFMDemod"
};
defs.WFMDemodSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"afBandwidth" : {
"type" : "number",
"format" : "float"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"squelch" : {
"type" : "number",
"format" : "float"
},
"audioMute" : {
"type" : "integer",
"description" : "audio mute (1 if muted else 0)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"audioDeviceName" : {
"type" : "string"
}
},
"description" : "WFMDemod"
};
defs.WFMModReport = {
"properties" : {
@ -20953,7 +21017,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-05-24T10:19:21.195+02:00
Generated 2018-05-25T09:35:58.275+02:00
</div>
</div>
</div>

View File

@ -73,10 +73,10 @@ DSDDemodReport:
description: symbol PLL status (1 if locked else 0)
type: integer
slot1On:
description: slot 1 status (1 if active else 0)
description: slot 1 status (1 if voice active else 0)
type: integer
slot2On:
description: slot 2 status (1 if active else 0)
description: slot 2 status (1 if voice active else 0)
type: integer
syncType:
description: type of frame synchronized

View File

@ -0,0 +1,42 @@
WFMDemodSettings:
description: WFMDemod
properties:
inputFrequencyOffset:
type: integer
format: int64
rfBandwidth:
type: number
format: float
afBandwidth:
type: number
format: float
volume:
type: number
format: float
squelch:
type: number
format: float
audioMute:
description: audio mute (1 if muted else 0)
type: integer
rgbColor:
type: integer
title:
type: string
audioDeviceName:
type: string
WFMDemodReport:
description: WFMDemod
properties:
channelPowerDB:
description: power transmitted in channel (dB)
type: number
format: float
squelch:
description: squelch status (1 if open else 0)
type: integer
audioSampleRate:
type: integer
channelSampleRate:
type: integer

View File

@ -1763,6 +1763,8 @@ definitions:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModSettings"
UDPSinkSettings:
$ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkSettings"
WFMDemodSettings:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings:
$ref: "/doc/swagger/include/WFMMod.yaml#/WFMModSettings"
@ -1794,6 +1796,8 @@ definitions:
$ref: "/doc/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSinkReport:
$ref: "/doc/swagger/include/UDPSink.yaml#/UDPSinkReport"
WFMDemodReport:
$ref: "/doc/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport:
$ref: "/doc/swagger/include/WFMMod.yaml#/WFMModReport"

View File

@ -1973,6 +1973,20 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false;
}
}
else if (*channelType == "WFMDemod")
{
if (channelSettings.getTx() == 0)
{
QJsonObject wfmDemodSettingsJsonObject = jsonObject["WFMDemodSettings"].toObject();
channelSettingsKeys = wfmDemodSettingsJsonObject.keys();
channelSettings.setWfmDemodSettings(new SWGSDRangel::SWGWFMDemodSettings());
channelSettings.getWfmDemodSettings()->fromJsonObject(wfmDemodSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "WFMMod")
{
if (channelSettings.getTx() != 0)

View File

@ -0,0 +1,42 @@
WFMDemodSettings:
description: WFMDemod
properties:
inputFrequencyOffset:
type: integer
format: int64
rfBandwidth:
type: number
format: float
afBandwidth:
type: number
format: float
volume:
type: number
format: float
squelch:
type: number
format: float
audioMute:
description: audio mute (1 if muted else 0)
type: integer
rgbColor:
type: integer
title:
type: string
audioDeviceName:
type: string
WFMDemodReport:
description: WFMDemod
properties:
channelPowerDB:
description: power transmitted in channel (dB)
type: number
format: float
squelch:
description: squelch status (1 if open else 0)
type: integer
audioSampleRate:
type: integer
channelSampleRate:
type: integer

View File

@ -1763,6 +1763,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModSettings"
UDPSinkSettings:
$ref: "http://localhost:8081/api/swagger/include/UDPSink.yaml#/UDPSinkSettings"
WFMDemodSettings:
$ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodSettings"
WFMModSettings:
$ref: "http://localhost:8081/api/swagger/include/WFMMod.yaml#/WFMModSettings"
@ -1794,6 +1796,8 @@ definitions:
$ref: "http://localhost:8081/api/swagger/include/SSBMod.yaml#/SSBModReport"
UDPSinkReport:
$ref: "http://localhost:8081/api/swagger/include/UDPSink.yaml#/UDPSinkReport"
WFMDemodReport:
$ref: "http://localhost:8081/api/swagger/include/WFMDemod.yaml#/WFMDemodReport"
WFMModReport:
$ref: "http://localhost:8081/api/swagger/include/WFMMod.yaml#/WFMModReport"

View File

@ -1322,6 +1322,9 @@ margin-bottom: 20px;
"UDPSinkReport" : {
"$ref" : "#/definitions/UDPSinkReport"
},
"WFMDemodReport" : {
"$ref" : "#/definitions/WFMDemodReport"
},
"WFMModReport" : {
"$ref" : "#/definitions/WFMModReport"
}
@ -1367,6 +1370,9 @@ margin-bottom: 20px;
"UDPSinkSettings" : {
"$ref" : "#/definitions/UDPSinkSettings"
},
"WFMDemodSettings" : {
"$ref" : "#/definitions/WFMDemodSettings"
},
"WFMModSettings" : {
"$ref" : "#/definitions/WFMModSettings"
}
@ -1413,11 +1419,11 @@ margin-bottom: 20px;
},
"slot1On" : {
"type" : "integer",
"description" : "slot 1 status (1 if active else 0)"
"description" : "slot 1 status (1 if voice active else 0)"
},
"slot2On" : {
"type" : "integer",
"description" : "slot 2 status (1 if active else 0)"
"description" : "slot 2 status (1 if voice active else 0)"
},
"syncType" : {
"type" : "string",
@ -2653,6 +2659,64 @@ margin-bottom: 20px;
}
},
"description" : "UDPSink"
};
defs.WFMDemodReport = {
"properties" : {
"channelPowerDB" : {
"type" : "number",
"format" : "float",
"description" : "power transmitted in channel (dB)"
},
"squelch" : {
"type" : "integer",
"description" : "squelch status (1 if open else 0)"
},
"audioSampleRate" : {
"type" : "integer"
},
"channelSampleRate" : {
"type" : "integer"
}
},
"description" : "WFMDemod"
};
defs.WFMDemodSettings = {
"properties" : {
"inputFrequencyOffset" : {
"type" : "integer",
"format" : "int64"
},
"rfBandwidth" : {
"type" : "number",
"format" : "float"
},
"afBandwidth" : {
"type" : "number",
"format" : "float"
},
"volume" : {
"type" : "number",
"format" : "float"
},
"squelch" : {
"type" : "number",
"format" : "float"
},
"audioMute" : {
"type" : "integer",
"description" : "audio mute (1 if muted else 0)"
},
"rgbColor" : {
"type" : "integer"
},
"title" : {
"type" : "string"
},
"audioDeviceName" : {
"type" : "string"
}
},
"description" : "WFMDemod"
};
defs.WFMModReport = {
"properties" : {
@ -20953,7 +21017,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2018-05-24T10:19:21.195+02:00
Generated 2018-05-25T09:35:58.275+02:00
</div>
</div>
</div>

View File

@ -50,6 +50,8 @@ SWGChannelReport::SWGChannelReport() {
m_ssb_mod_report_isSet = false;
udp_sink_report = nullptr;
m_udp_sink_report_isSet = false;
wfm_demod_report = nullptr;
m_wfm_demod_report_isSet = false;
wfm_mod_report = nullptr;
m_wfm_mod_report_isSet = false;
}
@ -82,6 +84,8 @@ SWGChannelReport::init() {
m_ssb_mod_report_isSet = false;
udp_sink_report = new SWGUDPSinkReport();
m_udp_sink_report_isSet = false;
wfm_demod_report = new SWGWFMDemodReport();
m_wfm_demod_report_isSet = false;
wfm_mod_report = new SWGWFMModReport();
m_wfm_mod_report_isSet = false;
}
@ -119,6 +123,9 @@ SWGChannelReport::cleanup() {
if(udp_sink_report != nullptr) {
delete udp_sink_report;
}
if(wfm_demod_report != nullptr) {
delete wfm_demod_report;
}
if(wfm_mod_report != nullptr) {
delete wfm_mod_report;
}
@ -157,6 +164,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&udp_sink_report, pJson["UDPSinkReport"], "SWGUDPSinkReport", "SWGUDPSinkReport");
::SWGSDRangel::setValue(&wfm_demod_report, pJson["WFMDemodReport"], "SWGWFMDemodReport", "SWGWFMDemodReport");
::SWGSDRangel::setValue(&wfm_mod_report, pJson["WFMModReport"], "SWGWFMModReport", "SWGWFMModReport");
}
@ -208,6 +217,9 @@ SWGChannelReport::asJsonObject() {
if((udp_sink_report != nullptr) && (udp_sink_report->isSet())){
toJsonValue(QString("UDPSinkReport"), udp_sink_report, obj, QString("SWGUDPSinkReport"));
}
if((wfm_demod_report != nullptr) && (wfm_demod_report->isSet())){
toJsonValue(QString("WFMDemodReport"), wfm_demod_report, obj, QString("SWGWFMDemodReport"));
}
if((wfm_mod_report != nullptr) && (wfm_mod_report->isSet())){
toJsonValue(QString("WFMModReport"), wfm_mod_report, obj, QString("SWGWFMModReport"));
}
@ -325,6 +337,16 @@ SWGChannelReport::setUdpSinkReport(SWGUDPSinkReport* udp_sink_report) {
this->m_udp_sink_report_isSet = true;
}
SWGWFMDemodReport*
SWGChannelReport::getWfmDemodReport() {
return wfm_demod_report;
}
void
SWGChannelReport::setWfmDemodReport(SWGWFMDemodReport* wfm_demod_report) {
this->wfm_demod_report = wfm_demod_report;
this->m_wfm_demod_report_isSet = true;
}
SWGWFMModReport*
SWGChannelReport::getWfmModReport() {
return wfm_mod_report;
@ -351,6 +373,7 @@ SWGChannelReport::isSet(){
if(nfm_mod_report != nullptr && nfm_mod_report->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_report != nullptr && ssb_mod_report->isSet()){ isObjectUpdated = true; break;}
if(udp_sink_report != nullptr && udp_sink_report->isSet()){ isObjectUpdated = true; break;}
if(wfm_demod_report != nullptr && wfm_demod_report->isSet()){ isObjectUpdated = true; break;}
if(wfm_mod_report != nullptr && wfm_mod_report->isSet()){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;

View File

@ -31,6 +31,7 @@
#include "SWGNFMModReport.h"
#include "SWGSSBModReport.h"
#include "SWGUDPSinkReport.h"
#include "SWGWFMDemodReport.h"
#include "SWGWFMModReport.h"
#include <QString>
@ -85,6 +86,9 @@ public:
SWGUDPSinkReport* getUdpSinkReport();
void setUdpSinkReport(SWGUDPSinkReport* udp_sink_report);
SWGWFMDemodReport* getWfmDemodReport();
void setWfmDemodReport(SWGWFMDemodReport* wfm_demod_report);
SWGWFMModReport* getWfmModReport();
void setWfmModReport(SWGWFMModReport* wfm_mod_report);
@ -125,6 +129,9 @@ private:
SWGUDPSinkReport* udp_sink_report;
bool m_udp_sink_report_isSet;
SWGWFMDemodReport* wfm_demod_report;
bool m_wfm_demod_report_isSet;
SWGWFMModReport* wfm_mod_report;
bool m_wfm_mod_report_isSet;

View File

@ -50,6 +50,8 @@ SWGChannelSettings::SWGChannelSettings() {
m_ssb_mod_settings_isSet = false;
udp_sink_settings = nullptr;
m_udp_sink_settings_isSet = false;
wfm_demod_settings = nullptr;
m_wfm_demod_settings_isSet = false;
wfm_mod_settings = nullptr;
m_wfm_mod_settings_isSet = false;
}
@ -82,6 +84,8 @@ SWGChannelSettings::init() {
m_ssb_mod_settings_isSet = false;
udp_sink_settings = new SWGUDPSinkSettings();
m_udp_sink_settings_isSet = false;
wfm_demod_settings = new SWGWFMDemodSettings();
m_wfm_demod_settings_isSet = false;
wfm_mod_settings = new SWGWFMModSettings();
m_wfm_mod_settings_isSet = false;
}
@ -119,6 +123,9 @@ SWGChannelSettings::cleanup() {
if(udp_sink_settings != nullptr) {
delete udp_sink_settings;
}
if(wfm_demod_settings != nullptr) {
delete wfm_demod_settings;
}
if(wfm_mod_settings != nullptr) {
delete wfm_mod_settings;
}
@ -157,6 +164,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&udp_sink_settings, pJson["UDPSinkSettings"], "SWGUDPSinkSettings", "SWGUDPSinkSettings");
::SWGSDRangel::setValue(&wfm_demod_settings, pJson["WFMDemodSettings"], "SWGWFMDemodSettings", "SWGWFMDemodSettings");
::SWGSDRangel::setValue(&wfm_mod_settings, pJson["WFMModSettings"], "SWGWFMModSettings", "SWGWFMModSettings");
}
@ -208,6 +217,9 @@ SWGChannelSettings::asJsonObject() {
if((udp_sink_settings != nullptr) && (udp_sink_settings->isSet())){
toJsonValue(QString("UDPSinkSettings"), udp_sink_settings, obj, QString("SWGUDPSinkSettings"));
}
if((wfm_demod_settings != nullptr) && (wfm_demod_settings->isSet())){
toJsonValue(QString("WFMDemodSettings"), wfm_demod_settings, obj, QString("SWGWFMDemodSettings"));
}
if((wfm_mod_settings != nullptr) && (wfm_mod_settings->isSet())){
toJsonValue(QString("WFMModSettings"), wfm_mod_settings, obj, QString("SWGWFMModSettings"));
}
@ -325,6 +337,16 @@ SWGChannelSettings::setUdpSinkSettings(SWGUDPSinkSettings* udp_sink_settings) {
this->m_udp_sink_settings_isSet = true;
}
SWGWFMDemodSettings*
SWGChannelSettings::getWfmDemodSettings() {
return wfm_demod_settings;
}
void
SWGChannelSettings::setWfmDemodSettings(SWGWFMDemodSettings* wfm_demod_settings) {
this->wfm_demod_settings = wfm_demod_settings;
this->m_wfm_demod_settings_isSet = true;
}
SWGWFMModSettings*
SWGChannelSettings::getWfmModSettings() {
return wfm_mod_settings;
@ -351,6 +373,7 @@ SWGChannelSettings::isSet(){
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(ssb_mod_settings != nullptr && ssb_mod_settings->isSet()){ isObjectUpdated = true; break;}
if(udp_sink_settings != nullptr && udp_sink_settings->isSet()){ isObjectUpdated = true; break;}
if(wfm_demod_settings != nullptr && wfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
if(wfm_mod_settings != nullptr && wfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;

View File

@ -31,6 +31,7 @@
#include "SWGNFMModSettings.h"
#include "SWGSSBModSettings.h"
#include "SWGUDPSinkSettings.h"
#include "SWGWFMDemodSettings.h"
#include "SWGWFMModSettings.h"
#include <QString>
@ -85,6 +86,9 @@ public:
SWGUDPSinkSettings* getUdpSinkSettings();
void setUdpSinkSettings(SWGUDPSinkSettings* udp_sink_settings);
SWGWFMDemodSettings* getWfmDemodSettings();
void setWfmDemodSettings(SWGWFMDemodSettings* wfm_demod_settings);
SWGWFMModSettings* getWfmModSettings();
void setWfmModSettings(SWGWFMModSettings* wfm_mod_settings);
@ -125,6 +129,9 @@ private:
SWGUDPSinkSettings* udp_sink_settings;
bool m_udp_sink_settings_isSet;
SWGWFMDemodSettings* wfm_demod_settings;
bool m_wfm_demod_settings_isSet;
SWGWFMModSettings* wfm_mod_settings;
bool m_wfm_mod_settings_isSet;

View File

@ -74,6 +74,8 @@
#include "SWGSuccessResponse.h"
#include "SWGUDPSinkReport.h"
#include "SWGUDPSinkSettings.h"
#include "SWGWFMDemodReport.h"
#include "SWGWFMDemodSettings.h"
#include "SWGWFMModReport.h"
#include "SWGWFMModSettings.h"
@ -260,6 +262,12 @@ namespace SWGSDRangel {
if(QString("SWGUDPSinkSettings").compare(type) == 0) {
return new SWGUDPSinkSettings();
}
if(QString("SWGWFMDemodReport").compare(type) == 0) {
return new SWGWFMDemodReport();
}
if(QString("SWGWFMDemodSettings").compare(type) == 0) {
return new SWGWFMDemodSettings();
}
if(QString("SWGWFMModReport").compare(type) == 0) {
return new SWGWFMModReport();
}

View File

@ -0,0 +1,169 @@
/**
* 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 "SWGWFMDemodReport.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGWFMDemodReport::SWGWFMDemodReport(QString* json) {
init();
this->fromJson(*json);
}
SWGWFMDemodReport::SWGWFMDemodReport() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
squelch = 0;
m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
}
SWGWFMDemodReport::~SWGWFMDemodReport() {
this->cleanup();
}
void
SWGWFMDemodReport::init() {
channel_power_db = 0.0f;
m_channel_power_db_isSet = false;
squelch = 0;
m_squelch_isSet = false;
audio_sample_rate = 0;
m_audio_sample_rate_isSet = false;
channel_sample_rate = 0;
m_channel_sample_rate_isSet = false;
}
void
SWGWFMDemodReport::cleanup() {
}
SWGWFMDemodReport*
SWGWFMDemodReport::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGWFMDemodReport::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
::SWGSDRangel::setValue(&channel_sample_rate, pJson["channelSampleRate"], "qint32", "");
}
QString
SWGWFMDemodReport::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGWFMDemodReport::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_channel_power_db_isSet){
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
}
if(m_squelch_isSet){
obj->insert("squelch", QJsonValue(squelch));
}
if(m_audio_sample_rate_isSet){
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
}
if(m_channel_sample_rate_isSet){
obj->insert("channelSampleRate", QJsonValue(channel_sample_rate));
}
return obj;
}
float
SWGWFMDemodReport::getChannelPowerDb() {
return channel_power_db;
}
void
SWGWFMDemodReport::setChannelPowerDb(float channel_power_db) {
this->channel_power_db = channel_power_db;
this->m_channel_power_db_isSet = true;
}
qint32
SWGWFMDemodReport::getSquelch() {
return squelch;
}
void
SWGWFMDemodReport::setSquelch(qint32 squelch) {
this->squelch = squelch;
this->m_squelch_isSet = true;
}
qint32
SWGWFMDemodReport::getAudioSampleRate() {
return audio_sample_rate;
}
void
SWGWFMDemodReport::setAudioSampleRate(qint32 audio_sample_rate) {
this->audio_sample_rate = audio_sample_rate;
this->m_audio_sample_rate_isSet = true;
}
qint32
SWGWFMDemodReport::getChannelSampleRate() {
return channel_sample_rate;
}
void
SWGWFMDemodReport::setChannelSampleRate(qint32 channel_sample_rate) {
this->channel_sample_rate = channel_sample_rate;
this->m_channel_sample_rate_isSet = true;
}
bool
SWGWFMDemodReport::isSet(){
bool isObjectUpdated = false;
do{
if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
if(m_squelch_isSet){ isObjectUpdated = true; break;}
if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
if(m_channel_sample_rate_isSet){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,76 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 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.
*/
/*
* SWGWFMDemodReport.h
*
* WFMDemod
*/
#ifndef SWGWFMDemodReport_H_
#define SWGWFMDemodReport_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGWFMDemodReport: public SWGObject {
public:
SWGWFMDemodReport();
SWGWFMDemodReport(QString* json);
virtual ~SWGWFMDemodReport();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGWFMDemodReport* fromJson(QString &jsonString) override;
float getChannelPowerDb();
void setChannelPowerDb(float channel_power_db);
qint32 getSquelch();
void setSquelch(qint32 squelch);
qint32 getAudioSampleRate();
void setAudioSampleRate(qint32 audio_sample_rate);
qint32 getChannelSampleRate();
void setChannelSampleRate(qint32 channel_sample_rate);
virtual bool isSet() override;
private:
float channel_power_db;
bool m_channel_power_db_isSet;
qint32 squelch;
bool m_squelch_isSet;
qint32 audio_sample_rate;
bool m_audio_sample_rate_isSet;
qint32 channel_sample_rate;
bool m_channel_sample_rate_isSet;
};
}
#endif /* SWGWFMDemodReport_H_ */

View File

@ -0,0 +1,278 @@
/**
* 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 "SWGWFMDemodSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGWFMDemodSettings::SWGWFMDemodSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGWFMDemodSettings::SWGWFMDemodSettings() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
af_bandwidth = 0.0f;
m_af_bandwidth_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
squelch = 0.0f;
m_squelch_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = nullptr;
m_title_isSet = false;
audio_device_name = nullptr;
m_audio_device_name_isSet = false;
}
SWGWFMDemodSettings::~SWGWFMDemodSettings() {
this->cleanup();
}
void
SWGWFMDemodSettings::init() {
input_frequency_offset = 0L;
m_input_frequency_offset_isSet = false;
rf_bandwidth = 0.0f;
m_rf_bandwidth_isSet = false;
af_bandwidth = 0.0f;
m_af_bandwidth_isSet = false;
volume = 0.0f;
m_volume_isSet = false;
squelch = 0.0f;
m_squelch_isSet = false;
audio_mute = 0;
m_audio_mute_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
title = new QString("");
m_title_isSet = false;
audio_device_name = new QString("");
m_audio_device_name_isSet = false;
}
void
SWGWFMDemodSettings::cleanup() {
if(title != nullptr) {
delete title;
}
if(audio_device_name != nullptr) {
delete audio_device_name;
}
}
SWGWFMDemodSettings*
SWGWFMDemodSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGWFMDemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
::SWGSDRangel::setValue(&af_bandwidth, pJson["afBandwidth"], "float", "");
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
::SWGSDRangel::setValue(&audio_mute, pJson["audioMute"], "qint32", "");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&audio_device_name, pJson["audioDeviceName"], "QString", "QString");
}
QString
SWGWFMDemodSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGWFMDemodSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_input_frequency_offset_isSet){
obj->insert("inputFrequencyOffset", QJsonValue(input_frequency_offset));
}
if(m_rf_bandwidth_isSet){
obj->insert("rfBandwidth", QJsonValue(rf_bandwidth));
}
if(m_af_bandwidth_isSet){
obj->insert("afBandwidth", QJsonValue(af_bandwidth));
}
if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume));
}
if(m_squelch_isSet){
obj->insert("squelch", QJsonValue(squelch));
}
if(m_audio_mute_isSet){
obj->insert("audioMute", QJsonValue(audio_mute));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(audio_device_name != nullptr && *audio_device_name != QString("")){
toJsonValue(QString("audioDeviceName"), audio_device_name, obj, QString("QString"));
}
return obj;
}
qint64
SWGWFMDemodSettings::getInputFrequencyOffset() {
return input_frequency_offset;
}
void
SWGWFMDemodSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
this->input_frequency_offset = input_frequency_offset;
this->m_input_frequency_offset_isSet = true;
}
float
SWGWFMDemodSettings::getRfBandwidth() {
return rf_bandwidth;
}
void
SWGWFMDemodSettings::setRfBandwidth(float rf_bandwidth) {
this->rf_bandwidth = rf_bandwidth;
this->m_rf_bandwidth_isSet = true;
}
float
SWGWFMDemodSettings::getAfBandwidth() {
return af_bandwidth;
}
void
SWGWFMDemodSettings::setAfBandwidth(float af_bandwidth) {
this->af_bandwidth = af_bandwidth;
this->m_af_bandwidth_isSet = true;
}
float
SWGWFMDemodSettings::getVolume() {
return volume;
}
void
SWGWFMDemodSettings::setVolume(float volume) {
this->volume = volume;
this->m_volume_isSet = true;
}
float
SWGWFMDemodSettings::getSquelch() {
return squelch;
}
void
SWGWFMDemodSettings::setSquelch(float squelch) {
this->squelch = squelch;
this->m_squelch_isSet = true;
}
qint32
SWGWFMDemodSettings::getAudioMute() {
return audio_mute;
}
void
SWGWFMDemodSettings::setAudioMute(qint32 audio_mute) {
this->audio_mute = audio_mute;
this->m_audio_mute_isSet = true;
}
qint32
SWGWFMDemodSettings::getRgbColor() {
return rgb_color;
}
void
SWGWFMDemodSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
QString*
SWGWFMDemodSettings::getTitle() {
return title;
}
void
SWGWFMDemodSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
QString*
SWGWFMDemodSettings::getAudioDeviceName() {
return audio_device_name;
}
void
SWGWFMDemodSettings::setAudioDeviceName(QString* audio_device_name) {
this->audio_device_name = audio_device_name;
this->m_audio_device_name_isSet = true;
}
bool
SWGWFMDemodSettings::isSet(){
bool isObjectUpdated = false;
do{
if(m_input_frequency_offset_isSet){ isObjectUpdated = true; break;}
if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_af_bandwidth_isSet){ isObjectUpdated = true; break;}
if(m_volume_isSet){ isObjectUpdated = true; break;}
if(m_squelch_isSet){ isObjectUpdated = true; break;}
if(m_audio_mute_isSet){ isObjectUpdated = true; break;}
if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
if(audio_device_name != nullptr && *audio_device_name != QString("")){ isObjectUpdated = true; break;}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,107 @@
/**
* 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.
*/
/*
* SWGWFMDemodSettings.h
*
* WFMDemod
*/
#ifndef SWGWFMDemodSettings_H_
#define SWGWFMDemodSettings_H_
#include <QJsonObject>
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGWFMDemodSettings: public SWGObject {
public:
SWGWFMDemodSettings();
SWGWFMDemodSettings(QString* json);
virtual ~SWGWFMDemodSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGWFMDemodSettings* fromJson(QString &jsonString) override;
qint64 getInputFrequencyOffset();
void setInputFrequencyOffset(qint64 input_frequency_offset);
float getRfBandwidth();
void setRfBandwidth(float rf_bandwidth);
float getAfBandwidth();
void setAfBandwidth(float af_bandwidth);
float getVolume();
void setVolume(float volume);
float getSquelch();
void setSquelch(float squelch);
qint32 getAudioMute();
void setAudioMute(qint32 audio_mute);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
QString* getTitle();
void setTitle(QString* title);
QString* getAudioDeviceName();
void setAudioDeviceName(QString* audio_device_name);
virtual bool isSet() override;
private:
qint64 input_frequency_offset;
bool m_input_frequency_offset_isSet;
float rf_bandwidth;
bool m_rf_bandwidth_isSet;
float af_bandwidth;
bool m_af_bandwidth_isSet;
float volume;
bool m_volume_isSet;
float squelch;
bool m_squelch_isSet;
qint32 audio_mute;
bool m_audio_mute_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;
QString* title;
bool m_title_isSet;
QString* audio_device_name;
bool m_audio_device_name_isSet;
};
}
#endif /* SWGWFMDemodSettings_H_ */

View File

@ -174,6 +174,14 @@ def setupChannel(deviceset_url, options):
settings["BFMDemodSettings"]["lsbStereo"] = 1 if options.lsb_stereo else 0
settings["BFMDemodSettings"]["rdsActive"] = 1 if options.rds else 0
settings["BFMDemodSettings"]["title"] = "Channel %d" % i
elif options.channel_id == "WFMDemod":
settings["WFMDemodSettings"]["inputFrequencyOffset"] = options.channel_freq
settings["WFMDemodSettings"]["afBandwidth"] = options.af_bw * 1000
settings["WFMDemodSettings"]["rfBandwidth"] = options.rf_bw
settings["WFMDemodSettings"]["volume"] = options.volume
settings["WFMDemodSettings"]["squelch"] = options.squelch_db # dB
settings["WFMDemodSettings"]["audioMute"] = 0
settings["WFMDemodSettings"]["title"] = "Channel %d" % i
elif options.channel_id == "AMDemod":
settings["AMDemodSettings"]["inputFrequencyOffset"] = options.channel_freq
settings["AMDemodSettings"]["rfBandwidth"] = options.rf_bw