lixiaojun
2024-10-31 abf1e3b3334ab47c38aa92405a11a6ec92b7847a
WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-parter/02-node/01-source/01-reservoir/HydroReservoirViewModel.cs
@@ -15,8 +15,8 @@
        /// </summary>
        public HydroReservoirViewModel(Yw.Model.HydroReservoirInfo rhs) : base(rhs)
        {
            this.PoolElev = rhs.PoolElev;
            this.Head = rhs.Head;
            this.PoolElev = rhs.PoolElev.HasValue ? Math.Round(rhs.PoolElev.Value, 4) : null;
            this.Head = Math.Round(rhs.Head, 2);
            this.HeadPattern = rhs.HeadPattern;
            this.Vmo = rhs;
@@ -27,8 +27,8 @@
        /// </summary>
        public HydroReservoirViewModel(Yw.Model.HydroReservoirInfo rhs, HydroCalcuNodeResult calcuResult) : base(rhs, calcuResult)
        {
            this.PoolElev = rhs.PoolElev;
            this.Head = rhs.Head;
            this.PoolElev = rhs.PoolElev.HasValue ? Math.Round(rhs.PoolElev.Value, 4) : null;
            this.Head = Math.Round(rhs.Head, 2);
            this.HeadPattern = rhs.HeadPattern;
            this.Vmo = rhs;
@@ -44,7 +44,7 @@
        /// 总水头
        /// </summary>
        [DisplayName("总水头(m)")]
        public double? Head { get; set; }
        public double Head { get; set; }
        /// <summary>
        /// 水头模式
@@ -57,5 +57,22 @@
        /// </summary>
        public new Yw.Model.HydroReservoirInfo Vmo { get; set; }
        /// <summary>
        ///
        /// </summary>
        public override void Update()
        {
            base.Update();
            if (this.Vmo == null)
            {
                return;
            }
            this.PoolElev = this.Vmo.PoolElev.HasValue ? Math.Round(this.Vmo.PoolElev.Value, 4) : null;
            this.Head = Math.Round(this.Vmo.Head, 2);
            this.HeadPattern = this.Vmo.HeadPattern;
        }
    }
}