| | |
| | | this.layoutControl1.SetupLayoutControl(); |
| | | } |
| | | //200,80 |
| | | |
| | | /// <summary> |
| | | /// 查看组件事件 |
| | | /// </summary> |
| | | public event Action<Yw.Model.HydroVisualInfo> HydroViewEvent; |
| | | |
| | | private Yw.Model.HydroVisualInfo _visual = null;//构件 |
| | | private HydroWorkingTankViewModel _working = null;//工况 |
| | | |
| | | private Yw.Model.HydroTankInfo _visual = null;//组件 |
| | | private HydroWorkingTankViewModel _working = null; //工况 |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Model.HydroVisualInfo visual) |
| | | public void SetBindingData(Yw.Model.HydroVisualInfo visual, HydroWorkingVisualViewModel working = null) |
| | | { |
| | | var tank = visual as Yw.Model.HydroTankInfo; |
| | | if (tank == null) |
| | | { |
| | | return; |
| | | } |
| | | _visual = tank; |
| | | this.layoutGroupCaption.Text = HydroParterCatalogHelper.GetName(Yw.Hydro.ParterCatalog.Tank); |
| | | if (!string.IsNullOrEmpty(visual.Name)) |
| | | { |
| | | this.layoutGroupCaption.Text = visual.Name; |
| | | } |
| | | _working = new HydroWorkingTankViewModel(tank); |
| | | UpdateBindingData(_working); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新绑定 |
| | | /// </summary> |
| | | public void UpdateBindingData(HydroWorkingVisualViewModel workingInfo) |
| | | { |
| | | _visual = visual as Yw.Model.HydroTankInfo; |
| | | if (_visual == null) |
| | | { |
| | | return; |
| | | } |
| | | _working = workingInfo as HydroWorkingTankViewModel; |
| | | this.layoutGroupCaption.Text = HydroParterCatalogHelper.GetName(Yw.Hydro.ParterCatalog.Tank); |
| | | if (!string.IsNullOrEmpty(_visual.Name)) |
| | | { |
| | | this.layoutGroupCaption.Text = _visual.Name; |
| | | } |
| | | _working = working as HydroWorkingTankViewModel; |
| | | if (_working == null) |
| | | { |
| | | return; |
| | | _working = new HydroWorkingTankViewModel(_visual); |
| | | } |
| | | this.txtInitLevel.EditValue = _working.InitLevel; |
| | | } |
| | |
| | | /// </summary> |
| | | public HydroWorkingVisualViewModel GetWorking() |
| | | { |
| | | if (_visual == null) |
| | | { |
| | | return default; |
| | | } |
| | | if (_working == null) |
| | | { |
| | | return default; |