[XSwiftBus] Give PQ variables a unit

ref T313
This commit is contained in:
Roland Rossgotterer
2018-11-21 16:52:20 +01:00
committed by Klaus Basan
parent 1edef31c0a
commit ec8245ea53
15 changed files with 310 additions and 310 deletions

View File

@@ -207,26 +207,26 @@ namespace BlackSimPlugin
if (this->isConnected()) if (this->isConnected())
{ {
m_serviceProxy->getOwnAircraftSituationData(&m_xplaneData); m_serviceProxy->getOwnAircraftSituationData(&m_xplaneData);
m_serviceProxy->getCom1ActiveAsync(&m_xplaneData.com1Active); m_serviceProxy->getCom1ActiveKhzAsync(&m_xplaneData.com1ActiveKhz);
m_serviceProxy->getCom1StandbyAsync(&m_xplaneData.com1Standby); m_serviceProxy->getCom1StandbyKhzAsync(&m_xplaneData.com1StandbyKhz);
m_serviceProxy->getCom2ActiveAsync(&m_xplaneData.com2Active); m_serviceProxy->getCom2ActiveKhzAsync(&m_xplaneData.com2ActiveKhz);
m_serviceProxy->getCom2StandbyAsync(&m_xplaneData.com2Standby); m_serviceProxy->getCom2StandbyKhzAsync(&m_xplaneData.com2StandbyKhz);
m_serviceProxy->getTransponderCodeAsync(&m_xplaneData.xpdrCode); m_serviceProxy->getTransponderCodeAsync(&m_xplaneData.xpdrCode);
m_serviceProxy->getTransponderModeAsync(&m_xplaneData.xpdrMode); m_serviceProxy->getTransponderModeAsync(&m_xplaneData.xpdrMode);
m_serviceProxy->getTransponderIdentAsync(&m_xplaneData.xpdrIdent); m_serviceProxy->getTransponderIdentAsync(&m_xplaneData.xpdrIdent);
m_serviceProxy->getAllWheelsOnGroundAsync(&m_xplaneData.onGroundAll); m_serviceProxy->getAllWheelsOnGroundAsync(&m_xplaneData.onGroundAll);
CAircraftSituation situation; CAircraftSituation situation;
situation.setPosition({ m_xplaneData.latitude, m_xplaneData.longitude, 0 }); situation.setPosition({ m_xplaneData.latitudeDeg, m_xplaneData.longitudeDeg, 0 });
CAltitude altitude { m_xplaneData.altitude, CAltitude::MeanSeaLevel, CLengthUnit::m() }; CAltitude altitude { m_xplaneData.altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() };
situation.setAltitude({ m_xplaneData.altitude, CAltitude::MeanSeaLevel, CLengthUnit::m() }); situation.setAltitude({ m_xplaneData.altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() });
CPressure seaLevelPressure({ m_xplaneData.seaLeveLPressure, CPressureUnit::inHg() }); CPressure seaLevelPressure({ m_xplaneData.seaLevelPressureInHg, CPressureUnit::inHg() });
CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure)); CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure));
situation.setPressureAltitude(pressureAltitude); situation.setPressureAltitude(pressureAltitude);
situation.setHeading({ m_xplaneData.trueHeading, CHeading::True, CAngleUnit::deg() }); situation.setHeading({ m_xplaneData.trueHeadingDeg, CHeading::True, CAngleUnit::deg() });
situation.setPitch({ m_xplaneData.pitch, CAngleUnit::deg() }); situation.setPitch({ m_xplaneData.pitchDeg, CAngleUnit::deg() });
situation.setBank({ m_xplaneData.roll, CAngleUnit::deg() }); situation.setBank({ m_xplaneData.rollDeg, CAngleUnit::deg() });
situation.setGroundSpeed({ m_xplaneData.groundspeed, CSpeedUnit::m_s() }); situation.setGroundSpeed({ m_xplaneData.groundspeedMs, CSpeedUnit::m_s() });
// updates // updates
updateOwnIcaoCodes(m_xplaneData.aircraftIcaoCode, CAirlineIcaoCode()); updateOwnIcaoCodes(m_xplaneData.aircraftIcaoCode, CAirlineIcaoCode());
@@ -239,12 +239,12 @@ namespace BlackSimPlugin
CTransponder transponder(myAircraft.getTransponder()); CTransponder transponder(myAircraft.getTransponder());
// updates // updates
com1.setFrequencyActive(CFrequency(m_xplaneData.com1Active, CFrequencyUnit::kHz())); com1.setFrequencyActive(CFrequency(m_xplaneData.com1ActiveKhz, CFrequencyUnit::kHz()));
com1.setFrequencyStandby(CFrequency(m_xplaneData.com1Standby, CFrequencyUnit::kHz())); com1.setFrequencyStandby(CFrequency(m_xplaneData.com1StandbyKhz, CFrequencyUnit::kHz()));
const bool changedCom1 = myAircraft.getCom1System() != com1; const bool changedCom1 = myAircraft.getCom1System() != com1;
com2.setFrequencyActive(CFrequency(m_xplaneData.com2Active, CFrequencyUnit::kHz())); com2.setFrequencyActive(CFrequency(m_xplaneData.com2ActiveKhz, CFrequencyUnit::kHz()));
com2.setFrequencyStandby(CFrequency(m_xplaneData.com2Standby, CFrequencyUnit::kHz())); com2.setFrequencyStandby(CFrequency(m_xplaneData.com2StandbyKhz, CFrequencyUnit::kHz()));
const bool changedCom2 = myAircraft.getCom2System() != com2; const bool changedCom2 = myAircraft.getCom2System() != com2;
transponder = CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent)); transponder = CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent));
@@ -493,21 +493,21 @@ namespace BlackSimPlugin
{ {
Q_ASSERT(this->isConnected()); Q_ASSERT(this->isConnected());
if (originator == this->identifier()) { return false; } if (originator == this->identifier()) { return false; }
auto com1 = CComSystem::getCom1System({ m_xplaneData.com1Active, CFrequencyUnit::kHz() }, { m_xplaneData.com1Standby, CFrequencyUnit::kHz() }); auto com1 = CComSystem::getCom1System({ m_xplaneData.com1ActiveKhz, CFrequencyUnit::kHz() }, { m_xplaneData.com1StandbyKhz, CFrequencyUnit::kHz() });
auto com2 = CComSystem::getCom2System({ m_xplaneData.com2Active, CFrequencyUnit::kHz() }, { m_xplaneData.com2Standby, CFrequencyUnit::kHz() }); auto com2 = CComSystem::getCom2System({ m_xplaneData.com2ActiveKhz, CFrequencyUnit::kHz() }, { m_xplaneData.com2StandbyKhz, CFrequencyUnit::kHz() });
auto xpdr = CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent)); auto xpdr = CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent));
if (aircraft.hasChangedCockpitData(com1, com2, xpdr)) if (aircraft.hasChangedCockpitData(com1, com2, xpdr))
{ {
m_xplaneData.com1Active = aircraft.getCom1System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); m_xplaneData.com1ActiveKhz = aircraft.getCom1System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz());
m_xplaneData.com1Standby = aircraft.getCom1System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); m_xplaneData.com1StandbyKhz = aircraft.getCom1System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz());
m_xplaneData.com2Active = aircraft.getCom2System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); m_xplaneData.com2ActiveKhz = aircraft.getCom2System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz());
m_xplaneData.com2Standby = aircraft.getCom2System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); m_xplaneData.com2StandbyKhz = aircraft.getCom2System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz());
m_xplaneData.xpdrCode = aircraft.getTransponderCode(); m_xplaneData.xpdrCode = aircraft.getTransponderCode();
m_xplaneData.xpdrMode = xpdrMode(aircraft.getTransponderMode()); m_xplaneData.xpdrMode = xpdrMode(aircraft.getTransponderMode());
m_serviceProxy->setCom1Active(m_xplaneData.com1Active); m_serviceProxy->setCom1ActiveKhz(m_xplaneData.com1ActiveKhz);
m_serviceProxy->setCom1Standby(m_xplaneData.com1Standby); m_serviceProxy->setCom1StandbyKhz(m_xplaneData.com1StandbyKhz);
m_serviceProxy->setCom2Active(m_xplaneData.com2Active); m_serviceProxy->setCom2ActiveKhz(m_xplaneData.com2ActiveKhz);
m_serviceProxy->setCom2Standby(m_xplaneData.com2Standby); m_serviceProxy->setCom2StandbyKhz(m_xplaneData.com2StandbyKhz);
m_serviceProxy->setTransponderCode(m_xplaneData.xpdrCode); m_serviceProxy->setTransponderCode(m_xplaneData.xpdrCode);
m_serviceProxy->setTransponderMode(m_xplaneData.xpdrMode); m_serviceProxy->setTransponderMode(m_xplaneData.xpdrMode);
@@ -821,12 +821,12 @@ namespace BlackSimPlugin
{ {
this->rememberLastSent(interpolatedSituation); this->rememberLastSent(interpolatedSituation);
planesPositions.callsigns.push_back(interpolatedSituation.getCallsign().asString()); planesPositions.callsigns.push_back(interpolatedSituation.getCallsign().asString());
planesPositions.latitudes.push_back(interpolatedSituation.latitude().value(CAngleUnit::deg())); planesPositions.latitudesDeg.push_back(interpolatedSituation.latitude().value(CAngleUnit::deg()));
planesPositions.longitudes.push_back(interpolatedSituation.longitude().value(CAngleUnit::deg())); planesPositions.longitudesDeg.push_back(interpolatedSituation.longitude().value(CAngleUnit::deg()));
planesPositions.altitudes.push_back(interpolatedSituation.getAltitude().value(CLengthUnit::ft())); planesPositions.altitudesFt.push_back(interpolatedSituation.getAltitude().value(CLengthUnit::ft()));
planesPositions.pitches.push_back(interpolatedSituation.getPitch().value(CAngleUnit::deg())); planesPositions.pitchesDeg.push_back(interpolatedSituation.getPitch().value(CAngleUnit::deg()));
planesPositions.rolls.push_back(interpolatedSituation.getBank().value(CAngleUnit::deg())); planesPositions.rollsDeg.push_back(interpolatedSituation.getBank().value(CAngleUnit::deg()));
planesPositions.headings.push_back(interpolatedSituation.getHeading().value(CAngleUnit::deg())); planesPositions.headingsDeg.push_back(interpolatedSituation.getHeading().value(CAngleUnit::deg()));
planesPositions.onGrounds.push_back(interpolatedSituation.getOnGround() == CAircraftSituation::OnGround); planesPositions.onGrounds.push_back(interpolatedSituation.getOnGround() == CAircraftSituation::OnGround);
} }
} }

