| | |
| | | using DevExpress.Diagram.Core.Native; |
| | | using DevExpress.Mvvm.Native; |
| | | using DevExpress.Utils.MVVM; |
| | | using DevExpress.XtraMap; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using DevExpress.Pdf.Native; |
| | | using Mapster; |
| | | using NPOI.OpenXmlFormats.Dml; |
| | | using NPOI.SS.Formula.Functions; |
| | | using System.Diagnostics; |
| | | using Yw.EPAnet; |
| | | using Yw.Epanet; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Q3d; |
| | | using Yw.WinFrmUI.Bimface; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | RegistBulkSetEvents(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> AppendWorkingEvent; |
| | | #region 模型事件 |
| | | |
| | | /// <summary> |
| | | /// 保存模型事件 |
| | | /// 获取模型事件 |
| | | /// </summary> |
| | | public event Func<Yw.Model.HydroModelInfo, Task<Yw.Model.HydroModelInfo>> SaveModelEvent; |
| | | public event Func<XhsSchemeVmo, Task<Yw.Model.HydroModelInfo>> GetModelEvent; |
| | | |
| | | /// <summary> |
| | | /// 刷新模型事件 |
| | | /// </summary> |
| | | public event Func<Task<Yw.Model.HydroModelInfo>> RefreshModelEvent; |
| | | |
| | | #endregion 模型事件 |
| | | |
| | | #region 方案事件 |
| | | |
| | | /// <summary> |
| | | /// 更新方案事件 |
| | |
| | | /// 移除方案事件 |
| | | /// </summary> |
| | | public event Action<XhsSchemeVmo> RemoveSchemeEvent; |
| | | |
| | | #endregion 方案事件 |
| | | |
| | | #region 工况事件 |
| | | |
| | | /// <summary> |
| | | /// 新增工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> AppendWorkingEvent; |
| | | |
| | | /// <summary> |
| | | /// 更新工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> UpdateWorkingEvent; |
| | | |
| | | /// <summary> |
| | | /// 移除工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> RemoveWorkingEvent; |
| | | |
| | | /// <summary> |
| | | /// 重载工况事件 |
| | | /// </summary> |
| | | public event Action<Dictionary<HydroWorkingVmo, bool>> ReloadWorkingEvent; |
| | | |
| | | #endregion 工况事件 |
| | | |
| | | private HStation.Vmo.XhsProjectVmo _project = null;//项目 |
| | | private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站 |
| | |
| | | { |
| | | base.InitialDataSource(); |
| | | ShowBimfaceCtrl(); |
| | | ShowQ3dCtrl(); |
| | | ShowL3d2Ctrl(); |
| | | ShowPropertyCtrl(); |
| | | InitialSvgImages(); |
| | | } |
| | | |
| | | //初始化Svg图片 |
| | | private void InitialSvgImages() |
| | | { |
| | | //监测 |
| | | this.barBtnSetMonitorList.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Docking; |
| | | |
| | | //水库 |
| | | this.barBtnSetReservoirList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Tank; |
| | | this.barBtnSetReservoirList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetReservoirList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetReservoirList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //水池 |
| | | this.barBtnSetTankList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Tank; |
| | | this.barBtnSetTankList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetTankList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetTankList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //水箱 |
| | | this.barBtnSetWaterboxList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Tank; |
| | | this.barBtnSetWaterboxList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetWaterboxList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetWaterboxList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //连接节点 |
| | | this.barBtnSetJunctionList.ImageOptions.SvgImage = HydroMainSvgImageHelper.Junction; |
| | | this.barBtnSetJunctionList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetJunctionList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetJunctionList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //闷头 |
| | | this.barBtnSetBluntheadList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Blunthead; |
| | | this.barBtnSetBluntheadList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetBluntheadList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetBluntheadList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //弯头 |
| | | this.barBtnSetElbowsList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Elbow; |
| | | this.barBtnSetElbowsList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetElbowsList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetElbowsList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //三通 |
| | | this.barBtnSetThreelinkList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Threelink; |
| | | this.barBtnSetThreelinkList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetThreelinkList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetThreelinkList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //四通 |
| | | this.barBtnSetFourlinkList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Fourlink; |
| | | this.barBtnSetFourlinkList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetFourlinkList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetFourlinkList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //消火栓 |
| | | this.barBtnSetHydrantList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Hydrant; |
| | | this.barBtnSetHydrantList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetHydrantList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetHydrantList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //喷头 |
| | | this.barBtnSetNozzleList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Nozzle; |
| | | this.barBtnSetNozzleList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetNozzleList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetNozzleList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //冷却塔 |
| | | this.barBtnSetCoolingList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Cooling; |
| | | this.barBtnSetCoolingList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetCoolingList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetCoolingList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //水表 |
| | | this.barBtnSetMeterList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Meter; |
| | | this.barBtnSetMeterList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetMeterList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetMeterList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //流量计 |
| | | this.barBtnSetFlowmeterList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Flowmeter; |
| | | this.barBtnSetFlowmeterList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetFlowmeterList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetFlowmeterList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //压力表 |
| | | this.barBtnSetPressmeterList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Pressmeter; |
| | | this.barBtnSetPressmeterList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetMeterList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetMeterList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //管道 |
| | | this.barBtnSetPipeList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Pipe; |
| | | this.barBtnSetPipeList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetPipeList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetPipeList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //过渡件 |
| | | this.barBtnSetTranslationList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Translation; |
| | | this.barBtnSetTranslationList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetTranslationList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetTranslationList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //水泵 |
| | | this.barBtnSetPumpList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Pump; |
| | | this.barBtnSetPumpList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetPumpList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetPumpList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //阀门 |
| | | this.barBtnSetValveList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Valve; |
| | | this.barBtnSetValveList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetValveList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetValveList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //换热器 |
| | | this.barBtnSetExchangerList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Exchanger; |
| | | this.barBtnSetExchangerList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetExchangerList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetExchangerList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | |
| | | //压缩机 |
| | | this.barBtnSetCompressorList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Compressor; |
| | | this.barBtnSetCompressorList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetCompressorList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetCompressorList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | } |
| | | |
| | | #region 属性状态 |
| | | |
| | | //属性状态辅助类 |
| | | private HydroPropStatusHelper _propStatusHelper = null; |
| | | |
| | | //获取属性状态辅助类 |
| | | private async Task<HydroPropStatusHelper> GetPropStatusHelper() |
| | | { |
| | | if (_propStatusHelper == null) |
| | | { |
| | | var allPropStatusList = await BLLFactory<Yw.BLL.HydroParterPropStatusInfo>.Instance.GetByModelID(_hydroInfo.ID); |
| | | _propStatusHelper = new HydroPropStatusHelper(_hydroInfo, allPropStatusList); |
| | | } |
| | | return _propStatusHelper; |
| | | } |
| | | |
| | | //获取属性状态Db列表 |
| | | private async Task<List<HydroParterPropStatusInfo>> GetPropStatusDbList() |
| | | { |
| | | var helper = await GetPropStatusHelper(); |
| | | return helper.GetPropStatusDbList(); |
| | | } |
| | | |
| | | #endregion 属性状态 |
| | | |
| | | #region 更改状态 |
| | | |
| | | //改变辅助类 |
| | | private HydroChangeHelper _changeHelper = null; |
| | | |
| | | //获取改变辅助类 |
| | | private HydroChangeHelper GetChangeHelper() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_changeHelper == null) |
| | | { |
| | | _changeHelper = new HydroChangeHelper(_hydroInfo); |
| | | } |
| | | return _changeHelper; |
| | | } |
| | | |
| | | //附加改变构件 |
| | | private void AppendChangeParter(HydroParterInfo parter, eChangeType changeType) |
| | | { |
| | | var helper = GetChangeHelper(); |
| | | helper.Append(parter, changeType); |
| | | } |
| | | |
| | | //获取增加构件列表 |
| | | private List<HydroParterInfo> GetAddParterList() |
| | | { |
| | | var helper = GetChangeHelper(); |
| | | return helper.GetAddParterList(); |
| | | } |
| | | |
| | | //获取更新构件列表 |
| | | private List<HydroParterInfo> GetUpdateParterList() |
| | | { |
| | | var helper = GetChangeHelper(); |
| | | return helper.GetUpdateParterList(); |
| | | } |
| | | |
| | | //获取移除构件列表 |
| | | private List<string> GetRemoveParters() |
| | | { |
| | | var helper = GetChangeHelper(); |
| | | return helper.GetRemoveParters(); |
| | | } |
| | | |
| | | #endregion 更改状态 |
| | | |
| | | #region BIM控件 |
| | | |
| | |
| | | } |
| | | if (_bimfaceCtrl == null) |
| | | { |
| | | var overlay = this.ShowOverlay(); |
| | | _bimfaceCtrl = new SimulationBimfaceCtrl(); |
| | | _bimfaceCtrl.Dock = DockStyle.Fill; |
| | | WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载模型,请稍后..."); |
| | | await _bimfaceCtrl.InitialData(_project, _projectSite); |
| | | _bimfaceCtrl.LoadCompletedEvent += () => |
| | | {//view加载完成事件 |
| | | overlay.Close(); |
| | | WaitFormHelper.HideWaitForm(); |
| | | this.barCkDecorator.Checked = false; |
| | | this.barCkGrading.Checked = true; |
| | | }; |
| | |
| | | |
| | | #endregion BIM控件 |
| | | |
| | | #region Q3d控件 |
| | | #region L3d2控件 |
| | | |
| | | //Q3d 控件 |
| | | private XhsProjectSimulationQ3dCtrl _q3dCtrl = null; |
| | | //L3d2控件 |
| | | private XhsProjectSimulationL3d2Ctrl _l3d2ctrl = null; |
| | | |
| | | //获取 Q3d 控件 |
| | | private XhsProjectSimulationQ3dCtrl GetQ3dCtrl() |
| | | //获取L3d2控件 |
| | | private XhsProjectSimulationL3d2Ctrl GetL3d2Ctrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_q3dCtrl == null) |
| | | if (_l3d2ctrl == null) |
| | | { |
| | | _q3dCtrl = new XhsProjectSimulationQ3dCtrl(); |
| | | _q3dCtrl.Dock = DockStyle.Fill; |
| | | _q3dCtrl.InitialData(() => _hydroInfo); |
| | | _q3dCtrl.SelectedPartersChangedEvent += (codes) => |
| | | _l3d2ctrl = new XhsProjectSimulationL3d2Ctrl(); |
| | | _l3d2ctrl.Dock = DockStyle.Fill; |
| | | _l3d2ctrl.InitialData(hydroInfoFunc: () => _hydroInfo); |
| | | _l3d2ctrl.SelectedPartersChangedEvent += (codes) => |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var visuals = visualListHelper.GetVisualList(codes); |
| | | SelectVisual(visuals?.LastOrDefault(), eSimulationVisualSource.Q3d); |
| | | }; |
| | | } |
| | | return _q3dCtrl; |
| | | return _l3d2ctrl; |
| | | } |
| | | |
| | | //显示 Q3d 控件 |
| | | private void ShowQ3dCtrl() |
| | | //显示L3d2控件 |
| | | private void ShowL3d2Ctrl() |
| | | { |
| | | var q3dCtrl = GetQ3dCtrl(); |
| | | var l3d2Ctrl = GetL3d2Ctrl(); |
| | | this.tabPageQ3d.Controls.Clear(); |
| | | this.tabPageQ3d.Controls.Add(q3dCtrl); |
| | | this.tabPageQ3d.Controls.Add(l3d2Ctrl); |
| | | } |
| | | |
| | | #endregion Q3d控件 |
| | | #endregion |
| | | |
| | | #region 属性控件 |
| | | |
| | |
| | | private SimulationPropertyCtrl _propertyCtrl = null; |
| | | |
| | | //获取属性控件 |
| | | private SimulationPropertyCtrl GetPropertyCtrl() |
| | | private async Task<SimulationPropertyCtrl> GetPropertyCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | } |
| | | if (_propertyCtrl == null) |
| | | { |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | _propertyCtrl = new SimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.AllowEdit = true; |
| | | _propertyCtrl.InitialData(changeHelper, propStatusHelper); |
| | | _propertyCtrl.CalcuResult = () => GetCalcuResult(); |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Property); |
| | |
| | | { |
| | | return; |
| | | } |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != linkNodeCode).ToList(); |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != link.Code).ToList(); |
| | | if (linkList == null || linkList.Count < 1) |
| | | { |
| | | return; |
| | |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(visual); |
| | | }; |
| | | _propertyCtrl.FlowEffectPropertyValueChangedEvent += async (visual) => |
| | | _propertyCtrl.FlowDirectionPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //流向属性发生改变 |
| | | //判断流向是否加载,如果加载则更新流向,最好是更新单个流向 |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Set(visual); |
| | | //判断当前是否有流向展示,若有则更新流向,最好是更新单个流向 |
| | | var flowDirectionHelper = await GetFlowEffectHelper(); |
| | | flowDirectionHelper.Set(visual); |
| | | }; |
| | | } |
| | | return _propertyCtrl; |
| | |
| | | } |
| | | |
| | | //显示属性控件 |
| | | private void ShowPropertyCtrl() |
| | | private async Task ShowPropertyCtrl() |
| | | { |
| | | if (IsPropertyCtrlVisible) |
| | | { |
| | | return; |
| | | } |
| | | var propertyCtrl = GetPropertyCtrl(); |
| | | var propertyCtrl = await GetPropertyCtrl(); |
| | | this.controlContainerRight.Controls.Clear(); |
| | | this.controlContainerRight.Controls.Add(propertyCtrl); |
| | | this.docPnlRight.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | |
| | | } |
| | | |
| | | //设置属性控件 |
| | | private void SetPropertyCtrl(HydroVisualInfo visual) |
| | | private async void SetPropertyCtrl(HydroVisualInfo visual) |
| | | { |
| | | ShowPropertyCtrl(); |
| | | await ShowPropertyCtrl(); |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | var vm = visualVmListHelper.GetVisual(visual); |
| | | _propertyCtrl.SelectedObject = vm; |
| | |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | #endregion 属性控件 |
| | | #endregion |
| | | |
| | | #region 选择构件 |
| | | |
| | |
| | | case eSimulationVisualSource.None: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Bimface: |
| | | { |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Q3d: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Property: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.List: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Set: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Search: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Monitor: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Check: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Calcu: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Warning: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | } |
| | | |
| | | //显示构件明细控件 |
| | | private void ShowVisualListCtrl() |
| | | private async void ShowVisualListCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var allVisualVmList = visualVmListHelper.GetVisualList(); |
| | | visualListCtrl.SetBindingData(allVisualVmList); |
| | | visualListCtrl.SetBindingData(allVisualVmList, changeHelper, propStatusHelper); |
| | | var calcuResult = GetCalcuResult(); |
| | | if (calcuResult != null && calcuResult.Succeed) |
| | | { |
| | |
| | | |
| | | #region 一键显隐 |
| | | |
| | | private List<string> _allDecoratorCodes = null; |
| | | |
| | | //获取装饰件code列表 |
| | | private async Task<List<string>> GetDecoratorCodes() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_allDecoratorCodes == null) |
| | | { |
| | | _allDecoratorCodes = await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.GetCodeListByModelID(_hydroInfo.ID, null); |
| | | } |
| | | if (_allDecoratorCodes == null) |
| | | { |
| | | _allDecoratorCodes = new List<string>(); |
| | | } |
| | | return _allDecoratorCodes; |
| | | } |
| | | |
| | | //设置装饰件可见性 |
| | | private async void SetDecoratorVisible(bool isDecoratorVisible) |
| | | { |
| | | var codes = _hydroInfo.Decorators?.Select(x => x.Code).Distinct().ToList(); |
| | | var codes = await GetDecoratorCodes(); |
| | | if (isDecoratorVisible) |
| | | { |
| | | await _bimfaceCtrl?.ShowComponents(codes); |
| | |
| | | |
| | | #endregion 一键显隐 |
| | | |
| | | |
| | | |
| | | #region 保存信息 |
| | | |
| | | //保存锁定对象 |
| | | private object _locker_save = new(); |
| | | |
| | | private bool _isSaving = false;//正在保存 |
| | | |
| | | //保存 |
| | | private async void barBtnSave_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | |
| | | { |
| | | return; |
| | | } |
| | | if (this.SaveModelEvent == null) |
| | | { |
| | | return; |
| | | } |
| | | var hydroInfo = await this.SaveModelEvent.Invoke(_hydroInfo); |
| | | if (hydroInfo == null) |
| | | { |
| | | TipFormHelper.ShowError("保存失败!"); |
| | | return; |
| | | } |
| | | _hydroInfo = hydroInfo; |
| | | |
| | | lock (_locker_save) |
| | | { |
| | | if (_isSaving) |
| | | { |
| | | this.FindForm().ShowAlertInfo("保存", "正在保存,请稍后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | _isSaving = true; |
| | | |
| | | var changeHelper = GetChangeHelper(); |
| | | |
| | | var addParterList = changeHelper.GetAddParterList(); |
| | | var updateParterList = changeHelper.GetUpdateParterList(); |
| | | var removeParters = changeHelper.GetRemoveParters(); |
| | | |
| | | if (addParterList == null || addParterList.Count < 1) |
| | | { |
| | | if (updateParterList == null || updateParterList.Count < 1) |
| | | { |
| | | if (removeParters == null || removeParters.Count < 1) |
| | | { |
| | | TipFormHelper.ShowWarn("未检测到修改,无需保存!"); |
| | | _isSaving = false; |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | WaitFormHelper.ShowWaitForm("正在保存,请稍后..."); |
| | | |
| | | bool bol = false; |
| | | |
| | | try |
| | | { |
| | | bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance |
| | | .Update(_hydroInfo, addParterList, updateParterList, removeParters); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | XtraMessageBox.Show(ex.Message); |
| | | _isSaving = false; |
| | | } |
| | | |
| | | if (!bol) |
| | | { |
| | | WaitFormHelper.HideWaitForm(); |
| | | TipFormHelper.ShowError("水力信息更新失败!"); |
| | | _isSaving = false; |
| | | return; |
| | | } |
| | | changeHelper.Reset(); |
| | | |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var updatePropStatusList = propStatusHelper.GetUpdatePropStatusDbList(); |
| | | if (updatePropStatusList != null && updatePropStatusList.Count > 0) |
| | | { |
| | | bol = await BLLFactory<Yw.BLL.HydroParterPropStatusInfo>.Instance.Update(_hydroInfo.ID, updatePropStatusList); |
| | | if (!bol) |
| | | { |
| | | WaitFormHelper.HideWaitForm(); |
| | | TipFormHelper.ShowWarn("属性状态更新失败!"); |
| | | _isSaving = false; |
| | | return; |
| | | } |
| | | } |
| | | propStatusHelper.Reset(); |
| | | |
| | | WaitFormHelper.HideWaitForm(); |
| | | TipFormHelper.ShowSucceed("保存成功!"); |
| | | _isSaving = false; |
| | | |
| | | //Stopwatch sw = new Stopwatch(); |
| | | //sw.Start(); |
| | |
| | | private void RegistBulkSetEvents() |
| | | { |
| | | //水库 |
| | | this.barBtnSetReservoirList.ItemClick += delegate |
| | | this.barBtnSetReservoirList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroReservoirListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水池 |
| | | this.barBtnSetTankList.ItemClick += delegate |
| | | this.barBtnSetTankList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroTankListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水箱 |
| | | this.barBtnSetWaterboxList.ItemClick += delegate |
| | | this.barBtnSetWaterboxList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroWaterboxListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //连接节点 |
| | | this.barBtnSetJunctionList.ItemClick += delegate |
| | | this.barBtnSetJunctionList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroJunctionListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //闷头 |
| | | this.barBtnSetBluntheadList.ItemClick += delegate |
| | | this.barBtnSetBluntheadList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroBluntheadListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //弯头 |
| | | this.barBtnSetElbowsList.ItemClick += delegate |
| | | this.barBtnSetElbowsList.ItemClick += async delegate |
| | | { |
| | | var allVisualVmList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroElbowListDlg(); |
| | | dlg.SetBindingData(allVisualVmList); |
| | | dlg.SetBindingData(allVisualVmList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //三通 |
| | | this.barBtnSetThreelinkList.ItemClick += delegate |
| | | this.barBtnSetThreelinkList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroThreelinkListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //四通 |
| | | this.barBtnSetFourlinkList.ItemClick += delegate |
| | | this.barBtnSetFourlinkList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroFourlinkListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水表 |
| | | this.barBtnSetMeterList.ItemClick += delegate |
| | | this.barBtnSetMeterList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroMeterListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //流量计 |
| | | this.barBtnSetFlowmeterList.ItemClick += delegate |
| | | this.barBtnSetFlowmeterList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroFlowmeterListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //压力表 |
| | | this.barBtnSetPressmeterList.ItemClick += delegate |
| | | this.barBtnSetPressmeterList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroPressmeterListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //喷嘴 |
| | | this.barBtnSetNozzleList.ItemClick += delegate |
| | | this.barBtnSetNozzleList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroNozzleListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eSimulationVisualSource.Set); |
| | | UpdateVisualListCtrl(); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //冷却塔 |
| | | this.barBtnSetCoolingList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroCoolingListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //管道 |
| | | this.barBtnSetPipeList.ItemClick += delegate |
| | | this.barBtnSetPipeList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroPipeListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //过渡件 |
| | | this.barBtnSetTranslationList.ItemClick += delegate |
| | | this.barBtnSetTranslationList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroTranslationListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //水泵 |
| | | this.barBtnSetPumpList.ItemClick += delegate |
| | | this.barBtnSetPumpList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroPumpListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //阀门 |
| | | this.barBtnSetValveList.ItemClick += delegate |
| | | this.barBtnSetValveList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroValveListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //换热器 |
| | | this.barBtnSetExchangerList.ItemClick += delegate |
| | | this.barBtnSetExchangerList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroExchangerListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //换热器 |
| | | this.barBtnSetCompressorList.ItemClick += delegate |
| | | //压缩机 |
| | | this.barBtnSetCompressorList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroCompressorListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.SetBindingData(allVisualViewModelList, changeHelper, propStatusHelper); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | |
| | | else |
| | | { |
| | | this.barBtnSetHydrantList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; |
| | | } |
| | | |
| | | //冷却塔 |
| | | if (_hydroInfo.Coolings == null || _hydroInfo.Coolings.Count < 1) |
| | | { |
| | | this.barBtnSetCoolingList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; |
| | | } |
| | | else |
| | | { |
| | | this.barBtnSetCoolingList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; |
| | | } |
| | | |
| | | //闷头 |
| | |
| | | markHelper.Set(); |
| | | } |
| | | |
| | | #endregion 模型标注 |
| | | #endregion |
| | | |
| | | #region 水流动画 |
| | | |
| | | |
| | | //水力动画辅助类 |
| | | private SimulationFlowEffectHelper _flowEffectHelper = null; |
| | | |
| | | //获取水流动画辅助类 |
| | | private async Task<SimulationFlowEffectHelper> GetFlowEffectHelper() |
| | | { |
| | | if (_flowEffectHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _flowEffectHelper = new SimulationFlowEffectHelper(visualListHelper, calcuResultHelper, bimfaceCtrl); |
| | | } |
| | | return _flowEffectHelper; |
| | | } |
| | | |
| | | |
| | | //水流动画是否可见 |
| | | private async void barCkFlowEffect_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (this.barCkFlowEffect.Checked) |
| | | { |
| | | this.barCkGrading.Checked = false; |
| | | } |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Visible = this.barCkFlowEffect.Checked; |
| | | flowEffectHelper.Set(); |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 颜色分级 |
| | | |
| | |
| | | //颜色分级展示 |
| | | private async void barCkGrading_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (this.barCkGrading.Checked) |
| | | { |
| | | this.barCkFlowEffect.Checked = false; |
| | | } |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Visible = this.barCkGrading.Checked; |
| | | gradingHelper.Set(); |
| | | } |
| | | |
| | | #endregion 颜色分级 |
| | | #endregion |
| | | |
| | | #region 人工刷新 |
| | | |
| | |
| | | |
| | | #endregion 人工刷新 |
| | | |
| | | #region 水流动画 |
| | | |
| | | //水流动画辅助类 |
| | | private SimulationFlowEffectHelper _flowEffectHelper = null; |
| | | |
| | | //获取水流动画辅助类 |
| | | private async Task<SimulationFlowEffectHelper> GetFlowEffectHelper() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_flowEffectHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var bimfaceCtrl = await GetBimfaceCtrl(); |
| | | _flowEffectHelper = new SimulationFlowEffectHelper(visualListHelper, bimfaceCtrl); |
| | | var calcuResult = GetCalcuResult(); |
| | | _flowEffectHelper.InitialData(calcuResult); |
| | | } |
| | | return _flowEffectHelper; |
| | | } |
| | | |
| | | //水流动画是否可见 |
| | | private async void barCkFlowEffect_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Visible = this.barCkFlowEffect.Checked; |
| | | flowEffectHelper.Set(); |
| | | } |
| | | |
| | | #endregion 水流动画 |
| | | |
| | | #region 监测列表 |
| | | |
| | | #region 监测点 |
| | | |
| | | //监测点辅助类 |
| | |
| | | //获取监测点辅助类 |
| | | private SimulationMonitorHelper GetMonitorHelper() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_monitorHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | |
| | | private async Task<List<HydroMonitorVmo>> GetMonitorList() |
| | | { |
| | | var helper = GetMonitorHelper(); |
| | | return await helper.Get(); |
| | | return await helper.GetAll(); |
| | | } |
| | | |
| | | //设置监测点列表 |
| | | private async void SetMonitorList(HydroVisualInfo visual) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.Get(); |
| | | var dlg = new SetHydroMonitorListDlg(); |
| | | dlg.SetBindingData(_hydroInfo, visual, allMonitorList); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | | var bol = await BLLFactory<Yw.BLL.HydroMonitor>.Instance.Save(_hydroInfo.ID, visual.Code, list); |
| | | if (!bol) |
| | | { |
| | | TipFormHelper.ShowError("设置失败!"); |
| | | return; |
| | | } |
| | | TipFormHelper.ShowSucceed("设置成功!"); |
| | | var monitorList = await monitorHelper.Update(visual.Code); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | monitorValueHelper.Update(visual.Code, monitorList); |
| | | var monitorMarkerHelper = await GetMonitorMarkerHelper(); |
| | | monitorMarkerHelper.Update(visual.Code, monitorList); |
| | | monitorMarkerHelper.Set(); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //设置监测点 |
| | | private void barBtnSetMonitor_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | SetMonitorList(_visual); |
| | | } |
| | | |
| | | #endregion 监测点 |
| | | #endregion |
| | | |
| | | #region 监测值 |
| | | |
| | |
| | | return _monitorValueHelper; |
| | | } |
| | | |
| | | //重置 |
| | | //获取监测值列表 |
| | | private async Task<List<HydroMonitorValueViewModel>> GetMonitorValueList() |
| | | { |
| | | var helper = GetMonitorValueHelper(); |
| | | return await helper.GetAll(); |
| | | } |
| | | |
| | | //重置监测值 |
| | | private void ResetMonitorValue() |
| | | { |
| | | var allWorkingList = GetWorkingList(); |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion 监测值 |
| | | #endregion |
| | | |
| | | #region 监测值控件 |
| | | #region 设置测点 |
| | | |
| | | //设置测点列表 |
| | | private async void SetMonitorList(HydroVisualInfo visual) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | if (visual == null) |
| | | { |
| | | return; |
| | | } |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.GetAll(); |
| | | var dlg = new SetHydroMonitorListDlg(); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | | var monitorList = list?.Select(x => x.Vmo).ToList(); |
| | | await monitorHelper.Update(visual.Code, monitorList); |
| | | await monitorValueHelper.Update(visual.Code, list); |
| | | var monitorMarkerHelper = await GetMonitorMarkerHelper(); |
| | | monitorMarkerHelper.Set(); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, visual, allMonitorList, allMonitorValueList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //设置测点列表 |
| | | private void barBtnSetMonitorList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | SetMonitorList(_visual); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 设置测值 |
| | | |
| | | //监测值列表控件 |
| | | private HydroMonitorValueListCtrl _monitorValueListCtrl = null; |
| | |
| | | _monitorValueListCtrl.Dock = DockStyle.Fill; |
| | | _monitorValueListCtrl.HydroViewEvent += (code) => |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var visual = visualListHelper.GetVisual(code); |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.Monitor); |
| | | }; |
| | | } |
| | |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(monitorValueListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "监测值"; |
| | | this.docPnlBottom.Text = "设置测值"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.Get(); |
| | | monitorValueListCtrl.SetBindingData(allMonitorValueList); |
| | | var allValueList = await GetMonitorValueList(); |
| | | monitorValueListCtrl.SetBindingData(allValueList); |
| | | } |
| | | |
| | | //设置监测值 |
| | | private void barBtnSetMonitorValue_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //设置测值 |
| | | private void barBtnSetMonitorValueList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowMonitorValueListCtrl(); |
| | | } |
| | | |
| | | #endregion 监测值控件 |
| | | #endregion |
| | | |
| | | #region 监测点标记 |
| | | #region 测点标记 |
| | | |
| | | //监测标记辅助类 |
| | | private SimulationMonitorMarkerHelper _monitorMarkerHelper = null; |
| | |
| | | return _monitorMarkerHelper; |
| | | } |
| | | |
| | | //显示状态改变 |
| | | private async void barCkMonitor_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //测点显示状态改变 |
| | | private async void barCkMonitorVisible_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var monitorMarkerHelper = await GetMonitorMarkerHelper(); |
| | | monitorMarkerHelper.Visible = this.barCkMonitor.Checked; |
| | | monitorMarkerHelper.Visible = this.barCkMonitorVisible.Checked; |
| | | monitorMarkerHelper.Set(); |
| | | } |
| | | |
| | | #endregion 监测点标记 |
| | | |
| | | #endregion 监测列表 |
| | | #endregion |
| | | |
| | | #region 模型检查 |
| | | |
| | |
| | | return _calcuResultHelper; |
| | | } |
| | | |
| | | #endregion 计算结果 |
| | | #endregion |
| | | |
| | | #region 计算失败 |
| | | |
| | |
| | | |
| | | #endregion 计算标签 |
| | | |
| | | #endregion 模型计算 |
| | | |
| | | #region 管网修复 |
| | | |
| | | //修复管网 |
| | | private void Repair() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var checkResult = _hydroInfo.Check(); |
| | | if (!checkResult.Succeed) |
| | | { |
| | | ShowCheckCtrl(checkResult); |
| | | TipFormHelper.ShowWarn("检查失败导致无法进行试算,停止管网修复!"); |
| | | return; |
| | | } |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.Simple); |
| | | if (!calcuResult.Succeed) |
| | | { |
| | | ShowCalcuFailedCtrl(calcuResult); |
| | | TipFormHelper.ShowWarn("试算失败,停止管网修复!"); |
| | | return; |
| | | } |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var allLinkList = visualListHelper.GetLinkList(); |
| | | if (allLinkList != null && allLinkList.Count < 1) |
| | | { |
| | | TipFormHelper.ShowError("模型中未包含管段信息,停止管网修复!"); |
| | | return; |
| | | } |
| | | int count = 0; |
| | | foreach (var link in allLinkList) |
| | | { |
| | | var calcuLink = calcuResult.LinkList?.Find(x => x.Code == link.Code); |
| | | if (calcuLink == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!calcuLink.CalcuFlow.HasValue) |
| | | { |
| | | continue; |
| | | } |
| | | if (calcuLink.CalcuFlow.Value < 0) |
| | | { |
| | | var tempCode = link.StartCode; |
| | | link.StartCode = link.EndCode; |
| | | link.EndCode = tempCode; |
| | | count++; |
| | | } |
| | | } |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateProperty(); |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | | TipFormHelper.ShowSucceed($"修复完成,共修复管段({count})个!"); |
| | | } |
| | | |
| | | //管网修复 |
| | | private void barBtnRepair_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | Repair(); |
| | | } |
| | | |
| | | #endregion 管网修复 |
| | | #endregion |
| | | |
| | | #region 导出INP |
| | | |
| | |
| | | |
| | | #endregion 水泵列表 |
| | | |
| | | #region 压力切换 |
| | | |
| | | //计算压力是否为绝对压力 |
| | | private bool _calcuPressModeIsHead = false; |
| | | |
| | | //计算结果压力切换 |
| | | private void barToggleSwitchPress_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | _calcuPressModeIsHead = !this.barToggleSwitchPress.Checked; |
| | | this.barToggleSwitchPress.Caption = _calcuPressModeIsHead ? "绝对压力" : "自由压力"; |
| | | var workingHelper = GetWorkingHelper(); |
| | | workingHelper.ResetResult(_calcuPressModeIsHead); |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | | } |
| | | |
| | | #endregion 压力切换 |
| | | |
| | | #region 评价规则 |
| | | |
| | | //评价规则辅助类 |
| | | private SimulationEvaluationHelper _evaluationHelper = null; |
| | | |
| | | //获取评价规则辅助类 |
| | | private SimulationEvaluationHelper GetEvaluationHelper() |
| | | { |
| | | if (_evaluationHelper == null) |
| | | { |
| | | _evaluationHelper = new SimulationEvaluationHelper(_hydroInfo.ID); |
| | | } |
| | | return _evaluationHelper; |
| | | } |
| | | |
| | | //获取评价规则列表 |
| | | private async Task<List<Yw.Vmo.HydroEvaluationVmo>> GetEvaluationList() |
| | | { |
| | | var helper = GetEvaluationHelper(); |
| | | return await helper.GetEvaluationList(); |
| | | } |
| | | |
| | | //设置评价规则列表 |
| | | private void SetEvaluationList(List<Yw.Vmo.HydroEvaluationVmo> allEvaluationList) |
| | | { |
| | | var helper = GetEvaluationHelper(); |
| | | helper.SetEvaluationList(allEvaluationList); |
| | | } |
| | | |
| | | //显示评价窗体 |
| | | private void ShowEvaluationDlg() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var dlg = new SetHydroEvaluationModelDlg(); |
| | | dlg.SetBindingData(_hydroInfo.ID); |
| | | dlg.ReloadDataEvent += (rhs) => |
| | | { |
| | | SetEvaluationList(rhs); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //评价规则 |
| | | private void barBtnEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowEvaluationDlg(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 水力计算 |
| | | |
| | | //计算 |
| | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allWorkingList = workingCheckedListHelper.GetWorkingList(); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.Get(); |
| | | var allMonitorValueList = await monitorValueHelper.GetAll(); |
| | | var dlg = new SetHydroWorkingDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allWorkingList, allMonitorValueList); |
| | | dlg.HydroViewEvent += (visual) => |
| | |
| | | return; |
| | | } |
| | | |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | WaitFormHelper.ShowWaitForm(this, "正在计算分析中,请稍候..."); |
| | | await Task.Delay(3000); |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss); |
| | | var calcuResult = _hydroInfo.Calcu(isHead, allEvaluationList); |
| | | WaitFormHelper.HideWaitForm(); |
| | | workingHelper.InitialData(hydroInfo, working, checkResult, calcuResult); |
| | | if (calcuResult.Succeed) |
| | |
| | | |
| | | #region 导出报告 |
| | | |
| | | private async void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //创建打印信息 |
| | | private async Task<SimulationPrintViewModel> CreatePrintInfo() |
| | | { |
| | | if (_visual == null) |
| | | if (_project == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | return default; |
| | | } |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | |
| | | #region 工况列表 |
| | | |
| | | var allWorkingList = GetCheckedWorkingList(); |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | var working = GetWorking(); |
| | | if (working == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | TipFormHelper.ShowWarn("请计算或选择工况后重试!"); |
| | | return default; |
| | | } |
| | | allWorkingList = new List<HydroWorkingVmo>() { working }; |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | |
| | | #endregion 工况列表 |
| | | |
| | | #region 选择节点 |
| | | |
| | | var selectedNode = GetSelectNode(); |
| | | if (selectedNode == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | return default; |
| | | } |
| | | |
| | | #endregion 选择节点 |
| | | |
| | | var vm = new SimulationPrintViewModel(); |
| | | |
| | | #region 项目 |
| | | |
| | | vm.Project = new SimulationPrintProjectViewModel(_project); |
| | | if (_hydroInfo == null) |
| | | { |
| | | return vm; |
| | | } |
| | | |
| | | #endregion 项目 |
| | | |
| | | #region 水泵列表 |
| | | |
| | | vm.PumpList = _hydroInfo.Pumps?.Select(x => |
| | | { |
| | | var pump = new SimulationPrintPumpViewModel(x); |
| | | return pump; |
| | | }).ToList(); |
| | | |
| | | #endregion 水泵列表 |
| | | |
| | | #region 附加信息 |
| | | |
| | | var allMonitorList = await GetMonitorList(); |
| | | var working = GetWorking(); |
| | | var calcuResult = GetCalcuResult(); |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var dlg = new SimulationWorkingReportDlg(); |
| | | dlg.ReloadDataEvent += (vm) => |
| | | #endregion 附加信息 |
| | | |
| | | #region 基础模型 |
| | | |
| | | var baseHydroInfo = _hydroInfo; |
| | | if (_scheme != null) |
| | | { |
| | | var fileName = FileDialogHelper.SaveWordDoc("导出Word报告"); |
| | | if (string.IsNullOrEmpty(fileName)) |
| | | baseHydroInfo = await GetModelEvent?.Invoke(null); |
| | | } |
| | | var baseHydroInfoRhs = baseHydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | |
| | | #endregion 基础模型 |
| | | |
| | | #region 遍历工况 |
| | | |
| | | vm.WorkingList = new List<SimulationPrintWorkingViewModel>(); |
| | | foreach (var working in allWorkingList) |
| | | { |
| | | baseHydroInfoRhs.UpdateWorkingInfo(working.WorkingInfo); |
| | | var calcuResult = baseHydroInfoRhs.Calcu(_calcuPressModeIsHead, allEvaluationList); |
| | | |
| | | var printWorking = new SimulationPrintWorkingViewModel(working); |
| | | vm.WorkingList.Add(printWorking); |
| | | |
| | | //精度评估 |
| | | printWorking.Accuracy = HydroAccuracyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //水泵分析 |
| | | printWorking.PumpAnaly = HydroPumpAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //监测分析 |
| | | printWorking.MonitorAnaly = HydroMonitorAnalyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //能耗分析 |
| | | printWorking.EnergyAnaly = HydroEnergyAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //损失统计 |
| | | printWorking.LossStatistics = HydroLossStatisticsHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //损失曲线 |
| | | printWorking.LossCurve = HydroLossCurveHelper.Create(baseHydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | } |
| | | |
| | | #endregion 遍历工况 |
| | | |
| | | #region 方案处理 |
| | | |
| | | if (_scheme != null) |
| | | { |
| | | var hydroInfo = _hydroInfo; |
| | | var hydroInfoRhs = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | vm.Scheme = new SimulationPrintSchemeViewModel(_scheme); |
| | | foreach (var working in allWorkingList) |
| | | { |
| | | return; |
| | | hydroInfoRhs.UpdateWorkingInfo(working.WorkingInfo); |
| | | var calcuResult = hydroInfoRhs.Calcu(_calcuPressModeIsHead, allEvaluationList); |
| | | |
| | | var printWorking = new SimulationPrintWorkingViewModel(working); |
| | | vm.Scheme.WorkingList.Add(printWorking); |
| | | |
| | | //精度评估 |
| | | printWorking.Accuracy = HydroAccuracyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //水泵分析 |
| | | printWorking.PumpAnaly = HydroPumpAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //监测分析 |
| | | printWorking.MonitorAnaly = HydroMonitorAnalyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //能耗分析 |
| | | printWorking.EnergyAnaly = HydroEnergyAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //损失统计 |
| | | printWorking.LossStatistics = HydroLossStatisticsHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //损失曲线 |
| | | printWorking.LossCurve = HydroLossCurveHelper.Create(hydroInfoRhs, working, selectedNode, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | } |
| | | var reportHelper = new SimulationWorkingReportHelper(); |
| | | reportHelper.Create(fileName, vm); |
| | | TipFormHelper.ShowInfo("导出成功!"); |
| | | }; |
| | | dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 方案处理 |
| | | |
| | | return vm; |
| | | } |
| | | |
| | | //导出word |
| | | private async void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var printInfo = await CreatePrintInfo(); |
| | | var printDlg = new HStation.WinFrmUI.SimulationCommonReportDlg(); |
| | | printDlg.SetBindingData(printInfo); |
| | | printDlg.ShowDialog(); |
| | | /* if (_visual == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | |
| | | var allMonitorList = await GetMonitorList(); |
| | | var working = GetWorking(); |
| | | var calcuResult = GetCalcuResult(); |
| | | |
| | | var dlg = new SimulationWorkingReportDlg(); |
| | | dlg.ReloadDataEvent += (vm) => |
| | | { |
| | | var fileName = FileDialogHelper.SaveWordDoc("导出Word报告"); |
| | | if (string.IsNullOrEmpty(fileName)) |
| | | { |
| | | return; |
| | | } |
| | | var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper(); |
| | | reportHelper.Create(fileName, vm); |
| | | TipFormHelper.ShowInfo("导出成功!"); |
| | | }; |
| | | dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); |
| | | dlg.ShowDialog();*/ |
| | | } |
| | | |
| | | #endregion 导出报告 |
| | |
| | | { |
| | | if (_workingCheckedListHelper == null) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | _workingCheckedListHelper = new SimulationWorkingCheckedListHelper(visualListHelper); |
| | | _workingCheckedListHelper = new SimulationWorkingCheckedListHelper(); |
| | | _workingCheckedListHelper.InitialData(_allWorkingCheckedListDict); |
| | | } |
| | | return _workingCheckedListHelper; |
| | | } |
| | | |
| | | //获取工况字典 |
| | | private Dictionary<HydroWorkingVmo, bool> GetWorkingDict() |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | return helper.GetWorkingDict(); |
| | | } |
| | | |
| | | //获取工况列表 |
| | |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | return helper.GetWorkingList(); |
| | | } |
| | | |
| | | //获取选择工况列表 |
| | | private List<HydroWorkingVmo> GetCheckedWorkingList() |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | return helper.GetCheckedWorkingList(); |
| | | } |
| | | |
| | | //更新工况选择列表 |
| | |
| | | helper.Remove(working); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 重载工况选择列表 |
| | | /// </summary> |
| | | public void ReloadWorkingCheckedList(Dictionary<HydroWorkingVmo, bool> dict) |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | helper.InitialData(dict); |
| | | } |
| | | |
| | | //管理工况 |
| | | private void barBtnMgrWorking_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dict = GetWorkingDict(); |
| | | var dlg = new HydroWorkingMgrDlg(); |
| | | dlg.ReloadDataEvent += (dict) => |
| | | { |
| | | this.ReloadWorkingEvent?.Invoke(dict); |
| | | }; |
| | | dlg.UpdateDataEvent += (rhs) => |
| | | { |
| | | this.UpdateWorkingEvent?.Invoke(rhs); |
| | | }; |
| | | dlg.ApplyDataEvent += async (rhs) => |
| | | { |
| | | _hydroInfo.UpdateWorkingInfo(rhs.WorkingInfo); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.GetAll(); |
| | | allMonitorValueList.UpdateMonitorValue(rhs.MonitorInfo); |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(); |
| | | }; |
| | | dlg.DeleteDataEvent += (rhs) => |
| | | { |
| | | this.RemoveWorkingEvent?.Invoke(rhs); |
| | | }; |
| | | dlg.SetBindingData(dict); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 选择工况 |
| | | |
| | | #region 监测分析 |
| | | |
| | | //监测分析列表控件 |
| | | private HydroMonitorAnalyListCtrl _monitorAnalyListCtrl = null; |
| | | |
| | | //获取监测分析列表控件 |
| | | private HydroMonitorAnalyListCtrl GetMonitorAnalyListCtrl() |
| | | { |
| | | if (_monitorAnalyListCtrl == null) |
| | | { |
| | | _monitorAnalyListCtrl = new HydroMonitorAnalyListCtrl(); |
| | | _monitorAnalyListCtrl.Dock = DockStyle.Fill; |
| | | _monitorAnalyListCtrl.HydroViewEvent += (code) => |
| | | { |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.Monitor); |
| | | }; |
| | | } |
| | | return _monitorAnalyListCtrl; |
| | | } |
| | | |
| | | //监测分析列表控件是否可见 |
| | | private bool IsMonitorAnalyListCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlBottom.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroMonitorAnalyListCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示监测分析列表控件 |
| | | private async void ShowMonitorAnalyListCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allWorkingList = GetCheckedWorkingList(); |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var monitorAnalyListCtrl = GetMonitorAnalyListCtrl(); |
| | | if (!IsMonitorAnalyListCtrlVisible) |
| | | { |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(monitorAnalyListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "监测分析"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | |
| | | var allMonitorList = await GetMonitorList(); |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | monitorAnalyListCtrl.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | } |
| | | else |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMonitorList, allWorkingList, isHead, allEvaluationList); |
| | | } |
| | | } |
| | | |
| | | //监测分析 |
| | | private void barBtnWorkingMonitorAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowMonitorAnalyListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 工况分析 |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //精度评估 |
| | | private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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 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 barBtnPumpAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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 SimulationSingleWorkingPumpAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingPumpAnalyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //能效分析 |
| | | private async void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var allMonitorList = await GetMonitorList(); |
| | | 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.Working, workingHelper.HydroInfo, allMonitorList, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingEnergyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //损失曲线 |
| | | private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //获取选择节点 |
| | | private HydroNodeInfo GetSelectNode() |
| | | { |
| | | if (_visual == null) |
| | | { |
| | |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | return null; |
| | | } |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | return visual as HydroNodeInfo; |
| | | } |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | //精度评估 |
| | | private async void barBtnAccuracy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var allMonitorList = await GetMonitorList(); |
| | | if (allMonitorList == null || allMonitorList.Count < 1) |
| | | { |
| | | TipFormHelper.ShowWarn("请设置监测点后重试!"); |
| | | return; |
| | | } |
| | | |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.Count < 1) |
| | | { |
| | | var allMonitorValueList = await GetMonitorValueList(); |
| | | allMonitorValueList = allMonitorValueList?.Where(x => x.PropValue.HasValue).ToList(); |
| | | if (allMonitorValueList == null || allMonitorValueList.Count < 1) |
| | | { |
| | | TipFormHelper.ShowWarn("请设置监测值后,重新计算!"); |
| | | return; |
| | | } |
| | | |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroAccuracyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | |
| | | var workingDlg = new HydroAccuracyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, allMonitorList, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | //水泵分析 |
| | | private async void barBtnPumpAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); |
| | | var dlg = new SimulationPumpAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | else |
| | | |
| | | var workingDlg = new SimulationPumpAnalyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | //能效分析 |
| | | private async void barBtnEnergyAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | var dlg = new HydroMultiWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new SimulationEnergyAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | var workingDlg = new SimulationEnergyAnalyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | //损失统计 |
| | | private void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var hydroInfo = _hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo); |
| | | var dlg = new HydroLossStatisticsDlg(); |
| | | dlg.SetBindingData(hydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | var workingDlg = new HydroLossStatisticsWorkingDlg(); |
| | | workingDlg.SetBindingData(hydroInfo, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | //综合分析 |
| | | private async void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_visual == null) |
| | | if (_hydroInfo == null) |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | return; |
| | | } |
| | | |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.Get(); |
| | | var selectNode = GetSelectNode(); |
| | | if (selectNode == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | var allMonitorList = await GetMonitorList(); |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.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); |
| | | var dlg = new SimulationMultiAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, selectNode, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | else |
| | | |
| | | var workingDlg = new SimulationMultiAnalyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, allMonitorList, workingList, selectNode, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 损失曲线 |
| | | |
| | | //损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl _lossCurveInteropCtrl = null; |
| | | |
| | | //获取损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl GetLossCurveInteropCtrl() |
| | | { |
| | | if (_lossCurveInteropCtrl == null) |
| | | { |
| | | var dlg = new SimulationMultiWorkingAnalyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | _lossCurveInteropCtrl = new HydroLossCurveInteropCtrl(); |
| | | _lossCurveInteropCtrl.Dock = DockStyle.Fill; |
| | | _lossCurveInteropCtrl.HydroClickEvent += (code) => |
| | | { |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.None); |
| | | }; |
| | | _lossCurveInteropCtrl.HydroSpecialDisplayEvent += (list) => |
| | | { |
| | | _bimfaceCtrl?.SetLogicOutlineGlowEffect(list); |
| | | }; |
| | | _lossCurveInteropCtrl.HydroCancelSpecialDisplayEvent += () => |
| | | { |
| | | _bimfaceCtrl?.RemoveLogicOutlineGlowEffect(); |
| | | }; |
| | | } |
| | | return _lossCurveInteropCtrl; |
| | | } |
| | | |
| | | //损失曲线控件是否可见 |
| | | private bool IsLossCurveInteropCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlBottom.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroLossCurveInteropCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | #endregion 工况分析 |
| | | //显示损失曲线控件 |
| | | private void ShowLossCurveInteropCtrl |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | HydroWorkingVmo working, |
| | | HydroNodeInfo node, |
| | | HydroCalcuResult calcuResult = null, |
| | | bool isHead = false, |
| | | List<HydroEvaluationVmo> allEvaluationList = null |
| | | ) |
| | | { |
| | | var ctrl = GetLossCurveInteropCtrl(); |
| | | if (!IsLossCurveInteropCtrlVisible) |
| | | { |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(ctrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "损失曲线"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | ctrl.SetBindingData(hydroInfo, working, node, calcuResult, isHead, allEvaluationList); |
| | | } |
| | | |
| | | //损失曲线 |
| | | private async void barBtnLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var node = GetSelectNode(); |
| | | if (node == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | var workingList = GetCheckedWorkingList(); |
| | | if (workingList == null || workingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | ShowLossCurveInteropCtrl(workingHelper.HydroInfo, workingHelper.Working, node, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | return; |
| | | } |
| | | |
| | | var dlg = new HydroLossCurveMultiWorkingDlg(); |
| | | dlg.SetBindingData(_hydroInfo, workingList, node, _calcuPressModeIsHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 损失曲线 |
| | | |
| | | #region 方案管理 |
| | | |
| | |
| | | TipFormHelper.ShowError("水力模拟方案删除失败,请重试!"); |
| | | return; |
| | | } |
| | | if (!await BLLFactory<Yw.BLL.HydroModelRelation>.Instance.DeleteAllByID(relation.ID)) |
| | | if (!await BLLFactory<Yw.BLL.HydroModelInfo>.Instance.DeleteByID(relation.ModelID)) |
| | | { |
| | | TipFormHelper.ShowError("水力模拟方案删除失败,请重试!"); |
| | | return; |
| | |
| | | } |
| | | |
| | | #endregion 方案管理 |
| | | |
| | | |
| | | } |
| | | } |