tx
5 天以前 570d70a13f6a117a240f6dd40b4b35600f66652e
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
using System;
using System.Collections.Generic;
 
namespace TProduct.PumpGraph.Dxf
{
    public class JieZhiFullPara : Eventech.Model.IJsonString//实际就是TProduct.Model.JieZhiFullPara
    {
        public JieZhiFullPara()
        {
            this.CatalogID = 1;
            this.ID = 1;
            this.Name = "清水";
            this.MinDensity = "1000";//kg/m³
            this.NormalDensity = "1000";//kg/m³
            this.MaxDensity = "1000";//kg/m³
            this.CalcDensity = 1000;//kg/m³
 
            this.MinViscosity = "1";//cSt(mm²/s)
            this.NormalViscosity = "1";//cSt(mm²/s)
            this.MaxViscosity = "1";//cSt(mm²/s)
            this.CalcViscosity = 1;
 
            this.MaxTemperature = "20";//℃ 
            this.NormalTemperature = "20";//℃ 
            this.MinTemperature = "20";//℃ 
            this.VisoCorrectCoeff = null;
            this.PH = "7";
        }
        //默认介质
        public static JieZhiFullPara Default
        {
            get
            {
                JieZhiFullPara defaultJieZi = new JieZhiFullPara();
                defaultJieZi.CatalogID = 1;
                defaultJieZi.ID = 1;
                defaultJieZi.Name = "清水";
 
                defaultJieZi.MinDensity = "1000";//kg/m³
                defaultJieZi.NormalDensity = "1000";//kg/m³
                defaultJieZi.MaxDensity = "1000";//kg/m³
                defaultJieZi.CalcDensity = 1000;//kg/m³
 
                defaultJieZi.MinViscosity = "1";//cSt(mm²/s)
                defaultJieZi.NormalViscosity = "1";//cSt(mm²/s)
                defaultJieZi.MaxViscosity = "1";//cSt(mm²/s)
                defaultJieZi.CalcViscosity = 1;
 
                defaultJieZi.MaxTemperature = "20";//℃ 
                defaultJieZi.NormalTemperature = "20";//℃ 
                defaultJieZi.MinTemperature = "20";//℃ 
 
                defaultJieZi.MaxVaporPressure = "/";
                defaultJieZi.MinVaporPressure = "/";
                defaultJieZi.NormalVaporPressure = "/";
 
                defaultJieZi.SpecificHeat = "/";
                defaultJieZi.PH = "7";
                return defaultJieZi;
            }
        }
 
        public JieZhiFullPara(string jsonString)
        {
            FromJsonString(jsonString);
        }
        public bool IsWaterDensity
        {
            get
            {
                if (Math.Abs(CalcDensity - 1000) < 10)
                    return true;
                else
                    return false;
            }
        }
 
        //获取 比重
        public double GetBiZhong()
        {
            return CalcDensity / 1000;
        }
 
        //获取 温度
        public double GetTemperature()
        {
            try
            {
                if (!string.IsNullOrEmpty(this.NormalTemperature))
                {
                    return Convert.ToDouble(this.NormalTemperature);
                }
                if (!string.IsNullOrEmpty(this.MaxTemperature))
                {
                    return Convert.ToDouble(this.MaxTemperature);
                }
                if (!string.IsNullOrEmpty(this.MinTemperature))
                {
                    return Convert.ToDouble(this.MinTemperature);
                }
                return 20;
            }
            catch
            {
                return 20;
            }
        }
 
        #region 属性
 
        public long ID
        {
            get { return _id; }
            set { _id = value; }
        }
        private long _id = 0;
 
        private long _catalogID = 0;
 
        public long CatalogID
        {
            get { return _catalogID; }
            set { _catalogID = value; }
        }
 
 
        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }
        private string _name;
 
        // 1厘泊(1cP)=1毫帕斯卡 .秒 (1mPa.s)  
        // 1泊(P)= 0.1帕*秒(Pa*S)
        // 1厘泊(CP)= 0.01泊(P)= 1毫帕*秒(mPa*S)
        //1 CSt  =Eventech.Model.UnitViscosity.CP*1000/比重
 
