Shuxia Ning
2024-08-07 554694000f4d7ffc231a23e7ff429595c254ceaa
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
using System.ComponentModel.DataAnnotations;
 
namespace IStation.Win.View.ViewModel
{
    public class RealTimePumpScheduleViewModel
    {
        [Display(Name = "泵")]
        public int Flag { get; set; }
 
        [Display(Name = "运行状态")]
        public double? RunStatus { get; set; }
 
        [Display(Name = "出口压力")]
        public double? OutletPressure { get; set; }
 
        [Display(Name = "瞬时流量")]
        public double? InstantaneousFlow { get; set; }
 
        [Display(Name = "有功功率")]
        public double? ActivePower { get; set; }
 
        [Display(Name = "转速")]
        public double? RotateSpeed { get; set; }
 
 
        [Display(Name = "有功功率(偏差)")]
        public double? ActivePowerDiff { get; set; }
 
        [Display(Name = "转速(偏差)")]
        public double? RotateSpeedDiif { get; set; }
 
 
        public void Set(RealTimePumpScadaViewModel vm)
        {
            this.ActivePowerDiff = this.ActivePower - vm.ActivePower;
            this.RotateSpeedDiif = this.RotateSpeed - vm.RotateSpeed;
        }
 
        public void Round()
        {
            this.OutletPressure = Round(this.OutletPressure, 3);
            this.InstantaneousFlow = Round(this.InstantaneousFlow, 1);
            this.ActivePower = Round(this.ActivePower, 1);
            this.RotateSpeed = Round(this.RotateSpeed, 1);
            this.ActivePowerDiff = Round(this.ActivePowerDiff, 2);
            this.RotateSpeedDiif = Round(this.RotateSpeedDiif, 2);
        }
 
        private double? Round(double? value, int le)
        {
            if (value == null)
            {
                return null;
            }
 
            return Math.Round(value.Value, le);
        }
    }
 
 
 
}