types

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package types contains types used by the TacView clients

Index

Constants

View Source
const (
	LowLevelProtocol        = "XtraLib.Stream"
	LowLevelProtocolVersion = "0"
)
View Source
const (
	HighLevelProtocol        = "Tacview.RealTimeTelemetry"
	HighLevelProtocolVersion = "0"
)
View Source
const GlobalObjectID = 0

Variables

This section is empty.

Functions

func ParseTimeFrame

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

Types

type ClientHandshake

type ClientHandshake struct {
	LowLevelProtocolVersion  string
	HighLevelProtocolVersion string
	Hostname                 string
	PasswordHash             string
}

func DecodeClientHandshake

func DecodeClientHandshake(packet string) (*ClientHandshake, error)

func NewClientHandshake

func NewClientHandshake(hostname string, password string) (handshake *ClientHandshake)

func (*ClientHandshake) Encode

func (h *ClientHandshake) Encode() (packet string)

type Coordinates

type Coordinates struct {
	Location orb.Point
	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  unit.Angle
	Pitch unit.Angle
	Yaw   unit.Angle
	// Heading is the object's flat earth heading
	Heading unit.Angle
}

type HostHandshake

type HostHandshake struct {
	LowLevelProtocolVersion  string
	HighLevelProtocolVersion string
	Hostname                 string
}

func DecodeHostHandshake

func DecodeHostHandshake(packet string) (HostHandshake, error)

func (*HostHandshake) Encode

func (h *HostHandshake) Encode() (packet string)

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)

type ObjectUpdate

type ObjectUpdate struct {
	ID         uint64
	IsGlobal   bool
	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