        public int ViscosityUnit { get; set; }//黏度单位: Eventech.Model.UnitViscosity.CSt =0; Eventech.Model.UnitViscosity.CP=5
 
        public string NormalViscosity { get; set; }//额定粘度
 
        public string MinViscosity { get; set; }//最小粘度
 
        public string MaxViscosity { get; set; }//最大粘度
 
 
        public double CalcViscosity { get; set; }//用于选型的粘度(cSt)
 
 
        public string MinTemperature { get; set; }//最小温度
 
        public string NormalTemperature { get; set; }//额定温度
 
        public string MaxTemperature { get; set; }//最大温度
 
        public string MinDensity { get; set; }//最小密度
 
        public string NormalDensity { get; set; }//额定密度
 
        public string MaxDensity { get; set; }//最大密度
 
 
        public double CalcDensity { get; set; }//用于选型的密度
 
 
        public string MinVaporPressure { get; set; }//最小气化压力(Bar)
 
        public string NormalVaporPressure { get; set; }//额定气化压力(Bar)
 
        public string MaxVaporPressure { get; set; }//最大气化压力(Bar)
 
        //气化压力转成KPa
        public string Disp_VaporPressure_KPa()
        {
            try
            {
                double vapar = 0;
                if (!string.IsNullOrEmpty(MaxVaporPressure))
                {
                    if (double.TryParse(MaxVaporPressure, out vapar))
                    {
                        return (vapar * 100).ToString();
                    }
                }
 
                if (!string.IsNullOrEmpty(NormalVaporPressure))
                {
                    if (double.TryParse(NormalVaporPressure, out vapar))
                    {
                        return (vapar * 100).ToString();
                    }
                }
 
                if (!string.IsNullOrEmpty(MinVaporPressure))
                {
                    if (double.TryParse(MinVaporPressure, out vapar))
                    {
                        return (vapar * 100).ToString();
                    }
                }
 
 
                return "";
            }
            catch
            {
                return "";
            }
        }
 
 
        //黏度修正系数
        public Eventech.Model.ViscosityCorrectCoeff VisoCorrectCoeff { get; set; }
 
        //比热    
        public string SpecificHeat { get; set; }
 
 
        public string PH
        {
            get { return _ph; }
            set { _ph = value; }
        }
        private string _ph = "7";
 
        #region 颗粒
        //是否含有颗粒
        private string _isHaveKeLi4Ds = "0";
 
        public string IsHaveKeLi4Ds
        {
            get { return _isHaveKeLi4Ds; }
            set { _isHaveKeLi4Ds = value; }
        }
        public bool IsHaveKeLi
        {
            get
            {
                if (string.IsNullOrEmpty(_isHaveKeLi4Ds))
                    return false;
                if (_isHaveKeLi4Ds == "1")
                    return true;
                else
                    return false;
            }
        }
        //颗粒百分比
        private string _keliRatio;
 
        public string KeliRatio
        {
            get { return _keliRatio; }
            set { _keliRatio = value; }
        }
        //颗粒尺寸(mm)
        private string _keliChiCun = "";
 
        public string KeliChiCun
        {
            get { return _keliChiCun; }
            set { _keliChiCun = value; }
        }
        #endregion
 
        //含固量
 
        public string HanGuLiang
        {
            set { _hanguliang = value; }
            get { return _hanguliang; }
        }
 
        //腐蚀成分
        private string _fuShiChengFeng;
 
        public string FuShiChengFeng
        {
            get { return _fuShiChengFeng; }
            set { _fuShiChengFeng = value; }
        }
 
        //腐蚀/磨蚀剂
        private string _fuShiMoShiJi;
 
        public string FuShiMoShiJi
        {
            get { return _fuShiMoShiJi; }
            set { _fuShiMoShiJi = value; }
        }
 
        //腐蚀
 
        public string FuShi
        {
            set { _fushi = value; }
            get { return _fushi; }
        }
        public string _fushi = null;
        public string FuShiString
        {
            get
            {
                if (_fushi == "1")
                    return "是";
                else
                    return "否";
            }
        }
 
        //磨蚀
 
