Bläddra i källkod

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

mengxiangge 6 år sedan
förälder
incheckning
7d726a41bc

+ 23 - 0
MBI/SAGA.DotNetUtils/DB/SQLiteUpdateUtil.cs

@@ -0,0 +1,23 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SQLiteUpdateUtil
+ * 作者:xulisong
+ * 创建时间: 2019/3/19 16:54:35
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace SAGA.DotNetUtils.DB
+{
+    public static class SQLiteUpdateUtil
+    {
+        public static void UpdateDb(int oldVersion, int newVersion)
+        {
+           // SQLiteHelper.exno
+        }
+    }
+}

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

@@ -297,6 +297,7 @@
     <Compile Include="Data\SingleFactory.cs" />
     <Compile Include="Data\SingleInstance.cs" />
     <Compile Include="DB\SQLiteHelper.cs" />
+    <Compile Include="DB\SQLiteUpdateUtil.cs" />
     <Compile Include="DB\TableNameAttribute.cs" />
     <Compile Include="Encrypt\MD5Tools.cs" />
     <Compile Include="Extend\BitmapExtend.cs" />

+ 3 - 17
MBI/SAGA.GplotManage/GplotCommand.cs

@@ -13,10 +13,7 @@ using SAGA.GplotDrawData;
 using SAGA.GplotDrawData.View;
 using SAGA.GplotManage.UploadRelated;
 using SAGA.GplotRelationComputerManage;
-using SAGA.MBI.Common;
 using SAGA.Models;
-using SAGA.RevitUtils;
-using SAGA.RevitUtils.Extends;
 using SAGA.RevitUtils.Extends;
 
 namespace SAGA.GplotManage
@@ -69,14 +66,11 @@ namespace SAGA.GplotManage
     {
         public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
         {
-            //RelationTypeManager.GetSystemRelationTypeNames() 
-            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();//new List<string>() { "ChillWaterLoop" };
+            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
             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;
         }
 
@@ -100,8 +94,6 @@ namespace SAGA.GplotManage
             handler1.ComputerWidthCache(useRelations);
             WinSystem floorWin = new WinSystem(GplotShowType.ViewPlan);
             floorWin.Show();
-            //var space = GplotFactory.Create(GraphTypeEnum.ChillWaterLoop);
-            //space.Show(GplotShowType.ViewPlan);
             return Result.Succeeded;
         }
 
@@ -125,8 +117,6 @@ namespace SAGA.GplotManage
             handler1.ComputerWidthCache(useRelations);
             WinSystem verticalWin = new WinSystem(GplotShowType.VerticalPlan);
             verticalWin.Show();
-            //var space = GplotFactory.Create(GraphTypeEnum.ChillWaterLoop);
-            //space.Show(GplotShowType.VerticalPlan);
             return Result.Succeeded;
 
         }
@@ -236,17 +226,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" };
+           // List<string> useRelations = new List<string>() { "ChillWaterLoop" };
+            List<string> useRelations = RelationTypeManager.GetSystemRelationTypeNames();
             SystemComputerHandler handler1 = new SystemComputerHandler();
             handler1.ComputerWidthCache(useRelations);
             WinMachineRoom room = new WinMachineRoom();
             room.Show();
             return Result.Succeeded;
-            RoomShowHandler handler = new RoomShowHandler("ChillWaterLoop");
-            handler.Show();
-            ;
-            return Result.Succeeded;
         }
 
         public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)

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

@@ -254,6 +254,9 @@
       <Generator>MSBuild:Compile</Generator>
     </Page>
   </ItemGroup>
+  <ItemGroup>
+    <Folder Include="RelationManager\" />
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Import Project="..\packages\MrAdvice.2.5.24\build\MrAdvice.targets" Condition="Exists('..\packages\MrAdvice.2.5.24\build\MrAdvice.targets')" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">

+ 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)