diff --git a/src/blackcore/context/contextsimulator.h b/src/blackcore/context/contextsimulator.h index ee7dd65af..a2ef2f397 100644 --- a/src/blackcore/context/contextsimulator.h +++ b/src/blackcore/context/contextsimulator.h @@ -291,9 +291,6 @@ namespace BlackCore::Context //! Enable mapping logging virtual void enableMatchingMessages(BlackMisc::Simulation::MatchingLog enabled) = 0; - //! Highlight aircraft in simulator - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) = 0; - //! Follow aircraft im simulator view virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) = 0; diff --git a/src/blackcore/context/contextsimulatorempty.h b/src/blackcore/context/contextsimulatorempty.h index 93ea70884..8d85f77a7 100644 --- a/src/blackcore/context/contextsimulatorempty.h +++ b/src/blackcore/context/contextsimulatorempty.h @@ -291,15 +291,6 @@ namespace BlackCore::Context return BlackMisc::CPixmap(); } - //! \copydoc IContextSimulator::highlightAircraft - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override - { - Q_UNUSED(aircraftToHighlight) - Q_UNUSED(enableHighlight) - Q_UNUSED(displayTime) - logEmptyContextWarning(Q_FUNC_INFO); - } - //! \copydoc IContextSimulator::followAircraft virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) override { diff --git a/src/blackcore/context/contextsimulatorimpl.cpp b/src/blackcore/context/contextsimulatorimpl.cpp index cebf236a3..7ee52978f 100644 --- a/src/blackcore/context/contextsimulatorimpl.cpp +++ b/src/blackcore/context/contextsimulatorimpl.cpp @@ -1109,13 +1109,6 @@ namespace BlackCore::Context return m_simulatorPlugin.second; } - void CContextSimulator::highlightAircraft(const CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const CTime &displayTime) - { - if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << aircraftToHighlight << enableHighlight << displayTime; } - if (!m_simulatorPlugin.second) { return; } - m_simulatorPlugin.second->highlightAircraft(aircraftToHighlight, enableHighlight, displayTime); - } - bool CContextSimulator::followAircraft(const CCallsign &callsign) { if (m_debugEnabled) { CLogMessage(this, CLogCategories::contextSlot()).debug() << Q_FUNC_INFO << callsign; } diff --git a/src/blackcore/context/contextsimulatorimpl.h b/src/blackcore/context/contextsimulatorimpl.h index a7a254e1c..3e9c6b348 100644 --- a/src/blackcore/context/contextsimulatorimpl.h +++ b/src/blackcore/context/contextsimulatorimpl.h @@ -177,9 +177,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextSimulator::iconForModel virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override; - //! \copydoc BlackCore::Context::IContextSimulator::highlightAircraft - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override; - //! \copydoc BlackCore::Context::IContextSimulator::followAircraft virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) override; diff --git a/src/blackcore/context/contextsimulatorproxy.cpp b/src/blackcore/context/contextsimulatorproxy.cpp index 50ecd680f..e8ab0e1e4 100644 --- a/src/blackcore/context/contextsimulatorproxy.cpp +++ b/src/blackcore/context/contextsimulatorproxy.cpp @@ -284,11 +284,6 @@ namespace BlackCore::Context return m_dBusInterface->callDBusRet(QLatin1String("iconForModel"), modelString); } - void CContextSimulatorProxy::highlightAircraft(const CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const CTime &displayTime) - { - m_dBusInterface->callDBus(QLatin1String("highlightAircraft"), aircraftToHighlight, enableHighlight, displayTime); - } - bool CContextSimulatorProxy::followAircraft(const CCallsign &callsign) { return m_dBusInterface->callDBusRet(QLatin1String("followAircraft"), callsign); diff --git a/src/blackcore/context/contextsimulatorproxy.h b/src/blackcore/context/contextsimulatorproxy.h index 65f1787c3..e8759cbf2 100644 --- a/src/blackcore/context/contextsimulatorproxy.h +++ b/src/blackcore/context/contextsimulatorproxy.h @@ -165,9 +165,6 @@ namespace BlackCore //! \copydoc BlackCore::Context::IContextSimulator::iconForModel virtual BlackMisc::CPixmap iconForModel(const QString &modelString) const override; - //! \copydoc BlackCore::Context::IContextSimulator::highlightAircraft - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override; - //! \copydoc BlackCore::Context::IContextSimulator::followAircraft virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign) override; diff --git a/src/blackcore/simulator.cpp b/src/blackcore/simulator.cpp index eddb511fe..ff2f88444 100644 --- a/src/blackcore/simulator.cpp +++ b/src/blackcore/simulator.cpp @@ -101,18 +101,6 @@ namespace BlackCore return false; } - void ISimulator::highlightAircraft(const CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const CTime &displayTime) - { - const CCallsign cs(aircraftToHighlight.getCallsign()); - m_highlightedAircraft.removeByCallsign(cs); - if (enableHighlight) - { - const qint64 deltaT = displayTime.valueInteger(CTimeUnit::ms()); - m_highlightEndTimeMsEpoch = QDateTime::currentMSecsSinceEpoch() + deltaT; - m_highlightedAircraft.push_back(aircraftToHighlight); - } - } - bool ISimulator::followAircraft(const CCallsign &callsign) { Q_UNUSED(callsign) @@ -202,7 +190,6 @@ namespace BlackCore m_updateRemoteAircraftInProgress = false; this->clearInterpolationSetupsPerCallsign(); - this->resetHighlighting(); this->resetAircraftStatistics(); } @@ -248,7 +235,6 @@ namespace BlackCore void ISimulator::clearData(const CCallsign &callsign) { - m_highlightedAircraft.removeByCallsign(callsign); m_statsPhysicallyRemovedAircraft++; m_lastSentParts.remove(callsign); m_lastSentSituations.remove(callsign); @@ -307,32 +293,6 @@ namespace BlackCore m_updateAllRemoteAircraftUntil = -1; } - void ISimulator::resetHighlighting() - { - m_highlightedAircraft.clear(); - m_blinkCycle = false; - m_highlightEndTimeMsEpoch = false; - } - - void ISimulator::stopHighlighting() - { - // restore - const CSimulatedAircraftList highlightedAircraft(m_highlightedAircraft); - for (const CSimulatedAircraft &aircraft : highlightedAircraft) - { - // get the current state for this aircraft - // it might has been removed in the meantime - const CCallsign cs(aircraft.getCallsign()); - this->resetAircraftFromProvider(cs); - } - this->resetHighlighting(); - } - - void ISimulator::oneSecondTimerTimeout() - { - this->blinkHighlightedAircraft(); - } - void ISimulator::safeKillTimer() { if (m_timerId < 0) { return; } @@ -346,26 +306,6 @@ namespace BlackCore Q_UNUSED(weatherGrid) } - void ISimulator::blinkHighlightedAircraft() - { - if (m_highlightedAircraft.isEmpty() || m_highlightEndTimeMsEpoch < 1) { return; } - if (this->isShuttingDown()) { return; } - m_blinkCycle = !m_blinkCycle; - - if (QDateTime::currentMSecsSinceEpoch() > m_highlightEndTimeMsEpoch) - { - this->stopHighlighting(); - return; - } - - // blink mode, toggle aircraft - for (const CSimulatedAircraft &aircraft : std::as_const(m_highlightedAircraft)) - { - if (m_blinkCycle) { this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign(), true); } - else { this->callPhysicallyAddRemoteAircraft(aircraft); } - } - } - CInterpolationAndRenderingSetupPerCallsign ISimulator::getInterpolationSetupConsolidated(const CCallsign &callsign, bool forceFullUpdate) const { CInterpolationAndRenderingSetupPerCallsign setup = this->getInterpolationSetupPerCallsignOrDefault(callsign); @@ -759,11 +699,6 @@ namespace BlackCore [](const Aviation::CCallsign &) { /* currently not used, the calls are handled by context call logicallyRemoveRemoteAircraft*/ }, [this](const CAirspaceAircraftSnapshot &snapshot) { this->rapOnRecalculatedRenderedAircraft(snapshot); })); - // timer - connect(&m_oneSecondTimer, &QTimer::timeout, this, &ISimulator::oneSecondTimerTimeout); - m_oneSecondTimer.setObjectName(this->objectName().append(":m_oneSecondTimer")); - m_oneSecondTimer.start(1000); - // swift data if (sApp && sApp->hasWebDataServices()) { @@ -860,7 +795,6 @@ namespace BlackCore int ISimulator::physicallyRemoveMultipleRemoteAircraft(const CCallsignSet &callsigns) { if (callsigns.isEmpty()) { return 0; } - this->stopHighlighting(); int removed = 0; for (const CCallsign &callsign : callsigns) { @@ -1128,7 +1062,6 @@ namespace BlackCore if (this->isShuttingDown()) { return false; } if (callsign.isEmpty()) { return false; } - this->stopHighlighting(); this->logicallyRemoveRemoteAircraft(callsign); if (!this->isAircraftInRange(callsign)) { return false; } const QPointer myself(this); @@ -1322,9 +1255,9 @@ namespace BlackCore this->physicallyAddRemoteAircraft(remoteAircraft); } - void ISimulator::callPhysicallyRemoveRemoteAircraft(const CCallsign &remoteCallsign, bool blinking) + void ISimulator::callPhysicallyRemoveRemoteAircraft(const CCallsign &remoteCallsign) { - if (!blinking) { this->clearData(remoteCallsign); } + this->clearData(remoteCallsign); this->physicallyRemoveRemoteAircraft(remoteCallsign); } diff --git a/src/blackcore/simulator.h b/src/blackcore/simulator.h index a06d20cb1..a63cd35b2 100644 --- a/src/blackcore/simulator.h +++ b/src/blackcore/simulator.h @@ -153,9 +153,6 @@ namespace BlackCore //! This shall only return aircraft handled in the simulator virtual BlackMisc::Aviation::CCallsignSet physicallyRenderedAircraft() const = 0; - //! Highlight the aircraft for given time (or disable highlight) - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime); - //! Follow aircraft virtual bool followAircraft(const BlackMisc::Aviation::CCallsign &callsign); @@ -498,21 +495,9 @@ namespace BlackCore //! Reset void resetUpdateAllRemoteAircraft(); - //! Reset highlighting - void resetHighlighting(); - - //! Restore all highlighted aircraft - void stopHighlighting(); - - //! Slow timer used to highlight aircraft, can be used for other things too - virtual void oneSecondTimerTimeout(); - //! Kill timer if id is valid void safeKillTimer(); - //! Blink the highlighted aircraft - void blinkHighlightedAircraft(); - //! Equal to last sent situation bool isEqualLastSent(const BlackMisc::Aviation::CAircraftSituation &compare) const; @@ -619,7 +604,7 @@ namespace BlackCore // call with counters updated void callPhysicallyAddRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft); - void callPhysicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &remoteCallsign, bool blinking = false); + void callPhysicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &remoteCallsign); //! Display a logged situation in simulator void displayLoggedSituationInSimulator(const BlackMisc::Aviation::CCallsign &cs, bool stopLogging, int times = 40); @@ -629,14 +614,6 @@ namespace BlackCore int m_statsPhysicallyAddedAircraft = 0; //!< statistics, how many aircraft added int m_statsPhysicallyRemovedAircraft = 0; //!< statistics, how many aircraft removed - // highlighting - bool m_blinkCycle = false; //!< used for highlighting - qint64 m_highlightEndTimeMsEpoch = 0; //!< end highlighting - BlackMisc::Simulation::CSimulatedAircraftList m_highlightedAircraft; //!< all other aircraft are to be ignored - - // timer - QTimer m_oneSecondTimer; //!< multi purpose timer with 1 sec. interval - // misc. bool m_networkConnected = false; //!< flight network connected bool m_test = false; //!< test mode? diff --git a/src/blackgui/views/simulatedaircraftview.cpp b/src/blackgui/views/simulatedaircraftview.cpp index 0ce60693c..b34e894c0 100644 --- a/src/blackgui/views/simulatedaircraftview.cpp +++ b/src/blackgui/views/simulatedaircraftview.cpp @@ -115,9 +115,6 @@ namespace BlackGui::Views } menuActions.addAction(CIcons::appAircraft16(), "Zero 0 pitch on ground", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::request0PitchOnGround }); menuActions.addAction(CIcons::appAircraft16(), "Remove pitch manipulation", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::requestNullPitchOnGround }); - - if (!menuActions.isEmpty()) { menuActions.addSeparator(CMenuAction::pathClientSimulationDisplay()); } - menuActions.addAction(CIcons::appSimulator16(), "Highlight in simulator", CMenuAction::pathClientSimulationDisplay(), { this, &CSimulatedAircraftView::requestHighlightInSimulator }); } if (m_withMenuEnableGndFlag) { @@ -169,13 +166,6 @@ namespace BlackGui::Views this->updateAircraftSupportingGndFLag(aircraft); } - void CSimulatedAircraftView::requestHighlightInSimulator() - { - const CSimulatedAircraft aircraft(this->selectedObject()); - if (aircraft.getCallsign().isEmpty()) { return; } - this->highlightInSimulator(aircraft); - } - void CSimulatedAircraftView::requestFollowInSimulator() { const CSimulatedAircraft aircraft(this->selectedObject()); @@ -306,13 +296,6 @@ namespace BlackGui::Views return netContext->isRemoteAircraftSupportingParts(cs); } - void CSimulatedAircraftView::highlightInSimulator(const CSimulatedAircraft &aircraft) - { - IContextSimulator *simContext = simulatorContext(); - if (!simContext) { return; } - simContext->highlightAircraft(aircraft, true, IContextSimulator::HighlightTime()); - } - void CSimulatedAircraftView::recalculateAllAircraft() { IContextSimulator *simContext = simulatorContext(); diff --git a/src/blackgui/views/simulatedaircraftview.h b/src/blackgui/views/simulatedaircraftview.h index aea5adb4b..f9dfbeeb1 100644 --- a/src/blackgui/views/simulatedaircraftview.h +++ b/src/blackgui/views/simulatedaircraftview.h @@ -84,9 +84,6 @@ namespace BlackGui //! Enable gnd. flag (enable gnd flag capability for given aircraft) void toggleSupportingGndFlag(); - //! Highlight aircraft in simulator - void requestHighlightInSimulator(); - //! Follow in simulator void requestFollowInSimulator(); @@ -132,9 +129,6 @@ namespace BlackGui //! Aircraft supporting parts? bool isSupportingAircraftParts(const BlackMisc::Aviation::CCallsign &cs) const; - //! Highlight in simulator - void highlightInSimulator(const BlackMisc::Simulation::CSimulatedAircraft &aircraft); - //! Fully recalculate all aircraft void recalculateAllAircraft(); diff --git a/src/plugins/simulator/emulated/simulatoremulated.cpp b/src/plugins/simulator/emulated/simulatoremulated.cpp index fe00a8e4f..7aa923795 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.cpp +++ b/src/plugins/simulator/emulated/simulatoremulated.cpp @@ -249,12 +249,6 @@ namespace BlackSimPlugin::Emulated return true; } - void CSimulatorEmulated::highlightAircraft(const CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const CTime &displayTime) - { - if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, aircraftToHighlight.toQString(), boolToTrueFalse(enableHighlight), displayTime.toQString()); } - ISimulator::highlightAircraft(aircraftToHighlight, enableHighlight, displayTime); - } - bool CSimulatorEmulated::parseCommandLine(const QString &commandLine, const CIdentifier &originator) { if (canLog()) { m_monitorWidget->appendReceivingCall(Q_FUNC_INFO, commandLine, originator.toQString()); } diff --git a/src/plugins/simulator/emulated/simulatoremulated.h b/src/plugins/simulator/emulated/simulatoremulated.h index e1434ae61..4737725d9 100644 --- a/src/plugins/simulator/emulated/simulatoremulated.h +++ b/src/plugins/simulator/emulated/simulatoremulated.h @@ -70,7 +70,6 @@ namespace BlackSimPlugin::Emulated virtual void injectWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid) override; // ----- functions just logged ------- - virtual void highlightAircraft(const BlackMisc::Simulation::CSimulatedAircraft &aircraftToHighlight, bool enableHighlight, const BlackMisc::PhysicalQuantities::CTime &displayTime) override; virtual bool logicallyAddRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft) override; virtual bool logicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override; virtual int physicallyRemoveMultipleRemoteAircraft(const BlackMisc::Aviation::CCallsignSet &callsigns) override; diff --git a/src/plugins/simulator/fs9/simulatorfs9.cpp b/src/plugins/simulator/fs9/simulatorfs9.cpp index ffd11f4fc..0520ffba7 100644 --- a/src/plugins/simulator/fs9/simulatorfs9.cpp +++ b/src/plugins/simulator/fs9/simulatorfs9.cpp @@ -196,7 +196,6 @@ namespace BlackSimPlugin::Fs9 int CSimulatorFs9::physicallyRemoveAllRemoteAircraft() { - resetHighlighting(); if (m_hashFs9Clients.isEmpty()) { return 0; } QList callsigns(m_hashFs9Clients.keys()); int r = 0; diff --git a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp index 13a5d9307..66be92fb1 100644 --- a/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp +++ b/src/plugins/simulator/fsxcommon/simulatorfsxcommon.cpp @@ -1852,7 +1852,6 @@ namespace BlackSimPlugin::FsxCommon { // make sure they are not added again // cleaning here is somewhat redundant, but double checks - this->resetHighlighting(); m_addPendingAircraft.clear(); m_addAgainAircraftWhenRemoved.clear();