fix: add STRT invalid detction, ach server passes config for get events,

This commit is contained in:
2026-04-14 17:08:27 -04:00
parent 4f4c1a8f64
commit 171dc2551c
5 changed files with 104 additions and 14 deletions
+12
View File
@@ -191,6 +191,18 @@ rectime_seconds = int(round((total_samples - pretrig_samples) / sample_rate))
`_decode_a5_waveform` uses `sample_rate=1024` as a default; the server overrides with
`compliance_config.sample_rate` when available. Do NOT use `strt[18]` for rectime.
**Pre-trigger time is separate from record_time (confirmed 2026-04-14):**
Blastware documentation states: "The default Time Scale is -0.25 second to 1 second — this
negative number accounts for the pre-trigger set for compliance monitoring." Therefore:
- `record_time` (3.0 s) is POST-TRIGGER duration only
- Pre-trigger = 0.25 s = 256 samples at 1024 sps (compliance monitoring standard default)
- The pre-trigger field has NOT yet been located in the raw compliance config bytes
- When STRT layout is invalid, `_decode_a5_waveform` falls back to pretrig = 0.25 × sr
- TODO: locate pretrig_time offset in ComplianceConfig — search around anchor or channel blocks
The device bulk-streams zero-padded frames BEYOND the configured record window. The
viewer clips `displayCount = total_samples = pretrig + post_trig` to exclude this padding.
**Sanity check — pretrig_samples must be less than total_samples:**
If `pretrig_samples >= total_samples` the STRT parse is invalid. Possible causes:
DLE-stuffed `0x10` byte within prev_key4 or key4 shifted field offsets, or a different