Browse Source

demodchirpmodem: keep the frequency dial in step on sample rate changes

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 <noreply@anthropic.com>
chirpmodem-v8.0.0
Daniel Peter Chokola 2 weeks ago
parent
commit
c96ef80c53
  1. 8
      plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp

8
plugins/channelrx/demodchirpmodem/chirpmodemdemodgui.cpp

@ -384,7 +384,13 @@ void ChirpModemDemodGUI::handleInputMessages() @@ -384,7 +384,13 @@ void ChirpModemDemodGUI::handleInputMessages()
const auto& notification = static_cast<const DSPSignalNotification&>(*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))

Loading…
Cancel
Save