namespace Yw.WinFrmUI { /// /// 水泵属性视图 /// public class HydroPumpViewModel : HydroLinkViewModel, IHydroCalcuPumpResult { /// /// /// public HydroPumpViewModel() { } /// /// /// public HydroPumpViewModel(Yw.Model.HydroPumpInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { this.RatedP = rhs.RatedP; this.RatedQ = rhs.RatedQ; this.RatedH = rhs.RatedH; this.RatedN = rhs.RatedN; this.RatedHz = rhs.RatedHz; this.InletDiameter = rhs.InletDiameter; this.OutletDiameter = rhs.OutletDiameter; this.SpeedRatio = rhs.SpeedRatio; this.SpeedRatioPattern = rhs.SpeedRatioPattern; this.CurveQH = rhs.CurveQH; this.CurveQP = rhs.CurveQP; this.CurveQE = rhs.CurveQE; } /// /// 水泵状态 /// [Category("数据")] [DisplayName("水泵状态")] [PropertyOrder(1003)] [TypeConverter(typeof(HydroPumpStatusConverter))] [Browsable(true)] public override string LinkStatus { get; set; } /// /// 额定流量 /// [Category("数据")] [Display(Name = "额定流量(m³/h)")] [DisplayUnit("m³/h")] [DisplayName("额定流量")] [PropertyOrder(2001)] [Browsable(true)] public double RatedQ { get; set; } /// /// 额定扬程 /// [Category("数据")] [Display(Name = "额定扬程(m)")] [DisplayName("额定扬程")] [DisplayUnit("m")] [PropertyOrder(2002)] [Browsable(true)] public double RatedH { get; set; } /// /// 额定功率 /// [Category("数据")] [Display(Name = "额定功率(kW)")] [DisplayName("额定功率")] [DisplayUnit("kW")] [PropertyOrder(2003)] [Browsable(true)] public double RatedP { get; set; } /// /// 额定转速 /// [Category("数据")] [Display(Name = "额定转速(r/min)")] [DisplayName("额定转速")] [DisplayUnit("r/min")] [PropertyOrder(2004)] [Browsable(true)] public double RatedN { get; set; } /// /// 额定频率 /// [Category("数据")] [Display(Name = "额定频率")] [DisplayName("额定频率")] [DisplayUnit("hz")] [PropertyOrder(2005)] [Browsable(true)] public double RatedHz { get; set; } /// /// 进口口径 /// [Category("数据")] [Display(Name = "进口口径(mm)")] [DisplayName("进口口径")] [DisplayUnit("mm")] [PropertyOrder(2006)] [Browsable(true)] public double? InletDiameter { get; set; } /// /// 出口口径 /// [Category("数据")] [Display(Name = "出口口径(mm)")] [DisplayName("出口口径")] [DisplayUnit("mm")] [PropertyOrder(2007)] [Browsable(true)] public double? OutletDiameter { get; set; } /// /// 设定频率 /// [Category("数据")] [Display(Name = "设定频率")] [DisplayName("设定频率")] [DisplayUnit("hz")] [PropertyOrder(2006)] [Browsable(true)] public double CurrentHz { get { return this.SpeedRatio * this.RatedHz; } set { if (this.RatedHz <= 0) { return; } this.SpeedRatio = value / this.RatedHz; } } /// /// 转速比 /// [Category("数据")] [DisplayName("转速比")] [PropertyOrder(2007)] [Browsable(false)] public double SpeedRatio { get; set; } /// /// 转速比模式 /// [Category("数据")] [DisplayName("转速比模式")] [PropertyOrder(2008)] [Browsable(false)] public string SpeedRatioPattern { get; set; } /// /// 性能曲线 /// [Category("数据")] [DisplayName("性能曲线")] [PropertyOrder(2009)] [HydroCurvePro(HydroCurve.Pump)] [Browsable(true)] public string Curve { get { if (string.IsNullOrEmpty(this.CurveQH)) { return "未配置"; } return "已配置"; } } /// /// 流量扬程曲线 /// [Category("数据")] [DisplayName("流量扬程曲线")] [PropertyOrder(2010)] [HydroCurvePro(HydroCurve.Pump, HydroCurveType.CurveQH)] [Browsable(true)] public string CurveQH { get; set; } /// /// 流量功率曲线 /// [Category("数据")] [DisplayName("流量功率曲线")] [PropertyOrder(2011)] [HydroCurvePro(HydroCurve.Pump, HydroCurveType.CurveQP)] [Browsable(true)] public string CurveQP { get; set; } /// /// 流量效率曲线 /// [Category("数据")] [DisplayName("流量效率曲线")] [PropertyOrder(2012)] [HydroCurvePro(HydroCurve.Pump, HydroCurveType.CurveQE)] [Browsable(true)] public string CurveQE { get; set; } /// /// 流量 /// [Category("计算结果")] [DisplayName("流量")] [DisplayUnit("m³/h")] [Display(Name = "流量(m³/h)")] [PropertyOrder(11001)] [HydroCalcuPro] [ShowEditor(false)] [Browsable(true)] public 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")] [Display(Name = "扬程(m)")] [PropertyOrder(11004)] [HydroCalcuPro] [ShowEditor(false)] [Browsable(true)] public double? CalcuH { get; set; } /// /// 功率 /// [Category("计算结果")] [DisplayName("功率")] [DisplayUnit("kW")] [Display(Name = "功率(kW)")] [PropertyOrder(11005)] [HydroCalcuPro] [ShowEditor(false)] [Browsable(true)] public double? CalcuP { get; set; } /// /// 效率 /// [Category("计算结果")] [DisplayName("效率")] [DisplayUnit("%")] [Display(Name = "效率(%)")] [PropertyOrder(11006)] [HydroCalcuPro] [ShowEditor(false)] [Browsable(true)] public double? CalcuE { get; set; } /// /// /// [Browsable(false)] public new Yw.Model.HydroPumpInfo Vmo { get { return _vmo as Yw.Model.HydroPumpInfo; } set { _vmo = value; } } /// /// /// public override void UpdateProperty() { base.UpdateProperty(); this.RatedP = this.Vmo.RatedP; this.RatedQ = this.Vmo.RatedQ; this.RatedH = this.Vmo.RatedH; this.RatedN = this.Vmo.RatedN; this.RatedHz = this.Vmo.RatedHz; this.SpeedRatio = this.Vmo.SpeedRatio; this.SpeedRatioPattern = this.Vmo.SpeedRatioPattern; this.CurveQH = this.Vmo.CurveQH; this.CurveQP = this.Vmo.CurveQP; this.CurveQE = this.Vmo.CurveQE; } public override void UpdateVmoProperty() { base.UpdateVmoProperty(); this.Vmo.RatedQ = this.RatedQ; this.Vmo.RatedH = this.RatedH; this.Vmo.RatedP = this.RatedP; this.Vmo.RatedN = this.RatedN; this.Vmo.RatedHz = this.RatedHz; this.Vmo.SpeedRatio = this.SpeedRatio; this.Vmo.SpeedRatioPattern = this.SpeedRatioPattern; this.Vmo.CurveQH = this.CurveQH; this.Vmo.CurveQP = this.CurveQP; this.Vmo.CurveQE = this.CurveQE; } /// /// 更新计算属性 /// public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs) { base.UpdateCalcuProperty(rhs); if (rhs is HydroCalcuPumpResult calcuPumpProperty) { this.CalcuQ = calcuPumpProperty.CalcuQ.HasValue ? Math.Round(calcuPumpProperty.CalcuQ.Value, 1) : null; this.CalcuPr1 = calcuPumpProperty.CalcuPr1.HasValue ? Math.Round(calcuPumpProperty.CalcuPr1.Value, 2) : null; this.CalcuPr2 = calcuPumpProperty.CalcuPr2.HasValue ? Math.Round(calcuPumpProperty.CalcuPr2.Value, 2) : null; this.CalcuH = calcuPumpProperty.CalcuH.HasValue ? Math.Round(calcuPumpProperty.CalcuH.Value, 2) : null; this.CalcuP = calcuPumpProperty.CalcuP.HasValue ? Math.Round(calcuPumpProperty.CalcuP.Value, 1) : null; this.CalcuE = calcuPumpProperty.CalcuE.HasValue ? Math.Round(calcuPumpProperty.CalcuE.Value, 1) : null; } } } }