Bläddra i källkod

Merge branch 'master' of https://git.dev.tencent.com/xuhuo1234/saga

mengxiangge 6 år sedan
förälder
incheckning
ab81e357fc

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

@@ -41,10 +41,10 @@ namespace SAGA.GplotRelationComputerManage
                 var item = MBIItemFactory.Create(jobject);
                 if (item != null)
                 {
-                    if (item is MBIEquipItem mbiItem)
+                    if (item is MBIEquipItem mbiItem&& mbiItem.Category!=null&&mbiItem.Category.Length>1)
                     {
                         var useType = mbiItem.Category.Remove(0, 2);
-                        if (useType != null && !types.Contains(useType))
+                        if (!types.Contains(useType))
                         {
                             if (((JObject)jobject["infos"]).Property(MBIBuiltInParameter.CTM_MainPower) == null)
                                 continue;

+ 1 - 1
MBI/SAGA.GplotRelationComputerManage/RelationType/RelationTypeManager.cs

@@ -187,7 +187,7 @@ namespace SAGA.GplotRelationComputerManage
                 case 1:
                     #region 动态解析枚举
                     system.FlowType = FlowType.Undefine;
-                    if ("-1" == useValue)
+                    if ("0" == useValue)
                     {
                         system.FlowType = FlowType.Out;
                     }

+ 3 - 6
MBI/SAGA.GplotRelationComputerManage/SystemRelation/Common/SystemParseManager.cs

@@ -436,7 +436,7 @@ namespace SAGA.GplotRelationComputerManage
         /// <summary>
         /// 计算立面数据
         /// </summary>
-        public static List<VerticalResult> ComputerVerticalDatas(List<VerticalPipe> pipeDatas)
+        public static List<VerticalResult> ComputerVerticalDatas(List<VerticalPipe> pipeDatas, List<LevelData> inputLevels)
         {
             List<VerticalResult> results = new List<VerticalResult>();
             var groupBuilding = pipeDatas.GroupBy(p => p.BuildingId);
@@ -444,10 +444,8 @@ namespace SAGA.GplotRelationComputerManage
             {
                 var buildPipeDatas = building.ToList();
                 var firstData = buildPipeDatas.FirstOrDefault();
-                var levelDatas = buildPipeDatas
-                    .Select(vp => new LevelData(){Name = vp.FloorName, FloorId = vp.FloorId, Id = vp.LevelId})
-                    .Distinct(new CommonEqualComparer<LevelData>((l1, l2) => l1.FloorId == l2.FloorId))
-                    .ToList();             
+                var levelDatas = inputLevels.Where(v => v.BuildingId == building.Key).ToList();
+                levelDatas = levelDatas.OrderBy(c => c.Elevation).ToList();
                 var buildingResult = ComputerVerticalData(buildPipeDatas, levelDatas);
                 if (firstData != null)
                 {
@@ -642,7 +640,6 @@ namespace SAGA.GplotRelationComputerManage
                         }
                       
                     }
-                   
                     nodeGraph.Nodes.Add(node);
                 }
                 #region 调整入度为零的点的顺序

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

@@ -435,8 +435,11 @@ namespace SAGA.GplotRelationComputerManage
             {
                 Id = refLevel.Id.ToString(),
                 Name = MBIInfoUtil.GetFloorNameByLevel(refLevel.Name),
-                FloorId= Document.PathName.GetFileName(),
+                FloorId = Document.PathName.GetFileName(),
+                Elevation = refLevel.Elevation,                    
             };
+            levelData.BuildingName = MBIInfoUtil.GetBuildingName(levelData.FloorId);
+            levelData.BuildingId = MBIInfoUtil.GetBuildingId(levelData.FloorId);
             context[relationType].VerticalPipes.AddRange(result);
             context[relationType].Levels.Add(levelData);
         }

+ 1 - 1
MBI/SAGA.GplotRelationComputerManage/SystemRelation/RelationComputerData.cs

@@ -82,7 +82,7 @@ namespace SAGA.GplotRelationComputerManage
             MachineRoomDrawRecords.ForEach(r => r.BuildingTime = buildingTime);
             DataServerUtil.Current.SaveData(RealKey(ComputerFileSetting.MachineRoomDraw), MachineRoomDrawRecords);
             DataServerUtil.Current.SaveData(RealKey(ComputerFileSetting.MachineRoomRelation), MachineRoomRelationRecords);
-            var results = SystemParseManager.ComputerVerticalDatas(VerticalPipes);
+            var results = SystemParseManager.ComputerVerticalDatas(VerticalPipes,Levels);
             DataServerUtil.Current.SaveData(RealKey(ComputerFileSetting.VerticalDraw), results.Select(r=>r.DrawData).ToList());
             DataServerUtil.Current.SaveData(RealKey(ComputerFileSetting.VerticalRelation), results.SelectMany(r => r.RelationData).ToList());
         }

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

@@ -89,7 +89,7 @@ namespace SAGA.GplotRelationComputerManage
             // List<string> useRelations = new List<string>() { "ChillWaterLoop" };
             List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
 #if DEBUG
-            //useRelations = new List<string>() { "ChillWaterLoop" };
+            //useRelations = new List<string>() { "CoolingWaterLoop" };
 #endif
             SystemComputerHandler handler1 = new SystemComputerHandler();
             handler1.ComputerWidthCache(useRelations);

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

@@ -37,5 +37,7 @@ namespace SAGA.Models
         public double Elevation { get; set; }
         public string Name { get; set; }
         public string FloorId { get; set; }
+        public string BuildingName { get; set; }
+        public string BuildingId { get; set; }
     }
 }