LTAPI
API to access LiveTraffic's aircraft information
LTAPI.h
Go to the documentation of this file.
1
29
30#ifndef LTAPI_h
31#define LTAPI_h
32
33#include <cstring>
34#include <memory>
35#include <string>
36#include <list>
37#include <map>
38#include <chrono>
39#include <cmath>
40
41#include "XPLMDataAccess.h"
42#include "XPLMGraphics.h"
43
44class LTDataRef;
45class LTAPIAircraft;
46
48typedef std::shared_ptr<LTAPIAircraft> SPtrLTAPIAircraft;
49
57{
58private:
61 unsigned keyNum = 0;
63 std::string key;
64
65public:
66
88
102
108 public:
109 // identification
110 uint64_t keyNum = 0;
111 // position, attitude
112 float lat_f = 0.0f;
113 float lon_f = 0.0f;
114 float alt_ft_f = 0.0f;
115 float heading = 0.0f;
116 float track = 0.0f;
117 float roll = 0.0f;
118 float pitch = 0.0f;
119 float speed_kt = 0.0f;
120 float vsi_ft = 0.0f;
121 float terrainAlt_ft = 0.0f;
122 float height_ft = 0.0f;
123 // configuration
124 float flaps = 0.0f;
125 float gear = 0.0f;
126 float reversers = 0.0f;
127 // simulation
128 float bearing = 0.0f;
129 float dist_nm = 0.0f;
130
131 struct BulkBitsTy {
133 bool onGnd : 1;
134 // Lights:
135 bool taxi : 1;
136 bool land : 1;
137 bool bcn : 1;
138 bool strb : 1;
139 bool nav : 1;
140 unsigned hidden : 1;
141 bool camera : 1;
142 // Misc
143 int multiIdx : 8;
144 // Transponder Mode (added in LT 4.4.0)
145 unsigned trspMode : 4;
146 // Filler for 8-byte alignment
147 unsigned filler2 : 4;
148 unsigned filler3 : 32;
150
151 // V1.22 additions
152 double lat = 0.0f;
153 double lon = 0.0f;
154 double alt_ft = 0.0f;
155
156 // LT v4.4.0 additions
157 // Cartesian location in local coordinates
158 double x = NAN;
159 double y = NAN;
160 double z = NAN;
161 // Cartesian velocity in m/s per axis, updated at least once per second
162 double v_x = NAN;
163 double v_y = NAN;
164 double v_z = NAN;
165
168 { memset(&bits, 0, sizeof(bits)); bits.trspMode = 4; }
169 };
170
174 public:
175 // identification
176 uint64_t keyNum;
177 char registration[8];
178 // aircraft model/operator
179 char modelIcao[8];
180 char acClass[4];
181 char wtc[4];
182 char opIcao[8];
183 char man[40];
184 char model[40];
185 char catDescr[40];
186 char op[40];
187 // flight data
188 char callSign[8];
189 char squawk[8];
190 char flightNumber[8];
191 char origin[8];
192 char destination[8];
193 char trackedBy[24];
194
195 // V1.22 additions, in V2.40 extended from 24 to 40 chars
196 char cslModel[40];
197
200 { memset(this, 0, sizeof(*this)); }
201 };
202
204 struct LTLights {
205 bool beacon : 1;
206 bool strobe : 1;
207 bool nav : 1;
208 bool landing : 1;
209 bool taxi : 1;
210
213 beacon(b.bcn), strobe(b.strb), nav(b.nav), landing(b.land), taxi(b.taxi){}
214 };
215
216protected:
219
221 bool bUpdated = false;
222
223public:
225 virtual ~LTAPIAircraft();
226
227 // Updates an aircraft. If our key is defined it first verifies that the
228 // key matches with the one currently available in the dataRefs.
229 // Returns false if not.
230 // If our key is not defined it just accepts anything available.
231 // Updates all fields, set bUpdated and returns true.
235 virtual bool updateAircraft(const LTAPIBulkData& __bulk, size_t __inSize);
239 virtual bool updateAircraft(const LTAPIBulkInfoTexts& __info, size_t __inSize);
241 bool isUpdated () const { return bUpdated; }
243 void resetUpdated () { bUpdated = false; }
244
248 virtual void toggleCamera ([[maybe_unused]] bool bCameraActive,
249 [[maybe_unused]] SPtrLTAPIAircraft spPrevAc) {}
250
252 void setCameraAc ();
253
254 // data access
255public:
256 std::string getKey() const { return key; }
257 // identification
258 std::string getRegistration() const { return info.registration; }
259 // aircraft model/operator
260 std::string getModelIcao() const { return info.modelIcao; }
261 std::string getAcClass() const { return info.acClass; }
262 std::string getWtc() const { return info.wtc; }
263 std::string getOpIcao() const { return info.opIcao; }
264 std::string getMan() const { return info.man; }
265 std::string getModel() const { return info.model; }
266 std::string getCatDescr() const { return info.catDescr; }
267 std::string getOp() const { return info.op; }
268 std::string getCslModel() const { return info.cslModel; }
269 // flight data
270 std::string getCallSign() const { return info.callSign; }
271 std::string getSquawk() const { return info.squawk; }
272 std::string getFlightNumber() const { return info.flightNumber; }
273 std::string getOrigin() const { return info.origin; }
274 std::string getDestination() const { return info.destination; }
275 std::string getTrackedBy() const { return info.trackedBy; }
276 // combined info
277 std::string getDescription() const;
278 // position, attitude
279 double getLat() const { return bulk.lat; }
280 double getLon() const { return bulk.lon; }
281 double getAltFt() const { return bulk.alt_ft; }
282 float getHeading() const { return bulk.heading; }
283 float getTrack() const { return bulk.track; }
284 float getRoll() const { return bulk.roll; }
285 float getPitch() const { return bulk.pitch; }
286 float getSpeedKn() const { return bulk.speed_kt; }
287 float getVSIft() const { return bulk.vsi_ft; }
288 float getTerrainFt() const { return bulk.terrainAlt_ft; }
289 float getHeightFt() const { return bulk.height_ft; }
290 bool isOnGnd() const { return bulk.bits.onGnd; }
291 LTFlightPhase getPhase() const { return bulk.bits.phase; }
292 std::string getPhaseStr() const;
293 bool isVisible() const { return !bulk.bits.hidden; }
294 // configuration
295 float getFlaps() const { return bulk.flaps; }
296 float getGear() const { return bulk.gear; }
297 float getReversers() const { return bulk.reversers; }
298 LTLights getLights() const { return bulk.bits; }
299 bool isOnCamera() const { return bulk.bits.camera; }
300 // simulation
301 float getBearing() const { return bulk.bearing; }
302 float getDistNm() const { return bulk.dist_nm; }
303 int getMultiIdx() const { return bulk.bits.multiIdx; }
306 const char* getTrspModeTxt() const;
307
313 void getLocalVelocities (double& v_x, double& v_y, double& v_z) const
314 { v_x = bulk.v_x; v_y = bulk.v_y; v_z = bulk.v_z; }
315
317 double getLocalGndSpeed_ms () const { return std::hypot(bulk.v_x, bulk.v_z); }
319 double getLocalGndSpeed_kn () const { return getLocalGndSpeed_ms() * 1.94384; }
320
321 // calculated (or transferred in newer versions)
328 void getLocalCoord (double& x, double& y, double& z) const;
329
330public:
333 static LTAPIAircraft* CreateNewObject() { return new LTAPIAircraft(); }
334};
335
336//
337// MapLTAPIAircraft
338//
339
350typedef std::map<std::string,SPtrLTAPIAircraft> MapLTAPIAircraft;
351
356typedef std::list<SPtrLTAPIAircraft> ListLTAPIAircraft;
357
362{
363public:
374
378 std::chrono::seconds sPeriodExpsv = std::chrono::seconds(3);
379
380protected:
382 const int iBulkAc = 50;
384 std::unique_ptr<LTAPIAircraft::LTAPIBulkData[]> vBulkNum;
386 std::unique_ptr<LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts;
387
388protected:
391
394
396 std::chrono::time_point<std::chrono::steady_clock> lastExpsvFetch;
397
398public:
404 int numBulkAc = 50);
405 virtual ~LTAPIConnect();
406
408 static bool isLTAvail ();
409
421 static int getLTVerNr();
422
427 static int getLTVerDate();
428
434 static bool doesLTDisplayAc ();
435
437 static int getLTNumAc ();
438
446 static bool doesLTControlAI ();
447
449 static time_t getLTSimTime ();
450
452 static std::chrono::system_clock::time_point getLTSimTimePoint ();
453
461 const MapLTAPIAircraft& UpdateAcList (ListLTAPIAircraft* plistRemovedAc = nullptr);
462
464 const MapLTAPIAircraft& getAcMap () const { return mapAc; }
465
469 SPtrLTAPIAircraft getAcByMultIdx (int multiIdx) const;
470
474
477
478protected:
486 template <class T>
487 bool DoBulkFetch (int numAc, LTDataRef& DR, int& outSizeLT,
488 std::unique_ptr<T[]> &vBulk);
489
492};
493
494
503
505protected:
506 std::string sDataRef;
507 XPLMDataRef dataRef = NULL;
508 XPLMDataTypeID dataTypes = xplmType_Unknown;
509 bool bValid = true;
510public:
511 LTDataRef (std::string _sDataRef);
512 inline bool needsInit () const { return bValid && !dataRef; }
514 bool isValid ();
516 bool FindDataRef ();
517
518 // types
520 XPLMDataTypeID getDataRefTypes() const { return dataTypes; }
522 bool hasInt () const { return dataTypes & xplmType_Int; }
524 bool hasFloat () const { return dataTypes & xplmType_Float; }
526 static constexpr XPLMDataTypeID usefulTypes =
527 xplmType_Int | xplmType_Float | xplmType_Data;
528
531 int getInt();
534 float getFloat();
536 inline bool getBool() { return getInt() != 0; }
538 int getData(void* pOut, int inOffset, int inMaxBytes);
539
541 void set(int i);
543 void set(float f);
544
545protected:
546};
547
548//
549// Sizes for version compatibility comparison
550//
551
553constexpr size_t LTAPIBulkData_v120 = 80;
555#if IBM
556constexpr size_t LTAPIBulkData_v122 = 120;
557#else
558constexpr size_t LTAPIBulkData_v122 = 104;
559#endif
560
563#if IBM
564static_assert(LTAPIBulkData_v440 == 168, "LTAPIBulkData size is not 152 as expected");
565#else
566static_assert(LTAPIBulkData_v440 == 152, "LTAPIBulkData size is not 152 as expected");
567#endif
568
570constexpr size_t LTAPIBulkInfoTexts_v120 = 264;
571constexpr size_t LTAPIBulkInfoTexts_v122 = 288;
574static_assert(LTAPIBulkInfoTexts_v240 == 304, "LTAPIBulkInfoTexts size is not 304 as expected");
575
576#endif /* LTAPI_h */
std::map< std::string, SPtrLTAPIAircraft > MapLTAPIAircraft
Map of all aircrafts stored as smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:350
constexpr size_t LTAPIBulkData_v122
Size of bulk structure as per LiveTraffic v1.22.
Definition LTAPI.h:558
std::list< SPtrLTAPIAircraft > ListLTAPIAircraft
Simple list of smart pointers to LTAPIAircraft objects.
Definition LTAPI.h:356
constexpr size_t LTAPIBulkInfoTexts_v120
Size of original bulk info structure as per previous versions of LiveTraffic.
Definition LTAPI.h:570
constexpr size_t LTAPIBulkData_v120
Size of original bulk structure as per LiveTraffic v1.20.
Definition LTAPI.h:553
std::shared_ptr< LTAPIAircraft > SPtrLTAPIAircraft
Smart pointer to an LTAPIAircraft object.
Definition LTAPI.h:48
constexpr size_t LTAPIBulkData_v440
Size of current bulk structure.
Definition LTAPI.h:562
constexpr size_t LTAPIBulkInfoTexts_v240
Size of current bulk info structure.
Definition LTAPI.h:573
constexpr size_t LTAPIBulkInfoTexts_v122
Definition LTAPI.h:571
Represents one aircraft as controlled by LiveTraffic.
Definition LTAPI.h:57
std::string getKey() const
Unique key for this aircraft, usually ICAO transponder hex code.
Definition LTAPI.h:256
float getPitch() const
[°] pitch: positive up
Definition LTAPI.h:285
float getFlaps() const
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:295
bool isOnGnd() const
Is plane on ground?
Definition LTAPI.h:290
LTFlightPhase getPhase() const
flight phase
Definition LTAPI.h:291
std::string getPhaseStr() const
flight phase as string
std::string getDestination() const
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:274
double getLocalGndSpeed_kn() const
[kn] Approximate ground speed based on local coordinates
Definition LTAPI.h:319
void resetUpdated()
Helper in update loop, resets bUpdated flag.
Definition LTAPI.h:243
std::string getOpIcao() const
ICAO-code of operator like "DLH".
Definition LTAPI.h:263
const char * getTrspModeTxt() const
Transponder mode text, like "off", "Mode C", "Mode S TARA".
float getTrack() const
[°] track over ground
Definition LTAPI.h:283
LTAPIBulkInfoTexts info
textual plane's data
Definition LTAPI.h:218
void getLocalCoord(double &x, double &y, double &z) const
Local coordinates (coverted from lat/lon/alt in older versions)
LTLights getLights() const
all plane's lights
Definition LTAPI.h:298
void setCameraAc()
Declare the aircraft the one under the camera (e.g. if your plugin is a camera plugin and now views t...
std::string getOrigin() const
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:273
std::string getMan() const
human-readable manufacturer like "Airbus"
Definition LTAPI.h:264
double getLon() const
[°] longitude
Definition LTAPI.h:280
float getTerrainFt() const
[ft] terrain altitude beneath plane
Definition LTAPI.h:288
bool isVisible() const
aircraft visible?
Definition LTAPI.h:293
std::string getTrackedBy() const
name of channel deliverying the underlying tracking data
Definition LTAPI.h:275
std::string getModel() const
human-readable a/c model like "A321-231"
Definition LTAPI.h:265
virtual void toggleCamera(bool bCameraActive, SPtrLTAPIAircraft spPrevAc)
Called when LiveTraffic toggles its aircraft camera, override in your class to handle event.
Definition LTAPI.h:248
std::string getFlightNumber() const
flight number like "LH1113"
Definition LTAPI.h:272
virtual bool updateAircraft(const LTAPIBulkData &__bulk, size_t __inSize)
Updates the aircraft with fresh numerical values, called from LTAPIConnect::UpdateAcList()
std::string getSquawk() const
squawk code (as text) like "1000"
Definition LTAPI.h:271
float getReversers() const
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:297
LTFlightPhase
Flight phase, definition copied from LiveTraffic.
Definition LTAPI.h:68
@ FPH_TAXI
Taxiing.
Definition LTAPI.h:71
@ FPH_LIFT_OFF
Lift-off, until "gear-up" height.
Definition LTAPI.h:75
@ FPH_STOPPED_ON_RWY
Stopped on runway because ran out of tracking data, plane will disappear soon.
Definition LTAPI.h:86
@ FPH_DESCEND
Descend, more then 100ft/min descend.
Definition LTAPI.h:79
@ FPH_FLARE
Flare, when reaching "flare " height.
Definition LTAPI.h:83
@ FPH_TOUCH_DOWN
The one cycle when plane touches down, don't rely on catching it...it's really one cycle only.
Definition LTAPI.h:84
@ FPH_ROTATE
Rotating.
Definition LTAPI.h:74
@ FPH_FINAL
Final, below "gear-down" height.
Definition LTAPI.h:81
@ FPH_CRUISE
Cruising, no altitude change.
Definition LTAPI.h:78
@ FPH_UNKNOWN
used for initializations
Definition LTAPI.h:69
@ FPH_ROLL_OUT
Roll-out after touch-down until reaching taxi speed or stopping.
Definition LTAPI.h:85
@ FPH_APPROACH
Approach, below "flaps-down" height.
Definition LTAPI.h:80
@ FPH_INITIAL_CLIMB
Initial climb, until "flaps-up" height.
Definition LTAPI.h:76
@ FPH_TAKE_OFF
Group of status for take-off:
Definition LTAPI.h:72
@ FPH_CLIMB
Regular climbout.
Definition LTAPI.h:77
@ FPH_PARKED
Parked at startup position.
Definition LTAPI.h:70
@ FPH_TO_ROLL
Take-off roll.
Definition LTAPI.h:73
@ FPH_LANDING
Group of status for landing:
Definition LTAPI.h:82
float getHeightFt() const
[ft] height AGL
Definition LTAPI.h:289
std::string getModelIcao() const
ICAO aircraft type like "A321".
Definition LTAPI.h:260
float getGear() const
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:296
bool isUpdated() const
Helper in update loop to detected removed aircrafts.
Definition LTAPI.h:241
std::string getCslModel() const
name of CSL model used for actual rendering of plane
Definition LTAPI.h:268
std::string getCatDescr() const
human-readable category description
Definition LTAPI.h:266
virtual ~LTAPIAircraft()
double getLocalGndSpeed_ms() const
[m/s] Approximate ground speed based on local coordinates
Definition LTAPI.h:317
int getMultiIdx() const
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:303
std::string getAcClass() const
a/c class like "L2J"
Definition LTAPI.h:261
std::string getDescription() const
some reasonable descriptive string formed from the above, like an identifier, type,...
virtual bool updateAircraft(const LTAPIBulkInfoTexts &__info, size_t __inSize)
Updates the aircraft with fresh textual information, called from LTAPIConnect::UpdateAcList()
LTAPIBulkData bulk
numerical plane's data
Definition LTAPI.h:217
double getLat() const
[°] latitude
Definition LTAPI.h:279
XPMPTransponderMode getTrspMode() const
< Transponder mode, like off, Mode_C, Mode_S_TARA
Definition LTAPI.h:304
bool bUpdated
update helper, gets reset before updates, set during updates, stays false if not updated
Definition LTAPI.h:221
static LTAPIAircraft * CreateNewObject()
Standard object creation callback.
Definition LTAPI.h:333
std::string getCallSign() const
call sign like "DLH56C"
Definition LTAPI.h:270
XPMPTransponderMode
These enumerations define the way the transponder of a given plane is operating.
Definition LTAPI.h:92
@ xpmpTransponderMode_ModeC
transponder is on, Mode C (Alt)
Definition LTAPI.h:96
@ xpmpTransponderMode_ModeS_Gnd
transponder is on, Mode S (Gnd)
Definition LTAPI.h:98
@ xpmpTransponderMode_ModeA
transponder is on, Mode A
Definition LTAPI.h:95
@ xpmpTransponderMode_Standby
transponder is in standby, not currently sending -> aircraft not visible on TCAS
Definition LTAPI.h:94
@ xpmpTransponderMode_ModeS_TARA
transponder is on, Mode S (TA/RA)
Definition LTAPI.h:100
@ xpmpTransponderMode_ModeS_TAOnly
transponder is on, Mode S (TA-Only)
Definition LTAPI.h:99
@ xpmpTransponderMode_Test
transponder is on, Test
Definition LTAPI.h:97
@ xpmpTransponderMode_Off
transponder is off not currently sending -> aircraft not visible on TCAS
Definition LTAPI.h:93
std::string getRegistration() const
tail number like "D-AISD"
Definition LTAPI.h:258
float getVSIft() const
[ft/minute] vertical speed, positive up
Definition LTAPI.h:287
void getLocalVelocities(double &v_x, double &v_y, double &v_z) const
lat/lon/alt converted to local coordinates
Definition LTAPI.h:313
float getBearing() const
[°] to current camera position
Definition LTAPI.h:301
float getDistNm() const
[nm] distance to current camera
Definition LTAPI.h:302
float getRoll() const
[°] roll: positive right
Definition LTAPI.h:284
std::string getWtc() const
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:262
double getAltFt() const
[ft] altitude
Definition LTAPI.h:281
bool isOnCamera() const
is currently seen on LiveTraffic's internal camera view?
Definition LTAPI.h:299
float getSpeedKn() const
[kt] ground speed
Definition LTAPI.h:286
std::string getOp() const
human-readable operator like "Lufthansa"
Definition LTAPI.h:267
float getHeading() const
[°] heading
Definition LTAPI.h:282
Connects to LiveTraffic's dataRefs and returns aircraft information.
Definition LTAPI.h:362
fCreateAcObject * pfCreateAcObject
Pointer to callback function returning new aircraft objects.
Definition LTAPI.h:390
const MapLTAPIAircraft & getAcMap() const
Returns the map of aircraft as it currently stands.
Definition LTAPI.h:464
static int getLTNumAc()
How many aircraft does LiveTraffic display right now?
bool DoBulkFetch(int numAc, LTDataRef &DR, int &outSizeLT, std::unique_ptr< T[]> &vBulk)
fetch bulk data and create/update aircraft objects
std::unique_ptr< LTAPIAircraft::LTAPIBulkInfoTexts[]> vInfoTexts
bulk info text array for communication with LT
Definition LTAPI.h:386
std::chrono::seconds sPeriodExpsv
Definition LTAPI.h:378
MapLTAPIAircraft mapAc
THE map of aircrafts.
Definition LTAPI.h:393
static int getLTVerDate()
LiveTraffic's version date.
SPtrLTAPIAircraft getAcInCameraView() const
Returns the aircraft being viewed in LiveTraffic's camera view, if any.
static void CameraSharedDataCB(LTAPIConnect *me)
shared DataRef event notification
std::unique_ptr< LTAPIAircraft::LTAPIBulkData[]> vBulkNum
bulk data array for communication with LT
Definition LTAPI.h:384
LTAPIAircraft * fCreateAcObject()
Callback function type passed in to LTAPIConnect()
Definition LTAPI.h:373
static bool doesLTControlAI()
Does LiveTaffic control AI planes?
static bool doesLTDisplayAc()
Does LiveTraffic display aircrafts? (Is it activated?)
virtual ~LTAPIConnect()
static std::chrono::system_clock::time_point getLTSimTimePoint()
What is current simulated time in LiveTraffic (usually 'now' minus buffering period)?
static int getLTVerNr()
LiveTraffic's version number.
static time_t getLTSimTime()
What is current simulated time in LiveTraffic (usually 'now' minus buffering period)?
static bool isLTAvail()
Is LiveTraffic available? (checks via XPLMFindPluginBySignature)
LTAPIConnect(fCreateAcObject *_pfCreateAcObject=LTAPIAircraft::CreateNewObject, int numBulkAc=50)
Constructor.
const int iBulkAc
Number of aircraft to fetch in one bulk operation.
Definition LTAPI.h:382
SPtrLTAPIAircraft getAcByMultIdx(int multiIdx) const
Finds an aircraft for a given multiplayer slot.
void clearCameraInfo()
Clear camera information, ie. delcare that no aircraft is currently being viewed.
std::chrono::time_point< std::chrono::steady_clock > lastExpsvFetch
Last fetching of expensive data.
Definition LTAPI.h:396
const MapLTAPIAircraft & UpdateAcList(ListLTAPIAircraft *plistRemovedAc=nullptr)
Main function: updates map of aircrafts and returns reference to it.
Represents a dataRef and covers late binding.
Definition LTAPI.h:504
XPLMDataTypeID dataTypes
supported data types
Definition LTAPI.h:508
int getData(void *pOut, int inOffset, int inMaxBytes)
Gets dataRef's binary data.
bool hasFloat() const
Is float a supported dataRef type?
Definition LTAPI.h:524
static constexpr XPLMDataTypeID usefulTypes
Defines which types to work with to become valid
Definition LTAPI.h:526
void set(float f)
Writes a float vlue to the dataRef.
LTDataRef(std::string _sDataRef)
Constructor, set the dataRef's name.
bool hasInt() const
Is int a supported dataRef type?
Definition LTAPI.h:522
bool FindDataRef()
Finds the dataRef (and would try again and again, no matter what bValid says)
XPLMDataRef dataRef
dataRef identifier returned by X-Plane
Definition LTAPI.h:507
bool bValid
does this object have a valid binding to a dataRef already?
Definition LTAPI.h:509
XPLMDataTypeID getDataRefTypes() const
Get types supported by the dataRef.
Definition LTAPI.h:520
void set(int i)
Writes an integer value to the dataRef.
bool needsInit() const
Definition LTAPI.h:512
int getInt()
Get dataRef's integer value. Silently returns 0 if dataRef doesn't exist.
std::string sDataRef
dataRef name, passed in via constructor
Definition LTAPI.h:506
bool isValid()
Found the dataRef and it contains formats we can work with?
bool getBool()
Gets dataRef's integer value and returns if it is not zero.
Definition LTAPI.h:536
float getFloat()
Get dataRef's float value. Silently returns 0.0f if dataRef doesn't exist.
Bulk data transfer structur for communication with LTAPI.
Definition LTAPI.h:107
LTFlightPhase phase
flight phase, see LTAircraft::FlightPhase
Definition LTAPI.h:132
unsigned hidden
aircraft not visible? (remains an 'unsigned' for backward compatibility)
Definition LTAPI.h:140
float alt_ft_f
deprecated: [ft] altitude
Definition LTAPI.h:114
float track
[°] track over ground
Definition LTAPI.h:116
float gear
gear position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:125
float terrainAlt_ft
[ft] terrain altitude beneath plane
Definition LTAPI.h:121
float pitch
[°] pitch: positive up
Definition LTAPI.h:118
float lat_f
deprecated: [°] latitude
Definition LTAPI.h:112
double lat
[°] latitude
Definition LTAPI.h:152
double v_z
[m/s] Cartesian velocity in Z direction
Definition LTAPI.h:164
double x
local Cartesian X coordinate (NAN indicates to delivered by master, e.g. because older version)
Definition LTAPI.h:158
float reversers
reversers position: 0.0 closed, 1.0 fully opened
Definition LTAPI.h:126
unsigned filler2
Definition LTAPI.h:147
float height_ft
[ft] height AGL
Definition LTAPI.h:122
double z
local Cartesian Z coordinate
Definition LTAPI.h:160
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:110
float speed_kt
[kt] ground speed
Definition LTAPI.h:119
float flaps
flap position: 0.0 retracted, 1.0 fully extended
Definition LTAPI.h:124
LTAPIBulkData()
Constructor initializes some data without defaults.
Definition LTAPI.h:167
float heading
[°] heading
Definition LTAPI.h:115
bool camera
is LiveTraffic's camera on this aircraft?
Definition LTAPI.h:141
double v_x
[m/s] Cartesian velocity in X direction
Definition LTAPI.h:162
bool strb
strobe light
Definition LTAPI.h:138
unsigned trspMode
Transponder mode, see enum XPMPTransponderMode (filled only as of LT 4.4.0)
Definition LTAPI.h:145
float vsi_ft
[ft/minute] vertical speed, positive up
Definition LTAPI.h:120
double alt_ft
[ft] altitude
Definition LTAPI.h:154
float lon_f
deprecated: [°] longitude
Definition LTAPI.h:113
bool taxi
taxi lights
Definition LTAPI.h:135
struct LTAPIAircraft::LTAPIBulkData::BulkBitsTy bits
Flights phase, on-ground status, lights.
bool land
landing lights
Definition LTAPI.h:136
bool nav
navigaton lights
Definition LTAPI.h:139
int multiIdx
multiplayer index if plane reported via sim/multiplayer/position dataRefs, 0 if not
Definition LTAPI.h:143
double v_y
[m/s] Cartesian velocity in Y direction
Definition LTAPI.h:163
float bearing
[°] to current camera position
Definition LTAPI.h:128
float dist_nm
[nm] distance to current camera
Definition LTAPI.h:129
unsigned filler3
Definition LTAPI.h:148
float roll
[°] roll: positive right
Definition LTAPI.h:117
bool bcn
beacon light
Definition LTAPI.h:137
bool onGnd
Is plane on ground?
Definition LTAPI.h:133
double y
local Cartesian Y coordinate
Definition LTAPI.h:159
double lon
[°] longitude
Definition LTAPI.h:153
Bulk text transfer structur for communication with LTAPI.
Definition LTAPI.h:173
char wtc[4]
wake turbulence category like H,M,L/M,L
Definition LTAPI.h:181
char catDescr[40]
human-readable category description
Definition LTAPI.h:185
char callSign[8]
call sign like "DLH56C"
Definition LTAPI.h:188
char squawk[8]
squawk code (as text) like "1000"
Definition LTAPI.h:189
LTAPIBulkInfoTexts()
Constructor initializes all data with zeroes.
Definition LTAPI.h:199
uint64_t keyNum
a/c id, usually transp hex code, or any other unique id (FLARM etc.)
Definition LTAPI.h:176
char opIcao[8]
ICAO-code of operator like "DLH".
Definition LTAPI.h:182
char op[40]
human-readable operator like "Lufthansa"
Definition LTAPI.h:186
char modelIcao[8]
ICAO aircraft type like "A321".
Definition LTAPI.h:179
char flightNumber[8]
flight number like "LH1113"
Definition LTAPI.h:190
char origin[8]
origin airport (IATA or ICAO) like "MAD" or "LEMD"
Definition LTAPI.h:191
char registration[8]
tail number like "D-AISD"
Definition LTAPI.h:177
char cslModel[40]
name of CSL model used for actual rendering of plane
Definition LTAPI.h:196
char man[40]
human-readable manufacturer like "Airbus"
Definition LTAPI.h:183
char trackedBy[24]
name of channel deliverying the underlying tracking data
Definition LTAPI.h:193
char destination[8]
destination airport (IATA or ICAO) like "FRA" or "EDDF"
Definition LTAPI.h:192
char acClass[4]
a/c class like "L2J"
Definition LTAPI.h:180
char model[40]
human-readable a/c model like "A321-231"
Definition LTAPI.h:184
Structure to return plane's lights status.
Definition LTAPI.h:204
bool nav
navigaton lights
Definition LTAPI.h:207
LTLights(const LTAPIBulkData::BulkBitsTy b)
Type conversion constructor.
Definition LTAPI.h:212
bool strobe
strobe light
Definition LTAPI.h:206
bool beacon
beacon light
Definition LTAPI.h:205
bool landing
landing lights
Definition LTAPI.h:208
bool taxi
taxi lights
Definition LTAPI.h:209