From 93bc151189c3956c80701bf1adf7600be6f19ee7 Mon Sep 17 00:00:00 2001
From: lixiaojun <1287241240@qq.com>
Date: 星期三, 23 十月 2024 16:19:13 +0800
Subject: [PATCH] 颜色分级

---
 WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 1075 +++++++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 846 insertions(+), 229 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 f36e230..79007e5 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,7 +1,8 @@
 锘縢lobal using Yw.EPAnet;
-using DevExpress.XtraMap.Drawing;
-using NetTaste;
-using Org.BouncyCastle.Crypto.Engines;
+using DevExpress.Mvvm.Native;
+using HStation.WinFrmUI.PhartRelation;
+using Yw.WinFrmUI.Bimface;
+using Yw.WinFrmUI.Hydro;
 
 namespace HStation.WinFrmUI
 {
@@ -13,7 +14,8 @@
             this.PageTitle.Caption = "姘村姏妯℃嫙";
             this.PageTitle.HeaderSvgImage = this.svgImg32[0];
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
-
+            this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
+            RegistBulkSetEvents();
         }
 
         private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰
@@ -68,11 +70,18 @@
             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);
+            ShowPropertyCtrl();
+
         }
 
         #region Bimface
+
+        //bimface鎺т欢
+        private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
 
         //鑾峰彇 bimface 鎺т欢
         private XhsProjectSimulationBimfaceCtrl GetBimfaceCtrl()
@@ -107,8 +116,8 @@
             }
             return _bimfaceCtrl;
         }
-        //bimface鎺т欢
-        private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
+
+
 
         //璁剧疆Bimface杩炴帴棰滆壊
         private async void SetBimfaceLinkColor()
@@ -175,23 +184,170 @@
 
         #region Q3d
 
-        //鐐瑰嚮浜嬩欢
-        private void xhsProjectSimulationQ3dCtrl1_ClickParterEvent(string code)
+        //鑾峰彇Q3d鎺т欢
+        private XhsProjectSimulationQ3dCtrl GetQ3dCtrl()
+        {
+            if (_q3dCtrl == null)
+            {
+                _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();
+                };
+            }
+            return _q3dCtrl;
+        }
+
+        //Q3d鎺т欢
+        private XhsProjectSimulationQ3dCtrl _q3dCtrl = null;
+
+        #endregion Q3d
+
+        #region 灞炴�ч潰鏉�
+
+        //灞炴�ф帶浠�
+        private XhsProjectSimulationPropertyCtrl _propertyCtrl = null;
+
+        //鑾峰彇灞炴�ф帶浠�
+        private XhsProjectSimulationPropertyCtrl GetPropertyCtrl()
+        {
+            if (_propertyCtrl == null)
+            {
+                _propertyCtrl = new XhsProjectSimulationPropertyCtrl();
+                _propertyCtrl.Dock = DockStyle.Fill;
+                _propertyCtrl.InitialData(() => _hydroInfo, () => GetAllCalcuResultList());
+                _propertyCtrl.BlinkLinkParterEvent += async (code, linkCode) =>
+                { //寮鸿皟杩炴帴缁勪欢
+                    if (string.IsNullOrEmpty(code))
+                    {
+                        return;
+                    }
+                    if (string.IsNullOrEmpty(linkCode))
+                    {
+                        return;
+                    }
+                    if (_hydroInfo == null)
+                    {
+                        return;
+                    }
+                    var allVisualList = _hydroInfo.GetAllVisuals();
+                    if (allVisualList == null || allVisualList.Count < 1)
+                    {
+                        return;
+                    }
+                    var linkParter = allVisualList.Find(x => x.Code == linkCode);
+                    if (linkParter == null)
+                    {
+                        return;
+                    }
+                    var blinkCodes = new List<string>();
+                    if (linkParter.GetType() == typeof(Yw.Model.HydroJunctionInfo))
+                    {
+                        var allLinkList = _hydroInfo.GetAllLinks();
+                        if (allLinkList == null || allLinkList.Count < 1)
+                        {
+                            return;
+                        }
+                        var linkList = allLinkList.Where(x => (x.StartCode == linkParter.Code || x.EndCode == linkParter.Code) && x.Code != code).ToList();
+                        if (linkList == null || linkList.Count < 1)
+                        {
+                            return;
+                        }
+                        blinkCodes.AddRange(linkList.Select(x => x.Code));
+                    }
+                    else
+                    {
+                        blinkCodes.Add(linkCode);
+                    }
+
+                    await _bimfaceCtrl?.SetBlinkComponents(blinkCodes);
+                    await Task.Delay(5000);
+                    await _bimfaceCtrl?.ClearBlinkComponents();
+                };
+            }
+            return _propertyCtrl;
+        }
+
+        //鏄剧ず灞炴�ч潰鏉�
+        private void ShowPropertyCtrl()
+        {
+            var propertyCtrl = GetPropertyCtrl();
+            this.controlContainerRight.Controls.Clear();
+            this.controlContainerRight.Controls.Add(propertyCtrl);
+            this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
+            this.docPnlRight.Text = "灞炴��";
+            this.docPnlRight.Width = 300;
+        }
+
+        //灞炴�ч潰鏉挎寜閽�
+        private void barBtnProperty_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            ShowPropertyCtrl();
+        }
+
+        //鏄剧ず灞炴��
+        private void ShowProperty()
         {
             if (_hydroInfo == null)
             {
                 return;
             }
-            var allParterList = _hydroInfo.GetAllParters();
-            _parter = allParterList?.Find(x => x.Code == code);
-            ShowProperty();
+            if (this.docPnlRight.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Hidden)
+            {
+                ShowPropertyCtrl();
+            }
+
+            if (_parter == null)
+            {
+                _propertyCtrl?.SelectParter(null);
+                return;
+            }
+
+            _propertyCtrl?.SelectParter(_parter.Code);
+            if (_calcuResult != null)
+            {
+                if (_calcuResult.Succeed)
+                {
+                    var allCalcuParterList = _calcuResult.GetParterList();
+                    var calcuParter = allCalcuParterList.Find(x => x.Id == _parter.Code);
+                    if (calcuParter != null)
+                    {
+                        IHydroCalcuResult calcuProperty = null;
+                        if (calcuParter is Yw.EPAnet.CalcuNode calcuNode)
+                        {
+                            var calcuNodeProperty = new Yw.WinFrmUI.HydroCalcuNodeResult();
+                            calcuNodeProperty.Code = _parter.Code;
+                            calcuNodeProperty.CalcuPress = calcuNode.Press;
+                            calcuNodeProperty.CalcuDemand = calcuNode.Demand;
+                            calcuNodeProperty.CalcuHead = calcuNode.Head;
+                            calcuProperty = calcuNodeProperty;
+                        }
+                        else if (calcuParter is Yw.EPAnet.CalcuLink calcuLink)
+                        {
+                            var calcuLinkProperty = new Yw.WinFrmUI.HydroCalcuLinkResult();
+                            calcuLinkProperty.Code = _parter.Code;
+                            calcuLinkProperty.CalcuHeadLoss = calcuLink.Headloss;
+                            calcuLinkProperty.CalcuFlow = calcuLink.Flow;
+                            calcuLinkProperty.CalcuVelocity = calcuLink.Velocity;
+                            calcuProperty = calcuLinkProperty;
+                        }
+
+                        if (calcuProperty != null)
+                        {
+                            _propertyCtrl?.UpdateCalcuProperty(calcuProperty);
+                        }
+                    }
+                }
+            }
+
         }
-
-        #endregion
-
-        #region 灞炴�ч潰鏉�
-
-
 
         #endregion
 
@@ -232,6 +388,7 @@
             }
             return _matchingListCtrl;
         }
+
         //鍖归厤鍒楄〃鎺т欢
         private XhsProjectSimulationMatchingListCtrl _matchingListCtrl = null;
 
@@ -244,7 +401,7 @@
             }
             this.controlContainerBottom.Controls.Clear();
             var matchingListCtrl = GetMatchingListCtrl();
-            var input = AssetsMatchingParasHelper.Create(_hydroInfo);
+            var input = AssetsMatchingParasHelper.Create(_hydroInfo, GetAllCalcuResultList());
             matchingListCtrl.SetBindingData(input);
             this.controlContainerBottom.Controls.Add(matchingListCtrl);
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
@@ -252,8 +409,7 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-        #endregion
+        #endregion 鑷姩鍖归厤
 
         #region 鏈尮閰嶅垪琛�
 
@@ -291,6 +447,7 @@
             }
             return _unMatchingListCtrl;
         }
+
         private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//鏈尮閰嶅垪琛�
 
         //鏈尮閰嶅垪琛�
@@ -309,17 +466,12 @@
             this.docPnlBottom.Height = 350;
         }
 
-
-
-        #endregion
+        #endregion 鏈尮閰嶅垪琛�
 
         #region 涓�閿樉闅�
 
-        //鏄鹃殣缂栫爜鍒楄〃
-        private List<string> _fastShowHideCodeList = null;
-
-        //瑙﹀彂涓�閿樉闅�
-        private async void barBtnShowHide_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //涓�閿樉闅�
+        private async Task FastShowHidden()
         {
             if (_hydroInfo == null)
             {
@@ -329,30 +481,42 @@
             {
                 return;
             }
-            if (_fastShowHideCodeList == null)
+            if (_fastShowHiddenCodeList == null)
             {
-                _fastShowHideCodeList = _hydroInfo.Decorators.Select(x => x.Code).ToList();
-                await _bimfaceCtrl?.HideComponents(_fastShowHideCodeList);
+                _fastShowHiddenCodeList = _hydroInfo.Decorators.Select(x => x.Code).ToList();
+                await _bimfaceCtrl?.HideComponents(_fastShowHiddenCodeList);
             }
             else
             {
-                await _bimfaceCtrl?.ShowComponents(_fastShowHideCodeList);
-                _fastShowHideCodeList = null;
+                await _bimfaceCtrl?.ShowComponents(_fastShowHiddenCodeList);
+                _fastShowHiddenCodeList = null;
             }
+        }
+
+        //鏄鹃殣缂栫爜鍒楄〃
+        private List<string> _fastShowHiddenCodeList = null;
+
+        //瑙﹀彂涓�閿樉闅�
+        private async void barBtnFastShowHidden_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            await FastShowHidden();
         }
 
         #endregion
 
         #region 姘村姏鏍¢獙
 
