Skip to content

Commit

Permalink
Merge pull request f4exb#2178 from srcejon/freq_scanner
Browse files Browse the repository at this point in the history
ILS Demod: Save frequency when switching between LOC and G/S. Set frequency for ident when in G/S mode.
  • Loading branch information
f4exb authored Jun 20, 2024
2 parents fd9e995 + 0488cc6 commit 9e4dc83
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions plugins/channelrx/demodils/ilsdemodgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ void ILSDemodGUI::on_rfBW_valueChanged(int value)

void ILSDemodGUI::on_mode_currentIndexChanged(int index)
{
int freqIdx = ui->frequency->currentIndex();
ui->frequency->clear();
m_settings.m_mode = (ILSDemodSettings::Mode)index;
if (m_settings.m_mode == ILSDemodSettings::LOC)
Expand All @@ -318,6 +319,7 @@ void ILSDemodGUI::on_mode_currentIndexChanged(int index)
}
closePipes();
}
ui->frequency->setCurrentIndex(freqIdx);
applySettings();
}

Expand Down Expand Up @@ -411,14 +413,8 @@ void ILSDemodGUI::on_ident_currentIndexChanged(int index)
on_runway_editingFinished();
int frequency = m_ils[index].m_frequency;
QString freqText = QString("%1").arg(frequency / 1000000.0f, 0, 'f', 2);
if (m_settings.m_mode == ILSDemodSettings::GS)
{
int index = m_locFrequencies.indexOf(freqText);
if (index >= 0) {
freqText = m_gsFrequencies[index];
}
}
ui->frequency->setCurrentText(freqText);
int freqIndex = m_locFrequencies.indexOf(freqText);
ui->frequency->setCurrentIndex(freqIndex);
m_disableDrawILS = false;
}
drawILSOnMap();
Expand Down

0 comments on commit 9e4dc83

Please sign in to comment.