View Source F1Bot.F1Session.TrackStatusHistory (f1_bot v0.7.0)
Stores intervals when the race is neutralized (VSC, SC, red flag)
Link to this section Summary
Link to this section Types
@type interval() :: %{ id: binary(), starts_at: DateTime.t(), ends_at: DateTime.t() | nil, start_lap: pos_integer(), end_lap: pos_integer() | nil, status: status() }
@type status() ::
:all_clear | :yellow_flag | :safety_car | :red_flag | :virtual_safety_car
@type t() :: %F1Bot.F1Session.TrackStatusHistory{intervals: [interval()]}
Link to this section Functions
@spec new() :: t()
Link to this function
new_interval(track_status, starts_at, ends_at \\ nil, start_lap \\ nil, end_lap \\ nil)
View Source@spec new_interval( status(), DateTime.t(), DateTime.t() | nil, pos_integer() | nil, pos_integer() | nil ) :: interval()
@spec push_track_status(t(), status(), pos_integer(), DateTime.t()) :: {t(), [F1Bot.F1Session.Common.Event.t()]}
@spec to_chart_events(t()) :: [F1Bot.F1Session.Common.Event.t()]