1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

Merge pull request #2178 from srcejon/freq_scanner

ILS Demod: Save frequency when switching between LOC and G/S. Set frequency for ident when in G/S mode.
This commit is contained in:
Edouard Griffiths 2024-06-20 17:58:10 +02:00 committed by GitHub
commit 9e4dc83e74
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,6 +296,7 @@ void ILSDemodGUI::on_rfBW_valueChanged(int value)
void ILSDemodGUI::on_mode_currentIndexChanged(int index) void ILSDemodGUI::on_mode_currentIndexChanged(int index)
{ {
int freqIdx = ui->frequency->currentIndex();
ui->frequency->clear(); ui->frequency->clear();
m_settings.m_mode = (ILSDemodSettings::Mode)index; m_settings.m_mode = (ILSDemodSettings::Mode)index;
if (m_settings.m_mode == ILSDemodSettings::LOC) if (m_settings.m_mode == ILSDemodSettings::LOC)
@ -318,6 +319,7 @@ void ILSDemodGUI::on_mode_currentIndexChanged(int index)
} }
closePipes(); closePipes();
} }
ui->frequency->setCurrentIndex(freqIdx);
applySettings(); applySettings();
} }
@ -411,14 +413,8 @@ void ILSDemodGUI::on_ident_currentIndexChanged(int index)
on_runway_editingFinished(); on_runway_editingFinished();
int frequency = m_ils[index].m_frequency; int frequency = m_ils[index].m_frequency;
QString freqText = QString("%1").arg(frequency / 1000000.0f, 0, 'f', 2); QString freqText = QString("%1").arg(frequency / 1000000.0f, 0, 'f', 2);
if (m_settings.m_mode == ILSDemodSettings::GS) int freqIndex = m_locFrequencies.indexOf(freqText);
{ ui->frequency->setCurrentIndex(freqIndex);
int index = m_locFrequencies.indexOf(freqText);
if (index >= 0) {
freqText = m_gsFrequencies[index];
}
}
ui->frequency->setCurrentText(freqText);
m_disableDrawILS = false; m_disableDrawILS = false;
} }
drawILSOnMap(); drawILSOnMap();