Documentation
¶
Index ¶
- Constants
- Variables
- func CWTApproachSeparation(front, back string) float32
- func CWTDirectlyBehindSeparation(front, back string) float32
- func CheckApproaches(e *util.ErrorLogger, wps []WaypointArray, requireFAF bool, ...)
- func CheckVideoMapManifest(filename string, e *util.ErrorLogger)
- func DensityRatioAtAltitude(alt float32) float32
- func FixReadback(fix string) string
- func FormatAltitude(falt float32) string
- func IASToTAS(ias, altitude float32) float32
- func InAirspace(p math.Point2LL, alt float32, volumes []ControllerAirspaceVolume) (bool, [][2]int)
- func ParseARINC424(r io.Reader) (map[string]FAAAirport, map[string]Navaid, map[string]Fix, map[string][]Airway)
- func PlausibleFinalAltitude(fp *FlightPlan, perf AircraftPerformance, nmPerLongitude float32, ...) (altitude int)
- func PrintCIFPRoutes(airport string) error
- func PrintVideoMaps(path string, e *util.ErrorLogger)
- func SquawkIsSPC(squawk Squawk) (ok bool, code string)
- func StringIsSPC(code string) bool
- func TASToIAS(tas, altitude float32) float32
- func TidyRunway(r string) string
- func TurnAngle(from, to float32, turn TurnMethod) float32
- type ARTCC
- type ATIS
- type ATPAVolume
- type AdaptationFix
- type AdaptationFixes
- type Aircraft
- func (ac *Aircraft) ATPAVolume() *ATPAVolume
- func (ac *Aircraft) AircraftPerformance() AircraftPerformance
- func (ac *Aircraft) Altitude() float32
- func (ac *Aircraft) ArrivalAirportElevation() float32
- func (ac *Aircraft) ArrivalAirportLocation() math.Point2LL
- func (ac *Aircraft) AssignAltitude(altitude int, afterSpeed bool) []RadioTransmission
- func (ac *Aircraft) AssignHeading(heading int, turn TurnMethod) []RadioTransmission
- func (ac *Aircraft) AssignSpeed(speed int, afterAltitude bool) []RadioTransmission
- func (ac *Aircraft) AssignedApproach() string
- func (ac *Aircraft) AtFixCleared(fix, approach string) []RadioTransmission
- func (ac *Aircraft) CWT() string
- func (ac *Aircraft) CancelApproachClearance() []RadioTransmission
- func (ac *Aircraft) Check(lg *log.Logger)
- func (ac *Aircraft) ClearedApproach(id string, lg *log.Logger) []RadioTransmission
- func (ac *Aircraft) ClearedStraightInApproach(id string) []RadioTransmission
- func (ac *Aircraft) ClimbViaSID() []RadioTransmission
- func (ac *Aircraft) ContactMessage(reportingPoints []ReportingPoint) string
- func (ac *Aircraft) ContactTower(lg *log.Logger) []RadioTransmission
- func (ac *Aircraft) CrossFixAt(fix string, ar *AltitudeRestriction, speed int) []RadioTransmission
- func (ac *Aircraft) DepartFixDirect(fixa, fixb string) []RadioTransmission
- func (ac *Aircraft) DepartFixHeading(fix string, hdg int) []RadioTransmission
- func (ac *Aircraft) DepartOnCourse(lg *log.Logger)
- func (ac *Aircraft) DepartureAirportElevation() float32
- func (ac *Aircraft) DepartureAirportLocation() math.Point2LL
- func (ac *Aircraft) DescendViaSTAR() []RadioTransmission
- func (ac *Aircraft) DirectFix(fix string) []RadioTransmission
- func (ac *Aircraft) DistanceAlongRoute(fix string) (float32, error)
- func (ac *Aircraft) DistanceToEndOfApproach() (float32, error)
- func (ac *Aircraft) ExpectApproach(id string, ap *Airport, lg *log.Logger) []RadioTransmission
- func (ac *Aircraft) ExpediteClimb() []RadioTransmission
- func (ac *Aircraft) ExpediteDescent() []RadioTransmission
- func (ac *Aircraft) FlyPresentHeading() []RadioTransmission
- func (ac *Aircraft) GS() float32
- func (ac *Aircraft) GoAround() []RadioTransmission
- func (ac *Aircraft) HandingOffTo(tcp string) bool
- func (ac *Aircraft) HandleControllerDisconnect(callsign string, primaryController string)
- func (ac *Aircraft) Heading() float32
- func (ac *Aircraft) IAS() float32
- func (ac *Aircraft) InitializeArrival(ap *Airport, arr *Arrival, arrivalHandoffController string, goAround bool, ...) error
- func (ac *Aircraft) InitializeDeparture(ap *Airport, departureAirport string, dep *Departure, runway string, ...) error
- func (ac *Aircraft) InitializeOverflight(of *Overflight, controller string, nmPerLongitude float32, ...) error
- func (ac *Aircraft) InitializeVFRDeparture(ap *Airport, wps WaypointArray, alt int, randomizeAltitudeRange bool, ...) error
- func (ac *Aircraft) InterceptApproach() []RadioTransmission
- func (ac *Aircraft) IsAirborne() bool
- func (ac *Aircraft) MVAsApply() bool
- func (ac *Aircraft) MagneticVariation() float32
- func (ac *Aircraft) MaintainMaximumForward() []RadioTransmission
- func (ac *Aircraft) MaintainSlowestPractical() []RadioTransmission
- func (ac *Aircraft) NavSummary(lg *log.Logger) string
- func (ac *Aircraft) NewFlightPlan(r FlightRules, acType, dep, arr string) *FlightPlan
- func (ac *Aircraft) NmPerLongitude() float32
- func (ac *Aircraft) OnApproach(checkAltitude bool) bool
- func (ac *Aircraft) OnExtendedCenterline(maxNmDeviation float32) bool
- func (ac *Aircraft) Position() math.Point2LL
- func (ac *Aircraft) RouteIncludesFix(fix string) bool
- func (ac *Aircraft) SayAltitude() []RadioTransmission
- func (ac *Aircraft) SayHeading() []RadioTransmission
- func (ac *Aircraft) SaySpeed() []RadioTransmission
- func (ac *Aircraft) TAS() float32
- func (ac *Aircraft) ToggleSPCOverride(spc string)
- func (ac *Aircraft) TransferTracks(from, to string)
- func (ac *Aircraft) TurnLeft(deg int) []RadioTransmission
- func (ac *Aircraft) TurnRight(deg int) []RadioTransmission
- func (ac *Aircraft) Update(wind WindModel, lg *log.Logger) *Waypoint
- func (ac *Aircraft) Waypoints() []Waypoint
- type AircraftPerformance
- type Airline
- type AirlineSpecifier
- type Airport
- type Airspace
- type AirspaceAwareness
- type AirspaceGrid
- type AirspaceVolume
- type AirspaceVolumeType
- type Airway
- type AirwayDirection
- type AirwayFix
- type AirwayLevel
- type AltitudeRestriction
- type Approach
- type ApproachRegion
- func (ar *ApproachRegion) FarPoint(nmPerLongitude, magneticVariation float32) [2]float32
- func (ar *ApproachRegion) GetLateralGeometry(nmPerLongitude, magneticVariation float32) (line [2]math.Point2LL, quad [4]math.Point2LL)
- func (ar *ApproachRegion) Inside(p math.Point2LL, alt float32, nmPerLongitude, magneticVariation float32) (lateral, vertical bool)
- func (ar *ApproachRegion) NearPoint(nmPerLongitude, magneticVariation float32) [2]float32
- func (ar *ApproachRegion) TryMakeGhost(callsign string, track RadarTrack, heading float32, scratchpad string, ...) *GhostAircraft
- type ApproachType
- type Arrival
- type ArrivalAirline
- type Controller
- type ControllerAirspaceVolume
- type ConvergingRunways
- type CoordinationList
- type CoordinationTime
- type DMEArc
- type DeferredHeading
- type Departure
- type DepartureAirline
- type ERAMAdaptation
- type ExitRoute
- type FAAAirport
- type Fix
- type FleetAircraft
- type FlightPlan
- type FlightRules
- type FlightState
- type FlightStrip
- type FlyRacetrackPT
- type FlyStandard45PT
- type Frequency
- type GhostAircraft
- type InboundFlow
- type InterceptState
- type Locator
- type METAR
- type MVA
- type MVAExterior
- type MVAHorizontalProjection
- type MVAInterior
- type MVALinearRing
- type MVAPatches
- type MVAPolygonPatch
- type MVASurface
- type MagneticGrid
- type MultiUserController
- type Nav
- func (nav *Nav) ApproachHeading(wind WindModel, lg *log.Logger) (heading float32, turn TurnMethod, rate float32)
- func (nav *Nav) AssignAltitude(alt float32, afterSpeed bool) PilotResponse
- func (nav *Nav) AssignHeading(hdg float32, turn TurnMethod) PilotResponse
- func (nav *Nav) AssignSpeed(speed float32, afterAltitude bool) PilotResponse
- func (nav *Nav) AssignedHeading() (float32, bool)
- func (nav *Nav) AtFixCleared(fix, id string) PilotResponse
- func (nav *Nav) CancelApproachClearance() PilotResponse
- func (nav *Nav) Check(lg *log.Logger)
- func (nav *Nav) ClimbViaSID() PilotResponse
- func (nav *Nav) ContactMessage(reportingPoints []ReportingPoint, star string) string
- func (nav *Nav) CrossFixAt(fix string, ar *AltitudeRestriction, speed int) PilotResponse
- func (nav *Nav) DepartFixDirect(fixa string, fixb string) PilotResponse
- func (nav *Nav) DepartFixHeading(fix string, hdg float32) PilotResponse
- func (nav *Nav) DepartOnCourse(alt float32, exit string)
- func (nav *Nav) DepartureMessage() string
- func (nav *Nav) DescendViaSTAR() PilotResponse
- func (nav *Nav) DirectFix(fix string) PilotResponse
- func (nav *Nav) DistanceAlongRoute(fix string) (float32, error)
- func (nav *Nav) EnqueueHeading(h NavHeading)
- func (nav *Nav) ExpectApproach(airport *Airport, id string, runwayWaypoints map[string]WaypointArray, ...) PilotResponse
- func (nav *Nav) ExpediteClimb() PilotResponse
- func (nav *Nav) ExpediteDescent() PilotResponse
- func (nav *Nav) FlyPresentHeading() PilotResponse
- func (nav *Nav) GoAround() PilotResponse
- func (nav *Nav) InterceptApproach(airport string) PilotResponse
- func (nav *Nav) InterceptedButNotCleared() bool
- func (nav *Nav) IsAirborne() bool
- func (nav *Nav) MaintainMaximumForward() PilotResponse
- func (nav *Nav) MaintainSlowestPractical() PilotResponse
- func (nav *Nav) OnApproach(checkAltitude bool) bool
- func (nav *Nav) OnExtendedCenterline(maxNmDeviation float32) bool
- func (nav *Nav) SayAltitude() PilotResponse
- func (nav *Nav) SayHeading() PilotResponse
- func (nav *Nav) SaySpeed() PilotResponse
- func (nav *Nav) Summary(fp FlightPlan, lg *log.Logger) string
- func (nav *Nav) TAS() float32
- func (nav *Nav) TargetAltitude(lg *log.Logger) (float32, float32)
- func (nav *Nav) TargetHeading(wind WindModel, lg *log.Logger) (heading float32, turn TurnMethod, rate float32)
- func (nav *Nav) TargetSpeed(targetAltitude float32, lg *log.Logger) (float32, float32)
- func (nav *Nav) Update(wind WindModel, fp *FlightPlan, lg *log.Logger) *Waypoint
- type NavAirwork
- type NavAltitude
- type NavApproach
- type NavFixAssignment
- type NavHeading
- type NavSpeed
- type Navaid
- type Overflight
- type OverflightAirline
- type PTType
- type PilotResponse
- type ProcedureTurn
- type RacetrackPTEntry
- type RadarSite
- type RadarTrack
- type RadioTransmission
- type RadioTransmissionType
- type RedirectedHandoff
- type ReportingPoint
- type RestrictionArea
- type RouteGenerator
- type Runway
- type SPC
- type STAR
- type STARSControllerConfig
- type STARSFacilityAdaptation
- type STARSFlightPlan
- type SignificantPoint
- type SplitConfiguration
- type SplitConfigurationSet
- type Squawk
- type SquawkCodePool
- type StaticDatabase
- type TFR
- type TFRCache
- type TRACON
- type TransponderMode
- type TurnMethod
- type VFRRandomsSpec
- type VFRRouteSpec
- type VideoMap
- type VideoMapLibrary
- type VideoMapManifest
- type Waypoint
- type WaypointArray
- func (w WaypointArray) CheckArrival(e *util.ErrorLogger, ctrl map[string]*Controller, approachAssigned bool)
- func (w WaypointArray) CheckDeparture(e *util.ErrorLogger, controllers map[string]*Controller)
- func (w WaypointArray) CheckOverflight(e *util.ErrorLogger, ctrl map[string]*Controller)
- func (wslice WaypointArray) Encode() string
- func (waypoints WaypointArray) InitializeLocations(loc Locator, nmPerLongitude float32, magneticVariation float32, allowSlop bool, ...) WaypointArray
- func (w WaypointArray) RouteString() string
- func (w *WaypointArray) UnmarshalJSON(b []byte) error
- type WaypointCrossingConstraint
- type Wind
- type WindModel
- type XNOTAMUpdate
Constants ¶
const ( AirspaceVolumePolygon = iota AirspaceVolumeCircle )
const ( RadioTransmissionContact = iota // Messages initiated by the pilot RadioTransmissionReadback // Reading back an instruction RadioTransmissionUnexpected // Something urgent or unusual )
const ( RouteBasedFix = "route" ZoneBasedFix = "zone" )
const ( PTStateApproaching = iota PTStateTurningOutbound PTStateFlyingOutbound PTStateTurningInbound PTStateFlyingInbound // parallel entry only )
const ( PT45StateApproaching = iota PT45StateTurningOutbound PT45StateFlyingOutbound PT45StateTurningAway PT45StateFlyingAway PT45StateTurningIn PT45StateFlyingIn PT45StateTurningToIntercept )
const ( PTUndefined = iota PTRacetrack PTStandard45 )
const ( DirectEntryShortTurn = iota DirectEntryLongTurn ParallelEntry TeardropEntry )
const ( AirwayLevelAll = iota AirwayLevelLow AirwayLevelHigh )
const ( AirwayDirectionAny = iota AirwayDirectionForward AirwayDirectionBackward )
const ( // Flight plan received from a NAS ARTCC. This is a flight plan that // has been sent over by an overlying ERAM facility. RemoteEnroute = iota // Flight plan received from an adjacent terminal facility This is a // flight plan that has been sent over by another STARS facility. RemoteNonEnroute // VFR interfacility flight plan entered locally for which the NAS // ARTCC has not returned a flight plan This is a flight plan that is // made by a STARS facility that gets a NAS code. LocalEnroute // Flight plan entered by TCW or flight plan from an adjacent terminal // that has been handed off to this STARS facility This is a flight // plan that is made at a STARS facility and gets a local code. LocalNonEnroute )
Flight plan types (STARS)
const ARINC424LineLength = 134 // 132 chars + \r + \n
const MaxIAS = 290
const MaxRestrictionAreas = 100
This many adapted and then this many user-defined
const MaximumRate = 100000
const StandardTurnRate = 3
Variables ¶
var ( ErrClearedForUnexpectedApproach = errors.New("Cleared for unexpected approach") ErrFixNotInRoute = errors.New("Fix not in aircraft's route") ErrInvalidAltitude = errors.New("Altitude above aircraft's ceiling") ErrInvalidApproach = errors.New("Invalid approach") ErrInvalidController = errors.New("Invalid controller") ErrInvalidFacility = errors.New("Invalid facility") ErrInvalidHeading = errors.New("Invalid heading") ErrInvalidSquawkCode = errors.New("Invalid squawk code") ErrNoAircraftForCallsign = errors.New("No aircraft exists with specified callsign") ErrNoController = errors.New("No controller with that callsign") ErrNoCoordinationFix = errors.New("No coordination fix found") ErrNoERAMFacility = errors.New("No ERAM facility exists") ErrNoFlightPlan = errors.New("No flight plan has been filed for aircraft") ErrNoMatchingFix = errors.New("No matching fix") ErrNoMoreAvailableSquawkCodes = errors.New("No more available squawk codes") ErrNoSTARSFacility = errors.New("No STARS Facility in ERAM computer") ErrNoValidArrivalFound = errors.New("Unable to find a valid arrival") ErrNoValidDepartureFound = errors.New("Unable to find a valid departure") ErrNotBeingHandedOffToMe = errors.New("Aircraft not being handed off to current controller") ErrNotClearedForApproach = errors.New("Aircraft has not been cleared for an approach") ErrNotFlyingRoute = errors.New("Aircraft is not currently flying its assigned route") ErrNotPointedOutByMe = errors.New("Aircraft not being pointed out by current controller") ErrNotPointedOutToMe = errors.New("Aircraft not being pointed out to current controller") ErrOtherControllerHasTrack = errors.New("Another controller is already tracking the aircraft") ErrSquawkCodeAlreadyAssigned = errors.New("Squawk code has already been assigned") ErrSquawkCodeNotManagedByPool = errors.New("Squawk code is not managed by this pool") ErrSquawkCodeUnassigned = errors.New("Squawk code has not been assigned") ErrUnableCommand = errors.New("Unable") ErrUnknownAircraftType = errors.New("Unknown aircraft type") ErrUnknownAirport = errors.New("Unknown airport") ErrUnknownApproach = errors.New("Unknown approach") ErrUnknownRunway = errors.New("Unknown runway") )
Functions ¶
func CWTApproachSeparation ¶ added in v0.11.5
CWTApproachSeparation returns the required separation between aircraft of the two given CWT categories. If 0 is returned, minimum radar separation should be used.
func CWTDirectlyBehindSeparation ¶ added in v0.11.5
CWTDirectlyBehindSeparation returns the required separation between aircraft of the two given CWT categories. If 0 is returned, minimum radar separation should be used.
func CheckApproaches ¶ added in v0.11.8
func CheckApproaches(e *util.ErrorLogger, wps []WaypointArray, requireFAF bool, controllers map[string]*Controller)
func CheckVideoMapManifest ¶ added in v0.11.6
func CheckVideoMapManifest(filename string, e *util.ErrorLogger)
func DensityRatioAtAltitude ¶
returns the ratio of air density at the given altitude (in feet) to the air density at sea level, subject to assuming the standard atmosphere.
func FixReadback ¶
func FormatAltitude ¶
func InAirspace ¶ added in v0.11.9
func ParseARINC424 ¶
func PlausibleFinalAltitude ¶
func PlausibleFinalAltitude(fp *FlightPlan, perf AircraftPerformance, nmPerLongitude float32, magneticVariation float32) (altitude int)
func PrintCIFPRoutes ¶
func PrintVideoMaps ¶
func PrintVideoMaps(path string, e *util.ErrorLogger)
func SquawkIsSPC ¶
func StringIsSPC ¶
func TidyRunway ¶ added in v0.11.9
func TurnAngle ¶
func TurnAngle(from, to float32, turn TurnMethod) float32
Types ¶
type ATPAVolume ¶
type ATPAVolume struct { Id string `json:"id"` ThresholdString string `json:"runway_threshold"` Threshold math.Point2LL Heading float32 `json:"heading"` MaxHeadingDeviation float32 `json:"max_heading_deviation"` Floor float32 `json:"floor"` Ceiling float32 `json:"ceiling"` Length float32 `json:"length"` LeftWidth float32 `json:"left_width"` RightWidth float32 `json:"right_width"` FilteredScratchpads []string `json:"filtered_scratchpads"` ExcludedScratchpads []string `json:"excluded_scratchpads"` Enable25nmApproach bool `json:"enable_2.5nm"` Dist25nmApproach float32 `json:"2.5nm_distance"` }
type AdaptationFix ¶
type AdaptationFixes ¶
type AdaptationFixes []AdaptationFix
func (AdaptationFixes) Fix ¶
func (fixes AdaptationFixes) Fix(altitude string) (AdaptationFix, error)
type Aircraft ¶
type Aircraft struct { // This is ADS-B callsign of the aircraft. Just because different the // callsign in the flight plan can be different across multiple STARS // facilities, so two different facilities can show different // callsigns; however, the ADS-B callsign is transmitted from the // aircraft and would be the same to all facilities. Callsign string Scratchpad string SecondaryScratchpad string Squawk Squawk // actually squawking Mode TransponderMode TempAltitude int FlightPlan *FlightPlan PointOutHistory []string // STARS-related state that is globally visible TrackingController string // Who has the radar track ControllingController string // Who has control; not necessarily the same as TrackingController HandoffTrackController string // Handoff offered but not yet accepted GlobalLeaderLineDirection *math.CardinalOrdinalDirection RedirectedHandoff RedirectedHandoff SPCOverride string PilotReportedAltitude int InhibitModeCAltitudeDisplay bool HoldForRelease bool Released bool // only used for hold for release ReleaseTime time.Time WaitingForLaunch bool // for departures // The controller who gave approach clearance ApproachController string Strip FlightStrip // nil -> unset/unspecified. Nav Nav // Departure related state DepartureContactAltitude float32 DepartureContactController string // Arrival-related state GoAroundDistance *float32 STAR string STARRunwayWaypoints map[string]WaypointArray GotContactTower bool // Who to try to hand off to at a waypoint with /ho WaypointHandoffController string }
func (*Aircraft) ATPAVolume ¶
func (ac *Aircraft) ATPAVolume() *ATPAVolume
func (*Aircraft) AircraftPerformance ¶
func (ac *Aircraft) AircraftPerformance() AircraftPerformance
func (*Aircraft) ArrivalAirportElevation ¶
func (*Aircraft) ArrivalAirportLocation ¶ added in v0.11.2
func (*Aircraft) AssignAltitude ¶
func (ac *Aircraft) AssignAltitude(altitude int, afterSpeed bool) []RadioTransmission
func (*Aircraft) AssignHeading ¶
func (ac *Aircraft) AssignHeading(heading int, turn TurnMethod) []RadioTransmission
func (*Aircraft) AssignSpeed ¶
func (ac *Aircraft) AssignSpeed(speed int, afterAltitude bool) []RadioTransmission
func (*Aircraft) AssignedApproach ¶ added in v0.11.7
func (*Aircraft) AtFixCleared ¶
func (ac *Aircraft) AtFixCleared(fix, approach string) []RadioTransmission
func (*Aircraft) CancelApproachClearance ¶
func (ac *Aircraft) CancelApproachClearance() []RadioTransmission
func (*Aircraft) ClearedApproach ¶
func (ac *Aircraft) ClearedApproach(id string, lg *log.Logger) []RadioTransmission
func (*Aircraft) ClearedStraightInApproach ¶
func (ac *Aircraft) ClearedStraightInApproach(id string) []RadioTransmission
func (*Aircraft) ClimbViaSID ¶
func (ac *Aircraft) ClimbViaSID() []RadioTransmission
func (*Aircraft) ContactMessage ¶
func (ac *Aircraft) ContactMessage(reportingPoints []ReportingPoint) string
func (*Aircraft) ContactTower ¶
func (ac *Aircraft) ContactTower(lg *log.Logger) []RadioTransmission
func (*Aircraft) CrossFixAt ¶
func (ac *Aircraft) CrossFixAt(fix string, ar *AltitudeRestriction, speed int) []RadioTransmission
func (*Aircraft) DepartFixDirect ¶
func (ac *Aircraft) DepartFixDirect(fixa, fixb string) []RadioTransmission
func (*Aircraft) DepartFixHeading ¶
func (ac *Aircraft) DepartFixHeading(fix string, hdg int) []RadioTransmission
func (*Aircraft) DepartOnCourse ¶
func (*Aircraft) DepartureAirportElevation ¶
func (*Aircraft) DepartureAirportLocation ¶ added in v0.11.2
func (*Aircraft) DescendViaSTAR ¶
func (ac *Aircraft) DescendViaSTAR() []RadioTransmission
func (*Aircraft) DirectFix ¶
func (ac *Aircraft) DirectFix(fix string) []RadioTransmission
func (*Aircraft) DistanceAlongRoute ¶
func (*Aircraft) DistanceToEndOfApproach ¶
func (*Aircraft) ExpectApproach ¶
func (*Aircraft) ExpediteClimb ¶
func (ac *Aircraft) ExpediteClimb() []RadioTransmission
func (*Aircraft) ExpediteDescent ¶
func (ac *Aircraft) ExpediteDescent() []RadioTransmission
func (*Aircraft) FlyPresentHeading ¶
func (ac *Aircraft) FlyPresentHeading() []RadioTransmission
func (*Aircraft) GoAround ¶
func (ac *Aircraft) GoAround() []RadioTransmission
func (*Aircraft) HandingOffTo ¶ added in v0.11.10
func (*Aircraft) HandleControllerDisconnect ¶
func (*Aircraft) InitializeArrival ¶
func (*Aircraft) InitializeDeparture ¶
func (ac *Aircraft) InitializeDeparture(ap *Airport, departureAirport string, dep *Departure, runway string, exitRoute ExitRoute, nmPerLongitude float32, magneticVariation float32, scratchpads map[string]string, primaryController string, multiControllers SplitConfiguration, wind WindModel, lg *log.Logger) error
func (*Aircraft) InitializeOverflight ¶ added in v0.11.2
func (*Aircraft) InitializeVFRDeparture ¶ added in v0.11.9
func (*Aircraft) InterceptApproach ¶ added in v0.11.8
func (ac *Aircraft) InterceptApproach() []RadioTransmission
func (*Aircraft) IsAirborne ¶
func (*Aircraft) MagneticVariation ¶
func (*Aircraft) MaintainMaximumForward ¶
func (ac *Aircraft) MaintainMaximumForward() []RadioTransmission
func (*Aircraft) MaintainSlowestPractical ¶
func (ac *Aircraft) MaintainSlowestPractical() []RadioTransmission
func (*Aircraft) NewFlightPlan ¶
func (ac *Aircraft) NewFlightPlan(r FlightRules, acType, dep, arr string) *FlightPlan
func (*Aircraft) NmPerLongitude ¶
func (*Aircraft) OnApproach ¶
func (*Aircraft) OnExtendedCenterline ¶
func (*Aircraft) RouteIncludesFix ¶
func (*Aircraft) SayAltitude ¶
func (ac *Aircraft) SayAltitude() []RadioTransmission
func (*Aircraft) SayHeading ¶
func (ac *Aircraft) SayHeading() []RadioTransmission
func (*Aircraft) SaySpeed ¶
func (ac *Aircraft) SaySpeed() []RadioTransmission
func (*Aircraft) ToggleSPCOverride ¶
func (*Aircraft) TransferTracks ¶
func (*Aircraft) TurnLeft ¶
func (ac *Aircraft) TurnLeft(deg int) []RadioTransmission
func (*Aircraft) TurnRight ¶
func (ac *Aircraft) TurnRight(deg int) []RadioTransmission
type AircraftPerformance ¶
type AircraftPerformance struct { Name string `json:"name"` ICAO string `json:"icao"` // engines, weight class, category WeightClass string `json:"weightClass"` Ceiling float32 `json:"ceiling"` Engine struct { AircraftType string `json:"type"` } `json:"engines"` Rate struct { Climb float32 `json:"climb"` // ft / minute; reduce by 500 after alt 5000 if this is >=2500 Descent float32 `json:"descent"` Accelerate float32 `json:"accelerate"` // kts / 2 seconds Decelerate float32 `json:"decelerate"` } `json:"rate"` Category struct { SRS int `json:"srs"` LAHSO int `json:"lahso"` CWT string `json:"cwt"` } Runway struct { Takeoff float32 `json:"takeoff"` // nm Landing float32 `json:"landing"` // nm } `json:"runway"` Speed struct { Min float32 `json:"min"` V2 float32 `json:"v2"` Landing float32 `json:"landing"` CruiseTAS float32 `json:"cruise"` CruiseMach float32 `json:"cruiseM"` MaxTAS float32 `json:"max"` MaxMach float32 `json:"maxM"` } `json:"speed"` }
type AirlineSpecifier ¶ added in v0.11.5
type AirlineSpecifier struct { ICAO string `json:"icao"` Fleet string `json:"fleet,omitempty"` AircraftTypes []string `json:"types,omitempty"` }
func (AirlineSpecifier) Aircraft ¶ added in v0.11.5
func (a AirlineSpecifier) Aircraft() []FleetAircraft
func (*AirlineSpecifier) Check ¶ added in v0.11.5
func (a *AirlineSpecifier) Check(e *util.ErrorLogger)
type Airport ¶
type Airport struct { Location math.Point2LL TowerListIndex int `json:"tower_list"` Name string `json:"name"` Approaches map[string]*Approach `json:"approaches,omitempty"` Departures []Departure `json:"departures,omitempty"` VFR struct { Randoms VFRRandomsSpec `json:"random_routes"` Routes []VFRRouteSpec `json:"routes"` } `json:"vfr"` // Optional: initial tracking controller, for cases where a virtual // controller has the initial track. DepartureController string `json:"departure_controller"` HoldForRelease bool `json:"hold_for_release"` ExitCategories map[string]string `json:"exit_categories"` // runway -> (exit -> route) DepartureRoutes map[string]map[string]*ExitRoute `json:"departure_routes"` ApproachRegions map[string]*ApproachRegion `json:"approach_regions"` ConvergingRunways []ConvergingRunways `json:"converging_runways"` ATPAVolumes map[string]*ATPAVolume `json:"atpa_volumes"` OmitArrivalScratchpad bool `json:"omit_arrival_scratchpad"` DepartureRunwaysAsOne []string `json:"departure_runways_as_one"` }
func (*Airport) PostDeserialize ¶
func (Airport) VFRRateSum ¶ added in v0.11.9
type Airspace ¶ added in v0.11.9
type Airspace struct { Boundaries map[string][]math.Point2LL `json:"boundaries"` Volumes map[string][]ControllerAirspaceVolume `json:"volumes"` }
type AirspaceAwareness ¶ added in v0.11.9
type AirspaceGrid ¶ added in v0.11.9
type AirspaceGrid struct {
// contains filtered or unexported fields
}
AirspaceGrid organizes AirspaceVolume definitions and provides efficient in volume tests via a grid in lat-long space that records which of a potentially large set of volumes overlap grid cells. Grid cells are initialized on demand rather than upfront, which saves storage
func MakeAirspaceGrid ¶ added in v0.11.9
func MakeAirspaceGrid(v []*AirspaceVolume) *AirspaceGrid
type AirspaceVolume ¶
type AirspaceVolume struct { Name string `json:"name"` Type AirspaceVolumeType `json:"type"` Floor int `json:"floor"` Ceiling int `json:"ceiling"` // Polygon PolygonBounds *math.Extent2D // not always set Vertices []math.Point2LL `json:"vertices"` Holes [][]math.Point2LL `json:"holes"` // Circle Center math.Point2LL `json:"center"` Radius float32 `json:"radius"` }
func (*AirspaceVolume) GenerateDrawCommands ¶
func (a *AirspaceVolume) GenerateDrawCommands(cb *renderer.CommandBuffer, nmPerLongitude float32)
type AirspaceVolumeType ¶
type AirspaceVolumeType int
func (*AirspaceVolumeType) MarshalJSON ¶
func (t *AirspaceVolumeType) MarshalJSON() ([]byte, error)
func (*AirspaceVolumeType) UnmarshalJSON ¶
func (t *AirspaceVolumeType) UnmarshalJSON(b []byte) error
type AirwayDirection ¶ added in v0.11.1
type AirwayDirection int
type AirwayFix ¶ added in v0.11.1
type AirwayFix struct { Fix string Level AirwayLevel Direction AirwayDirection }
type AirwayLevel ¶ added in v0.11.1
type AirwayLevel int
type AltitudeRestriction ¶
type AltitudeRestriction struct { // We treat 0 as "unset", which works naturally for the bottom but // requires occasional care at the top. Range [2]float32 }
func ParseAltitudeRestriction ¶
func ParseAltitudeRestriction(s string) (*AltitudeRestriction, error)
ParseAltitudeRestriction parses an altitude restriction in the compact text format used in scenario definition files.
func (AltitudeRestriction) ClampRange ¶
func (a AltitudeRestriction) ClampRange(r [2]float32) (c [2]float32, ok bool)
ClampRange limits a range of altitudes to satisfy the altitude restriction; the returned Boolean indicates whether the ranges overlapped.
func (AltitudeRestriction) Encoded ¶
func (a AltitudeRestriction) Encoded() string
Encoded returns the restriction in the encoded form in which it is specified in scenario configuration files, e.g. "5000+" for "at or above 5000".
func (AltitudeRestriction) Summary ¶
func (a AltitudeRestriction) Summary() string
Summary returns a human-readable summary of the altitude restriction.
func (AltitudeRestriction) TargetAltitude ¶
func (a AltitudeRestriction) TargetAltitude(alt float32) float32
func (*AltitudeRestriction) UnmarshalJSON ¶
func (a *AltitudeRestriction) UnmarshalJSON(b []byte) error
type Approach ¶
type Approach struct { Id string `json:"cifp_id"` FullName string `json:"full_name"` Type ApproachType `json:"type"` Runway string `json:"runway"` Waypoints []WaypointArray `json:"waypoints"` // Note: this isn't currently documented; currently it's only set when // we have a canonical value from the CIFP. ApproachHeading float32 `json:"approach_heading"` }
func (*Approach) FAFSegment ¶ added in v0.11.8
Find the FAF: return the corresponding waypoint array and the index of the FAF within it.
type ApproachRegion ¶
type ApproachRegion struct { Runway string // set during deserialization HeadingTolerance float32 `json:"heading_tolerance"` ReferenceLineHeading float32 `json:"reference_heading"` ReferenceLineLength float32 `json:"reference_length"` ReferencePointAltitude float32 `json:"reference_altitude"` ReferencePoint math.Point2LL `json:"reference_point"` // lateral qualification region NearDistance float32 `json:"near_distance"` NearHalfWidth float32 `json:"near_half_width"` FarHalfWidth float32 `json:"far_half_width"` RegionLength float32 `json:"region_length"` // vertical qualification region DescentPointDistance float32 `json:"descent_distance"` DescentPointAltitude float32 `json:"descent_altitude"` AboveAltitudeTolerance float32 `json:"above_altitude_tolerance"` BelowAltitudeTolerance float32 `json:"below_altitude_tolerance"` ScratchpadPatterns []string `json:"scratchpad_patterns"` }
func (*ApproachRegion) FarPoint ¶
func (ar *ApproachRegion) FarPoint(nmPerLongitude, magneticVariation float32) [2]float32
func (*ApproachRegion) GetLateralGeometry ¶
func (*ApproachRegion) NearPoint ¶
func (ar *ApproachRegion) NearPoint(nmPerLongitude, magneticVariation float32) [2]float32
func (*ApproachRegion) TryMakeGhost ¶
func (ar *ApproachRegion) TryMakeGhost(callsign string, track RadarTrack, heading float32, scratchpad string, forceGhost bool, offset float32, leaderDirection math.CardinalOrdinalDirection, runwayIntersection [2]float32, nmPerLongitude float32, magneticVariation float32, other *ApproachRegion) *GhostAircraft
type ApproachType ¶
type ApproachType int
const ( ILSApproach ApproachType = iota RNAVApproach ChartedVisualApproach LocalizerApproach VORApproach )
func (ApproachType) MarshalJSON ¶
func (at ApproachType) MarshalJSON() ([]byte, error)
func (ApproachType) String ¶
func (at ApproachType) String() string
func (*ApproachType) UnmarshalJSON ¶
func (at *ApproachType) UnmarshalJSON(b []byte) error
type Arrival ¶
type Arrival struct { Waypoints WaypointArray `json:"waypoints"` RunwayWaypoints map[string]map[string]WaypointArray `json:"runway_waypoints"` // Airport -> runway -> waypoints SpawnWaypoint string `json:"spawn"` // if "waypoints" aren't specified CruiseAltitude float32 `json:"cruise_altitude"` Route string `json:"route"` STAR string `json:"star"` InitialController string `json:"initial_controller"` InitialAltitude float32 `json:"initial_altitude"` AssignedAltitude float32 `json:"assigned_altitude"` InitialSpeed float32 `json:"initial_speed"` SpeedRestriction float32 `json:"speed_restriction"` Scratchpad string `json:"scratchpad"` SecondaryScratchpad string `json:"secondary_scratchpad"` Description string `json:"description"` CoordinationFix string `json:"coordination_fix"` ExpectApproach util.OneOf[string, map[string]string] `json:"expect_approach"` // Airport -> arrival airlines Airlines map[string][]ArrivalAirline `json:"airlines"` }
func (Arrival) GetRunwayWaypoints ¶
func (a Arrival) GetRunwayWaypoints(airport, rwy string) WaypointArray
func (*Arrival) PostDeserialize ¶
func (ar *Arrival) PostDeserialize(loc Locator, nmPerLongitude float32, magneticVariation float32, airports map[string]*Airport, controlPositions map[string]*Controller, e *util.ErrorLogger)
type ArrivalAirline ¶
type ArrivalAirline struct { AirlineSpecifier Airport string `json:"airport"` }
type Controller ¶
type Controller struct { Position string // This is the key in the controllers map in JSON RadioName string `json:"radio_name"` Frequency Frequency `json:"frequency"` TCP string `json:"sector_id"` // e.g. N56, 2J, ... Scope string `json:"scope_char"` // Optional. If unset, facility id is used for external, last char of sector id for local. FacilityIdentifier string `json:"facility_id"` // For example the "N" in "N4P" showing the N90 TRACON ERAMFacility bool `json:"eram_facility"` // To weed out N56 and N4P being the same fac Facility string `json:"facility"` // So we can get the STARS facility from a controller DefaultAirport string `json:"default_airport"` // only required if CRDA is a thing }
func (Controller) Id ¶ added in v0.11.7
func (c Controller) Id() string
type ControllerAirspaceVolume ¶ added in v0.11.9
type ConvergingRunways ¶
type ConvergingRunways struct { Runways [2]string `json:"runways"` TieSymbol string `json:"tie_symbol"` StaggerSymbol string `json:"stagger_symbol"` TieOffset float32 `json:"tie_offset"` LeaderDirectionStrings [2]string `json:"leader_directions"` LeaderDirections [2]math.CardinalOrdinalDirection // not in JSON, set during deserialize RunwayIntersection math.Point2LL // not in JSON, set during deserialize }
type CoordinationList ¶ added in v0.11.9
type CoordinationTime ¶ added in v0.11.9
type DMEArc ¶
type DMEArc struct { Fix string Center math.Point2LL Radius float32 Length float32 InitialHeading float32 Clockwise bool }
Can either be specified with (Fix,Radius), or (Length,Clockwise); the remaining fields are then derived from those.
type DeferredHeading ¶
type DeferredHeading struct { // Time is just plain old wallclock time; it should be sim time, but a // lot of replumbing would be required to have that available where // needed. The downsides are minor: 1. On quit and resume, any pending // assignments will generally be followed immediately, and 2. if the // sim rate is increased, the delay will end up being longer than // intended. Time time.Time Heading NavHeading }
DeferredHeading stores a heading assignment from the controller and the time at which to start executing it; this time is set to be a few seconds after the controller issues it in order to model the delay before pilots start to follow assignments.
type Departure ¶
type Departure struct { Exit string `json:"exit"` Destination string `json:"destination"` Altitudes util.SingleOrArray[int] `json:"altitude,omitempty"` Route string `json:"route"` RouteWaypoints WaypointArray // not specified in user JSON Airlines []DepartureAirline `json:"airlines"` Scratchpad string `json:"scratchpad"` // optional SecondaryScratchpad string `json:"secondary_scratchpad"` // optional Description string `json:"description"` }
type DepartureAirline ¶
type DepartureAirline struct {
AirlineSpecifier
}
type ERAMAdaptation ¶
type ERAMAdaptation struct { ARTCC string // not in JSON CoordinationFixes map[string]AdaptationFixes `json:"coordination_fixes"` }
func (ERAMAdaptation) AdaptationFixForAltitude ¶
func (ea ERAMAdaptation) AdaptationFixForAltitude(fix string, altitude string) *AdaptationFix
func (ERAMAdaptation) FixForRouteAndAltitude ¶
func (ea ERAMAdaptation) FixForRouteAndAltitude(route string, altitude string) *AdaptationFix
type ExitRoute ¶
type ExitRoute struct { SID string `json:"sid"` AssignedAltitude int `json:"assigned_altitude"` ClearedAltitude int `json:"cleared_altitude"` SpeedRestriction int `json:"speed_restriction"` Waypoints WaypointArray `json:"waypoints"` Description string `json:"description"` // optional, control position to handoff to at a /ho HandoffController string `json:"handoff_controller"` }
type FAAAirport ¶
type FAAAirport struct { Id string Name string Country string Elevation int Location math.Point2LL Runways []Runway Approaches map[string]Approach STARs map[string]STAR ARTCC string }
func (FAAAirport) SelectBestRunway ¶ added in v0.11.9
func (ap FAAAirport) SelectBestRunway(wind WindModel, magneticVariation float32) (*Runway, *Runway)
func (FAAAirport) ValidRunways ¶
func (ap FAAAirport) ValidRunways() string
type FleetAircraft ¶
type FlightPlan ¶
type FlightPlan struct { Callsign string Rules FlightRules AircraftType string CruiseSpeed int AssignedSquawk Squawk // from ATC // An ECID (CID) are three alpha-numeric characters (eg. 971, 43A, // etc.) and is what ERAM assigns to a track to act as another way to // identify that track. To execute commands, controllers may use the // ECID instead of the aircrafts callsign. ECID string DepartureAirport string DepartTimeEst int DepartTimeActual int Altitude int ArrivalAirport string Hours, Minutes int FuelHours, FuelMinutes int AlternateAirport string Exit string Route string Remarks string }
func (FlightPlan) BaseType ¶
func (fp FlightPlan) BaseType() string
func (FlightPlan) TypeWithoutSuffix ¶
func (fp FlightPlan) TypeWithoutSuffix() string
type FlightRules ¶
type FlightRules int
const ( UNKNOWN FlightRules = iota IFR VFR DVFR SVFR )
func (FlightRules) String ¶
func (f FlightRules) String() string
type FlightState ¶
type FlightState struct { InitialDepartureClimb bool DepartureAirportLocation math.Point2LL DepartureAirportElevation float32 ArrivalAirport Waypoint ArrivalAirportLocation math.Point2LL ArrivalAirportElevation float32 MagneticVariation float32 NmPerLongitude float32 Position math.Point2LL Heading float32 Altitude float32 IAS, GS float32 // speeds... }
func (FlightState) LogValue ¶
func (fs FlightState) LogValue() slog.Value
func (*FlightState) Summary ¶
func (fs *FlightState) Summary() string
type FlightStrip ¶
type FlyRacetrackPT ¶
type FlyRacetrackPT struct { ProcedureTurn *ProcedureTurn Fix string FixLocation math.Point2LL Entry RacetrackPTEntry InboundHeading float32 OutboundHeading float32 OutboundTurnRate float32 OutboundTurnMethod TurnMethod OutboundLegLength float32 State int }
func MakeFlyRacetrackPT ¶
func MakeFlyRacetrackPT(nav *Nav, wp []Waypoint) *FlyRacetrackPT
func (*FlyRacetrackPT) GetAltitude ¶
func (fp *FlyRacetrackPT) GetAltitude(nav *Nav) (float32, bool)
func (*FlyRacetrackPT) GetHeading ¶
func (fp *FlyRacetrackPT) GetHeading(nav *Nav, wind WindModel, lg *log.Logger) (float32, TurnMethod, float32)
type FlyStandard45PT ¶
type FlyStandard45PT struct { ProcedureTurn *ProcedureTurn Fix string FixLocation math.Point2LL InboundHeading float32 // fix->airport AwayHeading float32 // outbound + 45 offset State int SecondsRemaining int }
func MakeFlyStandard45PT ¶
func MakeFlyStandard45PT(nav *Nav, wp []Waypoint) *FlyStandard45PT
func (*FlyStandard45PT) GetHeading ¶
func (fp *FlyStandard45PT) GetHeading(nav *Nav, wind WindModel, lg *log.Logger) (float32, TurnMethod, float32)
type Frequency ¶
type Frequency int
Frequencies are scaled by 1000 and then stored in integers.
func NewFrequency ¶
type GhostAircraft ¶
type InboundFlow ¶ added in v0.11.9
type InboundFlow struct { Arrivals []Arrival `json:"arrivals"` Overflights []Overflight `json:"overflights"` }
type InterceptState ¶ added in v0.11.8
type InterceptState int
const ( NotIntercepting InterceptState = iota InitialHeading TurningToJoin OnApproachCourse )
type Locator ¶
type Locator interface { // Locate returns the lat-long coordinates of the named point if they // are available; the bool indicates whether the point was known. Locate(fix string) (math.Point2LL, bool) // If Locate fails, Similar can be called to get alternatives that are // similarly-spelled to be offered in error messages. Similar(fix string) []string }
Locator is a simple interface to abstract looking up the location of a named thing (e.g. a fix). This is mostly present so that the route code can call back into the ScenarioGroup to resolve locations accounting for fixes defined in a scenario, without exposing Scenario-related types to the aviation package.
type METAR ¶
type METAR struct { AirportICAO string Time string Auto bool Wind Wind `json:"wind"` // WAR changing this from a strong to deserialization doesn't fail. Altimeter string Weather string Rmk string }
func GetWeather ¶ added in v0.11.9
type MVA ¶
type MVAExterior ¶
type MVAExterior struct {
LinearRing MVALinearRing `xml:"LinearRing"`
}
type MVAHorizontalProjection ¶
type MVAHorizontalProjection struct {
Surface MVASurface `xml:"Surface"`
}
type MVAInterior ¶
type MVAInterior struct {
LinearRing MVALinearRing `xml:"LinearRing"`
}
type MVALinearRing ¶
type MVALinearRing struct {
PosList string `xml:"posList"`
}
func (MVALinearRing) Vertices ¶
func (r MVALinearRing) Vertices() [][2]float32
type MVAPatches ¶
type MVAPatches struct {
PolygonPatch MVAPolygonPatch `xml:"PolygonPatch"`
}
type MVAPolygonPatch ¶
type MVAPolygonPatch struct { Exterior MVAExterior `xml:"exterior"` Interiors []MVAInterior `xml:"interior"` }
type MVASurface ¶
type MVASurface struct {
Patches MVAPatches `xml:"patches"`
}
type MagneticGrid ¶
type MultiUserController ¶
type MultiUserController struct { Primary bool `json:"primary"` BackupController string `json:"backup"` Departures []string `json:"departures"` Arrivals []string `json:"arrivals"` // TEMPORARY for inbound flows transition InboundFlows []string `json:"inbound_flows"` }
func (*MultiUserController) IsDepartureController ¶
func (c *MultiUserController) IsDepartureController(ap, rwy, sid string) bool
func (*MultiUserController) IsInboundController ¶ added in v0.11.2
func (c *MultiUserController) IsInboundController(group string) bool
type Nav ¶
type Nav struct { // the pilot has not yet started to follow. Note that only a single // such assignment is stored; if the controller issues a first heading // and then a second shortly afterward, before the first has been // followed, it's fine for the second to override it. DeferredHeading *DeferredHeading }
State related to navigation. Pointers are used for optional values; nil -> unset/unspecified.
func MakeArrivalNav ¶
func MakeArrivalNav(callsign string, arr *Arrival, fp FlightPlan, perf AircraftPerformance, nmPerLongitude float32, magneticVariation float32, wind WindModel, lg *log.Logger) *Nav
func MakeDepartureNav ¶
func MakeOverflightNav ¶ added in v0.11.2
func MakeOverflightNav(callsign string, of *Overflight, fp FlightPlan, perf AircraftPerformance, nmPerLongitude float32, magneticVariation float32, wind WindModel, lg *log.Logger) *Nav
func (*Nav) ApproachHeading ¶ added in v0.11.8
func (*Nav) AssignAltitude ¶
func (nav *Nav) AssignAltitude(alt float32, afterSpeed bool) PilotResponse
func (*Nav) AssignHeading ¶
func (nav *Nav) AssignHeading(hdg float32, turn TurnMethod) PilotResponse
func (*Nav) AssignSpeed ¶
func (nav *Nav) AssignSpeed(speed float32, afterAltitude bool) PilotResponse
func (*Nav) AssignedHeading ¶
AssignedHeading returns the aircraft's current heading assignment, if any, regardless of whether the pilot has yet started following it.
func (*Nav) AtFixCleared ¶
func (nav *Nav) AtFixCleared(fix, id string) PilotResponse
func (*Nav) CancelApproachClearance ¶
func (nav *Nav) CancelApproachClearance() PilotResponse
func (*Nav) ClimbViaSID ¶
func (nav *Nav) ClimbViaSID() PilotResponse
func (*Nav) ContactMessage ¶
func (nav *Nav) ContactMessage(reportingPoints []ReportingPoint, star string) string
func (*Nav) CrossFixAt ¶
func (nav *Nav) CrossFixAt(fix string, ar *AltitudeRestriction, speed int) PilotResponse
func (*Nav) DepartFixDirect ¶
func (nav *Nav) DepartFixDirect(fixa string, fixb string) PilotResponse
func (*Nav) DepartFixHeading ¶
func (nav *Nav) DepartFixHeading(fix string, hdg float32) PilotResponse
func (*Nav) DepartOnCourse ¶
func (*Nav) DepartureMessage ¶
func (*Nav) DescendViaSTAR ¶
func (nav *Nav) DescendViaSTAR() PilotResponse
func (*Nav) DirectFix ¶
func (nav *Nav) DirectFix(fix string) PilotResponse
func (*Nav) EnqueueHeading ¶
func (nav *Nav) EnqueueHeading(h NavHeading)
EnqueueHeading enqueues the given heading assignment to be followed a few seconds in the future. It should only be called for heading changes due to controller instructions to the pilot and never in cases where the autopilot is changing the heading assignment.
func (*Nav) ExpectApproach ¶
func (nav *Nav) ExpectApproach(airport *Airport, id string, runwayWaypoints map[string]WaypointArray, lg *log.Logger) PilotResponse
func (*Nav) ExpediteClimb ¶
func (nav *Nav) ExpediteClimb() PilotResponse
func (*Nav) ExpediteDescent ¶
func (nav *Nav) ExpediteDescent() PilotResponse
func (*Nav) FlyPresentHeading ¶
func (nav *Nav) FlyPresentHeading() PilotResponse
func (*Nav) GoAround ¶
func (nav *Nav) GoAround() PilotResponse
func (*Nav) InterceptApproach ¶ added in v0.11.8
func (nav *Nav) InterceptApproach(airport string) PilotResponse
func (*Nav) InterceptedButNotCleared ¶ added in v0.11.7
func (*Nav) IsAirborne ¶
func (*Nav) MaintainMaximumForward ¶
func (nav *Nav) MaintainMaximumForward() PilotResponse
func (*Nav) MaintainSlowestPractical ¶
func (nav *Nav) MaintainSlowestPractical() PilotResponse
func (*Nav) OnApproach ¶
func (*Nav) OnExtendedCenterline ¶
OnExtendedCenterline checks if the flight position is less than maxNmDeviation from the infinite line defined by the assigned approach localizer
func (*Nav) SayAltitude ¶
func (nav *Nav) SayAltitude() PilotResponse
func (*Nav) SayHeading ¶
func (nav *Nav) SayHeading() PilotResponse
func (*Nav) SaySpeed ¶
func (nav *Nav) SaySpeed() PilotResponse
func (*Nav) Summary ¶
func (nav *Nav) Summary(fp FlightPlan, lg *log.Logger) string
Full human-readable summary of nav state for use when paused and mouse hover on the scope
func (*Nav) TargetHeading ¶
func (*Nav) TargetSpeed ¶
type NavAirwork ¶ added in v0.11.9
type NavAirwork struct {}
func StartAirwork ¶ added in v0.11.9
func StartAirwork(wp Waypoint, nav Nav) *NavAirwork
func (*NavAirwork) Start360 ¶ added in v0.11.9
func (aw *NavAirwork) Start360(nav Nav)
func (*NavAirwork) TargetAltitude ¶ added in v0.11.9
func (aw *NavAirwork) TargetAltitude() (float32, float32)
func (*NavAirwork) TargetHeading ¶ added in v0.11.9
func (aw *NavAirwork) TargetHeading() (heading float32, turn TurnMethod, rate float32)
func (*NavAirwork) TargetSpeed ¶ added in v0.11.9
func (aw *NavAirwork) TargetSpeed() (float32, float32, bool)
func (*NavAirwork) Update ¶ added in v0.11.9
func (aw *NavAirwork) Update(nav *Nav) bool
type NavAltitude ¶
type NavAltitude struct { // restriction at the way point; we keep trying until we get there (or // are given another instruction..) Restriction *AltitudeRestriction }
type NavApproach ¶
type NavApproach struct {}
type NavFixAssignment ¶
type NavFixAssignment struct { AltitudeRestriction Speed *float32 } Fix *Waypoint Heading *float32 } }Altitude *
type NavHeading ¶
type NavHeading struct {}
type Overflight ¶ added in v0.11.2
type Overflight struct { Waypoints WaypointArray `json:"waypoints"` InitialAltitudes util.SingleOrArray[int] `json:"initial_altitude"` CruiseAltitude float32 `json:"cruise_altitude"` AssignedAltitude float32 `json:"assigned_altitude"` InitialSpeed float32 `json:"initial_speed"` AssignedSpeed float32 `json:"assigned_speed"` SpeedRestriction float32 `json:"speed_restriction"` InitialController string `json:"initial_controller"` Scratchpad string `json:"scratchpad"` SecondaryScratchpad string `json:"secondary_scratchpad"` Description string `json:"description"` Airlines []OverflightAirline `json:"airlines"` }
func (*Overflight) PostDeserialize ¶ added in v0.11.2
func (of *Overflight) PostDeserialize(loc Locator, nmPerLongitude float32, magneticVariation float32, airports map[string]*Airport, controlPositions map[string]*Controller, e *util.ErrorLogger)
type OverflightAirline ¶ added in v0.11.2
type OverflightAirline struct { AirlineSpecifier DepartureAirport string `json:"departure_airport"` ArrivalAirport string `json:"arrival_airport"` }
type PilotResponse ¶
type ProcedureTurn ¶
type ProcedureTurn struct { Type PTType RightTurns bool ExitAltitude int `json:",omitempty"` MinuteLimit float32 `json:",omitempty"` NmLimit float32 `json:",omitempty"` Entry180NoPT bool `json:",omitempty"` }
func (*ProcedureTurn) SelectRacetrackEntry ¶
func (pt *ProcedureTurn) SelectRacetrackEntry(inboundHeading float32, aircraftFixHeading float32) RacetrackPTEntry
type RacetrackPTEntry ¶
type RacetrackPTEntry int
func (RacetrackPTEntry) MarshalJSON ¶
func (e RacetrackPTEntry) MarshalJSON() ([]byte, error)
func (RacetrackPTEntry) String ¶
func (e RacetrackPTEntry) String() string
func (*RacetrackPTEntry) UnmarshalJSON ¶
func (e *RacetrackPTEntry) UnmarshalJSON(b []byte) error
type RadarSite ¶
type RadarSite struct { Char string `json:"char"` PositionString string `json:"position"` Position math.Point2LL // not in JSON, set during deserialize Elevation int32 `json:"elevation"` PrimaryRange int32 `json:"primary_range"` SecondaryRange int32 `json:"secondary_range"` SlopeAngle float32 `json:"slope_angle"` SilenceAngle float32 `json:"silence_angle"` }
type RadarTrack ¶
type RadioTransmission ¶
type RadioTransmission struct { Controller string Message string Type RadioTransmissionType }
type RadioTransmissionType ¶
type RadioTransmissionType int
func (RadioTransmissionType) String ¶
func (r RadioTransmissionType) String() string
type RedirectedHandoff ¶
type RedirectedHandoff struct { OriginalOwner string // Controller callsign Redirector []string // Controller callsign RedirectedTo string // Controller callsign }
func (*RedirectedHandoff) AddRedirector ¶
func (rd *RedirectedHandoff) AddRedirector(ctrl *Controller)
func (*RedirectedHandoff) GetLastRedirector ¶
func (rd *RedirectedHandoff) GetLastRedirector() string
func (*RedirectedHandoff) ShouldFallbackToHandoff ¶
func (rd *RedirectedHandoff) ShouldFallbackToHandoff(ctrl, octrl string) bool
func (*RedirectedHandoff) ShowRDIndicator ¶
func (rd *RedirectedHandoff) ShowRDIndicator(callsign string, RDIndicatorEnd time.Time) bool
type ReportingPoint ¶
type RestrictionArea ¶ added in v0.11.9
type RestrictionArea struct { Title string `json:"title"` Text [2]string `json:"text"` BlinkingText bool `json:"blinking_text"` HideId bool `json:"hide_id"` TextPosition math.Point2LL `json:"text_position"` CircleCenter math.Point2LL `json:"circle_center"` CircleRadius float32 `json:"circle_radius"` VerticesUser WaypointArray `json:"vertices"` Vertices [][]math.Point2LL Closed bool `json:"closed"` Shaded bool `json:"shade_region"` Color int `json:"color"` Tris [][3]math.Point2LL Deleted bool }
func RestrictionAreaFromTFR ¶ added in v0.11.9
func RestrictionAreaFromTFR(tfr TFR) RestrictionArea
func (*RestrictionArea) AverageVertexPosition ¶ added in v0.11.9
func (ra *RestrictionArea) AverageVertexPosition() math.Point2LL
func (*RestrictionArea) MoveTo ¶ added in v0.11.9
func (ra *RestrictionArea) MoveTo(p math.Point2LL)
func (*RestrictionArea) UpdateTriangles ¶ added in v0.11.9
func (ra *RestrictionArea) UpdateTriangles()
type RouteGenerator ¶ added in v0.11.9
type RouteGenerator struct {
// contains filtered or unexported fields
}
RouteGenerator is a utility class for describing lateral routes with respect to a local coordinate system. The user provides two points (generally the endpoints of a runway) which are then at (-1,0) and (1,0) in the coordinate system. The y axis is perpendicular to the vector between the two points and points to the left of it. (Thus, note that lengths in the two dimensions are different.)
func MakeRouteGenerator ¶ added in v0.11.9
func MakeRouteGenerator(p0ll, p1ll math.Point2LL, nmPerLongitude float32) RouteGenerator
type SPC ¶
SPC (Special Purpose Code) is a unique beacon code, indicate an emergency or non-standard operation.
type STAR ¶
type STAR struct { Transitions map[string]WaypointArray RunwayWaypoints map[string]WaypointArray }
func (STAR) Check ¶
func (s STAR) Check(e *util.ErrorLogger)
type STARSControllerConfig ¶ added in v0.11.9
type STARSControllerConfig struct { VideoMapNames []string `json:"video_maps"` DefaultMaps []string `json:"default_maps"` Center math.Point2LL `json:"-"` CenterString string `json:"center"` Range float32 `json:"range"` MonitoredBeaconCodeBlocksString *string `json:"beacon_code_blocks"` MonitoredBeaconCodeBlocks []Squawk }
type STARSFacilityAdaptation ¶ added in v0.11.9
type STARSFacilityAdaptation struct { AirspaceAwareness []AirspaceAwareness `json:"airspace_awareness"` ForceQLToSelf bool `json:"force_ql_self"` AllowLongScratchpad bool `json:"allow_long_scratchpad"` VideoMapNames []string `json:"stars_maps"` VideoMapLabels map[string]string `json:"map_labels"` ControllerConfigs map[string]*STARSControllerConfig `json:"controller_configs"` InhibitCAVolumes []AirspaceVolume `json:"inhibit_ca_volumes"` RadarSites map[string]*RadarSite `json:"radar_sites"` Center math.Point2LL `json:"-"` CenterString string `json:"center"` Range float32 `json:"range"` Scratchpads map[string]string `json:"scratchpads"` SignificantPoints map[string]SignificantPoint `json:"significant_points"` Altimeters []string `json:"altimeters"` MonitoredBeaconCodeBlocksString *string `json:"beacon_code_blocks"` MonitoredBeaconCodeBlocks []Squawk VideoMapFile string `json:"video_map_file"` CoordinationFixes map[string]AdaptationFixes `json:"coordination_fixes"` SingleCharAIDs map[string]string `json:"single_char_aids"` // Char to airport BeaconBank int `json:"beacon_bank"` KeepLDB bool `json:"keep_ldb"` FullLDBSeconds int `json:"full_ldb_seconds"` HandoffAcceptFlashDuration int `json:"handoff_acceptance_flash_duration"` DisplayHOFacilityOnly bool `json:"display_handoff_facility_only"` HOSectorDisplayDuration int `json:"handoff_sector_display_duration"` PDB struct { ShowScratchpad2 bool `json:"show_scratchpad2"` HideGroundspeed bool `json:"hide_gs"` ShowAircraftType bool `json:"show_aircraft_type"` SplitGSAndCWT bool `json:"split_gs_and_cwt"` DisplayCustomSPCs bool `json:"display_custom_spcs"` } `json:"pdb"` Scratchpad1 struct { DisplayExitFix bool `json:"display_exit_fix"` DisplayExitFix1 bool `json:"display_exit_fix_1"` DisplayExitGate bool `json:"display_exit_gate"` DisplayAltExitGate bool `json:"display_alternate_exit_gate"` } `json:"scratchpad1"` CustomSPCs []string `json:"custom_spcs"` CoordinationLists []CoordinationList `json:"coordination_lists"` RestrictionAreas []RestrictionArea `json:"restriction_areas"` UseLegacyFont bool `json:"use_legacy_font"` }
func (*STARSFacilityAdaptation) GetCoordinationFix ¶ added in v0.11.9
func (fa *STARSFacilityAdaptation) GetCoordinationFix(fp *STARSFlightPlan, acpos math.Point2LL, waypoints []Waypoint) (string, bool)
type STARSFlightPlan ¶ added in v0.11.9
type STARSFlightPlan struct { *FlightPlan FlightPlanType int CoordinationTime CoordinationTime CoordinationFix string ContainedFacilities []string Altitude string SP1 string SP2 string InitialController string // For abbreviated FPs }
func MakeSTARSFlightPlan ¶ added in v0.11.9
func MakeSTARSFlightPlan(fp *FlightPlan) *STARSFlightPlan
func (*STARSFlightPlan) SetCoordinationFix ¶ added in v0.11.9
func (fp *STARSFlightPlan) SetCoordinationFix(fa STARSFacilityAdaptation, ac *Aircraft, simTime time.Time) error
type SignificantPoint ¶ added in v0.11.9
type SplitConfiguration ¶
type SplitConfiguration map[string]*MultiUserController
callsign -> controller contig
func (SplitConfiguration) GetDepartureController ¶
func (sc SplitConfiguration) GetDepartureController(airport, runway, sid string) (string, error)
func (SplitConfiguration) GetInboundController ¶ added in v0.11.2
func (sc SplitConfiguration) GetInboundController(group string) (string, error)
func (SplitConfiguration) ResolveController ¶
func (sc SplitConfiguration) ResolveController(id string, active func(id string) bool) (string, error)
ResolveController takes a controller callsign and returns the signed-in controller that is responsible for that position (possibly just the provided callsign).
type SplitConfigurationSet ¶
type SplitConfigurationSet map[string]SplitConfiguration
split -> config
func (SplitConfigurationSet) GetConfiguration ¶
func (sc SplitConfigurationSet) GetConfiguration(split string) (SplitConfiguration, error)
func (SplitConfigurationSet) GetPrimaryController ¶
func (sc SplitConfigurationSet) GetPrimaryController(split string) (string, error)
func (SplitConfigurationSet) Len ¶
func (sc SplitConfigurationSet) Len() int
func (SplitConfigurationSet) Splits ¶
func (sc SplitConfigurationSet) Splits() []string
type Squawk ¶
type Squawk int
func ParseSquawk ¶
func ParseSquawkOrBlock ¶ added in v0.11.10
type SquawkCodePool ¶ added in v0.11.2
type SquawkCodePool struct {
First, Last Squawk // inclusive range of codes
// Available squawk codes are represented by a bitset
AssignedBits []uint64
}
func MakeCompleteSquawkCodePool ¶ added in v0.11.2
func MakeCompleteSquawkCodePool() *SquawkCodePool
func MakeSquawkBankCodePool ¶ added in v0.11.2
func MakeSquawkBankCodePool(bank int) *SquawkCodePool
func (*SquawkCodePool) Claim ¶ added in v0.11.2
func (p *SquawkCodePool) Claim(code Squawk) error
func (*SquawkCodePool) Get ¶ added in v0.11.2
func (p *SquawkCodePool) Get() (Squawk, error)
func (*SquawkCodePool) IsAssigned ¶ added in v0.11.2
func (p *SquawkCodePool) IsAssigned(code Squawk) bool
func (*SquawkCodePool) NumAvailable ¶ added in v0.11.2
func (p *SquawkCodePool) NumAvailable() int
func (*SquawkCodePool) Return ¶ added in v0.11.2
func (p *SquawkCodePool) Return(code Squawk) error
type StaticDatabase ¶
type StaticDatabase struct { Airports map[string]FAAAirport Fixes map[string]Fix Airways map[string][]Airway Callsigns map[string]string // 3 letter -> callsign AircraftTypeAliases map[string]string AircraftPerformance map[string]AircraftPerformance Airlines map[string]Airline MagneticGrid MagneticGrid ARTCCs map[string]ARTCC ERAMAdaptations map[string]ERAMAdaptation TRACONs map[string]TRACON MVAs map[string][]MVA // TRACON -> MVAs BravoAirspace map[string][]AirspaceVolume CharlieAirspace map[string][]AirspaceVolume }
var DB *StaticDatabase
func (StaticDatabase) LookupWaypoint ¶
func (d StaticDatabase) LookupWaypoint(f string) (math.Point2LL, bool)
type TFR ¶ added in v0.11.6
type TFR struct { ARTCC string Type string // VIP, SECURITY, EVENT, etc. LocalName string // Short string summarizing it. Effective time.Time Expire time.Time Points [][]math.Point2LL // One or more line loops defining its extent. }
TFR represents an FAA-issued temporary flight restriction.
type TFRCache ¶ added in v0.11.6
type TFRCache struct { TFRs map[string]TFR // URL -> TFR // contains filtered or unexported fields }
TFRCache stores active TFRs that have been retrieved previously; we save it out on the config so that we don't download all of them each time vice is launched.
func MakeTFRCache ¶ added in v0.11.6
func MakeTFRCache() TFRCache
func (*TFRCache) Sync ¶ added in v0.11.6
Sync synchronizes the cache, adding any newly-downloaded TFRs. It returns after the given timeout passes if we haven't gotten results back yet.
func (*TFRCache) TFRsForTRACON ¶ added in v0.11.6
TFRsForTRACON returns all TFRs that apply to the given TRACON. (It currently return all of the ones for the TRACON's ARTCC, which is overkill; we should probably cull them based on distance to the center of the TRACON.)
func (*TFRCache) UpdateAsync ¶ added in v0.11.6
UpdateAsync kicks off an update of the TFRCache; it runs asynchronously with synchronization happening when Sync or TFRsForTRACON is called.
type TransponderMode ¶
type TransponderMode int
const ( Standby TransponderMode = iota /* off */ Altitude /* mode C */ On /* mode A */ )
func (TransponderMode) String ¶
func (t TransponderMode) String() string
type TurnMethod ¶
type TurnMethod int
const ( TurnClosest TurnMethod = iota // default TurnLeft TurnRight )
func (TurnMethod) String ¶
func (t TurnMethod) String() string
type VFRRandomsSpec ¶ added in v0.11.9
type VFRRouteSpec ¶ added in v0.11.9
type VideoMap ¶
type VideoMap struct { Label string // for DCB Group int // 0 -> A, 1 -> B Name string // For maps system list Id int Category int Restriction struct { Id int Text [2]string TextBlink bool HideText bool } Color int Lines [][]math.Point2LL CommandBuffer renderer.CommandBuffer }
Note: this should match ViceMapSpec/VideoMap in crc2vice/dat2vice. (crc2vice doesn't support all of these, though.)
type VideoMapLibrary ¶
type VideoMapLibrary struct {
Maps []VideoMap
}
This should match VideoMapLibrary in dat2vice
func HashCheckLoadVideoMap ¶ added in v0.11.6
func HashCheckLoadVideoMap(path string, wantHash []byte) (*VideoMapLibrary, error)
Loads the specified video map file, though only if its hash matches the provided hash. Returns an error otherwise.
func LoadVideoMapLibrary ¶ added in v0.11.6
func LoadVideoMapLibrary(path string) (*VideoMapLibrary, error)
type VideoMapManifest ¶ added in v0.11.6
type VideoMapManifest struct {
// contains filtered or unexported fields
}
VideoMapManifest stores which maps are available in a video map file and is also able to provide the video map file's hash.
func LoadVideoMapManifest ¶ added in v0.11.6
func LoadVideoMapManifest(filename string) (*VideoMapManifest, error)
func (VideoMapManifest) HasMap ¶ added in v0.11.6
func (v VideoMapManifest) HasMap(s string) bool
func (VideoMapManifest) Hash ¶ added in v0.11.6
func (v VideoMapManifest) Hash() ([]byte, error)
Hash returns a hash of the underlying video map file (i.e., not the manifest!)
type Waypoint ¶
type Waypoint struct { Fix string `json:"fix"` Location math.Point2LL // not provided in scenario JSON; derived from fix AltitudeRestriction *AltitudeRestriction `json:"altitude_restriction,omitempty"` Speed int `json:"speed,omitempty"` Heading int `json:"heading,omitempty"` // outbound heading after waypoint PresentHeading bool ProcedureTurn *ProcedureTurn `json:"pt,omitempty"` NoPT bool `json:"nopt,omitempty"` HumanHandoff bool `json:"human_handoff"` // To named TCP. TCPHandoff string `json:"tcp_handoff"` // To named TCP. PointOut string `json:"pointout,omitempty"` ClearApproach bool `json:"clear_approach,omitempty"` // used for distractor a/c, clears them for the approach passing the wp. FlyOver bool `json:"flyover,omitempty"` Delete bool `json:"delete,omitempty"` Land bool `json:"land,omitempty"` Arc *DMEArc `json:"arc,omitempty"` IAF, IF, FAF bool // not provided in scenario JSON; derived from fix Airway string // when parsing waypoints, this is set if we're on an airway after the fix OnSID, OnSTAR bool // set during deserialization OnApproach bool // set during deserialization AirworkRadius int // set during deserialization AirworkMinutes int // set during deserialization Radius float32 Shift float32 PrimaryScratchpad string ClearPrimaryScratchpad bool SecondaryScratchpad string ClearSecondaryScratchpad bool TransferComms bool }
type WaypointArray ¶
type WaypointArray []Waypoint
func RandomizeRoute ¶ added in v0.11.9
func RandomizeRoute(w []Waypoint, randomizeAltitudeRange bool, perf AircraftPerformance, nmPerLongitude float32, magneticVariation float32, airport string, wind WindModel, lg *log.Logger) WaypointArray
func (WaypointArray) CheckArrival ¶
func (w WaypointArray) CheckArrival(e *util.ErrorLogger, ctrl map[string]*Controller, approachAssigned bool)
func (WaypointArray) CheckDeparture ¶
func (w WaypointArray) CheckDeparture(e *util.ErrorLogger, controllers map[string]*Controller)
func (WaypointArray) CheckOverflight ¶ added in v0.11.2
func (w WaypointArray) CheckOverflight(e *util.ErrorLogger, ctrl map[string]*Controller)
func (WaypointArray) Encode ¶
func (wslice WaypointArray) Encode() string
func (WaypointArray) InitializeLocations ¶ added in v0.11.6
func (waypoints WaypointArray) InitializeLocations(loc Locator, nmPerLongitude float32, magneticVariation float32, allowSlop bool, e *util.ErrorLogger) WaypointArray
func (WaypointArray) RouteString ¶ added in v0.11.2
func (w WaypointArray) RouteString() string
func (*WaypointArray) UnmarshalJSON ¶
func (w *WaypointArray) UnmarshalJSON(b []byte) error
type Wind ¶
type XNOTAMUpdate ¶ added in v0.11.6
type XNOTAMUpdate struct { Group struct { Add struct { Not struct { NotUid struct { TxtLocalName string `xml:"txtLocalName"` } `xml:"NotUid"` DateEffective string `xml:"dateEffective"` DateExpire string `xml:"dateExpire"` CodeTimeZone string `xml:"codeTimeZone"` CodeExpirationTimeZone string `xml:"codeExpirationTimeZone"` CodeFacility string `xml:"codeFacility"` TfrNot struct { CodeType string `xml:"codeType"` TFRAreaGroup []struct { AbdMergedArea struct { Avx []struct { Text string `xml:",chardata"` CodeDatum string `xml:"codeDatum"` CodeType string `xml:"codeType"` GeoLat string `xml:"geoLat"` GeoLong string `xml:"geoLong"` } `xml:"Avx"` } `xml:"abdMergedArea"` } `xml:"TFRAreaGroup"` } `xml:"TfrNot"` } `xml:"Not"` } `xml:"Add"` } `xml:"Group"` }
XNOTAMUpdate was generated 2024-09-23 07:39:34 by https://xml-to-go.github.io/, using https://github.com/miku/zek. Then manually chopped down to the parts we care about...