9 #include <QDBusServiceWatcher>
10 #include <QElapsedTimer>
16 #include "dbus/dbus.h"
17 #include "qcompilerdetection.h"
49 #include "misc/simulation/settings/xswiftbussettingsqtfree.inc"
60 using namespace swift::config;
62 using namespace swift::misc::aviation;
63 using namespace swift::misc::network;
64 using namespace swift::misc::physical_quantities;
65 using namespace swift::misc::geo;
66 using namespace swift::misc::simulation;
67 using namespace swift::misc::simulation::settings;
68 using namespace swift::misc::weather;
73 const QString &xswiftbusServiceName()
75 static const QString name(
"org.swift-project.xswiftbus");
80 static const QString hash(XSWIFTBUS_COMMIT);
85 namespace swift::simplugin::xplane
90 : CSimulatorPluginCommon(info, ownAircraftProvider, remoteAircraftProvider, clientProvider, parent)
105 m_fastTimer.
start(100);
106 m_slowTimer.
start(1000);
107 m_pendingAddedTimer.
start(5000);
109 this->
setDefaultModel({
"Jets A320_a A320_a_Austrian_Airlines A320_a_Austrian_Airlines",
110 CAircraftModel::TypeModelMatchingDefaultModel,
"A320 AUA",
112 this->resetXPlaneData();
122 CSimulatorPluginCommon::unload();
129 return QStringLiteral(
"Add-time: %1ms/%2ms").
arg(m_statsAddCurrentTimeMs).
arg(m_statsAddMaxTimeMs);
134 m_statsAddMaxTimeMs = -1;
135 m_statsAddCurrentTimeMs = -1;
140 if (callsign.
isEmpty() || !m_xplaneAircraftObjects.
contains(callsign)) {
return {}; }
143 return m_xplaneAircraftObjects[callsign].getInterpolationMessages(setup.
getInterpolatorMode());
150 if (!m_trafficProxy) {
return false; }
151 if (!m_xplaneAircraftObjects.
contains(callsign)) {
return false; }
173 const QString &hint,
bool ignoreOutsideRange)
178 if (isSuspiciousTerrainValue(plane))
182 if (ignoreOutsideRange && distance > maxTerrainRequestDistance()) {
return false; }
184 static const CLength threshold = maxTerrainRequestDistance() * 0.50;
185 if (distance > threshold)
191 this->setMinTerrainProbeDistance(distance);
193 u
"Suspicous XPlane probe [%1] value %2 for '%3' ignored, distance: %4 min.disance: %5 water: %6")
196 << m_minSuspicousTerrainProbe.
valueRoundedAsString(CLengthUnit::NM(), 2) << boolToYesNo(waterFlag);
206 static const QString hint(
"probe callback");
207 if (!this->handleProbeValue(plane, callsign, isWater, hint,
false))
212 CSimulatorPluginCommon::callbackReceivedRequestedElevation(plane, callsign, isWater);
218 CSimulatorPluginCommon::setFlightNetworkConnected(connected);
221 bool CSimulatorXPlane::isSuspiciousTerrainValue(
const CElevationPlane &elevation)
225 return valueFt < 1.0;
228 const CLength &CSimulatorXPlane::maxTerrainRequestDistance()
230 static const CLength d(70.0, CLengthUnit::NM());
236 m_aircraftAddedFailed.
clear();
237 CSimulatorPluginCommon::clearAllRemoteAircraftData();
238 m_minSuspicousTerrainProbe.
setNull();
244 if (reference.
isNull()) {
return false; }
247 if (callsign.
isEmpty()) {
return false; }
251 if (!d.
isNull() && d > maxTerrainRequestDistance())
265 static const CAltitude alt(0, CAltitude::MeanSeaLevel, CLengthUnit::ft());
269 using namespace std::placeholders;
270 auto callback = [
this](
auto &&plane,
auto &&callsign,
auto &&isWater) {
272 std::forward<decltype(callsign)>(callsign),
273 std::forward<decltype(isWater)>(isWater));
277 m_trafficProxy->getElevationAtPosition(callsign, pos.
latitude().
value(CAngleUnit::deg()),
287 if (ident) {
return CTransponder::StateIdent; }
288 if (xplaneMode == 0 || xplaneMode == 1) {
return CTransponder::StateStandby; }
289 return CTransponder::ModeC;
295 void CSimulatorXPlane::fastTimerTimeout()
312 const CAltitude altitude { m_xplaneData.
altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() };
314 const CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure));
317 m_altitudeDelta = {};
324 CAltitude::PressureAltitude, CLengthUnit::ft());
325 m_altitudeDelta = pressureAltitude - pressureAltitudeXP12;
327 situation.
setAltitude({ altitude - m_altitudeDelta, CAltitude::MeanSeaLevel });
356 const int v1 = qRound(m_xplaneData.
com1Volume * 100);
357 com1.setVolumeReceive(v1);
360 const bool changedCom1 = myAircraft.getCom1System() != com1;
364 const int v2 = qRound(m_xplaneData.
com2Volume * 100);
365 com2.setVolumeReceive(v2);
368 const bool changedCom2 = myAircraft.getCom2System() != com2;
370 transponder = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
372 const bool changedXpr = (myAircraft.getTransponder() != transponder);
374 if (changedCom1 || changedCom2 || changedXpr)
381 void CSimulatorXPlane::slowTimerTimeout()
416 for (CXPlaneMPAircraft &xplaneAircraft : m_xplaneAircraftObjects)
419 const CCallsign cs = xplaneAircraft.getCallsign();
427 xplaneAircraft.setSimulatedAircraft(simulatedAircraft);
433 for (
const CCallsign &cs : invalid) { this->triggerRemoveAircraft(cs, ++i * 100); }
437 if ((m_slowTimerCalls % 3u) == 0u) { this->requestRemoteAircraftDataFromXPlane(); }
441 if ((m_slowTimerCalls % 5u) == 0u)
443 constexpr
double warningMiles = 1;
444 constexpr
double disconnectMiles = 2;
449 if (previousMiles < disconnectMiles && m_trackMilesShort >= disconnectMiles)
453 else if (previousMiles < warningMiles && m_trackMilesShort >= warningMiles)
466 const QString dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
468 if (CDBusServer::isSessionOrSystemAddress(dBusServerAddress))
471 m_dbusMode = Session;
473 else if (CDBusServer::isQtDBusAddress(dBusServerAddress))
476 if (!m_dBusConnection.
isConnected()) {
return false; }
484 bool s = m_dBusConnection.
connect(
QString(), DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL,
"Disconnected",
this,
485 SLOT(onDBusServiceUnregistered()));
497 QString xplaneVersion = QStringLiteral(
"%1.%2")
502 &CSimulatorXPlane::emitOwnAircraftModelChanged);
505 &CSimulatorXPlane::onRemoteAircraftAdded);
507 &CSimulatorXPlane::onRemoteAircraftAddingFailed);
508 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
512 this->sendXSwiftBusSettings();
515 this->loadCslPackages();
527 this->disconnectFromDBus();
528 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
529 delete m_serviceProxy;
530 delete m_trafficProxy;
531 m_serviceProxy =
nullptr;
532 m_trafficProxy =
nullptr;
533 m_fastTimerCalls = 0;
534 m_slowTimerCalls = 0;
540 void CSimulatorXPlane::onDBusServiceUnregistered()
542 if (!m_serviceProxy) {
return; }
547 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
548 delete m_serviceProxy;
549 delete m_trafficProxy;
550 m_serviceProxy =
nullptr;
551 m_trafficProxy =
nullptr;
555 void CSimulatorXPlane::emitOwnAircraftModelChanged(
const QString &path,
const QString &filename,
560 CAircraftModel model(modelString, CAircraftModel::TypeOwnSimulatorModel, CSimulatorInfo::XPLANE, name,
562 if (!livery.
isEmpty()) { model.setModelString(model.getModelString() +
" " + livery); }
563 model.setFileName(path +
"/" + filename);
574 static bool isInFunction =
false;
575 if (isInFunction) {
return; }
578 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
579 QColor color = msgBoxValues[9];
589 isInFunction =
false;
597 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
602 else { color = msgBoxValues[6]; }
610 return m_xplaneAircraftObjects.contains(callsign);
616 if (originator == this->
identifier()) {
return false; }
619 auto com1 = CComSystem::getCom1System({ m_xplaneData.
com1ActiveKhz, CFrequencyUnit::kHz() },
621 auto com2 = CComSystem::getCom2System({ m_xplaneData.
com2ActiveKhz, CFrequencyUnit::kHz() },
623 auto xpdr = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
653 if (originator == this->
identifier()) {
return false; }
661 void CSimulatorXPlane::loadCslPackages()
668 Prefix(
const QString &p) : s(p +
'/') {}
679 struct PrefixComparator
681 bool operator()(
const Prefix &a,
const QString &b)
const
685 bool operator()(
const QString &a,
const Prefix &b)
const
698 for (
const auto &model : models)
700 const QString &modelFile = model.getFileName();
704 auto it = std::lower_bound(packages.
begin(), packages.
end(), modelFile, PrefixComparator());
705 if (it != packages.
end() && it->isPrefixOf(modelFile)) {
continue; }
708 QString package = findCslPackage(modelFile);
709 if (package.isEmpty()) {
continue; }
710 packages.
insert(it, package);
716 for (
const Prefix &package : std::as_const(packages)) { superpackages.
insert(package.parent()); }
720 for (
const QString &package : superpackagesList)
722 if (CDirectoryUtils::isSameOrSubDirectoryOf(package, simDir))
733 u
"CSL package '%1' can not be loaded as it is outside the X-Plane installation directory")
739 QString CSimulatorXPlane::findCslPackage(
const QString &modelFile)
743 QDir dir = info.isDir() ?
QDir(modelFile) : info.dir();
745 if (dir.
exists(QStringLiteral(
"xsb_aircraft.txt"))) {
return dir.
path(); }
758 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
759 Q_ASSERT_X(!newRemoteAircraft.
getCallsign().
isEmpty(), Q_FUNC_INFO,
"empty callsign");
760 Q_ASSERT_X(newRemoteAircraft.
hasModelString(), Q_FUNC_INFO,
"missing model string");
772 if (this->canAddAircraft())
784 CLogMessage(
this).
warning(u
"Model for '%1' has no callsign, maybe using a default model") << callsign;
805 m_pendingToBeAddedAircraft.
replaceOrAdd(newRemoteAircraft);
816 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"wrong thread");
817 if (callsign.
isEmpty()) {
return false; }
820 if (!this->
isTestMode() && !m_xplaneAircraftObjects.contains(callsign) &&
831 if (m_xplaneAircraftObjects.contains(callsign))
847 if (m_addingInProgressAircraft.
contains(callsign))
852 if (!myself) {
return; }
853 m_addingInProgressAircraft.
remove(callsign);
860 m_xplaneAircraftObjects.remove(callsign);
864 return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
870 m_pendingToBeAddedAircraft.
clear();
871 m_addingInProgressAircraft.
clear();
872 return CSimulatorPluginCommon::physicallyRemoveAllRemoteAircraft();
883 if (!m_trafficProxy || !m_trafficProxy->
isValid()) {
return false; }
888 void CSimulatorXPlane::updateRemoteAircraft()
890 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
893 if (remoteAircraftNo < 1) {
return; }
900 PlanesPositions planesPositions;
901 PlanesSurfaces planesSurfaces;
902 PlanesTransponders planesTransponders;
904 uint32_t aircraftNumber = 0;
907 for (
const CXPlaneMPAircraft &xplaneAircraft : std::as_const(m_xplaneAircraftObjects))
909 const CCallsign callsign(xplaneAircraft.getCallsign());
910 const bool hasCallsign = !callsign.
isEmpty();
919 if (!callsignsInRange.
contains(callsign)) {
continue; }
921 planesTransponders.callsigns.push_back(callsign.
asString());
922 planesTransponders.codes.push_back(xplaneAircraft.getAircraft().getTransponderCode());
924 planesTransponders.idents.push_back(transponderMode == CTransponder::StateIdent);
925 planesTransponders.modeCs.push_back(transponderMode == CTransponder::ModeC);
933 xplaneAircraft.getInterpolation(currentTimestamp, setup, aircraftNumber++);
939 const CLength relativeAltitude =
941 const double altitudeDeltaWeight =
942 2 - qBound(3000.0, relativeAltitude.
abs().
value(CLengthUnit::ft()), 6000.0) / 3000;
943 const CLength alt = interpolatedSituation.getAltitude() +
944 m_altitudeDelta * altitudeDeltaWeight *
945 (1 - interpolatedSituation.getOnGroundInfo().getGroundFactor());
946 interpolatedSituation.setAltitude({ alt, interpolatedSituation.getAltitude().getReferenceDatum() });
949 if (updateAllAircraft || !this->
isEqualLastSent(interpolatedSituation))
952 planesPositions.push_back(interpolatedSituation);
967 planesSurfaces.push_back(xplaneAircraft.getCallsign(), parts);
975 if (!planesPositions.isEmpty())
977 if (CBuildConfig::isLocalDeveloperDebugBuild())
979 SWIFT_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO,
"Mismatching sizes");
984 if (!planesSurfaces.isEmpty()) { m_trafficProxy->
setPlanesSurfaces(planesSurfaces); }
990 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane()
998 CCallsignSet callsigns = m_xplaneAircraftObjects.getAllCallsigns();
1000 callsigns.
remove(remove);
1001 if (!callsigns.
isEmpty()) { this->requestRemoteAircraftDataFromXPlane(callsigns); }
1004 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1006 if (callsigns.
isEmpty()) {
return; }
1011 csStrings, [=](
const QStringList &callsigns,
const QDoubleList &latitudesDeg,
1012 const QDoubleList &longitudesDeg,
const QDoubleList &elevationsMeters,
1013 const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters) {
1014 if (!myself) {
return; }
1015 this->updateRemoteAircraftFromSimulator(callsigns, latitudesDeg, longitudesDeg, elevationsMeters,
1016 waterFlags, verticalOffsetsMeters);
1020 void CSimulatorXPlane::triggerRequestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1022 if (callsigns.
isEmpty()) {
return; }
1025 if (!myself) {
return; }
1026 this->requestRemoteAircraftDataFromXPlane(callsigns);
1030 void CSimulatorXPlane::updateRemoteAircraftFromSimulator(
1031 const QStringList &callsigns,
const QDoubleList &latitudesDeg,
const QDoubleList &longitudesDeg,
1032 const QDoubleList &elevationsMeters,
const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters)
1034 const int size = callsigns.
size();
1037 if (CBuildConfig::isLocalDeveloperDebugBuild())
1039 Q_ASSERT_X(elevationsMeters.size() == size, Q_FUNC_INFO,
"Wrong elevations");
1040 Q_ASSERT_X(waterFlags.size() == size, Q_FUNC_INFO,
"Wrong waterFlags");
1041 Q_ASSERT_X(latitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong latitudesDeg");
1042 Q_ASSERT_X(longitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong longitudesDeg");
1043 Q_ASSERT_X(verticalOffsetsMeters.size() == size, Q_FUNC_INFO,
"Wrong CG");
1047 static const QString hint(
"remote acft.");
1048 for (
int i = 0; i < size; i++)
1050 const bool emptyCs = callsigns[i].
isEmpty();
1052 if (emptyCs) {
continue; }
1055 if (!m_xplaneAircraftObjects.contains(cs)) {
continue; }
1056 const CXPlaneMPAircraft xpAircraft = m_xplaneAircraftObjects[cs];
1057 SWIFT_VERIFY_X(xpAircraft.hasCallsign(), Q_FUNC_INFO,
"Need callsign");
1058 if (!xpAircraft.hasCallsign()) {
continue; }
1061 if (!std::isnan(elevationsMeters[i]))
1063 const CAltitude elevationAlt =
CAltitude(elevationsMeters[i], CLengthUnit::m(), CLengthUnit::ft());
1065 CLongitude(longitudesDeg[i], CAngleUnit::deg()), elevationAlt,
1066 CElevationPlane::singlePointRadius());
1069 const double cgValue = verticalOffsetsMeters[i];
1071 cg = fixSimulatorCg(cg, xpAircraft.getAircraftModel());
1075 const bool waterFlag = waterFlags[i];
1076 const bool useElevation = this->handleProbeValue(elevation, cs, waterFlag, hint,
true);
1078 useElevation ? elevation : CElevationPlane::null(), cg);
1092 return { 0.0, CLengthUnit::ft() };
1097 void CSimulatorXPlane::disconnectFromDBus()
1101 if (m_trafficProxy) { m_trafficProxy->
cleanup(); }
1109 bool CSimulatorXPlane::sendXSwiftBusSettings()
1112 if (!m_serviceProxy) {
return false; }
1126 if (!m_serviceProxy) {
return s; }
1134 void CSimulatorXPlane::onXSwiftBusSettingsChanged()
1145 this->sendXSwiftBusSettings();
1150 void CSimulatorXPlane::setMinTerrainProbeDistance(
const CLength &distance)
1152 if (distance.
isNull()) {
return; }
1153 if (m_minSuspicousTerrainProbe.
isNull() || distance < m_minSuspicousTerrainProbe)
1155 m_minSuspicousTerrainProbe = distance;
1159 void CSimulatorXPlane::onRemoteAircraftAdded(
const QString &callsign)
1162 if (callsign.
isEmpty()) {
return; }
1167 bool wasPending =
false;
1168 if (m_addingInProgressAircraft.
contains(cs))
1171 const qint64 wasStartedMs = m_addingInProgressAircraft.
value(cs);
1173 m_statsAddCurrentTimeMs = deltaTimeMs;
1174 m_statsAddMaxTimeMs = std::max(deltaTimeMs, m_statsAddMaxTimeMs);
1175 m_addingInProgressAircraft.
remove(cs);
1180 CLogMessage(
this).
warning(u
"Aircraft '%1' no longer in range, will be removed") << callsign;
1181 this->triggerRemoveAircraft(cs, TimeoutAdding);
1190 CLogMessage(
this).
warning(u
"Added callsign '%1' was not in progress anymore. Timeout?") << callsign;
1193 const bool rendered =
true;
1196 this->triggerRequestRemoteAircraftDataFromXPlane(cs);
1197 this->triggerAddNextPendingAircraft();
1199 Q_ASSERT_X(addedRemoteAircraft.
hasCallsign(), Q_FUNC_INFO,
1201 Q_ASSERT_X(addedRemoteAircraft.
getCallsign() == cs, Q_FUNC_INFO,
1203 m_xplaneAircraftObjects.insert(cs, CXPlaneMPAircraft(addedRemoteAircraft,
this, &
m_interpolationLogger));
1207 void CSimulatorXPlane::onRemoteAircraftAddingFailed(
const QString &callsign)
1210 if (callsign.
isEmpty()) {
return; }
1221 CLogMessage(
this).
warning(u
"Adding '%1' failed, but aircraft no longer in range, will be removed")
1225 const bool wasPending = (
static_cast<int>(m_addingInProgressAircraft.
remove(cs)) > 0);
1226 Q_UNUSED(wasPending)
1230 m_aircraftAddedFailed.
push_back(failedRemoteAircraft);
1231 m_pendingToBeAddedAircraft.
replaceOrAdd(failedRemoteAircraft);
1233 this->triggerAddNextPendingAircraft();
1236 void CSimulatorXPlane::addNextPendingAircraft()
1238 if (m_pendingToBeAddedAircraft.
isEmpty()) {
return; }
1241 this->detectTimeoutAdding();
1244 if (!this->canAddAircraft()) {
return; }
1249 CLogMessage(
this).
info(u
"Adding next pending aircraft '%1', pending %2, in progress %3")
1251 << m_addingInProgressAircraft.
size();
1255 void CSimulatorXPlane::triggerAddNextPendingAircraft()
1260 this->addNextPendingAircraft();
1264 int CSimulatorXPlane::detectTimeoutAdding()
1266 if (m_addingInProgressAircraft.
isEmpty()) {
return 0; }
1270 for (
const CCallsign &cs : addingCallsigns)
1272 if (m_addingInProgressAircraft.
value(cs) < timeout) {
continue; }
1276 for (
const CCallsign &cs : std::as_const(timeoutCallsigns))
1278 m_addingInProgressAircraft.
remove(cs);
1282 return timeoutCallsigns.
size();
1285 void CSimulatorXPlane::triggerRemoveAircraft(
const CCallsign &callsign, qint64 deferMs)
1289 if (!myself) {
return; }
1294 QPair<qint64, qint64> CSimulatorXPlane::minMaxTimestampsAddInProgress()
const
1296 static const QPair<qint64, qint64> empty(-1, -1);
1297 if (m_addingInProgressAircraft.
isEmpty()) {
return empty; }
1300 return { *mm.first, *mm.second };
1303 bool CSimulatorXPlane::canAddAircraft()
const
1305 if (m_addingInProgressAircraft.
isEmpty()) {
return true; }
1309 const QPair<qint64, qint64> tsMM = this->minMaxTimestampsAddInProgress();
1310 const qint64 deltaLatest = now - tsMM.second;
1311 const bool canAdd = (deltaLatest > TimeoutAdding);
1320 return new CSimulatorXPlane(info, ownAircraftProvider, remoteAircraftProvider, clientProvider,
this);
1325 constexpr
int QueryInterval = 5 * 1000;
1337 if (!m_timer.
isActive()) {
return; }
1343 if (!myself) {
return; }
1348 void CSimulatorXPlaneListener::checkConnection()
1351 Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO,
"Expect to run in background");
1356 m_dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
1357 if (CDBusServer::isSessionOrSystemAddress(m_dBusServerAddress))
1359 checkConnectionViaSessionBus();
1362 else if (CDBusServer::isQtDBusAddress(m_dBusServerAddress))
1364 checkConnectionViaPeer(m_dBusServerAddress);
1371 void CSimulatorXPlaneListener::checkConnectionViaSessionBus()
1379 checkConnectionCommon();
1383 void CSimulatorXPlaneListener::checkConnectionViaPeer(
const QString &address)
1392 checkConnectionCommon();
1396 void CSimulatorXPlaneListener::checkConnectionCommon()
1398 CXSwiftBusServiceProxy service(m_DBusConnection);
1399 CXSwiftBusTrafficProxy traffic(m_DBusConnection);
1401 const bool result = service.isValid() && traffic.isValid();
1402 if (!result) {
return; }
1404 const QString swiftVersion = CBuildConfig::getVersionString();
1405 const QString xswiftbusVersion = service.getVersionNumber();
1406 const QString xswiftbusCommitHash = service.getCommitHash();
1407 if (xswiftbusVersion.
isEmpty())
1409 CLogMessage(
this).
warning(u
"Could not determine which version of xswiftbus is running. Mismatched versions "
1410 u
"might cause instability.");
1412 else if (commitHash() != xswiftbusCommitHash)
1414 CLogMessage(
this).
error(u
"You are using an incorrect version of xswiftbus. The version of xswiftbus (%1) "
1415 u
"should match the version of swift (%2). Consider upgrading!")
1416 << xswiftbusVersion << swiftVersion;
1419 if (!traffic.initialize())
1422 u
"Connection to xswiftbus successful, but could not initialize xswiftbus. Check X-Plane Log.txt.");
1426 const MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
1427 if (!info.hasAcquired)
1430 info.owner.
trimmed().
isEmpty() ? QStringLiteral(
"unknown plugin") : info.owner.trimmed();
1432 u
"Connection to xswiftbus successful, but could not acquire multiplayer planes. '%1' has acquired them "
1433 u
"already. Disable '%2' or remove it if not required and reload xswiftbus.")
1441 void CSimulatorXPlaneListener::serviceRegistered(
const QString &serviceName)
1447 void CSimulatorXPlaneListener::onXSwiftBusServerSettingChanged()
SWIFT_CORE_EXPORT swift::core::CApplication * sApp
Single instance of application object.
bool isShuttingDown() const
Is application shutting down?
Interface to a simulator.
double m_simTimeRatio
ratio of simulation time to real time, due to low FPS (X-Plane)
bool addLoopbackSituation(const swift::misc::aviation::CAircraftSituation &situation)
Add a loopback situation if logging is enabled.
bool isEqualLastSent(const swift::misc::aviation::CAircraftSituation &compare) const
Equal to last sent situation.
bool updateOwnSituationAndGroundElevation(const swift::misc::aviation::CAircraftSituation &situation)
Update own aircraft position and if suitable use it to update ground elevation.
bool isUpdateAllRemoteAircraft(qint64 currentTimestamp=-1) const
Do update all remote aircraft?
virtual bool isShuttingDown() const
Is overall (swift) application shutting down.
void requestedElevation(const swift::misc::aviation::CCallsign &callsign)
Requested elevation, call pending.
bool m_updateRemoteAircraftInProgress
currently updating remote aircraft
void rememberElevationAndSimulatorCG(const swift::misc::aviation::CCallsign &callsign, const swift::misc::simulation::CAircraftModel &model, bool likelyOnGroundElevation, const swift::misc::geo::CElevationPlane &elevation, const swift::misc::physical_quantities::CLength &simulatorCG)
Set elevation and CG in the providers and for auto publishing.
double m_trackMilesShort
difference between real and reported groundspeed, multiplied by time
double m_minutesLate
difference between real and reported groundspeed, integrated over time
bool isAircraftInRangeOrTestMode(const swift::misc::aviation::CCallsign &callsign) const
Test version aware version of isAircraftInRange.
void finishUpdateRemoteAircraftAndSetStatistics(qint64 startTime, bool limited=false)
Update stats and flags.
void insufficientFrameRateDetected(bool fatal)
Frame rate has fallen too far below the threshold to maintain consistent sim rate.
void reverseLookupAndUpdateOwnAircraftModel(const swift::misc::simulation::CAircraftModel &model)
Set own model.
swift::misc::aviation::CAircraftSituationList getLastSentCanLikelySkipNearGroundInterpolation() const
Last sent situations.
bool isTestMode() const
Test mode? (driver can skip code parts etc., driver dependent)
swift::misc::simulation::CAircraftModelList getModelSet() const
Get the model set.
void emitSimulatorCombinedStatus(SimulatorStatus oldStatus=Unspecified)
Emit the combined status.
void logAddingAircraftModel(const swift::misc::simulation::CSimulatedAircraft &aircraft) const
Unified qeeing aircraft message.
swift::misc::simulation::CInterpolationAndRenderingSetupPerCallsign getInterpolationSetupConsolidated(const swift::misc::aviation::CCallsign &callsign, bool forceFullUpdate) const
Consolidate setup with other data like from swift::misc::simulation::IRemoteAircraftProvider.
swift::misc::simulation::settings::CSpecializedSimulatorSettings getSimulatorSettings() const
Settings for current simulator.
swift::misc::simulation::CInterpolationLogger m_interpolationLogger
log.interpolation
void aircraftRenderingChanged(const swift::misc::simulation::CSimulatedAircraft &aircraft)
Aircraft rendering changed.
virtual bool isShuttingDownOrDisconnected() const
Shutting down or disconnected?
virtual void initSimulatorInternals()
Init the internals info from the simulator.
QString getInvalidSituationLogMessage(const swift::misc::aviation::CCallsign &callsign, const swift::misc::simulation::CInterpolationStatus &status, const QString &details={}) const
Info about invalid situation.
void rememberLastSent(const swift::misc::aviation::CAircraftSituation &sent)
Remember as last sent.
Interface to a simulator listener.
const swift::misc::simulation::CSimulatorPluginInfo & getPluginInfo() const
Corresponding info.
void simulatorStarted(const swift::misc::simulation::CSimulatorPluginInfo &info)
Emitted when the listener discovers the simulator running.
virtual bool isShuttingDown() const
Overall (swift) application shutting down.
void start()
Start listening for the simulator to start.
void stop()
Stops listening.
const T & getThreadLocal() const
Read the current value.
T get() const
Get a copy of the current value.
size_type size() const
Returns number of elements in the collection.
void remove(const T &object)
Efficient remove using the find and erase of the implementation container. Typically O(log n).
iterator insert(const_iterator hint, const T &value)
For compatibility with std::inserter.
bool isEmpty() const
Synonym for empty.
iterator push_back(const T &value)
Synonym for insert.
void clear()
Removes all elements in the collection.
const CIdentifier & identifier() const
Get identifier.
Value object encapsulating information identifying a component of a modular distributed swift process...
Class for emitting a log message.
Derived & warning(const char16_t(&format)[N])
Set the severity to warning, providing a format string.
Derived & validationError(const char16_t(&format)[N])
Set the severity to error, providing a format string, and adding the validation category.
Derived & error(const char16_t(&format)[N])
Set the severity to error, providing a format string.
Derived & debug()
Set the severity to debug.
Derived & info(const char16_t(&format)[N])
Set the severity to info, providing a format string.
bool contains(const T &object) const
Return true if there is an element equal to given object. Uses the most efficient implementation avai...
size_type size() const
Returns number of elements in the sequence.
void replaceOrAdd(const T &original, const T &replacement)
Replace elements matching the given element. If there is no match, push the new element on the end.
void push_back(const T &value)
Appends an element at the end of the sequence.
reference front()
Access the first element.
void clear()
Removes all elements in the sequence.
bool isEmpty() const
Synonym for empty.
void pop_front()
Removes an element at the front of the sequence.
Build a QSet more efficiently when calling insert() in a for loop.
void insert(const T &value)
Add an element to the set. Runs in amortized constant time.
Streamable status message, e.g.
QString getMessage() const
Message.
Status messages, e.g. from Core -> GUI.
Value object encapsulating information about aircraft's engines.
Value object encapsulating a list of aircraft engines.
Value object for ICAO classification.
const QString & getDesignator() const
Get ICAO designator, e.g. "B737".
Value object encapsulating information about aircraft's lights.
Value object encapsulating information of aircraft's parts.
bool isNull() const
NULL parts object?
Value object encapsulating information of an aircraft's situation.
void setPressureAltitude(const CAltitude &altitude)
Set pressure altitude.
void setGroundSpeed(const physical_quantities::CSpeed &groundspeed)
Set ground speed.
bool setGroundElevation(const aviation::CAltitude &altitude, GndElevationInfo info, bool transferred=false)
Elevation of the ground directly beneath at the given situation.
void setBank(const physical_quantities::CAngle &bank)
Set bank (angle)
void setHeading(const CHeading &heading)
Set heading.
void setAltitude(const CAltitude &altitude)
Set altitude.
void setPitch(const physical_quantities::CAngle &pitch)
Set pitch.
bool isNull() const
Null situation.
void setVelocity(const CAircraftVelocity &velocity)
Set 6DOF velocity.
void setPosition(const geo::CCoordinateGeodetic &position)
Set position.
const QString & getDesignator() const
Get airline, e.g. "DLH".
Altitude as used in aviation, can be AGL or MSL altitude.
Value object encapsulating information of a callsign.
const QString & asString() const
Get callsign (normalized)
bool isEmpty() const
Is empty?
Value object for a set of callsigns.
QStringList getCallsignStrings(bool sorted=false) const
The callsign strings.
const QString & getCombinedCode() const
Combined code.
swift::misc::physical_quantities::CFrequency getFrequencyStandby() const
Standby frequency.
swift::misc::physical_quantities::CFrequency getFrequencyActive() const
Active frequency.
TransponderMode
Transponder codes.
OBJ findFirstByCallsign(const CCallsign &callsign, const OBJ &ifNotFound={}) const
Find the first aircraft by callsign, if none return given one.
int removeByCallsign(const CCallsign &callsign)
Remove all objects with callsign.
swift::misc::aviation::CCallsignSet getCallsigns() const
All callsigns.
bool containsCallsign(const CCallsign &callsign) const
Contains callsign?
const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS)
CLatitude latitude() const
Latitude.
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height)
CLongitude longitude() const
Longitude.
Plane of same elevation, can be a single point or larger area (e.g. airport)
const aviation::CAltitude & getAltitude() const
Altitude (synonym for geodetic height)
double getAltitudeValue(const physical_quantities::CLengthUnit &unit) const
Altitude (synonym for geodetic height)
Geodetic coordinate, a position in 3D space relative to the reference geoid.
bool hasMSLGeodeticHeight() const
Geodetic height not null and aviation::CAltitude::MeanSeaLevel.
virtual bool isNull() const
Is null, means vector x, y, z == 0.
QString toQString(bool i18n=false) const
Cast as QString.
Value object encapsulating information of a text message.
bool isPrivateMessage() const
Is private message?
const QString & getMessage() const
Get message.
bool isServerMessage() const
Initial message of server?
const aviation::CCallsign & getSenderCallsign() const
Get callsign (from)
bool isSupervisorMessage() const
Supervisor message?
Direct in memory access to client (network client) data.
Physical unit length (length)
Specialized class for distance units (meter, foot, nautical miles).
int valueInteger(MU unit) const
As integer value.
bool isNull() const
Is quantity null?
double value(MU unit) const
Value in given unit.
QString valueRoundedAsString(MU unit, int digits=-1) const
Rounded value in given unit.
PQ abs() const
Absolute value (always >=0)
Aircraft model (used by another pilot, my models on disk)
const aviation::CCallsign & getCallsign() const
Corresponding callsign if applicable.
const aviation::CLivery & getLivery() const
Get livery.
const QString & getModelString() const
Model key, either queried or loaded from simulator model.
void setCallsign(const aviation::CCallsign &callsign)
Corresponding callsign if applicable.
const CDistributor & getDistributor() const
Get distributor.
Value object encapsulating a list of aircraft models.
bool matchesKeyOrAlias(const QString &keyOrAlias) const
Matches key or alias.
InterpolatorMode getInterpolatorMode() const
Interpolator mode.
Value object for interpolator and rendering per callsign.
const CInterpolationStatus & getInterpolationStatus() const
Get status.
const CPartsStatus & getPartsStatus() const
Get status.
bool hasValidSituation() const
Is the corresponding position valid?
bool updateOwnParts(const aviation::CAircraftParts &parts)
Update own parts.
swift::misc::physical_quantities::CLength getDistanceToOwnAircraft(const swift::misc::geo::ICoordinateGeodetic &position) const
Distance to own aircraft.
bool updateCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Update cockpit, but only send signals when applicable.
swift::misc::geo::CCoordinateGeodetic getOwnAircraftPosition() const
Own aircraft's position.
CSimulatedAircraft getOwnAircraft() const
Own aircraft.
bool isSupportingParts() const
Supporting parts.
aviation::CCallsignSet getAircraftInRangeCallsigns() const
Unique callsigns for aircraft in range.
bool isAircraftInRange(const aviation::CCallsign &callsign) const
Is aircraft in range?
CSimulatedAircraftList getAircraftInRange() const
All remote aircraft.
int getAircraftInRangeCount() const
Count remote aircraft.
CSimulatedAircraft getAircraftInRangeForCallsign(const aviation::CCallsign &callsign) const
Aircraft for callsign.
bool updateAircraftRendered(const aviation::CCallsign &callsign, bool rendered)
Set aircraft rendered.
Comprehensive information of an aircraft.
bool hasModelString() const
Has model string?
aviation::CTransponder::TransponderMode getTransponderMode() const
Get transponder mode.
const aviation::CAircraftSituation & getSituation() const
Get situation.
const aviation::CComSystem & getCom2System() const
Get COM2 system.
bool setRendered(bool rendered)
Rendered?
qint32 getTransponderCode() const
Get transponder code.
bool hasCallsign() const
Callsign not empty, no further checks.
const aviation::CCallsign & getCallsign() const
Get callsign.
const aviation::CAircraftIcaoCode & getAircraftIcaoCode() const
Get aircraft ICAO info.
bool hasChangedCockpitData(const aviation::CComSystem &com1, const aviation::CComSystem &com2, const aviation::CTransponder &transponder) const
Changed cockpit data?
const simulation::CAircraftModel & getModel() const
Get model (model used for mapping)
QString getCallsignAsString() const
Get callsign.
const aviation::CComSystem & getCom1System() const
Get COM1 system.
const aviation::CAirlineIcaoCode & getAirlineIcaoCode() const
Airline ICAO code if any.
const aviation::CAircraftParts & getParts() const
Get aircraft parts.
Q_REQUIRED_RESULT CSimulatedAircraftList findByRendered(bool rendered) const
Rendered / not rendered aircraft.
Describing a simulator plugin.
aviation::CCallsignSet getLogCallsigns() const
All callsigns marked to be logged.
Direct threadsafe in memory access to own aircraft.
Direct thread safe in memory access to remote aircraft.
void setSimulatorDetails(const QString &name, const QString &details, const QString &version)
Set version and simulator details from running simulator.
void removePendingElevationRequest(const aviation::CCallsign &cs)
Remove pending timestamp.
void setDefaultModel(const CAircraftModel &defaultModel)
Default model.
const QString & getSimulatorDirectoryOrDefault() const
Simulator directory or default path.
void parseXSwiftBusStringQt(const QString &json)
Load and parse config file.
QString toXSwiftBusJsonStringQt() const
As JSON string.
void setCurrentUtcTime()
Sets both timestamps.
QString getDBusServerAddressQt() const
DBus server.
swift::core::ISimulator * create(const swift::misc::simulation::CSimulatorPluginInfo &info, swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, swift::misc::network::IClientProvider *clientProvider)
Create a new instance of a driver.
int physicallyRemoveAllRemoteAircraft()
Remove all remote aircraft and their data via ISimulator::clearAllRemoteAircraftData.
bool connectTo()
Connect to simulator.
bool followAircraft(const swift::misc::aviation::CCallsign &callsign)
Follow aircraft.
bool isConnected() const
Are we connected to the simulator?
bool requestElevation(const swift::misc::geo::ICoordinateGeodetic &reference, const swift::misc::aviation::CCallsign &callsign)
Request elevation, there is no guarantee the requested elevation will be available in the provider.
CSimulatorXPlane(const swift::misc::simulation::CSimulatorPluginInfo &info, swift::misc::simulation::IOwnAircraftProvider *ownAircraftProvider, swift::misc::simulation::IRemoteAircraftProvider *remoteAircraftProvider, swift::misc::network::IClientProvider *clientProvider, QObject *parent=nullptr)
Constructor.
bool testSendSituationAndParts(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CAircraftSituation &situation, const swift::misc::aviation::CAircraftParts &parts)
Send situation/parts for testing.
void resetAircraftStatistics()
Reset the statistics.
bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context)
void clearAllRemoteAircraftData()
Clear all aircraft related data, but do not physically remove the aircraft.
bool isPhysicallyRenderedAircraft(const swift::misc::aviation::CCallsign &callsign) const
Is the aircraft rendered (displayed in simulator)? This shall only return true if the aircraft is rea...
void unload()
Driver will be unloaded.
bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context)
swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const
Physically rendered (displayed in simulator) This shall only return aircraft handled in the simulator...
swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const
Interpolation messages for callsign.
void setFlightNetworkConnected(bool connected)
Flight network has been connected.
bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft)
Add new remote aircraft physically to the simulator.
bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign)
Remove remote aircraft from simulator.
QString getStatisticsSimulatorSpecific() const
Allows to print out simulator specific statistics.
void callbackReceivedRequestedElevation(const swift::misc::geo::CElevationPlane &plane, const swift::misc::aviation::CCallsign &callsign, bool isWater)
A requested elevation has been received.
void displayStatusMessage(const swift::misc::CStatusMessage &message) const
Display a status message in the simulator.
bool disconnectFrom()
Disconnect from simulator.
void displayTextMessage(const swift::misc::network::CTextMessage &message) const
Display a text message.
CSimulatorXPlaneListener(const swift::misc::simulation::CSimulatorPluginInfo &info)
Constructor.
void checkImpl()
Plugin specific implementation to check.
void startImpl()
Plugin specific implementation to start listener.
void stopImpl()
Plugin specific implementation to stop listener.
Class representing a X-Plane multiplayer aircraft.
const swift::misc::simulation::CSimulatedAircraft & getAircraft() const
Simulated aircraft (as added)
Proxy object connected to a real XSwiftBus::CService object via DBus.
void getOwnAircraftModelDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own model data.
void getOwnAircraftCom2DataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft COM2 data.
void setTransponderMode(int mode)
Set the current transponder mode (depends on the aircraft, 0 and 1 usually mean standby,...
QString getAircraftModelFilename() const
Get base filename of current aircraft model.
int getXPlaneVersionMajor() const
Get major version number.
void setCom2ActiveKhz(int freq)
Set the current COM2 active frequency in kHz.
void getAllWheelsOnGroundAsync(bool *o_allWheels)
Get whether all wheels are on the ground.
QString getAircraftLivery() const
Get current aircraft livery.
void setTransponderCode(int code)
Set the current transponder code in decimal.
void addTextMessage(const QString &text, double red, double green, double blue)
Add a text message to the on-screen display, with RGB components in the range [0,1].
void setCom1StandbyKhz(int freq)
Set the current COM1 standby frequency in kHz.
void getOwnAircraftLightsAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own lights data.
void getOwnAircraftVelocityDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft velocity data.
void setCom1ActiveKhz(int freq)
Set the current COM1 active frequency in kHz.
void getOwnAircraftXpdrAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own XPDR data.
QString getAircraftDescription() const
Get the description of the current aircraft model.
QString getAircraftName() const
Get name of current aircraft model.
QString getSettingsJson() const
Get settings.
bool isValid() const
Does the remote object exist?
void setSettingsJson(const QString &json)
Set settings.
QString getAircraftModelString() const
Get canonical swift model string of current aircraft model.
QString getAircraftIcaoCode() const
Get the ICAO code of the current aircraft model.
QString getAircraftModelPath() const
Get full path to current aircraft model.
void getPressureAltitudeFtAsync(double *o_altitude)
Get aircraft pressure altitude in feet in standard atmosphere in X-Plane 12. NaN in earlier versions ...
void getFrameStats(double *o_averageFps, double *o_simTimeRatio, double *o_trackMilesShort, double *o_minutesLate) const
Frames-per-second, averaged over the last 500 frames, or since this function was last called,...
void getOwnAircraftPartsAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own parts such as gear, flaps.
void getHeightAglMAsync(double *o_height)
Get aircraft height in meters.
void aircraftModelChanged(const QString &path, const QString &filename, const QString &livery, const QString &icao, const QString &modelString, const QString &name, const QString &description)
Own aircraft model changed.
void getOwnAircraftSituationDataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft situation data.
void setCom2StandbyKhz(int freq)
Set the current COM2 standby frequency in kHz.
void resetFrameTotals()
Reset the monitoring of total miles and minutes lost due to low frame rate.
void cancelAllPendingAsyncCalls()
Cancel all current async slot calls.
int getXPlaneVersionMinor() const
Get minor version number.
void getOwnAircraftCom1DataAsync(swift::simplugin::xplane::XPlaneData *o_xplaneData)
Get own aircraft COM1 data.
Proxy object connected to a real XSwiftBus::CTraffic object via DBus.
void cleanup()
Reverse the actions of initialize().
void addPlane(const QString &callsign, const QString &modelName, const QString &aircraftIcao, const QString &airlineIcao, const QString &livery)
Introduce a new traffic aircraft.
void remoteAircraftAddingFailed(const QString &callsign)
Remote aircraft adding failed.
void setPlanesPositions(const swift::simplugin::xplane::PlanesPositions &planesPositions)
Set the position of multiple traffic aircrafts.
void removeAllPlanes()
Remove all traffic aircraft.
void setFollowedAircraft(const QString &callsign)
Sets the aircraft with callsign to be followed in plane view.
void simFrame()
Simulator frame.
void setPlanesSurfaces(const swift::simplugin::xplane::PlanesSurfaces &planesSurfaces)
Set the flight control surfaces and lights of multiple traffic aircrafts.
QString loadPlanesPackage(const QString &path)
Load a collection of planes from the given directory and return error message if unsuccessful.
void setPlanesTransponders(const swift::simplugin::xplane::PlanesTransponders &planesTransponders)
Set the transponder of multiple traffic aircraft.
void removePlane(const QString &callsign)
Remove a traffic aircraft.
bool isValid() const
Does the remote object exist?
void remoteAircraftAdded(const QString &callsign)
Remote aircraft successfully added.
void getRemoteAircraftData(const QStringList &callsigns, const RemoteAircraftDataCallback &setter) const
Get remote aircrafts data (lat, lon, elevation and CG)
Backend services of the swift project, like dealing with the network or the simulators.
Free functions in swift::misc.
float blueF() const const
float greenF() const const
qint64 currentMSecsSinceEpoch()
bool connect(const QString &service, const QString &path, const QString &interface, const QString &name, QObject *receiver, const char *slot)
QDBusConnection connectToPeer(const QString &address, const QString &name)
void disconnectFromBus(const QString &name)
void disconnectFromPeer(const QString &name)
bool isConnected() const const
QString name() const const
QDBusConnection sessionBus()
void addWatchedService(const QString &newService)
void serviceUnregistered(const QString &serviceName)
void setConnection(const QDBusConnection &connection)
void setWatchMode(QDBusServiceWatcher::WatchMode mode)
bool exists() const const
QString path() const const
qint64 elapsed() const const
bool exists() const const
bool contains(const Key &key) const const
QHash< Key, T >::iterator insert(const Key &key, const T &value)
bool isEmpty() const const
QList< Key > keys() const const
bool remove(const Key &key)
qsizetype size() const const
T value(const Key &key) const const
QList< T > values() const const
QList< T >::const_reference at(qsizetype i) const const
QList< T >::iterator begin()
QList< T >::const_iterator constBegin() const const
QList< T >::const_iterator constEnd() const const
QList< T >::iterator end()
QList< T >::iterator insert(QList< T >::const_iterator before, QList< T >::parameter_type value)
bool isEmpty() const const
qsizetype size() const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
QObject * parent() const const
void setObjectName(QAnyStringView name)
QString arg(Args &&... args) const const
bool isEmpty() const const
bool startsWith(QChar c, Qt::CaseSensitivity cs) const const
QString toLower() const const
QString trimmed() const const
QStringView left(qsizetype length) const const
void setInterval(int msec)
bool isActive() const const
void push_back(const swift::misc::aviation::CAircraftSituation &situation)
Push back the latest situation.
void push_back(const swift::misc::aviation::CCallsign &callsign, const swift::misc::aviation::CAircraftParts &parts)
Push back the latest parts.
double rollDeg
Roll [deg].
int com2StandbyKhz
COM2 standby [kHz].
double headingRadPerSec
Heading angular velocity [rad/s].
double groundspeedMs
Ground speed [m/s].
bool isCom1Receiving
COM1 receiving.
double com2Volume
COM2 volume 0..1.
double com1Volume
COM1 volume 0..1.
double longitudeDeg
Latitude [deg].
double localXVelocityMs
Local x velocity [m/s].
int xpdrMode
Transponder mode (off=0,stdby=1,on=2,test=3)
int com1ActiveKhz
COM1 active [kHz].
bool beaconLightsOn
Beacon lights on?
bool isCom1Transmitting
COM1 transmittings.
double flapsDeployRatio
Flaps deployment ratio [%].
double localZVelocityMs
Local z velocity [m/s].
bool taxiLightsOn
Taxi lights on?
bool isCom2Transmitting
COM2 transmittings.
bool strobeLightsOn
Strobe lights on?
double rollRadPerSec
Roll angular velocity [rad/s].
int xpdrCode
Transpondder code.
double gearDeployRatio
Gear deployment ratio [%].
double trueHeadingDeg
True heading [deg].
bool xpdrIdent
Is transponder in ident?
int com2ActiveKhz
COM2 active [kHz].
double altitudeM
Altitude [m].
bool onGroundAll
All wheels on ground?
double latitudeDeg
Longitude [deg].
bool isCom2Receiving
COM2 receiving.
double heightAglM
Height AGL [m].
bool navLightsOn
NAV lights on?
double pitchRadPerSec
Pitch angular velocity [rad/s].
QList< double > enginesN1Percentage
N1 per engine [%].
double pitchDeg
Pitch [deg].
double speedBrakeRatio
Speed break ratio [%].
double seaLevelPressureInHg
Sea level pressure [inhg].
int com1StandbyKhz
COM1 standby [kHz].
double pressureAltitudeFt
Pressure altitude [ft, XP12].
bool landingLightsOn
Landing lights on?
double localYVelocityMs
Local y velocity [m/s].
#define SWIFT_VERIFY_X(COND, WHERE, WHAT)
A weaker kind of assert.