From e75ab1c53ed49ae6fb7430d42f06de0b94e99ade Mon Sep 17 00:00:00 2001 From: f4exb Date: Mon, 14 Sep 2015 02:15:08 +0200 Subject: [PATCH] NFM demod: squelch slider with 0.1 dB precision --- plugins/channel/nfm/nfmdemod.cpp | 4 ++-- plugins/channel/nfm/nfmdemodgui.cpp | 2 +- plugins/channel/nfm/nfmdemodgui.ui | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/plugins/channel/nfm/nfmdemod.cpp b/plugins/channel/nfm/nfmdemod.cpp index 3f33e78d2..aaa6e42a2 100644 --- a/plugins/channel/nfm/nfmdemod.cpp +++ b/plugins/channel/nfm/nfmdemod.cpp @@ -349,8 +349,8 @@ void NFMDemod::apply() if (m_config.m_squelch != m_running.m_squelch) { - // input is a power level in dB - m_squelchLevel = pow(10.0, m_config.m_squelch / 10.0); + // input is a value in tenths of dB + m_squelchLevel = pow(10.0, m_config.m_squelch / 100.0); //m_squelchLevel *= m_squelchLevel; m_afSquelch.setThreshold(m_squelchLevel); } diff --git a/plugins/channel/nfm/nfmdemodgui.cpp b/plugins/channel/nfm/nfmdemodgui.cpp index 7c27a2e40..ed270d936 100644 --- a/plugins/channel/nfm/nfmdemodgui.cpp +++ b/plugins/channel/nfm/nfmdemodgui.cpp @@ -181,7 +181,7 @@ void NFMDemodGUI::on_volume_valueChanged(int value) void NFMDemodGUI::on_squelch_valueChanged(int value) { - ui->squelchText->setText(QString("%1 dB").arg(value)); + ui->squelchText->setText(QString("%1").arg(value / 10.0, 0, 'f', 1)); applySettings(); } diff --git a/plugins/channel/nfm/nfmdemodgui.ui b/plugins/channel/nfm/nfmdemodgui.ui index f9974a386..85122430c 100644 --- a/plugins/channel/nfm/nfmdemodgui.ui +++ b/plugins/channel/nfm/nfmdemodgui.ui @@ -130,8 +130,11 @@ + + Threshold min/max in dB + - -30 + -200 0 @@ -140,7 +143,7 @@ 1 - -20 + -150 Qt::Horizontal @@ -214,7 +217,7 @@ - -40 dB + -15.0 Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter