types

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

package types contains types used by the TacView clients

Index

Constants

View Source
const GlobalObjectID = 0

Variables

This section is empty.

Functions

func ParseTimeFrame

func ParseTimeFrame(line string) (time.Duration, error)

Types

type Coordinates

type Coordinates struct {
	// Flag indicating the presence or absence of the related field
	ValidLon, ValidLat bool
	// Location is the object's lon/lat position
	Location orb.Point
	// Altitude above sea level
	Altitude *unit.Length
	// X is the object's native coordinate within the sim
	X *float64
	// Y is the object's native coordiante within the sim
	Y *float64
	// Roll angle
	Roll *unit.Angle
	// Pitch angle
	Pitch *unit.Angle
	// Yaw angle (this may be different from heading)
	Yaw *unit.Angle
	// Heading is the object's flat earth heading
	Heading *unit.Angle
}

func NewCoordinates added in v0.5.2

func NewCoordinates(
	point orb.Point,
	validLon, validLat bool,
	altitude *unit.Length,
	x, y *float64,
	roll, pitch, yaw, heading *unit.Angle,
) *Coordinates

func (*Coordinates) Parse added in v0.5.2

func (c *Coordinates) Parse(transform string, ref orb.Point) error

func (*Coordinates) Transform added in v0.5.2

func (c *Coordinates) Transform(ref orb.Point) string

func (*Coordinates) Update added in v0.5.2

func (c *Coordinates) Update(next *Coordinates)

type Object

type Object struct {
	ID uint64
	// contains filtered or unexported fields
}

func NewObject

func NewObject(id uint64) *Object

func (*Object) GetAngle

func (o *Object) GetAngle(property string) (unit.Angle, error)

func (*Object) GetCoordinates

func (o *Object) GetCoordinates(ref orb.Point) (*Coordinates, error)

GetCoordinates returns the coordinates of the object, if possible. Many objects have insufficient information to determine their coordinates. In such a case, the function returns nil and no error. ref is the reference point from the global properties.

func (*Object) GetLength

func (o *Object) GetLength(property string) (unit.Length, error)

func (*Object) GetProperty

func (o *Object) GetProperty(p string) (string, bool)

func (*Object) GetSpeed

func (o *Object) GetSpeed(property string) (unit.Speed, error)

func (*Object) GetTypes

func (o *Object) GetTypes() ([]string, error)

GetTypes returns all object type tags.

func (*Object) Properties

func (o *Object) Properties() map[string]string

func (*Object) SetProperty

func (o *Object) SetProperty(p, v string)

func (*Object) Update added in v0.5.2

func (o *Object) Update(update *ObjectUpdate, ref orb.Point) error

type ObjectUpdate

type ObjectUpdate struct {
	ID         uint64
	IsRemoval  bool
	Properties map[string]string
}

func ParseObjectUpdate

func ParseObjectUpdate(line string) (*ObjectUpdate, error)

Jump to

Keyboard shortcuts

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