| | |
| | | global using Yw.EPAnet; |
| | | using DevExpress.Xpo.Helpers; |
| | | using HStation.WinFrmUI.Xhs; |
| | | using HStation.WinFrmUI.Xhs.Core; |
| | | using NPOI.SS.Formula.Functions; |
| | | using Yw.WinFrmUI.HydroL2d; |
| | | using Yw.WinFrmUI.HydroL3d; |
| | | using NetTaste; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | InitializeComponent(); |
| | | this.PageTitle.Caption = "水力模拟"; |
| | | this.PageTitle.HeaderSvgImage = this.svgImg32[0]; |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | } |
| | | |
| | | private HStation.Vmo.XhsProjectVmo _project = null;//项目 |
| | |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息 |
| | | |
| | | private Yw.Model.HydroParterInfo _parter = null; |
| | | private Yw.EPAnet.CheckResult _checkResult = null; |
| | | private Yw.WinFrmUI.HydroCheckResult _checkResult = null; |
| | | private Yw.EPAnet.CalcuResult _calcuResult = null; |
| | | |
| | | /// <summary> |
| | |
| | | this.PageTitle.Caption = $"{_project.Name}\r\n水力模拟"; |
| | | await this.xhsProjectSimulationBimfaceCtrl1.SetBindingData(_project, _projectSite, () => _hydroInfo); |
| | | this.xhsProjectSimulationQ3dCtrl1.SetBindingData(_hydroInfo); |
| | | this.xhsProjectSimulationL3dCtrl1.SetBindingData(_hydroInfo); |
| | | this.xhsProjectSimulationPropertyCtrl1.SetBindingData(() => _hydroInfo); |
| | | this.xhsProjectSimulationPropertyCtrl1.InitialData(() => _hydroInfo); |
| | | } |
| | | |
| | | #region INP导出 |
| | | |
| | | //导出水力INP文件 |
| | | private void barBtnHydroExportInp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var fileName = Yw.WinFrmUI.FileDialogHelper.SaveInp("导出Inp文件"); |
| | | if (string.IsNullOrEmpty(fileName)) |
| | | { |
| | | return; |
| | | } |
| | | var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo); |
| | | var result = netWork.ToInpString(); |
| | | File.WriteAllText(fileName, result); |
| | | TipFormHelper.ShowSucceed("导出成功"); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Bimface |
| | | |
| | |
| | | await this.xhsProjectSimulationBimfaceCtrl1.SetLinkComponentsColor(elementIds); |
| | | } |
| | | |
| | | #endregion Bimface |
| | | #endregion |
| | | |
| | | #region Q3d |
| | | |
| | | //点击事件 |
| | | private void xhsProjectSimulationQ3dCtrl1_ClickParterEvent(string code) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == code); |
| | | ShowProperty(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 属性面板 |
| | | |
| | |
| | | |
| | | #region 自动匹配 |
| | | |
| | | //获取匹配列表控件 |
| | | private XhsProjectSimulationMatchingListCtrl GetMatchingListCtrl() |
| | | { |
| | | if (_matchingListCtrl == null) |
| | | { |
| | | _matchingListCtrl = new XhsProjectSimulationMatchingListCtrl(); |
| | | _matchingListCtrl.Dock = DockStyle.Fill; |
| | | _matchingListCtrl.HydroClickEvent += async (code) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == code); |
| | | var elementIds = new List<string>(); |
| | | if (_parter != null) |
| | | { |
| | | elementIds.Add(_parter.Code); |
| | | } |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | }; |
| | | _matchingListCtrl.ApplyMatchingEvent += (output) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return false; |
| | | } |
| | | return AssetsMatchingParasHelper.Apply(_hydroInfo, output); |
| | | }; |
| | | } |
| | | return _matchingListCtrl; |
| | | } |
| | | //匹配列表控件 |
| | | private XhsProjectSimulationMatchingListCtrl _matchingListCtrl = null; |
| | | |
| | | //自动匹配 |
| | | private void barBtnMatchingList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | var matchingListCtrl = GetMatchingListCtrl(); |
| | | var input = AssetsMatchingParasHelper.Create(_hydroInfo); |
| | | this.xhsProjectSimulationMatchingListCtrl1.SetBindingData(input); |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlMatchingList.Height = 350; |
| | | matchingListCtrl.SetBindingData(input); |
| | | this.controlContainerBottom.Controls.Add(matchingListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "匹配列表"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | //水力信息点击 |
| | | private async void xhsProjectSimulationMatchingListCtrl1_HydroClickEvent(string code) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList.Find(x => x.Code == code); |
| | | var elementIds = new List<string>() { _parter.Code }; |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | } |
| | | |
| | | //应用匹配事件 |
| | | private bool xhsProjectSimulationMatchingListCtrl1_ApplyMatchingEvent(AssetsMatchingViewModel output) |
| | | { |
| | | return AssetsMatchingParasHelper.Apply(_hydroInfo, output); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 未匹配列表 |
| | | |
| | | //获取未匹配列表控件 |
| | | private XhsProjectSimulationUnMatchingListCtrl GetUnMatchingListCtrl() |
| | | { |
| | | if (_unMatchingListCtrl == null) |
| | | { |
| | | _unMatchingListCtrl = new XhsProjectSimulationUnMatchingListCtrl(); |
| | | _unMatchingListCtrl.Dock = DockStyle.Fill; |
| | | _unMatchingListCtrl.HydroClickEvent += async (parter) =>//行点击 |
| | | { |
| | | if (parter == null) |
| | | { |
| | | return; |
| | | } |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == parter.Code); |
| | | var elementIds = new List<string>() { parter.Code }; |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | }; |
| | | _unMatchingListCtrl.ViewModelEvent += async (parters) =>//查看模型 |
| | | { |
| | | var codes = parters?.Select(x => x.Code).Distinct().ToList(); |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(codes); |
| | | _parter = null; |
| | | ShowProperty(); |
| | | }; |
| | | } |
| | | return _unMatchingListCtrl; |
| | | } |
| | | private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//未匹配列表 |
| | | |
| | | //未匹配列表 |
| | | private void barBtnUnMatchingList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | this.xhsProjectSimulationUnMatchingListCtrl1.SetBindingData(_hydroInfo); |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlUnMatchingList.Height = 350; |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | var unMatchingListCtrl = GetUnMatchingListCtrl(); |
| | | unMatchingListCtrl.SetBindingData(_hydroInfo); |
| | | this.controlContainerBottom.Controls.Add(unMatchingListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "未匹配列表"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | //未匹配列表点击事件 |
| | | private async void xhsProjectSimulationUnMatchingListCtrl1_HydroClickEvent(Yw.Model.HydroParterInfo parter) |
| | | { |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList.Find(x => x.ID == parter.ID); |
| | | var elementIds = new List<string>() { _parter.Code }; |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | } |
| | | |
| | | //未匹配列表查看模型 |
| | | private async void xhsProjectSimulationUnMatchingListCtrl1_ViewModelEvent(List<Yw.Model.HydroParterInfo> parters) |
| | | { |
| | | var codes = parters?.Select(x => x.Code).Distinct().ToList(); |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(codes); |
| | | _parter = null; |
| | | ShowProperty(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | |
| | | #region 水力校验 |
| | | |
| | | //获取校验结果控件 |
| | | private XhsProjectSimulationHydroCheckResultCtrl GetCheckResultCtrl() |
| | | { |
| | | if (_checkResultCtrl == null) |
| | | { |
| | | _checkResultCtrl = new XhsProjectSimulationHydroCheckResultCtrl(); |
| | | _checkResultCtrl.Dock = DockStyle.Fill; |
| | | _checkResultCtrl.HydroClickEvent += async (code) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var elementIds = new List<string>(); |
| | | if (string.IsNullOrEmpty(code)) |
| | | { |
| | | _parter = null; |
| | | } |
| | | else |
| | | { |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == code); |
| | | if (_parter != null) |
| | | { |
| | | elementIds.Add(_parter.Code); |
| | | } |
| | | } |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | }; |
| | | } |
| | | return _checkResultCtrl; |
| | | } |
| | | //校验结果控件 |
| | | private XhsProjectSimulationHydroCheckResultCtrl _checkResultCtrl = null; |
| | | |
| | | //水力验证 |
| | | private void barBtnHydroCheck_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo); |
| | | _checkResult = netWork.Check(); |
| | | if (_checkResult.Succeed) |
| | | { |
| | | TipFormHelper.ShowSucceed("校验通过!"); |
| | | return; |
| | | } |
| | | this.xhsProjectSimulationHydroCheckFailedCtrl1.SetBindingData(_checkResult.FailedList); |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlHydroCheck.Height = 350; |
| | | } |
| | | |
| | | //水力校验点击 |
| | | private async void xhsProjectSimulationHydroCheckFailedCtrl1_HydroClickEvent(string code) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList.Find(x => x.Code == code); |
| | | var elementIds = new List<string>() { _parter.Code }; |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | _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; |
| | | } |
| | | |
| | | #endregion |
| | |
| | | |
| | | #region 构件明细 |
| | | |
| | | //获取构件明细控件 |
| | | private Yw.WinFrmUI.HydroParterListCtrl GetParterListCtrl() |
| | | { |
| | | if (_parterListCtrl == null) |
| | | { |
| | | _parterListCtrl = new HydroParterListCtrl(); |
| | | _parterListCtrl.Dock = DockStyle.Fill; |
| | | _parterListCtrl.HydroClickEvent += async (parter) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == parter.Code); |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(new List<string>() { _parter.Code }); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | }; |
| | | } |
| | | return _parterListCtrl; |
| | | } |
| | | //构件明细控件 |
| | | private Yw.WinFrmUI.HydroParterListCtrl _parterListCtrl = null; |
| | | |
| | | //水力构件列表 |
| | | private void barBtnHydroParterList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | |
| | | { |
| | | return; |
| | | } |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | this.hydroParterListCtrl1.SetBindingData(_hydroInfo); |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlHydroParterList.Height = 350; |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | var parterListCtrl = GetParterListCtrl(); |
| | | parterListCtrl.SetBindingData(_hydroInfo); |
| | | this.controlContainerBottom.Controls.Add(parterListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "构件明细"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | //水力构件明细面板点击事件 |
| | | private async void hydroParterListCtrl1_HydroClickEvent(Yw.Model.HydroParterInfo parter) |
| | | |
| | | #endregion |
| | | |
| | | #region INP导出 |
| | | |
| | | //导出水力INP文件 |
| | | private void barBtnHydroExportInp_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList.Find(x => x.ID == parter.ID); |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(new List<string>() { _parter.Code }); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var fileName = Yw.WinFrmUI.FileDialogHelper.SaveInp("导出Inp文件"); |
| | | if (string.IsNullOrEmpty(fileName)) |
| | | { |
| | | return; |
| | | } |
| | | var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo); |
| | | var result = netWork.ToInpString(); |
| | | File.WriteAllText(fileName, result); |
| | | TipFormHelper.ShowSucceed("导出成功"); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | return; |
| | | } |
| | | var pumps = _hydroInfo.Pumps; |
| | | var vmList = pumps.Select(x => new HStation.WinFrmUI.PhartRelation.Perform2dMultiViewModel() |
| | | var vmList = new List<Yw.WinFrmUI.Phart.PumpSerialParallelViewModel>(); |
| | | foreach (var x in pumps) |
| | | { |
| | | Id = x.Code, |
| | | Name = x.Code, |
| | | SpeedRatio = x.SpeedRatio ?? 1, |
| | | PointsQH = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQH)?.CurveData?.Select(z => new PhartRelation.PerformPoint2dViewModel() { X = z.X, Y = z.Y }).ToList(), |
| | | PointsQP = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQP)?.CurveData?.Select(z => new PhartRelation.PerformPoint2dViewModel() { X = z.X, Y = z.Y }).ToList(), |
| | | PointsQE = _hydroInfo.Curves?.Find(t => t.Code == x.CurveQE)?.CurveData?.Select(z => new PhartRelation.PerformPoint2dViewModel() { X = z.X, Y = z.Y }).ToList(), |
| | | }).ToList(); |
| | | var dlg = new HStation.WinFrmUI.PhartRelation.PumpPerform2dMultiViewDlg(); |
| | | dlg.SetBindingData(vmList, false, true); |
| | | 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.Qh = new Yw.Geometry.CubicSpline2d(PointsQH); |
| | | vm.Qe = new Yw.Geometry.CubicSpline2d(PointsQE); |
| | | vm.Qp = new Yw.Geometry.CubicSpline2d(PointsQP); |
| | | vmList.Add(vm); |
| | | } |
| | | var dlg = new HStation.WinFrmUI.PhartRelation.PumpSerialParallelChartDlg(); |
| | | dlg.SetBindingData(vmList, null, true); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | |
| | | |
| | | #region 水力计算 |
| | | |
| | | |
| | | //获取计算控件 |
| | | private XhsProjectSimulationCalcuCtrl GetCalcuCtrl() |
| | | { |
| | | if (_calcuCtrl == null) |
| | | { |
| | | _calcuCtrl = new XhsProjectSimulationCalcuCtrl(); |
| | | _calcuCtrl.Dock = DockStyle.Fill; |
| | | _calcuCtrl.CancelEvent += () => |
| | | { |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | }; |
| | | _calcuCtrl.OkEvent += async () => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo); |
| | | _calcuResult = netWork.Calcu(); |
| | | if (_calcuResult.Succeed) |
| | | { |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | ShowProperty(); |
| | | TipFormHelper.ShowSucceed("计算成功!"); |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ShowCalcuCustomLabels(_calcuResult); |
| | | } |
| | | else |
| | | { |
| | | _calcuCtrl.SetBindingData(_calcuResult.FailedList); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "水力计算失败原因"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | }; |
| | | } |
| | | return _calcuCtrl; |
| | | } |
| | | private XhsProjectSimulationCalcuCtrl _calcuCtrl = null;//计算控件 |
| | | |
| | | //水力计算 |
| | | private async void barBtnHydroCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private void barBtnHydroCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | this.docPnlHydroCheck.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlHydroParterList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlUnMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | this.docPnlMatchingList.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Hidden; |
| | | |
| | | var netWork = Yw.Hydro.ParseHelper.ToNetwork(_hydroInfo); |
| | | _calcuResult = netWork.Calcu(); |
| | | if (_calcuResult.Succeed) |
| | | 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; |
| | | } |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 构件查询 |
| | | |
| | | //获取查询组件 |
| | | private XhsProjectSimulationSearchCtrl GetSearchCtrl() |
| | | { |
| | | if (_searchCtrl == null) |
| | | { |
| | | ShowProperty(); |
| | | TipFormHelper.ShowSucceed("计算成功!"); |
| | | _searchCtrl = new XhsProjectSimulationSearchCtrl(); |
| | | _searchCtrl.Dock = DockStyle.Fill; |
| | | _searchCtrl.InitialData(() => _hydroInfo); |
| | | _searchCtrl.ApplySearchEvent += async (list) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var elementIds = new List<string>(); |
| | | if (list != null && list.Count > 0) |
| | | { |
| | | var first = list.First(); |
| | | var allParterList = _hydroInfo.GetAllParters(); |
| | | _parter = allParterList?.Find(x => x.Code == first.Code); |
| | | list.ForEach(x => elementIds.Add(x.Code)); |
| | | } |
| | | else |
| | | { |
| | | _parter = null; |
| | | } |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ZoomAndSelectComponents(elementIds); |
| | | ShowProperty(); |
| | | SetBimfaceLinkColor(); |
| | | }; |
| | | } |
| | | else |
| | | return _searchCtrl; |
| | | } |
| | | private XhsProjectSimulationSearchCtrl _searchCtrl = null;//查询组件 |
| | | |
| | | //查询 |
| | | private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | this.xhsProjectSimulationHydroCalcuFailedCtrl1.SetBindingData(_calcuResult.FailedList); |
| | | this.docPnlHydroCalcu.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlHydroCalcu.Height = 350; |
| | | return; |
| | | } |
| | | await this.xhsProjectSimulationBimfaceCtrl1.ShowCalcuCustomLabels(_calcuResult); |
| | | |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | var searchCtrl = GetSearchCtrl(); |
| | | this.controlContainerBottom.Controls.Add(searchCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "模型构件查询"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | } |
| | | } |