Browse Source

Fix RadioButton group problems. Rework RTL settings to match correct usage.

QGC4.4
DonLakeFlyer 5 years ago
parent
commit
fcb9308e88
  1. 50
      src/AutoPilotPlugins/APM/APMSafetyComponent.qml

50
src/AutoPilotPlugins/APM/APMSafetyComponent.qml

@ -58,6 +58,7 @@ SetupPage { @@ -58,6 +58,7 @@ SetupPage {
property Fact _armingCheck: controller.getParameterFact(-1, "ARMING_CHECK")
property real _margins: ScreenTools.defaultFontPixelHeight
property real _innerMargin: _margins / 2
property bool _showIcon: !ScreenTools.isTinyScreen
property bool _roverFirmware: controller.parameterExists(-1, "MODE1") // This catches all usage of ArduRover firmware vehicle types: Rover, Boat...
@ -551,8 +552,8 @@ SetupPage { @@ -551,8 +552,8 @@ SetupPage {
Rectangle {
id: rtlSettings
width: rltAltFinalField.x + rltAltFinalField.width + _margins
height: rltAltFinalField.y + rltAltFinalField.height + _margins
width: landSpeedField.x + landSpeedField.width + _margins
height: landSpeedField.y + landSpeedField.height + _margins
color: ggcPal.windowShade
Image {
@ -578,7 +579,7 @@ SetupPage { @@ -578,7 +579,7 @@ SetupPage {
QGCRadioButton {
id: returnAtCurrentRadio
anchors.margins: _margins
anchors.margins: _innerMargin
anchors.left: _showIcon ? icon.right : parent.left
anchors.top: parent.top
text: qsTr("Return at current altitude")
@ -589,9 +590,9 @@ SetupPage { @@ -589,9 +590,9 @@ SetupPage {
QGCRadioButton {
id: returnAltRadio
anchors.topMargin: _margins
anchors.left: returnAtCurrentRadio.left
anchors.topMargin: _innerMargin
anchors.top: returnAtCurrentRadio.bottom
anchors.left: returnAtCurrentRadio.left
text: qsTr("Return at specified altitude:")
checked: _rtlAltFact.value != 0
@ -620,7 +621,7 @@ SetupPage { @@ -620,7 +621,7 @@ SetupPage {
FactTextField {
id: landDelayField
anchors.topMargin: _margins * 1.5
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
anchors.top: rltAltField.bottom
fact: _rtlLoitTimeFact
@ -628,42 +629,33 @@ SetupPage { @@ -628,42 +629,33 @@ SetupPage {
enabled: homeLoiterCheckbox.checked === true
}
QGCRadioButton {
id: landRadio
QGCLabel {
anchors.left: returnAtCurrentRadio.left
anchors.baseline: landSpeedField.baseline
text: qsTr("Land with descent speed:")
checked: _rtlAltFinalFact.value == 0
onClicked: _rtlAltFinalFact.value = 0
anchors.baseline: rltAltFinalField.baseline
text: qsTr("Final land stage altitude:")
}
FactTextField {
id: landSpeedField
anchors.topMargin: _margins * 1.5
anchors.top: landDelayField.bottom
id: rltAltFinalField
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
fact: _landSpeedFact
anchors.top: landDelayField.bottom
fact: _rtlAltFinalFact
showUnits: true
enabled: landRadio.checked
}
QGCRadioButton {
id: finalLoiterRadio
QGCLabel {
anchors.left: returnAtCurrentRadio.left
anchors.baseline: rltAltFinalField.baseline
text: qsTr("Final loiter altitude:")
onClicked: _rtlAltFinalFact.value = _rtlAltFact.value
anchors.baseline: landSpeedField.baseline
text: qsTr("Final land stage descent speed:")
}
FactTextField {
id: rltAltFinalField
anchors.topMargin: _margins / 2
id: landSpeedField
anchors.topMargin: _innerMargin
anchors.left: rltAltField.left
anchors.top: landSpeedField.bottom
fact: _rtlAltFinalFact
enabled: finalLoiterRadio.checked
anchors.top: rltAltFinalField.bottom
fact: _landSpeedFact
showUnits: true
}
} // Rectangle - RTL Settings

Loading…
Cancel
Save