eive-tmtc/eive_tmtc/config/object_ids.py

180 lines
6.6 KiB
Python
Raw Normal View History

2021-03-19 17:39:52 +01:00
"""
@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.
"""
2023-02-01 11:17:04 +01:00
import logging
2022-03-04 11:56:42 +01:00
import os.path
2023-02-06 14:49:50 +01:00
from typing import Dict
2022-12-01 11:14:28 +01:00
2022-12-01 14:16:06 +01:00
from eive_tmtc import EIVE_TMTC_ROOT
2023-06-19 17:16:00 +02:00
from tmtccmd.util.obj_id import ObjectIdU32
from tmtccmd.fsfw import parse_fsfw_objects_csv
2022-03-04 11:56:42 +01:00
2022-12-01 11:14:28 +01:00
DEFAULT_OBJECTS_CSV_PATH = EIVE_TMTC_ROOT / "config/objects.csv"
2022-03-04 11:56:42 +01:00
__OBJECT_ID_DICT = None
2021-03-19 17:39:52 +01:00
2021-09-13 18:06:25 +02:00
# Core Object IDs
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x41, 0x00, 0xA2])
2021-09-13 18:06:25 +02:00
# Power Object IDs
PCDU_HANDLER_ID = bytes([0x44, 0x20, 0x00, 0xA1])
2021-06-24 16:42:58 +02:00
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])
2022-06-21 16:49:11 +02:00
SCEX_HANDLER_ID = bytes([0x44, 0x33, 0x00, 0x32])
2021-09-13 18:06:25 +02:00
# Thermal Object IDs
THERMAL_CONTROLLER_ID = bytes([0x43, 0x40, 0x00, 0x01])
HEATER_CONTROLLER_ID = bytes([0x44, 0x41, 0x00, 0xA4])
2023-02-06 14:27:00 +01:00
TMP1075_HANDLER_TCS_BRD_0_ID = bytes([0x44, 0x42, 0x00, 0x04])
TMP1075_HANDLER_TCS_BRD_1_ID = bytes([0x44, 0x42, 0x00, 0x05])
TMP1075_HANDLER_PLPCDU_0_ID = bytes([0x44, 0x42, 0x00, 0x06])
TMP1075_HANDLER_IF_BRD_ID = bytes([0x44, 0x42, 0x00, 0x08])
2021-09-13 18:06:25 +02:00
# Communication Object IDs
2021-12-02 09:25:31 +01:00
SYRLINKS_HANDLER_ID = bytes([0x44, 0x53, 0x00, 0xA3])
2021-09-13 18:06:25 +02:00
# ACS Object IDs
2022-05-19 13:58:43 +02:00
MGM_0_LIS3_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x06])
MGM_1_RM3100_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x07])
MGM_2_LIS3_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x08])
MGM_3_RM3100_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x09])
GYRO_0_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x00, 0x10])
GYRO_1_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x01, 0x11])
GYRO_2_ADIS_HANDLER_ID = bytes([0x44, 0x12, 0x02, 0x12])
GYRO_3_L3G_HANDLER_ID = bytes([0x44, 0x12, 0x03, 0x13])
2022-05-24 01:49:57 +02:00
GPS_CONTROLLER = bytes([0x44, 0x13, 0x00, 0x45])
2023-03-30 17:22:05 +02:00
GPS_0_HEALTH_DEV = bytes([0x44, 0x13, 0x00, 0x46])
GPS_1_HEALTH_DEV = bytes([0x44, 0x13, 0x00, 0x47])
2021-08-17 19:48:55 +02:00
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])
2021-09-13 18:06:25 +02:00
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])
2021-11-24 15:56:25 +01:00
CCSDS_HANDLER_ID = bytes([0x50, 0x00, 0x08, 0x00])
2022-04-27 16:43:38 +02:00
PDEC_HANDLER_ID = bytes([0x50, 0x00, 0x07, 0x00])
2021-09-13 18:06:25 +02:00
# Payload Object IDs
2021-08-16 10:03:40 +02:00
STAR_TRACKER_ID = bytes([0x44, 0x13, 0x00, 0x1])
RAD_SENSOR_ID = bytes([0x44, 0x32, 0x00, 0xA5])
2021-07-11 14:29:11 +02:00
PLOC_SUPV_ID = bytes([0x44, 0x33, 0x00, 0x16])
2021-08-31 11:17:01 +02:00
PLOC_MEMORY_DUMPER_ID = bytes([0x44, 0x33, 0x00, 0x01])
2021-12-02 08:01:18 +01:00
STR_IMG_HELPER_ID = bytes([0x44, 0x33, 0x00, 0x02])
2021-09-13 18:06:25 +02:00
PLOC_MPSOC_ID = bytes([0x44, 0x33, 0x00, 0x15])
2022-02-25 19:21:32 +01:00
PL_PCDU_ID = bytes([0x44, 0x30, 0x00, 0x00])
2022-05-05 14:30:28 +02:00
# Other
2023-03-09 16:30:24 +01:00
HEATER_0_PLOC_PROC_BRD = bytes([0x60, 0x00, 0x00, 0x00])
HEATER_1_PCDU_BRD = bytes([0x60, 0x00, 0x00, 0x01])
2022-05-05 14:30:28 +02:00
HEATER_2_ACS_BRD = bytes([0x60, 0x00, 0x00, 0x02])
2023-03-09 16:30:24 +01:00
HEATER_3_OBC_BRD = bytes([0x60, 0x00, 0x00, 0x03])
2022-05-05 14:30:28 +02:00
HEATER_4_CAMERA = bytes([0x60, 0x00, 0x00, 0x04])
HEATER_5_STR = bytes([0x60, 0x00, 0x00, 0x05])
HEATER_6_DRO = bytes([0x60, 0x00, 0x00, 0x06])
HEATER_7_SYRLINKS = bytes([0x60, 0x00, 0x00, 0x07])
2022-05-05 14:30:28 +02:00
2022-05-23 17:50:08 +02:00
# RTDs
RTD_0_PLOC_HSPD = bytes([0x44, 0x42, 0x00, 0x16])
2022-05-23 18:34:28 +02:00
RTD_1_PLOC_MISSIONBRD = bytes([0x44, 0x42, 0x00, 0x17])
2022-05-23 17:50:08 +02:00
RTD_2_4K_CAM = bytes([0x44, 0x42, 0x00, 0x18])
RTD_3_DAC_HSPD = bytes([0x44, 0x42, 0x00, 0x19])
RTD_4_STR = bytes([0x44, 0x42, 0x00, 0x20])
RTD_5_RW1_MX_MY = bytes([0x44, 0x42, 0x00, 0x21])
RTD_6_DRO = bytes([0x44, 0x42, 0x00, 0x22])
RTD_7_SCEX = bytes([0x44, 0x42, 0x00, 0x23])
RTD_8_X8 = bytes([0x44, 0x42, 0x00, 0x24])
RTD_9_HPA = bytes([0x44, 0x42, 0x00, 0x25])
RTD_10_PL_TX = bytes([0x44, 0x42, 0x00, 0x26])
RTD_11_MPA = bytes([0x44, 0x42, 0x00, 0x27])
RTD_12_ACU = bytes([0x44, 0x42, 0x00, 0x28])
RTD_13_PLPCDU_HSPD = bytes([0x44, 0x42, 0x00, 0x29])
RTD_14_TCS_BRD = bytes([0x44, 0x42, 0x00, 0x30])
RTD_15_IMTQ = bytes([0x44, 0x42, 0x00, 0x31])
2022-05-24 17:36:07 +02:00
# SUS
"""
Name convention for SUS devices
SUS_<IDX>_<N/R>_LOC_X<F/M/B>Y<F/M/B>Z<F/M/B>_PT_<DIR><F/B>
LOC: Location
PT: Pointing
N/R: Nominal/Redundant
F/M/B: Forward/Middle/Backwards
"""
SUS_0_N_LOC_XFYFZM_PT_XF = bytes([0x44, 0x12, 0x00, 0x32])
SUS_6_R_LOC_XFYBZM_PT_XF = bytes([0x44, 0x12, 0x00, 0x38])
SUS_1_N_LOC_XBYFZM_PT_XB = bytes([0x44, 0x12, 0x00, 0x33])
SUS_7_R_LOC_XBYBZM_PT_XB = bytes([0x44, 0x12, 0x00, 0x39])
SUS_2_N_LOC_XFYBZB_PT_YB = bytes([0x44, 0x12, 0x00, 0x34])
SUS_8_R_LOC_XBYBZB_PT_YB = bytes([0x44, 0x12, 0x00, 0x40])
SUS_3_N_LOC_XFYBZF_PT_YF = bytes([0x44, 0x12, 0x00, 0x35])
SUS_9_R_LOC_XBYBZB_PT_YF = bytes([0x44, 0x12, 0x00, 0x41])
SUS_4_N_LOC_XMYFZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x36])
2022-05-25 11:10:57 +02:00
SUS_10_R_LOC_XMYBZF_PT_ZF = bytes([0x44, 0x12, 0x00, 0x42])
2022-05-24 17:36:07 +02:00
SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37])
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
# System and Assembly Objects
2023-02-12 18:56:59 +01:00
EIVE_SYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x00])
2022-10-04 14:46:00 +02:00
ACS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x01])
2022-11-03 22:16:10 +01:00
PL_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x02])
2023-01-20 11:28:07 +01:00
TCS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x03])
2023-01-27 15:42:00 +01:00
COM_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x04])
# Legacy names, kept for backwards compatibility
ACS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x01])
2022-03-22 19:29:55 +01:00
TCS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x03])
SUS_BOARD_ASS_ID = bytes([0x73, 0x00, 0x00, 0x02])
IMTQ_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x08])
ACS_BOARD_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x01])
SUS_BOARD_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x02])
TCS_BOARD_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x03])
2022-05-05 01:21:57 +02:00
RW_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x04])
2023-03-07 10:03:22 +01:00
CAM_SWITCHER = bytes([0x73, 0x00, 0x00, 0x06])
SYRLINKS_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x07])
2023-03-07 10:06:58 +01:00
# To be removed soon..
MGT_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x08])
2023-03-07 10:03:22 +01:00
STR_ASSEMBLY = bytes([0x73, 0x00, 0x00, 0x09])
2022-08-11 19:12:27 +02:00
# Controllers
TCS_CONTROLLER = bytes([0x43, 0x40, 0x00, 0x01])
2022-08-16 11:56:06 +02:00
ACS_CONTROLLER = bytes([0x43, 0x00, 0x00, 0x02])
2022-08-11 19:12:27 +02:00
CORE_CONTROLLER_ID = bytes([0x43, 0x00, 0x00, 0x03])
2023-02-07 14:42:53 +01:00
MISC_TM_STORE = bytes([0x73, 0x02, 0x00, 0x01])
OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x02])
NOT_OK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x03])
HK_TM_STORE = bytes([0x73, 0x02, 0x00, 0x04])
CFDP_TM_STORE = bytes([0x73, 0x03, 0x00, 0x00])
2021-03-19 17:39:52 +01:00
2023-02-06 14:49:50 +01:00
ObjectIdDict = Dict[bytes, ObjectIdU32]
def get_object_ids() -> ObjectIdDict:
2022-03-04 11:56:42 +01:00
global __OBJECT_ID_DICT
2022-03-04 14:27:19 +01:00
if not os.path.exists(DEFAULT_OBJECTS_CSV_PATH):
2023-02-01 15:58:34 +01:00
logging.getLogger(__name__).warning(
f"No Objects CSV file found at {DEFAULT_OBJECTS_CSV_PATH}"
)
2022-03-04 14:27:19 +01:00
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()
2022-03-04 11:56:42 +01:00
return __OBJECT_ID_DICT