diff --git a/eive_tmtc/tmtc/acs/gps.py b/eive_tmtc/tmtc/acs/gps.py index ab60805..efad9f6 100644 --- a/eive_tmtc/tmtc/acs/gps.py +++ b/eive_tmtc/tmtc/acs/gps.py @@ -13,7 +13,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import ( make_sid, create_request_one_hk_command, create_enable_periodic_hk_command_with_interval, - create_disable_periodic_hk_command, + create_disable_periodic_hk_command, create_enable_periodic_hk_command_with_interval_with_diag, + create_disable_periodic_hk_command_with_diag, ) from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter @@ -83,7 +84,7 @@ def pack_gps_command( # noqa: C901 if interval <= 0: raise ValueError("invalid interval") q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}") - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK), interval_seconds=interval, @@ -93,7 +94,7 @@ def pack_gps_command( # noqa: C901 if op_code in OpCode.DISABLE_CORE_HK: q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( diag=False, sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK) ) ) @@ -109,7 +110,7 @@ def pack_gps_command( # noqa: C901 if interval <= 0: raise ValueError("invalid interval") q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}") - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK), interval_seconds=interval, @@ -119,7 +120,7 @@ def pack_gps_command( # noqa: C901 if op_code in OpCode.DISABLE_SKYVIEW_HK: q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK) ) ) diff --git a/eive_tmtc/tmtc/acs/imtq.py b/eive_tmtc/tmtc/acs/imtq.py index cf739ea..2629edd 100644 --- a/eive_tmtc/tmtc/acs/imtq.py +++ b/eive_tmtc/tmtc/acs/imtq.py @@ -26,6 +26,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import ( create_request_one_diag_command, create_disable_periodic_hk_command, create_enable_periodic_hk_command_with_interval, + create_enable_periodic_hk_command_with_interval_with_diag, + create_disable_periodic_hk_command_with_diag, ) from tmtccmd.tc.pus_200_fsfw_mode import pack_mode_data, Mode from tmtccmd.util import ObjectIdU32 @@ -248,7 +250,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.ENABLE_ENG_HK_NO_TORQUE: q.add_log_cmd("IMTQ: Enable ENG HK") interval = float(input("Please enter collection interval in seconds: ")) - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=True, sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE), interval_seconds=interval, @@ -258,7 +260,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.DISABLE_ENG_HK_NO_TORQUE: q.add_log_cmd("IMTQ: Disable ENG HK (No Torque)") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( True, make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE) ) ) @@ -275,7 +277,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.ENABLE_ENG_HK_WITH_TORQUE: q.add_log_cmd("IMTQ: Enable ENG HK with torque") interval = float(input("Please enter collection interval in seconds: ")) - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=True, sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE), interval_seconds=interval, @@ -285,7 +287,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.DISABLE_ENG_HK_WITH_TORQUE: q.add_log_cmd("IMTQ: Disable ENG HK with Torque") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( True, make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE) ) ) @@ -320,14 +322,14 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.DISABLE_MGM_RAW_NO_TORQUE: q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE) ) ) if op_code == OpCode.ENABLE_MGM_RAW_NO_TORQUE: q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)") interval = float(input("Please enter collection interval in seconds: ")) - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=True, sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE), interval_seconds=interval, @@ -346,7 +348,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.ENABLE_MGM_RAW_WITH_TORQUE: q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)") interval = float(input("Please enter collection interval in seconds: ")) - cmds = create_enable_periodic_hk_command_with_interval( + cmds = create_enable_periodic_hk_command_with_interval_with_diag( diag=True, sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE), interval_seconds=interval, @@ -356,7 +358,7 @@ def pack_imtq_test_into( # noqa C901 if op_code == OpCode.DISABLE_MGM_RAW_WITH_TORQUE: q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)") q.add_pus_tc( - create_disable_periodic_hk_command( + create_disable_periodic_hk_command_with_diag( True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE) ) ) diff --git a/eive_tmtc/tmtc/com/pdec_handler.py b/eive_tmtc/tmtc/com/pdec_handler.py index 38763b4..758ca5c 100644 --- a/eive_tmtc/tmtc/com/pdec_handler.py +++ b/eive_tmtc/tmtc/com/pdec_handler.py @@ -83,7 +83,7 @@ def pack_pdec_handler_test( 0, ParameterId.POSITIVE_WINDOW, pw, - ).pack() + ) ) ) if op_code == OpCode.NEGATIVE_WINDOW: @@ -96,7 +96,7 @@ def pack_pdec_handler_test( 0, ParameterId.NEGATIVE_WINDOW, nw, - ).pack() + ) ) ) if op_code == OpCode.RESET_NO_INIT: diff --git a/eive_tmtc/tmtc/com/subsystem.py b/eive_tmtc/tmtc/com/subsystem.py index 7a2273e..f011ce5 100644 --- a/eive_tmtc/tmtc/com/subsystem.py +++ b/eive_tmtc/tmtc/com/subsystem.py @@ -3,6 +3,7 @@ import enum from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.object_ids import COM_SUBSYSTEM_ID from eive_tmtc.tmtc.com.syrlinks_handler import Datarate +from tmtccmd.pus.s20_fsfw_param_defs import create_scalar_u8_parameter from .defs import Mode as ComMode @@ -87,11 +88,12 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901 q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_LOW}") q.add_pus_tc( create_load_param_cmd( - pack_scalar_u8_parameter_app_data( + create_scalar_u8_parameter( COM_SUBSYSTEM_ID, 0, ParameterId.DATARATE, Datarate.LOW_RATE_MODULATION_BPSK, + ) ) ) @@ -99,7 +101,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901 q.add_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_HIGH}") q.add_pus_tc( create_load_param_cmd( - pack_scalar_u8_parameter_app_data( + create_scalar_u8_parameter( COM_SUBSYSTEM_ID, 0, ParameterId.DATARATE, @@ -122,7 +124,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901 0, ParameterId.TRANSMITTER_TIMEOUT, timeout, - ).pack() + ) ) ) elif o == OpCode.READ_MODE: diff --git a/eive_tmtc/tmtc/com/syrlinks_handler.py b/eive_tmtc/tmtc/com/syrlinks_handler.py index d103900..51ceda0 100644 --- a/eive_tmtc/tmtc/com/syrlinks_handler.py +++ b/eive_tmtc/tmtc/com/syrlinks_handler.py @@ -23,7 +23,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import ( create_request_one_diag_command, create_enable_periodic_hk_command_with_interval, create_disable_periodic_hk_command, - create_request_one_hk_command, + create_request_one_hk_command, create_enable_periodic_hk_command_with_interval_with_diag, + create_disable_periodic_hk_command_with_diag, ) from spacepackets.ecss.tc import PusTelecommand from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command @@ -182,24 +183,24 @@ def pack_syrlinks_command( # noqa C901: Complexity okay here. q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}") sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) interval = float(input("HK interval in floating point seconds")) - cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval) + cmds = create_enable_periodic_hk_command_with_interval_with_diag(True, sid, interval) for cmd in cmds: q.add_pus_tc(cmd) if op_code in OpCode.DISABLE_HK_RX_REGS: q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}") sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) - q.add_pus_tc(create_disable_periodic_hk_command(True, sid)) + q.add_pus_tc(create_disable_periodic_hk_command_with_diag(True, sid)) if op_code in OpCode.ENABLE_HK_TX_REGS: q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_TX_REGS}") sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) interval = float(input("HK interval in floating point seconds")) - cmds = create_enable_periodic_hk_command_with_interval(True, sid, interval) + cmds = create_enable_periodic_hk_command_with_interval_with_diag(True, sid, interval) for cmd in cmds: q.add_pus_tc(cmd) if op_code in OpCode.DISABLE_HK_TX_REGS: q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_TX_REGS}") sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) - q.add_pus_tc(create_disable_periodic_hk_command(True, sid)) + q.add_pus_tc(create_disable_periodic_hk_command_with_diag(True, sid)) if op_code in OpCode.HK_TX_REGS: q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}") sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)