FlightGear next
flightgear::swift::CService Class Reference

#include <service.h>

Inherits flightgear::swift::CDBusObject.

Public Member Functions

 CService ()
 Constructor.
 
void addTextMessage (const std::string &text)
 
std::string getAircraftModelPath () const
 
std::string getAircraftModelFilename () const
 
std::string getAircraftModelString () const
 
std::string getAircraftName () const
 
std::string getAircraftLivery () const
 
std::string getAircraftIcaoCode () const
 Get the ICAO code of the current aircraft model.
 
std::string getAircraftDescription () const
 
bool isPaused () const
 True if sim is paused.
 
double getLatitude () const
 Get aircraft latitude in degrees.
 
double getLongitude () const
 Get aircraft longitude in degrees.
 
double getAltitudeMSL () const
 Get aircraft altitude in feet.
 
double getHeightAGL () const
 Get aircraft height in feet.
 
double getGroundSpeed () const
 Get aircraft groundspeed in knots.
 
double getPitch () const
 Get aircraft pitch in degrees above horizon.
 
double getRoll () const
 Get aircraft roll in degrees.
 
double getTrueHeading () const
 Get aircraft true heading in degrees.
 
bool getAllWheelsOnGround () const
 Get whether all wheels are on the ground.
 
int getCom1Active () const
 Get the current COM1 active frequency in kHz.
 
int getCom1Standby () const
 Get the current COM1 standby frequency in kHz.
 
int getCom2Active () const
 Get the current COM2 active frequency in kHz.
 
int getCom2Standby () const
 Get the current COM2 standby frequency in kHz.
 
int getTransponderCode () const
 Get the current transponder code in decimal.
 
int getTransponderMode () const
 Get the current transponder mode (depends on the aircraft, 0-2 usually mean standby, >2 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 getPressAlt () const
 Get pressure altitude in ft.
 
void setCom1Active (int freq)
 Set the current COM1 active frequency in kHz.
 
void setCom1Standby (int freq)
 Set the current COM1 standby frequency in kHz.
 
void setCom2Active (int freq)
 Set the current COM2 active frequency in kHz.
 
void setCom2Standby (int freq)
 Set the current COM2 standby frequency in kHz.
 
void setTransponderCode (int code)
 
void setTransponderMode (int mode)
 
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)
 
double getGroundElevation () const
 Get ground elevation at aircraft current position.
 
double getVelocityX () const
 Get x velocity in m/s.
 
double getVelocityY () const
 Get y velocity in m/s.
 
double getVelocityZ () const
 Get z velocity in m/s.
 
double getRollRate () const
 Get roll rate in rad/sec.
 
double getPitchRate () const
 Get pitch rate in rad/sec.
 
double getYawRate () const
 Get yaw rate in rad/sec.
 
double getCom1Volume () const
 
double getCom2Volume () const
 
int process ()
 Perform generic processing.
 
- Public Member Functions inherited from flightgear::swift::CDBusObject
 CDBusObject ()=default
 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 int getVersionNumber ()
 Getting flightgear version.
 

Protected Member Functions

DBusHandlerResult dbusMessageHandler (const CDBusMessage &message) override
 DBus message handler.
 
- Protected Member Functions inherited from flightgear::swift::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.
 

Detailed Description

FGSwiftBus service object which is accessible through DBus

Definition at line 31 of file service.h.

Constructor & Destructor Documentation

◆ CService()

flightgear::swift::CService::CService ( )

Constructor.

Definition at line 22 of file service.cpp.

Member Function Documentation

◆ addTextMessage()

void flightgear::swift::CService::addTextMessage ( const std::string & text)

Definition at line 85 of file service.cpp.

◆ dbusMessageHandler()

DBusHandlerResult flightgear::swift::CService::dbusMessageHandler ( const CDBusMessage & message)
overrideprotectedvirtual

DBus message handler.

Implements flightgear::swift::CDBusObject.

Definition at line 360 of file service.cpp.

◆ getAircraftDescription()

std::string flightgear::swift::CService::getAircraftDescription ( ) const

Definition at line 106 of file service.cpp.

◆ getAircraftIcaoCode()

std::string flightgear::swift::CService::getAircraftIcaoCode ( ) const

Get the ICAO code of the current aircraft model.

Definition at line 101 of file service.cpp.

◆ getAircraftLivery()

std::string flightgear::swift::CService::getAircraftLivery ( ) const

