using Yw.Model;
namespace Yw.WinFrmUI
{
///
/// 连接节点
///
public class HydroJunctionPropertyViewModel : HydroNodePropertyViewModel
{
///
///
///
public HydroJunctionPropertyViewModel() : base() { }
///
///
///
public HydroJunctionPropertyViewModel(Yw.Model.HydroJunctionInfo rhs) : base(rhs)
{
this.Elev = rhs.Elev;
this.UpdatePropStatus(nameof(this.Elev), rhs, nameof(rhs.Elev));
this.MinorLoss = rhs.MinorLoss;
this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
this.Demand = rhs.Demand;
this.UpdatePropStatus(nameof(this.Demand), rhs, nameof(rhs.Demand));
this.DemandPattern = rhs.DemandPattern;
this.UpdatePropStatus(nameof(this.DemandPattern), rhs, nameof(rhs.DemandPattern));
}
///
/// 标高/高程
///
[Category("数据")]
[DisplayName("标高")]
[PropertyOrder(101)]
[DisplayUnit("m")]
[Browsable(true)]
public double Elev { get; set; }
///
/// 损失系数
///
[Category("数据")]
[DisplayName("损失系数")]
[PropertyOrder(33)]
[Browsable(true)]
public double? MinorLoss { get; set; }
///
/// 需水量
///
[Category("数据")]
[DisplayName("需水量")]
[PropertyOrder(102)]
[DisplayUnit("m³/h")]
[Browsable(true)]
public double? Demand { get; set; }
///
/// 需水模式
///
[Category("数据")]
[DisplayName("需水模式")]
[PropertyOrder(103)]
[IsHydroPatternPro(HydroPattern.Demand)]
[Browsable(true)]
public string DemandPattern { get; set; }
///
/// 更新属性
///
public override void UpdateProperty(HydroParterInfo rhs, List allParterList)
{
base.UpdateProperty(rhs, allParterList);
if (rhs is Yw.Model.HydroJunctionInfo hydroJunctionInfo)
{
this.Elev = hydroJunctionInfo.Elev;
this.UpdatePropStatus(nameof(this.Elev), hydroJunctionInfo, nameof(hydroJunctionInfo.Elev));
this.MinorLoss = hydroJunctionInfo.MinorLoss;
this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(hydroJunctionInfo.MinorLoss));
this.Demand = hydroJunctionInfo.Demand;
this.UpdatePropStatus(nameof(this.Demand), hydroJunctionInfo, nameof(hydroJunctionInfo.Demand));
this.DemandPattern = hydroJunctionInfo.DemandPattern;
this.UpdatePropStatus(nameof(this.DemandPattern), hydroJunctionInfo, nameof(hydroJunctionInfo.DemandPattern));
}
}
}
}