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);
219 CSimulatorPluginCommon::setFlightNetworkConnected(connected);
225 CSimulatorPluginCommon::setOwnCallsign(callsign);
228 bool CSimulatorXPlane::isSuspiciousTerrainValue(
const CElevationPlane &elevation)
232 return valueFt < 1.0;
235 const CLength &CSimulatorXPlane::maxTerrainRequestDistance()
237 static const CLength d(70.0, CLengthUnit::NM());
243 m_aircraftAddedFailed.
clear();
244 CSimulatorPluginCommon::clearAllRemoteAircraftData();
245 m_minSuspicousTerrainProbe.
setNull();
251 if (reference.
isNull()) {
return false; }
254 if (callsign.
isEmpty()) {
return false; }
258 if (!d.
isNull() && d > maxTerrainRequestDistance())
272 static const CAltitude alt(0, CAltitude::MeanSeaLevel, CLengthUnit::ft());
276 using namespace std::placeholders;
277 auto callback = [
this](
auto &&plane,
auto &&callsign,
auto &&isWater) {
279 std::forward<decltype(callsign)>(callsign),
280 std::forward<decltype(isWater)>(isWater));
284 m_trafficProxy->getElevationAtPosition(callsign, pos.
latitude().
value(CAngleUnit::deg()),
294 if (ident) {
return CTransponder::StateIdent; }
295 if (xplaneMode == 0 || xplaneMode == 1) {
return CTransponder::StateStandby; }
296 return CTransponder::ModeC;
302 void CSimulatorXPlane::fastTimerTimeout()
319 const CAltitude altitude { m_xplaneData.
altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() };
321 const CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure));
324 m_altitudeDelta = {};
331 CAltitude::PressureAltitude, CLengthUnit::ft());
332 m_altitudeDelta = pressureAltitude - pressureAltitudeXP12;
334 situation.
setAltitude({ altitude - m_altitudeDelta, CAltitude::MeanSeaLevel });
363 const int v1 = qRound(m_xplaneData.
com1Volume * 100);
364 com1.setVolumeReceive(v1);
367 const bool changedCom1 = myAircraft.getCom1System() != com1;
371 const int v2 = qRound(m_xplaneData.
com2Volume * 100);
372 com2.setVolumeReceive(v2);
375 const bool changedCom2 = myAircraft.getCom2System() != com2;
377 transponder = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
379 const bool changedXpr = (myAircraft.getTransponder() != transponder);
381 if (changedCom1 || changedCom2 || changedXpr)
388 void CSimulatorXPlane::slowTimerTimeout()
423 for (CXPlaneMPAircraft &xplaneAircraft : m_xplaneAircraftObjects)
426 const CCallsign cs = xplaneAircraft.getCallsign();
434 xplaneAircraft.setSimulatedAircraft(simulatedAircraft);
440 for (
const CCallsign &cs : invalid) { this->triggerRemoveAircraft(cs, ++i * 100); }
444 if ((m_slowTimerCalls % 3u) == 0u) { this->requestRemoteAircraftDataFromXPlane(); }
448 if ((m_slowTimerCalls % 5u) == 0u)
450 constexpr
double warningMiles = 1;
451 constexpr
double disconnectMiles = 2;
456 if (previousMiles < disconnectMiles && m_trackMilesShort >= disconnectMiles)
460 else if (previousMiles < warningMiles && m_trackMilesShort >= warningMiles)
473 const QString dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
475 if (CDBusServer::isSessionOrSystemAddress(dBusServerAddress))
478 m_dbusMode = Session;
480 else if (CDBusServer::isQtDBusAddress(dBusServerAddress))
483 if (!m_dBusConnection.
isConnected()) {
return false; }
491 bool s = m_dBusConnection.
connect(
QString(), DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL,
"Disconnected",
this,
492 SLOT(onDBusServiceUnregistered()));
504 QString xplaneVersion = QStringLiteral(
"%1.%2")
509 &CSimulatorXPlane::emitOwnAircraftModelChanged);
512 &CSimulatorXPlane::onRemoteAircraftAdded);
514 &CSimulatorXPlane::onRemoteAircraftAddingFailed);
515 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
519 this->sendXSwiftBusSettings();
522 this->loadCslPackages();
534 this->disconnectFromDBus();
535 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
536 delete m_serviceProxy;
537 delete m_trafficProxy;
538 m_serviceProxy =
nullptr;
539 m_trafficProxy =
nullptr;
540 m_fastTimerCalls = 0;
541 m_slowTimerCalls = 0;
547 void CSimulatorXPlane::onDBusServiceUnregistered()
549 if (!m_serviceProxy) {
return; }
554 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
555 delete m_serviceProxy;
556 delete m_trafficProxy;
557 m_serviceProxy =
nullptr;
558 m_trafficProxy =
nullptr;
562 void CSimulatorXPlane::emitOwnAircraftModelChanged(
const QString &path,
const QString &filename,
567 CAircraftModel model(modelString, CAircraftModel::TypeOwnSimulatorModel, CSimulatorInfo::XPLANE, name,
569 if (!livery.
isEmpty()) { model.setModelString(model.getModelString() +
" " + livery); }
570 model.setFileName(path +
"/" + filename);
581 static bool isInFunction =
false;
582 if (isInFunction) {
return; }
585 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
586 QColor color = msgBoxValues[9];
596 isInFunction =
false;
604 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
609 else { color = msgBoxValues[6]; }
617 return m_xplaneAircraftObjects.contains(callsign);
623 if (originator == this->
identifier()) {
return false; }
626 auto com1 = CComSystem::getCom1System({ m_xplaneData.
com1ActiveKhz, CFrequencyUnit::kHz() },
628 auto com2 = CComSystem::getCom2System({ m_xplaneData.
com2ActiveKhz, CFrequencyUnit::kHz() },
630 auto xpdr = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
660 if (originator == this->
identifier()) {
return false; }
668 void CSimulatorXPlane::loadCslPackages()
675 Prefix(
const QString &p) : s(p +
'/') {}
686 struct PrefixComparator
688 bool operator()(
const Prefix &a,
const QString &b)
const
692 bool operator()(
const QString &a,
const Prefix &b)
const
705 for (
const auto &model : models)
707 const QString &modelFile = model.getFileName();
711 auto it = std::lower_bound(packages.
begin(), packages.
end(), modelFile, PrefixComparator());
712 if (it != packages.
end() && it->isPrefixOf(modelFile)) {
continue; }
715 QString package = findCslPackage(modelFile);
716 if (package.isEmpty()) {
continue; }
717 packages.
insert(it, package);
723 for (
const Prefix &package : std::as_const(packages)) { superpackages.
insert(package.parent()); }
727 for (
const QString &package : superpackagesList)
729 if (CDirectoryUtils::isSameOrSubDirectoryOf(package, simDir))
740 u
"CSL package '%1' can not be loaded as it is outside the X-Plane installation directory")
746 QString CSimulatorXPlane::findCslPackage(
const QString &modelFile)
750 QDir dir = info.isDir() ?
QDir(modelFile) : info.dir();
752 if (dir.
exists(QStringLiteral(
"xsb_aircraft.txt"))) {
return dir.
path(); }
765 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
766 Q_ASSERT_X(!newRemoteAircraft.
getCallsign().
isEmpty(), Q_FUNC_INFO,
"empty callsign");
767 Q_ASSERT_X(newRemoteAircraft.
hasModelString(), Q_FUNC_INFO,
"missing model string");
779 if (this->canAddAircraft())
791 CLogMessage(
this).
warning(u
"Model for '%1' has no callsign, maybe using a default model") << callsign;
812 m_pendingToBeAddedAircraft.
replaceOrAdd(newRemoteAircraft);
823 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"wrong thread");
824 if (callsign.
isEmpty()) {
return false; }
827 if (!this->
isTestMode() && !m_xplaneAircraftObjects.contains(callsign) &&
838 if (m_xplaneAircraftObjects.contains(callsign))
854 if (m_addingInProgressAircraft.
contains(callsign))
859 if (!myself) {
return; }
860 m_addingInProgressAircraft.
remove(callsign);
867 m_xplaneAircraftObjects.remove(callsign);
871 return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
877 m_pendingToBeAddedAircraft.
clear();
878 m_addingInProgressAircraft.
clear();
879 return CSimulatorPluginCommon::physicallyRemoveAllRemoteAircraft();
890 if (!m_trafficProxy || !m_trafficProxy->
isValid()) {
return false; }
895 void CSimulatorXPlane::updateRemoteAircraft()
897 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
900 if (remoteAircraftNo < 1) {
return; }
907 PlanesPositions planesPositions;
908 PlanesSurfaces planesSurfaces;
909 PlanesTransponders planesTransponders;
911 uint32_t aircraftNumber = 0;
914 for (
const CXPlaneMPAircraft &xplaneAircraft : std::as_const(m_xplaneAircraftObjects))
916 const CCallsign callsign(xplaneAircraft.getCallsign());
917 const bool hasCallsign = !callsign.
isEmpty();
926 if (!callsignsInRange.
contains(callsign)) {
continue; }
928 planesTransponders.callsigns.push_back(callsign.
asString());
929 planesTransponders.codes.push_back(xplaneAircraft.getAircraft().getTransponderCode());
931 planesTransponders.idents.push_back(transponderMode == CTransponder::StateIdent);
932 planesTransponders.modeCs.push_back(transponderMode == CTransponder::ModeC);
940 xplaneAircraft.getInterpolation(currentTimestamp, setup, aircraftNumber++);
946 const CLength relativeAltitude =
948 const double altitudeDeltaWeight =
949 2 - qBound(3000.0, relativeAltitude.
abs().
value(CLengthUnit::ft()), 6000.0) / 3000;
950 const CLength alt = interpolatedSituation.getAltitude() +
951 m_altitudeDelta * altitudeDeltaWeight *
952 (1 - interpolatedSituation.getOnGroundInfo().getGroundFactor());
953 interpolatedSituation.setAltitude({ alt, interpolatedSituation.getAltitude().getReferenceDatum() });
956 if (updateAllAircraft || !this->
isEqualLastSent(interpolatedSituation))
959 planesPositions.push_back(interpolatedSituation);
974 planesSurfaces.push_back(xplaneAircraft.getCallsign(), parts);
982 if (!planesPositions.isEmpty())
984 if (CBuildConfig::isLocalDeveloperDebugBuild())
986 SWIFT_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO,
"Mismatching sizes");
991 if (!planesSurfaces.isEmpty()) { m_trafficProxy->
setPlanesSurfaces(planesSurfaces); }
997 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane()
1005 CCallsignSet callsigns = m_xplaneAircraftObjects.getAllCallsigns();
1007 callsigns.
remove(remove);
1008 if (!callsigns.
isEmpty()) { this->requestRemoteAircraftDataFromXPlane(callsigns); }
1011 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1013 if (callsigns.
isEmpty()) {
return; }
1018 csStrings, [=](
const QStringList &callsigns,
const QDoubleList &latitudesDeg,
1019 const QDoubleList &longitudesDeg,
const QDoubleList &elevationsMeters,
1020 const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters) {
1021 if (!myself) {
return; }
1022 this->updateRemoteAircraftFromSimulator(callsigns, latitudesDeg, longitudesDeg, elevationsMeters,
1023 waterFlags, verticalOffsetsMeters);
1027 void CSimulatorXPlane::triggerRequestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1029 if (callsigns.
isEmpty()) {
return; }
1032 if (!myself) {
return; }
1033 this->requestRemoteAircraftDataFromXPlane(callsigns);
1037 void CSimulatorXPlane::updateRemoteAircraftFromSimulator(
1038 const QStringList &callsigns,
const QDoubleList &latitudesDeg,
const QDoubleList &longitudesDeg,
1039 const QDoubleList &elevationsMeters,
const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters)
1041 const int size = callsigns.
size();
1044 if (CBuildConfig::isLocalDeveloperDebugBuild())
1046 Q_ASSERT_X(elevationsMeters.size() == size, Q_FUNC_INFO,
"Wrong elevations");
1047 Q_ASSERT_X(waterFlags.size() == size, Q_FUNC_INFO,
"Wrong waterFlags");
1048 Q_ASSERT_X(latitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong latitudesDeg");
1049 Q_ASSERT_X(longitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong longitudesDeg");
1050 Q_ASSERT_X(verticalOffsetsMeters.size() == size, Q_FUNC_INFO,
"Wrong CG");
1054 static const QString hint(
"remote acft.");
1055 for (
int i = 0; i < size; i++)
1057 const bool emptyCs = callsigns[i].
isEmpty();
1059 if (emptyCs) {
continue; }
1062 if (!m_xplaneAircraftObjects.contains(cs)) {
continue; }
1063 const CXPlaneMPAircraft xpAircraft = m_xplaneAircraftObjects[cs];
1064 SWIFT_VERIFY_X(xpAircraft.hasCallsign(), Q_FUNC_INFO,
"Need callsign");
1065 if (!xpAircraft.hasCallsign()) {
continue; }
1068 if (!std::isnan(elevationsMeters[i]))
1070 const CAltitude elevationAlt =
CAltitude(elevationsMeters[i], CLengthUnit::m(), CLengthUnit::ft());
1072 CLongitude(longitudesDeg[i], CAngleUnit::deg()), elevationAlt,
1073 CElevationPlane::singlePointRadius());
1076 const double cgValue = verticalOffsetsMeters[i];
1078 cg = fixSimulatorCg(cg, xpAircraft.getAircraftModel());
1082 const bool waterFlag = waterFlags[i];
1083 const bool useElevation = this->handleProbeValue(elevation, cs, waterFlag, hint,
true);
1085 useElevation ? elevation : CElevationPlane::null(), cg);
1099 return { 0.0, CLengthUnit::ft() };
1104 void CSimulatorXPlane::disconnectFromDBus()
1108 if (m_trafficProxy) { m_trafficProxy->
cleanup(); }
1116 bool CSimulatorXPlane::sendXSwiftBusSettings()
1119 if (!m_serviceProxy) {
return false; }
1133 if (!m_serviceProxy) {
return s; }
1141 void CSimulatorXPlane::onXSwiftBusSettingsChanged()
1152 this->sendXSwiftBusSettings();
1157 void CSimulatorXPlane::setMinTerrainProbeDistance(
const CLength &distance)
1159 if (distance.
isNull()) {
return; }
1160 if (m_minSuspicousTerrainProbe.
isNull() || distance < m_minSuspicousTerrainProbe)
1162 m_minSuspicousTerrainProbe = distance;
1166 void CSimulatorXPlane::onRemoteAircraftAdded(
const QString &callsign)
1169 if (callsign.
isEmpty()) {
return; }
1174 bool wasPending =
false;
1175 if (m_addingInProgressAircraft.
contains(cs))
1178 const qint64 wasStartedMs = m_addingInProgressAircraft.
value(cs);
1180 m_statsAddCurrentTimeMs = deltaTimeMs;
1181 m_statsAddMaxTimeMs = std::max(deltaTimeMs, m_statsAddMaxTimeMs);
1182 m_addingInProgressAircraft.
remove(cs);
1187 CLogMessage(
this).
warning(u
"Aircraft '%1' no longer in range, will be removed") << callsign;
1188 this->triggerRemoveAircraft(cs, TimeoutAdding);
1197 CLogMessage(
this).
warning(u
"Added callsign '%1' was not in progress anymore. Timeout?") << callsign;
1200 const bool rendered =
true;
1203 this->triggerRequestRemoteAircraftDataFromXPlane(cs);
1204 this->triggerAddNextPendingAircraft();
1206 Q_ASSERT_X(addedRemoteAircraft.
hasCallsign(), Q_FUNC_INFO,
1208 Q_ASSERT_X(addedRemoteAircraft.
getCallsign() == cs, Q_FUNC_INFO,
1210 m_xplaneAircraftObjects.insert(cs, CXPlaneMPAircraft(addedRemoteAircraft,
this, &
m_interpolationLogger));
1214 void CSimulatorXPlane::onRemoteAircraftAddingFailed(
const QString &callsign)
1217 if (callsign.
isEmpty()) {
return; }
1228 CLogMessage(
this).
warning(u
"Adding '%1' failed, but aircraft no longer in range, will be removed")
1232 const bool wasPending = (
static_cast<int>(m_addingInProgressAircraft.
remove(cs)) > 0);
1233 Q_UNUSED(wasPending)
1237 m_aircraftAddedFailed.
push_back(failedRemoteAircraft);
1238 m_pendingToBeAddedAircraft.
replaceOrAdd(failedRemoteAircraft);
1240 this->triggerAddNextPendingAircraft();
1243 void CSimulatorXPlane::addNextPendingAircraft()
1245 if (m_pendingToBeAddedAircraft.
isEmpty()) {
return; }
1248 this->detectTimeoutAdding();
1251 if (!this->canAddAircraft()) {
return; }
1256 CLogMessage(
this).
info(u
"Adding next pending aircraft '%1', pending %2, in progress %3")
1258 << m_addingInProgressAircraft.
size();
1262 void CSimulatorXPlane::triggerAddNextPendingAircraft()
1267 this->addNextPendingAircraft();
1271 int CSimulatorXPlane::detectTimeoutAdding()
1273 if (m_addingInProgressAircraft.
isEmpty()) {
return 0; }
1277 for (
const CCallsign &cs : addingCallsigns)
1279 if (m_addingInProgressAircraft.
value(cs) < timeout) {
continue; }
1283 for (
const CCallsign &cs : std::as_const(timeoutCallsigns))
1285 m_addingInProgressAircraft.
remove(cs);
1289 return timeoutCallsigns.
size();
1292 void CSimulatorXPlane::triggerRemoveAircraft(
const CCallsign &callsign, qint64 deferMs)
1296 if (!myself) {
return; }
1301 QPair<qint64, qint64> CSimulatorXPlane::minMaxTimestampsAddInProgress()
const
1303 static const QPair<qint64, qint64> empty(-1, -1);
1304 if (m_addingInProgressAircraft.
isEmpty()) {
return empty; }
1307 return { *mm.first, *mm.second };
1310 bool CSimulatorXPlane::canAddAircraft()
const
1312 if (m_addingInProgressAircraft.
isEmpty()) {
return true; }
1316 const QPair<qint64, qint64> tsMM = this->minMaxTimestampsAddInProgress();
1317 const qint64 deltaLatest = now - tsMM.second;
1318 const bool canAdd = (deltaLatest > TimeoutAdding);
1327 return new CSimulatorXPlane(info, ownAircraftProvider, remoteAircraftProvider, clientProvider,
this);
1332 constexpr
int QueryInterval = 5 * 1000;
1344 if (!m_timer.
isActive()) {
return; }
1350 if (!myself) {
return; }
1355 void CSimulatorXPlaneListener::checkConnection()
1358 Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO,
"Expect to run in background");
1363 m_dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
1364 if (CDBusServer::isSessionOrSystemAddress(m_dBusServerAddress))
1366 checkConnectionViaSessionBus();
1369 else if (CDBusServer::isQtDBusAddress(m_dBusServerAddress))
1371 checkConnectionViaPeer(m_dBusServerAddress);
1378 void CSimulatorXPlaneListener::checkConnectionViaSessionBus()
1386 checkConnectionCommon();
1390 void CSimulatorXPlaneListener::checkConnectionViaPeer(
const QString &address)
1399 checkConnectionCommon();
1403 void CSimulatorXPlaneListener::checkConnectionCommon()
1405 CXSwiftBusServiceProxy service(m_DBusConnection);
1406 CXSwiftBusTrafficProxy traffic(m_DBusConnection);
1408 const bool result = service.isValid() && traffic.isValid();
1409 if (!result) {
return; }
1411 const QString swiftVersion = CBuildConfig::getVersionString();
1412 const QString xswiftbusVersion = service.getVersionNumber();
1413 const QString xswiftbusCommitHash = service.getCommitHash();
1414 if (xswiftbusVersion.
isEmpty())
1416 CLogMessage(
this).
warning(u
"Could not determine which version of xswiftbus is running. Mismatched versions "
1417 u
"might cause instability.");
1419 else if (commitHash() != xswiftbusCommitHash)
1421 CLogMessage(
this).
error(u
"You are using an incorrect version of xswiftbus. The version of xswiftbus (%1) "
1422 u
"should match the version of swift (%2). Consider upgrading!")
1423 << xswiftbusVersion << swiftVersion;
1426 if (!traffic.initialize())
1429 u
"Connection to xswiftbus successful, but could not initialize xswiftbus. Check X-Plane Log.txt.");
1433 const MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
1434 if (!info.hasAcquired)
1437 info.owner.
trimmed().
isEmpty() ? QStringLiteral(
"unknown plugin") : info.owner.trimmed();
1439 u
"Connection to xswiftbus successful, but could not acquire multiplayer planes. '%1' has acquired them "
1440 u
"already. Disable '%2' or remove it if not required and reload xswiftbus.")
1448 void CSimulatorXPlaneListener::serviceRegistered(
const QString &serviceName)
1454 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 setOwnCallsign(const swift::misc::aviation::CCallsign &callsign)
Own callsign has changed.
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.
void setOwnCallsign(const QString &callsign)
Set the current own callsign.
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.
void setFlightNetworkConnected(bool connected)
Set the current connection state.
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.