From f6c7e0b68f17c2ecb8981fb62ad650bc4b744bc0 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 27 十一月 2024 17:18:35 +0800
Subject: [PATCH] 增加多工况损失统计

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs |   75 +++++++++++++++++++++----------------
 1 files changed, 43 insertions(+), 32 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 64cf438..ce734ec 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
@@ -77,15 +77,15 @@
             }
             if (_bimfaceCtrl == null)
             {
+                var overlay = this.ShowOverlay();
                 _bimfaceCtrl = new XhsProjectSimulationBimfaceCtrl();
                 _bimfaceCtrl.Dock = DockStyle.Fill;
                 await _bimfaceCtrl.InitialData(_project, _projectSite);
                 _bimfaceCtrl.LoadCompletedEvent += () =>
                 {//view鍔犺浇瀹屾垚浜嬩欢
-                    if (_hydroInfo == null)
-                    {
-                        return;
-                    }
+                    overlay.Close();
+                    this.barCkDecorator.Checked = false;
+                    this.barCkGrading.Checked = true;
                 };
                 _bimfaceCtrl.HydroMouseLeftClickEvent += (code) =>
                 {//榧犳爣宸﹂敭鐐瑰嚮浜嬩欢
@@ -1714,8 +1714,6 @@
             {
                 var workingHelper = GetWorkingHelper();
                 _calcuResultHelper = new SimulationCalcuResultHelper(workingHelper);
-                var calcuResult = GetCalcuResult();
-                _calcuResultHelper.InitialData();
             }
             return _calcuResultHelper;
         }
@@ -1868,10 +1866,9 @@
         {
             if (_calcuResultLabelHelper == null)
             {
-                var visualListHelper = GetVisualListHelper();
                 var calcuResultHelper = GetCalcuResultHelper();
                 var bimfaceCtrl = await GetBimfaceCtrl();
-                _calcuResultLabelHelper = new SimulationCalcuResultLabelHelper(visualListHelper, calcuResultHelper, bimfaceCtrl);
+                _calcuResultLabelHelper = new SimulationCalcuResultLabelHelper(calcuResultHelper, bimfaceCtrl);
             }
             return _calcuResultLabelHelper;
         }
@@ -1976,10 +1973,12 @@
 
         #endregion
 
-        #region 骞惰仈璁$畻
+        #region 姘存车鍒楄〃
 
-        //骞惰仈鍒嗘瀽
-        private void ParallelAnalysis()
+        #region 骞惰仈妯℃嫙
+
+        //骞惰仈妯℃嫙
+        private void PumpParallel()
         {
             if (_hydroInfo == null)
             {
@@ -2049,13 +2048,17 @@
             dlg.ShowDialog();
         }
 
-        //骞惰仈鍒嗘瀽
-        private void barBtnParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //骞惰仈妯℃嫙
+        private void barBtnPumpParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            ParallelAnalysis();
+            PumpParallel();
         }
 
         #endregion
+
+        #endregion
+
+
 
         #region 姘村姏璁$畻
 
@@ -2121,13 +2124,6 @@
                     ShowCalcuFailedCtrl(calcuResult);
                     TipFormHelper.ShowError("璁$畻澶辫触锛�");
                 }
-
-                #region 璁$畻缁撴灉
-
-                var calcuResultHelper = GetCalcuResultHelper();
-                calcuResultHelper.InitialData();
-
-                #endregion
 
                 #region 瑙嗗浘鍒楄〃
 
@@ -2444,22 +2440,37 @@
 
         #endregion
 
-        #region 鎹熷け姣斾緥
+        #region 鎹熷け缁熻
 
-        private void barBtnWorkingLossScale_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //鎹熷け缁熻
+        private void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-            var workingHelper = GetWorkingHelper();
-            if (workingHelper.Working == null)
+            if (_hydroInfo == null)
             {
-                TipFormHelper.ShowWarn("璇疯绠楀悗閲嶈瘯锛�");
                 return;
             }
-            var network = workingHelper.HydroInfo.ToNetwork();
-            var calcuResult = network.Calcu(Yw.EPAnet.CalcuMode.MinorLoss);
-            var allEnergyPointList = network.AnalyzeEnergy(calcuResult);
-            var dlg = new HydroSingleLossScaleDlg();
-            dlg.SetBindingData(workingHelper.HydroInfo, allEnergyPointList);
-            dlg.ShowDialog();
+            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 HydroSingleWorkingLossStatisticsDlg();
+                dlg.SetBindingData(workingHelper.HydroInfo);
+                dlg.ShowDialog();
+            }
+            else
+            {
+                var dlg = new HydroMultiWorkingLossStatisticsDlg();
+                dlg.SetBindingData(_hydroInfo, allCheckedWorkingList);
+                dlg.ShowDialog();
+            }
+
+
         }
 
         #endregion

--
Gitblit v1.9.3