Tunnel Indizes in Ausgabe todraw hinzugefügr, damit Tunnel anders o. garnicht gezeichnet werden können
This commit is contained in:
+16
-2
@@ -447,6 +447,14 @@ class Anlage():
|
||||
return errors
|
||||
|
||||
|
||||
def coord_is_in_tunnel(self, coord):
|
||||
for tname, pos in self._tunnels.items():
|
||||
if coord == pos[0]:
|
||||
return True
|
||||
elif coord == pos[1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
||||
def join_racks(self):
|
||||
@@ -590,12 +598,18 @@ class Anlage():
|
||||
pfade["errors_routing"].append((sname, dname))
|
||||
continue
|
||||
pfad_coords = self._nodeids.get_points(pfad_nodes)
|
||||
#tuplecoords = [(p.x, p.y) for p in pfad_coords]
|
||||
|
||||
ld = dict()
|
||||
|
||||
ld['id'] = f"{dname}-{sname}"
|
||||
ld["coords"]= [{"x":round(p.x,1), "y":round(p.y,1)} for p in pfad_coords]
|
||||
ld["length"]= round(pfad_length,1)
|
||||
ld["nodes"]=pfad_nodes
|
||||
#ld["nodes"]=pfad_nodes
|
||||
ld['tunnel_indices'] = list()
|
||||
for i, p in enumerate(pfad_coords):
|
||||
if self.coord_is_in_tunnel(p):
|
||||
ld['tunnel_indices'].append(i)
|
||||
|
||||
pfade["kabel"].append(ld)
|
||||
|
||||
return pfade
|
||||
|
||||
Reference in New Issue
Block a user