added cmds to enable and disable MGM HK

This commit is contained in:
Robin Müller 2022-08-16 16:42:34 +02:00
parent f85694de02
commit 51dc18e226
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
5 changed files with 87 additions and 6 deletions

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MGM Disable HK" type="PythonConfigurationType" factoryName="Python" folderName="ACS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<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 acs-ctrl -o disable-mgm-hk" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MGM Enable HK" type="PythonConfigurationType" factoryName="Python" folderName="ACS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<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 acs-ctrl -o enable-mgm-hk -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

24
.run/MGM HK Once.run.xml Normal file
View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="MGM HK Once" type="PythonConfigurationType" factoryName="Python" folderName="ACS">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<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 acs-ctrl -o req-mgm-hk -d 5" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

2
deps/tmtccmd vendored

@ -1 +1 @@
Subproject commit 5e153e556716d340641563f2a18478a664fa4b92 Subproject commit 403c5fd2b1cd28af8de2b39f308b633892e660e5

View File

@ -11,7 +11,8 @@ from tmtccmd.config.tmtc import (
OpCodeEntry, OpCodeEntry,
) )
from tmtccmd.tc import DefaultPusQueueHelper, service_provider from tmtccmd.tc import DefaultPusQueueHelper, service_provider
from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid from tmtccmd.tc.pus_3_fsfw_hk import generate_one_hk_command, make_sid, \
enable_periodic_hk_command_with_interval, disable_periodic_hk_command
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
LOGGER = get_console_logger() LOGGER = get_console_logger()
@ -23,8 +24,8 @@ class SetIds(enum.IntEnum):
class OpCodes: class OpCodes:
REQUEST_MGM_HK = ["0", "req-mgm-hk"] REQUEST_MGM_HK = ["0", "req-mgm-hk"]
ENABLE_MGM_HK = ["1", "enable-hk"] ENABLE_MGM_HK = ["1", "enable-mgm-hk"]
DISABLE_MGM_HK = ["1", "enable-hk"] DISABLE_MGM_HK = ["1", "disable-mgm-hk"]
class Info: class Info:
@ -48,10 +49,18 @@ def acs_cmd_defs(defs: TmtcDefinitionWrapper):
def pack_acs_ctrl_command( def pack_acs_ctrl_command(
_info: DefaultProcedureInfo, q: DefaultPusQueueHelper, op_code: str _info: DefaultProcedureInfo, q: DefaultPusQueueHelper, op_code: str
): ):
if op_code in OpCodes.REQUEST_MGM_HK:
sid = make_sid(ACS_CONTROLLER, SetIds.MGM_SET) sid = make_sid(ACS_CONTROLLER, SetIds.MGM_SET)
q.add_log_cmd("Requesting one MGM HK packet") if op_code in OpCodes.REQUEST_MGM_HK:
q.add_log_cmd(Info.REQUEST_MGM_HK)
q.add_pus_tc(generate_one_hk_command(sid)) q.add_pus_tc(generate_one_hk_command(sid))
elif op_code in OpCodes.ENABLE_MGM_HK:
q.add_log_cmd(Info.ENABLE_MGM_HK)
cmd_tuple = enable_periodic_hk_command_with_interval(False, sid, 2.0)
q.add_pus_tc(cmd_tuple[0])
q.add_pus_tc(cmd_tuple[1])
elif op_code in OpCodes.DISABLE_MGM_HK:
q.add_log_cmd(Info.DISABLE_MGM_HK)
q.add_pus_tc(disable_periodic_hk_command(False, sid))
else: else:
LOGGER.info(f"Unknown op code {op_code}") LOGGER.info(f"Unknown op code {op_code}")