mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 20:15:35 +08:00
Regularly update X-Plane simulated aircraft
The simulated aircraft object has been set only once for each X-Plane aircraft as soon as adding to the simulator succeeded. Any updates to transponder codes, modes etc. were missed and never updated. To make sure we always have the latest information available, we update all known X-Plane aircraft every second in the slow timer tasks. Manifest Tasks: T502
This commit is contained in:
committed by
Mat Sutcliffe
parent
db8285868b
commit
8df4024bde
@@ -308,6 +308,13 @@ namespace BlackSimPlugin
|
||||
|
||||
this->updateOwnParts(parts);
|
||||
this->requestRemoteAircraftDataFromXPlane();
|
||||
|
||||
for (CXPlaneMPAircraft &xplaneAircraft : m_xplaneAircraftObjects)
|
||||
{
|
||||
// Update remote aircraft to have the latest transponder modes, codes etc.
|
||||
CSimulatedAircraft simulatedAircraft = this->getAircraftInRangeForCallsign(xplaneAircraft.getCallsign());
|
||||
xplaneAircraft.setSimulatedAircraft(simulatedAircraft);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,11 @@ namespace BlackSimPlugin
|
||||
m_interpolator->initCorrespondingModel(aircraft.getModel());
|
||||
}
|
||||
|
||||
void CXPlaneMPAircraft::setSimulatedAircraft(const CSimulatedAircraft &simulatedAircraft)
|
||||
{
|
||||
m_aircraft = simulatedAircraft;
|
||||
}
|
||||
|
||||
QString CXPlaneMPAircraft::getInterpolatorInfo(CInterpolationAndRenderingSetupBase::InterpolatorMode mode) const
|
||||
{
|
||||
Q_ASSERT(m_interpolator);
|
||||
|
||||
@@ -37,6 +37,9 @@ namespace BlackSimPlugin
|
||||
//! Destructor
|
||||
~CXPlaneMPAircraft() {}
|
||||
|
||||
//! Set simulated aircraft
|
||||
void setSimulatedAircraft(const BlackMisc::Simulation::CSimulatedAircraft &simulatedAircraft);
|
||||
|
||||
//! Get callsign
|
||||
const BlackMisc::Aviation::CCallsign &getCallsign() const { return m_aircraft.getCallsign(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user