1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-08-23 07:52:26 -04:00

Add Channel Power to Web API

This commit is contained in:
srcejon 2024-03-13 15:52:45 +00:00
parent ddcd08ba15
commit d45058d08f
5 changed files with 16 additions and 0 deletions

View File

@ -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_HEATMAP "Enable channelrx heatmap plugin" ON)
option(ENABLE_CHANNELRX_FREQSCANNER "Enable channelrx freqscanner 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_ENDOFTRAIN "Enable channelrx end-of-train plugin" ON)
option(ENABLE_CHANNELRX_CHANNELPOWER "Enable channelrx channel power plugin" ON)
# Channel Tx enablers # Channel Tx enablers
option(ENABLE_CHANNELTX "Enable channeltx plugins" ON) option(ENABLE_CHANNELTX "Enable channeltx plugins" ON)

View File

@ -1,5 +1,9 @@
project(demod) project(demod)
if (ENABLE_CHANNELRX_CHANNELPOWER)
add_subdirectory(channelpower)
endif()
if (ENABLE_CHANNELRX_ENDOFTRAIN) if (ENABLE_CHANNELRX_ENDOFTRAIN)
add_subdirectory(demodendoftrain) add_subdirectory(demodendoftrain)
endif() endif()

View File

@ -421,6 +421,7 @@ void ChannelPower::webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& resp
response.getChannelPowerReport()->setChannelPowerDb(CalcDb::dbPower(magAvg)); response.getChannelPowerReport()->setChannelPowerDb(CalcDb::dbPower(magAvg));
response.getChannelPowerReport()->setChannelPowerMaxDb(CalcDb::dbPower(magMaxPeak)); response.getChannelPowerReport()->setChannelPowerMaxDb(CalcDb::dbPower(magMaxPeak));
response.getChannelPowerReport()->setChannelPowerMinDb(CalcDb::dbPower(magMinPeak)); response.getChannelPowerReport()->setChannelPowerMinDb(CalcDb::dbPower(magMinPeak));
response.getChannelPowerReport()->setChannelPowerPulseDb(CalcDb::dbPower(magPulseAvg));
response.getChannelPowerReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate()); response.getChannelPowerReport()->setChannelSampleRate(m_basebandSink->getChannelSampleRate());
} }

View File

@ -4478,6 +4478,12 @@ bool WebAPIRequestMapper::getChannelSettings(
channelSettings->getChannelAnalyzerSettings()->init(); channelSettings->getChannelAnalyzerSettings()->init();
channelSettings->getChannelAnalyzerSettings()->fromJsonObject(settingsJsonObject); channelSettings->getChannelAnalyzerSettings()->fromJsonObject(settingsJsonObject);
} }
else if (channelSettingsKey == "ChannelPowerSettings")
{
channelSettings->setChannelPowerSettings(new SWGSDRangel::SWGChannelPowerSettings());
channelSettings->setChannelPowerSettings()->init();
channelSettings->setChannelPowerSettings()->fromJsonObject(settingsJsonObject);
}
else if (channelSettingsKey == "ChirpChatDemodSettings") else if (channelSettingsKey == "ChirpChatDemodSettings")
{ {
channelSettings->setChirpChatDemodSettings(new SWGSDRangel::SWGChirpChatDemodSettings()); channelSettings->setChirpChatDemodSettings(new SWGSDRangel::SWGChirpChatDemodSettings());
@ -5526,6 +5532,7 @@ void WebAPIRequestMapper::resetChannelSettings(SWGSDRangel::SWGChannelSettings&
channelSettings.setAptDemodSettings(nullptr); channelSettings.setAptDemodSettings(nullptr);
channelSettings.setAtvModSettings(nullptr); channelSettings.setAtvModSettings(nullptr);
channelSettings.setBfmDemodSettings(nullptr); channelSettings.setBfmDemodSettings(nullptr);
channelSettings.setChannelPowerSettings(nullptr);
channelSettings.setDatvModSettings(nullptr); channelSettings.setDatvModSettings(nullptr);
channelSettings.setDabDemodSettings(nullptr); channelSettings.setDabDemodSettings(nullptr);
channelSettings.setDsdDemodSettings(nullptr); channelSettings.setDsdDemodSettings(nullptr);
@ -5572,6 +5579,7 @@ void WebAPIRequestMapper::resetChannelReport(SWGSDRangel::SWGChannelReport& chan
channelReport.setAmModReport(nullptr); channelReport.setAmModReport(nullptr);
channelReport.setAtvModReport(nullptr); channelReport.setAtvModReport(nullptr);
channelReport.setBfmDemodReport(nullptr); channelReport.setBfmDemodReport(nullptr);
channelReport.setChannelPowerReport(nullptr);
channelReport.setDatvModReport(nullptr); channelReport.setDatvModReport(nullptr);
channelReport.setDsdDemodReport(nullptr); channelReport.setDsdDemodReport(nullptr);
channelReport.setEndOfTrainDemodReport(nullptr); channelReport.setEndOfTrainDemodReport(nullptr);

View File

@ -33,6 +33,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelURIToSettingsKey = {
{"sdrangel.channeltx.moddatv", "DATVModSettings"}, {"sdrangel.channeltx.moddatv", "DATVModSettings"},
{"sdrangel.channel.bfm", "BFMDemodSettings"}, {"sdrangel.channel.bfm", "BFMDemodSettings"},
{"sdrangel.channel.chanalyzer", "ChannelAnalyzerSettings"}, {"sdrangel.channel.chanalyzer", "ChannelAnalyzerSettings"},
{"sdrangel.channel.channelpower", "ChannelPowerSettings"},
{"sdrangel.channel.chanalyzerng", "ChannelAnalyzerSettings"}, // remap {"sdrangel.channel.chanalyzerng", "ChannelAnalyzerSettings"}, // remap
{"org.f4exb.sdrangelove.channel.chanalyzer", "ChannelAnalyzerSettings"}, // remap {"org.f4exb.sdrangelove.channel.chanalyzer", "ChannelAnalyzerSettings"}, // remap
{"sdrangel.channel.chirpchatdemod", "ChirpChatDemodSettings"}, {"sdrangel.channel.chirpchatdemod", "ChirpChatDemodSettings"},
@ -160,6 +161,7 @@ const QMap<QString, QString> WebAPIUtils::m_channelTypeToSettingsKey = {
{"ChannelAnalyzer", "ChannelAnalyzerSettings"}, {"ChannelAnalyzer", "ChannelAnalyzerSettings"},
{"ChirpChatDemod", "ChirpChatDemodSettings"}, {"ChirpChatDemod", "ChirpChatDemodSettings"},
{"ChirpChatMod", "ChirpChatModSettings"}, {"ChirpChatMod", "ChirpChatModSettings"},
{"ChannelPower", "ChannelPowerSettings"},
{"DATVDemod", "DATVDemodSettings"}, {"DATVDemod", "DATVDemodSettings"},
{"DATVMod", "DATVModSettings"}, {"DATVMod", "DATVModSettings"},
{"DABDemod", "DABDemodSettings"}, {"DABDemod", "DABDemodSettings"},