Commit f1196e14 authored by Don Gagne's avatar Don Gagne

Show vehicle errors after parameter load

parent fa12589e
......@@ -758,20 +758,25 @@ void ParameterLoader::_checkInitialLoadComplete(void)
UASMessageHandler* msgHandler = UASMessageHandler::instance();
if (msgHandler->getErrorCountTotal()) {
QString errors;
bool firstError = true;
msgHandler->lockAccess();
foreach (UASMessage* msg, msgHandler->messages()) {
if (msg->severityIsError()) {
if (!firstError) {
errors += "\n";
}
errors += " - ";
errors += msg->getText();
errors += "\n";
firstError = false;
}
}
msgHandler->unlockAccess();
QGCMessageBox::critical("Vehicle startup errors",
QString("Errors were detected during vehicle startup:\n"
"%1"
"You should resolve these prior to flight.").arg(errors));
if (!firstError) {
QString errorMsg = QString("Errors were detected during vehicle startup. You should resolve these prior to flight.\n%1").arg(errors);
qgcApp()->showToolBarMessage(errorMsg);
}
}
// Warn of parameter load failure
......
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