From c409d75eed5e8d28bc90505da4ff3998b0d2d144 Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 21 Oct 2014 19:51:41 +0200 Subject: [PATCH 1/2] OP-1556 Setting ActuatorCommand to 0 after calibration. --- .../setupwizard/pages/esccalibrationpage.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp index 6a5752ca1..da1090626 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/esccalibrationpage.cpp @@ -35,6 +35,8 @@ #include "vehicleconfigurationhelper.h" #include "actuatorsettings.h" +#include + EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), ui(new Ui::EscCalibrationPage), m_isCalibrating(false) @@ -44,7 +46,7 @@ EscCalibrationPage::EscCalibrationPage(SetupWizard *wizard, QWidget *parent) : ui->outputHigh->setEnabled(false); ui->outputLow->setEnabled(true); ui->outputLevel->setEnabled(true); - ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); + ui->outputLevel->setText(QString(tr("%1 µs")).arg(0)); connect(ui->startStopButton, SIGNAL(clicked()), this, SLOT(startStopButtonClicked())); @@ -102,7 +104,7 @@ void EscCalibrationPage::startStopButtonClicked() Q_ASSERT(field); if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) { OutputCalibrationUtil *output = new OutputCalibrationUtil(); - output->startChannelOutput(i, LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS); + output->startChannelOutput(i, 0); output->setChannelOutputValue(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS); m_outputs << output; } @@ -112,13 +114,22 @@ void EscCalibrationPage::startStopButtonClicked() } else { m_isCalibrating = false; ui->startStopButton->setEnabled(false); + ui->outputHigh->setEnabled(false); + foreach(OutputCalibrationUtil * output, m_outputs) { + output->setChannelOutputValue(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS); + } + ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); + + qApp->processEvents(QEventLoop::AllEvents); + QThread::msleep(1000); + foreach(OutputCalibrationUtil * output, m_outputs) { output->stopChannelOutput(); delete output; } + ui->outputLevel->setText(QString(tr("%1 µs")).arg(0)); ui->outputHigh->setEnabled(false); ui->outputLow->setEnabled(true); - ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS)); m_outputs.clear(); m_isCalibrating = false; resetAllSecurityCheckboxes(); From 2ee9e04ff61023818c626179535f732e133cfa21 Mon Sep 17 00:00:00 2001 From: m_thread Date: Thu, 23 Oct 2014 12:42:27 +0200 Subject: [PATCH 2/2] OP-1567 Fixed some defaults in wizard. If CC or CC3D disable GPS. --- .../src/plugins/setupwizard/pages/controllerpage.cpp | 3 +++ ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp index 1aaca405d..6384ef239 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/controllerpage.cpp @@ -80,6 +80,9 @@ bool ControllerPage::isComplete() const bool ControllerPage::validatePage() { getWizard()->setControllerType((SetupWizard::CONTROLLER_TYPE)ui->boardTypeCombo->itemData(ui->boardTypeCombo->currentIndex()).toInt()); + if (getWizard()->getControllerType() == SetupWizard::CONTROLLER_CC || getWizard()->getControllerType() == SetupWizard::CONTROLLER_CC3D) { + getWizard()->setGpsType(SetupWizard::GPS_DISABLED); + } return true; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index 29ec8bae3..63cee784a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -58,6 +58,7 @@ SetupWizard::SetupWizard(QWidget *parent) : QWizard(parent), VehicleConfiguratio m_controllerType(CONTROLLER_UNKNOWN), m_vehicleType(VEHICLE_UNKNOWN), m_inputType(INPUT_UNKNOWN), m_escType(ESC_UNKNOWN), m_servoType(SERVO_UNKNOWN), m_vehicleTemplate(NULL), + m_gpsType(GPS_DISABLED), m_airspeedType(AIRSPEED_DISABLED), m_calibrationPerformed(false), m_restartNeeded(false), m_connectionManager(0) { setWindowTitle(tr("OpenPilot Setup Wizard"));