From 39bd8aa2bbe4ee5c705ba54b80c97996d490c8db Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sun, 25 Jun 2017 19:34:40 +0200 Subject: [PATCH] Formatting --- src/blackcore/airspacemonitor.h | 27 +++++++++++---------- src/blackcore/simulatorcommon.cpp | 9 ++++--- src/blackcore/simulatorcommon.h | 14 ++++++----- src/blackcore/vatsim/vatsimdatafilereader.h | 1 - 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/src/blackcore/airspacemonitor.h b/src/blackcore/airspacemonitor.h index fa7183880..ffba44b86 100644 --- a/src/blackcore/airspacemonitor.h +++ b/src/blackcore/airspacemonitor.h @@ -116,7 +116,8 @@ namespace BlackCore //! Returns a list of the users corresponding to the given callsigns BlackMisc::Network::CUserList getUsersForCallsigns(const BlackMisc::Aviation::CCallsignSet &callsigns) const; - //! Returns the flightplan for the given callsign + //! Returns the loaded flight plan for the given callsign + //! \remarks only use this if a network loaded flight plan is directly needed //! \remarks pseudo synchronous, call the async functions and waits for result BlackMisc::Aviation::CFlightPlan loadFlightPlanFromNetwork(const BlackMisc::Aviation::CCallsign &callsign); @@ -170,9 +171,9 @@ namespace BlackCore //! \copydoc BlackMisc::Simulation::IRemoteAircraftProvider::connectRemoteAircraftProviderSignals virtual QList connectRemoteAircraftProviderSignals( QObject *receiver, - std::function addedSituationSlot, - std::function addedPartsSlot, - std::function removedAircraftSlot, + std::function addedSituationSlot, + std::function addedPartsSlot, + std::function removedAircraftSlot, std::function aircraftSnapshotSlot ) override; @@ -232,10 +233,10 @@ namespace BlackCore QString modelString; }; - BlackMisc::Aviation::CAtcStationList m_atcStationsOnline; //!< online ATC stations - BlackMisc::Aviation::CAtcStationList m_atcStationsBooked; //!< booked ATC stations - BlackMisc::Network::CClientList m_otherClients; //!< client informatiom, thread safe access required - BlackMisc::Simulation::CSimulatedAircraftList m_aircraftInRange; //!< aircraft, thread safe access required + BlackMisc::Aviation::CAtcStationList m_atcStationsOnline; //!< online ATC stations + BlackMisc::Aviation::CAtcStationList m_atcStationsBooked; //!< booked ATC stations + BlackMisc::Network::CClientList m_otherClients; //!< client informatiom, thread safe access required + BlackMisc::Simulation::CSimulatedAircraftList m_aircraftInRange; //!< aircraft, thread safe access required QMap m_reverseLookupMessages; QMap m_aircraftPartsHistory; QMap m_tempFsInnPackets; @@ -247,11 +248,11 @@ namespace BlackCore QMap m_flightPlanCache; //!< flight plan information retrieved any cached - INetwork *m_network = nullptr; //!< corresponding network interface - CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer - bool m_enableReverseLookupMsgs = false; //!< shall we log. information about the matching process - bool m_enableAircraftPartsHistory = true; //!< shall we keep a history of aircraft parts - bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal + INetwork *m_network = nullptr; //!< corresponding network interface + CAirspaceAnalyzer *m_analyzer = nullptr; //!< owned analyzer + bool m_enableReverseLookupMsgs = false; //!< shall we log. information about the matching process + bool m_enableAircraftPartsHistory = true; //!< shall we keep a history of aircraft parts + bool m_bookingsRequested = false; //!< bookings have been requested, it can happen we receive an BlackCore::Vatsim::CVatsimBookingReader::atcBookingsReadUnchanged signal // locks mutable QReadWriteLock m_lockSituations; //!< lock for situations: m_situationsByCallsign diff --git a/src/blackcore/simulatorcommon.cpp b/src/blackcore/simulatorcommon.cpp index 037b28296..a08f5dee3 100644 --- a/src/blackcore/simulatorcommon.cpp +++ b/src/blackcore/simulatorcommon.cpp @@ -79,7 +79,7 @@ namespace BlackCore } // info - CLogMessage(this).info("Initialized simulator driver %1") << m_simulatorPluginInfo.toQString(); + CLogMessage(this).info("Initialized simulator driver: '%1'") << m_simulatorPluginInfo.toQString(); } CSimulatorCommon::~CSimulatorCommon() { } @@ -94,12 +94,15 @@ namespace BlackCore { Q_ASSERT_X(remoteAircraft.hasModelString(), Q_FUNC_INFO, "Missing model string"); Q_ASSERT_X(remoteAircraft.hasCallsign(), Q_FUNC_INFO, "Missing callsign"); + + const bool renderingRestricted = m_interpolationRenderingSetup.isRenderingRestricted(); + if (this->showDebugLogMessage()) { this->debugLogMessage(Q_FUNC_INFO, QString("Restricted: %1 cs: '%2' enabled: %3").arg(boolToYesNo(renderingRestricted), remoteAircraft.getCallsignAsString(), boolToYesNo(remoteAircraft.isEnabled()))); } if (!remoteAircraft.isEnabled()) { return false; } // if not restriced, directly change - if (!m_interpolationRenderingSetup.isRenderingRestricted()) { this->physicallyAddRemoteAircraft(remoteAircraft); return true; } + if (!renderingRestricted) { this->physicallyAddRemoteAircraft(remoteAircraft); return true; } - // will be added with next snapshot ps_recalculateRenderedAircraft + // restricted -> will be added with next snapshot ps_recalculateRenderedAircraft return false; } diff --git a/src/blackcore/simulatorcommon.h b/src/blackcore/simulatorcommon.h index 19b30d5c2..268f5ae69 100644 --- a/src/blackcore/simulatorcommon.h +++ b/src/blackcore/simulatorcommon.h @@ -199,24 +199,26 @@ namespace BlackCore qint64 m_statsUpdateAircraftTimeAvgMs = 0; //!< statistics update time BlackMisc::Simulation::CSimulatorInternals m_simulatorInternals; //!< setup object BlackMisc::Simulation::CInterpolationLogger m_interpolationLogger; //!< log interpolation - BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc. mutable QReadWriteLock m_interpolationRenderingSetupMutex; //!< mutex protecting setup object + // setup for debugging, logs .. + BlackMisc::Simulation::CInterpolationAndRenderingSetup m_interpolationRenderingSetup; //!< logging, rendering etc. + // 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 QHash m_hints; //!< 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 + bool m_isWeatherActivated = false; //!< Is simulator weather activated? + BlackMisc::Geo::CCoordinateGeodetic m_lastWeatherPosition; //!< Own aircraft position at which weather was fetched and injected last BlackMisc::CSetting m_weatherScenarioSettings { this, &CSimulatorCommon::reloadWeatherSettings }; //!< Selected weather scenario //! Lookup against DB data static BlackMisc::Simulation::CAircraftModel reverseLookupModel(const BlackMisc::Simulation::CAircraftModel &model); private: - bool m_blinkCycle = false; //!< use for highlighting - qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting - int m_timerCounter = 0; //!< allows to calculate n seconds + bool m_blinkCycle = false; //!< used for highlighting + qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting + int m_timerCounter = 0; //!< allows to calculate n seconds QTimer m_oneSecondTimer {this}; //!< multi purpose timer BlackMisc::Simulation::CSimulatorPluginInfo m_simulatorPluginInfo; //!< info object BlackMisc::Simulation::CSimulatedAircraftList m_highlightedAircraft; //!< all other aircraft are to be ignored diff --git a/src/blackcore/vatsim/vatsimdatafilereader.h b/src/blackcore/vatsim/vatsimdatafilereader.h index 7cbc4a10e..7a04c9dd7 100644 --- a/src/blackcore/vatsim/vatsimdatafilereader.h +++ b/src/blackcore/vatsim/vatsimdatafilereader.h @@ -35,7 +35,6 @@ class QNetworkReply; namespace BlackMisc { namespace Simulation { class CSimulatedAircraft; } } - namespace BlackCore { namespace Vatsim