From 7a56c604a6edbcb8a70cb1f8973b15bc2790da6d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 20 Feb 2024 11:26:36 +0100 Subject: [PATCH 1/3] RW commanding fixes --- eive_tmtc/pus_tc/cmd_demux.py | 12 ++++++------ eive_tmtc/tmtc/acs/reaction_wheels.py | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/eive_tmtc/pus_tc/cmd_demux.py b/eive_tmtc/pus_tc/cmd_demux.py index 8abed29..d379ebd 100644 --- a/eive_tmtc/pus_tc/cmd_demux.py +++ b/eive_tmtc/pus_tc/cmd_demux.py @@ -198,29 +198,29 @@ def handle_acs_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: Lis ) if cmd_path_list[0] == "rws": - assert len(cmd_path_list) >= 3 + assert len(cmd_path_list) >= 2 if cmd_path_list[1] == "rw_assy": - assert len(cmd_path_list) >= 4 + assert len(cmd_path_list) >= 3 return pack_rw_ass_cmds( q=queue_helper, object_id=RW_ASSEMBLY, cmd_str=cmd_path_list[2] ) if cmd_path_list[1] == "rw_1": - assert len(cmd_path_list) >= 4 + assert len(cmd_path_list) >= 3 return create_single_rw_cmd( object_id=RW1_ID, rw_idx=1, q=queue_helper, cmd_str=cmd_path_list[2] ) if cmd_path_list[1] == "rw_2": - assert len(cmd_path_list) >= 4 + assert len(cmd_path_list) >= 3 return create_single_rw_cmd( object_id=RW2_ID, rw_idx=2, q=queue_helper, cmd_str=cmd_path_list[2] ) if cmd_path_list[1] == "rw_3": - assert len(cmd_path_list) >= 4 + assert len(cmd_path_list) >= 3 return create_single_rw_cmd( object_id=RW3_ID, rw_idx=3, q=queue_helper, cmd_str=cmd_path_list[2] ) if cmd_path_list[1] == "rw_4": - assert len(cmd_path_list) >= 4 + assert len(cmd_path_list) >= 3 return create_single_rw_cmd( object_id=RW4_ID, rw_idx=4, q=queue_helper, cmd_str=cmd_path_list[2] ) diff --git a/eive_tmtc/tmtc/acs/reaction_wheels.py b/eive_tmtc/tmtc/acs/reaction_wheels.py index ec635c2..e83bc2b 100644 --- a/eive_tmtc/tmtc/acs/reaction_wheels.py +++ b/eive_tmtc/tmtc/acs/reaction_wheels.py @@ -6,7 +6,7 @@ """ import enum import struct -from typing import List +from typing import List, Tuple from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID @@ -126,11 +126,11 @@ def create_reaction_wheel_assembly_node() -> CmdTreeNode: node = CmdTreeNode( "rw_assy", "Reaction Wheels Assembly", hide_children_which_are_leaves=True ) - node.add_child(CmdTreeNode(InfoAss.ON, OpCodesAss.ON)) - node.add_child(CmdTreeNode(InfoAss.NML, OpCodesAss.NML)) - node.add_child(CmdTreeNode(InfoAss.OFF, OpCodesAss.OFF)) - node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_UP, OpCodesAss.ALL_SPEED_UP)) - node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_OFF, OpCodesAss.ALL_SPEED_OFF)) + node.add_child(CmdTreeNode(OpCodesAss.ON, InfoAss.ON)) + node.add_child(CmdTreeNode(OpCodesAss.NML, InfoAss.NML)) + node.add_child(CmdTreeNode(OpCodesAss.OFF, InfoAss.OFF)) + node.add_child(CmdTreeNode(OpCodesAss.ALL_SPEED_UP, InfoAss.ALL_SPEED_UP)) + node.add_child(CmdTreeNode(OpCodesAss.ALL_SPEED_OFF, InfoAss.ALL_SPEED_OFF)) return node @@ -272,7 +272,7 @@ def pack_rw_ass_cmds(q: DefaultPusQueueHelper, object_id: bytes, cmd_str: str): ) -def prompt_speed_ramp_time() -> (int, int): +def prompt_speed_ramp_time() -> Tuple[int, int]: speed = int( input("Specify speed [0.1 RPM, 0 or range [-65000, -1000] and [1000, 65000]: ") ) -- 2.43.0 From f8c3172e7abac382ea49c65c4394ff16f0a98e49 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 20 Feb 2024 11:26:54 +0100 Subject: [PATCH 2/3] changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fafd6ae..ff18d79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ list yields a list of all related PRs for each release. # [unreleased] +## Fixed + +- RW commanding + # [v6.0.0] 2024-02-08 ## Changed -- 2.43.0 From d062a22a7ae70160cfe01fb87762008891e308ba Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 20 Feb 2024 11:29:20 +0100 Subject: [PATCH 3/3] delete old function --- eive_tmtc/tmtc/acs/reaction_wheels.py | 49 +-------------------------- 1 file changed, 1 insertion(+), 48 deletions(-) diff --git a/eive_tmtc/tmtc/acs/reaction_wheels.py b/eive_tmtc/tmtc/acs/reaction_wheels.py index e83bc2b..94f2036 100644 --- a/eive_tmtc/tmtc/acs/reaction_wheels.py +++ b/eive_tmtc/tmtc/acs/reaction_wheels.py @@ -10,8 +10,7 @@ from typing import List, Tuple from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID -from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry -from tmtccmd.config.tmtc import tmtc_definitions_provider +from tmtccmd.config import CmdTreeNode from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.pus.tc.s3_fsfw_hk import ( generate_one_hk_command, @@ -23,7 +22,6 @@ from tmtccmd.pus.tc.s3_fsfw_hk import ( from tmtccmd.pus.s8_fsfw_action import create_action_cmd from spacepackets.ecss.tc import PusTelecommand from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode, Subservice -from eive_tmtc.config.definitions import CustomServiceList from tmtccmd.util import ObjectIdU32 from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter @@ -134,51 +132,6 @@ def create_reaction_wheel_assembly_node() -> CmdTreeNode: return node -@tmtc_definitions_provider -def add_rw_cmds(defs: TmtcDefinitionWrapper): - oce = OpCodeEntry() - oce.add(info=InfoDev.SPEED, keys=OpCodesDev.SPEED) - oce.add(info=InfoDev.ON, keys=OpCodesDev.ON) - oce.add(info=InfoDev.OFF, keys=OpCodesDev.OFF) - oce.add(info=InfoDev.NML, keys=OpCodesDev.NML) - oce.add(info=InfoDev.REQ_TM, keys=OpCodesDev.REQ_TM) - oce.add(info=InfoDev.GET_STATUS, keys=OpCodesDev.GET_STATUS) - oce.add(info=InfoDev.GET_TM, keys=OpCodesDev.GET_TM) - oce.add(info=InfoDev.ENABLE_STATUS_HK, keys=OpCodesDev.ENABLE_STATUS_HK) - oce.add(info=InfoDev.DISABLE_STATUS_HK, keys=OpCodesDev.DISABLE_STATUS_HK) - defs.add_service( - name=CustomServiceList.REACTION_WHEEL_1.value, - info="Reaction Wheel 1", - op_code_entry=oce, - ) - defs.add_service( - name=CustomServiceList.REACTION_WHEEL_2.value, - info="Reaction Wheel 2", - op_code_entry=oce, - ) - defs.add_service( - name=CustomServiceList.REACTION_WHEEL_3.value, - info="Reaction Wheel 3", - op_code_entry=oce, - ) - defs.add_service( - name=CustomServiceList.REACTION_WHEEL_4.value, - info="Reaction Wheel 4", - op_code_entry=oce, - ) - oce = OpCodeEntry() - oce.add(info=InfoAss.ON, keys=OpCodesAss.ON) - oce.add(info=InfoAss.NML, keys=OpCodesAss.NML) - oce.add(info=InfoAss.OFF, keys=OpCodesAss.OFF) - oce.add(info=InfoAss.ALL_SPEED_UP, keys=OpCodesAss.ALL_SPEED_UP) - oce.add(info=InfoAss.ALL_SPEED_OFF, keys=OpCodesAss.ALL_SPEED_OFF) - defs.add_service( - name=CustomServiceList.RW_ASSEMBLY.value, - info="Reaction Wheel Assembly", - op_code_entry=oce, - ) - - def create_single_rw_cmd( # noqa C901: Complexity is okay here. object_id: bytes, rw_idx: int, q: DefaultPusQueueHelper, cmd_str: str ): -- 2.43.0