continuing printout handling refactoring
This commit is contained in:
@ -21,6 +21,7 @@ from tmtccmd.tm.service_200_fsfw_mode import Service200FsfwTm
|
||||
from tmtccmd.utility.tmtc_printer import PrintFormats, FsfwTmTcPrinter
|
||||
|
||||
from config.definitions import PUS_APID
|
||||
from config.object_ids import get_object_ids
|
||||
from .event_handler import handle_event_packet
|
||||
from .verification_handler import handle_service_1_packet
|
||||
from .hk_handling import handle_hk_packet
|
||||
@ -44,6 +45,7 @@ def pus_factory_hook(raw_tm_packet: bytes):
|
||||
subservice_type = raw_tm_packet[8]
|
||||
tm_packet = None
|
||||
file_logger = FSFW_PRINTER.file_logger
|
||||
obj_id_dict = get_object_ids()
|
||||
try:
|
||||
if service_type == 1:
|
||||
handle_service_1_packet(printer=FSFW_PRINTER, raw_tm=raw_tm_packet)
|
||||
@ -51,7 +53,15 @@ def pus_factory_hook(raw_tm_packet: bytes):
|
||||
tm_packet = Service3FsfwTm.unpack(
|
||||
raw_telemetry=raw_tm_packet, custom_hk_handling=False
|
||||
)
|
||||
handle_hk_packet(hk_packet=tm_packet, packet_if=tm_packet)
|
||||
named_obj_id = obj_id_dict.get(tm_packet.object_id.as_bytes)
|
||||
if named_obj_id is None:
|
||||
named_obj_id = tm_packet.object_id
|
||||
handle_hk_packet(
|
||||
printer=FSFW_PRINTER,
|
||||
object_id=named_obj_id,
|
||||
hk_packet=tm_packet,
|
||||
packet_if=tm_packet
|
||||
)
|
||||
elif service_type == 5:
|
||||
tm_packet = Service5Tm.unpack(raw_telemetry=raw_tm_packet)
|
||||
handle_event_packet(file_logger=file_logger, tm=tm_packet)
|
||||
|
Reference in New Issue
Block a user