using DevExpress.XtraSpreadsheet.Export;
namespace Yw.WinFrmUI
{
///
///
///
public class HydroPumpAnalyWorkingPumpListItemViewModel
{
///
///
///
public HydroPumpAnalyWorkingPumpListItemViewModel() { }
///
///
///
public HydroPumpAnalyWorkingPumpListItemViewModel
(
Yw.Model.HydroPumpInfo rhs,
Dictionary allCalcuResultDict
)
{
this.BeginGroup = string.IsNullOrEmpty(rhs.BeginGroup) ? string.Empty : rhs.BeginGroup;
this.Name = rhs.Name;
this.Code = rhs.Code;
this.RatedHz = $"{rhs.RatedHz}hz";
this.LinkStatus = Yw.Hydro.PumpStatus.Closed;
if (allCalcuResultDict != null && allCalcuResultDict.Count > 0)
{
var list = allCalcuResultDict.Values.ToList();
if (list.Exists(x => x.Items != null && x.Items.Exists(t => t.Code == rhs.Code && t.LinkStatus == Yw.Hydro.PumpStatus.Open)))
{
this.LinkStatus = Yw.Hydro.PumpStatus.Open;
}
}
this.Description = rhs.Description;
this.Vmo = rhs;
}
///
/// 分组
///
public string BeginGroup { get; set; }
///
/// 名称
///
public string Name { get; set; }
///
/// 编码
///
public string Code { get; set; }
///
/// 额定频率
///
public string RatedHz { get; set; }
///
/// 运行状态
///
public string LinkStatus { get; set; }
///
/// 图片
///
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;
}
}
///
/// 说明
///
public string Description { get; set; }
///
/// vmo
///
public Yw.Model.HydroPumpInfo Vmo { get; set; }
}
}