View File

@@ -71,23 +71,22 @@ namespace BlackSimPlugin
class CXSwiftBusWeatherProxy; class CXSwiftBusWeatherProxy;
//! X-Plane data //! X-Plane data
//! \todo Add units to members? pitchDeg?, altitudeFt?
struct XPlaneData struct XPlaneData
{ {
QString aircraftModelPath; //!< Aircraft model path QString aircraftModelPath; //!< Aircraft model path
QString aircraftIcaoCode; //!< Aircraft ICAO code QString aircraftIcaoCode; //!< Aircraft ICAO code
double latitude; //!< Longitude [deg] double latitudeDeg; //!< Longitude [deg]
double longitude; //!< Latitude [deg] double longitudeDeg; //!< Latitude [deg]
double altitude; //!< Altitude [m] double altitudeM; //!< Altitude [m]
double groundspeed; //!< Ground speed [m/s] double groundspeedMs; //!< Ground speed [m/s]
double pitch; //!< Pitch [deg] double pitchDeg; //!< Pitch [deg]
double roll; //!< Roll [deg] double rollDeg; //!< Roll [deg]
double trueHeading; //!< True heading [deg] double trueHeadingDeg; //!< True heading [deg]
bool onGroundAll; //!< All wheels on ground? bool onGroundAll; //!< All wheels on ground?
int com1Active; //!< COM1 active [kHz] int com1ActiveKhz; //!< COM1 active [kHz]
int com1Standby; //!< COM1 standby [kHz] int com1StandbyKhz; //!< COM1 standby [kHz]
int com2Active; //!< COM2 active [kHz] int com2ActiveKhz; //!< COM2 active [kHz]
int com2Standby; //!< COM2 standby [kHz] int com2StandbyKhz; //!< COM2 standby [kHz]
int xpdrCode; //!< Transpondder code int xpdrCode; //!< Transpondder code
int xpdrMode; //!< Transponder mode (off=0,stdby=1,on=2,test=3) int xpdrMode; //!< Transponder mode (off=0,stdby=1,on=2,test=3)
bool xpdrIdent; //!< Is transponder in ident? bool xpdrIdent; //!< Is transponder in ident?
@@ -100,7 +99,7 @@ namespace BlackSimPlugin
double gearReployRatio; //!< Gear deployment ratio [%] double gearReployRatio; //!< Gear deployment ratio [%]
QList<double> enginesN1Percentage; //!< N1 per engine [%] QList<double> enginesN1Percentage; //!< N1 per engine [%]
double speedBrakeRatio; //!< Speed break ratio [%] double speedBrakeRatio; //!< Speed break ratio [%]
double seaLeveLPressure; //!< Sea level pressure [inhg] double seaLevelPressureInHg; //!< Sea level pressure [inhg]
}; };
//! X-Plane ISimulator implementation //! X-Plane ISimulator implementation

View File

@@ -48,14 +48,14 @@ namespace BlackSimPlugin
QDBusPendingReply<double, double, double, double, double, double, double, double> reply = *watcher; QDBusPendingReply<double, double, double, double, double, double, double, double> reply = *watcher;
if (!reply.isError()) if (!reply.isError())
{ {
o_xplaneData->latitude = reply.argumentAt<0>(); o_xplaneData->latitudeDeg = reply.argumentAt<0>();
o_xplaneData->longitude = reply.argumentAt<1>(); o_xplaneData->longitudeDeg = reply.argumentAt<1>();
o_xplaneData->altitude = reply.argumentAt<2>(); o_xplaneData->altitudeM = reply.argumentAt<2>();
o_xplaneData->groundspeed = reply.argumentAt<3>(); o_xplaneData->groundspeedMs = reply.argumentAt<3>();
o_xplaneData->pitch = reply.argumentAt<4>(); o_xplaneData->pitchDeg = reply.argumentAt<4>();
o_xplaneData->roll = reply.argumentAt<5>(); o_xplaneData->rollDeg = reply.argumentAt<5>();
o_xplaneData->trueHeading = reply.argumentAt<6>(); o_xplaneData->trueHeadingDeg = reply.argumentAt<6>();
o_xplaneData->seaLeveLPressure = reply.argumentAt<7>(); o_xplaneData->seaLevelPressureInHg = reply.argumentAt<7>();
} }
watcher->deleteLater(); watcher->deleteLater();
}; };
@@ -189,94 +189,94 @@ namespace BlackSimPlugin
m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime)); m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime));
} }
double CXSwiftBusServiceProxy::getLatitude() const double CXSwiftBusServiceProxy::getLatitudeDeg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLatitude")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getLatitudeDeg"));
} }
void CXSwiftBusServiceProxy::getLatitudeAsync(double *o_latitude) void CXSwiftBusServiceProxy::getLatitudeDegAsync(double *o_latitude)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getLatitude"), setterCallback(o_latitude)); m_dbusInterface->callDBusAsync(QLatin1String("getLatitudeDeg"), setterCallback(o_latitude));
} }
double CXSwiftBusServiceProxy::getLongitude() const double CXSwiftBusServiceProxy::getLongitudeDeg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getLongitude")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getLongitudeDeg"));
} }
void CXSwiftBusServiceProxy::getLongitudeAsync(double *o_longitude) void CXSwiftBusServiceProxy::getLongitudeDegAsync(double *o_longitude)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getLongitude"), setterCallback(o_longitude)); m_dbusInterface->callDBusAsync(QLatin1String("getLongitudeDeg"), setterCallback(o_longitude));
} }
double CXSwiftBusServiceProxy::getAltitudeMSL() const double CXSwiftBusServiceProxy::getAltitudeMslM() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getAltitudeMSL")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getAltitudeMslM"));
} }
void CXSwiftBusServiceProxy::getAltitudeMSLAsync(double *o_altitude) void CXSwiftBusServiceProxy::getAltitudeMslMAsync(double *o_altitude)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getAltitudeMSL"), setterCallback(o_altitude)); m_dbusInterface->callDBusAsync(QLatin1String("getAltitudeMslM"), setterCallback(o_altitude));
} }
double CXSwiftBusServiceProxy::getHeightAGL() const double CXSwiftBusServiceProxy::getHeightAglM() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getHeightAGL")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getHeightAglM"));
} }
void CXSwiftBusServiceProxy::getHeightAGLAsync(double *o_height) void CXSwiftBusServiceProxy::getHeightAglMAsync(double *o_height)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getHeightAGL"), setterCallback(o_height)); m_dbusInterface->callDBusAsync(QLatin1String("getHeightAglM"), setterCallback(o_height));
} }
double CXSwiftBusServiceProxy::getGroundSpeed() const double CXSwiftBusServiceProxy::getGroundSpeedMps() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getGroundSpeed")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getGroundSpeedMps"));
} }
void CXSwiftBusServiceProxy::getGroundSpeedAsync(double *o_groundspeed) void CXSwiftBusServiceProxy::getGroundSpeedMpsAsync(double *o_groundspeed)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getGroundSpeed"), setterCallback(o_groundspeed)); m_dbusInterface->callDBusAsync(QLatin1String("getGroundSpeedMps"), setterCallback(o_groundspeed));
} }
double CXSwiftBusServiceProxy::getIndicatedAirspeed() const double CXSwiftBusServiceProxy::getIndicatedAirspeedKias() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getIndicatedAirspeed")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getIndicatedAirspeedKias"));
} }
void CXSwiftBusServiceProxy::getIndicatedAirspeedAsync(double *o_ias) void CXSwiftBusServiceProxy::getIndicatedAirspeedKiasAsync(double *o_ias)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getIndicatedAirspeed"), setterCallback(o_ias)); m_dbusInterface->callDBusAsync(QLatin1String("getIndicatedAirspeedKias"), setterCallback(o_ias));
} }
double CXSwiftBusServiceProxy::getTrueAirspeed() const double CXSwiftBusServiceProxy::getTrueAirspeedKias() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueAirspeed")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueAirspeedKias"));
} }
void CXSwiftBusServiceProxy::getTrueAirspeedAsync(double *o_tas) void CXSwiftBusServiceProxy::getTrueAirspeedKiasAsync(double *o_tas)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getTrueAirspeed"), setterCallback(o_tas)); m_dbusInterface->callDBusAsync(QLatin1String("getTrueAirspeedKias"), setterCallback(o_tas));
} }
double CXSwiftBusServiceProxy::getPitch() const double CXSwiftBusServiceProxy::getPitchDeg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getPitch")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getPitchDeg"));
} }
void CXSwiftBusServiceProxy::getPitchAsync(double *o_pitch) void CXSwiftBusServiceProxy::getPitchDegAsync(double *o_pitch)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getPitch"), setterCallback(o_pitch)); m_dbusInterface->callDBusAsync(QLatin1String("getPitchDeg"), setterCallback(o_pitch));
} }
double CXSwiftBusServiceProxy::getRoll() const double CXSwiftBusServiceProxy::getRollDeg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getRoll")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getRollDeg"));
} }
void CXSwiftBusServiceProxy::getRollAsync(double *o_roll) void CXSwiftBusServiceProxy::getRollDegAsync(double *o_roll)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getRoll"), setterCallback(o_roll)); m_dbusInterface->callDBusAsync(QLatin1String("getRollDeg"), setterCallback(o_roll));
} }
double CXSwiftBusServiceProxy::getTrueHeading() const double CXSwiftBusServiceProxy::getTrueHeadingDeg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueHeading")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getTrueHeadingDeg"));
} }
void CXSwiftBusServiceProxy::getTrueHeadingAsync(double *o_heading) void CXSwiftBusServiceProxy::getTrueHeadingDegAsync(double *o_heading)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getTrueHeading"), setterCallback(o_heading)); m_dbusInterface->callDBusAsync(QLatin1String("getTrueHeadingDeg"), setterCallback(o_heading));
} }
bool CXSwiftBusServiceProxy::getAnyWheelOnGround() const bool CXSwiftBusServiceProxy::getAnyWheelOnGround() const
@@ -297,40 +297,40 @@ namespace BlackSimPlugin
m_dbusInterface->callDBusAsync(QLatin1String("getAllWheelsOnGround"), setterCallback(o_allWheels)); m_dbusInterface->callDBusAsync(QLatin1String("getAllWheelsOnGround"), setterCallback(o_allWheels));
} }
int CXSwiftBusServiceProxy::getCom1Active() const int CXSwiftBusServiceProxy::getCom1ActiveKhz() const
{ {
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1Active")); return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1ActiveKhz"));
} }
void CXSwiftBusServiceProxy::getCom1ActiveAsync(int *o_com1Active) void CXSwiftBusServiceProxy::getCom1ActiveKhzAsync(int *o_com1Active)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getCom1Active"), setterCallback(o_com1Active)); m_dbusInterface->callDBusAsync(QLatin1String("getCom1ActiveKhz"), setterCallback(o_com1Active));
} }
int CXSwiftBusServiceProxy::getCom1Standby() const int CXSwiftBusServiceProxy::getCom1StandbyKhz() const
{ {
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1Standby")); return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom1StandbyKhz"));
} }
void CXSwiftBusServiceProxy::getCom1StandbyAsync(int *o_com1Standby) void CXSwiftBusServiceProxy::getCom1StandbyKhzAsync(int *o_com1Standby)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getCom1Standby"), setterCallback(o_com1Standby)); m_dbusInterface->callDBusAsync(QLatin1String("getCom1StandbyKhz"), setterCallback(o_com1Standby));
} }
int CXSwiftBusServiceProxy::getCom2Active() const int CXSwiftBusServiceProxy::getCom2ActiveKhz() const
{ {
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2Active")); return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2ActiveKhz"));
} }
void CXSwiftBusServiceProxy::getCom2ActiveAsync(int *o_com2Active) void CXSwiftBusServiceProxy::getCom2ActiveKhzAsync(int *o_com2Active)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getCom2Active"), setterCallback(o_com2Active)); m_dbusInterface->callDBusAsync(QLatin1String("getCom2ActiveKhz"), setterCallback(o_com2Active));
} }
int CXSwiftBusServiceProxy::getCom2Standby() const int CXSwiftBusServiceProxy::getCom2StandbyKhz() const
{ {
return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2Standby")); return m_dbusInterface->callDBusRet<int>(QLatin1String("getCom2StandbyKhz"));
} }
void CXSwiftBusServiceProxy::getCom2StandbyAsync(int *o_com2Standby) void CXSwiftBusServiceProxy::getCom2StandbyKhzAsync(int *o_com2Standby)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getCom2Standby"), setterCallback(o_com2Standby)); m_dbusInterface->callDBusAsync(QLatin1String("getCom2StandbyKhz"), setterCallback(o_com2Standby));
} }
int CXSwiftBusServiceProxy::getTransponderCode() const int CXSwiftBusServiceProxy::getTransponderCode() const
@@ -412,35 +412,35 @@ namespace BlackSimPlugin
} }
double CXSwiftBusServiceProxy::getQNH() const double CXSwiftBusServiceProxy::getQNHInHg() const
{ {
return m_dbusInterface->callDBusRet<double>(QLatin1String("getQNH")); return m_dbusInterface->callDBusRet<double>(QLatin1String("getQNHInHg"));
} }
void CXSwiftBusServiceProxy::getQNHAsync(double *o_qnh) void CXSwiftBusServiceProxy::getQNHInHgAsync(double *o_qnh)
{ {
m_dbusInterface->callDBusAsync(QLatin1String("getQNH"), setterCallback(o_qnh)); m_dbusInterface->callDBusAsync(QLatin1String("getQNHInHg"), setterCallback(o_qnh));
} }
void CXSwiftBusServiceProxy::setCom1Active(int freq) void CXSwiftBusServiceProxy::setCom1ActiveKhz(int freq)
{ {
m_dbusInterface->callDBus(QLatin1String("setCom1Active"), freq); m_dbusInterface->callDBus(QLatin1String("setCom1ActiveKhz"), freq);
} }
void CXSwiftBusServiceProxy::setCom1Standby(int freq) void CXSwiftBusServiceProxy::setCom1StandbyKhz(int freq)
{ {
m_dbusInterface->callDBus(QLatin1String("setCom1Standby"), freq); m_dbusInterface->callDBus(QLatin1String("setCom1StandbyKhz"), freq);
} }
void CXSwiftBusServiceProxy::setCom2Active(int freq) void CXSwiftBusServiceProxy::setCom2ActiveKhz(int freq)
{ {
m_dbusInterface->callDBus(QLatin1String("setCom2Active"), freq); m_dbusInterface->callDBus(QLatin1String("setCom2ActiveKhz"), freq);
} }
void CXSwiftBusServiceProxy::setCom2Standby(int freq) void CXSwiftBusServiceProxy::setCom2StandbyKhz(int freq)
{ {
m_dbusInterface->callDBus(QLatin1String("setCom2Standby"), freq); m_dbusInterface->callDBus(QLatin1String("setCom2StandbyKhz"), freq);
} }
void CXSwiftBusServiceProxy::setTransponderCode(int code) void CXSwiftBusServiceProxy::setTransponderCode(int code)

