diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 7e47eda79..88579c78c 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -174,11 +174,13 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) : ConfigTaskWidget(parent) connect(m_config->ch5Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); connect(m_config->ch6Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); connect(m_config->ch7Rev, SIGNAL(toggled(bool)), this, SLOT(reverseCheckboxClicked(bool))); - + connect(m_config->doRCInputCalibration,SIGNAL(stateChanged(int)),this,SLOT(updateTips(int))); firstUpdate = true; // Connect the help button connect(m_config->inputHelp, SIGNAL(clicked()), this, SLOT(openHelp())); + updateTips(Qt::Unchecked); + } ConfigInputWidget::~ConfigInputWidget() @@ -469,10 +471,15 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) QString fieldName = QString("Connected"); UAVObjectField *field = controlCommand->getField(fieldName); if (field->getValue().toBool()) + { m_config->RCInputConnected->setText("RC Receiver connected"); + m_config->lblMissingInputs->setText(""); + } else + { m_config->RCInputConnected->setText("RC Receiver not connected or invalid input configuration (missing channels)"); - + receiverHelp(); + } if (m_config->doRCInputCalibration->isChecked()) { if (firstUpdate) { // Increase the data rate from the board so that the sliders @@ -655,4 +662,77 @@ void ConfigInputWidget::openHelp() QDesktopServices::openUrl( QUrl("http://wiki.openpilot.org/display/Doc/Input+Configuration", QUrl::StrictMode) ); } +void ConfigInputWidget::receiverHelp() +{ + QString unassigned; + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + UAVObjectManager *objManager = pm->getObject(); + UAVDataObject* controlCommand = dynamic_cast(objManager->getObject(QString("ManualControlSettings"))); + UAVObjectField *field; + + field= controlCommand->getField("Roll"); + if(field->getValue().toString()=="None") + unassigned.append("Roll"); + + field =controlCommand->getField("Pitch"); + if(field->getValue().toString()=="None") + { + if(unassigned.length()>0) + unassigned.append(", "); + unassigned.append("Pitch"); + } + + field =controlCommand->getField("Yaw"); + if(field->getValue().toString()=="None") + { + if(unassigned.length()>0) + unassigned.append(", "); + unassigned.append("Yaw"); + } + + field =controlCommand->getField("Throttle"); + if(field->getValue().toString()=="None") + { + if(unassigned.length()>0) + unassigned.append(", "); + unassigned.append("Throttle"); + } + + field =controlCommand->getField("FlightMode"); + if(field->getValue().toString()=="None") + { + if(unassigned.length()>0) + unassigned.append(", "); + unassigned.append("FlightMode"); + } + if(unassigned.length()>0) + m_config->lblMissingInputs->setText(QString("Channels left to assign:")+unassigned); + else + m_config->lblMissingInputs->setText(""); +} +void ConfigInputWidget::updateTips(int value) +{ + if(value==Qt::Checked) + { + m_config->ch0Cur->setToolTip("Current channel value"); + m_config->ch1Cur->setToolTip("Current channel value"); + m_config->ch2Cur->setToolTip("Current channel value"); + m_config->ch3Cur->setToolTip("Current channel value"); + m_config->ch4Cur->setToolTip("Current channel value"); + m_config->ch5Cur->setToolTip("Current channel value"); + m_config->ch6Cur->setToolTip("Current channel value"); + m_config->ch7Cur->setToolTip("Current channel value"); + } + else + { + m_config->ch0Cur->setToolTip("Channel neutral point"); + m_config->ch1Cur->setToolTip("Channel neutral point"); + m_config->ch2Cur->setToolTip("Channel neutral point"); + m_config->ch3Cur->setToolTip("Channel neutral point"); + m_config->ch4Cur->setToolTip("Channel neutral point"); + m_config->ch5Cur->setToolTip("Channel neutral point"); + m_config->ch6Cur->setToolTip("Channel neutral point"); + m_config->ch7Cur->setToolTip("Channel neutral point"); + } +} diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.h b/ground/openpilotgcs/src/plugins/config/configinputwidget.h index 3017c5677..75f47cc8d 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.h +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.h @@ -71,7 +71,7 @@ private: bool firstUpdate; virtual void enableControls(bool enable); - + void receiverHelp(); private slots: void updateChannels(UAVObject* obj); virtual void refreshValues(); @@ -79,6 +79,7 @@ private slots: void saveRCInputObject(); void reverseCheckboxClicked(bool state); void openHelp(); + void updateTips(int); }; #endif diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 224424c4e..c4986955b 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -6,7 +6,7 @@ 0 0 - 557 + 560 467 @@ -24,6 +24,186 @@ RC Input + + + + + 75 + true + + + + Receiver Type: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Select the receiver type here: +- PWM is the most usual type +- PPM is connected to input XXX +- Spektrum is used with Spektrum 'satellite' receivers + + + + + + + + + + 234 + 54 + + + + + 11 + 75 + true + + + + Indicates whether OpenPilot is getting a signal from the RC receiver. + + + RC Receiver not connected or invalid input configuration (missing channels) + + + true + + + + + + + + + Rev. + + + + + + + + MS Shell Dlg 2 + 8 + + + + + 16 + 16 + + + + true + + + + + + + + FreeSans + 10 + 75 + true + + + + <!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:'FreeSans'; font-size:10pt; 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-size:9pt;">Current channel value.</span></p></body></html> + + + 1500 + + + + + + + + FreeSans + 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:'FreeSans'; 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;">Minimum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 1000 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + true + + + 1000 + + + 2000 + + + 1500 + + + Qt::Horizontal + + + + + + + + FreeSans + 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:'FreeSans'; 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;">Maximum channel pulse width</p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> + + + 2000 + + + + + + + Check this to reverse the channel. +(Useful for transmitters without channel +reversal capabilities). + + + + + + @@ -80,7 +260,7 @@ p, li { white-space: pre-wrap; } - + true @@ -99,7 +279,7 @@ p, li { white-space: pre-wrap; } - + @@ -120,7 +300,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -188,7 +368,7 @@ p, li { white-space: pre-wrap; } - + true @@ -207,7 +387,7 @@ p, li { white-space: pre-wrap; } - + @@ -228,7 +408,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -296,7 +476,7 @@ p, li { white-space: pre-wrap; } - + true @@ -315,7 +495,7 @@ p, li { white-space: pre-wrap; } - + @@ -336,7 +516,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -404,7 +584,7 @@ p, li { white-space: pre-wrap; } - + true @@ -423,7 +603,7 @@ p, li { white-space: pre-wrap; } - + @@ -444,7 +624,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -512,7 +692,7 @@ p, li { white-space: pre-wrap; } - + true @@ -531,7 +711,7 @@ p, li { white-space: pre-wrap; } - + @@ -552,7 +732,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -620,7 +800,7 @@ p, li { white-space: pre-wrap; } - + true @@ -639,7 +819,7 @@ p, li { white-space: pre-wrap; } - + @@ -660,7 +840,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -728,7 +908,7 @@ p, li { white-space: pre-wrap; } - + true @@ -747,7 +927,7 @@ p, li { white-space: pre-wrap; } - + @@ -768,7 +948,7 @@ p, li { white-space: pre-wrap; } - + Check this to reverse the channel. @@ -800,7 +980,7 @@ Neutral should be put at the bottom of the slider for the throttle. - + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> @@ -811,176 +991,19 @@ p, li { white-space: pre-wrap; } - - - - Rev. - - - - - - - Check this to reverse the channel. -(Useful for transmitters without channel -reversal capabilities). + + + + + 75 + true + - - - - - FreeSans - 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:'FreeSans'; 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;">Maximum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 2000 - - - - - - - true - - - 1000 - - - 2000 - - - 1500 - - - Qt::Horizontal - - - - - - - - FreeSans - 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:'FreeSans'; 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;">Minimum channel pulse width</p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">(microseconds)</p></body></html> - - - 1000 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - FreeSans - 10 - 75 - true - - - - <!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:'FreeSans'; font-size:10pt; 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-size:9pt;">Current channel value.</span></p></body></html> - - - 1500 - - - - - - - - MS Shell Dlg 2 - 8 - - - - - 16 - 16 - - - - true - - - - - - - - 11 - 75 - true - - - - Indicates whether OpenPilot is getting a signal from the RC receiver. - - - RC Receiver not connected or invalid input configuration (missing channels) - - - true - - - - - - - Select the receiver type here: -- PWM is the most usual type -- PPM is connected to input XXX -- Spektrum is used with Spektrum 'satellite' receivers - - - - - - - - 75 - true - - - - Receiver Type: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - -