|
swift
|
xswiftbus service object which is accessible through DBus More...
#include <service.h>
Public Member Functions | |
| CService (CSettingsProvider *settingsProvider) | |
| Constructor. | |
| virtual | ~CService () |
| Destructor. | |
| void | onAircraftModelChanged () |
| Called by XPluginReceiveMessage when the model changes. | |
| void | onSceneryLoaded () |
| Called by XPluginReceiveMessage when some scenery is loaded. | |
| void | addTextMessage (const std::string &text, double red, double green, double blue) |
| Add a text message to the on-screen display, with RGB components in the range [0,1]. | |
| std::string | getAircraftLivery () const |
| Get current aircraft livery. | |
| std::string | getAircraftIcaoCode () const |
| Get the ICAO code of the current aircraft model. | |
| std::string | getAircraftDescription () const |
| Get the description of the current aircraft model. | |
| bool | isPaused () const |
| True if sim is paused. | |
| bool | isUsingRealTime () const |
| True if sim time is tracking operating system time. | |
| std::tuple< double, double, double, double > | getFrameStats () |
| Frames-per-second, averaged over the last 500 frames, or since this function was last called, whichever is later. Second part is the average simulation time ratio during the same period. Third part is the total track miles over-reported during the same period. Fourth part is the total minutes behind scedule during the same period. | |
| void | resetFrameTotals () |
| Reset the monitoring of total miles and minutes lost due to low frame rate. | |
| void | setFlightNetworkConnected (bool connected) |
| Set the current connection state. | |
| void | setOwnCallsign (const std::string &callsign) |
| Set the current own callsign. | |
| double | getLatitudeDeg () const |
| Get aircraft latitude in degrees. | |
| double | getLongitudeDeg () const |
| Get aircraft longitude in degrees. | |
| double | getAltitudeMslM () const |
| Get aircraft altitude in meters. | |
| double | getPressureAltitudeFt () const |
| Get aircraft pressure altitude in feet in standard atmosphere in X-Plane 12. NaN in earlier versions of X-Plane. | |
| double | getHeightAglM () const |
| Get aircraft height in meters. | |
| double | getGroundSpeedMps () const |
| Get aircraft groundspeed in meters per second. | |
| double | getIndicatedAirspeedKias () const |
| Get aircraft IAS in knots. | |
| double | getTrueAirspeedKias () const |
| Get aircraft TAS in meters per second. | |
| double | getPitchDeg () const |
| Get aircraft pitch in degrees above horizon. | |
| double | getRollDeg () const |
| Get aircraft roll in degrees. | |
| double | getTrueHeadingDeg () const |
| Get aircraft true heading in degrees. | |
| bool | getAnyWheelOnGround () const |
| Get whether any wheel is on the ground. | |
| bool | getAllWheelsOnGround () const |
| Get whether all wheels are on the ground. | |
| double | getGroundElevation () const |
| Get elevation of ground under the plane in meters. | |
| int | getCom1ActiveKhz () const |
| Get the current COM1 active frequency in kHz. | |
| int | getCom1StandbyKhz () const |
| Get the current COM1 standby frequency in kHz. | |
| bool | getCom1Power () const |
| Get the COM1 power on/off. | |
| bool | getCom1Listening () const |
| Get the COM1 listening yes/no. | |
| float | getCom1Volume () const |
| Get the COM1 volume 0..1. | |
| bool | isCom1Receiving () const |
| Is COM1 receiving? | |
| bool | isCom1Transmitting () const |
| Is COM1 transmitting? | |
| int | getCom2ActiveKhz () const |
| Get the current COM2 active frequency in kHz. | |
| int | getCom2StandbyKhz () const |
| Get the current COM2 standby frequency in kHz. | |
| bool | getCom2Power () const |
| Get the COM2 power on/off. | |
| bool | getCom2Listening () const |
| Get the COM2 listening yes/no. | |
| float | getCom2Volume () const |
| Get the COM2 volume 0..1. | |
| bool | isCom2Receiving () const |
| Is COM2 receiving? | |
| bool | isCom2Transmitting () const |
| Is COM2 transmitting? | |
| int | getTransponderCode () const |
| Get the current transponder code in decimal. | |
| int | getTransponderMode () const |
| Get the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby, >1 active). | |
| bool | getTransponderIdent () const |
| Get whether we are currently squawking ident. | |
| bool | getBeaconLightsOn () const |
| Get whether beacon lights are on. | |
| bool | getLandingLightsOn () const |
| Get whether landing lights are on. | |
| bool | getNavLightsOn () const |
| Get whether nav lights are on. | |
| bool | getStrobeLightsOn () const |
| Get whether strobe lights are on. | |
| bool | getTaxiLightsOn () const |
| Get whether taxi lights are on. | |
| double | getQNHInHg () const |
| Get barometric pressure at sea level in inches of mercury. | |
| void | setCom1ActiveKhz (int freq) |
| Set the current COM1 active frequency in kHz. | |
| void | setCom1StandbyKhz (int freq) |
| Set the current COM1 standby frequency in kHz. | |
| void | setCom2ActiveKhz (int freq) |
| Set the current COM2 active frequency in kHz. | |
| void | setCom2StandbyKhz (int freq) |
| Set the current COM2 standby frequency in kHz. | |
| void | setTransponderCode (int code) |
| Set the current transponder code in decimal. | |
| void | setTransponderMode (int mode) |
| Set the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby, >1 active). | |
| double | getFlapsDeployRatio () const |
| Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended. | |
| double | getGearDeployRatio () const |
| Get gear deploy ratio, where 0 is up and 1 is down. | |
| int | getNumberOfEngines () const |
| Get the number of engines of current aircraft. | |
| std::vector< double > | getEngineN1Percentage () const |
| Get the N1 speed as percent of max (per engine). | |
| double | getSpeedBrakeRatio () const |
| Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted, and 1.0 is fully extended). | |
| void | toggleMessageBoxVisibility () |
| Toggles the visibility of the message box. | |
| void | setPopupMessageWindow (bool enabled) |
| Enable/disable message window popping up for new messages. | |
| void | setDisappearMessageWindow (bool enabled) |
| Enable/disable message window disappearing again after x ms. | |
| void | setDisappearMessageWindowTimeMs (int durationMs) |
| Enable/disable message window disappearing after x ms. | |
| std::string | getSettingsJson () const |
| Get settings in JSON format. | |
| void | setSettingsJson (const std::string &jsonString) |
| Set settings. | |
| int | process () |
| Perform generic processing. | |
| double | getLocalXVelocityMps () const |
| Get aircraft local velocity in world coordinates meters per second. | |
| double | getLocalYVelocityMps () const |
| Get aircraft local velocity in world coordinates meters per second. | |
| double | getLocalZVelocityMps () const |
| Get aircraft local velocity in world coordinates meters per second. | |
| double | getPitchRadPerSec () const |
| Get aircraft angular velocity in radians per second. | |
| double | getRollRadPerSec () const |
| Get aircraft angular velocity in radians per second. | |
| double | getHeadingRadPerSec () const |
| Get aircraft angular velocity in radians per second. | |
| int | getComSelection () const |
| COM Selection 6/7. | |
| bool | isCom1Selected () const |
| COM Selection 6/7. | |
| bool | isCom2Selected () const |
| COM Selection 6/7. | |
| 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. | |
| void | registerDBusObjectPath (const std::string &interfaceName, const std::string &objectPath) |
| Register itself with interfaceName and objectPath. | |
Static Public Member Functions | |
| static const std::string & | InterfaceName () |
| DBus interface name. | |
| static const std::string & | ObjectPath () |
| DBus object path. | |
| static std::string | getVersionNumber () |
| Returns the xswiftbus version number. | |
| static std::string | getCommitHash () |
| Returns the SHA1 of the last commit that could influence xswiftbus. | |
| static std::string | getAircraftModelPath () |
| Get full path to current aircraft model. | |
| static std::string | getAircraftModelFilename () |
| Get base filename of current aircraft model. | |
| static std::string | getAircraftModelString () |
| Get canonical swift model string of current aircraft model. | |
| static std::string | getAircraftName () |
| Get name of current aircraft model. | |
| static int | getXPlaneVersionMajor () |
| Get major version number. | |
| static int | getXPlaneVersionMinor () |
| Get minor version number. | |
| static std::string | getXPlaneInstallationPath () |
| Get root of X-Plane install path. | |
| static std::string | getXPlanePreferencesPath () |
| Get full path to X-Plane preferences file. | |
Protected Member Functions | |
| DBusHandlerResult | dbusMessageHandler (const CDBusMessage &message) |
| DBus message handler. | |
| Protected Member Functions inherited from XSwiftBus::CDBusObject | |
| virtual void | dbusConnectedHandler () |
| Handler which is called when DBusCconnection is established. | |
| virtual void | dbusDisconnectedHandler () |
| Handler which is called when DBusConnection disconnected. | |
| 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. | |
| void | setSettings (const CSettings &settings) |
| Set settings. | |
| const CConfig & | getConfig () const |
| Get settings from xswiftbus.conf (needed during plugin initialization). | |
| bool | writeConfig (bool tcas, bool debug) |
| Write a config file with these new values. | |
| XSwiftBus::CService::CService | ( | CSettingsProvider * | settingsProvider | ) |
Constructor.
Definition at line 100 of file service.cpp.
| void XSwiftBus::CService::addTextMessage | ( | const std::string & | text, |
| double | red, | ||
| double | green, | ||
| double | blue ) |
Add a text message to the on-screen display, with RGB components in the range [0,1].
Definition at line 157 of file service.cpp.
|
protectedvirtual |
DBus message handler.
Implements XSwiftBus::CDBusObject.
Definition at line 568 of file service.cpp.
|
inline |
|
inline |
| std::string XSwiftBus::CService::getAircraftLivery | ( | ) | const |
Get current aircraft livery.
Definition at line 234 of file service.cpp.
|
static |
Get base filename of current aircraft model.
Definition at line 208 of file service.cpp.
|
static |
Get full path to current aircraft model.
Definition at line 200 of file service.cpp.
|
static |
Get canonical swift model string of current aircraft model.
Definition at line 216 of file service.cpp.
|
static |
Get name of current aircraft model.
Definition at line 225 of file service.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Returns the SHA1 of the last commit that could influence xswiftbus.
Definition at line 131 of file service.cpp.
|
inline |
|
inline |
|
inline |
| std::tuple< double, double, double, double > XSwiftBus::CService::getFrameStats | ( | ) |
Frames-per-second, averaged over the last 500 frames, or since this function was last called, whichever is later. Second part is the average simulation time ratio during the same period. Third part is the total track miles over-reported during the same period. Fourth part is the total minutes behind scedule during the same period.
Definition at line 133 of file service.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| std::string XSwiftBus::CService::getSettingsJson | ( | ) | const |
Get settings in JSON format.
Definition at line 285 of file service.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Returns the xswiftbus version number.
Definition at line 129 of file service.cpp.
|
static |
Get root of X-Plane install path.
Definition at line 269 of file service.cpp.
|
static |
Get full path to X-Plane preferences file.
Definition at line 276 of file service.cpp.
|
static |
Get major version number.
Definition at line 247 of file service.cpp.
|
static |
Get minor version number.
Definition at line 258 of file service.cpp.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
| void XSwiftBus::CService::onAircraftModelChanged | ( | ) |
Called by XPluginReceiveMessage when the model changes.
Definition at line 112 of file service.cpp.
| void XSwiftBus::CService::onSceneryLoaded | ( | ) |
Called by XPluginReceiveMessage when some scenery is loaded.
Definition at line 127 of file service.cpp.
| int XSwiftBus::CService::process | ( | ) |
Perform generic processing.
Definition at line 1081 of file service.cpp.
| void XSwiftBus::CService::resetFrameTotals | ( | ) |
Reset the monitoring of total miles and minutes lost due to low frame rate.
Definition at line 144 of file service.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void XSwiftBus::CService::setDisappearMessageWindowTimeMs | ( | int | durationMs | ) |
Enable/disable message window disappearing after x ms.
Definition at line 283 of file service.cpp.
| void XSwiftBus::CService::setFlightNetworkConnected | ( | bool | connected | ) |
Set the current connection state.
Definition at line 153 of file service.cpp.
| void XSwiftBus::CService::setOwnCallsign | ( | const std::string & | callsign | ) |
Set the current own callsign.
Definition at line 155 of file service.cpp.
|
inline |
| void XSwiftBus::CService::setSettingsJson | ( | const std::string & | jsonString | ) |
Set settings.
Definition at line 287 of file service.cpp.
|
inline |
|
inline |
|
inline |