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

Morse Decoder: implemented API. For #2112

This commit is contained in:
f4exb 2024-05-21 02:43:51 +02:00
parent 7772ac405c
commit 176fe034ea
21 changed files with 1255 additions and 42 deletions

View File

@ -52,10 +52,10 @@ MorseDecoder::MorseDecoder(WebAPIAdapterInterface *webAPIAdapterInterface) :
m_selectedChannel(nullptr),
m_dataPipe(nullptr)
{
qDebug("DemodAnalyzer::DemodAnalyzer: webAPIAdapterInterface: %p", webAPIAdapterInterface);
qDebug("MorseDecoder::MorseDecoder: webAPIAdapterInterface: %p", webAPIAdapterInterface);
setObjectName(m_featureId);
m_state = StIdle;
m_errorMessage = "DemodAnalyzer error";
m_errorMessage = "MorseDecoder error";
m_networkManager = new QNetworkAccessManager();
QObject::connect(
m_networkManager,
@ -183,7 +183,7 @@ bool MorseDecoder::handleMessage(const Message& cmd)
if (MsgConfigureMorseDecoder::match(cmd))
{
MsgConfigureMorseDecoder& cfg = (MsgConfigureMorseDecoder&) cmd;
qDebug() << "MorseDecoder::handleMessage: MsgConfigureDemodAnalyzer";
qDebug() << "MorseDecoder::handleMessage: MsgConfigureMorseDecoder";
applySettings(cfg.getSettings(), cfg.getSettingsKeys(), cfg.getForce());
return true;
@ -329,12 +329,12 @@ void MorseDecoder::applySettings(const MorseDecoderSettings& settings, const QLi
m_logFile.setFileName(settings.m_logFilename);
if (m_logFile.open(QIODevice::WriteOnly | QIODevice::Append | QIODevice::Text))
{
qDebug() << "RttyDemod::applySettings - Logging to: " << settings.m_logFilename;
qDebug() << "MorseDecoder::applySettings - Logging to: " << settings.m_logFilename;
m_logStream.setDevice(&m_logFile);
}
else
{
qDebug() << "RttyDemod::applySettings - Unable to open log file: " << settings.m_logFilename;
qDebug() << "MorseDecoder::applySettings - Unable to open log file: " << settings.m_logFilename;
}
}
}
@ -455,8 +455,8 @@ int MorseDecoder::webapiSettingsGet(
QString& errorMessage)
{
(void) errorMessage;
response.setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings());
response.getDemodAnalyzerSettings()->init();
response.setMorseDecoderSettings(new SWGSDRangel::SWGMorseDecoderSettings());
response.getMorseDecoderSettings()->init();
webapiFormatFeatureSettings(response, m_settings);
return 200;
}
@ -474,7 +474,7 @@ int MorseDecoder::webapiSettingsPutPatch(
MsgConfigureMorseDecoder *msg = MsgConfigureMorseDecoder::create(settings, featureSettingsKeys, force);
m_inputMessageQueue.push(msg);
qDebug("DemodAnalyzer::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
qDebug("MorseDecoder::webapiSettingsPutPatch: forward to GUI: %p", m_guiMessageQueue);
if (m_guiMessageQueue) // forward to GUI if any
{
MsgConfigureMorseDecoder *msgToGUI = MsgConfigureMorseDecoder::create(settings, featureSettingsKeys, force);
@ -490,36 +490,68 @@ void MorseDecoder::webapiFormatFeatureSettings(
SWGSDRangel::SWGFeatureSettings& response,
const MorseDecoderSettings& settings)
{
if (response.getDemodAnalyzerSettings()->getTitle()) {
*response.getDemodAnalyzerSettings()->getTitle() = settings.m_title;
if (response.getMorseDecoderSettings()->getTitle()) {
*response.getMorseDecoderSettings()->getTitle() = settings.m_title;
} else {
response.getDemodAnalyzerSettings()->setTitle(new QString(settings.m_title));
response.getMorseDecoderSettings()->setTitle(new QString(settings.m_title));
}
response.getDemodAnalyzerSettings()->setRgbColor(settings.m_rgbColor);
response.getDemodAnalyzerSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
response.getMorseDecoderSettings()->setRgbColor(settings.m_rgbColor);
response.getMorseDecoderSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getDemodAnalyzerSettings()->getReverseApiAddress()) {
*response.getDemodAnalyzerSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
if (response.getMorseDecoderSettings()->getReverseApiAddress()) {
*response.getMorseDecoderSettings()->getReverseApiAddress() = settings.m_reverseAPIAddress;
} else {
response.getDemodAnalyzerSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
response.getMorseDecoderSettings()->setReverseApiAddress(new QString(settings.m_reverseAPIAddress));
}
response.getDemodAnalyzerSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getDemodAnalyzerSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex);
response.getDemodAnalyzerSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex);
response.getMorseDecoderSettings()->setReverseApiPort(settings.m_reverseAPIPort);
response.getMorseDecoderSettings()->setReverseApiFeatureSetIndex(settings.m_reverseAPIFeatureSetIndex);
response.getMorseDecoderSettings()->setReverseApiFeatureIndex(settings.m_reverseAPIFeatureIndex);
response.getMorseDecoderSettings()->setUdpEnabled(settings.m_udpEnabled ? 1 : 0);
if (response.getMorseDecoderSettings()->getUdpAddress()) {
*response.getMorseDecoderSettings()->getUdpAddress() = settings.m_udpAddress;
} else {
response.getMorseDecoderSettings()->setUdpAddress(new QString(settings.m_udpAddress));
}
response.getMorseDecoderSettings()->setUdpPort(settings.m_udpPort);
if (response.getMorseDecoderSettings()->getLogFiledName()) {
*response.getMorseDecoderSettings()->getLogFiledName() = settings.m_logFilename;
} else {
response.getMorseDecoderSettings()->setLogFiledName(new QString(settings.m_logFilename));
}
response.getMorseDecoderSettings()->setLogEnabled(settings.m_logEnabled ? 1 : 0);
response.getMorseDecoderSettings()->setAuto(settings.m_auto ? 1 : 0);
if (settings.m_scopeGUI)
{
if (response.getMorseDecoderSettings()->getScopeConfig())
{
settings.m_scopeGUI->formatTo(response.getMorseDecoderSettings()->getScopeConfig());
}
else
{
SWGSDRangel::SWGGLScope *swgGLScope = new SWGSDRangel::SWGGLScope();
settings.m_scopeGUI->formatTo(swgGLScope);
response.getMorseDecoderSettings()->setScopeConfig(swgGLScope);
}
}
if (settings.m_rollupState)
{
if (response.getDemodAnalyzerSettings()->getRollupState())
if (response.getMorseDecoderSettings()->getRollupState())
{
settings.m_rollupState->formatTo(response.getDemodAnalyzerSettings()->getRollupState());
settings.m_rollupState->formatTo(response.getMorseDecoderSettings()->getRollupState());
}
else
{
SWGSDRangel::SWGRollupState *swgRollupState = new SWGSDRangel::SWGRollupState();
settings.m_rollupState->formatTo(swgRollupState);
response.getDemodAnalyzerSettings()->setRollupState(swgRollupState);
response.getMorseDecoderSettings()->setRollupState(swgRollupState);
}
}
}
@ -530,28 +562,49 @@ void MorseDecoder::webapiUpdateFeatureSettings(
SWGSDRangel::SWGFeatureSettings& response)
{
if (featureSettingsKeys.contains("title")) {
settings.m_title = *response.getDemodAnalyzerSettings()->getTitle();
settings.m_title = *response.getMorseDecoderSettings()->getTitle();
}
if (featureSettingsKeys.contains("rgbColor")) {
settings.m_rgbColor = response.getDemodAnalyzerSettings()->getRgbColor();
settings.m_rgbColor = response.getMorseDecoderSettings()->getRgbColor();
}
if (featureSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getDemodAnalyzerSettings()->getUseReverseApi() != 0;
settings.m_useReverseAPI = response.getMorseDecoderSettings()->getUseReverseApi() != 0;
}
if (featureSettingsKeys.contains("reverseAPIAddress")) {
settings.m_reverseAPIAddress = *response.getDemodAnalyzerSettings()->getReverseApiAddress();
settings.m_reverseAPIAddress = *response.getMorseDecoderSettings()->getReverseApiAddress();
}
if (featureSettingsKeys.contains("reverseAPIPort")) {
settings.m_reverseAPIPort = response.getDemodAnalyzerSettings()->getReverseApiPort();
settings.m_reverseAPIPort = response.getMorseDecoderSettings()->getReverseApiPort();
}
if (featureSettingsKeys.contains("reverseAPIFeatureSetIndex")) {
settings.m_reverseAPIFeatureSetIndex = response.getDemodAnalyzerSettings()->getReverseApiFeatureSetIndex();
settings.m_reverseAPIFeatureSetIndex = response.getMorseDecoderSettings()->getReverseApiFeatureSetIndex();
}
if (featureSettingsKeys.contains("reverseAPIFeatureIndex")) {
settings.m_reverseAPIFeatureIndex = response.getDemodAnalyzerSettings()->getReverseApiFeatureIndex();
settings.m_reverseAPIFeatureIndex = response.getMorseDecoderSettings()->getReverseApiFeatureIndex();
}
if (featureSettingsKeys.contains("udpEnabled")) {
settings.m_udpEnabled = response.getMorseDecoderSettings()->getUdpEnabled() != 0;
}
if (featureSettingsKeys.contains("udpAddress")) {
settings.m_udpAddress = *response.getMorseDecoderSettings()->getUdpAddress();
}
if (featureSettingsKeys.contains("udpPort")) {
settings.m_udpPort = response.getMorseDecoderSettings()->getUdpPort();
}
if (featureSettingsKeys.contains("logFilename")) {
settings.m_logFilename = *response.getMorseDecoderSettings()->getLogFiledName();
}
if (featureSettingsKeys.contains("logEnabled")) {
settings.m_logEnabled = response.getMorseDecoderSettings()->getLogEnabled() != 0;
}
if (featureSettingsKeys.contains("auto")) {
settings.m_auto = response.getMorseDecoderSettings()->getAuto() != 0;
}
if (settings.m_scopeGUI && featureSettingsKeys.contains("scopeGUI")) {
settings.m_scopeGUI->updateFrom(featureSettingsKeys, response.getMorseDecoderSettings()->getScopeConfig());
}
if (settings.m_rollupState && featureSettingsKeys.contains("rollupState")) {
settings.m_rollupState->updateFrom(featureSettingsKeys, response.getDemodAnalyzerSettings()->getRollupState());
settings.m_rollupState->updateFrom(featureSettingsKeys, response.getMorseDecoderSettings()->getRollupState());
}
}
@ -560,17 +613,17 @@ void MorseDecoder::webapiReverseSendSettings(const QList<QString>& featureSettin
SWGSDRangel::SWGFeatureSettings *swgFeatureSettings = new SWGSDRangel::SWGFeatureSettings();
// swgFeatureSettings->setOriginatorFeatureIndex(getIndexInDeviceSet());
// swgFeatureSettings->setOriginatorFeatureSetIndex(getDeviceSetIndex());
swgFeatureSettings->setFeatureType(new QString("DemodAnalyzer"));
swgFeatureSettings->setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings());
SWGSDRangel::SWGDemodAnalyzerSettings *swgDemodAnalyzerSettings = swgFeatureSettings->getDemodAnalyzerSettings();
swgFeatureSettings->setFeatureType(new QString("MorseDecoder"));
swgFeatureSettings->setMorseDecoderSettings(new SWGSDRangel::SWGMorseDecoderSettings());
SWGSDRangel::SWGMorseDecoderSettings *swgMorseDecoderSettings = swgFeatureSettings->getMorseDecoderSettings();
// transfer data that has been modified. When force is on transfer all data except reverse API data
if (featureSettingsKeys.contains("title") || force) {
swgDemodAnalyzerSettings->setTitle(new QString(settings.m_title));
swgMorseDecoderSettings->setTitle(new QString(settings.m_title));
}
if (featureSettingsKeys.contains("rgbColor") || force) {
swgDemodAnalyzerSettings->setRgbColor(settings.m_rgbColor);
swgMorseDecoderSettings->setRgbColor(settings.m_rgbColor);
}
QString channelSettingsURL = QString("http://%1:%2/sdrangel/featureset/%3/feature/%4/settings")
@ -650,7 +703,8 @@ int MorseDecoder::webapiActionsPost(
QString& errorMessage) {
MainCore* m_core = MainCore::instance();
auto action = query.getDemodAnalyzerActions();
auto action = query.getMorseDecoderActions();
if (action == nullptr) {
errorMessage = QString("missing MorseDecoderActions in request");
return 404;
@ -658,8 +712,8 @@ int MorseDecoder::webapiActionsPost(
auto deviceId = action->getDeviceId();
auto chanId = action->getChannelId();
ChannelAPI * chan = m_core->getChannel(deviceId, chanId);
if (chan == nullptr) {
errorMessage = QString("device(%1) or channel (%2) on the device does not exist").arg(deviceId).arg(chanId);
return 404;

View File

@ -30,8 +30,8 @@ int MorseDecoderWebAPIAdapter::webapiSettingsGet(
QString& errorMessage)
{
(void) errorMessage;
response.setDemodAnalyzerSettings(new SWGSDRangel::SWGDemodAnalyzerSettings());
response.getDemodAnalyzerSettings()->init();
response.setMorseDecoderSettings(new SWGSDRangel::SWGMorseDecoderSettings());
response.getMorseDecoderSettings()->init();
MorseDecoder::webapiFormatFeatureSettings(response, m_settings);
return 200;

View File

@ -6429,6 +6429,9 @@ margin-bottom: 20px;
"MapActions" : {
"$ref" : "#/definitions/MapActions"
},
"MorseDecoderActions" : {
"$ref" : "#/definitions/MorseDecoderActions"
},
"PERTesterActions" : {
"$ref" : "#/definitions/PERTesterActions"
},
@ -6681,6 +6684,9 @@ margin-bottom: 20px;
"MapSettings" : {
"$ref" : "#/definitions/MapSettings"
},
"MorseDecoderSettings" : {
"$ref" : "#/definitions/MorseDecoderSettings"
},
"PERTesterSettings" : {
"$ref" : "#/definitions/PERTesterSettings"
},
@ -10495,6 +10501,76 @@ margin-bottom: 20px;
}
},
"description" : "MetisMISOSettings"
};
defs.MorseDecoderActions = {
"properties" : {
"deviceId" : {
"type" : "integer",
"description" : "Device Id/Number that channel belongs to"
},
"channelId" : {
"type" : "integer",
"description" : "Channel Id/Number of the channel within the device"
}
},
"description" : "Morse Decoder actions"
};
defs.MorseDecoderSettings = {
"properties" : {
"title" : {
"type" : "string"
},
"rgbColor" : {
"type" : "integer"
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API\n * 1 - yes\n * 0 - no\n"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"udpEnabled" : {
"type" : "integer",
"description" : "Send decoded text via UDP\n * 1 - send\n * 0 - do not send\n"
},
"udpAddress" : {
"type" : "string",
"description" : "Address to semd text via UDP"
},
"udpPort" : {
"type" : "integer",
"description" : "Port to semd text via UDP"
},
"logFiledName" : {
"type" : "string",
"description" : "File to log the decoded text to"
},
"logEnabled" : {
"type" : "integer",
"description" : "Log decoded text to file\n * 1 - log\n * 0 - do not log\n"
},
"auto" : {
"type" : "integer",
"description" : "Auto detect CW pitch and keying speed\n * 1 - auto detect\n * 0 - use last values\n"
},
"reverseAPIFeatureSetIndex" : {
"type" : "integer"
},
"reverseAPIFeatureIndex" : {
"type" : "integer"
},
"scopeConfig" : {
"$ref" : "#/definitions/GLScope"
},
"rollupState" : {
"$ref" : "#/definitions/RollupState"
}
},
"description" : "MorseDecoder"
};
defs.NFMDemodReport = {
"properties" : {
@ -58976,7 +59052,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2024-05-13T21:38:23.490+02:00
Generated 2024-05-21T02:18:43.789+02:00
</div>
</div>
</div>

View File

@ -23,6 +23,8 @@ FeatureActions:
$ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFEActions"
MapActions:
$ref: "/doc/swagger/include/Map.yaml#/MapActions"
MorseDecoderActions:
$ref: "/doc/swagger/include/MorseDecoder.yaml#/MorseDecoderActions"
PERTesterActions:
$ref: "/doc/swagger/include/PERTester.yaml#/PERTesterActions"
RigCtlServerActions:

View File

@ -33,6 +33,8 @@ FeatureSettings:
$ref: "/doc/swagger/include/LimeRFE.yaml#/LimeRFESettings"
MapSettings:
$ref: "/doc/swagger/include/Map.yaml#/MapSettings"
MorseDecoderSettings:
$ref: "/doc/swagger/include/MorseDecoder.yaml#/MorseDecoderSettings"
PERTesterSettings:
$ref: "/doc/swagger/include/PERTester.yaml#/PERTesterSettings"
RadiosondeSettings:

View File

@ -0,0 +1,64 @@
MorseDecoderSettings:
description: MorseDecoder
properties:
title:
type: string
rgbColor:
type: integer
useReverseAPI:
type: integer
description: >
Synchronize with reverse API
* 1 - yes
* 0 - no
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
udpEnabled:
type: integer
description: >
Send decoded text via UDP
* 1 - send
* 0 - do not send
udpAddress:
type: string
description: Address to semd text via UDP
udpPort:
type: integer
description: Port to semd text via UDP
logFiledName:
type: string
description: File to log the decoded text to
logEnabled:
type: integer
description: >
Log decoded text to file
* 1 - log
* 0 - do not log
auto:
type: integer
description: >
Auto detect CW pitch and keying speed
* 1 - auto detect
* 0 - use last values
reverseAPIFeatureSetIndex:
type: integer
reverseAPIFeatureIndex:
type: integer
scopeConfig:
$ref: "/doc/swagger/include/GLScope.yaml#/GLScope"
rollupState:
$ref: "/doc/swagger/include/RollupState.yaml#/RollupState"
MorseDecoderActions:
description: "Morse Decoder actions"
properties:
deviceId:
type: integer
required: true
description: "Device Id/Number that channel belongs to"
channelId:
type: integer
required: true
description: "Channel Id/Number of the channel within the device"

View File

@ -5265,6 +5265,11 @@ bool WebAPIRequestMapper::getFeatureSettings(
featureSettings->setMapSettings(new SWGSDRangel::SWGMapSettings());
featureSettings->getMapSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "MorseDecoderSettings")
{
featureSettings->setMorseDecoderSettings(new SWGSDRangel::SWGMorseDecoderSettings());
featureSettings->getMorseDecoderSettings()->fromJsonObject(settingsJsonObject);
}
else if (featureSettingsKey == "PERTesterSettings")
{
featureSettings->setPerTesterSettings(new SWGSDRangel::SWGPERTesterSettings());
@ -5405,6 +5410,11 @@ bool WebAPIRequestMapper::getFeatureActions(
featureActions->setDemodAnalyzerActions(new SWGSDRangel::SWGDemodAnalyzerActions());
featureActions->getDemodAnalyzerActions()->fromJsonObject(actionsJsonObject);
}
else if (featureActionsKey == "MorseDecoderActions")
{
featureActions->setMorseDecoderActions(new SWGSDRangel::SWGMorseDecoderActions());
featureActions->getMorseDecoderActions()->fromJsonObject(actionsJsonObject);
}
else
{
return false;

View File

@ -319,6 +319,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToSettingsKey = {
{"GS232Controller", "GS232ControllerSettings"}, // a.k.a Rotator Controller
{"LimeRFE", "LimeRFESettings"},
{"Map", "MapSettings"},
{"MorseDecoder", "MorseDecoderSettings"},
{"PERTester", "PERTesterSettings"},
{"Radiosonde", "RadiosondeSettings"},
{"RigCtlServer", "RigCtlServerSettings"},
@ -343,7 +344,8 @@ const QMap<QString, QString> WebAPIUtils::m_featureTypeToActionsKey = {
{"SkyMap", "SkyMapActions"},
{"StarTracker", "StarTrackerActions"},
{"VORLocalizer", "VORLocalizerActions"},
{"DemodAnalyzer", "DemodAnalyzerActions"}
{"DemodAnalyzer", "DemodAnalyzerActions"},
{"MorseDecoder", "MorseDecoderActions"}
};
const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
@ -357,6 +359,7 @@ const QMap<QString, QString> WebAPIUtils::m_featureURIToSettingsKey = {
{"sdrangel.feature.gs232controller", "GS232ControllerSettings"},
{"sdrangel.feature.limerfe", "LimeRFESettings"},
{"sdrangel.feature.map", "MapSettings"},
{"sdrangel.feature.morsedecoder", "MorseDecoderSettings"},
{"sdrangel.feature.pertester", "PERTesterSettings"},
{"sdrangel.feature.radiosonde", "RadiosondeSettings"},
{"sdrangel.feature.rigctlserver", "RigCtlServerSettings"},

View File

@ -23,6 +23,8 @@ FeatureActions:
$ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFEActions"
MapActions:
$ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapActions"
MorseDecoderActions:
$ref: "http://swgserver:8081/api/swagger/include/MorseDecoder.yaml#/MorseDecoderActions"
PERTesterActions:
$ref: "http://swgserver:8081/api/swagger/include/PERTester.yaml#/PERTesterActions"
RigCtlServerActions:

View File

@ -33,6 +33,8 @@ FeatureSettings:
$ref: "http://swgserver:8081/api/swagger/include/LimeRFE.yaml#/LimeRFESettings"
MapSettings:
$ref: "http://swgserver:8081/api/swagger/include/Map.yaml#/MapSettings"
MorseDecoderSettings:
$ref: "http://swgserver:8081/api/swagger/include/MorseDecoder.yaml#/MorseDecoderSettings"
PERTesterSettings:
$ref: "http://swgserver:8081/api/swagger/include/PERTester.yaml#/PERTesterSettings"
RadiosondeSettings:

View File

@ -0,0 +1,64 @@
MorseDecoderSettings:
description: MorseDecoder
properties:
title:
type: string
rgbColor:
type: integer
useReverseAPI:
type: integer
description: >
Synchronize with reverse API
* 1 - yes
* 0 - no
reverseAPIAddress:
type: string
reverseAPIPort:
type: integer
udpEnabled:
type: integer
description: >
Send decoded text via UDP
* 1 - send
* 0 - do not send
udpAddress:
type: string
description: Address to semd text via UDP
udpPort:
type: integer
description: Port to semd text via UDP
logFiledName:
type: string
description: File to log the decoded text to
logEnabled:
type: integer
description: >
Log decoded text to file
* 1 - log
* 0 - do not log
auto:
type: integer
description: >
Auto detect CW pitch and keying speed
* 1 - auto detect
* 0 - use last values
reverseAPIFeatureSetIndex:
type: integer
reverseAPIFeatureIndex:
type: integer
scopeConfig:
$ref: "http://swgserver:8081/api/swagger/include/GLScope.yaml#/GLScope"
rollupState:
$ref: "http://swgserver:8081/api/swagger/include/RollupState.yaml#/RollupState"
MorseDecoderActions:
description: "Morse Decoder actions"
properties:
deviceId:
type: integer
required: true
description: "Device Id/Number that channel belongs to"
channelId:
type: integer
required: true
description: "Channel Id/Number of the channel within the device"

View File

@ -6429,6 +6429,9 @@ margin-bottom: 20px;
"MapActions" : {
"$ref" : "#/definitions/MapActions"
},
"MorseDecoderActions" : {
"$ref" : "#/definitions/MorseDecoderActions"
},
"PERTesterActions" : {
"$ref" : "#/definitions/PERTesterActions"
},
@ -6681,6 +6684,9 @@ margin-bottom: 20px;
"MapSettings" : {
"$ref" : "#/definitions/MapSettings"
},
"MorseDecoderSettings" : {
"$ref" : "#/definitions/MorseDecoderSettings"
},
"PERTesterSettings" : {
"$ref" : "#/definitions/PERTesterSettings"
},
@ -10495,6 +10501,76 @@ margin-bottom: 20px;
}
},
"description" : "MetisMISOSettings"
};
defs.MorseDecoderActions = {
"properties" : {
"deviceId" : {
"type" : "integer",
"description" : "Device Id/Number that channel belongs to"
},
"channelId" : {
"type" : "integer",
"description" : "Channel Id/Number of the channel within the device"
}
},
"description" : "Morse Decoder actions"
};
defs.MorseDecoderSettings = {
"properties" : {
"title" : {
"type" : "string"
},
"rgbColor" : {
"type" : "integer"
},
"useReverseAPI" : {
"type" : "integer",
"description" : "Synchronize with reverse API\n * 1 - yes\n * 0 - no\n"
},
"reverseAPIAddress" : {
"type" : "string"
},
"reverseAPIPort" : {
"type" : "integer"
},
"udpEnabled" : {
"type" : "integer",
"description" : "Send decoded text via UDP\n * 1 - send\n * 0 - do not send\n"
},
"udpAddress" : {
"type" : "string",
"description" : "Address to semd text via UDP"
},
"udpPort" : {
"type" : "integer",
"description" : "Port to semd text via UDP"
},
"logFiledName" : {
"type" : "string",
"description" : "File to log the decoded text to"
},
"logEnabled" : {
"type" : "integer",
"description" : "Log decoded text to file\n * 1 - log\n * 0 - do not log\n"
},
"auto" : {
"type" : "integer",
"description" : "Auto detect CW pitch and keying speed\n * 1 - auto detect\n * 0 - use last values\n"
},
"reverseAPIFeatureSetIndex" : {
"type" : "integer"
},
"reverseAPIFeatureIndex" : {
"type" : "integer"
},
"scopeConfig" : {
"$ref" : "#/definitions/GLScope"
},
"rollupState" : {
"$ref" : "#/definitions/RollupState"
}
},
"description" : "MorseDecoder"
};
defs.NFMDemodReport = {
"properties" : {
@ -58976,7 +59052,7 @@ except ApiException as e:
</div>
<div id="generator">
<div class="content">
Generated 2024-05-13T21:38:23.490+02:00
Generated 2024-05-21T02:18:43.789+02:00
</div>
</div>
</div>

View File

@ -44,6 +44,8 @@ SWGFeatureActions::SWGFeatureActions() {
m_lime_rfe_actions_isSet = false;
map_actions = nullptr;
m_map_actions_isSet = false;
morse_decoder_actions = nullptr;
m_morse_decoder_actions_isSet = false;
per_tester_actions = nullptr;
m_per_tester_actions_isSet = false;
rig_ctl_server_actions = nullptr;
@ -84,6 +86,8 @@ SWGFeatureActions::init() {
m_lime_rfe_actions_isSet = false;
map_actions = new SWGMapActions();
m_map_actions_isSet = false;
morse_decoder_actions = new SWGMorseDecoderActions();
m_morse_decoder_actions_isSet = false;
per_tester_actions = new SWGPERTesterActions();
m_per_tester_actions_isSet = false;
rig_ctl_server_actions = new SWGRigCtlServerActions();
@ -124,6 +128,9 @@ SWGFeatureActions::cleanup() {
if(map_actions != nullptr) {
delete map_actions;
}
if(morse_decoder_actions != nullptr) {
delete morse_decoder_actions;
}
if(per_tester_actions != nullptr) {
delete per_tester_actions;
}
@ -177,6 +184,8 @@ SWGFeatureActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&map_actions, pJson["MapActions"], "SWGMapActions", "SWGMapActions");
::SWGSDRangel::setValue(&morse_decoder_actions, pJson["MorseDecoderActions"], "SWGMorseDecoderActions", "SWGMorseDecoderActions");
::SWGSDRangel::setValue(&per_tester_actions, pJson["PERTesterActions"], "SWGPERTesterActions", "SWGPERTesterActions");
::SWGSDRangel::setValue(&rig_ctl_server_actions, pJson["RigCtlServerActions"], "SWGRigCtlServerActions", "SWGRigCtlServerActions");
@ -233,6 +242,9 @@ SWGFeatureActions::asJsonObject() {
if((map_actions != nullptr) && (map_actions->isSet())){
toJsonValue(QString("MapActions"), map_actions, obj, QString("SWGMapActions"));
}
if((morse_decoder_actions != nullptr) && (morse_decoder_actions->isSet())){
toJsonValue(QString("MorseDecoderActions"), morse_decoder_actions, obj, QString("SWGMorseDecoderActions"));
}
if((per_tester_actions != nullptr) && (per_tester_actions->isSet())){
toJsonValue(QString("PERTesterActions"), per_tester_actions, obj, QString("SWGPERTesterActions"));
}
@ -341,6 +353,16 @@ SWGFeatureActions::setMapActions(SWGMapActions* map_actions) {
this->m_map_actions_isSet = true;
}
SWGMorseDecoderActions*
SWGFeatureActions::getMorseDecoderActions() {
return morse_decoder_actions;
}
void
SWGFeatureActions::setMorseDecoderActions(SWGMorseDecoderActions* morse_decoder_actions) {
this->morse_decoder_actions = morse_decoder_actions;
this->m_morse_decoder_actions_isSet = true;
}
SWGPERTesterActions*
SWGFeatureActions::getPerTesterActions() {
return per_tester_actions;
@ -450,6 +472,9 @@ SWGFeatureActions::isSet(){
if(map_actions && map_actions->isSet()){
isObjectUpdated = true; break;
}
if(morse_decoder_actions && morse_decoder_actions->isSet()){
isObjectUpdated = true; break;
}
if(per_tester_actions && per_tester_actions->isSet()){
isObjectUpdated = true; break;
}

View File

@ -28,6 +28,7 @@
#include "SWGGS232ControllerActions.h"
#include "SWGLimeRFEActions.h"
#include "SWGMapActions.h"
#include "SWGMorseDecoderActions.h"
#include "SWGPERTesterActions.h"
#include "SWGRigCtlServerActions.h"
#include "SWGSatelliteTrackerActions.h"
@ -79,6 +80,9 @@ public:
SWGMapActions* getMapActions();
void setMapActions(SWGMapActions* map_actions);
SWGMorseDecoderActions* getMorseDecoderActions();
void setMorseDecoderActions(SWGMorseDecoderActions* morse_decoder_actions);
SWGPERTesterActions* getPerTesterActions();
void setPerTesterActions(SWGPERTesterActions* per_tester_actions);
@ -131,6 +135,9 @@ private:
SWGMapActions* map_actions;
bool m_map_actions_isSet;
SWGMorseDecoderActions* morse_decoder_actions;
bool m_morse_decoder_actions_isSet;
SWGPERTesterActions* per_tester_actions;
bool m_per_tester_actions_isSet;

View File

@ -54,6 +54,8 @@ SWGFeatureSettings::SWGFeatureSettings() {
m_lime_rfe_settings_isSet = false;
map_settings = nullptr;
m_map_settings_isSet = false;
morse_decoder_settings = nullptr;
m_morse_decoder_settings_isSet = false;
per_tester_settings = nullptr;
m_per_tester_settings_isSet = false;
radiosonde_settings = nullptr;
@ -106,6 +108,8 @@ SWGFeatureSettings::init() {
m_lime_rfe_settings_isSet = false;
map_settings = new SWGMapSettings();
m_map_settings_isSet = false;
morse_decoder_settings = new SWGMorseDecoderSettings();
m_morse_decoder_settings_isSet = false;
per_tester_settings = new SWGPERTesterSettings();
m_per_tester_settings_isSet = false;
radiosonde_settings = new SWGRadiosondeSettings();
@ -163,6 +167,9 @@ SWGFeatureSettings::cleanup() {
if(map_settings != nullptr) {
delete map_settings;
}
if(morse_decoder_settings != nullptr) {
delete morse_decoder_settings;
}
if(per_tester_settings != nullptr) {
delete per_tester_settings;
}
@ -229,6 +236,8 @@ SWGFeatureSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&map_settings, pJson["MapSettings"], "SWGMapSettings", "SWGMapSettings");
::SWGSDRangel::setValue(&morse_decoder_settings, pJson["MorseDecoderSettings"], "SWGMorseDecoderSettings", "SWGMorseDecoderSettings");
::SWGSDRangel::setValue(&per_tester_settings, pJson["PERTesterSettings"], "SWGPERTesterSettings", "SWGPERTesterSettings");
::SWGSDRangel::setValue(&radiosonde_settings, pJson["RadiosondeSettings"], "SWGRadiosondeSettings", "SWGRadiosondeSettings");
@ -302,6 +311,9 @@ SWGFeatureSettings::asJsonObject() {
if((map_settings != nullptr) && (map_settings->isSet())){
toJsonValue(QString("MapSettings"), map_settings, obj, QString("SWGMapSettings"));
}
if((morse_decoder_settings != nullptr) && (morse_decoder_settings->isSet())){
toJsonValue(QString("MorseDecoderSettings"), morse_decoder_settings, obj, QString("SWGMorseDecoderSettings"));
}
if((per_tester_settings != nullptr) && (per_tester_settings->isSet())){
toJsonValue(QString("PERTesterSettings"), per_tester_settings, obj, QString("SWGPERTesterSettings"));
}
@ -463,6 +475,16 @@ SWGFeatureSettings::setMapSettings(SWGMapSettings* map_settings) {
this->m_map_settings_isSet = true;
}
SWGMorseDecoderSettings*
SWGFeatureSettings::getMorseDecoderSettings() {
return morse_decoder_settings;
}
void
SWGFeatureSettings::setMorseDecoderSettings(SWGMorseDecoderSettings* morse_decoder_settings) {
this->morse_decoder_settings = morse_decoder_settings;
this->m_morse_decoder_settings_isSet = true;
}
SWGPERTesterSettings*
SWGFeatureSettings::getPerTesterSettings() {
return per_tester_settings;
@ -597,6 +619,9 @@ SWGFeatureSettings::isSet(){
if(map_settings && map_settings->isSet()){
isObjectUpdated = true; break;
}
if(morse_decoder_settings && morse_decoder_settings->isSet()){
isObjectUpdated = true; break;
}
if(per_tester_settings && per_tester_settings->isSet()){
isObjectUpdated = true; break;
}

View File

@ -32,6 +32,7 @@
#include "SWGJogdialControllerSettings.h"
#include "SWGLimeRFESettings.h"
#include "SWGMapSettings.h"
#include "SWGMorseDecoderSettings.h"
#include "SWGPERTesterSettings.h"
#include "SWGRadiosondeSettings.h"
#include "SWGRigCtlServerSettings.h"
@ -100,6 +101,9 @@ public:
SWGMapSettings* getMapSettings();
void setMapSettings(SWGMapSettings* map_settings);
SWGMorseDecoderSettings* getMorseDecoderSettings();
void setMorseDecoderSettings(SWGMorseDecoderSettings* morse_decoder_settings);
SWGPERTesterSettings* getPerTesterSettings();
void setPerTesterSettings(SWGPERTesterSettings* per_tester_settings);
@ -170,6 +174,9 @@ private:
SWGMapSettings* map_settings;
bool m_map_settings_isSet;
SWGMorseDecoderSettings* morse_decoder_settings;
bool m_morse_decoder_settings_isSet;
SWGPERTesterSettings* per_tester_settings;
bool m_per_tester_settings_isSet;

View File

@ -220,6 +220,8 @@
#include "SWGMapReport.h"
#include "SWGMapSettings.h"
#include "SWGMetisMISOSettings.h"
#include "SWGMorseDecoderActions.h"
#include "SWGMorseDecoderSettings.h"
#include "SWGNFMDemodReport.h"
#include "SWGNFMDemodSettings.h"
#include "SWGNFMModReport.h"
@ -1415,6 +1417,16 @@ namespace SWGSDRangel {
obj->init();
return obj;
}
if(QString("SWGMorseDecoderActions").compare(type) == 0) {
SWGMorseDecoderActions *obj = new SWGMorseDecoderActions();
obj->init();
return obj;
}
if(QString("SWGMorseDecoderSettings").compare(type) == 0) {
SWGMorseDecoderSettings *obj = new SWGMorseDecoderSettings();
obj->init();
return obj;
}
if(QString("SWGNFMDemodReport").compare(type) == 0) {
SWGNFMDemodReport *obj = new SWGNFMDemodReport();
obj->init();

View 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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 "SWGMorseDecoderActions.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGMorseDecoderActions::SWGMorseDecoderActions(QString* json) {
init();
this->fromJson(*json);
}
SWGMorseDecoderActions::SWGMorseDecoderActions() {
device_id = 0;
m_device_id_isSet = false;
channel_id = 0;
m_channel_id_isSet = false;
}
SWGMorseDecoderActions::~SWGMorseDecoderActions() {
this->cleanup();
}
void
SWGMorseDecoderActions::init() {
device_id = 0;
m_device_id_isSet = false;
channel_id = 0;
m_channel_id_isSet = false;
}
void
SWGMorseDecoderActions::cleanup() {
}
SWGMorseDecoderActions*
SWGMorseDecoderActions::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGMorseDecoderActions::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&device_id, pJson["deviceId"], "qint32", "");
::SWGSDRangel::setValue(&channel_id, pJson["channelId"], "qint32", "");
}
QString
SWGMorseDecoderActions::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGMorseDecoderActions::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(m_device_id_isSet){
obj->insert("deviceId", QJsonValue(device_id));
}
if(m_channel_id_isSet){
obj->insert("channelId", QJsonValue(channel_id));
}
return obj;
}
qint32
SWGMorseDecoderActions::getDeviceId() {
return device_id;
}
void
SWGMorseDecoderActions::setDeviceId(qint32 device_id) {
this->device_id = device_id;
this->m_device_id_isSet = true;
}
qint32
SWGMorseDecoderActions::getChannelId() {
return channel_id;
}
void
SWGMorseDecoderActions::setChannelId(qint32 channel_id) {
this->channel_id = channel_id;
this->m_channel_id_isSet = true;
}
bool
SWGMorseDecoderActions::isSet(){
bool isObjectUpdated = false;
do{
if(m_device_id_isSet){
isObjectUpdated = true; break;
}
if(m_channel_id_isSet){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View 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. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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.
*/
/*
* SWGMorseDecoderActions.h
*
* Morse Decoder actions
*/
#ifndef SWGMorseDecoderActions_H_
#define SWGMorseDecoderActions_H_
#include <QJsonObject>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGMorseDecoderActions: public SWGObject {
public:
SWGMorseDecoderActions();
SWGMorseDecoderActions(QString* json);
virtual ~SWGMorseDecoderActions();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGMorseDecoderActions* fromJson(QString &jsonString) override;
qint32 getDeviceId();
void setDeviceId(qint32 device_id);
qint32 getChannelId();
void setChannelId(qint32 channel_id);
virtual bool isSet() override;
private:
qint32 device_id;
bool m_device_id_isSet;
qint32 channel_id;
bool m_channel_id_isSet;
};
}
#endif /* SWGMorseDecoderActions_H_ */

View File

@ -0,0 +1,442 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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 "SWGMorseDecoderSettings.h"
#include "SWGHelpers.h"
#include <QJsonDocument>
#include <QJsonArray>
#include <QObject>
#include <QDebug>
namespace SWGSDRangel {
SWGMorseDecoderSettings::SWGMorseDecoderSettings(QString* json) {
init();
this->fromJson(*json);
}
SWGMorseDecoderSettings::SWGMorseDecoderSettings() {
title = nullptr;
m_title_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = nullptr;
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
udp_enabled = 0;
m_udp_enabled_isSet = false;
udp_address = nullptr;
m_udp_address_isSet = false;
udp_port = 0;
m_udp_port_isSet = false;
log_filed_name = nullptr;
m_log_filed_name_isSet = false;
log_enabled = 0;
m_log_enabled_isSet = false;
_auto = 0;
m__auto_isSet = false;
reverse_api_feature_set_index = 0;
m_reverse_api_feature_set_index_isSet = false;
reverse_api_feature_index = 0;
m_reverse_api_feature_index_isSet = false;
scope_config = nullptr;
m_scope_config_isSet = false;
rollup_state = nullptr;
m_rollup_state_isSet = false;
}
SWGMorseDecoderSettings::~SWGMorseDecoderSettings() {
this->cleanup();
}
void
SWGMorseDecoderSettings::init() {
title = new QString("");
m_title_isSet = false;
rgb_color = 0;
m_rgb_color_isSet = false;
use_reverse_api = 0;
m_use_reverse_api_isSet = false;
reverse_api_address = new QString("");
m_reverse_api_address_isSet = false;
reverse_api_port = 0;
m_reverse_api_port_isSet = false;
udp_enabled = 0;
m_udp_enabled_isSet = false;
udp_address = new QString("");
m_udp_address_isSet = false;
udp_port = 0;
m_udp_port_isSet = false;
log_filed_name = new QString("");
m_log_filed_name_isSet = false;
log_enabled = 0;
m_log_enabled_isSet = false;
_auto = 0;
m__auto_isSet = false;
reverse_api_feature_set_index = 0;
m_reverse_api_feature_set_index_isSet = false;
reverse_api_feature_index = 0;
m_reverse_api_feature_index_isSet = false;
scope_config = new SWGGLScope();
m_scope_config_isSet = false;
rollup_state = new SWGRollupState();
m_rollup_state_isSet = false;
}
void
SWGMorseDecoderSettings::cleanup() {
if(title != nullptr) {
delete title;
}
if(reverse_api_address != nullptr) {
delete reverse_api_address;
}
if(udp_address != nullptr) {
delete udp_address;
}
if(log_filed_name != nullptr) {
delete log_filed_name;
}
if(scope_config != nullptr) {
delete scope_config;
}
if(rollup_state != nullptr) {
delete rollup_state;
}
}
SWGMorseDecoderSettings*
SWGMorseDecoderSettings::fromJson(QString &json) {
QByteArray array (json.toStdString().c_str());
QJsonDocument doc = QJsonDocument::fromJson(array);
QJsonObject jsonObject = doc.object();
this->fromJsonObject(jsonObject);
return this;
}
void
SWGMorseDecoderSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&title, pJson["title"], "QString", "QString");
::SWGSDRangel::setValue(&rgb_color, pJson["rgbColor"], "qint32", "");
::SWGSDRangel::setValue(&use_reverse_api, pJson["useReverseAPI"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_address, pJson["reverseAPIAddress"], "QString", "QString");
::SWGSDRangel::setValue(&reverse_api_port, pJson["reverseAPIPort"], "qint32", "");
::SWGSDRangel::setValue(&udp_enabled, pJson["udpEnabled"], "qint32", "");
::SWGSDRangel::setValue(&udp_address, pJson["udpAddress"], "QString", "QString");
::SWGSDRangel::setValue(&udp_port, pJson["udpPort"], "qint32", "");
::SWGSDRangel::setValue(&log_filed_name, pJson["logFiledName"], "QString", "QString");
::SWGSDRangel::setValue(&log_enabled, pJson["logEnabled"], "qint32", "");
::SWGSDRangel::setValue(&_auto, pJson["auto"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_feature_set_index, pJson["reverseAPIFeatureSetIndex"], "qint32", "");
::SWGSDRangel::setValue(&reverse_api_feature_index, pJson["reverseAPIFeatureIndex"], "qint32", "");
::SWGSDRangel::setValue(&scope_config, pJson["scopeConfig"], "SWGGLScope", "SWGGLScope");
::SWGSDRangel::setValue(&rollup_state, pJson["rollupState"], "SWGRollupState", "SWGRollupState");
}
QString
SWGMorseDecoderSettings::asJson ()
{
QJsonObject* obj = this->asJsonObject();
QJsonDocument doc(*obj);
QByteArray bytes = doc.toJson();
delete obj;
return QString(bytes);
}
QJsonObject*
SWGMorseDecoderSettings::asJsonObject() {
QJsonObject* obj = new QJsonObject();
if(title != nullptr && *title != QString("")){
toJsonValue(QString("title"), title, obj, QString("QString"));
}
if(m_rgb_color_isSet){
obj->insert("rgbColor", QJsonValue(rgb_color));
}
if(m_use_reverse_api_isSet){
obj->insert("useReverseAPI", QJsonValue(use_reverse_api));
}
if(reverse_api_address != nullptr && *reverse_api_address != QString("")){
toJsonValue(QString("reverseAPIAddress"), reverse_api_address, obj, QString("QString"));
}
if(m_reverse_api_port_isSet){
obj->insert("reverseAPIPort", QJsonValue(reverse_api_port));
}
if(m_udp_enabled_isSet){
obj->insert("udpEnabled", QJsonValue(udp_enabled));
}
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(log_filed_name != nullptr && *log_filed_name != QString("")){
toJsonValue(QString("logFiledName"), log_filed_name, obj, QString("QString"));
}
if(m_log_enabled_isSet){
obj->insert("logEnabled", QJsonValue(log_enabled));
}
if(m__auto_isSet){
obj->insert("auto", QJsonValue(_auto));
}
if(m_reverse_api_feature_set_index_isSet){
obj->insert("reverseAPIFeatureSetIndex", QJsonValue(reverse_api_feature_set_index));
}
if(m_reverse_api_feature_index_isSet){
obj->insert("reverseAPIFeatureIndex", QJsonValue(reverse_api_feature_index));
}
if((scope_config != nullptr) && (scope_config->isSet())){
toJsonValue(QString("scopeConfig"), scope_config, obj, QString("SWGGLScope"));
}
if((rollup_state != nullptr) && (rollup_state->isSet())){
toJsonValue(QString("rollupState"), rollup_state, obj, QString("SWGRollupState"));
}
return obj;
}
QString*
SWGMorseDecoderSettings::getTitle() {
return title;
}
void
SWGMorseDecoderSettings::setTitle(QString* title) {
this->title = title;
this->m_title_isSet = true;
}
qint32
SWGMorseDecoderSettings::getRgbColor() {
return rgb_color;
}
void
SWGMorseDecoderSettings::setRgbColor(qint32 rgb_color) {
this->rgb_color = rgb_color;
this->m_rgb_color_isSet = true;
}
qint32
SWGMorseDecoderSettings::getUseReverseApi() {
return use_reverse_api;
}
void
SWGMorseDecoderSettings::setUseReverseApi(qint32 use_reverse_api) {
this->use_reverse_api = use_reverse_api;
this->m_use_reverse_api_isSet = true;
}
QString*
SWGMorseDecoderSettings::getReverseApiAddress() {
return reverse_api_address;
}
void
SWGMorseDecoderSettings::setReverseApiAddress(QString* reverse_api_address) {
this->reverse_api_address = reverse_api_address;
this->m_reverse_api_address_isSet = true;
}
qint32
SWGMorseDecoderSettings::getReverseApiPort() {
return reverse_api_port;
}
void
SWGMorseDecoderSettings::setReverseApiPort(qint32 reverse_api_port) {
this->reverse_api_port = reverse_api_port;
this->m_reverse_api_port_isSet = true;
}
qint32
SWGMorseDecoderSettings::getUdpEnabled() {
return udp_enabled;
}
void
SWGMorseDecoderSettings::setUdpEnabled(qint32 udp_enabled) {
this->udp_enabled = udp_enabled;
this->m_udp_enabled_isSet = true;
}
QString*
SWGMorseDecoderSettings::getUdpAddress() {
return udp_address;
}
void
SWGMorseDecoderSettings::setUdpAddress(QString* udp_address) {
this->udp_address = udp_address;
this->m_udp_address_isSet = true;
}
qint32
SWGMorseDecoderSettings::getUdpPort() {
return udp_port;
}
void
SWGMorseDecoderSettings::setUdpPort(qint32 udp_port) {
this->udp_port = udp_port;
this->m_udp_port_isSet = true;
}
QString*
SWGMorseDecoderSettings::getLogFiledName() {
return log_filed_name;
}
void
SWGMorseDecoderSettings::setLogFiledName(QString* log_filed_name) {
this->log_filed_name = log_filed_name;
this->m_log_filed_name_isSet = true;
}
qint32
SWGMorseDecoderSettings::getLogEnabled() {
return log_enabled;
}
void
SWGMorseDecoderSettings::setLogEnabled(qint32 log_enabled) {
this->log_enabled = log_enabled;
this->m_log_enabled_isSet = true;
}
qint32
SWGMorseDecoderSettings::getAuto() {
return _auto;
}
void
SWGMorseDecoderSettings::setAuto(qint32 _auto) {
this->_auto = _auto;
this->m__auto_isSet = true;
}
qint32
SWGMorseDecoderSettings::getReverseApiFeatureSetIndex() {
return reverse_api_feature_set_index;
}
void
SWGMorseDecoderSettings::setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index) {
this->reverse_api_feature_set_index = reverse_api_feature_set_index;
this->m_reverse_api_feature_set_index_isSet = true;
}
qint32
SWGMorseDecoderSettings::getReverseApiFeatureIndex() {
return reverse_api_feature_index;
}
void
SWGMorseDecoderSettings::setReverseApiFeatureIndex(qint32 reverse_api_feature_index) {
this->reverse_api_feature_index = reverse_api_feature_index;
this->m_reverse_api_feature_index_isSet = true;
}
SWGGLScope*
SWGMorseDecoderSettings::getScopeConfig() {
return scope_config;
}
void
SWGMorseDecoderSettings::setScopeConfig(SWGGLScope* scope_config) {
this->scope_config = scope_config;
this->m_scope_config_isSet = true;
}
SWGRollupState*
SWGMorseDecoderSettings::getRollupState() {
return rollup_state;
}
void
SWGMorseDecoderSettings::setRollupState(SWGRollupState* rollup_state) {
this->rollup_state = rollup_state;
this->m_rollup_state_isSet = true;
}
bool
SWGMorseDecoderSettings::isSet(){
bool isObjectUpdated = false;
do{
if(title && *title != QString("")){
isObjectUpdated = true; break;
}
if(m_rgb_color_isSet){
isObjectUpdated = true; break;
}
if(m_use_reverse_api_isSet){
isObjectUpdated = true; break;
}
if(reverse_api_address && *reverse_api_address != QString("")){
isObjectUpdated = true; break;
}
if(m_reverse_api_port_isSet){
isObjectUpdated = true; break;
}
if(m_udp_enabled_isSet){
isObjectUpdated = true; break;
}
if(udp_address && *udp_address != QString("")){
isObjectUpdated = true; break;
}
if(m_udp_port_isSet){
isObjectUpdated = true; break;
}
if(log_filed_name && *log_filed_name != QString("")){
isObjectUpdated = true; break;
}
if(m_log_enabled_isSet){
isObjectUpdated = true; break;
}
if(m__auto_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_feature_set_index_isSet){
isObjectUpdated = true; break;
}
if(m_reverse_api_feature_index_isSet){
isObjectUpdated = true; break;
}
if(scope_config && scope_config->isSet()){
isObjectUpdated = true; break;
}
if(rollup_state && rollup_state->isSet()){
isObjectUpdated = true; break;
}
}while(false);
return isObjectUpdated;
}
}

View File

@ -0,0 +1,145 @@
/**
* SDRangel
* This is the web REST/JSON API of SDRangel SDR software. SDRangel is an Open Source Qt5/OpenGL 3.0+ (4.3+ in Windows) GUI and server Software Defined Radio and signal analyzer in software. It supports Airspy, BladeRF, HackRF, LimeSDR, PlutoSDR, RTL-SDR, SDRplay RSP1 and FunCube --- Limitations and specifcities: * In SDRangel GUI the first Rx device set cannot be deleted. Conversely the server starts with no device sets and its number of device sets can be reduced to zero by as many calls as necessary to /sdrangel/deviceset with DELETE method. * Preset import and export from/to file is a server only feature. * Device set focus is a GUI only feature. * The following channels are not implemented (status 501 is returned): ATV and DATV demodulators, Channel Analyzer NG, LoRa demodulator * The device settings and report structures contains only the sub-structure corresponding to the device type. The DeviceSettings and DeviceReport structures documented here shows all of them but only one will be or should be present at a time * The channel settings and report structures contains only the sub-structure corresponding to the channel type. The ChannelSettings and ChannelReport structures documented here shows all of them but only one will be or should be present at a time ---
*
* OpenAPI spec version: 7.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.
*/
/*
* SWGMorseDecoderSettings.h
*
* MorseDecoder
*/
#ifndef SWGMorseDecoderSettings_H_
#define SWGMorseDecoderSettings_H_
#include <QJsonObject>
#include "SWGGLScope.h"
#include "SWGRollupState.h"
#include <QString>
#include "SWGObject.h"
#include "export.h"
namespace SWGSDRangel {
class SWG_API SWGMorseDecoderSettings: public SWGObject {
public:
SWGMorseDecoderSettings();
SWGMorseDecoderSettings(QString* json);
virtual ~SWGMorseDecoderSettings();
void init();
void cleanup();
virtual QString asJson () override;
virtual QJsonObject* asJsonObject() override;
virtual void fromJsonObject(QJsonObject &json) override;
virtual SWGMorseDecoderSettings* fromJson(QString &jsonString) override;
QString* getTitle();
void setTitle(QString* title);
qint32 getRgbColor();
void setRgbColor(qint32 rgb_color);
qint32 getUseReverseApi();
void setUseReverseApi(qint32 use_reverse_api);
QString* getReverseApiAddress();
void setReverseApiAddress(QString* reverse_api_address);
qint32 getReverseApiPort();
void setReverseApiPort(qint32 reverse_api_port);
qint32 getUdpEnabled();
void setUdpEnabled(qint32 udp_enabled);
QString* getUdpAddress();
void setUdpAddress(QString* udp_address);
qint32 getUdpPort();
void setUdpPort(qint32 udp_port);
QString* getLogFiledName();
void setLogFiledName(QString* log_filed_name);
qint32 getLogEnabled();
void setLogEnabled(qint32 log_enabled);
qint32 getAuto();
void setAuto(qint32 _auto);
qint32 getReverseApiFeatureSetIndex();
void setReverseApiFeatureSetIndex(qint32 reverse_api_feature_set_index);
qint32 getReverseApiFeatureIndex();
void setReverseApiFeatureIndex(qint32 reverse_api_feature_index);
SWGGLScope* getScopeConfig();
void setScopeConfig(SWGGLScope* scope_config);
SWGRollupState* getRollupState();
void setRollupState(SWGRollupState* rollup_state);
virtual bool isSet() override;
private:
QString* title;
bool m_title_isSet;
qint32 rgb_color;
bool m_rgb_color_isSet;
qint32 use_reverse_api;
bool m_use_reverse_api_isSet;
QString* reverse_api_address;
bool m_reverse_api_address_isSet;
qint32 reverse_api_port;
bool m_reverse_api_port_isSet;
qint32 udp_enabled;
bool m_udp_enabled_isSet;
QString* udp_address;
bool m_udp_address_isSet;
qint32 udp_port;
bool m_udp_port_isSet;
QString* log_filed_name;
bool m_log_filed_name_isSet;
qint32 log_enabled;
bool m_log_enabled_isSet;
qint32 _auto;
bool m__auto_isSet;
qint32 reverse_api_feature_set_index;
bool m_reverse_api_feature_set_index_isSet;
qint32 reverse_api_feature_index;
bool m_reverse_api_feature_index_isSet;
SWGGLScope* scope_config;
bool m_scope_config_isSet;
SWGRollupState* rollup_state;
bool m_rollup_state_isSet;
};
}
#endif /* SWGMorseDecoderSettings_H_ */