From 6cd1e794f7352d8c18fa2e2b8adf49c8e41ceba9 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 6 Feb 2022 22:33:09 -0500 Subject: [PATCH] logextract: Breakup shutdown parsing into classes Separate out message parsing into individual classes. This should make the code a little eaiser to understand. Signed-off-by: Kevin O'Connor --- scripts/logextract.py | 367 +++++++++++++++++++++++++----------------- 1 file changed, 216 insertions(+), 151 deletions(-) diff --git a/scripts/logextract.py b/scripts/logextract.py index 5d86cdce..937c68ec 100755 --- a/scripts/logextract.py +++ b/scripts/logextract.py @@ -148,22 +148,69 @@ class TMCUartHelper: # Shutdown extraction ###################################################################### -stats_seq_s = r" send_seq=(?P[0-9]+) receive_seq=(?P[0-9]+) " +def add_high_bits(val, ref, mask): + half = (mask + 1) // 2 + return ref + ((val - (ref & mask) + half) & mask) - half + count_s = r"(?P[0-9]+)" time_s = r"(?P