diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index 04bd330d030f845456a2765dd560db14e4628938..0176aa6598f228b8b58c4c9f38472cb0de604282 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -335,9 +335,23 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled) void QGCPX4VehicleConfig::toggleSpektrumPairing(bool enabled) { + if (!ui->dsm2RadioButton->isChecked() && !ui->dsmxRadioButton) { + // Reject + QMessageBox warnMsgBox; + warnMsgBox.setText(tr("Please select a Spektrum Protocol Version")); + warnMsgBox.setInformativeText(tr("Please select either DSM2 or DSM-X\ndirectly below the pair button,\nbased on the receiver type.")); + warnMsgBox.setStandardButtons(QMessageBox::Ok); + warnMsgBox.setDefaultButton(QMessageBox::Ok); + (void)warnMsgBox.exec(); + } + if (enabled) { - mav->getParamManager()->setPendingParam(0, "RC_DSM_BIND", (int)1); + int mode = 1; // DSM2 + if (ui->dsmxRadioButton->isChecked()) + mode = 2; // DSMX + + mav->getParamManager()->setPendingParam(0, "RC_DSM_BIND", mode); // Do not save this parameter, just set in RAM mav->getParamManager()->sendPendingParameters(); } diff --git a/src/ui/QGCPX4VehicleConfig.ui b/src/ui/QGCPX4VehicleConfig.ui index db6fbd9f21d0e5178e9c7b1b3525522ee4558637..26210d1c875bc47f80eb2a47efa95b257a0a2274 100644 --- a/src/ui/QGCPX4VehicleConfig.ui +++ b/src/ui/QGCPX4VehicleConfig.ui @@ -205,6 +205,23 @@ + + + + DSM2 Mode + + + true + + + + + + + DSMX Mode + + + @@ -853,8 +870,8 @@ 0 0 - 16 - 16 + 98 + 28 @@ -890,8 +907,8 @@ 0 0 - 16 - 16 + 98 + 28 @@ -941,8 +958,8 @@ 0 0 - 16 - 16 + 98 + 28