ningshuxia
2025-03-31 d321346f204a69b1929cc39098a5d88f44509e7b
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
using IStation.WinFrmUI.Monitor;
using System;
using System.ComponentModel.DataAnnotations;
 
namespace IStation
{
    /// <summary>
    /// 
    /// </summary>
    public class AvgStatisticsS1Dto : AvgStatisticsDto
    {
        public AvgStatisticsS1Dto() { }
        public AvgStatisticsS1Dto(AvgStatisticsDto rhs) : base(rhs) { }
        public AvgStatisticsS1Dto(AvgStatisticsS1ViewModel rhs)
        {
            MinTotalFlow = rhs.MinTotalFlow;
            MaxTotalFlow = rhs.MaxTotalFlow;
            RunCount = rhs.RunCount;
            RunFlags = rhs.RunFlags;
            TimeCount = rhs.Count;
            Pump11Pd = rhs.Pump11PdMax;
            Pump12Pd = rhs.Pump12PdMax;
            Pump13Pd = rhs.Pump13PdMax;
            Pump14Pd = rhs.Pump14PdMax;
            Pump15Pd = rhs.Pump15PdMax;
            Pump16Pd = rhs.Pump16PdMax;
            Pump17Pd = rhs.Pump17PdMax;
            Pump18Pd = rhs.Pump18PdMax;
        }
 
 
 
        [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()
        {
            Pump11Pd = Round(Pump11Pd, 4);
            Pump12Pd = Round(Pump12Pd, 4);
            Pump13Pd = Round(Pump13Pd, 4);
            Pump14Pd = Round(Pump14Pd, 4);
            Pump15Pd = Round(Pump15Pd, 4);
            Pump16Pd = Round(Pump16Pd, 4);
            Pump17Pd = Round(Pump17Pd, 4);
            Pump18Pd = Round(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;
        }
 
 
 
    }
}