Messages

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSegments = 40

Variables

This section is empty.

Functions

This section is empty.

Types

type CarLocation

type CarLocation int
const (
	NoLocation CarLocation = iota
	Pitlane
	PitOut
	OutLap
	OnTrack
	OutOfRace
	Stopped
)

TODO - add garage and grid - need to calculate these based on speed and session type

func (CarLocation) String

func (c CarLocation) String() string

type DRSState

type DRSState int
const (
	DRSUnknown DRSState = iota
	DRSEnabled
	DRSDisabled
)

func (DRSState) String

func (d DRSState) String() string

type DriverInfo added in v1.0.0

type DriverInfo struct {
	StartPosition int
	Name          string
	ShortName     string
	Number        int
	Team          string
	HexColor      string
	Color         color.RGBA
}

type Drivers added in v1.0.0

type Drivers struct {
	Timestamp time.Time

	Drivers []DriverInfo
}

type Event

type Event struct {
	Timestamp time.Time

	Name string
	Type EventType

	Status    SessionState
	Heartbeat bool

	CurrentLap      int
	TotalLaps       int
	Sector1Segments int
	Sector2Segments int
	Sector3Segments int
	TotalSegments   int
	SegmentFlags    [MaxSegments]FlagState

	PitExitOpen bool
	TrackStatus FlagState
	SafetyCar   TrackState

	RemainingTime    time.Duration
	SessionStartTime time.Time
	ClockStopped     bool

	DRSEnabled DRSState
}

type EventTime

type EventTime struct {
	Timestamp time.Time

	Remaining time.Duration
}

type EventType

type EventType int
const (
	Practice1 EventType = iota
	Practice2
	Practice3
	Qualifying0
	Qualifying1
	Qualifying2
	Qualifying3
	Sprint
	Race
	PreSeason
)

func (EventType) String

func (e EventType) String() string

type FlagState

type FlagState int
const (
	NoFlag FlagState = iota
	GreenFlag
	YellowFlag
	DoubleYellowFlag
	RedFlag
	ChequeredFlag
	BlueFlag
	BlackAndWhite
)

func (FlagState) String

func (f FlagState) String() string

type Location

type Location struct {
	Timestamp time.Time

	DriverNumber int
	X            float64
	Y            float64
	Z            float64
}

type PitStop added in v1.0.0

type PitStop struct {
	Lap          int
	PitlaneEntry time.Time
	PitlaneExit  time.Time
	PitlaneTime  time.Duration
}

type RaceControlMessage

type RaceControlMessage struct {
	Timestamp time.Time

	Msg  string
	Flag FlagState
}

type Radio

type Radio struct {
	Timestamp time.Time

	Driver string
	Msg    []byte
}

type SegmentType

type SegmentType int
const (
	None SegmentType = iota
	YellowSegment
	GreenSegment
	InvalidSegment // Doesn't get displayed, cut corner/boundaries or invalid segment time?
	PurpleSegment
	RedSegment     // After chequered flag/stopped on track
	PitlaneSegment // In pitlane
	Mystery
	Mystery2 // ??? 2021 - Turkey Practice_2
	Mystery3 // ??? 2020 - Italy Race
)

type SessionState

type SessionState int
const (
	UnknownState SessionState = iota
	Inactive
	Started
	Aborted
	Finished
	Finalised
	Ended
)

func (SessionState) String

func (s SessionState) String() string

type SessionType

type SessionType int
const (
	Practice1Session SessionType = iota
	Practice2Session
	Practice3Session
	QualifyingSession
	SprintSession
	RaceSession
	PreSeasonSession
)

func (SessionType) String

func (s SessionType) String() string

type Telemetry

type Telemetry struct {
	Timestamp    time.Time
	DriverNumber int

	RPM      int16
	Speed    float32
	Gear     byte
	Throttle float32
	Brake    float32
	DRS      bool
}

type Timing

type Timing struct {
	Timestamp time.Time

	Position int

	Name      string
	ShortName string
	Number    int
	Team      string
	HexColor  string
	Color     color.RGBA

	TimeDiffToFastest       time.Duration
	TimeDiffToPositionAhead time.Duration
	GapToLeader             time.Duration

	PreviousSegmentIndex   int
	Segment                [MaxSegments]SegmentType
	Sector1                time.Duration
	Sector1PersonalFastest bool
	Sector1OverallFastest  bool
	Sector2                time.Duration
	Sector2PersonalFastest bool
	Sector2OverallFastest  bool
	Sector3                time.Duration
	Sector3PersonalFastest bool
	Sector3OverallFastest  bool
	LastLap                time.Duration
	LastLapPersonalFastest bool
	LastLapOverallFastest  bool

	FastestLap        time.Duration
	OverallFastestLap bool

	KnockedOutOfQualifying bool
	ChequeredFlag          bool

	Tire       TireType
	LapsOnTire int
	Lap        int

	DRSOpen bool

	Pitstops     int
	PitStopTimes []PitStop

	Location CarLocation

	SpeedTrap                int
	SpeedTrapPersonalFastest bool
	SpeedTrapOverallFastest  bool
}

type TireType

type TireType int
const (
	Unknown TireType = iota
	Soft
	Medium
	Hard
	Intermediate
	Wet
	Test
	HYPERSOFT
	ULTRASOFT
	SUPERSOFT
)

func (TireType) String

func (t TireType) String() string

type TrackState

type TrackState int
const (
	Clear TrackState = iota
	VirtualSafetyCar
	VirtualSafetyCarEnding
	SafetyCar
	SafetyCarEnding
)

func (TrackState) String

func (t TrackState) String() string

type Weather

type Weather struct {
	Timestamp time.Time

	AirTemp       float64
	Humidity      float64
	AirPressure   float64
	Rainfall      bool
	TrackTemp     float64
	WindDirection float64
	WindSpeed     float64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL