using System.ComponentModel.DataAnnotations;
using Yw.Untity;
namespace IStation
{
///
///
///
public class CombineStatisticsViewModel: ModelScadaValidViewModel
{
public CombineStatisticsViewModel() { }
public CombineStatisticsViewModel(ModelScadaValidViewModel rhs) : base(rhs)
{
}
public CombineStatisticsViewModel(CombineStatisticsViewModel rhs):base(rhs)
{
this.RunCount1 = rhs.RunCount1;
this.RunCount2 = rhs.RunCount2;
this.RunFlags1 = rhs.RunFlags1;
this.RunFlags2 = rhs.RunFlags2;
}
[Display(Name = "运行数量")]
public int RunCount1 { get; set; }
[Display(Name = "运行数量")]
public int RunCount2 { get; set; }
[Display(Name = "运行组合")]
public string RunFlags1 { get; set; }
[Display(Name = "运行组合")]
public string RunFlags2 { get; set; }
[Display(Name = "总流量")]
public double? TotalFlow1 { get; set; }
[Display(Name = "总流量")]
public double? TotalFlow2 { get; set; }
public void Statistics()
{
var runFlag1 = new List();
if (this.Pump11s > 0)
runFlag1.Add(11);
if (this.Pump12s > 0)
runFlag1.Add(12);
if (this.Pump13s > 0)
runFlag1.Add(13);
if (this.Pump14s > 0)
runFlag1.Add(14);
if (this.Pump15s > 0)
runFlag1.Add(15);
if (this.Pump16s > 0)
runFlag1.Add(16);
if (this.Pump17s > 0)
runFlag1.Add(17);
if (this.Pump18s > 0)
runFlag1.Add(18);
this.RunCount1 = runFlag1.Count;
this.RunFlags1 = IntListHelper.ToString(runFlag1);
var runFlag2 = new List();
if (this.Pump21s > 0)
runFlag2.Add(21);
if (this.Pump22s > 0)
runFlag2.Add(22);
if (this.Pump23s > 0)
runFlag2.Add(23);
if (this.Pump24s > 0)
runFlag2.Add(24);
if (this.Pump25s > 0)
runFlag2.Add(25);
if (this.Pump26s > 0)
runFlag2.Add(26);
if (this.Pump27s > 0)
runFlag2.Add(27);
this.RunCount2 = runFlag2.Count;
this.RunFlags2 = IntListHelper.ToString(runFlag2);
this.TotalFlow1 = this.JD1F + this.JD2F + this.JD3F;
this.TotalFlow2 = this.DN2400F + this.DN2700F;
}
}
}