mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 01:39:05 -05:00
Ensure frequency and inputFrequencyOffset are consistent.
This commit is contained in:
parent
67723563a4
commit
a76262f0b7
@ -291,12 +291,12 @@ int ChannelPower::webapiSettingsPutPatch(
|
|||||||
|
|
||||||
// Ensure inputFrequencyOffset and frequency are consistent
|
// Ensure inputFrequencyOffset and frequency are consistent
|
||||||
QStringList settingsKeys = channelSettingsKeys;
|
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;
|
settings.m_inputFrequencyOffset = settings.m_frequency - m_centerFrequency;
|
||||||
settingsKeys.append("inputFrequencyOffset");
|
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;
|
settings.m_frequency = m_centerFrequency + settings.m_inputFrequencyOffset;
|
||||||
settingsKeys.append("frequency");
|
settingsKeys.append("frequency");
|
||||||
|
Loading…
Reference in New Issue
Block a user