mirror of
https://github.com/smittix/intercept.git
synced 2026-04-25 07:10:00 -07:00
Fix waterfall retaining invalid span after error (#150)
When an error occurred with an out-of-range span (e.g. 30 MHz on RTL-SDR), the span input kept the invalid value. Track the last effective span from successful starts and reset the input on error. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,6 +36,7 @@ const Waterfall = (function () {
|
||||
|
||||
let _startMhz = 98.8;
|
||||
let _endMhz = 101.2;
|
||||
let _lastEffectiveSpan = 2.4;
|
||||
let _monitorFreqMhz = 100.0;
|
||||
|
||||
let _monitoring = false;
|
||||
@@ -2516,6 +2517,7 @@ const Waterfall = (function () {
|
||||
_drawFreqAxis();
|
||||
}
|
||||
if (Number.isFinite(msg.effective_span_mhz)) {
|
||||
_lastEffectiveSpan = msg.effective_span_mhz;
|
||||
const spanEl = document.getElementById('wfSpanMhz');
|
||||
if (spanEl) spanEl.value = msg.effective_span_mhz;
|
||||
}
|
||||
@@ -2567,6 +2569,10 @@ const Waterfall = (function () {
|
||||
_pendingMonitorTuneMhz = null;
|
||||
_scanStartPending = false;
|
||||
_pendingSharedMonitorRearm = false;
|
||||
// Reset span input to last known good value so an
|
||||
// invalid span doesn't persist across restart (#150).
|
||||
const spanEl = document.getElementById('wfSpanMhz');
|
||||
if (spanEl) spanEl.value = _lastEffectiveSpan;
|
||||
// If the monitor was using the shared IQ stream that
|
||||
// just failed, tear down the stale monitor state so
|
||||
// the button becomes clickable again after restart.
|
||||
|
||||
Reference in New Issue
Block a user