using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Yw.WinFrmUI { /// /// /// public class HydroPumpListItemStateViewModel { /// /// /// public HydroPumpListItemStateViewModel() { } /// /// /// public HydroPumpListItemStateViewModel(Yw.Model.HydroPumpInfo rhs, Yw.Model.HydroModelInfo hydroInfo) { this.Code = rhs.Code; this.Name = rhs.Name; this.LinkStatus = rhs.LinkStatus; this.CurrentHz = Math.Round(rhs.RatedHz * rhs.SpeedRatio, 1); this.Description = rhs.Description; this.Vmo = rhs; this.HydroInfo = hydroInfo; } /// /// 编码 /// [Display(Name = "编码")] public string Code { get; set; } /// /// 名称 /// [Display(Name = "名称")] public string Name { get; set; } /// /// 运行状态 /// [Display(Name = "运行状态")] public string LinkStatus { get; set; } /// /// 频率 /// [Display(Name = "频率")] public double CurrentHz { get; set; } /// /// 图片 /// [Display(Name = "图片")] public Image Image { get { if (this.LinkStatus == Yw.Hydro.PumpStatus.Open) { return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_run_32; } return Yw.WinFrmUI.Hydro.Core.Properties.Resources.pump_shut_32; } } /// /// 说明 /// [Display(Name = "说明")] public string Description { get; set; } /// /// vmo /// public Yw.Model.HydroPumpInfo Vmo { get; set; } /// /// /// public Yw.Model.HydroModelInfo HydroInfo { get; set; } } }