using System.ComponentModel.DataAnnotations; using Yw.Untity; namespace IStation.Win { /// /// /// public class CombineStatisticsViewModel: ScadaModelValidViewModel { public CombineStatisticsViewModel() { } public CombineStatisticsViewModel(ScadaModelValidViewModel 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.Pump11 > 0) runFlag1.Add(11); if (this.Pump12 > 0) runFlag1.Add(12); if (this.Pump13 > 0) runFlag1.Add(13); if (this.Pump14 > 0) runFlag1.Add(14); if (this.Pump15 > 0) runFlag1.Add(15); if (this.Pump16 > 0) runFlag1.Add(16); if (this.Pump17 > 0) runFlag1.Add(17); if (this.Pump18 > 0) runFlag1.Add(18); this.RunCount1 = runFlag1.Count; this.RunFlags1 = IntListHelper.ToString(runFlag1); var runFlag2 = new List(); if (this.Pump21 > 0) runFlag2.Add(21); if (this.Pump22 > 0) runFlag2.Add(22); if (this.Pump23 > 0) runFlag2.Add(23); if (this.Pump24 > 0) runFlag2.Add(24); if (this.Pump25 > 0) runFlag2.Add(25); if (this.Pump26 > 0) runFlag2.Add(26); if (this.Pump27 > 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; } } }