View File

@@ -183,64 +183,64 @@ namespace BlackSimPlugin
void isUsingRealTimeAsync(bool *o_isRealTime); void isUsingRealTimeAsync(bool *o_isRealTime);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getLatitude //! \copydoc XSwiftBus::CService::getLatitudeDeg
//! @{ //! @{
double getLatitude() const; double getLatitudeDeg() const;
void getLatitudeAsync(double *o_latitude); void getLatitudeDegAsync(double *o_latitude);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getLongitude //! \copydoc XSwiftBus::CService::getLongitudeDeg
//! @{ //! @{
double getLongitude() const; double getLongitudeDeg() const;
void getLongitudeAsync(double *o_longitude); void getLongitudeDegAsync(double *o_longitude);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getAltitudeMSL //! \copydoc XSwiftBus::CService::getAltitudeMslM
//! @{ //! @{
double getAltitudeMSL() const; double getAltitudeMslM() const;
void getAltitudeMSLAsync(double *o_altitude); void getAltitudeMslMAsync(double *o_altitude);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getHeightAGL //! \copydoc XSwiftBus::CService::getHeightAglM
//! @{ //! @{
double getHeightAGL() const; double getHeightAglM() const;
void getHeightAGLAsync(double *o_height); void getHeightAglMAsync(double *o_height);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getGroundSpeed //! \copydoc XSwiftBus::CService::getGroundSpeedMps
//! @{ //! @{
double getGroundSpeed() const; double getGroundSpeedMps() const;
void getGroundSpeedAsync(double *o_groundspeed); void getGroundSpeedMpsAsync(double *o_groundspeed);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getIndicatedAirspeed //! \copydoc XSwiftBus::CService::getIndicatedAirspeedKias
//! @{ //! @{
double getIndicatedAirspeed() const; double getIndicatedAirspeedKias() const;
void getIndicatedAirspeedAsync(double *o_ias); void getIndicatedAirspeedKiasAsync(double *o_ias);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getTrueAirspeed //! \copydoc XSwiftBus::CService::getTrueAirspeedKias
//! @{ //! @{
double getTrueAirspeed() const; double getTrueAirspeedKias() const;
void getTrueAirspeedAsync(double *o_tas); void getTrueAirspeedKiasAsync(double *o_tas);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getPitch //! \copydoc XSwiftBus::CService::getPitchDeg
//! @{ //! @{
double getPitch() const; double getPitchDeg() const;
void getPitchAsync(double *o_pitch); void getPitchDegAsync(double *o_pitch);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getRoll //! \copydoc XSwiftBus::CService::getRollDeg
//! @{ //! @{
double getRoll() const; double getRollDeg() const;
void getRollAsync(double *o_roll); void getRollDegAsync(double *o_roll);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getTrueHeading //! \copydoc XSwiftBus::CService::getTrueHeadingDeg
//! @{ //! @{
double getTrueHeading() const; double getTrueHeadingDeg() const;
void getTrueHeadingAsync(double *o_heading); void getTrueHeadingDegAsync(double *o_heading);
//! @} //! @}
//! Get whether any wheel is on the ground //! Get whether any wheel is on the ground
@@ -255,28 +255,28 @@ namespace BlackSimPlugin
void getAllWheelsOnGroundAsync(bool *o_allWheels); void getAllWheelsOnGroundAsync(bool *o_allWheels);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getCom1Active //! \copydoc XSwiftBus::CService::getCom1ActiveKhz
//! @{ //! @{
int getCom1Active() const; int getCom1ActiveKhz() const;
void getCom1ActiveAsync(int *o_com1Active); void getCom1ActiveKhzAsync(int *o_com1Active);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getCom1Standby //! \copydoc XSwiftBus::CService::getCom1StandbyKhz
//! @{ //! @{
int getCom1Standby() const; int getCom1StandbyKhz() const;
void getCom1StandbyAsync(int *o_com1Standby); void getCom1StandbyKhzAsync(int *o_com1Standby);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getCom2Active //! \copydoc XSwiftBus::CService::getCom2ActiveKhz
//! @{ //! @{
int getCom2Active() const; int getCom2ActiveKhz() const;
void getCom2ActiveAsync(int *o_com2Active); void getCom2ActiveKhzAsync(int *o_com2Active);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getCom2Standby //! \copydoc XSwiftBus::CService::getCom2StandbyKhz
//! @{ //! @{
int getCom2Standby() const; int getCom2StandbyKhz() const;
void getCom2StandbyAsync(int *o_com2Standby); void getCom2StandbyKhzAsync(int *o_com2Standby);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getTransponderCode //! \copydoc XSwiftBus::CService::getTransponderCode
@@ -327,23 +327,23 @@ namespace BlackSimPlugin
void getTaxiLightsOnAsync(bool *o_taxiLightsOn); void getTaxiLightsOnAsync(bool *o_taxiLightsOn);
//! @} //! @}
//! \copydoc XSwiftBus::CService::getQNH //! \copydoc XSwiftBus::CService::getQNHInHg
//! @{ //! @{
double getQNH() const; double getQNHInHg() const;
void getQNHAsync(double *o_qnh); void getQNHInHgAsync(double *o_qnh);
//! @} //! @}
//! \copydoc XSwiftBus::CService::setCom1Active //! \copydoc XSwiftBus::CService::setCom1ActiveKhz
void setCom1Active(int freq); void setCom1ActiveKhz(int freq);
//! \copydoc XSwiftBus::CService::setCom1Standby //! \copydoc XSwiftBus::CService::setCom1StandbyKhz
void setCom1Standby(int freq); void setCom1StandbyKhz(int freq);
//! \copydoc XSwiftBus::CService::setCom2Active //! \copydoc XSwiftBus::CService::setCom2ActiveKhz
void setCom2Active(int freq); void setCom2ActiveKhz(int freq);
//! \copydoc XSwiftBus::CService::setCom2Standby //! \copydoc XSwiftBus::CService::setCom2StandbyKhz
void setCom2Standby(int freq); void setCom2StandbyKhz(int freq);
//! \copydoc XSwiftBus::CService::setTransponderCode //! \copydoc XSwiftBus::CService::setTransponderCode
void setTransponderCode(int code); void setTransponderCode(int code);

