feat(codec): one settings codec for both series, on the shared layout

micromate/setup_fields.py: the fields an operator can change (record
mode, sample rate, interval, record time, geophone trigger, Series 3's
range and -- read-only until benched -- alarm, job number and its report
flag, the four notes by slot), the units' own limits from Instantel's
manuals, field-only byte patching (bit fields bit by bit; Series 3's
[26:28] as Blastware writes it; Series 4's CRC recomputed), the
read-back verdict compared by bytes, and the preview revision.

All 11 Blastware compliance writes reproduce from the block before them
(BE11529's first also shows Blastware re-rendering two mic levels
through its dB value; SFM echoes the unit's bytes); Series 4 keypad
fixtures reproduce pairwise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SyJ2ip3Krb6dtdv2cXua44
This commit is contained in:
serversdownandClaude Opus 5.5 committed 2026-11-03 21:33:01 -05:00
1 parent 1bb15573fc
commit 5ba72740dd
4 files changed
+712 -1

No files matched your search

+14
View File
@@ -88,6 +88,20 @@ def crc_ok(content: bytes) -> bool:
return _crc16_aug_ccitt(content[: n - 2]) == int.from_bytes(content[n : n + 2], "big")
def with_crc(content: bytes) -> bytes:
"""`content` with its trailing checksum recomputed: CRC-16/AUG-CCITT over
``[0:N-2]``, stored big-endian at ``[N:N+2]`` (the rule `crc_ok` checks).
THOR's write omits the checksum and the unit computes its own; this keeps a
patched block self-consistent so a plan's integrity check still means
something."""
n = int.from_bytes(content[0:2], "big")
if n < 2 or len(content) < n + 2:
raise ValueError(f"block header says {n} but the block is {len(content)} B")
out = bytearray(content)
out[n : n + 2] = _crc16_aug_ccitt(content[: n - 2]).to_bytes(2, "big")
return bytes(out)
def _f32(c: bytes, offset: int) -> float:
return struct.unpack_from(">f", c, offset)[0]