New ACS Stuff #263
@ -29,9 +29,9 @@ from tmtccmd.pus.s20_fsfw_param_defs import (
|
||||
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_command
|
||||
from tmtccmd.pus.tc.s3_fsfw_hk import (
|
||||
create_request_one_diag_command,
|
||||
create_request_one_hk_command,
|
||||
disable_periodic_hk_command,
|
||||
enable_periodic_hk_command_with_interval,
|
||||
generate_one_hk_command,
|
||||
make_sid,
|
||||
)
|
||||
from tmtccmd.tmtc import service_provider
|
||||
@ -54,10 +54,17 @@ class SetId(enum.IntEnum):
|
||||
GYR_RAW_SET = 4
|
||||
GYR_PROC_SET = 5
|
||||
GPS_PROC_SET = 6
|
||||
MEKF_DATA = 7
|
||||
ATTITUDE_ESTIMATION_DATA = 7
|
||||
CTRL_VAL_DATA = 8
|
||||
ACTUATOR_CMD_DATA = 9
|
||||
FUSED_ROT_RATE_DATA = 10
|
||||
FUSED_ROT_RATE_SOURCE_DATA = 11
|
||||
|
||||
|
||||
class DataSetRequest(enum.IntEnum):
|
||||
ONESHOT = 0
|
||||
ENABLE = 1
|
||||
DISABLE = 2
|
||||
|
||||
|
||||
class ActionId(enum.IntEnum):
|
||||
@ -99,55 +106,25 @@ GPS_COURCE_DICT = {
|
||||
|
||||
|
||||
class OpCodes:
|
||||
OFF = ["off"]
|
||||
SAFE = ["safe"]
|
||||
DTBL = ["safe_detumble"]
|
||||
IDLE = ["ptg_idle"]
|
||||
NADIR = ["ptg_nadir"]
|
||||
TARGET = ["ptg_target"]
|
||||
GS = ["ptg_target_gs"]
|
||||
INERTIAL = ["ptg_inertial"]
|
||||
SAFE_PTG = ["confirm_deployment"]
|
||||
RESET_MEKF = ["reset_mekf"]
|
||||
RESTORE_MEKF_NONFINITE_RECOVERY = ["restore_mekf_nonfinite_recovery"]
|
||||
UPDATE_TLE = ["update_tle"]
|
||||
READ_TLE = ["read_tle"]
|
||||
SET_PARAMETER_SCALAR = ["set_scalar_param"]
|
||||
SET_PARAMETER_VECTOR = ["set_vector_param"]
|
||||
SET_PARAMETER_MATRIX = ["set_matrix_param"]
|
||||
REQUEST_RAW_MGM_HK = ["mgm_raw_hk"]
|
||||
ENABLE_RAW_MGM_HK = ["mgm_raw_enable_hk"]
|
||||
DISABLE_RAW_MGM_HK = ["mgm_raw_disable_hk"]
|
||||
REQUEST_PROC_MGM_HK = ["mgm_proc_hk"]
|
||||
ENABLE_PROC_MGM_HK = ["mgm_proc_enable_hk"]
|
||||
DISABLE_PROC_MGM_HK = ["mgm_proc_disable_hk"]
|
||||
REQUEST_RAW_SUS_HK = ["sus_raw_hk"]
|
||||
ENABLE_RAW_SUS_HK = ["sus_raw_enable_hk"]
|
||||
DISABLE_RAW_SUS_HK = ["sus_raw_disable_hk"]
|
||||
REQUEST_PROC_SUS_HK = ["sus_proc_hk"]
|
||||
ENABLE_PROC_SUS_HK = ["sus_proc_enable_hk"]
|
||||
DISABLE_PROC_SUS_HK = ["sus_proc_disable_hk"]
|
||||
REQUEST_RAW_GYR_HK = ["gyr_raw_hk"]
|
||||
ENABLE_RAW_GYR_HK = ["gyr_raw_enable_hk"]
|
||||
DISABLE_RAW_GYR_HK = ["gyr_raw_disable_hk"]
|
||||
REQUEST_PROC_GYR_HK = ["gyr_proc_hk"]
|
||||
ENABLE_PROC_GYR_HK = ["gyr_proc_enable_hk"]
|
||||
DISABLE_PROC_GYR_HK = ["gyr_proc_disable_hk"]
|
||||
REQUEST_PROC_GPS_HK = ["gps_proc_hk"]
|
||||
ENABLE_PROC_GPS_HK = ["gps_proc_enable_hk"]
|
||||
DISABLE_PROC_GPS_HK = ["gps_proc_disable_hk"]
|
||||
REQUEST_MEKF_HK = ["mekf_hk"]
|
||||
ENABLE_MEKF_HK = ["mekf_enable_hk"]
|
||||
DISABLE_MEKF_HK = ["mekf_disable_hk"]
|
||||
REQUEST_CTRL_VAL_HK = ["ctrl_val_hk"]
|
||||
ENABLE_CTRL_VAL_HK = ["ctrl_val_enable_hk"]
|
||||
DISABLE_CTRL_VAL_HK = ["ctrl_val_disable_hk"]
|
||||
REQUEST_ACT_CMD_HK = ["act_cmd_hk"]
|
||||
ENABLE_ACT_CMD_HK = ["act_cmd_enable_hk"]
|
||||
DISABLE_ACT_CMD_HK = ["act_cmd_disable_hk"]
|
||||
REQUEST_FUSED_ROT_RATE_HK = ["f_rot_rate_hk"]
|
||||
ENABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_enable_hk"]
|
||||
DISABLE_FUSED_ROT_RATE_HK = ["f_rot_rate_disable_hk"]
|
||||
OFF = "off"
|
||||
SAFE = "safe"
|
||||
DTBL = "safe_detumble"
|
||||
IDLE = "ptg_idle"
|
||||
NADIR = "ptg_nadir"
|
||||
TARGET = "ptg_target"
|
||||
GS = "ptg_target_gs"
|
||||
INERTIAL = "ptg_inertial"
|
||||
SAFE_PTG = "confirm_deployment"
|
||||
RESET_MEKF = "reset_mekf"
|
||||
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
|
||||
UPDATE_TLE = "update_tle"
|
||||
READ_TLE = "read_tle"
|
||||
SET_PARAMETER_SCALAR = "set_scalar_param"
|
||||
SET_PARAMETER_VECTOR = "set_vector_param"
|
||||
SET_PARAMETER_MATRIX = "set_matrix_param"
|
||||
ONE_SHOOT_HK = "one_shot_hk"
|
||||
ENABLE_HK = "enable_hk"
|
||||
DISABLE_HK = "disable_hk"
|
||||
|
||||
|
||||
class Info:
|
||||
@ -167,39 +144,9 @@ class Info:
|
||||
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
|
||||
SET_PARAMETER_VECTOR = "Set Vector Parameter"
|
||||
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
|
||||
REQUEST_RAW_MGM_HK = "Request Raw MGM HK once"
|
||||
ENABLE_RAW_MGM_HK = "Enable Raw MGM HK data generation"
|
||||
DISABLE_RAW_MGM_HK = "Disable Raw MGM HK data generation"
|
||||
REQUEST_PROC_MGM_HK = "Request Processed MGM HK"
|
||||
ENABLE_PROC_MGM_HK = "Enable Processed MGM HK data generation"
|
||||
DISABLE_PROC_MGM_HK = "Disable Processed MGM HK data generation"
|
||||
REQUEST_RAW_SUS_HK = "Request Raw SUS HK"
|
||||
ENABLE_RAW_SUS_HK = "Enable Raw SUS HK data generation"
|
||||
DISABLE_RAW_SUS_HK = "Disable Raw SUS HK data generation"
|
||||
REQUEST_PROC_SUS_HK = "Request Processed SUS HK"
|
||||
ENABLE_PROC_SUS_HK = "Enable Processed SUS HK data generation"
|
||||
DISABLE_PROC_SUS_HK = "Disable Processed MGM HK data generation"
|
||||
REQUEST_RAW_GYR_HK = "Request Raw GYR HK"
|
||||
ENABLE_RAW_GYR_HK = "Enable Raw GYR HK data generation"
|
||||
DISABLE_RAW_GYR_HK = "Disable Raw GYR HK data generation"
|
||||
REQUEST_PROC_GYR_HK = "Request Processed GYR HK"
|
||||
ENABLE_PROC_GYR_HK = "Enable Processed GYR HK data generation"
|
||||
DISABLE_PROC_GYR_HK = "Disable Processed GYR HK data generation"
|
||||
REQUEST_PROC_GPS_HK = "Request Processed GPS HK"
|
||||
ENABLE_PROC_GPS_HK = "Enable Processed GPS HK data generation"
|
||||
DISABLE_PROC_GPS_HK = "Disable Processed GPS HK data generation"
|
||||
REQUEST_MEKF_HK = "Request MEKF HK"
|
||||
ENABLE_MEKF_HK = "Enable MEKF HK data generation"
|
||||
DISABLE_MEKF_HK = "Disable MEKF HK data generation"
|
||||
REQUEST_CTRL_VAL_HK = "Request Control Values HK"
|
||||
ENABLE_CTRL_VAL_HK = "Enable Control Values HK data generation"
|
||||
DISABLE_CTRL_VAL_HK = "Disable Control Values HK data generation"
|
||||
REQUEST_ACT_CMD_HK = "Request Actuator Commands HK"
|
||||
ENABLE_ACT_CMD_HK = "Enable Actuator Commands HK data generation"
|
||||
DISABLE_ACT_CMD_HK = "Disable Actuator Commands HK data generation"
|
||||
REQUEST_FUSED_ROT_RATE_HK = "Request Fused Rotational Rates HK"
|
||||
ENABLE_FUSED_ROT_RATE_HK = "Enable Fused Rotational Rates HK data generation"
|
||||
DISABLE_FUSED_ROT_RATE_HK = "Disable Fused Rotational Rates HK data generation"
|
||||
ONE_SHOOT_HK = "One shoot HK Set"
|
||||
ENABLE_HK = "Enable Periodic HK"
|
||||
DISABLE_HK = "Disable Periodic HK"
|
||||
|
||||
|
||||
PERFORM_MGM_CALIBRATION = False
|
||||
@ -236,39 +183,9 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||
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.REQUEST_RAW_MGM_HK, info=Info.REQUEST_RAW_MGM_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_RAW_MGM_HK, info=Info.ENABLE_RAW_MGM_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_RAW_MGM_HK, info=Info.DISABLE_RAW_MGM_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_PROC_MGM_HK, info=Info.REQUEST_PROC_MGM_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_PROC_MGM_HK, info=Info.ENABLE_PROC_MGM_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_PROC_MGM_HK, info=Info.DISABLE_PROC_MGM_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_RAW_SUS_HK, info=Info.REQUEST_RAW_SUS_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_RAW_SUS_HK, info=Info.ENABLE_RAW_SUS_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_RAW_SUS_HK, info=Info.DISABLE_RAW_SUS_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_PROC_SUS_HK, info=Info.REQUEST_PROC_SUS_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_PROC_SUS_HK, info=Info.ENABLE_PROC_SUS_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_PROC_SUS_HK, info=Info.DISABLE_PROC_SUS_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_RAW_GYR_HK, info=Info.REQUEST_RAW_GYR_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_RAW_GYR_HK, info=Info.ENABLE_RAW_GYR_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_RAW_GYR_HK, info=Info.DISABLE_RAW_GYR_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_PROC_GYR_HK, info=Info.REQUEST_PROC_GYR_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_PROC_GYR_HK, info=Info.ENABLE_PROC_GYR_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_PROC_GYR_HK, info=Info.DISABLE_PROC_GYR_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_PROC_GPS_HK, info=Info.REQUEST_PROC_GPS_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_PROC_GPS_HK, info=Info.ENABLE_PROC_GPS_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_PROC_GPS_HK, info=Info.DISABLE_PROC_GPS_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_MEKF_HK, info=Info.REQUEST_MEKF_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_MEKF_HK, info=Info.ENABLE_MEKF_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_MEKF_HK, info=Info.DISABLE_MEKF_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_CTRL_VAL_HK, info=Info.REQUEST_CTRL_VAL_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_CTRL_VAL_HK, info=Info.ENABLE_CTRL_VAL_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_CTRL_VAL_HK, info=Info.DISABLE_CTRL_VAL_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_ACT_CMD_HK, info=Info.REQUEST_ACT_CMD_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_ACT_CMD_HK, info=Info.ENABLE_ACT_CMD_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_ACT_CMD_HK, info=Info.DISABLE_ACT_CMD_HK)
|
||||
oce.add(keys=OpCodes.REQUEST_FUSED_ROT_RATE_HK, info=Info.REQUEST_FUSED_ROT_RATE_HK)
|
||||
oce.add(keys=OpCodes.ENABLE_FUSED_ROT_RATE_HK, info=Info.ENABLE_FUSED_ROT_RATE_HK)
|
||||
oce.add(keys=OpCodes.DISABLE_FUSED_ROT_RATE_HK, info=Info.DISABLE_FUSED_ROT_RATE_HK)
|
||||
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
|
||||
)
|
||||
@ -278,50 +195,50 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
|
||||
def pack_acs_ctrl_command(p: ServiceProviderParams): # noqa C901
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
if op_code in OpCodes.OFF:
|
||||
if op_code == OpCodes.OFF:
|
||||
q.add_log_cmd(f"{Info.OFF}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, Mode.OFF, 0))
|
||||
elif op_code in OpCodes.SAFE:
|
||||
elif op_code == OpCodes.SAFE:
|
||||
q.add_log_cmd(f"{Info.SAFE}")
|
||||
q.add_pus_tc(
|
||||
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DEFAULT)
|
||||
)
|
||||
elif op_code in OpCodes.DTBL:
|
||||
elif op_code == OpCodes.DTBL:
|
||||
q.add_log_cmd(f"{Info.DTBL}")
|
||||
q.add_pus_tc(
|
||||
pack_mode_command(ACS_CONTROLLER, AcsMode.SAFE, SafeSubmode.DETUMBLE)
|
||||
)
|
||||
elif op_code in OpCodes.IDLE:
|
||||
elif op_code == OpCodes.IDLE:
|
||||
q.add_log_cmd(f"{Info.IDLE}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.IDLE, 0))
|
||||
elif op_code in OpCodes.NADIR:
|
||||
elif op_code == OpCodes.NADIR:
|
||||
q.add_log_cmd(f"{Info.NADIR}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_NADIR, 0))
|
||||
elif op_code in OpCodes.TARGET:
|
||||
elif op_code == OpCodes.TARGET:
|
||||
q.add_log_cmd(f"{Info.TARGET}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET, 0))
|
||||
elif op_code in OpCodes.GS:
|
||||
elif op_code == OpCodes.GS:
|
||||
q.add_log_cmd(f"{Info.GS}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_TARGET_GS, 0))
|
||||
elif op_code in OpCodes.INERTIAL:
|
||||
elif op_code == OpCodes.INERTIAL:
|
||||
q.add_log_cmd(f"{Info.INERTIAL}")
|
||||
q.add_pus_tc(pack_mode_command(ACS_CONTROLLER, AcsMode.PTG_INERTIAL, 0))
|
||||
elif op_code in OpCodes.SAFE_PTG:
|
||||
elif op_code == OpCodes.SAFE_PTG:
|
||||
q.add_log_cmd(f"{Info.SAFE_PTG}")
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(
|
||||
ACS_CONTROLLER, ActionId.SOLAR_ARRAY_DEPLOYMENT_SUCCESSFUL
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.RESET_MEKF:
|
||||
elif op_code == OpCodes.RESET_MEKF:
|
||||
q.add_log_cmd(f"{Info.RESET_MEKF}")
|
||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.RESET_MEKF))
|
||||
elif op_code in OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY:
|
||||
elif op_code == OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY:
|
||||
q.add_log_cmd(f"{Info.RESTORE_MEKF_NONFINITE_RECOVERY}")
|
||||
q.add_pus_tc(
|
||||
create_action_cmd(ACS_CONTROLLER, ActionId.RESTORE_MEKF_NONFINITE_RECOVERY)
|
||||
)
|
||||
elif op_code in OpCodes.UPDATE_TLE:
|
||||
elif op_code == OpCodes.UPDATE_TLE:
|
||||
q.add_log_cmd(f"{Info.UPDATE_TLE}")
|
||||
while True:
|
||||
line1 = input("Please input the first line of the TLE: ")
|
||||
@ -337,242 +254,79 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): # 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 op_code in OpCodes.READ_TLE:
|
||||
elif op_code == OpCodes.READ_TLE:
|
||||
q.add_log_cmd(f"{Info.READ_TLE}")
|
||||
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
|
||||
elif op_code in OpCodes.SET_PARAMETER_SCALAR:
|
||||
elif op_code == OpCodes.SET_PARAMETER_SCALAR:
|
||||
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
|
||||
set_acs_ctrl_param_scalar(q)
|
||||
elif op_code in OpCodes.SET_PARAMETER_VECTOR:
|
||||
elif op_code == OpCodes.SET_PARAMETER_VECTOR:
|
||||
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
|
||||
set_acs_ctrl_param_vector(q)
|
||||
elif op_code in OpCodes.SET_PARAMETER_MATRIX:
|
||||
elif op_code == OpCodes.SET_PARAMETER_MATRIX:
|
||||
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
|
||||
set_acs_ctrl_param_matrix(q)
|
||||
elif op_code in OpCodes.REQUEST_RAW_MGM_HK:
|
||||
q.add_log_cmd(Info.REQUEST_RAW_MGM_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_RAW_MGM_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_RAW_MGM_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_RAW_MGM_HK:
|
||||
q.add_log_cmd(Info.DISABLE_RAW_MGM_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_PROC_MGM_HK:
|
||||
q.add_log_cmd(Info.REQUEST_PROC_MGM_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_PROC_MGM_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_PROC_MGM_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_PROC_MGM_HK:
|
||||
q.add_log_cmd(Info.DISABLE_PROC_MGM_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_RAW_SUS_HK:
|
||||
q.add_log_cmd(Info.REQUEST_RAW_SUS_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_RAW_SUS_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_RAW_SUS_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_RAW_SUS_HK:
|
||||
q.add_log_cmd(Info.DISABLE_RAW_SUS_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_PROC_SUS_HK:
|
||||
q.add_log_cmd(Info.REQUEST_PROC_SUS_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_PROC_SUS_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_PROC_SUS_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_PROC_SUS_HK:
|
||||
q.add_log_cmd(Info.DISABLE_PROC_SUS_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_RAW_GYR_HK:
|
||||
q.add_log_cmd(Info.REQUEST_RAW_GYR_HK)
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_RAW_GYR_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_RAW_GYR_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_RAW_GYR_HK:
|
||||
q.add_log_cmd(Info.DISABLE_RAW_GYR_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_PROC_GYR_HK:
|
||||
q.add_log_cmd(Info.REQUEST_PROC_GYR_HK)
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(
|
||||
make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_PROC_GYR_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_PROC_GYR_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_PROC_GYR_HK:
|
||||
q.add_log_cmd(Info.DISABLE_PROC_GYR_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
True, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_PROC_GPS_HK:
|
||||
q.add_log_cmd(Info.REQUEST_PROC_GPS_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_PROC_GPS_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_PROC_GPS_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_PROC_GPS_HK:
|
||||
q.add_log_cmd(Info.DISABLE_PROC_GPS_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_MEKF_HK:
|
||||
q.add_log_cmd(Info.REQUEST_MEKF_HK)
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_MEKF_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_MEKF_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_MEKF_HK:
|
||||
q.add_log_cmd(Info.DISABLE_MEKF_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA))
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_CTRL_VAL_HK:
|
||||
q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_CTRL_VAL_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_CTRL_VAL_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_CTRL_VAL_HK:
|
||||
q.add_log_cmd(Info.DISABLE_CTRL_VAL_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_ACT_CMD_HK:
|
||||
q.add_log_cmd(Info.REQUEST_ACT_CMD_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_ACT_CMD_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_ACT_CMD_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_ACT_CMD_HK:
|
||||
q.add_log_cmd(Info.DISABLE_ACT_CMD_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA)
|
||||
)
|
||||
)
|
||||
elif op_code in OpCodes.REQUEST_FUSED_ROT_RATE_HK:
|
||||
q.add_log_cmd(Info.REQUEST_FUSED_ROT_RATE_HK)
|
||||
q.add_pus_tc(
|
||||
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA))
|
||||
)
|
||||
elif op_code in OpCodes.ENABLE_FUSED_ROT_RATE_HK:
|
||||
interval = float(input("Please specify interval in floating point seconds: "))
|
||||
q.add_log_cmd(Info.ENABLE_FUSED_ROT_RATE_HK)
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
elif op_code in OpCodes.DISABLE_FUSED_ROT_RATE_HK:
|
||||
q.add_log_cmd(Info.DISABLE_FUSED_ROT_RATE_HK)
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(
|
||||
False, make_sid(ACS_CONTROLLER, SetId.FUSED_ROT_RATE_DATA)
|
||||
)
|
||||
)
|
||||
elif op_code == OpCodes.ONE_SHOOT_HK:
|
||||
q.add_log_cmd(Info.ONE_SHOOT_HK)
|
||||
request_dataset(q, DataSetRequest.ONESHOT)
|
||||
elif op_code == OpCodes.ENABLE_HK:
|
||||
q.add_log_cmd(Info.ENABLE_HK)
|
||||
request_dataset(q, DataSetRequest.ENABLE)
|
||||
elif op_code == OpCodes.DISABLE_HK:
|
||||
q.add_log_cmd(Info.DISABLE_HK)
|
||||
request_dataset(q, DataSetRequest.DISABLE)
|
||||
else:
|
||||
logging.getLogger(__name__).info(f"Unknown op code {op_code}")
|
||||
|
||||
|
||||
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
|
||||
for val in SetId:
|
||||
print("{:<2}: {:<20}".format(val, val.name))
|
||||
set_id = int(input("Specify the dataset \n" ""))
|
||||
if set_id in [
|
||||
SetId.GYR_RAW_SET,
|
||||
SetId.GPS_PROC_SET,
|
||||
SetId.ATTITUDE_ESTIMATION_DATA,
|
||||
]:
|
||||
is_diag = True
|
||||
else:
|
||||
is_diag = False
|
||||
match req_type:
|
||||
case DataSetRequest.ONESHOT:
|
||||
if is_diag:
|
||||
q.add_pus_tc(
|
||||
create_request_one_diag_command(make_sid(ACS_CONTROLLER, set_id))
|
||||
)
|
||||
else:
|
||||
q.add_pus_tc(
|
||||
create_request_one_hk_command(make_sid(ACS_CONTROLLER, set_id))
|
||||
)
|
||||
case DataSetRequest.ENABLE:
|
||||
interval = float(
|
||||
input("Please specify interval in floating point seconds: ")
|
||||
)
|
||||
|
||||
if is_diag:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
True, make_sid(ACS_CONTROLLER, set_id), interval
|
||||
)
|
||||
else:
|
||||
cmd_tuple = enable_periodic_hk_command_with_interval(
|
||||
False, make_sid(ACS_CONTROLLER, set_id), interval
|
||||
)
|
||||
q.add_pus_tc(cmd_tuple[0])
|
||||
q.add_pus_tc(cmd_tuple[1])
|
||||
case DataSetRequest.DISABLE:
|
||||
if is_diag:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, set_id))
|
||||
)
|
||||
else:
|
||||
q.add_pus_tc(
|
||||
disable_periodic_hk_command(False, make_sid(ACS_CONTROLLER, set_id))
|
||||
)
|
||||
|
||||
|
||||
def set_acs_ctrl_param_scalar(q: DefaultPusQueueHelper):
|
||||
pt = int(
|
||||
input(
|
||||
@ -778,7 +532,7 @@ def handle_acs_ctrl_hk_data(
|
||||
handle_gyr_data_processed(pw, hk_data)
|
||||
case SetId.GPS_PROC_SET:
|
||||
handle_gps_data_processed(pw, hk_data)
|
||||
case SetId.MEKF_DATA:
|
||||
case SetId.ATTITUDE_ESTIMATION_DATA:
|
||||
handle_mekf_data(pw, hk_data)
|
||||
case SetId.CTRL_VAL_DATA:
|
||||
handle_ctrl_val_data(pw, hk_data)
|
||||
|
Loading…
Reference in New Issue
Block a user