From 7b65f86343ca014b12894f09b7d62e8b5ac1f95d Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期五, 24 一月 2025 09:15:11 +0800
Subject: [PATCH] 单工况损失曲线增加上下游追踪和高亮显示

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/00-core/HydroJunctionViewModel.cs |   49 +++++++++++++++++++++++++++++++------------------
 1 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/00-core/HydroJunctionViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/00-core/HydroJunctionViewModel.cs
index 39b1371..70e7e70 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/00-core/HydroJunctionViewModel.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/00-core/HydroJunctionViewModel.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// 杩炴帴鑺傜偣
     /// </summary>
-    public class HydroJunctionViewModel : HydroNodeViewModel
+    public class HydroJunctionViewModel : HydroNodeViewModel, IHydroCalcuJunctionResult
     {
         /// <summary>
         /// 
@@ -15,14 +15,10 @@
         /// </summary>
         public HydroJunctionViewModel(Yw.Model.HydroJunctionInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
         {
-            this.Elev = rhs.Elev;
-            this.UpdatePropStatus(nameof(this.Elev), rhs, nameof(rhs.Elev));
+            this.Elev = Math.Round(rhs.Elev, 4);
             this.MinorLoss = rhs.MinorLoss;
-            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
             this.Demand = rhs.Demand;
-            this.UpdatePropStatus(nameof(this.Demand), rhs, nameof(rhs.Demand));
             this.DemandPattern = rhs.DemandPattern;
-            this.UpdatePropStatus(nameof(this.DemandPattern), rhs, nameof(rhs.DemandPattern));
         }
 
 
@@ -31,8 +27,8 @@
         /// </summary>
         [Category("鏁版嵁")]
         [DisplayName("鏍囬珮")]
-        [Display(Name = "鏍囬珮(m)")]
         [DisplayUnit("m")]
+        [Display(Name = "鏍囬珮(m)")]
         [PropertyOrder(2001)]
         [Browsable(true)]
         public virtual double Elev { get; set; }
@@ -45,7 +41,7 @@
         [Display(Name = "鎹熷け绯绘暟")]
         [PropertyOrder(2002)]
         [Browsable(true)]
-        public virtual double? MinorLoss { get; set; }
+        public virtual double MinorLoss { get; set; }
 
         /// <summary>
         /// 闇�姘撮噺
@@ -56,7 +52,7 @@
         [DisplayUnit("m鲁/h")]
         [PropertyOrder(2003)]
         [Browsable(false)]
-        public virtual double? Demand { get; set; }
+        public virtual double Demand { get; set; }
 
         /// <summary>
         /// 闇�姘存ā寮�
@@ -68,6 +64,19 @@
         [PropertyOrder(2004)]
         [Browsable(false)]
         public virtual string DemandPattern { get; set; }
+
+        /// <summary>
+        /// 鍘嬪姏
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("鍘嬪姏")]
+        [DisplayUnit("m")]
+        [Display(Name = "鍘嬪姏(m)")]
+        [PropertyOrder(11002)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public virtual double? CalcuPr { get; set; }
 
         /// <summary>
         /// 
@@ -85,14 +94,10 @@
         public override void UpdateProperty()
         {
             base.UpdateProperty();
-            this.Elev = this.Vmo.Elev;
-            this.UpdatePropStatus(nameof(this.Elev), this.Vmo, nameof(this.Vmo.Elev));
+            this.Elev = Math.Round(this.Vmo.Elev, 4);
             this.MinorLoss = this.Vmo.MinorLoss;
-            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
             this.Demand = this.Vmo.Demand;
-            this.UpdatePropStatus(nameof(this.Demand), this.Vmo, nameof(this.Vmo.Demand));
             this.DemandPattern = this.Vmo.DemandPattern;
-            this.UpdatePropStatus(nameof(this.DemandPattern), this.Vmo, nameof(this.Vmo.DemandPattern));
         }
 
         /// <summary>
@@ -102,13 +107,21 @@
         {
             base.UpdateVmoProperty();
             this.Vmo.Elev = this.Elev;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Elev), this, nameof(this.Elev));
             this.Vmo.MinorLoss = this.MinorLoss;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
             this.Vmo.Demand = this.Demand;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Demand), this, nameof(this.Demand));
             this.Vmo.DemandPattern = this.DemandPattern;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.DemandPattern), this, nameof(this.DemandPattern));
+        }
+
+        /// <summary>
+        /// 鏇存柊璁$畻灞炴��
+        /// </summary>
+        public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs)
+        {
+            base.UpdateCalcuProperty(rhs);
+            if (rhs is HydroCalcuJunctionResult calcuJunctionResult)
+            {
+                this.CalcuPr = calcuJunctionResult.CalcuPr.HasValue ? Math.Round(calcuJunctionResult.CalcuPr.Value, 2) : null;
+            }
         }
 
 

--
Gitblit v1.9.3