1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Frequency tracker: fixed REST API

This commit is contained in:
f4exb 2019-07-01 02:26:18 +02:00
parent 38df0a6928
commit 764fc99e40
2 changed files with 25 additions and 1 deletions

View File

@ -594,6 +594,9 @@ int FreqTracker::webapiSettingsPutPatch(
if (channelSettingsKeys.contains("rrcRolloff")) {
settings.m_rrcRolloff = response.getFreqTrackerSettings()->getRrcRolloff();
}
if (channelSettingsKeys.contains("squelchGate")) {
settings.m_squelchGate = response.getFreqTrackerSettings()->getSquelchGate();
}
if (channelSettingsKeys.contains("useReverseAPI")) {
settings.m_useReverseAPI = response.getAmDemodSettings()->getUseReverseApi() != 0;
}
@ -640,8 +643,9 @@ void FreqTracker::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
{
response.getFreqTrackerSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getFreqTrackerSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getFreqTrackerSettings()->setRgbColor(settings.m_rgbColor);
response.getFreqTrackerSettings()->setLog2Decim(settings.m_log2Decim);
response.getFreqTrackerSettings()->setSquelch(settings.m_squelch);
response.getFreqTrackerSettings()->setRgbColor(settings.m_rgbColor);
if (response.getFreqTrackerSettings()->getTitle()) {
*response.getFreqTrackerSettings()->getTitle() = settings.m_title;
@ -649,7 +653,13 @@ void FreqTracker::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
response.getFreqTrackerSettings()->setTitle(new QString(settings.m_title));
}
response.getFreqTrackerSettings()->setAlphaEma(m_settings.m_alphaEMA);
response.getFreqTrackerSettings()->setTracking(m_settings.m_tracking ? 1 : 0);
response.getFreqTrackerSettings()->setTrackerType((int) m_settings.m_trackerType);
response.getFreqTrackerSettings()->setPllPskOrder(m_settings.m_pllPskOrder);
response.getFreqTrackerSettings()->setRrc(m_settings.m_rrc ? 1 : 0);
response.getFreqTrackerSettings()->setRrcRolloff(m_settings.m_rrcRolloff);
response.getFreqTrackerSettings()->setSquelchGate(m_settings.m_squelchGate);
response.getFreqTrackerSettings()->setUseReverseApi(settings.m_useReverseAPI ? 1 : 0);
if (response.getFreqTrackerSettings()->getReverseApiAddress()) {

View File

@ -2352,6 +2352,20 @@ bool WebAPIRequestMapper::validateChannelSettings(
return false;
}
}
else if (*channelType == "FreqTracker")
{
if (channelSettings.getDirection() == 0)
{
QJsonObject freqTrackerSettingsJsonObject = jsonObject["FreqTrackerSettings"].toObject();
channelSettingsKeys = freqTrackerSettingsJsonObject.keys();
channelSettings.setFreqTrackerSettings(new SWGSDRangel::SWGFreqTrackerSettings());
channelSettings.getFreqTrackerSettings()->fromJsonObject(freqTrackerSettingsJsonObject);
return true;
}
else {
return false;
}
}
else if (*channelType == "NFMDemod")
{
if (channelSettings.getDirection() == 0)