Browse Source

xls:解析风口相关信息

xulisong 6 years ago
parent
commit
08ede3541b

BIN
MBI/MBIResource/BaseDB/MBIAssistData.db


+ 0 - 12
MBI/Menu/MBITool.xml

@@ -222,18 +222,6 @@
       <MenuTab>MBITool_W</MenuTab>
       <Modules>MBITool</Modules>
     </Button>
-<Button ButtonStyles="Large">
-      <ButtonName>SAGA.GplotManage.SearchShaftCommand</ButtonName>
-      <ButtonText>导出竖井关系</ButtonText>
-      <ImageName>10、空间管理</ImageName>
-      <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
-      <ClassName>SAGA.GplotManage.SearchShaftCommand</ClassName>
-      <ToolTip>导出竖井关系</ToolTip>
-      <LongDescription>导出竖井关系</LongDescription>
-      <ToolTipImage></ToolTipImage>
-      <MenuTab>MBITool_W</MenuTab>
-      <Modules>MBITool</Modules>
-    </Button>
 </Panel>
 </Menus>
 <!--名称里面换行-->

+ 6 - 6
MBI/Menu/SAGABIM.xml

@@ -486,12 +486,12 @@
     <!--冷凍水供水-->
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.ChillWaterLoopComputerSupplyGraph</ButtonName>
-      <ButtonText>系统-平面</ButtonText>
+      <ButtonText>系统-平面</ButtonText>
       <ImageName>10、空间管理</ImageName>
       <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
       <ClassName>SAGA.GplotManage.ChillWaterLoopComputerSupplyGraph</ClassName>
-      <ToolTip>系统平面</ToolTip>
-      <LongDescription>系统平面</LongDescription>
+      <ToolTip>系统平面</ToolTip>
+      <LongDescription>系统平面</LongDescription>
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>
@@ -513,12 +513,12 @@
     <!--冷凍水立管-->
     <Button ButtonStyles="Large">
       <ButtonName>SAGA.GplotManage.ChillWaterLoopComputerVGraph</ButtonName>
-      <ButtonText>系统-立面</ButtonText>
+      <ButtonText>系统-立面</ButtonText>
       <ImageName>10、空间管理</ImageName>
       <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
       <ClassName>SAGA.GplotManage.ChillWaterLoopComputerVGraph</ClassName>
-      <ToolTip>系统立面</ToolTip>
-      <LongDescription>系统立面</LongDescription>
+      <ToolTip>系统立面</ToolTip>
+      <LongDescription>系统立面</LongDescription>
       <ToolTipImage></ToolTipImage>
       <MenuTab>SJJC_W</MenuTab>
       <Modules>SJJC</Modules>

+ 39 - 0
MBI/Menu/TopolgyTool.xml

@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Menus>
+  <App>
+    <AppIndex>3</AppIndex>
+    <AppName>SAGA</AppName>
+  </App>
+  <Tab TabName="拓扑工具">
+    <MenuTab>Topology_W</MenuTab>
+    <Modules>Topology</Modules>
+  </Tab>
+ <Panel PanelName="功能扩展" GroupFlag="True" GroupImage="" RevitVer="R14,R15,R16,R17"  ButtonStyles="Large">   
+    <Button ButtonStyles="Large">
+      <ButtonName>SAGA.GplotManage.SpaceAirSupplyCommand</ButtonName>
+      <ButtonText>机组服务空间</ButtonText>
+      <ImageName>10、空间管理</ImageName>
+      <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
+      <ClassName>SAGA.GplotManage.SpaceAirSupplyCommand</ClassName>
+      <ToolTip>导出竖井关系</ToolTip>
+      <LongDescription>导出竖井关系</LongDescription>
+      <ToolTipImage></ToolTipImage>
+       <MenuTab>Topology_W</MenuTab>
+    <Modules>Topology</Modules>
+    </Button>
+<Button ButtonStyles="Large">
+      <ButtonName>SAGA.GplotManage.SearchShaftCommand</ButtonName>
+      <ButtonText>导出竖井关系</ButtonText>
+      <ImageName>10、空间管理</ImageName>
+      <DllName>..\OutputDll\SAGA.GplotManage.exe</DllName>
+      <ClassName>SAGA.GplotManage.SearchShaftCommand</ClassName>
+      <ToolTip>导出竖井关系</ToolTip>
+      <LongDescription>导出竖井关系</LongDescription>
+      <ToolTipImage></ToolTipImage>
+       <MenuTab>Topology_W</MenuTab>
+    <Modules>Topology</Modules>
+    </Button>
+</Panel>
+</Menus>
+<!--名称里面换行-->
+<!-- <ButtonText>扫楼App&#x000A;用户管理</ButtonText>-->

