Nasal library: Difference between revisions

Jump to navigation Jump to search
Line 928: Line 928:
|source = {{flightgear file|src/Scripting/NasalPositioned.cxx|l=1024|t=Source}}
|source = {{flightgear file|src/Scripting/NasalPositioned.cxx|l=1024|t=Source}}
|text = Function for retrieval of airport, heliport, or seaplane base information. It returns a Nasal ghost; however, its structure is like that of a Nasal hash. The following information is returned:
|text = Function for retrieval of airport, heliport, or seaplane base information. It returns a Nasal ghost; however, its structure is like that of a Nasal hash. The following information is returned:
* '''parents''': A vector containing a hash of various functions to access information about the runway. See {{flightgear file|src/Scripting/NasalPositioned.cxx|l=2659}} for full list.
* '''parents''': A vector containing a hash of various functions to access information about the runway. These functions are:
** '''bestRunwayForPos()''' return runway as ghost by given geo position, e.g. <code>var rwy = airport.findBestRunwayForPos(geo.aircraft_position());</code>.
** '''runway()''' return runway as ghost by runway ID, e.g. <code>var rwy = airport.runway("18R");</code>.
** '''runwaysWithoutReciprocals()''' return vector of runways as ghost.
** '''helipad()''' return helipad as ghost by helipad ID, e.g. <code>var heli = airport.helipad("H19");</code>.
** '''tower()''' return hash with <code>lat</code>, <code>lon</code>, <code>elevation</code> fields.
** '''comms()''' return vector of hashes, each hash with <code>frequency</code> and <code>ident</code> fields.
** '''sids()''' return vector of strings with SID IDs.
** '''stars()''' return vector of strings with STAR IDs.
** '''getApproachList()''' return vector of string with approaches.
** '''parking''' return vector of hashes, each hash with  <code>lat</code>, <code>lon</code>, <code>elevation</code>, <code>name</code> fields.
** '''getSid()''' return SID as ghost, e.g. <code>var sid = airport.getSid("SA1A");</code>.
** '''getStar()''' return STAR as ghost, e.g. <code>var star = airport.getStar("KEILA1");</code>.
** '''getIAP()''' return IAP as ghost, e.g. <code>var iap = airport.getIAP("ILS02");</code>.
** '''getApproach()''' return approach as ghost, e.g. <code>var approach = airport.getApproach("ILS02");</code>.
** '''tostring''' just return string "an airport ICAO".
** See also {{flightgear file|src/Scripting/NasalPositioned.cxx|l=1902}}.
* '''lon''': Longitude of the location.
* '''lon''': Longitude of the location.
* '''lat''': Latitude of the location.
* '''lat''': Latitude of the location.
1,376

edits

Navigation menu