diff --git a/CMakeLists.txt b/CMakeLists.txt index 48f6a0103..299f51fc2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,6 +94,7 @@ option(ENABLE_CHANNELRX_DEMODDSC "Enable channelrx demoddsc plugin" ON) option(ENABLE_CHANNELRX_HEATMAP "Enable channelrx heatmap plugin" ON) option(ENABLE_CHANNELRX_FREQSCANNER "Enable channelrx freqscanner plugin" ON) option(ENABLE_CHANNELRX_ENDOFTRAIN "Enable channelrx end-of-train plugin" ON) +option(ENABLE_CHANNELRX_CHANNELPOWER "Enable channelrx channel power plugin" ON) # Channel Tx enablers option(ENABLE_CHANNELTX "Enable channeltx plugins" ON) diff --git a/plugins/channelrx/CMakeLists.txt b/plugins/channelrx/CMakeLists.txt index 5c5b43911..6e060a663 100644 --- a/plugins/channelrx/CMakeLists.txt +++ b/plugins/channelrx/CMakeLists.txt @@ -1,5 +1,9 @@ project(demod) +if (ENABLE_CHANNELRX_CHANNELPOWER) + add_subdirectory(channelpower) +endif() + if (ENABLE_CHANNELRX_ENDOFTRAIN) add_subdirectory(demodendoftrain) endif() diff --git a/plugins/channelrx/channelpower/channelpower.cpp b/plugins/channelrx/channelpower/channelpower.cpp index c44afd1f3..d44184b7d 100644 --- a/plugins/channelrx/channelpower/channelpower.cpp +++ b/plugins/channelrx/channelpower/channelpower.cpp @@ -421,6 +421,7 @@ void ChannelPower::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& resp response.getChannelPowerReport()->setChannelPowerDb(CalcDb::dbPower(magAvg)); response.getChannelPowerReport()->setChannelPowerMaxDb(CalcDb::dbPower(magMaxPeak)); response.getChannelPowerReport()->setChannelPowerMinDb(CalcDb::dbPower(magMinPeak)); + response.getChannelPowerReport()->setChannelPowerPulseDb(CalcDb::dbPower(magPulseAvg)); response.getChannelPowerReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate()); } diff --git a/sdrbase/webapi/webapirequestmapper.cpp b/sdrbase/webapi/webapirequestmapper.cpp index dad19b7b7..4409e69fe 100644 --- a/sdrbase/webapi/webapirequestmapper.cpp +++ b/sdrbase/webapi/webapirequestmapper.cpp @@ -4478,6 +4478,12 @@ bool WebAPIRequestMapper::getChannelSettings( channelSettings->getChannelAnalyzerSettings()->init(); channelSettings->getChannelAnalyzerSettings()->fromJsonObject(settingsJsonObject); } + else if (channelSettingsKey == "ChannelPowerSettings") + { + channelSettings->setChannelPowerSettings(new SWGSDRangel::SWGChannelPowerSettings()); + channelSettings->setChannelPowerSettings()->init(); + channelSettings->setChannelPowerSettings()->fromJsonObject(settingsJsonObject); + } else if (channelSettingsKey == "ChirpChatDemodSettings") { channelSettings->setChirpChatDemodSettings(new SWGSDRangel::SWGChirpChatDemodSettings()); @@ -5526,6 +5532,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings& channelSettings.setAptDemodSettings(nullptr); channelSettings.setAtvModSettings(nullptr); channelSettings.setBfmDemodSettings(nullptr); + channelSettings.setChannelPowerSettings(nullptr); channelSettings.setDatvModSettings(nullptr); channelSettings.setDabDemodSettings(nullptr); channelSettings.setDsdDemodSettings(nullptr); @@ -5572,6 +5579,7 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan channelReport.setAmModReport(nullptr); channelReport.setAtvModReport(nullptr); channelReport.setBfmDemodReport(nullptr); + channelReport.setChannelPowerReport(nullptr); channelReport.setDatvModReport(nullptr); channelReport.setDsdDemodReport(nullptr); channelReport.setEndOfTrainDemodReport(nullptr); diff --git a/sdrbase/webapi/webapiutils.cpp b/sdrbase/webapi/webapiutils.cpp index 24537a8b3..17948bf31 100644 --- a/sdrbase/webapi/webapiutils.cpp +++ b/sdrbase/webapi/webapiutils.cpp @@ -33,6 +33,7 @@ const QMap WebAPIUtils::m_channelURIToSettingsKey = { {"sdrangel.channeltx.moddatv", "DATVModSettings"}, {"sdrangel.channel.bfm", "BFMDemodSettings"}, {"sdrangel.channel.chanalyzer", "ChannelAnalyzerSettings"}, + {"sdrangel.channel.channelpower", "ChannelPowerSettings"}, {"sdrangel.channel.chanalyzerng", "ChannelAnalyzerSettings"}, // remap {"org.f4exb.sdrangelove.channel.chanalyzer", "ChannelAnalyzerSettings"}, // remap {"sdrangel.channel.chirpchatdemod", "ChirpChatDemodSettings"}, @@ -160,6 +161,7 @@ const QMap WebAPIUtils::m_channelTypeToSettingsKey = { {"ChannelAnalyzer", "ChannelAnalyzerSettings"}, {"ChirpChatDemod", "ChirpChatDemodSettings"}, {"ChirpChatMod", "ChirpChatModSettings"}, + {"ChannelPower", "ChannelPowerSettings"}, {"DATVDemod", "DATVDemodSettings"}, {"DATVMod", "DATVModSettings"}, {"DABDemod", "DABDemodSettings"},