lixiaojun
2024-09-20 abbe29e54421c136aa6eb4ef11935c70d818101a
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
using Yw.Model;
 
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 管段属性视图
    /// </summary>
    public class HydroLinkPropertyViewModel : HydroParterPropertyViewModel, IHydroCalcuLinkProperty
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroLinkPropertyViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroLinkPropertyViewModel(Yw.Model.HydroLinkInfo rhs) : base(rhs)
        {
            this.StartCode = rhs.StartCode;
            this.EndCode = rhs.EndCode;
            this.LinkStatus = rhs.LinkStatus;
        }
 
        /// <summary>
        /// 上游节点编码
        /// </summary>
        [Category("基础信息")]
        [DisplayName("上游节点编码")]
        [PropertyOrder(11)]
        [Browsable(true)]
        [ShowEditor(false)]
        public string StartCode { get; set; }
 
        /// <summary>
        /// 下游节点编码
        /// </summary>
        [Category("基础信息")]
        [DisplayName("下游节点编码")]
        [PropertyOrder(12)]
        [Browsable(true)]
        [ShowEditor(false)]
        public string EndCode { get; set; }
 
        /// <summary>
        /// 管段状态
        /// </summary>
        [Category("数据")]
        [DisplayName("管段状态")]
        [PropertyOrder(13)]
        [Browsable(true)]
        public virtual string LinkStatus { get; set; }
 
        /// <summary>
        /// 流量
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流量")]
        [PropertyOrder(10001)]
        [Browsable(true)]
        [DisplayUnit("m³/h")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        public double? CalcuFlow { get; set; }
 
        /// <summary>
        /// 流速
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流速")]
        [PropertyOrder(10002)]
        [Browsable(true)]
        [DisplayUnit("m/s")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        public double? CalcuVelocity { get; set; }
 
        /// <summary>
        /// 水头损失
        /// </summary>
        [Category("计算结果")]
        [DisplayName("水头损失")]
        [PropertyOrder(10003)]
        [Browsable(true)]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        public double? CalcuHeadLoss { get; set; }
 
        /// <summary>
        /// 更新属性
        /// </summary>
        /// <param name="rhs"></param>
        /// <param name="allParterList"></param>
        public override void UpdateProperty(HydroParterInfo rhs, List<HydroParterInfo> allParterList)
        {
            base.UpdateProperty(rhs, allParterList);
            if (rhs is Yw.Model.HydroLinkInfo hydroLinkInfo)
            {
                this.StartCode = hydroLinkInfo.StartCode;
                this.EndCode = hydroLinkInfo.EndCode;
                this.LinkStatus = hydroLinkInfo.LinkStatus;
            }
        }
 
        /// <summary>
        /// 更新计算属性
        /// </summary>
        /// <param name="rhs"></param>
        public override void UpdateCalcuProperty(IHydroCalcuProperty rhs)
        {
            base.UpdateCalcuProperty(rhs);
            if (rhs is IHydroCalcuLinkProperty calcuLinkProperty)
            {
                this.CalcuFlow = calcuLinkProperty.CalcuFlow;
                this.CalcuVelocity = calcuLinkProperty.CalcuVelocity;
                this.CalcuHeadLoss = calcuLinkProperty.CalcuHeadLoss;
            }
        }
 
 
    }
}