From 00f80abcfbf890ab3718d960550380389c64cea3 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 16 十月 2024 10:30:39 +0800
Subject: [PATCH] Revit解析修改

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs |  105 ++++++++++++++++++++++++++++++++--------------------
 1 files changed, 65 insertions(+), 40 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 d58715b..0d4dba9 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
@@ -11,7 +11,7 @@
             InitializeComponent();
             this.PageTitle.Caption = "姘村姏妯℃嫙";
             this.PageTitle.HeaderSvgImage = this.svgImg32[0];
-            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; 
+            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
         }
 
         private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰
@@ -66,8 +66,14 @@
             this.tabPageBimface.Controls.Clear();
             this.tabPageBimface.Controls.Add(bimfaceCtrl);
             await bimfaceCtrl.InitialData(_project, _projectSite, () => _hydroInfo);
-            this.xhsProjectSimulationQ3dCtrl1.SetBindingData(_hydroInfo);
-            this.xhsProjectSimulationPropertyCtrl1.InitialData(() => _hydroInfo);
+            var q3dCtrl = GetQ3dCtrl();
+            this.tabPageQ3d.Controls.Clear();
+            this.tabPageQ3d.Controls.Add(q3dCtrl);
+            q3dCtrl.InitialData(() => _hydroInfo);
+            var propertyCtrl = GetPropertyCtrl();
+            this.controlContainerRight.Controls.Clear();
+            this.controlContainerRight.Controls.Add(propertyCtrl);
+            propertyCtrl.InitialData(() => _hydroInfo);
         }
 
         #region Bimface
@@ -105,6 +111,7 @@
             }
             return _bimfaceCtrl;
         }
+
         //bimface鎺т欢
         private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
 
@@ -169,29 +176,52 @@
             }
         }
 
-        #endregion
+        #endregion Bimface
 
         #region Q3d
 
-        //鐐瑰嚮浜嬩欢
-        private void xhsProjectSimulationQ3dCtrl1_ClickParterEvent(string code)
+        //鑾峰彇Q3d鎺т欢
+        private XhsProjectSimulationQ3dCtrl GetQ3dCtrl()
         {
-            if (_hydroInfo == null)
+            if (_q3dCtrl == null)
             {
-                return;
+                _q3dCtrl = new XhsProjectSimulationQ3dCtrl();
+                _q3dCtrl.Dock = DockStyle.Fill;
+                _q3dCtrl.SelectedPartersChangedEvent += (obj) =>
+                {
+                    if (_hydroInfo == null)
+                    {
+                        return;
+                    }
+                    var allParterList = _hydroInfo.GetAllParters();
+                    _parter = allParterList?.Find(x => x.Code == obj?.FirstOrDefault());
+                    ShowProperty();
+                };
             }
-            var allParterList = _hydroInfo.GetAllParters();
-            _parter = allParterList?.Find(x => x.Code == code);
-            ShowProperty();
+            return _q3dCtrl;
         }
 
-        #endregion
+        //Q3d鎺т欢
+        private XhsProjectSimulationQ3dCtrl _q3dCtrl = null;
+
+        #endregion Q3d
 
         #region 灞炴�ч潰鏉�
 
+        //鑾峰彇灞炴�ф帶浠�
+        private XhsProjectSimulationPropertyCtrl GetPropertyCtrl()
+        {
+            if (_propertyCtrl == null)
+            {
+                _propertyCtrl = new XhsProjectSimulationPropertyCtrl();
+                _propertyCtrl.Dock = DockStyle.Fill;
+            }
+            return _propertyCtrl;
+        }
 
+        private XhsProjectSimulationPropertyCtrl _propertyCtrl = null;//灞炴�ф帶浠�
 
-        #endregion
+        #endregion 灞炴�ч潰鏉�
 
         #region 鑷姩鍖归厤
 
@@ -230,6 +260,7 @@
             }
             return _matchingListCtrl;
         }
+
         //鍖归厤鍒楄〃鎺т欢
         private XhsProjectSimulationMatchingListCtrl _matchingListCtrl = null;
 
@@ -250,8 +281,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-        #endregion
+        #endregion 鑷姩鍖归厤
 
         #region 鏈尮閰嶅垪琛�
 
