lixiaojun
2024-10-23 164d205d245d81faf8727cc5e599fa84245f1994
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs
@@ -1,6 +1,5 @@
global using Yw.EPAnet;
using DevExpress.Mvvm.Native;
using DevExpress.Utils.DirectXPaint;
using Yw.WinFrmUI.Bimface;
using Yw.WinFrmUI.Hydro;
@@ -15,6 +14,7 @@
            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;//项目
@@ -73,9 +73,14 @@
            this.tabPageQ3d.Controls.Clear();
            this.tabPageQ3d.Controls.Add(q3dCtrl);
            q3dCtrl.InitialData(() => _hydroInfo);
            ShowPropertyCtrl();
        }
        #region Bimface
        //bimface控件
        private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
        //获取 bimface 控件
        private XhsProjectSimulationBimfaceCtrl GetBimfaceCtrl()
@@ -111,8 +116,7 @@
            return _bimfaceCtrl;
        }
        //bimface控件
        private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null;
        //设置Bimface连接颜色
        private async void SetBimfaceLinkColor()
@@ -175,7 +179,7 @@
            }
        }
        #endregion Bimface
        #endregion
        #region Q3d
@@ -217,7 +221,55 @@
            {
                _propertyCtrl = new XhsProjectSimulationPropertyCtrl();
                _propertyCtrl.Dock = DockStyle.Fill;
                _propertyCtrl.InitialData(() => _hydroInfo);
                _propertyCtrl.InitialData(() => _hydroInfo, () => GetAllCalcuResult());
                _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;
        }
@@ -228,9 +280,9 @@
            var propertyCtrl = GetPropertyCtrl();
            this.controlContainerRight.Controls.Clear();
            this.controlContainerRight.Controls.Add(propertyCtrl);
            this.docPnlRight.Text = "属性";
            this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
            this.docPnlRight.Width = 270;
            this.docPnlRight.Text = "属性";
            this.docPnlRight.Width = 300;
        }
        //属性面板按钮
@@ -246,6 +298,11 @@
            {
                return;
            }
            if (this.docPnlRight.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Hidden)
            {
                ShowPropertyCtrl();
            }
            if (_parter == null)
            {
                _propertyCtrl?.SelectParter(null);
@@ -288,6 +345,7 @@
                    }
                }
            }
        }
        #endregion
@@ -342,7 +400,7 @@
            }
            this.controlContainerBottom.Controls.Clear();
            var matchingListCtrl = GetMatchingListCtrl();
            var input = AssetsMatchingParasHelper.Create(_hydroInfo);
            var input = AssetsMatchingParasHelper.Create(_hydroInfo, GetAllCalcuResult());
            matchingListCtrl.SetBindingData(input);
            this.controlContainerBottom.Controls.Add(matchingListCtrl);
            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
@@ -411,11 +469,8 @@
        #region 一键显隐
        //显隐编码列表
        private List<string> _fastShowHideCodeList = null;
        //触发一键显隐
        private async void barBtnShowHide_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        //一键显隐
        private async Task FastShowHidden()
        {
            if (_hydroInfo == null)
            {
@@ -425,19 +480,28 @@
            {
                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;
            }
        }
        #endregion 一键显隐
        //显隐编码列表
        private List<string> _fastShowHiddenCodeList = null;
        //触发一键显隐
        private async void barBtnFastShowHidden_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            await FastShowHidden();
        }
        #endregion
        #region 水力校验
@@ -490,9 +554,10 @@
            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;
            this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible;
        }
        //水力验证
@@ -508,7 +573,7 @@
        #endregion 水力校验
        #region 保存水力信息
        #region 保存信息
        //保存
        private async void barBtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
@@ -530,6 +595,9 @@
        #endregion 保存水力信息
        #region 构件明细
        //构件明细控件
        private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null;
        //获取构件明细控件
        private Yw.WinFrmUI.HydroParterListCtrl GetParterListCtrl()
@@ -554,23 +622,26 @@
            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, GetAllCalcuResult());
            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 构件明细
@@ -597,12 +668,270 @@
        #endregion INP导出
        #region 配置
        #region 批量配置
        //注册批量配置事件
        private void RegistBulkSetEvents()
        {
            //水库
            this.barBtnSetReservoirList.ItemClick += delegate
            {
                var dlg = new HydroReservoirBulkSetListDlg();
                dlg.ShowDialog();
            };
            //水池
            this.barBtnSetTankList.ItemClick += delegate
            {
                var dlg = new HydroTankBulkSetListDlg();
                dlg.ShowDialog();
            };
            //水箱
            this.barBtnSetWaterboxList.ItemClick += delegate
            {
                if (_hydroInfo == null)
                {
                    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
            {
            };
        }
        //显示RadialMenu
        private void barBtnSetList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            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 配置
@@ -616,15 +945,16 @@
            {
                return;
            }
            if (_calcuResult == null)
            {
                return;
            }
            if (!_calcuResult.Succeed)
            {
                return;
            }
            var pumps = _hydroInfo.Pumps;
            //if (_calcuResult == null)
            //{
            //    return;
            //}
            //if (!_calcuResult.Succeed)
            //{
            //    return;
            //}
            var pumps = _hydroInfo.Pumps?.Where(x => x.LinkStatus == Yw.Hydro.LinkStatus.Open).ToList();
            var curve_list = _hydroInfo.Curves;
            if (curve_list == null || !curve_list.Any())
            {
@@ -655,7 +985,7 @@
                var vm = new Yw.WinFrmUI.Phart.PumpSerialParallelViewModel();
                vm.Id = x.Code;
                vm.Name = x.Code;
                vm.Name = x.Name;
                //vm.IsBp = ;
                vm.RatedSpeed = rated_speed;
                vm.CurrentSpeed = Math.Round(rated_speed * speed_ratio);
@@ -672,7 +1002,7 @@
            dlg.ShowDialog();
        }
        #endregion 性能曲线
        #endregion
        #region 水力计算
@@ -731,6 +1061,74 @@
            return _calcuCtrl;
        }
        //获取计算结果
        private List<IHydroCalcuResult> GetAllCalcuResult()
        {
            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)
        {
@@ -750,6 +1148,9 @@
        #endregion
        #region 构件查询
        //查询组件
        private XhsProjectSimulationSearchCtrl _searchCtrl = null;
        //获取查询组件
        private XhsProjectSimulationSearchCtrl GetSearchCtrl()
@@ -785,32 +1186,36 @@
            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;
        }
        #endregion 构件查询
        //查询
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ShowSearchCtrl();
        }
        #region 标注
        #endregion
        #region 模型标注
        //所有标注列表
        private List<HydroMarkSetViewModel> _allMarkList = null;
        //设置标注
        private void barBtnMarkSet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        //显示标注窗体
        private async void ShowMarkDlg()
        {
            if (_hydroInfo == null)
            {
@@ -866,28 +1271,125 @@
                }
            }
            var dlg = new SetHydroMarkDlg();
            dlg.SetBindingData(() => _hydroInfo, _allMarkList);
            dlg.ReloadDataEvent += async (obj) =>
            dlg.InitialData(() => _hydroInfo);
            dlg.SetBindingData(_allMarkList);
            dlg.ReloadDataEvent += async (allResultList) =>
            {
                var leadLabels = obj?.Select(x => new LogicMarkLeadLabel() { Id = x.Code, Text = x.Text }).ToList();
                var leadLabels = allResultList?.Select(x => new LogicMarkLeadLabel(x.Code, x.Text)).ToList();
                await _bimfaceCtrl?.SetLogicMarkLeadLabels(leadLabels);
            };
            dlg.ShowDialog();
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                await _bimfaceCtrl?.ClearLogicMarkLeadLabels();
            }
        }
        //取消标注
        private async void barBtnMarkCancel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        //设置标注
        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 barBtnGradingSet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (_hydroInfo == null)
            {
                return;
            }
            await _bimfaceCtrl?.ClearLogicMarkLeadLabels();
            var dlg = new SetHydroGradingModelDlg();
            dlg.SetBindingData(_hydroInfo.ID);
            dlg.ShowDialog();
        }
        //应用
        private void barBtnGradingApply_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (_hydroInfo == null)
            {
                return;
            }
            if (_allGradingApplyList == null)
            {
                _allGradingApplyList = new List<HydroGradingApplyViewModel>();
                if (_hydroInfo.Waterboxs != null && _hydroInfo.Waterboxs.Count > 0)
                {
                    _allGradingApplyList.Add(new HydroGradingApplyViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Waterbox,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Waterbox),
                        PropName = string.Empty
                    });
                }
                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
                    });
                }
                if (_hydroInfo.Nozzles != null && _hydroInfo.Nozzles.Count > 0)
                {
                    _allGradingApplyList.Add(new HydroGradingApplyViewModel()
                    {
                        Code = Yw.Hydro.ParterCatalog.Nozzle,
                        Name = Yw.WinFrmUI.HydroParterCatalogHelper.GetCatalogName(Yw.Hydro.ParterCatalog.Nozzle),
                        PropName = string.Empty
                    });
                }
            }
            var dlg = new ApplyHydroGradingDlg();
            dlg.SetBindingData(() => _hydroInfo, _allGradingApplyList, GetAllCalcuResult());
            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);
                });
            };
            dlg.ShowDialog();
        }
        //取消
        private async void barBtnGradingCancel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            await _bimfaceCtrl?.RestoreComponentsColor(_allGradingCodeList);
        }
        #endregion
    }
}