From 17a0baa0ef883689c73e3141d148a28a48d62cd6 Mon Sep 17 00:00:00 2001
From: duheng <2784771470@qq.com>
Date: 星期三, 11 十二月 2024 10:31:04 +0800
Subject: [PATCH] 报告修改

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs |  214 ++++++++++++++++++++++++++++-------------------------
 1 files changed, 114 insertions(+), 100 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 311d22c..183d629 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
@@ -30,24 +30,26 @@
         /// 鏂板宸ュ喌浜嬩欢
         /// </summary>
         public event Action<HydroWorkingVmo> AppendWorkingEvent;
+
         /// <summary>
         /// 淇濆瓨妯″瀷浜嬩欢
         /// </summary>
         public event Func<Yw.Model.HydroModelInfo, Task<Yw.Model.HydroModelInfo>> SaveModelEvent;
+
         /// <summary>
         /// 鍒锋柊妯″瀷浜嬩欢
         /// </summary>
         public event Func<Task<Yw.Model.HydroModelInfo>> RefreshModelEvent;
+
         /// <summary>
         /// 鏇存柊鏂规浜嬩欢
         /// </summary>
         public event Action<XhsSchemeVmo> UpdateSchemeEvent;
+
         /// <summary>
         /// 绉婚櫎鏂规浜嬩欢
         /// </summary>
         public event Action<XhsSchemeVmo> RemoveSchemeEvent;
-
-
 
         private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰
         private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//椤圭洰绔�
@@ -138,7 +140,7 @@
             this.tabPageBimface.Controls.Add(bimfaceCtrl);
         }
 
-        #endregion
+        #endregion BIM鎺т欢
 
         #region Q3d鎺т欢
 
@@ -175,7 +177,7 @@
             this.tabPageQ3d.Controls.Add(q3dCtrl);
         }
 
-        #endregion
+        #endregion Q3d鎺т欢
 
         #region 灞炴�ф帶浠�
 
@@ -266,7 +268,6 @@
                     var flowEffectHelper = await GetFlowEffectHelper();
                     flowEffectHelper.Set(visual);
                 };
-
             }
             return _propertyCtrl;
         }
@@ -321,7 +322,7 @@
             _propertyCtrl?.UpdateRows();
         }
 
-        #endregion
+        #endregion 灞炴�ф帶浠�
 
         #region 閫夋嫨鏋勪欢
 
@@ -357,12 +358,14 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Bimface:
                     {
                         this.barBtnSetMonitor.Enabled = visual != null;
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Q3d:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -370,12 +373,14 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Property:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
                         this.barBtnSetMonitor.Enabled = visual != null;
                     }
                     break;
+
                 case eVisualSource.List:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -383,6 +388,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Set:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -390,6 +396,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Search:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -397,6 +404,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Monitor:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -404,6 +412,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Check:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -411,6 +420,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Calcu:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -418,6 +428,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 case eVisualSource.Warning:
                     {
                         _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code);
@@ -425,6 +436,7 @@
                         SetPropertyCtrl(visual);
                     }
                     break;
+
                 default: break;
             }
         }
@@ -436,7 +448,7 @@
             SelectVisual(visual, source);
         }
 
-        #endregion
+        #endregion 閫夋嫨鏋勪欢
 
         #region 鏋勪欢鏄庣粏
 
@@ -485,7 +497,7 @@
             return helper.GetSourceList();
         }
 
-        #endregion
+        #endregion 鍙鍒楄〃
 
         #region 瑙嗗浘鍒楄〃
 
@@ -515,7 +527,7 @@
             return helper.GetVisualList();
         }
 
-        #endregion
+        #endregion 瑙嗗浘鍒楄〃
 
         #region 鏄庣粏鎺т欢
 
@@ -615,7 +627,7 @@
             ShowVisualListCtrl();
         }
 
-        #endregion
+        #endregion 鏄庣粏鎺т欢
 
         #region 鏋勪欢鏄剧ず
 
@@ -664,9 +676,9 @@
             SetVisualVisible();
         }
 
-        #endregion
+        #endregion 鏋勪欢鏄剧ず
 
