Commit 16e91924 authored by Don Gagne's avatar Don Gagne

Merge pull request #3005 from DonLakeFlyer/MoreCompass

Better param reset for APM compass cal
parents bbdf6dde 23acfb63
......@@ -624,21 +624,17 @@ void APMCompassCal::startCalibration(void)
const char* deviceIdParam = CalWorkerThread::rgCompassParams[i][3];
if (plugin->parameterExists(-1, deviceIdParam)) {
if (plugin->getParameterFact(-1, deviceIdParam)->rawValue().toInt() > 0) {
_calWorkerThread->rgCompassAvailable[i] = plugin->getParameterFact(-1, deviceIdParam)->rawValue().toInt() > 0;
for (int j=0; j<3; j++) {
const char* offsetParam = CalWorkerThread::rgCompassParams[i][j];
if (plugin->parameterExists(-1, offsetParam)) {
Fact* paramFact = plugin->getParameterFact(-1, offsetParam);
_rgSavedCompassOffsets[i][j] = paramFact->rawValue().toFloat();
paramFact->setRawValue(0.0);
goto has_compass;
}
}
}
}
} else {
_calWorkerThread->rgCompassAvailable[i] = false;
has_compass:
}
qCDebug(APMCompassCalLog) << QStringLiteral("Compass %1 available: %2").arg(i).arg(_calWorkerThread->rgCompassAvailable[i]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment