From 28999ee3f86d70c5be79f6f6a686c59e56bcad32 Mon Sep 17 00:00:00 2001
From: Shuxia Ning <NingShuxia0927@outlook.com>
Date: 星期二, 24 十二月 2024 21:22:30 +0800
Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs |  224 ++++++++++++++++++++++++++++++++++++-------------------
 1 files changed, 145 insertions(+), 79 deletions(-)

diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
index 30dc8eb..b6a8882 100644
--- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
+++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1,4 +1,6 @@
-锘縰sing DevExpress.Diagram.Core.Native;
+锘縰sing Castle.Core.Logging;
+using DevExpress.CodeParser;
+using DevExpress.Diagram.Core.Native;
 using DevExpress.Mvvm.Native;
 using DevExpress.Utils.MVVM;
 using DevExpress.XtraMap;
@@ -235,13 +237,13 @@
             }
             if (_bimfaceCtrl == null)
             {
-                var overlay = this.ShowOverlay();
                 _bimfaceCtrl = new SimulationBimfaceCtrl();
                 _bimfaceCtrl.Dock = DockStyle.Fill;
+                WaitFormHelper.ShowWaitForm(this.FindForm(), "姝e湪鍔犺浇妯″瀷锛岃绋嶅悗...");
                 await _bimfaceCtrl.InitialData(_project, _projectSite);
                 _bimfaceCtrl.LoadCompletedEvent += () =>
                 {//view鍔犺浇瀹屾垚浜嬩欢
-                    overlay.Close();
+                    WaitFormHelper.HideWaitForm();
                     this.barCkDecorator.Checked = false;
                     this.barCkGrading.Checked = true;
                 };
@@ -319,6 +321,7 @@
                 _propertyCtrl = new SimulationPropertyCtrl();
                 _propertyCtrl.Dock = DockStyle.Fill;
                 _propertyCtrl.AllowEdit = true;
+                _propertyCtrl.CalcuResult = () => GetCalcuResult();
                 _propertyCtrl.HydroViewEvent += (visual) =>
                 {
                     SelectVisual(visual, eSimulationVisualSource.Property);
@@ -807,10 +810,30 @@
 
         #region 涓�閿樉闅�
 
+        private List<string> _allDecoratorCodes = null;
+
+        //鑾峰彇瑁呴グ浠禼ode鍒楄〃
+        private async Task<List<string>> GetDecoratorCodes()
+        {
+            if (_hydroInfo == null)
+            {
+                return default;
+            }
+            if (_allDecoratorCodes == null)
+            {
+                _allDecoratorCodes = await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.GetCodeListByModelID(_hydroInfo.ID, null);
+            }
+            if (_allDecoratorCodes == null)
+            {
+                _allDecoratorCodes = new List<string>();
+            }
+            return _allDecoratorCodes;
+        }
+
         //璁剧疆瑁呴グ浠跺彲瑙佹��
         private async void SetDecoratorVisible(bool isDecoratorVisible)
         {
-            var codes = _hydroInfo.Decorators?.Select(x => x.Code).Distinct().ToList();
+            var codes = await GetDecoratorCodes();
             if (isDecoratorVisible)
             {
                 await _bimfaceCtrl?.ShowComponents(codes);
@@ -1688,11 +1711,11 @@
         private async void barCkFlowEffect_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             var flowEffectHelper = await GetFlowEffectHelper();
-            flowEffectHelper.Visible = this.barCkFlowEffect.Checked;
-            flowEffectHelper.Set();
+            //flowEffectHelper.Visible = this.barCkFlowEffect.Checked;
+            //flowEffectHelper.Set();
         }
 
-        #endregion 姘存祦鍔ㄧ敾
+        #endregion
 
         #region 鐩戞祴鐐�
 
@@ -1731,7 +1754,7 @@
             return await helper.GetAnalyseList();
         }
 
-        #endregion
+        #endregion 鐩戞祴鐐�
 
         #region 鐩戞祴鍊�
 
@@ -1784,7 +1807,7 @@
             }
         }
 
-        #endregion
+        #endregion 鐩戞祴鍊�
 
         #region 浼犳劅鍣ㄦ祴鐐�
 
@@ -1827,7 +1850,7 @@
             SetMonitorDockingList(_visual);
         }
 
-        #endregion
+        #endregion 浼犳劅鍣ㄦ祴鐐�
 
         #region 浼犳劅鍣ㄦ祴鍊�
 
@@ -1892,7 +1915,7 @@
             ShowMonitorDockingValueListCtrl();
         }
 
-        #endregion
+        #endregion 浼犳劅鍣ㄦ祴鍊�
 
         #region 鍒嗘瀽娴嬬偣
 
@@ -1908,7 +1931,7 @@
                 return;
             }
             var monitorHelper = GetMonitorHelper();
-            var allMonitorList = await monitorHelper.GetAll();
+            var allMonitorList = await monitorHelper.GetAnalyseList();
             var dlg = new SetHydroMonitorAnalyseListDlg();
             dlg.ReloadDataEvent += async (list) =>
             {
@@ -1931,7 +1954,7 @@
             SetMonitorAnalyseList(_visual);
         }
 
-        #endregion
+        #endregion 鍒嗘瀽娴嬬偣
 
         #region 娴嬬偣鏍囪
 
@@ -1958,7 +1981,7 @@
             monitorMarkerHelper.Set();
         }
 
-        #endregion
+        #endregion 娴嬬偣鏍囪
 
         #region 妯″瀷妫�鏌�
 
@@ -2227,7 +2250,7 @@
 
         #endregion 璁$畻鏍囩
 
-        #endregion
+        #endregion 妯″瀷璁$畻
 
         #region 瀵煎嚭INP
 
@@ -2475,7 +2498,7 @@
                 {
                     return;
                 }
-                var reportHelper = new SimulationWorkingReportHelper();
+                var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper();
                 reportHelper.Create(fileName, vm);
                 TipFormHelper.ShowInfo("瀵煎嚭鎴愬姛锛�");
             };
@@ -2548,7 +2571,7 @@
             AddWorking();
         }
 
-        #endregion
+        #endregion 褰撳墠宸ュ喌
 
         #region 閫夋嫨宸ュ喌
 
@@ -2670,16 +2693,14 @@
                 this.docPnlBottom.Text = "鐩戞祴鍒嗘瀽";
                 this.docPnlBottom.Height = 350;
             }
-            var allMontorList = await GetMonitorList();
-            var allMonitorValueList = await GetMonitorValueList();
-
+            var allMontorList = await GetMonitorAnalyseList();
             if (allWorkingList == null || allWorkingList.Count < 1)
             {
-                monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, GetWorking(), GetCalcuResult(), _visual);
+                monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, GetCalcuResult());
             }
             else
             {
-                monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, allWorkingList, _visual);
+                monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allWorkingList);
             }
         }
 
@@ -2689,7 +2710,7 @@
             ShowMonitorAnalyListCtrl();
         }
 
-        #endregion
+        #endregion 鐩戞祴鍒嗘瀽
 
         #region 宸ュ喌鍒嗘瀽
 
@@ -2792,55 +2813,6 @@
             }
         }
 
-        //鎹熷け鏇茬嚎
-        private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
-        {
-            if (_visual == null)
-            {
-                SelectInputSource();
-                if (_visual == null)
-                {
-                    TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒");
-                    return;
-                }
-            }
-            HydroVisualInfo visual = _visual;
-            if (_visual is HydroLinkInfo linkInfo)
-            {
-                var visualListHelper = GetVisualListHelper();
-                visual = visualListHelper.GetVisual(linkInfo.StartCode);
-            }
-
-            var workingCheckedListHelper = GetWorkingCheckedListHelper();
-            var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList();
-            if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1)
-            {
-                var workingHelper = GetWorkingHelper();
-                if (!workingHelper.Initialized)
-                {
-                    TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�");
-                    return;
-                }
-                var dlg = new HydroSingleWorkingLossCurveDlg();
-                dlg.HydroClickEvent += (code) =>
-                {
-                    SelectVisual(code, eSimulationVisualSource.None);
-                };
-                dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult, visual);
-                dlg.ShowDialog();
-            }
-            else
-            {
-                var dlg = new HydroMultiWorkingLossCurveDlg();
-                dlg.HydroClickEvent += (code) =>
-                {
-                    SelectVisual(code, eSimulationVisualSource.None);
-                };
-                dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual);
-                dlg.ShowDialog();
-            }
-        }
-
         //鎹熷け缁熻
         private void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
@@ -2913,7 +2885,107 @@
             }
         }
 
-        #endregion
+        #endregion 宸ュ喌鍒嗘瀽
+
+        #region 鎹熷け鏇茬嚎
+
+        //鍗曞伐鍐垫崯澶辨洸绾挎帶浠�
+        private HydroSingleWorkingLossCurveCtrl _singleWorkingLossCurveCtrl = null;
+
+        //鑾峰彇鍗曞伐鍐垫崯澶辨洸绾挎帶浠�
+        private HydroSingleWorkingLossCurveCtrl GetSingleWorkingLossCurveCtrl()
+        {
+            if (_singleWorkingLossCurveCtrl == null)
+            {
+                _singleWorkingLossCurveCtrl = new HydroSingleWorkingLossCurveCtrl();
+                _singleWorkingLossCurveCtrl.Dock = DockStyle.Fill;
+                _singleWorkingLossCurveCtrl.HydroClickEvent += (code) =>
+                {
+                    var visual = GetVisual(code);
+                    SelectVisual(visual, eSimulationVisualSource.None);
+                };
+            }
+            return _singleWorkingLossCurveCtrl;
+        }
+
+        //鍗曞伐鍐垫崯澶辨洸绾挎帶浠舵槸鍚﹀彲瑙�
+        private bool IsSingleWorkingLossCurveCtrlVisible
+        {
+            get
+            {
+                if (this.docPnlBottom.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible)
+                {
+                    if (this.controlContainerBottom.Controls.Count > 0)
+                    {
+                        if (this.controlContainerBottom.Controls[0] is HydroSingleWorkingLossCurveCtrl)
+                        {
+                            return true;
+                        }
+                    }
+                }
+                return false;
+            }
+        }
+
+        //鏄剧ず鍗曞伐鍐垫崯澶辨洸绾挎帶浠�
+        private void ShowSingleWorkingLossCurveCtrl(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult, HydroVisualInfo visual)
+        {
+            var singleWorkingLossCurveCtrl = GetSingleWorkingLossCurveCtrl();
+            if (!IsSingleWorkingLossCurveCtrlVisible)
+            {
+                this.controlContainerBottom.Controls.Clear();
+                this.controlContainerBottom.Controls.Add(singleWorkingLossCurveCtrl);
+                this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
+                this.docPnlBottom.Text = "鎹熷け鏇茬嚎";
+                this.docPnlBottom.Height = 350;
+            }
+            singleWorkingLossCurveCtrl.SetBindingData(hydroInfo, calcuResult, visual);
+        }
+
+        //鎹熷け鏇茬嚎
+        private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            if (_visual == null)
+            {
+                SelectInputSource();
+                if (_visual == null)
+                {
+                    TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒");
+                    return;
+                }
+            }
+            HydroVisualInfo visual = _visual;
+            if (_visual is HydroLinkInfo linkInfo)
+            {
+                var visualListHelper = GetVisualListHelper();
+                visual = visualListHelper.GetVisual(linkInfo.StartCode);
+            }
+
+            var workingCheckedListHelper = GetWorkingCheckedListHelper();
+            var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList();
+            if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1)
+            {
+                var workingHelper = GetWorkingHelper();
+                if (!workingHelper.Initialized)
+                {
+                    TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�");
+                    return;
+                }
+                ShowSingleWorkingLossCurveCtrl(workingHelper.HydroInfo, workingHelper.CalcuResult, visual);
+            }
+            else
+            {
+                var dlg = new HydroMultiWorkingLossCurveDlg();
+                dlg.HydroClickEvent += (code) =>
+                {
+                    SelectVisual(code, eSimulationVisualSource.None);
+                };
+                dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual);
+                dlg.ShowDialog();
+            }
+        }
+
+        #endregion 鎹熷け鏇茬嚎
 
         #region 鏂规绠$悊
 
@@ -2989,11 +3061,5 @@
         }
 
         #endregion 鏂规绠$悊
-
-
-
-
-
-
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3