From 612383ade1f5a41bde98061975cbfeec758942ea Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Wed, 18 Jan 2023 16:50:56 +0100 Subject: [PATCH 1/7] bump installed tmtccmd again --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 8efca18..9526f4a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ classifiers = [options] install_requires = # tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a1 - tmtccmd @ git+https://github.com/robamu-org/tmtccmd@d6e024a3c82832#egg=tmtccmd + tmtccmd @ git+https://github.com/robamu-org/tmtccmd@152ecf9ffe0#egg=tmtccmd packages = find: python_requires = >=3.10 include_package_data = True From c2f43c90fb19fedca1bd18ec25c6303c72702b8d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Jan 2023 13:11:28 +0100 Subject: [PATCH 2/7] hmm this command disappeared --- eive_tmtc/tmtc/__init__.py | 1 + eive_tmtc/tmtc/solar_array_deployment.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eive_tmtc/tmtc/__init__.py b/eive_tmtc/tmtc/__init__.py index 22d3893..d78d994 100644 --- a/eive_tmtc/tmtc/__init__.py +++ b/eive_tmtc/tmtc/__init__.py @@ -1,2 +1,3 @@ from .payload.pl_subsystem import add_payload_subsystem_cmds +from .solar_array_deployment import add_sa_depl_cmds from .test import add_test_defs diff --git a/eive_tmtc/tmtc/solar_array_deployment.py b/eive_tmtc/tmtc/solar_array_deployment.py index 7d8765d..f8f91b9 100644 --- a/eive_tmtc/tmtc/solar_array_deployment.py +++ b/eive_tmtc/tmtc/solar_array_deployment.py @@ -35,7 +35,7 @@ class ActionId: @tmtc_definitions_provider -def pack_sa_depl_cmds(defs: TmtcDefinitionWrapper): +def add_sa_depl_cmds(defs: TmtcDefinitionWrapper): oce = OpCodeEntry() oce.add(keys=OpCode.MANUAL_DEPLOYMENT, info=Info.MANUAL_DEPLOYMENT) defs.add_service( From 887312371bbc7aad5f8fba1532cf5fc0d2d0470d Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Thu, 19 Jan 2023 13:21:12 +0100 Subject: [PATCH 3/7] rtd command to rewrite config --- eive_tmtc/pus_tc/devs/rtd.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eive_tmtc/pus_tc/devs/rtd.py b/eive_tmtc/pus_tc/devs/rtd.py index 450ced8..239c7b9 100644 --- a/eive_tmtc/pus_tc/devs/rtd.py +++ b/eive_tmtc/pus_tc/devs/rtd.py @@ -1,4 +1,5 @@ from typing import Optional +import struct from eive_tmtc.config.definitions import CustomServiceList from eive_tmtc.pus_tc.devs.pdec_handler import CommandId @@ -32,18 +33,22 @@ RTD_IDS = [ ] +class CommandId: + WRITE_CONFIG = 6 + + class OpCode: ON = ["0", "on"] OFF = ["1", "off"] NORMAL = ["2", "normal"] - CONFIG_CMD = ["3", "Write config"] + WRITE_CONFIG = ["3", "Write config"] class Info: ON = "Switch handler on" OFF = "Switch handler off" NORMAL = "Switch handler normal" - WIRTE_CONFIG = "Write config" + WRITE_CONFIG = "Write config" @tmtc_definitions_provider @@ -52,6 +57,7 @@ def specify_rtd_cmds(defs: TmtcDefinitionWrapper): oce.add(keys=OpCode.ON, info=Info.ON) oce.add(keys=OpCode.NORMAL, info=Info.NORMAL) oce.add(keys=OpCode.OFF, info=Info.OFF) + oce.add(keys=OpCode.WRITE_CONFIG, info=Info.WRITE_CONFIG) defs.add_service( name=CustomServiceList.RTD.value, info="RTD commands", op_code_entry=oce ) @@ -92,8 +98,8 @@ def pack_rtd_commands( service=200, subservice=Subservice.TC_MODE_COMMAND, app_data=app_data ) ) - if op_code in OpCode.CONFIG_CMD: - command = object_id.as_bytes + CommandId.PRINT_CLCW + if op_code in OpCode.WRITE_CONFIG: + command = object_id.as_bytes + struct.pack('!I', CommandId.WRITE_CONFIG) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) From a5337b5293eaeda34b08307fb088df89c03f18a3 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Jan 2023 13:29:01 +0100 Subject: [PATCH 4/7] replace deprecated API --- eive_tmtc/tmtc/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eive_tmtc/tmtc/test.py b/eive_tmtc/tmtc/test.py index 1a7985c..ad292fd 100644 --- a/eive_tmtc/tmtc/test.py +++ b/eive_tmtc/tmtc/test.py @@ -5,7 +5,7 @@ from tmtccmd.config.tmtc import ( TmtcDefinitionWrapper, OpCodeEntry, ) -from tmtccmd.pus.s17_test import pack_service_17_ping_command +from tmtccmd.pus.s17_test import create_service_17_ping_command from tmtccmd.tc import service_provider from tmtccmd.tc.decorator import ServiceProviderParams @@ -42,7 +42,7 @@ def pack_test_command(p: ServiceProviderParams): q = p.queue_helper if info.op_code == OpCodes.PING: q.add_log_cmd("Sending PUS TC [17,1]") - q.add_pus_tc(pack_service_17_ping_command()) + q.add_pus_tc(create_service_17_ping_command()) if info.op_code == OpCodes.TRIGGER_EVENT: q.add_log_cmd("Sending PUS TC Event Trigger [17, 128]") q.add_pus_tc(PusTelecommand(service=PusService.S17_TEST, subservice=128)) From 1cab6dc0651c0ad317e692c9a791499aa1114a90 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Jan 2023 16:28:22 +0100 Subject: [PATCH 5/7] bump used tmtccmd version --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 9526f4a..d351f9c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -28,7 +28,7 @@ classifiers = [options] install_requires = # tmtccmd @ git+https://github.com/robamu-org/tmtccmd@v4.0.0a1 - tmtccmd @ git+https://github.com/robamu-org/tmtccmd@152ecf9ffe0#egg=tmtccmd + tmtccmd @ git+https://github.com/robamu-org/tmtccmd@fa3c006d3ed#egg=tmtccmd packages = find: python_requires = >=3.10 include_package_data = True From a3eb34a73d4b2c998e386b077f6fc4c4b20ba9c9 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Thu, 19 Jan 2023 16:41:49 +0100 Subject: [PATCH 6/7] some ACS sets are diagnostic now --- eive_tmtc/tmtc/acs/acs_ctrl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eive_tmtc/tmtc/acs/acs_ctrl.py b/eive_tmtc/tmtc/acs/acs_ctrl.py index 3e0c955..daf645f 100644 --- a/eive_tmtc/tmtc/acs/acs_ctrl.py +++ b/eive_tmtc/tmtc/acs/acs_ctrl.py @@ -258,7 +258,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.ENABLE_RAW_GYR_HK: q.add_log_cmd(Info.ENABLE_RAW_GYR_HK) cmd_tuple = enable_periodic_hk_command_with_interval( - False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), 2.0 + True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET), 2.0 ) q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[1]) @@ -266,7 +266,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): q.add_log_cmd(Info.DISABLE_RAW_GYR_HK) q.add_pus_tc( disable_periodic_hk_command( - False, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET) + True, make_sid(ACS_CONTROLLER, SetId.GYR_RAW_SET) ) ) elif op_code in OpCodes.REQUEST_PROC_GYR_HK: @@ -313,7 +313,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.ENABLE_MEKF_HK: q.add_log_cmd(Info.ENABLE_MEKF_HK) cmd_tuple = enable_periodic_hk_command_with_interval( - False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), 2.0 + True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA), 2.0 ) q.add_pus_tc(cmd_tuple[0]) q.add_pus_tc(cmd_tuple[1]) @@ -321,7 +321,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): q.add_log_cmd(Info.DISABLE_MEKF_HK) q.add_pus_tc( disable_periodic_hk_command( - False, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA) + True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA) ) ) elif op_code in OpCodes.REQUEST_CTRL_VAL_HK: From 3a60fd2d6dbb9add119397bda0d049b77409585b Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 20 Jan 2023 10:35:30 +0100 Subject: [PATCH 7/7] black --- eive_tmtc/pus_tc/devs/rtd.py | 2 +- eive_tmtc/tmtc/acs/acs_ctrl.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/eive_tmtc/pus_tc/devs/rtd.py b/eive_tmtc/pus_tc/devs/rtd.py index 239c7b9..a97f277 100644 --- a/eive_tmtc/pus_tc/devs/rtd.py +++ b/eive_tmtc/pus_tc/devs/rtd.py @@ -99,7 +99,7 @@ def pack_rtd_commands( ) ) if op_code in OpCode.WRITE_CONFIG: - command = object_id.as_bytes + struct.pack('!I', CommandId.WRITE_CONFIG) + command = object_id.as_bytes + struct.pack("!I", CommandId.WRITE_CONFIG) q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command)) diff --git a/eive_tmtc/tmtc/acs/acs_ctrl.py b/eive_tmtc/tmtc/acs/acs_ctrl.py index daf645f..86efc20 100644 --- a/eive_tmtc/tmtc/acs/acs_ctrl.py +++ b/eive_tmtc/tmtc/acs/acs_ctrl.py @@ -320,9 +320,7 @@ def pack_acs_ctrl_command(p: ServiceProviderParams): elif op_code in OpCodes.DISABLE_MEKF_HK: q.add_log_cmd(Info.DISABLE_MEKF_HK) q.add_pus_tc( - disable_periodic_hk_command( - True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA) - ) + disable_periodic_hk_command(True, make_sid(ACS_CONTROLLER, SetId.MEKF_DATA)) ) elif op_code in OpCodes.REQUEST_CTRL_VAL_HK: q.add_log_cmd(Info.REQUEST_CTRL_VAL_HK)