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
73
74
75
76
using System.ComponentModel.DataAnnotations;
 
namespace IStation
{
    /// <summary>
    /// 
    /// </summary>
    public class AvgStatisticsS1ViewModel : AvgStatisticsViewModel
    {
        public AvgStatisticsS1ViewModel() { }
        public AvgStatisticsS1ViewModel(AvgStatisticsViewModel rhs):base(rhs) { }
        
 
 
        [Display(Name = "11#")]
        public double? Pump11Pd { get; set; }
  
        [Display(Name = "12#")]
        public double? Pump12Pd { get; set; }
 
        [Display(Name = "13#")]
        public double? Pump13Pd { get; set; }
          
        [Display(Name = "14#")]
        public double? Pump14Pd { get; set; }
  
        [Display(Name = "15#")]
        public double? Pump15Pd { get; set; }
         
        [Display(Name = "16#")]
        public double? Pump16Pd { get; set; }
         
        [Display(Name = "17#")]
        public double? Pump17Pd { get; set; }
  
        [Display(Name = "18#")]
        public double? Pump18Pd { get; set; }
 
    
 
 
        public void Round()
        {
            this.Pump11Pd = Round(this.Pump11Pd, 4);
            this.Pump12Pd = Round(this.Pump12Pd, 4);
            this.Pump13Pd = Round(this.Pump13Pd, 4);
            this.Pump14Pd = Round(this.Pump14Pd, 4);
            this.Pump15Pd = Round(this.Pump15Pd, 4);
            this.Pump16Pd = Round(this.Pump16Pd, 4);
            this.Pump17Pd = Round(this.Pump17Pd, 4);
            this.Pump18Pd = Round(this.Pump18Pd, 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;
        }
 
        
 
    }
}