| | |
| | | using DevExpress.Mvvm.Native; |
| | | using DevExpress.Pdf.Native; |
| | | using Mapster; |
| | | using Yw.EPAnet; |
| | | using Yw.Epanet; |
| | | using Yw.Hydro; |
| | | using Yw.Model; |
| | | using Yw.Vmo; |
| | | using Yw.WinFrmUI.Bimface; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | RegistBulkSetEvents(); |
| | | } |
| | | |
| | | |
| | | |
| | | #region 模型事件 |
| | | |
| | | /// <summary> |
| | | /// 获取模型事件 |
| | | /// </summary> |
| | | public event Func<XhsSchemeVmo, Task<Yw.Model.HydroModelInfo>> GetModelEvent; |
| | | |
| | | /// <summary> |
| | | /// 刷新模型事件 |
| | | /// </summary> |
| | | public event Func<Task<Yw.Model.HydroModelInfo>> RefreshModelEvent; |
| | | |
| | | #endregion |
| | | #endregion 模型事件 |
| | | |
| | | #region 方案事件 |
| | | |
| | |
| | | /// 更新方案事件 |
| | | /// </summary> |
| | | public event Action<XhsSchemeVmo> UpdateSchemeEvent; |
| | | |
| | | /// <summary> |
| | | /// 移除方案事件 |
| | | /// </summary> |
| | | public event Action<XhsSchemeVmo> RemoveSchemeEvent; |
| | | |
| | | #endregion |
| | | #endregion 方案事件 |
| | | |
| | | #region 工况事件 |
| | | |
| | |
| | | /// 新增工况事件 |
| | | /// </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 |
| | | #endregion 工况事件 |
| | | |
| | | private HStation.Vmo.XhsProjectVmo _project = null;//项目 |
| | | private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站 |
| | |
| | | { |
| | | base.InitialDataSource(); |
| | | ShowBimfaceCtrl(); |
| | | ShowQ3dCtrl(); |
| | | ShowL3d2Ctrl(); |
| | | ShowPropertyCtrl(); |
| | | InitialSvgImages(); |
| | | } |
| | |
| | | private void InitialSvgImages() |
| | | { |
| | | //监测 |
| | | this.barBtnDockingMonitor.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Docking; |
| | | this.barBtnAnalyseMonitor.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Analyse; |
| | | this.barBtnSetMonitorList.ImageOptions.SvgImage = HydroMonitorSvgImageHelper.Docking; |
| | | |
| | | //水库 |
| | | this.barBtnSetReservoirList.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; |
| | |
| | | return helper.GetPropStatusDbList(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 属性状态 |
| | | |
| | | #region 更改状态 |
| | | |
| | |
| | | return helper.GetRemoveParters(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 更改状态 |
| | | |
| | | #region BIM控件 |
| | | |
| | |
| | | this.tabPageBimface.Controls.Add(bimfaceCtrl); |
| | | } |
| | | |
| | | #endregion |
| | | #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 |
| | |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(visual); |
| | | }; |
| | | _propertyCtrl.FlowDirectionPropertyValueChangedEvent += async (visual) => |
| | | { |
| | | //流向属性发生改变 |
| | | //判断当前是否有流向展示,若有则更新流向,最好是更新单个流向 |
| | | var flowDirectionHelper = await GetFlowEffectHelper(); |
| | | flowDirectionHelper.Set(visual); |
| | | }; |
| | | } |
| | | return _propertyCtrl; |
| | | } |
| | |
| | | } |
| | | |
| | | //显示属性控件 |
| | | private async void ShowPropertyCtrl() |
| | | private async Task ShowPropertyCtrl() |
| | | { |
| | | if (IsPropertyCtrlVisible) |
| | | { |
| | |
| | | } |
| | | |
| | | //设置属性控件 |
| | | 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; |
| | |
| | | case eSimulationVisualSource.None: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Bimface: |
| | | { |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Q3d: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Property: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.List: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Set: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Search: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Monitor: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Check: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Calcu: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | case eSimulationVisualSource.Warning: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnDockingMonitor.Enabled = visual != null; |
| | | this.barBtnAnalyseMonitor.Enabled = visual != null; |
| | | this.barBtnSetMonitorList.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | |
| | | return helper.GetSourceList(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 可见列表 |
| | | |
| | | #region 视图列表 |
| | | |
| | |
| | | return helper.GetVisual(code); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 视图列表 |
| | | |
| | | #region 明细控件 |
| | | |
| | |
| | | ShowVisualListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 明细控件 |
| | | |
| | | #region 构件显示 |
| | | |
| | |
| | | |
| | | #endregion 构件显示 |
| | | |
| | | #endregion |
| | | #endregion 构件明细 |
| | | |
| | | #region 一键显隐 |
| | | |
| | |
| | | |
| | | //保存锁定对象 |
| | | private object _locker_save = new(); |
| | | |
| | | private bool _isSaving = false;//正在保存 |
| | | |
| | | //保存 |
| | |
| | | |
| | | WaitFormHelper.ShowWaitForm("正在保存,请稍后..."); |
| | | |
| | | var bol = await BLLFactory<Yw.BLL.HydroModelInfo>.Instance |
| | | 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(); |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 批量配置 |
| | | |
| | | #region 构件查询 |
| | | |
| | |
| | | |
| | | #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 人工刷新 |
| | | |
| | |
| | | return await helper.GetAll(); |
| | | } |
| | | |
| | | //获取监测对接列表 |
| | | private async Task<List<HydroMonitorVmo>> GetMonitorDockingList() |
| | | { |
| | | var helper = GetMonitorHelper(); |
| | | return await helper.GetDockingList(); |
| | | } |
| | | |
| | | //获取监测分析列表 |
| | | private async Task<List<HydroMonitorVmo>> GetMonitorAnalyseList() |
| | | { |
| | | var helper = GetMonitorHelper(); |
| | | return await helper.GetAnalyseList(); |
| | | } |
| | | |
| | | #endregion 监测点 |
| | | #endregion |
| | | |
| | | #region 监测值 |
| | | |
| | |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var calcuResultHelper = GetCalcuResultHelper(); |
| | | _monitorValueHelper = new SimulationMonitorValueHelper(visualListHelper, monitorHelper, calcuResultHelper); |
| | | _monitorValueHelper = new SimulationMonitorValueHelper(visualListHelper, monitorHelper); |
| | | } |
| | | return _monitorValueHelper; |
| | | } |
| | |
| | | return await helper.GetAll(); |
| | | } |
| | | |
| | | //获取监测对接值列表 |
| | | private async Task<List<HydroMonitorValueViewModel>> GetMonitorDockingValueList() |
| | | { |
| | | var helper = GetMonitorValueHelper(); |
| | | return await helper.GetDockingList(); |
| | | } |
| | | |
| | | //获取监测分析值列表 |
| | | private async Task<List<HydroMonitorValueViewModel>> GetMonitorAnalyseValueList() |
| | | { |
| | | var helper = GetMonitorValueHelper(); |
| | | return await helper.GetAnalyseList(); |
| | | } |
| | | |
| | | //重置 |
| | | //重置监测值 |
| | | private void ResetMonitorValue() |
| | | { |
| | | var allWorkingList = GetWorkingList(); |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion 监测值 |
| | | #endregion |
| | | |
| | | #region 传感器测点 |
| | | #region 设置测点 |
| | | |
| | | //设置可见构件对接测点列表 |
| | | private async void SetMonitorDockingList(HydroVisualInfo visual) |
| | | //设置测点列表 |
| | | private async void SetMonitorList(HydroVisualInfo visual) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.GetAll(); |
| | | var calcuResult = GetCalcuResult(); |
| | | var dlg = new SetHydroMonitorDockingListDlg(); |
| | | var dlg = new SetHydroMonitorListDlg(); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | | var monitorList = list?.Select(x => x.Vmo).ToList(); |
| | | await monitorHelper.Update(visual.Code, eSourceType.Docking, monitorList); |
| | | await monitorValueHelper.Update(visual.Code, eSourceType.Docking, list); |
| | | await monitorHelper.Update(visual.Code, monitorList); |
| | | await monitorValueHelper.Update(visual.Code, list); |
| | | var monitorMarkerHelper = await GetMonitorMarkerHelper(); |
| | | monitorMarkerHelper.Set(); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, visual, allMonitorList, allMonitorValueList, calcuResult); |
| | | dlg.SetBindingData(_hydroInfo, visual, allMonitorList, allMonitorValueList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //设置传感器测点 |
| | | private void barBtnDockingMonitor_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //设置测点列表 |
| | | private void barBtnSetMonitorList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | SetMonitorDockingList(_visual); |
| | | SetMonitorList(_visual); |
| | | } |
| | | |
| | | #endregion 传感器测点 |
| | | #endregion |
| | | |
| | | #region 传感器测值 |
| | | #region 设置测值 |
| | | |
| | | //监测值列表控件 |
| | | private HydroMonitorValueListCtrl _monitorValueListCtrl = null; |
| | |
| | | } |
| | | } |
| | | |
| | | //显示监测对接值列表控件 |
| | | private async void ShowMonitorDockingValueListCtrl() |
| | | //显示监测值列表控件 |
| | | private async void ShowMonitorValueListCtrl() |
| | | { |
| | | var monitorValueListCtrl = GetMonitorValueListCtrl(); |
| | | if (!IsMonitorValueListCtrlVisible) |
| | |
| | | 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 allValueList = await GetMonitorDockingValueList(); |
| | | var calcuResult = GetCalcuResult(); |
| | | var allValueList = await GetMonitorValueList(); |
| | | monitorValueListCtrl.SetBindingData(allValueList); |
| | | } |
| | | |
| | | //设置传感器测值 |
| | | private void barBtnDockingMonitorValue_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //设置测值 |
| | | private void barBtnSetMonitorValueList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowMonitorDockingValueListCtrl(); |
| | | ShowMonitorValueListCtrl(); |
| | | } |
| | | |
| | | #endregion 传感器测值 |
| | | |
| | | #region 分析测点 |
| | | |
| | | //设置可见构件分析测点列表 |
| | | private async void SetMonitorAnalyseList(HydroVisualInfo visual) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | if (visual == null) |
| | | { |
| | | return; |
| | | } |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAnalyseList(); |
| | | var dlg = new SetHydroMonitorAnalyseListDlg(); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | | await monitorHelper.Update(visual.Code, eSourceType.Analyse, list); |
| | | //var monitorMarkerHelper = await GetMonitorMarkerHelper(); |
| | | //monitorMarkerHelper.Update(visual.Code, monitorList); |
| | | //monitorMarkerHelper.Set(); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, visual, allMonitorList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | //设置分析测点 |
| | | private void barBtnAnalyseMonitor_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | return; |
| | | } |
| | | SetMonitorAnalyseList(_visual); |
| | | } |
| | | |
| | | #endregion 分析测点 |
| | | #endregion |
| | | |
| | | #region 测点标记 |
| | | |
| | |
| | | monitorMarkerHelper.Set(); |
| | | } |
| | | |
| | | #endregion 测点标记 |
| | | #endregion |
| | | |
| | | #region 模型检查 |
| | | |
| | |
| | | return _calcuResultHelper; |
| | | } |
| | | |
| | | #endregion 计算结果 |
| | | #endregion |
| | | |
| | | #region 计算失败 |
| | | |
| | |
| | | |
| | | #endregion 计算标签 |
| | | |
| | | #endregion 模型计算 |
| | | #endregion |
| | | |
| | | #region 导出INP |
| | | |
| | |
| | | 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 |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | WaitFormHelper.ShowWaitForm(this, "正在计算分析中,请稍候..."); |
| | | await Task.Delay(3000); |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.MinorLoss, _calcuPressModeIsHead); |
| | | var calcuResult = _hydroInfo.Calcu(isHead, allEvaluationList); |
| | | WaitFormHelper.HideWaitForm(); |
| | | workingHelper.InitialData(hydroInfo, working, checkResult, calcuResult); |
| | | if (calcuResult.Succeed) |
| | |
| | | Calcu(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 水力计算 |
| | | |
| | | #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 HStation.ReportFile.SimulationWorkingReportHelper(); |
| | | reportHelper.Create(fileName, vm); |
| | | TipFormHelper.ShowInfo("导出成功!"); |
| | | }; |
| | | dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 方案处理 |
| | | |
| | | return vm; |
| | | } |
| | | |
| | | #endregion |
| | | //导出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 导出报告 |
| | | |
| | | #region 当前工况 |
| | | |
| | |
| | | AddWorking(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 当前工况 |
| | | |
| | | #region 选择工况 |
| | | |
| | |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.GetAll(); |
| | | allMonitorValueList.UpdateMonitorValue(rhs.MonitorInfo); |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(); |
| | | }; |
| | | dlg.DeleteDataEvent += (rhs) => |
| | | { |
| | |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 选择工况 |
| | | |
| | | #region 监测分析 |
| | | |
| | | //监测分析列表控件 |
| | | private HydroWorkingMonitorAnalyListCtrl _monitorAnalyListCtrl = null; |
| | | private HydroMonitorAnalyListCtrl _monitorAnalyListCtrl = null; |
| | | |
| | | //获取监测分析列表控件 |
| | | private HydroWorkingMonitorAnalyListCtrl GetMonitorAnalyListCtrl() |
| | | private HydroMonitorAnalyListCtrl GetMonitorAnalyListCtrl() |
| | | { |
| | | if (_monitorAnalyListCtrl == null) |
| | | { |
| | | _monitorAnalyListCtrl = new HydroWorkingMonitorAnalyListCtrl(); |
| | | _monitorAnalyListCtrl = new HydroMonitorAnalyListCtrl(); |
| | | _monitorAnalyListCtrl.Dock = DockStyle.Fill; |
| | | _monitorAnalyListCtrl.HydroViewEvent += (code) => |
| | | { |
| | |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroWorkingMonitorAnalyListCtrl) |
| | | if (this.controlContainerBottom.Controls[0] is HydroMonitorAnalyListCtrl) |
| | | { |
| | | return true; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //显示监测值列表控件 |
| | | //显示监测分析列表控件 |
| | | private async void ShowMonitorAnalyListCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var monitorAnalyListCtrl = GetMonitorAnalyListCtrl(); |
| | | if (!IsMonitorAnalyListCtrlVisible) |
| | | { |
| | |
| | | this.docPnlBottom.Text = "监测分析"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var allMontorList = await GetMonitorAnalyseList(); |
| | | |
| | | var allMonitorList = await GetMonitorList(); |
| | | var isHead = _calcuPressModeIsHead; |
| | | var allEvaluationList = await GetEvaluationList(); |
| | | |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, GetCalcuResult()); |
| | | var workingHelper = GetWorkingHelper(); |
| | | monitorAnalyListCtrl.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | } |
| | | else |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allWorkingList); |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMonitorList, allWorkingList, isHead, allEvaluationList); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //精度评估 |
| | | private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var allMonitorList = await GetMonitorDockingList(); |
| | | |
| | | 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 barBtnWorkingLossStatistics_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 HydroSingleWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossStatisticsDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //综合分析 |
| | | private async void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | //获取选择节点 |
| | | private HydroNodeInfo GetSelectNode() |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return null; |
| | | } |
| | | } |
| | | HydroVisualInfo visual = _visual; |
| | |
| | | var visualListHelper = GetVisualListHelper(); |
| | | visual = visualListHelper.GetVisual(linkInfo.StartCode); |
| | | } |
| | | return visual as HydroNodeInfo; |
| | | } |
| | | |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | //精度评估 |
| | | private async void barBtnAccuracy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | 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 SimulationSingleWorkingAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, workingHelper.CalcuResult, visual); |
| | | var dlg = new SimulationPumpAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | var dlg = new SimulationMultiWorkingAnalyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | var workingDlg = new SimulationPumpAnalyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion 工况分析 |
| | | //能效分析 |
| | | private async void barBtnEnergyAnaly_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 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 async void barBtnWorkingLossStatistics_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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 HydroLossStatisticsDlg(); |
| | | dlg.SetBindingData(hydroInfo, workingHelper.Working, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | |
| | | var workingDlg = new HydroLossStatisticsWorkingDlg(); |
| | | workingDlg.SetBindingData(hydroInfo, workingList, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | //综合分析 |
| | | private async void barBtnWorkingAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | var selectNode = GetSelectNode(); |
| | | if (selectNode == null) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | 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 SimulationMultiAnalyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, allMonitorList, workingHelper.Working, selectNode, workingHelper.CalcuResult, isHead, allEvaluationList); |
| | | dlg.ShowDialog(); |
| | | return; |
| | | } |
| | | |
| | | var workingDlg = new SimulationMultiAnalyWorkingDlg(); |
| | | workingDlg.SetBindingData(_hydroInfo, allMonitorList, workingList, selectNode, isHead, allEvaluationList); |
| | | workingDlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region 损失曲线 |
| | | |
| | | //单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveInteropCtrl _singleWorkingLossCurveCtrl = null; |
| | | //损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl _lossCurveInteropCtrl = null; |
| | | |
| | | //获取单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveInteropCtrl GetSingleWorkingLossCurveCtrl() |
| | | //获取损失曲线交互控件 |
| | | private HydroLossCurveInteropCtrl GetLossCurveInteropCtrl() |
| | | { |
| | | if (_singleWorkingLossCurveCtrl == null) |
| | | if (_lossCurveInteropCtrl == null) |
| | | { |
| | | _singleWorkingLossCurveCtrl = new HydroSingleWorkingLossCurveInteropCtrl(); |
| | | _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); |
| | | }; |
| | | _singleWorkingLossCurveCtrl.HydroSpecialDisplayEvent += (list) => |
| | | _lossCurveInteropCtrl.HydroSpecialDisplayEvent += (list) => |
| | | { |
| | | _bimfaceCtrl?.SetLogicOutlineGlowEffect(list); |
| | | }; |
| | | _singleWorkingLossCurveCtrl.HydroCancelSpecialDisplayEvent += () => |
| | | _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 HydroSingleWorkingLossCurveInteropCtrl) |
| | | 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 |
| | | #endregion 损失曲线 |
| | | |
| | | #region 方案管理 |
| | | |
| | |
| | | } |
| | | |
| | | #endregion 方案管理 |
| | | |
| | | |
| | | |
| | | |
| | | } |