From 30a40140be8014aebc6867cba1a075eed9e00637 Mon Sep 17 00:00:00 2001 From: samguns Date: Wed, 18 Mar 2015 23:00:17 +0800 Subject: [PATCH] OP-1781 Minor changes according to review results. Leave the stick don't move and 1 flight mode issues to tomorrow --- .../src/plugins/config/configinputwidget.cpp | 27 ++++++++++--------- .../src/plugins/config/input_wizard.ui | 6 ++--- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 1c0ec9edf..7cfd0b541 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -901,12 +901,16 @@ void ConfigInputWidget::setChannel(int newChan) void ConfigInputWidget::nextChannel() { QList order; - if (transmitterType == heli) { + switch (transmitterType) { + case heli: order = heliChannelOrder; - } else if (transmitterType == ground) { + break; + case ground: order = groundChannelOrder; - } else { + break; + default: order = acroChannelOrder; + break; } if (currentChannelNum == -1) { @@ -1677,16 +1681,15 @@ void ConfigInputWidget::simpleCalibration(bool enable) manualCommandData = manualCommandObj->getData(); manualSettingsData = manualSettingsObj->getData(); - QMessageBox msgBox; - QPushButton *yesButton = msgBox.addButton(tr("Yes"), QMessageBox::YesRole); - QPushButton *noButton = msgBox.addButton(tr("No"), QMessageBox::NoRole); - msgBox.setText(tr("

Are you configuring a transmitter for your ground vehicle with reversible motor
" - "controlled by throttle stick?

" - "

If so, please make sure you've centered throttle control and press Yes button. Otherwise, press No.

")); - msgBox.setDefaultButton(noButton); - msgBox.exec(); + QMessageBox::StandardButton reply; + reply = QMessageBox::question(this, tr("Ground vehicle"), + tr("

Are you configuring a transmitter for your ground vehicle with reversible motor
" + "controlled by throttle stick?

" + "

If so, please make sure you've centered throttle control and press Yes button. Otherwise, press No.

" + "

Attention, if you press Yes, then the flight modes will be set to 1.

"), + QMessageBox::Yes | QMessageBox::No); - if (msgBox.clickedButton() == yesButton) { + if (reply == QMessageBox::Yes) { transmitterType = ground; manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = manualCommandData.Channel[ManualControlSettings::CHANNELNUMBER_THROTTLE]; diff --git a/ground/openpilotgcs/src/plugins/config/input_wizard.ui b/ground/openpilotgcs/src/plugins/config/input_wizard.ui index d3150bbb8..51836cc39 100644 --- a/ground/openpilotgcs/src/plugins/config/input_wizard.ui +++ b/ground/openpilotgcs/src/plugins/config/input_wizard.ui @@ -14,7 +14,7 @@ - 0 + 1 @@ -67,7 +67,7 @@ You can press 'back' at any time to return to the previous screen or press 'Canc - Surface: has reversible motor controlled by throttle stick + Surface: has reversible motor controlled by throttle stick, plus yaw control (2 channels) @@ -81,7 +81,7 @@ You can press 'back' at any time to return to the previous screen or press 'Canc - If selecting the Helicopter option, please engage throttle hold now. + <html><head/><body><p>If selecting the Helicopter option, please engage throttle hold now.</p><p>If selecting the Surface option, the flight mode will be set to be only one mode.</p></body></html> true