Definition at line 96 of file service.cpp.

◆ getAircraftModelFilename()

std::string flightgear::swift::CService::getAircraftModelFilename ( ) const

Definition at line 299 of file service.cpp.

◆ getAircraftModelPath()

std::string flightgear::swift::CService::getAircraftModelPath ( ) const

Definition at line 91 of file service.cpp.

◆ getAircraftModelString()

std::string flightgear::swift::CService::getAircraftModelString ( ) const

Definition at line 306 of file service.cpp.

◆ getAircraftName()

std::string flightgear::swift::CService::getAircraftName ( ) const

Definition at line 313 of file service.cpp.

◆ getAllWheelsOnGround()

bool flightgear::swift::CService::getAllWheelsOnGround ( ) const

Get whether all wheels are on the ground.

Definition at line 156 of file service.cpp.

◆ getAltitudeMSL()

double flightgear::swift::CService::getAltitudeMSL ( ) const

Get aircraft altitude in feet.

Definition at line 126 of file service.cpp.

◆ getBeaconLightsOn()

bool flightgear::swift::CService::getBeaconLightsOn ( ) const

Get whether beacon lights are on.

Definition at line 196 of file service.cpp.

◆ getCom1Active()

int flightgear::swift::CService::getCom1Active ( ) const

Get the current COM1 active frequency in kHz.

Definition at line 161 of file service.cpp.

◆ getCom1Standby()

int flightgear::swift::CService::getCom1Standby ( ) const

Get the current COM1 standby frequency in kHz.

Definition at line 166 of file service.cpp.

◆ getCom1Volume()

double flightgear::swift::CService::getCom1Volume ( ) const

Definition at line 347 of file service.cpp.

◆ getCom2Active()

int flightgear::swift::CService::getCom2Active ( ) const

Get the current COM2 active frequency in kHz.

Definition at line 171 of file service.cpp.

◆ getCom2Standby()

int flightgear::swift::CService::getCom2Standby ( ) const

Get the current COM2 standby frequency in kHz.

Definition at line 176 of file service.cpp.

◆ getCom2Volume()

double flightgear::swift::CService::getCom2Volume ( ) const

Definition at line 352 of file service.cpp.

◆ getEngineN1Percentage()

std::vector< double > flightgear::swift::CService::getEngineN1Percentage ( ) const

Get the N1 speed as percent of max (per engine)

Definition at line 277 of file service.cpp.

◆ getFlapsDeployRatio()

double flightgear::swift::CService::getFlapsDeployRatio ( ) const

Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.

Definition at line 261 of file service.cpp.

◆ getGearDeployRatio()

double flightgear::swift::CService::getGearDeployRatio ( ) const

Get gear deploy ratio, where 0 is up and 1 is down.

Definition at line 266 of file service.cpp.

◆ getGroundElevation()

double flightgear::swift::CService::getGroundElevation ( ) const

Get ground elevation at aircraft current position.

Definition at line 294 of file service.cpp.

◆ getGroundSpeed()

double flightgear::swift::CService::getGroundSpeed ( ) const

Get aircraft groundspeed in knots.

Definition at line 136 of file service.cpp.

◆ getHeightAGL()

double flightgear::swift::CService::getHeightAGL ( ) const

Get aircraft height in feet.

Definition at line 131 of file service.cpp.

◆ getLandingLightsOn()

bool flightgear::swift::CService::getLandingLightsOn ( ) const

Get whether landing lights are on.

Definition at line 201 of file service.cpp.

◆ getLatitude()

double flightgear::swift::CService::getLatitude ( ) const

Get aircraft latitude in degrees.

Definition at line 116 of file service.cpp.

◆ getLongitude()

double flightgear::swift::CService::getLongitude ( ) const

Get aircraft longitude in degrees.

Definition at line 121 of file service.cpp.

◆ getNavLightsOn()

bool flightgear::swift::CService::getNavLightsOn ( ) const

Get whether nav lights are on.

Definition at line 206 of file service.cpp.

◆ getNumberOfEngines()

int flightgear::swift::CService::getNumberOfEngines ( ) const

Get the number of engines of current aircraft.

Definition at line 271 of file service.cpp.

◆ getPitch()

double flightgear::swift::CService::getPitch ( ) const

Get aircraft pitch in degrees above horizon.

Definition at line 141 of file service.cpp.

◆ getPitchRate()

