namespace Yw.WinFrmUI { /// /// 压缩机视图 /// public class HydroCompressorViewModel : HydroLinkViewModel { /// /// /// public HydroCompressorViewModel() { } /// /// /// public HydroCompressorViewModel(Yw.Model.HydroCompressorInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { 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; } /// /// 开关状态 /// [Category("数据")] [DisplayName("开关状态")] [PropertyOrder(103)] [Browsable(true)] [TypeConverter(typeof(HydroValveStatusConverter))] public override string LinkStatus { get; set; } /// /// 材料 /// [Category("数据")] [DisplayName("材料")] [PropertyOrder(1001)] [Browsable(true)] public string Material { get; set; } /// /// 直径 /// [Category("数据")] [DisplayName("直径")] [PropertyOrder(1002)] [Browsable(true)] [DisplayUnit("mm")] public double Diameter { get; set; } /// /// 局阻系数 /// [Category("数据")] [DisplayName("局阻系数")] [PropertyOrder(1003)] [Browsable(true)] public double MinorLoss { get; set; } /// /// 水头损失曲线 /// [Category("数据")] [DisplayName("水头损失曲线")] [PropertyOrder(1004)] [HydroCurvePro(HydroCurve.Compressor)] [Browsable(true)] public string Curve { get { if (string.IsNullOrEmpty(this.CurveQL)) { return "未配置"; } return "已配置"; } } /// /// 水头损失曲线 /// [Category("数据")] [DisplayName("水头损失曲线")] [PropertyOrder(1005)] [HydroCurvePro(HydroCurve.CompressorQL)] [Browsable(false)] public string CurveQL { get; set; } /// /// /// [Browsable(false)] public new Yw.Model.HydroCompressorInfo Vmo { get; set; } /// /// /// 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.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)); } /// /// /// 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.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)); } } }