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

xswiftbus service object which is accessible through DBus More...

Inheritance diagram for XSwiftBus::CService:
[legend]

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.
 
std::string getVersionNumber () const
 Returns the xswiftbus version number.
 
std::string getCommitHash () const
 Returns the SHA1 of the last commit that could influence xswiftbus.
 
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 getAircraftModelPath () const
 Get full path to current aircraft model.
 
std::string getAircraftModelFilename () const
 Get base filename of current aircraft model.
 
std::string getAircraftModelString () const
 Get canonical swift model string of current aircraft model.
 
std::string getAircraftName () const
 Get name of current aircraft model.
 
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.
 
int getXPlaneVersionMajor () const
 Get major version number.
 
int getXPlaneVersionMinor () const
 Get minor version number.
 
std::string getXPlaneInstallationPath () const
 Get root of X-Plane install path.
 
std::string getXPlanePreferencesPath () const
 Get full path to X-Plane preferences file.
 
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. More...
 
void resetFrameTotals ()
 Reset the monitoring of total miles and minutes lost due to low frame rate.
 
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. More...
 
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. 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.
 

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. 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 which is accessible through DBus

Definition at line 34 of file service.h.

Member Function Documentation

◆ getFrameStats()

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.

Returns
Zero if no samples were collected since this function was last called.

Definition at line 121 of file service.cpp.

◆ toggleMessageBoxVisibility()

void XSwiftBus::CService::toggleMessageBoxVisibility ( )
inline

Toggles the visibility of the message box.

Definition at line 306 of file service.h.


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