[feat](trx-frontend-http): display S-meter in standard S-unit steps

Show S0–S9 as whole units and S9+xdB in 10dB steps instead of fractional S-unit values.

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-30 21:35:08 +02:00
parent 3c7cad5b85
commit 691f0727b2
@@ -2712,10 +2712,11 @@ function dbmToSUnits(dbm) {
} }
function formatSignal(sUnits) { function formatSignal(sUnits) {
if (!Number.isFinite(sUnits) || sUnits <= 9) return `S${Math.max(0, sUnits || 0).toFixed(1)}`; if (!Number.isFinite(sUnits) || sUnits <= 0) return "S0";
// S9+60dB is already extremely strong; cap anything beyond that. if (sUnits <= 9) return `S${Math.round(sUnits)}`;
const overDb = Math.min(60, (sUnits - 9) * 10); // S9+xdB: round to nearest 10 dB step, cap at +60.
return `S9 + ${overDb.toFixed(0)}dB`; const overDb = Math.min(60, Math.round((sUnits - 9) * 10 / 10) * 10);
return overDb === 0 ? "S9" : `S9+${overDb}dB`;
} }
function setDisabled(disabled) { function setDisabled(disabled) {