diff --git a/.run/RW All Off.run.xml b/.run/RW All Off.run.xml new file mode 100644 index 0000000..482a5e7 --- /dev/null +++ b/.run/RW All Off.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.run/RW All On.run.xml b/.run/RW All On.run.xml new file mode 100644 index 0000000..bc80f1a --- /dev/null +++ b/.run/RW All On.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.run/RW2.run.xml b/.run/RW2.run.xml new file mode 100644 index 0000000..58e7433 --- /dev/null +++ b/.run/RW2.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.run/RW3.run.xml b/.run/RW3.run.xml new file mode 100644 index 0000000..7548b59 --- /dev/null +++ b/.run/RW3.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/.run/RW4.run.xml b/.run/RW4.run.xml new file mode 100644 index 0000000..2ada545 --- /dev/null +++ b/.run/RW4.run.xml @@ -0,0 +1,24 @@ + + + + + \ No newline at end of file diff --git a/tmtc/reaction_wheels.py b/tmtc/reaction_wheels.py index ce8211a..74987d1 100644 --- a/tmtc/reaction_wheels.py +++ b/tmtc/reaction_wheels.py @@ -126,6 +126,8 @@ def add_rw_cmds(defs: TmtcDefinitionWrapper): 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", @@ -137,12 +139,7 @@ def pack_single_rw_test_into( object_id: bytes, rw_idx: int, q: DefaultPusQueueHelper, op_code: str ): if op_code in OpCodesDevs.SPEED: - speed = int( - input( - "Specify speed [0.1 RPM, 0 or range [-65000, -1000] and [1000, 65000]: " - ) - ) - ramp_time = int(input("Specify ramp time [ms, range [10, 20000]]: ")) + speed, ramp_time = prompt_speed_ramp_time() q.add_log_cmd( f"RW {rw_idx}: {InfoDevs.SPEED} with target " f"speed {speed / 10.0} RPM and {ramp_time} ms ramp time" @@ -218,9 +215,23 @@ def pack_rw_ass_cmds(q: DefaultPusQueueHelper, object_id: bytes, op_code: str): ) ) if op_code in OpCodesAss.ALL_SPEED_UP: - rw_speed_up_cmd_consec(q, [RW1_ID, RW2_ID, RW3_ID, RW4_ID], 65000, 10000) + speed, ramp_time = prompt_speed_ramp_time() + rw_speed_up_cmd_consec(q, [RW1_ID, RW2_ID, RW3_ID, RW4_ID], speed, ramp_time) if op_code in OpCodesAss.ALL_SPEED_OFF: - rw_speed_down_cmd_consec(q, [RW1_ID, RW2_ID, RW3_ID, RW4_ID], 10000) + rw_speed_down_cmd_consec( + q, [RW1_ID, RW2_ID, RW3_ID, RW4_ID], prompt_ramp_time() + ) + + +def prompt_speed_ramp_time() -> (int, int): + speed = int( + input("Specify speed [0.1 RPM, 0 or range [-65000, -1000] and [1000, 65000]: ") + ) + return speed, prompt_ramp_time() + + +def prompt_ramp_time() -> int: + return int(input("Specify ramp time [ms, range [10, 20000]]: ")) def pack_set_speed_command(