85 lines
3.1 KiB
Python
85 lines
3.1 KiB
Python
"""
|
|
@brief This file transfers control of the object IDs to the user.
|
|
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
|
|
it to your needs.
|
|
"""
|
|
import os.path
|
|
from tmtccmd.pus.obj_id import ObjectIdDictT
|
|
from tmtccmd.utility.fsfw import parse_fsfw_objects_csv
|
|
from tmtccmd.utility.logger import get_console_logger
|
|
|
|
LOGGER = get_console_logger()
|
|
DEFAULT_OBJECTS_CSV_PATH = "config/objects.csv"
|
|
__OBJECT_ID_DICT = None
|
|
|
|
|
|
# Core Object IDs
|
|
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
|
|
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2])
|
|
|
|
# Power Object IDs
|
|
PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
|
|
P60_DOCK_HANDLER = bytes([0x44, 0x25, 0x00, 0x00])
|
|
PDU_1_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x01])
|
|
PDU_2_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x02])
|
|
ACU_HANDLER_ID = bytes([0x44, 0x25, 0x00, 0x03])
|
|
BPX_HANDLER_ID = bytes([0x44, 0x26, 0x00, 0x00])
|
|
|
|
# Thermal Object IDs
|
|
HEATER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
|
|
TMP_1075_1_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x04])
|
|
TMP_1075_2_HANDLER_ID = bytes([0x44, 0x42, 0x00, 0x05])
|
|
|
|
# Communication Object IDs
|
|
SYRLINKS_HANDLER_ID = bytes([0x44, 0x53, 0x00, 0xA3])
|
|
|
|
# ACS Object IDs
|
|
MGM_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
|
|
MGM_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
|
|
MGM_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
|
|
MGM_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
|
|
GYRO_0_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
|
|
GYRO_1_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
|
|
GYRO_2_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
|
|
GYRO_3_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
|
|
GPS_HANDLER_0_ID = bytes([0x44, 0x13, 0x00, 0x45])
|
|
GPS_HANDLER_1_ID = bytes([0x44, 0x13, 0x01, 0x46])
|
|
RW1_ID = bytes([0x44, 0x12, 0x00, 0x47])
|
|
RW2_ID = bytes([0x44, 0x12, 0x01, 0x48])
|
|
RW3_ID = bytes([0x44, 0x12, 0x02, 0x49])
|
|
RW4_ID = bytes([0x44, 0x12, 0x03, 0x50])
|
|
IMTQ_HANDLER_ID = bytes([0x44, 0x14, 0x00, 0x14])
|
|
|
|
# Misc Object IDs
|
|
PUS_SERVICE_17_ID = bytes([0x53, 0x00, 0x00, 0x17])
|
|
TEST_DEVICE_ID = bytes([0x54, 0x00, 0xAF, 0xFE])
|
|
CCSDS_HANDLER_ID = bytes([0x50, 0x00, 0x08, 0x00])
|
|
PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x04])
|
|
|
|
# Payload Object IDs
|
|
STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
|
|
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
|
|
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
|
|
PLOC_UPDATER_ID = bytes([0x44, 0x33, 0x00, 0x00])
|
|
PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
|
|
STR_IMG_HELPER_ID = bytes([0x44, 0x33, 0x00, 0x02])
|
|
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
|
|
PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00])
|
|
|
|
# System and Assembly Objects
|
|
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
|
|
SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
|
|
TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
|
|
|
|
|
|
def get_object_ids() -> ObjectIdDictT:
|
|
global __OBJECT_ID_DICT
|
|
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
|
LOGGER.warning(f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}")
|
|
if __OBJECT_ID_DICT is None:
|
|
if os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
|
|
__OBJECT_ID_DICT = parse_fsfw_objects_csv(csv_file=DEFAULT_OBJECTS_CSV_PATH)
|
|
else:
|
|
__OBJECT_ID_DICT = dict()
|
|
return __OBJECT_ID_DICT
|