From 4da9b8277d8ef7567dfc9ca47f1251849b7234de Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期二, 03 十二月 2024 14:33:49 +0800
Subject: [PATCH] 增加过渡件上下游直径修复

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs |   64 ++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs
index edfbb38..a38c376 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/01-matching/01-viewmodel/ValveMatchingViewModel.cs
@@ -1,10 +1,47 @@
-锘縩amespace HStation.WinFrmUI
+锘縰sing HStation.Assets;
+
+namespace HStation.WinFrmUI
 {
     /// <summary>
     /// 闃�闂ㄥ尮閰峍iewModel
     /// </summary>
     public class ValveMatchingViewModel
     {
+        /// <summary>
+        ///
+        /// </summary>
+        public ValveMatchingViewModel()
+        { }
+
+        /// <summary>
+        ///
+        /// </summary>
+        public ValveMatchingViewModel(Yw.Model.HydroValveInfo rhs, Yw.Model.HydroModelInfo hydroInfo, List<HydroCalcuVisualResult> allCalcuResult)
+        {
+            this.ID = rhs.ID;
+            this.Name = rhs.Name;
+            this.Code = rhs.Code;
+            this.ModelType = rhs.ModelType;
+            this.DbLocked = rhs.DbLocked;
+            this.DbId = rhs.DbId;
+            this.CurveDbId = hydroInfo.Curves?.Find(x => x.Code == rhs.ValveSetting)?.DbId;
+            this.Material = rhs.Material;
+            this.Diameter = rhs.Diameter;
+            this.MinorLoss = rhs.MinorLoss;
+            switch (rhs.ValveType)
+            {
+                case Yw.Hydro.ValveType.PRV: this.ValveType = HStation.Assets.eValveType.PRV; break;
+                case Yw.Hydro.ValveType.PSV: this.ValveType = HStation.Assets.eValveType.PSV; break;
+                case Yw.Hydro.ValveType.PBV: this.ValveType = HStation.Assets.eValveType.PBV; break;
+                case Yw.Hydro.ValveType.TCV: this.ValveType = HStation.Assets.eValveType.TCV; break;
+                case Yw.Hydro.ValveType.FCV: this.ValveType = HStation.Assets.eValveType.FCV; break;
+                case Yw.Hydro.ValveType.GPV: this.ValveType = HStation.Assets.eValveType.GPV; break;
+                case Yw.Hydro.ValveType.CV: this.ValveType = HStation.Assets.eValveType.CV; break;
+                default: break;
+            }
+            this.ValveSetting = rhs.ValveSetting;
+        }
+
         /// <summaryd>
         /// ID
         /// </summary>
@@ -48,6 +85,13 @@
         public string DbId { get; set; }
 
         /// <summary>
+        /// CurveDbId
+        /// </summary>
+        [DisplayName("CurveDbId")]
+        [Browsable(false)]
+        public string CurveDbId { get; set; }
+
+        /// <summary>
         /// 鐩村緞
         /// </summary>
         [DisplayName("鐩村緞")]
@@ -73,7 +117,7 @@
         /// </summary>
         [DisplayName("闃�闂ㄧ被鍨�")]
         [Browsable(true)]
-        public string ValveType { get; set; }
+        public HStation.Assets.eValveType ValveType { get; set; }
 
         /// <summary>
         /// 闃�闂ㄨ缃�
@@ -104,6 +148,13 @@
         public double? MatchingDiameter { get; set; }
 
         /// <summary>
+        /// MatchingCurveDbId
+        /// </summary>
+        [DisplayName("MatchingCurveDbId")]
+        [Browsable(false)]
+        public string MatchingCurveDbId { get; set; }
+
+        /// <summary>
         /// 鍖归厤鏉愯川
         /// </summary>
         [DisplayName("鍖归厤鏉愯川")]
@@ -122,7 +173,7 @@
         /// </summary>
         [DisplayName("鍖归厤闃�闂ㄧ被鍨�")]
         [Browsable(true)]
-        public string MatchingValveType { get; set; }
+        public HStation.Assets.eValveType? MatchingValveType { get; set; }
 
         /// <summary>
         /// 鍖归厤闃�闂ㄨ缃�
@@ -137,5 +188,12 @@
         [DisplayName("鍖归厤姘村ご鎹熷け鏇茬嚎")]
         [Browsable(false)]
         public List<CurvePointMatchingViewModel> MatchingCurveQL { get; set; }
+
+        /// <summary>
+        /// 鍖归厤寮�搴︽崯澶辨洸绾�
+        /// </summary>
+        [DisplayName("鍖归厤寮�搴︽崯澶辨洸绾�")]
+        [Browsable(false)]
+        public List<CurvePointMatchingViewModel> MatchingCurveOL { get; set; }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3