double flightgear::swift::CService::getPitchRate ( ) const

Get pitch rate in rad/sec.

Definition at line 337 of file service.cpp.

◆ getPressAlt()

double flightgear::swift::CService::getPressAlt ( ) const

Get pressure altitude in ft.

Definition at line 222 of file service.cpp.

◆ getRoll()

double flightgear::swift::CService::getRoll ( ) const

Get aircraft roll in degrees.

Definition at line 146 of file service.cpp.

◆ getRollRate()

double flightgear::swift::CService::getRollRate ( ) const

Get roll rate in rad/sec.

Definition at line 333 of file service.cpp.

◆ getSpeedBrakeRatio()

double flightgear::swift::CService::getSpeedBrakeRatio ( ) const

Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted, and 1.0 is fully extended)

Definition at line 289 of file service.cpp.

◆ getStrobeLightsOn()

bool flightgear::swift::CService::getStrobeLightsOn ( ) const

Get whether strobe lights are on.

Definition at line 212 of file service.cpp.

◆ getTaxiLightsOn()

bool flightgear::swift::CService::getTaxiLightsOn ( ) const

Get whether taxi lights are on.

Definition at line 217 of file service.cpp.

◆ getTransponderCode()

int flightgear::swift::CService::getTransponderCode ( ) const

Get the current transponder code in decimal.

Definition at line 181 of file service.cpp.

◆ getTransponderIdent()

bool flightgear::swift::CService::getTransponderIdent ( ) const

Get whether we are currently squawking ident.

Definition at line 191 of file service.cpp.

◆ getTransponderMode()

int flightgear::swift::CService::getTransponderMode ( ) const

Get the current transponder mode (depends on the aircraft, 0-2 usually mean standby, >2 active)

Definition at line 186 of file service.cpp.

◆ getTrueHeading()

double flightgear::swift::CService::getTrueHeading ( ) const

Get aircraft true heading in degrees.

Definition at line 151 of file service.cpp.

◆ getVelocityX()

double flightgear::swift::CService::getVelocityX ( ) const

Get x velocity in m/s.

Definition at line 318 of file service.cpp.

◆ getVelocityY()

double flightgear::swift::CService::getVelocityY ( ) const

Get y velocity in m/s.

Definition at line 323 of file service.cpp.

◆ getVelocityZ()

double flightgear::swift::CService::getVelocityZ ( ) const

Get z velocity in m/s.

Definition at line 328 of file service.cpp.

◆ getVersionNumber()

int flightgear::swift::CService::getVersionNumber ( )
static

Getting flightgear version.

Definition at line 80 of file service.cpp.

◆ getYawRate()

double flightgear::swift::CService::getYawRate ( ) const

Get yaw rate in rad/sec.

Definition at line 342 of file service.cpp.

◆ InterfaceName()

const std::string & flightgear::swift::CService::InterfaceName ( )
static

DBus interface name.

Definition at line 69 of file service.cpp.

◆ isPaused()

bool flightgear::swift::CService::isPaused ( ) const

True if sim is paused.

Definition at line 111 of file service.cpp.

◆ ObjectPath()

const std::string & flightgear::swift::CService::ObjectPath ( )
static

DBus object path.

Definition at line 74 of file service.cpp.

◆ process()

int flightgear::swift::CService::process ( )

Perform generic processing.

Definition at line 627 of file service.cpp.

◆ setCom1Active()

void flightgear::swift::CService::setCom1Active ( int freq)

Set the current COM1 active frequency in kHz.

Definition at line 231 of file service.cpp.

◆ setCom1Standby()

void flightgear::swift::CService::setCom1Standby ( int freq)

Set the current COM1 standby frequency in kHz.

Definition at line 236 of file service.cpp.

◆ setCom2Active()

void flightgear::swift::CService::setCom2Active ( int freq)

Set the current COM2 active frequency in kHz.

Definition at line 241 of file service.cpp.

◆ setCom2Standby()

void flightgear::swift::CService::setCom2Standby ( int freq)

Set the current COM2 standby frequency in kHz.

Definition at line 246 of file service.cpp.

◆ setTransponderCode()

void flightgear::swift::CService::setTransponderCode ( int code)

Definition at line 251 of file service.cpp.

◆ setTransponderMode()

void flightgear::swift::CService::setTransponderMode ( int mode)

Definition at line 256 of file service.cpp.


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