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
using IStation.WinFrmUI.Monitor;
using System;
using System.ComponentModel.DataAnnotations;
 
namespace IStation
{
    /// <summary>
    /// 
    /// </summary>
    public class AvgStatisticsS2Dto : AvgStatisticsDto
    {
        public AvgStatisticsS2Dto() { }
        public AvgStatisticsS2Dto(AvgStatisticsDto rhs) : base(rhs) { }
        public AvgStatisticsS2Dto(AvgStatisticsS2ViewModel rhs)
        {
            MinTotalFlow = rhs.MinTotalFlow;
            MaxTotalFlow = rhs.MaxTotalFlow;
            RunCount = rhs.RunCount;
            RunFlags = rhs.RunFlags;
            TimeCount = rhs.Count;
            Pump21Pd = rhs.Pump21PdMax;
            Pump22Pd = rhs.Pump22PdMax;
            Pump23Pd = rhs.Pump23PdMax;
            Pump24Pd = rhs.Pump24PdMax;
            Pump25Pd = rhs.Pump25PdMax;
            Pump26Pd = rhs.Pump26PdMax;
            Pump27Pd = rhs.Pump27PdMax;
        }
 
        #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()
        {
            Pump21Pd = Round(Pump21Pd, 4);
            Pump22Pd = Round(Pump22Pd, 4);
            Pump23Pd = Round(Pump23Pd, 4);
            Pump24Pd = Round(Pump24Pd, 4);
            Pump25Pd = Round(Pump25Pd, 4);
            Pump26Pd = Round(Pump26Pd, 4);
            Pump27Pd = Round(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;
        }
 
 
 
 
    }
}