duheng
2024-11-05 21dd2ae9704c484d5d75b2ed980e5402505da7dc
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
using Yw.Model;
 
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 管道视图
    /// </summary>
    public class HydroPipeViewModel : HydroLinkViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroPipeViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroPipeViewModel(Yw.Model.HydroPipeInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.Material = rhs.Material;
            this.UpdatePropStatus(nameof(this.Material), rhs, nameof(rhs.Material));
            this.Diameter = Math.Round(rhs.Diameter, 0);
            this.UpdatePropStatus(nameof(this.Diameter), rhs, nameof(rhs.Diameter));
            this.Length = Math.Round(rhs.Length, 4);
            this.UpdatePropStatus(nameof(this.Length), rhs, nameof(rhs.Length));
            this.Roughness = rhs.Roughness;
            this.UpdatePropStatus(nameof(this.Roughness), rhs, nameof(rhs.Roughness));
            this.MinorLoss = rhs.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
            this.Vmo = rhs;
        }
 
        /// <summary>
        /// 管道状态
        /// </summary>
        [Category("数据")]
        [DisplayName("管道状态")]
        [PropertyOrder(13)]
        [Browsable(true)]
        [TypeConverter(typeof(HydroPipeStatusConverter))]
        public override string LinkStatus { get; set; }
 
        /// <summary>
        /// 材料
        /// </summary>
        [Category("数据")]
        [DisplayName("材料")]
        [PropertyOrder(100)]
        [Browsable(true)]
        public string Material { get; set; }
 
        /// <summary>
        /// 直径
        /// </summary>
        [Category("数据")]
        [DisplayName("直径")]
        [PropertyOrder(101)]
        [DisplayUnit("mm")]
        [Browsable(true)]
        public double Diameter { get; set; }
 
        /// <summary>
        /// 长度
        /// </summary>
        [Category("数据")]
        [DisplayName("长度")]
        [PropertyOrder(102)]
        [DisplayUnit("m")]
        [Browsable(true)]
        public double Length { get; set; }
 
        /// <summary>
        /// 粗糙系数
        /// </summary>
        [Category("数据")]
        [DisplayName("粗糙系数")]
        [PropertyOrder(103)]
        [Browsable(true)]
        public double Roughness { get; set; }
 
        /// <summary>
        /// 局阻系数
        /// </summary>
        [Category("数据")]
        [DisplayName("局阻系数")]
        [PropertyOrder(104)]
        [Browsable(true)]
        public double MinorLoss { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        public new Yw.Model.HydroPipeInfo Vmo { get; set; }
 
 
 
        /// <summary>
        /// 更新属性
        /// </summary>
        public override void UpdateProperty()
        {
            base.UpdateProperty();
            this.Material = this.Vmo.Material;
            this.UpdatePropStatus(nameof(this.Material), this.Vmo, nameof(this.Vmo.Material));
            this.Diameter = this.Vmo.Diameter;
            this.UpdatePropStatus(nameof(this.Diameter), this.Vmo, nameof(this.Vmo.Diameter));
            this.Length = this.Vmo.Length;
            this.UpdatePropStatus(nameof(this.Length), this.Vmo, nameof(this.Vmo.Length));
            this.Roughness = this.Vmo.Roughness;
            this.UpdatePropStatus(nameof(this.Roughness), this.Vmo, nameof(this.Vmo.Roughness));
            this.MinorLoss = this.Vmo.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
        }
 
 
 
    }
}