View File

@@ -99,9 +99,9 @@ namespace BlackSimPlugin
void CXSwiftBusTrafficProxy::setPlanesPositions(const PlanesPositions &planesPositions) void CXSwiftBusTrafficProxy::setPlanesPositions(const PlanesPositions &planesPositions)
{ {
m_dbusInterface->callDBus(QLatin1String("setPlanesPositions"), m_dbusInterface->callDBus(QLatin1String("setPlanesPositions"),
planesPositions.callsigns, planesPositions.latitudes, planesPositions.longitudes, planesPositions.callsigns, planesPositions.latitudesDeg, planesPositions.longitudesDeg,
planesPositions.altitudes, planesPositions.pitches, planesPositions.rolls, planesPositions.altitudesFt, planesPositions.pitchesDeg, planesPositions.rollsDeg,
planesPositions.headings, planesPositions.onGrounds); planesPositions.headingsDeg, planesPositions.onGrounds);
} }
void CXSwiftBusTrafficProxy::setPlanesSurfaces(const PlanesSurfaces &planesSurfaces) void CXSwiftBusTrafficProxy::setPlanesSurfaces(const PlanesSurfaces &planesSurfaces)

View File

@@ -44,22 +44,22 @@ namespace BlackSimPlugin
bool hasSameSizes() const bool hasSameSizes() const
{ {
const int s = callsigns.size(); const int s = callsigns.size();
if (s != latitudes.size()) { return false; } if (s != latitudesDeg.size()) { return false; }
if (s != longitudes.size()) { return false; } if (s != longitudesDeg.size()) { return false; }
if (s != altitudes.size()) { return false; } if (s != altitudesFt.size()) { return false; }
if (s != pitches.size()) { return false; } if (s != pitchesDeg.size()) { return false; }
if (s != rolls.size()) { return false; } if (s != rollsDeg.size()) { return false; }
if (s != headings.size()) { return false; } if (s != headingsDeg.size()) { return false; }
return true; return true;
} }
QStringList callsigns; //!< List of callsigns QStringList callsigns; //!< List of callsigns
QList<double> latitudes; //!< List of latitudes QList<double> latitudesDeg; //!< List of latitudes
QList<double> longitudes; //!< List of longitudes QList<double> longitudesDeg; //!< List of longitudes
QList<double> altitudes; //!< List of altitudes QList<double> altitudesFt; //!< List of altitudes
QList<double> pitches; //!< List of pitches QList<double> pitchesDeg; //!< List of pitches
QList<double> rolls; //!< List of rolls QList<double> rollsDeg; //!< List of rolls
QList<double> headings; //!< List of headings QList<double> headingsDeg; //!< List of headings
QList<bool> onGrounds; //!< List of onGrounds QList<bool> onGrounds; //!< List of onGrounds
}; };

View File

@@ -75,14 +75,14 @@ namespace BlackSimPlugin
m_dbusInterface->callDBus(QLatin1String("setRunwayFriction"), friction); m_dbusInterface->callDBus(QLatin1String("setRunwayFriction"), friction);
} }
void CXSwiftBusWeatherProxy::setCloudLayer(int layer, int base, int tops, int type, int coverage) void CXSwiftBusWeatherProxy::setCloudLayer(int layer, int baseM, int topsM, int type, int coverage)
{ {
m_dbusInterface->callDBus(QLatin1String("setCloudLayer"), layer, base, tops, type, coverage); m_dbusInterface->callDBus(QLatin1String("setCloudLayer"), layer, baseM, topsM, type, coverage);
} }
void CXSwiftBusWeatherProxy::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence) void CXSwiftBusWeatherProxy::setWindLayer(int layer, int altitudeM, double directionDeg, int speedKt, int shearDirectionDeg, int shearSpeedKt, int turbulence)
{ {
m_dbusInterface->callDBus(QLatin1String("setWindLayer"), layer, altitude, direction, speed, shearDirection, shearSpeed, turbulence); m_dbusInterface->callDBus(QLatin1String("setWindLayer"), layer, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence);
} }
} }

View File

@@ -92,10 +92,10 @@ namespace BlackSimPlugin
void setRunwayFriction(int friction); void setRunwayFriction(int friction);
//! \copydoc XSwiftBus::CWeather::setCloudLayer //! \copydoc XSwiftBus::CWeather::setCloudLayer
void setCloudLayer(int layer, int base, int tops, int type, int coverage); void setCloudLayer(int layer, int baseM, int topsM, int type, int coverage);
//! \copydoc XSwiftBus::CWeather::setWindLayer //! \copydoc XSwiftBus::CWeather::setWindLayer
void setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence); void setWindLayer(int layer, int altitudeM, double directionDeg, int speedKt, int shearDirectionDeg, int shearSpeedKt, int turbulence);
}; };
} }

View File

