mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 17:28:50 -05:00
Web API: AM demod: implemented settings and report entry points
This commit is contained in:
parent
e6eecf3e28
commit
7ad8e50651
@ -1,5 +1,7 @@
|
||||
project(am)
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||
|
||||
set(am_SOURCES
|
||||
amdemod.cpp
|
||||
amdemodgui.cpp
|
||||
@ -21,6 +23,7 @@ set(am_FORMS
|
||||
include_directories(
|
||||
.
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/swagger/sdrangel/code/qt5/client
|
||||
)
|
||||
|
||||
#include(${QT_USE_FILE})
|
||||
|
@ -22,12 +22,18 @@
|
||||
#include <stdio.h>
|
||||
#include <complex.h>
|
||||
|
||||
#include "SWGChannelSettings.h"
|
||||
#include "SWGAMDemodSettings.h"
|
||||
#include "SWGChannelReport.h"
|
||||
#include "SWGAMDemodReport.h"
|
||||
|
||||
#include "dsp/downchannelizer.h"
|
||||
#include "audio/audiooutput.h"
|
||||
#include "dsp/dspengine.h"
|
||||
#include "dsp/threadedbasebandsamplesink.h"
|
||||
#include "dsp/dspcommands.h"
|
||||
#include "device/devicesourceapi.h"
|
||||
#include "util/db.h"
|
||||
|
||||
MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureAMDemod, Message)
|
||||
MESSAGE_CLASS_DEFINITION(AMDemod::MsgConfigureChannelizer, Message)
|
||||
@ -313,3 +319,132 @@ bool AMDemod::deserialize(const QByteArray& data)
|
||||
}
|
||||
}
|
||||
|
||||
int AMDemod::webapiSettingsGet(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
response.setAmDemodSettings(new SWGSDRangel::SWGAMDemodSettings());
|
||||
response.getAmDemodSettings()->init();
|
||||
webapiFormatChannelSettings(response, m_settings);
|
||||
return 200;
|
||||
}
|
||||
|
||||
int AMDemod::webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
AMDemodSettings settings = m_settings;
|
||||
bool frequencyOffsetChanged = false;
|
||||
|
||||
if (channelSettingsKeys.contains("audioMute")) {
|
||||
settings.m_audioMute = response.getAmDemodSettings()->getAudioMute() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("audioSampleRate")) {
|
||||
settings.m_audioSampleRate = response.getAmDemodSettings()->getAudioSampleRate();
|
||||
}
|
||||
if (channelSettingsKeys.contains("copyAudioToUDP")) {
|
||||
settings.m_copyAudioToUDP = response.getAmDemodSettings()->getCopyAudioToUdp() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("copyAudioUseRTP")) {
|
||||
settings.m_copyAudioUseRTP = response.getAmDemodSettings()->getCopyAudioUseRtp() != 0;
|
||||
}
|
||||
if (channelSettingsKeys.contains("inputFrequencyOffset"))
|
||||
{
|
||||
settings.m_inputFrequencyOffset = response.getAmDemodSettings()->getInputFrequencyOffset();
|
||||
frequencyOffsetChanged = true;
|
||||
}
|
||||
if (channelSettingsKeys.contains("rfBandwidth")) {
|
||||
settings.m_rfBandwidth = response.getAmDemodSettings()->getRfBandwidth();
|
||||
}
|
||||
if (channelSettingsKeys.contains("rgbColor")) {
|
||||
settings.m_rgbColor = response.getAmDemodSettings()->getRgbColor();
|
||||
}
|
||||
if (channelSettingsKeys.contains("squelch")) {
|
||||
settings.m_squelch = response.getAmDemodSettings()->getSquelch();
|
||||
}
|
||||
if (channelSettingsKeys.contains("title")) {
|
||||
settings.m_title = *response.getAmDemodSettings()->getTitle();
|
||||
}
|
||||
if (channelSettingsKeys.contains("udpAddress")) {
|
||||
settings.m_udpAddress = *response.getAmDemodSettings()->getUdpAddress();
|
||||
}
|
||||
if (channelSettingsKeys.contains("udpPort")) {
|
||||
settings.m_udpPort = response.getAmDemodSettings()->getUdpPort();
|
||||
}
|
||||
if (channelSettingsKeys.contains("volume")) {
|
||||
settings.m_volume = response.getAmDemodSettings()->getVolume();
|
||||
}
|
||||
if (channelSettingsKeys.contains("bandpassEnable")) {
|
||||
settings.m_bandpassEnable = response.getAmDemodSettings()->getBandpassEnable() != 0;
|
||||
}
|
||||
|
||||
if (frequencyOffsetChanged)
|
||||
{
|
||||
MsgConfigureChannelizer* channelConfigMsg = MsgConfigureChannelizer::create(
|
||||
48000, settings.m_inputFrequencyOffset);
|
||||
m_inputMessageQueue.push(channelConfigMsg);
|
||||
}
|
||||
|
||||
MsgConfigureAMDemod *msg = MsgConfigureAMDemod::create(settings, force);
|
||||
m_inputMessageQueue.push(msg);
|
||||
|
||||
if (m_guiMessageQueue) // forward to GUI if any
|
||||
{
|
||||
MsgConfigureAMDemod *msgToGUI = MsgConfigureAMDemod::create(settings, force);
|
||||
m_guiMessageQueue->push(msgToGUI);
|
||||
}
|
||||
|
||||
webapiFormatChannelSettings(response, settings);
|
||||
|
||||
return 200;
|
||||
}
|
||||
|
||||
int AMDemod::webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage __attribute__((unused)))
|
||||
{
|
||||
response.setAmDemodReport(new SWGSDRangel::SWGAMDemodReport());
|
||||
response.getAmDemodReport()->init();
|
||||
webapiFormatChannelReport(response);
|
||||
return 200;
|
||||
}
|
||||
|
||||
void AMDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const AMDemodSettings& settings)
|
||||
{
|
||||
response.getAmDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
|
||||
response.getAmDemodSettings()->setAudioSampleRate(settings.m_audioSampleRate);
|
||||
response.getAmDemodSettings()->setCopyAudioToUdp(settings.m_copyAudioToUDP ? 1 : 0);
|
||||
response.getAmDemodSettings()->setCopyAudioUseRtp(settings.m_copyAudioUseRTP ? 1 : 0);
|
||||
response.getAmDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
|
||||
response.getAmDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
|
||||
response.getAmDemodSettings()->setRgbColor(settings.m_rgbColor);
|
||||
response.getAmDemodSettings()->setSquelch(settings.m_squelch);
|
||||
response.getAmDemodSettings()->setUdpPort(settings.m_udpPort);
|
||||
response.getAmDemodSettings()->setVolume(settings.m_volume);
|
||||
response.getAmDemodSettings()->setBandpassEnable(settings.m_bandpassEnable ? 1 : 0);
|
||||
|
||||
if (response.getAmDemodSettings()->getTitle()) {
|
||||
*response.getAmDemodSettings()->getTitle() = settings.m_title;
|
||||
} else {
|
||||
response.getAmDemodSettings()->setTitle(new QString(settings.m_title));
|
||||
}
|
||||
|
||||
if (response.getAmDemodSettings()->getUdpAddress()) {
|
||||
*response.getAmDemodSettings()->getUdpAddress() = settings.m_udpAddress;
|
||||
} else {
|
||||
response.getAmDemodSettings()->setUdpAddress(new QString(settings.m_udpAddress));
|
||||
}
|
||||
}
|
||||
|
||||
void AMDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
{
|
||||
double magsqAvg, magsqPeak;
|
||||
int nbMagsqSamples;
|
||||
getMagSqLevels(magsqAvg, magsqPeak, nbMagsqSamples);
|
||||
|
||||
response.getAmDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsqAvg));
|
||||
response.getAmDemodReport()->setSquelch(m_squelchOpen ? 1 : 0);
|
||||
}
|
||||
|
||||
|
@ -101,6 +101,20 @@ public:
|
||||
virtual QByteArray serialize() const;
|
||||
virtual bool deserialize(const QByteArray& data);
|
||||
|
||||
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);
|
||||
|
||||
double getMagSq() const { return m_magsq; }
|
||||
bool getSquelchOpen() const { return m_squelchOpen; }
|
||||
|
||||
@ -162,6 +176,8 @@ private:
|
||||
|
||||
void applyChannelSettings(int inputSampleRate, int inputFrequencyOffset, bool force = false);
|
||||
void applySettings(const AMDemodSettings& settings, bool force = false);
|
||||
void webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& response, const AMDemodSettings& settings);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
|
||||
void processOneSample(Complex &ci)
|
||||
{
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
const PluginDescriptor AMDemodPlugin::m_pluginDescriptor = {
|
||||
QString("AM Demodulator"),
|
||||
QString("3.12.0"),
|
||||
QString("3.13.1"),
|
||||
QString("(c) Edouard Griffiths, F4EXB"),
|
||||
QString("https://github.com/f4exb/sdrangel"),
|
||||
true,
|
||||
|
@ -6,6 +6,7 @@
|
||||
<file>webapi/doc/swagger/include/FileSource.yaml</file>
|
||||
<file>webapi/doc/swagger/include/HackRF.yaml</file>
|
||||
<file>webapi/doc/swagger/include/LimeSdr.yaml</file>
|
||||
<file>webapi/doc/swagger/include/AMDemod.yaml</file>
|
||||
<file>webapi/doc/swagger/include/NFMDemod.yaml</file>
|
||||
<file>webapi/doc/swagger/include/NFMMod.yaml</file>
|
||||
<file>webapi/doc/swagger/include/RtlSdr.yaml</file>
|
||||
|
@ -696,6 +696,72 @@ margin-bottom: 20px;
|
||||
<script>
|
||||
// Script section to load models into a JS Var
|
||||
var defs = {}
|
||||
defs.AMDemodReport = {
|
||||
"properties" : {
|
||||
"channelPowerDB" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power received in channel (dB)"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "integer",
|
||||
"description" : "squelch status (1 if open else 0)"
|
||||
}
|
||||
},
|
||||
"description" : "AMDemod"
|
||||
};
|
||||
defs.AMDemodSettings = {
|
||||
"properties" : {
|
||||
"inputFrequencyOffset" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64",
|
||||
"description" : "channel center frequency shift from baseband center in Hz"
|
||||
},
|
||||
"rfBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "channel RF bandwidth in Hz (rounds to lower kHz)"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power squelch threshold in centi-bels"
|
||||
},
|
||||
"volume" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
},
|
||||
"audioSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"audioMute" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandpassEnable" : {
|
||||
"type" : "integer",
|
||||
"description" : "use bandpass filter (1 for yes, 0 for no)"
|
||||
},
|
||||
"copyAudioToUDP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"copyAudioUseRTP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"udpAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"udpPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"rgbColor" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"title" : {
|
||||
"type" : "string"
|
||||
}
|
||||
},
|
||||
"description" : "AMDemod"
|
||||
};
|
||||
defs.AudioDevice = {
|
||||
"properties" : {
|
||||
"name" : {
|
||||
@ -855,6 +921,9 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "Not zero if it is a tx channel else it is a rx channel"
|
||||
},
|
||||
"AMDemodReport" : {
|
||||
"$ref" : "#/definitions/AMDemodReport"
|
||||
},
|
||||
"NFMDemodReport" : {
|
||||
"$ref" : "#/definitions/NFMDemodReport"
|
||||
},
|
||||
@ -876,6 +945,9 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "Not zero if it is a tx channel else it is a rx channel"
|
||||
},
|
||||
"AMDemodSettings" : {
|
||||
"$ref" : "#/definitions/AMDemodSettings"
|
||||
},
|
||||
"NFMDemodSettings" : {
|
||||
"$ref" : "#/definitions/NFMDemodSettings"
|
||||
},
|
||||
@ -1389,28 +1461,33 @@ margin-bottom: 20px;
|
||||
"properties" : {
|
||||
"inputFrequencyOffset" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
"format" : "int64",
|
||||
"description" : "channel center frequency shift from baseband center in Hz"
|
||||
},
|
||||
"rfBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "channel RF bandwidth in Hz (takes closest value from RF bandwidth set)"
|
||||
},
|
||||
"afBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "AF bandwidth in Hz (rounds to lower kHz)"
|
||||
},
|
||||
"fmDeviation" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"squelchGate" : {
|
||||
"type" : "integer"
|
||||
"type" : "integer",
|
||||
"description" : "squelch gate in tens of ms"
|
||||
},
|
||||
"deltaSquelch" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "power squelch threshold in centi-bels"
|
||||
},
|
||||
"volume" : {
|
||||
"type" : "number",
|
||||
@ -17955,7 +18032,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-03-20T20:09:28.335+01:00
|
||||
Generated 2018-03-21T22:39:00.405+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
48
sdrbase/resources/webapi/doc/swagger/include/AMDemod.yaml
Normal file
48
sdrbase/resources/webapi/doc/swagger/include/AMDemod.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
AMDemodSettings:
|
||||
description: AMDemod
|
||||
properties:
|
||||
inputFrequencyOffset:
|
||||
description: channel center frequency shift from baseband center in Hz
|
||||
type: integer
|
||||
format: int64
|
||||
rfBandwidth:
|
||||
description: channel RF bandwidth in Hz (rounds to lower kHz)
|
||||
type: number
|
||||
format: float
|
||||
squelch:
|
||||
description: power squelch threshold in centi-bels
|
||||
type: number
|
||||
format: float
|
||||
volume:
|
||||
type: number
|
||||
format: float
|
||||
audioSampleRate:
|
||||
type: integer
|
||||
audioMute:
|
||||
type: integer
|
||||
bandpassEnable:
|
||||
description: use bandpass filter (1 for yes, 0 for no)
|
||||
type: integer
|
||||
copyAudioToUDP:
|
||||
type: integer
|
||||
copyAudioUseRTP:
|
||||
type: integer
|
||||
udpAddress:
|
||||
type: string
|
||||
udpPort:
|
||||
type: integer
|
||||
rgbColor:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
|
||||
AMDemodReport:
|
||||
description: AMDemod
|
||||
properties:
|
||||
channelPowerDB:
|
||||
description: power received in channel (dB)
|
||||
type: number
|
||||
format: float
|
||||
squelch:
|
||||
description: squelch status (1 if open else 0)
|
||||
type: integer
|
@ -2,21 +2,26 @@ NFMDemodSettings:
|
||||
description: NFMDemod
|
||||
properties:
|
||||
inputFrequencyOffset:
|
||||
description: channel center frequency shift from baseband center in Hz
|
||||
type: integer
|
||||
format: int64
|
||||
rfBandwidth:
|
||||
description: channel RF bandwidth in Hz (takes closest value from RF bandwidth set)
|
||||
type: number
|
||||
format: float
|
||||
afBandwidth:
|
||||
description: AF bandwidth in Hz (rounds to lower kHz)
|
||||
type: number
|
||||
format: float
|
||||
fmDeviation:
|
||||
type: integer
|
||||
squelchGate:
|
||||
description: squelch gate in tens of ms
|
||||
type: integer
|
||||
deltaSquelch:
|
||||
type: integer
|
||||
squelch:
|
||||
description: power squelch threshold in centi-bels
|
||||
type: number
|
||||
format: float
|
||||
volume:
|
||||
|
@ -1594,6 +1594,8 @@ definitions:
|
||||
tx:
|
||||
description: Not zero if it is a tx channel else it is a rx channel
|
||||
type: integer
|
||||
AMDemodSettings:
|
||||
$ref: "/doc/swagger/include/AMDemod.yaml#/AMDemodSettings"
|
||||
NFMDemodSettings:
|
||||
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
|
||||
NFMModSettings:
|
||||
@ -1609,6 +1611,8 @@ definitions:
|
||||
tx:
|
||||
description: Not zero if it is a tx channel else it is a rx channel
|
||||
type: integer
|
||||
AMDemodReport:
|
||||
$ref: "/doc/swagger/include/AMDemod.yaml#/AMDemodReport"
|
||||
NFMDemodReport:
|
||||
$ref: "/doc/swagger/include/NFMDemod.yaml#/NFMDemodReport"
|
||||
NFMModReport:
|
||||
|
48
swagger/sdrangel/api/swagger/include/AMDemod.yaml
Normal file
48
swagger/sdrangel/api/swagger/include/AMDemod.yaml
Normal file
@ -0,0 +1,48 @@
|
||||
AMDemodSettings:
|
||||
description: AMDemod
|
||||
properties:
|
||||
inputFrequencyOffset:
|
||||
description: channel center frequency shift from baseband center in Hz
|
||||
type: integer
|
||||
format: int64
|
||||
rfBandwidth:
|
||||
description: channel RF bandwidth in Hz (rounds to lower kHz)
|
||||
type: number
|
||||
format: float
|
||||
squelch:
|
||||
description: power squelch threshold in centi-bels
|
||||
type: number
|
||||
format: float
|
||||
volume:
|
||||
type: number
|
||||
format: float
|
||||
audioSampleRate:
|
||||
type: integer
|
||||
audioMute:
|
||||
type: integer
|
||||
bandpassEnable:
|
||||
description: use bandpass filter (1 for yes, 0 for no)
|
||||
type: integer
|
||||
copyAudioToUDP:
|
||||
type: integer
|
||||
copyAudioUseRTP:
|
||||
type: integer
|
||||
udpAddress:
|
||||
type: string
|
||||
udpPort:
|
||||
type: integer
|
||||
rgbColor:
|
||||
type: integer
|
||||
title:
|
||||
type: string
|
||||
|
||||
AMDemodReport:
|
||||
description: AMDemod
|
||||
properties:
|
||||
channelPowerDB:
|
||||
description: power received in channel (dB)
|
||||
type: number
|
||||
format: float
|
||||
squelch:
|
||||
description: squelch status (1 if open else 0)
|
||||
type: integer
|
@ -2,21 +2,26 @@ NFMDemodSettings:
|
||||
description: NFMDemod
|
||||
properties:
|
||||
inputFrequencyOffset:
|
||||
description: channel center frequency shift from baseband center in Hz
|
||||
type: integer
|
||||
format: int64
|
||||
rfBandwidth:
|
||||
description: channel RF bandwidth in Hz (takes closest value from RF bandwidth set)
|
||||
type: number
|
||||
format: float
|
||||
afBandwidth:
|
||||
description: AF bandwidth in Hz (rounds to lower kHz)
|
||||
type: number
|
||||
format: float
|
||||
fmDeviation:
|
||||
type: integer
|
||||
squelchGate:
|
||||
description: squelch gate in tens of ms
|
||||
type: integer
|
||||
deltaSquelch:
|
||||
type: integer
|
||||
squelch:
|
||||
description: power squelch threshold in centi-bels
|
||||
type: number
|
||||
format: float
|
||||
volume:
|
||||
|
@ -1594,6 +1594,8 @@ definitions:
|
||||
tx:
|
||||
description: Not zero if it is a tx channel else it is a rx channel
|
||||
type: integer
|
||||
AMDemodSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/AMDemod.yaml#/AMDemodSettings"
|
||||
NFMDemodSettings:
|
||||
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodSettings"
|
||||
NFMModSettings:
|
||||
@ -1609,6 +1611,8 @@ definitions:
|
||||
tx:
|
||||
description: Not zero if it is a tx channel else it is a rx channel
|
||||
type: integer
|
||||
AMDemodReport:
|
||||
$ref: "http://localhost:8081/api/swagger/include/AMDemod.yaml#/AMDemodReport"
|
||||
NFMDemodReport:
|
||||
$ref: "http://localhost:8081/api/swagger/include/NFMDemod.yaml#/NFMDemodReport"
|
||||
NFMModReport:
|
||||
|
@ -696,6 +696,72 @@ margin-bottom: 20px;
|
||||
<script>
|
||||
// Script section to load models into a JS Var
|
||||
var defs = {}
|
||||
defs.AMDemodReport = {
|
||||
"properties" : {
|
||||
"channelPowerDB" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power received in channel (dB)"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "integer",
|
||||
"description" : "squelch status (1 if open else 0)"
|
||||
}
|
||||
},
|
||||
"description" : "AMDemod"
|
||||
};
|
||||
defs.AMDemodSettings = {
|
||||
"properties" : {
|
||||
"inputFrequencyOffset" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64",
|
||||
"description" : "channel center frequency shift from baseband center in Hz"
|
||||
},
|
||||
"rfBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "channel RF bandwidth in Hz (rounds to lower kHz)"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power squelch threshold in centi-bels"
|
||||
},
|
||||
"volume" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
},
|
||||
"audioSampleRate" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"audioMute" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"bandpassEnable" : {
|
||||
"type" : "integer",
|
||||
"description" : "use bandpass filter (1 for yes, 0 for no)"
|
||||
},
|
||||
"copyAudioToUDP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"copyAudioUseRTP" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"udpAddress" : {
|
||||
"type" : "string"
|
||||
},
|
||||
"udpPort" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"rgbColor" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"title" : {
|
||||
"type" : "string"
|
||||
}
|
||||
},
|
||||
"description" : "AMDemod"
|
||||
};
|
||||
defs.AudioDevice = {
|
||||
"properties" : {
|
||||
"name" : {
|
||||
@ -855,6 +921,9 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "Not zero if it is a tx channel else it is a rx channel"
|
||||
},
|
||||
"AMDemodReport" : {
|
||||
"$ref" : "#/definitions/AMDemodReport"
|
||||
},
|
||||
"NFMDemodReport" : {
|
||||
"$ref" : "#/definitions/NFMDemodReport"
|
||||
},
|
||||
@ -876,6 +945,9 @@ margin-bottom: 20px;
|
||||
"type" : "integer",
|
||||
"description" : "Not zero if it is a tx channel else it is a rx channel"
|
||||
},
|
||||
"AMDemodSettings" : {
|
||||
"$ref" : "#/definitions/AMDemodSettings"
|
||||
},
|
||||
"NFMDemodSettings" : {
|
||||
"$ref" : "#/definitions/NFMDemodSettings"
|
||||
},
|
||||
@ -1389,28 +1461,33 @@ margin-bottom: 20px;
|
||||
"properties" : {
|
||||
"inputFrequencyOffset" : {
|
||||
"type" : "integer",
|
||||
"format" : "int64"
|
||||
"format" : "int64",
|
||||
"description" : "channel center frequency shift from baseband center in Hz"
|
||||
},
|
||||
"rfBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "channel RF bandwidth in Hz (takes closest value from RF bandwidth set)"
|
||||
},
|
||||
"afBandwidth" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "AF bandwidth in Hz (rounds to lower kHz)"
|
||||
},
|
||||
"fmDeviation" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"squelchGate" : {
|
||||
"type" : "integer"
|
||||
"type" : "integer",
|
||||
"description" : "squelch gate in tens of ms"
|
||||
},
|
||||
"deltaSquelch" : {
|
||||
"type" : "integer"
|
||||
},
|
||||
"squelch" : {
|
||||
"type" : "number",
|
||||
"format" : "float"
|
||||
"format" : "float",
|
||||
"description" : "power squelch threshold in centi-bels"
|
||||
},
|
||||
"volume" : {
|
||||
"type" : "number",
|
||||
@ -17955,7 +18032,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2018-03-20T20:09:28.335+01:00
|
||||
Generated 2018-03-21T22:39:00.405+01:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
127
swagger/sdrangel/code/qt5/client/SWGAMDemodReport.cpp
Normal file
127
swagger/sdrangel/code/qt5/client/SWGAMDemodReport.cpp
Normal file
@ -0,0 +1,127 @@
|
||||
/**
|
||||
* 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 "SWGAMDemodReport.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGAMDemodReport::SWGAMDemodReport(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGAMDemodReport::SWGAMDemodReport() {
|
||||
channel_power_db = 0.0f;
|
||||
m_channel_power_db_isSet = false;
|
||||
squelch = 0;
|
||||
m_squelch_isSet = false;
|
||||
}
|
||||
|
||||
SWGAMDemodReport::~SWGAMDemodReport() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodReport::init() {
|
||||
channel_power_db = 0.0f;
|
||||
m_channel_power_db_isSet = false;
|
||||
squelch = 0;
|
||||
m_squelch_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodReport::cleanup() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGAMDemodReport*
|
||||
SWGAMDemodReport::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodReport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGAMDemodReport::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGAMDemodReport::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));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
float
|
||||
SWGAMDemodReport::getChannelPowerDb() {
|
||||
return channel_power_db;
|
||||
}
|
||||
void
|
||||
SWGAMDemodReport::setChannelPowerDb(float channel_power_db) {
|
||||
this->channel_power_db = channel_power_db;
|
||||
this->m_channel_power_db_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodReport::getSquelch() {
|
||||
return squelch;
|
||||
}
|
||||
void
|
||||
SWGAMDemodReport::setSquelch(qint32 squelch) {
|
||||
this->squelch = squelch;
|
||||
this->m_squelch_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGAMDemodReport::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_channel_power_db_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_squelch_isSet){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
64
swagger/sdrangel/code/qt5/client/SWGAMDemodReport.h
Normal file
64
swagger/sdrangel/code/qt5/client/SWGAMDemodReport.h
Normal file
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGAMDemodReport.h
|
||||
*
|
||||
* AMDemod
|
||||
*/
|
||||
|
||||
#ifndef SWGAMDemodReport_H_
|
||||
#define SWGAMDemodReport_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGAMDemodReport: public SWGObject {
|
||||
public:
|
||||
SWGAMDemodReport();
|
||||
SWGAMDemodReport(QString* json);
|
||||
virtual ~SWGAMDemodReport();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGAMDemodReport* fromJson(QString &jsonString) override;
|
||||
|
||||
float getChannelPowerDb();
|
||||
void setChannelPowerDb(float channel_power_db);
|
||||
|
||||
qint32 getSquelch();
|
||||
void setSquelch(qint32 squelch);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
float channel_power_db;
|
||||
bool m_channel_power_db_isSet;
|
||||
|
||||
qint32 squelch;
|
||||
bool m_squelch_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGAMDemodReport_H_ */
|
362
swagger/sdrangel/code/qt5/client/SWGAMDemodSettings.cpp
Normal file
362
swagger/sdrangel/code/qt5/client/SWGAMDemodSettings.cpp
Normal file
@ -0,0 +1,362 @@
|
||||
/**
|
||||
* 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 "SWGAMDemodSettings.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGAMDemodSettings::SWGAMDemodSettings(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGAMDemodSettings::SWGAMDemodSettings() {
|
||||
input_frequency_offset = 0L;
|
||||
m_input_frequency_offset_isSet = false;
|
||||
rf_bandwidth = 0.0f;
|
||||
m_rf_bandwidth_isSet = false;
|
||||
squelch = 0.0f;
|
||||
m_squelch_isSet = false;
|
||||
volume = 0.0f;
|
||||
m_volume_isSet = false;
|
||||
audio_sample_rate = 0;
|
||||
m_audio_sample_rate_isSet = false;
|
||||
audio_mute = 0;
|
||||
m_audio_mute_isSet = false;
|
||||
bandpass_enable = 0;
|
||||
m_bandpass_enable_isSet = false;
|
||||
copy_audio_to_udp = 0;
|
||||
m_copy_audio_to_udp_isSet = false;
|
||||
copy_audio_use_rtp = 0;
|
||||
m_copy_audio_use_rtp_isSet = false;
|
||||
udp_address = nullptr;
|
||||
m_udp_address_isSet = false;
|
||||
udp_port = 0;
|
||||
m_udp_port_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = nullptr;
|
||||
m_title_isSet = false;
|
||||
}
|
||||
|
||||
SWGAMDemodSettings::~SWGAMDemodSettings() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodSettings::init() {
|
||||
input_frequency_offset = 0L;
|
||||
m_input_frequency_offset_isSet = false;
|
||||
rf_bandwidth = 0.0f;
|
||||
m_rf_bandwidth_isSet = false;
|
||||
squelch = 0.0f;
|
||||
m_squelch_isSet = false;
|
||||
volume = 0.0f;
|
||||
m_volume_isSet = false;
|
||||
audio_sample_rate = 0;
|
||||
m_audio_sample_rate_isSet = false;
|
||||
audio_mute = 0;
|
||||
m_audio_mute_isSet = false;
|
||||
bandpass_enable = 0;
|
||||
m_bandpass_enable_isSet = false;
|
||||
copy_audio_to_udp = 0;
|
||||
m_copy_audio_to_udp_isSet = false;
|
||||
copy_audio_use_rtp = 0;
|
||||
m_copy_audio_use_rtp_isSet = false;
|
||||
udp_address = new QString("");
|
||||
m_udp_address_isSet = false;
|
||||
udp_port = 0;
|
||||
m_udp_port_isSet = false;
|
||||
rgb_color = 0;
|
||||
m_rgb_color_isSet = false;
|
||||
title = new QString("");
|
||||
m_title_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodSettings::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if(udp_address != nullptr) {
|
||||
delete udp_address;
|
||||
}
|
||||
|
||||
|
||||
if(title != nullptr) {
|
||||
delete title;
|
||||
}
|
||||
}
|
||||
|
||||
SWGAMDemodSettings*
|
||||
SWGAMDemodSettings::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGAMDemodSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&input_frequency_offset, pJson["inputFrequencyOffset"], "qint64", "");
|
||||
|
||||
::SWGSDRangel::setValue(&rf_bandwidth, pJson["rfBandwidth"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&squelch, pJson["squelch"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&audio_sample_rate, pJson["audioSampleRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&audio_mute, pJson["audioMute"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&bandpass_enable, pJson["bandpassEnable"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(©_audio_to_udp, pJson["copyAudioToUDP"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(©_audio_use_rtp, pJson["copyAudioUseRTP"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString");
|
||||
|
||||
::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGAMDemodSettings::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGAMDemodSettings::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_squelch_isSet){
|
||||
obj->insert("squelch", QJsonValue(squelch));
|
||||
}
|
||||
if(m_volume_isSet){
|
||||
obj->insert("volume", QJsonValue(volume));
|
||||
}
|
||||
if(m_audio_sample_rate_isSet){
|
||||
obj->insert("audioSampleRate", QJsonValue(audio_sample_rate));
|
||||
}
|
||||
if(m_audio_mute_isSet){
|
||||
obj->insert("audioMute", QJsonValue(audio_mute));
|
||||
}
|
||||
if(m_bandpass_enable_isSet){
|
||||
obj->insert("bandpassEnable", QJsonValue(bandpass_enable));
|
||||
}
|
||||
if(m_copy_audio_to_udp_isSet){
|
||||
obj->insert("copyAudioToUDP", QJsonValue(copy_audio_to_udp));
|
||||
}
|
||||
if(m_copy_audio_use_rtp_isSet){
|
||||
obj->insert("copyAudioUseRTP", QJsonValue(copy_audio_use_rtp));
|
||||
}
|
||||
if(udp_address != nullptr && *udp_address != QString("")){
|
||||
toJsonValue(QString("udpAddress"), udp_address, obj, QString("QString"));
|
||||
}
|
||||
if(m_udp_port_isSet){
|
||||
obj->insert("udpPort", QJsonValue(udp_port));
|
||||
}
|
||||
if(m_rgb_color_isSet){
|
||||
obj->insert("rgbColor", QJsonValue(rgb_color));
|
||||
}
|
||||
if(title != nullptr && *title != QString("")){
|
||||
toJsonValue(QString("title"), title, obj, QString("QString"));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
qint64
|
||||
SWGAMDemodSettings::getInputFrequencyOffset() {
|
||||
return input_frequency_offset;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setInputFrequencyOffset(qint64 input_frequency_offset) {
|
||||
this->input_frequency_offset = input_frequency_offset;
|
||||
this->m_input_frequency_offset_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGAMDemodSettings::getRfBandwidth() {
|
||||
return rf_bandwidth;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setRfBandwidth(float rf_bandwidth) {
|
||||
this->rf_bandwidth = rf_bandwidth;
|
||||
this->m_rf_bandwidth_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGAMDemodSettings::getSquelch() {
|
||||
return squelch;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setSquelch(float squelch) {
|
||||
this->squelch = squelch;
|
||||
this->m_squelch_isSet = true;
|
||||
}
|
||||
|
||||
float
|
||||
SWGAMDemodSettings::getVolume() {
|
||||
return volume;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setVolume(float volume) {
|
||||
this->volume = volume;
|
||||
this->m_volume_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getAudioSampleRate() {
|
||||
return audio_sample_rate;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setAudioSampleRate(qint32 audio_sample_rate) {
|
||||
this->audio_sample_rate = audio_sample_rate;
|
||||
this->m_audio_sample_rate_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getAudioMute() {
|
||||
return audio_mute;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setAudioMute(qint32 audio_mute) {
|
||||
this->audio_mute = audio_mute;
|
||||
this->m_audio_mute_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getBandpassEnable() {
|
||||
return bandpass_enable;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setBandpassEnable(qint32 bandpass_enable) {
|
||||
this->bandpass_enable = bandpass_enable;
|
||||
this->m_bandpass_enable_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getCopyAudioToUdp() {
|
||||
return copy_audio_to_udp;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setCopyAudioToUdp(qint32 copy_audio_to_udp) {
|
||||
this->copy_audio_to_udp = copy_audio_to_udp;
|
||||
this->m_copy_audio_to_udp_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getCopyAudioUseRtp() {
|
||||
return copy_audio_use_rtp;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setCopyAudioUseRtp(qint32 copy_audio_use_rtp) {
|
||||
this->copy_audio_use_rtp = copy_audio_use_rtp;
|
||||
this->m_copy_audio_use_rtp_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGAMDemodSettings::getUdpAddress() {
|
||||
return udp_address;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setUdpAddress(QString* udp_address) {
|
||||
this->udp_address = udp_address;
|
||||
this->m_udp_address_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getUdpPort() {
|
||||
return udp_port;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setUdpPort(qint32 udp_port) {
|
||||
this->udp_port = udp_port;
|
||||
this->m_udp_port_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGAMDemodSettings::getRgbColor() {
|
||||
return rgb_color;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setRgbColor(qint32 rgb_color) {
|
||||
this->rgb_color = rgb_color;
|
||||
this->m_rgb_color_isSet = true;
|
||||
}
|
||||
|
||||
QString*
|
||||
SWGAMDemodSettings::getTitle() {
|
||||
return title;
|
||||
}
|
||||
void
|
||||
SWGAMDemodSettings::setTitle(QString* title) {
|
||||
this->title = title;
|
||||
this->m_title_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGAMDemodSettings::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_input_frequency_offset_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_rf_bandwidth_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_squelch_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_volume_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_audio_sample_rate_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_audio_mute_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_bandpass_enable_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_copy_audio_to_udp_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_copy_audio_use_rtp_isSet){ isObjectUpdated = true; break;}
|
||||
if(udp_address != nullptr && *udp_address != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_udp_port_isSet){ isObjectUpdated = true; break;}
|
||||
if(m_rgb_color_isSet){ isObjectUpdated = true; break;}
|
||||
if(title != nullptr && *title != QString("")){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
131
swagger/sdrangel/code/qt5/client/SWGAMDemodSettings.h
Normal file
131
swagger/sdrangel/code/qt5/client/SWGAMDemodSettings.h
Normal file
@ -0,0 +1,131 @@
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGAMDemodSettings.h
|
||||
*
|
||||
* AMDemod
|
||||
*/
|
||||
|
||||
#ifndef SWGAMDemodSettings_H_
|
||||
#define SWGAMDemodSettings_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGAMDemodSettings: public SWGObject {
|
||||
public:
|
||||
SWGAMDemodSettings();
|
||||
SWGAMDemodSettings(QString* json);
|
||||
virtual ~SWGAMDemodSettings();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGAMDemodSettings* fromJson(QString &jsonString) override;
|
||||
|
||||
qint64 getInputFrequencyOffset();
|
||||
void setInputFrequencyOffset(qint64 input_frequency_offset);
|
||||
|
||||
float getRfBandwidth();
|
||||
void setRfBandwidth(float rf_bandwidth);
|
||||
|
||||
float getSquelch();
|
||||
void setSquelch(float squelch);
|
||||
|
||||
float getVolume();
|
||||
void setVolume(float volume);
|
||||
|
||||
qint32 getAudioSampleRate();
|
||||
void setAudioSampleRate(qint32 audio_sample_rate);
|
||||
|
||||
qint32 getAudioMute();
|
||||
void setAudioMute(qint32 audio_mute);
|
||||
|
||||
qint32 getBandpassEnable();
|
||||
void setBandpassEnable(qint32 bandpass_enable);
|
||||
|
||||
qint32 getCopyAudioToUdp();
|
||||
void setCopyAudioToUdp(qint32 copy_audio_to_udp);
|
||||
|
||||
qint32 getCopyAudioUseRtp();
|
||||
void setCopyAudioUseRtp(qint32 copy_audio_use_rtp);
|
||||
|
||||
QString* getUdpAddress();
|
||||
void setUdpAddress(QString* udp_address);
|
||||
|
||||
qint32 getUdpPort();
|
||||
void setUdpPort(qint32 udp_port);
|
||||
|
||||
qint32 getRgbColor();
|
||||
void setRgbColor(qint32 rgb_color);
|
||||
|
||||
QString* getTitle();
|
||||
void setTitle(QString* title);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
qint64 input_frequency_offset;
|
||||
bool m_input_frequency_offset_isSet;
|
||||
|
||||
float rf_bandwidth;
|
||||
bool m_rf_bandwidth_isSet;
|
||||
|
||||
float squelch;
|
||||
bool m_squelch_isSet;
|
||||
|
||||
float volume;
|
||||
bool m_volume_isSet;
|
||||
|
||||
qint32 audio_sample_rate;
|
||||
bool m_audio_sample_rate_isSet;
|
||||
|
||||
qint32 audio_mute;
|
||||
bool m_audio_mute_isSet;
|
||||
|
||||
qint32 bandpass_enable;
|
||||
bool m_bandpass_enable_isSet;
|
||||
|
||||
qint32 copy_audio_to_udp;
|
||||
bool m_copy_audio_to_udp_isSet;
|
||||
|
||||
qint32 copy_audio_use_rtp;
|
||||
bool m_copy_audio_use_rtp_isSet;
|
||||
|
||||
QString* udp_address;
|
||||
bool m_udp_address_isSet;
|
||||
|
||||
qint32 udp_port;
|
||||
bool m_udp_port_isSet;
|
||||
|
||||
qint32 rgb_color;
|
||||
bool m_rgb_color_isSet;
|
||||
|
||||
QString* title;
|
||||
bool m_title_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGAMDemodSettings_H_ */
|
@ -32,6 +32,8 @@ SWGChannelReport::SWGChannelReport() {
|
||||
m_channel_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
am_demod_report = nullptr;
|
||||
m_am_demod_report_isSet = false;
|
||||
nfm_demod_report = nullptr;
|
||||
m_nfm_demod_report_isSet = false;
|
||||
nfm_mod_report = nullptr;
|
||||
@ -48,6 +50,8 @@ SWGChannelReport::init() {
|
||||
m_channel_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
am_demod_report = new SWGAMDemodReport();
|
||||
m_am_demod_report_isSet = false;
|
||||
nfm_demod_report = new SWGNFMDemodReport();
|
||||
m_nfm_demod_report_isSet = false;
|
||||
nfm_mod_report = new SWGNFMModReport();
|
||||
@ -60,6 +64,9 @@ SWGChannelReport::cleanup() {
|
||||
delete channel_type;
|
||||
}
|
||||
|
||||
if(am_demod_report != nullptr) {
|
||||
delete am_demod_report;
|
||||
}
|
||||
if(nfm_demod_report != nullptr) {
|
||||
delete nfm_demod_report;
|
||||
}
|
||||
@ -83,6 +90,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&am_demod_report, pJson["AMDemodReport"], "SWGAMDemodReport", "SWGAMDemodReport");
|
||||
|
||||
::SWGSDRangel::setValue(&nfm_demod_report, pJson["NFMDemodReport"], "SWGNFMDemodReport", "SWGNFMDemodReport");
|
||||
|
||||
::SWGSDRangel::setValue(&nfm_mod_report, pJson["NFMModReport"], "SWGNFMModReport", "SWGNFMModReport");
|
||||
@ -109,6 +118,9 @@ SWGChannelReport::asJsonObject() {
|
||||
if(m_tx_isSet){
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if((am_demod_report != nullptr) && (am_demod_report->isSet())){
|
||||
toJsonValue(QString("AMDemodReport"), am_demod_report, obj, QString("SWGAMDemodReport"));
|
||||
}
|
||||
if((nfm_demod_report != nullptr) && (nfm_demod_report->isSet())){
|
||||
toJsonValue(QString("NFMDemodReport"), nfm_demod_report, obj, QString("SWGNFMDemodReport"));
|
||||
}
|
||||
@ -139,6 +151,16 @@ SWGChannelReport::setTx(qint32 tx) {
|
||||
this->m_tx_isSet = true;
|
||||
}
|
||||
|
||||
SWGAMDemodReport*
|
||||
SWGChannelReport::getAmDemodReport() {
|
||||
return am_demod_report;
|
||||
}
|
||||
void
|
||||
SWGChannelReport::setAmDemodReport(SWGAMDemodReport* am_demod_report) {
|
||||
this->am_demod_report = am_demod_report;
|
||||
this->m_am_demod_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGNFMDemodReport*
|
||||
SWGChannelReport::getNfmDemodReport() {
|
||||
return nfm_demod_report;
|
||||
@ -166,6 +188,7 @@ SWGChannelReport::isSet(){
|
||||
do{
|
||||
if(channel_type != nullptr && *channel_type != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_tx_isSet){ isObjectUpdated = true; break;}
|
||||
if(am_demod_report != nullptr && am_demod_report->isSet()){ isObjectUpdated = true; break;}
|
||||
if(nfm_demod_report != nullptr && nfm_demod_report->isSet()){ isObjectUpdated = true; break;}
|
||||
if(nfm_mod_report != nullptr && nfm_mod_report->isSet()){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGAMDemodReport.h"
|
||||
#include "SWGNFMDemodReport.h"
|
||||
#include "SWGNFMModReport.h"
|
||||
#include <QString>
|
||||
@ -50,6 +51,9 @@ public:
|
||||
qint32 getTx();
|
||||
void setTx(qint32 tx);
|
||||
|
||||
SWGAMDemodReport* getAmDemodReport();
|
||||
void setAmDemodReport(SWGAMDemodReport* am_demod_report);
|
||||
|
||||
SWGNFMDemodReport* getNfmDemodReport();
|
||||
void setNfmDemodReport(SWGNFMDemodReport* nfm_demod_report);
|
||||
|
||||
@ -66,6 +70,9 @@ private:
|
||||
qint32 tx;
|
||||
bool m_tx_isSet;
|
||||
|
||||
SWGAMDemodReport* am_demod_report;
|
||||
bool m_am_demod_report_isSet;
|
||||
|
||||
SWGNFMDemodReport* nfm_demod_report;
|
||||
bool m_nfm_demod_report_isSet;
|
||||
|
||||
|
@ -32,6 +32,8 @@ SWGChannelSettings::SWGChannelSettings() {
|
||||
m_channel_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
am_demod_settings = nullptr;
|
||||
m_am_demod_settings_isSet = false;
|
||||
nfm_demod_settings = nullptr;
|
||||
m_nfm_demod_settings_isSet = false;
|
||||
nfm_mod_settings = nullptr;
|
||||
@ -48,6 +50,8 @@ SWGChannelSettings::init() {
|
||||
m_channel_type_isSet = false;
|
||||
tx = 0;
|
||||
m_tx_isSet = false;
|
||||
am_demod_settings = new SWGAMDemodSettings();
|
||||
m_am_demod_settings_isSet = false;
|
||||
nfm_demod_settings = new SWGNFMDemodSettings();
|
||||
m_nfm_demod_settings_isSet = false;
|
||||
nfm_mod_settings = new SWGNFMModSettings();
|
||||
@ -60,6 +64,9 @@ SWGChannelSettings::cleanup() {
|
||||
delete channel_type;
|
||||
}
|
||||
|
||||
if(am_demod_settings != nullptr) {
|
||||
delete am_demod_settings;
|
||||
}
|
||||
if(nfm_demod_settings != nullptr) {
|
||||
delete nfm_demod_settings;
|
||||
}
|
||||
@ -83,6 +90,8 @@ SWGChannelSettings::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&tx, pJson["tx"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&am_demod_settings, pJson["AMDemodSettings"], "SWGAMDemodSettings", "SWGAMDemodSettings");
|
||||
|
||||
::SWGSDRangel::setValue(&nfm_demod_settings, pJson["NFMDemodSettings"], "SWGNFMDemodSettings", "SWGNFMDemodSettings");
|
||||
|
||||
::SWGSDRangel::setValue(&nfm_mod_settings, pJson["NFMModSettings"], "SWGNFMModSettings", "SWGNFMModSettings");
|
||||
@ -109,6 +118,9 @@ SWGChannelSettings::asJsonObject() {
|
||||
if(m_tx_isSet){
|
||||
obj->insert("tx", QJsonValue(tx));
|
||||
}
|
||||
if((am_demod_settings != nullptr) && (am_demod_settings->isSet())){
|
||||
toJsonValue(QString("AMDemodSettings"), am_demod_settings, obj, QString("SWGAMDemodSettings"));
|
||||
}
|
||||
if((nfm_demod_settings != nullptr) && (nfm_demod_settings->isSet())){
|
||||
toJsonValue(QString("NFMDemodSettings"), nfm_demod_settings, obj, QString("SWGNFMDemodSettings"));
|
||||
}
|
||||
@ -139,6 +151,16 @@ SWGChannelSettings::setTx(qint32 tx) {
|
||||
this->m_tx_isSet = true;
|
||||
}
|
||||
|
||||
SWGAMDemodSettings*
|
||||
SWGChannelSettings::getAmDemodSettings() {
|
||||
return am_demod_settings;
|
||||
}
|
||||
void
|
||||
SWGChannelSettings::setAmDemodSettings(SWGAMDemodSettings* am_demod_settings) {
|
||||
this->am_demod_settings = am_demod_settings;
|
||||
this->m_am_demod_settings_isSet = true;
|
||||
}
|
||||
|
||||
SWGNFMDemodSettings*
|
||||
SWGChannelSettings::getNfmDemodSettings() {
|
||||
return nfm_demod_settings;
|
||||
@ -166,6 +188,7 @@ SWGChannelSettings::isSet(){
|
||||
do{
|
||||
if(channel_type != nullptr && *channel_type != QString("")){ isObjectUpdated = true; break;}
|
||||
if(m_tx_isSet){ isObjectUpdated = true; break;}
|
||||
if(am_demod_settings != nullptr && am_demod_settings->isSet()){ isObjectUpdated = true; break;}
|
||||
if(nfm_demod_settings != nullptr && nfm_demod_settings->isSet()){ isObjectUpdated = true; break;}
|
||||
if(nfm_mod_settings != nullptr && nfm_mod_settings->isSet()){ isObjectUpdated = true; break;}
|
||||
}while(false);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
#include "SWGAMDemodSettings.h"
|
||||
#include "SWGNFMDemodSettings.h"
|
||||
#include "SWGNFMModSettings.h"
|
||||
#include <QString>
|
||||
@ -50,6 +51,9 @@ public:
|
||||
qint32 getTx();
|
||||
void setTx(qint32 tx);
|
||||
|
||||
SWGAMDemodSettings* getAmDemodSettings();
|
||||
void setAmDemodSettings(SWGAMDemodSettings* am_demod_settings);
|
||||
|
||||
SWGNFMDemodSettings* getNfmDemodSettings();
|
||||
void setNfmDemodSettings(SWGNFMDemodSettings* nfm_demod_settings);
|
||||
|
||||
@ -66,6 +70,9 @@ private:
|
||||
qint32 tx;
|
||||
bool m_tx_isSet;
|
||||
|
||||
SWGAMDemodSettings* am_demod_settings;
|
||||
bool m_am_demod_settings_isSet;
|
||||
|
||||
SWGNFMDemodSettings* nfm_demod_settings;
|
||||
bool m_nfm_demod_settings_isSet;
|
||||
|
||||
|
@ -14,6 +14,8 @@
|
||||
#define ModelFactory_H_
|
||||
|
||||
|
||||
#include "SWGAMDemodReport.h"
|
||||
#include "SWGAMDemodSettings.h"
|
||||
#include "SWGAudioDevice.h"
|
||||
#include "SWGAudioDevices.h"
|
||||
#include "SWGAudioDevicesSelect.h"
|
||||
@ -59,6 +61,12 @@
|
||||
namespace SWGSDRangel {
|
||||
|
||||
inline void* create(QString type) {
|
||||
if(QString("SWGAMDemodReport").compare(type) == 0) {
|
||||
return new SWGAMDemodReport();
|
||||
}
|
||||
if(QString("SWGAMDemodSettings").compare(type) == 0) {
|
||||
return new SWGAMDemodSettings();
|
||||
}
|
||||
if(QString("SWGAudioDevice").compare(type) == 0) {
|
||||
return new SWGAudioDevice();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user