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

Ensure frequency and inputFrequencyOffset are consistent.

This commit is contained in:
srcejon 2024-04-07 15:00:50 +01:00
parent 67723563a4
commit a76262f0b7

View File

@ -291,12 +291,12 @@ int ChannelPower::webapiSettingsPutPatch(
// Ensure inputFrequencyOffset and frequency are consistent
QStringList settingsKeys = channelSettingsKeys;
if (settingsKeys.contains("frequency") && (settings.m_frequencyMode == ChannelPowerSettings::Absolute))
if (settingsKeys.contains("frequency") && !settingsKeys.contains("inputFrequencyOffset"))
{
settings.m_inputFrequencyOffset = settings.m_frequency - m_centerFrequency;
settingsKeys.append("inputFrequencyOffset");
}
else if (settingsKeys.contains("inputFrequencyOffset") && (settings.m_frequencyMode == ChannelPowerSettings::Offset))
else if (settingsKeys.contains("inputFrequencyOffset") && !settingsKeys.contains("frequency"))
{
settings.m_frequency = m_centerFrequency + settings.m_inputFrequencyOffset;
settingsKeys.append("frequency");