@@ -57,34 +57,34 @@ R"(<node>
<method name="isUsingRealTime"> <method name="isUsingRealTime">
<arg type="b" direction="out"/> <arg type="b" direction="out"/>
</method> </method>
<method name="getLatitude"> <method name="getLatitudeDeg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getLongitude"> <method name="getLongitudeDeg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getAltitudeMSL"> <method name="getAltitudeMslM">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getHeightAGL"> <method name="getHeightAglM">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getGroundSpeed"> <method name="getGroundSpeedMps">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getIndicatedAirspeed"> <method name="getIndicatedAirspeedKias">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getTrueAirspeed"> <method name="getTrueAirspeedKias">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getPitch"> <method name="getPitchDeg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getRoll"> <method name="getRollDeg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getTrueHeading"> <method name="getTrueHeadingDeg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="getAnyWheelOnGround"> <method name="getAnyWheelOnGround">
@@ -93,16 +93,16 @@ R"(<node>
<method name="getAllWheelsOnGround"> <method name="getAllWheelsOnGround">
<arg type="b" direction="out"/> <arg type="b" direction="out"/>
</method> </method>
<method name="getCom1Active"> <method name="getCom1ActiveKhz">
<arg type="i" direction="out"/> <arg type="i" direction="out"/>
</method> </method>
<method name="getCom1Standby"> <method name="getCom1StandbyKhz">
<arg type="i" direction="out"/> <arg type="i" direction="out"/>
</method> </method>
<method name="getCom2Active"> <method name="getCom2ActiveKhz">
<arg type="i" direction="out"/> <arg type="i" direction="out"/>
</method> </method>
<method name="getCom2Standby"> <method name="getCom2StandbyKhz">
<arg type="i" direction="out"/> <arg type="i" direction="out"/>
</method> </method>
<method name="getTransponderCode"> <method name="getTransponderCode">
@@ -129,19 +129,19 @@ R"(<node>
<method name="getTaxiLightsOn"> <method name="getTaxiLightsOn">
<arg type="b" direction="out"/> <arg type="b" direction="out"/>
</method> </method>
<method name="getQNH"> <method name="getQNHInHg">
<arg type="d" direction="out"/> <arg type="d" direction="out"/>
</method> </method>
<method name="setCom1Active"> <method name="setCom1ActiveKhz">
<arg name="freq" type="i" direction="in"/> <arg name="freq" type="i" direction="in"/>
</method> </method>
<method name="setCom1Standby"> <method name="setCom1StandbyKhz">
<arg name="freq" type="i" direction="in"/> <arg name="freq" type="i" direction="in"/>
</method> </method>
<method name="setCom2Active"> <method name="setCom2ActiveKhz">
<arg name="freq" type="i" direction="in"/> <arg name="freq" type="i" direction="in"/>
</method> </method>
<method name="setCom2Standby"> <method name="setCom2StandbyKhz">
<arg name="freq" type="i" direction="in"/> <arg name="freq" type="i" direction="in"/>
</method> </method>
<method name="setTransponderCode"> <method name="setTransponderCode">

View File

@@ -171,7 +171,7 @@ namespace XSwiftBus
} }
std::vector<std::string> icaos, names; std::vector<std::string> icaos, names;
std::vector<double> lats, lons, alts; std::vector<double> lats, lons, alts;
std::vector<CNavDataReference> closestAirports = findClosestAirports(20, getLatitude(), getLongitude()); std::vector<CNavDataReference> closestAirports = findClosestAirports(20, getLatitudeDeg(), getLongitudeDeg());
for (const auto &navref : closestAirports) for (const auto &navref : closestAirports)
{ {
float lat, lon, alt; float lat, lon, alt;
@@ -349,74 +349,74 @@ namespace XSwiftBus
sendDBusReply(sender, serial, isUsingRealTime()); sendDBusReply(sender, serial, isUsingRealTime());
}); });
} }
else if (message.getMethodName() == "getLatitude") else if (message.getMethodName() == "getLatitudeDeg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getLatitude()); sendDBusReply(sender, serial, getLatitudeDeg());
}); });
} }
else if (message.getMethodName() == "getLongitude") else if (message.getMethodName() == "getLongitudeDeg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getLongitude()); sendDBusReply(sender, serial, getLongitudeDeg());
}); });
} }
else if (message.getMethodName() == "getAltitudeMSL") else if (message.getMethodName() == "getAltitudeMslM")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getAltitudeMSL()); sendDBusReply(sender, serial, getAltitudeMslM());
}); });
} }
else if (message.getMethodName() == "getHeightAGL") else if (message.getMethodName() == "getHeightAglM")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getHeightAGL()); sendDBusReply(sender, serial, getHeightAglM());
}); });
} }
else if (message.getMethodName() == "getGroundSpeed") else if (message.getMethodName() == "getGroundSpeedMps")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getGroundSpeed()); sendDBusReply(sender, serial, getGroundSpeedMps());
}); });
} }
else if (message.getMethodName() == "getIndicatedAirspeed") else if (message.getMethodName() == "getIndicatedAirspeedKias")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getIndicatedAirspeed()); sendDBusReply(sender, serial, getIndicatedAirspeedKias());
}); });
} }
else if (message.getMethodName() == "getTrueAirspeed") else if (message.getMethodName() == "getTrueAirspeedKias")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getTrueAirspeed()); sendDBusReply(sender, serial, getTrueAirspeedKias());
}); });
} }
else if (message.getMethodName() == "getPitch") else if (message.getMethodName() == "getPitchDeg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getPitch()); sendDBusReply(sender, serial, getPitchDeg());
}); });
} }
else if (message.getMethodName() == "getRoll") else if (message.getMethodName() == "getRollDeg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getRoll()); sendDBusReply(sender, serial, getRollDeg());
}); });
} }
else if (message.getMethodName() == "getTrueHeading") else if (message.getMethodName() == "getTrueHeadingDeg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getTrueHeading()); sendDBusReply(sender, serial, getTrueHeadingDeg());
}); });
} }
else if (message.getMethodName() == "getAnyWheelOnGround") else if (message.getMethodName() == "getAnyWheelOnGround")
@@ -433,32 +433,32 @@ namespace XSwiftBus
sendDBusReply(sender, serial, getAllWheelsOnGround()); sendDBusReply(sender, serial, getAllWheelsOnGround());
}); });
} }
else if (message.getMethodName() == "getCom1Active") else if (message.getMethodName() == "getCom1ActiveKhz")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getCom1Active()); sendDBusReply(sender, serial, getCom1ActiveKhz());
}); });
} }
else if (message.getMethodName() == "getCom1Standby") else if (message.getMethodName() == "getCom1StandbyKhz")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getCom1Standby()); sendDBusReply(sender, serial, getCom1StandbyKhz());
}); });
} }
else if (message.getMethodName() == "getCom2Active") else if (message.getMethodName() == "getCom2ActiveKhz")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getCom2Active()); sendDBusReply(sender, serial, getCom2ActiveKhz());
}); });
} }
else if (message.getMethodName() == "getCom2Standby") else if (message.getMethodName() == "getCom2StandbyKhz")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getCom2Standby()); sendDBusReply(sender, serial, getCom2StandbyKhz());
}); });
} }
else if (message.getMethodName() == "getTransponderCode") else if (message.getMethodName() == "getTransponderCode")
@@ -517,14 +517,14 @@ namespace XSwiftBus
sendDBusReply(sender, serial, getTaxiLightsOn()); sendDBusReply(sender, serial, getTaxiLightsOn());
}); });
} }
else if (message.getMethodName() == "getQNH") else if (message.getMethodName() == "getQNHInHg")
{ {
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
sendDBusReply(sender, serial, getQNH()); sendDBusReply(sender, serial, getQNHInHg());
}); });
} }
else if (message.getMethodName() == "setCom1Active") else if (message.getMethodName() == "setCom1ActiveKhz")
{ {
maybeSendEmptyDBusReply(wantsReply, sender, serial); maybeSendEmptyDBusReply(wantsReply, sender, serial);
int frequency = 0; int frequency = 0;
@@ -532,10 +532,10 @@ namespace XSwiftBus
message.getArgument(frequency); message.getArgument(frequency);
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
setCom1Active(frequency); setCom1ActiveKhz(frequency);
}); });
} }
else if (message.getMethodName() == "setCom1Standby") else if (message.getMethodName() == "setCom1StandbyKhz")
{ {
maybeSendEmptyDBusReply(wantsReply, sender, serial); maybeSendEmptyDBusReply(wantsReply, sender, serial);
int frequency = 0; int frequency = 0;
@@ -543,10 +543,10 @@ namespace XSwiftBus
message.getArgument(frequency); message.getArgument(frequency);
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
setCom1Standby(frequency); setCom1StandbyKhz(frequency);
}); });
} }
else if (message.getMethodName() == "setCom2Active") else if (message.getMethodName() == "setCom2ActiveKhz")
{ {
maybeSendEmptyDBusReply(wantsReply, sender, serial); maybeSendEmptyDBusReply(wantsReply, sender, serial);
int frequency = 0; int frequency = 0;
@@ -554,10 +554,10 @@ namespace XSwiftBus
message.getArgument(frequency); message.getArgument(frequency);
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
setCom2Active(frequency); setCom2ActiveKhz(frequency);
}); });
} }
else if (message.getMethodName() == "setCom2Standby") else if (message.getMethodName() == "setCom2StandbyKhz")
{ {
maybeSendEmptyDBusReply(wantsReply, sender, serial); maybeSendEmptyDBusReply(wantsReply, sender, serial);
int frequency = 0; int frequency = 0;
@@ -565,7 +565,7 @@ namespace XSwiftBus
message.getArgument(frequency); message.getArgument(frequency);
queueDBusCall([ = ]() queueDBusCall([ = ]()
{ {
setCom2Standby(frequency); setCom2StandbyKhz(frequency);
}); });
} }
else if (message.getMethodName() == "setTransponderCode") else if (message.getMethodName() == "setTransponderCode")

