heater selection input
This commit is contained in:
parent
4433fb68ac
commit
e19883d80f
@ -14,12 +14,25 @@ class TestProcedure:
|
|||||||
"""
|
"""
|
||||||
@brief The variables in this class can be used to configure the heater test procedure.
|
@brief The variables in this class can be used to configure the heater test procedure.
|
||||||
"""
|
"""
|
||||||
on = False # All heaters will be turned on
|
allOn = False # All heaters will be turned on
|
||||||
off = True # All heaters will be turned off
|
allOff = False # All heaters will be turned off
|
||||||
|
# Set to true if a specific heater shall be set to on or off
|
||||||
|
singleHeaterOn = True
|
||||||
|
singleHeaterOff = False
|
||||||
|
# When in single heater test mode, define here the heater to switch
|
||||||
|
singleHeaterSelection = 0xFF
|
||||||
|
|
||||||
|
|
||||||
class SwitchNumbers:
|
class SwitchNumbers:
|
||||||
PAYLOAD_CAMERA_HEATER = 0
|
HEATER_0 = 0
|
||||||
|
HEATER_1 = 1
|
||||||
|
HEATER_2 = 2
|
||||||
|
HEATER_3 = 3
|
||||||
|
HEATER_4 = 4
|
||||||
|
HEATER_5 = 5
|
||||||
|
HEATER_6 = 6
|
||||||
|
HEATER_7 = 7
|
||||||
|
NUMBER_OF_SWITCHES = 8
|
||||||
|
|
||||||
|
|
||||||
class SwitchActions:
|
class SwitchActions:
|
||||||
@ -34,16 +47,18 @@ class ActionIds:
|
|||||||
def pack_heater_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
|
def pack_heater_test_into(object_id: bytearray, tc_queue: TcQueueT) -> TcQueueT:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Testing Heater Switching"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Testing Heater Switching"))
|
||||||
|
|
||||||
if TestProcedure.on:
|
heater_number = int(input("Type number of heater to switch: "))
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching on heater of payload camera"))
|
if heater_number >= SwitchNumbers.NUMBER_OF_SWITCHES:
|
||||||
command = pack_switch_heater_command(object_id, SwitchNumbers.PAYLOAD_CAMERA_HEATER, SwitchActions.ON)
|
print("Invalid heater switch number")
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=300, app_data=command)
|
return
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
action = int(input("Turn switch on or off? (0 - off, 1 - on): "))
|
||||||
if TestProcedure.off:
|
if action != 0 and action != 1:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Switching off heater of payload camera"))
|
print("Invalid action defined. Must be 0 (off) or 1 (on")
|
||||||
command = pack_switch_heater_command(object_id, SwitchNumbers.PAYLOAD_CAMERA_HEATER, SwitchActions.OFF)
|
debug_string = "Switching heater " + str(heater_number)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=301, app_data=command)
|
tc_queue.appendleft((QueueCommands.PRINT, debug_string))
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
command = pack_switch_heater_command(object_id, heater_number, action)
|
||||||
|
command = PusTelecommand(service=8, subservice=128, ssc=300, app_data=command)
|
||||||
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
|
|
||||||
def pack_switch_heater_command(object_id: bytearray, switch_nr: int, switch_action: int) -> bytearray:
|
def pack_switch_heater_command(object_id: bytearray, switch_nr: int, switch_action: int) -> bytearray:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user