From 80ec78f9c85466b09ac4a4101d5073c26f37021e Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期一, 06 一月 2025 09:14:32 +0800
Subject: [PATCH] 水力计算bug修复

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs |   87 +++++++++++++++++++++++++------------------
 1 files changed, 51 insertions(+), 36 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
index e77c2e4..c403ae0 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/XhsProjectSimulationMgrPage.cs
@@ -17,15 +17,18 @@
             this.PageTitle.SvgImageSize = new Size(24, 24);
             this.simulationFunctionMgrCtrl1.ShowProjectSiteInfoEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteInfoEvent;
             this.simulationFunctionMgrCtrl1.ShowProjectSiteSimulationEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteSimulationEvent;
-            this.simulationFunctionMgrCtrl1.ShowProjectSiteWorkingEvent += SimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent;
+            this.simulationFunctionMgrCtrl1.ProjectSiteWorkingAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingAppendEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingUpdateEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingRemoveEvent;
             this.simulationFunctionMgrCtrl1.ProjectSiteWorkingCheckedEvent += SimulationFunctionMgrCtrl1_ProjectSiteWorkingCheckedEvent;
             this.simulationFunctionMgrCtrl1.CreateProjectSiteSchemeEvent += SimulationFunctionMgrCtrl1_CreateProjectSiteSchemeEvent;
+            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeAppendEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeAppendEvent;
+            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeUpdateEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeUpdateEvent;
+            this.simulationFunctionMgrCtrl1.ProjectSiteSchemeRemoveEvent += SimulationFunctionMgrCtrl1_ProjectSiteSchemeRemoveEvent;
         }
 
         private XhsProjectVmo _project = null;//椤圭洰
-        private object _locker = new object();//閿佸畾瀵硅薄
+        private object _locker = new();//閿佸畾瀵硅薄
 
         /// <summary>
         /// 鍒濆鍖栨暟鎹簮
@@ -134,10 +137,12 @@
                     page.UpdateSchemeEvent += (rhs) =>
                     {
                         //鏇存柊鏂规浜嬩欢
+                        this.simulationFunctionMgrCtrl1.UpdateScheme(rhs);
                     };
                     page.RemoveSchemeEvent += (rhs) =>
                     {
                         //绉婚櫎鏂规浜嬩欢
+                        this.simulationFunctionMgrCtrl1.RemoveScheme(rhs);
                     };
                     page.SetBindingData(project, projectSite, scheme, hydroInfo, allWorkingCheckedListDict);
                     CreatePage(page, guid);
@@ -145,42 +150,18 @@
             }
         }
 
-        //鏄剧ず椤圭洰绔欏伐鍐典簨浠�
-        private void SimulationFunctionMgrCtrl1_ShowProjectSiteWorkingEvent
+        /// <summary>
+        /// 椤圭洰绔欏伐鍐靛鍔犱簨浠�
+        /// </summary>
+        private void SimulationFunctionMgrCtrl1_ProjectSiteWorkingAppendEvent
             (
                 XhsProjectVmo project,
                 XhsProjectSiteVmo projectSite,
                 XhsSchemeVmo scheme,
-                Yw.Model.HydroModelInfo hydroInfo,
-                HydroWorkingVmo working,
-                SvgImage svgImage
+                HydroWorkingVmo working
             )
         {
-            lock (_locker)
-            {
-                var guid = new PageGuid()
-                {
-                    Modular = this.PageGuid.Modular,
-                    MoudingType = eMoudingType.Tab,
-                    Function = SimulationFunctionHelper.Working,
-                    TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}-{working.ID}"
-                };
-                if (!IsExistPage(guid, true))
-                {
-                    var page = new XhsProjectSimulationWorkingPage();
-                    page.UpdateWorkingEvent += (rhs) =>
-                    {
-                        this.simulationFunctionMgrCtrl1.UpdateWorking(scheme, rhs);
-                    };
-                    page.RemoveWorkingEvent += (rhs) =>
-                    {
-                        this.simulationFunctionMgrCtrl1.RemoveWorking(scheme, rhs);
-                    };
-                    page.PageTitle.HeaderSvgImage = svgImage;
-                    page.SetBindingData(project, projectSite, scheme, hydroInfo, working);
-                    CreatePage(page, guid);
-                }
-            }
+            //鐩墠澧炲姞宸ュ喌閮芥槸閫氳繃妯℃嫙鐣岄潰澧炲姞鐨勶紝鍔熻兘绠$悊鎺т欢灞炰簬琚�氱煡鐨勶紝鍏朵粬鍦版柟鏆傛椂涓嶅叧蹇冨伐鍐靛鍔�
         }
 
         //椤圭洰绔欏伐鍐垫洿鏂颁簨浠�
@@ -197,7 +178,7 @@
                 Modular = this.PageGuid.Modular,
                 MoudingType = eMoudingType.Tab,
                 Function = SimulationFunctionHelper.Simulation,
-                TagName = projectSite.ID.ToString()
+                TagName = $"{project.ID}-{projectSite.ID}-{scheme?.ID}"
             };
             var page = FindPage(guid);
             if (page == null)
@@ -277,20 +258,54 @@
                 XhsProjectVmo project,
                 XhsProjectSiteVmo projectSite,
                 Yw.Model.HydroModelInfo hydroInfo,
+                List<XhsSchemeVmo> allSchemeList,
                 SvgImage svgImage
             )
         {
-            WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇妯″瀷锛岃绋嶄警...");
-            var dlg = new AddXhsSchemeDlg();
+            WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇锛岃绋嶄警...");
+            var dlg = new CreateXhsSchemeDlg();
             dlg.Shown += delegate { WaitFormHelper.HideWaitForm(this.FindForm()); };
+            dlg.SetBindingData(project, projectSite, hydroInfo, allSchemeList);
             dlg.ReloadDataEvent += (rhs) =>
             {
                 this.simulationFunctionMgrCtrl1.AppendScheme(rhs);
             };
-            dlg.SetBindingData(project, projectSite, hydroInfo);
             dlg.ShowDialog();
         }
 
+        //椤圭洰绔欐柟妗堝鍔犱簨浠�
+        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeAppendEvent
+            (
+                XhsProjectVmo project,
+                XhsProjectSiteVmo projectSite,
+                XhsSchemeVmo scheme
+            )
+        {
+            //琚姩
+        }
+
+        //椤圭洰绔欐柟妗堟洿鏂颁簨浠�
+        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeUpdateEvent
+            (
+                XhsProjectVmo project,
+                XhsProjectSiteVmo projectSite,
+                XhsSchemeVmo scheme
+            )
+        {
+            //琚姩
+        }
+
+        //椤圭洰绔欐柟妗堢Щ闄や簨浠�
+        private void SimulationFunctionMgrCtrl1_ProjectSiteSchemeRemoveEvent
+            (
+                XhsProjectVmo project,
+                XhsProjectSiteVmo projectSite,
+                XhsSchemeVmo scheme
+            )
+        {
+            //琚姩
+        }
+
         #endregion
 
         #region TabbedView 鐩稿叧浜嬩欢澶勭悊绋嬪簭

--
Gitblit v1.9.3