rw test fixes

This commit is contained in:
Martin Zietz 2021-06-25 15:25:22 +02:00
parent 899cd942ce
commit 19b76d961c
4 changed files with 17 additions and 11 deletions

View File

@ -17,12 +17,12 @@ HEATER_ID = bytes([0x54, 0x00, 0x00, 0x1])
PCDU_HANDLER_ID = bytes([0x44, 0x00, 0x10, 0x00])
SOLAR_ARRAY_DEPLOYMENT_ID = bytes([0x44, 0x00, 0x10, 0x01])
SYRLINKS_HANDLER = bytes([0x44, 0x00, 0x10, 0x02])
IMTQ_HANDLER_ID = bytearray([0x44, 0x00, 0x00, 0x14])
PLOC_ID = bytearray([0x44, 0x00, 0x00, 0x15])
RW1_ID = bytearray([0x44, 0x21, 0x00, 0x1])
RW2_ID = bytearray([0x44, 0x21, 0x00, 0x2])
RW3_ID = bytearray([0x44, 0x21, 0x00, 0x3])
RW4_ID = bytearray([0x44, 0x21, 0x00, 0x4])
IMTQ_HANDLER_ID = bytes([0x44, 0x00, 0x00, 0x14])
PLOC_ID = bytes([0x44, 0x00, 0x00, 0x15])
RW1_ID = bytes([0x44, 0x21, 0x00, 0x1])
RW2_ID = bytes([0x44, 0x21, 0x00, 0x2])
RW3_ID = bytes([0x44, 0x21, 0x00, 0x3])
RW4_ID = bytes([0x44, 0x21, 0x00, 0x4])
def get_object_ids() -> Dict[bytes, list]:
@ -38,5 +38,9 @@ def get_object_ids() -> Dict[bytes, list]:
HEATER_ID: "Heater",
PCDU_HANDLER_ID: "PCDU",
SOLAR_ARRAY_DEPLOYMENT_ID: "Solar Array Deployment",
RW1_ID: "Reaction Wheel 1",
RW2_ID: "Reaction Wheel 2",
RW3_ID: "Reaction Wheel 3",
RW4_ID: "Reaction Wheel 4",
})
return object_id_dict

View File

@ -32,7 +32,7 @@ class SpeedDefinitions:
class RampTime:
MS_100 = 100
MS_1000 = 1000
def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: str) -> TcQueueT:
@ -43,7 +43,7 @@ def pack_single_rw_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code:
if op_code == "0" or op_code == "1":
tc_queue.appendleft((QueueCommands.PRINT, "Reaction Wheel: Set speed"))
command = pack_set_speed_command(SpeedDefinitions.RPM_100, RampTime.MS_100)
command = pack_set_speed_command(object_id, 10000, 1000)
command = PusTelecommand(service=8, subservice=128, ssc=40, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
@ -60,6 +60,6 @@ def pack_set_speed_command(object_id: bytearray, speed: int, ramp_time: int) ->
command_id = RwCommandIds.SET_SPEED
command = bytearray()
command = object_id + command_id
command.extend(speed.to_bytes(length=4, byteorder='big'))
command.extend(ramp_time.to_bytes(length=2, byteorder='big'))
command = command + speed.to_bytes(length=4, byteorder='big')
command = command + ramp_time.to_bytes(length=2, byteorder='big')
return command

View File

@ -22,6 +22,7 @@ from pus_tc.imtq import pack_imtq_test_into
from pus_tc.tmp1075 import pack_tmp1075_test_into
from pus_tc.ploc import pack_ploc_test_into
from pus_tc.heater import pack_heater_test_into
from pus_tc.reaction_wheels import pack_single_rw_test_into
from config.definitions import CustomServiceList
from config.object_ids import P60_DOCK_HANDLER, PDU_1_HANDLER_ID, PDU_2_HANDLER_ID, ACU_HANDLER_ID, \
TMP_1075_1_HANDLER_ID, TMP_1075_2_HANDLER_ID, HEATER_ID, IMTQ_HANDLER_ID, PLOC_ID, RW1_ID
@ -70,7 +71,7 @@ def pack_service_queue_user(service: Union[str, int], op_code: str, service_queu
return pack_ploc_test_into(object_id=object_id, tc_queue=service_queue)
if service == CustomServiceList.REACTION_WHEEL.value:
object_id = RW1_ID
return pack_ploc_test_into(object_id=object_id, tc_queue=service_queue)
return pack_single_rw_test_into(object_id=object_id, tc_queue=service_queue, op_code=op_code)
LOGGER.warning("Invalid Service !")

1
tmtc_core Submodule

@ -0,0 +1 @@
Subproject commit bd46c5a85262140ab097b2704926745e1a0687d1