old API
This commit is contained in:
parent
927508e65d
commit
8bc51b293b
@ -26,7 +26,9 @@ class SwitchNumbers:
|
|||||||
|
|
||||||
|
|
||||||
class OpCodes:
|
class OpCodes:
|
||||||
HEATER_CMD = ["0", "heater-cmd"]
|
HEATER_CMD = ["0", "switch-cmd"]
|
||||||
|
HEATER_EXT_CTRL = ["1", "heater-ext-ctrl"]
|
||||||
|
HEATER_FAULTY_CMD = ["2", "set-faulty"]
|
||||||
|
|
||||||
|
|
||||||
class Info:
|
class Info:
|
||||||
@ -50,7 +52,8 @@ def add_heater_cmds(cmd_dict: ServiceOpCodeDictT):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def pack_heater_cmds(object_id: bytearray, tc_queue: TcQueueT):
|
def pack_heater_cmds(object_id: bytearray, op_code: str, tc_queue: TcQueueT):
|
||||||
|
if op_code in OpCodes.HEATER_CMD:
|
||||||
tc_queue.appendleft((QueueCommands.PRINT, "Heater Switching"))
|
tc_queue.appendleft((QueueCommands.PRINT, "Heater Switching"))
|
||||||
while True:
|
while True:
|
||||||
heater_number = input("Type number of heater to switch [0-7]: ")
|
heater_number = input("Type number of heater to switch [0-7]: ")
|
||||||
@ -80,15 +83,17 @@ def pack_heater_cmds(object_id: bytearray, tc_queue: TcQueueT):
|
|||||||
tc_queue.appendleft((QueueCommands.PRINT, debug_string))
|
tc_queue.appendleft((QueueCommands.PRINT, debug_string))
|
||||||
command = pack_switch_heater_command(object_id, heater_number, action)
|
command = pack_switch_heater_command(object_id, heater_number, action)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
if op_code in OpCodes.HEATER_EXT_CTRL:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
def pack_switch_heater_command(
|
def pack_switch_heater_command(
|
||||||
object_id: bytes, switch_nr: int, switch_action: int
|
object_id: bytes, switch_nr: int, switch_action: int
|
||||||
) -> PusTelecommand:
|
) -> PusTelecommand:
|
||||||
"""Function to generate the command switch a heater
|
"""Function to generate a heater switch command.
|
||||||
@param object_id The object id of the HeaterHandler object.
|
:param object_id: The object id of the HeaterHandler object.
|
||||||
@param switch_nr The switch number identifying the heater to switch
|
:param switch_nr: The switch number identifying the heater to switch
|
||||||
@param switch_action Action to perform. 0 - Sets switch off, 1 - Sets switch on.
|
:param switch_action: Action to perform. 0 - Sets switch off, 1 - Sets switch on.
|
||||||
"""
|
"""
|
||||||
command = bytearray()
|
command = bytearray()
|
||||||
command.append(switch_nr)
|
command.append(switch_nr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user