tx
2025-04-10 2538101febc78f525945da72c7cdcb2589f9e6ea
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
using System;
using System.Linq;
using System.Text;
 
namespace TProduct.Model
{
    public class ValveCoordinateParas
    {
        public ValveCoordinateParas() { }
 
        public ValveCoordinateParas(string strChartCoord)
        {
            try
            {
                if (string.IsNullOrEmpty(strChartCoord))
                {
                    isNull = true;
                    return;
                }
 
                string[] coords = strChartCoord.Split('|');
                if (coords.Count() < 4)
                {
                    isNull = true;
                    return;
                }
 
                //
                string sbQ = coords[0];
                string[] coordParasQ = sbQ.Split(',');
                this.GridLineNumberDegree = Convert.ToInt32(coordParasQ[2]);
                this.MinDegree = Convert.ToDouble(coordParasQ[3]);
                this.SpaceDegree = Convert.ToDouble(coordParasQ[4]);
 
 
                //
                string sbFlow = coords[1];
                string[] coordParasFlow = sbFlow.Split(',');
                this.GridLineNumberFlow = Convert.ToInt32(coordParasFlow[2]);
                this.MinFlow = Convert.ToDouble(coordParasQ[3]);
                this.SpaceFlow = Convert.ToDouble(coordParasQ[4]);
 
                //
                string sbDeltaP = coords[2];
                string[] coordParasDeltaP = sbDeltaP.Split(',');
                this.GridLineNumberDeltaP = Convert.ToInt32(coordParasDeltaP[2]);
                this.MinDeltaP = Convert.ToDouble(coordParasDeltaP[3]);
                this.SpaceDeltaP = Convert.ToDouble(coordParasDeltaP[4]);
 
 
                string sbRc = coords[3];
                string[] coordParasRc = sbRc.Split(',');
                this.GridLineNumberRc = Convert.ToInt32(coordParasRc[2]);
                this.MinRc = Convert.ToDouble(coordParasRc[3]);
                this.SpaceRc = Convert.ToDouble(coordParasRc[4]);
 
 
                string sbKv = coords[3];
                string[] coordParasKv = sbKv.Split(',');
                this.GridLineNumberKv = Convert.ToInt32(coordParasKv[2]);
                this.MinKv = Convert.ToDouble(coordParasKv[3]);
                this.SpaceKv = Convert.ToDouble(coordParasKv[4]);
 
 
            }
            catch (Exception)
            {
                isNull = true;
                return;
            }
        }
 
        public ValveCoordinateParas(ValveCoordinateParas rhs)
        {
            if (rhs == null)
            {
                return;
            }
 
 
            this.GridLineNumberDegree = rhs.GridLineNumberDegree;
            this.MinDegree = rhs.MinDegree;
            this.SpaceDegree = rhs.SpaceDegree;
 
 
            this.GridLineNumberFlow = rhs.GridLineNumberFlow;
            this.MinFlow = rhs.MinFlow;
            this.SpaceFlow = rhs.SpaceFlow;
 
 
            this.GridLineNumberDeltaP = rhs.GridLineNumberDeltaP;
            this.MinDeltaP = rhs.MinDeltaP;
            this.SpaceDeltaP = rhs.SpaceDeltaP;
 
 
            this.GridLineNumberKv = rhs.GridLineNumberKv;
            this.MinKv = rhs.MinKv;
            this.SpaceKv = rhs.SpaceKv;
 
 
 
 
            this.GridLineNumberRc = rhs.GridLineNumberRc;
            this.MinRc = rhs.MinRc;
            this.SpaceRc = rhs.SpaceRc;
        }
 
        //开度 
        public int GridLineNumberDegree;
        public double MinDegree, SpaceDegree;
        public double MaxDegree
        {
            get
            {
                return MinDegree + (GridLineNumberDegree - 1) * SpaceDegree;
            }
        }
 
 
        //流量
        public int GridLineNumberFlow;
        public double MinFlow, SpaceFlow;
        public double MaxFlow
        {
            get
            {
                return MinFlow + (GridLineNumberFlow - 1) * SpaceFlow;
            }
        }
        //压差 
        public int GridLineNumberDeltaP;
        public double MinDeltaP, SpaceDeltaP;
        public double MaxDeltaP
        {
            get
            {
                return MinDeltaP + (GridLineNumberDeltaP - 1) * SpaceDeltaP;
            }
        }
 
        //流阻系数Rc
        public int GridLineNumberRc;
        public double MinRc, SpaceRc;
        public double MaxRc
        {
            get
            {
                return MinRc + (GridLineNumberRc - 1) * SpaceRc;
            }
        }
 
        //流量系数Kv
        public int GridLineNumberKv;
        public double MinKv, SpaceKv;
        public double MaxKv
        {
            get
            {
                return MinKv + (GridLineNumberKv - 1) * SpaceKv;
            }
        }
 
 
 
 
 
 
 
        public Object Clone()  //对外提供一个创建自身的浅表副本的能力
        {
            return this.MemberwiseClone();
        }
 
 
        //
        protected bool isNull = false;
        public bool IsNull
        {
            get { return isNull; }
        }
 
        public static ValveCoordinateParas ToParameter(string strChartCoord)
        {
            try
            {
                var paras = new ValveCoordinateParas(strChartCoord);
                if (paras.isNull)
                    return null;
                else
                    return paras;
            }
            catch (Exception)
            {
                return null;
            }
        }
 
        public string ToDsString()
        {
            return ToDsString(this);
        }
 
        public static string ToDsString(ValveCoordinateParas paras)
        {
            if (paras == null)
                return "";
 
            StringBuilder sbInfo = new StringBuilder();
            sbInfo.Append("1,0,"); //1:表示均匀
            sbInfo.Append(paras.GridLineNumberDegree); sbInfo.Append(",");
            sbInfo.Append(paras.MinDegree); sbInfo.Append(",");
            sbInfo.Append(paras.SpaceDegree);
 
            sbInfo.Append("|1,0,"); //1:表示均匀
            sbInfo.Append(paras.GridLineNumberFlow); sbInfo.Append(",");
            sbInfo.Append(paras.MinFlow); sbInfo.Append(",");
            sbInfo.Append(paras.SpaceFlow);
 
            sbInfo.Append("|1,0,"); //1:表示均匀
            sbInfo.Append(paras.GridLineNumberDeltaP); sbInfo.Append(",");
            sbInfo.Append(paras.MinDeltaP); sbInfo.Append(",");
            sbInfo.Append(paras.SpaceDeltaP);
 
            sbInfo.Append("|1,0,"); //1:表示均匀
            sbInfo.Append(paras.GridLineNumberRc); sbInfo.Append(",");
            sbInfo.Append(paras.MinRc); sbInfo.Append(",");
            sbInfo.Append(paras.SpaceRc);
 
            sbInfo.Append("|1,0,"); //1:表示均匀
            sbInfo.Append(paras.GridLineNumberKv); sbInfo.Append(",");
            sbInfo.Append(paras.MinKv); sbInfo.Append(",");
            sbInfo.Append(paras.SpaceKv);
 
            return sbInfo.ToString();
        }
 
 
    }
}