View File

@@ -107,34 +107,34 @@ namespace XSwiftBus
bool isUsingRealTime() const { return m_useSystemTime.get(); } bool isUsingRealTime() const { return m_useSystemTime.get(); }
//! Get aircraft latitude in degrees //! Get aircraft latitude in degrees
double getLatitude() const { return m_latitude.get(); } double getLatitudeDeg() const { return m_latitude.get(); }
//! Get aircraft longitude in degrees //! Get aircraft longitude in degrees
double getLongitude() const { return m_longitude.get(); } double getLongitudeDeg() const { return m_longitude.get(); }
//! Get aircraft altitude in meters //! Get aircraft altitude in meters
double getAltitudeMSL() const { return m_elevation.get(); } double getAltitudeMslM() const { return m_elevation.get(); }
//! Get aircraft height in meters //! Get aircraft height in meters
double getHeightAGL() const { return m_agl.get(); } double getHeightAglM() const { return m_agl.get(); }
//! Get aircraft groundspeed in meters per second //! Get aircraft groundspeed in meters per second
double getGroundSpeed() const { return m_groundSpeed.get(); } double getGroundSpeedMps() const { return m_groundSpeed.get(); }
//! Get aircraft IAS in knots //! Get aircraft IAS in knots
double getIndicatedAirspeed() const { return m_indicatedAirspeed.get(); } double getIndicatedAirspeedKias() const { return m_indicatedAirspeed.get(); }
//! Get aircraft TAS in meters per second //! Get aircraft TAS in meters per second
double getTrueAirspeed() const { return m_trueAirspeed.get(); } double getTrueAirspeedKias() const { return m_trueAirspeed.get(); }
//! Get aircraft pitch in degrees above horizon //! Get aircraft pitch in degrees above horizon
double getPitch() const { return m_pitch.get(); } double getPitchDeg() const { return m_pitch.get(); }
//! Get aircraft roll in degrees //! Get aircraft roll in degrees
double getRoll() const { return m_roll.get(); } double getRollDeg() const { return m_roll.get(); }
//! Get aircraft true heading in degrees //! Get aircraft true heading in degrees
double getTrueHeading() const { return m_heading.get(); } double getTrueHeadingDeg() const { return m_heading.get(); }
//! Get whether any wheel is on the ground //! Get whether any wheel is on the ground
bool getAnyWheelOnGround() const { return m_onGroundAny.get(); } bool getAnyWheelOnGround() const { return m_onGroundAny.get(); }
@@ -143,16 +143,16 @@ namespace XSwiftBus
bool getAllWheelsOnGround() const { return m_onGroundAll.get(); } bool getAllWheelsOnGround() const { return m_onGroundAll.get(); }
//! Get the current COM1 active frequency in kHz //! Get the current COM1 active frequency in kHz
int getCom1Active() const { return m_com1Active.get() * 10; } int getCom1ActiveKhz() const { return m_com1Active.get() * 10; }
//! Get the current COM1 standby frequency in kHz //! Get the current COM1 standby frequency in kHz
int getCom1Standby() const { return m_com1Standby.get() * 10; } int getCom1StandbyKhz() const { return m_com1Standby.get() * 10; }
//! Get the current COM2 active frequency in kHz //! Get the current COM2 active frequency in kHz
int getCom2Active() const { return m_com2Active.get() * 10; } int getCom2ActiveKhz() const { return m_com2Active.get() * 10; }
//! Get the current COM2 standby frequency in kHz //! Get the current COM2 standby frequency in kHz
int getCom2Standby() const { return m_com2Standby.get() * 10; } int getCom2StandbyKhz() const { return m_com2Standby.get() * 10; }
//! Get the current transponder code in decimal //! Get the current transponder code in decimal
int getTransponderCode() const { return m_xpdrCode.get(); } int getTransponderCode() const { return m_xpdrCode.get(); }
@@ -179,19 +179,19 @@ namespace XSwiftBus
bool getTaxiLightsOn() const { return m_taxiLightsOn.get(); } bool getTaxiLightsOn() const { return m_taxiLightsOn.get(); }
//! Get barometric pressure at sea level in inches of mercury. //! Get barometric pressure at sea level in inches of mercury.
double getQNH() const { return m_qnhInhg.get(); } double getQNHInHg() const { return m_qnhInhg.get(); }
//! Set the current COM1 active frequency in kHz //! Set the current COM1 active frequency in kHz
void setCom1Active(int freq) { m_com1Active.set(freq / 10); } void setCom1ActiveKhz(int freq) { m_com1Active.set(freq / 10); }
//! Set the current COM1 standby frequency in kHz //! Set the current COM1 standby frequency in kHz
void setCom1Standby(int freq) { m_com1Standby.set(freq / 10); } void setCom1StandbyKhz(int freq) { m_com1Standby.set(freq / 10); }
//! Set the current COM2 active frequency in kHz //! Set the current COM2 active frequency in kHz
void setCom2Active(int freq) { m_com2Active.set(freq / 10); } void setCom2ActiveKhz(int freq) { m_com2Active.set(freq / 10); }
//! Set the current COM2 standby frequency in kHz //! Set the current COM2 standby frequency in kHz
void setCom2Standby(int freq) { m_com2Standby.set(freq / 10); } void setCom2StandbyKhz(int freq) { m_com2Standby.set(freq / 10); }
//! Set the current transponder code in decimal //! Set the current transponder code in decimal
void setTransponderCode(int code) { m_xpdrCode.set(code); } void setTransponderCode(int code) { m_xpdrCode.set(code); }

View File

@@ -318,8 +318,8 @@ namespace XSwiftBus
m_followPlaneViewSequence.clear(); m_followPlaneViewSequence.clear();
} }
void CTraffic::setPlanesPositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitudes, void CTraffic::setPlanesPositions(const std::vector<std::string> &callsigns, std::vector<double> latitudesDeg, std::vector<double> longitudesDeg, std::vector<double> altitudesFt,
std::vector<double> pitches, std::vector<double> rolles, std::vector<double> headings, const std::vector<bool> &onGrounds) std::vector<double> pitchesDeg, std::vector<double> rollsDeg, std::vector<double> headingsDeg, const std::vector<bool> &onGrounds)
{ {
(void)onGrounds; (void)onGrounds;
@@ -330,12 +330,12 @@ namespace XSwiftBus
Plane *plane = planeIt->second; Plane *plane = planeIt->second;
if (!plane) { return; } if (!plane) { return; }
plane->position.lat = latitudes.at(i); plane->position.lat = latitudesDeg.at(i);
plane->position.lon = longitudes.at(i); plane->position.lon = longitudesDeg.at(i);
plane->position.elevation = altitudes.at(i); plane->position.elevation = altitudesFt.at(i);
plane->position.pitch = static_cast<float>(pitches.at(i)); plane->position.pitch = static_cast<float>(pitchesDeg.at(i));
plane->position.roll = static_cast<float>(rolles.at(i)); plane->position.roll = static_cast<float>(rollsDeg.at(i));
plane->position.heading = static_cast<float>(headings.at(i)); plane->position.heading = static_cast<float>(headingsDeg.at(i));
} }
} }

