lixiaojun
2024-12-11 e47f92df1569e16a19deed592f773591da02d890
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
142
143
144
145
146
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 组件视图
    /// </summary>
    public class HydroResistanceViewModel : HydroLinkViewModel
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroResistanceViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroResistanceViewModel(Yw.Model.HydroResistanceInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.LinkStatus = HydroResistanceStatusHelper.GetStatusName(rhs.LinkStatus);
            this.UpdatePropStatus(nameof(this.LinkStatus), rhs, nameof(rhs.LinkStatus));
            this.Material = rhs.Material;
            this.UpdatePropStatus(nameof(this.Material), rhs, nameof(rhs.Material));
            this.Diameter = rhs.Diameter;
            this.UpdatePropStatus(nameof(this.Diameter), rhs, nameof(rhs.Diameter));
            this.MinorLoss = rhs.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
            this.CurveQL = rhs.CurveQL;
            this.UpdatePropStatus(nameof(this.CurveQL), rhs, nameof(rhs.CurveQL));
 
            this.Vmo = rhs;
        }
 
        /// <summary>
        /// 开关状态
        /// </summary>
        [Category("数据")]
        [DisplayName("开关状态")]
        [Display(Name = "开关状态")]
        [Description("[默认]使用水头损失曲线;[开启]使用局阻系数")]
        [PropertyOrder(103)]
        [Browsable(true)]
        [TypeConverter(typeof(HydroResistanceStatusConverter))]
        public override string LinkStatus { get; set; }
 
        /// <summary>
        /// 材料
        /// </summary>
        [Category("数据")]
        [DisplayName("材料")]
        [PropertyOrder(1001)]
        [Browsable(true)]
        public string Material { get; set; }
 
        /// <summary>
        /// 直径
        /// </summary>
        [Category("数据")]
        [DisplayName("直径")]
        [DisplayUnit("mm")]
        [PropertyOrder(1002)]
        [Browsable(true)]
        public double Diameter { get; set; }
 
        /// <summary>
        /// 局阻系数
        /// </summary>
        [Category("数据")]
        [DisplayName("局阻系数")]
        [PropertyOrder(1003)]
        [Browsable(true)]
        public double MinorLoss { get; set; }
 
        /// <summary>
        /// 水头损失曲线
        /// </summary>
        [Category("数据")]
        [DisplayName("水头损失曲线")]
        [HydroCurvePro(HydroCurve.ResistanceQL, HydroCurveType.CurveQL)]
        [PropertyOrder(1004)]
        [Browsable(true)]
        public virtual string Curve
        {
            get
            {
                if (string.IsNullOrEmpty(this.CurveQL))
                {
                    return "未配置";
                }
                return "已配置";
            }
        }
 
        /// <summary>
        /// 水头损失曲线
        /// </summary>
        [Category("数据")]
        [DisplayName("水头损失曲线")]
        [PropertyOrder(1005)]
        [HydroCurvePro(HydroCurve.ResistanceQL, HydroCurveType.CurveQL)]
        [Browsable(false)]
        public string CurveQL { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroResistanceInfo Vmo { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        public override void UpdateProperty()
        {
            base.UpdateProperty();
            this.LinkStatus = HydroResistanceStatusHelper.GetStatusName(this.Vmo.LinkStatus);
            this.UpdatePropStatus(nameof(this.LinkStatus), this.Vmo, nameof(this.Vmo.LinkStatus));
            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.MinorLoss = this.Vmo.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
            this.CurveQL = this.Vmo.CurveQL;
            this.UpdatePropStatus(nameof(this.CurveQL), this.Vmo, nameof(this.Vmo.CurveQL));
        }
 
        /// <summary>
        /// 
        /// </summary>
        public override void UpdateVmoProperty()
        {
            base.UpdateVmoProperty();
            this.Vmo.LinkStatus = HydroResistanceStatusHelper.GetStatusCode(this.LinkStatus);
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.LinkStatus), this, nameof(this.LinkStatus));
            this.Vmo.Material = this.Material;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Material), this, nameof(this.Material));
            this.Vmo.Diameter = this.Diameter;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Diameter), this, nameof(this.Diameter));
            this.Vmo.MinorLoss = this.MinorLoss;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
            this.Vmo.CurveQL = this.CurveQL;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.CurveQL), this, nameof(this.CurveQL));
        }
 
 
    }
}