mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +01:00
OP-1474 Updated GUI to follow the standard way of handling checked groups.
Added missing push buttons to widget list to make then enable/disable correctly.
This commit is contained in:
parent
7fb064cf22
commit
45ea8015ed
@ -112,6 +112,8 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
|
||||
addWidget(ui->pushButton_5);
|
||||
addWidget(ui->pushButton_6);
|
||||
addWidget(ui->pushButton_9);
|
||||
addWidget(ui->pushButton_10);
|
||||
addWidget(ui->pushButton_11);
|
||||
addWidget(ui->pushButton_20);
|
||||
addWidget(ui->pushButton_22);
|
||||
addWidget(ui->pushButton_23);
|
||||
@ -124,12 +126,13 @@ ConfigStabilizationWidget::ConfigStabilizationWidget(QWidget *parent) : ConfigTa
|
||||
connect(ui->advancedResponsivenessCheckBox, SIGNAL(toggled(bool)), this, SLOT(linkCheckBoxes(bool)));
|
||||
|
||||
connect(ui->defaultThrottleCurveButton, SIGNAL(clicked()), this, SLOT(resetThrottleCurveToDefault()));
|
||||
connect(ui->thrustPIDScalingGroup, SIGNAL(toggled(bool)), ui->thrustPIDScalingCurve, SLOT(setEnabled(bool)));
|
||||
connect(ui->enableThrustPIDScalingCheckBox, SIGNAL(toggled(bool)), ui->thrustPIDScalingCurve, SLOT(setEnabled(bool)));
|
||||
ui->thrustPIDScalingCurve->setMixerType(MixerCurve::MIXERCURVE_TPA);
|
||||
ui->thrustPIDScalingCurve->setMin(-1);
|
||||
ui->thrustPIDScalingCurve->setMax(1);
|
||||
|
||||
addWidget(ui->thrustPIDScalingGroup);
|
||||
addWidget(ui->defaultThrottleCurveButton);
|
||||
addWidget(ui->enableThrustPIDScalingCheckBox);
|
||||
addWidget(ui->thrustPIDScalingCurve);
|
||||
addWidget(ui->thrustPIDScalingCurve->getCurveWidget());
|
||||
|
||||
@ -173,7 +176,7 @@ void ConfigStabilizationWidget::updateThrottleCurveFromObject()
|
||||
}
|
||||
|
||||
ui->thrustPIDScalingCurve->setCurve(&curve);
|
||||
ui->thrustPIDScalingGroup->setChecked(stabSettings->getEnableThrustPIDScaling() == StabilizationSettings::ENABLETHRUSTPIDSCALING_TRUE);
|
||||
ui->enableThrustPIDScalingCheckBox->setChecked(stabSettings->getEnableThrustPIDScaling() == StabilizationSettings::ENABLETHRUSTPIDSCALING_TRUE);
|
||||
ui->thrustPIDScalingCurve->setEnabled(stabSettings->getEnableThrustPIDScaling() == StabilizationSettings::ENABLETHRUSTPIDSCALING_TRUE);
|
||||
}
|
||||
|
||||
@ -187,7 +190,7 @@ void ConfigStabilizationWidget::updateObjectFromThrottleCurve()
|
||||
stabSettings->setThrustPIDScaleCurve(i, curve.at(i));
|
||||
}
|
||||
|
||||
stabSettings->setEnableThrustPIDScaling(ui->thrustPIDScalingGroup->isChecked() ?
|
||||
stabSettings->setEnableThrustPIDScaling(ui->enableThrustPIDScalingCheckBox->isChecked() ?
|
||||
StabilizationSettings::ENABLETHRUSTPIDSCALING_TRUE : StabilizationSettings::ENABLETHRUSTPIDSCALING_FALSE);
|
||||
}
|
||||
|
||||
|
@ -136,8 +136,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>782</width>
|
||||
<height>726</height>
|
||||
<width>798</width>
|
||||
<height>699</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
@ -23932,22 +23932,41 @@ font:bold;</string>
|
||||
<string>Thrust PID Scaling</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QGridLayout" name="gridLayout_27">
|
||||
<item row="0" column="2" rowspan="2">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QPushButton" name="defaultThrottleCurveButton">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="MixerCurve" name="thrustPIDScalingCurve" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
|
||||
@ -23963,28 +23982,26 @@ font:bold;</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QFrame" name="frame_2">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="enableThrustPIDScalingCheckBox">
|
||||
<property name="text">
|
||||
<string>Enable Thrust PID Scaling</string>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_20">
|
||||
<property name="topMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<item alignment="Qt::AlignTop">
|
||||
<widget class="QPushButton" name="defaultThrottleCurveButton">
|
||||
<property name="text">
|
||||
<string>Default</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_61">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user