xulisong 6 лет назад
Родитель
Сommit
35b5f67f72

+ 2 - 0
MBI/SAGA.GplotDrawData/View/WinSystem.xaml.cs

@@ -146,6 +146,8 @@ namespace SAGA.GplotDrawData.View
             List<VerticalDrawData> drawDatas = GetVerticalDrawData();
             foreach (var drawData in drawDatas)
             {
+                if (drawData == null)
+                    continue;
                 var groups = (drawData.DrawRecords ?? new List<VerticalDrawRecord>()).GroupBy(c => c.SystemName);
                 foreach (var group in groups)
                 {

+ 22 - 9
MBI/SAGA.GplotManage/GplotCommand.cs

@@ -64,6 +64,11 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            //List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            //SystemComputerHandler handler1 = new SystemComputerHandler();
+            //handler1.ComputerWidthCache(useRelations);
+            //WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
+            //floorWin.Show();
             var space = GplotFactory.Create(GraphTypeEnum.ChillWaterLoop);
             space.Show(GplotShowType.Default);
             return Result.Succeeded;
@@ -84,6 +89,11 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            //List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            //SystemComputerHandler handler1 = new SystemComputerHandler();
+            //handler1.ComputerWidthCache(useRelations);
+            //WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
+            //floorWin.Show();
             var space = GplotFactory.Create(GraphTypeEnum.ChillWaterLoop);
             space.Show(GplotShowType.ViewPlan);
             return Result.Succeeded;
@@ -104,6 +114,11 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
+            //List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            //SystemComputerHandler handler1 = new SystemComputerHandler();
+            //handler1.ComputerWidthCache(useRelations);      
+            //WinSystem verticalWin = new WinSystem(GplotShowType.VerticalPlan);
+            //verticalWin.Show();
             var space = GplotFactory.Create(GraphTypeEnum.ChillWaterLoop);
             space.Show(GplotShowType.VerticalPlan);
             return Result.Succeeded;
@@ -183,15 +198,13 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            var relationType = RelationTypeManager.GetRelationTypeItem("ChillWaterLoop");
-            List<string> useRelations = new List<string>() { "ChillWaterLoop" };
-            SystemComputerHandler handler1 = new SystemComputerHandler();
-            handler1.ComputerWidthCache(useRelations);
-            WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
-            floorWin.Show();
-            WinSystem verticalWin = new WinSystem(GplotShowType.VerticalPlan);
-            verticalWin.Show();
-            return Result.Succeeded;
+            //var relationType = RelationTypeManager.GetRelationTypeItem("ChillWaterLoop");
+            //List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            //SystemComputerHandler handler1 = new SystemComputerHandler();
+            //handler1.ComputerWidthCache(useRelations);
+            //WinMachineRoom room = new WinMachineRoom();
+            //room.Show();
+            //return Result.Succeeded;
             RoomShowHandler handler = new RoomShowHandler("ChillWaterLoop");
             handler.Show();
             ;

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

@@ -189,7 +189,7 @@ namespace SAGA.GplotRelationComputerManage
                 var shell = context.RelationShells.GetItem(relation);
                 if (shell.IsPipeSystem())
                 {
-                    ParsePipe(context, shell);
+                    ParsePipe(context, shell,Domain.DomainPiping);
                 }
                 else
                 {
@@ -200,9 +200,9 @@ namespace SAGA.GplotRelationComputerManage
 
         #region 水系统解析
 
-        public void ParsePipe(SystemComputerContext context, RelationTypeShell relationSetting)
+        public void ParsePipe(SystemComputerContext context, RelationTypeShell relationSetting, Domain currentDomain)
         {
-            Domain useDomain = Domain.DomainPiping;
+            Domain useDomain = currentDomain;//Domain.DomainPiping;
             var relationType = relationSetting.RelationItem.Type;
             List<FloorDrawRecord> drawRecords = new List<FloorDrawRecord>();
             List<FloorRelationRecord> relationRecords = new List<FloorRelationRecord>();
@@ -343,6 +343,7 @@ namespace SAGA.GplotRelationComputerManage
 
         public void ParseDuct(SystemComputerContext context, RelationTypeShell relationSetting)
         {
+            ParsePipe(context, relationSetting, Domain.DomainHvac);
         }
 
         #endregion

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

@@ -109,9 +109,9 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         public void LoadData()
         {
-            FloorRelationRecords = DataServerUtil.Current.LoadData<List<FloorRelationRecord>>(RealKey(ComputerFileSetting.FloorRelation));
-            MachineRoomRelationRecords = DataServerUtil.Current.LoadData<List<MachineRoomRelationRecord>>(RealKey(ComputerFileSetting.MachineRoomRelation));
-            VerticalRelationRecords = DataServerUtil.Current.LoadData<List<VerticalRelationRecord>>(RealKey(ComputerFileSetting.VerticalRelation));
+            FloorRelationRecords = DataServerUtil.Current.LoadData<List<FloorRelationRecord>>(RealKey(ComputerFileSetting.FloorRelation))??new List<FloorRelationRecord>();
+            MachineRoomRelationRecords = DataServerUtil.Current.LoadData<List<MachineRoomRelationRecord>>(RealKey(ComputerFileSetting.MachineRoomRelation))??new List<MachineRoomRelationRecord>();
+            VerticalRelationRecords = DataServerUtil.Current.LoadData<List<VerticalRelationRecord>>(RealKey(ComputerFileSetting.VerticalRelation))??new List<VerticalRelationRecord>();
         }
 
         #endregion
@@ -137,7 +137,7 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         public void LoadData()
         {
-            FloorDrawRecords = DataServerUtil.Current.LoadData<List<FloorDrawRecord>>(RealKey(ComputerFileSetting.FloorDraw));
+            FloorDrawRecords = DataServerUtil.Current.LoadData<List<FloorDrawRecord>>(RealKey(ComputerFileSetting.FloorDraw))??new List<FloorDrawRecord>();
         }
 
         #endregion
@@ -160,7 +160,7 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         public void LoadData()
         {
-            MachineRoomDrawRecords = DataServerUtil.Current.LoadData<List<MachineRoomDrawRecord>>(RealKey(ComputerFileSetting.MachineRoomDraw));
+            MachineRoomDrawRecords = DataServerUtil.Current.LoadData<List<MachineRoomDrawRecord>>(RealKey(ComputerFileSetting.MachineRoomDraw))??new List<MachineRoomDrawRecord>();
         }
         #endregion
     }
@@ -184,7 +184,7 @@ namespace SAGA.GplotRelationComputerManage
         public void LoadData()
         {
 
-            VerticalDrawData = DataServerUtil.Current.LoadData<VerticalDrawData>(RealKey(ComputerFileSetting.VerticalDraw));
+            VerticalDrawData = DataServerUtil.Current.LoadData<VerticalDrawData>(RealKey(ComputerFileSetting.VerticalDraw))??new VerticalDrawData();
 
         }
     }

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

@@ -31,7 +31,7 @@ namespace SAGA.GplotRelationComputerManage
         /// <returns></returns>
         public bool IsMissData()
         {
-            return DataServerUtil.Current.GetFile(RealKey(ComputerFileSetting.FloorDraw)).Exists();
+            return !DataServerUtil.Current.GetFile(RealKey(ComputerFileSetting.FloorDraw)).Exists();
         }
     }
 }

