Documentation
¶
Overview ¶
Package xctrack implements XCTrack's task format. See http://xctrack.org/ and http://xctrack.org/Competition_Interfaces.html.
Index ¶
- Constants
- type Direction
- type EarthModel
- type Goal
- type GoalType
- type QRCodeDirection
- type QRCodeEarthModel
- type QRCodeGoal
- type QRCodeGoalType
- type QRCodeSSS
- type QRCodeSSSType
- type QRCodeTask
- type QRCodeTaskType
- type QRCodeTurnpoint
- type QRCodeTurnpointType
- type QRCodeTurnpointZ
- type SSS
- type SSSType
- type Takeoff
- type Task
- type TaskType
- type TimeOfDay
- type Turnpoint
- type TurnpointType
- type Waypoint
Constants ¶
const ( QRCodeScheme = "XCTSK:" QRCodeTaskVersion = 2 )
Constants.
const ( Extension = ".xctsk" MIMEType = "application/xctsk" Version = 1 )
Constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EarthModel ¶
type EarthModel string
An EarthModel is an Earth model.
const ( EarthModelWGS84 EarthModel = "WGS84" EarthModelFAISphere EarthModel = "FAI_SPHERE" )
Earth models.
type Goal ¶
type Goal struct {
Type GoalType `json:"type,omitempty"`
Deadline *TimeOfDay `json:"deadline,omitempty"`
}
A Goal is a goal.
type QRCodeDirection ¶
type QRCodeDirection int
A QRCodeDirection is a QR code direction.
const ( QRCodeDirectionEnter QRCodeDirection = 1 QRCodeDirectionExit QRCodeDirection = 2 )
QR code directions.
type QRCodeEarthModel ¶
type QRCodeEarthModel int
A QRCodeEarthModel is a QR code Earth model.
const ( QRCodeEarthModelWGS84 QRCodeEarthModel = 0 QRCodeEarthModelFAISphere QRCodeEarthModel = 1 )
QR code Earth models.
type QRCodeGoal ¶
type QRCodeGoal struct {
Deadline *TimeOfDay `json:"d,omitempty"`
Type QRCodeGoalType `json:"t,omitempty"`
}
A QRCodeGoal is a QR code goal.
type QRCodeGoalType ¶
type QRCodeGoalType int
A QRCodeGoalType is a QR code goal type.
const ( QRCodeGoalTypeLine QRCodeGoalType = 1 QRCodeGoalTypeCylinder QRCodeGoalType = 2 )
QR code goal types.
type QRCodeSSS ¶
type QRCodeSSS struct {
TimeGates []*TimeOfDay `json:"g"`
Direction QRCodeDirection `json:"d"`
Type QRCodeSSSType `json:"t"`
}
A QRCodeSSS is a QR code start.
type QRCodeSSSType ¶
type QRCodeSSSType int
A QRCodeSSSType is a QR code start of speed section type.
const ( QRCodeSSSTypeRace QRCodeSSSType = 1 QRCodeSSSTypeElapsedTime QRCodeSSSType = 2 )
QR code start of speed section types.
type QRCodeTask ¶
type QRCodeTask struct {
TaskType TaskType `json:"taskType"`
Version int `json:"version"`
Turnpoints []*QRCodeTurnpoint `json:"t"`
TakeoffOpen *TimeOfDay `json:"to,omitempty"`
TakeoffClose *TimeOfDay `json:"tc,omitempty"`
SSS *QRCodeSSS `json:"s,omitempty"`
Goal *QRCodeGoal `json:"g,omitempty"`
EarthModel QRCodeEarthModel `json:"e"`
}
A QRCodeTask is a QR code task.
func (*QRCodeTask) String ¶
func (q *QRCodeTask) String() (string, error)
type QRCodeTaskType ¶
type QRCodeTaskType int
A QRCodeTaskType is a QR code task type.
const ( QRCodeTaskTypeRace QRCodeTaskType = 1 QRCodeTaskTypeElapsedTime QRCodeTaskType = 2 )
QR code task types.
type QRCodeTurnpoint ¶
type QRCodeTurnpoint struct {
Z QRCodeTurnpointZ `json:"z"`
Name string `json:"n"`
Description string `json:"d,omitempty"`
Type QRCodeTurnpointType `json:"t,omitempty"`
}
A QRCodeTurnpoint is a QR code turnpoint.
type QRCodeTurnpointType ¶
type QRCodeTurnpointType int
A QRCodeTurnpointType is a QR code turnpoint type.
const ( QRCodeTurnpointTypeNone QRCodeTurnpointType = 0 QRCodeTurnpointTypeSSS QRCodeTurnpointType = 2 QRCodeTurnpointTypeESS QRCodeTurnpointType = 3 )
QR code turnpoint types.
type QRCodeTurnpointZ ¶
A QRCodeTurnpointZ is a QR code turnpoint Z.
func (*QRCodeTurnpointZ) MarshalJSON ¶
func (z *QRCodeTurnpointZ) MarshalJSON() ([]byte, error)
MarshalJSON implements encoding/json.Marshaler.
func (*QRCodeTurnpointZ) UnmarshalJSON ¶
func (z *QRCodeTurnpointZ) UnmarshalJSON(value []byte) error
UnmarshalJSON implements encoding/json.Unmarshaler.
type SSS ¶
type SSS struct {
Type SSSType `json:"type"`
Direction Direction `json:"direction"`
TimeGates []*TimeOfDay `json:"timeGates"`
}
An SSS is a start of speed section.
type Takeoff ¶
type Takeoff struct {
TimeOpen *TimeOfDay `json:"timeOpen,omitempty"`
TimeClose *TimeOfDay `json:"timeClose,omitempty"`
}
A Takeoff is a takeoff.
type Task ¶
type Task struct {
TaskType TaskType `json:"taskType"`
Version int `json:"version"`
EarthModel EarthModel `json:"earthModel,omitempty"`
Turnpoints []*Turnpoint `json:"turnpoints"`
Takeoff *Takeoff `json:"takeoff,omitempty"`
SSS *SSS `json:"sss,omitempty"`
Goal *Goal `json:"goal,omitempty"`
}
A Task is an XC Track task, see http://xctrack.org/Competition_Interfaces.html.
func (*Task) QRCodeTask ¶
func (t *Task) QRCodeTask() *QRCodeTask
QRCodeTask returns t as a QRCodeTask.
type TimeOfDay ¶ added in v1.1.0
A TimeOfDay is a time of day.
func (*TimeOfDay) MarshalJSON ¶ added in v1.1.0
MarshalJSON implements encoding/json.Marshaler.
func (*TimeOfDay) UnmarshalJSON ¶ added in v1.1.0
UnmarshalJSON implements encoding/json.Unmarshaler.
type Turnpoint ¶
type Turnpoint struct {
Type TurnpointType `json:"type,omitempty"`
Radius int `json:"radius"`
Waypoint Waypoint `json:"waypoint"`
}
A Turnpoint is a turnpoint.
type TurnpointType ¶
type TurnpointType string
A TurnpointType is a turnpoint type.
const ( TurnpointTypeNone TurnpointType = "" TurnpointTypeTakeoff TurnpointType = "TAKEOFF" TurnpointTypeSSS TurnpointType = "SSS" TurnpointTypeESS TurnpointType = "ESS" )
Turnpoint types.