From 3effbd15ec04bbc39514c6904fa71d00631c96eb Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期一, 04 十一月 2024 01:36:42 +0800 Subject: [PATCH] 整合属性研究 --- WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/03-meter/02-flowmeter/HydroFlowmeterViewModel.cs | 39 ++++++++++++++++++++++----------------- 1 files changed, 22 insertions(+), 17 deletions(-) diff --git a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/02-node/03-junction/03-other/02-flowmeter/HydroFlowmeterPropertyViewModel.cs b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/03-meter/02-flowmeter/HydroFlowmeterViewModel.cs similarity index 70% rename from WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/02-node/03-junction/03-other/02-flowmeter/HydroFlowmeterPropertyViewModel.cs rename to WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/03-meter/02-flowmeter/HydroFlowmeterViewModel.cs index 9d7aaa3..a56ccf3 100644 --- a/WinFrmUI/Yw.WinFrmUI.Hydro.Core/03-property/02-node/03-junction/03-other/02-flowmeter/HydroFlowmeterPropertyViewModel.cs +++ b/WinFrmUI/Yw.WinFrmUI.Hydro.Core/04-viewmodel/03-node/03-junction/03-meter/02-flowmeter/HydroFlowmeterViewModel.cs @@ -1,24 +1,24 @@ -锘縰sing Yw.Model; - -namespace Yw.WinFrmUI +锘縩amespace Yw.WinFrmUI { /// <summary> - /// 娴侀噺璁″睘鎬ц鍥� + /// 娴侀噺璁¤鍥� /// </summary> - public class HydroFlowmeterPropertyViewModel : HydroJunctionPropertyViewModel, IHydroCalcuFlowmeterResult + public class HydroFlowmeterViewModel : HydroJunctionViewModel, IHydroCalcuFlowmeterResult { /// <summary> /// /// </summary> - public HydroFlowmeterPropertyViewModel() : base() { } + public HydroFlowmeterViewModel() { } /// <summary> /// /// </summary> - public HydroFlowmeterPropertyViewModel(Yw.Model.HydroFlowmeterInfo rhs) : base(rhs) + public HydroFlowmeterViewModel(Yw.Model.HydroFlowmeterInfo rhs, Yw.Model.HydroModelInfo hydroInfo) : base(rhs, hydroInfo) { this.CurrentFlow = rhs.CurrentFlow.HasValue ? Math.Round(rhs.CurrentFlow.Value, 1) : null; this.UpdatePropStatus(nameof(this.CurrentFlow), rhs, nameof(rhs.CurrentFlow)); + + this.Vmo = rhs; } @@ -82,25 +82,30 @@ /// <summary> - /// 鏇存柊灞炴�� + /// /// </summary> - public override void UpdateProperty(HydroParterInfo rhs, List<HydroParterInfo> allParterList) + [Browsable(false)] + public new Yw.Model.HydroFlowmeterInfo Vmo { get; set; } + + /// <summary> + /// + /// </summary> + public override void Update() { - base.UpdateProperty(rhs, allParterList); - if (rhs is Yw.Model.HydroFlowmeterInfo hydroFlowmeterInfo) - { - this.CurrentFlow = hydroFlowmeterInfo.CurrentFlow; - this.UpdatePropStatus(nameof(this.CurrentFlow), hydroFlowmeterInfo, nameof(hydroFlowmeterInfo.CurrentFlow)); - } + base.Update(); + this.CurrentFlow = this.Vmo.CurrentFlow; + this.UpdatePropStatus(nameof(this.CurrentFlow), this.Vmo, nameof(this.Vmo.CurrentFlow)); } + + /// <summary> /// 鏇存柊璁$畻灞炴�� /// </summary> - public override void UpdateCalcuProperty(IHydroCalcuResult rhs) + public override void UpdateCalcuProperty(HydroCalcuResult rhs) { base.UpdateCalcuProperty(rhs); - if (rhs is IHydroCalcuFlowmeterResult calcuFlowmeterProperty) + if (rhs is HydroCalcuFlowmeterResult calcuFlowmeterProperty) { this.CalcuQ = calcuFlowmeterProperty.CalcuQ.HasValue ? Math.Round(calcuFlowmeterProperty.CalcuQ.Value, 1) : null; } -- Gitblit v1.9.3