From f04e6ed843d66c22e08132ca23d2193d6800905c Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期四, 26 九月 2024 11:51:19 +0800
Subject: [PATCH] 增加窗体图标

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs
index 081023d..535af31 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/04-simulation/01-property/XhsProjectSimulationPropertyCtrl.cs
@@ -23,8 +23,6 @@
         /// </summary>
         public event Func<Yw.Model.HydroModelInfo> GetHydroInfoEvent;
 
-
-
         /// <summary>
         /// 閫夋嫨缁勪欢
         /// </summary>
@@ -98,12 +96,23 @@
             {
                 case Yw.WinFrmUI.HydroCurve.Pump:
                     {
-                        var pumpPropertyViewModel = propViewModel as HydroPumpPropertyViewModel;
-                        var dbId = pumpPropertyViewModel.DbId;
-                        var modelType = pumpPropertyViewModel.ModelType;
+                        var hydroInfo = GetHydroInfoEvent?.Invoke();
+                        if (hydroInfo == null)
+                        {
+                            return false;
+                        }
+                        var vmPump = propViewModel as HydroPumpPropertyViewModel;
+                        var modelType = vmPump.ModelType;
+                        var dbId = vmPump.DbId;
+                        var curveDbId = string.Empty;
+                        if (!string.IsNullOrEmpty(vmPump.CurveQH))
+                        {
+                            var curveQh = hydroInfo.Curves?.Find(x => x.Code == vmPump.CurveQH);
+                            curveDbId = curveQh?.DbId;
+                        }
                         var dlg = new PumpMainCurveChoiceDlg();
-                        dlg.SetBindingData(dbId, modelType);
-                        dlg.CurveinfoEvent += (dbid, curveid, curveinfo) =>
+                        dlg.SetBindingData(dbId, modelType, curveDbId);
+                        dlg.SelectCurveInfoEvent += (dbId, curveId, curveInfo) =>
                         {
                         };
                         dlg.ShowDialog();
@@ -165,6 +174,5 @@
         {
             return false;
         }
-
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3