GPS internals: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with 'GPS internals ==Introduction== Although the code is named 'GPS', it is intended to be used to support a wide range of related devices, such as INS or FMS systems. A generic nam…')
 
No edit summary
Line 19: Line 19:
===Active waypoints===
===Active waypoints===


The active waypoint is available as gps/wp/wp[1], for historical reasons. Various interesting values are computed for the active waypoint, such as distance, bearing and so on.
The active waypoint is available as <tt>gps/wp/wp[1]</tt>, for historical reasons. Various interesting values are computed for the active waypoint, such as distance, bearing and so on.


gps/wp/wp[0] contains another waypoint, which varies depending on mode. For DTO and OBS modes, it is the position at the point the mode was entered; for LEG mode it is the previous waypoint in the route. Again this exists for compatibility reasons, and SHOULD NOT be used by aircraft or instruments.
<tt>gps/wp/wp[0]</tt> contains another waypoint, which varies depending on mode. For DTO and OBS modes, it is the position at the point the mode was entered; for LEG mode it is the previous waypoint in the route. Again this exists for compatibility reasons, and SHOULD NOT be used by aircraft or instruments.


==Commands and the scratch===
===Commands and the scratch===


The GPS has a simple command system - it expects the properties under gps/scratch to be populated with some parameters, and then a command property to be set. Information is also returned via the gps/scratch properties. For example, to go direct to a waypoint, it must be loaded into the scratch, and a 'direct' command executed. To find the nearest VOR, set scratch/type to 'vor' and execute a 'nearest' command. The scratch will be updated with information about the result (if one was found) - and then a 'direct' or 'obs' command can be executed to use the waypoint.
The GPS has a simple command system - it expects the properties under <tt>gps/scratch</tt> to be populated with some parameters, and then a command property to be set. Information is also returned via the <tt>gps/scratch</tt> properties. For example, to go direct to a waypoint, it must be loaded into the scratch, and a 'direct' command executed. To find the nearest VOR, set scratch/type to 'vor' and execute a 'nearest' command. The scratch will be updated with information about the result (if one was found) - and then a 'direct' or 'obs' command can be executed to use the waypoint.




Line 41: Line 41:
: Enter DTO mode. The active waypoint is loaded from the scratch, and a course calculated.
: Enter DTO mode. The active waypoint is loaded from the scratch, and a course calculated.


- nearest, load the nearest waypoint (of a type) into the scratch.
;nearest
max-results - maximum number of nearby waypoints to load. Default is 1.
: load the nearest waypoint (of a type) into the scratch. The following parameters are supported:
type - a type string. 'any', 'all' or an empty value mean all types
:# max-results - maximum number of nearby waypoints to load. Default is 1.
:# type - a type string. 'any', 'all' or an empty value mean all types


- search, load waypoints by matching ident or name
;search,
type - as for 'nearest'
: load waypoints by matching ident or name. The following parameters are supported:
ident - the string to search on
:# type - as for 'nearest'
:# ident - the string to search on
order-by-range - a flag indicating if matches should be returned sorted by distance (the default) or alphabetically
order-by-range - a flag indicating if matches should be returned sorted by distance (the default) or alphabetically
exact - a flag indicated if matches must be exact (true) or partial (false). In
exact - a flag indicated if matches must be exact (true) or partial (false). In
- next - load the next result (for nearest/search/load-route-wpt)
;next
- previous - load the previous search result
: load the next result (for nearest/search/load-route-wpt)
 
;previous
: load the previous search result
- define-user-waypoint - create a user waypoint based on the current scratch.
;define-user-waypoint
: create a user waypoint based on the current scratch.
==Configuration==
==Configuration==
580

edits

Navigation menu