From 789e24be50fd98f05c5ba28e4b4e2017224445ee Mon Sep 17 00:00:00 2001 From: serversdown Date: Tue, 3 Nov 2026 15:32:02 -0500 Subject: [PATCH] fix(sfm): the top bar names a Micromate's firmware line; a stale overlay comment MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The page's top bar Firmware read '—' for a Micromate: Batch 2 gave the Device tab's card firmwareLabel() but not populateDeviceBar. Seen at the bench 2026-11-03; checked in jsdom ('—' before, 'Thor line (version not read)' after). - save_imported_bw's overlay comment said the waveform codec was undecoded and gave +-10 in/s; the overlay now stays because production keeps a paired Blastware report as the record until the file-only decode has no blanks (flagged by the decode-checker session). Comment only. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44 --- sfm/static/sfm_webapp.js | 2 +- sfm/waveform_store.py | 17 +++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/sfm/static/sfm_webapp.js b/sfm/static/sfm_webapp.js index 1a707d4..4d7a3a2 100644 --- a/sfm/static/sfm_webapp.js +++ b/sfm/static/sfm_webapp.js @@ -346,7 +346,7 @@ async function loadEventList() { // ── Device bar ───────────────────────────────────────────────────────────────── function populateDeviceBar() { qs('di-serial').textContent = unitInfo.serial || '—'; - qs('di-fw').textContent = unitInfo.firmware_version || unitInfo.firmware || '—'; + qs('di-fw').textContent = firmwareLabel(unitInfo); const cc = unitInfo.compliance_config || {}; qs('di-sr').textContent = cc.sample_rate ? `${cc.sample_rate} sps` : '—'; qs('di-rt').textContent = cc.record_time != null ? `${cc.record_time.toFixed(1)} s` : '—'; diff --git a/sfm/waveform_store.py b/sfm/waveform_store.py index 7bce4e8..5ac0788 100644 --- a/sfm/waveform_store.py +++ b/sfm/waveform_store.py @@ -345,14 +345,15 @@ class WaveformStore: exc, ) - # If we have a report, overlay its device-authoritative fields - # (peaks, project, sample_rate, record_time) onto the Event - # BEFORE handing it to db.insert_events(). Without this overlay - # the DB row gets `peak_values` from _peaks_from_samples(), which - # runs the still-undecoded waveform codec on the BW body and - # produces ±10 in/s saturation values on every channel for every - # event. The sidecar JSON had the correct values via - # event_to_sidecar_dict(bw_report=...) but the DB columns didn't. + # If we have a report, overlay its fields (peaks, project, + # sample_rate, record_time) onto the Event BEFORE handing it to + # db.insert_events(). The file decode reads these itself now (the + # decode checker compares it with Blastware's XML reports, DL2's + # 70,042 events); the overlay stays because production keeps a + # paired Blastware report as the record until the file-only decode + # has no blanks. The sidecar's `bw_report` block keeps the report's + # own values either way. (The old reason -- an undecoded codec + # giving ±10 in/s -- has not held since the 2026-08 codec fixes.) if bw_report is not None: try: event_file_io.apply_report_to_event(ev, bw_report)