From ed720673f384d023014df9a844ef371d267c4473 Mon Sep 17 00:00:00 2001 From: f4exb Date: Thu, 28 Oct 2021 08:48:32 +0200 Subject: [PATCH] DATV demod: API enhancements with report --- plugins/channelrx/demoddatv/datvdemod.cpp | 27 ++ plugins/channelrx/demoddatv/datvdemod.h | 5 + sdrbase/resources/webapi/doc/html2/index.html | 47 ++- .../doc/swagger/include/ChannelReport.yaml | 2 + .../webapi/doc/swagger/include/DATVDemod.yaml | 58 ++++ .../api/swagger/include/ChannelReport.yaml | 2 + .../api/swagger/include/DATVDemod.yaml | 60 ++++ swagger/sdrangel/code/html2/index.html | 47 ++- .../code/qt5/client/SWGChannelReport.cpp | 25 ++ .../code/qt5/client/SWGChannelReport.h | 7 + .../code/qt5/client/SWGDATVDemodReport.cpp | 292 ++++++++++++++++++ .../code/qt5/client/SWGDATVDemodReport.h | 106 +++++++ .../code/qt5/client/SWGModelFactory.h | 6 + 13 files changed, 682 insertions(+), 2 deletions(-) create mode 100644 swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp create mode 100644 swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h diff --git a/plugins/channelrx/demoddatv/datvdemod.cpp b/plugins/channelrx/demoddatv/datvdemod.cpp index 5095082bd..bff0c8db5 100644 --- a/plugins/channelrx/demoddatv/datvdemod.cpp +++ b/plugins/channelrx/demoddatv/datvdemod.cpp @@ -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 *messageQueues, QList& channelSettingsKeys, diff --git a/plugins/channelrx/demoddatv/datvdemod.h b/plugins/channelrx/demoddatv/datvdemod.h index 581a5692c..5a7095c7f 100644 --- a/plugins/channelrx/demoddatv/datvdemod.h +++ b/plugins/channelrx/demoddatv/datvdemod.h @@ -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& channelSettingsKeys, const DATVDemodSettings& settings, bool force); void sendChannelSettings( QList *messageQueues, diff --git a/sdrbase/resources/webapi/doc/html2/index.html b/sdrbase/resources/webapi/doc/html2/index.html index 952385dcb..890390b99 100644 --- a/sdrbase/resources/webapi/doc/html2/index.html +++ b/sdrbase/resources/webapi/doc/html2/index.html @@ -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:
- Generated 2021-10-23T19:53:41.859+02:00 + Generated 2021-10-26T22:25:01.367+02:00
diff --git a/sdrbase/resources/webapi/doc/swagger/include/ChannelReport.yaml b/sdrbase/resources/webapi/doc/swagger/include/ChannelReport.yaml index e7c53810c..0cae44f80 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/ChannelReport.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/ChannelReport.yaml @@ -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: diff --git a/sdrbase/resources/webapi/doc/swagger/include/DATVDemod.yaml b/sdrbase/resources/webapi/doc/swagger/include/DATVDemod.yaml index daf0bfb9b..d00ee6b96 100644 --- a/sdrbase/resources/webapi/doc/swagger/include/DATVDemod.yaml +++ b/sdrbase/resources/webapi/doc/swagger/include/DATVDemod.yaml @@ -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) + + diff --git a/swagger/sdrangel/api/swagger/include/ChannelReport.yaml b/swagger/sdrangel/api/swagger/include/ChannelReport.yaml index a8914da66..19e85cde6 100644 --- a/swagger/sdrangel/api/swagger/include/ChannelReport.yaml +++ b/swagger/sdrangel/api/swagger/include/ChannelReport.yaml @@ -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: diff --git a/swagger/sdrangel/api/swagger/include/DATVDemod.yaml b/swagger/sdrangel/api/swagger/include/DATVDemod.yaml index daf0bfb9b..3aed4b127 100644 --- a/swagger/sdrangel/api/swagger/include/DATVDemod.yaml +++ b/swagger/sdrangel/api/swagger/include/DATVDemod.yaml @@ -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) + + diff --git a/swagger/sdrangel/code/html2/index.html b/swagger/sdrangel/code/html2/index.html index 952385dcb..890390b99 100644 --- a/swagger/sdrangel/code/html2/index.html +++ b/swagger/sdrangel/code/html2/index.html @@ -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:
- Generated 2021-10-23T19:53:41.859+02:00 + Generated 2021-10-26T22:25:01.367+02:00
diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelReport.cpp b/swagger/sdrangel/code/qt5/client/SWGChannelReport.cpp index 14f39c952..4f7ed5f17 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChannelReport.cpp +++ b/swagger/sdrangel/code/qt5/client/SWGChannelReport.cpp @@ -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; } diff --git a/swagger/sdrangel/code/qt5/client/SWGChannelReport.h b/swagger/sdrangel/code/qt5/client/SWGChannelReport.h index f0d6d6996..2b40a3bec 100644 --- a/swagger/sdrangel/code/qt5/client/SWGChannelReport.h +++ b/swagger/sdrangel/code/qt5/client/SWGChannelReport.h @@ -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; diff --git a/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp b/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp new file mode 100644 index 000000000..053332355 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.cpp @@ -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 +#include +#include +#include + +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; +} +} + diff --git a/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h b/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h new file mode 100644 index 000000000..cd9b1f7f0 --- /dev/null +++ b/swagger/sdrangel/code/qt5/client/SWGDATVDemodReport.h @@ -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 + + + +#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_ */ diff --git a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h b/swagger/sdrangel/code/qt5/client/SWGModelFactory.h index 57d1c749f..6a1c76ec3 100644 --- a/swagger/sdrangel/code/qt5/client/SWGModelFactory.h +++ b/swagger/sdrangel/code/qt5/client/SWGModelFactory.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();