@@ -289,6 +319,7 @@
             }
             return _unMatchingListCtrl;
         }
+
         private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//鏈尮閰嶅垪琛�
 
         //鏈尮閰嶅垪琛�
@@ -307,9 +338,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-
-        #endregion
+        #endregion 鏈尮閰嶅垪琛�
 
         #region 涓�閿樉闅�
 
@@ -339,7 +368,7 @@
             }
         }
 
-        #endregion
+        #endregion 涓�閿樉闅�
 
         #region 姘村姏鏍¢獙
 
@@ -377,6 +406,7 @@
             }
             return _checkResultCtrl;
         }
+
         //鏍¢獙缁撴灉鎺т欢
         private XhsProjectSimulationHydroCheckResultCtrl _checkResultCtrl = null;
 
@@ -397,7 +427,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-        #endregion
+        #endregion 姘村姏鏍¢獙
 
         #region 淇濆瓨姘村姏淇℃伅
 
@@ -418,7 +448,7 @@
             TipFormHelper.ShowSucceed("淇濆瓨鎴愬姛锛�");
         }
 
-        #endregion
+        #endregion 淇濆瓨姘村姏淇℃伅
 
         #region 鏋勪欢鏄庣粏
 
@@ -444,6 +474,7 @@
             }
             return _parterListCtrl;
         }
+
         //鏋勪欢鏄庣粏鎺т欢
         private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null;
 
@@ -463,8 +494,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-        #endregion
+        #endregion 鏋勪欢鏄庣粏
 
         #region INP瀵煎嚭
 
@@ -486,7 +516,7 @@
             TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛");
         }
 
-        #endregion
+        #endregion INP瀵煎嚭
 
         #region 涓氬姟鏂规硶
 
@@ -500,11 +530,11 @@
 
             if (_parter == null)
             {
-                this.xhsProjectSimulationPropertyCtrl1.SelectParter(null);
+                _propertyCtrl?.SelectParter(null);
                 return;
             }
 
-            this.xhsProjectSimulationPropertyCtrl1.SelectParter(_parter.Code);
+            _propertyCtrl?.SelectParter(_parter.Code);
             if (_calcuResult != null)
             {
                 if (_calcuResult.Succeed)
@@ -535,15 +565,14 @@
 
                         if (calcuProperty != null)
                         {
-                            this.xhsProjectSimulationPropertyCtrl1.UpdateCalcuProperty(calcuProperty);
+                            _propertyCtrl?.UpdateCalcuProperty(calcuProperty);
                         }
                     }
                 }
             }
-
         }
 
-        #endregion
+        #endregion 涓氬姟鏂规硶
 
         #region 閰嶇疆
 
@@ -553,7 +582,7 @@
             this.rmSet.ShowPopup(MousePosition, true);
         }
 
-        #endregion
+        #endregion 閰嶇疆
 
         #region 鎬ц兘鏇茬嚎
 
@@ -620,10 +649,9 @@
             dlg.ShowDialog();
         }
 
-        #endregion
+        #endregion 鎬ц兘鏇茬嚎
 
         #region 姘村姏璁$畻
-
 
         //鑾峰彇璁$畻鎺т欢
         private XhsProjectSimulationCalcuCtrl GetCalcuCtrl()
@@ -696,11 +724,11 @@
                             this.docPnlBottom.Height = 350;
                             TipFormHelper.ShowError("璁$畻澶辫触");
                         }
-
                     };
             }
             return _calcuCtrl;
         }
+
         private XhsProjectSimulationCalcuCtrl _calcuCtrl = null;//璁$畻鎺т欢
 
         //姘村姏璁$畻
@@ -720,9 +748,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-
-        #endregion
+        #endregion 姘村姏璁$畻
 
         #region 鏋勪欢鏌ヨ
 
@@ -759,6 +785,7 @@
             }
             return _searchCtrl;
         }
+
         private XhsProjectSimulationSearchCtrl _searchCtrl = null;//鏌ヨ缁勪欢
 
         //鏌ヨ
@@ -777,9 +804,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-        #endregion
-
-
+        #endregion 鏋勪欢鏌ヨ
 
         #region 鏍囨敞
 
@@ -851,6 +876,6 @@
             dlg.ShowDialog();
         }
 
-        #endregion
+        #endregion 鏍囨敞
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3