eive-tmtc bugfixes

This commit is contained in:
Robin Müller 2023-09-12 13:35:26 +02:00
parent d23cc6834a
commit 9edc819a97
Signed by: muellerr
GPG Key ID: A649FB78196E3849
5 changed files with 29 additions and 23 deletions

View File

@ -13,7 +13,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid, make_sid,
create_request_one_hk_command, create_request_one_hk_command,
create_enable_periodic_hk_command_with_interval, 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 from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
@ -83,7 +84,7 @@ def pack_gps_command( # noqa: C901
if interval <= 0: if interval <= 0:
raise ValueError("invalid interval") raise ValueError("invalid interval")
q.add_log_cmd(f"GPS: {Info.ENABLE_CORE_HK}") 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, diag=False,
sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK), sid=make_sid(object_id=object_id, set_id=SetId.CORE_HK),
interval_seconds=interval, interval_seconds=interval,
@ -93,7 +94,7 @@ def pack_gps_command( # noqa: C901
if op_code in OpCode.DISABLE_CORE_HK: if op_code in OpCode.DISABLE_CORE_HK:
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}") q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
q.add_pus_tc( 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) 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: if interval <= 0:
raise ValueError("invalid interval") raise ValueError("invalid interval")
q.add_log_cmd(f"GPS: {Info.ENABLE_SKYVIEW_HK}") 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, diag=False,
sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK), sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK),
interval_seconds=interval, interval_seconds=interval,
@ -119,7 +120,7 @@ def pack_gps_command( # noqa: C901
if op_code in OpCode.DISABLE_SKYVIEW_HK: if op_code in OpCode.DISABLE_SKYVIEW_HK:
q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}") q.add_log_cmd(f"gps: {Info.DISABLE_SKYVIEW_HK}")
q.add_pus_tc( 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) diag=False, sid=make_sid(object_id=object_id, set_id=SetId.SKYVIEW_HK)
) )
) )

View File

@ -26,6 +26,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
create_request_one_diag_command, create_request_one_diag_command,
create_disable_periodic_hk_command, create_disable_periodic_hk_command,
create_enable_periodic_hk_command_with_interval, 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.tc.pus_200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.util import ObjectIdU32 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: if op_code == OpCode.ENABLE_ENG_HK_NO_TORQUE:
q.add_log_cmd("IMTQ: Enable ENG HK") q.add_log_cmd("IMTQ: Enable ENG HK")
interval = float(input("Please enter collection interval in seconds: ")) 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, diag=True,
sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE), sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_NO_TORQUE),
interval_seconds=interval, interval_seconds=interval,
@ -258,7 +260,7 @@ def pack_imtq_test_into( # noqa C901
if op_code == OpCode.DISABLE_ENG_HK_NO_TORQUE: if op_code == OpCode.DISABLE_ENG_HK_NO_TORQUE:
q.add_log_cmd("IMTQ: Disable ENG HK (No Torque)") q.add_log_cmd("IMTQ: Disable ENG HK (No Torque)")
q.add_pus_tc( 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) 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: if op_code == OpCode.ENABLE_ENG_HK_WITH_TORQUE:
q.add_log_cmd("IMTQ: Enable ENG HK with torque") q.add_log_cmd("IMTQ: Enable ENG HK with torque")
interval = float(input("Please enter collection interval in seconds: ")) 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, diag=True,
sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE), sid=make_sid(object_id.as_bytes, ImtqSetId.ENG_HK_SET_WITH_TORQUE),
interval_seconds=interval, interval_seconds=interval,
@ -285,7 +287,7 @@ def pack_imtq_test_into( # noqa C901
if op_code == OpCode.DISABLE_ENG_HK_WITH_TORQUE: if op_code == OpCode.DISABLE_ENG_HK_WITH_TORQUE:
q.add_log_cmd("IMTQ: Disable ENG HK with Torque") q.add_log_cmd("IMTQ: Disable ENG HK with Torque")
q.add_pus_tc( 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) 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: if op_code == OpCode.DISABLE_MGM_RAW_NO_TORQUE:
q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)") q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)")
q.add_pus_tc( 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) True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE)
) )
) )
if op_code == OpCode.ENABLE_MGM_RAW_NO_TORQUE: if op_code == OpCode.ENABLE_MGM_RAW_NO_TORQUE:
q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)") q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)")
interval = float(input("Please enter collection interval in seconds: ")) 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, diag=True,
sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE), sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_NO_TORQUE),
interval_seconds=interval, interval_seconds=interval,
@ -346,7 +348,7 @@ def pack_imtq_test_into( # noqa C901
if op_code == OpCode.ENABLE_MGM_RAW_WITH_TORQUE: if op_code == OpCode.ENABLE_MGM_RAW_WITH_TORQUE:
q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)") q.add_log_cmd("IMTQ: Enable MGM RAW HK (No Torque)")
interval = float(input("Please enter collection interval in seconds: ")) 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, diag=True,
sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE), sid=make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE),
interval_seconds=interval, interval_seconds=interval,
@ -356,7 +358,7 @@ def pack_imtq_test_into( # noqa C901
if op_code == OpCode.DISABLE_MGM_RAW_WITH_TORQUE: if op_code == OpCode.DISABLE_MGM_RAW_WITH_TORQUE:
q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)") q.add_log_cmd("IMTQ: Disable MGM RAW HK (No Torque)")
q.add_pus_tc( 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) True, make_sid(object_id.as_bytes, ImtqSetId.RAW_MTM_WITH_TORQUE)
) )
) )

