Documentation ¶
Overview ¶
package types contains types used by the TacView clients
Index ¶
- Constants
- func ParseTimeFrame(line string) (time.Duration, error)
- type ClientHandshake
- type Coordinates
- type HostHandshake
- type Object
- func (o *Object) GetAngle(property string) (unit.Angle, error)
- func (o *Object) GetCoordinates(ref orb.Point) (*Coordinates, error)
- func (o *Object) GetLength(property string) (unit.Length, error)
- func (o *Object) GetProperty(p string) (string, bool)
- func (o *Object) GetSpeed(property string) (unit.Speed, error)
- func (o *Object) GetTypes() ([]string, error)
- func (o *Object) Properties() map[string]string
- func (o *Object) SetProperty(p, v string)
- type ObjectUpdate
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 ¶
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 (*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) Properties ¶
func (*Object) SetProperty ¶
type ObjectUpdate ¶
func ParseObjectUpdate ¶
func ParseObjectUpdate(line string) (*ObjectUpdate, error)
Click to show internal directories.
Click to hide internal directories.