lixiaojun
2024-11-23 2c9f613860b0f1f104da43f67895e221e6f7cf11
WinFrmUI/HStation.WinFrmUI.Xhs.Core/03-simulation/00-core/03-calcu/02-label/SimulationCalcuResultLabelHelper.cs
@@ -52,7 +52,6 @@
            }
        }
        //获取计算标签
        private List<LogicCalcuCustomLabel> GetLabels()
        {
@@ -61,29 +60,35 @@
            {
                return default;
            }
            var allCalcuResultVisualDict = _calcuResultHelper.GetVisualResultDict();
            var workingInfo = JsonHelper.Json2Object<HydroWorkingInfoViewModel>(_calcuResultHelper.Working.WorkingInfo);
            var allCalcuResultVisualDict = _calcuResultHelper.GetVisualDict();
            var allCalcuLabels = new List<LogicCalcuCustomLabel>();
            hydroInfo.Pumps?.ForEach(x =>
            {
                var hz = Math.Round(x.RatedHz * x.SpeedRatio);
                var calcuPumpResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuLinkResult;
                if (calcuPumpResult != null)
                var workingPump = workingInfo?.Pumps?.Find(t => t.Code == x.Code);
                if (workingPump != 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.Data = new List<LogicCalcuCustomLabelItem>()
                    var hz = Math.Round(x.RatedHz * x.SpeedRatio);
                    var calcuPumpResult = allCalcuResultVisualDict.GetValue(x.Code) as HydroCalcuLinkResult;
                    if (calcuPumpResult != null)
                    {
                        new LogicCalcuCustomLabelItem(){ Name="状态",Value=HydroLinkStatusHelper.GetStatusName(x.LinkStatus),Unit=string.Empty},
                        new LogicCalcuCustomLabelItem(){ Name="频率",Value=hz.ToString(),Unit=string.Empty},
                        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"},
                    };
                    allCalcuLabels.Add(pumpCustomLabel);
                        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.Data = new List<LogicCalcuCustomLabelItem>()
                        {
                            new LogicCalcuCustomLabelItem(){ Name="状态",Value=HydroLinkStatusHelper.GetStatusName(workingPump.LinkStatus),Unit=string.Empty},
                            new LogicCalcuCustomLabelItem(){ Name="频率",Value=workingPump.CurrentHz.ToString(),Unit=string.Empty},
                            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"},
                        };
                        allCalcuLabels.Add(pumpCustomLabel);
                    }
                }
            });
            hydroInfo.GetAllEmitters()?.ForEach(x =>