| | |
| | | global 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 |
| | | { |
| | |
| | | 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;//项目 |
| | |
| | | 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 |
| | |
| | | } |
| | | return _bimfaceCtrl; |
| | | } |
| | | |
| | | //bimface控件 |
| | | private XhsProjectSimulationBimfaceCtrl _bimfaceCtrl = null; |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #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 |
| | | |
| | |
| | | } |
| | | return _matchingListCtrl; |
| | | } |
| | | |
| | | //匹配列表控件 |
| | | private XhsProjectSimulationMatchingListCtrl _matchingListCtrl = null; |
| | | |
| | |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | #endregion 自动匹配 |
| | | |
| | | #region 未匹配列表 |
| | | |
| | |
| | | } |
| | | return _unMatchingListCtrl; |
| | | } |
| | | |
| | | private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//未匹配列表 |
| | | |
| | | //未匹配列表 |
| | |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | #endregion 未匹配列表 |
| | | |
| | | #region 一键显隐 |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #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) |
| | | { |
| | |
| | | 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) |
| | |
| | | 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 保存水力信息 |
| | | |
| | |
| | | TipFormHelper.ShowSucceed("保存成功!"); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 保存水力信息 |
| | | |
| | | #region 构件明细 |
| | | |
| | |
| | | } |
| | | return _parterListCtrl; |
| | | } |
| | | |
| | | //构件明细控件 |
| | | private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null; |
| | | |
| | |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | #endregion 构件明细 |
| | | |
| | | #region INP导出 |
| | | |
| | |
| | | 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 配置 |
| | | |
| | |
| | | this.rmSet.ShowPopup(MousePosition, true); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 配置 |
| | | |
| | | #region 性能曲线 |
| | | |
| | |
| | | } |
| | | |
| | | var rated_speed = x.RatedN.Value; |
| | | var speed_ratio = x.SpeedRatio ?? 1; |
| | | 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; |
| | |
| | | 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) |
| | |
| | | { |
| | | 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 |
| | | |
| | |
| | | } |
| | | return _searchCtrl; |
| | | } |
| | | |
| | | private XhsProjectSimulationSearchCtrl _searchCtrl = null;//查询组件 |
| | | |
| | | //查询 |
| | |
| | | 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 |
| | | |
| | | |