View File

@ -83,7 +83,7 @@ def pack_pdec_handler_test(
0, 0,
ParameterId.POSITIVE_WINDOW, ParameterId.POSITIVE_WINDOW,
pw, pw,
).pack() )
) )
) )
if op_code == OpCode.NEGATIVE_WINDOW: if op_code == OpCode.NEGATIVE_WINDOW:
@ -96,7 +96,7 @@ def pack_pdec_handler_test(
0, 0,
ParameterId.NEGATIVE_WINDOW, ParameterId.NEGATIVE_WINDOW,
nw, nw,
).pack() )
) )
) )
if op_code == OpCode.RESET_NO_INIT: if op_code == OpCode.RESET_NO_INIT:

View File

@ -3,6 +3,7 @@ import enum
from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import COM_SUBSYSTEM_ID from eive_tmtc.config.object_ids import COM_SUBSYSTEM_ID
from eive_tmtc.tmtc.com.syrlinks_handler import Datarate 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 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_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_LOW}")
q.add_pus_tc( q.add_pus_tc(
create_load_param_cmd( create_load_param_cmd(
pack_scalar_u8_parameter_app_data( create_scalar_u8_parameter(
COM_SUBSYSTEM_ID, COM_SUBSYSTEM_ID,
0, 0,
ParameterId.DATARATE, ParameterId.DATARATE,
Datarate.LOW_RATE_MODULATION_BPSK, 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_log_cmd(f"{prefix}: {Info.UPDATE_DEFAULT_DATARATE_HIGH}")
q.add_pus_tc( q.add_pus_tc(
create_load_param_cmd( create_load_param_cmd(
pack_scalar_u8_parameter_app_data( create_scalar_u8_parameter(
COM_SUBSYSTEM_ID, COM_SUBSYSTEM_ID,
0, 0,
ParameterId.DATARATE, ParameterId.DATARATE,
@ -122,7 +124,7 @@ def build_com_subsystem_cmd(p: ServiceProviderParams): # noqa C901
0, 0,
ParameterId.TRANSMITTER_TIMEOUT, ParameterId.TRANSMITTER_TIMEOUT,
timeout, timeout,
).pack() )
) )
) )
elif o == OpCode.READ_MODE: elif o == OpCode.READ_MODE:

View File

@ -23,7 +23,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
create_request_one_diag_command, create_request_one_diag_command,
create_enable_periodic_hk_command_with_interval, create_enable_periodic_hk_command_with_interval,
create_disable_periodic_hk_command, 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 spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_mode_command 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}") q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_RX_REGS}")
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET)
interval = float(input("HK interval in floating point seconds")) 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: for cmd in cmds:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
if op_code in OpCode.DISABLE_HK_RX_REGS: if op_code in OpCode.DISABLE_HK_RX_REGS:
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}") q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_RX_REGS}")
sid = make_sid(obyt, SetId.RX_REGISTERS_DATASET) 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: if op_code in OpCode.ENABLE_HK_TX_REGS:
q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_TX_REGS}") q.add_log_cmd(f"{prefix}: {Info.ENABLE_HK_TX_REGS}")
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)
interval = float(input("HK interval in floating point seconds")) 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: for cmd in cmds:
q.add_pus_tc(cmd) q.add_pus_tc(cmd)
if op_code in OpCode.DISABLE_HK_TX_REGS: if op_code in OpCode.DISABLE_HK_TX_REGS:
q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_TX_REGS}") q.add_log_cmd(f"{prefix}: {Info.DISABLE_HK_TX_REGS}")
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) 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: if op_code in OpCode.HK_TX_REGS:
q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}") q.add_log_cmd(f"{prefix}: {Info.HK_TX_REGS}")
sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET) sid = make_sid(obyt, SetId.TX_REGISTERS_DATASET)