+ 13 - 2
MBI/SAGA.DotNetUtils/Data/EdgesArray/EdgesArrayGraphUtil.cs

@@ -161,6 +161,17 @@ namespace SAGA.DotNetUtils.Data
                 return edgesArray;
         }
 
+        /// <summary>
+        /// 查找相关联的路径信息,该方法如果传入的图不是有向无环图,则不能获取到正确结果【不建议使用】
+        /// </summary>
+        /// <typeparam name="V"></typeparam>
+        /// <typeparam name="VD"></typeparam>
+        /// <typeparam name="E"></typeparam>
+        /// <typeparam name="ED"></typeparam>
+        /// <param name="edgesArray"></param>
+        /// <param name="start"></param>
+        /// <param name="endPredicate"></param>
+        /// <returns></returns>
         public static List<PathNodes<V, E>> GetPaths<V, VD, E, ED>(this EdgesArrayGraph<V, VD, E, ED> edgesArray, V start, Predicate<V> endPredicate) where V : EAVertex<VD>, new() where E : EAEdge<ED>, new()
         {
             List<PathNodes<V, E>> list = new List<PathNodes<V, E>>();
@@ -190,7 +201,7 @@ namespace SAGA.DotNetUtils.Data
             return list;
         }
         /// <summary>
-        /// 获取指定起点,到指定条件的节点路径信息;
+        /// 获取指定起点,到指定条件的节点路径信息;(建议使用)
         /// </summary>
         /// <typeparam name="V"></typeparam>
         /// <typeparam name="VD"></typeparam>
@@ -223,7 +234,7 @@ namespace SAGA.DotNetUtils.Data
                     continue;
                 if (prePath.Count > 1 && prePath[prePath.Count - 1].NextNode.Id == anotherId)
                 {
-                    //或者不进行数量判断,弹药对NextNode进行非空判断
+                    //或者不进行数量判断,但要对NextNode进行非空判断
                     continue; 
                 }
                 if ((prePath.Any(n => n.NextNode.Id == anotherId)) ||(endPredicate != null && endPredicate(v)))

+ 3 - 2
MBI/SAGA.DotNetUtils/Logger/DocumentChangedLog.cs

@@ -60,9 +60,10 @@ namespace SAGA.DotNetUtils.Logger
         /// <summary>
         /// 删除临时文件
         /// </summary>
