From b6309027b37257fb1f402b8979f694591a3c2676 Mon Sep 17 00:00:00 2001 From: serversdown Date: Sun, 8 Nov 2026 03:43:05 -0500 Subject: [PATCH] feat(decode): the monitor log line from the file's footer (group F) Blastware prints one Monitor Log line per event: the footer's start and stop, then words for the footer's flag word [18:20] -- 69,983 / 69,983 DL2 lines, character for character (2026-11-08): 0x0001 Event Recorded 0x0010 Timer Stop 0x0002 Keyboard Exit 0x0020 Modem Exit 0x0004 Remote Exit 0x0200 Battery Low Exit 0x0008 Selfcheck Passed 0x0800 Memory Full Exit One line sets Modem and Timer and prints Modem, so the higher bit wins (the order of the others is inferred). Footer [20:22] is the event record's trigger source again (69,983 / 69,983); [22:24] is zero; [24:26] is not a common CRC-16 or sum. Event.monitor_log: MonitorLogLine(start, stop, flags, description), read only when the file's record chain is whole, which proves the footer. The checker compares it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01ALX2R8pghDaZuti9U7mEE9 --- minimateplus/decode_check.py | 5 + minimateplus/event_file_io.py | 48 +++++++- minimateplus/models.py | 14 +++ .../monitor-log-11-08-26/K559HCQ7.IU0H | Bin 0 -> 1752 bytes .../K559HCQ7_IU0H_XML.XML | 116 ++++++++++++++++++ .../monitor-log-11-08-26/T189INWA.060H | Bin 0 -> 1524 bytes .../T189INWA_060H_XML.XML | 116 ++++++++++++++++++ .../monitor-log-11-08-26/T189JZY7.L60H | Bin 0 -> 1850 bytes .../T189JZY7_L60H_XML.XML | 116 ++++++++++++++++++ .../monitor-log-11-08-26/T192JWEL.0Y0H | Bin 0 -> 1854 bytes .../T192JWEL_0Y0H_XML.XML | 116 ++++++++++++++++++ tests/test_bw_file_fields.py | 53 ++++++++ tests/test_decode_check.py | 15 +++ 13 files changed, 595 insertions(+), 4 deletions(-) create mode 100755 tests/fixtures/monitor-log-11-08-26/K559HCQ7.IU0H create mode 100755 tests/fixtures/monitor-log-11-08-26/K559HCQ7_IU0H_XML.XML create mode 100755 tests/fixtures/monitor-log-11-08-26/T189INWA.060H create mode 100755 tests/fixtures/monitor-log-11-08-26/T189INWA_060H_XML.XML create mode 100755 tests/fixtures/monitor-log-11-08-26/T189JZY7.L60H create mode 100755 tests/fixtures/monitor-log-11-08-26/T189JZY7_L60H_XML.XML create mode 100755 tests/fixtures/monitor-log-11-08-26/T192JWEL.0Y0H create mode 100755 tests/fixtures/monitor-log-11-08-26/T192JWEL_0Y0H_XML.XML diff --git a/minimateplus/decode_check.py b/minimateplus/decode_check.py index 350a415..e1b1335 100644 --- a/minimateplus/decode_check.py +++ b/minimateplus/decode_check.py @@ -157,6 +157,11 @@ def sfm_side(raw: bytes) -> SfmSide: ("LongZCFreq", pv.long_zc_freq), ("MicLZCFreq", pv.mic_zc_freq)): if hz is not None: values[tag] = "<1.0" if hz < 1.0 else hz + # The event's Monitor Log line, from the footer (2026-11-08). + if ev.monitor_log is not None: + ml = ev.monitor_log + values["MonitorLog"] = (f'{ml.start:%Y-%m-%d %H:%M:%S} - {ml.stop:%Y-%m-%d %H:%M:%S} ' + f'"{ml.description}"') # The unit's sensor check (2026-11-06), every record type. for ch, r in (ev.sensor_check_results or {}).items(): values[f"{ch}TestResults"] = r.result diff --git a/minimateplus/event_file_io.py b/minimateplus/event_file_io.py index 4127afc..480f930 100644 --- a/minimateplus/event_file_io.py +++ b/minimateplus/event_file_io.py @@ -26,7 +26,8 @@ import struct from pathlib import Path from typing import Optional, Union -from .models import DeviceInfo, Event, PeakValues, ProjectInfo, SensorCheckResult, Timestamp +from .models import (DeviceInfo, Event, MonitorLogLine, PeakValues, ProjectInfo, SensorCheckResult, + Timestamp) from . import blastware_file as _bw # avoid circular reference at module load from .bw_ascii_report import BwAsciiReport from . import waveform_codec as _wc @@ -1162,6 +1163,40 @@ def _sensor_check_results(chain: dict[int, bytes]) -> Optional[dict[str, SensorC return out or None +# The Monitor Log line Blastware prints for an event is the footer's start and +# stop, then words for the footer's flag word [18:20]: 69,983 / 69,983 DL2 +# lines, character for character (2026-11-08). Every DL2 line has "Event +# Recorded"; a session that ended adds how. One line sets Modem and Timer and +# prints Modem, so the higher bit wins -- the order of the others is inferred. +_MONITOR_LOG_RECORDED = 0x0001 +_MONITOR_LOG_ENDS = { # highest bit first + 0x0800: "Memory Full Exit", + 0x0200: "Battery Low Exit", + 0x0020: "Modem Exit", + 0x0010: "Timer Stop", + 0x0008: "Selfcheck Passed", + 0x0004: "Remote Exit", + 0x0002: "Keyboard Exit", +} +_FOOTER_ID = 0x0E +_FOOTER_LEN = 26 + + +def monitor_log_description(flags: int) -> str: + """Blastware's Monitor Log words for a footer flag word.""" + words = "Event Recorded " if flags & _MONITOR_LOG_RECORDED else "" + end = next((w for bit, w in _MONITOR_LOG_ENDS.items() if flags & bit), None) + return words + (" " + end if end else "") + + +def _monitor_log(footer: bytes) -> Optional[MonitorLogLine]: + start, stop = _bw._decode_ts_be(footer[2:10]), _bw._decode_ts_be(footer[10:18]) + if start is None or stop is None: + return None + flags = int.from_bytes(footer[18:20], "big") + return MonitorLogLine(start, stop, flags, monitor_log_description(flags)) + + def _parse_record_time_seconds(raw: bytes) -> Optional[float]: """The configured post-trigger record time in seconds, from the recording- setup config block, or None when absent / implausible.""" @@ -1457,12 +1492,13 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: body = raw[body_start : footer_pos] footer = raw[footer_pos : footer_pos + 26] - # Footer layout: + # Footer layout (the record chain's last record, id 0e: D.6.13): # [0:2] 0e 08 marker # [2:10] ts1 (start) BE 8B # [10:18] ts2 (stop) BE 8B - # [18:24] 00 01 00 02 00 00 - # [24:26] crc + # [18:20] the monitor log's flag word (_monitor_log) + # [20:22] the trigger source, as in the event record [22:24] 00 00 + # [24:26] not identified (no common CRC-16 or 16-bit sum fits) ts1 = _bw._decode_ts_be(footer[2:10]) ts2 = _bw._decode_ts_be(footer[10:18]) @@ -1664,6 +1700,10 @@ def decode_blastware_bytes(raw: bytes, *, name: Optional[str] = None) -> Event: _chain = _record_chain(raw, _record_at) if _record_at is not None else None _summary = _unit_summary(_chain) if _chain is not None else None ev.sensor_check_results = _sensor_check_results(_chain) if _chain is not None else None + # A whole chain ends at the file's last byte with the footer, so the last + # 26 bytes are proven to be it. + if _chain is not None and _FOOTER_ID in _chain: + ev.monitor_log = _monitor_log(raw[-_FOOTER_LEN:]) if _summary is not None and ev.peak_values is not None and ev.sample_rate: _apply_unit_summary(ev.peak_values, _summary, geo_fs, ev.sample_rate, ev.pretrig_samples if is_waveform_body else None) diff --git a/minimateplus/models.py b/minimateplus/models.py index 675ea7e..32d0d39 100644 --- a/minimateplus/models.py +++ b/minimateplus/models.py @@ -394,6 +394,17 @@ class SensorCheckResult: amplitude_mv: Optional[int] = None # the mic only +@dataclass +class MonitorLogLine: + """The Monitor Log line Blastware prints for an event, from the file's + footer (2026-11-08): the monitoring session's start, the stop, and what + happened. Not the live 0x0A browse entries (MonitorLogEntry).""" + start: datetime.datetime + stop: datetime.datetime + flags: int # the footer's flag word + description: str # Blastware's words, e.g. "Event Recorded Modem Exit" + + # ── Project / operator metadata ─────────────────────────────────────────────── @dataclass @@ -606,6 +617,9 @@ class Event: # And its results per channel, from the same records (2026-11-06): None # when the file's record chain is not whole. sensor_check_results: Optional[dict] = None # channel -> SensorCheckResult + # The event's Monitor Log line (2026-11-08): None unless the file's record + # chain is whole, which proves the footer. + monitor_log: Optional[MonitorLogLine] = None # Where `timestamp` came from, when decoded from a Blastware binary # (event_file_io): "event_record" -- the instrument's own event record in diff --git a/tests/fixtures/monitor-log-11-08-26/K559HCQ7.IU0H b/tests/fixtures/monitor-log-11-08-26/K559HCQ7.IU0H new file mode 100755 index 0000000000000000000000000000000000000000..72e9791148af64ffc9aca5cd97c363dd43970818 GIT binary patch literal 1752 zcma)+ZERCj7{{O6b=zIrd+)jJT_dvKStevK9qZQeG8xRh$i_OdusS{%KQ!xg)NCzj z%S-sQ#3+Uk;e$pcelSL&n26CYL^?H&1Tbq8UxEQ)NQX1L^|o7!jsd+s=XO)0`@nO0 z@9jA`&;R^?=Q;Nh;6?$uL(!N&6jO(x{3)=PK)-K?PcLxtHYX=Hb-i!}R#<=qX94bC z%>*VKG##yj_sXEHbEC(z5xU=yfir!`CId+CZy5!67CY>@)YaVI)U=`AwI0CLP`|zr z9xE?T{o@7`mkNIA8NI)DrJJ(DLO# zig6uX39nW0{kRtaeVzo59!H{WR@pgMKv_t*74bU^Dcn!4cZNOWhj@534cg z+#gdz0X0Ckhhu6K*iQdk3GQ0lK_5zDmxDf#pcX1kC7c<3L+jbM9|CM%_U^G@sNUGu zwFn$u1@6^2dq9oE9zE;cYH+W?EN?h8^ypaybXbSedxL{se3;-oG@^Bj=>m5dN n z4DbNYoGATlcQgo_KHi|!dRIgE4Aho_847nz=JF|!%T^Sh0a8Eir!ib8xzs7_SR}(*t^8LBTk$sAoFU1LyHLFx_5Q#ibYmw~ku}JTXf^ zs{qcue)!F?+mqj4yq21}e&gnCEi;q9`{&&Jg971Gj?R6wp~7Od38Ey)vfXZXI2;OI z4!c9P%S4ulB#NS76Kqzi)ncjOdA^Kz_XOG-Wps0OGMP*yCK6-ui8u!SNhT-LS|+3G zdNzw5x@3%Ml(ko*TroHq8yY4OK$f*uMgv{@VZ5bC;)NRSqCw)}JYb_$9GpFLfD)rm%H*cl2>}>vzxqJ5?5I*DR972i;t5ska5@GAGHH}~$LWor4u-Pou3Il`m zy`*-u*T_WDwR9RW7(qOK8Zjmki6nw(7zl#z9N7d5qH?tn_+YxIECV4N*ji0&;wu~^ zHWwLspw1*33@*+^c;wB3nbqUW!NW)5)0dJLu3r6hYWl{lI~jvy{{BNGv3KmFZmfqO zFbph)q9~Qv6vd&iiV(ERNCW{(QmhD;q^zur^!eIc6!c6wJ&BRHk{Fv98)GF&u!?9} zp`aJ^td4tbCT<3^SPlaWOG0E0LBK}Lz!fXfxtt4ZVF&=<;TzG*{+2YBtfXXiHaD9y zBA>&SZ{Q2s!I9RT8Teslr9z1)N>~WIu^+l^;6WC}nr~$3)CaF#r^@tf{yz%&uNusn zc4)Kj7*&2+B2y5wQ>Tf3JbvdoB{Mn00lLVe59UBG6bvV6e++wY=+ zaG=2~%Wr-AiHj=YWE%4q6c%=aDdfcNtr>XH>s&#NcZU&RI<7CUec%M4i~Rq-Bc=GAhjY*U1rf*dKL7v# literal 0 HcmV?d00001 diff --git a/tests/fixtures/monitor-log-11-08-26/K559HCQ7_IU0H_XML.XML b/tests/fixtures/monitor-log-11-08-26/K559HCQ7_IU0H_XML.XML new file mode 100755 index 0000000..cdb5691 --- /dev/null +++ b/tests/fixtures/monitor-log-11-08-26/K559HCQ7_IU0H_XML.XML @@ -0,0 +1,116 @@ + + +8.0 +Full Histogram +BE9559 +V 10.72-8.17 MiniMate Plus +K559HCQ7.IU0H +17:06:30 +2018-04-02 +17:07:47 +2018-04-02 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.8 Volts +July 24, 2017 by Instantel +in/s and dB(L) +JV 254 +Walsh Granite JV +TMI- DB +Keim Chevrolet + +10.000 +in/s + + +0.005 +in/s + + +0.005 +in/s + + +0.005 +in/s + + +>100 +Hz + + +>100 +Hz + + +>100 +Hz + +17:07:30 +2018-04-02 +17:07:30 +2018-04-02 +17:07:30 +2018-04-02 + +0.007 +in/s + +17:07:30 +2018-04-02 +Linear Weighting + +88.0 +dB(L) + +17:07:30 +2018-04-02 + +>100 +Hz + +7.7 Hz. +3.8 +Passed +7.6 Hz. +3.5 +Passed +7.5 Hz. +4.3 +Passed +20.1 Hz. +589 mv +Passed + + +2018-04-02 17:06:30 - 2018-04-02 17:07:47 "Event Recorded Remote Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.005>1000.005>1000.005>1000.0070.00087.96>100 + + + + + + diff --git a/tests/fixtures/monitor-log-11-08-26/T189INWA.060H b/tests/fixtures/monitor-log-11-08-26/T189INWA.060H new file mode 100755 index 0000000000000000000000000000000000000000..79f87b1d144c54b69bf64e43eb7ab2aefd427abc GIT binary patch literal 1524 zcma)+O>7%Q6vyAJ*Y?Ko$JkCHKozWuDkW`W8rx}2NZQcE60Mxbs?%IJS@x1Hxa-Q^ zQa~JXAaDUGY7f1D#DN29Bn0I|Y^j_O)OK2-_SD!(lNJ(+9j76XCdA8|O_OlQp>I4h zn(>=A?>GOMr9egjPAM5Rrl?X9%!k2cfauVfA+1iF#yR2ysHpIw1(*>FkeveH1T#(= z+Whdj2~LJOf*rwE;e96%?knaD;P~>yD8TDDVEtaTE9&l#l2m?TG5XV|Jy`_(0i(+B&38mm{O$-FpX}EL!cGUekdJNa7Z8m z4rqmD&Omr1hTfm9ZUP(+7mBjt)fIUKkLt!b2(+R1u#{GxeO22C1P2$eVZa4n0VsW{gPD-i6ZnxWP*2YGQr9lt` z8hKah_xqewt8Z3Hg+e};%}!>S+iMof2pwK?z|)h8X6dd zovEUW!ZO#>M*wz&xT&s-bz2v+*+e5!D6ro{YFfQqDix-4`Fu8?&E=Rd#o~0iRH-s$ z9Gb2S5ELAvqv{yX!&>Bc3PW^dpqIlN3|HfD^aKO2p-B2Cm;-HH!(2UqlU9*mf3i`h i{7b$gJU$ur5*D`f?BL)9yYTd-bnd(q1AYS`e*QnG(Q=Cb literal 0 HcmV?d00001 diff --git a/tests/fixtures/monitor-log-11-08-26/T189INWA_060H_XML.XML b/tests/fixtures/monitor-log-11-08-26/T189INWA_060H_XML.XML new file mode 100755 index 0000000..c9a84c6 --- /dev/null +++ b/tests/fixtures/monitor-log-11-08-26/T189INWA_060H_XML.XML @@ -0,0 +1,116 @@ + + +8.0 +Full Histogram +BE18189 +V 10.72-8.17 MiniMate Plus +T189INWA.060H +16:04:54 +2020-10-05 +16:06:09 +2020-10-05 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.8 Volts +August 25, 2020 by Instantel +in/s and dB(L) +CMU-New Scaife Hall- Porter Hall +PJ Dick Inc. +Terra-Mechanics, Inc. - D. Harrison +Loc. 3 - Porter Hall + +10.000 +in/s + + +0.005 +in/s + + +0.005 +in/s + + +0.005 +in/s + + +>100 +Hz + + +>100 +Hz + + +N/A +Hz + +16:05:54 +2020-10-05 +16:05:54 +2020-10-05 +16:05:54 +2020-10-05 + +0.009 +in/s + +16:05:54 +2020-10-05 +Linear Weighting + +106.5 +dB(L) + +16:05:54 +2020-10-05 + +73 +Hz + +7.6 Hz. +3.7 +Passed +7.6 Hz. +3.5 +Passed +7.4 Hz. +4.1 +Passed +0.0 Hz. +0 mv +Check + + +2020-10-05 16:04:53 - 2020-10-05 16:06:09 "Event Recorded Keyboard Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.005>1000.005>1000.005N/A0.0090.001106.573 + + + + + + diff --git a/tests/fixtures/monitor-log-11-08-26/T189JZY7.L60H b/tests/fixtures/monitor-log-11-08-26/T189JZY7.L60H new file mode 100755 index 0000000000000000000000000000000000000000..bac8a2fd6914498df4150e80bb90d99d1c2ad50a GIT binary patch literal 1850 zcma)+UrbY19LIm>Qs`~DrRTPYaiTfJxPT5up$sITfRM=shS2IB_SCdjtkzp?t5aDr zGEKI*Y;G=d*|LW%`UHu4S(XgQmTj3ap=HZ5_qRoiizt(}LhHyj>3-*4ahUkvk8|$1 zJ)HBszt8#p?xjG60J_yk)T>67AQ+zjTLHK|{hs_1kym#RS^Vt6+pyjYJct(*a_4~w9q%h}{?+5*R9Ai{Z^Cji!uwhaNa;}1SQtT(&s>zitvjR4Ntn#MX< zB^YP^&jvR>EX0Se=nbfWUT;)keZj+#`}CE78LTp)VZTr}(1H&|TeF%e+zM?q?0o>c)mG zjZLhY^@M!PiKDBo;VJxAgOkDbU_eoE!_%RlUs0JS9Pp|GK?Qb2lrY=rJ)ks$M+t|$ z)xC;uuU8HDBCK2W)u2d64cp-jhXaw23T`D3;p)wR7jHBWQrU(T55gR9LpS>8gRY}d zMfEFwwlfq}BB0rJs1RJ0=!YllRgs%OA6TIhkGg;uxQ}fY-@6O2wI>!2s5P2PPvY@? zxffhjxO%q|jz0RXssV6q!d*Qfb>Pu=)jSWb&A7Zb;OoIbfJ;z^xtoQ{dp zqJ3pMCJsgd&~ol)b7fBz%(OveAr|9OZmq#M1EsJ@9|#*OCMg_|1IJsW2IA1@G z7vbu0D68kIusAR_Vo`j8qu_Btnd^b|1-y2IJJnFu@W8w@$mgH=4q~_fD;|2_agxR< zAnl}`N|2!dl$8T~bMo~wU)-Ad{+BCPrmtPUar0Ixb32<`{QIAOsUcs%T!n>3(PS=` zEF~pYN~vt)VYk__;f-vQscfazk`jwWk|eX)Y%+;P+IK|h++N`znS5$)E*_hhm>3%y z$2L9|i^USj_*^QLTFU3GRxr>uLI{;*RC1u4jo)ZNWS|s_A3$sq@_B&l`!LzMOtV3- zYcw6CgBpN>$XUKVaq9H=Y$E54^Bg5q{I`)HHHkd3Fru%DTm3eI?uCEDWDuLCHishR#fIdnUL)iDYsvHI+{1@zgn03-=un95Ob%aL=((jR`G6 ze>jgjN%m~x5CGreJA$8A0fZ^x2S&3C_;)XIxooahTuOaBdf-SJ5;3-xQ5hX6!EV7S z;!!ICu~=SwPNrv1nKrW0>6!Ulc3A@VXLC7COc*u?bjr@ilk{sr+qS< zef7>7R(jK pZCphY;2KyDlI7yjHi5iLPWaz~$4bO|- + +8.0 +Full Histogram +BE18189 +V 10.72-8.17 MiniMate Plus +T189JZY7.L60H +20:00:42 +2023-04-27 +20:01:42 +2023-04-27 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +6.8 Volts +February 21, 2023 by Instantel +in/s and dB(L) +I-70 at SR 51-75978 - Loc 1 - 4256 SR51 +Golden Triangle +Terra-Mechanics Inc. - B. Harrison +Location #1 - 4256 SR 51 - Intec + +10.000 +in/s + + +0.015 +in/s + + +0.020 +in/s + + +0.015 +in/s + + +N/A +Hz + + +14 +Hz + + +N/A +Hz + +20:01:42 +2023-04-27 +20:01:42 +2023-04-27 +20:01:42 +2023-04-27 + +0.027 +in/s + +20:01:42 +2023-04-27 +Linear Weighting + +91.5 +dB(L) + +20:01:42 +2023-04-27 + +N/A +Hz + +7.6 Hz. +3.8 +Passed +7.6 Hz. +3.5 +Passed +7.5 Hz. +4.0 +Passed +19.7 Hz. +577 mv +Passed + + +2023-04-27 20:00:41 - 2023-04-27 20:01:42 "Event Recorded Battery Low Exit" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.015N/A0.020140.015N/A0.0270.00091.48N/A + + + + + + diff --git a/tests/fixtures/monitor-log-11-08-26/T192JWEL.0Y0H b/tests/fixtures/monitor-log-11-08-26/T192JWEL.0Y0H new file mode 100755 index 0000000000000000000000000000000000000000..b281f93e6d1edec8093f5a6d57778cf32b58e0bf GIT binary patch literal 1854 zcma)6U2qds6h1di$tF#+cbibHmU@H8w3W7L8irD-U~5N_wo`5Cj4#f_bb)BtbT%mp zK8TMB4P?O z3Ue|XT>%|k&8^KF{ScFYSWfW80OI?b_X9kJAAG!1YwK@mX>DxY0MP7f+~5b%Zo7Cp z8w|XY33p!66IQ}K!MM!&A|tU|aZ>@Pw*pwPZCZBnOrQir+a!TC~k_k>vss$qACMwP(k(t`apzQSZOICR;&eV`R<*YsC9R8EUYw|S~X!2{Rs%v z;p#zIjo*FLhu=V;9;3RW%Ferw`rtYQ9>(Q8;ZQdY7We`D-~fl^4EX~}F}K!10pO8i zrC$uk!m#PnR;{+X4x*=^wiFL#VNtT!F2Tw+hdEXv0-jB?U+PX&L8Tvz0wQz60|6_r zSza55$`BM)Z1?y{$y(U=U>wk6BlMKUYVQE==sHKf8Y3*3YpbiJDJaJ zcQ~Ccmq;mP7od;B|;DuJEH4^z!qd`7{@+>)9pnzJ+OwH zG}-uxpE{{dKqsskVDiwxBcETHJ$r6)YHH@v?3|X#<`@6Ee&e5;$kxpQ*3uP%U@t3k zmb;LTC{o=kJh)hJ6i!X+Zr6O$KaE~7Sjc7bbyd`_1v@o_jzKA1g{sNj#O3@@Z94pMSC%bjIqC=OTW-IsQ3 zALwZI5)ch-{%R_jP9{f@R5FnqOQpur<7urhuNg*$P(#PUdI^_=(u&ob4e&ki5=MD& zj(oOQP)PW!hwRwQ2>^VHf5>q@Eg31<#b`dCUszmNH2Z~IPWK5|uZ>krI`}R1)r`7% z%2ebDn!@-5ki`Ds8A+Tz5S(N*btQwA&E@mCY!(NfU>Jz`oTdfuS(9X*vul|Lj}ON% zjUr#4KqU97pDs}&@#VGij9$)SG=}TCp2Y`qFbcWciKAMkrbao!JT+^pP_3d~90uzq zag6W3x|*VfRGpe;R7V6f6NhJm7+PMN^K1IO{!Sb7)ZXtdRvt4k>+UKa@>wP6m6?eV z=6U+h)NDr2WblX3G@auV5f-*RTczoBGZ*R@WuD^kFGh + +8.0 +Full Histogram +BE18192 +V 10.72-8.17 MiniMate Plus +T192JWEL.0Y0H +21:58:10 +2023-02-17 +22:00:00 +2023-02-17 + +Tran +Vert +Long +MicL + +1.00 +1 minute +1024 sps +7.0 Volts +September 15, 2022 by Instantel +in/s and dB(L) +Trumbull-Berkeley By.-Loc 2-85 Pennsyl +Trumbull Corporation +Terra-Mechanics Inc - D Harrison +Loc #2- 85 Pennsylvania Lane + +10.000 +in/s + + +0.010 +in/s + + +0.010 +in/s + + +0.010 +in/s + + +>100 +Hz + + +>100 +Hz + + +>100 +Hz + +21:59:10 +2023-02-17 +21:59:10 +2023-02-17 +21:59:10 +2023-02-17 + +0.014 +in/s + +21:59:10 +2023-02-17 +Linear Weighting + +120.0 +dB(L) + +21:59:10 +2023-02-17 + +8.8 +Hz + +7.4 Hz. +4.1 +Passed +7.7 Hz. +3.6 +Passed +7.4 Hz. +4.2 +Passed +19.7 Hz. +688 mv +Passed + + +2023-02-17 21:58:09 - 2023-02-17 22:00:00 "Event Recorded Timer Stop" + + + Tran Peak in/s + Tran Freq Hz + Vert Peak in/s + Vert Freq Hz + Long Peak in/s + Long Freq Hz + Geo PVS in/s + MicL Peak psi(L) + MicL Peak dB(L) + MicL Freq Hz + + + + +0.010>1000.010>1000.010>1000.0140.003120.08.8 + + + + + + diff --git a/tests/test_bw_file_fields.py b/tests/test_bw_file_fields.py index c049752..c7b3c2e 100644 --- a/tests/test_bw_file_fields.py +++ b/tests/test_bw_file_fields.py @@ -658,3 +658,56 @@ def test_a_check_keeps_the_units_status_code(): # Tran is a Check at 8.1 Hz and 3.3, inside every passing range). got = read_blastware_file(_FIX / f"{_US}/K440HJCN.AS0W").sensor_check_results assert [got[ch].status for ch in ("Tran", "Vert", "Long", "MicL")] == [11, 2, 0, 0] + + +# ── Group F: the monitor log ──────────────────────────────────────────────── +# Blastware prints one Monitor Log line per event: the footer's start and stop, +# and words from the footer's flag word [18:20]. 69,983 / 69,983 DL2 lines, +# character for character (2026-11-08). Expected lines are Blastware's own, +# from each file's _XML.XML report. + +_ML = "monitor-log-11-08-26" + + +def _log_line(ml): + return f'{ml.start:%Y-%m-%d %H:%M:%S} - {ml.stop:%Y-%m-%d %H:%M:%S} "{ml.description}"' + + +@pytest.mark.parametrize("rel,line", [ + (f"{_US}/I145L6UJ.3Y0W", '2025-08-08 18:23:55 - 2025-08-08 18:24:01 "Event Recorded "'), + (f"{_US}/O117I1NK.R70W", '2019-07-31 06:59:31 - 2019-07-31 06:59:33 "Event Recorded "'), + (f"{_US}/T193HLJ3.X80H", '2018-09-20 20:07:55 - 2018-09-21 13:20:01 "Event Recorded Modem Exit"'), + (f"{_ML}/T189INWA.060H", '2020-10-05 16:04:53 - 2020-10-05 16:06:09 "Event Recorded Keyboard Exit"'), + (f"{_ML}/K559HCQ7.IU0H", '2018-04-02 17:06:30 - 2018-04-02 17:07:47 "Event Recorded Remote Exit"'), + (f"{_ML}/T192JWEL.0Y0H", '2023-02-17 21:58:09 - 2023-02-17 22:00:00 "Event Recorded Timer Stop"'), + (f"{_ML}/T189JZY7.L60H", '2023-04-27 20:00:41 - 2023-04-27 20:01:42 "Event Recorded Battery Low Exit"'), +]) +def test_the_monitor_log_is_the_footers(rel, line): + assert _log_line(read_blastware_file(_FIX / rel).monitor_log) == line + + +from minimateplus.event_file_io import monitor_log_description # noqa: E402 + + +@pytest.mark.parametrize("flags,words", [ + (0x0001, "Event Recorded "), + (0x0003, "Event Recorded Keyboard Exit"), + (0x0005, "Event Recorded Remote Exit"), + (0x0009, "Event Recorded Selfcheck Passed"), + (0x0011, "Event Recorded Timer Stop"), + (0x0021, "Event Recorded Modem Exit"), + (0x0201, "Event Recorded Battery Low Exit"), + (0x0801, "Event Recorded Memory Full Exit"), + # One DL2 line sets Modem and Timer; Blastware prints Modem: the higher + # bit wins (one file, so the order of the others is inferred). + (0x0031, "Event Recorded Modem Exit"), +]) +def test_the_monitor_log_words(flags, words): + assert monitor_log_description(flags) == words + + +def test_without_a_whole_record_chain_there_is_no_monitor_log(): + raw = bytearray((_FIX / f"{_US}/I145L6UJ.3Y0W").read_bytes()) + i = raw.find(b"\x00\xd4\x3c") + raw[i + 1] = 0xd3 # one byte short: the footer is not proven + assert decode_blastware_bytes(bytes(raw), name=None).monitor_log is None diff --git a/tests/test_decode_check.py b/tests/test_decode_check.py index 56ae130..8e8ea1a 100644 --- a/tests/test_decode_check.py +++ b/tests/test_decode_check.py @@ -416,3 +416,18 @@ def test_sensor_check_results_match_blastware(path): assert res[f].verdict == "match", (f, res[f]) checked += 1 assert checked >= 4 + + +# ── Group F: the monitor log (2026-11-08) ─────────────────────────────────── +_ML = FIX.parent / "monitor-log-11-08-26" + + +@pytest.mark.parametrize("path", [ + FIX / "R352HIUI.F40W", FIX / "T004JTRF.ME0H", FIX / "M529L4XQ.R30H", + _US / "K440HJCN.AS0W", _US / "O117I1NK.R70W", + _ML / "T189INWA.060H", _ML / "K559HCQ7.IU0H", _ML / "T192JWEL.0Y0H", _ML / "T189JZY7.L60H", +]) +def test_the_monitor_log_matches_blastware(path): + ref = parse_xml_report_file(path.with_name(path.name.replace(".", "_", 1) + "_XML.XML")) + res = {r.field: r for r in compare(sfm_side(path.read_bytes()), ref, CARVEOUTS)} + assert res["MonitorLog"].verdict == "match", res["MonitorLog"]