|
|
|
|
@ -1796,24 +1796,27 @@ def _route_track_min_capacity(route_track):
|
|
|
|
|
return min(capacities)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _route_capacity_pressure_summary(report, lane_summary):
|
|
|
|
|
if not lane_summary:
|
|
|
|
|
return {}
|
|
|
|
|
max_parallel_wires = int(lane_summary.get("max_lane_index", 0) or 0) + 1
|
|
|
|
|
min_capacity = None
|
|
|
|
|
def _route_capacity_pressure_summary(report):
|
|
|
|
|
pressure = {}
|
|
|
|
|
for route in report.get("routes", []) or []:
|
|
|
|
|
if not isinstance(route, dict):
|
|
|
|
|
continue
|
|
|
|
|
lane = route.get("lane", {})
|
|
|
|
|
if not isinstance(lane, dict):
|
|
|
|
|
continue
|
|
|
|
|
try:
|
|
|
|
|
max_parallel_wires = int(lane.get("index", 0) or 0) + 1
|
|
|
|
|
except Exception:
|
|
|
|
|
max_parallel_wires = 1
|
|
|
|
|
route_capacity = _route_track_min_capacity(route.get("route_track", {}))
|
|
|
|
|
if route_capacity is None:
|
|
|
|
|
if route_capacity is None or max_parallel_wires <= route_capacity:
|
|
|
|
|
continue
|
|
|
|
|
min_capacity = route_capacity if min_capacity is None else min(min_capacity, route_capacity)
|
|
|
|
|
if min_capacity is None or max_parallel_wires <= min_capacity:
|
|
|
|
|
return {}
|
|
|
|
|
return {
|
|
|
|
|
"max_parallel_wires": max_parallel_wires,
|
|
|
|
|
"min_capacity": min_capacity,
|
|
|
|
|
}
|
|
|
|
|
if not pressure or max_parallel_wires > pressure.get("max_parallel_wires", 0):
|
|
|
|
|
pressure = {
|
|
|
|
|
"max_parallel_wires": max_parallel_wires,
|
|
|
|
|
"min_capacity": route_capacity,
|
|
|
|
|
}
|
|
|
|
|
return pressure
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def format_eplan_connection_route_report(report):
|
|
|
|
|
@ -1873,7 +1876,7 @@ def format_eplan_connection_route_report(report):
|
|
|
|
|
lane_summary.get("max_lane_index", 0),
|
|
|
|
|
float(lane_summary.get("spacing_mm", 0.0) or 0.0),
|
|
|
|
|
)
|
|
|
|
|
capacity_pressure = _route_capacity_pressure_summary(report, lane_summary)
|
|
|
|
|
capacity_pressure = _route_capacity_pressure_summary(report)
|
|
|
|
|
if capacity_pressure:
|
|
|
|
|
message += "\n容量提示:最大并行线数 {0},路径最小容量 {1}。".format(
|
|
|
|
|
capacity_pressure.get("max_parallel_wires", 0),
|
|
|
|
|
|