| | |
| | | /// 新增工况事件 |
| | | /// </summary> |
| | | public event Action<HydroWorkingVmo> AppendWorkingEvent; |
| | | |
| | | /// <summary> |
| | | /// 保存模型事件 |
| | | /// </summary> |
| | | public event Func<Yw.Model.HydroModelInfo, Task<Yw.Model.HydroModelInfo>> SaveModelEvent; |
| | | |
| | | /// <summary> |
| | | /// 刷新模型事件 |
| | | /// </summary> |
| | | public event Func<Task<Yw.Model.HydroModelInfo>> RefreshModelEvent; |
| | | |
| | | /// <summary> |
| | | /// 更新方案事件 |
| | | /// </summary> |
| | | public event Action<XhsSchemeVmo> UpdateSchemeEvent; |
| | | |
| | | /// <summary> |
| | | /// 移除方案事件 |
| | | /// </summary> |
| | | public event Action<XhsSchemeVmo> RemoveSchemeEvent; |
| | | |
| | | |
| | | |
| | | private HStation.Vmo.XhsProjectVmo _project = null;//项目 |
| | | private HStation.Vmo.XhsProjectSiteVmo _projectSite = null;//项目站 |
| | |
| | | this.tabPageBimface.Controls.Add(bimfaceCtrl); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion BIM控件 |
| | | |
| | | #region Q3d控件 |
| | | |
| | |
| | | this.tabPageQ3d.Controls.Add(q3dCtrl); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion Q3d控件 |
| | | |
| | | #region 属性控件 |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != linkNodeCode).ToList(); |
| | | var linkList = allLinkList.Where(x => (x.StartCode == linkNodeCode || x.EndCode == linkNodeCode) && x.Code != link.Code).ToList(); |
| | | if (linkList == null || linkList.Count < 1) |
| | | { |
| | | return; |
| | |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Set(visual); |
| | | }; |
| | | |
| | | } |
| | | return _propertyCtrl; |
| | | } |
| | |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 属性控件 |
| | | |
| | | #region 选择构件 |
| | | |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Bimface: |
| | | { |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Q3d: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Property: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | | this.barBtnSetMonitor.Enabled = visual != null; |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.List: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Set: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Search: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Monitor: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Check: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Calcu: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | case eSimulationVisualSource.Warning: |
| | | { |
| | | _bimfaceCtrl?.ZoomAndSelectComponent(visual?.Code); |
| | |
| | | SetPropertyCtrl(visual); |
| | | } |
| | | break; |
| | | |
| | | default: break; |
| | | } |
| | | } |
| | |
| | | SelectVisual(visual, source); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 选择构件 |
| | | |
| | | #region 构件明细 |
| | | |
| | |
| | | return helper.GetSourceList(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 可见列表 |
| | | |
| | | #region 视图列表 |
| | | |
| | |
| | | return helper.GetVisualList(); |
| | | } |
| | | |
| | | #endregion |
| | | //获取可见视图 |
| | | private HydroVisualViewModel GetVisualViewModel(string code) |
| | | { |
| | | var helper = GetVisualVmListHelper(); |
| | | return helper.GetVisual(code); |
| | | } |
| | | |
| | | #endregion 视图列表 |
| | | |
| | | #region 明细控件 |
| | | |
| | |
| | | ShowVisualListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 明细控件 |
| | | |
| | | #region 构件显示 |
| | | |
| | |
| | | SetVisualVisible(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 构件显示 |
| | | |
| | | #endregion |
| | | #endregion 构件明细 |
| | | |
| | | #region 一键显隐 |
| | | |
| | |
| | | SetDecoratorVisible(this.barCkDecorator.Checked); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 一键显隐 |
| | | |
| | | #region 保存信息 |
| | | |
| | |
| | | |
| | | TipFormHelper.ShowSucceed("保存成功!"); |
| | | |
| | | |
| | | //Stopwatch sw = new Stopwatch(); |
| | | //sw.Start(); |
| | | //耗时巨大的代码 |
| | | //耗时巨大的代码 |
| | | //sw.Stop(); |
| | | //TimeSpan ts2 = sw.Elapsed; |
| | | //Console.WriteLine("Stopwatch总共花费{0}ms.", ts2.TotalMilliseconds); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 保存信息 |
| | | |
| | | #region 批量配置 |
| | | |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //压力表 |
| | | this.barBtnSetPressmeterList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetPressmeterList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Pressmeter; |
| | | this.barBtnSetPressmeterList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetPressmeterList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | this.barBtnSetPressmeterList.ItemClick += delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var dlg = new SetHydroPressmeterListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eSimulationVisualSource.Set); |
| | | UpdateVisualListCtrl(); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //喷嘴 |
| | | this.barBtnSetNozzleList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetNozzleList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Nozzle; |
| | | this.barBtnSetNozzleList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetNozzleList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | this.barBtnSetNozzleList.ItemClick += delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var dlg = new SetHydroNozzleListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Set); |
| | | }; |
| | | dlg.HydroChangedInfoEvent += visuals => |
| | | { |
| | | SelectVisual(visuals?.FirstOrDefault(), eSimulationVisualSource.Set); |
| | | UpdateVisualListCtrl(); |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //冷却塔 |
| | | this.barBtnSetCoolingList.ItemAppearance.Normal.ForeColor = Color.FromArgb(0, 122, 204); |
| | | this.barBtnSetCoolingList.ImageOptions.SvgImage = AssetsMainSvgImageHelper.Cooling; |
| | | this.barBtnSetCoolingList.ImageOptions.SvgImageSize = new Size(32, 32); |
| | | this.barBtnSetCoolingList.ImageOptions.AllowGlyphSkinning = DevExpress.Utils.DefaultBoolean.True; |
| | | this.barBtnSetCoolingList.ItemClick += delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | | var dlg = new SetHydroCoolingListDlg(); |
| | | dlg.SetBindingData(allVisualViewModelList); |
| | | dlg.HydroClickInfoEvent += (visual) => |
| | | { |
| | |
| | | }; |
| | | dlg.ShowDialog(); |
| | | }; |
| | | //换热器 |
| | | //压缩机 |
| | | this.barBtnSetCompressorList.ItemClick += delegate |
| | | { |
| | | var allVisualViewModelList = GetVisualViewModelList(); |
| | |
| | | dlg.ShowDialog(); |
| | | }; |
| | | } |
| | | |
| | | |
| | | //显示RadialMenu |
| | | private void barBtnSetList_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | |
| | | else |
| | | { |
| | | this.barBtnSetHydrantList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; |
| | | } |
| | | |
| | | //冷却塔 |
| | | if (_hydroInfo.Coolings == null || _hydroInfo.Coolings.Count < 1) |
| | | { |
| | | this.barBtnSetCoolingList.Visibility = DevExpress.XtraBars.BarItemVisibility.Never; |
| | | } |
| | | else |
| | | { |
| | | this.barBtnSetCoolingList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; |
| | | } |
| | | |
| | | //闷头 |
| | |
| | | { |
| | | this.barBtnSetCompressorList.Visibility = DevExpress.XtraBars.BarItemVisibility.Always; |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 批量配置 |
| | | |
| | | #region 构件查询 |
| | | |
| | |
| | | ShowSearchDlg(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 构件查询 |
| | | |
| | | #region 模型标注 |
| | | |
| | |
| | | markHelper.Set(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 模型标注 |
| | | |
| | | #region 颜色分级 |
| | | |
| | |
| | | gradingHelper.Set(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 颜色分级 |
| | | |
| | | #region 人工刷新 |
| | | |
| | |
| | | } |
| | | if (XtraMessageBox.Show("刷新后将丢失当前水力信息更改,是否继续刷新?", "询问", MessageBoxButtons.YesNo) == DialogResult.Yes) |
| | | { |
| | | |
| | | var hydroInfo = await this.RefreshModelEvent.Invoke(); |
| | | if (hydroInfo == null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 人工刷新 |
| | | |
| | | #region 水流动画 |
| | | |
| | |
| | | flowEffectHelper.Set(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 水流动画 |
| | | |
| | | #region 监测列表 |
| | | |
| | |
| | | SetMonitorList(_visual); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 监测点 |
| | | |
| | | #region 监测值 |
| | | |
| | |
| | | return _monitorValueHelper; |
| | | } |
| | | |
| | | //获取监测值列表 |
| | | private async Task<List<HydroMonitorValueViewModel>> GetMonitorValueList() |
| | | { |
| | | var helper = GetMonitorValueHelper(); |
| | | return await helper.Get(); |
| | | } |
| | | |
| | | //重置 |
| | | private void ResetMonitorValue() |
| | | { |
| | |
| | | var helper = GetMonitorValueHelper(); |
| | | helper.Reset(working.MonitorInfo); |
| | | } |
| | | |
| | | } |
| | | |
| | | #endregion |
| | |
| | | _monitorValueListCtrl.Dock = DockStyle.Fill; |
| | | _monitorValueListCtrl.HydroViewEvent += (code) => |
| | | { |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var visual = visualListHelper.GetVisual(code); |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.Monitor); |
| | | }; |
| | | } |
| | |
| | | this.docPnlBottom.Text = "监测值"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var monitorValueHelper = GetMonitorValueHelper(); |
| | | var allMonitorValueList = await monitorValueHelper.Get(); |
| | | monitorValueListCtrl.SetBindingData(allMonitorValueList); |
| | | var allMonitorValueList = await GetMonitorValueList(); |
| | | monitorValueListCtrl.SetBindingData(allMonitorValueList, _visual); |
| | | } |
| | | |
| | | //设置监测值 |
| | |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | #endregion 监测列表 |
| | | |
| | | #region 模型检查 |
| | | |
| | |
| | | ShowCheckCtrl(checkResult); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 模型检查 |
| | | |
| | | #region 模型计算 |
| | | |
| | |
| | | return _calcuResultHelper; |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 计算结果 |
| | | |
| | | #region 计算失败 |
| | | |
| | |
| | | calcuFailedCtrl.SetBindingData(calcuResult.FailedList); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 计算失败 |
| | | |
| | | #region 计算警告 |
| | | |
| | |
| | | calcuWaringCtrl.SetBindingData(calcuResult.WainingList, allVisualDict); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 计算警告 |
| | | |
| | | #region 计算标签 |
| | | |
| | |
| | | calcuResultLabelHelper.Set(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 管网修复 |
| | | |
| | | //修复管网 |
| | | private void Repair() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var checkResult = _hydroInfo.Check(); |
| | | if (!checkResult.Succeed) |
| | | { |
| | | ShowCheckCtrl(checkResult); |
| | | TipFormHelper.ShowWarn("检查失败导致无法进行试算,停止管网修复!"); |
| | | return; |
| | | } |
| | | var calcuResult = _hydroInfo.Calcu(Yw.EPAnet.CalcuMode.Simple); |
| | | if (!calcuResult.Succeed) |
| | | { |
| | | ShowCalcuFailedCtrl(calcuResult); |
| | | TipFormHelper.ShowWarn("试算失败,停止管网修复!"); |
| | | return; |
| | | } |
| | | var visualListHelper = GetVisualListHelper(); |
| | | var allLinkList = visualListHelper.GetLinkList(); |
| | | if (allLinkList != null && allLinkList.Count < 1) |
| | | { |
| | | TipFormHelper.ShowError("模型中未包含管段信息,停止管网修复!"); |
| | | return; |
| | | } |
| | | int count = 0; |
| | | foreach (var link in allLinkList) |
| | | { |
| | | var calcuLink = calcuResult.LinkList?.Find(x => x.Code == link.Code); |
| | | if (calcuLink == null) |
| | | { |
| | | continue; |
| | | } |
| | | if (!calcuLink.CalcuFlow.HasValue) |
| | | { |
| | | continue; |
| | | } |
| | | if (calcuLink.CalcuFlow.Value < 0) |
| | | { |
| | | var tempCode = link.StartCode; |
| | | link.StartCode = link.EndCode; |
| | | link.EndCode = tempCode; |
| | | count++; |
| | | } |
| | | } |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateProperty(); |
| | | UpdateVisualListCtrl(); |
| | | UpdatePropertyCtrl(); |
| | | TipFormHelper.ShowSucceed($"修复完成,共修复管段({count})个!"); |
| | | } |
| | | |
| | | //管网修复 |
| | | private void barBtnRepair_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | Repair(); |
| | | } |
| | | #endregion 计算标签 |
| | | |
| | | #endregion |
| | | |
| | |
| | | TipFormHelper.ShowSucceed("导出成功"); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 导出INP |
| | | |
| | | #region 水泵列表 |
| | | |
| | |
| | | //并联模拟 |
| | | private void barBtnPumpParallel_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | |
| | | PumpParallel(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 水泵列表 |
| | | |
| | | #region 水力计算 |
| | | |
| | |
| | | working.ModelID = vm.ModelID; |
| | | working.Name = vm.Name; |
| | | working.WorkingInfo = JsonHelper.Object2Json(vm.WorkingInfo); |
| | | working.MonitorInfo = JsonHelper.Object2Json(vm.MonitorInfo); |
| | | var useWorkingMonitorInfo = vm.MonitorInfo?.Where(x => x.PropValue.HasValue).ToList(); |
| | | if (useWorkingMonitorInfo != null && useWorkingMonitorInfo.Count > 0) |
| | | { |
| | | working.MonitorInfo = JsonHelper.Object2Json(useWorkingMonitorInfo); |
| | | } |
| | | working.SortCode = vm.SortCode; |
| | | working.Description = vm.Description; |
| | | |
| | |
| | | var visualVmListHelper = GetVisualVmListHelper(); |
| | | visualVmListHelper.UpdateCalcuProperty(calcuResult); |
| | | |
| | | #endregion |
| | | #endregion 视图列表 |
| | | |
| | | #region 当前构件 |
| | | |
| | | SelectVisual(_visual, eSimulationVisualSource.Calcu); |
| | | |
| | | #endregion |
| | | #endregion 当前构件 |
| | | |
| | | #region 构件明细 |
| | | |
| | | UpdateVisualListCtrl(); |
| | | |
| | | #endregion |
| | | #endregion 构件明细 |
| | | |
| | | #region 颜色分级 |
| | | |
| | | var gradingHelper = await GetGradingHelper(); |
| | | gradingHelper.Set(); |
| | | |
| | | #endregion |
| | | #endregion 颜色分级 |
| | | |
| | | #region 计算标签 |
| | | |
| | | var calcuResultLabelHelper = await GetCalcuResultLabelHelper(); |
| | | calcuResultLabelHelper.Set(); |
| | | |
| | | #endregion |
| | | |
| | | #endregion 计算标签 |
| | | }; |
| | | |
| | | dlg.ShowDialog(); |
| | | |
| | | } |
| | | |
| | | //水力计算 |
| | |
| | | Calcu(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 水力计算 |
| | | |
| | | #region 导出报告 |
| | | |
| | | private void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | private async void barBtnExportWord_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var fileName = FileDialogHelper.SaveWordDoc("导出Word报告"); |
| | | if (string.IsNullOrEmpty(fileName)) |
| | | if (_visual == null) |
| | | { |
| | | return; |
| | | SelectInputSource(); |
| | | if (_visual == null) |
| | | { |
| | | TipFormHelper.ShowWarn("请选择构件后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | var vm = new ReportViewModel(); |
| | | vm.ProjectName = _project.Name; |
| | | vm.Description = _project.Description; |
| | | SimulationWordReport word = new SimulationWordReport(); |
| | | word.Create(fileName, vm); |
| | | 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 SimulationWorkingReportHelper(); |
| | | reportHelper.Create(fileName, vm); |
| | | TipFormHelper.ShowInfo("导出成功!"); |
| | | }; |
| | | dlg.SetBindingData(_project, _hydroInfo, allMonitorList, working, calcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 导出报告 |
| | | |
| | | #region 当前工况 |
| | | |
| | |
| | | AddWorking(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 当前工况 |
| | | |
| | | #region 选择工况 |
| | | |
| | |
| | | return helper.GetWorkingList(); |
| | | } |
| | | |
| | | //获取选择工况列表 |
| | | private List<HydroWorkingVmo> GetCheckedWorkingList() |
| | | { |
| | | var helper = GetWorkingCheckedListHelper(); |
| | | return helper.GetCheckedWorkingList(); |
| | | } |
| | | |
| | | //更新工况选择列表 |
| | | public void UpdateWorkingCheckedList(HydroWorkingVmo working) |
| | | { |
| | |
| | | helper.Remove(working); |
| | | } |
| | | |
| | | #endregion 选择工况 |
| | | |
| | | #region 监测分析 |
| | | |
| | | //监测分析列表控件 |
| | | private HydroWorkingMonitorAnalyListCtrl _monitorAnalyListCtrl = null; |
| | | |
| | | //获取监测分析列表控件 |
| | | private HydroWorkingMonitorAnalyListCtrl GetMonitorAnalyListCtrl() |
| | | { |
| | | if (_monitorAnalyListCtrl == null) |
| | | { |
| | | _monitorAnalyListCtrl = new HydroWorkingMonitorAnalyListCtrl(); |
| | | _monitorAnalyListCtrl.Dock = DockStyle.Fill; |
| | | _monitorAnalyListCtrl.HydroViewEvent += (code) => |
| | | { |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.Monitor); |
| | | }; |
| | | } |
| | | return _monitorAnalyListCtrl; |
| | | } |
| | | |
| | | //监测分析列表控件是否可见 |
| | | private bool IsMonitorAnalyListCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlBottom.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroWorkingMonitorAnalyListCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示监测值列表控件 |
| | | private async void ShowMonitorAnalyListCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return; |
| | | } |
| | | var allWorkingList = GetCheckedWorkingList(); |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | } |
| | | var monitorAnalyListCtrl = GetMonitorAnalyListCtrl(); |
| | | if (!IsMonitorAnalyListCtrlVisible) |
| | | { |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(monitorAnalyListCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "监测分析"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var allMontorList = await GetMonitorList(); |
| | | var allMonitorValueList = await GetMonitorValueList(); |
| | | |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, GetWorking(), GetCalcuResult(), _visual); |
| | | } |
| | | else |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, allWorkingList, _visual); |
| | | } |
| | | } |
| | | |
| | | //监测分析 |
| | | private void barBtnWorkingMonitorAnaly_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | ShowMonitorAnalyListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | } |
| | | else |
| | | { |
| | | |
| | | var dlg = new SimulationMultiWorkingEnergyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | |
| | | //删除方案 |
| | | private async void DeleteScheme() |
| | | { |
| | | var bol = XtraMessageBox.Show("请问是否删除当前方案?", "询问", MessageBoxButtons.YesNo) == DialogResult.Yes; |
| | | if (!bol) |
| | | { |
| | | return; |
| | | } |
| | | if (_scheme == null) |
| | | { |
| | | return; |
| | |
| | | DeleteScheme(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 方案管理 |
| | | |
| | | |
| | | } |
| | | } |