better mode printout

This commit is contained in:
Robin Müller 2022-10-11 14:24:13 +02:00
parent ebb0ddf399
commit 61317e695c
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -3,6 +3,7 @@ import os.path
from datetime import datetime
from config.object_ids import get_object_ids
from pus_tm.defs import PrintWrapper
from tmtc.acs_subsystem import AcsModes
from tmtccmd.tc.pus_200_fsfw_modes import Modes
from tmtccmd.tm import Service5Tm
@ -60,19 +61,29 @@ def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
pw.dlog(additional_event_info)
pw.dlog(context)
if info.name == "MODE_INFO":
if obj_name == "ACS_SUBSYSTEM":
pass
mode_name = "Unknown"
if tm.param_1 == Modes.OFF:
mode_name = "Off"
elif tm.param_1 == Modes.ON:
mode_name = "On"
elif tm.param_1 == Modes.NORMAL:
mode_name = "Normal"
elif tm.param_1 == Modes.RAW:
mode_str = "Raw"
# pw.dlog(f"Mode: {tm.param_1}{mode_str}")
# pw.dlog(f"Submode: {tm.param_2}{submode_str}")
if obj_name == "ACS_SUBSYSTEM":
if tm.param_1 == Modes.OFF:
mode_name = "Off"
elif tm.param_1 == AcsModes.IDLE:
mode_name = "Idle"
elif tm.param_1 == AcsModes.DETUMBLE:
mode_name = "Detumble"
elif tm.param_1 == AcsModes.SAFE:
mode_name = "Safe"
elif tm.param_1 == AcsModes.TARGET_PT:
mode_name = "Target Pointing"
else:
if tm.param_1 == Modes.OFF:
mode_name = "Off"
elif tm.param_1 == Modes.ON:
mode_name = "On"
elif tm.param_1 == Modes.NORMAL:
mode_name = "Normal"
elif tm.param_1 == Modes.RAW:
mode_name = "Raw"
pw.dlog(f"Mode Number {tm.param_1}, Mode Name {mode_name}")
pw.dlog(f"Submode: {tm.param_2}")
else:
specific_handler = False
if info.info != "":