that should do the job

This commit is contained in:
Robin Müller 2022-12-01 11:14:28 +01:00
parent c421f3f5d7
commit 140c827ce7
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 39 additions and 20 deletions

View File

@ -9,6 +9,10 @@ import enum
from spacepackets import PacketType
from spacepackets.ccsds import PacketId
from spacepackets.util import UnsignedByteField
from pathlib import Path
EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
PUS_APID = 0x65
CFDP_APID = 0x66

View File

@ -0,0 +1,21 @@
import os
from eive_tmtc.config.definitions import EIVE_TMTC_ROOT
from tmtccmd import get_console_logger
from tmtccmd.fsfw import parse_fsfw_events_csv
from tmtccmd.pus.pus_5_event import EventDictT
LOGGER = get_console_logger()
DEFAULT_EVENTS_CSV_PATH = EIVE_TMTC_ROOT / "/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

View File

@ -4,13 +4,15 @@
it to your needs.
"""
import os.path
from eive_tmtc.config.definitions import EIVE_TMTC_ROOT
from tmtccmd.util.obj_id import ObjectIdDictT
from tmtccmd.fsfw import parse_fsfw_objects_csv
from tmtccmd.logging import get_console_logger
LOGGER = get_console_logger()
DEFAULT_OBJECTS_CSV_PATH = "eive_tmtc/config/objects.csv"
DEFAULT_OBJECTS_CSV_PATH = EIVE_TMTC_ROOT / "config/objects.csv"
__OBJECT_ID_DICT = None

View File

@ -1,8 +1,10 @@
import os
from eive_tmtc.config.definitions import EIVE_TMTC_ROOT
from tmtccmd.fsfw import parse_fsfw_returnvalues_csv, RetvalDictT
from tmtccmd.logging import get_console_logger
DEFAULT_RETVAL_CSV_NAME = "eive_tmtc/config/returnvalues.csv"
DEFAULT_RETVAL_CSV_NAME = EIVE_TMTC_ROOT / "config/returnvalues.csv"
__RETVAL_DICT = None
LOGGER = get_console_logger()

View File

@ -33,7 +33,11 @@ from eive_tmtc.pus_tc.devs.gps import SetIds as GpsSetIds
from eive_tmtc.tmtc.acs.imtq import ImtqSetIds
from eive_tmtc.pus_tc.devs.sus import SetIds
from eive_tmtc.pus_tc.devs.star_tracker import SetIds as StrSetIds
from eive_tmtc.tmtc.acs.reaction_wheels import RwSetIds, rw_speed_up_cmd_consec, rw_speed_down_cmd_consec
from eive_tmtc.tmtc.acs.reaction_wheels import (
RwSetIds,
rw_speed_up_cmd_consec,
rw_speed_down_cmd_consec,
)
from eive_tmtc.pus_tc.system.controllers import (
pack_cmd_ctrl_to_off,
pack_cmd_ctrl_to_nml,

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):