mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Rename xbus to xswiftbus
Summary: I wanted to rename xbus because its relation to //swift// is not immediately clear from the name. xswiftbus seems reasonable. Reviewers: #swift_pilot_client, kbasan Reviewed By: kbasan Subscribers: kbasan, jenkins Tags: #swift_pilot_client Differential Revision: https://dev.swift-project.org/D14
This commit is contained in:
@@ -48,9 +48,9 @@
|
||||
#include "blackmisc/weather/windlayer.h"
|
||||
#include "blackmisc/weather/windlayerlist.h"
|
||||
#include "qcompilerdetection.h"
|
||||
#include "xbusserviceproxy.h"
|
||||
#include "xbustrafficproxy.h"
|
||||
#include "xbusweatherproxy.h"
|
||||
#include "xswiftbusserviceproxy.h"
|
||||
#include "xswiftbustrafficproxy.h"
|
||||
#include "xswiftbusweatherproxy.h"
|
||||
|
||||
#include <QColor>
|
||||
#include <QDBusServiceWatcher>
|
||||
@@ -69,9 +69,9 @@ using namespace BlackMisc::Weather;
|
||||
|
||||
namespace
|
||||
{
|
||||
inline QString xbusServiceName()
|
||||
inline QString xswiftbusServiceName()
|
||||
{
|
||||
return QStringLiteral("org.swift-project.xbus");
|
||||
return QStringLiteral("org.swift-project.xswiftbus");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace BlackSimPlugin
|
||||
{
|
||||
m_watcher = new QDBusServiceWatcher(this);
|
||||
m_watcher->setWatchMode(QDBusServiceWatcher::WatchForUnregistration);
|
||||
m_watcher->addWatchedService(xbusServiceName());
|
||||
m_watcher->addWatchedService(xswiftbusServiceName());
|
||||
m_watcher->setObjectName("QDBusServiceWatcher");
|
||||
connect(m_watcher, &QDBusServiceWatcher::serviceUnregistered, this, &CSimulatorXPlane::ps_serviceUnregistered);
|
||||
|
||||
@@ -243,16 +243,16 @@ namespace BlackSimPlugin
|
||||
{
|
||||
if (isConnected()) { return true; }
|
||||
m_conn = QDBusConnection::sessionBus(); // TODO make this configurable
|
||||
m_service = new CXBusServiceProxy(m_conn, this);
|
||||
m_traffic = new CXBusTrafficProxy(m_conn, this);
|
||||
m_weather = new CXBusWeatherProxy(m_conn, this);
|
||||
m_service = new CXSwiftBusServiceProxy(m_conn, this);
|
||||
m_traffic = new CXSwiftBusTrafficProxy(m_conn, this);
|
||||
m_weather = new CXSwiftBusWeatherProxy(m_conn, this);
|
||||
|
||||
if (m_service->isValid() && m_traffic->isValid() && m_weather->isValid() && m_traffic->initialize())
|
||||
{
|
||||
// FIXME duplication
|
||||
connect(m_service, &CXBusServiceProxy::aircraftModelChanged, this, &CSimulatorXPlane::ps_emitOwnAircraftModelChanged);
|
||||
connect(m_service, &CXBusServiceProxy::airportsInRangeUpdated, this, &CSimulatorXPlane::ps_setAirportsInRange);
|
||||
connect(m_traffic, &CXBusTrafficProxy::installedModelsUpdated, this, &CSimulatorXPlane::ps_installedModelsUpdated);
|
||||
connect(m_service, &CXSwiftBusServiceProxy::aircraftModelChanged, this, &CSimulatorXPlane::ps_emitOwnAircraftModelChanged);
|
||||
connect(m_service, &CXSwiftBusServiceProxy::airportsInRangeUpdated, this, &CSimulatorXPlane::ps_setAirportsInRange);
|
||||
connect(m_traffic, &CXSwiftBusTrafficProxy::installedModelsUpdated, this, &CSimulatorXPlane::ps_installedModelsUpdated);
|
||||
m_service->updateAirportsInRange();
|
||||
m_traffic->updateInstalledModels();
|
||||
m_watcher->setConnection(m_conn);
|
||||
@@ -722,15 +722,15 @@ namespace BlackSimPlugin
|
||||
void CSimulatorXPlaneListener::startImpl()
|
||||
{
|
||||
if (m_watcher) { return; } // already started
|
||||
if (isXBusRunning())
|
||||
if (isXSwiftBusRunning())
|
||||
{
|
||||
emit simulatorStarted(getPluginInfo());
|
||||
}
|
||||
else
|
||||
{
|
||||
CLogMessage(this).debug() << "Starting XBus on" << m_xbusServerSetting.getThreadLocal();
|
||||
m_conn = CSimulatorXPlane::connectionFromString(m_xbusServerSetting.getThreadLocal());
|
||||
m_watcher = new QDBusServiceWatcher(xbusServiceName(), m_conn, QDBusServiceWatcher::WatchForRegistration, this);
|
||||
CLogMessage(this).debug() << "Starting XSwiftBus on" << m_xswiftbusServerSetting.getThreadLocal();
|
||||
m_conn = CSimulatorXPlane::connectionFromString(m_xswiftbusServerSetting.getThreadLocal());
|
||||
m_watcher = new QDBusServiceWatcher(xswiftbusServiceName(), m_conn, QDBusServiceWatcher::WatchForRegistration, this);
|
||||
connect(m_watcher, &QDBusServiceWatcher::serviceRegistered, this, &CSimulatorXPlaneListener::ps_serviceRegistered);
|
||||
}
|
||||
}
|
||||
@@ -744,11 +744,11 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
bool CSimulatorXPlaneListener::isXBusRunning() const
|
||||
bool CSimulatorXPlaneListener::isXSwiftBusRunning() const
|
||||
{
|
||||
QDBusConnection conn = CSimulatorXPlane::connectionFromString(m_xbusServerSetting.getThreadLocal());
|
||||
CXBusServiceProxy *service = new CXBusServiceProxy(conn);
|
||||
CXBusTrafficProxy *traffic = new CXBusTrafficProxy(conn);
|
||||
QDBusConnection conn = CSimulatorXPlane::connectionFromString(m_xswiftbusServerSetting.getThreadLocal());
|
||||
CXSwiftBusServiceProxy *service = new CXSwiftBusServiceProxy(conn);
|
||||
CXSwiftBusTrafficProxy *traffic = new CXSwiftBusTrafficProxy(conn);
|
||||
|
||||
bool result = service->isValid() && traffic->isValid();
|
||||
|
||||
@@ -760,13 +760,13 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorXPlaneListener::ps_serviceRegistered(const QString &serviceName)
|
||||
{
|
||||
if (serviceName == xbusServiceName())
|
||||
if (serviceName == xswiftbusServiceName())
|
||||
{
|
||||
emit simulatorStarted(getPluginInfo());
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorXPlaneListener::ps_xbusServerSettingChanged()
|
||||
void CSimulatorXPlaneListener::ps_xswiftbusServerSettingChanged()
|
||||
{
|
||||
// user changed settings, restart the listener
|
||||
if (m_watcher)
|
||||
|
||||
@@ -62,9 +62,9 @@ namespace BlackSimPlugin
|
||||
{
|
||||
namespace XPlane
|
||||
{
|
||||
class CXBusServiceProxy;
|
||||
class CXBusTrafficProxy;
|
||||
class CXBusWeatherProxy;
|
||||
class CXSwiftBusServiceProxy;
|
||||
class CXSwiftBusTrafficProxy;
|
||||
class CXSwiftBusWeatherProxy;
|
||||
|
||||
//! X-Plane ISimulator implementation
|
||||
class CSimulatorXPlane : public BlackCore::CSimulatorCommon
|
||||
@@ -146,9 +146,9 @@ namespace BlackSimPlugin
|
||||
|
||||
QDBusConnection m_conn { "default" };
|
||||
QDBusServiceWatcher *m_watcher { nullptr };
|
||||
CXBusServiceProxy *m_service { nullptr };
|
||||
CXBusTrafficProxy *m_traffic { nullptr };
|
||||
CXBusWeatherProxy *m_weather { nullptr };
|
||||
CXSwiftBusServiceProxy *m_service { nullptr };
|
||||
CXSwiftBusTrafficProxy *m_traffic { nullptr };
|
||||
CXSwiftBusWeatherProxy *m_weather { nullptr };
|
||||
QTimer *m_fastTimer { nullptr };
|
||||
QTimer *m_slowTimer { nullptr };
|
||||
BlackMisc::Aviation::CAirportList m_airportsInRange; //!< aiports in range of own aircraft
|
||||
@@ -195,7 +195,7 @@ namespace BlackSimPlugin
|
||||
}
|
||||
};
|
||||
|
||||
//! Listener waits for xbus service to show up
|
||||
//! Listener waits for xswiftbus service to show up
|
||||
class CSimulatorXPlaneListener : public BlackCore::ISimulatorListener
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -212,17 +212,17 @@ namespace BlackSimPlugin
|
||||
virtual void stopImpl() override;
|
||||
|
||||
private:
|
||||
//! \brief Check if XBus service is already registered
|
||||
bool isXBusRunning() const;
|
||||
//! \brief Check if XSwiftBus service is already registered
|
||||
bool isXSwiftBusRunning() const;
|
||||
|
||||
private slots:
|
||||
void ps_serviceRegistered(const QString &serviceName);
|
||||
void ps_xbusServerSettingChanged();
|
||||
void ps_xswiftbusServerSettingChanged();
|
||||
|
||||
private:
|
||||
QDBusConnection m_conn { "default" };
|
||||
QDBusServiceWatcher *m_watcher { nullptr };
|
||||
BlackMisc::CSetting<TXBusServer> m_xbusServerSetting { this, &CSimulatorXPlaneListener::ps_xbusServerSettingChanged };
|
||||
BlackMisc::CSetting<TXSwiftBusServer> m_xswiftbusServerSetting { this, &CSimulatorXPlaneListener::ps_xswiftbusServerSettingChanged };
|
||||
};
|
||||
|
||||
//! Factory for creating CSimulatorXPlane instance
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
"identifier" : "org.swift-project.plugins.simulator.xplane",
|
||||
"name" : "X-Plane",
|
||||
"simulator" : "xplane",
|
||||
"description" : "Support for the X-Plane simulator via the xbus plugin.",
|
||||
"description" : "Support for the X-Plane simulator via the xswiftbus plugin.",
|
||||
"config" : "org.swift-project.plugins.simulator.xplane.config"
|
||||
}
|
||||
|
||||
@@ -7,423 +7,423 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "xbusserviceproxy.h"
|
||||
#include "xswiftbusserviceproxy.h"
|
||||
|
||||
#include <QLatin1String>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
#define XBUS_SERVICE_SERVICENAME "org.swift-project.xbus"
|
||||
#define XSWIFTBUS_SERVICE_SERVICENAME "org.swift-project.xswiftbus"
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace XPlane
|
||||
{
|
||||
|
||||
CXBusServiceProxy::CXBusServiceProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
||||
CXSwiftBusServiceProxy::CXSwiftBusServiceProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
||||
{
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XBUS_SERVICE_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICE_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
if (! dummy) { m_dbusInterface->relayParentSignals(); }
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::addTextMessage(const QString &text, double red, double green, double blue)
|
||||
void CXSwiftBusServiceProxy::addTextMessage(const QString &text, double red, double green, double blue)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("addTextMessage"), text, red, green, blue);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::updateAirportsInRange()
|
||||
void CXSwiftBusServiceProxy::updateAirportsInRange()
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("updateAirportsInRange"));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getAircraftModelPath() const
|
||||
QString CXSwiftBusServiceProxy::getAircraftModelPath() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getAircraftModelPath"));
|
||||
}
|
||||
void CXBusServiceProxy::getAircraftModelPathAsync(QString *o_modelPath)
|
||||
void CXSwiftBusServiceProxy::getAircraftModelPathAsync(QString *o_modelPath)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAircraftModelPath"), setterCallback(o_modelPath));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getAircraftModelFilename() const
|
||||
QString CXSwiftBusServiceProxy::getAircraftModelFilename() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getAircraftModelFilename"));
|
||||
}
|
||||
void CXBusServiceProxy::getAircraftModelFilenameAsync(QString *o_modelFilename)
|
||||
void CXSwiftBusServiceProxy::getAircraftModelFilenameAsync(QString *o_modelFilename)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAircraftModelFilename"), setterCallback(o_modelFilename));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getAircraftLivery() const
|
||||
QString CXSwiftBusServiceProxy::getAircraftLivery() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getAircraftLivery"));
|
||||
}
|
||||
void CXBusServiceProxy::getAircraftLiveryAsync(QString *o_modelLivery)
|
||||
void CXSwiftBusServiceProxy::getAircraftLiveryAsync(QString *o_modelLivery)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAircraftLivery"), setterCallback(o_modelLivery));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getAircraftIcaoCode() const
|
||||
QString CXSwiftBusServiceProxy::getAircraftIcaoCode() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getAircraftIcaoCode"));
|
||||
}
|
||||
void CXBusServiceProxy::getAircraftIcaoCodeAsync(QString *o_icaoCode)
|
||||
void CXSwiftBusServiceProxy::getAircraftIcaoCodeAsync(QString *o_icaoCode)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAircraftIcaoCode"), setterCallback(o_icaoCode));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getXPlaneVersionMajor() const
|
||||
int CXSwiftBusServiceProxy::getXPlaneVersionMajor() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getXPlaneVersionMajor"));
|
||||
}
|
||||
void CXBusServiceProxy::getXPlaneVersionMajorAsync(int *o_versionMajor)
|
||||
void CXSwiftBusServiceProxy::getXPlaneVersionMajorAsync(int *o_versionMajor)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getXPlaneVersionMajor"), setterCallback(o_versionMajor));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getXPlaneVersionMinor() const
|
||||
int CXSwiftBusServiceProxy::getXPlaneVersionMinor() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getXPlaneVersionMinor"));
|
||||
}
|
||||
void CXBusServiceProxy::getXPlaneVersionMinorAsync(int *o_versionMinor)
|
||||
void CXSwiftBusServiceProxy::getXPlaneVersionMinorAsync(int *o_versionMinor)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getXPlaneVersionMinor"), setterCallback(o_versionMinor));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getXPlaneInstallationPath() const
|
||||
QString CXSwiftBusServiceProxy::getXPlaneInstallationPath() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getXPlaneInstallationPath"));
|
||||
}
|
||||
void CXBusServiceProxy::getXPlaneInstallationPathAsync(QString *o_installPath)
|
||||
void CXSwiftBusServiceProxy::getXPlaneInstallationPathAsync(QString *o_installPath)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getXPlaneInstallationPath"), setterCallback(o_installPath));
|
||||
}
|
||||
|
||||
QString CXBusServiceProxy::getXPlanePreferencesPath() const
|
||||
QString CXSwiftBusServiceProxy::getXPlanePreferencesPath() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QString>(QLatin1String("getXPlanePreferencesPath"));
|
||||
}
|
||||
void CXBusServiceProxy::getXPlanePreferencesPathAsync(QString *o_prefsPath)
|
||||
void CXSwiftBusServiceProxy::getXPlanePreferencesPathAsync(QString *o_prefsPath)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getXPlanePreferencesPath"), setterCallback(o_prefsPath));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::isPaused() const
|
||||
bool CXSwiftBusServiceProxy::isPaused() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("isPaused"));
|
||||
}
|
||||
void CXBusServiceProxy::isPausedAsync(bool *o_paused)
|
||||
void CXSwiftBusServiceProxy::isPausedAsync(bool *o_paused)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("isPaused"), setterCallback(o_paused));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::isUsingRealTime() const
|
||||
bool CXSwiftBusServiceProxy::isUsingRealTime() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("isUsingRealTime"));
|
||||
}
|
||||
void CXBusServiceProxy::isUsingRealTimeAsync(bool *o_isRealTime)
|
||||
void CXSwiftBusServiceProxy::isUsingRealTimeAsync(bool *o_isRealTime)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getLatitude() const
|
||||
double CXSwiftBusServiceProxy::getLatitude() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLatitude"));
|
||||
}
|
||||
void CXBusServiceProxy::getLatitudeAsync(double *o_latitude)
|
||||
void CXSwiftBusServiceProxy::getLatitudeAsync(double *o_latitude)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getLatitude"), setterCallback(o_latitude));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getLongitude() const
|
||||
double CXSwiftBusServiceProxy::getLongitude() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLongitude"));
|
||||
}
|
||||
void CXBusServiceProxy::getLongitudeAsync(double *o_longitude)
|
||||
void CXSwiftBusServiceProxy::getLongitudeAsync(double *o_longitude)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getLongitude"), setterCallback(o_longitude));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getAltitudeMSL() const
|
||||
double CXSwiftBusServiceProxy::getAltitudeMSL() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getAltitudeMSL"));
|
||||
}
|
||||
void CXBusServiceProxy::getAltitudeMSLAsync(double *o_altitude)
|
||||
void CXSwiftBusServiceProxy::getAltitudeMSLAsync(double *o_altitude)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAltitudeMSL"), setterCallback(o_altitude));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getHeightAGL() const
|
||||
double CXSwiftBusServiceProxy::getHeightAGL() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getHeightAGL"));
|
||||
}
|
||||
void CXBusServiceProxy::getHeightAGLAsync(double *o_height)
|
||||
void CXSwiftBusServiceProxy::getHeightAGLAsync(double *o_height)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getHeightAGL"), setterCallback(o_height));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getGroundSpeed() const
|
||||
double CXSwiftBusServiceProxy::getGroundSpeed() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getGroundSpeed"));
|
||||
}
|
||||
void CXBusServiceProxy::getGroundSpeedAsync(double *o_groundspeed)
|
||||
void CXSwiftBusServiceProxy::getGroundSpeedAsync(double *o_groundspeed)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getGroundSpeed"), setterCallback(o_groundspeed));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getIndicatedAirspeed() const
|
||||
double CXSwiftBusServiceProxy::getIndicatedAirspeed() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getIndicatedAirspeed"));
|
||||
}
|
||||
void CXBusServiceProxy::getIndicatedAirspeedAsync(double *o_ias)
|
||||
void CXSwiftBusServiceProxy::getIndicatedAirspeedAsync(double *o_ias)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getIndicatedAirspeed"), setterCallback(o_ias));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getTrueAirspeed() const
|
||||
double CXSwiftBusServiceProxy::getTrueAirspeed() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueAirspeed"));
|
||||
}
|
||||
void CXBusServiceProxy::getTrueAirspeedAsync(double *o_tas)
|
||||
void CXSwiftBusServiceProxy::getTrueAirspeedAsync(double *o_tas)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTrueAirspeed"), setterCallback(o_tas));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getPitch() const
|
||||
double CXSwiftBusServiceProxy::getPitch() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getPitch"));
|
||||
}
|
||||
void CXBusServiceProxy::getPitchAsync(double *o_pitch)
|
||||
void CXSwiftBusServiceProxy::getPitchAsync(double *o_pitch)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getPitch"), setterCallback(o_pitch));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getRoll() const
|
||||
double CXSwiftBusServiceProxy::getRoll() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getRoll"));
|
||||
}
|
||||
void CXBusServiceProxy::getRollAsync(double *o_roll)
|
||||
void CXSwiftBusServiceProxy::getRollAsync(double *o_roll)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getRoll"), setterCallback(o_roll));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getTrueHeading() const
|
||||
double CXSwiftBusServiceProxy::getTrueHeading() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueHeading"));
|
||||
}
|
||||
void CXBusServiceProxy::getTrueHeadingAsync(double *o_heading)
|
||||
void CXSwiftBusServiceProxy::getTrueHeadingAsync(double *o_heading)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTrueHeading"), setterCallback(o_heading));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getAnyWheelOnGround() const
|
||||
bool CXSwiftBusServiceProxy::getAnyWheelOnGround() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getAnyWheelOnGround"));
|
||||
}
|
||||
void CXBusServiceProxy::getAnyWheelOnGroundAsync(bool *o_anyWheel)
|
||||
void CXSwiftBusServiceProxy::getAnyWheelOnGroundAsync(bool *o_anyWheel)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAnyWheelOnGround"), setterCallback(o_anyWheel));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getAllWheelsOnGround() const
|
||||
bool CXSwiftBusServiceProxy::getAllWheelsOnGround() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getAllWheelsOnGround"));
|
||||
}
|
||||
void CXBusServiceProxy::getAllWheelsOnGroundAsync(bool *o_allWheels)
|
||||
void CXSwiftBusServiceProxy::getAllWheelsOnGroundAsync(bool *o_allWheels)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getAllWheelsOnGround"), setterCallback(o_allWheels));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getCom1Active() const
|
||||
int CXSwiftBusServiceProxy::getCom1Active() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1Active"));
|
||||
}
|
||||
void CXBusServiceProxy::getCom1ActiveAsync(int *o_com1Active)
|
||||
void CXSwiftBusServiceProxy::getCom1ActiveAsync(int *o_com1Active)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getCom1Active"), setterCallback(o_com1Active));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getCom1Standby() const
|
||||
int CXSwiftBusServiceProxy::getCom1Standby() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1Standby"));
|
||||
}
|
||||
void CXBusServiceProxy::getCom1StandbyAsync(int *o_com1Standby)
|
||||
void CXSwiftBusServiceProxy::getCom1StandbyAsync(int *o_com1Standby)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getCom1Standby"), setterCallback(o_com1Standby));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getCom2Active() const
|
||||
int CXSwiftBusServiceProxy::getCom2Active() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2Active"));
|
||||
}
|
||||
void CXBusServiceProxy::getCom2ActiveAsync(int *o_com2Active)
|
||||
void CXSwiftBusServiceProxy::getCom2ActiveAsync(int *o_com2Active)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getCom2Active"), setterCallback(o_com2Active));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getCom2Standby() const
|
||||
int CXSwiftBusServiceProxy::getCom2Standby() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2Standby"));
|
||||
}
|
||||
void CXBusServiceProxy::getCom2StandbyAsync(int *o_com2Standby)
|
||||
void CXSwiftBusServiceProxy::getCom2StandbyAsync(int *o_com2Standby)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getCom2Standby"), setterCallback(o_com2Standby));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getTransponderCode() const
|
||||
int CXSwiftBusServiceProxy::getTransponderCode() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getTransponderCode"));
|
||||
}
|
||||
void CXBusServiceProxy::getTransponderCodeAsync(int *o_xpdrCode)
|
||||
void CXSwiftBusServiceProxy::getTransponderCodeAsync(int *o_xpdrCode)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTransponderCode"), setterCallback(o_xpdrCode));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getTransponderMode() const
|
||||
int CXSwiftBusServiceProxy::getTransponderMode() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getTransponderMode"));
|
||||
}
|
||||
void CXBusServiceProxy::getTransponderModeAsync(int *o_xpdrMode)
|
||||
void CXSwiftBusServiceProxy::getTransponderModeAsync(int *o_xpdrMode)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTransponderMode"), setterCallback(o_xpdrMode));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getTransponderIdent() const
|
||||
bool CXSwiftBusServiceProxy::getTransponderIdent() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getTransponderIdent"));
|
||||
}
|
||||
void CXBusServiceProxy::getTransponderIdentAsync(bool *o_ident)
|
||||
void CXSwiftBusServiceProxy::getTransponderIdentAsync(bool *o_ident)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTransponderIdent"), setterCallback(o_ident));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getBeaconLightsOn() const
|
||||
bool CXSwiftBusServiceProxy::getBeaconLightsOn() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getBeaconLightsOn"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getBeaconLightsOnAsync(bool *o_beaconLightsOn)
|
||||
void CXSwiftBusServiceProxy::getBeaconLightsOnAsync(bool *o_beaconLightsOn)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getBeaconLightsOn"), setterCallback(o_beaconLightsOn));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getLandingLightsOn() const
|
||||
bool CXSwiftBusServiceProxy::getLandingLightsOn() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getLandingLightsOn"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getLandingLightsOnAsync(bool *o_landingLightsOn)
|
||||
void CXSwiftBusServiceProxy::getLandingLightsOnAsync(bool *o_landingLightsOn)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getLandingLightsOn"), setterCallback(o_landingLightsOn));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getNavLightsOn() const
|
||||
bool CXSwiftBusServiceProxy::getNavLightsOn() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getNavLightsOn"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getNavLightsOnAsync(bool *o_navLightsOn)
|
||||
void CXSwiftBusServiceProxy::getNavLightsOnAsync(bool *o_navLightsOn)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getNavLightsOn"), setterCallback(o_navLightsOn));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getStrobeLightsOn() const
|
||||
bool CXSwiftBusServiceProxy::getStrobeLightsOn() const
|
||||
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getStrobeLightsOn"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getStrobeLightsOnAsync(bool *o_strobeLightsOn)
|
||||
void CXSwiftBusServiceProxy::getStrobeLightsOnAsync(bool *o_strobeLightsOn)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getStrobeLightsOn"), setterCallback(o_strobeLightsOn));
|
||||
}
|
||||
|
||||
bool CXBusServiceProxy::getTaxiLightsOn() const
|
||||
bool CXSwiftBusServiceProxy::getTaxiLightsOn() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("getTaxiLightsOn"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getTaxiLightsOnAsync(bool *o_taxiLightsOn)
|
||||
void CXSwiftBusServiceProxy::getTaxiLightsOnAsync(bool *o_taxiLightsOn)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getTaxiLightsOn"), setterCallback(o_taxiLightsOn));
|
||||
}
|
||||
|
||||
|
||||
void CXBusServiceProxy::setCom1Active(int freq)
|
||||
void CXSwiftBusServiceProxy::setCom1Active(int freq)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setCom1Active"), freq);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::setCom1Standby(int freq)
|
||||
void CXSwiftBusServiceProxy::setCom1Standby(int freq)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setCom1Standby"), freq);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::setCom2Active(int freq)
|
||||
void CXSwiftBusServiceProxy::setCom2Active(int freq)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setCom2Active"), freq);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::setCom2Standby(int freq)
|
||||
void CXSwiftBusServiceProxy::setCom2Standby(int freq)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setCom2Standby"), freq);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::setTransponderCode(int code)
|
||||
void CXSwiftBusServiceProxy::setTransponderCode(int code)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setTransponderCode"), code);
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::setTransponderMode(int mode)
|
||||
void CXSwiftBusServiceProxy::setTransponderMode(int mode)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setTransponderMode"), mode);
|
||||
}
|
||||
double CXBusServiceProxy::getFlapsDeployRatio() const
|
||||
double CXSwiftBusServiceProxy::getFlapsDeployRatio() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getFlapsDeployRatio"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getFlapsDeployRatioAsync(double *o_flapsDeployRatio)
|
||||
void CXSwiftBusServiceProxy::getFlapsDeployRatioAsync(double *o_flapsDeployRatio)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getFlapsDeployRatio"), setterCallback(o_flapsDeployRatio));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getGearDeployRatio() const
|
||||
double CXSwiftBusServiceProxy::getGearDeployRatio() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getGearDeployRatio"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getGearDeployRatioAsync(double *o_gearDeployRatio)
|
||||
void CXSwiftBusServiceProxy::getGearDeployRatioAsync(double *o_gearDeployRatio)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getGearDeployRatio"), setterCallback(o_gearDeployRatio));
|
||||
}
|
||||
|
||||
int CXBusServiceProxy::getNumberOfEngines() const
|
||||
int CXSwiftBusServiceProxy::getNumberOfEngines() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<int>(QLatin1String("getNumberOfEngines"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getNumberOfEnginesAsync(double *o_numberOfEngines)
|
||||
void CXSwiftBusServiceProxy::getNumberOfEnginesAsync(double *o_numberOfEngines)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getNumberOfEngines"), setterCallback(o_numberOfEngines));
|
||||
}
|
||||
|
||||
QList<double> CXBusServiceProxy::getEngineN1Percentage() const
|
||||
QList<double> CXSwiftBusServiceProxy::getEngineN1Percentage() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<QList<double>>(QLatin1String("getEngineN1Percentage"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getEngineN1PercentageAsync(QList<double> *o_engineN1Percentage)
|
||||
void CXSwiftBusServiceProxy::getEngineN1PercentageAsync(QList<double> *o_engineN1Percentage)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getEngineN1Percentage"), setterCallback(o_engineN1Percentage));
|
||||
}
|
||||
|
||||
double CXBusServiceProxy::getSpeedBrakeRatio() const
|
||||
double CXSwiftBusServiceProxy::getSpeedBrakeRatio() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<double>(QLatin1String("getSpeedBrakeRatio"));
|
||||
}
|
||||
|
||||
void CXBusServiceProxy::getSpeedBrakeRatioAsync(double *o_speedBrakeRatio)
|
||||
void CXSwiftBusServiceProxy::getSpeedBrakeRatioAsync(double *o_speedBrakeRatio)
|
||||
{
|
||||
m_dbusInterface->callDBusAsync(QLatin1String("getSpeedBrakeRatio"), setterCallback(o_speedBrakeRatio));
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMPLUGIN_XBUS_SERVICE_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XBUS_SERVICE_PROXY_H
|
||||
#ifndef BLACKSIMPLUGIN_XSWIFTBUS_SERVICE_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XSWIFTBUS_SERVICE_PROXY_H
|
||||
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ class QDBusConnection;
|
||||
class QDBusPendingCallWatcher;
|
||||
|
||||
//! \cond PRIVATE
|
||||
#define XBUS_SERVICE_INTERFACENAME "org.swift_project.xbus.service"
|
||||
#define XBUS_SERVICE_OBJECTPATH "/xbus/service"
|
||||
#define XSWIFTBUS_SERVICE_INTERFACENAME "org.swift_project.xswiftbus.service"
|
||||
#define XSWIFTBUS_SERVICE_OBJECTPATH "/xswiftbus/service"
|
||||
//! \endcond
|
||||
|
||||
namespace BlackSimPlugin
|
||||
@@ -38,9 +38,9 @@ namespace BlackSimPlugin
|
||||
{
|
||||
|
||||
/*!
|
||||
* Proxy object connected to a real XBus::CService object via DBus
|
||||
* Proxy object connected to a real XSwiftBus::CService object via DBus
|
||||
*/
|
||||
class CXBusServiceProxy : public QObject
|
||||
class CXSwiftBusServiceProxy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -48,19 +48,19 @@ namespace BlackSimPlugin
|
||||
//! Service name
|
||||
static const QString &InterfaceName()
|
||||
{
|
||||
static QString s(XBUS_SERVICE_INTERFACENAME);
|
||||
static QString s(XSWIFTBUS_SERVICE_INTERFACENAME);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Service path
|
||||
static const QString &ObjectPath()
|
||||
{
|
||||
static QString s(XBUS_SERVICE_OBJECTPATH);
|
||||
static QString s(XSWIFTBUS_SERVICE_OBJECTPATH);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Constructor
|
||||
CXBusServiceProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
||||
CXSwiftBusServiceProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
||||
|
||||
//! Does the remote object exist?
|
||||
bool isValid() const { return m_dbusInterface->isValid(); }
|
||||
@@ -88,134 +88,134 @@ namespace BlackSimPlugin
|
||||
//! Emitted if an asynchronous method call caused a DBus error
|
||||
void asyncMethodError(QDBusError error);
|
||||
|
||||
//! \copydoc XBus::CService::aircraftModelChanged
|
||||
//! \copydoc XSwiftBus::CService::aircraftModelChanged
|
||||
void aircraftModelChanged(const QString &path, const QString &filename, const QString &livery, const QString &icao);
|
||||
|
||||
//! \copydoc XBus::CService::airportsInRangeUpdated
|
||||
//! \copydoc XSwiftBus::CService::airportsInRangeUpdated
|
||||
void airportsInRangeUpdated(const QStringList &icaoCodes, const QStringList &names, const QList<double> &lats, const QList<double> &lons, const QList<double> &alts);
|
||||
|
||||
public slots:
|
||||
//! \copydoc XBus::CService::addTextMessage
|
||||
//! \copydoc XSwiftBus::CService::addTextMessage
|
||||
void addTextMessage(const QString &text, double red, double green, double blue);
|
||||
|
||||
//! \copydoc XBus::CService::updateAirportsInRange
|
||||
//! \copydoc XSwiftBus::CService::updateAirportsInRange
|
||||
void updateAirportsInRange();
|
||||
|
||||
//! \copydoc XBus::CService::getAircraftModelPath
|
||||
//! \copydoc XSwiftBus::CService::getAircraftModelPath
|
||||
//! @{
|
||||
QString getAircraftModelPath() const;
|
||||
void getAircraftModelPathAsync(QString *o_modelPath);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getAircraftModelFilename
|
||||
//! \copydoc XSwiftBus::CService::getAircraftModelFilename
|
||||
//! @{
|
||||
QString getAircraftModelFilename() const;
|
||||
void getAircraftModelFilenameAsync(QString *o_modelFilename);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getAircraftLivery
|
||||
//! \copydoc XSwiftBus::CService::getAircraftLivery
|
||||
//! @{
|
||||
QString getAircraftLivery() const;
|
||||
void getAircraftLiveryAsync(QString *o_modelLivery);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getAircraftIcaoCode
|
||||
//! \copydoc XSwiftBus::CService::getAircraftIcaoCode
|
||||
//! @{
|
||||
QString getAircraftIcaoCode() const;
|
||||
void getAircraftIcaoCodeAsync(QString *o_icaoCode);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getXPlaneVersionMajor
|
||||
//! \copydoc XSwiftBus::CService::getXPlaneVersionMajor
|
||||
//! @{
|
||||
int getXPlaneVersionMajor() const;
|
||||
void getXPlaneVersionMajorAsync(int *o_versionMajor);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getXPlaneVersionMinor
|
||||
//! \copydoc XSwiftBus::CService::getXPlaneVersionMinor
|
||||
//! @{
|
||||
int getXPlaneVersionMinor() const;
|
||||
void getXPlaneVersionMinorAsync(int *o_versionMinor);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getXPlaneInstallationPath
|
||||
//! \copydoc XSwiftBus::CService::getXPlaneInstallationPath
|
||||
//! @{
|
||||
QString getXPlaneInstallationPath() const;
|
||||
void getXPlaneInstallationPathAsync(QString *o_installPath);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getXPlanePreferencesPath
|
||||
//! \copydoc XSwiftBus::CService::getXPlanePreferencesPath
|
||||
//! @{
|
||||
QString getXPlanePreferencesPath() const;
|
||||
void getXPlanePreferencesPathAsync(QString *o_prefsPath);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::isPaused
|
||||
//! \copydoc XSwiftBus::CService::isPaused
|
||||
//! @{
|
||||
bool isPaused() const;
|
||||
void isPausedAsync(bool *o_paused);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::isUsingRealTime
|
||||
//! \copydoc XSwiftBus::CService::isUsingRealTime
|
||||
//! @{
|
||||
bool isUsingRealTime() const;
|
||||
void isUsingRealTimeAsync(bool *o_isRealTime);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getLatitude
|
||||
//! \copydoc XSwiftBus::CService::getLatitude
|
||||
//! @{
|
||||
double getLatitude() const;
|
||||
void getLatitudeAsync(double *o_latitude);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getLongitude
|
||||
//! \copydoc XSwiftBus::CService::getLongitude
|
||||
//! @{
|
||||
double getLongitude() const;
|
||||
void getLongitudeAsync(double *o_longitude);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getAltitudeMSL
|
||||
//! \copydoc XSwiftBus::CService::getAltitudeMSL
|
||||
//! @{
|
||||
double getAltitudeMSL() const;
|
||||
void getAltitudeMSLAsync(double *o_altitude);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getHeightAGL
|
||||
//! \copydoc XSwiftBus::CService::getHeightAGL
|
||||
//! @{
|
||||
double getHeightAGL() const;
|
||||
void getHeightAGLAsync(double *o_height);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getGroundSpeed
|
||||
//! \copydoc XSwiftBus::CService::getGroundSpeed
|
||||
//! @{
|
||||
double getGroundSpeed() const;
|
||||
void getGroundSpeedAsync(double *o_groundspeed);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getIndicatedAirspeed
|
||||
//! \copydoc XSwiftBus::CService::getIndicatedAirspeed
|
||||
//! @{
|
||||
double getIndicatedAirspeed() const;
|
||||
void getIndicatedAirspeedAsync(double *o_ias);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTrueAirspeed
|
||||
//! \copydoc XSwiftBus::CService::getTrueAirspeed
|
||||
//! @{
|
||||
double getTrueAirspeed() const;
|
||||
void getTrueAirspeedAsync(double *o_tas);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getPitch
|
||||
//! \copydoc XSwiftBus::CService::getPitch
|
||||
//! @{
|
||||
double getPitch() const;
|
||||
void getPitchAsync(double *o_pitch);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getRoll
|
||||
//! \copydoc XSwiftBus::CService::getRoll
|
||||
//! @{
|
||||
double getRoll() const;
|
||||
void getRollAsync(double *o_roll);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTrueHeading
|
||||
//! \copydoc XSwiftBus::CService::getTrueHeading
|
||||
//! @{
|
||||
double getTrueHeading() const;
|
||||
void getTrueHeadingAsync(double *o_heading);
|
||||
@@ -233,124 +233,124 @@ namespace BlackSimPlugin
|
||||
void getAllWheelsOnGroundAsync(bool *o_allWheels);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getCom1Active
|
||||
//! \copydoc XSwiftBus::CService::getCom1Active
|
||||
//! @{
|
||||
int getCom1Active() const;
|
||||
void getCom1ActiveAsync(int *o_com1Active);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getCom1Standby
|
||||
//! \copydoc XSwiftBus::CService::getCom1Standby
|
||||
//! @{
|
||||
int getCom1Standby() const;
|
||||
void getCom1StandbyAsync(int *o_com1Standby);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getCom2Active
|
||||
//! \copydoc XSwiftBus::CService::getCom2Active
|
||||
//! @{
|
||||
int getCom2Active() const;
|
||||
void getCom2ActiveAsync(int *o_com2Active);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getCom2Standby
|
||||
//! \copydoc XSwiftBus::CService::getCom2Standby
|
||||
//! @{
|
||||
int getCom2Standby() const;
|
||||
void getCom2StandbyAsync(int *o_com2Standby);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTransponderCode
|
||||
//! \copydoc XSwiftBus::CService::getTransponderCode
|
||||
//! @{
|
||||
int getTransponderCode() const;
|
||||
void getTransponderCodeAsync(int *o_xpdrCode);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTransponderMode
|
||||
//! \copydoc XSwiftBus::CService::getTransponderMode
|
||||
//! @{
|
||||
int getTransponderMode() const;
|
||||
void getTransponderModeAsync(int *o_xpdrMode);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTransponderIdent
|
||||
//! \copydoc XSwiftBus::CService::getTransponderIdent
|
||||
//! @{
|
||||
bool getTransponderIdent() const;
|
||||
void getTransponderIdentAsync(bool *o_ident);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getLandingLightsOn
|
||||
//! \copydoc XSwiftBus::CService::getLandingLightsOn
|
||||
//! @{
|
||||
bool getBeaconLightsOn() const;
|
||||
void getBeaconLightsOnAsync(bool *o_beaconLightsOn);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getLandingLightsOn
|
||||
//! \copydoc XSwiftBus::CService::getLandingLightsOn
|
||||
//! @{
|
||||
bool getLandingLightsOn() const;
|
||||
void getLandingLightsOnAsync(bool *o_landingLightsOn);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getNavLightsOn
|
||||
//! \copydoc XSwiftBus::CService::getNavLightsOn
|
||||
//! @{
|
||||
bool getNavLightsOn() const;
|
||||
void getNavLightsOnAsync(bool *o_navLightsOn);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getStrobeLightsOn
|
||||
//! \copydoc XSwiftBus::CService::getStrobeLightsOn
|
||||
//! @{
|
||||
bool getStrobeLightsOn() const;
|
||||
void getStrobeLightsOnAsync(bool *o_strobeLightsOn);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getTaxiLightsOn
|
||||
//! \copydoc XSwiftBus::CService::getTaxiLightsOn
|
||||
|
||||
//! @{
|
||||
bool getTaxiLightsOn() const;
|
||||
void getTaxiLightsOnAsync(bool *o_taxiLightsOn);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::setCom1Active
|
||||
//! \copydoc XSwiftBus::CService::setCom1Active
|
||||
void setCom1Active(int freq);
|
||||
|
||||
//! \copydoc XBus::CService::setCom1Standby
|
||||
//! \copydoc XSwiftBus::CService::setCom1Standby
|
||||
void setCom1Standby(int freq);
|
||||
|
||||
//! \copydoc XBus::CService::setCom2Active
|
||||
//! \copydoc XSwiftBus::CService::setCom2Active
|
||||
void setCom2Active(int freq);
|
||||
|
||||
//! \copydoc XBus::CService::setCom2Standby
|
||||
//! \copydoc XSwiftBus::CService::setCom2Standby
|
||||
void setCom2Standby(int freq);
|
||||
|
||||
//! \copydoc XBus::CService::setTransponderCode
|
||||
//! \copydoc XSwiftBus::CService::setTransponderCode
|
||||
void setTransponderCode(int code);
|
||||
|
||||
//! \copydoc XBus::CService::setTransponderMode
|
||||
//! \copydoc XSwiftBus::CService::setTransponderMode
|
||||
void setTransponderMode(int mode);
|
||||
|
||||
//! \copydoc XBus::CService::getFlapsDeployRatio
|
||||
//! \copydoc XSwiftBus::CService::getFlapsDeployRatio
|
||||
|
||||
//! @{
|
||||
double getFlapsDeployRatio() const;
|
||||
void getFlapsDeployRatioAsync(double *o_flapsDeployRatio);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getGearDeployRatio
|
||||
//! \copydoc XSwiftBus::CService::getGearDeployRatio
|
||||
//! @{
|
||||
double getGearDeployRatio() const;
|
||||
void getGearDeployRatioAsync(double *o_gearDeployRatio);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getNumberOfEngines
|
||||
//! \copydoc XSwiftBus::CService::getNumberOfEngines
|
||||
|
||||
//! @{
|
||||
int getNumberOfEngines() const;
|
||||
void getNumberOfEnginesAsync(double *o_numberOfEngines);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getEngineN1Percentage
|
||||
//! \copydoc XSwiftBus::CService::getEngineN1Percentage
|
||||
//! @{
|
||||
QList<double> getEngineN1Percentage() const;
|
||||
void getEngineN1PercentageAsync(QList<double> *o_engineN1Percentage);
|
||||
//! @}
|
||||
|
||||
//! \copydoc XBus::CService::getSpeedBrakeRatio
|
||||
//! \copydoc XSwiftBus::CService::getSpeedBrakeRatio
|
||||
//! @{
|
||||
double getSpeedBrakeRatio() const;
|
||||
void getSpeedBrakeRatioAsync(double *o_speedBrakeRatio);
|
||||
@@ -7,103 +7,103 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "xbustrafficproxy.h"
|
||||
#include "xswiftbustrafficproxy.h"
|
||||
|
||||
#include <QLatin1String>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
#define XBUS_SERVICENAME "org.swift-project.xbus"
|
||||
#define XSWIFTBUS_SERVICENAME "org.swift-project.xswiftbus"
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace XPlane
|
||||
{
|
||||
|
||||
CXBusTrafficProxy::CXBusTrafficProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
||||
CXSwiftBusTrafficProxy::CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent, bool dummy) : QObject(parent)
|
||||
{
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
if (! dummy) { m_dbusInterface->relayParentSignals(); }
|
||||
}
|
||||
|
||||
bool CXBusTrafficProxy::initialize()
|
||||
bool CXSwiftBusTrafficProxy::initialize()
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("initialize"));
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::cleanup()
|
||||
void CXSwiftBusTrafficProxy::cleanup()
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("cleanup"));
|
||||
}
|
||||
|
||||
bool CXBusTrafficProxy::loadPlanesPackage(const QString &path)
|
||||
bool CXSwiftBusTrafficProxy::loadPlanesPackage(const QString &path)
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("loadPlanesPackage"), path);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setDefaultIcao(const QString &defaultIcao)
|
||||
void CXSwiftBusTrafficProxy::setDefaultIcao(const QString &defaultIcao)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setDefaultIcao"), defaultIcao);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setDrawingLabels(bool drawing)
|
||||
void CXSwiftBusTrafficProxy::setDrawingLabels(bool drawing)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setDrawingLabels"), drawing);
|
||||
}
|
||||
|
||||
bool CXBusTrafficProxy::isDrawingLabels() const
|
||||
bool CXSwiftBusTrafficProxy::isDrawingLabels() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("isDrawingLabels"));
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::updateInstalledModels() const
|
||||
void CXSwiftBusTrafficProxy::updateInstalledModels() const
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("updateInstalledModels"));
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setMaxPlanes(int planes)
|
||||
void CXSwiftBusTrafficProxy::setMaxPlanes(int planes)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setMaxPlanes"), planes);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setMaxDrawDistance(float nauticalMiles)
|
||||
void CXSwiftBusTrafficProxy::setMaxDrawDistance(float nauticalMiles)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setMaxDrawDistance"), nauticalMiles);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
||||
void CXSwiftBusTrafficProxy::addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("addPlane"), callsign, modelName, aircraftIcao, airlineIcao, livery);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::removePlane(const QString &callsign)
|
||||
void CXSwiftBusTrafficProxy::removePlane(const QString &callsign)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("removePlane"), callsign);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::removeAllPlanes()
|
||||
void CXSwiftBusTrafficProxy::removeAllPlanes()
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("removeAllPlanes"));
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime)
|
||||
void CXSwiftBusTrafficProxy::addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("addPlanePosition"), callsign, latitude, longitude, altitude, pitch, roll, heading, relativeTime);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::addPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
void CXSwiftBusTrafficProxy::addPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
double elevator, double rudder, double aileron, bool landLight, bool beaconLight, bool strobeLight, bool navLight, int lightPattern, bool onGround, qint64 relativeTime)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("addPlaneSurfaces"), callsign, gear, flap, spoiler, speedBrake, slat, wingSweep, thrust, elevator, rudder, aileron,
|
||||
landLight, beaconLight, strobeLight, navLight, lightPattern, onGround, relativeTime);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setPlaneTransponder(const QString &callsign, int code, bool modeC, bool ident)
|
||||
void CXSwiftBusTrafficProxy::setPlaneTransponder(const QString &callsign, int code, bool modeC, bool ident)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setPlaneTransponder"), callsign, code, modeC, ident);
|
||||
}
|
||||
|
||||
void CXBusTrafficProxy::setInterpolatorMode(const QString &callsign, bool spline)
|
||||
void CXSwiftBusTrafficProxy::setInterpolatorMode(const QString &callsign, bool spline)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setInterpolatorMode"), callsign, spline);
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMPLUGIN_XBUS_TRAFFIC_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XBUS_TRAFFIC_PROXY_H
|
||||
#ifndef BLACKSIMPLUGIN_XSWIFTBUS_TRAFFIC_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XSWIFTBUS_TRAFFIC_PROXY_H
|
||||
|
||||
#include "blackmisc/genericdbusinterface.h"
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
class QDBusConnection;
|
||||
|
||||
//! \cond PRIVATE
|
||||
#define XBUS_TRAFFIC_INTERFACENAME "org.swift_project.xbus.traffic"
|
||||
#define XBUS_TRAFFIC_OBJECTPATH "/xbus/traffic"
|
||||
#define XSWIFTBUS_TRAFFIC_INTERFACENAME "org.swift_project.xswiftbus.traffic"
|
||||
#define XSWIFTBUS_TRAFFIC_OBJECTPATH "/xswiftbus/traffic"
|
||||
//! \endcond
|
||||
|
||||
namespace BlackSimPlugin
|
||||
@@ -31,9 +31,9 @@ namespace BlackSimPlugin
|
||||
{
|
||||
|
||||
/*!
|
||||
* Proxy object connected to a real XBus::CTraffic object via DBus
|
||||
* Proxy object connected to a real XSwiftBus::CTraffic object via DBus
|
||||
*/
|
||||
class CXBusTrafficProxy : public QObject
|
||||
class CXSwiftBusTrafficProxy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -41,19 +41,19 @@ namespace BlackSimPlugin
|
||||
//! Service name
|
||||
static const QString &InterfaceName()
|
||||
{
|
||||
static QString s(XBUS_TRAFFIC_INTERFACENAME);
|
||||
static QString s(XSWIFTBUS_TRAFFIC_INTERFACENAME);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Service path
|
||||
static const QString &ObjectPath()
|
||||
{
|
||||
static QString s(XBUS_TRAFFIC_OBJECTPATH);
|
||||
static QString s(XSWIFTBUS_TRAFFIC_OBJECTPATH);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Constructor
|
||||
CXBusTrafficProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
||||
CXSwiftBusTrafficProxy(QDBusConnection &connection, QObject *parent = nullptr, bool dummy = false);
|
||||
|
||||
//! Does the remote object exist?
|
||||
bool isValid() const { return m_dbusInterface->isValid(); }
|
||||
@@ -62,57 +62,57 @@ namespace BlackSimPlugin
|
||||
BlackMisc::CGenericDBusInterface *m_dbusInterface = nullptr;
|
||||
|
||||
signals:
|
||||
//! \copydoc XBus::CTraffic::installedModelsUpdated
|
||||
//! \copydoc XSwiftBus::CTraffic::installedModelsUpdated
|
||||
void installedModelsUpdated(const QStringList &modelStrings, const QStringList &icaos, const QStringList &airlines, const QStringList &liveries);
|
||||
|
||||
public slots:
|
||||
//! \copydoc XBus::CTraffic::initialize
|
||||
//! \copydoc XSwiftBus::CTraffic::initialize
|
||||
bool initialize();
|
||||
|
||||
//! \copydoc XBus::CTraffic::cleanup
|
||||
//! \copydoc XSwiftBus::CTraffic::cleanup
|
||||
void cleanup();
|
||||
|
||||
//! \copydoc XBus::CTraffic::loadPlanesPackage
|
||||
//! \copydoc XSwiftBus::CTraffic::loadPlanesPackage
|
||||
bool loadPlanesPackage(const QString &path);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setDefaultIcao
|
||||
//! \copydoc XSwiftBus::CTraffic::setDefaultIcao
|
||||
void setDefaultIcao(const QString &defaultIcao);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setDrawingLabels
|
||||
//! \copydoc XSwiftBus::CTraffic::setDrawingLabels
|
||||
void setDrawingLabels(bool drawing);
|
||||
|
||||
//! \copydoc XBus::CTraffic::isDrawingLabels
|
||||
//! \copydoc XSwiftBus::CTraffic::isDrawingLabels
|
||||
bool isDrawingLabels() const;
|
||||
|
||||
//! \copydoc XBus::CTraffic::updateInstalledModels
|
||||
//! \copydoc XSwiftBus::CTraffic::updateInstalledModels
|
||||
void updateInstalledModels() const;
|
||||
|
||||
//! \copydoc XBus::CTraffic::setMaxPlanes
|
||||
//! \copydoc XSwiftBus::CTraffic::setMaxPlanes
|
||||
void setMaxPlanes(int planes);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setMaxDrawDistance
|
||||
//! \copydoc XSwiftBus::CTraffic::setMaxDrawDistance
|
||||
void setMaxDrawDistance(float nauticalMiles);
|
||||
|
||||
//! \copydoc XBus::CTraffic::addPlane
|
||||
//! \copydoc XSwiftBus::CTraffic::addPlane
|
||||
void addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery);
|
||||
|
||||
//! \copydoc XBus::CTraffic::removePlane
|
||||
//! \copydoc XSwiftBus::CTraffic::removePlane
|
||||
void removePlane(const QString &callsign);
|
||||
|
||||
//! \copydoc XBus::CTraffic::removeAllPlanes
|
||||
//! \copydoc XSwiftBus::CTraffic::removeAllPlanes
|
||||
void removeAllPlanes();
|
||||
|
||||
//! \copydoc XBus::CTraffic::addPlanePosition
|
||||
//! \copydoc XSwiftBus::CTraffic::addPlanePosition
|
||||
void addPlanePosition(const QString &callsign, double latitude, double longitude, double altitude, double pitch, double roll, double heading, qint64 relativeTime);
|
||||
|
||||
//! \copydoc XBus::CTraffic::addPlaneSurfaces
|
||||
//! \copydoc XSwiftBus::CTraffic::addPlaneSurfaces
|
||||
void addPlaneSurfaces(const QString &callsign, double gear, double flap, double spoiler, double speedBrake, double slat, double wingSweep, double thrust,
|
||||
double elevator, double rudder, double aileron, bool landLight, bool beaconLight, bool strobeLight, bool navLight, int lightPattern, bool onGround, qint64 relativeTime);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setPlaneTransponder
|
||||
//! \copydoc XSwiftBus::CTraffic::setPlaneTransponder
|
||||
void setPlaneTransponder(const QString &callsign, int code, bool modeC, bool ident);
|
||||
|
||||
//! \copydoc XBus::CTraffic::setInterpolatorMode
|
||||
//! \copydoc XSwiftBus::CTraffic::setInterpolatorMode
|
||||
void setInterpolatorMode(const QString &callsign, bool spline);
|
||||
};
|
||||
|
||||
@@ -7,80 +7,80 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "xbusweatherproxy.h"
|
||||
#include "xswiftbusweatherproxy.h"
|
||||
|
||||
#include <QLatin1String>
|
||||
|
||||
class QDBusConnection;
|
||||
|
||||
#define XBUS_SERVICENAME "org.swift-project.xbus"
|
||||
#define XSWIFTBUS_SERVICENAME "org.swift-project.xswiftbus"
|
||||
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace XPlane
|
||||
{
|
||||
|
||||
CXBusWeatherProxy::CXBusWeatherProxy(QDBusConnection &connection, QObject *parent) : QObject(parent)
|
||||
CXSwiftBusWeatherProxy::CXSwiftBusWeatherProxy(QDBusConnection &connection, QObject *parent) : QObject(parent)
|
||||
{
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
m_dbusInterface = new BlackMisc::CGenericDBusInterface(XSWIFTBUS_SERVICENAME, ObjectPath(), InterfaceName(), connection, this);
|
||||
}
|
||||
|
||||
bool CXBusWeatherProxy::isUsingRealWeather() const
|
||||
bool CXSwiftBusWeatherProxy::isUsingRealWeather() const
|
||||
{
|
||||
return m_dbusInterface->callDBusRet<bool>(QLatin1String("isUsingRealWeather"));
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setUseRealWeather(bool enable)
|
||||
void CXSwiftBusWeatherProxy::setUseRealWeather(bool enable)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setUseRealWeather"), enable);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setVisibility(double visibilityM)
|
||||
void CXSwiftBusWeatherProxy::setVisibility(double visibilityM)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setVisibility"), visibilityM);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setTemperature(int degreesC)
|
||||
void CXSwiftBusWeatherProxy::setTemperature(int degreesC)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setTemperature"), degreesC);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setDewPoint(int degreesC)
|
||||
void CXSwiftBusWeatherProxy::setDewPoint(int degreesC)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setDewPoint"), degreesC);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setQNH(double inHg)
|
||||
void CXSwiftBusWeatherProxy::setQNH(double inHg)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setQNH"), inHg);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setPrecipitationRatio(double precipRatio)
|
||||
void CXSwiftBusWeatherProxy::setPrecipitationRatio(double precipRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setPrecipitationRatio"), precipRatio);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setThunderstormRatio(double cbRatio)
|
||||
void CXSwiftBusWeatherProxy::setThunderstormRatio(double cbRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setThunderstormRatio"), cbRatio);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setTurbulenceRatio(double turbulenceRatio)
|
||||
void CXSwiftBusWeatherProxy::setTurbulenceRatio(double turbulenceRatio)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setTurbulenceRatio"), turbulenceRatio);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setRunwayFriction(int friction)
|
||||
void CXSwiftBusWeatherProxy::setRunwayFriction(int friction)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setRunwayFriction"), friction);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setCloudLayer(int layer, int base, int tops, int type, int coverage)
|
||||
void CXSwiftBusWeatherProxy::setCloudLayer(int layer, int base, int tops, int type, int coverage)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setCloudLayer"), layer, base, tops, type, coverage);
|
||||
}
|
||||
|
||||
void CXBusWeatherProxy::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
void CXSwiftBusWeatherProxy::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
m_dbusInterface->callDBus(QLatin1String("setWindLayer"), layer, altitude, direction, speed, shearDirection, shearSpeed, turbulence);
|
||||
}
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKSIMPLUGIN_XBUS_WEATHER_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XBUS_WEATHER_PROXY_H
|
||||
#ifndef BLACKSIMPLUGIN_XSWIFTBUS_WEATHER_PROXY_H
|
||||
#define BLACKSIMPLUGIN_XSWIFTBUS_WEATHER_PROXY_H
|
||||
|
||||
#include "blackmisc/genericdbusinterface.h"
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
class QDBusConnection;
|
||||
|
||||
//! \cond PRIVATE
|
||||
#define XBUS_WEATHER_INTERFACENAME "org.swift_project.xbus.weather"
|
||||
#define XBUS_WEATHER_OBJECTPATH "/xbus/weather"
|
||||
#define XSWIFTBUS_WEATHER_INTERFACENAME "org.swift_project.xswiftbus.weather"
|
||||
#define XSWIFTBUS_WEATHER_OBJECTPATH "/xswiftbus/weather"
|
||||
//! \endcond
|
||||
|
||||
namespace BlackSimPlugin
|
||||
@@ -30,9 +30,9 @@ namespace BlackSimPlugin
|
||||
{
|
||||
|
||||
/*!
|
||||
* Proxy object connected to a real XBus::CWeather object via DBus
|
||||
* Proxy object connected to a real XSwiftBus::CWeather object via DBus
|
||||
*/
|
||||
class CXBusWeatherProxy : public QObject
|
||||
class CXSwiftBusWeatherProxy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -40,19 +40,19 @@ namespace BlackSimPlugin
|
||||
//! Service name
|
||||
static const QString &InterfaceName()
|
||||
{
|
||||
static QString s(XBUS_WEATHER_INTERFACENAME);
|
||||
static QString s(XSWIFTBUS_WEATHER_INTERFACENAME);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Service path
|
||||
static const QString &ObjectPath()
|
||||
{
|
||||
static QString s(XBUS_WEATHER_OBJECTPATH);
|
||||
static QString s(XSWIFTBUS_WEATHER_OBJECTPATH);
|
||||
return s;
|
||||
}
|
||||
|
||||
//! Constructor
|
||||
CXBusWeatherProxy(QDBusConnection &connection, QObject *parent = nullptr);
|
||||
CXSwiftBusWeatherProxy(QDBusConnection &connection, QObject *parent = nullptr);
|
||||
|
||||
//! Does the remote object exist?
|
||||
bool isValid() const { return m_dbusInterface->isValid(); }
|
||||
@@ -61,40 +61,40 @@ namespace BlackSimPlugin
|
||||
BlackMisc::CGenericDBusInterface *m_dbusInterface = nullptr;
|
||||
|
||||
public slots:
|
||||
//! \copydoc XBus::CWeather::isUsingRealWeather
|
||||
//! \copydoc XSwiftBus::CWeather::isUsingRealWeather
|
||||
bool isUsingRealWeather() const;
|
||||
|
||||
//! \copydoc XBus::CWeather::setUseRealWeather
|
||||
//! \copydoc XSwiftBus::CWeather::setUseRealWeather
|
||||
void setUseRealWeather(bool enable);
|
||||
|
||||
//! \copydoc XBus::CWeather::setVisibility
|
||||
//! \copydoc XSwiftBus::CWeather::setVisibility
|
||||
void setVisibility(double visibilityM);
|
||||
|
||||
//! \copydoc XBus::CWeather::setTemperature
|
||||
//! \copydoc XSwiftBus::CWeather::setTemperature
|
||||
void setTemperature(int degreesC);
|
||||
|
||||
//! \copydoc XBus::CWeather::setDewPoint
|
||||
//! \copydoc XSwiftBus::CWeather::setDewPoint
|
||||
void setDewPoint(int degreesC);
|
||||
|
||||
//! \copydoc XBus::CWeather::setQNH
|
||||
//! \copydoc XSwiftBus::CWeather::setQNH
|
||||
void setQNH(double inHg);
|
||||
|
||||
//! \copydoc XBus::CWeather::setPrecipitationRatio
|
||||
//! \copydoc XSwiftBus::CWeather::setPrecipitationRatio
|
||||
void setPrecipitationRatio(double precipRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setThunderstormRatio
|
||||
//! \copydoc XSwiftBus::CWeather::setThunderstormRatio
|
||||
void setThunderstormRatio(double cbRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setTurbulenceRatio
|
||||
//! \copydoc XSwiftBus::CWeather::setTurbulenceRatio
|
||||
void setTurbulenceRatio(double turbulenceRatio);
|
||||
|
||||
//! \copydoc XBus::CWeather::setRunwayFriction
|
||||
//! \copydoc XSwiftBus::CWeather::setRunwayFriction
|
||||
void setRunwayFriction(int friction);
|
||||
|
||||
//! \copydoc XBus::CWeather::setCloudLayer
|
||||
//! \copydoc XSwiftBus::CWeather::setCloudLayer
|
||||
void setCloudLayer(int layer, int base, int tops, int type, int coverage);
|
||||
|
||||
//! \copydoc XBus::CWeather::setWindLayer
|
||||
//! \copydoc XSwiftBus::CWeather::setWindLayer
|
||||
void setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence);
|
||||
};
|
||||
|
||||
@@ -26,12 +26,12 @@ namespace BlackSimPlugin
|
||||
namespace XPlane
|
||||
{
|
||||
/*!
|
||||
* Setting for XBus.
|
||||
* Setting for XSwiftBus.
|
||||
*/
|
||||
struct TXBusServer : public BlackMisc::TSettingTrait<QString>
|
||||
struct TXSwiftBusServer : public BlackMisc::TSettingTrait<QString>
|
||||
{
|
||||
//! \copydoc BlackMisc::TSettingTrait::key
|
||||
static const char *key() { return "xbus/server"; }
|
||||
static const char *key() { return "xswiftbus/server"; }
|
||||
|
||||
//! \copydoc BlackMisc::TSettingTrait::defaultValue
|
||||
static QString defaultValue() { return QStringLiteral("session"); }
|
||||
|
||||
@@ -32,9 +32,9 @@ using namespace BlackMisc;
|
||||
|
||||
namespace
|
||||
{
|
||||
QString xBusOriginDir()
|
||||
QString xSwiftBusOriginDir()
|
||||
{
|
||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/../xbus");
|
||||
return CDirectoryUtils::applicationDirectoryPath() % QStringLiteral("/../xswiftbus");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,19 +48,19 @@ namespace BlackSimPlugin
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::sessionBusAddress());
|
||||
ui->cp_XBusServer->addItem(BlackMisc::CDBusServer::systemBusAddress());
|
||||
ui->cp_XSwiftBusServer->addItem(BlackMisc::CDBusServer::sessionBusAddress());
|
||||
ui->cp_XSwiftBusServer->addItem(BlackMisc::CDBusServer::systemBusAddress());
|
||||
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::ps_storeSettings);
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::accepted, this, &CSimulatorXPlaneConfigWindow::close);
|
||||
connect(ui->bb_OkCancel, &QDialogButtonBox::rejected, this, &CSimulatorXPlaneConfigWindow::close);
|
||||
|
||||
ui->cp_XBusServer->setCurrentText(m_xbusServerSetting.getThreadLocal());
|
||||
ui->cp_XSwiftBusServer->setCurrentText(m_xswiftbusServerSetting.getThreadLocal());
|
||||
|
||||
if (xBusAvailable())
|
||||
connect(ui->pb_InstallXBus, &QPushButton::clicked, this, &CSimulatorXPlaneConfigWindow::ps_installXBus);
|
||||
if (xSwiftBusAvailable())
|
||||
connect(ui->pb_InstallXSwiftBus, &QPushButton::clicked, this, &CSimulatorXPlaneConfigWindow::ps_installXSwiftBus);
|
||||
else
|
||||
ui->pb_InstallXBus->setEnabled(false);
|
||||
ui->pb_InstallXSwiftBus->setEnabled(false);
|
||||
}
|
||||
|
||||
CSimulatorXPlaneConfigWindow::~CSimulatorXPlaneConfigWindow()
|
||||
@@ -68,20 +68,20 @@ namespace BlackSimPlugin
|
||||
|
||||
}
|
||||
|
||||
bool CSimulatorXPlaneConfigWindow::xBusAvailable()
|
||||
bool CSimulatorXPlaneConfigWindow::xSwiftBusAvailable()
|
||||
{
|
||||
return QDir(xBusOriginDir()).exists();
|
||||
return QDir(xSwiftBusOriginDir()).exists();
|
||||
}
|
||||
|
||||
void CSimulatorXPlaneConfigWindow::ps_storeSettings()
|
||||
{
|
||||
if (ui->cp_XBusServer->currentText() != m_xbusServerSetting.getThreadLocal())
|
||||
if (ui->cp_XSwiftBusServer->currentText() != m_xswiftbusServerSetting.getThreadLocal())
|
||||
{
|
||||
m_xbusServerSetting.set(ui->cp_XBusServer->currentText());
|
||||
m_xswiftbusServerSetting.set(ui->cp_XSwiftBusServer->currentText());
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorXPlaneConfigWindow::ps_installXBus()
|
||||
void CSimulatorXPlaneConfigWindow::ps_installXSwiftBus()
|
||||
{
|
||||
const QString xPlaneLocation = BlackMisc::Simulation::XPlane::CXPlaneUtil::xplaneRootDir();
|
||||
QString path = QFileDialog::getExistingDirectory(parentWidget(),
|
||||
@@ -99,17 +99,17 @@ namespace BlackSimPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
path.append("/xbus");
|
||||
path.append("/xswiftbus");
|
||||
|
||||
// TODO Use QtConcurrent here, maybe?
|
||||
const bool result = BlackMisc::CFileUtils::copyRecursively(xBusOriginDir(), path);
|
||||
const bool result = BlackMisc::CFileUtils::copyRecursively(xSwiftBusOriginDir(), path);
|
||||
if (result)
|
||||
{
|
||||
QMessageBox::information(this, tr("XBus installed"), tr("You may now launch your X-Plane and start using XBus!"));
|
||||
QMessageBox::information(this, tr("XSwiftBus installed"), tr("You may now launch your X-Plane and start using XSwiftBus!"));
|
||||
}
|
||||
else
|
||||
{
|
||||
QMessageBox::warning(this, tr("Failed installing XBus"), tr("Failed installing the XBus plugin in your X-Plane installation directory; try installing it manually."));
|
||||
QMessageBox::warning(this, tr("Failed installing XSwiftBus"), tr("Failed installing the XSwiftBus plugin in your X-Plane installation directory; try installing it manually."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,16 @@ namespace BlackSimPlugin
|
||||
virtual ~CSimulatorXPlaneConfigWindow();
|
||||
|
||||
private:
|
||||
//! Checks whether xbus is present in the distributed directory.
|
||||
bool xBusAvailable();
|
||||
//! Checks whether xswiftbus is present in the distributed directory.
|
||||
bool xSwiftBusAvailable();
|
||||
|
||||
private slots:
|
||||
void ps_storeSettings();
|
||||
void ps_installXBus();
|
||||
void ps_installXSwiftBus();
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CSimulatorXPlaneConfigWindow> ui;
|
||||
BlackMisc::CSetting<TXBusServer> m_xbusServerSetting { this };
|
||||
BlackMisc::CSetting<TXSwiftBusServer> m_xswiftbusServerSetting { this };
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,19 +15,19 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cp_XBusServer"/>
|
||||
<widget class="QComboBox" name="cp_XSwiftBusServer"/>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_XBusServer">
|
||||
<widget class="QLabel" name="lbl_XSwiftBusServer">
|
||||
<property name="text">
|
||||
<string>XBus server:</string>
|
||||
<string>XSwiftBus server:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QPushButton" name="pb_InstallXBus">
|
||||
<widget class="QPushButton" name="pb_InstallXSwiftBus">
|
||||
<property name="text">
|
||||
<string>Install XBus in the X-Plane directory...</string>
|
||||
<string>Install XSwiftBus in the X-Plane directory...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user