AerodromeObject
(For high level concepts about how to use Lua to write scripted tasks, please see VR-Forces User's Guide.)
The AerodromeObject class refers to a single aerodrome object that contains data about the geometry and other characteristics of an aerodrome. The static characteristics of the aerodrome are defined in feature data in the terrain database. An aerodrome object may also be managed by the simulation and published on the network; in this case, dynamic characteristics such as lighting status can be modeled as well. The member functions for an AerodromeObject provide access to the aerodrome object data.
AerodromeObject Validity
The isValid check should always be made on the aerodrome object to make sure the data for it was found in the terrain data.
The isManaged will return true if this aerodrome is also managed by the simulation. If it is, then additional API will be available to get status of published information about dynamic runway and airport conditions.
Getting AerodromObjects
AerodromeObjects are returned from vrf functions getAerodrome and getAerodromesWithinRange. See the vrf module documentation.
Aerodrome Task Parameters
Note that when Lua scripts are created, they may be given Aerodrome task parameters. An Aerodrome task parameter is not an AerodromeObject, but a table with elements specifying an aerodrome code and other data.
The elements in the table depend on how the aerodrome task parameter was set up in the script metadata dialog when the script was created. There are two check boxes for aerodrome parameters: "Aerodrome Only" and "Aerodrome Near Location." The table provided to the script has these entries depending on the check boxes:
- Aerodrome Near Location checked -- Location data. {aerodrome = (string--ICAO code), location = (Location3D), radius = (number)}.
- Aerodrome Only checked, Aerodrome Near Location not checked -- Only aerodrome information. {aerodrome = (code)}.
- No boxes checked -- Aerodrome and runway information. {aerodrome = (code), runway = (name)}.
Function List
| getAeroromeLightIntensity (lightGroup) | For the given light group return a ight intensity from 0 - 100 |
| getAirportCode () | |
| getAirportName () | Use isValid() to test if this object is valid first. |
| getForceType () | Returns the published force type of this aerodrome if published, else returns DtForceNeutral |
| getLocation3D () | Retrieve the location of this aerodrome. |
| getRunwayCondition (runway) | Returns the condition of the runway. |
| getRunwayHeading (runway) | Returns the heading of the runway |
| getRunwayLength (runway) | Returns the length of the runway |
| getRunwayLightIntensity (runway, lightGroup) | For the given light group and runway, return a runway light intensity from 0 - 100 |
| getRunwayLocations3D (runway) | Returns the locations of the runway if the runway exists at this aerodrome. |
| getRunways (runway) | Returns the names of all the runways associated with this aerodrome |
| getSimObject () | Returns the SimObject representation of this aerodrome if it exists on the network. |
| isActive () | Returns whether or not this aerodrome is active. |
| isManaged () | Determine if the state of this AerodromeObject is managed by VR-Forces. |
| isValid () | Determine if this AerodromeObject is current in a valid state. |
| runwayExists (runway) | Returns true if the route exists at this aerodrome |
| runwayIsActive (runway) | Returns the active state of the runway. |
| runwayIsDamaged (runway) | Returns the damaged state of the runway. |
Functions
- getAeroromeLightIntensity (lightGroup)
-
For the given light group return a ight intensity from 0 - 100
Parameters:
-
lightGroup: (string) Light group to check. Available light groups are "ApronLight" "ApronFloodLight" "ClearanceBarLight" "ObstructionLight" "TaxiwayCentreLight" "TaxiwayEdgeLight" "TaxiwayGuardLight" "TaxiwayIdentifierMarkerBoardLight"
Return value:
- Returns the light intensity of the aerodrome
-
- getAirportCode ()
-
Return value:
- (string) The airport code of this aerodrome.
- getAirportName ()
-
Use isValid() to test if this object is valid first.
Return value:
- (string) The full name of this aerodrome.
- getForceType ()
- Returns the published force type of this aerodrome if published, else returns DtForceNeutral
- getLocation3D ()
-
Retrieve the location of this aerodrome.
Return value:
- A Location3D giving the location of this aerodrome.
- getRunwayCondition (runway)
-
Returns the condition of the runway. If published on the network will check that, else, will return 0 (Unknown). Valid return values are: Dry = 1, Wet = 2, Ice = 3, Snow = 4
Parameters:
-
runway: (string) Runway to check.
Return value:
- (integer) The condition of the runway.
-
- getRunwayHeading (runway)
-
Returns the heading of the runway
Parameters:
-
runway: to check
Return value:
- Returns the heading of the runway (in degrees)
-
- getRunwayLength (runway)
-
Returns the length of the runway
Parameters:
-
runway: to check
Return value:
- Returns the length of the runway in meters
-
- getRunwayLightIntensity (runway, lightGroup)
-
For the given light group and runway, return a runway light intensity from 0 - 100
Parameters:
-
runway: to check -
lightGroup: (string) Light group to check. Available light groups are "RunwayGuard" "Approach" "Edge" "CenterLine" DistanceToGo" TDZ" "DisplacedThreshold" "PrethresholdEdgeLight" "ThresholdLighting" "RapidExitTaxiwayLight" "RunwayExitLight" "TaxiwayLeadOnLight" "TaxiwayStopBarLight" "REILS" "VSGI"
Return value:
- Returns the light intensity of the runway
-
- getRunwayLocations3D (runway)
-
Returns the locations of the runway if the runway exists at this aerodrome. If the runway does not exist, an empty table will be returned.
Parameters:
-
runway: (string) Runway to check.
Return value:
- (table) A vector of two runway locations (Location3D).
-
- getRunways (runway)
-
Returns the names of all the runways associated with this aerodrome
Parameters:
-
runway: to check
Return value:
- A vector (table) of runway names.
-
- getSimObject ()
- Returns the SimObject representation of this aerodrome if it exists on the network. If it does not an empty, invalid sim object will be returned
- isActive ()
- Returns whether or not this aerodrome is active. If it is published it will return the active state as published on the network. If it is not published it will be considered active.
- isManaged ()
- Determine if the state of this AerodromeObject is managed by VR-Forces.
- isValid ()
-
Determine if this AerodromeObject is current in a valid state. A AerodromeObject must be valid in order to call any functions on it other than isValid() or getAirportCode().
An AerodromeObject will only be invalid if it does not have aerodrome data in the currently loaded terrain. - runwayExists (runway)
-
Returns true if the route exists at this aerodrome
Parameters:
-
runway: (string) Runway to check.
Return value:
- Returns true if the route exists at this aerodrome
-
- runwayIsActive (runway)
-
Returns the active state of the runway. If published on the network will check that, else, assumes true.
Parameters:
-
runway: (string) Runway to check.
Return value:
- True if the runway is active
-
- runwayIsDamaged (runway)
-
Returns the damaged state of the runway. If published on the network will check that, else, assumes false
Parameters:
-
runway: (string) Runway to check.
Return value:
- True if the runway is damaged
-
