LTAPI
API to access LiveTraffic's aircraft information
|
Represents one aircraft as controlled by LiveTraffic. More...
#include <LTAPI.h>
Classes | |
struct | LTAPIBulkData |
Bulk data transfer structur for communication with LTAPI. More... | |
struct | LTAPIBulkInfoTexts |
Bulk text transfer structur for communication with LTAPI. More... | |
struct | LTLights |
Structure to return plane's lights status. More... | |
Public Types | |
enum | LTFlightPhase { FPH_UNKNOWN = 0, FPH_TAXI = 10, FPH_TAKE_OFF = 20, FPH_TO_ROLL, FPH_ROTATE, FPH_LIFT_OFF, FPH_INITIAL_CLIMB, FPH_CLIMB = 30, FPH_CRUISE = 40, FPH_DESCEND = 50, FPH_APPROACH = 60, FPH_FINAL, FPH_LANDING = 70, FPH_FLARE, FPH_TOUCH_DOWN, FPH_ROLL_OUT, FPH_STOPPED_ON_RWY } |
Flight phase, definition copied from LiveTraffic. More... | |
Public Member Functions | |
LTAPIAircraft () | |
virtual | ~LTAPIAircraft () |
virtual bool | updateAircraft (const LTAPIBulkData &__bulk, size_t __inSize) |
Updates the aircraft with fresh numerical values, called from LTAPIConnect::UpdateAcList() More... | |
virtual bool | updateAircraft (const LTAPIBulkInfoTexts &__info, size_t __inSize) |
Updates the aircraft with fresh textual information, called from LTAPIConnect::UpdateAcList() More... | |
bool | isUpdated () const |
Helper in update loop to detected removed aircrafts. More... | |
void | resetUpdated () |
Helper in update loop, resets bUpdated flag. More... | |
std::string | getKey () const |
Unique key for this aircraft, usually ICAO transponder hex code. More... | |
std::string | getRegistration () const |
tail number like "D-AISD" More... | |
std::string | getModelIcao () const |
ICAO aircraft type like "A321". More... | |
std::string | getAcClass () const |
a/c class like "L2J" More... | |
std::string | getWtc () const |
wake turbulence category like H,M,L/M,L More... | |
std::string | getOpIcao () const |
ICAO-code of operator like "DLH". More... | |
std::string | getMan () const |
human-readable manufacturer like "Airbus" More... | |
std::string | getModel () const |
human-readable a/c model like "A321-231" More... | |
std::string | getCatDescr () const |
human-readable category description More... | |
std::string | getOp () const |
human-readable operator like "Lufthansa" More... | |
std::string | getCslModel () const |
name of CSL model used for actual rendering of plane More... | |
std::string | getCallSign () const |
call sign like "DLH56C" More... | |
std::string | getSquawk () const |
squawk code (as text) like "1000" More... | |
std::string | getFlightNumber () const |
flight number like "LH1113" More... | |
std::string | getOrigin () const |
origin airport (IATA or ICAO) like "MAD" or "LEMD" More... | |
std::string | getDestination () const |
destination airport (IATA or ICAO) like "FRA" or "EDDF" More... | |
std::string | getTrackedBy () const |
name of channel deliverying the underlying tracking data More... | |
std::string | getDescription () const |
some reasonable descriptive string formed from the above, like an identifier, type, form/to More... | |
double | getLat () const |
[°] latitude More... | |
double | getLon () const |
[°] longitude More... | |
double | getAltFt () const |
[ft] altitude More... | |
float | getHeading () const |
[°] heading More... | |
float | getTrack () const |
[°] track over ground More... | |
float | getRoll () const |
[°] roll: positive right More... | |
float | getPitch () const |
[°] pitch: positive up More... | |
float | getSpeedKn () const |
[kt] ground speed More... | |
float | getVSIft () const |
[ft/minute] vertical speed, positive up More... | |
float | getTerrainFt () const |
[ft] terrain altitude beneath plane More... | |
float | getHeightFt () const |
[ft] height AGL More... | |
bool | isOnGnd () const |
Is plane on ground? More... | |
LTFlightPhase | getPhase () const |
flight phase More... | |
std::string | getPhaseStr () const |
flight phase as string More... | |
float | getFlaps () const |
flap position: 0.0 retracted, 1.0 fully extended More... | |
float | getGear () const |
gear position: 0.0 retracted, 1.0 fully extended More... | |
float | getReversers () const |
reversers position: 0.0 closed, 1.0 fully opened More... | |
LTLights | getLights () const |
all plane's lights More... | |
bool | isOnCamera () const |
is currently seen on LiveTraffic's internal camera view? More... | |
float | getBearing () const |
[°] to current camera position More... | |
float | getDistNm () const |
[nm] distance to current camera More... | |
int | getMultiIdx () const |
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not More... | |
void | getLocalCoord (double &x, double &y, double &z) const |
lat /lon /alt converted to local coordinates More... | |
Static Public Member Functions | |
static LTAPIAircraft * | CreateNewObject () |
Standard object creation callback. More... | |
Protected Attributes | |
LTAPIBulkData | bulk |
numerical plane's data More... | |
LTAPIBulkInfoTexts | info |
textual plane's data More... | |
bool | bUpdated = false |
update helper, gets reset before updates, set during updates, stays false if not updated More... | |
Represents one aircraft as controlled by LiveTraffic.
You can derive subclasses from this class if you want to add information specific to you app. Then you would need to provide a callback function fCreateAcObject
to LTAPIConnect so that you create new aircraft objects when required by LTAPIConnect.
Flight phase, definition copied from LiveTraffic.
LTAPIAircraft::LTAPIAircraft | ( | ) |
|
virtual |
|
inlinestatic |
Standard object creation callback.
|
inline |
a/c class like "L2J"
|
inline |
[ft] altitude
|
inline |
[°] to current camera position
|
inline |
call sign like "DLH56C"
|
inline |
human-readable category description
|
inline |
name of CSL model used for actual rendering of plane
std::string LTAPIAircraft::getDescription | ( | ) | const |
some reasonable descriptive string formed from the above, like an identifier, type, form/to
Puts together a string if at max 3 compontens:
|
inline |
destination airport (IATA or ICAO) like "FRA" or "EDDF"
|
inline |
[nm] distance to current camera
|
inline |
flap position: 0.0 retracted, 1.0 fully extended
|
inline |
flight number like "LH1113"
|
inline |
gear position: 0.0 retracted, 1.0 fully extended
|
inline |
[°] heading
|
inline |
[ft] height AGL
|
inline |
Unique key for this aircraft, usually ICAO transponder hex code.
|
inline |
[°] latitude
|
inline |
all plane's lights
|
inline |
lat
/lon
/alt
converted to local coordinates
[out] | x | Local x coordinate |
[out] | y | Local y coordinate |
[out] | z | Local z coordinate |
|
inline |
[°] longitude
|
inline |
human-readable manufacturer like "Airbus"
|
inline |
human-readable a/c model like "A321-231"
|
inline |
ICAO aircraft type like "A321".
|
inline |
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
|
inline |
human-readable operator like "Lufthansa"
|
inline |
ICAO-code of operator like "DLH".
|
inline |
origin airport (IATA or ICAO) like "MAD" or "LEMD"
|
inline |
flight phase
std::string LTAPIAircraft::getPhaseStr | ( | ) | const |
flight phase as string
|
inline |
[°] pitch: positive up
|
inline |
tail number like "D-AISD"
|
inline |
reversers position: 0.0 closed, 1.0 fully opened
|
inline |
[°] roll: positive right
|
inline |
[kt] ground speed
|
inline |
squawk code (as text) like "1000"
|
inline |
[ft] terrain altitude beneath plane
|
inline |
[°] track over ground
|
inline |
name of channel deliverying the underlying tracking data
|
inline |
[ft/minute] vertical speed, positive up
|
inline |
wake turbulence category like H,M,L/M,L
|
inline |
is currently seen on LiveTraffic's internal camera view?
|
inline |
Is plane on ground?
|
inline |
Helper in update loop to detected removed aircrafts.
|
inline |
Helper in update loop, resets bUpdated
flag.
|
virtual |
Updates the aircraft with fresh numerical values, called from LTAPIConnect::UpdateAcList()
__bulk | A structure with updated numeric aircraft data |
__inSize | Number of bytes returned by LiveTraffic |
Copies the provided bulk
data and sets bUpdated
to true
if the provided data matches this aircraft.
key
for the first and only time.
|
virtual |
Updates the aircraft with fresh textual information, called from LTAPIConnect::UpdateAcList()
__info | A structure with updated textual info |
__inSize | Number of bytes returned by LiveTraffic |
Copies the provided info
data and sets bUpdated
to true
if the provided data matches this aircraft.
key
! A new LTAPIAircraft object will always receive a call to the above version (with LTAPIBulkData
) first before receiving a call to this version (with LTAPIBulkInfoTexts
).
|
protected |
numerical plane's data
|
protected |
update helper, gets reset before updates, set during updates, stays false if not updated
|
protected |
textual plane's data