tangxu
2024-02-27 707a73304e0406b865548645c7cd1880a3651cc4
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
using System;
 
namespace IStation.Common
{
    public class RoundHelper
    {
        public static int NpshRoundNumber_Large5 = 1;
 
        public static int NpshRoundNumber_small5 = 2;
 
        public static double GetDispValueFlow(double flow)
        {
            if (flow < 1.0)
            {
                return Math.Round(flow, 4);
            }
 
            if (flow < 5.0)
            {
                return Math.Round(flow, 3);
            }
 
            if (flow < 15.0)
            {
                return Math.Round(flow, 2);
            }
 
            return Math.Round(flow, 1);
        }
 
        public static double GetDispValueHead(double head)
        {
            if (head < 1.0)
            {
                return Math.Round(head, 4);
            }
 
            if (head < 5.0)
            {
                return Math.Round(head, 3);
            }
 
            if (head < 15.0)
            {
                return Math.Round(head, 2);
            }
 
            return Math.Round(head, 1);
        }
 
        public static double GetDispValuePress(double head)
        {
            if (head < 2.0)
            {
                return Math.Round(head, 4);
            }
 
            if (head < 5.0)
            {
                return Math.Round(head, 3);
            }
 
            if (head < 15.0)
            {
                return Math.Round(head, 2);
            }
 
            return Math.Round(head, 1);
        }
 
        public static double GetDispValuePower(double power)
        {
            if (power < 1.0)
            {
                return Math.Round(power, 4);
            }
 
            if (power < 5.0)
            {
                return Math.Round(power, 3);
            }
 
            if (power < 15.0)
            {
                return Math.Round(power, 2);
            }
 
            return Math.Round(power, 1);
        }
 
        public static double GetDispValueEta(double eta)
        {
            if (eta < 30.0)
            {
                return Math.Round(eta, 2);
            }
 
            return Math.Round(eta, 1);
        }
 
        public static double GetDispValueNPSH(double npsh)
        {
            if (npsh < 5.0)
            {
                return Math.Round(npsh, NpshRoundNumber_small5);
            }
 
            return Math.Round(npsh, NpshRoundNumber_Large5);
        }
 
        public static void Round_HEP(ref Eventech.Model.GroupPoint pt)
        {
            if (pt != null)
            {
                pt.H = GetDispValueHead(pt.H);
                pt.E = Math.Round(pt.E, 1);
                pt.P = GetDispValuePower(pt.P);
                pt.NPSH = GetDispValueNPSH(pt.NPSH);
            }
        }
    }
}