Shuxia Ning
2024-08-28 1a8a81785470302fc7fbd6914a9df5d1094dac2a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System.ComponentModel.DataAnnotations;
using Yw.Untity;
 
namespace IStation
{
    /// <summary>
    /// 
    /// </summary>
    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<int>();
            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<int>();
            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;
        }
 
    }
}