|
@@ -4,6 +4,8 @@
|
|
* 创建时间: 2019/1/4 17:50:04
|
|
* 创建时间: 2019/1/4 17:50:04
|
|
* 版本号:v1.0
|
|
* 版本号:v1.0
|
|
* -------------------------------------------------------------------------*/
|
|
* -------------------------------------------------------------------------*/
|
|
|
|
+
|
|
|
|
+using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
using System.Text.RegularExpressions;
|
|
@@ -126,6 +128,39 @@ namespace SAGA.GplotRelationComputerManage
|
|
return m_StartNodes = startNodes;
|
|
return m_StartNodes = startNodes;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private List<StringFlag<Element>> m_RoomStartElements;
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 获取机房开始元素
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="relationSetting"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ private List<Element> GetRoomStartNodes(RelationTypeShell relationSetting)
|
|
|
|
+ {
|
|
|
|
+ if (m_RoomStartElements == null)
|
|
|
|
+ {
|
|
|
|
+ m_RoomStartElements = new List<StringFlag<Element>>();
|
|
|
|
+ ElementCategoryFilter pipeFilter = new ElementCategoryFilter(BuiltInCategory.OST_PipeAccessory);
|
|
|
|
+ ElementCategoryFilter ductFilter = new ElementCategoryFilter(BuiltInCategory.OST_DuctAccessory);
|
|
|
|
+ ElementFilter filter = new LogicalOrFilter(pipeFilter, ductFilter);
|
|
|
|
+ var specialValves = Document.FilterElements(filter).Where(f => SystemCalcUtil.IsStart(f));
|
|
|
|
+ foreach (var familyInstance in specialValves)
|
|
|
|
+ {
|
|
|
|
+ var connector = familyInstance.GetAllConnectors()
|
|
|
|
+ .FirstOrDefault(c => Regex.IsMatch(c.Description, AppSetting.SourceFlag));
|
|
|
|
+ if (connector == null)
|
|
|
|
+ continue;
|
|
|
|
+ var node = SystemParseManager.CreateTreeNode(familyInstance, connector, e => e is MEPCurve);
|
|
|
|
+ var useMepCurve = node.GetLeaves().FirstOrDefault()?.Current as MEPCurve;
|
|
|
|
+ if (useMepCurve == null)
|
|
|
|
+ continue;
|
|
|
|
+ var systemTypeName = useMepCurve.GetSystemTypeName();
|
|
|
|
+ m_RoomStartElements.Add(new StringFlag<Element>(systemTypeName, familyInstance));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return m_RoomStartElements.Where(f => relationSetting.IsMatchSystem(f.Flag)).Select(f => f.Instance)
|
|
|
|
+ .ToList();
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 设备节点获取
|
|
#region 设备节点获取
|
|
@@ -202,7 +237,7 @@ namespace SAGA.GplotRelationComputerManage
|
|
var relationType = relationSetting.RelationItem.Type;
|
|
var relationType = relationSetting.RelationItem.Type;
|
|
List<FloorDrawRecord> drawRecords = new List<FloorDrawRecord>();
|
|
List<FloorDrawRecord> drawRecords = new List<FloorDrawRecord>();
|
|
List<FloorRelationRecord> relationRecords = new List<FloorRelationRecord>();
|
|
List<FloorRelationRecord> relationRecords = new List<FloorRelationRecord>();
|
|
- List<Element> roomStartElements = new List<Element>();
|
|
|
|
|
|
+ //List<Element> roomStartElements = new List<Element>();
|
|
#region 计算拓扑树形结构
|
|
#region 计算拓扑树形结构
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -220,10 +255,10 @@ namespace SAGA.GplotRelationComputerManage
|
|
if (useRelation == null)
|
|
if (useRelation == null)
|
|
continue;
|
|
continue;
|
|
//加入开始元素
|
|
//加入开始元素
|
|
- if (startNode.Instance.Current is FamilyInstance)
|
|
|
|
- {
|
|
|
|
- roomStartElements.Add(startNode.Instance.Current);
|
|
|
|
- }
|
|
|
|
|
|
+ //if (startNode.Instance.Current is FamilyInstance)
|
|
|
|
+ //{
|
|
|
|
+ // roomStartElements.Add(startNode.Instance.Current);
|
|
|
|
+ //}
|
|
if (useIds.Any(id => id == startNode.Instance.Current.Id.IntegerValue))
|
|
if (useIds.Any(id => id == startNode.Instance.Current.Id.IntegerValue))
|
|
{
|
|
{
|
|
continue;
|
|
continue;
|
|
@@ -236,10 +271,6 @@ namespace SAGA.GplotRelationComputerManage
|
|
|
|
|
|
var tempIds = SystemParseManager.BuildSystemNode(startNode.Instance, useDomain,
|
|
var tempIds = SystemParseManager.BuildSystemNode(startNode.Instance, useDomain,
|
|
(m => !startNode.Flag.Equals(m.GetSystemTypeName())));
|
|
(m => !startNode.Flag.Equals(m.GetSystemTypeName())));
|
|
- if (tempIds.Any(d => d == 534844|| d == 534845))
|
|
|
|
- {
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
startNode.Instance.PipeSystemTypeName = startNode.Flag;
|
|
startNode.Instance.PipeSystemTypeName = startNode.Flag;
|
|
BuildElementNodeData(context, startNode.Instance);
|
|
BuildElementNodeData(context, startNode.Instance);
|
|
useIds.AddRange(tempIds);
|
|
useIds.AddRange(tempIds);
|
|
@@ -270,7 +301,7 @@ namespace SAGA.GplotRelationComputerManage
|
|
|
|
|
|
|
|
|
|
#region 解析机房数据
|
|
#region 解析机房数据
|
|
-
|
|
|
|
|
|
+ var roomStartElements = GetRoomStartNodes(relationSetting);
|
|
var useEquipments = ParseMachineRoomData2(context, relationSetting, roomStartElements);
|
|
var useEquipments = ParseMachineRoomData2(context, relationSetting, roomStartElements);
|
|
useEquipments = useEquipments.Distinct().ToList();
|
|
useEquipments = useEquipments.Distinct().ToList();
|
|
#endregion
|
|
#endregion
|
|
@@ -697,7 +728,7 @@ namespace SAGA.GplotRelationComputerManage
|
|
relationRecord.RelationItems.Add(node);
|
|
relationRecord.RelationItems.Add(node);
|
|
var newIds = new List<string>() { item.EquipmentItem1.Id, item.EquipmentItem2.Id };
|
|
var newIds = new List<string>() { item.EquipmentItem1.Id, item.EquipmentItem2.Id };
|
|
useEquipments.AddRange(newIds);
|
|
useEquipments.AddRange(newIds);
|
|
- }
|
|
|
|
|
|
+ }
|
|
context[relationType].MachineRoomRelationRecords.Add(relationRecord);
|
|
context[relationType].MachineRoomRelationRecords.Add(relationRecord);
|
|
#endregion
|
|
#endregion
|
|
|
|
|