[fix](trx-rs): wire DSP signal strength to Signal strength field and per-vchan SSE

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
2026-03-27 14:24:44 +01:00
parent d864969742
commit 4fc32f0e90
6 changed files with 49 additions and 9 deletions
@@ -362,6 +362,7 @@ let overviewPeakHoldMs = Number(loadSetting("overviewPeakHoldMs", 2000));
let decodeHistoryRetentionMin = 24 * 60;
let primaryRds = null;
let vchanRdsById = new Map();
let vchanSignalDbById = new Map();
let rdsOverlayEntries = [];
function currentDecodeHistoryRetentionMs() {
@@ -9163,12 +9164,21 @@ function startSpectrumStreaming() {
try {
const payload = evt.data === "null" ? [] : JSON.parse(evt.data);
const next = new Map();
const nextSig = new Map();
if (Array.isArray(payload)) {
payload.forEach((entry) => {
if (entry && entry.id) next.set(entry.id, entry.rds ?? null);
if (entry && entry.id) {
next.set(entry.id, entry.rds ?? null);
if (typeof entry.signal_db === "number") nextSig.set(entry.id, entry.signal_db);
}
});
}
vchanRdsById = next;
vchanSignalDbById = nextSig;
if (typeof vchanActiveId !== "undefined" && vchanActiveId && nextSig.has(vchanActiveId)) {
sigLastDbm = Math.round(nextSig.get(vchanActiveId));
refreshSigStrengthDisplay();
}
updateRdsPsOverlay(primaryRds);
} catch (_) {}
});
@@ -178,7 +178,7 @@
</div>
<div class="freq-field sig-strength-col">
<div class="sig-strength-display" id="sig-strength" title="Click to change unit">--</div>
<div class="label"><span>Sig Strength</span></div>
<div class="label"><span>Signal strength</span></div>
</div>
<div class="freq-field frequency-col">
<input class="status-input" id="freq" type="text" value="--" />