Misc. style issues interpolation/model adding

This commit is contained in:
Klaus Basan
2018-11-17 23:03:30 +01:00
parent c8ba6946bd
commit cb422d72cf
9 changed files with 32 additions and 37 deletions

View File

@@ -674,7 +674,7 @@ namespace BlackSimPlugin
}
// slower updates
if (m_ownAircraftUpdate % 10 == 0)
if (m_ownAircraftUpdateCycles % 10 == 0)
{
if (m_isWeatherActivated)
{
@@ -694,7 +694,7 @@ namespace BlackSimPlugin
// init terrain probes here has the advantage we can also switch it on/off at runtime
if (m_useFsxTerrainProbe && !m_initFsxTerrainProbes)
{
this->physicallyInitAITerrainProbes(position, 2);
this->physicallyInitAITerrainProbes(position, 2); // init probe
}
// SB4 offsets
@@ -702,7 +702,7 @@ namespace BlackSimPlugin
m_simulatorInternals.setValue(QStringLiteral("fsx/sb4packets"), m_useSbOffsets ? QString::number(m_sbDataReceived) : QStringLiteral("disabled"));
}
m_ownAircraftUpdate++; // with 50updates/sec long enough even for 32bit
m_ownAircraftUpdateCycles++; // with 50updates/sec long enough even for 32bit
}
void CSimulatorFsxCommon::triggerUpdateRemoteAircraftFromSimulator(const CSimConnectObject &simObject, const DataDefinitionPosData &remoteAircraftData)
@@ -827,9 +827,9 @@ namespace BlackSimPlugin
const QPointer<CSimulatorFsxCommon> myself(this);
QTimer::singleShot(1000, this, [ = ]
{
// also triggers new add if required
if (!myself) { return; }
if (this->isShuttingDownOrDisconnected()) { return; }
// verify aircraft and also triggers new add if required
// do not do this in the event loop, so we do this deferred
if (!myself || this->isShuttingDownOrDisconnected()) { return; }
this->verifyAddedRemoteAircraft(verifyAircraft);
});
return true;
@@ -922,7 +922,7 @@ namespace BlackSimPlugin
emit this->physicallyAddingRemoteModelFailed(CSimulatedAircraft(), false, msg);
}
// trigger new adding from pending if any
// trigger adding pending aircraft if there are any
if (!m_addPendingAircraft.isEmpty())
{
this->addPendingAircraftAfterAdded();
@@ -1020,7 +1020,7 @@ namespace BlackSimPlugin
// no simObject reference outside that block, because it will be deleted
{
CSimConnectObject &simObject = m_simConnectObjects[remoteAircraftIn.getCallsign()];
simObject.setConfirmedAdded(true);
simObject.setConfirmedAdded(true); // terrain probe
simObject.resetTimestampToNow();
cs = simObject.getCallsign();
CLogMessage(this).info("Probe: '%1' '%2' confirmed, %3") << simObject.getCallsignAsString() << simObject.getAircraftModelString() << simObject.toQString();
@@ -1052,7 +1052,7 @@ namespace BlackSimPlugin
void CSimulatorFsxCommon::addPendingAircraftAfterAdded()
{
this->addPendingAircraft(AddAfterAdded);
this->addPendingAircraft(AddAfterAdded); // addPendingAircraft is already "non blocking"
}
void CSimulatorFsxCommon::addPendingAircraft(AircraftAddMode mode)
@@ -2003,8 +2003,8 @@ namespace BlackSimPlugin
{
// MSFS has inverted pitch and bank angles
SIMCONNECT_DATA_PBH pbh;
pbh.Pitch = -situation.getPitch().value(CAngleUnit::deg());
pbh.Bank = -situation.getBank().value(CAngleUnit::deg());
pbh.Pitch = -situation.getPitch().value(CAngleUnit::deg());
pbh.Bank = -situation.getBank().value(CAngleUnit::deg());
pbh.Heading = situation.getHeading().value(CAngleUnit::deg());
return pbh;
}
@@ -2213,7 +2213,7 @@ namespace BlackSimPlugin
m_sbDataReceived = 0;
m_syncTimeDeferredCounter = 0;
m_skipCockpitUpdateCycles = 0;
m_ownAircraftUpdate = 0;
m_ownAircraftUpdateCycles = 0;
m_requestIdSimObjAircraft = static_cast<SIMCONNECT_DATA_REQUEST_ID>(RequestSimObjAircraftStart);
m_dispatchErrors = 0;
m_receiveExceptionCount = 0;

View File

@@ -564,7 +564,7 @@ namespace BlackSimPlugin
int m_sbDataReceived = 0; //!< SB4 area data received
int m_syncTimeDeferredCounter = 0; //!< Set when synchronized, used to wait some time
int m_skipCockpitUpdateCycles = 0; //!< skip some update cycles to allow changes in simulator cockpit to be set
int m_ownAircraftUpdate = 0; //!< own aircraft update
int m_ownAircraftUpdateCycles = 0; //!< own aircraft update
// tracing dispatch performance
int m_dispatchErrors = 0; //!< number of dispatched failed, \sa dispatch

View File

@@ -48,10 +48,10 @@ namespace BlackSimPlugin
case SIMCONNECT_RECV_ID_OPEN:
{
SIMCONNECT_RECV_OPEN *event = static_cast<SIMCONNECT_RECV_OPEN *>(pData);
const QString simConnectVersion = QString("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor);
const QString version = QString("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor);
const QString name = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName);
const QString details = QString("Name: '%1' Version: %2 SimConnect: %3").arg(name, version, simConnectVersion);
const QString simConnectVersion = QStringLiteral("%1.%2.%3.%4").arg(event->dwSimConnectVersionMajor).arg(event->dwSimConnectVersionMinor).arg(event->dwSimConnectBuildMajor).arg(event->dwSimConnectBuildMinor);
const QString version = QStringLiteral("%1.%2.%3.%4").arg(event->dwApplicationVersionMajor).arg(event->dwApplicationVersionMinor).arg(event->dwApplicationBuildMajor).arg(event->dwApplicationBuildMinor);
const QString name = CSimulatorFsxCommon::fsxCharToQString(event->szApplicationName);
const QString details = QStringLiteral("Name: '%1' Version: %2 SimConnect: %3").arg(name, version, simConnectVersion);
simulatorFsxP3D->setSimulatorDetails(name, details, version);
simulatorFsxP3D->m_simConnectVersion = simConnectVersion;
CLogMessage(simulatorFsxP3D).info("Connected to %1: '%2'") << simulatorFsxP3D->getSimulatorPluginInfo().getIdentifier() << details;
@@ -179,7 +179,10 @@ namespace BlackSimPlugin
case SystemEventObjectRemoved:
simulatorFsxP3D->simulatorReportedObjectRemoved(objectId);
break;
case SystemEventObjectAdded: // added in SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID
case SystemEventObjectAdded:
// added in SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID
// this event here is normally received before SIMCONNECT_RECV_ID_ASSIGNED_OBJECT_ID
break;
default:
break;
}