diff --git a/src/VehicleSetup/SetupView.cc b/src/VehicleSetup/SetupView.cc index 3718e290e192f437525051be3562164f0568a1a8..9149f1db09f92f869ce7e65b98840d8730344887 100644 --- a/src/VehicleSetup/SetupView.cc +++ b/src/VehicleSetup/SetupView.cc @@ -33,6 +33,7 @@ #include "ParameterEditor.h" #include "SetupWidgetHolder.h" #include "MainWindow.h" +#include "QGCMessageBox.h" #include #include @@ -117,6 +118,11 @@ void SetupView::_setConnectedView(void) void SetupView::_firmwareButtonClicked(void) { + if (_uasCurrent->isArmed()) { + QGCMessageBox::warning("Setup", "Firmware Update cannot be performed while vehicle is armed."); + return; + } + SetupWidgetHolder* dialog = new SetupWidgetHolder(MainWindow::instance()); dialog->setModal(true); dialog->setWindowTitle("Firmware Upgrade"); @@ -139,9 +145,20 @@ void SetupView::_parametersButtonClicked(void) void SetupView::_setupButtonClicked(const QVariant& component) { + if (_uasCurrent->isArmed()) { + QGCMessageBox::warning("Setup", "Setup cannot be performed while vehicle is armed."); + return; + } + VehicleComponent* vehicle = qobject_cast(component.value()); Q_ASSERT(vehicle); + QString setupPrereq = vehicle->prerequisiteSetup(); + if (!setupPrereq.isEmpty()) { + QGCMessageBox::warning("Setup", QString("%1 setup must be completed prior to %2 setup.").arg(setupPrereq).arg(vehicle->name())); + return; + } + SetupWidgetHolder dialog(MainWindow::instance()); dialog.setModal(true); dialog.setWindowTitle(vehicle->name());