diff --git a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp index 73278162a..2e6149092 100644 --- a/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp +++ b/plugins/channelrx/chanalyzerng/chanalyzernggui.cpp @@ -106,14 +106,31 @@ void ChannelAnalyzerNGGUI::displaySettings() blockApplySettings(true); ui->useRationalDownsampler->setChecked(m_settings.m_downSample); + ui->channelSampleRate->setValue(m_settings.m_downSampleRate); + setNewFinalRate(); ui->BW->setValue(m_settings.m_bandwidth/100); ui->lowCut->setValue(m_settings.m_lowCutoff/100); ui->deltaFrequency->setValue(m_settings.m_frequency); ui->spanLog2->setCurrentIndex(m_settings.m_spanLog2); + displayPLLSettings(); blockApplySettings(false); +} - setNewFinalRate(); +void ChannelAnalyzerNGGUI::displayPLLSettings() +{ + if (m_settings.m_fll) + { + ui->pllPskOrder->setCurrentIndex(5); + } + else + { + int i = 0; + for(; ((m_settings.m_pllPskOrder>>i) & 1) == 0; i++); + ui->pllPskOrder->setCurrentIndex(i); + } + + ui->pll->setChecked(m_settings.m_pll); } void ChannelAnalyzerNGGUI::setSpectrumDisplay() @@ -163,6 +180,7 @@ bool ChannelAnalyzerNGGUI::handleMessage(const Message& message) { qDebug() << "ChannelAnalyzerNGGUI::handleMessage: MsgReportChannelSampleRateChanged"; ui->channelSampleRate->setValueRange(7, 2000U, m_channelAnalyzer->getInputSampleRate()); + ui->channelSampleRate->setValue(m_settings.m_downSampleRate); setNewFinalRate(); return true; @@ -229,16 +247,18 @@ void ChannelAnalyzerNGGUI::on_pll_toggled(bool checked) ui->pll->setToolTip(tr("PLL lock")); } + m_settings.m_pll = checked; applySettings(); } void ChannelAnalyzerNGGUI::on_pllPskOrder_currentIndexChanged(int index) { - if (index < 5) - { + if (index < 5) { m_settings.m_pllPskOrder = (1< -m_lockFreq) && (dF < m_lockFreq)) + if ((dF > -m_lockFreq) && (dF < m_lockFreq)) { if (m_lockCount < 20) { m_lockCount++; } - } - else + } + else { if (m_lockCount > 0) { m_lockCount--; @@ -187,7 +189,7 @@ void PhaseLockComplex::feed(float re, float im) } m_freqPrev = m_freq; - m_phiHatPrev = m_phiHat; + m_phiHatPrev = m_phiHat; } else {