v1.9.0 #53

Merged
muellerr merged 354 commits from develop into master 2022-04-07 17:39:42 +02:00
2 changed files with 65 additions and 21 deletions
Showing only changes of commit e710390f53 - Show all commits

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_tuple = ("TMP1075 2", op_code_dict)
service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple service_op_code_dict[CustomServiceList.TMP1075_2.value] = service_tuple
op_code_dict_srv_p60 = { op_code_dict = dict()
"0": ("P60 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}), add_op_code_entry(
P60OpCodes.STACK_3V3_ON.value: ( op_code_dict=op_code_dict,
"P60 Dock: Turn stack 3V3 on", keys="0",
{OpCodeDictKeys.TIMEOUT: 2.0}, info="P60 Tests",
), options={OpCodeDictKeys.TIMEOUT: 2.0},
P60OpCodes.STACK_3V3_OFF.value: ( )
"P60 Dock: Turn stack 3V3 off", add_op_code_entry(
{OpCodeDictKeys.TIMEOUT: 2.0}, op_code_dict=op_code_dict,
), keys=P60OpCodes.STACK_3V3_ON.value,
GomspaceOpCodes.PRINT_SWITCH_V_I.value: ( info="P60 Dock: Turn stack 3V3 on",
"P60 Dock: Print Switches, Voltages, Currents", options={OpCodeDictKeys.TIMEOUT: 2.0},
{OpCodeDictKeys.TIMEOUT: 2.0}, )
), add_op_code_entry(
} op_code_dict=op_code_dict,
service_p60_tuple = ("P60 Device", op_code_dict_srv_p60) 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 = { op_code_dict_srv_pdu1 = {
"0": ("PDU1 Tests", {OpCodeDictKeys.TIMEOUT: 2.0}), "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, 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.PDU1.value] = service_pdu1_tuple
# service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple # service_op_code_dict[CustomServiceList.PDU2.value] = service_pdu2_tuple
service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple service_op_code_dict[CustomServiceList.HEATER.value] = service_heater_tuple

View File

@ -14,6 +14,8 @@ class P60OpCodes(enum.Enum):
TEST = "0" TEST = "0"
STACK_3V3_ON = "1" STACK_3V3_ON = "1"
STACK_3V3_OFF = "2" STACK_3V3_OFF = "2"
STACK_5V_ON = "3"
STACK_5V_OFF = "4"
class P60DockTestProcedure: class P60DockTestProcedure:
@ -29,7 +31,7 @@ class P60DockTestProcedure:
gnd_wdt_reset = False gnd_wdt_reset = False
ping = False ping = False
channel_3_off = False # pdu2 channel_3_off = False # pdu2
read_temperature1 = True read_temperature1 = False
read_channel_3_state = False # pdu2 read_channel_3_state = False # pdu2
read_cur_lu_lim_0 = False read_cur_lu_lim_0 = False
channel_3_on = False # pdu2 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, Channel.on,
) )
tc_queue.appendleft(command.pack_command_tuple()) tc_queue.appendleft(command.pack_command_tuple())
return
if op_code == P60OpCodes.STACK_3V3_OFF.value: if op_code == P60OpCodes.STACK_3V3_OFF.value:
tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off")) tc_queue.appendleft((QueueCommands.PRINT, "P60 Dock: Turning stack 3V3 off"))
command = pack_set_param_command( 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, Channel.off,
) )
tc_queue.appendleft(command.pack_command_tuple()) 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: if op_code == GomspaceOpCodes.PRINT_SWITCH_V_I.value:
tc_queue.appendleft( tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Print Switches, Voltages, Currents") (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()) tc_queue.appendleft(command.pack_command_tuple())
if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1: if P60DockTestProcedure.all or P60DockTestProcedure.read_temperature1:
tc_queue.appendleft( tc_queue.appendleft(
(QueueCommands.PRINT, "P60 Dock: Testing temperature reading") (QueueCommands.PRINT, "P60 Dock: Testing temperature reading")
) )
command = pack_get_param_command( command = pack_get_param_command(
object_id, object_id,