|
|
|
|
@ -1354,6 +1354,23 @@ def route_eplan_connections_from_payload(doc, payload, options=None, prepared_la
|
|
|
|
|
return report
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _missing_endpoint_label(sample, side):
|
|
|
|
|
terminal_uuid = str(sample.get("{0}_terminal_uuid".format(side), "") or "").strip()
|
|
|
|
|
element_uuid = str(sample.get("{0}_element_uuid".format(side), "") or "").strip()
|
|
|
|
|
terminal_display = str(sample.get("{0}_terminal_display".format(side), "") or "").strip()
|
|
|
|
|
if element_uuid and terminal_display:
|
|
|
|
|
label = "{0}/{1}".format(element_uuid, terminal_display)
|
|
|
|
|
elif terminal_display:
|
|
|
|
|
label = terminal_display
|
|
|
|
|
elif element_uuid:
|
|
|
|
|
label = element_uuid
|
|
|
|
|
else:
|
|
|
|
|
return terminal_uuid
|
|
|
|
|
if terminal_uuid and terminal_uuid != label:
|
|
|
|
|
return "{0} ({1})".format(label, terminal_uuid)
|
|
|
|
|
return label
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_eplan_connection_route_report(report):
|
|
|
|
|
message = "批量生成布线连接完成:routed={0}, collision_warnings={1}, missing_terminals={2}".format(
|
|
|
|
|
report.get("routed", 0),
|
|
|
|
|
@ -1441,8 +1458,8 @@ def format_eplan_connection_route_report(report):
|
|
|
|
|
sample = (report.get("missing_endpoint_samples") or [None])[0]
|
|
|
|
|
if sample:
|
|
|
|
|
message += "\n缺失示例:{0} -> {1}".format(
|
|
|
|
|
sample.get("start_terminal_uuid", ""),
|
|
|
|
|
sample.get("end_terminal_uuid", ""),
|
|
|
|
|
_missing_endpoint_label(sample, "start"),
|
|
|
|
|
_missing_endpoint_label(sample, "end"),
|
|
|
|
|
)
|
|
|
|
|
return message
|
|
|
|
|
|
|
|
|
|
|