Ref T268, consider "blinking" in simulator common

This commit is contained in:
Klaus Basan
2018-07-09 22:18:57 +02:00
parent 1428d39f4b
commit 51ad984200
2 changed files with 21 additions and 9 deletions

View File

@@ -147,7 +147,7 @@ namespace BlackCore
// blink mode, toggle aircraft
for (const CSimulatedAircraft &aircraft : as_const(m_highlightedAircraft))
{
if (m_blinkCycle) { this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign()); }
if (m_blinkCycle) { this->callPhysicallyRemoveRemoteAircraft(aircraft.getCallsign(), true); }
else { this->callPhysicallyAddRemoteAircraft(aircraft); }
}
}
@@ -170,6 +170,17 @@ namespace BlackCore
}
}
void CSimulatorCommon::clearData(const CCallsign &callsign)
{
m_highlightedAircraft.removeByCallsign(callsign);
m_statsPhysicallyRemovedAircraft++;
m_clampedLogMsg.clear();
m_lastSentParts.remove(callsign);
m_lastSentSituations.remove(callsign);
m_clampedLogMsg.remove(callsign);
this->removeInterpolationSetupPerCallsign(callsign);
}
void CSimulatorCommon::reloadWeatherSettings()
{
if (!m_isWeatherActivated) { return; }
@@ -649,6 +660,7 @@ namespace BlackCore
m_statsLastUpdateAircraftRequestedMs = 0;
m_statsUpdateAircraftRequestedDeltaMs = 0;
m_statsUpdateAircraftLimited = 0;
ISimulationEnvironmentProvider::resetSimulationEnvironmentStatistics();
}
CStatusMessageList CSimulatorCommon::debugVerifyStateAfterAllAircraftRemoved() const
@@ -719,7 +731,7 @@ namespace BlackCore
Q_ASSERT_X(compare.hasCallsign(), Q_FUNC_INFO, "Need callsign");
if (!m_lastSentSituations.contains(compare.getCallsign())) { return false; }
if (compare.isNull()) { return false; }
return compare.equalPbhAndVector(m_lastSentSituations.value(compare.getCallsign()));
return compare.equalPbhVectorAltitude(m_lastSentSituations.value(compare.getCallsign()));
}
bool CSimulatorCommon::isEqualLastSent(const CAircraftParts &compare, const CCallsign &callsign) const
@@ -838,6 +850,7 @@ namespace BlackCore
m_lastSentSituations.clear();
m_updateRemoteAircraftInProgress = false;
this->clearInterpolationSetupsPerCallsign();
this->resetHighlighting();
this->resetAircraftStatistics();
}
@@ -875,13 +888,9 @@ namespace BlackCore
this->physicallyAddRemoteAircraft(remoteAircraft);
}
void CSimulatorCommon::callPhysicallyRemoveRemoteAircraft(const CCallsign &remoteCallsign)
void CSimulatorCommon::callPhysicallyRemoveRemoteAircraft(const CCallsign &remoteCallsign, bool blinking)
{
m_statsPhysicallyRemovedAircraft++;
m_clampedLogMsg.clear();
m_lastSentParts.remove(remoteCallsign);
m_lastSentSituations.remove(remoteCallsign);
m_clampedLogMsg.remove(remoteCallsign);
if (!blinking) { this->clearData(remoteCallsign); }
this->physicallyRemoveRemoteAircraft(remoteCallsign);
}

View File

@@ -203,6 +203,9 @@ namespace BlackCore
//! Restore aircraft from the provider data
void resetAircraftFromProvider(const BlackMisc::Aviation::CCallsign &callsign);
//! Clear the related data as statistics etc.
virtual void clearData(const BlackMisc::Aviation::CCallsign &callsign);
//! Set own model
void reverseLookupAndUpdateOwnAircraftModel(const BlackMisc::Simulation::CAircraftModel &model);
@@ -313,7 +316,7 @@ namespace BlackCore
// call with counters updated
void callPhysicallyAddRemoteAircraft(const BlackMisc::Simulation::CSimulatedAircraft &remoteAircraft);
void callPhysicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &remoteCallsign);
void callPhysicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &remoteCallsign, bool blinking = false);
//! Display a logged situation in simulator
void displayLoggedSituationInSimulator(const BlackMisc::Aviation::CCallsign &cs, bool stopLogging, int times = 40);