Commit 6cf29b5f authored by Lorenz Meier's avatar Lorenz Meier

Merge pull request #395 from jean-m-cyr/config

Bind support for DSMX with 8 or more channels
parents 2034be4d e53b332e
...@@ -335,7 +335,7 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled) ...@@ -335,7 +335,7 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled)
void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled) void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled)
{ {
if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton) { if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton && !ui->dsmx8RadioButton) {
// Reject // Reject
QMessageBox warnMsgBox; QMessageBox warnMsgBox;
warnMsgBox.setText(tr("Please select a Spektrum Protocol Version")); warnMsgBox.setText(tr("Please select a Spektrum Protocol Version"));
...@@ -347,8 +347,16 @@ void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled) ...@@ -347,8 +347,16 @@ void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled)
} }
UASInterface* mav = UASManager::instance()->getActiveUAS(); UASInterface* mav = UASManager::instance()->getActiveUAS();
if (mav) if (mav) {
mav->pairRX(0, ui->dsmxRadioButton->isChecked() ? 1 : 0); int rxSubType;
if (ui->dsm2RadioButton->isChecked())
rxSubType = 0;
else if (ui->dsmxRadioButton->isChecked())
rxSubType = 1;
else // if (ui->dsmx8RadioButton->isChecked())
rxSubType = 2;
mav->pairRX(0, rxSubType);
}
} }
void QGCPX4VehicleConfig::setTrimPositions() void QGCPX4VehicleConfig::setTrimPositions()
......
...@@ -237,7 +237,14 @@ ...@@ -237,7 +237,14 @@
<item> <item>
<widget class="QRadioButton" name="dsmxRadioButton"> <widget class="QRadioButton" name="dsmxRadioButton">
<property name="text"> <property name="text">
<string>DSMX Mode</string> <string>DSMX Mode (3 to 7 channels)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="dsmx8RadioButton">
<property name="text">
<string>DSMX Mode (8 or more channels)</string>
</property> </property>
</widget> </widget>
</item> </item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment