using Yw.Model; namespace Yw.WinFrmUI { /// /// 管道属性视图 /// public class HydroPipePropertyViewModel : HydroLinkPropertyViewModel { /// /// /// public HydroPipePropertyViewModel() : base() { } /// /// /// public HydroPipePropertyViewModel(Yw.Model.HydroPipeInfo rhs) : base(rhs) { 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.Length = rhs.Length; 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)); } /// /// 管道状态 /// [Category("数据")] [DisplayName("管道状态")] [PropertyOrder(13)] [Browsable(true)] [TypeConverter(typeof(HydroPipeStatusConverter))] public override string LinkStatus { get; set; } /// /// 材料 /// [Category("数据")] [DisplayName("材料")] [PropertyOrder(100)] [Browsable(true)] public string Material { get; set; } /// /// 直径 /// [Category("数据")] [DisplayName("直径")] [PropertyOrder(101)] [DisplayUnit("mm")] [Browsable(true)] public double Diameter { get; set; } /// /// 长度 /// [Category("数据")] [DisplayName("长度")] [PropertyOrder(102)] [DisplayUnit("m")] [Browsable(true)] public double Length { get; set; } /// /// 粗糙系数 /// [Category("数据")] [DisplayName("粗糙系数")] [PropertyOrder(103)] [Browsable(true)] public double Roughness { get; set; } /// /// 局阻系数 /// [Category("数据")] [DisplayName("局阻系数")] [PropertyOrder(104)] [Browsable(true)] public double MinorLoss { get; set; } /// /// 更新属性 /// public override void UpdateProperty(HydroParterInfo rhs, List allParterList) { base.UpdateProperty(rhs, allParterList); if (rhs is Yw.Model.HydroPipeInfo hydroPipeInfo) { this.Material = hydroPipeInfo.Material; this.UpdatePropStatus(nameof(this.Material), hydroPipeInfo, nameof(hydroPipeInfo.Material)); this.Diameter = hydroPipeInfo.Diameter; this.UpdatePropStatus(nameof(this.Diameter), hydroPipeInfo, nameof(hydroPipeInfo.Diameter)); this.Length = hydroPipeInfo.Length; this.UpdatePropStatus(nameof(this.Length), hydroPipeInfo, nameof(hydroPipeInfo.Length)); this.Roughness = hydroPipeInfo.Roughness; this.UpdatePropStatus(nameof(this.Roughness), hydroPipeInfo, nameof(hydroPipeInfo.Roughness)); this.MinorLoss = hydroPipeInfo.MinorLoss; this.UpdatePropStatus(nameof(this.MinorLoss), hydroPipeInfo, nameof(hydroPipeInfo.MinorLoss)); } } } }