namespace Yw.WinFrmUI
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public class HydroPumpListItemExtendViewModel
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public HydroPumpListItemExtendViewModel
|
(
|
Yw.Model.HydroPumpInfo rhs,
|
List<Yw.Model.HydroPumpInfo> allPumpList,
|
Yw.Model.HydroModelInfo hydroInfo
|
)
|
{
|
this.BeginGroup = string.IsNullOrEmpty(rhs.BeginGroup) ? string.Empty : rhs.BeginGroup;
|
this.Code = rhs.Code;
|
this.Name = rhs.Name;
|
if (allPumpList != null && allPumpList.Count > 0)
|
{
|
var index = allPumpList.IndexOf(rhs);
|
this.Color = HydroPumpCurveColorHelper.GetRandomColor(index);
|
}
|
this.Hz = Math.Round(rhs.RatedHz * rhs.SpeedRatio, 1);
|
this.Extend = 100;
|
this.RunStatus = rhs.LinkStatus == Yw.Hydro.LinkStatus.Open;
|
this.Vmo = rhs;
|
this.HydroInfo = hydroInfo;
|
}
|
|
/// <summary>
|
/// 分组
|
/// </summary>
|
[Display(Name = "分组")]
|
public string BeginGroup { get; set; }
|
|
/// <summary>
|
/// 编码
|
/// </summary>
|
[Display(Name = "编码")]
|
public string Code { get; set; }
|
|
/// <summary>
|
/// 名称
|
/// </summary>
|
[Display(Name = "名称")]
|
public string Name { get; set; }
|
|
/// <summary>
|
/// 颜色
|
/// </summary>
|
[Display(Name = "颜色")]
|
public Color Color { get; set; }
|
|
/// <summary>
|
/// 频率
|
/// </summary>
|
[Display(Name = "频率(hz)")]
|
public double Hz { get; set; }
|
|
/// <summary>
|
/// 延长
|
/// </summary>
|
[Display(Name = "延长(%)")]
|
public double Extend { get; set; }
|
|
/// <summary>
|
/// 运行状态
|
/// </summary>
|
[Display(Name = "运行状态")]
|
public bool RunStatus { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public Yw.Model.HydroPumpInfo Vmo { get; set; }
|
|
/// <summary>
|
///
|
/// </summary>
|
public Yw.Model.HydroModelInfo HydroInfo { get; set; }
|
|
|
}
|
}
|