tangxu
2024-01-27 29a6de30e328c46cbbcae15066f449b0660c2db1
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
namespace Yw.Application
{
    /// <summary>
    /// 泵曲线
    /// </summary>
    public class PumpChartDto  
    {
 
        /// <summary>
        /// 
        /// </summary>
        public PumpChartDto() { }
 
        /// <summary>
        /// 
        /// </summary>
        public PumpChartDto(Model.PumpCurve rhs)  
        {
            this.Name = rhs.Name;
            this.SourceWay = rhs.SourceWay;
            this.CreateMethod = rhs.CreateMethod;
            //this.CoordParas = rhs.CoordParas;
            //this.CurveInfo = rhs.CurveInfo;
            this.ReliabilityStatus = rhs.ReliabilityStatus;
            this.InputTime = rhs.InputTime;
            this.CreateTime = rhs.CreateTime;
            this.CreateUserID = rhs.CreateUserID;
            this.CreateUserName = rhs.CreateUserName;
            this.UpdateTime = rhs.UpdateTime;
            this.UpdateUserID = rhs.UpdateUserID;
            this.UpdateUserName = rhs.UpdateUserName;
            this.Description = rhs.Description;
 
            _dictChartObject = new Dictionary<string, object>();
            if(rhs.CurveInfo != null && rhs.CurveInfo.CurveQH != null)
            {
                //最大叶轮曲线
                List<Yw.Curve.CurvePoint> qhPointMax = Yw.Curve.FitHelper.GetFitPoints(rhs.CurveInfo.CurveQH, 20);
                List<Yw.Curve.CurvePoint> qePointMax = Yw.Curve.FitHelper.GetFitPoints(rhs.CurveInfo.CurveQE, 14);
                List<Yw.Curve.CurvePoint> qpPointMax = Yw.Curve.FitHelper.GetFitPoints(rhs.CurveInfo.CurveQP, 14);
                //List<Yw.Curve.CurvePoint> npshPointMax = Yw.Curve.FitHelper.GetFitPoints(_maxCurveGrp.CurveExpressNPSH, 8);
 
                if (!string.IsNullOrEmpty(rhs.CoordParas))
                {
                    var lxp = new Yw.Coordinate.LxpCoordinateParas(rhs.CoordParas);
                    _dictChartObject["Coordinate"] = new Yw.Dto.CoordinateParasLxp(lxp);
                }
                else
                {
                    var lxp = Yw.Coordinate.CoordinateHelper.CalcCoordinate(qhPointMax, qePointMax, qpPointMax);
                    _dictChartObject["Coordinate"] = new Yw.Dto.CoordinateParasLxp(lxp);
                }
 
                _dictChartObject["MaxCurveQH"] = BuildDispElement4UI(qhPointMax);
                _dictChartObject["MaxCurveQE"] = BuildDispElement4UI(qePointMax);
                _dictChartObject["MaxCurveQP"] = BuildDispElement4UI(qpPointMax);
                //_dictChartObject["MaxWaterCurveNPSH"] = BuildDispElement4UI(npshPointMax);
            }
 
        }
        //传入到前端,没必要有过多小数点
        private List<Yw.Curve.CurvePoint> BuildDispElement4UI(List<Yw.Curve.CurvePoint> points)
        {
            if (points != null && points.Count > 0)
            {
                foreach (var pt in points)
                {
                    if (pt != null)
                    {
                        pt.X = Math.Round(pt.X, 3);
                        pt.Y = Math.Round(pt.Y, 3);
                    }
                }
            }
            return points;
        }
 
        /// <summary>
        /// 
        /// </summary>
        public virtual long ID { get; set; }
        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }
 
        /// <summary>
        /// 来源方式
        /// </summary>
        public eSourceWay SourceWay { get; set; }
 
        /// <summary>
        /// 创建方法
        /// </summary>
        public string CreateMethod { get; set; }
 
 
        private Dictionary<string, object> _dictChartObject = null;
        /// <summary>
        /// 
        /// </summary>
        public Dictionary<string, object> DictChartObject { get { return _dictChartObject; }set { _dictChartObject = value; } }
        /// <summary>
        /// 可信度
        /// </summary>
        public eReliabilityStatus ReliabilityStatus { get; set; }
 
        /// <summary>
        /// 录入时间
        /// </summary>
        public DateTime InputTime { get; set; }
 
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
 
        /// <summary>
        /// 创建人id
        /// </summary>
        public long CreateUserID { get; set; }
 
        /// <summary>
        /// 创建人名称
        /// </summary>
        public string CreateUserName { get; set; }
 
        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
 
        /// <summary>
        /// 更新人id
        /// </summary>
        public long? UpdateUserID { get; set; }
 
        /// <summary>
        /// 更新人名称
        /// </summary>
        public string UpdateUserName { get; set; }
 
        /// <summary>
        /// 说明
        /// </summary>
        public string Description { get; set; }
 
 
    }
 
}