Commit 50ab2ed9 authored by Don Gagne's avatar Don Gagne

Merge pull request #3192 from DonLakeFlyer/SafetyConfig

Fix RTL_LAND_DELAY usage
parents 35aeb8be 0209165f
...@@ -45,9 +45,10 @@ QGCView { ...@@ -45,9 +45,10 @@ QGCView {
property real _margins: ScreenTools.defaultFontPixelHeight property real _margins: ScreenTools.defaultFontPixelHeight
property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION") property Fact _fenceAction: controller.getParameterFact(-1, "GF_ACTION")
property Fact _fenceRadius: controller.getParameterFact(-1, "GF_MAX_HOR_DIST") property Fact _fenceRadius: controller.getParameterFact(-1, "GF_MAX_HOR_DIST")
property Fact _fenceAlt: controller.getParameterFact(-1, "GF_MAX_VER_DIST") property Fact _fenceAlt: controller.getParameterFact(-1, "GF_MAX_VER_DIST")
property Fact _rtlLandDelay: controller.getParameterFact(-1, "RTL_LAND_DELAY")
QGCViewPanel { QGCViewPanel {
id: panel id: panel
...@@ -245,26 +246,47 @@ QGCView { ...@@ -245,26 +246,47 @@ QGCView {
showUnits: true showUnits: true
} }
QGCCheckBox { QGCLabel {
id: homeLoiterCheckbox id: returnHomeLabel
anchors.topMargin: _margins
anchors.top: climbField.bottom
anchors.left: climbLabel.left
text: "Return Home, then:"
}
ExclusiveGroup { id: homeLoiterGroup }
QGCRadioButton {
id: homeLoiterNoLandRadio
anchors.topMargin: _margins
anchors.top: returnHomeLabel.bottom
anchors.left: climbLabel.left
checked: _rtlLandDelay.value < 0
exclusiveGroup: homeLoiterGroup
text: "Loiter at Home altitude, do not land"
onClicked: _rtlLandDelay.value = -1
}
QGCRadioButton {
id: homeLoiterLandRadio
anchors.baseline: landDelayField.baseline anchors.baseline: landDelayField.baseline
anchors.left: climbLabel.left anchors.left: climbLabel.left
checked: fact.value > 0 checked: _rtlLandDelay.value >= 0
exclusiveGroup: homeLoiterGroup
text: "Loiter at Home altitude for" text: "Loiter at Home altitude for"
property Fact fact: controller.getParameterFact(-1, "RTL_LAND_DELAY") onClicked: _rtlLandDelay.value = 60
onClicked: fact.value = checked ? 60 : -1
} }
FactTextField { FactTextField {
id: landDelayField id: landDelayField
anchors.margins: _margins anchors.margins: _margins
anchors.left: homeLoiterCheckbox.right anchors.left: homeLoiterLandRadio.right
anchors.top: climbField.bottom anchors.top: homeLoiterNoLandRadio.bottom
fact: controller.getParameterFact(-1, "RTL_LAND_DELAY") fact: controller.getParameterFact(-1, "RTL_LAND_DELAY")
showUnits: true showUnits: true
enabled: homeLoiterCheckbox.checked === true enabled: homeLoiterLandRadio.checked === true
} }
QGCLabel { QGCLabel {
...@@ -272,7 +294,7 @@ QGCView { ...@@ -272,7 +294,7 @@ QGCView {
anchors.baseline: descendField.baseline anchors.baseline: descendField.baseline
anchors.left: climbLabel.left anchors.left: climbLabel.left
color: palette.text color: palette.text
enabled: homeLoiterCheckbox.checked === true enabled: homeLoiterLandRadio.checked === true
} }
FactTextField { FactTextField {
...@@ -281,7 +303,7 @@ QGCView { ...@@ -281,7 +303,7 @@ QGCView {
anchors.left: landDelayField.left anchors.left: landDelayField.left
anchors.top: landDelayField.bottom anchors.top: landDelayField.bottom
fact: controller.getParameterFact(-1, "RTL_DESCEND_ALT") fact: controller.getParameterFact(-1, "RTL_DESCEND_ALT")
enabled: homeLoiterCheckbox.checked === true enabled: homeLoiterLandRadio.checked === true
showUnits: true showUnits: true
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment