mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 01:45:38 +08:00
refs #865, further improved logging
* set log flag in hints, so no lock for each aircraft is needed * as a result log functions have a bool log parameter now * highlight situation and parts changed
This commit is contained in:
committed by
Mathew Sutcliffe
parent
ff7756db38
commit
62d4a94106
@@ -170,7 +170,8 @@ namespace BlackSimPlugin
|
||||
if (m_clientStatus == Disconnected) { return; }
|
||||
|
||||
IInterpolator::InterpolationStatus status;
|
||||
const CInterpolationHints hints; // \fixme 201701 #865 KB if there is an elevation provider for FS9 add it here or set elevation
|
||||
CInterpolationHints hints; // \fixme 201701 #865 KB if there is an elevation provider for FS9 add it here or set elevation
|
||||
hints.setLoggingInterpolation(this->m_interpolator->getInterpolatorSetup().getLogCallsigns().contains(m_callsign));
|
||||
const CAircraftSituation situation = this->m_interpolator->getInterpolatedSituation(m_callsign, -1, hints, status);
|
||||
|
||||
// Test only for successful interpolation. FS9 requires constant positions
|
||||
|
||||
@@ -863,6 +863,9 @@ namespace BlackSimPlugin
|
||||
// values used for position and parts
|
||||
const qint64 currentTimestamp = QDateTime::currentMSecsSinceEpoch();
|
||||
const QList<CSimConnectObject> simObjects(m_simConnectObjects.values());
|
||||
const CCallsignSet callsignsToLog(this->m_interpolationRenderingSetup.getLogCallsigns());
|
||||
|
||||
// interpolation for all remote aircraft
|
||||
for (const CSimConnectObject &simObj : simObjects)
|
||||
{
|
||||
// happening if aircraft is not yet added to simulator or to be deleted
|
||||
@@ -875,14 +878,17 @@ namespace BlackSimPlugin
|
||||
|
||||
// fetch parts, as they are needed for ground interpolation
|
||||
const bool useAircraftParts = enableAircraftParts && aircraftWithParts.contains(callsign);
|
||||
const bool logInterpolationAndParts = callsignsToLog.contains(callsign);
|
||||
IInterpolator::PartsStatus partsStatus;
|
||||
partsStatus.setSupportsParts(useAircraftParts);
|
||||
const CAircraftParts parts = useAircraftParts ? this->m_interpolator->getInterpolatedParts(callsign, -1, partsStatus) : CAircraftParts();
|
||||
const CAircraftParts parts = useAircraftParts ? this->m_interpolator->getInterpolatedParts(callsign, -1, partsStatus, logInterpolationAndParts) : CAircraftParts();
|
||||
|
||||
// get interpolated situation
|
||||
IInterpolator::InterpolationStatus interpolatorStatus;
|
||||
CInterpolationHints hints(m_hints[simObj.getCallsign()]);
|
||||
hints.setAircraftParts(useAircraftParts ? parts : CAircraftParts(), useAircraftParts);
|
||||
hints.setLoggingInterpolation(logInterpolationAndParts);
|
||||
|
||||
const CAircraftSituation interpolatedSituation = this->m_interpolator->getInterpolatedSituation(callsign, currentTimestamp, hints, interpolatorStatus);
|
||||
|
||||
if (interpolatorStatus.allTrue())
|
||||
|
||||
Reference in New Issue
Block a user