From 36644d234dbe912695ac7c12a7015f454572c204 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期六, 12 十月 2024 21:36:20 +0800
Subject: [PATCH] 尝试进行批量修改

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs |  112 +++++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 83 insertions(+), 29 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 5c0b8ea..92fe0c2 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,5 @@
 锘縢lobal using Yw.EPAnet;
+using NetTaste;
 
 namespace HStation.WinFrmUI
 {
@@ -12,8 +13,6 @@
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
 
         }
-
-
 
         private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰
         private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//椤圭洰绔�
@@ -67,28 +66,6 @@
             this.xhsProjectSimulationQ3dCtrl1.SetBindingData(_hydroInfo);
             this.xhsProjectSimulationPropertyCtrl1.InitialData(() => _hydroInfo);
         }
-
-        #region INP瀵煎嚭
-
-        //瀵煎嚭姘村姏INP鏂囦欢
-        private void barBtnHydroExportInp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
-        {
-            if (_hydroInfo == null)
-            {
-                return;
-            }
-            var fileName = Yw.WinFrmUI.FileDialogHelper.SaveInp("瀵煎嚭Inp鏂囦欢");
-            if (string.IsNullOrEmpty(fileName))
-            {
-                return;
-            }
-            var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo);
-            var result = netWork.ToInpString();
-            File.WriteAllText(fileName, result);
-            TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛");
-        }
-
-        #endregion
 
         #region Bimface
 
@@ -170,7 +147,23 @@
             await this.xhsProjectSimulationBimfaceCtrl1.SetLinkComponentsColor(elementIds);
         }
 
-        #endregion Bimface
+        #endregion
+
+        #region Q3d
+
+        //鐐瑰嚮浜嬩欢
+        private void xhsProjectSimulationQ3dCtrl1_ClickParterEvent(string code)
+        {
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            var allParterList = _hydroInfo.GetAllParters();
+            _parter = allParterList?.Find(x => x.Code == code);
+            ShowProperty();
+        }
+
+        #endregion
 
         #region 灞炴�ч潰鏉�
 
@@ -451,6 +444,28 @@
 
         #endregion
 
+        #region INP瀵煎嚭
+
+        //瀵煎嚭姘村姏INP鏂囦欢
+        private void barBtnHydroExportInp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            var fileName = Yw.WinFrmUI.FileDialogHelper.SaveInp("瀵煎嚭Inp鏂囦欢");
+            if (string.IsNullOrEmpty(fileName))
+            {
+                return;
+            }
+            var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo);
+            var result = netWork.ToInpString();
+            File.WriteAllText(fileName, result);
+            TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛");
+        }
+
+        #endregion
+
         #region 涓氬姟鏂规硶
 
         //鏄剧ず灞炴��
@@ -579,21 +594,59 @@
                         {
                             return;
                         }
+                        _checkResult = _hydroInfo.Check();
+                        if (!_checkResult.Succeed)
+                        {
+                            this.controlContainerBottom.Controls.Clear();
+                            var checkResultCtrl = GetCheckResultCtrl();
+                            checkResultCtrl.SetBindingData(_checkResult);
+                            this.controlContainerBottom.Controls.Add(checkResultCtrl);
+                            TipFormHelper.ShowWarn("鏍¢獙澶辫触锛岃妫�鏌ュ悗閲嶈瘯");
+                            return;
+                        }
+
                         var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo);
                         _calcuResult = netWork.Calcu();
                         if (_calcuResult.Succeed)
                         {
-                            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
+                            this.controlContainerBottom.Controls.Clear();
+                            var parterListCtrl = GetParterListCtrl();
+                            var calcuResultList = new List<IHydroCalcuResult>();
+                            _calcuResult.NodeList?.ForEach(x =>
+                            {
+                                calcuResultList.Add(new HydroCalcuNodeResult()
+                                {
+                                    Code = x.Id,
+                                    CalcuPress = x.Press,
+                                    CalcuHead = x.Head,
+                                    CalcuDemand = x.Demand,
+                                });
+                            });
+                            _calcuResult.LinkList?.ForEach(x =>
+                            {
+                                calcuResultList.Add(new HydroCalcuLinkResult()
+                                {
+                                    Code = x.Id,
+                                    CalcuFlow = x.Flow,
+                                    CalcuVelocity = x.Velocity,
+                                    CalcuHeadLoss = x.Headloss
+                                });
+                            });
+                            parterListCtrl.SetBindingData(_hydroInfo, calcuResultList);
+                            parterListCtrl.SetCalcuView();
+                            this.controlContainerBottom.Controls.Add(parterListCtrl);
+                            this.docPnlBottom.Text = "璁$畻缁撴灉";
                             ShowProperty();
-                            TipFormHelper.ShowSucceed("璁$畻鎴愬姛锛�");
                             await this.xhsProjectSimulationBimfaceCtrl1.ShowCalcuCustomLabels(_calcuResult);
+                            TipFormHelper.ShowSucceed("璁$畻鎴愬姛锛�");
                         }
                         else
                         {
                             _calcuCtrl.SetBindingData(_calcuResult.FailedList);
                             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-                            this.docPnlBottom.Text = "姘村姏璁$畻澶辫触鍘熷洜";
+                            this.docPnlBottom.Text = "璁$畻澶辫触鍘熷洜";
                             this.docPnlBottom.Height = 350;
+                            TipFormHelper.ShowError("璁$畻澶辫触");
                         }
 
                     };
@@ -615,7 +668,7 @@
             calcuCtrl.SetBindingData(_hydroInfo);
             this.controlContainerBottom.Controls.Add(calcuCtrl);
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-            this.docPnlBottom.Text = "姘村姏璁$畻鍓嶆彁鏉′欢";
+            this.docPnlBottom.Text = "璁$畻鍓嶆彁鏉′欢";
             this.docPnlBottom.Height = 350;
         }
 
@@ -679,5 +732,6 @@
         #endregion
 
 
+
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3