+ 4 - 0
MBI/SAGA.GplotRelationComputerManage/SystemRelation/ServerData/FloorDrawData.cs

@@ -18,6 +18,10 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
     public class FloorDrawData: ServerData
     {
+        public FloorDrawData()
+        {
+            DrawRecords = new List<FloorDrawRecord>();
+        }
         /// <summary>
         /// 楼层信息
         /// </summary>

+ 4 - 0
MBI/SAGA.GplotRelationComputerManage/SystemRelation/ServerData/FloorRelationRecord.cs

@@ -18,6 +18,10 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
    public  class FloorRelationRecord: FloorRecord
     {
+        public FloorRelationRecord()
+        {
+            RelationItems = new List<BinaryRelationItem>();
+        }
         /// <summary>
         /// 关联数据
         /// </summary>

+ 4 - 0
MBI/SAGA.GplotRelationComputerManage/SystemRelation/ServerData/MachineRoomDrawRecord.cs

@@ -18,6 +18,10 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
     public class MachineRoomDrawRecord : ServerData
     {
+        public MachineRoomDrawRecord()
+        {
+            DrawIems = new SystemDrawItems();
+        }
         /// <summary>
         /// 关系名称
         /// </summary>

+ 4 - 0
MBI/SAGA.GplotRelationComputerManage/SystemRelation/ServerData/MachineRoomRelationRecord.cs

@@ -18,6 +18,10 @@ namespace SAGA.GplotRelationComputerManage
     /// </summary>
     public class MachineRoomRelationRecord : ServerData
     {
+        public MachineRoomRelationRecord()
+        {
+            RelationItems = new List<BinaryRelationItem>();
+        }
         /// <summary>
         /// 关系名称
         /// </summary>

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

@@ -53,7 +53,7 @@ namespace SAGA.GplotRelationComputerManage
         /// <param name="relationTypes"></param>
         public void ComputerWidthCache(List<string> relationTypes)
         {
-            if (relationTypes == null || relationTypes.Any())
+            if (relationTypes == null || !relationTypes.Any())
                 return;
             var useRelationTypes = RelationTypeUtil.NeedResetRelationTypes(relationTypes);
             if(!useRelationTypes.Any())