mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
Ref T298, prepared function to "redo" a mapping
This commit is contained in:
@@ -242,6 +242,9 @@ namespace BlackCore
|
||||
//! Request weather grid. Argument identifier is past in the signal to identify the requestor
|
||||
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) = 0;
|
||||
|
||||
//! Repeat the mapping
|
||||
virtual bool doMappingAgain(const BlackMisc::Aviation::CCallsign &callsign) = 0;
|
||||
|
||||
//! Current matching statistics
|
||||
virtual BlackMisc::Simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const = 0;
|
||||
|
||||
|
||||
@@ -238,6 +238,13 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::doMappingAgain
|
||||
virtual bool doMappingAgain(const BlackMisc::Aviation::CCallsign &callsign) override
|
||||
{
|
||||
Q_UNUSED(callsign);
|
||||
return false;
|
||||
}
|
||||
|
||||
//! \copydoc IContextSimulator::setWeatherActivated
|
||||
virtual void setWeatherActivated(bool activated) override
|
||||
{
|
||||
|
||||
@@ -854,6 +854,23 @@ namespace BlackCore
|
||||
m_weatherManager.requestWeatherGrid(weatherGrid, identifier);
|
||||
}
|
||||
|
||||
bool CContextSimulator::doMappingAgain(const CCallsign &callsign)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign.asString(); }
|
||||
if (!this->isAircraftInRange(callsign)) { return false; }
|
||||
if (!this->isSimulatorAvailable()) { return false; }
|
||||
|
||||
QPointer<CContextSimulator> myself(this);
|
||||
QTimer::singleShot(2500, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
const CSimulatedAircraft aircraft = this->getAircraftInRangeForCallsign(callsign);
|
||||
if (!aircraft.hasCallsign()) { return; } // no longer valid
|
||||
this->xCtxAddedRemoteAircraftReadyForModelMatching(aircraft);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
void CContextSimulator::onSimulatorStarted(const CSimulatorPluginInfo &info)
|
||||
{
|
||||
this->stopSimulatorListeners();
|
||||
|
||||
@@ -101,6 +101,7 @@ namespace BlackCore
|
||||
virtual bool resetToModelMatchingAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual void setWeatherActivated(bool activated) override;
|
||||
virtual void requestWeatherGrid(const BlackMisc::Weather::CWeatherGrid &weatherGrid, const BlackMisc::CIdentifier &identifier) override;
|
||||
virtual bool doMappingAgain(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual BlackMisc::CStatusMessageList getMatchingMessages(const BlackMisc::Aviation::CCallsign &callsign) const override;
|
||||
virtual bool isMatchingMessagesEnabled() const override;
|
||||
virtual void enableMatchingMessages(bool enabled) override;
|
||||
|
||||
@@ -91,6 +91,7 @@ namespace BlackCore
|
||||
virtual bool isMatchingMessagesEnabled() const override;
|
||||
virtual void enableMatchingMessages(bool enabled) override;
|
||||
virtual bool parseCommandLine(const QString &commandLine, const BlackMisc::CIdentifier &originator) override;
|
||||
virtual bool doMappingAgain(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
virtual BlackMisc::Simulation::CMatchingStatistics getCurrentMatchingStatistics(bool missingOnly) const override;
|
||||
virtual void setMatchingSetup(const BlackMisc::Simulation::CAircraftMatcherSetup &setup) override;
|
||||
virtual BlackMisc::Simulation::CAircraftMatcherSetup getMatchingSetup() const override;
|
||||
|
||||
Reference in New Issue
Block a user