-        //鑾峰彇鏍¢獙缁撴灉鎺т欢
-        private XhsProjectSimulationHydroCheckResultCtrl GetCheckResultCtrl()
+        //鏍¢獙鎺т欢
+        private XhsProjectSimulationHydroCheckResultCtrl _checkCtrl = null;
+
+        //鑾峰彇鏍¢獙鎺т欢
+        private XhsProjectSimulationHydroCheckResultCtrl GetCheckCtrl()
         {
-            if (_checkResultCtrl == null)
+            if (_checkCtrl == null)
             {
-                _checkResultCtrl = new XhsProjectSimulationHydroCheckResultCtrl();
-                _checkResultCtrl.Dock = DockStyle.Fill;
-                _checkResultCtrl.HydroClickEvent += async (code) =>
+                _checkCtrl = new XhsProjectSimulationHydroCheckResultCtrl();
+                _checkCtrl.Dock = DockStyle.Fill;
+                _checkCtrl.HydroClickEvent += async (code) =>
                 {
                     if (_hydroInfo == null)
                     {
@@ -377,10 +541,25 @@
                     SetBimfaceLinkColor();
                 };
             }
-            return _checkResultCtrl;
+            return _checkCtrl;
         }
-        //鏍¢獙缁撴灉鎺т欢
-        private XhsProjectSimulationHydroCheckResultCtrl _checkResultCtrl = null;
+
+        //鏄剧ず鏍¢獙鎺т欢
+        private void ShowCheckCtrl()
+        {
+            if (_checkResult == null)
+            {
+                return;
+            }
+            var checkCtrl = GetCheckCtrl();
+            checkCtrl.SetBindingData(_checkResult);
+            this.controlContainerBottom.Controls.Clear();
+            this.controlContainerBottom.Controls.Add(checkCtrl);
+            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
+            this.docPnlBottom.Text = "鏍¢獙缁撴灉";
+            this.docPnlBottom.Height = 350;
+
+        }
 
         //姘村姏楠岃瘉
         private void barBtnHydroCheck_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -390,18 +569,12 @@
                 return;
             }
             _checkResult = _hydroInfo.Check();
-            this.controlContainerBottom.Controls.Clear();
-            var checkResultCtrl = GetCheckResultCtrl();
-            checkResultCtrl.SetBindingData(_checkResult);
-            this.controlContainerBottom.Controls.Add(checkResultCtrl);
-            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-            this.docPnlBottom.Text = "鏍¢獙缁撴灉";
-            this.docPnlBottom.Height = 350;
+            ShowCheckCtrl();
         }
 
-        #endregion
+        #endregion 姘村姏鏍¢獙
 
-        #region 淇濆瓨姘村姏淇℃伅
+        #region 淇濆瓨淇℃伅
 
         //淇濆瓨
         private async void barBtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -420,9 +593,12 @@
             TipFormHelper.ShowSucceed("淇濆瓨鎴愬姛锛�");
         }
 
-        #endregion
+        #endregion 淇濆瓨姘村姏淇℃伅
 
         #region 鏋勪欢鏄庣粏
+
+        //鏋勪欢鏄庣粏鎺т欢
+        private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null;
 
         //鑾峰彇鏋勪欢鏄庣粏鎺т欢
         private Yw.WinFrmUI.HydroParterListCtrl GetParterListCtrl()
@@ -446,27 +622,30 @@
             }
             return _parterListCtrl;
         }
-        //鏋勪欢鏄庣粏鎺т欢
-        private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null;
 
-        //姘村姏鏋勪欢鍒楄〃
-        private void barBtnHydroParterList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //鏄剧ず鏋勪欢鏄庣粏鎺т欢
+        private void ShowParterListCtrl()
         {
             if (_hydroInfo == null)
             {
                 return;
             }
-            this.controlContainerBottom.Controls.Clear();
             var parterListCtrl = GetParterListCtrl();
-            parterListCtrl.SetBindingData(_hydroInfo);
+            parterListCtrl.SetBindingData(_hydroInfo, GetAllCalcuResultList());
+            this.controlContainerBottom.Controls.Clear();
             this.controlContainerBottom.Controls.Add(parterListCtrl);
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
             this.docPnlBottom.Text = "鏋勪欢鏄庣粏";
             this.docPnlBottom.Height = 350;
         }
 
+        //鏋勪欢鏄庣粏
+        private void barBtnHydroParterList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            ShowParterListCtrl();
+        }
 
-        #endregion
+        #endregion 鏋勪欢鏄庣粏
 
         #region INP瀵煎嚭
 
@@ -488,63 +667,67 @@
             TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛");
         }
 
-        #endregion
+        #endregion INP瀵煎嚭
 
-        #region 涓氬姟鏂规硶
+        #region 鎵归噺閰嶇疆
 
