From 820bd9e4288589e3661b3852fe892ca328e2f77f Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 22 Aug 2022 10:42:51 +0200 Subject: [PATCH] special event handling --- pus_tm/event_handler.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pus_tm/event_handler.py b/pus_tm/event_handler.py index f460659..553780b 100644 --- a/pus_tm/event_handler.py +++ b/pus_tm/event_handler.py @@ -47,10 +47,16 @@ def handle_event_packet( generic_event_string = ( f"Object {obj_name} generated Event {tm.event_id} | {info.name}" ) - if info.info != "": + if info.name == "SUPV_UPDATE_PROGRESS": additional_event_info = ( - f"Additional info: {info.info} | P1: {tm.param_1} | P2: {tm.param_2}" + f"Additional info: {info.info} | " + f"Percent: {tm.param_1 >> 24 & 0xff} | Sequence Count: {tm.param_1 & 0xffff} | Bytes Written: {tm.param_2}" ) + else: + if info.info != "": + additional_event_info = ( + f"Additional info: {info.info} | P1: {tm.param_1} | P2: {tm.param_2}" + ) file_logger.info( f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}: {generic_event_string}" )