small renaming

This commit is contained in:
Robin Müller 2023-01-16 13:22:41 +01:00
parent cae971e90b
commit 0e9f7e6444
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814

View File

@ -28,7 +28,7 @@ from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger() LOGGER = get_console_logger()
class SetIds(enum.IntEnum): class SetId(enum.IntEnum):
MGM_RAW_SET = 0 MGM_RAW_SET = 0
MGM_PROC_SET = 1 MGM_PROC_SET = 1
SUS_RAW_SET = 2 SUS_RAW_SET = 2
@ -164,12 +164,12 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
if op_code in OpCodes.REQUEST_RAW_MGM_HK: if op_code in OpCodes.REQUEST_RAW_MGM_HK:
q.add_log_cmd(Info.REQUEST_RAW_MGM_HK) q.add_log_cmd(Info.REQUEST_RAW_MGM_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.MGM_RAW_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET))
) )
elif op_code in OpCodes.ENABLE_RAW_MGM_HK: elif op_code in OpCodes.ENABLE_RAW_MGM_HK:
q.add_log_cmd(Info.ENABLE_RAW_MGM_HK) q.add_log_cmd(Info.ENABLE_RAW_MGM_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.MGM_RAW_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -177,18 +177,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_RAW_MGM_HK) q.add_log_cmd(Info.DISABLE_RAW_MGM_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.MGM_RAW_SET) False, make_sid(ACS_CONTROLLER, SetId.MGM_RAW_SET)
) )
) )
elif op_code in OpCodes.REQUEST_PROC_MGM_HK: elif op_code in OpCodes.REQUEST_PROC_MGM_HK:
q.add_log_cmd(Info.REQUEST_PROC_MGM_HK) q.add_log_cmd(Info.REQUEST_PROC_MGM_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.MGM_PROC_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET))
) )
elif op_code in OpCodes.ENABLE_PROC_MGM_HK: elif op_code in OpCodes.ENABLE_PROC_MGM_HK:
q.add_log_cmd(Info.ENABLE_PROC_MGM_HK) q.add_log_cmd(Info.ENABLE_PROC_MGM_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.MGM_PROC_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -196,18 +196,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_PROC_MGM_HK) q.add_log_cmd(Info.DISABLE_PROC_MGM_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.MGM_PROC_SET) False, make_sid(ACS_CONTROLLER, SetId.MGM_PROC_SET)
) )
) )
elif op_code in OpCodes.REQUEST_RAW_SUS_HK: elif op_code in OpCodes.REQUEST_RAW_SUS_HK:
q.add_log_cmd(Info.REQUEST_RAW_SUS_HK) q.add_log_cmd(Info.REQUEST_RAW_SUS_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.SUS_RAW_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET))
) )
elif op_code in OpCodes.ENABLE_RAW_SUS_HK: elif op_code in OpCodes.ENABLE_RAW_SUS_HK:
q.add_log_cmd(Info.ENABLE_RAW_SUS_HK) q.add_log_cmd(Info.ENABLE_RAW_SUS_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.SUS_RAW_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -215,18 +215,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_RAW_SUS_HK) q.add_log_cmd(Info.DISABLE_RAW_SUS_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.SUS_RAW_SET) False, make_sid(ACS_CONTROLLER, SetId.SUS_RAW_SET)
) )
) )
elif op_code in OpCodes.REQUEST_PROC_SUS_HK: elif op_code in OpCodes.REQUEST_PROC_SUS_HK:
q.add_log_cmd(Info.REQUEST_PROC_SUS_HK) q.add_log_cmd(Info.REQUEST_PROC_SUS_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.SUS_PROC_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET))
) )
elif op_code in OpCodes.ENABLE_PROC_SUS_HK: elif op_code in OpCodes.ENABLE_PROC_SUS_HK:
q.add_log_cmd(Info.ENABLE_PROC_SUS_HK) q.add_log_cmd(Info.ENABLE_PROC_SUS_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.SUS_PROC_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -234,18 +234,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_PROC_SUS_HK) q.add_log_cmd(Info.DISABLE_PROC_SUS_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.SUS_PROC_SET) False, make_sid(ACS_CONTROLLER, SetId.SUS_PROC_SET)
) )
) )
elif op_code in OpCodes.REQUEST_RAW_GYR_HK: elif op_code in OpCodes.REQUEST_RAW_GYR_HK:
q.add_log_cmd(Info.REQUEST_RAW_GYR_HK) q.add_log_cmd(Info.REQUEST_RAW_GYR_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.GYR_RAW_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET))
) )
elif op_code in OpCodes.ENABLE_RAW_GYR_HK: elif op_code in OpCodes.ENABLE_RAW_GYR_HK:
q.add_log_cmd(Info.ENABLE_RAW_GYR_HK) q.add_log_cmd(Info.ENABLE_RAW_GYR_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.GYR_RAW_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -253,18 +253,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_RAW_GYR_HK) q.add_log_cmd(Info.DISABLE_RAW_GYR_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.GYR_RAW_SET) False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET)
) )
) )
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, SetIds.GYR_PROC_SET)) generate_one_hk_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)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.GYR_PROC_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -272,18 +272,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_PROC_GYR_HK) q.add_log_cmd(Info.DISABLE_PROC_GYR_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.GYR_PROC_SET) False, make_sid(ACS_CONTROLLER, SetId.GYR_PROC_SET)
) )
) )
elif op_code in OpCodes.REQUEST_PROC_GPS_HK: elif op_code in OpCodes.REQUEST_PROC_GPS_HK:
q.add_log_cmd(Info.REQUEST_PROC_GPS_HK) q.add_log_cmd(Info.REQUEST_PROC_GPS_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.GPS_PROC_SET)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET))
) )
elif op_code in OpCodes.ENABLE_PROC_GPS_HK: elif op_code in OpCodes.ENABLE_PROC_GPS_HK:
q.add_log_cmd(Info.ENABLE_PROC_GPS_HK) q.add_log_cmd(Info.ENABLE_PROC_GPS_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.GPS_PROC_SET), 2.0 False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -291,18 +291,16 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_PROC_GPS_HK) q.add_log_cmd(Info.DISABLE_PROC_GPS_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.GPS_PROC_SET) False, make_sid(ACS_CONTROLLER, SetId.GPS_PROC_SET)
) )
) )
elif op_code in OpCodes.REQUEST_MEKF_HK: elif op_code in OpCodes.REQUEST_MEKF_HK:
q.add_log_cmd(Info.REQUEST_MEKF_HK) q.add_log_cmd(Info.REQUEST_MEKF_HK)
q.add_pus_tc( q.add_pus_tc(generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.MEKF_DATA)))
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.MEKF_DATA))
)
elif op_code in OpCodes.ENABLE_MEKF_HK: elif op_code in OpCodes.ENABLE_MEKF_HK:
q.add_log_cmd(Info.ENABLE_MEKF_HK) q.add_log_cmd(Info.ENABLE_MEKF_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.MEKF_DATA), 2.0 False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -310,18 +308,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_MEKF_HK) q.add_log_cmd(Info.DISABLE_MEKF_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.MEKF_DATA) False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA)
) )
) )
elif op_code in OpCodes.REQUEST_CTRL_VAL_HK: elif op_code in OpCodes.REQUEST_CTRL_VAL_HK:
q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK) q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.CTRL_VAL_DATA)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA))
) )
elif op_code in OpCodes.ENABLE_CTRL_VAL_HK: elif op_code in OpCodes.ENABLE_CTRL_VAL_HK:
q.add_log_cmd(Info.ENABLE_CTRL_VAL_HK) q.add_log_cmd(Info.ENABLE_CTRL_VAL_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.CTRL_VAL_DATA), 2.0 False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -329,18 +327,18 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_CTRL_VAL_HK) q.add_log_cmd(Info.DISABLE_CTRL_VAL_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.CTRL_VAL_DATA) False, make_sid(ACS_CONTROLLER, SetId.CTRL_VAL_DATA)
) )
) )
elif op_code in OpCodes.REQUEST_ACT_CMD_HK: elif op_code in OpCodes.REQUEST_ACT_CMD_HK:
q.add_log_cmd(Info.REQUEST_ACT_CMD_HK) q.add_log_cmd(Info.REQUEST_ACT_CMD_HK)
q.add_pus_tc( q.add_pus_tc(
generate_one_hk_command(make_sid(ACS_CONTROLLER, SetIds.ACTUATOR_CMD_DATA)) generate_one_hk_command(make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA))
) )
elif op_code in OpCodes.ENABLE_ACT_CMD_HK: elif op_code in OpCodes.ENABLE_ACT_CMD_HK:
q.add_log_cmd(Info.ENABLE_ACT_CMD_HK) q.add_log_cmd(Info.ENABLE_ACT_CMD_HK)
cmd_tuple = enable_periodic_hk_command_with_interval( cmd_tuple = enable_periodic_hk_command_with_interval(
False, make_sid(ACS_CONTROLLER, SetIds.ACTUATOR_CMD_DATA), 2.0 False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA), 2.0
) )
q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1]) q.add_pus_tc(cmd_tuple[1])
@ -348,7 +346,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
q.add_log_cmd(Info.DISABLE_ACT_CMD_HK) q.add_log_cmd(Info.DISABLE_ACT_CMD_HK)
q.add_pus_tc( q.add_pus_tc(
disable_periodic_hk_command( disable_periodic_hk_command(
False, make_sid(ACS_CONTROLLER, SetIds.ACTUATOR_CMD_DATA) False, make_sid(ACS_CONTROLLER, SetId.ACTUATOR_CMD_DATA)
) )
) )
else: else:
@ -358,25 +356,25 @@ def pack_acs_ctrl_command(p: ServiceProviderParams):
def handle_acs_ctrl_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes): def handle_acs_ctrl_hk_data(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer) pw = PrintWrapper(printer)
match set_id: match set_id:
case SetIds.MGM_RAW_SET: case SetId.MGM_RAW_SET:
handle_raw_mgm_data(pw, hk_data) handle_raw_mgm_data(pw, hk_data)
case SetIds.MGM_PROC_SET: case SetId.MGM_PROC_SET:
handle_mgm_data_processed(pw, hk_data) handle_mgm_data_processed(pw, hk_data)
case SetIds.SUS_RAW_SET: case SetId.SUS_RAW_SET:
handle_acs_ctrl_sus_raw_data(pw, hk_data) handle_acs_ctrl_sus_raw_data(pw, hk_data)
case SetIds.SUS_PROC_SET: case SetId.SUS_PROC_SET:
handle_acs_ctrl_sus_processed_data(pw, hk_data) handle_acs_ctrl_sus_processed_data(pw, hk_data)
case SetIds.GYR_RAW_SET: case SetId.GYR_RAW_SET:
handle_gyr_data_raw(pw, hk_data) handle_gyr_data_raw(pw, hk_data)
case SetIds.GYR_PROC_SET: case SetId.GYR_PROC_SET:
handle_gyr_data_processed(pw, hk_data) handle_gyr_data_processed(pw, hk_data)
case SetIds.GPS_PROC_SET: case SetId.GPS_PROC_SET:
handle_gps_data_processed(pw, hk_data) handle_gps_data_processed(pw, hk_data)
case SetIds.MEKF_DATA: case SetId.MEKF_DATA:
handle_mekf_data(pw, hk_data) handle_mekf_data(pw, hk_data)
case SetIds.CTRL_VAL_DATA: case SetId.CTRL_VAL_DATA:
handle_ctrl_val_data(pw, hk_data) handle_ctrl_val_data(pw, hk_data)
case SetIds.ACTUATOR_CMD_DATA: case SetId.ACTUATOR_CMD_DATA:
handle_act_cmd_data(pw, hk_data) handle_act_cmd_data(pw, hk_data)