diff --git a/OpenF1.Console/Display/SessionStatsDisplay.cs b/OpenF1.Console/Display/SessionStatsDisplay.cs index e450b4e..68758a8 100644 --- a/OpenF1.Console/Display/SessionStatsDisplay.cs +++ b/OpenF1.Console/Display/SessionStatsDisplay.cs @@ -119,23 +119,30 @@ private IRenderable GetTeamsChampionshipTable() private IRenderable GetSpeedTrapTable() { - var traps = new string[] {"FL", "I1", "I2", "ST"}; + var traps = new string[] { "FL", "I1", "I2", "ST" }; var tables = new List(); - var stats = timingStatsProcessor.Latest.Lines.Values; + var stats = timingStatsProcessor.Latest.Lines; foreach (var trapKey in traps) { var table = new Table() { Title = new TableTitle(trapKey) }; table.AddColumns("Driver", "Kph"); - var lines = stats.OrderBy(x => x.BestSpeeds.GetValueOrDefault(trapKey)?.Position); - foreach (var line in lines) + var lines = stats.OrderBy(x => x.Value.BestSpeeds.GetValueOrDefault(trapKey)?.Position); + foreach (var (driverNumber, line) in lines) { - var driver = driverList.Latest.GetValueOrDefault(line.RacingNumber ?? "", new() { RacingNumber = line.RacingNumber }); - table.AddRow( - new Markup(DisplayUtils.MarkedUpDriverNumber(driver)), - new Text(line.BestSpeeds.GetValueOrDefault(trapKey)?.Value ?? "UNK") + var driver = driverList.Latest.GetValueOrDefault( + driverNumber ?? "", + new() { RacingNumber = driverNumber } ); + var speed = line.BestSpeeds.GetValueOrDefault(trapKey)?.Value ?? ""; + if (!string.IsNullOrWhiteSpace(speed)) + { + table.AddRow( + new Markup(DisplayUtils.MarkedUpDriverNumber(driver)), + new Text(speed) + ); + } } table.SimpleBorder(); diff --git a/OpenF1.Data/Models/TimingDataPoints/TimingStatsDataPoint.cs b/OpenF1.Data/Models/TimingDataPoints/TimingStatsDataPoint.cs index 4c222a9..04ae972 100644 --- a/OpenF1.Data/Models/TimingDataPoints/TimingStatsDataPoint.cs +++ b/OpenF1.Data/Models/TimingDataPoints/TimingStatsDataPoint.cs @@ -9,9 +9,6 @@ public sealed record TimingStatsDataPoint: ILiveTimingDataPoint public sealed record Driver { - public int? Line { get; set; } - public string? RacingNumber { get; set; } - public Dictionary BestSpeeds { get; set; } = []; public record Stat