| | |
| | | /// <summary> |
| | | /// 连接节点 |
| | | /// </summary> |
| | | public class HydroJunctionViewModel : HydroNodeViewModel |
| | | public class HydroJunctionViewModel : HydroNodeViewModel, IHydroCalcuJunctionResult |
| | | { |
| | | /// <summary> |
| | | /// |
| | |
| | | /// </summary> |
| | | public HydroJunctionViewModel(Yw.Model.HydroJunctionInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) |
| | | { |
| | | this.Elev = rhs.Elev; |
| | | this.UpdatePropStatus(nameof(this.Elev), rhs, nameof(rhs.Elev)); |
| | | this.Elev = Math.Round(rhs.Elev, 4); |
| | | this.MinorLoss = rhs.MinorLoss; |
| | | this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss)); |
| | | this.Demand = rhs.Demand; |
| | | this.UpdatePropStatus(nameof(this.Demand), rhs, nameof(rhs.Demand)); |
| | | this.DemandPattern = rhs.DemandPattern; |
| | | this.UpdatePropStatus(nameof(this.DemandPattern), rhs, nameof(rhs.DemandPattern)); |
| | | |
| | | this.Vmo = rhs; |
| | | } |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | [Category("数据")] |
| | | [DisplayName("标高")] |
| | | [Display(Name = "标高(m)")] |
| | | [DisplayUnit("m")] |
| | | [Display(Name = "标高(m)")] |
| | | [PropertyOrder(2001)] |
| | | [Browsable(true)] |
| | | public virtual double Elev { get; set; } |
| | |
| | | [Display(Name = "损失系数")] |
| | | [PropertyOrder(2002)] |
| | | [Browsable(true)] |
| | | public virtual double? MinorLoss { get; set; } |
| | | public virtual double MinorLoss { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 需水量 |
| | |
| | | [DisplayUnit("m³/h")] |
| | | [PropertyOrder(2003)] |
| | | [Browsable(false)] |
| | | public virtual double? Demand { get; set; } |
| | | public virtual double Demand { get; set; } |
| | | |
| | | /// <summary> |
| | | /// 需水模式 |
| | |
| | | [Category("数据")] |
| | | [DisplayName("需水模式")] |
| | | [Display(Name = "需水模式")] |
| | | [IsHydroPatternPro(HydroPattern.Demand)] |
| | | [HydroPatternPro(HydroPattern.Demand)] |
| | | [PropertyOrder(2004)] |
| | | [Browsable(false)] |
| | | public virtual string DemandPattern { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// 压力 |
| | | /// </summary> |
| | | [Browsable(false)] |
| | | public new Yw.Model.HydroJunctionInfo Vmo { get; set; } |
| | | [Category("计算结果")] |
| | | [DisplayName("压力")] |
| | | [DisplayUnit("m")] |
| | | [Display(Name = "压力(m)")] |
| | | [PropertyOrder(11002)] |
| | | [HydroCalcuPro] |
| | | [ShowEditor(false)] |
| | | [Browsable(true)] |
| | | public virtual double? CalcuPr { get; set; } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public override void Update() |
| | | [Browsable(false)] |
| | | public new Yw.Model.HydroJunctionInfo Vmo |
| | | { |
| | | base.Update(); |
| | | this.Elev = this.Vmo.Elev; |
| | | this.UpdatePropStatus(nameof(this.Elev), this.Vmo, nameof(this.Vmo.Elev)); |
| | | this.MinorLoss = this.Vmo.MinorLoss; |
| | | this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss)); |
| | | this.Demand = this.Vmo.Demand; |
| | | this.UpdatePropStatus(nameof(this.Demand), this.Vmo, nameof(this.Vmo.Demand)); |
| | | this.DemandPattern = this.Vmo.DemandPattern; |
| | | this.UpdatePropStatus(nameof(this.DemandPattern), this.Vmo, nameof(this.Vmo.DemandPattern)); |
| | | get { return _vmo as Yw.Model.HydroJunctionInfo; } |
| | | set { _vmo = value; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | 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; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | 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; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新计算属性 |
| | | /// </summary> |
| | | 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; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |