1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-17 02:52:12 +01:00

OP-935 Fixes the Instant Update functionality on the Stabilization settings pages in the configuration plugin.

This commit is contained in:
Fredrik Arvidsson 2013-05-05 18:48:48 +02:00
parent 176bd3c4f7
commit a334c49151
2 changed files with 9 additions and 4 deletions

View File

@ -116,9 +116,11 @@ void ConfigStabilizationWidget::realtimeUpdatesSlot(bool value)
ui->realTimeUpdates_8->setChecked(value);
if (value && !realtimeUpdates->isActive()) {
realtimeUpdates->start(300);
} else {
realtimeUpdates->start(AUTOMATIC_UPDATE_RATE);
qDebug() << "Instant Update timer started.";
} else if (!value && realtimeUpdates->isActive()) {
realtimeUpdates->stop();
qDebug() << "Instant Update timer stopped.";
}
}
@ -134,7 +136,7 @@ void ConfigStabilizationWidget::linkCheckBoxes(bool value)
ui->checkBox_8->setChecked(value);
} else if (sender() == ui->basicResponsivenessGroupBox) {
ui->advancedResponsivenessGroupBox->setChecked(!value);
if(value) {
if (value) {
processLinkedWidgets(ui->AttitudeResponsivenessSlider);
processLinkedWidgets(ui->RateResponsivenessSlider);
}
@ -181,7 +183,7 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
}
}
if(ui->basicResponsivenessGroupBox->isChecked()) {
if (ui->basicResponsivenessGroupBox->isChecked()) {
if (widget == ui->AttitudeResponsivenessSlider) {
ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value());
} else if (widget == ui->RateResponsivenessSlider) {

View File

@ -49,6 +49,9 @@ private:
Ui_StabilizationWidget *ui;
QTimer * realtimeUpdates;
// Milliseconds between automatic 'Instant Updates'
static const int AUTOMATIC_UPDATE_RATE = 500;
protected slots:
void refreshWidgetsValues(UAVObject *o = NULL);