Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G

Route Manager internals

From FlightGear wiki
Revision as of 04:11, 17 October 2009 by Zakalawe (Talk | contribs) (Created page with 'Internal documentation for people wanting to work with the [route manager]. The major change in the route manager is that waypoints are no longer popped when they are sequenced.…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Internal documentation for people wanting to work with the [route manager].

The major change in the route manager is that waypoints are no longer popped when they are sequenced. Instead, the current waypoint index is incremented. This change is necessary to allow the route manager to function as the flight plan backend of real-world GPS and navigation devices, which, for example, show previous waypoints and route on a moving map display.

Since most real navigation systems deal in legs, not waypoints, the active leg is defined as that between waypoints[currentWpt - 1] and waypoints[currentWpt]. This is why current waypoint property is initialised to '1' on activating a route, and why activating a route adds the current location (usually the departure runway) as waypoint 0 - taken together, the user and GPS see the expected first leg from the runway to the first waypoint they entered.

Compatibility

To keep older aircraft and instruments work, the properties wp[0], wp[0] and wp-last are maintained, implicitly updated to refer to the current waypoint, the next waypoint and the final waypoint.