common

package
v0.0.0-...-1c86302 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2014 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package common provides common functionality and interfaces.

It includes methods to manage airfield, airspace and waypoint data, as well as other utility libraries.

Index

Constants

View Source
const (
	UnclearAirstrip = 1 << iota
	Outlanding      = 1 << iota
	ULMSite         = 1 << iota
	GliderSite      = 1 << iota
	ElevationProved = 1 << iota
	Asphalt         = 1 << iota
	Concrete        = 1 << iota
	Loam            = 1 << iota
	Sand            = 1 << iota
	Clay            = 1 << iota
	Grass           = 1 << iota
	Gravel          = 1 << iota
	Dirt            = 1 << iota
)

Enum for Airfield flags

Variables

This section is empty.

Functions

This section is empty.

Types

type Airfield

type Airfield struct {
	ID        string
	ShortName string
	Name      string
	Region    string
	ICAO      string
	Flags     int
	Catalog   int
	Length    int
	Elevation int
	Runway    string
	Frequency float64
	Latitude  string
	Longitude string
}

Airfield keeps details about a specific airfield

type Airfielder

type Airfielder interface {
	GetAirfield(regions []string, updatedSince time.Time) ([]Airfield, error)
	PutAirfield(airfields []Airfield) error
}

Airfielder is implemented by any data source which can provide or receive airfield information.

type Airspace

type Airspace struct {
	ID       string
	Date     time.Time
	Class    byte
	Name     string
	Ceiling  string
	Floor    string
	Label    []string
	Segments []AirspaceSegment
	Pen      Pen
}

Airspace keeps details about a specific airspace area

Date is of airspace definition or update.

Label is a list of Lat/Lon coordinates where the airspace label (usually the name) should be placed.

type AirspaceSegment

type AirspaceSegment struct {
	Type        AirspaceSegmentType
	Clockwise   bool
	X           string
	W           int
	Radius      float64
	AngleStart  float64
	AngleEnd    float64
	Coordinate1 string
	Coordinate2 string
}

AirspaceSegment is one of polygon, arc, circle.

Clockwise indicates direction for building arcs.

X is the center for arcs and circles, W is the width for airways (unused).

Data interpretation depends on record type:

Polygon: coordinate point (to be added)
Arc: radius, start, end || coordinate1, coordinate2 (center in X)
Circle: radius (from X)

type AirspaceSegmentType

type AirspaceSegmentType int

AirspaceSegmentType is an int for an AirspaceSegment.

const (
	Polygon AirspaceSegmentType = iota
	Arc
	Circle
)

Constants for airspace record types

type Airspacer

type Airspacer interface {
	GetAirspace(regions []string, updatedSince time.Time) ([]Airspace, error)
	PutAirspace(airspaces []Airspace) error
}

Airspacer is implemented by any data source which can manage airspace information. Only one of Get() or Put() or both can be implemented by the source. FIXME: add boundbox filter to Get

type Pen

type Pen struct {
	Style       PenStyle
	Width       int
	Color       color.Color
	InsideColor color.Color
}

Pen has drawing info for an Airspace.

type PenStyle

type PenStyle int

PenStyle is one of Solid, Dash, None.

const (
	// Solid PenStyle.
	Solid PenStyle = iota
	// Dash (ed) PenStyle.
	Dash
	// None is no PenStyle
	None
)

type Waypoint

type Waypoint struct {
	ID          string
	Name        string
	Description string
	Region      string
	Flags       int
	Elevation   int
	Latitude    string
	Longitude   string
}

Waypoint keeps details about a specific waypoint

type Waypointer

type Waypointer interface {
	GetWaypoint(regions []string, updatedSince time.Time) ([]Waypoint, error)
	PutWaypoint(waypoints []Waypoint) error
}

Waypointer is implemented in any data source which can provide or receive waypoint information.

Jump to

Keyboard shortcuts

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