update ACS SS commands #130

Merged
muellerr merged 5 commits from update_acs_ss_cmds into main 2023-02-03 14:21:42 +01:00
Showing only changes of commit d9c202c68e - Show all commits

View File

@ -20,16 +20,22 @@ class OpCode(str, enum.Enum):
SAFE = "safe" SAFE = "safe"
DETUMBLE = "detumble" DETUMBLE = "detumble"
IDLE = "idle" IDLE = "idle"
TARGET_PT = "target" PTG_TARGET = "ptg_target"
PTG_TARGET_NADIR = "ptg_nadir"
PTG_TARGET_GS = "ptg_target_gs"
PTG_TARGET_INERTIAL = "ptg_inertial"
REPORT_ALL_MODES = "all_modes" REPORT_ALL_MODES = "all_modes"
class AcsMode(enum.IntEnum): class AcsMode(enum.IntEnum):
OFF = 0 OFF = 0
SAFE = 1 << 24 SAFE = 2
DETUMBLE = 2 << 24 DETUMBLE = 2
IDLE = 3 << 24 IDLE = 4
TARGET_PT = 4 << 24 PTG_TARGET_NADIR = 5
PTG_TARGET = 6
PTG_TARGET_GS = 7
PTG_TARGET_INERTIAL = 8
class Info(str, enum.Enum): class Info(str, enum.Enum):
@ -37,15 +43,22 @@ class Info(str, enum.Enum):
SAFE = "Safe Mode Command" SAFE = "Safe Mode Command"
DETUMBLE = "Detumble Mode Command" DETUMBLE = "Detumble Mode Command"
IDLE = "Idle Mode Command" IDLE = "Idle Mode Command"
TARGET_PT = "Target Pointing Mode Command" PTG_TARGET_NADIR = "Target Pointing Nadir"
PTG_TARGET = "Target Pointing"
PTG_TARGET_GS = "Target Pointing Ground Station"
PTG_TARGET_INERTIAL = "Target Pointing Inertial"
REPORT_ALL_MODES = "Report All Modes Recursively" REPORT_ALL_MODES = "Report All Modes Recursively"
HANDLER_LIST: Dict[str, Tuple[int, str]] = { HANDLER_LIST: Dict[str, Tuple[int, str]] = {
OpCode.OFF: (AcsMode.OFF, Info.OFF), OpCode.OFF: (AcsMode.OFF, Info.OFF),
OpCode.IDLE: (AcsMode.IDLE, Info.IDLE),
OpCode.SAFE: (AcsMode.SAFE, Info.SAFE), OpCode.SAFE: (AcsMode.SAFE, Info.SAFE),
OpCode.DETUMBLE: (AcsMode.DETUMBLE, Info.DETUMBLE), OpCode.DETUMBLE: (AcsMode.DETUMBLE, Info.DETUMBLE),
OpCode.IDLE: (AcsMode.IDLE, Info.IDLE),
OpCode.PTG_TARGET: (AcsMode.PTG_TARGET, Info.PTG_TARGET),
OpCode.PTG_TARGET_GS: (AcsMode.PTG_TARGET_GS, Info.PTG_TARGET_GS),
OpCode.PTG_TARGET_NADIR: (AcsMode.PTG_TARGET_NADIR, Info.PTG_TARGET_NADIR),
OpCode.PTG_TARGET_INERTIAL: (AcsMode.PTG_TARGET_INERTIAL, Info.PTG_TARGET_INERTIAL),
} }
@ -78,8 +91,7 @@ def build_acs_subsystem_cmd(p: ServiceProviderParams):
@tmtc_definitions_provider @tmtc_definitions_provider
def add_acs_subsystem_cmds(defs: TmtcDefinitionWrapper): def add_acs_subsystem_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry() oce = OpCodeEntry()
oce.add(OpCode.OFF, Info.OFF) for op_code, (_, info) in HANDLER_LIST.items():
oce.add(OpCode.SAFE, Info.SAFE) oce.add(op_code, info)
oce.add(OpCode.IDLE, Info.IDLE)
oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES) oce.add(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
defs.add_service(CustomServiceList.ACS_SS, "ACS Subsystem", oce) defs.add_service(CustomServiceList.ACS_SS, "ACS Subsystem", oce)