on cmd for SCEX
This commit is contained in:
parent
135afdff3b
commit
a7714747bc
@ -13,7 +13,7 @@
|
||||
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcc.py" />
|
||||
<option name="PARAMETERS" value="-s scex -d 5" />
|
||||
<option name="PARAMETERS" value="-s scex -d 8" />
|
||||
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||
<option name="EMULATE_TERMINAL" value="true" />
|
||||
<option name="MODULE_MODE" value="false" />
|
||||
|
@ -1,10 +1,12 @@
|
||||
import enum
|
||||
import json
|
||||
|
||||
from spacepackets.ecss import PusTelecommand
|
||||
|
||||
from config.definitions import CustomServiceList
|
||||
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
|
||||
from tmtccmd.config.tmtc import tmtc_definitions_provider
|
||||
from tmtccmd.tc import DefaultPusQueueHelper, service_provider
|
||||
from tmtccmd.tc.pus_200_fsfw_modes import Modes, pack_mode_data, Subservices
|
||||
from tmtccmd.tc import service_provider
|
||||
from tmtccmd.tc.decorator import ServiceProviderParams
|
||||
from tmtccmd.tc.pus_8_funccmd import make_fsfw_action_cmd
|
||||
from tmtccmd.config import OpCodeEntry, TmtcDefinitionWrapper
|
||||
@ -24,6 +26,8 @@ class OpCodes:
|
||||
ALL_CELLS_CMD = ["5", "allcells"]
|
||||
FRAM = ["6", "fram"]
|
||||
|
||||
SWITCH_ON = ["7", "on"]
|
||||
|
||||
|
||||
class ActionIds(enum.IntEnum):
|
||||
PING = 7
|
||||
@ -46,6 +50,8 @@ class Info:
|
||||
ALL_CELLS_CMD = "All Cells"
|
||||
FRAM = "Read FRAM"
|
||||
|
||||
SWITCH_ON = "Switch Scex on"
|
||||
|
||||
|
||||
@tmtc_definitions_provider
|
||||
def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
@ -58,6 +64,7 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
|
||||
oce.add(keys=OpCodes.ALL_CELLS_CMD, info=Info.ALL_CELLS_CMD)
|
||||
oce.add(keys=OpCodes.FRAM, info=Info.FRAM)
|
||||
oce.add(keys=OpCodes.SWITCH_ON, info=Info.SWITCH_ON)
|
||||
|
||||
defs.add_service(
|
||||
name=CustomServiceList.SCEX.value, info="SCEX Device", op_code_entry=oce
|
||||
@ -68,6 +75,15 @@ def add_scex_cmds(defs: TmtcDefinitionWrapper):
|
||||
def pack_scex_cmds(p: ServiceProviderParams):
|
||||
op_code = p.op_code
|
||||
q = p.queue_helper
|
||||
if op_code in OpCodes.SWITCH_ON:
|
||||
q.add_log_cmd(Info.SWITCH_ON)
|
||||
q.add_pus_tc(
|
||||
PusTelecommand(
|
||||
service=200,
|
||||
subservice=Subservices.TC_MODE_COMMAND,
|
||||
app_data=pack_mode_data(SCEX_HANDLER_ID, Modes.ON, 0),
|
||||
)
|
||||
)
|
||||
if op_code in OpCodes.PING:
|
||||
q.add_log_cmd(Info.PING)
|
||||
app_data = bytes([0])
|
||||
|
@ -211,12 +211,14 @@ def handle_default_procedure(
|
||||
gui=tc_handler.gui,
|
||||
)
|
||||
if service == CustomServiceList.SCEX.value:
|
||||
return pack_scex_cmds(ServiceProviderParams(
|
||||
return pack_scex_cmds(
|
||||
ServiceProviderParams(
|
||||
handler_base=tc_base,
|
||||
op_code=op_code,
|
||||
info=info,
|
||||
queue_helper=queue_helper
|
||||
))
|
||||
queue_helper=queue_helper,
|
||||
)
|
||||
)
|
||||
if not route_to_registered_service_handlers(
|
||||
service,
|
||||
ServiceProviderParams(
|
||||
|
Loading…
x
Reference in New Issue
Block a user