From bcc7f0563d92efd7013ec36e1d9ad7871b631454 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期五, 08 十一月 2024 14:52:00 +0800
Subject: [PATCH] 优化水力特性

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs |   81 ++++++++++++++++++++++++++++++----------
 1 files changed, 61 insertions(+), 20 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
index d0fbe62..50ebf13 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/02-bimface/XhsProjectSimulationBimfaceCtrl.cs
@@ -161,8 +161,6 @@
         /// <summary>
         /// 鏄剧ず鏋勪欢
         /// </summary>
-        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
-        /// <returns></returns>
         public async Task ShowComponents(List<string> elementIds)
         {
             if (_bimfaceInteropContainer == null)
@@ -175,8 +173,6 @@
         /// <summary>
         /// 闅愯棌鏋勪欢
         /// </summary>
-        /// <param name="elementIds">鏋勪欢id鍒楄〃</param>
-        /// <returns></returns>
         public async Task HideComponents(List<string> elementIds)
         {
             if (_bimfaceInteropContainer == null)
@@ -189,7 +185,6 @@
         /// <summary>
         /// 鏄剧ず鎵�鏈夋瀯浠�
         /// </summary>
-        /// <returns></returns>
         public async Task ShowAllComponents()
         {
             if (_bimfaceInteropContainer == null)
@@ -321,12 +316,20 @@
         /// <summary>
         /// 缂╂斁鑷抽�夋嫨鏋勪欢
         /// </summary>
-        public async Task ZoomAndSelectComponents(List<string> elementIds)
+        public async Task ZoomAndSelectComponent(string elementId)
         {
-            if (_bimfaceInteropContainer == null)
+            if (string.IsNullOrEmpty(elementId))
             {
                 return;
             }
+            await _bimfaceInteropContainer.ZoomAndSelectComponents(new List<string>() { elementId });
+        }
+
+        /// <summary>
+        /// 缂╂斁鑷抽�夋嫨鏋勪欢
+        /// </summary>
+        public async Task ZoomAndSelectComponents(List<string> elementIds)
+        {
             await _bimfaceInteropContainer.ZoomAndSelectComponents(elementIds);
         }
 
@@ -412,37 +415,39 @@
                 await _bimfaceInteropContainer?.ClearLogicCalcuCustomLabels();
                 return;
             }
-            var obj = new List<CustomLabel>();
+            var obj = new List<LogicCalcuCustomLabel>();
             var allParterList = hydroInfo.GetAllParters();
             allParterList?.ForEach(x =>
             {
                 if (x is Yw.Model.HydroPumpInfo pump)
                 {
-                    var hz = pump.RatedHz * pump.SpeedRatio;
+                    var hz = Math.Round(pump.RatedHz * pump.SpeedRatio);
                     var calcuPump = calcuResult.LinkList.Find(x => x.Id == pump.Code);
                     var calcuPumpStart = calcuResult.NodeList.Find(x => x.Id == pump.StartCode);
                     var calcuPumpEnd = calcuResult.NodeList.Find(x => x.Id == pump.EndCode);
-                    var pumpCustomLabel = new CustomLabel();
+                    var pumpCustomLabel = new LogicCalcuCustomLabel();
                     pumpCustomLabel.Id = pump.Code;
-                    pumpCustomLabel.Data = new List<CustomLabelItem>()
+                    pumpCustomLabel.Distance = 10000;
+                    pumpCustomLabel.Data = new List<LogicCalcuCustomLabelItem>()
                     {
-                        new CustomLabelItem(){ Name="鐘舵��",Value=HydroLinkStatusHelper.GetStatusName(pump.LinkStatus),Unit=string.Empty},
-                        new CustomLabelItem(){ Name="棰戠巼",Value=hz.ToString(),Unit=string.Empty},
-                        new CustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuPump.Flow,1).ToString(),Unit="m鲁/h"},
-                        new CustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuPumpStart.Head,4).ToString(),Unit="m"},
-                        new CustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuPumpEnd.Head,4).ToString(),Unit="m"},
+                        new LogicCalcuCustomLabelItem(){ Name="鐘舵��",Value=HydroLinkStatusHelper.GetStatusName(pump.LinkStatus),Unit=string.Empty},
+                        new LogicCalcuCustomLabelItem(){ Name="棰戠巼",Value=hz.ToString(),Unit=string.Empty},
+                        new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuPump.Flow,1).ToString(),Unit="m鲁/h"},
+                        new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuPumpStart.Head,4).ToString(),Unit="m"},
+                        new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuPumpEnd.Head,4).ToString(),Unit="m"},
                     };
                     obj.Add(pumpCustomLabel);
                 }
                 else if (x is Yw.Model.HydroEmitterInfo emitter)
                 {
                     var calcuEmitter = calcuResult.NodeList.Find(x => x.Id == emitter.Code);
-                    var emitterCustomLabel = new CustomLabel();
+                    var emitterCustomLabel = new LogicCalcuCustomLabel();
                     emitterCustomLabel.Id = emitter.Code;
-                    emitterCustomLabel.Data = new List<CustomLabelItem>()
+                    emitterCustomLabel.Distance = 10000;
+                    emitterCustomLabel.Data = new List<LogicCalcuCustomLabelItem>()
                     {
-                        new CustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuEmitter.Demand,1).ToString(),Unit="m鲁/h"},
-                        new CustomLabelItem(){ Name="鍘嬪姏",Value=Math.Round(calcuEmitter.Head,4).ToString(),Unit="m"}
+                        new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuEmitter.Demand,1).ToString(),Unit="m鲁/h"},
+                        new LogicCalcuCustomLabelItem(){ Name="鍘嬪姏",Value=Math.Round(calcuEmitter.Head,4).ToString(),Unit="m"}
                     };
                     obj.Add(emitterCustomLabel);
                 }
@@ -480,6 +485,42 @@
 
         #endregion
 
+        #region 涓氬姟姘存祦鍔ㄧ敾
+
+        /// <summary>
+        /// 鍔犺浇姘存祦鍔ㄧ敾
+        /// </summary>
+        public async Task LoadFlowEffect(LogicFlowEffect obj)
+        {
+            await _bimfaceInteropContainer?.LoadFlowEffect(obj);
+        }
+
+        /// <summary>
+        /// 鍔犺浇姘存祦鍔ㄧ敾
+        /// </summary>
+        public async Task LoadFlowEffect(List<LogicFlowEffect> obj)
+        {
+            await _bimfaceInteropContainer?.LoadFlowEffectList(obj);
+        }
+
+        /// <summary>
+        /// 鍗歌浇姘存祦鍔ㄧ敾
+        /// </summary>
+        public async Task UnloadFlowEffect()
+        {
+            await _bimfaceInteropContainer?.UnloadFlowEffect();
+        }
+
+        /// <summary>
+        /// 閫氳繃Id鍗歌浇姘存祦鍔ㄧ敾
+        /// </summary>
+        public async Task UnloadFlowEffectById(string Id)
+        {
+            await _bimfaceInteropContainer?.UnloadFlowEffectById(Id);
+        }
+
+        #endregion
+
         #region 杩炴帴鏋勪欢棰滆壊
 
         private const string _linkComponentColor = "#008B00";//杩炴帴鏋勪欢棰滆壊

--
Gitblit v1.9.3