fix: peak0c scope bug and strt cross check fix
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user