mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-16 08:29:15 +01:00
OP-1512 Added security questions to esc setup wizard.
This commit is contained in:
parent
f6e4e72ec2
commit
9b6f1a7d31
@ -41,6 +41,10 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked()));
|
||||
|
||||
connect(ui->securityCheckBox1, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
|
||||
connect(ui->securityCheckBox2, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
|
||||
connect(ui->securityCheckBox3, SIGNAL(toggled(bool)), this, SLOT(securityCheckBoxesToggled()));
|
||||
}
|
||||
|
||||
EscCalibrationPage::~EscCalibrationPage()
|
||||
@ -59,9 +63,19 @@ void EscCalibrationPage::enableButtons(bool enable)
|
||||
getWizard()->button(QWizard::CancelButton)->setEnabled(enable);
|
||||
getWizard()->button(QWizard::BackButton)->setEnabled(enable);
|
||||
getWizard()->button(QWizard::CustomButton1)->setEnabled(enable);
|
||||
ui->securityCheckBox1->setEnabled(enable);
|
||||
ui->securityCheckBox2->setEnabled(enable);
|
||||
ui->securityCheckBox3->setEnabled(enable);
|
||||
QApplication::processEvents();
|
||||
}
|
||||
|
||||
void EscCalibrationPage::resetAllSecurityCheckboxes()
|
||||
{
|
||||
ui->securityCheckBox1->setChecked(false);
|
||||
ui->securityCheckBox2->setChecked(false);
|
||||
ui->securityCheckBox3->setChecked(false);
|
||||
}
|
||||
|
||||
void EscCalibrationPage::startStopButtonClicked()
|
||||
{
|
||||
if (!m_isCalibrating) {
|
||||
@ -74,7 +88,7 @@ void EscCalibrationPage::startStopButtonClicked()
|
||||
MixerSettings *mSettings = MixerSettings::GetInstance(uavoManager);
|
||||
Q_ASSERT(mSettings);
|
||||
QString mixerTypePattern = "Mixer%1Type";
|
||||
for (int i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
||||
for (quint32 i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
||||
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
|
||||
Q_ASSERT(field);
|
||||
if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) {
|
||||
@ -95,8 +109,21 @@ void EscCalibrationPage::startStopButtonClicked()
|
||||
}
|
||||
m_outputs.clear();
|
||||
m_isCalibrating = false;
|
||||
resetAllSecurityCheckboxes();
|
||||
ui->startStopButton->setText(tr("Start"));
|
||||
ui->startStopButton->setEnabled(true);
|
||||
enableButtons(true);
|
||||
}
|
||||
}
|
||||
|
||||
void EscCalibrationPage::securityCheckBoxesToggled()
|
||||
{
|
||||
ui->startStopButton->setEnabled(ui->securityCheckBox1->isChecked() &&
|
||||
ui->securityCheckBox2->isChecked() &&
|
||||
ui->securityCheckBox3->isChecked());
|
||||
}
|
||||
|
||||
|
||||
void EscCalibrationPage::initializePage()
|
||||
{
|
||||
resetAllSecurityCheckboxes();
|
||||
}
|
||||
|
@ -43,10 +43,13 @@ public:
|
||||
explicit EscCalibrationPage(SetupWizard *wizard, QWidget *parent = 0);
|
||||
~EscCalibrationPage();
|
||||
bool validatePage();
|
||||
void initializePage();
|
||||
|
||||
private slots:
|
||||
void startStopButtonClicked();
|
||||
void securityCheckBoxesToggled();
|
||||
void enableButtons(bool enable);
|
||||
void resetAllSecurityCheckboxes();
|
||||
|
||||
private:
|
||||
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
|
||||
@ -55,6 +58,7 @@ private:
|
||||
bool m_isCalibrating;
|
||||
|
||||
QList<OutputCalibrationUtil *> m_outputs;
|
||||
|
||||
};
|
||||
|
||||
#endif // ESCCALIBRATIONPAGE_H
|
||||
|
@ -17,7 +17,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p><p><span style=" font-size:10pt;">As you have selected to use a MultiRotor and Fast / Flashed ESCs, we need to calibrate the endpoints of these ESCs so they can see the full throttle range sent from the flight controller. </span></p><p><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you absolutely </span><span style=" font-size:10pt; font-weight:600; color:#f30f1d;">must remove the propellers from all motors</span><span style=" font-size:10pt;">. </span></p><p><span style=" font-size:10pt;">The steps to perform this calibration are as follows:</span></p><p><span style=" font-size:10pt;">1. Press the Start button on this page <br/>2. Connect the battery to your airframe<br/>3. Wait for ESC calibration beep(s)<br/>4. Press the Stop button on this page<br/>5. Wait for ESC confirmation beep(s)<br/>6. Disconnect battery</span></p><p><span style=" font-size:10pt;">When ready push the start button below.</span></p></body></html></string>
|
||||
<string><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600;">OpenPilot ESC Calibration Procedure</span></p><p><span style=" font-size:10pt;">As you have selected to use a MultiRotor and Fast / Flashed ESCs, we need to calibrate the endpoints of these ESCs so they can see the full throttle range sent from the flight controller. </span></p><p><span style=" font-size:10pt;">This part of the wizard will tell you to connect the battery to your aircraft, before doing so you absolutely </span><span style=" font-size:10pt; font-weight:600; color:#f30f1d;">must remove the propellers from all motors</span><span style=" font-size:10pt;">. </span></p><p><span style=" font-size:10pt;">The steps to perform this calibration are as follows:</span></p><p><span style=" font-size:10pt;">1. Confirm all security questions<br/>2. Press the Start button when it becomes enabled<br/>3. Connect the battery to your airframe<br/>4. Wait for ESC calibration beep(s)<br/>5. Press the Stop button<br/>6. Wait for ESC confirmation beep(s)<br/>7. Disconnect battery</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
@ -43,6 +43,27 @@
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="securityCheckBox1">
|
||||
<property name="text">
|
||||
<string>I have removed ALL propellers from ALL motors of my vehicle.</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="securityCheckBox2">
|
||||
<property name="text">
|
||||
<string>The vehicle is NOT powered by any external power source but USB</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="securityCheckBox3">
|
||||
<property name="text">
|
||||
<string>I confirm I have read and understood the above instructions in full</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<property name="topMargin">
|
||||
@ -63,6 +84,9 @@
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="startStopButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
@ -104,6 +128,12 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>securityCheckBox1</tabstop>
|
||||
<tabstop>securityCheckBox2</tabstop>
|
||||
<tabstop>securityCheckBox3</tabstop>
|
||||
<tabstop>startStopButton</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -20,13 +20,13 @@
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot Configuration Summary</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The first part of this wizard is now complete. All information required to create a basic OpenPilot controller configuration for a specific vehicle has been collected.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Below is a summary of the configuration and a button that links to a diagram illustrating how to connect required hardware and the OpenPilot Controller with the current configuration.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">The following steps require that your OpenPilot controller is connected according to the diagram, remians connected to the computer by USB, and that you have a battery ready but </span><span style=" font-size:10pt; font-weight:600;">do not</span><span style=" font-size:10pt;"> connect it right now, you will be told when to in later steps of this wizard.</span></p></body></html></string>
|
||||
</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;">
|
||||
<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">OpenPilot Configuration Summary</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The first part of this wizard is now complete. All information required to create a basic OpenPilot controller configuration for a specific vehicle has been collected.</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">Below is a summary of the configuration and a button that links to a diagram illustrating how to connect required hardware and the OpenPilot Controller with the current configuration.</span></p>
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:10pt;"><br /></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;">The following steps require that your OpenPilot controller is connected according to the diagram, remains connected to the computer by USB, and that you have a battery ready but </span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt; font-weight:600;">do not</span><span style=" font-family:'MS Shell Dlg 2'; font-size:10pt;"> connect it right now, you will be told when to in later steps of this wizard.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
|
@ -598,7 +598,7 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
||||
// Set Mixer types and values
|
||||
QString mixerTypePattern = "Mixer%1Type";
|
||||
QString mixerVectorPattern = "Mixer%1Vector";
|
||||
for (int i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
||||
for (quint32 i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
||||
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
|
||||
Q_ASSERT(field);
|
||||
field->setValue(field->getOptions().at(channels[i].type));
|
||||
|
Loading…
x
Reference in New Issue
Block a user