| | |
| | | /// </summary> |
| | | public event Action<List<Yw.Model.HydroPipeInfo>> ReloadDataEvent; |
| | | |
| | | //所有部件列表 |
| | | private List<Yw.Model.HydroPipeInfo> _allVisualList = null; |
| | | |
| | | private List<Yw.Model.HydroPipeInfo> _allVisualList = null;//所有部件列表 |
| | | private HydroChangeHelper _changeHelper = null;//改变辅助类 |
| | | private HydroPropStatusHelper _propStatusHelper = null;//属性状态辅助类 |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(Yw.Model.HydroPipeInfo visual) |
| | | public void SetBindingData |
| | | ( |
| | | Yw.Model.HydroPipeInfo visual, |
| | | HydroChangeHelper changeHelper = null, |
| | | HydroPropStatusHelper propStatusHelper = null |
| | | ) |
| | | { |
| | | var allParterList = visual == null ? null : new List<Yw.Model.HydroPipeInfo>() { visual }; |
| | | this.SetBindingData(allParterList); |
| | | this.SetBindingData(allParterList, changeHelper, propStatusHelper); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 绑定数据 |
| | | /// </summary> |
| | | public void SetBindingData(List<Yw.Model.HydroPipeInfo> allVisualList) |
| | | public void SetBindingData |
| | | ( |
| | | List<Yw.Model.HydroPipeInfo> allVisualList, |
| | | HydroChangeHelper changeHelper = null, |
| | | HydroPropStatusHelper propStatusHelper = null |
| | | ) |
| | | { |
| | | _allVisualList = allVisualList; |
| | | _changeHelper = changeHelper; |
| | | _propStatusHelper = propStatusHelper; |
| | | if (_allVisualList != null && _allVisualList.Count == 1) |
| | | { |
| | | var visual = _allVisualList.First(); |
| | |
| | | { |
| | | if (!string.IsNullOrEmpty(material)) |
| | | { |
| | | if (x.Material != material) |
| | | { |
| | | _changeHelper.Append(x, eChangeType.Update); |
| | | _propStatusHelper?.UpdatePropStatus(x.Code, nameof(x.Material), Yw.Hydro.ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过设置组件修改"); |
| | | } |
| | | x.Material = material; |
| | | } |
| | | if (diameter.HasValue) |
| | | { |
| | | if (x.Diameter != diameter) |
| | | { |
| | | _changeHelper.Append(x, eChangeType.Update); |
| | | _propStatusHelper?.UpdatePropStatus(x.Code, nameof(x.Diameter), Yw.Hydro.ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过设置组件修改"); |
| | | } |
| | | x.Diameter = diameter.Value; |
| | | } |
| | | if (length.HasValue) |
| | | { |
| | | if (x.Length != length) |
| | | { |
| | | _changeHelper.Append(x, eChangeType.Update); |
| | | _propStatusHelper?.UpdatePropStatus(x.Code, nameof(x.Length), Yw.Hydro.ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过设置组件修改"); |
| | | } |
| | | x.Length = length.Value; |
| | | } |
| | | if (roughness.HasValue) |
| | | { |
| | | if (x.Roughness != roughness) |
| | | { |
| | | _changeHelper.Append(x, eChangeType.Update); |
| | | _propStatusHelper?.UpdatePropStatus(x.Code, nameof(x.Roughness), Yw.Hydro.ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过设置组件修改"); |
| | | } |
| | | x.Roughness = roughness.Value; |
| | | } |
| | | if (minorLoss.HasValue) |
| | | { |
| | | if (x.MinorLoss != minorLoss) |
| | | { |
| | | _changeHelper.Append(x, eChangeType.Update); |
| | | _propStatusHelper?.UpdatePropStatus(x.Code, nameof(x.MinorLoss), Yw.Hydro.ePropStatus.Normal, $"{DateTime.Now.ToStandardString()}通过设置组件修改"); |
| | | } |
| | | x.MinorLoss = minorLoss.Value; |
| | | } |
| | | }); |