-        #endregion
+        #endregion 鏋勪欢鏄庣粏
 
         #region 涓�閿樉闅�
 
@@ -690,7 +702,9 @@
             SetDecoratorVisible(this.barCkDecorator.Checked);
         }
 
-        #endregion   
+        #endregion 涓�閿樉闅�
+
+
 
         #region 淇濆瓨淇℃伅
 
@@ -715,16 +729,15 @@
 
             TipFormHelper.ShowSucceed("淇濆瓨鎴愬姛锛�");
 
-
             //Stopwatch sw = new Stopwatch();
             //sw.Start();
-            //鑰楁椂宸ㄥぇ鐨勪唬鐮�  
+            //鑰楁椂宸ㄥぇ鐨勪唬鐮�
             //sw.Stop();
             //TimeSpan ts2 = sw.Elapsed;
             //Console.WriteLine("Stopwatch鎬诲叡鑺辫垂{0}ms.", ts2.TotalMilliseconds);
         }
 
-        #endregion
+        #endregion 淇濆瓨淇℃伅
 
         #region 鎵归噺閰嶇疆
 
@@ -1022,7 +1035,6 @@
             };
         }
 
-
         //鏄剧ずRadialMenu
         private void barBtnSetList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
@@ -1226,11 +1238,9 @@
             {
                 this.barBtnSetCompressorList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
             }
-
-
         }
 
-        #endregion
+        #endregion 鎵归噺閰嶇疆
 
         #region 鏋勪欢鏌ヨ
 
@@ -1321,7 +1331,7 @@
             ShowSearchDlg();
         }
 
-        #endregion
+        #endregion 鏋勪欢鏌ヨ
 
         #region 妯″瀷鏍囨敞
 
@@ -1373,7 +1383,7 @@
             markHelper.Set();
         }
 
-        #endregion
+        #endregion 妯″瀷鏍囨敞
 
         #region 棰滆壊鍒嗙骇
 
@@ -1455,7 +1465,7 @@
             gradingHelper.Set();
         }
 
-        #endregion
+        #endregion 棰滆壊鍒嗙骇
 
         #region 浜哄伐鍒锋柊
 
@@ -1468,7 +1478,6 @@
             }
             if (XtraMessageBox.Show("鍒锋柊鍚庡皢涓㈠け褰撳墠姘村姏淇℃伅鏇存敼锛屾槸鍚︾户缁埛鏂帮紵", "璇㈤棶", MessageBoxButtons.YesNo) == DialogResult.Yes)
             {
-
                 var hydroInfo = await this.RefreshModelEvent.Invoke();
                 if (hydroInfo == null)
                 {
@@ -1483,7 +1492,7 @@
             }
         }
 
-        #endregion
+        #endregion 浜哄伐鍒锋柊
 
         #region 姘存祦鍔ㄧ敾
 
@@ -1516,7 +1525,7 @@
             flowEffectHelper.Set();
         }
 
-        #endregion
+        #endregion 姘存祦鍔ㄧ敾
 
         #region 鐩戞祴鍒楄〃
 
@@ -1538,6 +1547,13 @@
                 _monitorHelper = new SimulationMonitorHelper(visualListHelper);
             }
             return _monitorHelper;
+        }
+
+        //鑾峰彇鐩戞祴鐐瑰垪琛�
+        private async Task<List<HydroMonitorVmo>> GetMonitorList()
+        {
+            var helper = GetMonitorHelper();
+            return await helper.Get();
         }
 
         //璁剧疆鐩戞祴鐐瑰垪琛�
@@ -1576,7 +1592,7 @@
             SetMonitorList(_visual);
         }
 
-        #endregion
+        #endregion 鐩戞祴鐐�
 
         #region 鐩戞祴鍊�
 
@@ -1599,16 +1615,15 @@
         private void ResetMonitorValue()
         {
             var allWorkingList = GetWorkingList();
-            var working = allWorkingList?.Last(x => !string.IsNullOrEmpty(x.MonitorInfo));
+            var working = allWorkingList?.LastOrDefault(x => !string.IsNullOrEmpty(x.MonitorInfo));
             if (working != null)
             {
                 var helper = GetMonitorValueHelper();
                 helper.Reset(working.MonitorInfo);
             }
-
         }
 
