1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-03-15 07:29:15 +01:00

LP-56 - Add link checkbox for acro+ roll/pitch factors

This commit is contained in:
Alessio Morale 2015-07-27 23:25:38 +02:00
parent 7b3aed3de9
commit 3490057f69
2 changed files with 35 additions and 0 deletions

View File

@ -91,6 +91,9 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
connect(ui->checkBox_3, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBox_3);
connect(ui->checkBoxLinkAcroFactors, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
addWidget(ui->checkBoxLinkAcroFactors);
addWidget(ui->pushButton_2);
addWidget(ui->pushButton_3);
addWidget(ui->pushButton_4);
@ -568,6 +571,8 @@ void ConfigStabilizationWidget::linkCheckBoxes(bool value)
ui->basicResponsivenessCheckBox->setChecked(!value);
ui->basicResponsivenessControls->setEnabled(!value);
ui->advancedResponsivenessControls->setEnabled(value);
} else if(sender() == ui->checkBoxLinkAcroFactors) {
processLinkedWidgets(ui->AcroFactorRollSlider);
}
}
@ -608,6 +613,13 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
ui->ratePitchKi_4->setValue(ui->RateResponsivenessSlider->value());
}
}
if (ui->checkBoxLinkAcroFactors->isChecked()) {
if (widget == ui->AcroFactorRollSlider) {
ui->AcroFactorPitchSlider->setValue(ui->AcroFactorRollSlider->value());
} else if (widget == ui->AcroFactorPitchSlider) {
ui->AcroFactorRollSlider->setValue(ui->AcroFactorPitchSlider->value());
}
}
}
void ConfigStabilizationWidget::onBoardConnected()

View File

@ -195,6 +195,29 @@ margin-top: -1px;
<string>Acro+</string>
</property>
<layout class="QGridLayout" name="gridLayout_26">
<item row="0" column="0">
<widget class="QCheckBox" name="checkBoxLinkAcroFactors">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Link roll &amp;amp; pitch sliders to move together, thus giving same value for both roll &amp;amp; pitch when setting up a symetrical vehicle that requires both to be the same&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Link Roll and Pitch</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="pushButton_21">
<property name="sizePolicy">