4
lixiaojun
2024-08-08 f8dc11ea4cf77079f91652ba90b1643778c46f7b
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
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using static Yw.EPAnet.Calcu.ObjectEnum;
 
namespace Yw.EPAnet.Calcu
{
    [Serializable]
    public class PumpModel : LinkCalcModel
    {
        /// <summary>
        /// 泵类型
        /// </summary>
        public PumpType Type { get; set; }
        /// <summary>
        /// 额定转速
        /// </summary>
        public double RatedSpeed { get; set; } = 1500;
 
        /// <summary>
        /// 额定流量
        /// </summary>
        public double RatedFlow { get; set; } = 0;
 
        /// <summary>
        /// 额定扬程
        /// </summary>
        public double RatedHead { get; set; } = 0;
 
        /// <summary>
        /// 额定功率
        /// </summary>
        public double RatedPower { get; set; } = 75;
 
        /// <summary>
        /// 扬程曲线
        /// </summary>
        public string FlowCurveID { get; set; } = "PumpDefault";
 
        /// <summary>
        /// 参数
        /// </summary>
        public List<string> Parameters { get; set; }
 
        /// <summary>
        /// 流量曲线
        /// </summary>
        public FlowCurve FlowCurve { get; set; }
 
        public override string ToString()
        {
            string para = Parameters == null ? null : string.Join("\t", Parameters);
            return $"{ID}\t{Node1}\t{Node2}\tHead\t{FlowCurveID}\t{para}\t;\t";
        }
 
        /// <summary>
        /// 生成流量曲线
        /// </summary>
        /// <returns></returns>
        public string CreateFlowCurve()
        {
            StringBuilder txt = new StringBuilder();
            if (FlowCurve != null)
            {
                foreach (PointF point in FlowCurve.Data)
                {
                    txt.AppendLine($"{Name}\t{point.X}\t{point.Y}");
                }
            }
            return txt.ToString();
        }
    }
}