DataRefs
DataRefs offered to change configuration or read current aircraft's parameters
LiveTraffic makes good use of X-Plane's data ref feature. Historically, this was just meant to ease my development life as I could use the DataRefEditor plugin (or in XP11 also the DataRefTool) to change the configuration and read aircraft' status. Thus, it became the backbone of the configuration object in LiveTraffic and remains available to the outside world.
There is issue 86, planned for v1.20, to provide an actual access API, which would encapsulate all these dataRefs in a nice C++ interface and just return a std::vector
of all planes.
livetraffic/ac
includes information on one aircraft like position, heading, speed, flight phase... The aircraft is selected by writing the ICAO hex transponder code, converted to decimal, tolivetraffic/ac/key
or by writing an index number (1 through the number of currently displayed aircraft) to the samelivetraffic/ac/key
.livetraffic/sim/date
andlivetraffic/sim/time
provide the current simulated date/time. LiveTraffic's date/time might differ from X-Plane's: You can always use live flight data even if you have set X-Plane to some other day of the year (thenlivetraffic/sim
is current ime) or you can even write to these data refs and actively set X-Plane to the set date while using historical flight data for displaying traffic.livetraffic/cfg
includes most of the configuration options.livetraffic/channel
allows to enable/disable the various flight data channels.livetraffic/dbg
provides debugging options like filter the entire network traffic for one specific aircraft, providing additional log output on the selected aircraft or debugging libxplanemp's model matching.
Nowadays, all configuration and channel enable/disable options are also available in a settings GUI accessible from the plugin's menu and saved into a configuration file. The settings GUI and the config file code essentially just read and write data refs.
TODOs
Last updated