From 6ba3aa04241a0fe7781983c24be9d29c8adb148d Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Tue, 17 Feb 2015 13:35:47 +0100 Subject: [PATCH] OP-1723 Changes for review - Fix for FW dual aileron (output6 not set to 1500) --- .../pages/outputcalibrationpage.cpp | 19 ++++++++++++------- .../setupwizard/pages/outputcalibrationpage.h | 1 + 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp index 57acb32bd..fb4775aa9 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp @@ -117,11 +117,7 @@ void OutputCalibrationPage::setupVehicle() m_currentWizardIndex = 0; m_vehicleScene->clear(); - if (m_calibrationUtil) { - delete m_calibrationUtil; - m_calibrationUtil = 0; - } - m_calibrationUtil = new OutputCalibrationUtil(); + resetOutputCalibrationUtil(); switch (getWizard()->getVehicleSubType()) { case SetupWizard::MULTI_ROTOR_TRI_Y: @@ -202,7 +198,7 @@ void OutputCalibrationPage::setupVehicle() m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5; m_channelIndex << 0 << 2 << 0 << 5 << 1 << 3; - setupActuatorMinMaxAndNeutral(2, 2, 5); + setupActuatorMinMaxAndNeutral(2, 2, 6); // should be 5 instead 6 but output 5 is not used getWizard()->setActuatorSettings(m_actuatorSettings); break; @@ -465,7 +461,7 @@ void OutputCalibrationPage::onStartButtonToggle(QAbstractButton *button, quint16 m_calibrationUtil->startChannelOutput(channel, m_actuatorSettings[channel].channelNeutral); // Normal motor - if ((button->objectName() == "motorNeutralButton") && !m_actuatorSettings[channel].isReversableMotor) { + if ((button == ui->motorNeutralButton) && !m_actuatorSettings[channel].isReversableMotor) { m_calibrationUtil->startChannelOutput(channel, m_actuatorSettings[channel].channelMin); } @@ -654,3 +650,12 @@ void OutputCalibrationPage::on_reverseCheckbox_toggled(bool checked) ui->servoMaxAngleSlider->setValue(m_actuatorSettings[getCurrentChannel()].channelMax); } } + +void OutputCalibrationPage::resetOutputCalibrationUtil() +{ + if (m_calibrationUtil) { + delete m_calibrationUtil; + m_calibrationUtil = 0; + } + m_calibrationUtil = new OutputCalibrationUtil(); +} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h index 74a298ad0..3691a1d0a 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.h @@ -100,6 +100,7 @@ private: QList m_actuatorSettings; OutputCalibrationUtil *m_calibrationUtil; + void resetOutputCalibrationUtil(); static const QString MULTI_SVG_FILE; static const QString FIXEDWING_SVG_FILE;