From fb0b6675c8c5b5e301bafa319839ed0110ffbeca Mon Sep 17 00:00:00 2001 From: Jan Svabenik Date: Thu, 19 Mar 2026 07:35:11 +0100 Subject: [PATCH] fix: read CFAR debug state from live frame --- web/app.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/app.js b/web/app.js index b7d50f1..1dbcd31 100644 --- a/web/app.js +++ b/web/app.js @@ -558,9 +558,10 @@ function updateHeroMetrics() { metricSource.textContent = stats.last_sample_ago_ms >= 0 ? `${stats.last_sample_ago_ms} ms` : 'n/a'; const gpuText = gpuInfo.active ? 'GPU active' : (gpuInfo.available ? 'GPU ready' : 'GPU n/a'); - const thresholdInfo = Array.isArray(latest.thresholds) && latest.thresholds.length - ? `CFAR on · noise ${(Number.isFinite(latest.noise_floor) ? latest.noise_floor.toFixed(1) : 'n/a')} dB` - : `CFAR off · noise ${(Number.isFinite(latest.noise_floor) ? latest.noise_floor.toFixed(1) : 'n/a')} dB`; + const debug = latest.debug || {}; + const thresholdInfo = Array.isArray(debug.thresholds) && debug.thresholds.length + ? `CFAR ${showDebugOverlay ? 'on' : 'hidden'} · noise ${(Number.isFinite(debug.noise_floor) ? debug.noise_floor.toFixed(1) : 'n/a')} dB` + : `CFAR off · noise ${(Number.isFinite(debug.noise_floor) ? debug.noise_floor.toFixed(1) : 'n/a')} dB`; metaLine.textContent = `${fmtMHz(latest.center_hz, 3)} · ${fmtHz(span)} span · ${thresholdInfo} · ${gpuText}`; heroSubtitle.textContent = `${latest.signals?.length || 0} live signals · ${events.length} recent events tracked`;