From 1a2bcaa7bec4f0bc681e55d1ccc61b14427c98ce Mon Sep 17 00:00:00 2001 From: lixiaojun <1287241240@qq.com> Date: 星期六, 25 一月 2025 12:45:20 +0800 Subject: [PATCH] 增加构件自定义参数 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs | 64 +++++++++++++++++++++++++------- 1 files changed, 50 insertions(+), 14 deletions(-) diff --git a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs index 6a2765e..e549194 100644 --- a/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs +++ b/WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs @@ -97,6 +97,18 @@ new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuPumpResult.CalcuPr1.Value,2).ToString(),Unit="m"}, new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuPumpResult.CalcuPr2.Value,2).ToString(),Unit="m"}, }; + if (x.Paras != null && x.Paras.Count > 0) + { + foreach (var item in x.Paras) + { + pumpCustomLabel.Data.Add(new LogicCalcuCustomLabelItem() + { + Name = item.Key, + Value = item.Value, + Unit = string.Empty + }); + } + } allCalcuLabels.Add(pumpCustomLabel); } }); @@ -136,6 +148,18 @@ new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuEmitter.CalcuQ.Value,1).ToString(),Unit="m鲁/h"}, new LogicCalcuCustomLabelItem(){ Name="鍘嬪姏",Value=Math.Round(calcuEmitter.CalcuPr.Value,2).ToString(),Unit="m"} }; + if (x.Paras != null && x.Paras.Count > 0) + { + foreach (var item in x.Paras) + { + emitterCustomLabel.Data.Add(new LogicCalcuCustomLabelItem() + { + Name = item.Key, + Value = item.Value, + Unit = string.Empty + }); + } + } allCalcuLabels.Add(emitterCustomLabel); }); @@ -143,20 +167,32 @@ #region 姘村姏闃讳欢 - //_calcuResultHelper.HydroInfo.GetAllResistances()?.ForEach(x => - //{ - // var calcuResistanceResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuResistanceResult; - // var resistanceCustomLabel = new LogicCalcuCustomLabel(); - // resistanceCustomLabel.Id = x.Code; - // resistanceCustomLabel.Distance = 50000; - // resistanceCustomLabel.Data = new List<LogicCalcuCustomLabelItem>() - // { - // new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuResistanceResult.CalcuQ.Value,1).ToString(),Unit="m鲁/h"}, - // new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuResistanceResult.CalcuPr1.Value,2).ToString(),Unit="m"}, - // new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuResistanceResult.CalcuPr2.Value,2).ToString(),Unit="m"} - // }; - // allCalcuLabels.Add(resistanceCustomLabel); - //}); + _calcuResultHelper.HydroInfo.GetAllResistances()?.ForEach(x => + { + var calcuResistanceResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuResistanceResult; + var resistanceCustomLabel = new LogicCalcuCustomLabel(); + resistanceCustomLabel.Id = x.Code; + resistanceCustomLabel.Distance = 50000; + resistanceCustomLabel.Data = new List<LogicCalcuCustomLabelItem>() + { + new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuResistanceResult.CalcuQ.Value,1).ToString(),Unit="m鲁/h"}, + new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuResistanceResult.CalcuPr1.Value,2).ToString(),Unit="m"}, + new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuResistanceResult.CalcuPr2.Value,2).ToString(),Unit="m"} + }; + if (x.Paras != null && x.Paras.Count > 0) + { + foreach (var item in x.Paras) + { + resistanceCustomLabel.Data.Add(new LogicCalcuCustomLabelItem() + { + Name = item.Key, + Value = item.Value, + Unit = string.Empty + }); + } + } + allCalcuLabels.Add(resistanceCustomLabel); + }); #endregion -- Gitblit v1.9.3