mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 23:25:53 +08:00
refs #863 Move interpolator logging into a separate class.
A single logger instance can be shared between multiple interpolator instances.
This commit is contained in:
@@ -20,10 +20,13 @@ namespace BlackSimPlugin
|
||||
CSimConnectObject::CSimConnectObject()
|
||||
{ }
|
||||
|
||||
CSimConnectObject::CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId) :
|
||||
CSimConnectObject::CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId,
|
||||
BlackMisc::Simulation::CInterpolationLogger *logger) :
|
||||
m_aircraft(aircraft), m_requestId(requestId), m_validRequestId(true),
|
||||
m_interpolator(QSharedPointer<BlackMisc::Simulation::CInterpolatorLinear>::create(aircraft.getCallsign()))
|
||||
{ }
|
||||
{
|
||||
m_interpolator->attachLogger(logger);
|
||||
}
|
||||
|
||||
bool CSimConnectObject::isPendingAdded() const
|
||||
{
|
||||
|
||||
@@ -16,7 +16,14 @@
|
||||
#include "simconnectdatadefinition.h"
|
||||
#include <QSharedPointer>
|
||||
|
||||
namespace BlackMisc { namespace Simulation { class CInterpolatorLinear; } }
|
||||
namespace BlackMisc
|
||||
{
|
||||
namespace Simulation
|
||||
{
|
||||
class CInterpolatorLinear;
|
||||
class CInterpolationLogger;
|
||||
}
|
||||
}
|
||||
namespace BlackSimPlugin
|
||||
{
|
||||
namespace Fsx
|
||||
@@ -29,7 +36,8 @@ namespace BlackSimPlugin
|
||||
CSimConnectObject();
|
||||
|
||||
//! Constructor
|
||||
CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId);
|
||||
CSimConnectObject(const BlackMisc::Simulation::CSimulatedAircraft &aircraft, DWORD requestId,
|
||||
BlackMisc::Simulation::CInterpolationLogger *logger);
|
||||
|
||||
//! Destructor
|
||||
~CSimConnectObject() {}
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace BlackSimPlugin
|
||||
// we will request a new aircraft by request ID, later we will receive its object id
|
||||
// so far this object id is -1
|
||||
addedAircraft.setRendered(false);
|
||||
const CSimConnectObject simObject(addedAircraft, requestId);
|
||||
const CSimConnectObject simObject(addedAircraft, requestId, &m_interpolationLogger);
|
||||
m_simConnectObjects.insert(callsign, simObject);
|
||||
adding = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user