-
-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathPositionDataPoint.cs
More file actions
49 lines (40 loc) · 1.47 KB
/
PositionDataPoint.cs
File metadata and controls
49 lines (40 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
namespace UndercutF1.Data;
/// <summary>
/// Position data is sent as compressed (with deflate) JSON containing Entries.
/// Each Position Entry is the cars position at a specific point of time, and they seem to be batched to reduce network load.
/// </summary>
[Mergeable]
public sealed partial record PositionDataPoint : ILiveTimingDataPoint
{
public LiveTimingDataType LiveTimingDataType => LiveTimingDataType.Position;
public List<PositionData> Position { get; set; } = [new()];
public sealed partial record PositionData
{
public DateTimeOffset Timestamp { get; set; }
/// <summary>
/// Dictionary of DriverNumber to Entry with position data.
/// </summary>
public Dictionary<string, Entry> Entries { get; set; } = [];
public sealed partial record Entry
{
public DriverStatus? Status { get; set; }
/// <summary>
/// X position of the car in 1/10ths of a meter (cm).
/// </summary>
public int? X { get; set; }
/// <summary>
/// Y position of the car in 1/10ths of a meter (cm).
/// </summary>
public int? Y { get; set; }
/// <summary>
/// Z position of the car in 1/10ths of a meter (cm).
/// </summary>
public int? Z { get; set; }
public enum DriverStatus
{
OnTrack,
OffTrack,
}
}
}
}