|
@@ -45,7 +45,11 @@ class SystemEdge:
|
|
|
flow_direction = 0
|
|
|
|
|
|
def __init__(self,parent, system_data):
|
|
|
+ # 边上经过(使用)的构件(JoinObject类型的弯头,变径, Pipe, Duct)
|
|
|
+ # 起点和终点是一个多通, 设备(完整的管子)
|
|
|
+ # 起点是多通或设备, 终点是构件(JoinObject类型的弯头,变径, Pipe, Duct) (不完整的管子)
|
|
|
self.system_data = system_data
|
|
|
+ # 所属的系统
|
|
|
self.parent = parent
|
|
|
|
|
|
def get_vertexs(self):
|
|
@@ -74,9 +78,9 @@ class SystemGraph:
|
|
|
def add_edge(self, c1, c2, elements):
|
|
|
"""
|
|
|
Create edge and add to system_edges list
|
|
|
- :param c1:
|
|
|
- :param c2:
|
|
|
- :param elements:
|
|
|
+ :param c1: 出发连接点
|
|
|
+ :param c2: 结束连接点
|
|
|
+ :param elements: 途径对象
|
|
|
:return:
|
|
|
"""
|
|
|
edge = SystemEdge(self,elements)
|
|
@@ -97,7 +101,7 @@ class SystemGraph:
|
|
|
open_pipes.append(vertex)
|
|
|
return open_pipes
|
|
|
|
|
|
-
|
|
|
+# 一层中的最终分块
|
|
|
class FloorGraph:
|
|
|
"""FLoor Graph.
|
|
|
May contain one or more SystemGraph.
|
|
@@ -114,7 +118,7 @@ class FloorGraph:
|
|
|
self.system_graphs = []
|
|
|
|
|
|
def get_floor_graphs(self):
|
|
|
- """Get current floor graph.
|
|
|
+ """Get current floor graph.(一个楼层的分块)
|
|
|
system_name,domain
|
|
|
"""
|
|
|
for connector in self.connector_data:
|
|
@@ -157,6 +161,7 @@ class FloorGraph:
|
|
|
next_element = self.get_element(next_connector.belong)
|
|
|
edge_elements.append(next_element)
|
|
|
other_connectors = self.get_other_connectors(next_connector)
|
|
|
+ # 终止条件:遇到设备或部件或遇到多通或堵头(join_object)
|
|
|
if systemutils.is_break_condition(next_element) or len(other_connectors) != 1:
|
|
|
print(next_connector.source_id)
|
|
|
next_connector.is_used = True
|
|
@@ -242,6 +247,7 @@ class GroupedSystemGraph:
|
|
|
edge.end_vertex=vertex2
|
|
|
self.connectedges.append(edge)
|
|
|
|
|
|
+# 全部楼层合并后的分块
|
|
|
class ProjectGraph:
|
|
|
'''
|
|
|
ProjectGraph contain more than one GroupedSystemGraph.
|