        public string MoShi
        {
            set { _moshi = value; }
            get { return _moshi; }
        }
        public string _moshi = null;
        public string MoShiString
        {
            get
            {
                if (_moshi == "1")
                    return "是";
                else
                    return "否";
            }
        }
 
        //有毒
 
        public string YouDu
        {
            set { _youdu = value; }
            get { return _youdu; }
        }
        public string _youdu = null;
        public string YouDuString
        {
            get
            {
                if (_youdu == "1")
                    return "是";
                else
                    return "否";
            }
        }
 
        //易燃
 
        public string YiRan { get; set; }
 
        //易爆
 
        public string YiBao { get; set; }
 
        //介质特性
        private string _hanguliang;
 
        public string JieZhiTeXing
        {
            set { _jiezhitexing = value; }
            get { return _jiezhitexing; }
        }
        private string _jiezhitexing;
 
        //浓度
 
        public string Concentration { get; set; }
 
        //离子成分H
 
        public string LiZhiNongDuH
        {
            set { _lizhinongduh = value; }
            get { return _lizhinongduh; }
        }
        private string _lizhinongduh;
        //离子成分CL
 
        public string LiZhiNongDuCL
        {
            set { _lizhinongducl = value; }
            get { return _lizhinongducl; }
        }
        private string _lizhinongducl;
        //离子成分F
 
        public string LiZhiNongDuF
        {
            set { _lizhinongduf = value; }
            get { return _lizhinongduf; }
        }
        private string _lizhinongduf;
        //离子成分SO4
 
        public string LiZhiNongDuSO4
        {
            set { _lizhinongduso4 = value; }
            get { return _lizhinongduso4; }
        }
        private string _lizhinongduso4;
        //离子成分NO3
 
        public string LiZhiNongDuNO3
        {
            set { _lizhinongduno3 = value; }
            get { return _lizhinongduno3; }
        }
        private string _lizhinongduno3;
        //硫化氢浓度
 
        public string NongDuH2S { get; set; }
 
        //其他物质名称/浓度 (名称)
 
        public string NongDuOtherName { get; set; }
        //其他物质名称/浓度 (浓度)
 
        public string NongDuOtherPercent { get; set; }
 
 
 
        #endregion  
 
