namespace Yw.WinFrmUI { /// /// 连接节点 /// public class HydroJunctionViewModel : HydroNodeViewModel, IHydroCalcuJunctionResult { /// /// /// public HydroJunctionViewModel() : base() { } /// /// /// public HydroJunctionViewModel(Yw.Model.HydroJunctionInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { this.Elev = Math.Round(rhs.Elev, 4); this.MinorLoss = rhs.MinorLoss; this.Demand = rhs.Demand; this.DemandPattern = rhs.DemandPattern; } /// /// 标高/高程 /// [Category("数据")] [DisplayName("标高")] [DisplayUnit("m")] [Display(Name = "标高(m)")] [PropertyOrder(2001)] [Browsable(true)] public virtual double Elev { get; set; } /// /// 损失系数 /// [Category("数据")] [DisplayName("损失系数")] [Display(Name = "损失系数")] [PropertyOrder(2002)] [Browsable(true)] public virtual double MinorLoss { get; set; } /// /// 需水量 /// [Category("数据")] [DisplayName("需水量")] [Display(Name = "需水量(m³/h)")] [DisplayUnit("m³/h")] [PropertyOrder(2003)] [Browsable(false)] public virtual double Demand { get; set; } /// /// 需水模式 /// [Category("数据")] [DisplayName("需水模式")] [Display(Name = "需水模式")] [HydroPatternPro(HydroPattern.Demand)] [PropertyOrder(2004)] [Browsable(false)] public virtual string DemandPattern { get; set; } /// /// 压力 /// [Category("计算结果")] [DisplayName("压力")] [DisplayUnit("m")] [Display(Name = "压力(m)")] [PropertyOrder(11002)] [HydroCalcuPro] [ShowEditor(false)] [Browsable(true)] public virtual double? CalcuPr { get; set; } /// /// /// [Browsable(false)] public new Yw.Model.HydroJunctionInfo Vmo { get { return _vmo as Yw.Model.HydroJunctionInfo; } set { _vmo = value; } } /// /// /// public override void UpdateProperty() { base.UpdateProperty(); this.Elev = Math.Round(this.Vmo.Elev, 4); this.MinorLoss = this.Vmo.MinorLoss; this.Demand = this.Vmo.Demand; this.DemandPattern = this.Vmo.DemandPattern; } /// /// /// public override void UpdateVmoProperty() { base.UpdateVmoProperty(); this.Vmo.Elev = this.Elev; this.Vmo.MinorLoss = this.MinorLoss; this.Vmo.Demand = this.Demand; this.Vmo.DemandPattern = this.DemandPattern; } /// /// 更新计算属性 /// public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs) { base.UpdateCalcuProperty(rhs); if (rhs is HydroCalcuJunctionResult calcuJunctionResult) { this.CalcuPr = calcuJunctionResult.CalcuPr.HasValue ? Math.Round(calcuJunctionResult.CalcuPr.Value, 2) : null; } } } }