From 6936ebf1dfbd0025d3e86ae7dde316b6a6e43b9b Mon Sep 17 00:00:00 2001 From: duheng <2784771470@qq.com> Date: 星期二, 24 十二月 2024 16:40:23 +0800 Subject: [PATCH] Merge branch 'master' of http://47.103.154.90:83/r/HStation/XHS.V1.0 --- WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs | 98 +++++++++++++++++++++++++++++++++++++++++------- 1 files changed, 83 insertions(+), 15 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 83ec023..6a2765e 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 @@ -43,11 +43,11 @@ var labels = GetLabels(); if (labels != null && labels.Count > 0) { - _views.ForEach(x => x.SetLogicCalcuCustomLabels(labels)); + _views.ForEach(async x => await x.SetLogicCalcuCustomLabels(labels)); return; } } - _views.ForEach(x => x.ClearLogicCalcuCustomLabels()); + _views.ForEach(async x => await x.ClearLogicCalcuCustomLabels()); } //鑾峰彇璁$畻鏍囩 @@ -58,44 +58,112 @@ return default; } var allCalcuResultVisualDict = _calcuResultHelper.GetVisualDict(); + var allCalcuLabels = new List<LogicCalcuCustomLabel>(); + + #region 姘存睜 + + _calcuResultHelper.HydroInfo.GetAllTanks()?.ForEach(x => + { + var calcuTankResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuTankResult; + var customLabel = new LogicCalcuCustomLabel(); + customLabel.Id = x.Code; + customLabel.Distance = 50000; + customLabel.Data = new List<LogicCalcuCustomLabelItem>() + { + new LogicCalcuCustomLabelItem(){ Name="姘翠綅",Value=Math.Round(calcuTankResult.CalcuL.Value,2).ToString(),Unit="m"}, + }; + allCalcuLabels.Add(customLabel); + }); + + #endregion + + #region 姘存车 + _calcuResultHelper.HydroInfo.Pumps?.ForEach(x => { var hz = Math.Round(x.RatedHz * x.SpeedRatio); - var calcuPumpResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuLinkResult; + var calcuPumpResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuPumpResult; if (calcuPumpResult != null) { - var calcuPumpStartResult = allCalcuResultVisualDict.GetValue(x.StartCode) as HydroCalcuNodeResult; - var calcuPumpEndResult = allCalcuResultVisualDict.GetValue(x.EndCode) as HydroCalcuNodeResult; var pumpCustomLabel = new LogicCalcuCustomLabel(); pumpCustomLabel.Id = x.Code; - pumpCustomLabel.Distance = 20000; + pumpCustomLabel.Distance = 50000; pumpCustomLabel.Data = new List<LogicCalcuCustomLabelItem>() { - new LogicCalcuCustomLabelItem(){ Name="鐘舵��",Value=HydroLinkStatusHelper.GetStatusName(x.LinkStatus),Unit=string.Empty}, - new LogicCalcuCustomLabelItem(){ Name="棰戠巼",Value=x.LinkStatus==Yw.Hydro.PumpStatus.Open?hz.ToString():"0",Unit="hz"}, - new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuPumpResult.CalcuFlow.Value,1).ToString(),Unit="m鲁/h"}, - new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuPumpStartResult.CalcuHead.Value,4).ToString(),Unit="m"}, - new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuPumpEndResult.CalcuHead.Value,4).ToString(),Unit="m"}, + new LogicCalcuCustomLabelItem(){ Name="鐘舵��",Value=HydroLinkStatusHelper.GetStatusName(x.LinkStatus),Unit=string.Empty}, + new LogicCalcuCustomLabelItem(){ Name="棰戠巼",Value=x.LinkStatus==Yw.Hydro.PumpStatus.Open?hz.ToString():"0",Unit="hz"}, + new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuPumpResult.CalcuQ.Value,1).ToString(),Unit="m鲁/h"}, + 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"}, }; allCalcuLabels.Add(pumpCustomLabel); } }); + #endregion + + #region 闃�闂� + + //_calcuResultHelper.HydroInfo.Valves?.ForEach(x => + //{ + // var calcuResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuValveResult; + // var customLabel = new LogicCalcuCustomLabel(); + // customLabel.Id = x.Code; + // customLabel.Distance = 50000; + // customLabel.Data = new List<LogicCalcuCustomLabelItem>() + // { + // new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuResult.CalcuQ.Value,1).ToString(),Unit="m鲁/h"}, + // new LogicCalcuCustomLabelItem(){ Name="杩涘彛鍘嬪姏",Value=Math.Round(calcuResult.CalcuPr1.Value,2).ToString(),Unit="m"}, + // new LogicCalcuCustomLabelItem(){ Name="鍑哄彛鍘嬪姏",Value=Math.Round(calcuResult.CalcuPr2.Value,2).ToString(),Unit="m"}, + // new LogicCalcuCustomLabelItem(){ Name="闃�闂ㄥ紑搴�",Value=Math.Round(x.OpeningDegree,0).ToString(),Unit="掳"} + // }; + // allCalcuLabels.Add(customLabel); + //}); + + #endregion + + #region 鎵╂暎鍣� + _calcuResultHelper.HydroInfo.GetAllEmitters()?.ForEach(x => { - var calcuEmitter = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuNodeResult; + var calcuEmitter = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuEmitterResult; var emitterCustomLabel = new LogicCalcuCustomLabel(); emitterCustomLabel.Id = x.Code; - emitterCustomLabel.Distance = 30000; + emitterCustomLabel.Distance = 50000; emitterCustomLabel.Data = new List<LogicCalcuCustomLabelItem>() { - new LogicCalcuCustomLabelItem(){ Name="娴侀噺",Value=Math.Round(calcuEmitter.CalcuDemand.Value,1).ToString(),Unit="m鲁/h"}, - new LogicCalcuCustomLabelItem(){ Name="鍘嬪姏",Value=Math.Round(calcuEmitter.CalcuDemand.Value,4).ToString(),Unit="m"} + 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"} }; allCalcuLabels.Add(emitterCustomLabel); }); + + #endregion + + #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); + //}); + + #endregion + + return allCalcuLabels; + + } -- Gitblit v1.9.3