瀏覽代碼

xls:修改解析代码

xulisong 6 年之前
父節點
當前提交
7cd759fc59

+ 7 - 0
MBI/MBIResource/Config/HttpSetting.ini

@@ -0,0 +1,7 @@
+[Configure]
+GoodHandLocalHost = http://service.sagacloud.cn:28888/godhand/
+DataPlatformLocalHost = http://service.sagacloud.cn:28888/
+ScanBuildingLocalHost = http://mbi.sagacloud.cn:8080/ScanBuilding/
+OssClientFileKey = files/revit/
+GplotViewHost = http://mbi.sagacloud.cn:8888/#/
+ImageServiceLocalHost = http://service.sagacloud.cn:28888/

+ 6 - 6
MBI/MBIResource/Config/HttpSetting.xml

@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="utf-16"?>
 <InnerSetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
-  <BaseAddress>http://service.sagacloud.cn:28888/venders</BaseAddress>
-  <DependencyAddress>http://service.sagacloud.cn:28888/venders-dp</DependencyAddress>
-  <EquipmentFamilyAddress> http://service.sagacloud.cn:28888/data-platform-3</EquipmentFamilyAddress>
-  <FileAddress>http://service.sagacloud.cn:28888</FileAddress>
-  <SaasAddress>http://mbi.sagacloud.cn:8080</SaasAddress>
-  <H5Address>http://mbi.sagacloud.cn:8889</H5Address>
+  <BaseAddress>http://192.168.20.225:8080/venders</BaseAddress>
+  <DependencyAddress>http://192.168.20.225:8080/venders-dp</DependencyAddress>
+  <EquipmentFamilyAddress>http://192.168.20.225:8080/data-platform-3</EquipmentFamilyAddress>
+  <FileAddress>http://192.168.30.96:8080</FileAddress>
+  <SaasAddress>http://192.168.30.96:8080</SaasAddress>
+  <H5Address>http://172.16.0.181:8889/#</H5Address>
 </InnerSetting>

+ 4 - 2
MBI/SAGA.DotNetUtils/Data/EdgesArray/EdgesArrayGraphUtil.cs

@@ -184,6 +184,7 @@ namespace SAGA.DotNetUtils.Data
                     {
                         next.Insert(0, new PathNode<V, E>(v, edge));
                     }
+                    list.AddRange(nextList);
                 }
             }
             return list;
@@ -220,11 +221,12 @@ namespace SAGA.DotNetUtils.Data
                 var v = edgesArray.FindVertex(anotherId)?.GetRoot() as V;
                 if (v == null)
                     continue;
-                if (prePath.Count > 1 && prePath[prePath.Count - 2].NextNode.Id == start.Id)
+                if (prePath.Count > 1 && prePath[prePath.Count - 1].NextNode.Id == anotherId)
                 {
+                    //或者不进行数量判断,弹药对NextNode进行非空判断
                     continue; 
                 }
-                if ((prePath.Any(n => n.NextNode.Id == start.Id)) ||(endPredicate != null && endPredicate(v)))
+                if ((prePath.Any(n => n.NextNode.Id == anotherId)) ||(endPredicate != null && endPredicate(v)))
                 {
                     PathNodes<V, E> nodes = new PathNodes<V, E>(prePath);
                     nodes.Add(new PathNode<V, E>(v, edge));

+ 0 - 8
MBI/SAGA.GplotDrawData/SAGA.GplotDrawData.csproj

@@ -84,7 +84,6 @@
     <Compile Include="DBView\PipeEndGraphView.cs" />
     <Compile Include="DBView\RoomGraphView.cs" />
     <Compile Include="DBView\SpaceGraphView.cs" />
-    <Compile Include="DBView\VerticalPipeGraphView.cs" />
     <Compile Include="DBView\VerticalSystemGraphView.cs" />
     <Compile Include="DBView\ViewExtension.cs" />
     <Compile Include="DBView\VirticalSpaceGraphView.cs" />
@@ -101,9 +100,6 @@
     <Compile Include="UcShowElement.xaml.cs">
       <DependentUpon>UcShowElement.xaml</DependentUpon>
     </Compile>
-    <Compile Include="WinDrawEndPoint-Web.xaml.cs">
-      <DependentUpon>WinDrawEndPoint-Web.xaml</DependentUpon>
-    </Compile>
     <Compile Include="WinDrawSpace-Web.xaml.cs">
       <DependentUpon>WinDrawSpace-Web.xaml</DependentUpon>
     </Compile>
@@ -141,10 +137,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="WinDrawEndPoint-Web.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="WinDrawSpace-Web.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 70 - 10
MBI/SAGA.GplotManage/SystemRelation/RelationDataUtil.cs

@@ -76,7 +76,7 @@ namespace SAGA.GplotManage
             #endregion
 
             var verticalSets = relationData.VerticalRelationRecords;
-            var cacheFloorDatas = new List<BinaryRelationItem>(floorRelations);
+         
             List < StringFlag <VerticalRelationRecord>> verticalNodes = new List<StringFlag<VerticalRelationRecord>>();
             #region 初始化立管节点
             foreach (var verticalRelationRecord in verticalSets)
@@ -87,10 +87,13 @@ namespace SAGA.GplotManage
             }
             #endregion
             #region 构建端部临时边集
+            var cacheFloorDatas = new List<BinaryRelationItem>(floorRelations);
             var endGraph = CreateGraph(verticalNodes, cacheFloorDatas);
             #endregion
-            var roomItems = machineRoomData.SelectMany(c => c.RelationItems).ToList();
-            var sourceGraph = CreateGraph(verticalNodes, roomItems);
+            #region 构建源部临时边集
+            var cacheSourceDatas = new List<BinaryRelationItem>(roomRelations);
+            var sourceGraph = CreateGraph(verticalNodes, cacheSourceDatas); 
+            #endregion
             //连接类型,以机房端类型为基准;
             #region 描述
             /*
@@ -100,10 +103,55 @@ namespace SAGA.GplotManage
              * 根据立管数据,在机房里找到机房设备数据,在平面找到平面数据
              */
             #endregion
+
             #region 机房和平面关联
-            foreach (var verticalNode in verticalNodes)
+            //合并分界点
+            #region 合并分界点
+            /*
+             * 1、取出所有立管,和特殊阀门
+             * 2、将产生关联的立管和特殊阀门合并
+             * 3、按分组去遍历源或端信息
+             */
+            List<List<string>> groupIds = new List<List<string>>();
+            //处理端部
+            foreach (var binaryRelationItem in cacheSourceDatas)
             {
-                var startNode = sourceGraph.FindVertex(verticalNode.Flag);
+                #region 描述
+                /*
+                 * 如果为空,就将其房屋groopIds
+                 */
+                #endregion
+                var nodes= new List<EquipmentNode>() {binaryRelationItem.From, binaryRelationItem.To};
+                foreach (var equipmentNode in nodes)
+                {
+                    if (!equipmentNode.IsRealEquipment)
+                    {
+                        var useId = equipmentNode.BimId;
+                        var verticalId = verticalNodes.FirstOrDefault(c => c.Instance.RelationItems.Contains(useId));
+                        if (verticalId != null)
+                        {
+                            useId = verticalId.Flag;
+                        }
+                        var group = groupIds.FirstOrDefault(c => c.Any(id => id == useId));
+                        if (group != null)
+                        {
+                            group.Add(useId);
+                        }
+                        else
+                        {
+                            groupIds.Add(new List<string>(){ useId });
+                        }
+                    }
+                }
+              
+            }
+            #endregion
+
+            foreach (var groupId in groupIds)
+            {
+                var startNode = sourceGraph.Vertexes.FirstOrDefault(v => groupId.Any(id => id == v.Id));
+                if (startNode == null)
+                    continue;
                 #region 源路径
                 var sourcePathNodes = sourceGraph.GetPaths2(startNode, end =>
                      {
@@ -153,11 +201,17 @@ namespace SAGA.GplotManage
                     {
                         continue;
                     }
+
+                    bool noResvse = useEdge.Path.ContainVertex(useEdge.NextNode.Id) == 0;
                     foreach (var equipmentNode in endNodes)
                     {
+                        if (!equipmentNode.IsRealEquipment)
+                        {
+                            continue;
+                        }
                         BinaryRelationItem item = new BinaryRelationItem();
                         item.RelationType = (useEdge.Path.Data as string) ?? string.Empty;
-                        if (useEdge.Path.ContainVertex(useEdge.NextNode.Id) == 0)
+                        if (noResvse)
                         {
                             item.From = useNode;
                             item.To = equipmentNode;
@@ -183,8 +237,14 @@ namespace SAGA.GplotManage
         private static SimpleObjectGraph CreateGraph(List<StringFlag<VerticalRelationRecord>> verticalNodes, List<BinaryRelationItem> sourceRelations)
         {
             SimpleObjectGraph graph = new SimpleObjectGraph();
+            for (int j = 0; j < verticalNodes.Count; j++)
+            {
+                var currentVertical = verticalNodes[j];
+                graph.AddVertex(new SimpleVertex<object>(currentVertical.Instance) { Id = currentVertical.Flag });
+            }
+
             #region 构建临时边集
-            for (int i = sourceRelations.Count - 1; i >= 0; i--)
+                for (int i = sourceRelations.Count - 1; i >= 0; i--)
             {
                 var currentRecord = sourceRelations[i];
                 var startId = currentRecord.From.BimId;
@@ -198,15 +258,15 @@ namespace SAGA.GplotManage
                     if (replaceStart != null && replaceEnd != null)
                         break;
                     var currentVertical = verticalNodes[j];
-                    if (currentVertical.Instance.RelationItems.Contains(startId))
+                    if (replaceStart == null&&currentVertical.Instance.RelationItems.Contains(startId))
                     {
                         replaceStart = currentVertical.Flag;                                        
                     }
-                    if (currentVertical.Instance.RelationItems.Contains(endId))
+                    if (replaceEnd == null && currentVertical.Instance.RelationItems.Contains(endId))
                     {
                         replaceEnd = currentVertical.Flag;
                     }
-                    graph.AddVertex(new SimpleVertex<object>(currentVertical.Instance) { Id = currentVertical.Flag });
+                    //graph.AddVertex(new SimpleVertex<object>(currentVertical.Instance) { Id = currentVertical.Flag });
                 }
                 replaceStart = replaceStart ?? startId;
                 replaceEnd = replaceEnd ?? endId;

+ 15 - 15
MBI/SAGA.GplotManage/UploadRelated/ChillWaterLoop.cs

@@ -36,24 +36,24 @@ namespace SAGA.GplotManage.UploadRelated
             if (showType == GplotShowType.VerticalPlan)
             {
                 //WinDrawEndPoint win = new WinDrawEndPoint(showType);
-                WinDrawEndPoint_Web win = new WinDrawEndPoint_Web(showType);
-                win.ComputerAction += () => ExecuteCmd.ExecuteCommand(() =>
-                {
-                    Computer();
-                    return Result.Succeeded;
-                });
-                win.Show();
+                //WinDrawEndPoint_Web win = new WinDrawEndPoint_Web(showType);
+                //win.ComputerAction += () => ExecuteCmd.ExecuteCommand(() =>
+                //{
+                //    Computer();
+                //    return Result.Succeeded;
+                //});
+                //win.Show();
             }
             else
             {
-                WinDrawEndPoint_Web win = new WinDrawEndPoint_Web(showType);
-                //Revit上下文之外执行计算命令
-                win.ComputerAction += () => ExecuteCmd.ExecuteCommand(() =>
-                {
-                    Computer();
-                    return Result.Succeeded;
-                });
-                win.Show();
+                //WinDrawEndPoint_Web win = new WinDrawEndPoint_Web(showType);
+                ////Revit上下文之外执行计算命令
+                //win.ComputerAction += () => ExecuteCmd.ExecuteCommand(() =>
+                //{
+                //    Computer();
+                //    return Result.Succeeded;
+                //});
+                //win.Show();
             }
           
           

+ 2 - 1
MBI/SAGA.GplotRelationComputerManage/SystemRelation/Common/SystemParseManager.cs

@@ -451,7 +451,7 @@ namespace SAGA.GplotRelationComputerManage
                     tempFloor.ValueDescription = "G";
                 }
                 tempFloor.Index = i;
-                tempFloor.FloorId = i.ToString();
+                tempFloor.FloorId = levelDatas[i].FloorId;
                 tempFloor.LinkId = levelDatas[i].Id;
                 floors.Add(tempFloor);
 
@@ -493,6 +493,7 @@ namespace SAGA.GplotRelationComputerManage
                         drawRecord.SystemName = groupSystem.Key;
                         drawRecords.Add(drawRecord);
                         relationItemSet.AddRange(groupFloor.Select(v => string.Format("{0}:{1}", floorId, v.Id)));
+                       // relationItemSet.AddRange(groupFloor.Select(v => string.Format("{0}",  v.Id)));
                     }
                     #endregion
 

+ 2 - 1
MBI/SAGA.GplotRelationComputerManage/SystemRelation/FloorSystemItem.cs

@@ -426,7 +426,8 @@ namespace SAGA.GplotRelationComputerManage
             LevelData levelData = new LevelData()
             {
                 Id = refLevel.Id.ToString(),
-                Name = MBIInfoUtil.GetFloorNameByLevel(refLevel.Name)
+                Name = MBIInfoUtil.GetFloorNameByLevel(refLevel.Name),
+                FloorId= Document.PathName.GetFileName(),
             };
             context[relationType].VerticalPipes.AddRange(result);
             context[relationType].Levels.Add(levelData);

+ 11 - 6
MBI/SAGA.GplotRelationComputerManage/SystemRelation/SystemComputerHandler.cs

@@ -24,17 +24,22 @@ namespace SAGA.GplotRelationComputerManage
         public void Computer(SystemComputerContext context)
         {
             List<string> testFiles = new List<string>();
-            //testFiles.Add("Fl420105000119b7c08edcee11e8a553abe8a598be93.rvt");
-            //testFiles.Add("Fl420105000110be38e9dcf511e8a5532b791a1ee2c4.rvt");
+#if DEBUG
+            testFiles.Add("Fl420105000119b7c08edcee11e8a553abe8a598be93.rvt");
+            testFiles.Add("Fl420105000110be38e9dcf511e8a5532b791a1ee2c4.rvt");
+#endif
             var fileInfos = RevitModelPath.GetAllRevitFiles();
             foreach (var fileInfo in fileInfos)
             {
                 if (File.Exists(fileInfo))
                 {
-                    //if (testFiles.All(f => !fileInfo.Contains(f)))
-                    //{
-                    //    continue;
-                    //}
+
+#if DEBUG
+                    if (testFiles.All(f => !fileInfo.Contains(f)))
+                    {
+                        continue;
+                    }
+#endif
                     FloorSystemItem floorItems = context.FloorItems.GetItem(fileInfo);
                     //FloorSystemItemTest floorItems = context.TestFloorItems.GetItem(fileInfo);
                     floorItems.Parse(context);

+ 1 - 0
MBI/SAGA.Models/VerticalPipe.cs

@@ -41,5 +41,6 @@ namespace SAGA.Models
         public string Id { get; set; }
         public double Elevation { get; set; }
         public string Name { get; set; }
+        public string FloorId { get; set; }
     }
 }