trackfiles

package
v0.0.0-...-03c8f45 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package trackfiles records aircraft movement over time.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	// Time within the simulation when the event occurred.
	// This is not a wall-clock time. It may be decades in the past or years in the future, relative to the system clock.
	Time time.Time
	// Point is the contact's 2D position.
	Point orb.Point
	// Altitude above sea level.
	Altitude unit.Length
	// Altitude above ground level, if available.
	AGL *unit.Length
	// Heading is the direction the contact is moving. This is not necessarily the direction the nose is poining.
	Heading unit.Angle
}

Frame describes a contact's position and velocity at a point in time.

type Labels

type Labels struct {
	// ID is the object ID from TacView.
	ID uint64
	// Name is a unique string for each aircraft.
	// If this is a player's aircraft, it will be the player's in-game name.
	Name string
	// Coalition the aircraft belongs to.
	Coalition coalitions.Coalition
	// The name of the aircraft type in the ACMI file.
	// See https://www.tacview.net/documentation/database/en/
	ACMIName string
}

Labels are identifying information attached to a trackfile.

type Trackfile

type Trackfile struct {
	// Contact contains identifying information.
	Contact Labels
	// contains filtered or unexported fields
}

Trackfile tracks a contact's movement over time.

func NewTrackfile

func NewTrackfile(labels Labels) *Trackfile

func (*Trackfile) Bullseye

func (t *Trackfile) Bullseye(bullseye orb.Point) brevity.Bullseye

Bullseye returns the bearing and distance from the bullseye to the track's last known position.

func (*Trackfile) Course

func (t *Trackfile) Course() bearings.Bearing

Course returns the angle that the track is moving in. If the track has not moved very far, the course may be unreliable. You can check for this condition by checking if Trackfile.Direction returns brevity.UnknownDirection.

func (*Trackfile) Direction

func (t *Trackfile) Direction() brevity.Track

Direction returns the cardinal direction that the track is moving in, or brevity.UnknownDirection if the track is not moving faster than 1 m/s.

func (*Trackfile) IsLastKnownPointZero

func (t *Trackfile) IsLastKnownPointZero() bool

func (*Trackfile) LastKnown

func (t *Trackfile) LastKnown() Frame

LastKnown returns the most recent frame in the trackfile. If the trackfile is empty, a stub frame with a zero-value time is returned.

func (*Trackfile) Speed

func (t *Trackfile) Speed() unit.Speed

Speed returns either the ground speed or the true 3D speed of the track, whichever is greater.

func (*Trackfile) String

func (t *Trackfile) String() string

func (*Trackfile) Update

func (t *Trackfile) Update(f Frame)

Update the trackfile with a new frame. Frames older than the most recent one are discarded.

Jump to

Keyboard shortcuts

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