| | |
| | | global using Yw.EPAnet; |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Diagram.Core.Native; |
| | | using DevExpress.Diagram.Core.Native; |
| | | using DevExpress.Mvvm.Native; |
| | | using DevExpress.Office.Utils; |
| | | using DevExpress.PivotGrid.QueryMode.TuplesTree; |
| | | using DevExpress.Utils.Extensions; |
| | | using DevExpress.Xpo.Helpers; |
| | | using DevExpress.XtraBars.Ribbon; |
| | | using DevExpress.XtraPrinting.Native; |
| | | using DevExpress.XtraRichEdit.Layout; |
| | | using DevExpress.XtraSpreadsheet.Commands; |
| | | using DevExpress.Utils.MVVM; |
| | | using DevExpress.XtraMap; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using Microsoft.Web.WebView2.Core; |
| | | using NetTaste; |
| | | using Mapster; |
| | | using NPOI.SS.Formula.Functions; |
| | | using System.Collections.Generic; |
| | | using System.Diagnostics; |
| | | using System.Windows.Media; |
| | | using System.Windows.Media.Media3D; |
| | | using Yw.DAL.Basic; |
| | | using Yw.EPAnet; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | using Yw.Pump; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Bimface; |
| | | using Yw.WinFrmUI.Hydro; |
| | | using static DevExpress.Map.OpenGL.OpenGLCheckingHelper; |
| | | using Yw.WinFrmUI.Q3d; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | RegistBulkSetEvents(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> AppendWorkingEvent; |
| | | |
| | | private HStation.Vmo.XhsProjectVmo _project = null;//项目 |
| | | private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站 |
| | | private Yw.Model.HydroModelInfo _hydroInfo = null;//水力信息 |
| | | |
| | | |
| | | private Dictionary<HydroWorkingVmo, bool> _allWorkingCheckedListDict = null;//所有工况选择列表字典 |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public async Task SetBindingData |
| | | public void SetBindingData |
| | | ( |
| | | HStation.Vmo.XhsProjectVmo project, |
| | | HStation.Vmo.XhsProjectSiteVmo projectSite, |
| | | Yw.Model.HydroModelInfo hydroInfo |
| | | XhsProjectVmo project, |
| | | XhsProjectSiteVmo projectSite, |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | Dictionary<HydroWorkingVmo, bool> allWorkingCheckedListDict |
| | | ) |
| | | { |
| | | if (project == null) |
| | | { |
| | | return; |
| | | } |
| | | _project = project; |
| | | _projectSite = projectSite; |
| | | _hydroInfo = hydroInfo; |
| | | if (_projectSite == null) |
| | | { |
| | | _projectSite = await BLLFactory<HStation.BLL.XhsProjectSite>.Instance.GetDefaultByProjectID(_project.ID); |
| | | } |
| | | if (_hydroInfo == null) |
| | | { |
| | | var hydroRelation = await BLLFactory<Yw.BLL.HydroModelRelation>.Instance |
| | | .GetDefaultByObjectTypeAndObjectIDOfPurpose(HStation.Xhs.DataType.XhsProjectSite, _projectSite.ID, HStation.Xhs.Purpose.Simulation); |
| | | _hydroInfo = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.GetByID(hydroRelation.ModelID); |
| | | } |
| | | _allWorkingCheckedListDict = allWorkingCheckedListDict; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public override void InitialDataSource() |
| | | { |
| | | base.InitialDataSource(); |
| | | if (_project == null) |
| | | { |
| | | return; |
| | | } |
| | | this.PageTitle.Caption = $"{_project.Name}\r\n水力模拟"; |
| | | ShowBimfaceCtrl(); |
| | | ShowQ3dCtrl(); |
| | | ShowPropertyCtrl(); |
| | | } |
| | | |
| | | private void InitialUI() |
| | | { |
| | | InitialWorkingList(); |
| | | } |
| | | |
| | | |
| | | #region BIM控件 |
| | | |
| | |
| | | //获取 bimface 控件 |
| | | private async Task<XhsProjectSimulationBimfaceCtrl> GetBimfaceCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_bimfaceCtrl == null) |
| | | { |
| | | var overlay = this.ShowOverlay(); |
| | | _bimfaceCtrl = new XhsProjectSimulationBimfaceCtrl(); |
| | | _bimfaceCtrl.Dock = DockStyle.Fill; |
| | | await _bimfaceCtrl.InitialData(_project, _projectSite); |
| | | _bimfaceCtrl.LoadCompletedEvent += () => |
| | | {//view加载完成事件 |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | InitialUI(); |
| | | overlay.Close(); |
| | | this.barCkDecorator.Checked = false; |
| | | this.barCkGrading.Checked = true; |
| | | }; |
| | | _bimfaceCtrl.HydroMouseLeftClickEvent += (obj) => |
| | | _bimfaceCtrl.HydroMouseLeftClickEvent += (code) => |
| | | {//鼠标左键点击事件 |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | //_selectedVisual = obj; |
| | | //ShowSelectedProperty(); |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var visual = visualListHelper.GetVisual(code); |
| | | SelectVisual(visual, eVisualSource.Bimface); |
| | | }; |
| | | } |
| | | return _bimfaceCtrl; |
| | |
| | | this.tabPageBimface.Controls.Add(bimfaceCtrl); |
| | | } |
| | | |
| | | private void SelectBimfaceParter() |
| | | { |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region Q3d控件 |
| | |
| | | //获取 Q3d 控件 |
| | | private XhsProjectSimulationQ3dCtrl GetQ3dCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_q3dCtrl == null) |
| | | { |
| | | _q3dCtrl = new XhsProjectSimulationQ3dCtrl(); |
| | | _q3dCtrl.Dock = DockStyle.Fill; |
| | | _q3dCtrl.InitialData(() => _hydroInfo); |
| | | _q3dCtrl.SelectedPartersChangedEvent += (obj) => |
| | | _q3dCtrl.SelectedPartersChangedEvent += (codes) => |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allParterList = _hydroInfo.GetAllVisuals(); |
| | | _visual = allParterList?.Find(x => x.Code == obj?.FirstOrDefault()); |
| | | //ShowSelectedProperty(); |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var visuals = visualListHelper.GetVisualList(codes); |
| | | SelectVisual(visuals?.LastOrDefault(), eVisualSource.Q3d); |
| | | }; |
| | | } |
| | | return _q3dCtrl; |
| | |
| | | var q3dCtrl = GetQ3dCtrl(); |
| | | this.tabPageQ3d.Controls.Clear(); |
| | | this.tabPageQ3d.Controls.Add(q3dCtrl); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 属性控件 |
| | | |
| | | //属性控件 |
| | | private XhsProjectSimulationPropertyCtrl _propertyCtrl = null; |
| | | |
| | | //获取属性控件 |
| | | private XhsProjectSimulationPropertyCtrl GetPropertyCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_propertyCtrl == null) |
| | | { |
| | | _propertyCtrl = new XhsProjectSimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Property); |
| | | }; |
| | | _propertyCtrl.BlinkLinkNodeEvent += async (link, linkNodeCode) => |
| | | { //强调连接节点 |
| | | if (link == null) |
| | | { |
| | | return; |
| | | } |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var linkNode = visualListHelper.GetVisual(linkNodeCode); |
| | | if (linkNode == null) |
| | | { |
| | | return; |
| | | } |
| | | var blinkCodes = new List<string>(); |
| | | if (linkNode.GetType() == typeof(HydroJunctionInfo)) |
| | | { |
| | | var allLinkList = visualListHelper.GetLinkList(); |
| | | if (allLinkList == null || allLinkList.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != linkNodeCode).ToList(); |
| | | if (linkList == null || linkList.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | blinkCodes.AddRange(linkList.Select(x => x.Code)); |
| | | } |
| | | else |
| | | { |
| | | blinkCodes.Add(linkNodeCode); |
| | | } |
| | | |
| | | await _bimfaceCtrl?.ClearBlinkComponents(); |
| | | await _bimfaceCtrl?.SetBlinkComponents(blinkCodes); |
| | | await Task.Delay(5000); |
| | | await _bimfaceCtrl?.ClearBlinkComponents(); |
| | | }; |
| | | _propertyCtrl.PropertyValueChangedEvent += async (visual) => |
| | | { |
| | | if (visual == null) |
| | | { |
| | | return; |
| | | } |
| | | UpdateVisualListCtrl(); |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(); |
| | | }; |
| | | _propertyCtrl.MarkPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //标注属性发生改变 |
| | | //判断当前是否有标注展示,若有则更新标注,最好是更新单个标注 |
| | | var markHelper = await GetMarkHelper(); |
| | | markHelper.Set(visual); |
| | | }; |
| | | _propertyCtrl.GradingPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //分级属性发生改变 |
| | | //判断当前是否有分级展示,若有则更新分级,最好是更新单个分级 |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(visual); |
| | | }; |
| | | _propertyCtrl.FlowEffectPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //流向属性发生改变 |
| | | //判断流向是否加载,如果加载则更新流向,最好是更新单个流向 |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Set(visual); |
| | | }; |
| | | |
| | | } |
| | | return _propertyCtrl; |
| | | } |
| | | |
| | | //属性控件是否可见 |
| | | private bool IsPropertyCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlRight.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerRight.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerRight.Controls[0] is XhsProjectSimulationPropertyCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示属性控件 |
| | | private void ShowPropertyCtrl() |
| | | { |
| | | if (IsPropertyCtrlVisible) |
| | | { |
| | | return; |
| | | } |
| | | 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 SetPropertyCtrl(HydroVisualInfo visual) |
| | | { |
| | | ShowPropertyCtrl(); |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | var vm = visualVmListHelper.GetVisual(visual); |
| | | _propertyCtrl.SelectedObject = vm; |
| | | } |
| | | |
| | | //更新属性控件 |
| | | private void UpdatePropertyCtrl() |
| | | { |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | //清理属性控件 |
| | | private void ClearPropertyCtrl() |
| | | { |
| | | if (_propertyCtrl != null) |
| | | { |
| | | _propertyCtrl.SelectedObject = null; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 选择构件 |
| | | |
| | | //可见来源 |
| | | protected enum eVisualSource |
| | | { |
| | | None, |
| | | Bimface, |
| | | Q3d, |
| | | Property, |
| | | List, |
| | | Set, |
| | | Search, |
| | | Monitor, |
| | | Check, |
| | | Calcu, |
| | | Warning, |
| | | } |
| | | |
| | | //选择构件 |
| | | private Yw.Model.HydroVisualInfo _visual = null; |
| | | |
| | | //选择构件 |
| | | private void SelectVisual(HydroVisualInfo visual, eVisualSource source) |
| | | { |
| | | _visual = visual; |
| | | switch (source) |
| | | { |
| | | case eVisualSource.None: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Bimface: |
| | | { |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Q3d: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Property: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | } |
| | | break; |
| | | case eVisualSource.List: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Set: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Search: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Monitor: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Check: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Calcu: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | case eVisualSource.Warning: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | default: break; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | |
| | | private SimulationVisualVmListHelper _visualVmListHelper = null; |
| | | |
| | | //获取可见视图列表辅助类 |
| | | private async Task<SimulationVisualVmListHelper> GetVisualVmListHelper() |
| | | private SimulationVisualVmListHelper GetVisualVmListHelper() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | if (_visualVmListHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | _visualVmListHelper = new SimulationVisualVmListHelper(visualListHelper); |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | var calcuResult = await workingTupleHelper.GetCalcuResult(_working); |
| | | _visualVmListHelper.InitialData(_hydroInfo, calcuResult); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | _visualVmListHelper = new SimulationVisualVmListHelper(visualListHelper, calcuResultHelper); |
| | | } |
| | | return _visualVmListHelper; |
| | | } |
| | |
| | | _visualListCtrl.Dock = DockStyle.Fill; |
| | | _visualListCtrl.HydroClickInfoEvent += (visual) => |
| | | { |
| | | |
| | | SelectVisual(visual, eVisualSource.List); |
| | | }; |
| | | _visualListCtrl.HydroChangedInfoEvent += (visualList) => |
| | | { |
| | | |
| | | SelectVisual(_visual, eVisualSource.List); |
| | | }; |
| | | } |
| | | return _visualListCtrl; |
| | |
| | | } |
| | | |
| | | //显示构件明细控件 |
| | | private async void ShowVisualListCtrl() |
| | | private void ShowVisualListCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | this.docPnlBottom.Text = "构件明细"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var visualVmListHelper = await GetVisualVmListHelper(); |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | var allVisualVmList = visualVmListHelper.GetVisualList(); |
| | | visualListCtrl.SetBindingData(allVisualVmList); |
| | | var calcuResult = await GetCalcuResult(); |
| | | var calcuResult = GetCalcuResult(); |
| | | if (calcuResult != null && calcuResult.Succeed) |
| | | { |
| | | visualListCtrl.SetCalcuView(); |
| | |
| | | return; |
| | | } |
| | | _visualListCtrl?.UpdateBindingData(); |
| | | var calcuResult = GetCalcuResult(); |
| | | if (calcuResult != null && calcuResult.Succeed) |
| | | { |
| | | _visualListCtrl.SetCalcuView(); |
| | | } |
| | | else |
| | | { |
| | | _visualListCtrl.SetNormalView(); |
| | | } |
| | | } |
| | | |
| | | //构件明细 |
| | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 选择构件 |
| | | |
| | | //可见来源 |
| | | protected enum eVisualSource |
| | | { |
| | | None, |
| | | Bimface, |
| | | Q3d, |
| | | Check, |
| | | Property, |
| | | Calcu, |
| | | Monitor, |
| | | Warning, |
| | | Search, |
| | | } |
| | | |
| | | //选择构件 |
| | | private Yw.Model.HydroVisualInfo _visual = null; |
| | | |
| | | //选择构件 |
| | | private void SelectVisual(HydroVisualInfo visual, eVisualSource source) |
| | | { |
| | | if (visual == null) |
| | | { |
| | | switch (source) |
| | | { |
| | | case eVisualSource.None: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(null); |
| | | this.barBtnSetMonitor.Enabled = false; |
| | | ClearPropertyCtrl(); |
| | | } |
| | | break; |
| | | case eVisualSource.Bimface: |
| | | { |
| | | this.barBtnSetMonitor.Enabled = false; |
| | | ClearPropertyCtrl(); |
| | | } |
| | | break; |
| | | case eVisualSource.Check: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(null); |
| | | this.barBtnSetMonitor.Enabled = false; |
| | | ClearPropertyCtrl(); |
| | | } |
| | | break; |
| | | case eVisualSource.Property: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(null); |
| | | this.barBtnSetMonitor.Enabled = false; |
| | | } |
| | | break; |
| | | case eVisualSource.Calcu: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(null); |
| | | this.barBtnSetMonitor.Enabled = false; |
| | | ClearPropertyCtrl(); |
| | | } |
| | | break; |
| | | default: break; |
| | | } |
| | | _visual = null; |
| | | return; |
| | | } |
| | | if (_visual == null) |
| | | { |
| | | |
| | | _visual = visual; |
| | | return; |
| | | } |
| | | if (_visual.Code == visual.Code) |
| | | { |
| | | UpdatePropertyCtrl(); |
| | | return; |
| | | } |
| | | _visual = visual; |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual.Code); |
| | | this.barBtnSetMonitor.Enabled = true; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 属性控件 |
| | | |
| | | //属性控件 |
| | | private XhsProjectSimulationPropertyCtrl _propertyCtrl = null; |
| | | |
| | | //获取属性控件 |
| | | private XhsProjectSimulationPropertyCtrl GetPropertyCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_propertyCtrl == null) |
| | | { |
| | | _propertyCtrl = new XhsProjectSimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | if (visual == null) |
| | | { |
| | | return; |
| | | } |
| | | _bimfaceCtrl?.ZoomToComponent(visual.Code); |
| | | }; |
| | | _propertyCtrl.BlinkLinkNodeEvent += async (link, linkNodeCode) => |
| | | { //强调连接节点 |
| | | if (link == null) |
| | | { |
| | | return; |
| | | } |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var linkNode = visualListHelper.GetVisual(linkNodeCode); |
| | | if (linkNode == null) |
| | | { |
| | | return; |
| | | } |
| | | var blinkCodes = new List<string>(); |
| | | if (linkNode.GetType() == typeof(HydroJunctionInfo)) |
| | | { |
| | | var allLinkList = visualListHelper.GetLinkList(); |
| | | if (allLinkList == null || allLinkList.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != linkNodeCode).ToList(); |
| | | if (linkList == null || linkList.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | blinkCodes.AddRange(linkList.Select(x => x.Code)); |
| | | } |
| | | else |
| | | { |
| | | blinkCodes.Add(linkNodeCode); |
| | | } |
| | | |
| | | await _bimfaceCtrl?.ClearBlinkComponents(); |
| | | await _bimfaceCtrl?.SetBlinkComponents(blinkCodes); |
| | | await Task.Delay(5000); |
| | | await _bimfaceCtrl?.ClearBlinkComponents(); |
| | | }; |
| | | _propertyCtrl.PropertyValueChangedEvent += (visual) => |
| | | { |
| | | if (visual == null) |
| | | { |
| | | return; |
| | | } |
| | | UpdateVisualListCtrl(); |
| | | //ApplyGradingResultList(visual); |
| | | }; |
| | | _propertyCtrl.MarkPropertyValueChangedEvent += (visual) => |
| | | { |
| | | //标注属性发生改变 |
| | | //判断当前是否有标注展示,若有则更新标注,最好是更新单个标注 |
| | | }; |
| | | _propertyCtrl.GradingPropertyValueChangedEvent += (parter) => |
| | | { |
| | | //分级属性发生改变 |
| | | //判断当前是否有分级展示,若有则更新分级,最好是更新单个分级 |
| | | }; |
| | | _propertyCtrl.FlowEffectPropertyValueChangedEvent += (visual) => |
| | | { |
| | | //流向属性发生改变 |
| | | //判断流向是否加载,如果加载则更新流向,最好是更新单个流向 |
| | | }; |
| | | |
| | | } |
| | | return _propertyCtrl; |
| | | } |
| | | |
| | | //属性控件是否可见 |
| | | private bool IsPropertyCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlRight.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerRight.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerRight.Controls[0] is XhsProjectSimulationPropertyCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示属性控件 |
| | | private void ShowPropertyCtrl() |
| | | { |
| | | if (IsPropertyCtrlVisible) |
| | | { |
| | | return; |
| | | } |
| | | 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 SetPropertyCtrl(HydroVisualInfo visual) |
| | | { |
| | | ShowPropertyCtrl(); |
| | | // var vm = GetVisualViewModel(visual); |
| | | // _propertyCtrl.SelectedObject = vm; |
| | | } |
| | | |
| | | //更新属性控件 |
| | | private void UpdatePropertyCtrl() |
| | | { |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | //清理属性控件 |
| | | private void ClearPropertyCtrl() |
| | | { |
| | | if (_propertyCtrl != null) |
| | | { |
| | | _propertyCtrl.SelectedObject = null; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #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.GetAllVisuals(); |
| | | _visual = allParterList?.Find(x => x.Code == code); |
| | | var elementIds = new List<string>(); |
| | | if (_visual != null) |
| | | { |
| | | elementIds.Add(_visual.Code); |
| | | } |
| | | await _bimfaceCtrl?.ZoomAndSelectComponents(elementIds); |
| | | //ShowSelectedProperty(); |
| | | }; |
| | | _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) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | var matchingListCtrl = GetMatchingListCtrl(); |
| | | var input = AssetsMatchingParasHelper.Create(_hydroInfo, null); |
| | | matchingListCtrl.SetBindingData(input); |
| | | this.controlContainerBottom.Controls.Add(matchingListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "匹配列表"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | #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.GetAllVisuals(); |
| | | _visual = allParterList?.Find(x => x.Code == parter.Code); |
| | | var elementIds = new List<string>() { parter.Code }; |
| | | await _bimfaceCtrl?.ZoomAndSelectComponents(elementIds); |
| | | //ShowSelectedProperty(); |
| | | }; |
| | | _unMatchingListCtrl.ViewModelEvent += async (parters) =>//查看模型 |
| | | { |
| | | var codes = parters?.Select(x => x.Code).Distinct().ToList(); |
| | | await _bimfaceCtrl?.ZoomAndSelectComponents(codes); |
| | | _visual = null; |
| | | //ShowSelectedProperty(); |
| | | }; |
| | | } |
| | | return _unMatchingListCtrl; |
| | | } |
| | | |
| | | private XhsProjectSimulationUnMatchingListCtrl _unMatchingListCtrl = null;//未匹配列表 |
| | | |
| | | //未匹配列表 |
| | | private void barBtnUnMatchingList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | 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; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | //水库 |
| | | this.barBtnSetReservoirList.ItemClick += delegate |
| | | { |
| | | //var dlg = new HydroReservoirBulkSetListDlg(); |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroReservoirListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水池 |
| | | this.barBtnSetTankList.ItemClick += delegate |
| | | { |
| | | //var dlg = new HydroTankBulkSetListDlg(); |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroTankListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水箱 |
| | | this.barBtnSetWaterboxList.ItemClick += delegate |
| | | { |
| | | //if (_hydroInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var dlg = new SetHydroWaterboxListDlg(); |
| | | //dlg.SetBindingData(_hydroInfo); |
| | | //dlg.HydroClickEvent += async (obj) => |
| | | //{ |
| | | // if (obj == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // _selectedParter = obj; |
| | | // await _bimfaceCtrl?.ZoomAndSelectComponent(obj.Code); |
| | | // ShowProperty(); |
| | | //}; |
| | | //dlg.HydroChangedEvent += (obj) => |
| | | //{ |
| | | |
| | | //}; |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroWaterboxListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //连接节点 |
| | | this.barBtnSetJunctionList.ItemClick += delegate |
| | | { |
| | | //var dlg = new HydroJunctionBulkSetListDlg(); |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroJunctionListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //闷头 |
| | | this.barBtnSetBluntheadList.ItemClick += delegate |
| | | { |
| | | //if (_hydroInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var dlg = new SetHydroBluntheadListDlg(); |
| | | //dlg.SetBindingData(_hydroInfo); |
| | | //dlg.HydroClickEvent += async (obj) => |
| | | //{ |
| | | // if (obj == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // _selectedParter = obj; |
| | | // await _bimfaceCtrl?.ZoomAndSelectComponent(obj.Code); |
| | | // ShowProperty(); |
| | | //}; |
| | | //dlg.HydroChangedEvent += (obj) => |
| | | //{ |
| | | |
| | | //}; |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroBluntheadListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //弯头 |
| | | this.barBtnSetElbowsList.ItemClick += delegate |
| | | { |
| | | //if (_hydroInfo == null) |
| | | //{ |
| | | // return; |
| | | //} |
| | | //var dlg = new SetHydroElbowListDlg(); |
| | | //dlg.SetBindingData(_hydroInfo); |
| | | //dlg.HydroClickEvent += async (obj) => |
| | | //{ |
| | | // if (obj == null) |
| | | // { |
| | | // return; |
| | | // } |
| | | // _selectedParter = obj; |
| | | // await _bimfaceCtrl?.ZoomAndSelectComponent(obj.Code); |
| | | // ShowProperty(); |
| | | //}; |
| | | //dlg.HydroChangedEvent += (obj) => |
| | | //{ |
| | | |
| | | //}; |
| | | //dlg.ShowDialog(); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroElbowListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //三通 |
| | | this.barBtnSetThreelinkList.ItemClick += delegate |
| | |
| | | } |
| | | var dlg = new SetHydroThreelinkListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //四通 |
| | |
| | | } |
| | | var dlg = new SetHydroFourlinkListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水表 |
| | |
| | | } |
| | | var dlg = new SetHydroMeterListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //流量计 |
| | |
| | | } |
| | | var dlg = new SetHydroFlowmeterListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //压力表 |
| | |
| | | } |
| | | var dlg = new SetHydroPressmeterListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //管道 |
| | |
| | | } |
| | | var dlg = new SetHydroPipeListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //过渡件 |
| | | this.barBtnSetTranslationList.ItemClick += delegate |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroTranslationListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水泵 |
| | |
| | | } |
| | | var dlg = new SetHydroPumpListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //阀门 |
| | |
| | | } |
| | | var dlg = new SetHydroValveListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //换热器 |
| | | this.barBtnSetExchangerList.ItemClick += delegate |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroExchangerListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //换热器 |
| | | this.barBtnSetCompressorList.ItemClick += delegate |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroCompressorListDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eVisualSource.Set); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | } |
| | |
| | | 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.barBtnSetValveList.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; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | private HydroVisualSearchListCtrl _searchCtrl = null; |
| | | |
| | | //获取查询组件 |
| | | private async Task<HydroVisualSearchListCtrl> GetSearchCtrl() |
| | | private HydroVisualSearchListCtrl GetSearchCtrl() |
| | | { |
| | | if (_searchCtrl == null) |
| | | { |
| | | var visualVmListHelper = await GetVisualVmListHelper(); |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | var allVisualVmList = visualVmListHelper.GetVisualList(); |
| | | _searchCtrl = new HydroVisualSearchListCtrl(); |
| | | _searchCtrl.Dock = DockStyle.Fill; |
| | |
| | | } |
| | | |
| | | //显示查询控件 |
| | | private async void ShowSearchCtrl(string content) |
| | | private void ShowSearchCtrl(string content) |
| | | { |
| | | if (IsSearchCtrlVisible) |
| | | { |
| | | return; |
| | | } |
| | | var searchCtrl = await GetSearchCtrl(); |
| | | var searchCtrl = GetSearchCtrl(); |
| | | searchCtrl.SetBindingData(content); |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(searchCtrl); |
| | |
| | | if (_markHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _markHelper = new SimulationMarkHelper(visualListHelper, bimfaceCtrl); |
| | | _markHelper = new SimulationMarkHelper(visualListHelper, calcuResultHelper, bimfaceCtrl); |
| | | } |
| | | return _markHelper; |
| | | } |
| | |
| | | if (_gradingHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var calcuResultHelper = await GetCalcuResultHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _gradingHelper = new SimulationGradingHelper(visualListHelper, calcuResultHelper, bimfaceCtrl); |
| | | } |
| | |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _flowEffectHelper = new SimulationFlowEffectHelper(visualListHelper, bimfaceCtrl); |
| | | var calcuResult = await GetCalcuResult(); |
| | | var calcuResult = GetCalcuResult(); |
| | | _flowEffectHelper.InitialData(calcuResult); |
| | | } |
| | | return _flowEffectHelper; |
| | |
| | | } |
| | | if (_monitorHelper == null) |
| | | { |
| | | _monitorHelper = new SimulationMonitorHelper(_hydroInfo.ID); |
| | | var visualListHelper = GetVisualListHelper(); |
| | | _monitorHelper = new SimulationMonitorHelper(visualListHelper); |
| | | } |
| | | return _monitorHelper; |
| | | } |
| | |
| | | } |
| | | |
| | | //显示检查控件 |
| | | private async void ShowCheckCtrl() |
| | | private void ShowCheckCtrl() |
| | | { |
| | | var checkResult = await GetCheckResult(); |
| | | var checkResult = GetCheckResult(); |
| | | ShowCheckCtrl(checkResult); |
| | | } |
| | | |
| | |
| | | private SimulationCalcuResultHelper _calcuResultHelper = null; |
| | | |
| | | //获取计算结果辅助类 |
| | | private async Task<SimulationCalcuResultHelper> GetCalcuResultHelper() |
| | | private SimulationCalcuResultHelper GetCalcuResultHelper() |
| | | { |
| | | if (_calcuResultHelper == null) |
| | | { |
| | | _calcuResultHelper = new SimulationCalcuResultHelper(); |
| | | _calcuResultHelper.CalcuResult = await GetCalcuResult(); |
| | | var workingHelper = GetWorkingHelper(); |
| | | _calcuResultHelper = new SimulationCalcuResultHelper(workingHelper); |
| | | } |
| | | return _calcuResultHelper; |
| | | } |
| | |
| | | { |
| | | if (_calcuResultLabelHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var calcuResultHelper = await GetCalcuResultHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _calcuResultLabelHelper = new SimulationCalcuResultLabelHelper(visualListHelper, calcuResultHelper, bimfaceCtrl); |
| | | _calcuResultLabelHelper = new SimulationCalcuResultLabelHelper(calcuResultHelper, bimfaceCtrl); |
| | | } |
| | | return _calcuResultLabelHelper; |
| | | } |
| | |
| | | #region 管网修复 |
| | | |
| | | //修复管网 |
| | | private async void Repair() |
| | | private void Repair() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | count++; |
| | | } |
| | | } |
| | | var visualVmListHelper = await GetVisualVmListHelper(); |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateProperty(); |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | |
| | | |
| | | #endregion |
| | | |
| | | #region 并联计算 |
| | | #region 水泵列表 |
| | | |
| | | //并联分析 |
| | | private void ParallelAnalysis() |
| | | //性能曲线 |
| | | private void barBtnPumpCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new SimulationPumpFeatDlg(); |
| | | dlg.SetBindingData(_hydroInfo); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #region 并联模拟 |
| | | |
| | | //并联模拟 |
| | | private void PumpParallel() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //并联分析 |
| | | private void barBtnParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //并联模拟 |
| | | private void barBtnPumpParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ParallelAnalysis(); |
| | | var dlg = new SimulationPumpParallelDlg(); |
| | | dlg.ShowDialog(); |
| | | // PumpParallel(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况计算 |
| | | #endregion |
| | | |
| | | //工况元组辅助类 |
| | | private SimulationWorkingTupleHelper _workingTupleHelper = null; |
| | | #region 水力计算 |
| | | |
| | | //获取工况元组辅助类 |
| | | private SimulationWorkingTupleHelper GetWorkingTupleHelper() |
| | | { |
| | | if (_workingTupleHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | _workingTupleHelper = new SimulationWorkingTupleHelper(visualListHelper); |
| | | } |
| | | return _workingTupleHelper; |
| | | } |
| | | |
| | | //设置工况窗体 |
| | | private async void CalcuWorking() |
| | | //计算 |
| | | private async void Calcu() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | var allWorkingList = await workingTupleHelper.GetWorkingList(); |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allWorkingList = workingCheckedListHelper.GetWorkingList(); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.Get(); |
| | | var dlg = new SetHydroWorkingDlg(); |
| | |
| | | { |
| | | SelectVisual(visual, eVisualSource.Calcu); |
| | | }; |
| | | dlg.HydroCalcuEvent += async (working) => |
| | | dlg.HydroCalcuEvent += async (vm) => |
| | | { |
| | | var vmo = new HydroWorkingVmo(); |
| | | vmo.ModelID = _hydroInfo.ID; |
| | | vmo.Name = working.Name; |
| | | vmo.WorkingInfo = JsonHelper.Object2Json(working.WorkingInfo); |
| | | vmo.MonitorInfo = JsonHelper.Object2Json(working.MonitorInfo); |
| | | vmo.SortCode = allWorkingList.Count < 1 ? 1 : allWorkingList.Max(x => x.SortCode) + 1; |
| | | vmo.Description = working.Description; |
| | | vmo.ID = await BLLFactory<Yw.BLL.HydroWorking>.Instance.Insert(vmo); |
| | | if (vmo.ID < 1) |
| | | { |
| | | TipFormHelper.ShowError("创建工况失败,计算取消!"); |
| | | return; |
| | | } |
| | | allWorkingList.Add(vmo); |
| | | _hydroInfo.UpdateWorkingInfo(vm.WorkingInfo); |
| | | allMonitorValueList.UpdateMonitorValue(vm.MonitorInfo); |
| | | |
| | | _hydroInfo.UpdateWorkingInfo(working.WorkingInfo); |
| | | var hydroInfo = _hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | |
| | | var working = new HydroWorkingVmo(); |
| | | working.ModelID = vm.ModelID; |
| | | working.Name = vm.Name; |
| | | working.WorkingInfo = JsonHelper.Object2Json(vm.WorkingInfo); |
| | | working.MonitorInfo = JsonHelper.Object2Json(vm.MonitorInfo); |
| | | working.SortCode = vm.SortCode; |
| | | working.Description = vm.Description; |
| | | |
| | | var workingHelper = GetWorkingHelper(); |
| | | //校验 |
| | | var checkResult = _hydroInfo.Check(); |
| | | if (!checkResult.Succeed) |
| | | { |
| | | workingTupleHelper.AppendTuple(vmo, checkResult, null); |
| | | AppendWorking(vmo); |
| | | ShowCheckCtrl(checkResult); |
| | | TipFormHelper.ShowWarn("校验失败,请检查后重试"); |
| | | workingHelper.InitialData(hydroInfo, working, checkResult, null); |
| | | TipFormHelper.ShowError("校验失败,请检查后重试"); |
| | | return; |
| | | } |
| | | |
| | | WaitFormHelper.ShowWaitForm(this, "正在计算分析中,请稍候..."); |
| | | |
| | | |
| | | //await Task.Delay(5000); |
| | | //await Task.Delay(3000); |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss); |
| | | |
| | | |
| | | WaitFormHelper.HideWaitForm(); |
| | | workingHelper.InitialData(hydroInfo, working, checkResult, calcuResult); |
| | | if (calcuResult.Succeed) |
| | | { |
| | | workingTupleHelper.AppendTuple(vmo, checkResult, calcuResult); |
| | | AppendWorking(vmo); |
| | | var visualVmListHelper = await GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateProperty(); |
| | | visualVmListHelper.UpdateCalcuProperty(calcuResult); |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | | var calcuResultHelper = await GetCalcuResultHelper(); |
| | | calcuResultHelper.CalcuResult = calcuResult; |
| | | var calcuResultLabelHelper = await GetCalcuResultLabelHelper(); |
| | | calcuResultLabelHelper.Set(); |
| | | if (calcuResult.WainingList != null && calcuResult.WainingList.Count > 0) |
| | | { |
| | | ShowCalcuWarningCtrl(calcuResult); |
| | | } |
| | | this.barBtnAddWorking.Enabled = true; |
| | | TipFormHelper.ShowSucceed("计算成功!"); |
| | | var codes = _hydroInfo.Pumps.Select(x => x.Code).ToList(); |
| | | await _bimfaceCtrl?.ZoomAndSelectComponents(codes); |
| | | } |
| | | else |
| | | { |
| | | ShowCalcuFailedCtrl(calcuResult); |
| | | TipFormHelper.ShowError("计算失败!"); |
| | | } |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.InitialData(); |
| | | gradingHelper.Set(); |
| | | |
| | | #region 视图列表 |
| | | |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateCalcuProperty(calcuResult); |
| | | |
| | | #endregion |
| | | |
| | | #region 当前构件 |
| | | |
| | | SelectVisual(_visual, eVisualSource.Calcu); |
| | | |
| | | #endregion |
| | | |
| | | #region 构件明细 |
| | | |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | | |
| | | #endregion |
| | | |
| | | #region 计算标签 |
| | | |
| | | var calcuResultLabelHelper = await GetCalcuResultLabelHelper(); |
| | | calcuResultLabelHelper.Set(); |
| | | |
| | | #endregion |
| | | |
| | | }; |
| | | |
| | | dlg.ShowDialog(); |
| | | |
| | | } |
| | | |
| | | //工况计算 |
| | | private void barBtnWorkingCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //水力计算 |
| | | private void barBtnCalcu_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | CalcuWorking(); |
| | | Calcu(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 当前工况 |
| | | |
| | | //工况辅助类 |
| | | private SimulationWorkingHelper _workingHelper = null; |
| | | |
| | | //获取工况辅助类 |
| | | private SimulationWorkingHelper GetWorkingHelper() |
| | | { |
| | | if (_workingHelper == null) |
| | | { |
| | | _workingHelper = new SimulationWorkingHelper(); |
| | | } |
| | | return _workingHelper; |
| | | } |
| | | |
| | | //获取工况 |
| | | private HydroWorkingVmo GetWorking() |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | return workingHelper.Working; |
| | | } |
| | | |
| | | //获取检查结果 |
| | | private HydroCheckResult GetCheckResult() |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | return workingHelper.CheckResult; |
| | | } |
| | | |
| | | //获取计算结果 |
| | | private HydroCalcuResult GetCalcuResult() |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | return workingHelper.CalcuResult; |
| | | } |
| | | |
| | | //新增工况 |
| | | private void AddWorking() |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (workingHelper.Working == null) |
| | | { |
| | | TipFormHelper.ShowWarn("尚未计算,请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new AddHydroWorkingDlg(); |
| | | dlg.SetBindingData(workingHelper.Working); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | this.barBtnAddWorking.Enabled = false; |
| | | workingHelper.ResetWorking(rhs); |
| | | this.AppendWorkingEvent?.Invoke(rhs); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //增加工况 |
| | | private void barBtnAddWorking_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | AddWorking(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 选择工况 |
| | | |
| | | //工况选择列表辅助类 |
| | | private SimulationWorkingCheckedListHelper _workingCheckedListHelper = null; |
| | | |
| | | //获取工况元组辅助类 |
| | | private SimulationWorkingCheckedListHelper GetWorkingCheckedListHelper() |
| | | { |
| | | if (_workingCheckedListHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | _workingCheckedListHelper = new SimulationWorkingCheckedListHelper(visualListHelper); |
| | | _workingCheckedListHelper.InitialData(_allWorkingCheckedListDict); |
| | | } |
| | | return _workingCheckedListHelper; |
| | | } |
| | | |
| | | //更新工况选择列表 |
| | | public void UpdateWorkingCheckedList(HydroWorkingVmo working, bool hasChecked) |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | helper.Update(working, hasChecked); |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 工况分析 |
| | | |
| | | #region 当前工况 |
| | | |
| | | //当前工况 |
| | | private Yw.Vmo.HydroWorkingVmo _working = null; |
| | | |
| | | //获取检查结果 |
| | | private async Task<HydroCheckResult> GetCheckResult() |
| | | //精度评估 |
| | | private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | return await workingTupleHelper.GetCheckResult(_working); |
| | | } |
| | | |
| | | //获取计算结果 |
| | | private async Task<HydroCalcuResult> GetCalcuResult() |
| | | { |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | return await workingTupleHelper.GetCalcuResult(_working); |
| | | } |
| | | |
| | | //初始化工况列表 |
| | | private async void InitialWorkingList() |
| | | { |
| | | var workingTupleList = GetWorkingTupleHelper(); |
| | | var allWorkingList = await workingTupleList.GetWorkingList(); |
| | | this.repositoryItemImageComboBox1.Items.BeginUpdate(); |
| | | this.repositoryItemImageComboBox1.Items.Clear(); |
| | | if (allWorkingList != null && allWorkingList.Count > 0) |
| | | { |
| | | allWorkingList.ForEach(x => this.repositoryItemImageComboBox1.Items.Add(x.Name, x, -1)); |
| | | this.barEditCurrentWorking.EditValue = allWorkingList.Last(); |
| | | } |
| | | this.repositoryItemImageComboBox1.Items.EndUpdate(); |
| | | } |
| | | |
| | | //增加当前工况 |
| | | private void AppendWorking(HydroWorkingVmo working) |
| | | { |
| | | this.repositoryItemImageComboBox1.Items.BeginUpdate(); |
| | | this.repositoryItemImageComboBox1.Items.Add(working.Name, working, -1); |
| | | this.repositoryItemImageComboBox1.Items.EndUpdate(); |
| | | this.barEditCurrentWorking.EditValue = working; |
| | | } |
| | | |
| | | //设置当前工况 |
| | | private async void SetCurrentWorking(HydroWorkingVmo working) |
| | | { |
| | | _working = working; |
| | | this.barEditCurrentWorking.EditValue = working; |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | |
| | | } |
| | | |
| | | //当前工况发生改变 |
| | | private void barEditCurrentWorking_EditValueChanged(object sender, EventArgs e) |
| | | { |
| | | var working = this.barEditCurrentWorking.EditValue as HydroWorkingVmo; |
| | | SetCurrentWorking(working); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况控件 |
| | | |
| | | //工况控件 |
| | | private HydroWorkingTreeCtrl _workingCtrl = null; |
| | | |
| | | //获取工况控件 |
| | | private async Task<HydroWorkingTreeCtrl> GetWorkingCtrl() |
| | | { |
| | | if (_workingCtrl == null) |
| | | { |
| | | _workingCtrl = new HydroWorkingTreeCtrl(); |
| | | _workingCtrl.Dock = DockStyle.Fill; |
| | | _workingCtrl.FocusedChangedEvent += (vmo) => |
| | | { |
| | | |
| | | }; |
| | | _workingCtrl.HydroClickEvent += (working) => |
| | | { |
| | | SetCurrentWorking(working); |
| | | }; |
| | | } |
| | | return _workingCtrl; |
| | | } |
| | | |
| | | //工况控件是否可见 |
| | | private bool IsWorkingCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlRight.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerRight.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerRight.Controls[0] is HydroWorkingTreeCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示工况控件 |
| | | private async void ShowWorkingCtrl() |
| | | { |
| | | var workingCtrl = await GetWorkingCtrl(); |
| | | if (!IsWorkingCtrlVisible) |
| | | { |
| | | this.controlContainerRight.Controls.Clear(); |
| | | this.controlContainerRight.Controls.Add(workingCtrl); |
| | | this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlRight.Text = "工况"; |
| | | this.docPnlRight.Width = 300; |
| | | } |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | var allWorkingList = await workingTupleHelper.GetWorkingList(); |
| | | workingCtrl.SetBindingData(allWorkingList); |
| | | } |
| | | |
| | | //更新工况控件 |
| | | private async void UpdateWorkingCtrl() |
| | | { |
| | | if (!IsWorkingCtrlVisible) |
| | | { |
| | | return; |
| | | } |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | var allWorkingList = await workingTupleHelper.GetWorkingList(); |
| | | var workingCtrl = await GetWorkingCtrl(); |
| | | workingCtrl.SetBindingData(allWorkingList); |
| | | } |
| | | |
| | | //工况列表点击 |
| | | private void barBtnWorkingList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowWorkingCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况评估 |
| | | |
| | | //评估 |
| | | private async void Evaluate() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | if (_working == null) |
| | | { |
| | | TipFormHelper.ShowWarn("尚未计算,请计算后重试!"); |
| | | return; |
| | | } |
| | | var workingTupleHelper = GetWorkingTupleHelper(); |
| | | var checkResult = await workingTupleHelper.GetCheckResult(_working); |
| | | if (checkResult == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!checkResult.Succeed) |
| | | { |
| | | ShowCheckCtrl(checkResult); |
| | | TipFormHelper.ShowWarn("检查失败,停止评估!"); |
| | | return; |
| | | } |
| | | var calcuResult = await workingTupleHelper.GetCalcuResult(_working); |
| | | if (calcuResult == null) |
| | | { |
| | | return; |
| | | } |
| | | if (!calcuResult.Succeed) |
| | | { |
| | | ShowCalcuFailedCtrl(calcuResult); |
| | | TipFormHelper.ShowWarn("计算失败,停止评估!"); |
| | | return; |
| | | } |
| | | if (calcuResult.WainingList != null && calcuResult.WainingList.Count > 0) |
| | | { |
| | | ShowCalcuWarningCtrl(calcuResult); |
| | | TipFormHelper.ShowWarn("请关注警告信息!"); |
| | | } |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var allVisualDict = visualListHelper.GetVisualDict(); |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.Get(); |
| | | var allWorkingMonitorList = JsonHelper.Json2Object<List<HydroWorkingMonitorViewModel>>(_working.MonitorInfo); |
| | | var allCalcuResultDict = calcuResult.GetVisualDict(); |
| | | var dlg = new HydroWorkingEvaluationDlg(); |
| | | dlg.SetBindingData(allVisualDict, allMonitorList, allWorkingMonitorList, allCalcuResultDict); |
| | | dlg.ShowDialog(); |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingEvaluationDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingEvaluationDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //精度评估 |
| | | private void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | Evaluate(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况并联 |
| | | |
| | | //并联分析 |
| | | private async void barBtnAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //水泵分析 |
| | | private void barBtnPumpAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | return; |
| | | } |
| | | |
| | | var calcuResultHelper = await GetCalcuResultHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | var vmList = new List<XhsSinglePumpViewModel>(); |
| | | foreach (var pump in _hydroInfo.Pumps) |
| | | { |
| | |
| | | vm.CurveQE = qePtList; |
| | | vm.CurveQP = qpPtList; |
| | | |
| | | var calcuResultVisualDict = calcuResultHelper.GetVisualResultDict(); |
| | | var calcuResultVisualDict = calcuResultHelper.GetVisualDict(); |
| | | if (calcuResultVisualDict != null && calcuResultVisualDict.Count > 0) |
| | | { |
| | | //var calcuResult = allCalcuResultList.Find(x => x.Code == pump.Code) as HydroCalcuLinkResult; |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况能效 |
| | | |
| | | //能效分析 |
| | | private void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | XtraMessageBox.Show("正在开发中,敬请期待!"); |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new SimulationSingleWorkingEnergyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingEnergyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 损失曲线 |
| | | |
| | | //损失曲线 |
| | | private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | XtraMessageBox.Show("正在开发中,敬请期待!"); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingLossCurveDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossCurveDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 损失比例 |
| | | |
| | | private void barBtnWorkingLossScale_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //损失统计 |
| | | private void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | XtraMessageBox.Show("正在开发中,敬请期待!"); |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 综合分析 |
| | | private void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //综合分析 |
| | | private async void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | XtraMessageBox.Show("正在开发中,敬请期待!"); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.Get(); |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new SimulationSingleWorkingAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingAnalyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |