From 94d10185010a7476021764f5b5cb59dc7d2b68f4 Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期五, 20 十二月 2024 15:23:00 +0800 Subject: [PATCH] 项目管理整改 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs | 113 +++++++++++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 95 insertions(+), 18 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs index fe49c0c..144d424 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/04-link/01-pipe/00-core/HydroPipeViewModel.cs @@ -1,11 +1,9 @@ -锘縰sing Yw.Model; - -namespace Yw.WinFrmUI +锘縩amespace Yw.WinFrmUI { /// <summary> /// 绠¢亾瑙嗗浘 /// </summary> - public class HydroPipeViewModel : HydroLinkViewModel + public class HydroPipeViewModel : HydroLinkViewModel, IHydroCalcuPipeResult { /// <summary> /// @@ -27,7 +25,6 @@ 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; } /// <summary> @@ -35,17 +32,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,19 +51,21 @@ /// 鐩村緞 /// </summary> [Category("鏁版嵁")] + [Display(Name = "鐩村緞(mm)")] [DisplayName("鐩村緞")] - [PropertyOrder(101)] [DisplayUnit("mm")] + [PropertyOrder(2002)] [Browsable(true)] - public double Diameter { get; set; } + public virtual double Diameter { get; set; } /// <summary> /// 闀垮害 /// </summary> [Category("鏁版嵁")] + [Display(Name = "闀垮害(m)")] [DisplayName("闀垮害")] - [PropertyOrder(102)] [DisplayUnit("m")] + [PropertyOrder(2003)] [Browsable(true)] public double Length { get; set; } @@ -73,8 +73,10 @@ /// 绮楃硻绯绘暟 /// </summary> [Category("鏁版嵁")] + [Display(Name = "绮楃硻绯绘暟")] [DisplayName("绮楃硻绯绘暟")] - [PropertyOrder(103)] + [Description("娴锋.濞佸粔鍏紡绯绘暟")] + [PropertyOrder(2004)] [Browsable(true)] public double Roughness { get; set; } @@ -82,17 +84,62 @@ /// 灞�闃荤郴鏁� /// </summary> [Category("鏁版嵁")] + [Display(Name = "灞�闃荤郴鏁�")] [DisplayName("灞�闃荤郴鏁�")] - [PropertyOrder(104)] + [Description("灞�閮ㄩ樆鍔涚郴鏁�")] + [PropertyOrder(2005)] [Browsable(true)] public double MinorLoss { get; set; } + + + /// <summary> + /// 娴侀噺 + /// </summary> + [Category("璁$畻缁撴灉")] + [DisplayName("娴侀噺")] + [Display(Name = "娴侀噺(m鲁/h)")] + [PropertyOrder(11001)] + [Browsable(true)] + [DisplayUnit("m鲁/h")] + [HydroCalcuPro] + [ShowEditor(false)] + public virtual double? CalcuQ { get; set; } + + /// <summary> + /// 杩涘彛鍘嬪姏 + /// </summary> + [Category("璁$畻缁撴灉")] + [DisplayName("杩涘彛鍘嬪姏")] + [Display(Name = "杩涘彛鍘嬪姏(m)")] + [PropertyOrder(11002)] + [Browsable(true)] + [DisplayUnit("m")] + [HydroCalcuPro] + [ShowEditor(false)] + public virtual double? CalcuPr1 { get; set; } + + /// <summary> + /// 鍑哄彛鍘嬪姏 + /// </summary> + [Category("璁$畻缁撴灉")] + [DisplayName("鍑哄彛鍘嬪姏")] + [Display(Name = "鍑哄彛鍘嬪姏(m)")] + [PropertyOrder(11003)] + [Browsable(true)] + [DisplayUnit("m")] + [HydroCalcuPro] + [ShowEditor(false)] + public virtual double? CalcuPr2 { get; set; } /// <summary> /// /// </summary> - public new Yw.Model.HydroPipeInfo Vmo { get; set; } - - + [Browsable(false)] + public new Yw.Model.HydroPipeInfo Vmo + { + get { return _vmo as Yw.Model.HydroPipeInfo; } + set { _vmo = value; } + } /// <summary> /// 鏇存柊灞炴�� @@ -104,7 +151,7 @@ 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 = this.Vmo.Length; + 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)); @@ -112,7 +159,37 @@ 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)); + } + /// <summary> + /// 鏇存柊璁$畻灞炴�� + /// </summary> + public override void UpdateCalcuProperty(HydroCalcuVisualResult rhs) + { + base.UpdateCalcuProperty(rhs); + if (rhs is HydroCalcuPipeResult calcuPipeProperty) + { + this.CalcuQ = calcuPipeProperty.CalcuQ.HasValue ? Math.Round(calcuPipeProperty.CalcuQ.Value, 1) : null; + this.CalcuPr1 = calcuPipeProperty.CalcuPr1.HasValue ? Math.Round(calcuPipeProperty.CalcuPr1.Value, 2) : null; + this.CalcuPr2 = calcuPipeProperty.CalcuPr2.HasValue ? Math.Round(calcuPipeProperty.CalcuPr2.Value, 2) : null; + } + } } } -- Gitblit v1.9.3