lixiaojun
2024-11-05 7ddeb60ea935a8e1cfb2e835f7ba6898879d5716
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 压力表视图
    /// </summary>
    public class HydroPressmeterViewModel : HydroJunctionViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroPressmeterViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroPressmeterViewModel(Yw.Model.HydroPressmeterInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.CurrentPress = rhs.CurrentPress.HasValue ? Math.Round(rhs.CurrentPress.Value, 2) : null;
            this.UpdatePropStatus(nameof(this.CurrentPress), rhs, nameof(rhs.CurrentPress));
 
            this.Vmo = rhs;
        }
 
        /// <summary>
        /// 当前压力
        /// </summary>
        [Category("数据")]
        [DisplayName("当前压力")]
        [Display(Name = "当前压力(m)")]
        [DisplayUnit("m")]
        [PropertyOrder(3001)]
        [Browsable(true)]
        public double? CurrentPress { get; set; }
 
        /// <summary>
        /// 自由压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("自由压力")]
        [PropertyOrder(10001)]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(false)]
        public override double? CalcuPress { get; set; }
 
        /// <summary>
        /// 绝对压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("绝对压力")]
        [PropertyOrder(10002)]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(false)]
        public override double? CalcuHead { get; set; }
 
        /// <summary>
        /// 需水量
        /// </summary>
        [Category("计算结果")]
        [DisplayName("需水量")]
        [PropertyOrder(10003)]
        [DisplayUnit("m³/h")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(false)]
        public override double? CalcuDemand { get; set; }
 
        /// <summary>
        /// 计算压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("计算压力")]
        [Display(Name = "计算压力(m)")]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [PropertyOrder(11001)]
        [ShowEditor(false)]
        [Browsable(true)]
        public double? CalcuPr { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroPressmeterInfo Vmo { get; set; }
 
        /// <summary>
        /// 更新属性
        /// </summary>
        public override void UpdateProperty()
        {
            base.UpdateProperty();
            this.CurrentPress = this.Vmo.CurrentPress;
            this.UpdatePropStatus(nameof(this.CurrentPress), this.Vmo, nameof(this.Vmo.CurrentPress));
        }
 
 
        /// <summary>
        /// 更新计算属性
        /// </summary>
        public override void UpdateCalcuProperty(HydroCalcuResult rhs)
        {
            base.UpdateCalcuProperty(rhs);
            if (rhs is IHydroCalcuPressmeterResult calcuPressmeterProperty)
            {
                this.CalcuPr = calcuPressmeterProperty.CalcuPr.HasValue ? Math.Round(calcuPressmeterProperty.CalcuPr.Value, 2) : null;
            }
        }
 
    }
}