| | |
| | | /// <summary> |
| | | /// 管段属性视图 |
| | | /// </summary> |
| | | public class HydroLinkPropertyViewModel : HydroParterPropertyViewModel, IHydroCalcuLinkProperty |
| | | public class HydroLinkPropertyViewModel : HydroParterPropertyViewModel, IHydroCalcuLinkResult |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public HydroLinkPropertyViewModel() { } |
| | | public HydroLinkPropertyViewModel() : base() { } |
| | | |
| | | /// <summary> |
| | | /// |
| | |
| | | public HydroLinkPropertyViewModel(Yw.Model.HydroLinkInfo rhs) : base(rhs) |
| | | { |
| | | this.StartCode = rhs.StartCode; |
| | | this.UpdatePropStatus(nameof(this.StartCode), rhs, nameof(rhs.StartCode)); |
| | | this.EndCode = rhs.EndCode; |
| | | this.LinkStatus = rhs.LinkStatus; |
| | | this.UpdatePropStatus(nameof(this.EndCode), rhs, nameof(rhs.EndCode)); |
| | | this.LinkStatus = HydroLinkStatusHelper.GetStatusName(rhs.LinkStatus); |
| | | this.UpdatePropStatus(nameof(this.LinkStatus), rhs, nameof(rhs.LinkStatus)); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 上游节点编码 |
| | | /// 上游节点 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("上游节点编码")] |
| | | [DisplayName("上游节点")] |
| | | [PropertyOrder(11)] |
| | | [Browsable(true)] |
| | | [ShowEditor(false)] |
| | | public string StartCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 下游节点编码 |
| | | /// 下游节点 |
| | | /// </summary> |
| | | [Category("基础信息")] |
| | | [DisplayName("下游节点编码")] |
| | | [DisplayName("下游节点")] |
| | | [PropertyOrder(12)] |
| | | [Browsable(true)] |
| | | [ShowEditor(false)] |
| | | public string EndCode { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 管道状态 |
| | | /// 管段状态 |
| | | /// </summary> |
| | | [Category("数据")] |
| | | [DisplayName("管道状态")] |
| | | [DisplayName("管段状态")] |
| | | [PropertyOrder(13)] |
| | | [Browsable(true)] |
| | | public virtual string LinkStatus { get; set; } |
| | |
| | | [DisplayName("流量")] |
| | | [PropertyOrder(10001)] |
| | | [Browsable(true)] |
| | | [DisplayUnit("m³/h")] |
| | | [IsHydroCalcuPro(true)] |
| | | [ShowEditor(false)] |
| | | public double? CalcuFlow { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | [DisplayName("流速")] |
| | | [PropertyOrder(10002)] |
| | | [Browsable(true)] |
| | | [DisplayUnit("m/s")] |
| | | [IsHydroCalcuPro(true)] |
| | | [ShowEditor(false)] |
| | | public double? CalcuVelocity { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | [DisplayName("水头损失")] |
| | | [PropertyOrder(10003)] |
| | | [Browsable(true)] |
| | | [DisplayUnit("m")] |
| | | [IsHydroCalcuPro(true)] |
| | | [ShowEditor(false)] |
| | | public double? CalcuHeadLoss { get; set; } |
| | | |
| | | /// <summary> |
| | |
| | | if (rhs is Yw.Model.HydroLinkInfo hydroLinkInfo) |
| | | { |
| | | this.StartCode = hydroLinkInfo.StartCode; |
| | | this.UpdatePropStatus(nameof(this.StartCode), hydroLinkInfo, nameof(hydroLinkInfo.StartCode)); |
| | | this.EndCode = hydroLinkInfo.EndCode; |
| | | this.LinkStatus = hydroLinkInfo.LinkStatus; |
| | | this.UpdatePropStatus(nameof(this.EndCode), hydroLinkInfo, nameof(hydroLinkInfo.EndCode)); |
| | | this.LinkStatus = HydroLinkStatusHelper.GetStatusName(hydroLinkInfo.LinkStatus); |
| | | this.UpdatePropStatus(nameof(this.LinkStatus), hydroLinkInfo, nameof(hydroLinkInfo.LinkStatus)); |
| | | } |
| | | } |
| | | |
| | |
| | | /// 更新计算属性 |
| | | /// </summary> |
| | | /// <param name="rhs"></param> |
| | | public override void UpdateCalcuProperty(IHydroCalcuProperty rhs) |
| | | public override void UpdateCalcuProperty(IHydroCalcuResult rhs) |
| | | { |
| | | base.UpdateCalcuProperty(rhs); |
| | | if (rhs is IHydroCalcuLinkProperty calcuLinkProperty) |
| | | if (rhs is IHydroCalcuLinkResult calcuLinkProperty) |
| | | { |
| | | this.CalcuFlow = calcuLinkProperty.CalcuFlow; |
| | | this.CalcuVelocity = calcuLinkProperty.CalcuVelocity; |
| | | this.CalcuHeadLoss = calcuLinkProperty.CalcuHeadLoss; |
| | | this.CalcuFlow = calcuLinkProperty.CalcuFlow ?? Math.Round(calcuLinkProperty.CalcuFlow.Value, 1); |
| | | this.CalcuVelocity = calcuLinkProperty.CalcuVelocity ?? Math.Round(calcuLinkProperty.CalcuVelocity.Value, 2); |
| | | this.CalcuHeadLoss = calcuLinkProperty.CalcuHeadLoss ?? Math.Round(calcuLinkProperty.CalcuHeadLoss.Value, 2); |
| | | } |
| | | } |
| | | |