Shuxia Ning
2025-01-14 0f99d4d12f2eae29bbe343f4b3131f2faeccda5d
WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs
@@ -16,26 +16,11 @@
        public HydroPipeViewModel(Yw.Model.HydroPipeInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo)
        {
            this.Material = rhs.Material;
            this.UpdatePropStatus(nameof(this.Material), rhs, nameof(rhs.Material));
            this.Diameter = Math.Round(rhs.Diameter, 0);
            this.UpdatePropStatus(nameof(this.Diameter), rhs, nameof(rhs.Diameter));
            this.Length = Math.Round(rhs.Length, 4);
            this.UpdatePropStatus(nameof(this.Length), rhs, nameof(rhs.Length));
            this.Roughness = rhs.Roughness;
            this.UpdatePropStatus(nameof(this.Roughness), rhs, nameof(rhs.Roughness));
            this.MinorLoss = rhs.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), rhs, nameof(rhs.MinorLoss));
        }
        /// <summary>
        /// 管道状态
        /// </summary>
        [Category("数据")]
        [DisplayName("管道状态")]
        [PropertyOrder(1003)]
        [Browsable(true)]
        [TypeConverter(typeof(HydroPipeStatusConverter))]
        public override string LinkStatus { get; set; }
        /// <summary>
        /// 材质
@@ -54,6 +39,7 @@
        [Display(Name = "直径(mm)")]
        [DisplayName("直径")]
        [DisplayUnit("mm")]
        [Range(1, double.MaxValue)]
        [PropertyOrder(2002)]
        [Browsable(true)]
        public virtual double Diameter { get; set; }
@@ -97,12 +83,12 @@
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流量")]
        [DisplayUnit("m³/h")]
        [Display(Name = "流量(m³/h)")]
        [PropertyOrder(11001)]
        [Browsable(true)]
        [DisplayUnit("m³/h")]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuQ { get; set; }
        /// <summary>
@@ -110,12 +96,12 @@
        /// </summary>
        [Category("计算结果")]
        [DisplayName("进口压力")]
        [DisplayUnit("m")]
        [Display(Name = "进口压力(m)")]
        [PropertyOrder(11002)]
        [Browsable(true)]
        [DisplayUnit("m")]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuPr1 { get; set; }
        /// <summary>
@@ -123,13 +109,52 @@
        /// </summary>
        [Category("计算结果")]
        [DisplayName("出口压力")]
        [DisplayUnit("m")]
        [Display(Name = "出口压力(m)")]
        [PropertyOrder(11003)]
        [Browsable(true)]
        [DisplayUnit("m")]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public virtual double? CalcuPr2 { get; set; }
        /// <summary>
        /// 流速
        /// </summary>
        [Category("计算结果")]
        [DisplayName("流速")]
        [DisplayUnit("m/s")]
        [Display(Name = "流速(m/s)")]
        [PropertyOrder(19007)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuVelocity { get; set; }
        /// <summary>
        /// 局部损失
        /// </summary>
        [Category("计算结果")]
        [DisplayName("局部损失")]
        [DisplayUnit("m")]
        [Display(Name = "局部损失(m)")]
        [PropertyOrder(19008)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuMinorLoss { get; set; }
        /// <summary>
        /// 沿程损失
        /// </summary>
        [Category("计算结果")]
        [DisplayName("沿程损失")]
        [DisplayUnit("m")]
        [Display(Name = "沿程损失(m)")]
        [PropertyOrder(19009)]
        [HydroCalcuPro]
        [ShowEditor(false)]
        [Browsable(true)]
        public override double? CalcuFrictionLoss { get; set; }
        /// <summary>
        /// 
@@ -148,15 +173,10 @@
        {
            base.UpdateProperty();
            this.Material = this.Vmo.Material;
            this.UpdatePropStatus(nameof(this.Material), this.Vmo, nameof(this.Vmo.Material));
            this.Diameter = this.Vmo.Diameter;
            this.UpdatePropStatus(nameof(this.Diameter), this.Vmo, nameof(this.Vmo.Diameter));
            this.Length = Math.Round(this.Vmo.Length, 4);
            this.UpdatePropStatus(nameof(this.Length), this.Vmo, nameof(this.Vmo.Length));
            this.Roughness = this.Vmo.Roughness;
            this.UpdatePropStatus(nameof(this.Roughness), this.Vmo, nameof(this.Vmo.Roughness));
            this.MinorLoss = this.Vmo.MinorLoss;
            this.UpdatePropStatus(nameof(this.MinorLoss), this.Vmo, nameof(this.Vmo.MinorLoss));
        }
        /// <summary>
@@ -166,15 +186,10 @@
        {
            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));
        }
        /// <summary>