Merge pull request 'New ACS Ctrl Act Cmd' (#278) from acs-ctrl-new-stuff into main
All checks were successful
EIVE/-/pipeline/head This commit looks good

Reviewed-on: #278
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
This commit is contained in:
Robin Müller 2024-02-29 12:34:50 +01:00
commit 6ade001d3d
2 changed files with 12 additions and 39 deletions

View File

@ -14,6 +14,7 @@ list yields a list of all related PRs for each release.
- Added commands to unlock and use STR secondary firmware slot.
- STR BlobStats TM handling
- New ACS CTRL commands.
## Fixed

View File

@ -72,6 +72,7 @@ class ActionId(enum.IntEnum):
RESTORE_MEKF_NONFINITE_RECOVERY = 2
UPDATE_TLE = 3
READ_TLE = 4
UPDATE_MEKF_STANDARD_DEVIATIONS = 5
CTRL_STRAT_DICT = {
@ -126,6 +127,7 @@ class OpCodes:
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
UPDATE_TLE = "update_tle"
READ_TLE = "read_tle"
UPDATE_MEKF_STANDARD_DEVIATIONS = "update_mekf_standard_deviations"
SET_PARAMETER_SCALAR = "set_scalar_param"
SET_PARAMETER_VECTOR = "set_vector_param"
SET_PARAMETER_MATRIX = "set_matrix_param"
@ -148,6 +150,10 @@ class Info:
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
UPDATE_TLE = "Update TLE"
READ_TLE = "Read the currently stored TLE"
UPDATE_MEKF_STANDARD_DEVIATIONS = (
"Update the Standard Deviations within the MEKF to the current ACS Parameter "
"Values"
)
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
SET_PARAMETER_VECTOR = "Set Vector Parameter"
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
@ -183,36 +189,6 @@ def create_acs_ctrl_node() -> CmdTreeNode:
return acs_ctrl
@tmtc_definitions_provider
def acs_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.OFF, info=Info.OFF)
oce.add(keys=OpCodes.SAFE, info=Info.SAFE)
oce.add(keys=OpCodes.DTBL, info=Info.DTBL)
oce.add(keys=OpCodes.IDLE, info=Info.IDLE)
oce.add(keys=OpCodes.NADIR, info=Info.NADIR)
oce.add(keys=OpCodes.TARGET, info=Info.TARGET)
oce.add(keys=OpCodes.GS, info=Info.GS)
oce.add(keys=OpCodes.INERTIAL, info=Info.INERTIAL)
oce.add(keys=OpCodes.SAFE_PTG, info=Info.SAFE_PTG)
oce.add(keys=OpCodes.RESET_MEKF, info=Info.RESET_MEKF)
oce.add(
keys=OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY,
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
)
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE)
oce.add(keys=OpCodes.READ_TLE, info=Info.READ_TLE)
oce.add(keys=OpCodes.SET_PARAMETER_SCALAR, info=Info.SET_PARAMETER_SCALAR)
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR)
oce.add(keys=OpCodes.SET_PARAMETER_MATRIX, info=Info.SET_PARAMETER_MATRIX)
oce.add(keys=OpCodes.ONE_SHOOT_HK, info=Info.ONE_SHOOT_HK)
oce.add(keys=OpCodes.ENABLE_HK, info=Info.ENABLE_HK)
oce.add(keys=OpCodes.DISABLE_HK, info=Info.DISABLE_HK)
defs.add_service(
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce
)
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
if cmd_str in OpCodes.OFF:
q.add_log_cmd(f"{Info.OFF}")
@ -273,18 +249,14 @@ def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
print("The line does not have the required length of 69 characters")
tle = line1.encode() + line2.encode()
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
elif cmd_str in OpCodes.SET_PARAMETER_SCALAR:
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
set_acs_ctrl_param_scalar(q)
elif cmd_str in OpCodes.SET_PARAMETER_VECTOR:
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
set_acs_ctrl_param_vector(q)
elif cmd_str in OpCodes.SET_PARAMETER_MATRIX:
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
set_acs_ctrl_param_matrix(q)
elif cmd_str == OpCodes.READ_TLE:
q.add_log_cmd(f"{Info.READ_TLE}")
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
elif cmd_str == OpCodes.UPDATE_MEKF_STANDARD_DEVIATIONS:
q.add_log_cmd(f"{Info.UPDATE_MEKF_STANDARD_DEVIATIONS}")
q.add_pus_tc(
create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_MEKF_STANDARD_DEVIATIONS)
)
elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
set_acs_ctrl_param_scalar(q)