Ref T180, formatting

This commit is contained in:
Klaus Basan
2017-11-09 00:52:13 +01:00
parent 4cb404c91d
commit fa50e6a8ea
7 changed files with 31 additions and 26 deletions

View File

@@ -122,7 +122,7 @@ namespace BlackSimPlugin
CCallsign CSimConnectObjects::getCallsignForObjectId(DWORD objectId) const
{
return getSimObjectForObjectId(objectId).getCallsign();
return this->getSimObjectForObjectId(objectId).getCallsign();
}
CCallsignSet CSimConnectObjects::getAllCallsigns() const

View File

@@ -28,7 +28,7 @@ namespace BlackSimPlugin
//! Constructor
CSimConnectObject();
//! Constructor, providing initial situation/parts
//! Constructor providing initial situation/parts
CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft,
DWORD requestId,
BlackMisc::Simulation::CInterpolationLogger *logger);
@@ -99,7 +99,7 @@ namespace BlackSimPlugin
//! Valid object id?
bool hasValidObjectId() const { return m_validObjectId; }
//! Object is requested, not yet added
//! Object is requested in simulator, not yet confirmed added
bool isPendingAdded() const;
//! Adding is confirmed
@@ -117,28 +117,30 @@ namespace BlackSimPlugin
//! VTOL?
bool isVtol() const { return m_aircraft.isVtol(); }
//! Was the object really added to SIM
//! Was the object really added to simulator
bool hasValidRequestAndObjectId() const;
//! Toggle interpolator mode
//! \copydoc BlackMisc::Simulation::CInterpolatorMulti::toggleMode
void toggleInterpolatorMode();
//! Set interpolator mode
//! \copydoc BlackMisc::Simulation::CInterpolatorMulti::setMode
bool setInterpolatorMode(BlackMisc::Simulation::CInterpolatorMulti::Mode mode);
//! Interpolator info
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolatorInfo
QString getInterpolatorInfo() const;
//! Interpolator
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
//! \copydoc BlackMisc::Simulation::CInterpolator::attachLogger
void attachInterpolatorLogger(BlackMisc::Simulation::CInterpolationLogger *logger);
//! Get interpolated situation
//! \remark return original position if interpolation fails for some reason
//! \copydoc BlackMisc::Simulation::CInterpolator::getInterpolatedSituation
BlackMisc::Aviation::CAircraftSituation getInterpolatedSituation(
qint64 currentTimeSinceEpoc,
const BlackMisc::Simulation::CInterpolationAndRenderingSetup &setup,
const BlackMisc::Simulation::CInterpolationHints &hints, BlackMisc::Simulation::CInterpolationStatus &status) const;
//! Interpolator
BlackMisc::Simulation::CInterpolatorMulti *getInterpolator() const { return m_interpolator.data(); }
private:
BlackMisc::Simulation::CSimulatedAircraft m_aircraft; //!< corresponding aircraft
DWORD m_requestId = 0;

View File

@@ -508,7 +508,7 @@ namespace BlackSimPlugin
// we know the object has been created. But it can happen it is directly removed afterwards
QTimer::singleShot(500, this, [ = ]
{
// also triggers new add
// also triggers new add if required
this->verifyAddedRemoteAircraft(simObject.getAircraft());
});
return true;
@@ -1059,8 +1059,10 @@ namespace BlackSimPlugin
static_assert(sizeof(DataDefinitionRemoteAircraftPartsWithoutLights) == sizeof(double) * 10, "DataDefinitionRemoteAircraftPartsWithoutLights has an incorrect size.");
Q_ASSERT_X(CThreadUtils::isCurrentThreadObjectThread(this), Q_FUNC_INFO, "thread");
// Freeze interpolation while paused
if (this->isPaused() && m_pausedSimFreezesInterpolation) { return; }
// nothing to do, reset request id and exit
if (this->isPaused() && m_pausedSimFreezesInterpolation) { return; } // no interpolation while paused
const int remoteAircraftNo = this->getAircraftInRangeCount();
if (remoteAircraftNo < 1) { m_interpolationRequest = 0; return; }
@@ -1071,10 +1073,10 @@ namespace BlackSimPlugin
// values used for position and parts
const qint64 currentTimestamp = QDateTime::currentMSecsSinceEpoch();
const QList<CSimConnectObject> simObjects(m_simConnectObjects.values());
const CCallsignSet callsignsToLog(m_interpolationRenderingSetup.getLogCallsigns());
// interpolation for all remote aircraft
const QList<CSimConnectObject> simObjects(m_simConnectObjects.values());
for (const CSimConnectObject &simObject : simObjects)
{
// happening if aircraft is not yet added to simulator or to be deleted
@@ -1089,7 +1091,7 @@ namespace BlackSimPlugin
// fetch parts, as they are needed for ground interpolation
const bool useAircraftParts = enableAircraftParts && aircraftWithParts.contains(callsign);
const bool logInterpolationAndParts = callsignsToLog.contains(callsign);
const CInterpolationAndRenderingSetup setup(getInterpolationAndRenderingSetup());
const CInterpolationAndRenderingSetup setup(this->getInterpolationAndRenderingSetup());
CPartsStatus partsStatus(useAircraftParts);
const CAircraftParts parts = useAircraftParts ? simObject.getInterpolator()->getInterpolatedParts(-1, setup, partsStatus, logInterpolationAndParts) : CAircraftParts();
@@ -1110,7 +1112,7 @@ namespace BlackSimPlugin
sizeof(SIMCONNECT_DATA_INITPOSITION), &position);
if (hr == S_OK)
{
if (m_traceSendId) { this->traceSendId(simObject.getObjectId(), Q_FUNC_INFO);}
if (m_traceSendId) { this->traceSendId(simObject.getObjectId(), Q_FUNC_INFO); }
}
else
{
@@ -1565,7 +1567,7 @@ namespace BlackSimPlugin
if (toBeRemoved.isEmpty()) { return toBeRemoved; }
for (const CCallsign &callsign : toBeRemoved)
{
physicallyRemoveRemoteAircraft(callsign);
this->physicallyRemoveRemoteAircraft(callsign);
}
if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Cs: '%1'").arg(toBeRemoved.toStringList().join(", "))); }

View File

@@ -121,7 +121,7 @@ namespace BlackSimPlugin
virtual bool disconnectFrom() override;
virtual bool physicallyAddRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &newRemoteAircraft) override;
virtual bool physicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
virtual int physicallyRemoveAllRemoteAircraft() override;
virtual int physicallyRemoveAllRemoteAircraft() override;
virtual bool updateOwnSimulatorCockpit(const BlackMisc::Simulation::CSimulatedAircraft &ownAircraft, const BlackMisc::CIdentifier &originator) override;
virtual bool updateOwnSimulatorSelcal(const BlackMisc::Aviation::CSelcal &selcal, const BlackMisc::CIdentifier &originator) override;
virtual void displayStatusMessage(const BlackMisc::CStatusMessage &message) const override;
@@ -299,7 +299,7 @@ namespace BlackSimPlugin
//! Request data for a simObject (aka remote aircraft)
bool requestDataForSimObject(const CSimConnectObject &simObject, SIMCONNECT_PERIOD period = SIMCONNECT_PERIOD_SECOND);
//! Request lights for a simObject
//! Request lights for a CSimConnectObject
bool requestLightsForSimObject(const CSimConnectObject &simObject);
//! FSX position as string