lixiaojun
2024-11-06 278e94cb1b045288d1205f36b67f60cb5224754c
WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs
@@ -27,6 +27,7 @@
            this.UpdatePropStatus(nameof(this.Roughness), rhs, nameof(rhs.Roughness));
            this.MinorLoss = rhs.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
            this.Vmo = rhs;
        }
@@ -35,17 +36,18 @@
        /// </summary>
        [Category("数据")]
        [DisplayName("管道状态")]
        [PropertyOrder(13)]
        [PropertyOrder(1003)]
        [Browsable(true)]
        [TypeConverter(typeof(HydroPipeStatusConverter))]
        public override string LinkStatus { get; set; }
        /// <summary>
        /// 材料
        /// 材质
        /// </summary>
        [Category("数据")]
        [DisplayName("材料")]
        [PropertyOrder(100)]
        [Display(Name = "材质")]
        [DisplayName("材质")]
        [PropertyOrder(2001)]
        [Browsable(true)]
        public string Material { get; set; }
@@ -53,9 +55,10 @@
        /// 直径
        /// </summary>
        [Category("数据")]
        [Display(Name = "直径(mm)")]
        [DisplayName("直径")]
        [PropertyOrder(101)]
        [DisplayUnit("mm")]
        [PropertyOrder(2002)]
        [Browsable(true)]
        public double Diameter { get; set; }
@@ -63,9 +66,10 @@
        /// 长度
        /// </summary>
        [Category("数据")]
        [Display(Name = "长度(m)")]
        [DisplayName("长度")]
        [PropertyOrder(102)]
        [DisplayUnit("m")]
        [PropertyOrder(2003)]
        [Browsable(true)]
        public double Length { get; set; }
@@ -73,8 +77,10 @@
        /// 粗糙系数
        /// </summary>
        [Category("数据")]
        [Display(Name = "粗糙系数")]
        [DisplayName("粗糙系数")]
        [PropertyOrder(103)]
        [Description("海森威廉公式系数")]
        [PropertyOrder(2004)]
        [Browsable(true)]
        public double Roughness { get; set; }
@@ -82,14 +88,17 @@
        /// 局阻系数
        /// </summary>
        [Category("数据")]
        [Display(Name = "局阻系数")]
        [DisplayName("局阻系数")]
        [PropertyOrder(104)]
        [Description("局部阻力系数")]
        [PropertyOrder(2005)]
        [Browsable(true)]
        public double MinorLoss { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [Browsable(false)]
        public new Yw.Model.HydroPipeInfo Vmo { get; set; }
@@ -112,6 +121,24 @@
            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
        }
        /// <summary>
        ///
        /// </summary>
        public override void UpdateVmoProperty()
        {
            base.UpdateVmoProperty();
            this.Vmo.Material = this.Material;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Material), this, nameof(this.Material));
            this.Vmo.Diameter = this.Diameter;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Diameter), this, nameof(this.Diameter));
            this.Vmo.Length = this.Length;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Length), this, nameof(this.Length));
            this.Vmo.Roughness = this.Roughness;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.Roughness), this, nameof(this.Roughness));
            this.Vmo.MinorLoss = this.MinorLoss;
            this.Vmo.UpdatePropStatus(nameof(this.Vmo.MinorLoss), this, nameof(this.MinorLoss));
        }
    }