From 5e776f1884d4d865c8d3d037a1fb10fb083f37ed Mon Sep 17 00:00:00 2001
From: Shuxia Ning <NingShuxia0927@outlook.com>
Date: 星期五, 03 一月 2025 11:13:02 +0800
Subject: [PATCH] PhartRelation 新增远程方式

---
 WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs |  120 ++++++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 93 insertions(+), 27 deletions(-)

diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs
index 3ae807f..b7ca137 100644
--- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs
+++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs
@@ -3,7 +3,7 @@
     /// <summary>
     /// 绠¢亾瑙嗗浘
     /// </summary>
-    public class HydroPipeViewModel : HydroLinkViewModel
+    public class HydroPipeViewModel : HydroLinkViewModel, IHydroCalcuPipeResult
     {
         /// <summary>
         /// 
@@ -16,26 +16,11 @@
         public HydroPipeViewModel(Yw.Model.HydroPipeInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
         {
             this.Material = rhs.Material;
-            this.UpdatePropStatus(nameof(this.Material), rhs, nameof(rhs.Material));
             this.Diameter = Math.Round(rhs.Diameter, 0);
-            this.UpdatePropStatus(nameof(this.Diameter), rhs, nameof(rhs.Diameter));
             this.Length = Math.Round(rhs.Length, 4);
-            this.UpdatePropStatus(nameof(this.Length), rhs, nameof(rhs.Length));
             this.Roughness = rhs.Roughness;
-            this.UpdatePropStatus(nameof(this.Roughness), rhs, nameof(rhs.Roughness));
             this.MinorLoss = rhs.MinorLoss;
-            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
         }
-
-        /// <summary>
-        /// 绠¢亾鐘舵��
-        /// </summary>
-        [Category("鏁版嵁")]
-        [DisplayName("绠¢亾鐘舵��")]
-        [PropertyOrder(1003)]
-        [Browsable(true)]
-        [TypeConverter(typeof(HydroPipeStatusConverter))]
-        public override string LinkStatus { get; set; }
 
         /// <summary>
         /// 鏉愯川
@@ -91,6 +76,85 @@
         [Browsable(true)]
         public double MinorLoss { get; set; }
 
+
+        /// <summary>
+        /// 娴侀噺
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("娴侀噺")]
+        [DisplayUnit("m鲁/h")]
+        [Display(Name = "娴侀噺(m鲁/h)")]
+        [PropertyOrder(11001)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public virtual double? CalcuQ { get; set; }
+
+        /// <summary>
+        /// 杩涘彛鍘嬪姏
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("杩涘彛鍘嬪姏")]
+        [DisplayUnit("m")]
+        [Display(Name = "杩涘彛鍘嬪姏(m)")]
+        [PropertyOrder(11002)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public virtual double? CalcuPr1 { get; set; }
+
+        /// <summary>
+        /// 鍑哄彛鍘嬪姏
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("鍑哄彛鍘嬪姏")]
+        [DisplayUnit("m")]
+        [Display(Name = "鍑哄彛鍘嬪姏(m)")]
+        [PropertyOrder(11003)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public virtual double? CalcuPr2 { get; set; }
+
+        /// <summary>
+        /// 娴侀��
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("娴侀��")]
+        [DisplayUnit("m/s")]
+        [Display(Name = "娴侀��(m/s)")]
+        [PropertyOrder(19007)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public override double? CalcuVelocity { get; set; }
+
+        /// <summary>
+        /// 灞�閮ㄦ崯澶�
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("灞�閮ㄦ崯澶�")]
+        [DisplayUnit("m")]
+        [Display(Name = "灞�閮ㄦ崯澶�(m)")]
+        [PropertyOrder(19008)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public override double? CalcuMinorLoss { get; set; }
+
+        /// <summary>
+        /// 娌跨▼鎹熷け
+        /// </summary>
+        [Category("璁$畻缁撴灉")]
+        [DisplayName("娌跨▼鎹熷け")]
+        [DisplayUnit("m")]
+        [Display(Name = "娌跨▼鎹熷け(m)")]
+        [PropertyOrder(19009)]
+        [HydroCalcuPro]
+        [ShowEditor(false)]
+        [Browsable(true)]
+        public override double? CalcuFrictionLoss { get; set; }
+
         /// <summary>
         /// 
         /// </summary>
@@ -108,15 +172,10 @@
         {
             base.UpdateProperty();
             this.Material = this.Vmo.Material;
-            this.UpdatePropStatus(nameof(this.Material), this.Vmo, nameof(this.Vmo.Material));
             this.Diameter = this.Vmo.Diameter;
-            this.UpdatePropStatus(nameof(this.Diameter), this.Vmo, nameof(this.Vmo.Diameter));
             this.Length = Math.Round(this.Vmo.Length, 4);
-            this.UpdatePropStatus(nameof(this.Length), this.Vmo, nameof(this.Vmo.Length));
             this.Roughness = this.Vmo.Roughness;
-            this.UpdatePropStatus(nameof(this.Roughness), this.Vmo, nameof(this.Vmo.Roughness));
             this.MinorLoss = this.Vmo.MinorLoss;
-            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
         }
 
         /// <summary>
@@ -126,18 +185,25 @@
         {
             base.UpdateVmoProperty();
             this.Vmo.Material = this.Material;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Material), this, nameof(this.Material));
             this.Vmo.Diameter = this.Diameter;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Diameter), this, nameof(this.Diameter));
             this.Vmo.Length = this.Length;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Length), this, nameof(this.Length));
             this.Vmo.Roughness = this.Roughness;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Roughness), this, nameof(this.Roughness));
             this.Vmo.MinorLoss = this.MinorLoss;
-            this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
         }
 
-
+        /// <summary>
+        /// 鏇存柊璁$畻灞炴��
+        /// </summary>
+        public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs)
+        {
+            base.UpdateCalcuProperty(rhs);
+            if (rhs is HydroCalcuPipeResult calcuPipeProperty)
+            {
+                this.CalcuQ = calcuPipeProperty.CalcuQ.HasValue ? Math.Round(calcuPipeProperty.CalcuQ.Value, 1) : null;
+                this.CalcuPr1 = calcuPipeProperty.CalcuPr1.HasValue ? Math.Round(calcuPipeProperty.CalcuPr1.Value, 2) : null;
+                this.CalcuPr2 = calcuPipeProperty.CalcuPr2.HasValue ? Math.Round(calcuPipeProperty.CalcuPr2.Value, 2) : null;
+            }
+        }
 
     }
 }

--
Gitblit v1.9.3