From ce53757baab0c597b089ffbf0bf083bbd32ca1ed Mon Sep 17 00:00:00 2001 From: edouard Date: Sat, 11 Sep 2010 09:05:42 +0000 Subject: [PATCH] Servo input config was missing the accessory inputs. Changed the plugin to remove any hardcoded value, so it should be safe for future new channel assignement types git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1578 ebee16cc-31ac-478f-84a7-5cbb03baadba --- ground/src/plugins/config/configservowidget.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ground/src/plugins/config/configservowidget.cpp b/ground/src/plugins/config/configservowidget.cpp index c8db54dc9..e65185f3e 100644 --- a/ground/src/plugins/config/configservowidget.cpp +++ b/ground/src/plugins/config/configservowidget.cpp @@ -83,6 +83,8 @@ ConfigServoWidget::ConfigServoWidget(QWidget *parent) : ConfigTaskWidget(parent) << m_config->ch6Rev << m_config->ch7Rev; + + // Now connect the widget to the ManualControlCommand / Channel UAVObject ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); UAVObjectManager *objManager = pm->getObject(); @@ -567,12 +569,14 @@ void ConfigServoWidget::requestRCInputUpdate() m_config->ch6Assign->setCurrentIndex(0); m_config->ch7Assign->setCurrentIndex(0); + // Update all channels assignements - assignChannel(obj, field, QString("Roll")); - assignChannel(obj, field, QString("Pitch")); - assignChannel(obj, field, QString("Yaw")); - assignChannel(obj, field, QString("Throttle")); - assignChannel(obj, field, QString("FlightMode")); + QList fieldList = obj->getFields(); + foreach (UAVObjectField* field, fieldList) { + if (field->getUnits().contains("channel")) { + assignChannel(obj, field, field->getName()); + } + } }