1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

Merge branch 'master' into OP-423_Mathieu_Change_Init_To_Reduce_Memory_Footprint

This commit is contained in:
Mathieu Rondonneau 2011-06-13 18:51:22 -07:00
commit 0e6abd4f39

View File

@ -37,6 +37,7 @@
#include <QtGui/QPushButton> #include <QtGui/QPushButton>
#include <QDesktopServices> #include <QDesktopServices>
#include <QUrl> #include <QUrl>
#include <QMessageBox>
#include "manualcontrolsettings.h" #include "manualcontrolsettings.h"
@ -494,15 +495,34 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand)
} }
obj->updated(); obj->updated();
// OP-534: make sure the airframe can NEVER arm
obj = dynamic_cast<UAVDataObject*>(getObjectManager()->getObject(QString("ManualControlSettings")));
field = obj->getField("Arming");
field->setValue("Always Disarmed");
obj->updated();
// Last, make sure the user won't apply/save during calibration // Last, make sure the user won't apply/save during calibration
m_config->saveRCInputToRAM->setEnabled(false); m_config->saveRCInputToRAM->setEnabled(false);
m_config->saveRCInputToSD->setEnabled(false); m_config->saveRCInputToSD->setEnabled(false);
// Reset all slider values to zero
field = controlCommand->getField(QString("Channel"));
for (int i = 0; i < 8; i++)
updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked());
firstUpdate = false;
// Tell a few things to the user:
QMessageBox msgBox;
msgBox.setText(tr("Arming Settings are now set to Always Disarmed for your safety."));
msgBox.setDetailedText(tr("You will have to reconfigure arming settings yourself afterwards."));
msgBox.setStandardButtons(QMessageBox::Ok);
msgBox.setDefaultButton(QMessageBox::Ok);
msgBox.exec();
} }
field = controlCommand->getField(QString("Channel")); field = controlCommand->getField(QString("Channel"));
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked()); updateChannelInSlider(inSliders[i], inMinLabels[i], inMaxLabels[i], field->getValue(i).toInt(),inRevCheckboxes[i]->isChecked());
firstUpdate = false;
} }
else { else {
if (!firstUpdate) { if (!firstUpdate) {