mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
DATV demod: API enhancements with report
This commit is contained in:
parent
69ff3dc648
commit
ed720673f3
@ -29,6 +29,7 @@
|
||||
|
||||
#include "datvdemod.h"
|
||||
#include "maincore.h"
|
||||
#include "util/db.h"
|
||||
|
||||
const char* const DATVDemod::m_channelIdURI = "sdrangel.channel.demoddatv";
|
||||
const char* const DATVDemod::m_channelId = "DATVDemod";
|
||||
@ -150,6 +151,17 @@ int DATVDemod::webapiSettingsGet(
|
||||
return 200;
|
||||
}
|
||||
|
||||
int DATVDemod::webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage)
|
||||
{
|
||||
(void) errorMessage;
|
||||
response.setDatvDemodReport(new SWGSDRangel::SWGDATVDemodReport());
|
||||
response.getDatvDemodReport()->init();
|
||||
webapiFormatChannelReport(response);
|
||||
return 200;
|
||||
}
|
||||
|
||||
int DATVDemod::webapiSettingsPutPatch(
|
||||
bool force,
|
||||
const QStringList& channelSettingsKeys,
|
||||
@ -333,6 +345,7 @@ void DATVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
|
||||
response.getDatvDemodSettings()->setUdpTsAddress(new QString(settings.m_udpTSAddress));
|
||||
}
|
||||
|
||||
response.getDatvDemodSettings()->setUdpTsPort(settings.m_udpTSPort);
|
||||
response.getDatvDemodSettings()->setStreamIndex(settings.m_streamIndex);
|
||||
response.getDatvDemodSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
|
||||
|
||||
@ -347,6 +360,20 @@ void DATVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& res
|
||||
response.getDatvDemodSettings()->setReverseApiChannelIndex(settings.m_reverseAPIChannelIndex);
|
||||
}
|
||||
|
||||
void DATVDemod::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response)
|
||||
{
|
||||
double magsq = getMagSq() / (SDR_RX_SCALED*SDR_RX_SCALED);
|
||||
response.getDatvDemodReport()->setChannelPowerDb(CalcDb::dbPower(magsq));
|
||||
response.getDatvDemodReport()->setAudioActive(audioActive() ? 1 : 0);
|
||||
response.getDatvDemodReport()->setAudioDecodeOk(audioDecodeOK() ? 1 : 0);
|
||||
response.getDatvDemodReport()->setModcodCodeRate(getModcodCodeRate());
|
||||
response.getDatvDemodReport()->setModcodModulation(getModcodModulation());
|
||||
response.getDatvDemodReport()->setSetByModcod(isCstlnSetByModcod() ? 1 : 0);
|
||||
response.getDatvDemodReport()->setUdpRunning(udpRunning() ? 1 : 0);
|
||||
response.getDatvDemodReport()->setVideoActive(videoActive() ? 1 : 0);
|
||||
response.getDatvDemodReport()->setVideoDecodeOk(videoDecodeOK() ? 1 : 0);
|
||||
}
|
||||
|
||||
void DATVDemod::sendChannelSettings(
|
||||
QList<MessageQueue*> *messageQueues,
|
||||
QList<QString>& channelSettingsKeys,
|
||||
|
@ -80,6 +80,10 @@ public:
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
QString& errorMessage);
|
||||
|
||||
virtual int webapiReportGet(
|
||||
SWGSDRangel::SWGChannelReport& response,
|
||||
QString& errorMessage);
|
||||
|
||||
static void webapiFormatChannelSettings(
|
||||
SWGSDRangel::SWGChannelSettings& response,
|
||||
const DATVDemodSettings& settings);
|
||||
@ -150,6 +154,7 @@ private:
|
||||
int m_basebandSampleRate; //!< stored from device message used when starting baseband sink
|
||||
|
||||
void applySettings(const DATVDemodSettings& settings, bool force = false);
|
||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const DATVDemodSettings& settings, bool force);
|
||||
void sendChannelSettings(
|
||||
QList<MessageQueue*> *messageQueues,
|
||||
|
@ -3047,6 +3047,9 @@ margin-bottom: 20px;
|
||||
"ChirpChatModReport" : {
|
||||
"$ref" : "#/definitions/ChirpChatModReport"
|
||||
},
|
||||
"DATVDemodReport" : {
|
||||
"$ref" : "#/definitions/DATVDemodReport"
|
||||
},
|
||||
"DATVModReport" : {
|
||||
"$ref" : "#/definitions/DATVModReport"
|
||||
},
|
||||
@ -3766,6 +3769,48 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "DABDemod"
|
||||
};
|
||||
defs.DATVDemodReport = {
|
||||
"properties" : {
|
||||
"channelPowerDB" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power received in channel (dB)"
|
||||
},
|
||||
"audioActive" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio is active (1 for yes, 0 for now)"
|
||||
},
|
||||
"audioDecodeOK" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio decode (1 for OK, 0 for KO)"
|
||||
},
|
||||
"videoActive" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio is active (1 for yes, 0 for now)"
|
||||
},
|
||||
"videoDecodeOK" : {
|
||||
"type" : "integer",
|
||||
"description" : "Video decode (1 for OK, 0 for KO)"
|
||||
},
|
||||
"udpRunning" : {
|
||||
"type" : "integer",
|
||||
"description" : "UDP thread (1 running, 0 idle)"
|
||||
},
|
||||
"modcodModulation" : {
|
||||
"type" : "integer",
|
||||
"description" : "Modulation set by DVB-S2 MODCOD\n * 0: BPSK\n * 1: QPSK\n * 2: PSK8\n * 3: APSK16\n * 4: APSK32\n * 5: APSK64E\n * 6: QAM16\n * 7: QAM64\n * 8: QAM256\n"
|
||||
},
|
||||
"modcodCodeRate" : {
|
||||
"type" : "integer",
|
||||
"description" : "Code rate (FEC) set by DVB-S2 MODCOD\n * 0: 1/2\n * 1: 2/3\n * 2: 4/6\n * 3: 3/4\n * 4: 5/6\n * 5: 7/8\n * 6: 4/5\n * 7: 8/9\n * 8: 9/10\n * 9: 1/4\n * 10: 1/3\n * 11: 2/5\n * 12: 3/5\n"
|
||||
},
|
||||
"setByModcod" : {
|
||||
"type" : "integer",
|
||||
"description" : "Modulation and code rate set by DVB-S2 MODCOD (1 for yes, 0 for no)"
|
||||
}
|
||||
},
|
||||
"description" : "DATVDemod"
|
||||
};
|
||||
defs.DATVDemodSettings = {
|
||||
"properties" : {
|
||||
@ -51162,7 +51207,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2021-10-23T19:53:41.859+02:00
|
||||
Generated 2021-10-26T22:25:01.367+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -29,6 +29,8 @@ ChannelReport:
|
||||
$ref: "/doc/swagger/include/ChirpChatDemod.yaml#/ChirpChatDemodReport"
|
||||
ChirpChatModReport:
|
||||
$ref: "/doc/swagger/include/ChirpChatMod.yaml#/ChirpChatModReport"
|
||||
DATVDemodReport:
|
||||
$ref: "/doc/swagger/include/DATVDemod.yaml#/DATVDemodReport"
|
||||
DATVModReport:
|
||||
$ref: "/doc/swagger/include/DATVMod.yaml#/DATVModReport"
|
||||
DSDDemodReport:
|
||||
|
@ -118,3 +118,61 @@ DATVDemodSettings:
|
||||
type: integer
|
||||
reverseAPIChannelIndex:
|
||||
type: integer
|
||||
|
||||
DATVDemodReport:
|
||||
description: DATVDemod
|
||||
properties:
|
||||
channelPowerDB:
|
||||
description: power received in channel (dB)
|
||||
type: number
|
||||
format: float
|
||||
audioActive:
|
||||
description: Audio is active (1 for yes, 0 for now)
|
||||
type: integer
|
||||
audioDecodeOK:
|
||||
description: Audio decode (1 for OK, 0 for KO)
|
||||
type: integer
|
||||
videoActive:
|
||||
description: Audio is active (1 for yes, 0 for now)
|
||||
type: integer
|
||||
videoDecodeOK:
|
||||
description: Video decode (1 for OK, 0 for KO)
|
||||
type: integer
|
||||
udpRunning:
|
||||
description: UDP thread (1 running, 0 idle)
|
||||
type: integer
|
||||
modcodModulation:
|
||||
type: integer
|
||||
description: >
|
||||
Modulation set by DVB-S2 MODCOD
|
||||
* 0: BPSK
|
||||
* 1: QPSK
|
||||
* 2: PSK8
|
||||
* 3: APSK16
|
||||
* 4: APSK32
|
||||
* 5: APSK64E
|
||||
* 6: QAM16
|
||||
* 7: QAM64
|
||||
* 8: QAM256
|
||||
modcodCodeRate:
|
||||
type: integer
|
||||
description: >
|
||||
Code rate (FEC) set by DVB-S2 MODCOD
|
||||
* 0: 1/2
|
||||
* 1: 2/3
|
||||
* 2: 4/6
|
||||
* 3: 3/4
|
||||
* 4: 5/6
|
||||
* 5: 7/8
|
||||
* 6: 4/5
|
||||
* 7: 8/9
|
||||
* 8: 9/10
|
||||
* 9: 1/4
|
||||
* 10: 1/3
|
||||
* 11: 2/5
|
||||
* 12: 3/5
|
||||
setByModcod:
|
||||
type: integer
|
||||
description: Modulation and code rate set by DVB-S2 MODCOD (1 for yes, 0 for no)
|
||||
|
||||
|
||||
|
@ -29,6 +29,8 @@ ChannelReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/ChirpChatDemod.yaml#/ChirpChatDemodReport"
|
||||
ChirpChatModReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/ChirpChatMod.yaml#/ChirpChatModReport"
|
||||
DATVDemodReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DATVDemod.yaml#/DATVDemodReport"
|
||||
DATVModReport:
|
||||
$ref: "http://swgserver:8081/api/swagger/include/DATVMod.yaml#/DATVModReport"
|
||||
DSDDemodReport:
|
||||
|
@ -118,3 +118,63 @@ DATVDemodSettings:
|
||||
type: integer
|
||||
reverseAPIChannelIndex:
|
||||
type: integer
|
||||
|
||||
DATVDemodReport:
|
||||
description: DATVDemod
|
||||
properties:
|
||||
channelPowerDB:
|
||||
description: power received in channel (dB)
|
||||
type: number
|
||||
format: float
|
||||
audioActive:
|
||||
description: Audio is active (1 for yes, 0 for now)
|
||||
type: integer
|
||||
audioDecodeOK:
|
||||
description: Audio decode (1 for OK, 0 for KO)
|
||||
type: integer
|
||||
videoActive:
|
||||
description: Audio is active (1 for yes, 0 for now)
|
||||
type: integer
|
||||
videoDecodeOK:
|
||||
description: Video decode (1 for OK, 0 for KO)
|
||||
type: integer
|
||||
udpRunning:
|
||||
description: UDP thread (1 running, 0 idle)
|
||||
type: integer
|
||||
modcodModulation:
|
||||
type: integer
|
||||
description: >
|
||||
Modulation set by DVB-S2 MODCOD
|
||||
* -1: Unset
|
||||
* 0: BPSK
|
||||
* 1: QPSK
|
||||
* 2: PSK8
|
||||
* 3: APSK16
|
||||
* 4: APSK32
|
||||
* 5: APSK64E
|
||||
* 6: QAM16
|
||||
* 7: QAM64
|
||||
* 8: QAM256
|
||||
modcodCodeRate:
|
||||
type: integer
|
||||
description: >
|
||||
Code rate (FEC) set by DVB-S2 MODCOD
|
||||
* -1: Unset
|
||||
* 0: 1/2
|
||||
* 1: 2/3
|
||||
* 2: 4/6
|
||||
* 3: 3/4
|
||||
* 4: 5/6
|
||||
* 5: 7/8
|
||||
* 6: 4/5
|
||||
* 7: 8/9
|
||||
* 8: 9/10
|
||||
* 9: 1/4
|
||||
* 10: 1/3
|
||||
* 11: 2/5
|
||||
* 12: 3/5
|
||||
setByModcod:
|
||||
type: integer
|
||||
description: Modulation and code rate set by DVB-S2 MODCOD (1 for yes, 0 for no)
|
||||
|
||||
|
||||
|
@ -3047,6 +3047,9 @@ margin-bottom: 20px;
|
||||
"ChirpChatModReport" : {
|
||||
"$ref" : "#/definitions/ChirpChatModReport"
|
||||
},
|
||||
"DATVDemodReport" : {
|
||||
"$ref" : "#/definitions/DATVDemodReport"
|
||||
},
|
||||
"DATVModReport" : {
|
||||
"$ref" : "#/definitions/DATVModReport"
|
||||
},
|
||||
@ -3766,6 +3769,48 @@ margin-bottom: 20px;
|
||||
}
|
||||
},
|
||||
"description" : "DABDemod"
|
||||
};
|
||||
defs.DATVDemodReport = {
|
||||
"properties" : {
|
||||
"channelPowerDB" : {
|
||||
"type" : "number",
|
||||
"format" : "float",
|
||||
"description" : "power received in channel (dB)"
|
||||
},
|
||||
"audioActive" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio is active (1 for yes, 0 for now)"
|
||||
},
|
||||
"audioDecodeOK" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio decode (1 for OK, 0 for KO)"
|
||||
},
|
||||
"videoActive" : {
|
||||
"type" : "integer",
|
||||
"description" : "Audio is active (1 for yes, 0 for now)"
|
||||
},
|
||||
"videoDecodeOK" : {
|
||||
"type" : "integer",
|
||||
"description" : "Video decode (1 for OK, 0 for KO)"
|
||||
},
|
||||
"udpRunning" : {
|
||||
"type" : "integer",
|
||||
"description" : "UDP thread (1 running, 0 idle)"
|
||||
},
|
||||
"modcodModulation" : {
|
||||
"type" : "integer",
|
||||
"description" : "Modulation set by DVB-S2 MODCOD\n * 0: BPSK\n * 1: QPSK\n * 2: PSK8\n * 3: APSK16\n * 4: APSK32\n * 5: APSK64E\n * 6: QAM16\n * 7: QAM64\n * 8: QAM256\n"
|
||||
},
|
||||
"modcodCodeRate" : {
|
||||
"type" : "integer",
|
||||
"description" : "Code rate (FEC) set by DVB-S2 MODCOD\n * 0: 1/2\n * 1: 2/3\n * 2: 4/6\n * 3: 3/4\n * 4: 5/6\n * 5: 7/8\n * 6: 4/5\n * 7: 8/9\n * 8: 9/10\n * 9: 1/4\n * 10: 1/3\n * 11: 2/5\n * 12: 3/5\n"
|
||||
},
|
||||
"setByModcod" : {
|
||||
"type" : "integer",
|
||||
"description" : "Modulation and code rate set by DVB-S2 MODCOD (1 for yes, 0 for no)"
|
||||
}
|
||||
},
|
||||
"description" : "DATVDemod"
|
||||
};
|
||||
defs.DATVDemodSettings = {
|
||||
"properties" : {
|
||||
@ -51162,7 +51207,7 @@ except ApiException as e:
|
||||
</div>
|
||||
<div id="generator">
|
||||
<div class="content">
|
||||
Generated 2021-10-23T19:53:41.859+02:00
|
||||
Generated 2021-10-26T22:25:01.367+02:00
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -50,6 +50,8 @@ SWGChannelReport::SWGChannelReport() {
|
||||
m_chirp_chat_demod_report_isSet = false;
|
||||
chirp_chat_mod_report = nullptr;
|
||||
m_chirp_chat_mod_report_isSet = false;
|
||||
datv_demod_report = nullptr;
|
||||
m_datv_demod_report_isSet = false;
|
||||
datv_mod_report = nullptr;
|
||||
m_datv_mod_report_isSet = false;
|
||||
dsd_demod_report = nullptr;
|
||||
@ -130,6 +132,8 @@ SWGChannelReport::init() {
|
||||
m_chirp_chat_demod_report_isSet = false;
|
||||
chirp_chat_mod_report = new SWGChirpChatModReport();
|
||||
m_chirp_chat_mod_report_isSet = false;
|
||||
datv_demod_report = new SWGDATVDemodReport();
|
||||
m_datv_demod_report_isSet = false;
|
||||
datv_mod_report = new SWGDATVModReport();
|
||||
m_datv_mod_report_isSet = false;
|
||||
dsd_demod_report = new SWGDSDDemodReport();
|
||||
@ -215,6 +219,9 @@ SWGChannelReport::cleanup() {
|
||||
if(chirp_chat_mod_report != nullptr) {
|
||||
delete chirp_chat_mod_report;
|
||||
}
|
||||
if(datv_demod_report != nullptr) {
|
||||
delete datv_demod_report;
|
||||
}
|
||||
if(datv_mod_report != nullptr) {
|
||||
delete datv_mod_report;
|
||||
}
|
||||
@ -325,6 +332,8 @@ SWGChannelReport::fromJsonObject(QJsonObject &pJson) {
|
||||
|
||||
::SWGSDRangel::setValue(&chirp_chat_mod_report, pJson["ChirpChatModReport"], "SWGChirpChatModReport", "SWGChirpChatModReport");
|
||||
|
||||
::SWGSDRangel::setValue(&datv_demod_report, pJson["DATVDemodReport"], "SWGDATVDemodReport", "SWGDATVDemodReport");
|
||||
|
||||
::SWGSDRangel::setValue(&datv_mod_report, pJson["DATVModReport"], "SWGDATVModReport", "SWGDATVModReport");
|
||||
|
||||
::SWGSDRangel::setValue(&dsd_demod_report, pJson["DSDDemodReport"], "SWGDSDDemodReport", "SWGDSDDemodReport");
|
||||
@ -424,6 +433,9 @@ SWGChannelReport::asJsonObject() {
|
||||
if((chirp_chat_mod_report != nullptr) && (chirp_chat_mod_report->isSet())){
|
||||
toJsonValue(QString("ChirpChatModReport"), chirp_chat_mod_report, obj, QString("SWGChirpChatModReport"));
|
||||
}
|
||||
if((datv_demod_report != nullptr) && (datv_demod_report->isSet())){
|
||||
toJsonValue(QString("DATVDemodReport"), datv_demod_report, obj, QString("SWGDATVDemodReport"));
|
||||
}
|
||||
if((datv_mod_report != nullptr) && (datv_mod_report->isSet())){
|
||||
toJsonValue(QString("DATVModReport"), datv_mod_report, obj, QString("SWGDATVModReport"));
|
||||
}
|
||||
@ -613,6 +625,16 @@ SWGChannelReport::setChirpChatModReport(SWGChirpChatModReport* chirp_chat_mod_re
|
||||
this->m_chirp_chat_mod_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGDATVDemodReport*
|
||||
SWGChannelReport::getDatvDemodReport() {
|
||||
return datv_demod_report;
|
||||
}
|
||||
void
|
||||
SWGChannelReport::setDatvDemodReport(SWGDATVDemodReport* datv_demod_report) {
|
||||
this->datv_demod_report = datv_demod_report;
|
||||
this->m_datv_demod_report_isSet = true;
|
||||
}
|
||||
|
||||
SWGDATVModReport*
|
||||
SWGChannelReport::getDatvModReport() {
|
||||
return datv_mod_report;
|
||||
@ -901,6 +923,9 @@ SWGChannelReport::isSet(){
|
||||
if(chirp_chat_mod_report && chirp_chat_mod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(datv_demod_report && datv_demod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(datv_mod_report && datv_mod_report->isSet()){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "SWGBFMDemodReport.h"
|
||||
#include "SWGChirpChatDemodReport.h"
|
||||
#include "SWGChirpChatModReport.h"
|
||||
#include "SWGDATVDemodReport.h"
|
||||
#include "SWGDATVModReport.h"
|
||||
#include "SWGDSDDemodReport.h"
|
||||
#include "SWGFileSinkReport.h"
|
||||
@ -109,6 +110,9 @@ public:
|
||||
SWGChirpChatModReport* getChirpChatModReport();
|
||||
void setChirpChatModReport(SWGChirpChatModReport* chirp_chat_mod_report);
|
||||
|
||||
SWGDATVDemodReport* getDatvDemodReport();
|
||||
void setDatvDemodReport(SWGDATVDemodReport* datv_demod_report);
|
||||
|
||||
SWGDATVModReport* getDatvModReport();
|
||||
void setDatvModReport(SWGDATVModReport* datv_mod_report);
|
||||
|
||||
@ -221,6 +225,9 @@ private:
|
||||
SWGChirpChatModReport* chirp_chat_mod_report;
|
||||
bool m_chirp_chat_mod_report_isSet;
|
||||
|
||||
SWGDATVDemodReport* datv_demod_report;
|
||||
bool m_datv_demod_report_isSet;
|
||||
|
||||
SWGDATVModReport* datv_mod_report;
|
||||
bool m_datv_mod_report_isSet;
|
||||
|
||||
|
292
swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp
Normal file
292
swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp
Normal file
@ -0,0 +1,292 @@
|
||||
/**
|
||||
* 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: 6.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 "SWGDATVDemodReport.h"
|
||||
|
||||
#include "SWGHelpers.h"
|
||||
|
||||
#include <QJsonDocument>
|
||||
#include <QJsonArray>
|
||||
#include <QObject>
|
||||
#include <QDebug>
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
SWGDATVDemodReport::SWGDATVDemodReport(QString* json) {
|
||||
init();
|
||||
this->fromJson(*json);
|
||||
}
|
||||
|
||||
SWGDATVDemodReport::SWGDATVDemodReport() {
|
||||
channel_power_db = 0.0f;
|
||||
m_channel_power_db_isSet = false;
|
||||
audio_active = 0;
|
||||
m_audio_active_isSet = false;
|
||||
audio_decode_ok = 0;
|
||||
m_audio_decode_ok_isSet = false;
|
||||
video_active = 0;
|
||||
m_video_active_isSet = false;
|
||||
video_decode_ok = 0;
|
||||
m_video_decode_ok_isSet = false;
|
||||
udp_running = 0;
|
||||
m_udp_running_isSet = false;
|
||||
modcod_modulation = 0;
|
||||
m_modcod_modulation_isSet = false;
|
||||
modcod_code_rate = 0;
|
||||
m_modcod_code_rate_isSet = false;
|
||||
set_by_modcod = 0;
|
||||
m_set_by_modcod_isSet = false;
|
||||
}
|
||||
|
||||
SWGDATVDemodReport::~SWGDATVDemodReport() {
|
||||
this->cleanup();
|
||||
}
|
||||
|
||||
void
|
||||
SWGDATVDemodReport::init() {
|
||||
channel_power_db = 0.0f;
|
||||
m_channel_power_db_isSet = false;
|
||||
audio_active = 0;
|
||||
m_audio_active_isSet = false;
|
||||
audio_decode_ok = 0;
|
||||
m_audio_decode_ok_isSet = false;
|
||||
video_active = 0;
|
||||
m_video_active_isSet = false;
|
||||
video_decode_ok = 0;
|
||||
m_video_decode_ok_isSet = false;
|
||||
udp_running = 0;
|
||||
m_udp_running_isSet = false;
|
||||
modcod_modulation = 0;
|
||||
m_modcod_modulation_isSet = false;
|
||||
modcod_code_rate = 0;
|
||||
m_modcod_code_rate_isSet = false;
|
||||
set_by_modcod = 0;
|
||||
m_set_by_modcod_isSet = false;
|
||||
}
|
||||
|
||||
void
|
||||
SWGDATVDemodReport::cleanup() {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
SWGDATVDemodReport*
|
||||
SWGDATVDemodReport::fromJson(QString &json) {
|
||||
QByteArray array (json.toStdString().c_str());
|
||||
QJsonDocument doc = QJsonDocument::fromJson(array);
|
||||
QJsonObject jsonObject = doc.object();
|
||||
this->fromJsonObject(jsonObject);
|
||||
return this;
|
||||
}
|
||||
|
||||
void
|
||||
SWGDATVDemodReport::fromJsonObject(QJsonObject &pJson) {
|
||||
::SWGSDRangel::setValue(&channel_power_db, pJson["channelPowerDB"], "float", "");
|
||||
|
||||
::SWGSDRangel::setValue(&audio_active, pJson["audioActive"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&audio_decode_ok, pJson["audioDecodeOK"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&video_active, pJson["videoActive"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&video_decode_ok, pJson["videoDecodeOK"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&udp_running, pJson["udpRunning"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modcod_modulation, pJson["modcodModulation"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&modcod_code_rate, pJson["modcodCodeRate"], "qint32", "");
|
||||
|
||||
::SWGSDRangel::setValue(&set_by_modcod, pJson["setByModcod"], "qint32", "");
|
||||
|
||||
}
|
||||
|
||||
QString
|
||||
SWGDATVDemodReport::asJson ()
|
||||
{
|
||||
QJsonObject* obj = this->asJsonObject();
|
||||
|
||||
QJsonDocument doc(*obj);
|
||||
QByteArray bytes = doc.toJson();
|
||||
delete obj;
|
||||
return QString(bytes);
|
||||
}
|
||||
|
||||
QJsonObject*
|
||||
SWGDATVDemodReport::asJsonObject() {
|
||||
QJsonObject* obj = new QJsonObject();
|
||||
if(m_channel_power_db_isSet){
|
||||
obj->insert("channelPowerDB", QJsonValue(channel_power_db));
|
||||
}
|
||||
if(m_audio_active_isSet){
|
||||
obj->insert("audioActive", QJsonValue(audio_active));
|
||||
}
|
||||
if(m_audio_decode_ok_isSet){
|
||||
obj->insert("audioDecodeOK", QJsonValue(audio_decode_ok));
|
||||
}
|
||||
if(m_video_active_isSet){
|
||||
obj->insert("videoActive", QJsonValue(video_active));
|
||||
}
|
||||
if(m_video_decode_ok_isSet){
|
||||
obj->insert("videoDecodeOK", QJsonValue(video_decode_ok));
|
||||
}
|
||||
if(m_udp_running_isSet){
|
||||
obj->insert("udpRunning", QJsonValue(udp_running));
|
||||
}
|
||||
if(m_modcod_modulation_isSet){
|
||||
obj->insert("modcodModulation", QJsonValue(modcod_modulation));
|
||||
}
|
||||
if(m_modcod_code_rate_isSet){
|
||||
obj->insert("modcodCodeRate", QJsonValue(modcod_code_rate));
|
||||
}
|
||||
if(m_set_by_modcod_isSet){
|
||||
obj->insert("setByModcod", QJsonValue(set_by_modcod));
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
float
|
||||
SWGDATVDemodReport::getChannelPowerDb() {
|
||||
return channel_power_db;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setChannelPowerDb(float channel_power_db) {
|
||||
this->channel_power_db = channel_power_db;
|
||||
this->m_channel_power_db_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getAudioActive() {
|
||||
return audio_active;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setAudioActive(qint32 audio_active) {
|
||||
this->audio_active = audio_active;
|
||||
this->m_audio_active_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getAudioDecodeOk() {
|
||||
return audio_decode_ok;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setAudioDecodeOk(qint32 audio_decode_ok) {
|
||||
this->audio_decode_ok = audio_decode_ok;
|
||||
this->m_audio_decode_ok_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getVideoActive() {
|
||||
return video_active;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setVideoActive(qint32 video_active) {
|
||||
this->video_active = video_active;
|
||||
this->m_video_active_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getVideoDecodeOk() {
|
||||
return video_decode_ok;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setVideoDecodeOk(qint32 video_decode_ok) {
|
||||
this->video_decode_ok = video_decode_ok;
|
||||
this->m_video_decode_ok_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getUdpRunning() {
|
||||
return udp_running;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setUdpRunning(qint32 udp_running) {
|
||||
this->udp_running = udp_running;
|
||||
this->m_udp_running_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getModcodModulation() {
|
||||
return modcod_modulation;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setModcodModulation(qint32 modcod_modulation) {
|
||||
this->modcod_modulation = modcod_modulation;
|
||||
this->m_modcod_modulation_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getModcodCodeRate() {
|
||||
return modcod_code_rate;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setModcodCodeRate(qint32 modcod_code_rate) {
|
||||
this->modcod_code_rate = modcod_code_rate;
|
||||
this->m_modcod_code_rate_isSet = true;
|
||||
}
|
||||
|
||||
qint32
|
||||
SWGDATVDemodReport::getSetByModcod() {
|
||||
return set_by_modcod;
|
||||
}
|
||||
void
|
||||
SWGDATVDemodReport::setSetByModcod(qint32 set_by_modcod) {
|
||||
this->set_by_modcod = set_by_modcod;
|
||||
this->m_set_by_modcod_isSet = true;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
SWGDATVDemodReport::isSet(){
|
||||
bool isObjectUpdated = false;
|
||||
do{
|
||||
if(m_channel_power_db_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_audio_active_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_audio_decode_ok_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_video_active_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_video_decode_ok_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_udp_running_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_modcod_modulation_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_modcod_code_rate_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
if(m_set_by_modcod_isSet){
|
||||
isObjectUpdated = true; break;
|
||||
}
|
||||
}while(false);
|
||||
return isObjectUpdated;
|
||||
}
|
||||
}
|
||||
|
106
swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h
Normal file
106
swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h
Normal file
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* 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: 6.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.
|
||||
*/
|
||||
|
||||
/*
|
||||
* SWGDATVDemodReport.h
|
||||
*
|
||||
* DATVDemod
|
||||
*/
|
||||
|
||||
#ifndef SWGDATVDemodReport_H_
|
||||
#define SWGDATVDemodReport_H_
|
||||
|
||||
#include <QJsonObject>
|
||||
|
||||
|
||||
|
||||
#include "SWGObject.h"
|
||||
#include "export.h"
|
||||
|
||||
namespace SWGSDRangel {
|
||||
|
||||
class SWG_API SWGDATVDemodReport: public SWGObject {
|
||||
public:
|
||||
SWGDATVDemodReport();
|
||||
SWGDATVDemodReport(QString* json);
|
||||
virtual ~SWGDATVDemodReport();
|
||||
void init();
|
||||
void cleanup();
|
||||
|
||||
virtual QString asJson () override;
|
||||
virtual QJsonObject* asJsonObject() override;
|
||||
virtual void fromJsonObject(QJsonObject &json) override;
|
||||
virtual SWGDATVDemodReport* fromJson(QString &jsonString) override;
|
||||
|
||||
float getChannelPowerDb();
|
||||
void setChannelPowerDb(float channel_power_db);
|
||||
|
||||
qint32 getAudioActive();
|
||||
void setAudioActive(qint32 audio_active);
|
||||
|
||||
qint32 getAudioDecodeOk();
|
||||
void setAudioDecodeOk(qint32 audio_decode_ok);
|
||||
|
||||
qint32 getVideoActive();
|
||||
void setVideoActive(qint32 video_active);
|
||||
|
||||
qint32 getVideoDecodeOk();
|
||||
void setVideoDecodeOk(qint32 video_decode_ok);
|
||||
|
||||
qint32 getUdpRunning();
|
||||
void setUdpRunning(qint32 udp_running);
|
||||
|
||||
qint32 getModcodModulation();
|
||||
void setModcodModulation(qint32 modcod_modulation);
|
||||
|
||||
qint32 getModcodCodeRate();
|
||||
void setModcodCodeRate(qint32 modcod_code_rate);
|
||||
|
||||
qint32 getSetByModcod();
|
||||
void setSetByModcod(qint32 set_by_modcod);
|
||||
|
||||
|
||||
virtual bool isSet() override;
|
||||
|
||||
private:
|
||||
float channel_power_db;
|
||||
bool m_channel_power_db_isSet;
|
||||
|
||||
qint32 audio_active;
|
||||
bool m_audio_active_isSet;
|
||||
|
||||
qint32 audio_decode_ok;
|
||||
bool m_audio_decode_ok_isSet;
|
||||
|
||||
qint32 video_active;
|
||||
bool m_video_active_isSet;
|
||||
|
||||
qint32 video_decode_ok;
|
||||
bool m_video_decode_ok_isSet;
|
||||
|
||||
qint32 udp_running;
|
||||
bool m_udp_running_isSet;
|
||||
|
||||
qint32 modcod_modulation;
|
||||
bool m_modcod_modulation_isSet;
|
||||
|
||||
qint32 modcod_code_rate;
|
||||
bool m_modcod_code_rate_isSet;
|
||||
|
||||
qint32 set_by_modcod;
|
||||
bool m_set_by_modcod_isSet;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* SWGDATVDemodReport_H_ */
|
@ -81,6 +81,7 @@
|
||||
#include "SWGCommand.h"
|
||||
#include "SWGComplex.h"
|
||||
#include "SWGDABDemodSettings.h"
|
||||
#include "SWGDATVDemodReport.h"
|
||||
#include "SWGDATVDemodSettings.h"
|
||||
#include "SWGDATVModReport.h"
|
||||
#include "SWGDATVModSettings.h"
|
||||
@ -643,6 +644,11 @@ namespace SWGSDRangel {
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGDATVDemodReport").compare(type) == 0) {
|
||||
SWGDATVDemodReport *obj = new SWGDATVDemodReport();
|
||||
obj->init();
|
||||
return obj;
|
||||
}
|
||||
if(QString("SWGDATVDemodSettings").compare(type) == 0) {
|
||||
SWGDATVDemodSettings *obj = new SWGDATVDemodSettings();
|
||||
obj->init();
|
||||
|
Loading…
Reference in New Issue
Block a user