add announce mode cmds

This commit is contained in:
Robin Müller 2023-02-21 01:30:24 +01:00
parent 1bc38ea4b5
commit d1f96cb83d
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
3 changed files with 19 additions and 2 deletions

View File

@ -15,6 +15,7 @@ tmtccmd version 4.0.0
## Added
- Basic persistent TM store commanding
- System and TCS system announce mode commands
## Changed

View File

@ -7,18 +7,24 @@ from tmtccmd.config.tmtc import (
)
from tmtccmd.tc import service_provider
from eive_tmtc.config.object_ids import EIVE_SYSTEM_ID
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
from tmtccmd.tc.pus_200_fsfw_mode import (
create_mode_command,
Mode,
create_announce_mode_recursive_command,
)
from tmtccmd.tc.decorator import ServiceProviderParams
class OpCode:
SAFE_MODE = "safe"
IDLE_MODE = "idle"
ANNOUNCE_MODES = "announce_modes"
class Info:
SAFE_MODE = "Command System into Safe Mode"
IDLE_MODE = "Command System into Idle Pointing Mode"
ANNOUNCE_MODES = "Announce mode recursively"
@service_provider(CustomServiceList.SYSTEM.value)
@ -32,6 +38,9 @@ def build_system_cmds(p: ServiceProviderParams):
elif o == OpCode.IDLE_MODE:
q.add_log_cmd(f"{prefix}: {Info.IDLE_MODE}")
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.IDLE, 0))
elif o == OpCode.ANNOUNCE_MODES:
q.add_log_cmd(f"{prefix}: {Info.ANNOUNCE_MODES}")
q.add_pus_tc(create_announce_mode_recursive_command(EIVE_SYSTEM_ID))
@tmtc_definitions_provider
@ -39,6 +48,7 @@ def add_system_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCode.SAFE_MODE, info=Info.SAFE_MODE)
oce.add(keys=OpCode.IDLE_MODE, info=Info.IDLE_MODE)
oce.add(keys=OpCode.ANNOUNCE_MODES, info=Info.ANNOUNCE_MODES)
defs.add_service(
name=CustomServiceList.SYSTEM.value,
info="EIVE system commands",

View File

@ -9,7 +9,7 @@ from tmtccmd.config.tmtc import (
OpCodeEntry,
)
from tmtccmd.tc import DefaultPusQueueHelper
from tmtccmd.tc.pus_200_fsfw_mode import Mode
from tmtccmd.tc.pus_200_fsfw_mode import Mode, create_announce_mode_recursive_command
from tmtccmd.tc.pus_3_fsfw_hk import make_sid, generate_one_hk_command
@ -19,6 +19,7 @@ class OpCodeSys:
REQUEST_PRIMARY_TEMP_SET = ["temp"]
REQUEST_DEVICE_TEMP_SET = ["temp_devs"]
REQUEST_DEVICE_SUS_SET = ["temp_sus"]
ANNOUNCE_MODES = "announce_modes"
class InfoSys:
@ -27,6 +28,7 @@ class InfoSys:
REQUEST_PRIMARY_TEMP_SET = "Request HK set of primary sensor temperatures"
REQUEST_DEVICE_TEMP_SET = "Request HK set of device sensor temperatures"
REQUEST_DEVICE_SUS_SET = "Request HK set of the SUS temperatures"
ANNOUNCE_MODES = "Announce Modes recursively"
def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
@ -52,6 +54,9 @@ def pack_tcs_sys_commands(q: DefaultPusQueueHelper, op_code: str):
if op_code in OpCodeSys.NML:
q.add_log_cmd(InfoSys.NML)
pack_mode_cmd_with_info(TCS_SUBSYSTEM_ID, Mode.NORMAL, 0, q, InfoSys.OFF)
if op_code == OpCodeSys.ANNOUNCE_MODES:
q.add_log_cmd(InfoSys.ANNOUNCE_MODES)
q.add_pus_tc(create_announce_mode_recursive_command(TCS_SUBSYSTEM_ID))
pack_tcs_ass_cmds(q, op_code)
@ -67,6 +72,7 @@ def add_tcs_subsystem_cmds(defs: TmtcDefinitionWrapper):
keys=OpCodeSys.REQUEST_DEVICE_TEMP_SET, info=InfoSys.REQUEST_DEVICE_TEMP_SET
)
oce.add(keys=OpCodeSys.REQUEST_DEVICE_SUS_SET, info=InfoSys.REQUEST_DEVICE_SUS_SET)
oce.add(keys=OpCodeSys.ANNOUNCE_MODES, info=InfoSys.ANNOUNCE_MODES)
defs.add_service(
name=CustomServiceList.TCS,
info="TCS Board",