Ref T232 clear remote aircraft data once network disconnects

* blackconfig in .pro
* verify function to detect dangling states
* clear remote data when disconnected from network
* there was one problem that the data where not correctly cleaned up and hence new aircraft where not added again after a disconnect/reconnect from network
* it is not yet clear why data happens (dangling data), that is what the debugVerify function is for
This commit is contained in:
Klaus Basan
2018-01-22 05:07:00 +01:00
parent 5f7842163b
commit d118ea402f
13 changed files with 98 additions and 34 deletions

View File

@@ -86,6 +86,8 @@ namespace BlackCore
virtual bool isShuttingDown() const override;
virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override;
virtual int physicallyRemoveAllRemoteAircraft() override;
virtual void clearAllRemoteAircraftData() override;
virtual BlackMisc::CStatusMessageList debugVerifyStateAfterAllAircraftRemoved() const override;
//! \addtogroup swiftdotcommands
//! @{
@@ -100,14 +102,13 @@ namespace BlackCore
//! @}
//! \copydoc ISimulator::parseCommandLine
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
// --------- ISimulator implementations ------------
//! Register help
static void registerHelp();
// --------- ISimulator implementations ------------
//! Reset the statistics counters
void resetStatistics();
void resetAircraftStatistics();
//! Counter added aircraft
int getStatisticsPhysicallyAddedAircraft() const { return m_statsPhysicallyAddedAircraft; }
@@ -161,12 +162,11 @@ namespace BlackCore
//! Max.airports in range
int maxAirportsInRange() const;
//! Reset state
//! Full reset of state
//! \remark reset as it was unloaded without unloading
//! \sa ISimulator::clearAllRemoteAircraftData
virtual void reset();
//! Clear all aircraft related data
virtual void clearAllAircraft();
//! Inject weather grid to simulator
virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) { Q_UNUSED(weatherGrid); }
@@ -223,9 +223,9 @@ namespace BlackCore
// setup for debugging, logs ..
BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc.
// some optional functionality which can be used by the sims as needed
// some optional functionality which can be used by the simulators as needed
BlackMisc::Simulation::CSimulatedAircraftList m_addAgainAircraftWhenRemoved; //!< add this model again when removed, normally used to change model
QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolationHints> m_hints; //!< last ground elevation fetched
QHash<BlackMisc::Aviation::CCallsign, BlackMisc::Simulation::CInterpolationHints> m_hints; //!< hints for callsign, contains last ground elevation fetched
bool m_isWeatherActivated = false; //!< Is simulator weather activated?
BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last