Shuxia Ning
2024-10-23 5dd7ab9852c9a5659cc916e9ed986b5099efeaf8
WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/02-node/00-core/HydroNodePropertyViewModel.cs
@@ -10,7 +10,7 @@
        /// <summary>
        /// 
        /// </summary>
        public HydroNodePropertyViewModel() { }
        public HydroNodePropertyViewModel() : base() { }
        /// <summary>
        /// 
@@ -18,6 +18,7 @@
        public HydroNodePropertyViewModel(Yw.Model.HydroNodeInfo rhs) : base(rhs)
        {
            this.Quality = rhs.Quality;
            this.UpdatePropStatus(nameof(this.Quality), rhs, nameof(rhs.Quality));
        }
        /// <summary>
@@ -35,6 +36,9 @@
        [Category("计算结果")]
        [DisplayName("自由压力")]
        [PropertyOrder(10001)]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(true)]
        public double? CalcuPress { get; set; }
@@ -44,6 +48,9 @@
        [Category("计算结果")]
        [DisplayName("绝对压力")]
        [PropertyOrder(10002)]
        [DisplayUnit("m")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(true)]
        public double? CalcuHead { get; set; }
@@ -53,6 +60,9 @@
        [Category("计算结果")]
        [DisplayName("需水量")]
        [PropertyOrder(10003)]
        [DisplayUnit("m³/h")]
        [IsHydroCalcuPro(true)]
        [ShowEditor(false)]
        [Browsable(true)]
        public double? CalcuDemand { get; set; }
@@ -67,6 +77,7 @@
            if (rhs is Yw.Model.HydroNodeInfo hydroNodeInfo)
            {
                this.Quality = hydroNodeInfo.Quality;
                this.UpdatePropStatus(nameof(this.Quality), rhs, nameof(hydroNodeInfo.Quality));
            }
        }
@@ -79,9 +90,9 @@
            base.UpdateCalcuProperty(rhs);
            if (rhs is IHydroCalcuNodeResult calcuNodeProperty)
            {
                this.CalcuPress = calcuNodeProperty.CalcuPress;
                this.CalcuHead = calcuNodeProperty.CalcuHead;
                this.CalcuDemand = calcuNodeProperty.CalcuDemand;
                this.CalcuPress = calcuNodeProperty.CalcuPress.HasValue ? Math.Round(calcuNodeProperty.CalcuPress.Value, 2) : null;
                this.CalcuHead = calcuNodeProperty.CalcuHead.HasValue ? Math.Round(calcuNodeProperty.CalcuHead.Value, 2) : null;
                this.CalcuDemand = calcuNodeProperty.CalcuDemand.HasValue ? Math.Round(calcuNodeProperty.CalcuDemand.Value, 1) : null;
            }
        }