Shuxia Ning
2025-02-13 2f1cbec203dcff25df7a5c2b51b13ec558f2c3db
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
using System.Collections.Generic;
 
namespace IStation.Model
{
    /// <summary>
    /// 曲线点列表组
    /// </summary>
    public class FeatCurvePointGroup
    {
        public FeatCurvePointGroup() { }
        public FeatCurvePointGroup(FeatCurveExpressGroup grp)
        {
            this.PointQH = IStation.Common.FitCurveHelper.GetFitPoints(grp.CurveQH, 10);
            this.PointQE = IStation.Common.FitCurveHelper.GetFitPoints(grp.CurveQE, 10);
            this.PointQP = IStation.Common.FitCurveHelper.GetFitPoints(grp.CurveQP, 10);
        }
        public FeatCurvePointGroup(List<CurvePoint> qh, List<CurvePoint> qe, List<CurvePoint> qp)
        {
            this.PointQH = qh;
            this.PointQE = qe;
            this.PointQP = qp;
        }
        public FeatCurvePointGroup(string dsString)
        {
            if (string.IsNullOrEmpty(dsString))
                return;
            var dict = JsonHelper.Json2Object<Dictionary<string, string>>(dsString);
            if (dict.ContainsKey("PointQH"))
                this.PointQH = CurvePoint.ToList(dict["PointQH"]);
            if (dict.ContainsKey("PointQE"))
                this.PointQE = CurvePoint.ToList(dict["PointQE"]);
            if (dict.ContainsKey("PointQP"))
                this.PointQP = CurvePoint.ToList(dict["PointQP"]);
        }
 
        /// <summary>
        /// 流量扬程点列表
        /// </summary>
        public List<CurvePoint> PointQH { get; set; }
 
        /// <summary>
        /// 流量效率点列表
        /// </summary>
        public List<CurvePoint> PointQE { get; set; }
 
        /// <summary>
        /// 流量功率点列表
        /// </summary>
        public List<CurvePoint> PointQP { get; set; }
 
 
        /// <summary>
        /// To保存字符串
        /// </summary>
        public string ToDsString()
        {
            var dict = new Dictionary<string, string>();
            if (this.PointQH != null && this.PointQH.Count > 0)
            {
                dict.Add("PointQH", this.PointQH.ToDsString());
            }
 
            if (this.PointQE != null && this.PointQE.Count > 0)
            {
                dict.Add("PointQE", this.PointQE.ToDsString());
            }
 
            if (this.PointQP != null && this.PointQP.Count > 0)
            {
                dict.Add("PointQP", this.PointQP.ToDsString());
            }
 
            if (dict.Count < 1)
                return string.Empty;
 
            return JsonHelper.Object2Json(dict);
        }
 
        /// <summary>
        /// TO Model
        /// </summary>
        public static FeatCurvePointGroup ToModel(string dsString)
        {
            if (string.IsNullOrEmpty(dsString))
                return default;
            var dict = JsonHelper.Json2Object<Dictionary<string, string>>(dsString);
            var model = new FeatCurvePointGroup();
            if (dict.ContainsKey("PointQH"))
                model.PointQH = CurvePoint.ToList(dict["PointQH"]);
            if (dict.ContainsKey("PointQE"))
                model.PointQE = CurvePoint.ToList(dict["PointQE"]);
            if (dict.ContainsKey("PointQP"))
                model.PointQP = CurvePoint.ToList(dict["PointQP"]);
            return model;
        }
 
 
 
 
    }
 
 
 
}