enroute

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package enroute emulates the slice of the enroute host computer (ERAM) that vice needs: given a flight's route and a simple trajectory model, derive the coordination fix at which it crosses the boundary between the center and one of its TRACONs, the way the host would when sending the flight plan to STARS; all real ERAM background processing is out of scope. The adaptation lives on the ERAM host (ARTCC) facility config and is keyed, for arts_coordination, by the TRACON's STARS computer id (A90 = "BOA"). route_based coordination is tried first; zone_based is the fallback when no route rule matched.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlownFixes

func FlownFixes(wps []av.Waypoint, destAirport string) []string

FlownFixes returns the fix names a "waypoints" rule is matched against: the named fixes along the route with the trailing destination airport dropped (nav appends it to every route, and adapted rule sequences end where the adapted route does, not at the field). (Exported so adaptation tooling can build rule ids the matcher will accept.)

func NamedFixes

func NamedFixes(wps []av.Waypoint) []string

NamedFixes returns the proper fix names along a route's waypoints, skipping synthesized waypoints, raw lat-long positions, and adjacent repeats.

func ParseGeometry

func ParseGeometry(coord map[string]*ArtsCoordEntry, restrictions []Restriction, loc av.Locator, e *util.ErrorLogger)

ParseGeometry parses the adaptation's geometry strings (zone centers, restriction lines) into their native forms. The server calls it once per ERAM host config after all facility configs are loaded; TRACON scenario groups then share the parsed adaptation read-only.

func Validate

func Validate(coord map[string]*ArtsCoordEntry, restrictions []Restriction, e *util.ErrorLogger)

Validate performs non-geometry validation of the coordination adaptation. Errors accumulate in e.

Types

type ArtsCoordEntry

type ArtsCoordEntry struct {
	RouteBased []RouteRule `json:"route_based"`
	ZoneBased  []ZoneArea  `json:"zone_based"`
}

ArtsCoordEntry is the per-TRACON coordination adaptation.

type Attrs

type Attrs struct {
	Engine        string // spec vocabulary: "jet" | "turboprop" | "prop"
	Nav           string // "rnav" | "conventional"
	ACType        string // aircraft ICAO type
	DestAirport   string
	AssignedLevel int // assigned altitude in hundreds of feet (for altitude_kind Assigned)
}

Attrs are the aircraft attributes coordination criteria match against.

type CoordFix

type CoordFix struct {
	Fix         string   `json:"fix"`
	Altitude    [2]int   `json:"altitude"`     // [lo,hi] hundreds of ft; [0,0] = any
	Engine      []string `json:"engine"`       // jet | turboprop | prop (mapped to J/T/P)
	Nav         []string `json:"nav"`          // rnav | conventional
	Type        []string `json:"type"`         // aircraft ICAO type
	DestAirport []string `json:"dest_airport"` // destination airport filter
}

CoordFix is a criteria-gated coordination fix. A criterion is skipped when empty; `!`-prefixed tokens exclude (convention, shared with STARS).

type Coordination

type Coordination struct {
	ComputerID   string
	Coord        *ArtsCoordEntry
	Restrictions []Restriction
}

Coordination is the resolved adaptation a sim uses: the coordination entry and restrictions that apply to its TRACON computer id. Populated at scenario-group load from the ERAM host config.

type DBLocator

type DBLocator struct{}

DBLocator resolves locations against the static nav database alone; it is used for facility-config data that must resolve the same way regardless of which scenario group (with its own fixes) is loading it, and to re-derive ArtsCoordEntry/Restriction geometry (see ParseGeometry) after a saved sim is restored, since that geometry is excluded from JSON.

func (DBLocator) Locate

func (DBLocator) Locate(s string) (math.Point2LL, bool)

func (DBLocator) Similar

func (DBLocator) Similar(fix string) []string

type Restriction

type Restriction struct {
	Name                string          `json:"name"`
	FlightType          string          `json:"flight_type"` // arrival | departure
	Procedure           string          `json:"procedure"`
	Mode                string          `json:"mode"` // line
	LineStr             string          `json:"line"`
	Line                []math.Point2LL `json:"-"`
	AltitudeRestriction string          `json:"altitude_restriction"`
	ArrivalAirports     []string        `json:"arrival_airports"`
	Aircraft            struct {
		Engine []string `json:"engine"`
		Type   []string `json:"type"`
	} `json:"aircraft"`
}

