refs #789, improvements to try to solve FSX issue in driver

* more asserts to find issues
* limit number of exceptions displayed
* reset() function (there was an issue with not cleaned up values)
* using CSimConnectObjects and adjustments for the previous changes
This commit is contained in:
Klaus Basan
2016-11-07 20:22:15 +01:00
parent 9deedf1e10
commit 94d6b8d6b8
9 changed files with 379 additions and 171 deletions

View File

@@ -88,6 +88,8 @@ namespace BlackCore
//! @}
protected slots:
//! \name Connected with remote aircraft provider signals {
//! Slow timer used to highlight aircraft, can be used for other things too
virtual void ps_oneSecondTimer();
@@ -102,6 +104,11 @@ namespace BlackCore
//! Provider removed aircraft
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
@@ -117,6 +124,12 @@ namespace BlackCore
//! \copydoc ISimulator::logicallyRemoveRemoteAircraft
virtual bool logicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
//! Reset state
virtual void reset();
//! Clear all aircraft related data
virtual void clearAllAircraft();
//! Blink the highlighted aircraft
void blinkHighlightedAircraft();
@@ -132,15 +145,22 @@ namespace BlackCore
//! Set own model
void reverseLookupAndUpdateOwnAircraftModel(const QString &modelString);
protected:
//! 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
BlackMisc::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< debug messages, rendering etc.
BlackMisc::Simulation::CAircraftModel m_defaultModel; //!< default model
qint64 m_statsUpdateAircraftTimeTotalMs = 0; //!< statistics update time
qint64 m_statsUpdateAircraftTimeAvgMs = 0; //!< statistics update time
int m_statsUpdateAircraftCountMs = 0; //!< statistics update time
// 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);