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