| | |
| | | using DevExpress.Utils.MVVM; |
| | | using HStation.WinFrmUI.PhartRelation; |
| | | using HStation.WinFrmUI.Xhs; |
| | | using Yw.Model; |
| | | using Yw.WinFrmUI.HydroW3d; |
| | | using Yw.Model; |
| | | |
| | | namespace HStation.WinFrmUI |
| | | { |
| | |
| | | this.hydroVisualPropertyCtrl1.PropertyValueChangedEvent += HydroVisualPropertyCtrl1_PropertyValueChangedEvent; |
| | | this.hydroVisualPropertyCtrl1.MarkPropertyValueChangedEvent += HydroVisualPropertyCtrl1_MarkPropertyValueChangedEvent; |
| | | this.hydroVisualPropertyCtrl1.GradingPropertyValueChangedEvent += HydroPVisualPropertyCtrl1_GradingPropertyValueChangedEvent; |
| | | this.hydroVisualPropertyCtrl1.FlowEffectPropertyValueChangedEvent += HydroVisualPropertyCtrl1_FlowEffectPropertyValueChangedEvent; |
| | | } |
| | | |
| | | #region 事件集 |
| | | #region 事件集合 |
| | | |
| | | /// <summary> |
| | | /// 构件查看事件 |
| | |
| | | /// </summary> |
| | | public event Action<HydroVisualInfo> GradingPropertyValueChangedEvent; |
| | | |
| | | /// <summary> |
| | | /// 水流动画属性值改变事件 |
| | | /// </summary> |
| | | public event Action<HydroVisualInfo> FlowEffectPropertyValueChangedEvent; |
| | | private HydroChangeHelper _changeHelper = null;//改变辅助类 |
| | | private HydroPropStatusHelper _propStatusHelper = null;//属性状态辅助类 |
| | | |
| | | #endregion 事件集 |
| | | #endregion |
| | | |
| | | /// <summary> |
| | | /// 初始化数据 |
| | | /// </summary> |
| | | public void InitialData |
| | | ( |
| | | HydroChangeHelper changeHelper, |
| | | HydroPropStatusHelper propStatusHelper |
| | | ) |
| | | { |
| | | _changeHelper = changeHelper; |
| | | _propStatusHelper = propStatusHelper; |
| | | this.hydroVisualPropertyCtrl1.InitialData(changeHelper, propStatusHelper); |
| | | } |
| | | |
| | | #region 属性赋值 |
| | | |
| | |
| | | /// </summary> |
| | | public Func<HydroCalcuResult> CalcuResult { get; set; } |
| | | |
| | | #endregion 属性赋值 |
| | | #endregion |
| | | |
| | | #region 属性更新 |
| | | |
| | |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | } |
| | | |
| | | #endregion 属性更新 |
| | | #endregion |
| | | |
| | | #region 事件实现 |
| | | |
| | |
| | | var dlg = new AssetsTankSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(tankViewModel, output); |
| | | HydroMatchingHelper.Apply(tankViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsTankSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(tankViewModel, output); |
| | | HydroMatchingHelper.Apply(tankViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsBluntheadSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(bluntheadViewModel, output); |
| | | HydroMatchingHelper.Apply(bluntheadViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsElbowSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(elbowViewModel, output); |
| | | HydroMatchingHelper.Apply(elbowViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsThreelinkSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(threelinkViewModel, output); |
| | | HydroMatchingHelper.Apply(threelinkViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsFourlinkSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(fourlinkViewModel, output); |
| | | HydroMatchingHelper.Apply(fourlinkViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsMeterSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(meterViewModel, output); |
| | | HydroMatchingHelper.Apply(meterViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsFlowmeterSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(flowmeterViewModel, output); |
| | | HydroMatchingHelper.Apply(flowmeterViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsPressmeterSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(pressmeterViewModel, output); |
| | | HydroMatchingHelper.Apply(pressmeterViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsSprinklerSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(nozzleViewModel, output); |
| | | HydroMatchingHelper.Apply(nozzleViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsHydrantSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(hydrantViewModel, output); |
| | | HydroMatchingHelper.Apply(hydrantViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsCoolingSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(coolingViewModel, output); |
| | | HydroMatchingHelper.Apply(coolingViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsPipeSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(pipeViewModel, output); |
| | | HydroMatchingHelper.Apply(pipeViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.GradingPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | }; |
| | | dlg.SetBindingData(input); |
| | | dlg.ShowDialog(); |
| | | } |
| | | break; |
| | |
| | | var dlg = new SimulationPumpSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(pumpViewModel, output); |
| | | HydroMatchingHelper.Apply(pumpViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | var dlg = new AssetsValveSingleMatchingDlg(); |
| | | dlg.ReloadDataEvent += (output) => |
| | | { |
| | | HydroMatchingHelper.Apply(valveViewModel, output); |
| | | HydroMatchingHelper.Apply(valveViewModel, output, _changeHelper, _propStatusHelper); |
| | | this.hydroVisualPropertyCtrl1.UpdateRows(); |
| | | this.PropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | | this.MarkPropertyValueChangedEvent?.Invoke(vm.Vmo); |
| | |
| | | case HydroCurve.Valve: |
| | | { |
| | | var valveViewModel = vm as HydroValveViewModel; |
| | | var curveInfo = valveViewModel.HydroInfo.Curves?.Find(x => x.Code == valveViewModel.ValveSetting); |
| | | var curveInfo = valveViewModel.HydroInfo.Curves?.Find(x => x.Code == valveViewModel.CurveOL); |
| | | if (curveInfo != null) |
| | | { |
| | | if (long.TryParse(curveInfo.DbId, out long longDbId)) |
| | |
| | | } |
| | | } |
| | | |
| | | #endregion 事件实现 |
| | | #endregion |
| | | |
| | | #region 事件穿透 |
| | | |
| | |
| | | this.GradingPropertyValueChangedEvent?.Invoke(vm?.Vmo); |
| | | } |
| | | |
| | | //水流动画属性发生改变 |
| | | private void HydroVisualPropertyCtrl1_FlowEffectPropertyValueChangedEvent(HydroVisualViewModel vm) |
| | | { |
| | | this.FlowEffectPropertyValueChangedEvent?.Invoke(vm?.Vmo); |
| | | } |
| | | |
| | | #endregion 事件穿透 |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | } |