From c96ef80c53d1344d8ac3660d2289cfee0a502961 Mon Sep 17 00:00:00 2001 From: Daniel Peter Chokola Date: Sun, 8 Nov 2026 20:36:25 -0500 Subject: [PATCH] demodchirpmodem: keep the frequency dial in step on sample rate changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On a DSPSignalNotification the GUI narrows the Δf dial to ±rate/2. With the first notification at a device's default rate (48 kS/s), an offset set afterwards was clamped in the display only (signals blocked), and nothing put the real value back when the range widened: the dial showed +24,000 while the channel was at +250,000. setValueRange was also not signal blocked, so a clamp there could have sent the clamped offset to the channel. Block the dial's signals around the range change and show the offset from the settings again. Co-Authored-By: Claude Opus 5.5 --- plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp b/plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp index fa54eaaed..cb1e97559 100644 --- a/plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp +++ b/plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp @@ -384,7 +384,13 @@ void ChirpModemDemodGUI::handleInputMessages() const auto& notification = static_cast(*message); m_deviceCenterFrequency = notification.getCenterFrequency(); m_basebandSampleRate = notification.getSampleRate(); - ui->deltaFrequency->setValueRange(false, 8, -m_basebandSampleRate / 2, m_basebandSampleRate / 2); + { + // Changing the range clamps the dial: never send that back as a + // setting, and show the real offset again once the range allows it + QSignalBlocker blocker(ui->deltaFrequency); + ui->deltaFrequency->setValueRange(false, 8, -m_basebandSampleRate / 2, m_basebandSampleRate / 2); + ui->deltaFrequency->setValue(m_settings.m_inputFrequencyOffset); + } updateAbsoluteCenterFrequency(); } else if (ChirpModemMessages::MsgFrame::match(*message))