View File

@@ -96,8 +96,9 @@ namespace XSwiftBus
void removeAllPlanes(); void removeAllPlanes();
//! Set the position of multiple traffic aircrafts //! Set the position of multiple traffic aircrafts
void setPlanesPositions(const std::vector<std::string> &callsigns, std::vector<double> latitudes, std::vector<double> longitudes, std::vector<double> altitudes, void setPlanesPositions(const std::vector<std::string> &callsigns,
std::vector<double> pitches, std::vector<double> rolls, std::vector<double> headings, const std::vector<bool> &onGrounds); std::vector<double> latitudesDeg, std::vector<double> longitudesDeg, std::vector<double> altitudesFt,
std::vector<double> pitchesDeg, std::vector<double> rollsDeg, std::vector<double> headingsDeg, const std::vector<bool> &onGrounds);
//! Set the flight control surfaces and lights of multiple traffic aircrafts //! Set the flight control surfaces and lights of multiple traffic aircrafts
void setPlanesSurfaces(const std::vector<std::string> &callsigns, const std::vector<double> &gears, const std::vector<double> &flaps, const std::vector<double> &spoilers, void setPlanesSurfaces(const std::vector<std::string> &callsigns, const std::vector<double> &gears, const std::vector<double> &flaps, const std::vector<double> &spoilers,

View File

@@ -28,13 +28,13 @@ namespace XSwiftBus
layer.coverage.setAsInt(coverage); layer.coverage.setAsInt(coverage);
} }
void CWeather::setCloudLayer(int layer, int base, int tops, int type, int coverage) void CWeather::setCloudLayer(int layer, int baseM, int topsM, int type, int coverage)
{ {
switch (layer) switch (layer)
{ {
case 0: setCloudLayerImpl(m_cloudLayer0, base, tops, type, coverage); break; case 0: setCloudLayerImpl(m_cloudLayer0, baseM, topsM, type, coverage); break;
case 1: setCloudLayerImpl(m_cloudLayer1, base, tops, type, coverage); break; case 1: setCloudLayerImpl(m_cloudLayer1, baseM, topsM, type, coverage); break;
case 2: setCloudLayerImpl(m_cloudLayer2, base, tops, type, coverage); break; case 2: setCloudLayerImpl(m_cloudLayer2, baseM, topsM, type, coverage); break;
default: DEBUG_LOG("Invalid cloud layer"); break; default: DEBUG_LOG("Invalid cloud layer"); break;
} }
} }
@@ -51,13 +51,13 @@ namespace XSwiftBus
layer.turbulence.setAsInt(turbulence); layer.turbulence.setAsInt(turbulence);
} }
void CWeather::setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence) void CWeather::setWindLayer(int layer, int altitudeM, double directionDeg, int speedKt, int shearDirectionDeg, int shearSpeedKt, int turbulence)
{ {
switch (layer) switch (layer)
{ {
case 0: setWindLayerImpl(m_windLayer0, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; case 0: setWindLayerImpl(m_windLayer0, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break;
case 1: setWindLayerImpl(m_windLayer1, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; case 1: setWindLayerImpl(m_windLayer1, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break;
case 2: setWindLayerImpl(m_windLayer2, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; case 2: setWindLayerImpl(m_windLayer2, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break;
default: DEBUG_LOG("Invalid wind layer"); break; default: DEBUG_LOG("Invalid wind layer"); break;
} }
} }
@@ -213,23 +213,23 @@ namespace XSwiftBus
{ {
maybeSendEmptyDBusReply(wantsReply, sender, serial); maybeSendEmptyDBusReply(wantsReply, sender, serial);
int layer = 0; int layer = 0;
int altitude = 0; int altitudeM = 0;
double direction = 0; double directionDeg = 0;
int speed = 0; int speedKt = 0;
int shearDirection = 0; int shearDirectionDeg = 0;
int shearSpeed = 0; int shearSpeedKt = 0;
int turbulence = 0; int turbulence = 0;
message.beginArgumentRead(); message.beginArgumentRead();
message.getArgument(layer); message.getArgument(layer);
message.getArgument(altitude); message.getArgument(altitudeM);
message.getArgument(direction); message.getArgument(directionDeg);
message.getArgument(speed); message.getArgument(speedKt);
message.getArgument(shearDirection); message.getArgument(shearDirectionDeg);
message.getArgument(shearSpeed); message.getArgument(shearSpeedKt);
message.getArgument(turbulence); message.getArgument(turbulence);
queueDBusCall([=]() queueDBusCall([=]()
{ {
setWindLayer(layer, altitude, direction, speed, shearDirection, shearSpeed, turbulence); setWindLayer(layer, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence);
}); });
} }
else else

View File

@@ -81,21 +81,21 @@ namespace XSwiftBus
//! Set a cloud layer. //! Set a cloud layer.
//! \param layer Layer 0, 1, or 2. //! \param layer Layer 0, 1, or 2.
//! \param base Cloud base in meters above mean sea level. //! \param baseM Cloud base in meters above mean sea level.
//! \param tops Cloud tops in meters above mean sea level. //! \param topsM Cloud tops in meters above mean sea level.
//! \param type Type of cloud: 0=clear, 1=cirrus, 2=scattered, 3=broken, 4=overcast, 5=stratus. //! \param type Type of cloud: 0=clear, 1=cirrus, 2=scattered, 3=broken, 4=overcast, 5=stratus.
//! \param coverage Amount of sky covered [0,6]. //! \param coverage Amount of sky covered [0,6].
void setCloudLayer(int layer, int base, int tops, int type, int coverage); void setCloudLayer(int layer, int baseM, int topsM, int type, int coverage);
//! Set a wind layer. //! Set a wind layer.
//! \param layer Layer 0, 1, or 2. //! \param layer Layer 0, 1, or 2.
//! \param altitude Altitude in middle of layer in meters above mean sea level. //! \param altitudeM Altitude in middle of layer in meters above mean sea level.
//! \param direction Direction from which wind is blowing in degrees true. //! \param directionDeg Direction from which wind is blowing in degrees true.
//! \param speed Wind speed in knots. //! \param speedKt Wind speed in knots.
//! \param shearDirection Direction from which wind shears blow in degrees true. //! \param shearDirectionDeg Direction from which wind shears blow in degrees true.
//! \param shearSpeed Wind speed gain in knots (e.g. speed=10 and shearSpeed=5 means speed varies between 10 and 15). //! \param shearSpeedKt Wind speed gain in knots (e.g. speed=10 and shearSpeed=5 means speed varies between 10 and 15).
//! \param turbulence Amount of turbulence [0,10]. //! \param turbulence Amount of turbulence [0,10].
void setWindLayer(int layer, int altitude, double direction, int speed, int shearDirection, int shearSpeed, int turbulence); void setWindLayer(int layer, int altitudeM, double directionDeg, int speedKt, int shearDirectionDeg, int shearSpeedKt, int turbulence);
//! Perform generic processing //! Perform generic processing
int process(); int process();