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