Selaa lähdekoodia

xls:低压配电柜与末端关系处理

xulisong 6 vuotta sitten
vanhempi
commit
a3fe437ec8

+ 25 - 12
MBI/SAGA.GplotManage/GplotCommand.cs

@@ -5,19 +5,12 @@ using System.Linq;
 using Autodesk.Revit.Attributes;
 using Autodesk.Revit.DB;
 using Autodesk.Revit.UI;
-using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
-using NPOI.SS.UserModel;
-using NPOI.XSSF.UserModel;
-using SAGA.DotNetUtils.Data;
+using SAGA.DotNetUtils.Others;
 using SAGA.GplotDrawData;
 using SAGA.GplotDrawData.View;
 using SAGA.GplotManage.RelationManager;
-using SAGA.GplotManage.TopologyApplication;
 using SAGA.GplotRelationComputerManage;
-using SAGA.MBI.RequestData;
 using SAGA.Models;
-using SAGA.RevitUtils;
 using SAGA.RevitUtils.Extends;
 
 namespace SAGA.GplotManage
@@ -31,8 +24,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            //var space = GplotFactory.Create(GraphTypeEnum.ElementSpNeighborhood);
-            //space.Show(GplotShowType.ViewPlan);   
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SpaceComputerHandler.ComputerAllRelations();
             var win = new WinDrawSpace_Web(GplotShowType.ViewPlan);// 
             win.Show();
@@ -53,8 +48,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            //var space = GplotFactory.Create(GraphTypeEnum.ElementSpNeighborhood);
-            //space.Show(GplotShowType.VerticalPlan);
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SpaceComputerHandler.ComputerAllRelations();
             var win = new WinDrawSpace_Web(GplotShowType.VerticalPlan);
             win.Show();
@@ -76,6 +73,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SystemComputerHandler.ComputerAllRelations();
             WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
             floorWin.Show();
@@ -97,6 +98,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SystemComputerHandler.ComputerAllRelations();
             WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
             floorWin.Show();
@@ -118,6 +123,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SystemComputerHandler.ComputerAllRelations();
             WinSystem verticalWin = new WinSystem(GplotShowType.VerticalPlan);
             verticalWin.Show();
@@ -140,6 +149,10 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            if (!MessageShowBase.Confirm("确定要执行拓扑计算命令吗"))
+            {
+                return Result.Succeeded;
+            }
             SystemComputerHandler.ComputerAllRelations();
             WinMachineRoom room = new WinMachineRoom();
             room.Show();

+ 2 - 2
MBI/SAGA.GplotRelationComputerManage/PowerDistribution/ComputerHandler/EquipPowerRelationshipHandler.cs

@@ -58,8 +58,8 @@ namespace SAGA.GplotRelationComputerManage
             var originNodes = items.Select(i => context.ItemConvert(i)).ToList();
             #region 构建树形结构
             var tdls = originNodes.Where(t => t.Type ==MBIBuiltInCategory.TDLS).ToList();
-           // var eqs = originNodes.Where(t => t.Type != MBIBuiltInCategory.TDLS).ToList();
-            var eqs = originNodes.Where(t =>true).ToList();
+            var types = new[] { MBIBuiltInCategory.TDHS, MBIBuiltInCategory.TDLS, MBIBuiltInCategory.TDTF, MBIBuiltInCategory.TDLSDW };
+            var eqs = originNodes.Where(t => !types.Contains(t.Type)).ToList();
             foreach (var dn in tdls)
             {
                  DataNodeUtil.BuildNode(dn, eqs);

+ 7 - 1
MBI/SAGA.GplotRelationComputerManage/RevitSystemParse/Handler/GplotGraphParse.cs

@@ -403,15 +403,21 @@ namespace SAGA.GplotRelationComputerManage
                         {
                             continue;
                         }
+                        var otherId = systemEdge.GetAnotherVertex(currentVertex.Id);
+                        if (vertexes.Any(v => v.Id == otherId))
+                        {
+                            continue;
+                        }
                         edgeIds.Add(systemEdge.Id);
                         if ((isStart && systemEdge.ContainVertex(currentVertex.Id) == 1) || (!isStart && systemEdge.ContainVertex(currentVertex.Id) == 0))
                         {
                             systemEdge.Reverse();
                         }
 
-                        var otherId = systemEdge.GetAnotherVertex(currentVertex.Id);
+                       
                         if (!vertexIds.Contains(otherId))
                         {
+
                             var nextVertex = graph.FindVertex(otherId);
                             if (nextVertex != null)
                             {

+ 4 - 1
MBI/SAGA.GplotRelationComputerManage/SystemRelation/SystemComputerHandler.cs

@@ -26,7 +26,7 @@ namespace SAGA.GplotRelationComputerManage
             List<string> testFiles = new List<string>();
 #if DEBUG
             testFiles.Add("Fl420105000119b7c08edcee11e8a553abe8a598be93.rvt");
-            testFiles.Add("Fl42010500012ca5c61ddcf511e8a5535bb85ffaee3b.rvt");
+            testFiles.Add("Fl42010500015ecaeaf1dce811e8a553ab01e5731045.rvt");
             //testFiles.Add("Fl42010500015f8ce4eddcf411e8a5532f436ae9c161.rvt");
 #endif
             var fileInfos = RevitModelPath.GetAllRevitFiles();
@@ -88,6 +88,9 @@ namespace SAGA.GplotRelationComputerManage
         {
             // List<string> useRelations = new List<string>() { "ChillWaterLoop" };
             List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
+#if DEBUG
+            useRelations = new List<string>() { "ChillWaterLoop" };
+#endif
             SystemComputerHandler handler1 = new SystemComputerHandler();
             handler1.ComputerWidthCache(useRelations);
         }