[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:
@@ -2712,10 +2712,11 @@ function dbmToSUnits(dbm) {
|
||||
}
|
||||
|
||||
function formatSignal(sUnits) {
|
||||
if (!Number.isFinite(sUnits) || sUnits <= 9) return `S${Math.max(0, sUnits || 0).toFixed(1)}`;
|
||||
// S9+60dB is already extremely strong; cap anything beyond that.
|
||||
const overDb = Math.min(60, (sUnits - 9) * 10);
|
||||
return `S9 + ${overDb.toFixed(0)}dB`;
|
||||
if (!Number.isFinite(sUnits) || sUnits <= 0) return "S0";
|
||||
if (sUnits <= 9) return `S${Math.round(sUnits)}`;
|
||||
// S9+xdB: round to nearest 10 dB step, cap at +60.
|
||||
const overDb = Math.min(60, Math.round((sUnits - 9) * 10 / 10) * 10);
|
||||
return overDb === 0 ? "S9" : `S9+${overDb}dB`;
|
||||
}
|
||||
|
||||
function setDisabled(disabled) {
|
||||
|
||||
Reference in New Issue
Block a user