namespace Yw.WinFrmUI
{
///
///
///
public class HydroSinglePumpListItemExtendViewModel
{
///
///
///
public HydroSinglePumpListItemExtendViewModel() { }
///
///
///
public HydroSinglePumpListItemExtendViewModel(Yw.Model.HydroPumpInfo rhs, bool isRated)
{
if (isRated)
{
this.Name = "额定曲线";
this.Color = Color.Black;
this.Hz = rhs.RatedHz;
this.Extend = 100;
}
else
{
this.Name = "设定曲线";
this.Color = Color.Red;
this.Hz = Math.Round(rhs.RatedHz * rhs.SpeedRatio, 1);
this.Extend = 100;
}
this.IsRated = isRated;
this.Vmo = rhs;
}
///
/// 名称
///
[Display(Name = "名称")]
public string Name { get; set; }
///
/// 颜色
///
[Display(Name = "颜色")]
public Color Color { get; set; }
///
/// 频率
///
[Display(Name = "频率(hz)")]
public double Hz { get; set; }
///
/// 转速
///
[Display(Name = "转速(r/min)")]
public double N
{
get
{
if (this.Vmo == null)
{
return default;
}
return Math.Round(this.Hz / this.Vmo.RatedHz * this.Vmo.RatedN, 1);
}
}
///
/// 延长
///
[Display(Name = "延长(%)")]
public double Extend { get; set; }
///
/// 额定
///
[Display(Name = "额定")]
public bool IsRated { get; set; }
///
///
///
public Yw.Model.HydroPumpInfo Vmo { get; set; }
}
}