model

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: MIT Imports: 1 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalysisCarComputeState added in v0.9.0

type AnalysisCarComputeState struct {
	CarNum string `json:"carNum"`
	State  string `json:"state"`
	// sessionTime when state switched from PIT/RUN to OUT
	OutEncountered float64 `json:"outEncountered"`
}

type AnalysisCarInfo

type AnalysisCarInfo struct {
	Name     string               `json:"name"`
	CarNum   string               `json:"carNum"`
	CarClass string               `json:"carClass"`
	Drivers  []AnalysisDriverInfo `json:"drivers"`
}

type AnalysisCarLaps added in v0.9.0

type AnalysisCarLaps struct {
	CarNum string            `json:"carNum"`
	Laps   []AnalysisLapInfo `json:"laps"`
}

type AnalysisCarPits added in v0.9.0

type AnalysisCarPits struct {
	CarNum  string            `json:"carNum"`
	Current AnalysisPitInfo   `json:"current"`
	History []AnalysisPitInfo `json:"history"`
}

type AnalysisCarStints added in v0.9.0

type AnalysisCarStints struct {
	CarNum  string              `json:"carNum"`
	Current AnalysisStintInfo   `json:"current"`
	History []AnalysisStintInfo `json:"history"`
}

type AnalysisData

type AnalysisData struct {
	CarInfo         []AnalysisCarInfo         `json:"carInfo"`
	CarLaps         []AnalysisCarLaps         `json:"carLaps"`
	CarPits         []AnalysisCarPits         `json:"carPits"`
	CarStints       []AnalysisCarStints       `json:"carStints"`
	CarComputeState []AnalysisCarComputeState `json:"carComputeState"`
	RaceGraph       []AnalysisRaceGraph       `json:"raceGraph"`
	Cars            AnalysisMessage           `json:"cars"`     // latest StateData.Cars
	Session         AnalysisMessage           `json:"session"`  // latest StateData.Session
	InfoMsgs        []AnalysisMessage         `json:"infoMsgs"` // all info messages
	// carNum ordered by race position
	RaceOrder []string `json:"raceOrder"`
}

type AnalysisDataGeneric added in v0.9.0

type AnalysisDataGeneric map[string]interface{}

used for json marshaling to be compatible with frontend

type AnalysisDriverInfo added in v0.9.0

type AnalysisDriverInfo struct {
	DriverName string             `json:"driverName"`
	SeatTime   []AnalysisSeatTime `json:"seatTime"`
}

type AnalysisGapInfo added in v0.9.0

type AnalysisGapInfo struct {
	CarNum string  `json:"carNum"`
	LapNo  int     `json:"lapNo"`
	Gap    float64 `json:"gap"`
	Pos    int     `json:"pos"`
	Pic    int     `json:"pic"`
}

type AnalysisLapInfo added in v0.9.0

type AnalysisLapInfo struct {
	LapNo   int     `json:"lapNo"`
	LapTime float64 `json:"lapTime"`
}

type AnalysisMessage added in v0.9.0

type AnalysisMessage struct {
	Type      MessageType `json:"type"`
	Data      any         `json:"data"`
	Timestamp float64     `json:"timestamp"`
}

type AnalysisPitInfo added in v0.9.0

type AnalysisPitInfo struct {
	EnterTime        float64 `json:"enterTime"` // unit: sessionTime
	ExitTime         float64 `json:"exitTime"`  // unit: sessionTime
	CarNum           string  `json:"carNum"`
	LapEnter         int     `json:"lapEnter"`
	LapExit          int     `json:"lapExit"`
	LaneTime         float64 `json:"laneTime"`
	IsCurrentPitstop bool    `json:"isCurrentPitstop"`
}

type AnalysisRaceGraph added in v0.9.0

type AnalysisRaceGraph struct {
	LapNo    int               `json:"lapNo"`
	CarClass string            `json:"carClass"`
	Gaps     []AnalysisGapInfo `json:"gaps"`
}

type AnalysisSeatTime added in v0.9.0

type AnalysisSeatTime struct {
	EnterCarTime float64 `json:"enterCarTime"` // unit: sessionTime
	LeaveCarTime float64 `json:"leaveCarTime"` // unit: sessionTime
}

type AnalysisStintInfo added in v0.9.0

