6 #ifndef SWIFT_SIMPLUGIN_XSWIFTBUS_SERVICE_PROXY_H
7 #define SWIFT_SIMPLUGIN_XSWIFTBUS_SERVICE_PROXY_H
12 #include <QDBusPendingReply>
16 #include <QStringList>
22 class QDBusConnection;
23 class QDBusPendingCallWatcher;
26 #define XSWIFTBUS_SERVICE_INTERFACENAME "org.swift_project.xswiftbus.service"
27 #define XSWIFTBUS_SERVICE_OBJECTPATH "/xswiftbus/service"
30 namespace swift::simplugin::xplane
45 static const QString s(XSWIFTBUS_SERVICE_INTERFACENAME);
52 static const QString s(XSWIFTBUS_SERVICE_OBJECTPATH);
60 bool isValid()
const {
return m_dbusInterface->isValid(); }
70 std::function<void(QDBusPendingCallWatcher *)> setterCallback(T *obj)
72 return [
this, obj](QDBusPendingCallWatcher *watcher) {
73 QDBusPendingReply<T> reply = *watcher;
75 else { *obj = reply; }
76 watcher->deleteLater();
86 const QString &icao,
const QString &modelString,
const QString &name,
87 const QString &description);
124 void addTextMessage(
const QString &text,
double red,
double green,
double blue);
209 void getFrameStats(
double *o_averageFps,
double *o_simTimeRatio,
double *o_trackMilesShort,
210 double *o_minutesLate)
const;
211 void getFrameStatsAsync(
double *o_averageFps,
double *o_simTimeRatio,
double *o_trackMilesShort,
212 double *o_minutesLate);
Used for hand written interface based on virtual methods.
void cancelAllPendingAsyncCalls()
Cancel all asynchronous DBus calls which are currently pending.
Proxy object connected to a real XSwiftBus::CService object via DBus.
double getLocalXVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
QString getCommitHash()
Get SHA1 of the last commit that could influence xswiftbus.
static const QString & InterfaceName()
Service name.
bool getBeaconLightsOn() const
Get whether landing lights are on.
void isUsingRealTimeAsync(bool *o_isRealTime)
True if sim time is tracking operating system time.
void getOwnAircraftModelDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own model data.
void getOwnAircraftCom2DataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft COM2 data.
void setTransponderMode(int mode)
Set the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
void getAircraftLiveryAsync(QString *o_modelLivery)
Get current aircraft livery.
double getLocalYVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
void getTransponderModeAsync(int *o_xpdrMode)
Get the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
void getAltitudeMslMAsync(double *o_altitude)
Get aircraft altitude in meters.
void getEngineN1PercentageAsync(QList< double > *o_engineN1Percentage)
Get the N1 speed as percent of max (per engine)
int getNumberOfEngines() const
Get the number of engines of current aircraft.
double getLatitudeDeg() const
Get aircraft latitude in degrees.
QString getAircraftModelFilename() const
Get base filename of current aircraft model.
void updateAirportsInRange()
QString getXPlaneInstallationPath() const
Get root of X-Plane install path.
void getAircraftIcaoCodeAsync(QString *o_icaoCode)
Get the ICAO code of the current aircraft model.
bool getTaxiLightsOn() const
Get whether taxi lights are on.
void getAircraftModelPathAsync(QString *o_modelPath)
Get full path to current aircraft model.
void getAircraftModelFilenameAsync(QString *o_modelFilename)
Get base filename of current aircraft model.
void getPitchDegAsync(double *o_pitch)
Get aircraft pitch in degrees above horizon.
int getXPlaneVersionMajor() const
Get major version number.
void setCom2ActiveKhz(int freq)
Set the current COM2 active frequency in kHz.
QString getXPlanePreferencesPath() const
Get full path to X-Plane preferences file.
double getRollDeg() const
Get aircraft roll in degrees.
void getPitchRadPerSecAsync(double *o_radPerSec)
Get aircraft angular velocity in radians per second.
void getAllWheelsOnGroundAsync(bool *o_allWheels)
Get whether all wheels are on the ground.
double getCom2Volume() const
Get the COM2 volume 0..1.
static const QString & ObjectPath()
Service path.
double getGearDeployRatio() const
Get gear deploy ratio, where 0 is up and 1 is down.
QString getAircraftLivery() const
Get current aircraft livery.
void getBeaconLightsOnAsync(bool *o_beaconLightsOn)
Get whether landing lights are on.
void getLocalZVelocityMpsAsync(double *o_velocity)
Get aircraft local velocity in world coordinates meters per second.
double getLongitudeDeg() const
Get aircraft longitude in degrees.
void setTransponderCode(int code)
Set the current transponder code in decimal.
void getSpeedBrakeRatioAsync(double *o_speedBrakeRatio)
Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted,...
bool getLandingLightsOn() const
Get whether landing lights are on.
void getIndicatedAirspeedKiasAsync(double *o_ias)
Get aircraft IAS in knots.
void getTaxiLightsOnAsync(bool *o_taxiLightsOn)
Get whether taxi lights are on.
void addTextMessage(const QString &text, double red, double green, double blue)
Add a text message to the on-screen display, with RGB components in the range [0,1].
void getGroundElevationAsync(double *o_elevationM)
Get elevation of ground under the plane (in meters)
void sceneryLoaded()
Scenery was loaded.
void getRollRadPerSecAsync(double *o_radPerSec)
Get aircraft angular velocity in radians per second.
void setCom1StandbyKhz(int freq)
Set the current COM1 standby frequency in kHz.
bool isCom1Receiving() const
Is COM1 receiving?
void isCom1ReceivingAsync(bool *o_com1Rec)
Is COM1 receiving?
double getTrueAirspeedKias() const
Get aircraft TAS in meters per second.
void getOwnAircraftLightsAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own lights data.
void getCom1StandbyKhzAsync(int *o_com1Standby)
Get the current COM1 standby frequency in kHz.
void getOwnAircraftVelocityDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft velocity data.
void getAnyWheelOnGroundAsync(bool *o_anyWheel)
Get whether any wheel is on the ground.
void setCom1ActiveKhz(int freq)
Set the current COM1 active frequency in kHz.
void getOwnAircraftXpdrAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own XPDR data.
void getLandingLightsOnAsync(bool *o_landingLightsOn)
Get whether landing lights are on.
int getCom1StandbyKhz() const
Get the current COM1 standby frequency in kHz.
QString getAircraftDescription() const
Get the description of the current aircraft model.
void getXPlaneVersionMinorAsync(int *o_versionMinor)
Get minor version number.
void getStrobeLightsOnAsync(bool *o_strobeLightsOn)
Get whether strobe lights are on.
QString getAircraftName() const
Get name of current aircraft model.
bool getTransponderIdent() const
Get whether we are currently squawking ident.
void isPausedAsync(bool *o_paused)
True if sim is paused.
double getPitchDeg() const
Get aircraft pitch in degrees above horizon.
void isCom2TransmittingAsync(bool *o_com2Tx)
Is COM2 transmitting?
void getGroundSpeedMpsAsync(double *o_groundspeed)
Get aircraft groundspeed in meters per second.
double getCom1Volume() const
Get the COM1 volume 0..1.
int getTransponderMode() const
Get the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
void getTrueAirspeedKiasAsync(double *o_tas)
Get aircraft TAS in meters per second.
QString getSettingsJson() const
Get settings.
bool isPaused() const
True if sim is paused.
void getCom2VolumeAsync(double *o_com2Volume)
Get the COM2 volume 0..1.
bool isUsingRealTime() const
True if sim time is tracking operating system time.
int getCom2ActiveKhz() const
Get the current COM2 active frequency in kHz.
int getCom2StandbyKhz() const
Get the current COM2 standby frequency in kHz.
bool isValid() const
Does the remote object exist?
void isCom2ReceivingAsync(bool *o_com2Rec)
Is COM2 receiving?
void setSettingsJson(const QString &json)
Set settings.
void getCom2StandbyKhzAsync(int *o_com2Standby)
Get the current COM2 standby frequency in kHz.
QString getAircraftModelString() const
Get canonical swift model string of current aircraft model.
bool getStrobeLightsOn() const
Get whether strobe lights are on.
QString getAircraftIcaoCode() const
Get the ICAO code of the current aircraft model.
void getFlapsDeployRatioAsync(double *o_flapsDeployRatio)
Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.
void getGearDeployRatioAsync(double *o_gearDeployRatio)
Get gear deploy ratio, where 0 is up and 1 is down.
QString getAircraftModelPath() const
Get full path to current aircraft model.
QList< double > getEngineN1Percentage() const
Get the N1 speed as percent of max (per engine)
double getIndicatedAirspeedKias() const
Get aircraft IAS in knots.
void getXPlaneVersionMajorAsync(int *o_versionMajor)
Get major version number.
bool getNavLightsOn() const
Get whether nav lights are on.
void getLocalXVelocityMpsAsync(double *o_velocity)
Get aircraft local velocity in world coordinates meters per second.
double getRollRadPerSec() const
Get aircraft angular velocity in radians per second.
double getGroundElevation() const
Get elevation of ground under the plane (in meters)
double getFlapsDeployRatio() const
Get flaps deploy ratio, where 0.0 is flaps fully retracted, and 1.0 is flaps fully extended.
void getPressureAltitudeFtAsync(double *o_altitude)
Get aircraft pressure altitude in feet in standard atmosphere in X-Plane 12. NaN in earlier versions ...
void getTransponderCodeAsync(int *o_xpdrCode)
Get the current transponder code in decimal.
int getCom1ActiveKhz() const
Get the current COM1 active frequency in kHz.
int getTransponderCode() const
Get the current transponder code in decimal.
CXSwiftBusServiceProxy(QDBusConnection &connection, QObject *parent=nullptr, bool dummy=false)
Constructor.
void getAircraftModelStringAsync(QString *o_modelString)
Get canonical swift model string of current aircraft model.
void getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate) const
Frames-per-second, averaged over the last 500 frames, or since this function was last called,...
void getRollDegAsync(double *o_roll)
Get aircraft roll in degrees.
bool getAnyWheelOnGround() const
Get whether any wheel is on the ground.
void getOwnAircraftPartsAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own parts such as gear, flaps.
void getSettingsJsonAsync(QString *o_jsonSettings)
Get settings.
bool isCom2Receiving() const
Is COM2 receiving?
double getPressureAltitudeFt() const
Get aircraft pressure altitude in feet in standard atmosphere in X-Plane 12. NaN in earlier versions ...
void getCom2ActiveKhzAsync(int *o_com2Active)
Get the current COM2 active frequency in kHz.
void isCom1TransmittingAsync(bool *o_com1Tx)
Is COM1 transmitting?
double getTrueHeadingDeg() const
Get aircraft true heading in degrees.
void getNavLightsOnAsync(bool *o_navLightsOn)
Get whether nav lights are on.
bool isCom1Transmitting() const
Is COM1 transmitting?
SWIFT_NO_RELAY void asyncMethodError(QDBusError error)
Emitted if an asynchronous method call caused a DBus error.
void getHeightAglMAsync(double *o_height)
Get aircraft height in meters.
void aircraftModelChanged(const QString &path, const QString &filename, const QString &livery, const QString &icao, const QString &modelString, const QString &name, const QString &description)
Own aircraft model changed.
void getQNHInHgAsync(double *o_qnh)
Get barometric pressure at sea level in inches of mercury.
void getAircraftNameAsync(QString *o_name)
Get name of current aircraft model.
double getLocalZVelocityMps() const
Get aircraft local velocity in world coordinates meters per second.
void getLatitudeDegAsync(double *o_latitude)
Get aircraft latitude in degrees.
void getAircraftDescriptionAsync(QString *o_description)
Get the description of the current aircraft model.
void getCom1VolumeAsync(double *o_com1Volume)
Get the COM1 volume 0..1.
double getQNHInHg() const
Get barometric pressure at sea level in inches of mercury.
void getOwnAircraftSituationDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft situation data.
void getNumberOfEnginesAsync(double *o_numberOfEngines)
Get the number of engines of current aircraft.
double getGroundSpeedMps() const
Get aircraft groundspeed in meters per second.
void setCom2StandbyKhz(int freq)
Set the current COM2 standby frequency in kHz.
void getXPlaneInstallationPathAsync(QString *o_installPath)
Get root of X-Plane install path.
void resetFrameTotals()
Reset the monitoring of total miles and minutes lost due to low frame rate.
double getSpeedBrakeRatio() const
Get the ratio how much the speedbrakes surfaces are extended (0.0 is fully retracted,...
double getHeightAglM() const
Get aircraft height in meters.
void getLongitudeDegAsync(double *o_longitude)
Get aircraft longitude in degrees.
void getCom1ActiveKhzAsync(int *o_com1Active)
Get the current COM1 active frequency in kHz.
double getAltitudeMslM() const
Get aircraft altitude in meters.
void cancelAllPendingAsyncCalls()
Cancel all current async slot calls.
int getXPlaneVersionMinor() const
Get minor version number.
bool getAllWheelsOnGround() const
Get whether all wheels are on the ground.
double getPitchRadPerSec() const
Get aircraft angular velocity in radians per second.
QString getVersionNumber()
Get xswiftbus version number.
void getOwnAircraftCom1DataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft COM1 data.
void getLocalYVelocityMpsAsync(double *o_velocity)
Get aircraft local velocity in world coordinates meters per second.
double getHeadingRadPerSec() const
Get aircraft angular velocity in radians per second.
bool isCom2Transmitting() const
Is COM2 transmitting?
void getXPlanePreferencesPathAsync(QString *o_prefsPath)
Get full path to X-Plane preferences file.
void getHeadingRadPerSecAsync(double *o_radPerSec)
Get aircraft angular velocity in radians per second.
void getTrueHeadingDegAsync(double *o_heading)
Get aircraft true heading in degrees.
void getFrameStatsAsync(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate)
Frames-per-second, averaged over the last 500 frames, or since this function was last called,...
void getTransponderIdentAsync(bool *o_ident)
Get whether we are currently squawking ident.
#define SWIFT_NO_RELAY
Any signals tagged with this macro will be ignored by swift::misc::CGenericDBusInterface::relayParent...