mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Stop timer based model validation after some runs
This commit is contained in:
@@ -110,6 +110,7 @@ namespace BlackMisc
|
||||
m_inWork = true;
|
||||
emit this->validating(true);
|
||||
|
||||
const bool isTimerBased = (QObject::sender() == &m_updateTimer);
|
||||
CAircraftModelList valid;
|
||||
CAircraftModelList invalid;
|
||||
CStatusMessageList msgs;
|
||||
@@ -154,11 +155,22 @@ namespace BlackMisc
|
||||
while (false);
|
||||
|
||||
m_inWork = false;
|
||||
if (isTimerBased)
|
||||
{
|
||||
m_timerBasedRuns++;
|
||||
|
||||
// stop timer after some runs
|
||||
if (m_timerBasedRuns > 3)
|
||||
{
|
||||
m_updateTimer.stop();
|
||||
}
|
||||
}
|
||||
|
||||
emit this->validating(false);
|
||||
if (validated)
|
||||
{
|
||||
const bool e = !onlyErrorsAndWarnings || (!invalid.isEmpty() || msgs.hasWarningOrErrorMessages());
|
||||
if (e) { emit this->validated(simulator, valid, invalid, wasStopped, msgs); }
|
||||
if (e || !isTimerBased) { emit this->validated(simulator, valid, invalid, wasStopped, msgs); }
|
||||
}
|
||||
}
|
||||
} // ns
|
||||
|
||||
Reference in New Issue
Block a user