lixiaojun
2025-01-20 bef933e7e166b085ba7e46e38ea62d9ae0129ec6
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 过渡件视图
    /// </summary>
    public class HydroTranslationViewModel : HydroLinkViewModel, IHydroCalcuTranslationResult
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroTranslationViewModel() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroTranslationViewModel(Yw.Model.HydroTranslationInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.Material = rhs.Material;
            this.Length = Math.Round(rhs.Length, 0);
            this.Roughness = Math.Round(rhs.Roughness, 0);
            this.MinorLoss = Math.Round(rhs.MinorLoss, 0);
            this.StartDiameter = Math.Round(rhs.StartDiameter, 0);
            this.EndDiameter = Math.Round(rhs.EndDiameter, 0);
        }
 
        /// <summary>
        /// 材质
        /// </summary>
        [Category("数据")]
        [Display(Name = "材质")]
        [DisplayName("材质")]
        [PropertyOrder(2001)]
        [Browsable(true)]
        public string Material { get; set; }
 
        /// <summary>
        /// 长度
        /// </summary>
        [Category("数据")]
        [Display(Name = "长度(m)")]
        [DisplayName("长度")]
        [DisplayUnit("m")]
        [PropertyOrder(2003)]
        [Browsable(true)]
        public double Length { get; set; }
 
        /// <summary>
        /// 粗糙系数
        /// </summary>
        [Category("数据")]
        [Display(Name = "粗糙系数")]
        [DisplayName("粗糙系数")]
        [Description("海森威廉公式系数")]
        [PropertyOrder(2004)]
        [Browsable(true)]
        public double Roughness { get; set; }
 
        /// <summary>
        /// 局阻系数
        /// </summary>
        [Category("数据")]
        [Display(Name = "局阻系数")]
        [DisplayName("局阻系数")]
        [Description("局部阻力系数")]
        [PropertyOrder(2005)]
        [Browsable(true)]
        public double MinorLoss { get; set; }
 
        /// <summary>
        /// 上游直径
        /// </summary>
        [Category("数据")]
        [Display(Name = "上游直径(mm)")]
        [DisplayName("上游直径")]
        [DisplayUnit("mm")]
        [PropertyOrder(3001)]
        [Browsable(true)]
        public double StartDiameter { get; set; }
 
        /// <summary>
        /// 下游直径
        /// </summary>
        [Category("数据")]
        [Display(Name = "下游直径(mm)")]
        [DisplayName("下游直径")]
        [DisplayUnit("mm")]
        [PropertyOrder(3002)]
        [Browsable(true)]
        public double EndDiameter { get; set; }
 
        /// <summary>
        /// 流量
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流量")]
        [DisplayUnit("m³/h")]
        [Display(Name = "流量(m³/h)")]
        [PropertyOrder(11001)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuQ { get; set; }
 
        /// <summary>
        /// 进口压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("进口压力")]
        [DisplayUnit("m")]
        [Display(Name = "进口压力(m)")]
        [PropertyOrder(11002)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuPr1 { get; set; }
 
        /// <summary>
        /// 出口压力
        /// </summary>
        [Category("计算结果")]
        [DisplayName("出口压力")]
        [DisplayUnit("m")]
        [Display(Name = "出口压力(m)")]
        [PropertyOrder(11003)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuPr2 { get; set; }
 
        /// <summary>
        /// 流速
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流速")]
        [DisplayUnit("m/s")]
        [Display(Name = "流速(m/s)")]
        [PropertyOrder(19007)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuVelocity { get; set; }
 
        /// <summary>
        /// 局部损失
        /// </summary>
        [Category("计算结果")]
        [DisplayName("局部损失")]
        [DisplayUnit("m")]
        [Display(Name = "局部损失(m)")]
        [PropertyOrder(19008)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuMinorLoss { get; set; }
 
        /// <summary>
        /// 沿程损失
        /// </summary>
        [Category("计算结果")]
        [DisplayName("沿程损失")]
        [DisplayUnit("m")]
        [Display(Name = "沿程损失(m)")]
        [PropertyOrder(19009)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuFrictionLoss { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroTranslationInfo Vmo
        {
            get { return _vmo as Yw.Model.HydroTranslationInfo; }
            set { _vmo = value; }
        }
 
 
 
        /// <summary>
        /// 更新属性
        /// </summary>
        public override void UpdateProperty()
        {
            base.UpdateProperty();
            this.Material = this.Vmo.Material;
            this.Length = Math.Round(this.Vmo.Length, 4);
            this.Roughness = this.Vmo.Roughness;
            this.MinorLoss = this.Vmo.MinorLoss;
            this.StartDiameter = this.Vmo.StartDiameter;
            this.EndDiameter = this.Vmo.EndDiameter;
        }
 
        /// <summary>
        /// 
        /// </summary>
        public override void UpdateVmoProperty()
        {
            base.UpdateVmoProperty();
            this.Vmo.Material = this.Material;
            this.Vmo.Length = this.Length;
            this.Vmo.Roughness = this.Roughness;
            this.Vmo.MinorLoss = this.MinorLoss;
            this.Vmo.StartDiameter = this.StartDiameter;
            this.Vmo.EndDiameter = this.EndDiameter;
        }
 
        /// <summary>
        /// 更新计算属性
        /// </summary>
        public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs)
        {
            base.UpdateCalcuProperty(rhs);
            if (rhs is HydroCalcuPipeResult calcuPipeProperty)
            {
                this.CalcuQ = calcuPipeProperty.CalcuQ.HasValue ? Math.Round(calcuPipeProperty.CalcuQ.Value, 1) : null;
                this.CalcuPr1 = calcuPipeProperty.CalcuPr1.HasValue ? Math.Round(calcuPipeProperty.CalcuPr1.Value, 2) : null;
                this.CalcuPr2 = calcuPipeProperty.CalcuPr2.HasValue ? Math.Round(calcuPipeProperty.CalcuPr2.Value, 2) : null;
            }
        }
 
    }
}