that should do the job

This commit is contained in:
2022-12-01 11:14:28 +01:00
parent c421f3f5d7
commit 140c827ce7
6 changed files with 39 additions and 20 deletions

View File

@ -1,6 +1,6 @@
import logging
import os.path
from datetime import datetime
from eive_tmtc.config.events import get_event_dict
from eive_tmtc.config.object_ids import get_object_ids
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.pus_tm.verification_handler import generic_retval_printout
@ -10,23 +10,9 @@ from tmtccmd.tc.pus_200_fsfw_modes import Modes
from tmtccmd.tm import Service5Tm
from tmtccmd.logging import get_console_logger
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw import parse_fsfw_events_csv, EventDictT, EventInfo
from tmtccmd.fsfw import EventInfo
LOGGER = get_console_logger()
DEFAULT_EVENTS_CSV_PATH = "eive_tmtc/config/events.csv"
__EVENT_DICT = None
def get_event_dict() -> EventDictT:
global __EVENT_DICT
if __EVENT_DICT is None:
if os.path.exists(DEFAULT_EVENTS_CSV_PATH):
__EVENT_DICT = parse_fsfw_events_csv(DEFAULT_EVENTS_CSV_PATH)
else:
LOGGER.warning(f"No Event CSV file found at {DEFAULT_EVENTS_CSV_PATH}")
__EVENT_DICT = dict()
return __EVENT_DICT
def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):