From b702db2549616d4f0a5b937e82e4aeea9a9bd1b2 Mon Sep 17 00:00:00 2001 From: elafargue Date: Sun, 29 May 2011 09:37:19 +0200 Subject: [PATCH] OP-510 Fix for setting tail servo on tricopter, and retrieving tail servo settings. Please test thoroughly and report! --- .../plugins/config/configairframewidget.cpp | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp index 27696457c..4528b8580 100644 --- a/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configairframewidget.cpp @@ -1547,7 +1547,7 @@ bool ConfigAirframeWidget::setupMixer(double mixerFactors[8][3]) setupQuadMotor(channel, mixerFactors[i][0]*pFactor, rFactor*mixerFactors[i][1], yFactor*mixerFactors[i][2]); } - obj->updated(); + // obj->updated(); // Let caller do this... return true; } @@ -1591,7 +1591,7 @@ void ConfigAirframeWidget::setupMotors(QList motorList) field = obj->getField(motor); field->setValue(mmList.takeFirst()->currentText()); } - obj->updated(); // Save... + // obj->updated(); // Do not Save, let the caller do it... } @@ -2051,12 +2051,10 @@ void ConfigAirframeWidget::sendAircraftUpdate() } obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); Q_ASSERT(obj); - field = obj->getField("FixedWingYaw1"); - field->setValue(m_aircraft->triYawChannel->currentText()); - // No need to send a obj->updated() here because setupMotors - // will do it. motorList << "VTOLMotorNW" << "VTOLMotorNE" << "VTOLMotorS"; setupMotors(motorList); + field = obj->getField("FixedWingYaw1"); + field->setValue(m_aircraft->triYawChannel->currentText()); // Motor 1 to 6, Y6 Layout: // pitch roll yaw @@ -2135,10 +2133,18 @@ void ConfigAirframeWidget::sendAircraftUpdate() field->setValue(m_aircraft->customMixerTable->item(5,i)->text(),ti); } - obj->updated(); + // obj->updated(); } - UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); + UAVDataObject* obj = dynamic_cast(getObjectManager()->getObject(QString("ActuatorSettings"))); + Q_ASSERT(obj); + obj->updated(); + + obj = dynamic_cast(getObjectManager()->getObject(QString("MixerSettings"))); + Q_ASSERT(obj); + obj->updated(); + + obj = dynamic_cast(getObjectManager()->getObject(QString("SystemSettings"))); UAVObjectField* field = obj->getField(QString("AirframeType")); field->setValue(airframeType); obj->updated();