lixiaojun
2024-12-02 f54adb8f368def21b9aa01e466b09bed6cd8347c
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
namespace HStation.WinFrmUI.Xhs
{
    public class SinglePumpAnalyViewModel
    {
        public SinglePumpAnalyViewModel() { }
        public SinglePumpAnalyViewModel(SinglePumpAnalyViewModel rhs)
        {
            this.Id = rhs.Id;
            this.Name = rhs.Name;
            this.IsBp = rhs.IsBp;
            this.RatedSpeed = rhs.RatedSpeed;
            this.CurrentSpeed = rhs.CurrentSpeed;
            this.CurrentHz = rhs.CurrentHz;
            this.IsDefault = rhs.IsDefault;
            this.Color = rhs.Color;
            this.ExtendRatio = rhs.ExtendRatio;
            this.Qh = new Yw.Geometry.CubicSpline2d(rhs.Qh);
            this.Qe = new Yw.Geometry.CubicSpline2d(rhs.Qe);
            this.Qp = new Yw.Geometry.CubicSpline2d(rhs.Qp);
            this.QhCalc = new Yw.Geometry.CubicSpline2d(rhs.QhCalc);
            this.QeCalc = new Yw.Geometry.CubicSpline2d(rhs.QeCalc);
            this.QpCalc = new Yw.Geometry.CubicSpline2d(rhs.QpCalc);
 
            this.SectQ = rhs.QueryQ;
            this.SectH = rhs.QueryH;
            this.SectE = rhs.QueryE;
            this.SectP = rhs.QueryP;
 
            this.QueryQ = rhs.QueryQ;
            this.QueryH = rhs.QueryH;
            this.QueryE = rhs.QueryE;
            this.QueryP = rhs.QueryP;
        }
 
        public SinglePumpAnalyViewModel(Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel rhs, Yw.WinFrmUI.Phart.PumpSectPointViewModel sect)
        {
            this.Id = rhs.Id;
            this.Name = rhs.Name;
            this.IsBp = rhs.IsBp;
            this.RatedSpeed = rhs.RatedSpeed;
            this.CurrentSpeed = rhs.CurrentSpeed;
            this.CurrentHz = rhs.CurrentHz;
            this.IsDefault = rhs.IsDefault;
            this.Color = rhs.Color;
            this.ExtendRatio = rhs.ExtendRatio;
            this.Qh = new Yw.Geometry.CubicSpline2d(rhs.Qh);
            this.Qe = new Yw.Geometry.CubicSpline2d(rhs.Qe);
            this.Qp = new Yw.Geometry.CubicSpline2d(rhs.Qp);
            this.QhCalc = new Yw.Geometry.CubicSpline2d(rhs.QhCalc);
            this.QeCalc = new Yw.Geometry.CubicSpline2d(rhs.QeCalc);
            this.QpCalc = new Yw.Geometry.CubicSpline2d(rhs.QpCalc);
 
            this.SectQ = sect.QueryQ;
            this.SectH = sect.QueryH;
            this.SectE = sect.QueryE;
            this.SectP = sect.QueryP;
 
            this.QueryQ = rhs.QueryQ;
            this.QueryH = rhs.QueryH;
            this.QueryE = rhs.QueryE;
            this.QueryP = rhs.QueryP;
        }
 
        public Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel ToInfo()
        {
            var info = new Yw.WinFrmUI.Phart.PumpVariableSpeedInfoViewModel();
            info.Id = this.Id;
            info.Name = this.Name;
            info.IsBp = this.IsBp;
            info.RatedSpeed = this.RatedSpeed;
            info.CurrentSpeed = this.CurrentSpeed;
            info.CurrentHz = this.CurrentHz;
            info.IsDefault = this.IsDefault;
            info.Color = this.Color;
            info.ExtendRatio = this.ExtendRatio;
            info.Qh = new Yw.Geometry.CubicSpline2d(this.Qh);
            info.Qe = new Yw.Geometry.CubicSpline2d(this.Qe);
            info.Qp = new Yw.Geometry.CubicSpline2d(this.Qp);
            info.QhCalc = new Yw.Geometry.CubicSpline2d(this.QhCalc);
            info.QeCalc = new Yw.Geometry.CubicSpline2d(this.QeCalc);
            info.QpCalc = new Yw.Geometry.CubicSpline2d(this.QpCalc);
 
            info.QueryQ = this.QueryQ;
            info.QueryH = this.QueryH;
            info.QueryE = this.QueryE;
            info.QueryP = this.QueryP;
 
            return info;
        }
 
        /// <summary>
        /// 标识
        /// </summary>
        [Display(Name = "标识")]
        public string Id { get; set; }
 
        /// <summary>
        /// 名称
        /// </summary>
        [Display(Name = "名称")]
        public string Name { get; set; }
 
        /// <summary>
        /// 是否变频
        /// </summary>
        [Display(Name = "是否变频")]
        public bool IsBp { get; set; }
 
        /// <summary>
        /// 额定转速
        /// </summary>
        [Display(Name = "额定转速")]
        public double RatedSpeed { get; set; }
 
        /// <summary>
        /// 当前转速
        /// </summary>
        [Display(Name = "转速")]
        public double CurrentSpeed { get; set; }
 
        /// <summary>
        /// 当前频率
        /// </summary>
        [Display(Name = "频率")]
        public double CurrentHz { get; set; }
 
        /// <summary>
        /// 是否默认
        /// </summary>
        [Display(Name = "是否默认")]
        public bool IsDefault { get; set; }
 
        /// <summary>
        /// 颜色
        /// </summary>
        [Display(Name = "颜色")]
        public Color Color { get; set; }
 
        /// <summary>
        /// 延长(%)
        /// </summary>
        [Display(Name = "延长(%)")]
        public double ExtendRatio { get; set; } = 100;
 
        /// <summary>
        /// 流量扬程线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d Qh { get; set; }
 
        /// <summary>
        /// 流量效率线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d Qe { get; set; }
 
        /// <summary>
        /// 流量功率线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d Qp { get; set; }
 
        /// <summary>
        /// 流量扬程线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d QhCalc { get; set; }
 
        /// <summary>
        /// 流量效率线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d QeCalc { get; set; }
 
        /// <summary>
        /// 流量功率线
        /// </summary>
        [Display(Name = "")]
        public Yw.Geometry.CubicSpline2d QpCalc { get; set; }
 
 
        /// <summary>
        /// 流量(m³/h)
        /// </summary>
        [Display(Name = "流量(m³/h)")]
        public string SectQ { get; set; }
 
        /// <summary>
        /// 扬程(m)
        /// </summary>
        [Display(Name = "扬程(m)")]
        public string SectH { get; set; }
 
        /// <summary>
        /// 效率(%)
        /// </summary>
        [Display(Name = "效率(%)")]
        public string SectE { get; set; }
 
        /// <summary>
        /// 功率(kW)
        /// </summary>
        [Display(Name = "功率(kW)")]
        public string SectP { get; set; }
 
 
        /// <summary>
        /// 流量(m³/h)
        /// </summary>
        [Display(Name = "流量(m³/h)")]
        public string QueryQ { get; set; }
 
        /// <summary>
        /// 扬程(m)
        /// </summary>
        [Display(Name = "扬程(m)")]
        public string QueryH { get; set; }
 
        /// <summary>
        /// 效率(%)
        /// </summary>
        [Display(Name = "效率(%)")]
        public string QueryE { get; set; }
 
        /// <summary>
        /// 功率(kW)
        /// </summary>
        [Display(Name = "功率(kW)")]
        public string QueryP { get; set; }
 
 
        /// <summary>
        /// 计算
        /// </summary>
        public void Calc()
        {
            this.CurrentSpeed = Math.Round(this.CurrentHz / 50 * this.RatedSpeed);
 
            this.QhCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQH(this.Qh, this.RatedSpeed, this.CurrentSpeed);
            this.QeCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQE(this.Qe, this.RatedSpeed, this.CurrentSpeed);
            this.QpCalc = Yw.WinFrmUI.Phart.PumpCalcHelper.CalculateSimilarQP(this.Qp, this.RatedSpeed, this.CurrentSpeed);
 
            if (this.QhCalc != null)
                this.QhCalc.MaxX = this.QhCalc.MaxX * this.ExtendRatio / 100;
 
            if (this.QeCalc != null)
                this.QeCalc.MaxX = this.QeCalc.MaxX * this.ExtendRatio / 100;
 
            if (this.QpCalc != null)
                this.QpCalc.MaxX = this.QpCalc.MaxX * this.ExtendRatio / 100;
 
        }
 
 
    }
}