mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14: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:
parent
176bd3c4f7
commit
a334c49151
@ -116,9 +116,11 @@ void ConfigStabilizationWidget::realtimeUpdatesSlot(bool value)
|
|||||||
ui->realTimeUpdates_8->setChecked(value);
|
ui->realTimeUpdates_8->setChecked(value);
|
||||||
|
|
||||||
if (value && !realtimeUpdates->isActive()) {
|
if (value && !realtimeUpdates->isActive()) {
|
||||||
realtimeUpdates->start(300);
|
realtimeUpdates->start(AUTOMATIC_UPDATE_RATE);
|
||||||
} else {
|
qDebug() << "Instant Update timer started.";
|
||||||
|
} else if (!value && realtimeUpdates->isActive()) {
|
||||||
realtimeUpdates->stop();
|
realtimeUpdates->stop();
|
||||||
|
qDebug() << "Instant Update timer stopped.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +136,7 @@ void ConfigStabilizationWidget::linkCheckBoxes(bool value)
|
|||||||
ui->checkBox_8->setChecked(value);
|
ui->checkBox_8->setChecked(value);
|
||||||
} else if (sender() == ui->basicResponsivenessGroupBox) {
|
} else if (sender() == ui->basicResponsivenessGroupBox) {
|
||||||
ui->advancedResponsivenessGroupBox->setChecked(!value);
|
ui->advancedResponsivenessGroupBox->setChecked(!value);
|
||||||
if(value) {
|
if (value) {
|
||||||
processLinkedWidgets(ui->AttitudeResponsivenessSlider);
|
processLinkedWidgets(ui->AttitudeResponsivenessSlider);
|
||||||
processLinkedWidgets(ui->RateResponsivenessSlider);
|
processLinkedWidgets(ui->RateResponsivenessSlider);
|
||||||
}
|
}
|
||||||
@ -181,7 +183,7 @@ void ConfigStabilizationWidget::processLinkedWidgets(QWidget *widget)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ui->basicResponsivenessGroupBox->isChecked()) {
|
if (ui->basicResponsivenessGroupBox->isChecked()) {
|
||||||
if (widget == ui->AttitudeResponsivenessSlider) {
|
if (widget == ui->AttitudeResponsivenessSlider) {
|
||||||
ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value());
|
ui->ratePitchKp_4->setValue(ui->AttitudeResponsivenessSlider->value());
|
||||||
} else if (widget == ui->RateResponsivenessSlider) {
|
} else if (widget == ui->RateResponsivenessSlider) {
|
||||||
|
@ -49,6 +49,9 @@ private:
|
|||||||
Ui_StabilizationWidget *ui;
|
Ui_StabilizationWidget *ui;
|
||||||
QTimer * realtimeUpdates;
|
QTimer * realtimeUpdates;
|
||||||
|
|
||||||
|
// Milliseconds between automatic 'Instant Updates'
|
||||||
|
static const int AUTOMATIC_UPDATE_RATE = 500;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void refreshWidgetsValues(UAVObject *o = NULL);
|
void refreshWidgetsValues(UAVObject *o = NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user