duheng
2024-12-24 f47abf649b85ce5fd21725fedaebba359a6dfd1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
namespace Yw.WinFrmUI
{
    /// <summary>
    /// 水源视图
    /// </summary>
    public class HydroSourceViewModel : HydroNodeViewModel, IHydroCalcuSourceResult
    {
        /// <summary>
        /// 
        /// </summary>
        public HydroSourceViewModel() : base() { }
 
        /// <summary>
        /// 
        /// </summary>
        public HydroSourceViewModel(Yw.Model.HydroSourceInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
 
        }
 
 
        /// <summary>
        /// 水位
        /// </summary>
        [Category("计算结果")]
        [DisplayName("水位")]
        [Display(Name = "水位(m)")]
        [DisplayUnit("m")]
        [HydroCalcuPro]
        [PropertyOrder(11001)]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuL { get; set; }
 
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroSourceInfo Vmo
        {
            get { return _vmo as Yw.Model.HydroSourceInfo; }
            set { _vmo = value; }
        }
 
        /// <summary>
        /// 更新计算属性
        /// </summary>
        public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs)
        {
            base.UpdateCalcuProperty(rhs);
            if (rhs is HydroCalcuSourceResult calcuSourceResult)
            {
                this.CalcuL = calcuSourceResult.CalcuL.HasValue ? Math.Round(calcuSourceResult.CalcuL.Value, 2) : null;
            }
        }
 
    }
}