fix: peak0c scope bug and strt cross check fix

This commit is contained in:
2026-04-14 17:46:38 -04:00
parent 171dc2551c
commit 9ae968b108
2 changed files with 39 additions and 13 deletions
+5 -1
View File
@@ -527,6 +527,10 @@
? samples.slice(0, displayCount)
: samples;
// peak0C declared here (function scope) so it is visible in the Chart.js
// config block below (which lives outside the if(isGeo) block).
let peak0C = null;
if (isGeo) {
// Geo channels: counts × (range / 32767) → in/s
// Scale factor for the waveform shape (may need calibration per unit)
@@ -535,7 +539,7 @@
// Use the device-computed 0C record peak for the label (authoritative).
// The raw-sample-computed peak can be inflated by frame-boundary artifacts.
const peak0C = peakValues0C[ch];
peak0C = peakValues0C[ch];
const peakIns = (peak0C !== null && peak0C !== undefined)
? peak0C
: Math.max(...plotSamples.map(Math.abs));