Shuxia Ning
2024-07-26 19db3c68c67e27531e716567cefaa266e71a2baf
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
using System.ComponentModel.DataAnnotations;
 
namespace IStation
{
    /// <summary>
    /// 
    /// </summary>
    public class AvgStatisticsS2 : AvgStatistics
    {
        public AvgStatisticsS2() { }
        public AvgStatisticsS2(AvgStatistics rhs):base(rhs) { }
          
        #region  Different
 
        [Display(Name = "21#")]
        public double? Pump21Pd { get; set; }
          
        [Display(Name = "22#")]
        public double? Pump22Pd { get; set; } 
 
        [Display(Name = "23#")]
        public double? Pump23Pd { get; set; } 
 
        [Display(Name = "24#")]
        public double? Pump24Pd { get; set; } 
 
        [Display(Name = "25#")]
        public double? Pump25Pd { get; set; } 
 
        [Display(Name = "26#")]
        public double? Pump26Pd { get; set; } 
 
        [Display(Name = "27#")]
        public double? Pump27Pd { get; set; }
 
        #endregion
 
        public void Round()
        {
            this.Pump21Pd = Round(this.Pump21Pd, 4);
            this.Pump22Pd = Round(this.Pump22Pd, 4);
            this.Pump23Pd = Round(this.Pump23Pd, 4);
            this.Pump24Pd = Round(this.Pump24Pd, 4);
            this.Pump25Pd = Round(this.Pump25Pd, 4);
            this.Pump26Pd = Round(this.Pump26Pd, 4);
            this.Pump27Pd = Round(this.Pump27Pd, 4);  
        }
 
 
        /// <summary>
        /// Round
        /// </summary>
        /// <param name="t"></param>
        /// <param name="digits"></param>
        private double? Round(double? t, int digits, bool filter_zero = false)
        {
            if (t.HasValue && t.Value != 0)
            {
                t = Math.Round(t.Value, digits);
            }
            if (filter_zero && t == 0)
            {
                return null;
            }
            return t;
        }
 
 
      
 
    }
}