xls il y a 6 ans
Parent
commit
ef00de2b88

+ 6 - 0
MBI/SAGA.GplotManage/SAGA.GplotManage.csproj

@@ -129,6 +129,12 @@
     <Compile Include="GplotManage\GplotView\GplotView.cs" />
     <Compile Include="Command\GplotUtil.cs" />
     <Compile Include="GraphTypeEnum.cs" />
+    <Compile Include="RelationManager\ElectricalRelationUploader.cs" />
+    <Compile Include="RelationManager\IRelationUploader.cs" />
+    <Compile Include="RelationManager\RelationDataManager.cs" />
+    <Compile Include="RelationManager\RelationUploader.cs" />
+    <Compile Include="RelationManager\SpaceRelationUploader.cs" />
+    <Compile Include="RelationManager\SystemRelationUploader.cs" />
     <Compile Include="SystemChecks\CheckSystemResultView.xaml.cs">
       <DependentUpon>CheckSystemResultView.xaml</DependentUpon>
     </Compile>

+ 8 - 4
MBI/SAGA.GplotRelationComputerManage/PowerDistribution/ComputerHandler/DistributionRelationshipHandler.cs

@@ -17,8 +17,12 @@ using MBIEquipItem = SAGA.Models.EquipmentItem;
 
 namespace SAGA.GplotRelationComputerManage
 {
-    public class DistributionRelationshipHandler
+    public sealed class DistributionRelationshipHandler : IElectricalRelationHandler
     {
+        public string ElectricalRelationType
+        {
+            get { return "LUDistribution"; }
+        }
         /// <summary>
         /// 获取解析数据源
         /// </summary>
@@ -58,7 +62,7 @@ namespace SAGA.GplotRelationComputerManage
             var incomingCabinet = originNodes.Where(t => t.Childrens.Count != 0 && t.Parent == null).ToList();
             //孤立节点
             var orphanNodes = originNodes.Where(t => t.Childrens.Count == 0 && t.Parent == null).ToList();
-            DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "LUDistribution");
+            //DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "LUDistribution");
 
             List<DataNode> nodes = new List<DataNode>();
             nodes.Add(new DataNode() { Childrens = incomingCabinet });
@@ -71,9 +75,9 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         /// <param name="context"></param>
         /// <returns></returns>
-        public List<string> GetComputeData(PowerComputerContext context)
+        public List<DataNode> GetComputeData(PowerComputerContext context)
         {
-            return null;
+            return GetViewData(context);
         }
     }
 }

+ 8 - 4
MBI/SAGA.GplotRelationComputerManage/PowerDistribution/ComputerHandler/EquipPowerRelationshipHandler.cs

@@ -16,8 +16,12 @@ using SAGA.Models;
 using MBIEquipItem = SAGA.Models.EquipmentItem;
 namespace SAGA.GplotRelationComputerManage
 {
-    public class EquipPowerRelationshipHandler
+    public class EquipPowerRelationshipHandler : IElectricalRelationHandler
     {
+        public string ElectricalRelationType
+        {
+            get { return "EquipPower"; }
+        }
         /// <summary>
         /// 获取解析数据源
         /// </summary>
@@ -77,7 +81,7 @@ namespace SAGA.GplotRelationComputerManage
               .ToList();
             var incomingCabinet = allDataNodes.Where(t => t.Childrens.Count != 0 &&(t.Parent == null||ignoreNodes.Contains(t.Parent))).ToList();
             var orphanNodes = allDataNodes.Where(t => t.Childrens.Count == 0 && t.Parent == null).ToList();
-            DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "EquipPower");
+            //DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "EquipPower");
 
             List<DataNode> nodes = new List<DataNode>();
             nodes.Add(new DataNode() { Childrens = incomingCabinet });
@@ -90,9 +94,9 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         /// <param name="context"></param>
         /// <returns></returns>
-        public List<string> GetComputeData(PowerComputerContext context)
+        public List<DataNode> GetComputeData(PowerComputerContext context)
         {
-            return null;
+            return GetViewData(context);
         }
     }
 }

+ 8 - 4
MBI/SAGA.GplotRelationComputerManage/PowerDistribution/ComputerHandler/ObjectControlRelationshipHandler.cs

@@ -17,8 +17,12 @@ using MBIEquipItem = SAGA.Models.EquipmentItem;
 
 namespace SAGA.GplotRelationComputerManage
 {
-    public class ObjectControlRelationshipHandler
+    public class ObjectControlRelationshipHandler : IElectricalRelationHandler
     {
+        public string ElectricalRelationType
+        {
+            get { return "ControlRelation"; }
+        }
         /// <summary>
         /// 获取解析数据源
         /// </summary>
@@ -68,7 +72,7 @@ namespace SAGA.GplotRelationComputerManage
             //孤立节点
             var orphanNodes = eqs.Where(t => t.Childrens.Count == 0 && t.Parent == null).ToList();
 
-             DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "ControlRelation");
+             //DrawDataServer.SaveAsFile<DataNode>(new DataNode("root") { Childrens = incomingCabinet }, "ControlRelation");
             List<DataNode> nodes = new List<DataNode>();
             nodes.Add(new DataNode() { Childrens = incomingCabinet });
             nodes.Add(new DataNode() { Childrens = orphanNodes });
@@ -80,9 +84,9 @@ namespace SAGA.GplotRelationComputerManage
         /// </summary>
         /// <param name="context"></param>
         /// <returns></returns>
-        public List<string> GetComputeData(PowerComputerContext context)
+        public List<DataNode> GetComputeData(PowerComputerContext context)
         {
-            return null;
+             return GetViewData(context);
         }
 
         private DataNode ConvertToDataNode(PowerComputerContext context,MBIEquipItem item)

+ 1 - 0
MBI/SAGA.GplotRelationComputerManage/SAGA.GplotRelationComputerManage.csproj

@@ -132,6 +132,7 @@
     <Compile Include="PowerDistribution\Common\PowerComputerContext.cs" />
     <Compile Include="PowerDistribution\ComputerHandler\DistributionRelationshipHandler.cs" />
     <Compile Include="PowerDistribution\ComputerHandler\EquipPowerRelationshipHandler.cs" />
+    <Compile Include="PowerDistribution\ComputerHandler\IElectricalRelationHandler.cs" />
     <Compile Include="PowerDistribution\ComputerHandler\ObjectControlRelationshipHandler.cs" />
     <Compile Include="PumpEnd\DrawEnd.cs" />
     <Compile Include="PumpEnd\DuctTerminalBll.cs" />