implemented stack 5v switch cmd

This commit is contained in:
Robin Müller 2022-01-27 15:59:19 +01:00
parent 50128b7304
commit e710390f53
2 changed files with 65 additions and 21 deletions

View File

@ -149,22 +149,49 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
service_tuple = ("TMP1075 2", op_code_dict)
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
op_code_dict_srv_p60 = {
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
P60OpCodes.STACK_3V3_ON.value: (
"P60 Dock: Turn stack 3V3 on",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
P60OpCodes.STACK_3V3_OFF.value: (
"P60 Dock: Turn stack 3V3 off",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
GomspaceOpCodes.PRINT_SWITCH_V_I.value: (
"P60 Dock: Print Switches, Voltages, Currents",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60)
op_code_dict = dict()
add_op_code_entry(
op_code_dict=op_code_dict,
keys="0",
info="P60 Tests",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_3V3_ON.value,
info="P60 Dock: Turn stack 3V3 on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_3V3_OFF.value,
info="P60 Dock: Turn stack 3V3 off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_5V_ON.value,
info="P60 Dock: Turn stack 5V on",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=P60OpCodes.STACK_5V_OFF.value,
info="P60 Dock: Turn stack 5V off",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_op_code_entry(
op_code_dict=op_code_dict,
keys=GomspaceOpCodes.PRINT_SWITCH_V_I.value,
info="P60 Dock: Print Switches, Voltages, Currents",
options={OpCodeDictKeys.TIMEOUT: 2.0},
)
add_service_op_code_entry(
srv_op_code_dict=service_op_code_dict,
name=CustomServiceList.P60DOCK.value,
info="P60 Device",
op_code_entry=op_code_dict,
)
op_code_dict_srv_pdu1 = {
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}),
@ -544,7 +571,6 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
op_code_dict_srv_syrlinks_handler,
)
service_op_code_dict[CustomServiceList.P60DOCK.value] = service_p60_tuple
service_op_code_dict[CustomServiceList.PDU1.value] = service_pdu1_tuple
# service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple

View File

@ -14,6 +14,8 @@ class P60OpCodes(enum.Enum):
TEST = "0"
STACK_3V3_ON = "1"
STACK_3V3_OFF = "2"
STACK_5V_ON = "3"
STACK_5V_OFF = "4"
class P60DockTestProcedure:
@ -29,7 +31,7 @@ class P60DockTestProcedure:
gnd_wdt_reset = False
ping = False
channel_3_off = False # pdu2
read_temperature1 = True
read_temperature1 = False
read_channel_3_state = False # pdu2
read_cur_lu_lim_0 = False
channel_3_on = False # pdu2
@ -81,7 +83,6 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
return
if op_code == P60OpCodes.STACK_3V3_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
command = pack_set_param_command(
@ -91,7 +92,24 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
return
if op_code == P60OpCodes.STACK_5V_ON.value:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 5V on"))
command = pack_set_param_command(
object_id,
P60DockConfigTable.out_en_10.parameter_address,
P60DockConfigTable.out_en_10.parameter_size,
Channel.on,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == P60OpCodes.STACK_5V_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 5V off"))
command = pack_set_param_command(
object_id,
P60DockConfigTable.out_en_10.parameter_address,
P60DockConfigTable.out_en_10.parameter_size,
Channel.off,
)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents")
@ -146,7 +164,7 @@ def pack_p60dock_test_into(object_id: bytearray, tc_queue: TcQueueT, op_code: st
tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
)
command = pack_get_param_command(
object_id,