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

OP-1723 Changes for review - Fix for FW dual aileron (output6 not set to 1500)

This commit is contained in:
Laurent Lalanne 2015-02-17 13:35:47 +01:00
parent d76affcae3
commit 6ba3aa0424
2 changed files with 13 additions and 7 deletions

View File

@ -117,11 +117,7 @@ void OutputCalibrationPage::setupVehicle()
m_currentWizardIndex = 0; m_currentWizardIndex = 0;
m_vehicleScene->clear(); m_vehicleScene->clear();
if (m_calibrationUtil) { resetOutputCalibrationUtil();
delete m_calibrationUtil;
m_calibrationUtil = 0;
}
m_calibrationUtil = new OutputCalibrationUtil();
switch (getWizard()->getVehicleSubType()) { switch (getWizard()->getVehicleSubType()) {
case SetupWizard::MULTI_ROTOR_TRI_Y: case SetupWizard::MULTI_ROTOR_TRI_Y:
@ -202,7 +198,7 @@ void OutputCalibrationPage::setupVehicle()
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5; m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5;
m_channelIndex << 0 << 2 << 0 << 5 << 1 << 3; 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); getWizard()->setActuatorSettings(m_actuatorSettings);
break; break;
@ -465,7 +461,7 @@ void OutputCalibrationPage::onStartButtonToggle(QAbstractButton *button, quint16
m_calibrationUtil->startChannelOutput(channel, m_actuatorSettings[channel].channelNeutral); m_calibrationUtil->startChannelOutput(channel, m_actuatorSettings[channel].channelNeutral);
// Normal motor // 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); 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); ui->servoMaxAngleSlider->setValue(m_actuatorSettings[getCurrentChannel()].channelMax);
} }
} }
void OutputCalibrationPage::resetOutputCalibrationUtil()
{
if (m_calibrationUtil) {
delete m_calibrationUtil;
m_calibrationUtil = 0;
}
m_calibrationUtil = new OutputCalibrationUtil();
}

View File

@ -100,6 +100,7 @@ private:
QList<actuatorChannelSettings> m_actuatorSettings; QList<actuatorChannelSettings> m_actuatorSettings;
OutputCalibrationUtil *m_calibrationUtil; OutputCalibrationUtil *m_calibrationUtil;
void resetOutputCalibrationUtil();
static const QString MULTI_SVG_FILE; static const QString MULTI_SVG_FILE;
static const QString FIXEDWING_SVG_FILE; static const QString FIXEDWING_SVG_FILE;