Commit e87936cc authored by Lorenz Meier's avatar Lorenz Meier

Added DSM-X support

parent 5322c774
......@@ -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();
}
......
......@@ -205,6 +205,23 @@
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="dsm2RadioButton">
<property name="text">
<string>DSM2 Mode</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="dsmxRadioButton">
<property name="text">
<string>DSMX Mode</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
......@@ -853,8 +870,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>16</width>
<height>16</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
......@@ -890,8 +907,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>16</width>
<height>16</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
......@@ -941,8 +958,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>16</width>
<height>16</height>
<width>98</width>
<height>28</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_7">
......
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