mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
Ref T298, improved/fixed re-matching (match all aircraft again)
- reset to network model (otherwise we match "matched model" -> "matched model") - renamed/added functions doMtachingAgain/doMatchinsAgain in contexts
This commit is contained in:
@@ -863,7 +863,26 @@ namespace BlackCore
|
||||
m_weatherManager.requestWeatherGrid(weatherGrid, identifier);
|
||||
}
|
||||
|
||||
bool CContextSimulator::doMappingAgain(const CCallsign &callsign)
|
||||
int CContextSimulator::doMatchingsAgain()
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO; }
|
||||
const CCallsignSet callsigns = this->getAircraftInRangeCallsigns();
|
||||
if (callsigns.isEmpty()) { return 0; }
|
||||
int delayMs = 25;
|
||||
QPointer<CContextSimulator> myself(this);
|
||||
for (const CCallsign &cs : callsigns)
|
||||
{
|
||||
QTimer::singleShot(delayMs, this, [ = ]
|
||||
{
|
||||
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
||||
this->doMatchingAgain(cs);
|
||||
});
|
||||
delayMs += 25;
|
||||
}
|
||||
return callsigns.size();
|
||||
}
|
||||
|
||||
bool CContextSimulator::doMatchingAgain(const CCallsign &callsign)
|
||||
{
|
||||
if (m_debugEnabled) { CLogMessage(this, CLogCategory::contextSlot()).debug() << Q_FUNC_INFO << callsign.asString(); }
|
||||
if (!this->isAircraftInRange(callsign)) { return false; }
|
||||
@@ -872,10 +891,12 @@ namespace BlackCore
|
||||
QPointer<CContextSimulator> myself(this);
|
||||
QTimer::singleShot(2500, this, [ = ]
|
||||
{
|
||||
if (!myself) { return; }
|
||||
if (!sApp || sApp->isShuttingDown() || !myself) { return; }
|
||||
const CSimulatedAircraft aircraft = this->getAircraftInRangeForCallsign(callsign);
|
||||
if (!aircraft.hasCallsign()) { return; } // no longer valid
|
||||
this->xCtxAddedRemoteAircraftReadyForModelMatching(aircraft);
|
||||
CSimulatedAircraft resetAircraft(aircraft);
|
||||
resetAircraft.resetToNetworkModel();
|
||||
this->xCtxAddedRemoteAircraftReadyForModelMatching(resetAircraft);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user