1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1897 Adopt FTT's suggestion that make warning dialog for Ground Vehicle when it's neccesary and omit confusing texts

This commit is contained in:
samguns 2015-05-20 15:50:25 +08:00
parent 364409a367
commit 501e2e09de

View File

@ -1703,23 +1703,16 @@ void ConfigInputWidget::simpleCalibration(bool enable)
} else {
manualCommandData = manualCommandObj->getData();
manualSettingsData = manualSettingsObj->getData();
systemSettingsData = systemSettingsObj->getData();
QMessageBox::StandardButton reply;
reply = QMessageBox::question(this, tr("Ground vehicle"),
tr("<p>Are you configuring a transmitter for your <b>ground vehicle</b> with reversible motor<br>"
"controlled by throttle stick?</p>"
"<p>If so, please make sure you've centered throttle control and press <b>Yes</b> button. Otherwise, press No.</p>"
"<p>Attention, if you press <b>Yes</b>, then the <b>Flight Mode Count</b> will be set to 1.</p>"),
QMessageBox::Yes | QMessageBox::No);
if (systemSettingsData.AirframeType == SystemSettings::AIRFRAMETYPE_GROUNDVEHICLECAR) {
QMessageBox::warning(this, tr("Ground vehicle"),
tr("<p>Please <b>center</b> throttle control and"
" press <b>OK</b> when ready."));
if (reply == QMessageBox::Yes) {
transmitterType = ground;
manualSettingsData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] =
manualCommandData.Channel[ManualControlSettings::CHANNELNUMBER_THROTTLE];
/* Make sure to tell controller, this is really a ground vehicle. */
systemSettingsData = systemSettingsObj->getData();
systemSettingsData.AirframeType = SystemSettings::AIRFRAMETYPE_GROUNDVEHICLECAR;
systemSettingsObj->setData(systemSettingsData);
}
restoreMdataSingle(manualCommandObj, &manualControlMdata);