From e53b332e59b2a61e98b59b3684cbbd715e135f71 Mon Sep 17 00:00:00 2001 From: Jean Cyr Date: Sat, 12 Oct 2013 20:10:39 -0400 Subject: [PATCH] Bind support for DSMX with 8 or more channels --- src/ui/QGCPX4VehicleConfig.cc | 14 +++++++++++--- src/ui/QGCPX4VehicleConfig.ui | 9 ++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index 3e1c28d..d2419ec 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -335,7 +335,7 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled) void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled) { - if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton) { + if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton && !ui->dsmx8RadioButton) { // Reject QMessageBox warnMsgBox; warnMsgBox.setText(tr("Please select a Spektrum Protocol Version")); @@ -347,8 +347,16 @@ void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled) } UASInterface* mav = UASManager::instance()->getActiveUAS(); - if (mav) - mav->pairRX(0, ui->dsmxRadioButton->isChecked() ? 1 : 0); + if (mav) { + 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() diff --git a/src/ui/QGCPX4VehicleConfig.ui b/src/ui/QGCPX4VehicleConfig.ui index 7c9fe43..ffd58d5 100644 --- a/src/ui/QGCPX4VehicleConfig.ui +++ b/src/ui/QGCPX4VehicleConfig.ui @@ -237,7 +237,14 @@ - DSMX Mode + DSMX Mode (3 to 7 channels) + + + + + + + DSMX Mode (8 or more channels)