| | |
| | | using DevExpress.Diagram.Core.Native; |
| | | using Castle.Core.Logging; |
| | | using DevExpress.CodeParser; |
| | | using DevExpress.Diagram.Core.Native; |
| | | using DevExpress.Mvvm.Native; |
| | | using DevExpress.Utils.MVVM; |
| | | using DevExpress.XtraMap; |
| | |
| | | } |
| | | if (_bimfaceCtrl == null) |
| | | { |
| | | var overlay = this.ShowOverlay(); |
| | | _bimfaceCtrl = new SimulationBimfaceCtrl(); |
| | | _bimfaceCtrl.Dock = DockStyle.Fill; |
| | | WaitFormHelper.ShowWaitForm(this.FindForm(), "正在加载模型,请稍后..."); |
| | | await _bimfaceCtrl.InitialData(_project, _projectSite); |
| | | _bimfaceCtrl.LoadCompletedEvent += () => |
| | | {//view加载完成事件 |
| | | overlay.Close(); |
| | | WaitFormHelper.HideWaitForm(); |
| | | this.barCkDecorator.Checked = false; |
| | | this.barCkGrading.Checked = true; |
| | | }; |
| | |
| | | _propertyCtrl = new SimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.AllowEdit = true; |
| | | _propertyCtrl.CalcuResult = () => GetCalcuResult(); |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | SelectVisual(visual, eSimulationVisualSource.Property); |
| | |
| | | |
| | | #region 一键显隐 |
| | | |
| | | private List<string> _allDecoratorCodes = null; |
| | | |
| | | //获取装饰件code列表 |
| | | private async Task<List<string>> GetDecoratorCodes() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_allDecoratorCodes == null) |
| | | { |
| | | _allDecoratorCodes = await BLLFactory<Yw.BLL.HydroDecoratorInfo>.Instance.GetCodeListByModelID(_hydroInfo.ID, null); |
| | | } |
| | | if (_allDecoratorCodes == null) |
| | | { |
| | | _allDecoratorCodes = new List<string>(); |
| | | } |
| | | return _allDecoratorCodes; |
| | | } |
| | | |
| | | //设置装饰件可见性 |
| | | private async void SetDecoratorVisible(bool isDecoratorVisible) |
| | | { |
| | | var codes = _hydroInfo.Decorators?.Select(x => x.Code).Distinct().ToList(); |
| | | var codes = await GetDecoratorCodes(); |
| | | if (isDecoratorVisible) |
| | | { |
| | | await _bimfaceCtrl?.ShowComponents(codes); |
| | |
| | | private async void barCkFlowEffect_CheckedChanged(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var flowEffectHelper = await GetFlowEffectHelper(); |
| | | flowEffectHelper.Visible = this.barCkFlowEffect.Checked; |
| | | flowEffectHelper.Set(); |
| | | //flowEffectHelper.Visible = this.barCkFlowEffect.Checked; |
| | | //flowEffectHelper.Set(); |
| | | } |
| | | |
| | | #endregion 水流动画 |
| | | #endregion |
| | | |
| | | #region 监测点 |
| | | |
| | |
| | | return await helper.GetAnalyseList(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 监测点 |
| | | |
| | | #region 监测值 |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 监测值 |
| | | |
| | | #region 传感器测点 |
| | | |
| | |
| | | SetMonitorDockingList(_visual); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 传感器测点 |
| | | |
| | | #region 传感器测值 |
| | | |
| | |
| | | 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(); |
| | | monitorValueListCtrl.SetBindingData(allValueList); |
| | | } |
| | | |
| | |
| | | ShowMonitorDockingValueListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 传感器测值 |
| | | |
| | | #region 分析测点 |
| | | |
| | |
| | | return; |
| | | } |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | var allMonitorList = await monitorHelper.GetAnalyseList(); |
| | | var dlg = new SetHydroMonitorAnalyseListDlg(); |
| | | dlg.ReloadDataEvent += async (list) => |
| | | { |
| | |
| | | SetMonitorAnalyseList(_visual); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 分析测点 |
| | | |
| | | #region 测点标记 |
| | | |
| | |
| | | monitorMarkerHelper.Set(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 测点标记 |
| | | |
| | | #region 模型检查 |
| | | |
| | |
| | | |
| | | #endregion 计算标签 |
| | | |
| | | #endregion |
| | | #endregion 模型计算 |
| | | |
| | | #region 导出INP |
| | | |
| | |
| | | { |
| | | return; |
| | | } |
| | | var reportHelper = new SimulationWorkingReportHelper(); |
| | | var reportHelper = new HStation.ReportFile.SimulationWorkingReportHelper(); |
| | | reportHelper.Create(fileName, vm); |
| | | TipFormHelper.ShowInfo("导出成功!"); |
| | | }; |
| | |
| | | this.docPnlBottom.Text = "监测分析"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | var allMontorList = await GetMonitorList(); |
| | | var allMonitorValueList = await GetMonitorValueList(); |
| | | |
| | | var allMontorList = await GetMonitorAnalyseList(); |
| | | if (allWorkingList == null || allWorkingList.Count < 1) |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, GetWorking(), GetCalcuResult(), _visual); |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, GetCalcuResult()); |
| | | } |
| | | else |
| | | { |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allMonitorValueList, allWorkingList, _visual); |
| | | monitorAnalyListCtrl.SetBindingData(_hydroInfo, allMontorList, allWorkingList); |
| | | } |
| | | } |
| | | |
| | |
| | | ShowMonitorAnalyListCtrl(); |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 监测分析 |
| | | |
| | | #region 工况分析 |
| | | |
| | |
| | | //精度评估 |
| | | private async void barBtnWorkingEvaluation_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var monitorHelper = GetMonitorHelper(); |
| | | var allMonitorList = await monitorHelper.GetAll(); |
| | | var allMonitorList = await GetMonitorDockingList(); |
| | | |
| | | var workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | |
| | | { |
| | | var dlg = new SimulationMultiWorkingEnergyDlg(); |
| | | dlg.SetBindingData(_hydroInfo, allMonitorList, allCheckedWorkingList); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | //损失曲线 |
| | | private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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 workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | var dlg = new HydroSingleWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | #endregion 工况分析 |
| | | |
| | | #region 损失曲线 |
| | | |
| | | //单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveCtrl _singleWorkingLossCurveCtrl = null; |
| | | |
| | | //获取单工况损失曲线控件 |
| | | private HydroSingleWorkingLossCurveCtrl GetSingleWorkingLossCurveCtrl() |
| | | { |
| | | if (_singleWorkingLossCurveCtrl == null) |
| | | { |
| | | _singleWorkingLossCurveCtrl = new HydroSingleWorkingLossCurveCtrl(); |
| | | _singleWorkingLossCurveCtrl.Dock = DockStyle.Fill; |
| | | _singleWorkingLossCurveCtrl.HydroClickEvent += (code) => |
| | | { |
| | | var visual = GetVisual(code); |
| | | SelectVisual(visual, eSimulationVisualSource.None); |
| | | }; |
| | | } |
| | | return _singleWorkingLossCurveCtrl; |
| | | } |
| | | |
| | | //单工况损失曲线控件是否可见 |
| | | private bool IsSingleWorkingLossCurveCtrlVisible |
| | | { |
| | | get |
| | | { |
| | | if (this.docPnlBottom.Visibility == DevExpress.XtraBars.Docking.DockVisibility.Visible) |
| | | { |
| | | if (this.controlContainerBottom.Controls.Count > 0) |
| | | { |
| | | if (this.controlContainerBottom.Controls[0] is HydroSingleWorkingLossCurveCtrl) |
| | | { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | //显示单工况损失曲线控件 |
| | | private void ShowSingleWorkingLossCurveCtrl(Yw.Model.HydroModelInfo hydroInfo, HydroCalcuResult calcuResult, HydroVisualInfo visual) |
| | | { |
| | | var singleWorkingLossCurveCtrl = GetSingleWorkingLossCurveCtrl(); |
| | | if (!IsSingleWorkingLossCurveCtrlVisible) |
| | | { |
| | | this.controlContainerBottom.Controls.Clear(); |
| | | this.controlContainerBottom.Controls.Add(singleWorkingLossCurveCtrl); |
| | | this.docPnlBottom.Visibility = DevExpress.XtraBars.Docking.DockVisibility.Visible; |
| | | this.docPnlBottom.Text = "损失曲线"; |
| | | this.docPnlBottom.Height = 350; |
| | | } |
| | | singleWorkingLossCurveCtrl.SetBindingData(hydroInfo, calcuResult, visual); |
| | | } |
| | | |
| | | //损失曲线 |
| | | private void barBtnWorkingLossCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | 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 workingCheckedListHelper = GetWorkingCheckedListHelper(); |
| | | var allCheckedWorkingList = workingCheckedListHelper.GetCheckedWorkingList(); |
| | | if (allCheckedWorkingList == null || allCheckedWorkingList.Count < 1) |
| | | { |
| | | var workingHelper = GetWorkingHelper(); |
| | | if (!workingHelper.Initialized) |
| | | { |
| | | TipFormHelper.ShowWarn("请计算后重试!"); |
| | | return; |
| | | } |
| | | ShowSingleWorkingLossCurveCtrl(workingHelper.HydroInfo, workingHelper.CalcuResult, visual); |
| | | } |
| | | else |
| | | { |
| | | var dlg = new HydroMultiWorkingLossCurveDlg(); |
| | | dlg.HydroClickEvent += (code) => |
| | | { |
| | | SelectVisual(code, eSimulationVisualSource.None); |
| | | }; |
| | | dlg.SetBindingData(_hydroInfo, allCheckedWorkingList, visual); |
| | | dlg.ShowDialog(); |
| | | } |
| | | } |
| | | |
| | | #endregion 损失曲线 |
| | | |
| | | #region 方案管理 |
| | | |
| | |
| | | } |
| | | |
| | | #endregion 方案管理 |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |