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
5 changed files with 42 additions and 24 deletions

View File

@ -10,6 +10,11 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
## Changed
- Updated ACS SS commands for OBSW ACS SS update.
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/130
## Fixed ## Fixed
- Fixed parsing of processed GPS data - Fixed parsing of processed GPS data

View File

@ -84,7 +84,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
10800;0x2a30;STORE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 10800;0x2a30;STORE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h
10801;0x2a31;MSG_QUEUE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 10801;0x2a31;MSG_QUEUE_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h
10802;0x2a32;SERIALIZATION_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h 10802;0x2a32;SERIALIZATION_ERROR;LOW;;fsfw/src/fsfw/cfdp/handler/defs.h
11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;;mission/controller/AcsController.h 11200;0x2bc0;SAFE_RATE_VIOLATION;MEDIUM;;mission/acsDefs.h
11201;0x2bc1;SAFE_RATE_RECOVERY;MEDIUM;;mission/acsDefs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h 11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/devices/devicedefinitions/powerDefinitions.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h 11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;;mission/devices/devicedefinitions/powerDefinitions.h

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
84 10800 0x2a30 STORE_ERROR LOW fsfw/src/fsfw/cfdp/handler/defs.h
85 10801 0x2a31 MSG_QUEUE_ERROR LOW fsfw/src/fsfw/cfdp/handler/defs.h
86 10802 0x2a32 SERIALIZATION_ERROR LOW fsfw/src/fsfw/cfdp/handler/defs.h
87 11200 0x2bc0 SAFE_RATE_VIOLATION MEDIUM mission/controller/AcsController.h mission/acsDefs.h
88 11201 0x2bc1 SAFE_RATE_RECOVERY MEDIUM mission/acsDefs.h
89 11300 0x2c24 SWITCH_CMD_SENT INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
90 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/devices/devicedefinitions/powerDefinitions.h
91 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM mission/devices/devicedefinitions/powerDefinitions.h

View File

@ -56,16 +56,13 @@ def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
if info.name == "MODE_INFO": if info.name == "MODE_INFO":
mode_name = "Unknown" mode_name = "Unknown"
if obj_name == "ACS_SUBSYSTEM": if obj_name == "ACS_SUBSYSTEM":
if event_def.param1 == Mode.OFF: acs_mode = AcsMode(event_def.param1)
mode_name = "Off" pw.dlog(f"ACS Mode: {acs_mode!r}")
elif event_def.param1 == AcsMode.IDLE: elif obj_name == "ACS_CONTROLLER_ID":
mode_name = "Idle" mode_name = Mode(event_def.param1)
elif event_def.param1 == AcsMode.DETUMBLE: submode = AcsMode(event_def.param2)
mode_name = "Detumble" pw.dlog(f"Mode: {mode_name!r}")
elif event_def.param1 == AcsMode.SAFE: pw.dlog(f"ACS Mode: {submode!r}")
mode_name = "Safe"
elif event_def.param1 == AcsMode.TARGET_PT:
mode_name = "Target Pointing"
else: else:
if event_def.param1 == Mode.OFF: if event_def.param1 == Mode.OFF:
mode_name = "Off" mode_name = "Off"
@ -75,8 +72,8 @@ def handle_event_packet(raw_tm: bytes, printer: FsfwTmTcPrinter):
mode_name = "Normal" mode_name = "Normal"
elif event_def.param1 == Mode.RAW: elif event_def.param1 == Mode.RAW:
mode_name = "Raw" mode_name = "Raw"
pw.dlog(f"Mode Number {event_def.param1}, Mode Name {mode_name}") pw.dlog(f"Mode Number {event_def.param1}, Mode Name {mode_name}")
pw.dlog(f"Submode: {event_def.param2}") pw.dlog(f"Submode: {event_def.param2}")
elif info.name == "CLOCK_SET": elif info.name == "CLOCK_SET":
old_time = event_def.param1 old_time = event_def.param1
new_time = event_def.param2 new_time = event_def.param2

View File

@ -21,6 +21,7 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid, make_sid,
enable_periodic_hk_command_with_interval, enable_periodic_hk_command_with_interval,
disable_periodic_hk_command, disable_periodic_hk_command,
create_request_one_diag_command,
) )
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
@ -286,7 +287,9 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
elif op_code in OpCodes.REQUEST_PROC_GYR_HK: elif op_code in OpCodes.REQUEST_PROC_GYR_HK:
q.add_log_cmd(Info.REQUEST_PROC_GYR_HK) q.add_log_cmd(Info.REQUEST_PROC_GYR_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)) create_request_one_diag_command(
make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
)
) )
elif op_code in OpCodes.ENABLE_PROC_GYR_HK: elif op_code in OpCodes.ENABLE_PROC_GYR_HK:
q.add_log_cmd(Info.ENABLE_PROC_GYR_HK) q.add_log_cmd(Info.ENABLE_PROC_GYR_HK)

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 = 3
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)