swift
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
XSwiftBus::CTraffic Class Reference

xswiftbus service object for traffic aircraft which is accessible through DBus More...

Inheritance diagram for XSwiftBus::CTraffic:
[legend]

Public Member Functions

 CTraffic (CSettingsProvider *settingsProvider)
 Constructor.
 
virtual ~CTraffic ()
 Destructor.
 
void setPlaneViewMenu (const CMenu &planeViewSubMenu)
 Set plane view submenu.
 
bool initialize ()
 Initialize the multiplayer planes rendering and return true if successful.
 
bool acquireMultiplayerPlanes (std::string *owner=nullptr)
 Returns whether multiplayer planes have been acquired. If not, owner will be set to the plugin that acquired it.
 
void cleanup ()
 Reverse the actions of initialize().
 
std::string loadPlanesPackage (const std::string &path)
 Load a collection of planes from the given directory and return error message if unsuccessful.
 
void setDefaultIcao (const std::string &defaultIcao)
 Set the ICAO code to use for aircraft without a model match.
 
void setDrawingLabels (bool drawing, int rgb=-1)
 Set whether the plugin draws type and callsign labels above aircraft.
 
bool isDrawingLabels () const
 Get whether the plugin draws type and callsign labels above aircraft.
 
void setMaxPlanes (int planes)
 Set the maximum number of aircraft.
 
void setMaxDrawDistance (double nauticalMiles)
 Set the maximum distance at which to draw aircraft (nautical miles).
 
void addPlane (const std::string &callsign, const std::string &modelName, const std::string &aircraftIcao, const std::string &airlineIcao, const std::string &livery)
 Introduce a new traffic aircraft.
 
void removePlane (const std::string &callsign)
 Remove a traffic aircraft.
 
void removeAllPlanes ()
 Remove all traffic aircraft.
 
void setPlanesPositions (const std::vector< std::string > &callsigns, std::vector< double > latitudesDeg, std::vector< double > longitudesDeg, std::vector< double > altitudesFt, std::vector< double > pitchesDeg, std::vector< double > rollsDeg, std::vector< double > headingsDeg, const std::vector< bool > &onGrounds)
 Set the position of multiple traffic aircrafts.
 
void setPlanesSurfaces (const std::vector< std::string > &callsigns, const std::vector< double > &gears, const std::vector< double > &flaps, const std::vector< double > &spoilers, const std::vector< double > &speedBrakes, const std::vector< double > &slats, const std::vector< double > &wingSweeps, const std::vector< double > &thrusts, const std::vector< double > &elevators, const std::vector< double > &rudders, const std::vector< double > &ailerons, const std::vector< bool > &landLights, const std::vector< bool > &taxiLights, const std::vector< bool > &beaconLights, const std::vector< bool > &strobeLights, const std::vector< bool > &navLights, const std::vector< int > &lightPatterns)
 Set the flight control surfaces and lights of multiple traffic aircrafts.
 
void setPlanesTransponders (const std::vector< std::string > &callsigns, const std::vector< int > &codes, const std::vector< bool > &modeCs, const std::vector< bool > &idents)
 Set the transponder of multiple traffic aircraft.
 
void getRemoteAircraftData (std::vector< std::string > &callsigns, std::vector< double > &latitudesDeg, std::vector< double > &longitudesDeg, std::vector< double > &elevationsM, std::vector< bool > &waterFlags, std::vector< double > &verticalOffsets) const
 Get remote aircrafts data (lat, lon, elevation and CG)
 
std::array< double, 3 > getElevationAtPosition (const std::string &callsign, double latitudeDeg, double longitudeDeg, double altitudeMeters, bool &o_isWater) const
 Get the ground elevation at an arbitrary position.
 
void setFollowedAircraft (const std::string &callsign)
 Sets the aircraft with callsign to be followed in plane view.
 
int process ()
 Perform generic processing.
 
- Public Member Functions inherited from XSwiftBus::CDBusObject
 CDBusObject (CSettingsProvider *settingsProvider)
 Constructor.
 
virtual ~CDBusObject ()
 Destructor.
 
void setDBusConnection (const std::shared_ptr< CDBusConnection > &dbusConnection)
 Set the assigned DBus connection. More...
 
void registerDBusObjectPath (const std::string &interfaceName, const std::string &objectPath)
 Register itself with interfaceName and objectPath. More...
 

Static Public Member Functions

static const std::string & InterfaceName ()
 DBus interface name.
 
static const std::string & ObjectPath ()
 DBus object path.
 
static const std::string & ownAircraftString ()
 Returns the own aircraft string to be used as callsign for setFollowedAircraft()
 

Protected Member Functions

virtual void dbusDisconnectedHandler ()
 Handler.
 
DBusHandlerResult dbusMessageHandler (const CDBusMessage &message)
 Handler.
 
- Protected Member Functions inherited from XSwiftBus::CDBusObject
virtual void dbusConnectedHandler ()
 Handler which is called when DBusCconnection is established.
 
void sendDBusSignal (const std::string &name)
 Send DBus signal.
 
void sendDBusMessage (const CDBusMessage &message)
 Send DBus message.
 
void maybeSendEmptyDBusReply (bool wantsReply, const std::string &destination, dbus_uint32_t serial)
 Maybe sends an empty DBus reply (acknowledgement)
 
template<typename T >
void sendDBusReply (const std::string &destination, dbus_uint32_t serial, const T &argument)
 Send DBus reply.
 
template<typename T >
void sendDBusReply (const std::string &destination, dbus_uint32_t serial, const std::vector< T > &array)
 Send DBus reply.
 
void queueDBusCall (const std::function< void()> &func)
 Queue a DBus call to be executed in a different thread.
 
void invokeQueuedDBusCalls ()
 Invoke all pending DBus calls. They will be executed in the calling thread.
 
- Protected Member Functions inherited from XSwiftBus::CSettingsAware
 CSettingsAware (CSettingsProvider *provider)
 Constructor.
 
 ~CSettingsAware ()=default
 Destructor.
 
CSettings getSettings () const
 Get settings. More...
 
void setSettings (const CSettings &settings)
 Set settings. More...
 
const CConfiggetConfig () const
 Get settings from xswiftbus.conf (needed during plugin initialization) More...
 
bool writeConfig (bool tcas, bool debug)
 Write a config file with these new values. More...
 

Detailed Description

xswiftbus service object for traffic aircraft which is accessible through DBus

Definition at line 34 of file traffic.h.


The documentation for this class was generated from the following file: