| | |
| | | ( |
| | | XhsProjectVmo project, |
| | | XhsProjectSiteVmo projectSite, |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | HydroWorkingVmo working |
| | | ) |
| | | { |
| | | _project = project; |
| | | _projectSite = projectSite; |
| | | _hydroInfo = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | _working = working; |
| | | _hydroInfo.UpdateWorkingInfo(_working.WorkingInfo); |
| | | this.PageTitle.Caption = $"水力模拟\r\n{_working.Name}"; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData |
| | | ( |
| | | XhsProjectVmo project, |
| | | XhsProjectSiteVmo projectSite, |
| | | XhsSchemeVmo scheme, |
| | | Yw.Model.HydroModelInfo hydroInfo, |
| | | HydroWorkingVmo working |
| | |
| | | _hydroInfo = hydroInfo.Adapt<Yw.Model.HydroModelInfo>(); |
| | | _working = working; |
| | | _hydroInfo.UpdateWorkingInfo(_working.WorkingInfo); |
| | | this.PageTitle.Caption = $"{scheme.Name}\r\n{_working.Name}"; |
| | | if (_scheme == null) |
| | | { |
| | | this.PageTitle.Caption = $"水力模拟\r\n{_working.Name}"; |
| | | } |
| | | else |
| | | { |
| | | this.PageTitle.Caption = $"{scheme.Name}\r\n{_working.Name}"; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #region 属性控件 |
| | | |
| | | //属性控件 |
| | | private HydroVisualPropertyViewCtrl _propertyCtrl = null; |
| | | private SimulationPropertyCtrl _propertyCtrl = null; |
| | | |
| | | //获取属性控件 |
| | | private HydroVisualPropertyViewCtrl GetPropertyCtrl() |
| | | private SimulationPropertyCtrl GetPropertyCtrl() |
| | | { |
| | | if (_hydroInfo == null) |
| | | { |
| | |
| | | } |
| | | if (_propertyCtrl == null) |
| | | { |
| | | _propertyCtrl = new HydroVisualPropertyViewCtrl(); |
| | | _propertyCtrl = new SimulationPropertyCtrl(); |
| | | _propertyCtrl.Dock = DockStyle.Fill; |
| | | _propertyCtrl.HydroViewEvent += (visualViewModel) => |
| | | _propertyCtrl.AllowEdit = false; |
| | | _propertyCtrl.HydroViewEvent += (visual) => |
| | | { |
| | | SelectVisual(GetVisual(visualViewModel), eVisualSource.Property); |
| | | SelectVisual(visual, eVisualSource.Property); |
| | | }; |
| | | _propertyCtrl.BlinkLinkNodeEvent += async (link, linkNodeCode) => |
| | | { //强调连接节点 |
| | |
| | | _propertyCtrl?.UpdateRows(); |
| | | } |
| | | |
| | | //清理属性控件 |
| | | private void ClearPropertyCtrl() |
| | | { |
| | | if (_propertyCtrl != null) |
| | | { |
| | | _propertyCtrl.SelectedObject = null; |
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | return; |
| | | } |
| | | var dlg = new SimulationSingleWorkingEnergyDlg(); |
| | | dlg.SetBindingData(workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | dlg.SetBindingData(workingHelper.Working, workingHelper.HydroInfo, workingHelper.CalcuResult); |
| | | dlg.ShowDialog(); |
| | | } |
| | | |