| | |
| | | using Castle.Core.Logging; |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Diagram.Core.Native; |
| | | 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.Hydro; |
| | | using Yw.Model; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Q3d; |
| | | |
| | | 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;//项目站 |
| | |
| | | return _propStatusHelper; |
| | | } |
| | | |
| | | #endregion |
| | | //获取属性状态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 (_propertyCtrl == null) |
| | | { |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | _propertyCtrl = new SimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.AllowEdit = true; |
| | | _propertyCtrl.InitialData(propStatusHelper); |
| | | _propertyCtrl.InitialData(changeHelper, propStatusHelper); |
| | | _propertyCtrl.CalcuResult = () => GetCalcuResult(); |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(visual); |
| | | }; |
| | | _propertyCtrl.FlowEffectPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //流向属性发生改变 |
| | | //判断流向是否加载,如果加载则更新流向,最好是更新单个流向 |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Set(visual); |
| | | }; |
| | | } |
| | | return _propertyCtrl; |
| | | } |
| | |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 属性控件 |
| | | |
| | | #region 选择构件 |
| | | |
| | |
| | | } |
| | | |
| | | //显示构件明细控件 |
| | | 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 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("正在保存,请稍后..."); |
| | | |
| | | var bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance |
| | | .Update(_hydroInfo, addParterList, updateParterList, removeParters); |
| | | |
| | | 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.ShowDialog(); |
| | | }; |
| | | //冷却塔 |
| | | this.barBtnSetCoolingList.ItemClick += delegate |
| | | this.barBtnSetCoolingList.ItemClick += async delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var changeHelper = GetChangeHelper(); |
| | | var propStatusHelper = await GetPropStatusHelper(); |
| | | var dlg = new SetHydroCoolingListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | 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); |
| | |
| | | } |
| | | |
| | | #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 监测点 |
| | | |
| | |
| | | |
| | | #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 水力计算 |
| | | |
| | | //计算 |
| | |
| | | |
| | | WaitFormHelper.ShowWaitForm(this, "正在计算分析中,请稍候..."); |
| | | await Task.Delay(3000); |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss); |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, _calcuPressModeIsHead); |
| | | 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(Yw.EPAnet.CalcuMode.MinorLoss, _calcuPressModeIsHead, allEvaluationList); |
| | | |
| | | var printWorking = new SimulationPrintWorkingViewModel(working); |
| | | vm.WorkingList.Add(printWorking); |
| | | |
| | | //精度评估 |
| | | printWorking.Accuracy = SimulationPrintAccuracyHelper.Create(baseHydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //水泵分析 |
| | | printWorking.PumpAnaly = SimulationPrintPumpAnalyHelper.Create(baseHydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //监测分析 |
| | | printWorking.MonitorAnaly = SimulationPrintMonitorAnalyHelper.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(Yw.EPAnet.CalcuMode.MinorLoss, _calcuPressModeIsHead, allEvaluationList); |
| | | |
| | | var printWorking = new SimulationPrintWorkingViewModel(working); |
| | | vm.Scheme.WorkingList.Add(printWorking); |
| | | |
| | | //精度评估 |
| | | printWorking.Accuracy = SimulationPrintAccuracyHelper.Create(hydroInfoRhs, allMonitorList, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //水泵分析 |
| | | printWorking.PumpAnaly = SimulationPrintPumpAnalyHelper.Create(hydroInfoRhs, working, calcuResult, _calcuPressModeIsHead, allEvaluationList); |
| | | //监测分析 |
| | | printWorking.MonitorAnaly = SimulationPrintMonitorAnalyHelper.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 HStation.ReportFile.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.XtraForm1(); |
| | | 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(); |
| | | 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); |
| | | }; |
| | | dlg.DeleteDataEvent += (rhs) => |
| | | { |
| | | this.RemoveWorkingEvent?.Invoke(rhs); |
| | | }; |
| | | dlg.SetBindingData(dict); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 选择工况 |
| | |
| | | } |
| | | } |
| | | |
| | | //获取选择节点 |
| | | private HydroNodeInfo GetSelectNode() |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return null; |
| | | } |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | | if (_visual is HydroLinkInfo linkInfo) |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | return visual as HydroNodeInfo; |
| | | } |
| | | |
| | | //精度评估 |
| | | private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | |
| | | } |
| | | |
| | | //能效分析 |
| | | private async void barBtnWorkingPower_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void barBtnEnergyAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var allMonitorList = await GetMonitorList(); |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | 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 SimulationSingleWorkingEnergyDlg(); |
| | | dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, allMonitorList, workingHelper.CalcuResult); |
| | | var dlg = new SimulationEnergyAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingEnergyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | 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(); |
| | | } |
| | | |
| | | //综合分析 |
| | |
| | | |
| | | #region 损失曲线 |
| | | |
| | | //单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveCtrl _singleWorkingLossCurveCtrl = null; |
| | | //损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl _lossCurveInteropCtrl = null; |
| | | |
| | | //获取单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveCtrl GetSingleWorkingLossCurveCtrl() |
| | | //获取损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl GetLossCurveInteropCtrl() |
| | | { |
| | | if (_singleWorkingLossCurveCtrl == null) |
| | | if (_lossCurveInteropCtrl == null) |
| | | { |
| | | _singleWorkingLossCurveCtrl = new HydroSingleWorkingLossCurveCtrl(); |
| | | _singleWorkingLossCurveCtrl.Dock = DockStyle.Fill; |
| | | _singleWorkingLossCurveCtrl.HydroClickEvent += (code) => |
| | | _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 _singleWorkingLossCurveCtrl; |
| | | return _lossCurveInteropCtrl; |
| | | } |
| | | |
| | | //单工况损失曲线控件是否可见 |
| | | private bool IsSingleWorkingLossCurveCtrlVisible |
| | | //损失曲线控件是否可见 |
| | | private bool IsLossCurveInteropCtrlVisible |
| | | { |
| | | get |
| | | { |
| | |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroSingleWorkingLossCurveCtrl) |
| | | if (this.controlContainerBottom.Controls[0] is HydroLossCurveInteropCtrl) |
| | | { |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //显示单工况损失曲线控件 |
| | | private void ShowSingleWorkingLossCurveCtrl(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult, HydroVisualInfo visual) |
| | | //显示损失曲线控件 |
| | | private void ShowLossCurveInteropCtrl |
| | | ( |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | HydroWorkingVmo working, |
| | | HydroNodeInfo node, |
| | | HydroCalcuResult calcuResult = null, |
| | | bool isHead = false, |
| | | List<HydroEvaluationVmo> allEvaluationList = null |
| | | ) |
| | | { |
| | | var singleWorkingLossCurveCtrl = GetSingleWorkingLossCurveCtrl(); |
| | | if (!IsSingleWorkingLossCurveCtrlVisible) |
| | | var ctrl = GetLossCurveInteropCtrl(); |
| | | if (!IsLossCurveInteropCtrlVisible) |
| | | { |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(singleWorkingLossCurveCtrl); |
| | | this.controlContainerBottom.Controls.Add(ctrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "损失曲线"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | singleWorkingLossCurveCtrl.SetBindingData(hydroInfo, calcuResult, visual); |
| | | ctrl.SetBindingData(hydroInfo, working, node, calcuResult, isHead, allEvaluationList); |
| | | } |
| | | |
| | | //损失曲线 |
| | | private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void barBtnLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_visual == null) |
| | | var node = GetSelectNode(); |
| | | if (node == 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 workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | 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; |
| | | } |
| | | ShowSingleWorkingLossCurveCtrl(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); |
| | | ShowLossCurveInteropCtrl(workingHelper.HydroInfo, workingHelper.Working, node, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | var dlg = new HydroLossCurveMultiWorkingDlg(); |
| | | dlg.SetBindingData(_hydroInfo, workingList, node, _calcuPressModeIsHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 损失曲线 |