some more cleaning and set ID updates

This commit is contained in:
2022-10-18 11:01:01 +02:00
parent 195d5343bc
commit 9171f23d93
7 changed files with 38 additions and 34 deletions

View File

@ -16,6 +16,8 @@ from tmtccmd.tc.pus_3_fsfw_hk import (
make_sid,
generate_one_diag_command,
generate_one_hk_command,
enable_periodic_hk_command_with_interval,
disable_periodic_hk_command,
)
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd
from tmtccmd.util import ObjectIdU32, ObjectIdBase
@ -104,12 +106,27 @@ class PowerOpCodes:
PRINT_LATCHUPS = ["print_latchups"]
class SetIds:
CORE = 1
AUX = 2
CONFIG = 3
def pack_common_power_cmds(
prefix: str, object_id: ObjectIdU32, q: DefaultPusQueueHelper, op_code: str
):
objb = object_id.as_bytes
if op_code in PowerOpCodes.ENABLE_INFO_HK:
pass
interval = float(input("Specify HK interval in floating point seconds: "))
q.add_log_cmd(f"{prefix}: {PowerInfo.ENABLE_INFO_HK} with interval {interval}")
cmds = enable_periodic_hk_command_with_interval(
True, make_sid(objb, SetIds.CORE), interval
)
for cmd in cmds:
q.add_pus_tc(cmd)
if op_code in PowerOpCodes.DISABLE_INFO_HK:
q.add_log_cmd(f"{prefix}: {PowerInfo.DISABLE_INFO_HK}")
q.add_pus_tc(disable_periodic_hk_command(True, make_sid(objb, SetIds.CORE)))
def pack_common_gomspace_cmds(