type AnalysisStintInfo struct {
	EnterTime      float64 `json:"enterTime"` // unit: sessionTime
	ExitTime       float64 `json:"exitTime"`  // unit: sessionTime
	CarNum         string  `json:"carNum"`
	LapEnter       int     `json:"lapEnter"`
	LapExit        int     `json:"lapExit"`
	StintTime      float64 `json:"stintTime"`
	NumLaps        int     `json:"numLaps"`
	IsCurrentStint bool    `json:"isCurrentStint"`
}

type AvgLapOverTime

type AvgLapOverTime struct {
	Timestamp   float64            `json:"timestamp"`
	SessionTime float64            `json:"sessionTime"`
	TimeOfDay   float64            `json:"timeOfDay"`
	TrackTemp   float64            `json:"trackTemp"`
	Laptimes    map[string]float64 `json:"laptimes"`
}

type Car

type Car struct {
	CarID        int    `json:"carId"`
	CarIdx       int    `json:"carIdx"`
	CarClassID   int    `json:"carClassId"`
	Name         string `json:"name"`
	CarNumber    string `json:"carNumber"`
	CarNumberRaw int    `json:"carNumberRaw"`
}

type CarClass

type CarClass struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type CarData

type CarData struct {
	Type      int        `json:"type"`
	Payload   CarPayload `json:"payload"`
	Timestamp float64    `json:"timestamp"`
}

type CarEntry

type CarEntry struct {
	Car     Car      `json:"car"`
	Team    Team     `json:"team"`
	Drivers []Driver `json:"drivers"`
}

type CarInfo

type CarInfo struct {
	Name          string  `json:"name"`
	NameShort     string  `json:"nameShort"`
	CarID         int     `json:"carId"`
	CarClassID    int     `json:"carClassId"`
	CarClassName  string  `json:"carClassName"`
	FuelPct       float64 `json:"fuelPct"`
	PowerAdjust   float64 `json:"powerAdjust"`
	WeightPenalty float64 `json:"weightPenalty"`
	DryTireSets   int     `json:"dryTireSets"`
}

type CarPayload

type CarPayload struct {
	Cars       []CarInfo  `json:"cars"`
	CarClasses []CarClass `json:"carClasses"`
	Entries    []CarEntry `json:"entries"`
	// map of carIdx to driver name (for current driver)
	// TODO: racelogger must be changed to send this data
	CurrentDrivers map[int]string `json:"currentDrivers"`
	SessionTime    float64        `json:"sessionTime"`
}

type ClassSpeedmapData

type ClassSpeedmapData struct {
	Laptime     float64   `json:"laptime"`
	ChunkSpeeds []float64 `json:"chunkSpeeds"`
}

type DbAnalysis

type DbAnalysis struct {
	ID      int                 `json:"id"`
	EventID int                 `json:"eventId"`
	Data    AnalysisDataGeneric `json:"data"`
}

type DbCar

type DbCar struct {
	ID      int     `json:"id"`
	EventID int     `json:"eventId"`
	Data    CarData `json:"data"`
}

type DbEvent

type DbEvent struct {
	ID          int       `json:"id"`
	Name        string    `json:"name"`
	Key         string    `json:"eventKey"`
	Description string    `json:"description"`
	RecordStamp time.Time `json:"recordDate"`
	Data        EventData `json:"data"`
}

type DbEventExtra

type DbEventExtra struct {
	ID      int       `json:"id"`
	EventID int       `json:"eventId"`
	Data    ExtraInfo `json:"data"`
}

type DbSpeedmap

type DbSpeedmap struct {
	ID      int          `json:"id"`
	EventID int          `json:"eventId"`
	Data    SpeedmapData `json:"data"`
}

type DbState

type DbState struct {
	ID      int       `json:"id"`
	EventID int       `json:"eventId"`
	Data    StateData `json:"data"`
}

describes state of the race according to event manifests

type DbTeamInEvent

type DbTeamInEvent struct {
	Name     string `json:"name"`
	CarNum   string `json:"carNum"`
	CarClass string `json:"carClass"`
	Drivers  []struct {
		DriverName string `json:"driverName"`
	}
}

type DbTrack

type DbTrack struct {
	ID   int       `json:"id"`
	Data TrackInfo `json:"data"`
}

type DeltaPayload

type DeltaPayload struct {
	Cars    [][3]interface{} `json:"cars"`
	Session [][2]interface{} `json:"session"`
}

type Driver

type Driver struct {
	ID          int    `json:"id"`
	CarIdx      int    `json:"carIdx"`
	Name        string `json:"name"`
	IRating     int    `json:"iRating"`
	Initials    string `json:"initials"`
	LicLevel    int    `json:"licLevel"`
	LicSubLevel int    `json:"licSubLevel"`
	LicString   string `json:"licString"`
	AbbrevName  string `json:"abbrevName"`
}

