tangxu
2022-10-08 6b437da7145139fda9cbff0acaa5b8e2295d11cd
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace IStation.Dto.DispatchAna
{
    /// <summary>
    /// 当前泵站能效分析记录
    /// </summary>
    public class StationEtaAnaRecord
    {
        /// <summary>
        /// 
        /// </summary>
        public StationEtaAnaRecord() { }
 
        /// <summary>
        /// 
        /// </summary>
        public StationEtaAnaRecord(Model.EtaMultiRealRecordPure rhs)
        {
            if (rhs.Qa != null)
            {
                this.Q = Math.Round(rhs.Qa.Value, 1);
            }
            if (rhs.Ha != null)
            {
                this.H = Math.Round(rhs.Ha.Value, 1);
            }
            if (rhs.Pa != null)
            {
                this.P = Math.Round(rhs.Pa.Value, 1);
            }
            if (rhs.Ea != null)
            {
                this.E = Math.Round(rhs.Ea.Value, 1);
            }
            if (rhs.WPa != null)
            {
                this.WP = Math.Round(rhs.WPa.Value, 1);
            }
            if (rhs.UWPa != null)
            {
                this.UWP = Math.Round(rhs.UWPa.Value, 1);
            }
            this.RunStatus = rhs.RunningCount > 0 ? IStation.RunStatus.Run : IStation.RunStatus.Shut;
            if (rhs.RunningCount > 0)
            {
                this.Items = new List<PumpEtaAnaRecord>();
            }
        }
 
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 流量
        /// </summary>
        public double? Q { get; set; }
        /// <summary>
        /// 功率
        /// </summary>
        public double? P { get; set; }
        /// <summary>
        /// 扬程
        /// </summary>
        public double? H { get; set; }
        /// <summary>
        /// 效率
        /// </summary>
        public double? E { get; set; }
        /// <summary>
        /// 千吨能耗
        /// </summary>
        public double? WP { get; set; }
        /// <summary>
        /// 单位能耗
        /// </summary>
        public double? UWP { get; set; }
        /// <summary>
        /// 运行状态
        /// </summary>
        public int RunStatus { get; set; }
        /// <summary>
        /// 子项集合
        /// </summary>
        public List<PumpEtaAnaRecord> Items { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="error_info"></param>
        /// <returns></returns>
        public IStation.Calculation.DispatchAna.Model.EtaAnaRecord4Station Build(out string error_info)
        {
            error_info = null;
           
            IStation.Calculation.DispatchAna.Model.EtaAnaRecord4Station eta_ana_records = new Calculation.DispatchAna.Model.EtaAnaRecord4Station();
            eta_ana_records.Name = this.Name;
            eta_ana_records.Q = this.Q;
            eta_ana_records.H = this.H;
            eta_ana_records.E = this.E;
            eta_ana_records.P = this.P;
            eta_ana_records.WP  = this.WP;
            eta_ana_records.UWP = this.UWP;
            eta_ana_records.RunStatus = this.RunStatus;
            eta_ana_records.Items = new List<Calculation.DispatchAna.Model.EtaAnaRecord4Pump>();
            foreach(var v in this.Items)
            {
                eta_ana_records.Items.Add(new Calculation.DispatchAna.Model.EtaAnaRecord4Pump()
                { 
                     MachineID = v.MachineID,
                     PumpID = v.PumpID,
                     Q = v.Q,
                     H = v.H,
                     E = v.E,
                     P = v.P,
                     WP = v.WP,
                     UWP = v.UWP,
                     PipeLineID = v.PipeLineID,
                     Name = v.Name,
                     HZ = v.HZ
                });
            }
            return eta_ana_records;
        }
    }
}