2,733
edits
Red Leader (talk | contribs) m (Add WIP notice) |
Red Leader (talk | contribs) (Some more cleanup; comment out examples for now, because it uses APIs that aren't implemented. (Several bits of this article appear to have been based on the Airbus A320neo implementation of an FMS) |
||
Line 4: | Line 4: | ||
{{Nasal Navigation}} | {{Nasal Navigation}} | ||
Because FlightGear's | Because FlightGear's [[route manager]] flightplan system is exposed to [[Nasal]], '''Nasal can be used to interact with flightplans'''. Obviously, this is very useful, especially for aircraft like airliners, which have complex route managers systems. This article shows how this can be done. | ||
== Background == | == Background == | ||
The | The Nasal functions relating to the route manager system include: | ||
* {{func link|flightplan()}} | |||
* {{func link|airwaysRoute()|page=Nasal library}} | |||
== | Flightplans are based on waypoints, which, in C++, inherit from the {{API Link|flightgear|class|FGPositioned}} class. | ||
=== Waypoint hashes === | |||
The following are members of a waypoint ghost, as generated by, for example, {{func link|airwaysRoute()|page=Nasal library}}: | |||
; wp_name : Name of the waypoint, returned as string. | |||
; wp_type : Waypoint type, returned as string. One of "basic," "navaid," "offset-navaid," "runway," "hdgToAlt," "dmeIntercept," "radialIntercept," or "vectors." | |||
; wp_role: Role of waypoint. | |||
; wp_lat ''or'' lat : Latitude of waypoint. | |||
; wp_lon ''or'' lon : Longitude of waypoint. | |||
; wp_parent_name : Name of waypoint's parent. | |||
; wp_parent : Waypoint's parent. | |||
; fly_type : How to waypoint should be flown over or reacted to. One of "Hold," "flyOver," or "flyBy." | |||
; heading_course : Heading of runway. | |||
== Examples == | <!-- == Examples == | ||
Setting flight-plan global (non-waypoint) data. Potentially this can include lots of FMS data - cruise profile, EPR setting, company route ID and so on. But most of that is probably better handled in Nasal, so long as the flight plan object provides a way to persist it. | Setting flight-plan global (non-waypoint) data. Potentially this can include lots of FMS data - cruise profile, EPR setting, company route ID and so on. But most of that is probably better handled in Nasal, so long as the flight plan object provides a way to persist it. | ||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
Line 193: | Line 177: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> --> | ||
[[Category:Nasal]] | [[Category:Nasal]] | ||
[[Category: Core development projects]] | [[Category: Core development projects]] | ||
[[Category: Core developer documentation]] | [[Category: Core developer documentation]] |