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(1003)]
|
[Browsable(true)]
|
[TypeConverter(typeof(HydroPipeStatusConverter))]
|
public override string LinkStatus { get; set; }
|
|
/// <summary>
|
/// 材质
|
/// </summary>
|
[Category("数据")]
|
[Display(Name = "材质")]
|
[DisplayName("材质")]
|
[PropertyOrder(2001)]
|
[Browsable(true)]
|
public string Material { get; set; }
|
|
/// <summary>
|
/// 直径
|
/// </summary>
|
[Category("数据")]
|
[Display(Name = "直径(mm)")]
|
[DisplayName("直径")]
|
[DisplayUnit("mm")]
|
[PropertyOrder(2002)]
|
[Browsable(true)]
|
public double Diameter { 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>
|
[Browsable(false)]
|
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 = Math.Round(this.Vmo.Length, 4);
|
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));
|
}
|
|
/// <summary>
|
///
|
/// </summary>
|
public override void UpdateVmoProperty()
|
{
|
base.UpdateVmoProperty();
|
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.Length = this.Length;
|
this.Vmo.UpdatePropStatus(nameof(this.Vmo.Length), this, nameof(this.Length));
|
this.Vmo.Roughness = this.Roughness;
|
this.Vmo.UpdatePropStatus(nameof(this.Vmo.Roughness), this, nameof(this.Roughness));
|
this.Vmo.MinorLoss = this.MinorLoss;
|
this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
|
}
|
|
|
|
}
|
}
|