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;
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;
273 m_trafficProxy->getElevationAtPosition(callsign, pos.
latitude().
value(CAngleUnit::deg()),
283 if (ident) {
return CTransponder::StateIdent; }
284 if (xplaneMode == 0 || xplaneMode == 1) {
return CTransponder::StateStandby; }
285 return CTransponder::ModeC;
291 void CSimulatorXPlane::fastTimerTimeout()
308 const CAltitude altitude { m_xplaneData.
altitudeM, CAltitude::MeanSeaLevel, CLengthUnit::m() };
310 const CAltitude pressureAltitude(altitude.toPressureAltitude(seaLevelPressure));
313 m_altitudeDelta = {};
320 CAltitude::PressureAltitude, CLengthUnit::ft());
321 m_altitudeDelta = pressureAltitude - pressureAltitudeXP12;
323 situation.
setAltitude({ altitude - m_altitudeDelta, CAltitude::MeanSeaLevel });
352 const int v1 = qRound(m_xplaneData.
com1Volume * 100);
353 com1.setVolumeReceive(v1);
356 const bool changedCom1 = myAircraft.getCom1System() != com1;
360 const int v2 = qRound(m_xplaneData.
com2Volume * 100);
361 com2.setVolumeReceive(v2);
364 const bool changedCom2 = myAircraft.getCom2System() != com2;
366 transponder = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
368 const bool changedXpr = (myAircraft.getTransponder() != transponder);
370 if (changedCom1 || changedCom2 || changedXpr)
377 void CSimulatorXPlane::slowTimerTimeout()
412 for (CXPlaneMPAircraft &xplaneAircraft : m_xplaneAircraftObjects)
415 const CCallsign cs = xplaneAircraft.getCallsign();
423 xplaneAircraft.setSimulatedAircraft(simulatedAircraft);
429 for (
const CCallsign &cs : invalid) { this->triggerRemoveAircraft(cs, ++i * 100); }
433 if ((m_slowTimerCalls % 3u) == 0u) { this->requestRemoteAircraftDataFromXPlane(); }
437 if ((m_slowTimerCalls % 5u) == 0u)
439 constexpr
double warningMiles = 1;
440 constexpr
double disconnectMiles = 2;
445 if (previousMiles < disconnectMiles && m_trackMilesShort >= disconnectMiles)
449 else if (previousMiles < warningMiles && m_trackMilesShort >= warningMiles)
462 const QString dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
464 if (CDBusServer::isSessionOrSystemAddress(dBusServerAddress))
467 m_dbusMode = Session;
469 else if (CDBusServer::isQtDBusAddress(dBusServerAddress))
472 if (!m_dBusConnection.
isConnected()) {
return false; }
480 bool s = m_dBusConnection.
connect(
QString(), DBUS_PATH_LOCAL, DBUS_INTERFACE_LOCAL,
"Disconnected",
this,
481 SLOT(onDBusServiceUnregistered()));
493 QString xplaneVersion = QStringLiteral(
"%1.%2")
498 &CSimulatorXPlane::emitOwnAircraftModelChanged);
501 &CSimulatorXPlane::onRemoteAircraftAdded);
503 &CSimulatorXPlane::onRemoteAircraftAddingFailed);
504 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
508 this->sendXSwiftBusSettings();
511 this->loadCslPackages();
523 this->disconnectFromDBus();
524 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
525 delete m_serviceProxy;
526 delete m_trafficProxy;
527 m_serviceProxy =
nullptr;
528 m_trafficProxy =
nullptr;
529 m_fastTimerCalls = 0;
530 m_slowTimerCalls = 0;
536 void CSimulatorXPlane::onDBusServiceUnregistered()
538 if (!m_serviceProxy) {
return; }
543 if (m_watcher) { m_watcher->
setConnection(m_dBusConnection); }
544 delete m_serviceProxy;
545 delete m_trafficProxy;
546 m_serviceProxy =
nullptr;
547 m_trafficProxy =
nullptr;
551 void CSimulatorXPlane::emitOwnAircraftModelChanged(
const QString &path,
const QString &filename,
556 CAircraftModel model(modelString, CAircraftModel::TypeOwnSimulatorModel, CSimulatorInfo::XPLANE, name,
558 if (!livery.
isEmpty()) { model.setModelString(model.getModelString() +
" " + livery); }
559 model.setFileName(path +
"/" + filename);
570 static bool isInFunction =
false;
571 if (isInFunction) {
return; }
574 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
575 QColor color = msgBoxValues[9];
585 isInFunction =
false;
593 std::vector<int> msgBoxValues = m_xSwiftBusServerSettings.
getThreadLocal().getMessageBoxValuesVector();
598 else { color = msgBoxValues[6]; }
606 return m_xplaneAircraftObjects.contains(callsign);
612 if (originator == this->
identifier()) {
return false; }
615 auto com1 = CComSystem::getCom1System({ m_xplaneData.
com1ActiveKhz, CFrequencyUnit::kHz() },
617 auto com2 = CComSystem::getCom2System({ m_xplaneData.
com2ActiveKhz, CFrequencyUnit::kHz() },
619 auto xpdr = CTransponder::getStandardTransponder(m_xplaneData.
xpdrCode,
649 if (originator == this->
identifier()) {
return false; }
657 void CSimulatorXPlane::loadCslPackages()
664 Prefix(
const QString &p) : s(p +
'/') {}
675 struct PrefixComparator
677 bool operator()(
const Prefix &a,
const QString &b)
const
681 bool operator()(
const QString &a,
const Prefix &b)
const
694 for (
const auto &model : models)
696 const QString &modelFile = model.getFileName();
700 auto it = std::lower_bound(packages.
begin(), packages.
end(), modelFile, PrefixComparator());
701 if (it != packages.
end() && it->isPrefixOf(modelFile)) {
continue; }
704 QString package = findCslPackage(modelFile);
705 if (package.isEmpty()) {
continue; }
706 packages.
insert(it, package);
712 for (
const Prefix &package : std::as_const(packages)) { superpackages.
insert(package.parent()); }
716 for (
const QString &package : superpackagesList)
718 if (CDirectoryUtils::isSameOrSubDirectoryOf(package, simDir))
729 u
"CSL package '%1' can not be loaded as it is outside the X-Plane installation directory")
735 QString CSimulatorXPlane::findCslPackage(
const QString &modelFile)
739 QDir dir = info.isDir() ?
QDir(modelFile) : info.dir();
741 if (dir.
exists(QStringLiteral(
"xsb_aircraft.txt"))) {
return dir.
path(); }
754 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
755 Q_ASSERT_X(!newRemoteAircraft.
getCallsign().
isEmpty(), Q_FUNC_INFO,
"empty callsign");
756 Q_ASSERT_X(newRemoteAircraft.
hasModelString(), Q_FUNC_INFO,
"missing model string");
768 if (this->canAddAircraft())
780 CLogMessage(
this).
warning(u
"Model for '%1' has no callsign, maybe using a default model") << callsign;
801 m_pendingToBeAddedAircraft.
replaceOrAdd(newRemoteAircraft);
812 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"wrong thread");
813 if (callsign.
isEmpty()) {
return false; }
816 if (!this->
isTestMode() && !m_xplaneAircraftObjects.contains(callsign) &&
827 if (m_xplaneAircraftObjects.contains(callsign))
843 if (m_addingInProgressAircraft.
contains(callsign))
848 if (!myself) {
return; }
849 m_addingInProgressAircraft.
remove(callsign);
856 m_xplaneAircraftObjects.remove(callsign);
860 return CSimulatorPluginCommon::physicallyRemoveRemoteAircraft(callsign);
866 m_pendingToBeAddedAircraft.
clear();
867 m_addingInProgressAircraft.
clear();
868 return CSimulatorPluginCommon::physicallyRemoveAllRemoteAircraft();
879 if (!m_trafficProxy || !m_trafficProxy->
isValid()) {
return false; }
884 void CSimulatorXPlane::updateRemoteAircraft()
886 Q_ASSERT_X(CThreadUtils::isInThisThread(
this), Q_FUNC_INFO,
"thread");
889 if (remoteAircraftNo < 1) {
return; }
896 PlanesPositions planesPositions;
897 PlanesSurfaces planesSurfaces;
898 PlanesTransponders planesTransponders;
900 uint32_t aircraftNumber = 0;
903 for (
const CXPlaneMPAircraft &xplaneAircraft : std::as_const(m_xplaneAircraftObjects))
905 const CCallsign callsign(xplaneAircraft.getCallsign());
906 const bool hasCallsign = !callsign.
isEmpty();
915 if (!callsignsInRange.
contains(callsign)) {
continue; }
917 planesTransponders.callsigns.push_back(callsign.
asString());
918 planesTransponders.codes.push_back(xplaneAircraft.getAircraft().getTransponderCode());
920 planesTransponders.idents.push_back(transponderMode == CTransponder::StateIdent);
921 planesTransponders.modeCs.push_back(transponderMode == CTransponder::ModeC);
929 xplaneAircraft.getInterpolation(currentTimestamp, setup, aircraftNumber++);
935 const CLength relativeAltitude =
937 const double altitudeDeltaWeight =
938 2 - qBound(3000.0, relativeAltitude.
abs().
value(CLengthUnit::ft()), 6000.0) / 3000;
939 const CLength alt = interpolatedSituation.getAltitude() +
940 m_altitudeDelta * altitudeDeltaWeight *
941 (1 - interpolatedSituation.getOnGroundInfo().getGroundFactor());
942 interpolatedSituation.setAltitude({ alt, interpolatedSituation.getAltitude().getReferenceDatum() });
945 if (updateAllAircraft || !this->
isEqualLastSent(interpolatedSituation))
948 planesPositions.push_back(interpolatedSituation);
963 planesSurfaces.push_back(xplaneAircraft.getCallsign(), parts);
971 if (!planesPositions.isEmpty())
973 if (CBuildConfig::isLocalDeveloperDebugBuild())
975 SWIFT_VERIFY_X(planesPositions.hasSameSizes(), Q_FUNC_INFO,
"Mismatching sizes");
980 if (!planesSurfaces.isEmpty()) { m_trafficProxy->
setPlanesSurfaces(planesSurfaces); }
986 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane()
994 CCallsignSet callsigns = m_xplaneAircraftObjects.getAllCallsigns();
997 if (!callsigns.
isEmpty()) { this->requestRemoteAircraftDataFromXPlane(callsigns); }
1000 void CSimulatorXPlane::requestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1002 if (callsigns.
isEmpty()) {
return; }
1007 csStrings, [=](
const QStringList &callsigns,
const QDoubleList &latitudesDeg,
1008 const QDoubleList &longitudesDeg,
const QDoubleList &elevationsMeters,
1009 const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters) {
1010 if (!myself) {
return; }
1011 this->updateRemoteAircraftFromSimulator(callsigns, latitudesDeg, longitudesDeg, elevationsMeters,
1012 waterFlags, verticalOffsetsMeters);
1016 void CSimulatorXPlane::triggerRequestRemoteAircraftDataFromXPlane(
const CCallsignSet &callsigns)
1018 if (callsigns.
isEmpty()) {
return; }
1021 if (!myself) {
return; }
1022 this->requestRemoteAircraftDataFromXPlane(callsigns);
1026 void CSimulatorXPlane::updateRemoteAircraftFromSimulator(
1027 const QStringList &callsigns,
const QDoubleList &latitudesDeg,
const QDoubleList &longitudesDeg,
1028 const QDoubleList &elevationsMeters,
const QBoolList &waterFlags,
const QDoubleList &verticalOffsetsMeters)
1030 const int size = callsigns.
size();
1033 if (CBuildConfig::isLocalDeveloperDebugBuild())
1035 Q_ASSERT_X(elevationsMeters.size() == size, Q_FUNC_INFO,
"Wrong elevations");
1036 Q_ASSERT_X(waterFlags.size() == size, Q_FUNC_INFO,
"Wrong waterFlags");
1037 Q_ASSERT_X(latitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong latitudesDeg");
1038 Q_ASSERT_X(longitudesDeg.size() == size, Q_FUNC_INFO,
"Wrong longitudesDeg");
1039 Q_ASSERT_X(verticalOffsetsMeters.size() == size, Q_FUNC_INFO,
"Wrong CG");
1043 static const QString hint(
"remote acft.");
1044 for (
int i = 0; i < size; i++)
1046 const bool emptyCs = callsigns[i].
isEmpty();
1048 if (emptyCs) {
continue; }
1051 if (!m_xplaneAircraftObjects.contains(cs)) {
continue; }
1052 const CXPlaneMPAircraft xpAircraft = m_xplaneAircraftObjects[cs];
1053 SWIFT_VERIFY_X(xpAircraft.hasCallsign(), Q_FUNC_INFO,
"Need callsign");
1054 if (!xpAircraft.hasCallsign()) {
continue; }
1057 if (!std::isnan(elevationsMeters[i]))
1059 const CAltitude elevationAlt =
CAltitude(elevationsMeters[i], CLengthUnit::m(), CLengthUnit::ft());
1061 CLongitude(longitudesDeg[i], CAngleUnit::deg()), elevationAlt,
1062 CElevationPlane::singlePointRadius());
1065 const double cgValue = verticalOffsetsMeters[i];
1067 cg = fixSimulatorCg(cg, xpAircraft.getAircraftModel());
1071 const bool waterFlag = waterFlags[i];
1072 const bool useElevation = this->handleProbeValue(elevation, cs, waterFlag, hint,
true);
1074 useElevation ? elevation : CElevationPlane::null(), cg);
1088 return CLength(0.0, CLengthUnit::ft());
1093 void CSimulatorXPlane::disconnectFromDBus()
1097 if (m_trafficProxy) { m_trafficProxy->
cleanup(); }
1105 bool CSimulatorXPlane::sendXSwiftBusSettings()
1108 if (!m_serviceProxy) {
return false; }
1122 if (!m_serviceProxy) {
return s; }
1130 void CSimulatorXPlane::onXSwiftBusSettingsChanged()
1141 this->sendXSwiftBusSettings();
1146 void CSimulatorXPlane::setMinTerrainProbeDistance(
const CLength &distance)
1148 if (distance.
isNull()) {
return; }
1149 if (m_minSuspicousTerrainProbe.
isNull() || distance < m_minSuspicousTerrainProbe)
1151 m_minSuspicousTerrainProbe = distance;
1155 void CSimulatorXPlane::onRemoteAircraftAdded(
const QString &callsign)
1158 if (callsign.
isEmpty()) {
return; }
1163 bool wasPending =
false;
1164 if (m_addingInProgressAircraft.
contains(cs))
1167 const qint64 wasStartedMs = m_addingInProgressAircraft.
value(cs);
1169 m_statsAddCurrentTimeMs = deltaTimeMs;
1170 if (deltaTimeMs > m_statsAddMaxTimeMs) { m_statsAddMaxTimeMs = deltaTimeMs; }
1171 m_addingInProgressAircraft.
remove(cs);
1176 CLogMessage(
this).
warning(u
"Aircraft '%1' no longer in range, will be removed") << callsign;
1177 this->triggerRemoveAircraft(cs, TimeoutAdding);
1186 CLogMessage(
this).
warning(u
"Added callsign '%1' was not in progress anymore. Timeout?") << callsign;
1189 const bool rendered =
true;
1192 this->triggerRequestRemoteAircraftDataFromXPlane(cs);
1193 this->triggerAddNextPendingAircraft();
1195 Q_ASSERT_X(addedRemoteAircraft.
hasCallsign(), Q_FUNC_INFO,
1197 Q_ASSERT_X(addedRemoteAircraft.
getCallsign() == cs, Q_FUNC_INFO,
1199 m_xplaneAircraftObjects.insert(cs, CXPlaneMPAircraft(addedRemoteAircraft,
this, &
m_interpolationLogger));
1203 void CSimulatorXPlane::onRemoteAircraftAddingFailed(
const QString &callsign)
1206 if (callsign.
isEmpty()) {
return; }
1217 CLogMessage(
this).
warning(u
"Adding '%1' failed, but aircraft no longer in range, will be removed")
1221 const bool wasPending = (
static_cast<int>(m_addingInProgressAircraft.
remove(cs)) > 0);
1222 Q_UNUSED(wasPending)
1226 m_aircraftAddedFailed.
push_back(failedRemoteAircraft);
1227 m_pendingToBeAddedAircraft.
replaceOrAdd(failedRemoteAircraft);
1229 this->triggerAddNextPendingAircraft();
1232 void CSimulatorXPlane::addNextPendingAircraft()
1234 if (m_pendingToBeAddedAircraft.
isEmpty()) {
return; }
1237 this->detectTimeoutAdding();
1240 if (!this->canAddAircraft()) {
return; }
1245 CLogMessage(
this).
info(u
"Adding next pending aircraft '%1', pending %2, in progress %3")
1247 << m_addingInProgressAircraft.
size();
1251 void CSimulatorXPlane::triggerAddNextPendingAircraft()
1256 this->addNextPendingAircraft();
1260 int CSimulatorXPlane::detectTimeoutAdding()
1262 if (m_addingInProgressAircraft.
isEmpty()) {
return 0; }
1266 for (
const CCallsign &cs : addingCallsigns)
1268 if (m_addingInProgressAircraft.
value(cs) < timeout) {
continue; }
1272 for (
const CCallsign &cs : std::as_const(timeoutCallsigns))
1274 m_addingInProgressAircraft.
remove(cs);
1278 return timeoutCallsigns.
size();
1281 void CSimulatorXPlane::triggerRemoveAircraft(
const CCallsign &callsign, qint64 deferMs)
1285 if (!myself) {
return; }
1290 QPair<qint64, qint64> CSimulatorXPlane::minMaxTimestampsAddInProgress()
const
1292 static const QPair<qint64, qint64> empty(-1, -1);
1293 if (m_addingInProgressAircraft.
isEmpty()) {
return empty; }
1296 return QPair<qint64, qint64>(*mm.first, *mm.second);
1299 bool CSimulatorXPlane::canAddAircraft()
const
1301 if (m_addingInProgressAircraft.
isEmpty()) {
return true; }
1305 const QPair<qint64, qint64> tsMM = this->minMaxTimestampsAddInProgress();
1306 const qint64 deltaLatest = now - tsMM.second;
1307 const bool canAdd = (deltaLatest > TimeoutAdding);
1316 return new CSimulatorXPlane(info, ownAircraftProvider, remoteAircraftProvider, clientProvider,
this);
1321 constexpr
int QueryInterval = 5 * 1000;
1333 if (!m_timer.
isActive()) {
return; }
1339 if (!myself) {
return; }
1344 void CSimulatorXPlaneListener::checkConnection()
1347 Q_ASSERT_X(!CThreadUtils::thisIsMainThread(), Q_FUNC_INFO,
"Expect to run in background");
1352 m_dBusServerAddress = m_xSwiftBusServerSettings.
getThreadLocal().getDBusServerAddressQt();
1353 if (CDBusServer::isSessionOrSystemAddress(m_dBusServerAddress))
1355 checkConnectionViaSessionBus();
1358 else if (CDBusServer::isQtDBusAddress(m_dBusServerAddress))
1360 checkConnectionViaPeer(m_dBusServerAddress);
1367 void CSimulatorXPlaneListener::checkConnectionViaSessionBus()
1375 checkConnectionCommon();
1379 void CSimulatorXPlaneListener::checkConnectionViaPeer(
const QString &address)
1388 checkConnectionCommon();
1392 void CSimulatorXPlaneListener::checkConnectionCommon()
1394 CXSwiftBusServiceProxy service(m_DBusConnection);
1395 CXSwiftBusTrafficProxy traffic(m_DBusConnection);
1397 const bool result = service.isValid() && traffic.isValid();
1398 if (!result) {
return; }
1400 const QString swiftVersion = CBuildConfig::getVersionString();
1401 const QString xswiftbusVersion = service.getVersionNumber();
1402 const QString xswiftbusCommitHash = service.getCommitHash();
1403 if (xswiftbusVersion.
isEmpty())
1405 CLogMessage(
this).
warning(u
"Could not determine which version of xswiftbus is running. Mismatched versions "
1406 u
"might cause instability.");
1408 else if (commitHash() != xswiftbusCommitHash)
1410 CLogMessage(
this).
error(u
"You are using an incorrect version of xswiftbus. The version of xswiftbus (%1) "
1411 u
"should match the version of swift (%2). Consider upgrading!")
1412 << xswiftbusVersion << swiftVersion;
1415 if (!traffic.initialize())
1418 u
"Connection to xswiftbus successful, but could not initialize xswiftbus. Check X-Plane Log.txt.");
1422 const MultiplayerAcquireInfo info = traffic.acquireMultiplayerPlanes();
1423 if (!info.hasAcquired)
1426 info.owner.
trimmed().
isEmpty() ? QStringLiteral(
"unknown plugin") : info.owner.trimmed();
1428 u
"Connection to xswiftbus successful, but could not acquire multiplayer planes. '%1' has acquired them "
1429 u
"already. Disable '%2' or remove it if not required and reload xswiftbus.")
1437 void CSimulatorXPlaneListener::serviceRegistered(
const QString &serviceName)
1443 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.
virtual 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?
virtual CLatitude latitude() const
Latitude.
virtual const aviation::CAltitude & geodeticHeight() const
Height, ellipsoidal or geodetic height (used in GPS)
void setGeodeticHeight(const aviation::CAltitude &height)
Set height (ellipsoidal or geodetic height)
virtual 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.
virtual void setCurrentUtcTime()
Sets both timestamps.
QString getDBusServerAddressQt() const
DBus server.
virtual 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.
virtual int physicallyRemoveAllRemoteAircraft()
Remove all remote aircraft and their data via ISimulator::clearAllRemoteAircraftData.
virtual ~CSimulatorXPlane()
Dtor.
virtual bool connectTo()
Connect to simulator.
virtual bool followAircraft(const swift::misc::aviation::CCallsign &callsign)
Follow aircraft.
virtual bool isConnected() const
Are we connected to the simulator?
virtual 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.
virtual 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.
virtual void resetAircraftStatistics()
Reset the statistics.
virtual bool updateOwnSimulatorSelcal(const swift::misc::aviation::CSelcal &selcal, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context)
virtual void clearAllRemoteAircraftData()
Clear all aircraft related data, but do not physically remove the aircraft.
virtual 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...
virtual void unload()
Driver will be unloaded.
virtual bool updateOwnSimulatorCockpit(const swift::misc::simulation::CSimulatedAircraft &aircraft, const swift::misc::CIdentifier &originator)
Update own aircraft cockpit (usually from context)
virtual swift::misc::aviation::CCallsignSet physicallyRenderedAircraft() const
Physically rendered (displayed in simulator) This shall only return aircraft handled in the simulator...
virtual swift::misc::CStatusMessageList getInterpolationMessages(const swift::misc::aviation::CCallsign &callsign) const
Interpolation messages for callsign.
virtual void setFlightNetworkConnected(bool connected)
Flight network has been connected.
virtual bool physicallyAddRemoteAircraft(const swift::misc::simulation::CSimulatedAircraft &newRemoteAircraft)
Add new remote aircraft physically to the simulator.
virtual bool physicallyRemoveRemoteAircraft(const swift::misc::aviation::CCallsign &callsign)
Remove remote aircraft from simulator.
virtual QString getStatisticsSimulatorSpecific() const
Allows to print out simulator specific statistics.
virtual void callbackReceivedRequestedElevation(const swift::misc::geo::CElevationPlane &plane, const swift::misc::aviation::CCallsign &callsign, bool isWater)
A requested elevation has been received.
virtual void displayStatusMessage(const swift::misc::CStatusMessage &message) const
Display a status message in the simulator.
virtual bool disconnectFrom()
Disconnect from simulator.
virtual void displayTextMessage(const swift::misc::network::CTextMessage &message) const
Display a text message.
CSimulatorXPlaneListener(const swift::misc::simulation::CSimulatorPluginInfo &info)
Constructor.
virtual void checkImpl()
Plugin specific implementation to check.
virtual void startImpl()
Plugin specific implementation to start listener.
virtual 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.