added Gold Codes

This commit is contained in:
2026-07-10 08:09:26 +03:00
parent 23bd15c916
commit 937aafe15d
15 changed files with 113 additions and 9 deletions
+7 -4
View File
@@ -12,7 +12,7 @@
'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'
'bitrate', 'fdev', 'modulation index', 'rx bandwidth', 'sync word', 'modem mode', 'gold codes'
]);
function normalizeModemMode(mode) {
@@ -93,6 +93,7 @@
modulationIndex: null,
rxBandwidthHz: null,
syncWordLengthBits: null,
goldCodesEnabled: null,
extraFields: {}
};
if (!meta) return snap;
@@ -134,6 +135,7 @@
if (o.modulation_index != null) snap.modulationIndex = Number(o.modulation_index);
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.fields && typeof o.fields === 'object') {
for (const [k, v] of Object.entries(o.fields)) {
if (!isKnownLabel(k)) snap.extraFields[k] = String(v);
@@ -153,7 +155,7 @@
const keys = ['gps', 'packetTime', 'role', 'modemMode', 'rssiDbm', 'snrDb', 'rxQualityPercent', 'packet', 'payload', 'perPercent',
'packetReceive', 'packetTotal', 'packetError', 'crcError', 'preambleDetected', 'headerValid',
'txPktPerS', 'rxPktPerS', 'frequencyMhz', 'sf', 'bwKhz', 'powerDbm', 'codeRate', 'crcEnabled',
'bitrateBps', 'fdevHz', 'modulationIndex', 'rxBandwidthHz', 'syncWordLengthBits'];
'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',
@@ -162,7 +164,7 @@
txPktPerS: 'txSpeed', rxPktPerS: 'rxSpeed',
frequencyMhz: 'frequency', sf: 'sf', bwKhz: 'bw', powerDbm: 'power', codeRate: 'codeRate', crcEnabled: 'crc',
bitrateBps: 'bitrate', fdevHz: 'fdev', modulationIndex: 'modIndex',
rxBandwidthHz: 'rxBw', syncWordLengthBits: 'syncWord'
rxBandwidthHz: 'rxBw', syncWordLengthBits: 'syncWord', goldCodesEnabled: 'goldCodes'
};
for (const k of keys) {
if (a[k] !== b[k] && !(a[k] == null && b[k] == null)) changed.add(map[k]);
@@ -213,7 +215,8 @@
{ key: 'fdev', label: 'FDev', fmt: s => s.fdevHz != null ? `${s.fdevHz} Hz` : '—' },
{ key: 'modIndex', label: 'Mod Idx', fmt: s => s.modulationIndex != null ? String(s.modulationIndex) : '—' },
{ key: 'rxBw', label: 'Rx BW', fmt: s => s.rxBandwidthHz != null ? `${s.rxBandwidthHz} Hz` : '—' },
{ key: 'syncWord', label: 'Sync Word', fmt: s => s.syncWordLengthBits != null ? `${s.syncWordLengthBits} bit` : '—' }
{ key: 'syncWord', label: 'Sync Word', fmt: s => s.syncWordLengthBits != null ? `${s.syncWordLengthBits} bit` : '—' },
{ key: 'goldCodes', label: 'Gold Codes', fmt: s => fmtCrc(s.goldCodesEnabled) }
];
function staticRowsForCompare(txSnap, rxSnap) {