namespace Yw.WinFrmUI
{
///
/// 过渡件视图
///
public class HydroTranslationViewModel : HydroLinkViewModel, IHydroCalcuTranslationResult
{
///
///
///
public HydroTranslationViewModel() { }
///
///
///
public HydroTranslationViewModel(Yw.Model.HydroTranslationInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
{
this.Elev = Math.Round(rhs.Elev, 4);
this.TranslationType = rhs.TranslationType;
this.Material = rhs.Material;
this.Length = Math.Round(rhs.Length, 4);
this.Roughness = rhs.Roughness;
this.MinorLoss = rhs.MinorLoss;
this.StartDiameter = Math.Round(rhs.StartDiameter, 0);
this.EndDiameter = Math.Round(rhs.EndDiameter, 0);
}
///
/// 标高/高程
///
[Category("数据")]
[DisplayName("标高")]
[DisplayUnit("m")]
[Display(Name = "标高(m)")]
[PropertyOrder(2001)]
[Browsable(true)]
public virtual double Elev { get; set; }
///
/// 过渡件类型
///
[Category("数据")]
[Display(Name = "过渡件类型")]
[DisplayName("过渡件类型")]
[PropertyOrder(2002)]
[Browsable(true)]
public string TranslationType { get; set; }
///
/// 材质
///
[Category("数据")]
[Display(Name = "材质")]
[DisplayName("材质")]
[PropertyOrder(2003)]
[Browsable(true)]
public string Material { get; set; }
///
/// 长度
///
[Category("数据")]
[Display(Name = "长度(m)")]
[DisplayName("长度")]
[DisplayUnit("m")]
[PropertyOrder(2004)]
[Browsable(false)]
public double Length { get; set; }
///
/// 粗糙系数
///
[Category("数据")]
[Display(Name = "粗糙系数")]
[DisplayName("粗糙系数")]
[Description("海森威廉公式系数")]
[PropertyOrder(2005)]
[Browsable(false)]
public double Roughness { get; set; }
///
/// 局阻系数
///
[Category("数据")]
[Display(Name = "局阻系数")]
[DisplayName("局阻系数")]
[Description("局部阻力系数")]
[PropertyOrder(2006)]
[Browsable(true)]
public double MinorLoss { get; set; }
///
/// 上游直径
///
[Category("数据")]
[Display(Name = "上游直径(mm)")]
[DisplayName("上游直径")]
[DisplayUnit("mm")]
[PropertyOrder(3001)]
[Browsable(true)]
public double StartDiameter { get; set; }
///
/// 下游直径
///
[Category("数据")]
[Display(Name = "下游直径(mm)")]
[DisplayName("下游直径")]
[DisplayUnit("mm")]
[PropertyOrder(3002)]
[Browsable(true)]
public double EndDiameter { get; set; }
///
/// 流量
///
[Category("计算结果")]
[DisplayName("流量")]
[DisplayUnit("m³/h")]
[Display(Name = "流量(m³/h)")]
[PropertyOrder(11001)]
[HydroCalcuPro]
[ShowEditor(false)]
[Browsable(true)]
public virtual double? CalcuQ { get; set; }
///
/// 进口压力
///
[Category("计算结果")]
[DisplayName("进口压力")]
[DisplayUnit("m")]
[Display(Name = "进口压力(m)")]
[PropertyOrder(11002)]
[HydroCalcuPro]
[ShowEditor(false)]
[Browsable(true)]
public virtual double? CalcuPr1 { get; set; }
///
/// 出口压力
///
[Category("计算结果")]
[DisplayName("出口压力")]
[DisplayUnit("m")]
[Display(Name = "出口压力(m)")]
[PropertyOrder(11003)]
[HydroCalcuPro]
[ShowEditor(false)]
[Browsable(true)]
public virtual double? CalcuPr2 { get; set; }
///
/// 流速
///
[Category("计算结果")]
[DisplayName("流速")]
[DisplayUnit("m/s")]
[Display(Name = "流速(m/s)")]
[PropertyOrder(19007)]
[HydroCalcuPro]
[ShowEditor(false)]
[Browsable(true)]
public override double? CalcuVelocity { get; set; }
///
/// 局部损失
///
[Category("计算结果")]
[DisplayName("局部损失")]
[DisplayUnit("m")]
[Display(Name = "局部损失(m)")]
[PropertyOrder(19008)]
[HydroCalcuPro]
[ShowEditor(false)]
[Browsable(true)]
public override double? CalcuMinorLoss { get; set; }
///
///
///
[Browsable(false)]
public new Yw.Model.HydroTranslationInfo Vmo
{
get { return _vmo as Yw.Model.HydroTranslationInfo; }
set { _vmo = value; }
}
///
/// 更新属性
///
public override void UpdateProperty()
{
base.UpdateProperty();
this.Elev = Math.Round(this.Vmo.Elev, 4);
this.TranslationType = this.Vmo.TranslationType;
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;
}
///
///
///
public override void UpdateVmoProperty()
{
base.UpdateVmoProperty();
this.Vmo.Elev = this.Elev;
this.TranslationType = this.TranslationType;
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;
}
///
/// 更新计算属性
///
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;
}
}
}
}