noice to noise

This commit is contained in:
2026-07-10 11:21:05 +03:00
parent 937aafe15d
commit 132c867dd9
10 changed files with 252 additions and 35 deletions
+18 -3
View File
@@ -12,7 +12,8 @@
'preamble detected', 'header valid',
'on air', 'tx speed', 'rx speed', 'per', 'rx quality',
'code rate', 'preamble length', 'low data rate', 'crc', 'payload length', 'tx timeout',
'bitrate', 'fdev', 'modulation index', 'rx bandwidth', 'sync word', 'modem mode', 'gold codes'
'bitrate', 'fdev', 'modulation index', 'rx bandwidth', 'sync word', 'modem mode', 'gold codes',
'noise', 'gold error', 'golda error', 'gold all error', 'golda all error', 'noice'
]);
function normalizeModemMode(mode) {
@@ -94,6 +95,10 @@
rxBandwidthHz: null,
syncWordLengthBits: null,
goldCodesEnabled: null,
noiseDbm: null,
goldError: null,
goldAllError: null,
syncWordValid: null,
extraFields: {}
};
if (!meta) return snap;
@@ -136,6 +141,10 @@
if (o.rx_bandwidth_hz != null) snap.rxBandwidthHz = Number(o.rx_bandwidth_hz);
if (o.sync_word_length_bits != null) snap.syncWordLengthBits = Number(o.sync_word_length_bits);
if (o.gold_codes_enabled != null) snap.goldCodesEnabled = Boolean(o.gold_codes_enabled);
if (o.noise_dbm != null) snap.noiseDbm = Number(o.noise_dbm);
if (o.gold_error != null) snap.goldError = Number(o.gold_error);
if (o.gold_all_error != null) snap.goldAllError = Number(o.gold_all_error);
if (o.sync_word_valid != null) snap.syncWordValid = Number(o.sync_word_valid);
if (o.fields && typeof o.fields === 'object') {
for (const [k, v] of Object.entries(o.fields)) {
if (!isKnownLabel(k)) snap.extraFields[k] = String(v);
@@ -153,14 +162,16 @@
const changed = new Set();
if (!a || !b) return changed;
const keys = ['gps', 'packetTime', 'role', 'modemMode', 'rssiDbm', 'snrDb', 'rxQualityPercent', 'packet', 'payload', 'perPercent',
'packetReceive', 'packetTotal', 'packetError', 'crcError', 'preambleDetected', 'headerValid',
'packetReceive', 'packetTotal', 'packetError', 'crcError', 'noiseDbm', 'goldError', 'goldAllError',
'preambleDetected', 'headerValid', 'syncWordValid',
'txPktPerS', 'rxPktPerS', 'frequencyMhz', 'sf', 'bwKhz', 'powerDbm', 'codeRate', 'crcEnabled',
'bitrateBps', 'fdevHz', 'modulationIndex', 'rxBandwidthHz', 'syncWordLengthBits', 'goldCodesEnabled'];
const map = {
gps: 'gps', packetTime: 'packetTime', role: 'role', modemMode: 'modemMode', rssiDbm: 'rssi', snrDb: 'snr',
rxQualityPercent: 'rxQuality', packet: 'packet', payload: 'payload', perPercent: 'per',
packetReceive: 'packetReceive', packetTotal: 'packetTotal', packetError: 'packetError',
crcError: 'crcError', preambleDetected: 'preambleDetected', headerValid: 'headerValid',
crcError: 'crcError', noiseDbm: 'noise', goldError: 'goldError', goldAllError: 'goldAllError',
preambleDetected: 'preambleDetected', headerValid: 'headerValid', syncWordValid: 'syncWordValid',
txPktPerS: 'txSpeed', rxPktPerS: 'rxSpeed',
frequencyMhz: 'frequency', sf: 'sf', bwKhz: 'bw', powerDbm: 'power', codeRate: 'codeRate', crcEnabled: 'crc',
bitrateBps: 'bitrate', fdevHz: 'fdev', modulationIndex: 'modIndex',
@@ -185,8 +196,12 @@
{ key: 'packetTotal', label: 'Всего', fmt: s => s.packetTotal != null ? String(s.packetTotal) : '—' },
{ key: 'packetError', label: 'Ошибки', fmt: s => s.packetError != null ? String(s.packetError) : '—' },
{ key: 'crcError', label: 'CRC err', fmt: s => s.crcError != null ? String(s.crcError) : '—' },
{ key: 'noise', label: 'Noice', fmt: s => s.noiseDbm != null ? String(s.noiseDbm) : '—' },
{ key: 'goldError', label: 'Golda Error', fmt: s => s.goldError != null ? String(s.goldError) : '—' },
{ key: 'goldAllError', label: 'Golda All Error', fmt: s => s.goldAllError != null ? String(s.goldAllError) : '—' },
{ key: 'preambleDetected', label: 'Preamble', fmt: s => s.preambleDetected != null ? String(s.preambleDetected) : '—' },
{ key: 'headerValid', label: 'Header OK', fmt: s => s.headerValid != null ? String(s.headerValid) : '—' },
{ key: 'syncWordValid', label: 'Sync Word OK', fmt: s => s.syncWordValid != null ? String(s.syncWordValid) : '—' },
{ key: 'txSpeed', label: 'TX Speed', fmt: s => s.txPktPerS != null ? `${s.txPktPerS} pkt/s` : '—' },
{ key: 'rxSpeed', label: 'RX Speed', fmt: s => s.rxPktPerS != null ? `${s.rxPktPerS} pkt/s` : '—' }
];