From eddfa3bec060f9ea0f54a0d00fcc8ffaa69546ef Mon Sep 17 00:00:00 2001 From: srcejon Date: Sun, 3 Mar 2024 21:57:33 +0000 Subject: [PATCH] Add settings to API. --- plugins/channelrx/demodais/aisdemod.cpp | 10 ++++++++++ plugins/channelrx/demoddsc/dscdemod.cpp | 14 ++++++++++++-- .../channelrx/demodendoftrain/endoftraindemod.cpp | 11 +++++++++-- plugins/channelrx/demodpacket/packetdemod.cpp | 14 ++++++++++++-- .../channelrx/demodradiosonde/radiosondedemod.cpp | 10 ++++++++++ 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/plugins/channelrx/demodais/aisdemod.cpp b/plugins/channelrx/demodais/aisdemod.cpp index 2d61e6e30..6b3fe9fd2 100644 --- a/plugins/channelrx/demodais/aisdemod.cpp +++ b/plugins/channelrx/demodais/aisdemod.cpp @@ -310,6 +310,9 @@ void AISDemod::applySettings(const AISDemodSettings& settings, bool force) if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { reverseAPIKeys.append("logEnabled"); } + if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) { + reverseAPIKeys.append("useFileTime"); + } if (m_settings.m_streamIndex != settings.m_streamIndex) { if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only @@ -495,6 +498,9 @@ void AISDemod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("logEnabled")) { settings.m_logEnabled = response.getAisDemodSettings()->getLogEnabled(); } + if (channelSettingsKeys.contains("useFileTime")) { + settings.m_useFileTime = response.getAisDemodSettings()->getUseFileTime(); + } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getAisDemodSettings()->getRgbColor(); } @@ -543,6 +549,7 @@ void AISDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getAisDemodSettings()->setUdpFormat((int)settings.m_udpFormat); response.getAisDemodSettings()->setLogFilename(new QString(settings.m_logFilename)); response.getAisDemodSettings()->setLogEnabled(settings.m_logEnabled); + response.getAisDemodSettings()->setUseFileTime(settings.m_useFileTime); response.getAisDemodSettings()->setRgbColor(settings.m_rgbColor); if (response.getAisDemodSettings()->getTitle()) { @@ -681,6 +688,9 @@ void AISDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("logEnabled") || force) { swgAISDemodSettings->setLogEnabled(settings.m_logEnabled); } + if (channelSettingsKeys.contains("useFileTime") || force) { + swgAISDemodSettings->setUseFileTime(settings.m_useFileTime); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgAISDemodSettings->setRgbColor(settings.m_rgbColor); } diff --git a/plugins/channelrx/demoddsc/dscdemod.cpp b/plugins/channelrx/demoddsc/dscdemod.cpp index f026a9aee..82d886d29 100644 --- a/plugins/channelrx/demoddsc/dscdemod.cpp +++ b/plugins/channelrx/demoddsc/dscdemod.cpp @@ -314,6 +314,9 @@ void DSCDemod::applySettings(const DSCDemodSettings& settings, bool force) if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { reverseAPIKeys.append("logEnabled"); } + if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) { + reverseAPIKeys.append("useFileTime"); + } if (m_settings.m_streamIndex != settings.m_streamIndex) { if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only @@ -502,10 +505,13 @@ void DSCDemod::webapiUpdateChannelSettings( settings.m_udpPort = response.getDscDemodSettings()->getUdpPort(); } if (channelSettingsKeys.contains("logFilename")) { - settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename(); + settings.m_logFilename = *response.getDscDemodSettings()->getLogFilename(); } if (channelSettingsKeys.contains("logEnabled")) { - settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled(); + settings.m_logEnabled = response.getDscDemodSettings()->getLogEnabled(); + } + if (channelSettingsKeys.contains("useFileTime")) { + settings.m_useFileTime = response.getDscDemodSettings()->getUseFileTime(); } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getDscDemodSettings()->getRgbColor(); @@ -554,6 +560,7 @@ void DSCDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp response.getDscDemodSettings()->setUdpPort(settings.m_udpPort); response.getDscDemodSettings()->setLogFilename(new QString(settings.m_logFilename)); response.getDscDemodSettings()->setLogEnabled(settings.m_logEnabled); + response.getDscDemodSettings()->setUseFileTime(settings.m_useFileTime); response.getDscDemodSettings()->setRgbColor(settings.m_rgbColor); if (response.getDscDemodSettings()->getTitle()) { @@ -698,6 +705,9 @@ void DSCDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("logEnabled") || force) { swgDSCDemodSettings->setLogEnabled(settings.m_logEnabled); } + if (channelSettingsKeys.contains("useFileTime") || force) { + swgDSCDemodSettings->setUseFileTime(settings.m_useFileTime); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgDSCDemodSettings->setRgbColor(settings.m_rgbColor); } diff --git a/plugins/channelrx/demodendoftrain/endoftraindemod.cpp b/plugins/channelrx/demodendoftrain/endoftraindemod.cpp index 9d88cac71..b9a17de61 100644 --- a/plugins/channelrx/demodendoftrain/endoftraindemod.cpp +++ b/plugins/channelrx/demodendoftrain/endoftraindemod.cpp @@ -439,10 +439,13 @@ void EndOfTrainDemod::webapiUpdateChannelSettings( settings.m_udpPort = response.getEndOfTrainDemodSettings()->getUdpPort(); } if (channelSettingsKeys.contains("logFilename")) { - settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename(); + settings.m_logFilename = *response.getEndOfTrainDemodSettings()->getLogFilename(); } if (channelSettingsKeys.contains("logEnabled")) { - settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled(); + settings.m_logEnabled = response.getEndOfTrainDemodSettings()->getLogEnabled(); + } + if (channelSettingsKeys.contains("useFileTime")) { + settings.m_useFileTime = response.getEndOfTrainDemodSettings()->getUseFileTime(); } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getEndOfTrainDemodSettings()->getRgbColor(); @@ -486,6 +489,7 @@ void EndOfTrainDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting response.getEndOfTrainDemodSettings()->setUdpPort(settings.m_udpPort); response.getEndOfTrainDemodSettings()->setLogFilename(new QString(settings.m_logFilename)); response.getEndOfTrainDemodSettings()->setLogEnabled(settings.m_logEnabled); + response.getEndOfTrainDemodSettings()->setUseFileTime(settings.m_useFileTime); response.getEndOfTrainDemodSettings()->setRgbColor(settings.m_rgbColor); if (response.getEndOfTrainDemodSettings()->getTitle()) { @@ -611,6 +615,9 @@ void EndOfTrainDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("logEnabled") || force) { swgEndOfTrainDemodSettings->setLogEnabled(settings.m_logEnabled); } + if (channelSettingsKeys.contains("useFileTime") || force) { + swgEndOfTrainDemodSettings->setUseFileTime(settings.m_useFileTime); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgEndOfTrainDemodSettings->setRgbColor(settings.m_rgbColor); } diff --git a/plugins/channelrx/demodpacket/packetdemod.cpp b/plugins/channelrx/demodpacket/packetdemod.cpp index c772b22d8..926700635 100644 --- a/plugins/channelrx/demodpacket/packetdemod.cpp +++ b/plugins/channelrx/demodpacket/packetdemod.cpp @@ -297,6 +297,9 @@ void PacketDemod::applySettings(const PacketDemodSettings& settings, bool force) if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { reverseAPIKeys.append("logEnabled"); } + if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) { + reverseAPIKeys.append("useFileTime"); + } if (m_settings.m_streamIndex != settings.m_streamIndex) { if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only @@ -482,10 +485,13 @@ void PacketDemod::webapiUpdateChannelSettings( settings.m_udpPort = response.getPacketDemodSettings()->getUdpPort(); } if (channelSettingsKeys.contains("logFilename")) { - settings.m_logFilename = *response.getAdsbDemodSettings()->getLogFilename(); + settings.m_logFilename = *response.getPacketDemodSettings()->getLogFilename(); } if (channelSettingsKeys.contains("logEnabled")) { - settings.m_logEnabled = response.getAdsbDemodSettings()->getLogEnabled(); + settings.m_logEnabled = response.getPacketDemodSettings()->getLogEnabled(); + } + if (channelSettingsKeys.contains("useFileTime")) { + settings.m_useFileTime = response.getPacketDemodSettings()->getUseFileTime(); } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getPacketDemodSettings()->getRgbColor(); @@ -530,6 +536,7 @@ void PacketDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r response.getPacketDemodSettings()->setUdpPort(settings.m_udpPort); response.getPacketDemodSettings()->setLogFilename(new QString(settings.m_logFilename)); response.getPacketDemodSettings()->setLogEnabled(settings.m_logEnabled); + response.getPacketDemodSettings()->setUseFileTime(settings.m_useFileTime); response.getPacketDemodSettings()->setRgbColor(settings.m_rgbColor); if (response.getPacketDemodSettings()->getTitle()) { @@ -658,6 +665,9 @@ void PacketDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("logEnabled") || force) { swgPacketDemodSettings->setLogEnabled(settings.m_logEnabled); } + if (channelSettingsKeys.contains("useFilTime") || force) { + swgPacketDemodSettings->setUseFileTime(settings.m_useFileTime); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgPacketDemodSettings->setRgbColor(settings.m_rgbColor); } diff --git a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp index a025399c3..8aefc3f7e 100644 --- a/plugins/channelrx/demodradiosonde/radiosondedemod.cpp +++ b/plugins/channelrx/demodradiosonde/radiosondedemod.cpp @@ -337,6 +337,9 @@ void RadiosondeDemod::applySettings(const RadiosondeDemodSettings& settings, boo if ((settings.m_logEnabled != m_settings.m_logEnabled) || force) { reverseAPIKeys.append("logEnabled"); } + if ((settings.m_useFileTime != m_settings.m_useFileTime) || force) { + reverseAPIKeys.append("useFileTime"); + } if (m_settings.m_streamIndex != settings.m_streamIndex) { if (m_deviceAPI->getSampleMIMO()) // change of stream is possible for MIMO devices only @@ -516,6 +519,9 @@ void RadiosondeDemod::webapiUpdateChannelSettings( if (channelSettingsKeys.contains("logEnabled")) { settings.m_logEnabled = response.getRadiosondeDemodSettings()->getLogEnabled(); } + if (channelSettingsKeys.contains("useFileTime")) { + settings.m_useFileTime = response.getRadiosondeDemodSettings()->getUseFileTime(); + } if (channelSettingsKeys.contains("rgbColor")) { settings.m_rgbColor = response.getRadiosondeDemodSettings()->getRgbColor(); } @@ -563,6 +569,7 @@ void RadiosondeDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSetting response.getRadiosondeDemodSettings()->setUdpPort(settings.m_udpPort); response.getRadiosondeDemodSettings()->setLogFilename(new QString(settings.m_logFilename)); response.getRadiosondeDemodSettings()->setLogEnabled(settings.m_logEnabled); + response.getRadiosondeDemodSettings()->setUseFileTime(settings.m_useFileTime); response.getRadiosondeDemodSettings()->setRgbColor(settings.m_rgbColor); if (response.getRadiosondeDemodSettings()->getTitle()) { @@ -698,6 +705,9 @@ void RadiosondeDemod::webapiFormatChannelSettings( if (channelSettingsKeys.contains("logEnabled") || force) { swgRadiosondeDemodSettings->setLogEnabled(settings.m_logEnabled); } + if (channelSettingsKeys.contains("useFileTime") || force) { + swgRadiosondeDemodSettings->setUseFileTime(settings.m_useFileTime); + } if (channelSettingsKeys.contains("rgbColor") || force) { swgRadiosondeDemodSettings->setRgbColor(settings.m_rgbColor); }