refs #789, support for aircraft out of FSX reality bubble

* such aircraft will be tried to be added again
* removed qeueud adding as it was not solving the problem
This commit is contained in:
Klaus Basan
2016-11-11 01:08:20 +01:00
parent 356e91c22f
commit 42549760ed
5 changed files with 110 additions and 88 deletions

View File

@@ -435,23 +435,6 @@ namespace BlackCore
Q_UNUSED(callsign);
}
void CSimulatorCommon::ps_queueForAdding(const CSimulatedAircraft &aircraft)
{
m_pendingAircraftToAdd.replaceOrAddByCallsign(aircraft);
QTimer::singleShot(500, this, [ = ]
{
this->physicallyAddNextQueuedAircraft();
});
}
void CSimulatorCommon::physicallyAddNextQueuedAircraft()
{
if (m_pendingAircraftToAdd.isEmpty()) { return; } // delete in meantime
CSimulatedAircraft nextAircraft(m_pendingAircraftToAdd.front()); // normally it should always find a value
m_pendingAircraftToAdd.pop_front();
this->physicallyAddRemoteAircraft(nextAircraft);
}
void CSimulatorCommon::reset()
{
m_statsUpdateAircraftCountMs = 0;
@@ -463,7 +446,6 @@ namespace BlackCore
void CSimulatorCommon::clearAllAircraft()
{
m_aircraftToAddAgainWhenRemoved.clear();
m_pendingAircraftToAdd.clear();
}
} // namespace

View File

@@ -89,7 +89,8 @@ namespace BlackCore
protected slots:
//! \name Connected with remote aircraft provider signals {
//! \name Connected with remote aircraft provider signals
//! @{
//! Slow timer used to highlight aircraft, can be used for other things too
virtual void ps_oneSecondTimer();
@@ -106,10 +107,6 @@ namespace BlackCore
virtual void ps_remoteProviderRemovedAircraft(const BlackMisc::Aviation::CCallsign &callsign);
//! @}
//! Add when pending aircraft is added
//! \remark no need to use this if multiple models can be added to simulator at once
void ps_queueForAdding(const BlackMisc::Simulation::CSimulatedAircraft &aircraft);
protected:
//! Constructor
CSimulatorCommon(const BlackMisc::Simulation::CSimulatorPluginInfo &info,
@@ -145,9 +142,6 @@ namespace BlackCore
//! Set own model
void reverseLookupAndUpdateOwnAircraftModel(const QString &modelString);
//! Add the next qeueud aircraft
void physicallyAddNextQueuedAircraft();
BlackMisc::IInterpolator *m_interpolator = nullptr; //!< interpolator instance
bool m_pausedSimFreezesInterpolation = false; //!< paused simulator will also pause interpolation (so AI aircraft will hold)
BlackMisc::Simulation::CSimulatorSetup m_simulatorSetup; //!< setup object
@@ -159,7 +153,6 @@ namespace BlackCore
// some optional functionality which can be used by the sims as needed
BlackMisc::Simulation::CSimulatedAircraftList m_aircraftToAddAgainWhenRemoved; //!< add this model again when removed, normally used to change model
BlackMisc::Simulation::CSimulatedAircraftList m_pendingAircraftToAdd; //!< used with qeued adding, here only one model is added add a time and only after it is confirmed by the sim. the next model is added
//! Lookup against DB data
static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model);
@@ -179,7 +172,6 @@ namespace BlackCore
BlackMisc::Aviation::CCallsignSet m_callsignsToBeRendered; //!< callsigns which will be rendered
BlackMisc::PhysicalQuantities::CLength m_maxRenderedDistance { 0.0, BlackMisc::PhysicalQuantities::CLengthUnit::nullUnit()}; //!< max.distance for rendering
BlackMisc::CConnectionGuard m_remoteAircraftProviderConnections; //!< connected signal/slots
};
} // namespace