Package com.mouseviator.fsuipc.helpers.aircraft

# Class AircraftHelper

java.lang.Object
com.mouseviator.fsuipc.helpers.aircraft.AircraftHelper

    public class AircraftHelper
    extends java.lang.Object

This class provides methods that return data requests to gather various info about flight simulator. The returned requests are usually modified to return user-friendly data type, even thought the underlying data type may be different. For example, the `getIAS()` returns an instance of `FloatRequest`, while the overloaded getValue() reads integer (4 bytes) value from offset 0x02BC, divides it by 128 and returns the resulting float value, which is IAS in knots. Many of the methods here return data requests with overloaded getValue function to return user-friendly value rather that raw FSUIPC value.

Author:
  Mouseviator

- ## Nested Class Summary

  Nested Classes
  Modifier and Type | Class | Description
  --- | --- | ---
  `static class` | `AircraftHelper.EngineType` | This enumeration defines engine types supported by FSUIPC, which can be returned by `getEngineType()` function.

- ## Constructor Summary

  Constructors
  Constructor | Description
  --- | ---
  `AircraftHelper()` |

- ## Method Summary

  Modifier and Type | Method | Description
  --- | --- | ---
  `DoubleRequest` | `getAltitude​(boolean bFeet)` | Returns request to get aircraft altitude in meters of feet.
  `IDataRequest<java.lang.String>` | `getATCAircraftType()` | Returns request to get ATC aircraft type as declared in AircraftHelper.cfg.
  `StringRequest` | `getATCAirlineName()` | Returns request to get ATC airline name as declared in AircraftHelper.cfg.
  `StringRequest` | `getATCFlightNumber()` | Returns request to get ATC aircraft flight number as declared in AircraftHelper.cfg.
  `StringRequest` | `getATCIdent()` | Returns request to get ATC aircraft identifier (tail number) as declared in AircraftHelper.cfg.
  `FloatRequest` | `getBank()` | Returns request to get aircraft bank in degrees.
  `IDataRequest<java.lang.Byte>` | `getEngineType()` | Returns request to get aircraft engine type.
  `FloatRequest` | `getHeading()` | Returns request to get aircraft TRUE heading.
  `FloatRequest` | `getIAS()` | Returns request to get aircraft IAS in knots.
  `DoubleRequest` | `getLatitude()` | Returns request to get aircraft latitude in degrees.
  `DoubleRequest` | `getLongitude()` | Returns request to get aircraft longitude in degrees.
  `IDataRequest<java.lang.Float>` | `getMagneticVariation()` | Returns request to get aircraft magnetic variation in degrees.
  `IDataRequest<java.lang.Short>` | `getNumberOfEngines()` | Returns request to get number of aircraft engines.
  `IDataRequest<java.lang.Short>` | `getOnGround()` | Returns request to get whether the aircraft is on ground.
  `FloatRequest` | `getPitch()` | Returns request to get aircraft pitch in degrees.
  `FloatRequest` | `getTAS()` | Returns request to get aircraft TAS in knots.
  `FloatRequest` | `getVerticalSpeed​(boolean bFPM)` | Returns request to get aircraft vertical speed in m/s or Feets per minute.The setValue method is also overridden.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### AircraftHelper

    public AircraftHelper()

