From 06a1e1eb4ca614efc53d7c3082b861234ae0a479 Mon Sep 17 00:00:00 2001
From: cloudflight <cloudflight@126.com>
Date: 星期六, 23 十一月 2024 14:03:22 +0800
Subject: [PATCH] 1、管网添加能量统计扩展方法AnalyzeEnergy:(统计类型包括起始总能量、输入能量、势能损失、沿程损失、剩余能量(末端))

---
 Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs |  249 ++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 182 insertions(+), 67 deletions(-)

diff --git a/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs b/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs
index 3bdb160..fdbf379 100644
--- a/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs
+++ b/Service/HStation.Service.Revit.Core/01-model/RevitModel_Method.cs
@@ -27,14 +27,6 @@
             {//杩炴帴鑺傜偣
                 list.AddRange(this.Junctions);
             }
-            if (this.Nozzles != null && this.Nozzles.Count > 0)
-            {//鍠峰槾
-                list.AddRange(this.Nozzles);
-            }
-            if (this.Hydrants != null && this.Hydrants.Count > 0)
-            {//娑堢伀鏍�
-                list.AddRange(this.Hydrants);
-            }
             if (this.Bluntheads != null && this.Bluntheads.Count > 0)
             {//闂峰ご
                 list.AddRange(this.Bluntheads);
@@ -50,6 +42,14 @@
             if (this.Fourlinks != null && this.Fourlinks.Count > 0)
             {//鍥涢��
                 list.AddRange(this.Fourlinks);
+            }
+            if (this.Nozzles != null && this.Nozzles.Count > 0)
+            {//鍠峰槾
+                list.AddRange(this.Nozzles);
+            }
+            if (this.Hydrants != null && this.Hydrants.Count > 0)
+            {//娑堢伀鏍�
+                list.AddRange(this.Hydrants);
             }
             if (this.Meters != null && this.Meters.Count > 0)
             {//姘磋〃
@@ -72,9 +72,92 @@
             {//杩囨浮浠�
                 list.AddRange(this.Translations);
             }
+            if (this.Pumps != null && this.Pumps.Count > 0)
+            {//姘存车
+                list.AddRange(this.Pumps);
+            }
+            if (this.Valves != null && this.Valves.Count > 0)
+            {//闃�闂�
+                list.AddRange(this.Valves);
+            }
             if (this.Exchangers != null && this.Exchangers.Count > 0)
             {//鎹㈢儹鍣�
                 list.AddRange(this.Exchangers);
+            }
+            if (this.Compressors != null && this.Compressors.Count > 0)
+            {//绌哄帇鏈�
+                list.AddRange(this.Compressors);
+            }
+
+            return list;
+        }
+
+        /// <summary>
+        /// 鑾峰彇鎵�鏈夊彲瑙佺粍浠�
+        /// </summary>
+        public List<RevitVisual> GetAllVisuals()
+        {
+            var list = new List<RevitVisual>();
+            if (this.Reservoirs != null && this.Reservoirs.Count > 0)
+            {//姘村簱
+                list.AddRange(this.Reservoirs);
+            }
+            if (this.Tanks != null && this.Tanks.Count > 0)
+            {//姘存睜
+                list.AddRange(this.Tanks);
+            }
+            if (this.Waterboxs != null && this.Waterboxs.Count > 0)
+            {//姘寸
+                list.AddRange(this.Waterboxs);
+            }
+            if (this.Junctions != null && this.Junctions.Count > 0)
+            {//杩炴帴鑺傜偣
+                list.AddRange(this.Junctions);
+            }
+            if (this.Bluntheads != null && this.Bluntheads.Count > 0)
+            {//闂峰ご
+                list.AddRange(this.Bluntheads);
+            }
+            if (this.Elbows != null && this.Elbows.Count > 0)
+            {//寮ご
+                list.AddRange(this.Elbows);
+            }
+            if (this.Threelinks != null && this.Threelinks.Count > 0)
+            {//涓夐��
+                list.AddRange(this.Threelinks);
+            }
+            if (this.Fourlinks != null && this.Fourlinks.Count > 0)
+            {//鍥涢��
+                list.AddRange(this.Fourlinks);
+            }
+            if (this.Nozzles != null && this.Nozzles.Count > 0)
+            {//鍠峰槾
+                list.AddRange(this.Nozzles);
+            }
+            if (this.Hydrants != null && this.Hydrants.Count > 0)
+            {//娑堢伀鏍�
+                list.AddRange(this.Hydrants);
+            }
+            if (this.Meters != null && this.Meters.Count > 0)
+            {//姘磋〃
+                list.AddRange(this.Meters);
+            }
+            if (this.Flowmeters != null && this.Flowmeters.Count > 0)
+            {//娴侀噺璁�
+                list.AddRange(this.Flowmeters);
+            }
+            if (this.Pressmeters != null && this.Pressmeters.Count > 0)
+            {//鍘嬪姏琛�
+                list.AddRange(this.Pressmeters);
+            }
+
+            if (this.Pipes != null && this.Pipes.Count > 0)
+            {//绠¢亾
+                list.AddRange(this.Pipes);
+            }
+            if (this.Translations != null && this.Translations.Count > 0)
+            {//杩囨浮浠�
+                list.AddRange(this.Translations);
             }
             if (this.Pumps != null && this.Pumps.Count > 0)
             {//姘存车
@@ -84,12 +167,20 @@
             {//闃�闂�
                 list.AddRange(this.Valves);
             }
+            if (this.Exchangers != null && this.Exchangers.Count > 0)
+            {//鎹㈢儹鍣�
+                list.AddRange(this.Exchangers);
+            }
+            if (this.Compressors != null && this.Compressors.Count > 0)
+            {//绌哄帇鏈�
+                list.AddRange(this.Compressors);
+            }
 
             return list;
         }
 
         /// <summary>
-        /// 鑾峰彇鎵�鏈夎妭鐐�
+        /// 鑾峰彇鎵�鏈夎妭鐐圭粍浠�
         /// </summary>
         public List<RevitNode> GetAllNodes()
         {
@@ -110,14 +201,6 @@
             {//杩炴帴鑺傜偣
                 list.AddRange(this.Junctions);
             }
-            if (this.Nozzles != null && this.Nozzles.Count > 0)
-            {//鍠峰槾
-                list.AddRange(this.Nozzles);
-            }
-            if (this.Hydrants != null && this.Hydrants.Count > 0)
-            {//娑堢伀鏍�
-                list.AddRange(this.Hydrants);
-            }
             if (this.Bluntheads != null && this.Bluntheads.Count > 0)
             {//闂峰ご
                 list.AddRange(this.Bluntheads);
@@ -133,6 +216,14 @@
             if (this.Fourlinks != null && this.Fourlinks.Count > 0)
             {//鍥涢��
                 list.AddRange(this.Fourlinks);
+            }
+            if (this.Nozzles != null && this.Nozzles.Count > 0)
+            {//鍠峰槾
+                list.AddRange(this.Nozzles);
+            }
+            if (this.Hydrants != null && this.Hydrants.Count > 0)
+            {//娑堢伀鏍�
+                list.AddRange(this.Hydrants);
             }
             if (this.Meters != null && this.Meters.Count > 0)
             {//姘磋〃
@@ -150,42 +241,9 @@
         }
 
         /// <summary>
-        /// 鑾峰彇鎵�鏈夌娈�
+        /// 鑾峰彇鎵�鏈夋按婧愮粍浠�
         /// </summary>
-        public List<RevitLink> GetAllLinks()
-        {
-            var list = new List<RevitLink>();
-
-            if (this.Pipes != null && this.Pipes.Count > 0)
-            {//绠¢亾
-                list.AddRange(this.Pipes);
-            }
-            if (this.Translations != null && this.Translations.Count > 0)
-            {//杩囨浮浠�
-                list.AddRange(this.Translations);
-            }
-            if (this.Exchangers != null && this.Exchangers.Count > 0)
-            {//鎹㈢儹鍣�
-                list.AddRange(this.Exchangers);
-            }
-            if (this.Pumps != null && this.Pumps.Count > 0)
-            {//姘存车
-                list.AddRange(this.Pumps);
-            }
-            if (this.Valves != null && this.Valves.Count > 0)
-            {//闃�闂�
-                list.AddRange(this.Valves);
-            }
-
-            return list;
-
-        }
-
-        /// <summary>
-        /// 鑾峰彇鎵�鏈夋按婧�
-        /// </summary>
-        /// <returns></returns>
-        public List<RevitSource> GetAllWaterSources()
+        public List<RevitSource> GetAllSources()
         {
             var list = new List<RevitSource>();
             if (this.Reservoirs != null && this.Reservoirs.Count > 0)
@@ -204,7 +262,7 @@
         }
 
         /// <summary>
-        /// 鑾峰彇鎵�鏈夎繛鎺ヨ妭鐐�
+        /// 鑾峰彇鎵�鏈夎繛鎺ヨ妭鐐圭粍浠�
         /// </summary>
         public List<RevitJunction> GetAllJunctions()
         {
@@ -212,14 +270,6 @@
             if (this.Junctions != null && this.Junctions.Count > 0)
             {//杩炴帴鑺傜偣
                 list.AddRange(this.Junctions);
-            }
-            if (this.Nozzles != null && this.Nozzles.Count > 0)
-            {//鍠峰槾
-                list.AddRange(this.Nozzles);
-            }
-            if (this.Hydrants != null && this.Hydrants.Count > 0)
-            {//娑堢伀鏍�
-                list.AddRange(this.Hydrants);
             }
             if (this.Bluntheads != null && this.Bluntheads.Count > 0)
             {//闂峰ご
@@ -237,6 +287,14 @@
             {//鍥涢��
                 list.AddRange(this.Fourlinks);
             }
+            if (this.Nozzles != null && this.Nozzles.Count > 0)
+            {//鍠峰槾
+                list.AddRange(this.Nozzles);
+            }
+            if (this.Hydrants != null && this.Hydrants.Count > 0)
+            {//娑堢伀鏍�
+                list.AddRange(this.Hydrants);
+            }
             if (this.Meters != null && this.Meters.Count > 0)
             {//姘磋〃
                 list.AddRange(this.Meters);
@@ -253,7 +311,7 @@
         }
 
         /// <summary>
-        /// 鑾峰彇鎵�鏈夋墿鏁e櫒
+        /// 鑾峰彇鎵�鏈夋墿鏁e櫒缁勪欢
         /// </summary>
         public List<RevitEmitter> GetAllEmitters()
         {
@@ -272,7 +330,68 @@
         }
 
         /// <summary>
-        /// 鑾峰彇鎵�鏈夌閬�
+        /// 鑾峰彇鎵�鏈夎繛鎺ョ粍浠�
+        /// </summary>
+        public List<RevitCoupling> GetAllCouplings()
+        {
+            var list = new List<RevitCoupling>();
+            if (this.Bluntheads != null && this.Bluntheads.Count > 0)
+            {//闂峰ご
+                list.AddRange(this.Bluntheads);
+            }
+            if (this.Elbows != null && this.Elbows.Count > 0)
+            {//寮ご
+                list.AddRange(this.Elbows);
+            }
+            if (this.Threelinks != null && this.Threelinks.Count > 0)
+            {//涓夐��
+                list.AddRange(this.Threelinks);
+            }
+            if (this.Fourlinks != null && this.Fourlinks.Count > 0)
+            {//鍥涢��
+                list.AddRange(this.Fourlinks);
+            }
+            return list;
+        }
+
+        /// <summary>
+        /// 鑾峰彇鎵�鏈夌娈电粍浠�
+        /// </summary>
+        public List<RevitLink> GetAllLinks()
+        {
+            var list = new List<RevitLink>();
+
+            if (this.Pipes != null && this.Pipes.Count > 0)
+            {//绠¢亾
+                list.AddRange(this.Pipes);
+            }
+            if (this.Translations != null && this.Translations.Count > 0)
+            {//杩囨浮浠�
+                list.AddRange(this.Translations);
+            }
+            if (this.Pumps != null && this.Pumps.Count > 0)
+            {//姘存车
+                list.AddRange(this.Pumps);
+            }
+            if (this.Valves != null && this.Valves.Count > 0)
+            {//闃�闂�
+                list.AddRange(this.Valves);
+            }
+            if (this.Exchangers != null && this.Exchangers.Count > 0)
+            {//鎹㈢儹鍣�
+                list.AddRange(this.Exchangers);
+            }
+            if (this.Compressors != null && this.Compressors.Count > 0)
+            {//绌哄帇鏈�
+                list.AddRange(this.Compressors);
+            }
+
+            return list;
+
+        }
+
+        /// <summary>
+        /// 鑾峰彇鎵�鏈夌閬撶粍浠�
         /// </summary>
         public List<RevitPipe> GetAllPipes()
         {
@@ -285,10 +404,6 @@
             if (this.Translations != null && this.Translations.Count > 0)
             {//杩囨浮浠�
                 list.AddRange(this.Translations);
-            }
-            if (this.Exchangers != null && this.Exchangers.Count > 0)
-            {//鎹㈢儹鍣�
-                list.AddRange(this.Exchangers);
             }
 
             return list;

--
Gitblit v1.9.3