From 82dfff29bca77a1e11459fb7a69f729a09f4345c Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 18 十月 2024 15:05:05 +0800 Subject: [PATCH] 计算优化,标注优化 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/06-simulation/XhsProjectSimulationCorePage.cs | 502 +++++++++++++++++++++++++++++++++++-------------------- 1 files changed, 317 insertions(+), 185 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 1e4b136..64fb679 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 DevExpress.Utils.DirectXPaint; +using Yw.WinFrmUI.Bimface; +using Yw.WinFrmUI.Hydro; namespace HStation.WinFrmUI { @@ -13,7 +14,7 @@ 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; } private HStation.Vmo.XhsProjectVmo _project = null;//椤圭洰 @@ -68,8 +69,10 @@ 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); } #region Bimface @@ -107,6 +110,7 @@ } return _bimfaceCtrl; } + //bimface鎺т欢 private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null; @@ -171,27 +175,120 @@ } } - #endregion + #endregion Bimface #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); + } + return _propertyCtrl; + } + + //鏄剧ず灞炴�ч潰鏉� + private void ShowPropertyCtrl() + { + 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; + } + + //灞炴�ч潰鏉挎寜閽� + 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 (_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 +329,7 @@ } return _matchingListCtrl; } + //鍖归厤鍒楄〃鎺т欢 private XhsProjectSimulationMatchingListCtrl _matchingListCtrl = null; @@ -252,8 +350,7 @@ this.docPnlBottom.Height = 350; } - - #endregion + #endregion 鑷姩鍖归厤 #region 鏈尮閰嶅垪琛� @@ -291,6 +388,7 @@ } return _unMatchingListCtrl; } + private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//鏈尮閰嶅垪琛� //鏈尮閰嶅垪琛� @@ -309,9 +407,7 @@ this.docPnlBottom.Height = 350; } - - - #endregion + #endregion 鏈尮閰嶅垪琛� #region 涓�閿樉闅� @@ -341,18 +437,21 @@ } } - #endregion + #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 +476,24 @@ 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.Text = "鏍¢獙缁撴灉"; + this.docPnlBottom.Height = 350; + this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; + } //姘村姏楠岃瘉 private void barBtnHydroCheck_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) @@ -390,16 +503,10 @@ 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 淇濆瓨姘村姏淇℃伅 @@ -420,7 +527,7 @@ TipFormHelper.ShowSucceed("淇濆瓨鎴愬姛锛�"); } - #endregion + #endregion 淇濆瓨姘村姏淇℃伅 #region 鏋勪欢鏄庣粏 @@ -446,6 +553,7 @@ } return _parterListCtrl; } + //鏋勪欢鏄庣粏鎺т欢 private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null; @@ -465,8 +573,7 @@ this.docPnlBottom.Height = 350; } - - #endregion + #endregion 鏋勪欢鏄庣粏 #region INP瀵煎嚭 @@ -488,61 +595,7 @@ TipFormHelper.ShowSucceed("瀵煎嚭鎴愬姛"); } - #endregion - - #region 涓氬姟鏂规硶 - - //鏄剧ず灞炴�� - private void ShowProperty() - { - if (_hydroInfo == null) - { - return; - } - if (_parter == null) - { - this.xhsProjectSimulationPropertyCtrl1.SelectParter(null); - return; - } - this.xhsProjectSimulationPropertyCtrl1.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) - { - this.xhsProjectSimulationPropertyCtrl1.UpdateCalcuProperty(calcuProperty); - } - } - } - } - } - - #endregion + #endregion INP瀵煎嚭 #region 閰嶇疆 @@ -552,7 +605,7 @@ this.rmSet.ShowPopup(MousePosition, true); } - #endregion + #endregion 閰嶇疆 #region 鎬ц兘鏇茬嚎 @@ -572,112 +625,111 @@ 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) + { + 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; + + if (qh == null) + { + continue; + } + + var rated_speed = x.RatedN.Value; + var speed_ratio = x.SpeedRatio; + + 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 = 590; - //vm.CurrentSpeed = 590; - //vm.CurrentHz = 50; - var PointsQH = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQH)?.CurveData?.Select(z => new Yw.Geometry.Point2d() { X = z.X, Y = z.Y }).ToList(); - var PointsQP = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQP)?.CurveData?.Select(z => new Yw.Geometry.Point2d { X = z.X, Y = z.Y }).ToList(); - var PointsQE = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQE)?.CurveData?.Select(z => new Yw.Geometry.Point2d { X = z.X, Y = z.Y }).ToList(); + 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(PointsQH); - vm.Qe = new Yw.Geometry.CubicSpline2d(PointsQE); - vm.Qp = new Yw.Geometry.CubicSpline2d(PointsQP); + 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); vmList.Add(vm); } + var dlg = new HStation.WinFrmUI.PhartRelation.PumpSerialParallelChartDlg(); dlg.SetBindingData(vmList, null, true); dlg.ShowDialog(); } - #endregion + #endregion 鎬ц兘鏇茬嚎 #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 void barBtnHydroCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) @@ -686,17 +738,14 @@ { 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 @@ -735,6 +784,7 @@ } return _searchCtrl; } + private XhsProjectSimulationSearchCtrl _searchCtrl = null;//鏌ヨ缁勪欢 //鏌ヨ @@ -753,6 +803,88 @@ this.docPnlBottom.Height = 350; } + #endregion 鏋勪欢鏌ヨ + + #region 鏍囨敞 + + private List<HydroMarkSetViewModel> _allMarkList = null; + + //璁剧疆鏍囨敞 + private void barBtnMarkSet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + 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.SetBindingData(() => _hydroInfo, _allMarkList); + dlg.ReloadDataEvent += async (obj) => + { + var leadLabels = obj?.Select(x => new LogicMarkLeadLabel() { Id = x.Code, Text = x.Text }).ToList(); + await _bimfaceCtrl?.SetLogicMarkLeadLabels(leadLabels); + }; + dlg.ShowDialog(); + } + + //鍙栨秷鏍囨敞 + private async void barBtnMarkCancel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) + { + if (_hydroInfo == null) + { + return; + } + await _bimfaceCtrl?.ClearLogicMarkLeadLabels(); + } + #endregion -- Gitblit v1.9.3