diff --git a/src/FactSystem/ParameterLoader.cc b/src/FactSystem/ParameterLoader.cc index 0ce0f243f54776c106d0cd7adda4bfb87ed80432..97d658b49f79d8f98bdc9d5dc3ce3868e337038b 100644 --- a/src/FactSystem/ParameterLoader.cc +++ b/src/FactSystem/ParameterLoader.cc @@ -112,7 +112,7 @@ void ParameterLoader::_parameterUpdate(int uasId, int componentId, QString param #if 0 // Handy for testing retry logic static int counter = 0; - if (counter++ & 0x3) { + if (counter++ & 0x8) { qCDebug(ParameterLoaderLog) << "Artificial discard" << counter; return; } @@ -132,9 +132,6 @@ void ParameterLoader::_parameterUpdate(int uasId, int componentId, QString param } _dataMutex.lock(); - // Restart our waiting for param timer - _waitingParamTimeoutTimer.start(); - // Update our total parameter counts if (!_paramCountMap.contains(componentId)) { _paramCountMap[componentId] = parameterCount; @@ -170,6 +167,14 @@ void ParameterLoader::_parameterUpdate(int uasId, int componentId, QString param componentParamsComplete = true; } + if (_waitingReadParamIndexMap[componentId].contains(parameterId) || + _waitingReadParamNameMap[componentId].contains(parameterName) || + _waitingWriteParamNameMap[componentId].contains(parameterName)) { + // We were waiting for this parameter, restart wait timer. Otherwise it is a spurious parameter update which + // means we should not reset the wait timer. + _waitingParamTimeoutTimer.start(); + } + // Remove this parameter from the waiting lists _waitingReadParamIndexMap[componentId].remove(parameterId); _waitingReadParamNameMap[componentId].remove(parameterName);