From 4326a323e44bfd84df0a198c0a6cdccd3296ed10 Mon Sep 17 00:00:00 2001 From: peabody124 Date: Tue, 29 Mar 2011 00:15:56 +0000 Subject: [PATCH] OP-353: Display confirmation when testing motors advising to remove propellors git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@3098 ebee16cc-31ac-478f-84a7-5cbb03baadba --- .../src/plugins/config/configoutputwidget.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 064b8a9b7..41ad3e141 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -35,6 +35,7 @@ #include #include #include +#include ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(parent) { @@ -190,6 +191,21 @@ void ConfigOutputWidget::enableControls(bool enable) */ void ConfigOutputWidget::runChannelTests(bool state) { + // Confirm this is definitely what they want + if(state) { + QMessageBox mbox; + mbox.setText(QString(tr("This option will requires you to be in the armed state and will start your motors by the amount selected on the sliders. It is recommended to remove any blades from motors. Are you sure you want to do this?"))); + mbox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); + int retval = mbox.exec(); + if(retval != QMessageBox::Yes) { + state = false; + qDebug() << "Cancelled"; + m_config->channelOutTest->setChecked(false); + return; + } + } + + qDebug() << "Running with state " << state; ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject();