diff --git a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp index 5ef3daf72..9cce0171e 100644 --- a/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configoutputwidget.cpp @@ -103,7 +103,8 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren << m_config->ch6Link << m_config->ch7Link; - UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); +/* + UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); QList fieldList = obj->getFields(); foreach (UAVObjectField* field, fieldList) { if (field->getUnits().contains("channel")) { @@ -117,6 +118,7 @@ ConfigOutputWidget::ConfigOutputWidget(QWidget *parent) : ConfigTaskWidget(paren m_config->ch7Output->addItem(field->getName()); } } + */ for (int i = 0; i < 8; i++) { @@ -292,7 +294,7 @@ void ConfigOutputWidget::runChannelTests(bool state) } /** - * Set the dropdown option for a channel output assignement + * Set the label for a channel output assignement */ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str) { @@ -300,28 +302,28 @@ void ConfigOutputWidget::assignOutputChannel(UAVDataObject *obj, QString str) QStringList options = field->getOptions(); switch (options.indexOf(field->getValue().toString())) { case 0: - m_config->ch0Output->setCurrentIndex(m_config->ch0Output->findText(str)); + m_config->ch0Output->setText(str); break; case 1: - m_config->ch1Output->setCurrentIndex(m_config->ch1Output->findText(str)); + m_config->ch1Output->setText(str); break; case 2: - m_config->ch2Output->setCurrentIndex(m_config->ch2Output->findText(str)); + m_config->ch2Output->setText(str); break; case 3: - m_config->ch3Output->setCurrentIndex(m_config->ch3Output->findText(str)); + m_config->ch3Output->setText(str); break; case 4: - m_config->ch4Output->setCurrentIndex(m_config->ch4Output->findText(str)); + m_config->ch4Output->setText(str); break; case 5: - m_config->ch5Output->setCurrentIndex(m_config->ch5Output->findText(str)); + m_config->ch5Output->setText(str); break; case 6: - m_config->ch6Output->setCurrentIndex(m_config->ch6Output->findText(str)); + m_config->ch6Output->setText(str); break; case 7: - m_config->ch7Output->setCurrentIndex(m_config->ch7Output->findText(str)); + m_config->ch7Output->setText(str); break; } } @@ -405,14 +407,14 @@ void ConfigOutputWidget::requestRCOutputUpdate() UAVObjectManager *objManager = pm->getObject(); // Reset all channel assignements: - m_config->ch0Output->setCurrentIndex(0); - m_config->ch1Output->setCurrentIndex(0); - m_config->ch2Output->setCurrentIndex(0); - m_config->ch3Output->setCurrentIndex(0); - m_config->ch4Output->setCurrentIndex(0); - m_config->ch5Output->setCurrentIndex(0); - m_config->ch6Output->setCurrentIndex(0); - m_config->ch7Output->setCurrentIndex(0); + m_config->ch0Output->setText("-"); + m_config->ch1Output->setText("-"); + m_config->ch2Output->setText("-"); + m_config->ch3Output->setText("-"); + m_config->ch4Output->setText("-"); + m_config->ch5Output->setText("-"); + m_config->ch6Output->setText("-"); + m_config->ch7Output->setText("-"); // Get the channel assignements: UAVDataObject * obj = dynamic_cast(objManager->getObject(QString("ActuatorSettings"))); @@ -525,57 +527,9 @@ void ConfigOutputWidget::sendRCOutputUpdate() field->setValue(m_config->outputRate3->value(),2); field->setValue(m_config->outputRate4->value(),3); - // Set Actuator assignement for each channel: - // Rule: if two channels have the same setting (which is wrong!) the higher channel - // will get the setting. - - // First, reset all channel assignements: - QList fieldList = obj->getFields(); - foreach (UAVObjectField* field, fieldList) { - // NOTE: we assume that all options in ActuatorSettings are a channel assignement - // except for the options called "ChannelXXX" - if (field->getUnits().contains("channel")) { - field->setValue(field->getOptions().last()); - } - } - - if (m_config->ch0Output->currentIndex() != 0) { - field = obj->getField(m_config->ch0Output->currentText()); - field->setValue(field->getOptions().at(0)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch1Output->currentIndex() != 0) { - field = obj->getField(m_config->ch1Output->currentText()); - field->setValue(field->getOptions().at(1)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch2Output->currentIndex() != 0) { - field = obj->getField(m_config->ch2Output->currentText()); - field->setValue(field->getOptions().at(2)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch3Output->currentIndex() != 0) { - field = obj->getField(m_config->ch3Output->currentText()); - field->setValue(field->getOptions().at(3)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch4Output->currentIndex() != 0) { - field = obj->getField(m_config->ch4Output->currentText()); - field->setValue(field->getOptions().at(4)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch5Output->currentIndex() != 0) { - field = obj->getField(m_config->ch5Output->currentText()); - field->setValue(field->getOptions().at(5)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch6Output->currentIndex() != 0) { - field = obj->getField(m_config->ch6Output->currentText()); - field->setValue(field->getOptions().at(6)); // -> This way we don't depend on channel naming convention - } - if (m_config->ch7Output->currentIndex() != 0) { - field = obj->getField(m_config->ch7Output->currentText()); - field->setValue(field->getOptions().at(7)); // -> This way we don't depend on channel naming convention - } - // ... and send to the OP Board obj->updated(); - } diff --git a/ground/openpilotgcs/src/plugins/config/output.ui b/ground/openpilotgcs/src/plugins/config/output.ui index db63ba4c7..7a0257daf 100644 --- a/ground/openpilotgcs/src/plugins/config/output.ui +++ b/ground/openpilotgcs/src/plugins/config/output.ui @@ -162,27 +162,7 @@ Leave at 50Hz for fixed wing. - Channel 1 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 1: @@ -300,27 +280,7 @@ p, li { white-space: pre-wrap; } - Channel 2 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 2: @@ -407,27 +367,7 @@ p, li { white-space: pre-wrap; } - Channel 3 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 3: @@ -514,27 +454,7 @@ p, li { white-space: pre-wrap; } - Channel 4 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 4: @@ -621,27 +541,7 @@ p, li { white-space: pre-wrap; } - Channel 5 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 5: @@ -719,27 +619,7 @@ p, li { white-space: pre-wrap; } - Channel 6 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 6: @@ -817,54 +697,14 @@ p, li { white-space: pre-wrap; } - Channel 7 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 7: - Channel 8 - - - - - - - false - - - - 8 - - - - <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> -<html><head><meta name="qrichtext" content="1" /><style type="text/css"> -p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:8pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">This is the actuator connected to this channel.</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans';">You can change this through the &quot;Airframe&quot; dialog (on the left).</span></p></body></html> + Channel 8: @@ -1010,6 +850,133 @@ p, li { white-space: pre-wrap; } + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + + 9 + + + + - + + + Qt::AlignCenter + + + + + + + Assignment + + + @@ -1119,35 +1086,27 @@ Applies and Saves all settings to SD ch6OutMax ch7OutMin ch7OutMax - ch0Output ch0OutSlider ch0Rev ch0Link - ch1Output ch1OutSlider ch1Rev ch1Link - ch2Output ch2OutSlider ch2Rev ch2Link - ch3Output ch3OutSlider ch3Rev ch3Link - ch4Output ch4OutSlider ch4Rev ch4Link - ch5Output ch5OutSlider ch5Rev ch5Link - ch6Output ch6OutSlider ch6Rev ch6Link - ch7Output ch7OutSlider ch7Rev ch7Link