-        //鏄剧ず灞炴��
-        private void ShowProperty()
+        //娉ㄥ唽鎵归噺閰嶇疆浜嬩欢
+        private void RegistBulkSetEvents()
         {
-            if (_hydroInfo == null)
+            //姘村簱
+            this.barBtnSetReservoirList.ItemClick += delegate
             {
-                return;
-            }
-            if (_parter == null)
+                var dlg = new HydroReservoirBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //姘存睜
+            this.barBtnSetTankList.ItemClick += delegate
             {
-                this.xhsProjectSimulationPropertyCtrl1.SelectParter(null);
-                return;
-            }
-            this.xhsProjectSimulationPropertyCtrl1.SelectParter(_parter.Code);
-            if (_calcuResult != null)
+                var dlg = new HydroTankBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //姘寸
+            this.barBtnSetWaterboxList.ItemClick += delegate
             {
-                if (_calcuResult.Succeed)
+                if (_hydroInfo == null)
                 {
-                    var allCalcuParterList = _calcuResult.GetParterList();
-                    var calcuParter = allCalcuParterList.Find(x => x.Id == _parter.Code);
-                    if (calcuParter != null)
-                    {
-                        IHydroCalcuResult calcuProperty = null;
-                        if (calcuParter is Yw.EPAnet.CalcuNode calcuNode)
-                        {
-                            var calcuNodeProperty = new Yw.WinFrmUI.HydroCalcuNodeResult();
-                            calcuNodeProperty.Code = _parter.Code;
-                            calcuNodeProperty.CalcuPress = calcuNode.Press;
-                            calcuNodeProperty.CalcuDemand = calcuNode.Demand;
-                            calcuNodeProperty.CalcuHead = calcuNode.Head;
-                            calcuProperty = calcuNodeProperty;
-                        }
-                        else if (calcuParter is Yw.EPAnet.CalcuLink calcuLink)
-                        {
-                            var calcuLinkProperty = new Yw.WinFrmUI.HydroCalcuLinkResult();
-                            calcuLinkProperty.Code = _parter.Code;
-                            calcuLinkProperty.CalcuHeadLoss = calcuLink.Headloss;
-                            calcuLinkProperty.CalcuFlow = calcuLink.Flow;
-                            calcuLinkProperty.CalcuVelocity = calcuLink.Velocity;
-                            calcuProperty = calcuLinkProperty;
-                        }
-
-                        if (calcuProperty != null)
-                        {
-                            this.xhsProjectSimulationPropertyCtrl1.UpdateCalcuProperty(calcuProperty);
-                        }
-                    }
+                    return;
                 }
-            }
+                var dlg = new HydroWaterboxBulkSetListDlg();
+                dlg.SetBindingData(_hydroInfo);
+                dlg.ShowDialog();
+            };
+            //杩炴帴鑺傜偣
+            this.barBtnSetJunctionList.ItemClick += delegate
+            {
+                var dlg = new HydroJunctionBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //闂峰ご
+            this.barBtnSetBluntheadList.ItemClick += delegate
+            {
+                var dlg = new HydroBluntheadBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //寮ご
+            this.barBtnSetElbowsList.ItemClick += delegate
+            {
+                var dlg = new HydroElbowBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //涓夐��
+            this.barBtnSetThreelinkList.ItemClick += delegate
+            {
+                var dlg = new HydroThreelinkBulkSetListDlg();
+                dlg.ShowDialog();
+            };
+            //鍥涢��
+            this.barBtnSetFourlinkList.ItemClick += delegate
+            {
+
+            };
         }
 
-        #endregion
-
-        #region 閰嶇疆
 
         //鏄剧ずRadialMenu
         private void barBtnSetList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -552,70 +735,282 @@
             this.rmSet.ShowPopup(MousePosition, true);
         }
 
+        //寮瑰嚭鍓�
+        private void rmSet_BeforePopup(object sender, CancelEventArgs e)
+        {
+            if (_hydroInfo == null)
+            {
+                e.Cancel = true;
+                return;
+            }
+            //姘村簱
+            if (_hydroInfo.Reservoirs == null || _hydroInfo.Reservoirs.Count < 1)
+            {
+                this.barBtnSetReservoirList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetReservoirList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //姘存睜
+            if (_hydroInfo.Tanks == null || _hydroInfo.Tanks.Count < 1)
+            {
+                this.barBtnSetTankList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetTankList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //姘寸
+            if (_hydroInfo.Waterboxs == null || _hydroInfo.Waterboxs.Count < 1)
+            {
+                this.barBtnSetWaterboxList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetWaterboxList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //杩炴帴鑺傜偣
+            if (_hydroInfo.Junctions == null || _hydroInfo.Junctions.Count < 1)
+            {
+                this.barBtnSetJunctionList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetJunctionList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //鍠峰槾
+            if (_hydroInfo.Nozzles == null || _hydroInfo.Nozzles.Count < 1)
+            {
+                this.barBtnSetNozzleList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetNozzleList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //娑堢伀鏍�
+            if (_hydroInfo.Hydrants == null || _hydroInfo.Hydrants.Count < 1)
+            {
+                this.barBtnSetHydrantList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetHydrantList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //闂峰ご
+            if (_hydroInfo.Bluntheads == null || _hydroInfo.Bluntheads.Count < 1)
+            {
+                this.barBtnSetBluntheadList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetBluntheadList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //寮ご
+            if (_hydroInfo.Elbows == null || _hydroInfo.Elbows.Count < 1)
+            {
+                this.barBtnSetElbowsList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetElbowsList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //涓夐��
+            if (_hydroInfo.Threelinks == null || _hydroInfo.Threelinks.Count < 1)
+            {
+                this.barBtnSetThreelinkList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetThreelinkList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //鍥涢��
+            if (_hydroInfo.Fourlinks == null || _hydroInfo.Fourlinks.Count < 1)
+            {
+                this.barBtnSetFourlinkList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetFourlinkList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //姘磋〃
+            if (_hydroInfo.Meters == null || _hydroInfo.Meters.Count < 1)
+            {
+                this.barBtnSetMeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetMeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //娴侀噺璁�
+            if (_hydroInfo.Flowmeters == null || _hydroInfo.Flowmeters.Count < 1)
+            {
+                this.barBtnSetFlowmeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetFlowmeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //鍘嬪姏琛�
+            if (_hydroInfo.Pressmeters == null || _hydroInfo.Pressmeters.Count < 1)
+            {
+                this.barBtnSetPressmeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetPressmeterList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //绠¢亾
+            if (_hydroInfo.Pipes == null || _hydroInfo.Pipes.Count < 1)
+            {
+                this.barBtnSetPipeList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetPipeList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //杩囨浮浠�
+            if (_hydroInfo.Translations == null || _hydroInfo.Translations.Count < 1)
+            {
+                this.barBtnSetTranslationList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetTranslationList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //鎹㈢儹鍣�
+            if (_hydroInfo.Exchangers == null || _hydroInfo.Exchangers.Count < 1)
+            {
+                this.barBtnSetExchangerList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetExchangerList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //绌哄帇鏈�
+            if (_hydroInfo.Compressors == null || _hydroInfo.Compressors.Count < 1)
+            {
+                this.barBtnSetCompressorList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetCompressorList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //姘存车
+            if (_hydroInfo.Pumps == null || _hydroInfo.Pumps.Count < 1)
+            {
+                this.barBtnSetPumpList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetPumpList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+            //闃�闂�
+            if (_hydroInfo.Valves == null || _hydroInfo.Valves.Count < 1)
+            {
+                this.barBtnSetValveList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
+            }
+            else
+            {
+                this.barBtnSetValveList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always;
+            }
+
+        }
+
         #endregion
 
-        #region 鎬ц兘鏇茬嚎
+        #region 骞惰仈鍒嗘瀽
 
-        //鎬ц兘鏇茬嚎
-        private void barBtnFeatCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //骞惰仈鍒嗘瀽
+        private void barBtnAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             if (_hydroInfo == null)
             {
                 return;
             }
-            if (_calcuResult == null)
+            if (_hydroInfo.Pumps == null || _hydroInfo.Pumps.Count < 1)
             {
                 return;
             }
-            if (!_calcuResult.Succeed)
+            var allCalcuResultList = GetAllCalcuResultList();
+            var vmList = new List<XhsSinglePumpViewModel>();
+            foreach (var pump in _hydroInfo.Pumps)
             {
-                return;
-            }
-            var pumps = _hydroInfo.Pumps;
-            var curve_list = _hydroInfo.Curves;
-            if (curve_list == null || !curve_list.Any())
-            {
-                return;
-            }
-            var vmList = new List<Yw.WinFrmUI.Phart.PumpSerialParallelViewModel>();
-            foreach (var x in pumps)
-            {
-                if (!x.RatedN.HasValue)
+                if (!pump.RatedN.HasValue)
                 {
                     continue;
                 }
-                var qh = curve_list.Find(t => t.Code == x.CurveQH)?.CurveData;
-                var qe = curve_list.Find(t => t.Code == x.CurveQE)?.CurveData;
-                var qp = curve_list.Find(t => t.Code == x.CurveQP)?.CurveData;
-
+                var qh = _hydroInfo.Curves?.Find(t => t.Code == pump.CurveQH)?.CurveData;
+                var qe = _hydroInfo.Curves?.Find(t => t.Code == pump.CurveQE)?.CurveData;
+                var qp = _hydroInfo.Curves?.Find(t => t.Code == pump.CurveQP)?.CurveData;
                 if (qh == null)
                 {
                     continue;
                 }
 
-                var rated_speed = x.RatedN.Value;
-                var speed_ratio = x.SpeedRatio ?? 1;
+                var qhPtList = qh.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList();
+                var qePtList = qe?.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList();
+                var qpPtList = qp?.Select(x => new XhsSplinePointViewModel(x.X, x.Y)).ToList();
 
-                var qh_pt_list = qh.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
-                var qe_pt_list = qe?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
-                var qp_pt_list = qp?.Select(x => new Yw.Geometry.Point2d(x.X, x.Y)).ToList();
-                 
-                var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelViewModel();
-                vm.Id = x.Code;
-                vm.Name = x.Code;
-                //vm.IsBp = ;
-                vm.RatedSpeed = rated_speed;
-                vm.CurrentSpeed = Math.Round(rated_speed * speed_ratio);
-                vm.CurrentHz = Math.Round(vm.CurrentSpeed / vm.RatedSpeed * 50, 1);
-
-                vm.Qh = new Yw.Geometry.CubicSpline2d(qh_pt_list);
-                vm.Qe = new Yw.Geometry.CubicSpline2d(qe_pt_list);
-                vm.Qp = new Yw.Geometry.CubicSpline2d(qp_pt_list);
+                var vm = new XhsSinglePumpViewModel();
                 vmList.Add(vm);
+                vm.ID = pump.ID;
+                vm.Name = pump.Name;
+                vm.Code = pump.Code;
+                vm.IsBp = true;
+                vm.RunStatus = pump.LinkStatus == Yw.Hydro.LinkStatus.Open;
+                vm.RatedHz = pump.RatedHz;
+                vm.CurrentHz = Math.Round(pump.RatedHz * pump.SpeedRatio, 1);
+                vm.RatedSpeed = pump.RatedN.Value;
+                vm.CurrentSpeed = Math.Round(pump.RatedN.Value * pump.SpeedRatio);
+                vm.CurveQH = qhPtList;
+                vm.CurveQE = qePtList;
+                vm.CurveQP = qpPtList;
+
+                if (allCalcuResultList != null && allCalcuResultList.Count > 0)
+                {
+                    var calcuResult = allCalcuResultList.Find(x => x.Code == pump.Code) as HydroCalcuLinkResult;
+                    if (calcuResult != null)
+                    {
+                        if (calcuResult.CalcuFlow.HasValue)
+                        {
+                            vm.CalcuQ = Math.Abs(calcuResult.CalcuFlow.Value);
+                        }
+
+                        var calcuResultStart = allCalcuResultList.Find(x => x.Code == pump.StartCode) as HydroCalcuNodeResult;
+                        var calcuResultEnd = allCalcuResultList.Find(x => x.Code == pump.EndCode) as HydroCalcuNodeResult;
+                        if (calcuResultStart != null && calcuResultEnd != null)
+                        {
+                            if (calcuResultStart.CalcuHead.HasValue && calcuResultEnd.CalcuHead.HasValue)
+                            {
+                                vm.CalcuH = Math.Round(Math.Abs(calcuResultStart.CalcuHead.Value - calcuResultEnd.CalcuHead.Value), 4);
+                            }
+                        }
+                    }
+                }
+
             }
 
-            var dlg = new HStation.WinFrmUI.PhartRelation.PumpSerialParallelChartDlg();
-            dlg.SetBindingData(vmList, null, true);
+            var dlg = new PumpParallelChartDlg();
+            dlg.SetBindingData(vmList);
             dlg.ShowDialog();
         }
 
@@ -623,84 +1018,128 @@
 
         #region 姘村姏璁$畻
 
+        //璁$畻鎺т欢
+        private SetHydroCalcuPrefixCtrl _calcuCtrl = null;
 
         //鑾峰彇璁$畻鎺т欢
-        private XhsProjectSimulationCalcuCtrl GetCalcuCtrl()
+        private SetHydroCalcuPrefixCtrl GetCalcuCtrl()
         {
             if (_calcuCtrl == null)
             {
-                _calcuCtrl = new XhsProjectSimulationCalcuCtrl();
+                _calcuCtrl = new SetHydroCalcuPrefixCtrl();
                 _calcuCtrl.Dock = DockStyle.Fill;
-                _calcuCtrl.CancelEvent += () =>
+                _calcuCtrl.InitialData(() => _hydroInfo);
+                _calcuCtrl.HydroViewEvent += async (parter) =>
+                {//姘村姏鏌ョ湅浜嬩欢
+                    if (parter == null)
                     {
-                        this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
-                    };
-                _calcuCtrl.OkEvent += async () =>
+                        return;
+                    }
+                    await _bimfaceCtrl?.ZoomAndSelectComponents(new List<string>() { parter.Code });
+                };
+                _calcuCtrl.HydroCalcuEvent += async () =>
+                {//姘村姏璁$畻浜嬩欢
+                    if (_hydroInfo == null)
                     {
-                        if (_hydroInfo == null)
-                        {
-                            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;
-                        }
+                        return;
+                    }
 
-                        var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo);
-                        _calcuResult = netWork.Calcu();
-                        if (_calcuResult.Succeed)
-                        {
-                            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();
-                            await _bimfaceCtrl?.ShowCalcuCustomLabels(_calcuResult);
-                            TipFormHelper.ShowSucceed("璁$畻鎴愬姛锛�");
-                        }
-                        else
-                        {
-                            _calcuCtrl.SetBindingData(_calcuResult.FailedList);
-                            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-                            this.docPnlBottom.Text = "璁$畻澶辫触鍘熷洜";
-                            this.docPnlBottom.Height = 350;
-                            TipFormHelper.ShowError("璁$畻澶辫触");
-                        }
+                    //鏍¢獙
+                    _checkResult = _hydroInfo.Check();
+                    if (!_checkResult.Succeed)
+                    {
+                        ShowCheckCtrl();
+                        TipFormHelper.ShowWarn("鏍¢獙澶辫触锛岃妫�鏌ュ悗閲嶈瘯");
+                        return;
+                    }
 
-                    };
+                    var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo);
+                    _calcuResult = netWork.Calcu();
+                    if (_calcuResult.Succeed)
+                    {
+                        this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden;
+                        await _bimfaceCtrl?.SetLogicCalcuCustomLabels(_calcuResult);
+                        TipFormHelper.ShowSucceed("璁$畻鎴愬姛锛�");
+                    }
+                    else
+                    {
+                        _calcuCtrl.SetFailedList(_calcuResult.FailedList);
+                        this.docPnlRight.Text = "澶辫触鍘熷洜";
+                        this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
+                        TipFormHelper.ShowError("璁$畻澶辫触");
+                    }
+                };
             }
             return _calcuCtrl;
         }
-        private XhsProjectSimulationCalcuCtrl _calcuCtrl = null;//璁$畻鎺т欢
+
+        //鑾峰彇璁$畻缁撴灉
+        private List<IHydroCalcuResult> GetAllCalcuResultList()
+        {
+            if (_hydroInfo == null)
+            {
+                return default;
+            }
+            if (_calcuResult == null)
+            {
+                return default;
+            }
+            if (!_calcuResult.Succeed)
+            {
+                return default;
+            }
+            var list = new List<IHydroCalcuResult>();
+
+            var allNodeList = _hydroInfo.GetAllNodes();
+            if (allNodeList != null && allNodeList.Count > 0)
+            {
+                var allCalcuNodeList = _calcuResult.NodeList;
+                if (allCalcuNodeList != null && allCalcuNodeList.Count > 0)
+                {
+                    foreach (var node in allNodeList)
+                    {
+                        var calcuNode = allCalcuNodeList.Find(x => x.Id == node.Code);
+                        if (calcuNode != null)
+                        {
+                            var calcuResult = new HydroCalcuNodeResult()
+                            {
+                                Code = node.Code,
+                                CalcuPress = calcuNode.Press,
+                                CalcuHead = calcuNode.Head,
+                                CalcuDemand = calcuNode.Demand
+                            };
+                            list.Add(calcuResult);
+                        }
+                    }
+                }
+            }
+
+            var allListList = _hydroInfo.GetAllLinks();
+            if (allListList != null && allListList.Count > 0)
+            {
+                var allCalcuLinkList = _calcuResult.LinkList;
+                if (allCalcuLinkList != null && allCalcuLinkList.Count > 0)
+                {
+                    foreach (var link in allListList)
+                    {
+                        var calcuLink = allCalcuLinkList.Find(x => x.Id == link.Code);
+                        if (calcuLink != null)
+                        {
+                            var calcuResult = new HydroCalcuLinkResult()
+                            {
+                                Code = link.Code,
+                                CalcuFlow = calcuLink.Flow,
+                                CalcuVelocity = calcuLink.Velocity,
+                                CalcuHeadLoss = calcuLink.Headloss
+                            };
+                            list.Add(calcuResult);
+                        }
+                    }
+                }
+            }
+
+            return list;
+        }
 
         //姘村姏璁$畻
         private void barBtnHydroCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -709,21 +1148,21 @@
             {
                 return;
             }
-
-            this.controlContainerBottom.Controls.Clear();
-            var calcuCtrl = GetCalcuCtrl();
-            calcuCtrl.SetBindingData(_hydroInfo);
-            this.controlContainerBottom.Controls.Add(calcuCtrl);
-            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-            this.docPnlBottom.Text = "璁$畻鍓嶆彁鏉′欢";
-            this.docPnlBottom.Height = 350;
+            var calcuPrefixCtrl = GetCalcuCtrl();
+            calcuPrefixCtrl.SetBindingData();
+            this.controlContainerRight.Controls.Clear();
+            this.controlContainerRight.Controls.Add(calcuPrefixCtrl);
+            this.docPnlRight.Text = "鍓嶆彁鏉′欢";
+            this.docPnlRight.Width = SetHydroCalcuPrefixCtrl.ControlMinWidth;
+            this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
         }
-
-
 
         #endregion
 
         #region 鏋勪欢鏌ヨ
+
+        //鏌ヨ缁勪欢
+        private XhsProjectSimulationSearchCtrl _searchCtrl = null;
 
         //鑾峰彇鏌ヨ缁勪欢
         private XhsProjectSimulationSearchCtrl GetSearchCtrl()
@@ -758,26 +1197,204 @@
             }
             return _searchCtrl;
         }
-        private XhsProjectSimulationSearchCtrl _searchCtrl = null;//鏌ヨ缁勪欢
 
-        //鏌ヨ
-        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        //鏄剧ず鏌ヨ鎺т欢
+        private void ShowSearchCtrl()
         {
             if (_hydroInfo == null)
             {
                 return;
             }
-
-            this.controlContainerBottom.Controls.Clear();
             var searchCtrl = GetSearchCtrl();
+            this.controlContainerBottom.Controls.Clear();
             this.controlContainerBottom.Controls.Add(searchCtrl);
             this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
-            this.docPnlBottom.Text = "妯″瀷鏋勪欢鏌ヨ";
+            this.docPnlBottom.Text = "鏋勪欢鏌ヨ";
             this.docPnlBottom.Height = 350;
         }
 
+        //鏌ヨ
+        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            ShowSearchCtrl();
+        }
+
         #endregion
 
+        #region 妯″瀷鏍囨敞
+
+        //鎵�鏈夋爣娉ㄥ垪琛�
+        private List<HydroMarkSetViewModel> _allMarkList = null;
+
+        //鏄剧ず鏍囨敞绐椾綋
+        private async void ShowMarkDlg()
+        {
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            if (_allMarkList == null)
+            {
+                _allMarkList = new List<HydroMarkSetViewModel>();
+                if (_hydroInfo.Waterboxs != null && _hydroInfo.Waterboxs.Count > 0)
+                {
+                    _allMarkList.Add(new HydroMarkSetViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Waterbox,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Waterbox),
+                        MarkType = (int)eWaterboxMarkType.None
+                    });
+                }
+                if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
+                {
+                    _allMarkList.Add(new HydroMarkSetViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Pump,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pump),
+                        MarkType = (int)eWaterboxMarkType.None
+                    });
+                }
+                if (_hydroInfo.Valves != null && _hydroInfo.Valves.Count > 0)
+                {
+                    _allMarkList.Add(new HydroMarkSetViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Valve,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Valve),
+                        MarkType = (int)eWaterboxMarkType.None
+                    });
+                }
+                if (_hydroInfo.Pipes != null && _hydroInfo.Pipes.Count > 0)
+                {
+                    _allMarkList.Add(new HydroMarkSetViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Pipe,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pipe),
+                        MarkType = (int)eWaterboxMarkType.None
+                    });
+                }
+                if (_hydroInfo.Nozzles != null && _hydroInfo.Nozzles.Count > 0)
+                {
+                    _allMarkList.Add(new HydroMarkSetViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Nozzle,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Nozzle),
+                        MarkType = (int)eWaterboxMarkType.None
+                    });
+                }
+            }
+            var dlg = new SetHydroMarkDlg();
+            dlg.InitialData(() => _hydroInfo);
+            dlg.SetBindingData(_allMarkList);
+            dlg.ReloadDataEvent += async (allResultList) =>
+            {
+                var leadLabels = allResultList?.Select(x => new LogicMarkLeadLabel(x.Code, x.Text)).ToList();
+                await _bimfaceCtrl?.SetLogicMarkLeadLabels(leadLabels);
+            };
+            if (dlg.ShowDialog() != DialogResult.OK)
+            {
+                await _bimfaceCtrl?.ClearLogicMarkLeadLabels();
+            }
+        }
+
+        //璁剧疆鏍囨敞
+        private void barBtnSetMark_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            ShowMarkDlg();
+        }
+
+        #endregion
+
+        #region 棰滆壊鍒嗙骇
+
+        //棰滆壊鍒嗙骇搴旂敤鍒楄〃
+        private List<HydroGradingApplyViewModel> _allGradingApplyList = null;
+        //棰滆壊鍒嗙骇缂栫爜鍒楄〃
+        private List<string> _allGradingCodeList = null;
+
+        //璁剧疆棰滆壊鍒嗙骇
+        private void SetGrading()
+        {
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            var dlg = new SetHydroGradingModelDlg();
+            dlg.SetBindingData(_hydroInfo.ID);
+            dlg.ShowDialog();
+        }
+
+        //搴旂敤棰滆壊鍒嗙骇
+        private async void ApplyGrading()
+        {
+            if (_hydroInfo == null)
+            {
+                return;
+            }
+            if (_allGradingApplyList == null)
+            {
+                _allGradingApplyList = new List<HydroGradingApplyViewModel>();
+
+                if (_hydroInfo.Pumps != null && _hydroInfo.Pumps.Count > 0)
+                {
+                    _allGradingApplyList.Add(new HydroGradingApplyViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Pump,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pump),
+                        PropName = string.Empty
+                    });
+                }
+                if (_hydroInfo.Valves != null && _hydroInfo.Valves.Count > 0)
+                {
+                    _allGradingApplyList.Add(new HydroGradingApplyViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Valve,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Valve),
+                        PropName = string.Empty
+                    });
+                }
+                if (_hydroInfo.Pipes != null && _hydroInfo.Pipes.Count > 0)
+                {
+                    _allGradingApplyList.Add(new HydroGradingApplyViewModel()
+                    {
+                        Code = Yw.Hydro.ParterCatalog.Pipe,
+                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Pipe),
+                        PropName = string.Empty
+                    });
+                }
+            }
+            var dlg = new ApplyHydroGradingDlg();
+            dlg.SetBindingData(() => _hydroInfo, _allGradingApplyList, GetAllCalcuResultList());
+            dlg.ReloadDataEvent += (obj) =>
+            {
+                _allGradingCodeList = obj?.Select(x => x.Code).Distinct().ToList();
+                var objGroupList = obj?.GroupBy(x => x.Color).ToList();
+                objGroupList.ForEach(async x =>
+                {
+                    await _bimfaceCtrl?.OverrideComponentsColor(x.Select(t => t.Code).Distinct().ToList(), x.Key, 1);
+                });
+            };
+            if (dlg.ShowDialog() != DialogResult.OK)
+            {
+                await _bimfaceCtrl?.RestoreComponentsColor(_allGradingCodeList);
+            }
+        }
+
+        //璁剧疆
+        private void barBtnGradingSet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            SetGrading();
+        }
+
+        //搴旂敤
+        private void barBtnGradingApply_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
+        {
+            ApplyGrading();
+        }
+
+        #endregion
+
+
+
 
 
     }

--
Gitblit v1.9.3