add EIVE system cmds

This commit is contained in:
2023-02-12 18:56:59 +01:00
parent d99adf55a1
commit 2d79f6f484
6 changed files with 50 additions and 34 deletions

View File

@ -3,3 +3,4 @@ from .solar_array_deployment import add_sa_depl_cmds
from .test import add_test_defs
from .time import add_time_cmds
from .health import add_health_cmd_defs
from .system import add_system_cmd_defs

47
eive_tmtc/tmtc/system.py Normal file
View File

@ -0,0 +1,47 @@
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.tmtc.acs.subsystem import AcsMode
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
TmtcDefinitionWrapper,
OpCodeEntry,
)
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.decorator import ServiceProviderParams
class OpCode:
SAFE_MODE = "safe"
IDLE_MODE = "idle"
class Info:
SAFE_MODE = "Command System into Safe Mode"
IDLE_MODE = "Command System into Idle Pointing Mode"
@service_provider(CustomServiceList.SYSTEM.value)
def build_system_cmds(p: ServiceProviderParams):
o = p.op_code
q = p.queue_helper
prefix = "EIVE System"
if o == OpCode.SAFE_MODE:
q.add_log_cmd(f"{prefix}: {Info.SAFE_MODE}")
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.SAFE, 0))
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))
@tmtc_definitions_provider
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)
defs.add_service(
name=CustomServiceList.SYSTEM.value,
info="EIVE system commands",
op_code_entry=oce,
)
pass