From ec8245ea53323d17dc871221ec35130b1b8640b0 Mon Sep 17 00:00:00 2001 From: Roland Rossgotterer Date: Wed, 21 Nov 2018 16:52:20 +0100 Subject: [PATCH] [XSwiftBus] Give PQ variables a unit ref T313 --- .../simulator/xplane/simulatorxplane.cpp | 64 ++++---- .../simulator/xplane/simulatorxplane.h | 25 ++- .../xplane/xswiftbusserviceproxy.cpp | 152 +++++++++--------- .../simulator/xplane/xswiftbusserviceproxy.h | 106 ++++++------ .../xplane/xswiftbustrafficproxy.cpp | 6 +- .../simulator/xplane/xswiftbustrafficproxy.h | 24 +-- .../xplane/xswiftbusweatherproxy.cpp | 8 +- .../simulator/xplane/xswiftbusweatherproxy.h | 4 +- .../org.swift_project.xswiftbus.service.xml | 38 ++--- src/xswiftbus/service.cpp | 78 ++++----- src/xswiftbus/service.h | 38 ++--- src/xswiftbus/traffic.cpp | 16 +- src/xswiftbus/traffic.h | 5 +- src/xswiftbus/weather.cpp | 38 ++--- src/xswiftbus/weather.h | 18 +-- 15 files changed, 310 insertions(+), 310 deletions(-) diff --git a/src/plugins/simulator/xplane/simulatorxplane.cpp b/src/plugins/simulator/xplane/simulatorxplane.cpp index 40738427d..5a195b26e 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.cpp +++ b/src/plugins/simulator/xplane/simulatorxplane.cpp @@ -207,26 +207,26 @@ namespace BlackSimPlugin if (this->isConnected()) { m_serviceProxy->getOwnAircraftSituationData(&m_xplaneData); - m_serviceProxy->getCom1ActiveAsync(&m_xplaneData.com1Active); - m_serviceProxy->getCom1StandbyAsync(&m_xplaneData.com1Standby); - m_serviceProxy->getCom2ActiveAsync(&m_xplaneData.com2Active); - m_serviceProxy->getCom2StandbyAsync(&m_xplaneData.com2Standby); + m_serviceProxy->getCom1ActiveKhzAsync(&m_xplaneData.com1ActiveKhz); + m_serviceProxy->getCom1StandbyKhzAsync(&m_xplaneData.com1StandbyKhz); + m_serviceProxy->getCom2ActiveKhzAsync(&m_xplaneData.com2ActiveKhz); + m_serviceProxy->getCom2StandbyKhzAsync(&m_xplaneData.com2StandbyKhz); m_serviceProxy->getTransponderCodeAsync(&m_xplaneData.xpdrCode); m_serviceProxy->getTransponderModeAsync(&m_xplaneData.xpdrMode); m_serviceProxy->getTransponderIdentAsync(&m_xplaneData.xpdrIdent); m_serviceProxy->getAllWheelsOnGroundAsync(&m_xplaneData.onGroundAll); CAircraftSituation situation; - situation.setPosition({ m_xplaneData.latitude, m_xplaneData.longitude, 0 }); - CAltitude altitude { m_xplaneData.altitude, CAltitude::MeanSeaLevel, CLengthUnit::m() }; - situation.setAltitude({ m_xplaneData.altitude, CAltitude::MeanSeaLevel, CLengthUnit::m() }); - CPressure seaLevelPressure({ m_xplaneData.seaLeveLPressure, CPressureUnit::inHg() }); + situation.setPosition({ m_xplaneData.latitudeDeg, m_xplaneData.longitudeDeg, 0 }); + CAltitude altitude { m_xplaneData.altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() }; + situation.setAltitude({ m_xplaneData.altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() }); + CPressure seaLevelPressure({ m_xplaneData.seaLevelPressureInHg, CPressureUnit::inHg() }); CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure)); situation.setPressureAltitude(pressureAltitude); - situation.setHeading({ m_xplaneData.trueHeading, CHeading::True, CAngleUnit::deg() }); - situation.setPitch({ m_xplaneData.pitch, CAngleUnit::deg() }); - situation.setBank({ m_xplaneData.roll, CAngleUnit::deg() }); - situation.setGroundSpeed({ m_xplaneData.groundspeed, CSpeedUnit::m_s() }); + situation.setHeading({ m_xplaneData.trueHeadingDeg, CHeading::True, CAngleUnit::deg() }); + situation.setPitch({ m_xplaneData.pitchDeg, CAngleUnit::deg() }); + situation.setBank({ m_xplaneData.rollDeg, CAngleUnit::deg() }); + situation.setGroundSpeed({ m_xplaneData.groundspeedMs, CSpeedUnit::m_s() }); // updates updateOwnIcaoCodes(m_xplaneData.aircraftIcaoCode, CAirlineIcaoCode()); @@ -239,12 +239,12 @@ namespace BlackSimPlugin CTransponder transponder(myAircraft.getTransponder()); // updates - com1.setFrequencyActive(CFrequency(m_xplaneData.com1Active, CFrequencyUnit::kHz())); - com1.setFrequencyStandby(CFrequency(m_xplaneData.com1Standby, CFrequencyUnit::kHz())); + com1.setFrequencyActive(CFrequency(m_xplaneData.com1ActiveKhz, CFrequencyUnit::kHz())); + com1.setFrequencyStandby(CFrequency(m_xplaneData.com1StandbyKhz, CFrequencyUnit::kHz())); const bool changedCom1 = myAircraft.getCom1System() != com1; - com2.setFrequencyActive(CFrequency(m_xplaneData.com2Active, CFrequencyUnit::kHz())); - com2.setFrequencyStandby(CFrequency(m_xplaneData.com2Standby, CFrequencyUnit::kHz())); + com2.setFrequencyActive(CFrequency(m_xplaneData.com2ActiveKhz, CFrequencyUnit::kHz())); + com2.setFrequencyStandby(CFrequency(m_xplaneData.com2StandbyKhz, CFrequencyUnit::kHz())); const bool changedCom2 = myAircraft.getCom2System() != com2; transponder = CTransponder::getStandardTransponder(m_xplaneData.xpdrCode, xpdrMode(m_xplaneData.xpdrMode, m_xplaneData.xpdrIdent)); @@ -493,21 +493,21 @@ namespace BlackSimPlugin { Q_ASSERT(this->isConnected()); if (originator == this->identifier()) { return false; } - auto com1 = CComSystem::getCom1System({ m_xplaneData.com1Active, CFrequencyUnit::kHz() }, { m_xplaneData.com1Standby, CFrequencyUnit::kHz() }); - auto com2 = CComSystem::getCom2System({ m_xplaneData.com2Active, CFrequencyUnit::kHz() }, { m_xplaneData.com2Standby, CFrequencyUnit::kHz() }); + auto com1 = CComSystem::getCom1System({ m_xplaneData.com1ActiveKhz, CFrequencyUnit::kHz() }, { m_xplaneData.com1StandbyKhz, 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)); if (aircraft.hasChangedCockpitData(com1, com2, xpdr)) { - m_xplaneData.com1Active = aircraft.getCom1System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); - m_xplaneData.com1Standby = aircraft.getCom1System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); - m_xplaneData.com2Active = aircraft.getCom2System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); - m_xplaneData.com2Standby = aircraft.getCom2System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); + m_xplaneData.com1ActiveKhz = aircraft.getCom1System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); + m_xplaneData.com1StandbyKhz = aircraft.getCom1System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); + m_xplaneData.com2ActiveKhz = aircraft.getCom2System().getFrequencyActive().valueInteger(CFrequencyUnit::kHz()); + m_xplaneData.com2StandbyKhz = aircraft.getCom2System().getFrequencyStandby().valueInteger(CFrequencyUnit::kHz()); m_xplaneData.xpdrCode = aircraft.getTransponderCode(); m_xplaneData.xpdrMode = xpdrMode(aircraft.getTransponderMode()); - m_serviceProxy->setCom1Active(m_xplaneData.com1Active); - m_serviceProxy->setCom1Standby(m_xplaneData.com1Standby); - m_serviceProxy->setCom2Active(m_xplaneData.com2Active); - m_serviceProxy->setCom2Standby(m_xplaneData.com2Standby); + m_serviceProxy->setCom1ActiveKhz(m_xplaneData.com1ActiveKhz); + m_serviceProxy->setCom1StandbyKhz(m_xplaneData.com1StandbyKhz); + m_serviceProxy->setCom2ActiveKhz(m_xplaneData.com2ActiveKhz); + m_serviceProxy->setCom2StandbyKhz(m_xplaneData.com2StandbyKhz); m_serviceProxy->setTransponderCode(m_xplaneData.xpdrCode); m_serviceProxy->setTransponderMode(m_xplaneData.xpdrMode); @@ -821,12 +821,12 @@ namespace BlackSimPlugin { this->rememberLastSent(interpolatedSituation); planesPositions.callsigns.push_back(interpolatedSituation.getCallsign().asString()); - planesPositions.latitudes.push_back(interpolatedSituation.latitude().value(CAngleUnit::deg())); - planesPositions.longitudes.push_back(interpolatedSituation.longitude().value(CAngleUnit::deg())); - planesPositions.altitudes.push_back(interpolatedSituation.getAltitude().value(CLengthUnit::ft())); - planesPositions.pitches.push_back(interpolatedSituation.getPitch().value(CAngleUnit::deg())); - planesPositions.rolls.push_back(interpolatedSituation.getBank().value(CAngleUnit::deg())); - planesPositions.headings.push_back(interpolatedSituation.getHeading().value(CAngleUnit::deg())); + planesPositions.latitudesDeg.push_back(interpolatedSituation.latitude().value(CAngleUnit::deg())); + planesPositions.longitudesDeg.push_back(interpolatedSituation.longitude().value(CAngleUnit::deg())); + planesPositions.altitudesFt.push_back(interpolatedSituation.getAltitude().value(CLengthUnit::ft())); + planesPositions.pitchesDeg.push_back(interpolatedSituation.getPitch().value(CAngleUnit::deg())); + planesPositions.rollsDeg.push_back(interpolatedSituation.getBank().value(CAngleUnit::deg())); + planesPositions.headingsDeg.push_back(interpolatedSituation.getHeading().value(CAngleUnit::deg())); planesPositions.onGrounds.push_back(interpolatedSituation.getOnGround() == CAircraftSituation::OnGround); } } diff --git a/src/plugins/simulator/xplane/simulatorxplane.h b/src/plugins/simulator/xplane/simulatorxplane.h index a0ecd6fe9..86ee5ec19 100644 --- a/src/plugins/simulator/xplane/simulatorxplane.h +++ b/src/plugins/simulator/xplane/simulatorxplane.h @@ -71,23 +71,22 @@ namespace BlackSimPlugin class CXSwiftBusWeatherProxy; //! X-Plane data - //! \todo Add units to members? pitchDeg?, altitudeFt? struct XPlaneData { QString aircraftModelPath; //!< Aircraft model path QString aircraftIcaoCode; //!< Aircraft ICAO code - double latitude; //!< Longitude [deg] - double longitude; //!< Latitude [deg] - double altitude; //!< Altitude [m] - double groundspeed; //!< Ground speed [m/s] - double pitch; //!< Pitch [deg] - double roll; //!< Roll [deg] - double trueHeading; //!< True heading [deg] + double latitudeDeg; //!< Longitude [deg] + double longitudeDeg; //!< Latitude [deg] + double altitudeM; //!< Altitude [m] + double groundspeedMs; //!< Ground speed [m/s] + double pitchDeg; //!< Pitch [deg] + double rollDeg; //!< Roll [deg] + double trueHeadingDeg; //!< True heading [deg] bool onGroundAll; //!< All wheels on ground? - int com1Active; //!< COM1 active [kHz] - int com1Standby; //!< COM1 standby [kHz] - int com2Active; //!< COM2 active [kHz] - int com2Standby; //!< COM2 standby [kHz] + int com1ActiveKhz; //!< COM1 active [kHz] + int com1StandbyKhz; //!< COM1 standby [kHz] + int com2ActiveKhz; //!< COM2 active [kHz] + int com2StandbyKhz; //!< COM2 standby [kHz] int xpdrCode; //!< Transpondder code int xpdrMode; //!< Transponder mode (off=0,stdby=1,on=2,test=3) bool xpdrIdent; //!< Is transponder in ident? @@ -100,7 +99,7 @@ namespace BlackSimPlugin double gearReployRatio; //!< Gear deployment ratio [%] QList enginesN1Percentage; //!< N1 per engine [%] double speedBrakeRatio; //!< Speed break ratio [%] - double seaLeveLPressure; //!< Sea level pressure [inhg] + double seaLevelPressureInHg; //!< Sea level pressure [inhg] }; //! X-Plane ISimulator implementation diff --git a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp index cc31ff76d..0ee4a745a 100644 --- a/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbusserviceproxy.cpp @@ -48,14 +48,14 @@ namespace BlackSimPlugin QDBusPendingReply reply = *watcher; if (!reply.isError()) { - o_xplaneData->latitude = reply.argumentAt<0>(); - o_xplaneData->longitude = reply.argumentAt<1>(); - o_xplaneData->altitude = reply.argumentAt<2>(); - o_xplaneData->groundspeed = reply.argumentAt<3>(); - o_xplaneData->pitch = reply.argumentAt<4>(); - o_xplaneData->roll = reply.argumentAt<5>(); - o_xplaneData->trueHeading = reply.argumentAt<6>(); - o_xplaneData->seaLeveLPressure = reply.argumentAt<7>(); + o_xplaneData->latitudeDeg = reply.argumentAt<0>(); + o_xplaneData->longitudeDeg = reply.argumentAt<1>(); + o_xplaneData->altitudeM = reply.argumentAt<2>(); + o_xplaneData->groundspeedMs = reply.argumentAt<3>(); + o_xplaneData->pitchDeg = reply.argumentAt<4>(); + o_xplaneData->rollDeg = reply.argumentAt<5>(); + o_xplaneData->trueHeadingDeg = reply.argumentAt<6>(); + o_xplaneData->seaLevelPressureInHg = reply.argumentAt<7>(); } watcher->deleteLater(); }; @@ -189,94 +189,94 @@ namespace BlackSimPlugin m_dbusInterface->callDBusAsync(QLatin1String("isUsingRealTime"), setterCallback(o_isRealTime)); } - double CXSwiftBusServiceProxy::getLatitude() const + double CXSwiftBusServiceProxy::getLatitudeDeg() const { - return m_dbusInterface->callDBusRet(QLatin1String("getLatitude")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getLongitude")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getAltitudeMSL")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getHeightAGL")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getGroundSpeed")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getIndicatedAirspeed")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getTrueAirspeed")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getPitch")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getRoll")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getTrueHeading")); + return m_dbusInterface->callDBusRet(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 @@ -297,40 +297,40 @@ namespace BlackSimPlugin m_dbusInterface->callDBusAsync(QLatin1String("getAllWheelsOnGround"), setterCallback(o_allWheels)); } - int CXSwiftBusServiceProxy::getCom1Active() const + int CXSwiftBusServiceProxy::getCom1ActiveKhz() const { - return m_dbusInterface->callDBusRet(QLatin1String("getCom1Active")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getCom1Standby")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getCom2Active")); + return m_dbusInterface->callDBusRet(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(QLatin1String("getCom2Standby")); + return m_dbusInterface->callDBusRet(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 @@ -412,35 +412,35 @@ namespace BlackSimPlugin } - double CXSwiftBusServiceProxy::getQNH() const + double CXSwiftBusServiceProxy::getQNHInHg() const { - return m_dbusInterface->callDBusRet(QLatin1String("getQNH")); + return m_dbusInterface->callDBusRet(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) diff --git a/src/plugins/simulator/xplane/xswiftbusserviceproxy.h b/src/plugins/simulator/xplane/xswiftbusserviceproxy.h index 3d8e718e2..d770caaf1 100644 --- a/src/plugins/simulator/xplane/xswiftbusserviceproxy.h +++ b/src/plugins/simulator/xplane/xswiftbusserviceproxy.h @@ -183,64 +183,64 @@ namespace BlackSimPlugin void isUsingRealTimeAsync(bool *o_isRealTime); //! @} - //! \copydoc XSwiftBus::CService::getLatitude + //! \copydoc XSwiftBus::CService::getLatitudeDeg //! @{ - double getLatitude() const; - void getLatitudeAsync(double *o_latitude); + double getLatitudeDeg() const; + void getLatitudeDegAsync(double *o_latitude); //! @} - //! \copydoc XSwiftBus::CService::getLongitude + //! \copydoc XSwiftBus::CService::getLongitudeDeg //! @{ - double getLongitude() const; - void getLongitudeAsync(double *o_longitude); + double getLongitudeDeg() const; + void getLongitudeDegAsync(double *o_longitude); //! @} - //! \copydoc XSwiftBus::CService::getAltitudeMSL + //! \copydoc XSwiftBus::CService::getAltitudeMslM //! @{ - double getAltitudeMSL() const; - void getAltitudeMSLAsync(double *o_altitude); + double getAltitudeMslM() const; + void getAltitudeMslMAsync(double *o_altitude); //! @} - //! \copydoc XSwiftBus::CService::getHeightAGL + //! \copydoc XSwiftBus::CService::getHeightAglM //! @{ - double getHeightAGL() const; - void getHeightAGLAsync(double *o_height); + double getHeightAglM() const; + void getHeightAglMAsync(double *o_height); //! @} - //! \copydoc XSwiftBus::CService::getGroundSpeed + //! \copydoc XSwiftBus::CService::getGroundSpeedMps //! @{ - double getGroundSpeed() const; - void getGroundSpeedAsync(double *o_groundspeed); + double getGroundSpeedMps() const; + void getGroundSpeedMpsAsync(double *o_groundspeed); //! @} - //! \copydoc XSwiftBus::CService::getIndicatedAirspeed + //! \copydoc XSwiftBus::CService::getIndicatedAirspeedKias //! @{ - double getIndicatedAirspeed() const; - void getIndicatedAirspeedAsync(double *o_ias); + double getIndicatedAirspeedKias() const; + void getIndicatedAirspeedKiasAsync(double *o_ias); //! @} - //! \copydoc XSwiftBus::CService::getTrueAirspeed + //! \copydoc XSwiftBus::CService::getTrueAirspeedKias //! @{ - double getTrueAirspeed() const; - void getTrueAirspeedAsync(double *o_tas); + double getTrueAirspeedKias() const; + void getTrueAirspeedKiasAsync(double *o_tas); //! @} - //! \copydoc XSwiftBus::CService::getPitch + //! \copydoc XSwiftBus::CService::getPitchDeg //! @{ - double getPitch() const; - void getPitchAsync(double *o_pitch); + double getPitchDeg() const; + void getPitchDegAsync(double *o_pitch); //! @} - //! \copydoc XSwiftBus::CService::getRoll + //! \copydoc XSwiftBus::CService::getRollDeg //! @{ - double getRoll() const; - void getRollAsync(double *o_roll); + double getRollDeg() const; + void getRollDegAsync(double *o_roll); //! @} - //! \copydoc XSwiftBus::CService::getTrueHeading + //! \copydoc XSwiftBus::CService::getTrueHeadingDeg //! @{ - double getTrueHeading() const; - void getTrueHeadingAsync(double *o_heading); + double getTrueHeadingDeg() const; + void getTrueHeadingDegAsync(double *o_heading); //! @} //! Get whether any wheel is on the ground @@ -255,28 +255,28 @@ namespace BlackSimPlugin void getAllWheelsOnGroundAsync(bool *o_allWheels); //! @} - //! \copydoc XSwiftBus::CService::getCom1Active + //! \copydoc XSwiftBus::CService::getCom1ActiveKhz //! @{ - int getCom1Active() const; - void getCom1ActiveAsync(int *o_com1Active); + int getCom1ActiveKhz() const; + void getCom1ActiveKhzAsync(int *o_com1Active); //! @} - //! \copydoc XSwiftBus::CService::getCom1Standby + //! \copydoc XSwiftBus::CService::getCom1StandbyKhz //! @{ - int getCom1Standby() const; - void getCom1StandbyAsync(int *o_com1Standby); + int getCom1StandbyKhz() const; + void getCom1StandbyKhzAsync(int *o_com1Standby); //! @} - //! \copydoc XSwiftBus::CService::getCom2Active + //! \copydoc XSwiftBus::CService::getCom2ActiveKhz //! @{ - int getCom2Active() const; - void getCom2ActiveAsync(int *o_com2Active); + int getCom2ActiveKhz() const; + void getCom2ActiveKhzAsync(int *o_com2Active); //! @} - //! \copydoc XSwiftBus::CService::getCom2Standby + //! \copydoc XSwiftBus::CService::getCom2StandbyKhz //! @{ - int getCom2Standby() const; - void getCom2StandbyAsync(int *o_com2Standby); + int getCom2StandbyKhz() const; + void getCom2StandbyKhzAsync(int *o_com2Standby); //! @} //! \copydoc XSwiftBus::CService::getTransponderCode @@ -327,23 +327,23 @@ namespace BlackSimPlugin void getTaxiLightsOnAsync(bool *o_taxiLightsOn); //! @} - //! \copydoc XSwiftBus::CService::getQNH + //! \copydoc XSwiftBus::CService::getQNHInHg //! @{ - double getQNH() const; - void getQNHAsync(double *o_qnh); + double getQNHInHg() const; + void getQNHInHgAsync(double *o_qnh); //! @} - //! \copydoc XSwiftBus::CService::setCom1Active - void setCom1Active(int freq); + //! \copydoc XSwiftBus::CService::setCom1ActiveKhz + void setCom1ActiveKhz(int freq); - //! \copydoc XSwiftBus::CService::setCom1Standby - void setCom1Standby(int freq); + //! \copydoc XSwiftBus::CService::setCom1StandbyKhz + void setCom1StandbyKhz(int freq); - //! \copydoc XSwiftBus::CService::setCom2Active - void setCom2Active(int freq); + //! \copydoc XSwiftBus::CService::setCom2ActiveKhz + void setCom2ActiveKhz(int freq); - //! \copydoc XSwiftBus::CService::setCom2Standby - void setCom2Standby(int freq); + //! \copydoc XSwiftBus::CService::setCom2StandbyKhz + void setCom2StandbyKhz(int freq); //! \copydoc XSwiftBus::CService::setTransponderCode void setTransponderCode(int code); diff --git a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp index 0e30d956f..b97ec2057 100644 --- a/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbustrafficproxy.cpp @@ -99,9 +99,9 @@ namespace BlackSimPlugin void CXSwiftBusTrafficProxy::setPlanesPositions(const PlanesPositions &planesPositions) { m_dbusInterface->callDBus(QLatin1String("setPlanesPositions"), - planesPositions.callsigns, planesPositions.latitudes, planesPositions.longitudes, - planesPositions.altitudes, planesPositions.pitches, planesPositions.rolls, - planesPositions.headings, planesPositions.onGrounds); + planesPositions.callsigns, planesPositions.latitudesDeg, planesPositions.longitudesDeg, + planesPositions.altitudesFt, planesPositions.pitchesDeg, planesPositions.rollsDeg, + planesPositions.headingsDeg, planesPositions.onGrounds); } void CXSwiftBusTrafficProxy::setPlanesSurfaces(const PlanesSurfaces &planesSurfaces) diff --git a/src/plugins/simulator/xplane/xswiftbustrafficproxy.h b/src/plugins/simulator/xplane/xswiftbustrafficproxy.h index 58e8a428a..827e39ff9 100644 --- a/src/plugins/simulator/xplane/xswiftbustrafficproxy.h +++ b/src/plugins/simulator/xplane/xswiftbustrafficproxy.h @@ -44,22 +44,22 @@ namespace BlackSimPlugin bool hasSameSizes() const { const int s = callsigns.size(); - if (s != latitudes.size()) { return false; } - if (s != longitudes.size()) { return false; } - if (s != altitudes.size()) { return false; } - if (s != pitches.size()) { return false; } - if (s != rolls.size()) { return false; } - if (s != headings.size()) { return false; } + if (s != latitudesDeg.size()) { return false; } + if (s != longitudesDeg.size()) { return false; } + if (s != altitudesFt.size()) { return false; } + if (s != pitchesDeg.size()) { return false; } + if (s != rollsDeg.size()) { return false; } + if (s != headingsDeg.size()) { return false; } return true; } QStringList callsigns; //!< List of callsigns - QList latitudes; //!< List of latitudes - QList longitudes; //!< List of longitudes - QList altitudes; //!< List of altitudes - QList pitches; //!< List of pitches - QList rolls; //!< List of rolls - QList headings; //!< List of headings + QList latitudesDeg; //!< List of latitudes + QList longitudesDeg; //!< List of longitudes + QList altitudesFt; //!< List of altitudes + QList pitchesDeg; //!< List of pitches + QList rollsDeg; //!< List of rolls + QList headingsDeg; //!< List of headings QList onGrounds; //!< List of onGrounds }; diff --git a/src/plugins/simulator/xplane/xswiftbusweatherproxy.cpp b/src/plugins/simulator/xplane/xswiftbusweatherproxy.cpp index 20b728449..223c4b5cf 100644 --- a/src/plugins/simulator/xplane/xswiftbusweatherproxy.cpp +++ b/src/plugins/simulator/xplane/xswiftbusweatherproxy.cpp @@ -75,14 +75,14 @@ namespace BlackSimPlugin 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); } } diff --git a/src/plugins/simulator/xplane/xswiftbusweatherproxy.h b/src/plugins/simulator/xplane/xswiftbusweatherproxy.h index 963594f26..6b7e62f99 100644 --- a/src/plugins/simulator/xplane/xswiftbusweatherproxy.h +++ b/src/plugins/simulator/xplane/xswiftbusweatherproxy.h @@ -92,10 +92,10 @@ namespace BlackSimPlugin void setRunwayFriction(int friction); //! \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 - 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); }; } diff --git a/src/xswiftbus/org.swift_project.xswiftbus.service.xml b/src/xswiftbus/org.swift_project.xswiftbus.service.xml index 16e5d9430..47b409db2 100644 --- a/src/xswiftbus/org.swift_project.xswiftbus.service.xml +++ b/src/xswiftbus/org.swift_project.xswiftbus.service.xml @@ -57,34 +57,34 @@ R"( - + - + - + - + - + - + - + - + - + - + @@ -93,16 +93,16 @@ R"( - + - + - + - + @@ -129,19 +129,19 @@ R"( - + - + - + - + - + diff --git a/src/xswiftbus/service.cpp b/src/xswiftbus/service.cpp index 146adf998..81cbcba01 100644 --- a/src/xswiftbus/service.cpp +++ b/src/xswiftbus/service.cpp @@ -171,7 +171,7 @@ namespace XSwiftBus } std::vector icaos, names; std::vector lats, lons, alts; - std::vector closestAirports = findClosestAirports(20, getLatitude(), getLongitude()); + std::vector closestAirports = findClosestAirports(20, getLatitudeDeg(), getLongitudeDeg()); for (const auto &navref : closestAirports) { float lat, lon, alt; @@ -349,74 +349,74 @@ namespace XSwiftBus sendDBusReply(sender, serial, isUsingRealTime()); }); } - else if (message.getMethodName() == "getLatitude") + else if (message.getMethodName() == "getLatitudeDeg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getLatitude()); + sendDBusReply(sender, serial, getLatitudeDeg()); }); } - else if (message.getMethodName() == "getLongitude") + else if (message.getMethodName() == "getLongitudeDeg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getLongitude()); + sendDBusReply(sender, serial, getLongitudeDeg()); }); } - else if (message.getMethodName() == "getAltitudeMSL") + else if (message.getMethodName() == "getAltitudeMslM") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getAltitudeMSL()); + sendDBusReply(sender, serial, getAltitudeMslM()); }); } - else if (message.getMethodName() == "getHeightAGL") + else if (message.getMethodName() == "getHeightAglM") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getHeightAGL()); + sendDBusReply(sender, serial, getHeightAglM()); }); } - else if (message.getMethodName() == "getGroundSpeed") + else if (message.getMethodName() == "getGroundSpeedMps") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getGroundSpeed()); + sendDBusReply(sender, serial, getGroundSpeedMps()); }); } - else if (message.getMethodName() == "getIndicatedAirspeed") + else if (message.getMethodName() == "getIndicatedAirspeedKias") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getIndicatedAirspeed()); + sendDBusReply(sender, serial, getIndicatedAirspeedKias()); }); } - else if (message.getMethodName() == "getTrueAirspeed") + else if (message.getMethodName() == "getTrueAirspeedKias") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getTrueAirspeed()); + sendDBusReply(sender, serial, getTrueAirspeedKias()); }); } - else if (message.getMethodName() == "getPitch") + else if (message.getMethodName() == "getPitchDeg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getPitch()); + sendDBusReply(sender, serial, getPitchDeg()); }); } - else if (message.getMethodName() == "getRoll") + else if (message.getMethodName() == "getRollDeg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getRoll()); + sendDBusReply(sender, serial, getRollDeg()); }); } - else if (message.getMethodName() == "getTrueHeading") + else if (message.getMethodName() == "getTrueHeadingDeg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getTrueHeading()); + sendDBusReply(sender, serial, getTrueHeadingDeg()); }); } else if (message.getMethodName() == "getAnyWheelOnGround") @@ -433,32 +433,32 @@ namespace XSwiftBus sendDBusReply(sender, serial, getAllWheelsOnGround()); }); } - else if (message.getMethodName() == "getCom1Active") + else if (message.getMethodName() == "getCom1ActiveKhz") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getCom1Active()); + sendDBusReply(sender, serial, getCom1ActiveKhz()); }); } - else if (message.getMethodName() == "getCom1Standby") + else if (message.getMethodName() == "getCom1StandbyKhz") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getCom1Standby()); + sendDBusReply(sender, serial, getCom1StandbyKhz()); }); } - else if (message.getMethodName() == "getCom2Active") + else if (message.getMethodName() == "getCom2ActiveKhz") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getCom2Active()); + sendDBusReply(sender, serial, getCom2ActiveKhz()); }); } - else if (message.getMethodName() == "getCom2Standby") + else if (message.getMethodName() == "getCom2StandbyKhz") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getCom2Standby()); + sendDBusReply(sender, serial, getCom2StandbyKhz()); }); } else if (message.getMethodName() == "getTransponderCode") @@ -517,14 +517,14 @@ namespace XSwiftBus sendDBusReply(sender, serial, getTaxiLightsOn()); }); } - else if (message.getMethodName() == "getQNH") + else if (message.getMethodName() == "getQNHInHg") { queueDBusCall([ = ]() { - sendDBusReply(sender, serial, getQNH()); + sendDBusReply(sender, serial, getQNHInHg()); }); } - else if (message.getMethodName() == "setCom1Active") + else if (message.getMethodName() == "setCom1ActiveKhz") { maybeSendEmptyDBusReply(wantsReply, sender, serial); int frequency = 0; @@ -532,10 +532,10 @@ namespace XSwiftBus message.getArgument(frequency); queueDBusCall([ = ]() { - setCom1Active(frequency); + setCom1ActiveKhz(frequency); }); } - else if (message.getMethodName() == "setCom1Standby") + else if (message.getMethodName() == "setCom1StandbyKhz") { maybeSendEmptyDBusReply(wantsReply, sender, serial); int frequency = 0; @@ -543,10 +543,10 @@ namespace XSwiftBus message.getArgument(frequency); queueDBusCall([ = ]() { - setCom1Standby(frequency); + setCom1StandbyKhz(frequency); }); } - else if (message.getMethodName() == "setCom2Active") + else if (message.getMethodName() == "setCom2ActiveKhz") { maybeSendEmptyDBusReply(wantsReply, sender, serial); int frequency = 0; @@ -554,10 +554,10 @@ namespace XSwiftBus message.getArgument(frequency); queueDBusCall([ = ]() { - setCom2Active(frequency); + setCom2ActiveKhz(frequency); }); } - else if (message.getMethodName() == "setCom2Standby") + else if (message.getMethodName() == "setCom2StandbyKhz") { maybeSendEmptyDBusReply(wantsReply, sender, serial); int frequency = 0; @@ -565,7 +565,7 @@ namespace XSwiftBus message.getArgument(frequency); queueDBusCall([ = ]() { - setCom2Standby(frequency); + setCom2StandbyKhz(frequency); }); } else if (message.getMethodName() == "setTransponderCode") diff --git a/src/xswiftbus/service.h b/src/xswiftbus/service.h index 96a9b1793..37fc7a122 100644 --- a/src/xswiftbus/service.h +++ b/src/xswiftbus/service.h @@ -107,34 +107,34 @@ namespace XSwiftBus bool isUsingRealTime() const { return m_useSystemTime.get(); } //! Get aircraft latitude in degrees - double getLatitude() const { return m_latitude.get(); } + double getLatitudeDeg() const { return m_latitude.get(); } //! Get aircraft longitude in degrees - double getLongitude() const { return m_longitude.get(); } + double getLongitudeDeg() const { return m_longitude.get(); } //! Get aircraft altitude in meters - double getAltitudeMSL() const { return m_elevation.get(); } + double getAltitudeMslM() const { return m_elevation.get(); } //! 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 - double getGroundSpeed() const { return m_groundSpeed.get(); } + double getGroundSpeedMps() const { return m_groundSpeed.get(); } //! 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 - double getTrueAirspeed() const { return m_trueAirspeed.get(); } + double getTrueAirspeedKias() const { return m_trueAirspeed.get(); } //! 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 - double getRoll() const { return m_roll.get(); } + double getRollDeg() const { return m_roll.get(); } //! 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 bool getAnyWheelOnGround() const { return m_onGroundAny.get(); } @@ -143,16 +143,16 @@ namespace XSwiftBus bool getAllWheelsOnGround() const { return m_onGroundAll.get(); } //! 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 - int getCom1Standby() const { return m_com1Standby.get() * 10; } + int getCom1StandbyKhz() const { return m_com1Standby.get() * 10; } //! 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 - int getCom2Standby() const { return m_com2Standby.get() * 10; } + int getCom2StandbyKhz() const { return m_com2Standby.get() * 10; } //! Get the current transponder code in decimal int getTransponderCode() const { return m_xpdrCode.get(); } @@ -179,19 +179,19 @@ namespace XSwiftBus bool getTaxiLightsOn() const { return m_taxiLightsOn.get(); } //! 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 - 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 - 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 - 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 - 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 void setTransponderCode(int code) { m_xpdrCode.set(code); } diff --git a/src/xswiftbus/traffic.cpp b/src/xswiftbus/traffic.cpp index bbf8fd274..a61fd6b64 100644 --- a/src/xswiftbus/traffic.cpp +++ b/src/xswiftbus/traffic.cpp @@ -318,8 +318,8 @@ namespace XSwiftBus m_followPlaneViewSequence.clear(); } - void CTraffic::setPlanesPositions(const std::vector &callsigns, std::vector latitudes, std::vector longitudes, std::vector altitudes, - std::vector pitches, std::vector rolles, std::vector headings, const std::vector &onGrounds) + void CTraffic::setPlanesPositions(const std::vector &callsigns, std::vector latitudesDeg, std::vector longitudesDeg, std::vector altitudesFt, + std::vector pitchesDeg, std::vector rollsDeg, std::vector headingsDeg, const std::vector &onGrounds) { (void)onGrounds; @@ -330,12 +330,12 @@ namespace XSwiftBus Plane *plane = planeIt->second; if (!plane) { return; } - plane->position.lat = latitudes.at(i); - plane->position.lon = longitudes.at(i); - plane->position.elevation = altitudes.at(i); - plane->position.pitch = static_cast(pitches.at(i)); - plane->position.roll = static_cast(rolles.at(i)); - plane->position.heading = static_cast(headings.at(i)); + plane->position.lat = latitudesDeg.at(i); + plane->position.lon = longitudesDeg.at(i); + plane->position.elevation = altitudesFt.at(i); + plane->position.pitch = static_cast(pitchesDeg.at(i)); + plane->position.roll = static_cast(rollsDeg.at(i)); + plane->position.heading = static_cast(headingsDeg.at(i)); } } diff --git a/src/xswiftbus/traffic.h b/src/xswiftbus/traffic.h index 3469ff188..bfb646a9d 100644 --- a/src/xswiftbus/traffic.h +++ b/src/xswiftbus/traffic.h @@ -96,8 +96,9 @@ namespace XSwiftBus void removeAllPlanes(); //! Set the position of multiple traffic aircrafts - void setPlanesPositions(const std::vector &callsigns, std::vector latitudes, std::vector longitudes, std::vector altitudes, - std::vector pitches, std::vector rolls, std::vector headings, const std::vector &onGrounds); + void setPlanesPositions(const std::vector &callsigns, + std::vector latitudesDeg, std::vector longitudesDeg, std::vector altitudesFt, + std::vector pitchesDeg, std::vector rollsDeg, std::vector headingsDeg, const std::vector &onGrounds); //! Set the flight control surfaces and lights of multiple traffic aircrafts void setPlanesSurfaces(const std::vector &callsigns, const std::vector &gears, const std::vector &flaps, const std::vector &spoilers, diff --git a/src/xswiftbus/weather.cpp b/src/xswiftbus/weather.cpp index 1f214fbfa..17dce2cb5 100644 --- a/src/xswiftbus/weather.cpp +++ b/src/xswiftbus/weather.cpp @@ -28,13 +28,13 @@ namespace XSwiftBus 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) { - case 0: setCloudLayerImpl(m_cloudLayer0, base, tops, type, coverage); break; - case 1: setCloudLayerImpl(m_cloudLayer1, base, tops, type, coverage); break; - case 2: setCloudLayerImpl(m_cloudLayer2, base, tops, type, coverage); break; + case 0: setCloudLayerImpl(m_cloudLayer0, baseM, topsM, type, coverage); break; + case 1: setCloudLayerImpl(m_cloudLayer1, baseM, topsM, type, coverage); break; + case 2: setCloudLayerImpl(m_cloudLayer2, baseM, topsM, type, coverage); break; default: DEBUG_LOG("Invalid cloud layer"); break; } } @@ -51,13 +51,13 @@ namespace XSwiftBus 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) { - case 0: setWindLayerImpl(m_windLayer0, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; - case 1: setWindLayerImpl(m_windLayer1, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; - case 2: setWindLayerImpl(m_windLayer2, altitude, direction, speed, shearDirection, shearSpeed, turbulence); break; + case 0: setWindLayerImpl(m_windLayer0, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break; + case 1: setWindLayerImpl(m_windLayer1, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break; + case 2: setWindLayerImpl(m_windLayer2, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); break; default: DEBUG_LOG("Invalid wind layer"); break; } } @@ -213,23 +213,23 @@ namespace XSwiftBus { maybeSendEmptyDBusReply(wantsReply, sender, serial); int layer = 0; - int altitude = 0; - double direction = 0; - int speed = 0; - int shearDirection = 0; - int shearSpeed = 0; + int altitudeM = 0; + double directionDeg = 0; + int speedKt = 0; + int shearDirectionDeg = 0; + int shearSpeedKt = 0; int turbulence = 0; message.beginArgumentRead(); message.getArgument(layer); - message.getArgument(altitude); - message.getArgument(direction); - message.getArgument(speed); - message.getArgument(shearDirection); - message.getArgument(shearSpeed); + message.getArgument(altitudeM); + message.getArgument(directionDeg); + message.getArgument(speedKt); + message.getArgument(shearDirectionDeg); + message.getArgument(shearSpeedKt); message.getArgument(turbulence); queueDBusCall([=]() { - setWindLayer(layer, altitude, direction, speed, shearDirection, shearSpeed, turbulence); + setWindLayer(layer, altitudeM, directionDeg, speedKt, shearDirectionDeg, shearSpeedKt, turbulence); }); } else diff --git a/src/xswiftbus/weather.h b/src/xswiftbus/weather.h index f53a349d8..4e731f431 100644 --- a/src/xswiftbus/weather.h +++ b/src/xswiftbus/weather.h @@ -81,21 +81,21 @@ namespace XSwiftBus //! Set a cloud layer. //! \param layer Layer 0, 1, or 2. - //! \param base Cloud base in meters above mean sea level. - //! \param tops Cloud tops in meters above mean sea level. + //! \param baseM Cloud base 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 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. //! \param layer Layer 0, 1, or 2. - //! \param altitude Altitude in middle of layer in meters above mean sea level. - //! \param direction Direction from which wind is blowing in degrees true. - //! \param speed Wind speed in knots. - //! \param shearDirection 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 altitudeM Altitude in middle of layer in meters above mean sea level. + //! \param directionDeg Direction from which wind is blowing in degrees true. + //! \param speedKt Wind speed in knots. + //! \param shearDirectionDeg Direction from which wind shears blow in degrees true. + //! \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]. - 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 int process();