-        /// <param name="logPath">临时日志文件的路径 </param>
-        public static void DeleteTempLog(string logPath)
+        /// <param name="rvtPath">模型文件路径 </param>
+        public static void DeleteTempLog(string rvtPath)
         {
+            var logPath = GetTempLogFilePath(rvtPath);
             if (File.Exists(logPath))
             {
                 File.Delete(logPath);

+ 99 - 0
MBI/SAGA.DotNetUtils/NPOI/WorkbookExtension.cs

@@ -0,0 +1,99 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:WorkbookExtension
+ * 作者:xulisong
+ * 创建时间: 2019/4/11 17:31:29
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NPOI.SS.UserModel;
+
+namespace SAGA.DotNetUtils.NPOI
+{
+    public static class WorkbookExtension
+    {
+        /// <summary>
+        /// 保存excel信息
+        /// </summary>
+        /// <param name="book"></param>
+        /// <param name="filePath"></param>
+        /// <param name="closeBook">保存前,是否关闭流。如果使用文件被当前excel打开,必须关闭才能写入</param>
+        /// <returns></returns>
+        public static bool Save(this IWorkbook book, string filePath, bool closeBook)
+        {
+            if (string.IsNullOrWhiteSpace(filePath))
+                throw new ArgumentNullException(nameof(filePath));
+            using (MemoryStream ms = new MemoryStream())
+            {
+                book.Write(ms);
+                if (closeBook)
+                {
+                    book.Close();
+                }
+                var directory = Path.GetDirectoryName(filePath);
+                if (!Directory.Exists(directory))
+                {
+                    Directory.CreateDirectory(directory);
+                }
+                using (FileStream fs = new FileStream(filePath, FileMode.OpenOrCreate, FileAccess.Write))
+                {
+                    byte[] data = ms.ToArray();
+                    fs.Write(data, 0, data.Length);
+                    fs.Flush();
+                }
+                return true;
+            }                 
+        }
+
+        /// <summary>
+        /// 将book保存到指定文件
+        /// </summary>
+        /// <param name="book"></param>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public static bool Save(this IWorkbook book, string filePath)
+        {
+            return Save(book, filePath, true);
+        }
+
+
+        public static ICell SetCellValue(this ISheet sheet,int rowIndex, int columnIndex, object value)
+        {
+            #region 获取可用的Cell
+            var useRow = sheet.GetRow(rowIndex);
+            if (useRow == null)
+            {
+                useRow = sheet.CreateRow(rowIndex);
+            }
+            var useCell = useRow.GetCell(columnIndex);
+            if (useCell == null)
+            {
+                useCell = useRow.CreateCell(columnIndex);
+            } 
+            #endregion
+
+            do
+            {
+                if (value is string strValue)
+                {
+                    useCell.SetCellValue(strValue);
+                    break;
+                }
+                if (value is double dblValue)
+                {
+                    useCell.SetCellValue(dblValue);
+                    break;
+                }
+                //todo 待完善
+                useCell.SetCellValue(value.ToString());
+                break;
+            } while (false);
+            return useCell;
+        }
+    }
+}

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

@@ -333,6 +333,7 @@
     <Compile Include="MBI\OutReachConst.cs" />
     <Compile Include="NPOI\ExcelExtension.cs" />
     <Compile Include="NPOI\NPOIHelper.cs" />
+    <Compile Include="NPOI\WorkbookExtension.cs" />
     <Compile Include="Others\AppBaseInfo.cs" />
     <Compile Include="Others\ApplicationDecrypt.cs" />
     <Compile Include="Others\BaseWindow.cs" />

+ 4 - 1
MBI/SAGA.GplotDrawData/SAGA.GplotDrawData.csproj

@@ -55,7 +55,10 @@
     </Reference>
     <Reference Include="NPOI.OpenXml4Net, Version=2.2.1.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1" />
     <Reference Include="RevitAPI, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null" />
-    <Reference Include="RevitAPIUI, Version=17.0.0.0, Culture=neutral, PublicKeyToken=null" />
+    <Reference Include="RevitAPIUI, Version=16.0.0.0, Culture=neutral, processorArchitecture=AMD64">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\Dlls\RevitRefDll\RevitAPIUI.dll</HintPath>
+    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Data" />
     <Reference Include="System.Xml" />

File diff suppressed because it is too large
+ 2 - 302
MBI/SAGA.GplotManage/GplotCommand.cs


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

@@ -154,6 +154,13 @@
       <DependentUpon>WinSystemCheck.xaml</DependentUpon>
     </Compile>
     <Compile Include="SystemRelation\RelationDataUtil.cs" />
+    <Compile Include="TopologyApplicationCommand.cs" />
+    <Compile Include="TopologyApplication\SearchShaft\SearchShaftHandler.cs" />
+    <Compile Include="TopologyApplication\SearchShaft\SpaceInfo.cs" />
+    <Compile Include="TopologyApplication\SpaceAirSupply\SpaceAirSupplyDocUtil.cs" />
+    <Compile Include="TopologyApplication\SpaceAirSupply\SpaceAirSupplyHandler.cs" />
+    <Compile Include="TopologyApplication\SpaceAirSupply\SpaceAirSupplyResultItem.cs" />
+    <Compile Include="TopologyApplication\TopologyApplicationUtil.cs" />
     <Compile Include="UploadRelated\AirNetwork.cs" />
     <Compile Include="UploadRelated\ControlRelation.cs" />
     <Compile Include="UploadRelated\ConvectionNetwork.cs" />

File diff suppressed because it is too large
+ 268 - 0
MBI/SAGA.GplotManage/TopologyApplication/SearchShaft/SearchShaftHandler.cs


+ 50 - 0
MBI/SAGA.GplotManage/TopologyApplication/SearchShaft/SpaceInfo.cs

@@ -0,0 +1,50 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SpaceInfo
+ * 作者:xulisong
+ * 创建时间: 2019/4/11 17:16:30
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SAGA.Models;
+
+namespace SAGA.GplotManage.TopologyApplication
+{
+    public class SpaceInfo
+    {
+        /// <summary>
+        /// 元空间Id
+        /// </summary>
+        public string Id { get; set; }
+        /// <summary>
+        /// BimId
+        /// </summary>
+        public string BimId { get; set; }
+        /// <summary>
+        /// 楼层Id
+        /// </summary>
+        public string FloorId { get; set; }
+        /// <summary>
+        /// 楼层名称
+        /// </summary>
+        public string FloorName { get; set; }
+        /// <summary>
+        /// 本地名称
+        /// </summary>
+        public string Name { get; set; }
+
+        public static SpaceInfo Parse(RoomItem roomItem)
+        {
+            SpaceInfo info = new SpaceInfo();
+            info.Id = roomItem.Id;
+            info.FloorId = roomItem.FloorId;
+            info.Name = roomItem.GetDisplay();
+            info.BimId = roomItem.RevitId.ToString();
+            return info;
+        }
+    }
+}

+ 51 - 0
MBI/SAGA.GplotManage/TopologyApplication/SpaceAirSupply/SpaceAirSupplyDocUtil.cs

@@ -0,0 +1,51 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SpaceAirSupplyDocUtil
+ * 作者:xulisong
+ * 创建时间: 2019/4/11 17:13:35
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using NPOI.SS.UserModel;
+using NPOI.XSSF.UserModel;
+using SAGA.DotNetUtils.NPOI;
+
+namespace SAGA.GplotManage.TopologyApplication
+{
+    public class SpaceAirSupplyDocUtil
+    {
+        /// <summary>
+        /// 经计算结果保存到指定路径
+        /// </summary>
+        /// <param name="path"></param>
+        /// <param name="results"></param>
+        public static void Save(string path, List<SpaceAirSupplyResultItem> results)
+        {
+            IWorkbook book = new XSSFWorkbook(path);
+            ISheet sheet = book.CreateSheet("Sheet1");
+            List<string> headNames = new List<string>() { "空间id", "空间revitId", "风口id", "风口revitId", "供风设备Id", "供风设备revitId" };
+            for (int i = 0; i < headNames.Count; i++)
+            {
+                sheet.SetCellValue(0,i,headNames[i]);
+            }
+
+            int baseRowIndex = 1;
+            for (int i = 0; i < results.Count; i++)
+            {
+                var useResult = results[i];
+                int useIndex = baseRowIndex + i;
+                sheet.SetCellValue(useIndex, 0, useResult.Space.Id);
+                sheet.SetCellValue(useIndex, 1, useResult.Space.RevitId);
+                sheet.SetCellValue(useIndex, 2, useResult.AirVent.Id);
+                sheet.SetCellValue(useIndex, 3, useResult.AirVent.RevitId);
+                sheet.SetCellValue(useIndex, 4, useResult.AirSupply.Id);
+                sheet.SetCellValue(useIndex, 5, useResult.AirSupply.RevitId);
+            }
+            book.Save(path);
+        }
+    }
+}

+ 116 - 0
MBI/SAGA.GplotManage/TopologyApplication/SpaceAirSupply/SpaceAirSupplyHandler.cs

@@ -0,0 +1,116 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SpaceAirSupplyHandler
+ * 作者:xulisong
+ * 创建时间: 2019/4/12 14:56:14
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using SAGA.DotNetUtils.Cache;
+using SAGA.DotNetUtils.Data;
+using SAGA.Models;
+
+namespace SAGA.GplotManage.TopologyApplication
+{
+    public class SpaceAirSupplyHandler
+    {
+        public SpaceAirSupplyHandler()
+        {
+            EquipmentItems = TopologyApplicationUtil.CreateEquipmentItems();
+            Rooms= TopologyApplicationUtil.CreateRoomItems();
+        }
+        #region 数据获取
+        /// <summary>
+        /// 缓存设备
+        /// </summary>
+        public CacheItems<string, EquipmentItem> EquipmentItems { get; private set; }
+        /// <summary>
+        /// 缓存空间对象
+        /// </summary>
+        public CacheItems<string, RoomItem> Rooms { get; private set; }
+       
+        /// <summary>
+        /// 获取图关系
+        /// </summary>
+        /// <param name="graphType"></param>
+        /// <returns></returns>
+        private SimpleGraph<string, string> GetGraph(string graphType)
+        {
+            SimpleGraph<string, string> result = TopologyApplicationUtil.GetGraph(graphType);
+            foreach (var resultVertex in result.Vertexes)
+            {
+                var useCategory= EquipmentItems.GetItem(resultVertex.Id)?.Category;
+                if (!string.IsNullOrWhiteSpace(useCategory))
+                {
+                      useCategory = useCategory.Remove(0, 2);
+                }
+               
+                resultVertex.Data = useCategory;
+            }
+
+            return result;
+        } 
+        #endregion
+
+        public bool Execute()
+        {
+            /*1、找到数据源 图信息
+             * 2、找到为风口的点
+             * 3、根据风口找与风口相关联的机组设备
+             * 4、查找风口所在的空间信息
+             * 5、产生计算结果数据
+             */
+            List<SpaceAirSupplyResultItem> result = new List<SpaceAirSupplyResultItem>();
+            List<string> supplyEquipmentCategories = new List<string>()
+                {MBIBuiltInCategory.ATAH, MBIBuiltInCategory.ATFC, MBIBuiltInCategory.ATFU};
+            List<string> graphTypes = new List<string>(){ "ACAirNetwork", "FreshAirNetwork" };
+            SimpleGraph<string, string> equipinElementSp = null;
+            foreach (var graphType in graphTypes)
+            {
+                var graph = GetGraph(graphType);
+                var airPorts = graph.Vertexes.Where(v => v.Data == MBIBuiltInCategory.ATIO).ToList();
+                foreach (var airPort in airPorts)
+                {
+                    var paths=graph.GetPaths2(airPort, v => supplyEquipmentCategories.Contains(v.Data));
+                    foreach (var endPathNode in paths)
+                    {
+                        var useEdge = endPathNode.LastOrDefault();
+                        if (useEdge == null)
+                            continue;
+                        if (supplyEquipmentCategories.Contains((useEdge.NextNode.Data)))
+                        {
+                            if (equipinElementSp == null)
+                            {
+                                equipinElementSp = GetGraph("EquipinElementSp");
+                            }
+
+                            SpaceAirSupplyResultItem item = new SpaceAirSupplyResultItem();
+                            item.AirVent = EquipmentItems.GetItem(airPort.Id);
+                            item.AirSupply = EquipmentItems.GetItem(useEdge.NextNode.Id);
+                            var spaceRelations = equipinElementSp.GetOutVertexes(airPort.Id);
+                            if (spaceRelations != null && spaceRelations.Any())
+                            {
+                                item.Space = Rooms.GetItem(spaceRelations[0].Id);
+                            }
+                            result.Add(item);
+                        }
+                    }
+                }
+            }
+
+            SpaceAirSupplyDocUtil.Save(@"c:\airport.xlsx",result);
+            return false;
+        }
+        public static bool ShellExecute()
+        {
+            //类的静态方法,装饰类的实例方法
+            SpaceAirSupplyHandler handler = new SpaceAirSupplyHandler();
+            return handler.Execute();
+        }
+    }
+}

+ 32 - 0
MBI/SAGA.GplotManage/TopologyApplication/SpaceAirSupply/SpaceAirSupplyResultItem.cs

@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:SpaceAirSupplyResultItem
+ * 作者:xulisong
+ * 创建时间: 2019/4/11 17:04:50
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using SAGA.Models;
+
+namespace SAGA.GplotManage.TopologyApplication
+{
+    public class SpaceAirSupplyResultItem
+    {
+        /// <summary>
+        /// 风口所在空间信息
+        /// </summary>
+        public RoomItem Space { get; set; }
+        /// <summary>
+        /// 风口信息
+        /// </summary>
+        public EquipmentItem AirVent { get; set; }
+        /// <summary>
+        /// 供风设备
+        /// </summary>
+        public EquipmentItem AirSupply { get; set; }
+    }
+}

+ 86 - 0
MBI/SAGA.GplotManage/TopologyApplication/TopologyApplicationUtil.cs

@@ -0,0 +1,86 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:TopologyApplicationUtil
+ * 作者:xulisong
+ * 创建时间: 2019/4/12 15:05:38
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Newtonsoft.Json.Linq;
+using SAGA.DotNetUtils.Cache;
+using SAGA.DotNetUtils.Data;
+using SAGA.MBI.RequestData;
+using SAGA.Models;
+
+namespace SAGA.GplotManage.TopologyApplication
+{
+    public class TopologyApplicationUtil
+    {
+        /// <summary>
+        /// 获取指定图类型的当前关系
+        /// </summary>
+        /// <param name="graphType"></param>
+        /// <returns></returns>
+        public static SimpleGraph<string, string> GetGraph(string graphType)
+        {
+            string graphId = RelationRequest.GetCurrentGraphId(graphType);
+            var tuples = RelationRequest.QueryRelations(graphId, null);
+            var tempGraph = new SimpleGraph<string, string>();
+            foreach (var tuple in tuples)
+            {
+                tempGraph.AddVertex(new SimpleVertex<string>() { Id = tuple.Item1 });
+                tempGraph.AddVertex(new SimpleVertex<string>() { Id = tuple.Item2 });
+                tempGraph.AddEdge(new SimpleEdge<string>(tuple.Item1, tuple.Item2));
+            }
+            return tempGraph;
+        }
+
+
+        /// <summary>
+        /// 创建房间缓冲集合
+        /// </summary>
+        /// <returns></returns>
+        public static CacheItems<string, RoomItem> CreateRoomItems()
+        {
+            CacheItems<string, RoomItem> items = new CacheItems<string, RoomItem>((s) =>
+            {
+                var rooms = new Dictionary<string, RoomItem>();
+                var str = new string[] { MBIBuiltInCategory.Si };
+                List<JObject> datas = CommonConvert.QueryObjectInfoByTypes(str);
+                foreach (var data in datas)
+                {
+                    var roomItem = MBIItemFactory.Create<RoomItem>(data);
+                    rooms[roomItem.Id] = roomItem;
+                }
+
+                return rooms;
+            });
+            return items;
+        }
+
+        public static CacheItems<string, EquipmentItem> CreateEquipmentItems()
+        {
+            CacheItems<string, EquipmentItem> items = new CacheItems<string, EquipmentItem>((s) =>
+            {
+                var equipmentItems = new Dictionary<string, EquipmentItem>();
+                var types = new string[] { MBIBuiltInCategory.Eq };
+                List<JObject> equipDatas = CommonConvert.QueryObjectInfoByTypes(types);
+                foreach (var jobject in equipDatas)
+                {
+                    var item = MBIItemFactory.Create<EquipmentItem>(jobject);
+                    if (item != null && !string.IsNullOrWhiteSpace(item.BimId))
+                    {
+                        equipmentItems[item.Id] = item;
+                    }
+                }
+
+                return equipmentItems;
+            });
+            return items;
+        }
+    }
+}

+ 55 - 0
MBI/SAGA.GplotManage/TopologyApplicationCommand.cs

@@ -0,0 +1,55 @@
+/*-------------------------------------------------------------------------
+ * 功能描述:TopologyApplicationCommand
+ * 作者:xulisong
+ * 创建时间: 2019/4/12 16:17:56
+ * 版本号:v1.0
+ *  -------------------------------------------------------------------------*/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Autodesk.Revit.Attributes;
+using Autodesk.Revit.DB;
+using Autodesk.Revit.UI;
+using SAGA.GplotManage.TopologyApplication;
+using SAGA.RevitUtils.Extends;
+
+namespace SAGA.GplotManage
+{
+    /// <summary>
+    /// 竖井查找
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    public class SearchShaftCommand : ExternalCommand
+    {
+        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
+        {
+            return true;
+        }
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            SearchShaftHandler.ShellExecute();
+            return Result.Succeeded;
+        }
+    }
+    /// <summary>
+    /// 机组供电空间
+    /// </summary>
+    [Transaction(TransactionMode.Manual)]
+    [Regeneration(RegenerationOption.Manual)]
+    public class SpaceAirSupplyCommand : ExternalCommand
+    {
+        public override bool IsCommandAvailable(UIApplication applicationData, CategorySet selectedCategories)
+        {
+            return true;
+        }
+        public override Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
+        {
+            SpaceAirSupplyHandler.ShellExecute();
+            return Result.Succeeded;
+        }
+    }
+}

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

@@ -25,8 +25,8 @@ namespace SAGA.GplotRelationComputerManage
         {
             List<string> testFiles = new List<string>();
 #if DEBUG
-            testFiles.Add("Fl420105000119b7c08edcee11e8a553abe8a598be93.rvt");
-            testFiles.Add("Fl420105000110be38e9dcf511e8a5532b791a1ee2c4.rvt");
+            //testFiles.Add("Fl420105000119b7c08edcee11e8a553abe8a598be93.rvt");
+            testFiles.Add("Fl420105000103457586dcf211e8a553531a211276f8.rvt");
 #endif
             var fileInfos = RevitModelPath.GetAllRevitFiles();
             foreach (var fileInfo in fileInfos)
@@ -35,10 +35,10 @@ namespace SAGA.GplotRelationComputerManage
                 {
 
 #if DEBUG
-                    //if (testFiles.All(f => !fileInfo.Contains(f)))
-                    //{
-                    //    continue;
-                    //}
+                    if (testFiles.All(f => !fileInfo.Contains(f)))
+                    {
+                        continue;
+                    }
 #endif
                     FloorSystemItem floorItems = context.FloorItems.GetItem(fileInfo);
                     //FloorSystemItemTest floorItems = context.TestFloorItems.GetItem(fileInfo);

+ 17 - 0
MBI/SAGA.Models/MBIItem/MBIBuiltInCategory.cs

@@ -62,5 +62,22 @@ namespace SAGA.Models
         /// 楼控控制面板
         /// </summary>
         public readonly static string BACP = "BACP";
+
+        /// <summary>
+        /// 空调风口
+        /// </summary>
+        public readonly static string ATIO = "ATIO";
+        /// <summary>
+        /// 新风机组
+        /// </summary>
+        public readonly static string ATFU = "ATFU";
+        /// <summary>
+        /// 空调机组
+        /// </summary>
+        public readonly static string ATAH = "ATAH";
+        /// <summary>
+        /// 风机盘管
+        /// </summary>
+        public readonly static string ATFC = "ATFC";
     }
 }