- ## Method Details

  - ### getIAS

    public FloatRequest getIAS()
    Returns request to get aircraft IAS in knots. Expects IAS in Kts. However, not guaranteed to work. See description of offset 0x02BC in FSUIPC documentation. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft IAS in Kts.

  - ### getTAS

    public FloatRequest getTAS()
    Returns request to get aircraft TAS in knots. The setValue method is also overridden. Expects TAS in Kts. However, not guaranteed to work. See description of offset 0x02B0 in FSUIPC documentation. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft TAS in Kts.

  - ### getVerticalSpeed

    public FloatRequest getVerticalSpeed​(boolean bFPM)
    Returns request to get aircraft vertical speed in m/s or Feets per minute.The setValue method is also overridden. Expects vertical speed in m/s of fpm. However, not guaranteed to work. See description of offset 0x02B0 in FSUIPC documentation. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Parameters:
      `bFPM` - Whether to return value as fpm or m/s.
    Returns:
      Data request to get/set aircraft vertical speed in fpm or m/s.

  - ### getLatitude

    public DoubleRequest getLatitude()
    Returns request to get aircraft latitude in degrees. The setValue method is also overridden. Expects latitude in degrees. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft latitude in degrees.

  - ### getLongitude

    public DoubleRequest getLongitude()
    Returns request to get aircraft longitude in degrees. The setValue method is also overridden. Expects longitude in degrees. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft longitude in degrees.

  - ### getAltitude

    public DoubleRequest getAltitude​(boolean bFeet)
    Returns request to get aircraft altitude in meters of feet. This reads from offset 0x0570. Due to conversions, some precision might be lost and this might give slightly different result than `GPSHelper.getAltitude(boolean)`. But the difference should be within 1-2 meters.
    Parameters:
      `bFeet` - True to get result in feet, False for meters.
    Returns:
      Data request to get aircraft altitude in meters or feet.

  - ### getNumberOfEngines

    public IDataRequest<java.lang.Short> getNumberOfEngines()
    Returns request to get number of aircraft engines. READ ONLY!
    Returns:
      Data request to get number of aircraft engines.

  - ### getPitch

    public FloatRequest getPitch()
    Returns request to get aircraft pitch in degrees. The setValue method is also overridden. Expects pitch in degrees. Negative value for pitch up, positive for pitch down. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft pitch in degrees.

  - ### getBank

    public FloatRequest getBank()
    Returns request to get aircraft bank in degrees. The setValue method is also overridden. Expects bank in degrees. Negative value for bank right, positive for bank left. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft bank in degrees.

  - ### getHeading

    public FloatRequest getHeading()
    Returns request to get aircraft TRUE heading. The setValue method is also overridden. Expects heading in degrees TRUE. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.
    Returns:
      Data request to get/set aircraft TRUE heading in degrees.

  - ### getMagneticVariation

    public IDataRequest<java.lang.Float> getMagneticVariation()
    Returns request to get aircraft magnetic variation in degrees. READ ONLY.
    Returns:
      Data request to get aircraft magnetic variation in degrees.

  - ### getEngineType

    public IDataRequest<java.lang.Byte> getEngineType()
    Returns request to get aircraft engine type. READ ONLY!
    Returns:
      Data request to get aircraft engine type.

  - ### getATCFlightNumber

    public StringRequest getATCFlightNumber()
    Returns request to get ATC aircraft flight number as declared in AircraftHelper.cfg. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.

    SimConnect allows this SimVar to be written, but this may not change the Flight Number being used by ATC unless a flight plan has been loaded too (see offset 0130).

    Returns:
      Data request to get/set aircraft ATC flight number.

  - ### getATCIdent

    public StringRequest getATCIdent()
    Returns request to get ATC aircraft identifier (tail number) as declared in AircraftHelper.cfg. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.

    SimConnect seems to allow this SimVar to be written, but whether this does actually change the Tail Number being used I by ATC, I don’t yet know

    Returns:
      Data request to get/set aircraft ATC Identification (Ident).

  - ### getATCAirlineName

    public StringRequest getATCAirlineName()
    Returns request to get ATC airline name as declared in AircraftHelper.cfg. Note that the returned object will be READ request by default. To make it write request, call its `IDataRequest.setType(com.mouseviator.fsuipc.datarequest.IDataRequest.RequestType)` method with parameter `IDataRequest.RequestType.WRITE`.

    SimConnect seems to allow this SimVar to be written, but whether this does actually change the Airline Name being used by ATC, I don’t yet know

    Returns:
      Data request to get/set aircraft airline name.

  - ### getATCAircraftType

    public IDataRequest<java.lang.String> getATCAircraftType()
    Returns request to get ATC aircraft type as declared in AircraftHelper.cfg. READ ONLY!
    Returns:
      Data request to get aircraft ATC type.

  - ### getOnGround

    public IDataRequest<java.lang.Short> getOnGround()
    Returns request to get whether the aircraft is on ground. READ ONLY!
    Returns:
      Data request to get whether the aircraft is on ground or in the air.