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

Link to this function

find_intervals_with_status(self, statuses)

View Source
@spec find_intervals_with_status(t(), [status()]) :: [interval()]
Link to this function

humanize_status(interval)

View Source
@spec humanize_status(interval()) :: String.t()
@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()
Link to this function

push_track_status(self, track_status, lap_number, timestamp)

View Source
@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()]