Restriction caps or floors a matching flight's modeled vertical profile; only altitude restrictions are supported.

type Result

type Result struct {
	Fix  string // the coordination fix
	Rule string // human description of the matched rule (for logging/tests)
	OK   bool
}

Result is the outcome of coordination for one flight.

func DeriveCoordinationFix

func DeriveCoordinationFix(entry *ArtsCoordEntry, traj *Trajectory,
	attrs Attrs, ft av.TypeOfFlight, routeStr string) Result

DeriveCoordinationFix applies route_based then zone_based coordination.

type RouteRule

type RouteRule struct {
	Type         string     `json:"type"`          // sid | star | airway | string | waypoints
	ID           string     `json:"id"`            // procedure/route/airway id; for "string"/"waypoints", the fix sequence
	Direction    string     `json:"direction"`     // up | down | both (airway only; sid/star = down)
	AltitudeKind string     `json:"altitude_kind"` // "Assigned" (default) | "Trajectory": which altitude the fix criteria compare
	Fixes        []CoordFix `json:"fixes"`         // criteria-ordered; first match wins
	DefaultFix   string     `json:"default_fix"`   // used when no criteria fix matches
}

RouteRule matches a filed route and supplies a coordination fix. The "waypoints" type matches the fixes the flight actually flies over rather than its filed route string.

type Trajectory

type Trajectory struct {
	Waypoints  []av.Waypoint
	FlightType av.TypeOfFlight
	// contains filtered or unexported fields
}

Trajectory is the pseudo-ERAM trajectory model. It is deliberately minimal and kept behind this type so fidelity can be improved later: - Horizontal path = the filed route (the aircraft's waypoints). - Vertical profile = linear by flight type, using the aircraft-performance climb/descent rates: departures climb from field elevation toward the filed altitude; arrivals descend toward the arrival field; overflights are level at the filed altitude.

It is consumed for the altitude at a route point — to evaluate `altitude:[lo,hi]` coordination criteria — after capping the vertical envelope per adapted restrictions.

Acceleration/deceleration, speed, wind, and realistic top-of-climb / top-of-descent are not modeled.

func MakeTrajectory

func MakeTrajectory(wps []av.Waypoint, ft av.TypeOfFlight, acType string, cruiseAlt, fieldElev, nmPerLong float32) *Trajectory

MakeTrajectory builds the trajectory model for a flight: its route waypoints, filed cruise altitude, and — for a departure or arrival — the field elevation it climbs from or descends to. The vertical gradient comes from acType's performance data.

func (*Trajectory) AltitudeAtDistance

func (t *Trajectory) AltitudeAtDistance(dist float32) int

AltitudeAtDistance returns the linear-profile altitude (feet) at the given along-route distance from the route start.

func (*Trajectory) AltitudeAtFix

func (t *Trajectory) AltitudeAtFix(fix string) (int, bool)

AltitudeAtFix returns the profile altitude (feet) at the named route fix and whether the fix is on the route.

func (*Trajectory) ApplyRestrictions

func (t *Trajectory) ApplyRestrictions(restrictions []Restriction, routeStr, arrivalAirport string, attrs Attrs)

ApplyRestrictions caps/floors the trajectory's vertical envelope for every matching altitude restriction. A gate-line crossing (mode "line") is approximated as applying to the whole trajectory; only altitude is honored.

type ZoneArea

type ZoneArea struct {
	AreaID       string        `json:"area_id"`
	CenterStr    string        `json:"center"`
	Center       math.Point2LL `json:"-"`
	AltitudeKind string        `json:"altitude_kind"`
	Arrival      []ZoneEntry   `json:"arrival"`
	Departure    []ZoneEntry   `json:"departure"`
	Overflight   []ZoneEntry   `json:"overflight"`
}

ZoneArea is a zone-based coordination area: with several areas adapted, the one whose center is nearest the flight's boundary point applies, and then the fix pick is a bearing sector from Center.

type ZoneEntry

type ZoneEntry struct {
	Bearings   string     `json:"bearings"` // "start,end" degrees; "" = any
	Fixes      []CoordFix `json:"fixes"`
	DefaultFix string     `json:"default_fix"`
}

ZoneEntry selects a coordination fix by bearing sector (+ optional criteria).

Jump to

Keyboard shortcuts

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