        public string ToJsonString()
        {
            Dictionary<string, string> dict = new Dictionary<string, string>();
            dict["ID"] = this.ID.ToString();
            dict["CatID"] = this.CatalogID.ToString();
 
            dict["Name"] = this.Name.ToString();
 
            dict["MD"] = this.CalcDensity.ToString();
            dict["ND"] = this.CalcViscosity.ToString();
 
            if (!string.IsNullOrEmpty(PH))
                dict["PH"] = this.PH.ToString();
            if (!string.IsNullOrEmpty(IsHaveKeLi4Ds))
                dict["HKL"] = this.IsHaveKeLi4Ds.ToString();
            if (!string.IsNullOrEmpty(this._keliRatio))
                dict["HKR"] = this._keliRatio.ToString();
            if (!string.IsNullOrEmpty(_fuShiChengFeng))
                dict["FSCF"] = this._fuShiChengFeng.ToString();
            if (!string.IsNullOrEmpty(this.JieZhiTeXing))
                dict["TX"] = this.JieZhiTeXing;
            if (!string.IsNullOrEmpty(this.HanGuLiang))
                dict["HGL"] = this.HanGuLiang.ToString();
            if (!string.IsNullOrEmpty(this.LiZhiNongDuH))
                dict["LzndH"] = this.LiZhiNongDuH.ToString();
            if (!string.IsNullOrEmpty(this.LiZhiNongDuCL))
                dict["LzndCL"] = this.LiZhiNongDuCL.ToString();
            if (!string.IsNullOrEmpty(this.LiZhiNongDuF))
                dict["LzndF"] = this.LiZhiNongDuF.ToString();
            if (!string.IsNullOrEmpty(this.LiZhiNongDuSO4))
                dict["LzndSO4"] = this.LiZhiNongDuSO4.ToString();
            if (!string.IsNullOrEmpty(this.LiZhiNongDuNO3))
                dict["LzndNO3"] = this.LiZhiNongDuNO3.ToString();
            if (!string.IsNullOrEmpty(FuShi))
                dict["FuShi"] = this.FuShi.ToString();
            if (!string.IsNullOrEmpty(FuShiMoShiJi))
                dict["FSMSJ"] = this.FuShiMoShiJi.ToString();
 
 
            if (!string.IsNullOrEmpty(MoShi))
                dict["MoShi"] = this.MoShi.ToString();
            if (!string.IsNullOrEmpty(YouDu))
                dict["YouDu"] = this.YouDu.ToString();
            if (!string.IsNullOrEmpty(YiRan))
                dict["YiRan"] = this.YiRan.ToString();
            if (!string.IsNullOrEmpty(YiBao))
                dict["YiBao"] = this.YiBao.ToString();
 
            if (!string.IsNullOrEmpty(NongDuH2S))
                dict["HSA"] = this.NongDuH2S;
            if (!string.IsNullOrEmpty(SpecificHeat))
                dict["SHA"] = this.SpecificHeat;
 
            if (!string.IsNullOrEmpty(NormalViscosity))
                dict["RatVA"] = this.NormalViscosity;
            if (!string.IsNullOrEmpty(MaxViscosity))
                dict["MaxVA"] = this.MaxViscosity;
            if (!string.IsNullOrEmpty(MinViscosity))
                dict["MinVA"] = this.MinViscosity;
 
            if (!string.IsNullOrEmpty(NormalDensity))
                dict["RatDA"] = this.NormalDensity;
            if (!string.IsNullOrEmpty(MinDensity))
                dict["MinDA"] = this.MinDensity;
            if (!string.IsNullOrEmpty(MaxDensity))
                dict["MaxDA"] = this.MaxDensity;
 
            if (!string.IsNullOrEmpty(MaxVaporPressure))
                dict["MaxVP"] = this.MaxVaporPressure;
            if (!string.IsNullOrEmpty(NormalVaporPressure))
                dict["RatVP"] = this.NormalVaporPressure;
            if (!string.IsNullOrEmpty(MinVaporPressure))
                dict["MinVP"] = this.MinVaporPressure;
 
            if (!string.IsNullOrEmpty(MinTemperature))
                dict["MinTA"] = this.MinTemperature;
            if (!string.IsNullOrEmpty(MaxTemperature))
                dict["MaxTA"] = this.MaxTemperature;
            if (!string.IsNullOrEmpty(NormalTemperature))
                dict["RatTA"] = this.NormalTemperature;
 
            if (!string.IsNullOrEmpty(Concentration))
                dict["CAC"] = this.Concentration;
            if (!string.IsNullOrEmpty(NongDuOtherPercent))
                dict["OTA"] = this.NongDuOtherPercent;
            if (!string.IsNullOrEmpty(NongDuOtherName))
                dict["OCA"] = this.NongDuOtherName;
            if (!string.IsNullOrEmpty(KeliChiCun))
                dict["KLC"] = this.KeliChiCun;
 
            if (VisoCorrectCoeff != null)
            {
                dict["VCCF"] = this.VisoCorrectCoeff.ToDsString();
            }
            string json = (new System.Web.Script.Serialization.JavaScriptSerializer()).Serialize(dict);
 
            return json;
        }
 
