|
@@ -183,23 +183,23 @@ def get_connectors_data(model_id, system_name, domain):
|
|
connector_data=list(map(systemutils.dic2obj, connector_data))
|
|
connector_data=list(map(systemutils.dic2obj, connector_data))
|
|
return connector_data
|
|
return connector_data
|
|
|
|
|
|
-def save_project_data(project_graph,system_name,domain,build_id):
|
|
|
|
|
|
+def save_project_data(project_graph,system_name,domain,building_id):
|
|
"""
|
|
"""
|
|
Sava project graph data.
|
|
Sava project graph data.
|
|
:param floor_graph:
|
|
:param floor_graph:
|
|
:return:
|
|
:return:
|
|
"""
|
|
"""
|
|
- del_project_data(project_graph.project_id,system_name,domain,build_id)
|
|
|
|
|
|
+ del_project_data(project_graph.project_id,system_name,domain,building_id)
|
|
# Create
|
|
# Create
|
|
block_id=0
|
|
block_id=0
|
|
for g in project_graph.groupedsystemgraphs:
|
|
for g in project_graph.groupedsystemgraphs:
|
|
for s in g.systemgraphs:
|
|
for s in g.systemgraphs:
|
|
for e in s.system_edges:
|
|
for e in s.system_edges:
|
|
- save_edge_data(e, block_id,build_id)
|
|
|
|
|
|
+ save_edge_data(e, block_id,building_id)
|
|
for e in g.connectedges:
|
|
for e in g.connectedges:
|
|
- save_edge_data(e,block_id,build_id)
|
|
|
|
|
|
+ save_edge_data(e,block_id,building_id)
|
|
block_id+=1
|
|
block_id+=1
|
|
-def save_edge_data(edge,block_id,build_id):
|
|
|
|
|
|
+def save_edge_data(edge,block_id,building_id):
|
|
"""
|
|
"""
|
|
Save edge info using sql
|
|
Save edge info using sql
|
|
:param edge:
|
|
:param edge:
|
|
@@ -218,7 +218,7 @@ def save_edge_data(edge,block_id,build_id):
|
|
sql="insert into revit_calc.connected_block" \
|
|
sql="insert into revit_calc.connected_block" \
|
|
"(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id,mep_system_type,domain,building_id) values " \
|
|
"(id1,type1,model_id1,id2,type2,model_id2,block_id,project_id,mep_system_type,domain,building_id) values " \
|
|
"('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')"\
|
|
"('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')"\
|
|
- %(c1.id,c1.type,model1.model_id,c2.id,c2.type,model2.model_id,block_id,model1.project_id,floor1.system_name,floor1.domain,build_id)
|
|
|
|
|
|
+ %(c1.id,c1.type,model1.model_id,c2.id,c2.type,model2.model_id,block_id,model1.project_id,floor1.system_name,floor1.domain,building_id)
|
|
data = test.save_data(sql)
|
|
data = test.save_data(sql)
|
|
except Exception as e:
|
|
except Exception as e:
|
|
print(e)
|
|
print(e)
|
|
@@ -235,7 +235,7 @@ def del_project_data(project_id,system_name,domain,building_id):
|
|
"and ('%s' is null or building_id='%s')" \
|
|
"and ('%s' is null or building_id='%s')" \
|
|
% (project_id,system_name,domain,building_id,building_id)
|
|
% (project_id,system_name,domain,building_id,building_id)
|
|
test.save_data(sql)
|
|
test.save_data(sql)
|
|
-def get_connected_block_data(project_id,block_id,system_name,domain,building_id):
|
|
|
|
|
|
+def get_connected_block_data(project_id,building_id,block_id,system_name,domain):
|
|
'''
|
|
'''
|
|
Get all the connected_block .
|
|
Get all the connected_block .
|
|
:param project_id:
|
|
:param project_id:
|
|
@@ -270,7 +270,7 @@ def get_connected_block_data(project_id,block_id,system_name,domain,building_id)
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data.extend(get_dicdata(sql, KEYS))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|
|
element_data = list(map(systemutils.dic2obj, element_data))
|
|
return element_data
|
|
return element_data
|
|
-def get_connected_block_source_data(project_id,block_id,system_name,domain,building_id):
|
|
|
|
|
|
+def get_connected_block_source_data(project_id,building_id,block_id,system_name,domain):
|
|
'''
|
|
'''
|
|
Get all the connected_block source .
|
|
Get all the connected_block source .
|
|
:param project_id:
|
|
:param project_id:
|