-        #endregion
+        #endregion 鐩戞祴鍊�
 
         #region 鐩戞祴鍊兼帶浠�
 
@@ -1674,7 +1689,7 @@
             ShowMonitorValueListCtrl();
         }
 
-        #endregion
+        #endregion 鐩戞祴鍊兼帶浠�
 
         #region 鐩戞祴鐐规爣璁�
 
@@ -1701,9 +1716,9 @@
             monitorMarkerHelper.Set();
         }
 
-        #endregion
+        #endregion 鐩戞祴鐐规爣璁�
 
-        #endregion
+        #endregion 鐩戞祴鍒楄〃
 
         #region 妯″瀷妫�鏌�
 
@@ -1787,7 +1802,7 @@
             ShowCheckCtrl(checkResult);
         }
 
-        #endregion
+        #endregion 妯″瀷妫�鏌�
 
         #region 妯″瀷璁$畻
 
@@ -1807,7 +1822,7 @@
             return _calcuResultHelper;
         }
 
-        #endregion
+        #endregion 璁$畻缁撴灉
 
         #region 璁$畻澶辫触
 
@@ -1871,7 +1886,7 @@
             calcuFailedCtrl.SetBindingData(calcuResult.FailedList);
         }
 
-        #endregion
+        #endregion 璁$畻澶辫触
 
         #region 璁$畻璀﹀憡
 
@@ -1943,7 +1958,7 @@
             calcuWaringCtrl.SetBindingData(calcuResult.WainingList, allVisualDict);
         }
 
-        #endregion
+        #endregion 璁$畻璀﹀憡
 
         #region 璁$畻鏍囩
 
@@ -1970,9 +1985,9 @@
             calcuResultLabelHelper.Set();
         }
 
-        #endregion
+        #endregion 璁$畻鏍囩
 
-        #endregion
+        #endregion 妯″瀷璁$畻
 
         #region 绠$綉淇
 
@@ -2037,7 +2052,7 @@
             Repair();
         }
 
-        #endregion
+        #endregion 绠$綉淇
 
         #region 瀵煎嚭INP
 
@@ -2059,7 +2074,7 @@
             TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛");
         }
 
-        #endregion
+        #endregion 瀵煎嚭INP
 
         #region 姘存车鍒楄〃
 
@@ -2134,11 +2149,10 @@
         //骞惰仈妯℃嫙
         private void barBtnPumpParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
-
             PumpParallel();
         }
 
-        #endregion
+        #endregion 姘存车鍒楄〃
 
         #region 姘村姏璁$畻
 
@@ -2197,6 +2211,7 @@
                         ShowCalcuWarningCtrl(calcuResult);
                     }
                     this.barBtnAddWorking.Enabled = true;
+                    this.barBtnExportWord.Enabled = true;
                     TipFormHelper.ShowSucceed("璁$畻鎴愬姛锛�");
                 }
                 else
@@ -2210,38 +2225,36 @@
                 var visualVmListHelper = GetVisualVmListHelper();
                 visualVmListHelper.UpdateCalcuProperty(calcuResult);
 
-                #endregion
+                #endregion 瑙嗗浘鍒楄〃
 
                 #region 褰撳墠鏋勪欢
 
                 SelectVisual(_visual, eVisualSource.Calcu);
 
-                #endregion
+                #endregion 褰撳墠鏋勪欢
 
                 #region 鏋勪欢鏄庣粏
 
                 UpdateVisualListCtrl();
 
-                #endregion
+                #endregion 鏋勪欢鏄庣粏
 
                 #region 棰滆壊鍒嗙骇
 
                 var gradingHelper = await GetGradingHelper();
                 gradingHelper.Set();
 
-                #endregion
+                #endregion 棰滆壊鍒嗙骇
 
                 #region 璁$畻鏍囩
 
                 var calcuResultLabelHelper = await GetCalcuResultLabelHelper();
                 calcuResultLabelHelper.Set();
 
-                #endregion
-
+                #endregion 璁$畻鏍囩
             };
 
             dlg.ShowDialog();
-
         }
 
         //姘村姏璁$畻
@@ -2250,7 +2263,22 @@
             Calcu();
         }
 
-        #endregion
+        #endregion 姘村姏璁$畻
+
+        #region 瀵煎嚭鎶ュ憡
+
+        private void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            var fileName = FileDialogHelper.SaveWordDoc("瀵煎嚭Word鎶ュ憡");
+            if (string.IsNullOrEmpty(fileName))
+            {
+                return;
+            }
+            SimulationWordReport word = new SimulationWordReport();
+            //word.Create(fileName);
+        }
+
+        #endregion 瀵煎嚭鎶ュ憡
 
         #region 褰撳墠宸ュ喌
 
@@ -2315,7 +2343,7 @@
             AddWorking();
         }
 
-        #endregion
+        #endregion 褰撳墠宸ュ喌
 
         #region 閫夋嫨宸ュ喌
 
@@ -2362,10 +2390,30 @@
             helper.Remove(working);
         }
 
-
-        #endregion
+        #endregion 閫夋嫨宸ュ喌
 
         #region 宸ュ喌鍒嗘瀽
+
+        //閫夋嫨杩涘彛姘存簮
+        private void SelectInputSource()
+        {
+            var sources = GetSourceList();
+            if (sources != null)
+            {
+                if (sources.Count == 1)
+                {
+                    SelectVisual(sources[0], eVisualSource.None);
+                }
+                else
+                {
+                    var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.杩涘彛));
+                    if (source != null)
+                    {
+                        SelectVisual(source, eVisualSource.None);
+                    }
+                }
+            }
+        }
 
         //绮惧害璇勪及
         private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -2421,8 +2469,9 @@
         }
 
         //鑳芥晥鍒嗘瀽
-        private void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        private async void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
+            var allMonitorList = await GetMonitorList();
             var workingCheckedListHelper = GetWorkingCheckedListHelper();
             var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList();
             if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1)
@@ -2434,14 +2483,13 @@
                     return;
                 }
                 var dlg = new SimulationSingleWorkingEnergyDlg();
-                dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult);
+                dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, allMonitorList, workingHelper.CalcuResult);
                 dlg.ShowDialog();
             }
             else
             {
-
                 var dlg = new SimulationMultiWorkingEnergyDlg();
-                dlg.SetBindingData(_hydroInfo, allCheckedWorkingList);
+                dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList);
                 dlg.ShowDialog();
             }
         }
@@ -2451,22 +2499,7 @@
         {
             if (_visual == null)
             {
-                var sources = GetSourceList();
-                if (sources != null)
-                {
-                    if (sources.Count == 1)
-                    {
-                        SelectVisual(sources[0], eVisualSource.None);
-                    }
-                    else
-                    {
-                        var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.杩涘彛));
-                        if (source != null)
-                        {
-                            SelectVisual(source, eVisualSource.None);
-                        }
-                    }
-                }
+                SelectInputSource();
                 if (_visual == null)
                 {
                     TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒");
@@ -2540,26 +2573,14 @@
         {
             if (_visual == null)
             {
-                var sources = GetSourceList();
-                if (sources != null)
-                {
-                    if (sources.Count == 1)
-                    {
-                        SelectVisual(sources[0], eVisualSource.None);
-                    }
-                    else
-                    {
-                        var source = sources.FirstOrDefault(x => x.Flags.Contains(HStation.Xhs.Flags.杩涘彛));
-                        if (source != null)
-                        {
-                            SelectVisual(source, eVisualSource.None);
-                        }
-                    }
-                }
                 if (_visual == null)
                 {
-                    TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒");
-                    return;
+                    SelectInputSource();
+                    if (_visual == null)
+                    {
+                        TipFormHelper.ShowWarn("璇烽�夋嫨鏋勪欢鍚庨噸璇曪紒");
+                        return;
+                    }
                 }
             }
             HydroVisualInfo visual = _visual;
@@ -2594,13 +2615,6 @@
             }
         }
 
-        #endregion
-
-
-
-
-
-
-
+        #endregion 宸ュ喌鍒嗘瀽
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3