Shuxia Ning
2024-12-17 907a1579fecf2c160852cf99b3ea77c08eb481cc
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 连接节点
    /// </summary>
    public class HydroJunctionViewModel : HydroNodeViewModel, IHydroCalcuJunctionResult
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroJunctionViewModel() : base() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroJunctionViewModel(Yw.Model.HydroJunctionInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.Elev = rhs.Elev;
            this.UpdatePropStatus(nameof(this.Elev), rhs, nameof(rhs.Elev));
            this.MinorLoss = rhs.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
            this.Demand = rhs.Demand;
            this.UpdatePropStatus(nameof(this.Demand), rhs, nameof(rhs.Demand));
            this.DemandPattern = rhs.DemandPattern;
            this.UpdatePropStatus(nameof(this.DemandPattern), rhs, nameof(rhs.DemandPattern));
        }
 
 
        /// <summary>
        /// 标高/高程
        /// </summary>
        [Category("数据")]
        [DisplayName("标高")]
        [Display(Name = "标高(m)")]
        [DisplayUnit("m")]
        [PropertyOrder(2001)]
        [Browsable(true)]
        public virtual double Elev { get; set; }
 
        /// <summary>
        /// 损失系数
        /// </summary>
        [Category("数据")]
        [DisplayName("损失系数")]
        [Display(Name = "损失系数")]
        [PropertyOrder(2002)]
        [Browsable(true)]
        public virtual double? MinorLoss { get; set; }
 
        /// <summary>
        /// 需水量
        /// </summary>
        [Category("数据")]
        [DisplayName("需水量")]
        [Display(Name = "需水量(m³/h)")]
        [DisplayUnit("m³/h")]
        [PropertyOrder(2003)]
        [Browsable(false)]
        public virtual double? Demand { get; set; }
 
        /// <summary>
        /// 需水模式
        /// </summary>
        [Category("数据")]
        [DisplayName("需水模式")]
        [Display(Name = "需水模式")]
        [HydroPatternPro(HydroPattern.Demand)]
        [PropertyOrder(2004)]
        [Browsable(false)]
        public virtual string DemandPattern { get; set; }
 
        /// <summary>
        /// 压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("压力")]
        [Display(Name = "压力(m)")]
        [DisplayUnit("m")]
        [HydroCalcuPro]
        [PropertyOrder(11002)]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuPr { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroJunctionInfo Vmo
        {
            get { return _vmo as Yw.Model.HydroJunctionInfo; }
            set { _vmo = value; }
        }
 
        /// <summary>
        /// 
        /// </summary>
        public override void UpdateProperty()
        {
            base.UpdateProperty();
            this.Elev = this.Vmo.Elev;
            this.UpdatePropStatus(nameof(this.Elev), this.Vmo, nameof(this.Vmo.Elev));
            this.MinorLoss = this.Vmo.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
            this.Demand = this.Vmo.Demand;
            this.UpdatePropStatus(nameof(this.Demand), this.Vmo, nameof(this.Vmo.Demand));
            this.DemandPattern = this.Vmo.DemandPattern;
            this.UpdatePropStatus(nameof(this.DemandPattern), this.Vmo, nameof(this.Vmo.DemandPattern));
        }
 
        /// <summary>
        /// 
        /// </summary>
        public override void UpdateVmoProperty()
        {
            base.UpdateVmoProperty();
            this.Vmo.Elev = this.Elev;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Elev), this, nameof(this.Elev));
            this.Vmo.MinorLoss = this.MinorLoss;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
            this.Vmo.Demand = this.Demand;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Demand), this, nameof(this.Demand));
            this.Vmo.DemandPattern = this.DemandPattern;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.DemandPattern), this, nameof(this.DemandPattern));
        }
 
        /// <summary>
        /// 更新计算属性
        /// </summary>
        public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs)
        {
            base.UpdateCalcuProperty(rhs);
            if (rhs is HydroCalcuJunctionResult calcuJunctionResult)
            {
                this.CalcuPr = calcuJunctionResult.CalcuPr.HasValue ? Math.Round(calcuJunctionResult.CalcuPr.Value, 2) : null;
            }
        }
 
 
    }
}