type EventData

type EventData struct {
	Info       EventDataInfo `json:"info"`
	Manifests  Manifests     `json:"manifests"`
	ReplayInfo ReplayInfo    `json:"replayInfo"`
}

type EventDataInfo

type EventDataInfo struct {
	TrackId               int            `json:"trackId"`
	TrackDisplayName      string         `json:"trackDisplayName"`
	TrackDisplayShortName string         `json:"trackDisplayShortName"`
	TrackConfigName       string         `json:"trackConfigName"`
	TrackLength           float64        `json:"trackLength"`
	TrackPitSpeed         float64        `json:"trackPitSpeed"`
	Name                  string         `json:"name"`
	Description           string         `json:"description"`
	EventTime             string         `json:"eventTime"`
	RaceloggerVersion     string         `json:"raceloggerVersion"`
	TeamRacing            int            `json:"teamRacing"` // 0: false
	MultiClass            bool           `json:"multiClass"`
	NumCarTypes           int            `json:"numCarTypes"`
	NumCarClasses         int            `json:"numCarClasses"`
	IrSessionId           int            `json:"irSessionId"`
	Sectors               []Sector       `json:"sectors"`
	Sessions              []EventSession `json:"sessions"`
}

type EventSession added in v0.8.1

type EventSession struct {
	Num  int    `json:"num"`
	Name string `json:"name"`
}

type ExtraInfo

type ExtraInfo struct {
	Track TrackInfo `json:"track"`
}

type Manifests

type Manifests struct {
	Car     []string `json:"car"`
	Pit     []string `json:"pit"`
	Message []string `json:"message"`
	Session []string `json:"session"`
}

type MessageType

type MessageType int
const (
	MTEmpty      MessageType = 0
	MTState      MessageType = 1
	MTStateDelta MessageType = 2
	MTSpeedmap   MessageType = 3
	MTCar        MessageType = 4
)

type PitInfo

type PitInfo struct {
	Exit       float64 `json:"exit"`
	Entry      float64 `json:"entry"`
	LaneLength float64 `json:"laneLength"`
}

type ReplayInfo

type ReplayInfo struct {
	MinTimestamp   float64 `json:"minTimestamp"`
	MinSessionTime float64 `json:"minSessionTime"`
	MaxSessionTime float64 `json:"maxSessionTime"`
}

type Sector

type Sector struct {
	SectorNum      int
	SectorStartPct float64
}

type SpeedmapData

type SpeedmapData struct {
	Type      int             `json:"type"`
	Payload   SpeedmapPayload `json:"payload"`
	Timestamp float64         `json:"timestamp"`
}

type SpeedmapPayload

type SpeedmapPayload struct {
	Data        map[string]*ClassSpeedmapData `json:"data"`
	ChunkSize   int                           `json:"chunkSize"`
	TimeOfDay   float64                       `json:"timeOfDay"`
	TrackTemp   float64                       `json:"trackTemp"`
	TrackLength float64                       `json:"trackLength"`
	SessionTime float64                       `json:"sessionTime"`
	CurrentPos  float64                       `json:"currentPos"`
}

type StateData

type StateData struct {
	Type      int          `json:"type"`
	Payload   StatePayload `json:"payload"`
	Timestamp float64      `json:"timestamp"`
}

contains the state message sent by the client via WAMP

type StateDelta

type StateDelta struct {
	Type      int          `json:"type"`
	Payload   DeltaPayload `json:"payload"`
	Timestamp float64      `json:"timestamp"`
}

type StatePayload

type StatePayload struct {
	Cars     [][]interface{} `json:"cars"`
	Session  []interface{}   `json:"session"`
	Messages [][]interface{} `json:"messages"`
}

these attributes contain generic data according to event manifests

type Team

type Team struct {
	ID     int    `json:"id"`
	CarIdx int    `json:"carIdx"`
	Name   string `json:"name"`
}

type TrackInfo

type TrackInfo struct {
	ID        int      `json:"trackId"`
	Name      string   `json:"trackDisplayName"`
	ShortName string   `json:"trackDisplayShortName"`
	Config    string   `json:"trackConfigName"`
	Length    float64  `json:"trackLength"`
	Pit       *PitInfo `json:"pit,omitempty"`
	Sectors   []Sector `json:"sectors"`
}

Jump to

Keyboard shortcuts

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