using Yw.Model;
namespace Yw.WinFrmUI
{
///
/// 水池属性视图
///
public class HydroTankPropertyViewModel : HydroSourcePropertyViewModel
{
///
///
///
public HydroTankPropertyViewModel() : base() { }
///
///
///
public HydroTankPropertyViewModel(Yw.Model.HydroTankInfo rhs) : base(rhs)
{
this.PoolElev = rhs.PoolElev;
this.UpdatePropStatus(nameof(this.PoolElev), rhs, nameof(rhs.PoolElev));
this.InitLevel = rhs.InitLevel;
this.UpdatePropStatus(nameof(this.InitLevel), rhs, nameof(rhs.InitLevel));
this.MinLevel = rhs.MinLevel;
this.UpdatePropStatus(nameof(this.MinLevel), rhs, nameof(rhs.MinLevel));
this.MaxLevel = rhs.MaxLevel;
this.UpdatePropStatus(nameof(this.MaxLevel), rhs, nameof(rhs.MaxLevel));
this.DN = rhs.DN;
this.UpdatePropStatus(nameof(this.DN), rhs, nameof(rhs.DN));
this.MinVol = rhs.MinVol;
this.UpdatePropStatus(nameof(this.MinVol), rhs, nameof(rhs.MinVol));
this.VolCurve = rhs.VolCurve;
this.UpdatePropStatus(nameof(this.VolCurve), rhs, nameof(rhs.VolCurve));
this.OverFlow = rhs.OverFlow;
this.UpdatePropStatus(nameof(this.OverFlow), rhs, nameof(rhs.OverFlow));
}
///
/// 池底标高
///
[Category("数据")]
[DisplayName("池底标高")]
[PropertyOrder(101)]
[DisplayUnit("m")]
[Browsable(true)]
public double PoolElev { get; set; }
///
/// 初始水位
///
[Category("数据")]
[DisplayName("初始水位")]
[PropertyOrder(102)]
[DisplayUnit("m")]
[Browsable(true)]
public double InitLevel { get; set; }
///
/// 最低水位
///
[Category("数据")]
[DisplayName("最低水位")]
[PropertyOrder(103)]
[DisplayUnit("m")]
[Browsable(true)]
public double MinLevel { get; set; }
///
/// 最高水位
///
[Category("数据")]
[DisplayName("最高水位")]
[PropertyOrder(104)]
[DisplayUnit("m")]
[Browsable(true)]
public double MaxLevel { get; set; }
///
/// 公称直径
///
[Category("数据")]
[DisplayName("公称直径")]
[PropertyOrder(105)]
[DisplayUnit("m")]
[Browsable(true)]
public double DN { get; set; }
///
/// 最小容积
///
[Category("数据")]
[DisplayName("最小容积")]
[PropertyOrder(106)]
[DisplayUnit("m³")]
[Browsable(true)]
public double MinVol { get; set; }
///
/// 容积曲线
///
[Category("数据")]
[DisplayName("容积曲线")]
[PropertyOrder(107)]
[Browsable(true)]
public string VolCurve { get; set; }
///
/// 是否允许溢流
///
[Category("数据")]
[DisplayName("是否允许溢流")]
[PropertyOrder(108)]
[Browsable(true)]
public bool OverFlow { get; set; }
///
/// 更新属性
///
///
///
public override void UpdateProperty(HydroParterInfo rhs, List allParterList)
{
base.UpdateProperty(rhs, allParterList);
if (rhs is Yw.Model.HydroTankInfo hydroTankInfo)
{
this.PoolElev = hydroTankInfo.PoolElev;
this.UpdatePropStatus(nameof(this.PoolElev), hydroTankInfo, nameof(hydroTankInfo.PoolElev));
this.InitLevel = hydroTankInfo.InitLevel;
this.UpdatePropStatus(nameof(this.InitLevel), hydroTankInfo, nameof(hydroTankInfo.InitLevel));
this.MinLevel = hydroTankInfo.MinLevel;
this.UpdatePropStatus(nameof(this.MinLevel), hydroTankInfo, nameof(hydroTankInfo.MinLevel));
this.MaxLevel = hydroTankInfo.MaxLevel;
this.UpdatePropStatus(nameof(this.MaxLevel), hydroTankInfo, nameof(hydroTankInfo.MaxLevel));
this.DN = hydroTankInfo.DN;
this.UpdatePropStatus(nameof(this.DN), hydroTankInfo, nameof(hydroTankInfo.DN));
this.MinVol = hydroTankInfo.MinVol;
this.UpdatePropStatus(nameof(this.MinVol), hydroTankInfo, nameof(hydroTankInfo.MinVol));
this.VolCurve = hydroTankInfo.VolCurve;
this.UpdatePropStatus(nameof(this.VolCurve), hydroTankInfo, nameof(hydroTankInfo.VolCurve));
this.OverFlow = hydroTankInfo.OverFlow;
this.UpdatePropStatus(nameof(this.OverFlow), hydroTankInfo, nameof(hydroTankInfo.OverFlow));
}
}
}
}