        public void FromJsonString(string jsonString)
        {
            if (string.IsNullOrEmpty(jsonString))
                return;
            Dictionary<string, string> dict = (new System.Web.Script.Serialization.JavaScriptSerializer()).Deserialize(jsonString, typeof(Dictionary<string, string>)) as Dictionary<string, string>;
 
            if (dict.ContainsKey("ID"))
                this.ID = Convert.ToInt64(dict["ID"]);
            if (dict.ContainsKey("CatID"))
                this.CatalogID = Convert.ToInt64(dict["CatID"]);
            if (dict.ContainsKey("Name"))
                this.Name = dict["Name"];
 
            if (dict.ContainsKey("MD"))
            {
                double de = 0;
                if (double.TryParse(dict["MD"], out de))
                    this.CalcDensity = de;
            }
 
            if (dict.ContainsKey("ND"))
            {
                double de = 0;
                if (double.TryParse(dict["ND"], out de))
                    this.CalcViscosity = de;
            }
 
            if (dict.ContainsKey("PH"))
                this.PH = dict["PH"];
            if (dict.ContainsKey("HKL"))
                this.IsHaveKeLi4Ds = dict["HKL"];   //是否含有颗粒
            if (dict.ContainsKey("HKR"))
                this._keliRatio = dict["HKR"];     //颗粒百分比
            if (dict.ContainsKey("KLC"))
                this.KeliChiCun = dict["KLC"];
 
            if (dict.ContainsKey("FSCF"))
                this._fuShiChengFeng = dict["FSCF"];     //腐蚀成分
 
            if (dict.ContainsKey("TX"))
                this.JieZhiTeXing = dict["TX"];
            if (dict.ContainsKey("HGL"))
                this.HanGuLiang = dict["HGL"];
            if (dict.ContainsKey("LzndH"))
                this.LiZhiNongDuH = dict["LzndH"];
            if (dict.ContainsKey("LzndCL"))
                this.LiZhiNongDuCL = dict["LzndCL"];
            if (dict.ContainsKey("LzndF"))
                this.LiZhiNongDuF = dict["LzndF"];
            if (dict.ContainsKey("LzndSO4"))
                this.LiZhiNongDuSO4 = dict["LzndSO4"];
            if (dict.ContainsKey("LzndNO3"))
                this.LiZhiNongDuNO3 = dict["LzndNO3"];
            if (dict.ContainsKey("FuShi"))
                this.FuShi = dict["FuShi"];
            if (dict.ContainsKey("MoShi"))
                this.MoShi = dict["MoShi"];
            if (dict.ContainsKey("YouDu"))
                this.YouDu = dict["YouDu"];
            if (dict.ContainsKey("YiRan"))
                this.YiRan = dict["YiRan"];
            if (dict.ContainsKey("YiBao"))
                this.YiBao = dict["YiBao"];
 
 
 
 
            if (dict.ContainsKey("OCA"))
                this.NongDuOtherPercent = dict["OCA"];
            if (dict.ContainsKey("FSMSJ"))
                this.FuShiMoShiJi = dict["FSMSJ"];
 
            if (dict.ContainsKey("CAC"))
                this.Concentration = dict["CAC"];
 
            if (dict.ContainsKey("HSA"))
                this.NongDuH2S = dict["HSA"];
            if (dict.ContainsKey("SHA"))
                this.SpecificHeat = dict["SHA"];
            if (dict.ContainsKey("OTA"))
                this.NongDuOtherName = dict["OTA"];
 
 
            if (dict.ContainsKey("RatVA"))
                this.NormalViscosity = dict["RatVA"];
            if (dict.ContainsKey("MaxVA"))
                this.MaxViscosity = dict["MaxVA"];
            if (dict.ContainsKey("MinVA"))
                this.MinViscosity = dict["MinVA"];
 
            if (dict.ContainsKey("RatDA"))
                this.NormalDensity = dict["RatDA"];
            if (dict.ContainsKey("MaxDA"))
                this.MaxDensity = dict["MaxDA"];
            if (dict.ContainsKey("MinDA"))
                this.MinDensity = dict["MinDA"];
 
 
            if (dict.ContainsKey("RatVP"))
                this.NormalVaporPressure = dict["RatVP"];
            if (dict.ContainsKey("MaxVP"))
                this.MaxVaporPressure = dict["MaxVP"];
            if (dict.ContainsKey("MinVP"))
                this.MinVaporPressure = dict["MinVP"];
 
            if (dict.ContainsKey("RatTA"))
                this.NormalTemperature = dict["RatTA"];
            if (dict.ContainsKey("MaxTA"))
                this.MaxTemperature = dict["MaxTA"];
            if (dict.ContainsKey("MinTA"))
                this.MinTemperature = dict["MinTA"];
 
            if (dict.ContainsKey("VCCF") && !string.IsNullOrEmpty(dict["VCCF"]))
            {
                this.VisoCorrectCoeff = new Eventech.Model.ViscosityCorrectCoeff(dict["VCCF"]);
            }
        }
 
        public override string ToString()
        {
            return this.Name;
            //return base.ToString();
        }
    }
}