From 7a56c604a6edbcb8a70cb1f8973b15bc2790da6d Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 20 Feb 2024 11:26:36 +0100 Subject: [PATCH] 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]: ") )