pdu channel definitions

This commit is contained in:
Martin Zietz 2021-04-18 16:35:18 +02:00
parent 80ee42089e
commit 85f5bf2e6e
3 changed files with 20 additions and 8 deletions

View File

@ -6,6 +6,11 @@ class PDUConfigTable:
out_en_1 = TableEntry(bytearray([0x00, 0x49]), TableEntry.uint8_size)
out_en_2 = TableEntry(bytearray([0x00, 0x4A]), TableEntry.uint8_size)
out_en_3 = TableEntry(bytearray([0x00, 0x4B]), TableEntry.uint8_size)
out_en_4 = TableEntry(bytearray([0x00, 0x4C]), TableEntry.uint8_size)
out_en_5 = TableEntry(bytearray([0x00, 0x4D]), TableEntry.uint8_size)
out_en_6 = TableEntry(bytearray([0x00, 0x4E]), TableEntry.uint8_size)
out_en_7 = TableEntry(bytearray([0x00, 0x4F]), TableEntry.uint8_size)
out_en_8 = TableEntry(bytearray([0x00, 0x50]), TableEntry.uint8_size)
# When channel consumes more than cur_lu_lim, channel is turned of immediately
cur_lu_lim_0 = TableEntry(bytearray([0x00, 0xB8]), TableEntry.uint16_size)

View File

@ -24,6 +24,8 @@ class PDU1TestProcedure:
reboot = False
ping = False
read_temperature = False
turn_channel_2_on = True # MTQ connected to this channel (5V)
turn_channel_2_on = False
def pack_pdu1_test_into(
@ -31,14 +33,6 @@ def pack_pdu1_test_into(
):
tc_queue.appendleft((QueueCommands.PRINT, "Testing PDU1"))
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Enabling PDU1"))
command = pack_set_param_command(
p60dock_object_id, P60DockConfigTable.out_en_1.parameter_address,
P60DockConfigTable.out_en_1.parameter_size, Channel.on
)
command = PusTelecommand(service=8, subservice=128, ssc=23, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.ping:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Ping Test"))
ping_data = bytearray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
@ -53,3 +47,15 @@ def pack_pdu1_test_into(
)
command = PusTelecommand(service=8, subservice=128, ssc=24, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_on:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 on (MTQ)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.on)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if PDU1TestProcedure.all or PDU1TestProcedure.turn_channel_2_off:
tc_queue.appendleft((QueueCommands.PRINT, "PDU1: Turn channel 2 off (MTQ)"))
command = pack_set_param_command(pdu1_object_id, PDUConfigTable.out_en_2.parameter_address,
PDUConfigTable.out_en_2.parameter_size, Channel.off)
command = PusTelecommand(service=8, subservice=128, ssc=27, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())

View File

@ -101,4 +101,5 @@ def pack_pdu2_test_into(pdu2_object_id: bytearray, p60dock_object_id: bytearray,
command = pack_request_full_hk_table_command(pdu2_object_id)
command = PusTelecommand(service=8, subservice=128, ssc=28, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue