Browse Source

Added DSM-X support

QGC4.4
Lorenz Meier 12 years ago
parent
commit
e87936ccb0
  1. 16
      src/ui/QGCPX4VehicleConfig.cc
  2. 29
      src/ui/QGCPX4VehicleConfig.ui

16
src/ui/QGCPX4VehicleConfig.cc

@ -335,9 +335,23 @@ void QGCPX4VehicleConfig::toggleCalibrationRC(bool enabled) @@ -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();
}

29
src/ui/QGCPX4VehicleConfig.ui

@ -206,6 +206,23 @@ @@ -206,6 +206,23 @@
</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">
<enum>Qt::Vertical</enum>
@ -853,8 +870,8 @@ @@ -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 @@ @@ -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 @@ @@ -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">

Loading…
Cancel
Save