Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
da45a457
Commit
da45a457
authored
Oct 10, 2016
by
Rustom Jehangir
Browse files
Improve Sub safety page to match firmware capabilities
parent
adc0c941
Changes
2
Show whitespace changes
Inline
Side-by-side
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
View file @
da45a457
...
...
@@ -28,11 +28,11 @@ QGCView {
QGCPalette
{
id
:
ggcPal
;
colorGroupEnabled
:
enabled
}
property
Fact
_failsafeGCSEnable
:
controller
.
getParameterFact
(
-
1
,
"
FS_GCS_ENABLE
"
)
property
Fact
_failsafe
Batt
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
BATT
_ENABLE
"
)
property
Fact
_failsafe
BattMah
:
controller
.
getParameterFact
(
-
1
,
"
FS_
BATT_MAH
"
)
property
Fact
_failsafe
BattVoltag
e
:
controller
.
getParameterFact
(
-
1
,
"
FS_
BATT_VOLTAGE
"
)
property
Fact
_failsafeT
hr
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_T
HR
_ENABLE
"
)
property
Fact
_failsafeT
hr
Value
:
controller
.
getParameterFact
(
-
1
,
"
FS_T
HR_VALUE
"
)
property
Fact
_failsafe
Leak
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
LEAK
_ENABLE
"
)
property
Fact
_failsafe
PressureEnable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
PRESS_ENABLE
"
)
property
Fact
_failsafe
PressureValu
e
:
controller
.
getParameterFact
(
-
1
,
"
FS_
PRESS_MAX
"
)
property
Fact
_failsafeT
emp
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_T
EMP
_ENABLE
"
)
property
Fact
_failsafeT
emp
Value
:
controller
.
getParameterFact
(
-
1
,
"
FS_T
EMP_MAX
"
)
property
Fact
_fenceAction
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ACTION
"
)
property
Fact
_fenceAltMax
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ALT_MAX
"
)
...
...
@@ -70,14 +70,14 @@ QGCView {
QGCLabel
{
id
:
failsafeLabel
text
:
qsTr
(
"
Failsafe
Trigger
s
"
)
text
:
qsTr
(
"
Failsafe
Action
s
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
Rectangle
{
id
:
failsafeSettings
width
:
thrott
leEnableCombo
.
x
+
thrott
leEnableCombo
.
width
+
_margins
height
:
mahField
.
y
+
mahField
.
height
+
_margins
width
:
le
ak
EnableCombo
.
x
+
le
ak
EnableCombo
.
width
+
_margins
height
:
leakEnableCombo
.
y
+
leakEnableCombo
.
height
+
_margins
color
:
ggcPal
.
windowShade
QGCLabel
{
...
...
@@ -90,111 +90,30 @@ QGCView {
FactComboBox
{
id
:
gcsEnableCombo
anchors.topMargin
:
_margins
anchors.leftMargin
:
_margins
anchors.margins
:
_margins
anchors.left
:
gcsEnableLabel
.
right
anchors.top
:
parent
.
top
width
:
voltageField
.
w
idth
width
:
ScreenTools
.
defaultFontPixelW
idth
*
15
fact
:
_failsafeGCSEnable
indexModel
:
false
}
QGCLabel
{
id
:
thrott
leEnableLabel
id
:
le
ak
EnableLabel
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.baseline
:
thrott
leEnableCombo
.
baseline
text
:
qsTr
(
"
Throttle
failsafe:
"
)
anchors.baseline
:
le
ak
EnableCombo
.
baseline
text
:
qsTr
(
"
Leak
failsafe:
"
)
}
QGC
ComboBox
{
id
:
thrott
leEnableCombo
Fact
ComboBox
{
id
:
le
ak
EnableCombo
anchors.topMargin
:
_margins
anchors.left
:
gcsEnableCombo
.
left
anchors.top
:
gcsEnableCombo
.
bottom
width
:
voltageField
.
width
model
:
[
qsTr
(
"
Disabled
"
),
qsTr
(
"
Always RTL
"
),
qsTr
(
"
Continue with Mission in Auto Mode
"
),
qsTr
(
"
Always Land
"
)]
currentIndex
:
_failsafeThrEnable
.
value
onActivated
:
_failsafeThrEnable
.
value
=
index
}
QGCLabel
{
id
:
throttlePWMLabel
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.baseline
:
throttlePWMField
.
baseline
text
:
qsTr
(
"
PWM threshold:
"
)
}
FactTextField
{
id
:
throttlePWMField
anchors.topMargin
:
_margins
/
2
anchors.left
:
gcsEnableCombo
.
left
anchors.top
:
throttleEnableCombo
.
bottom
fact
:
_failsafeThrValue
showUnits
:
true
}
QGCLabel
{
id
:
batteryEnableLabel
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.baseline
:
batteryEnableCombo
.
baseline
text
:
qsTr
(
"
Battery failsafe:
"
)
}
QGCComboBox
{
id
:
batteryEnableCombo
anchors.topMargin
:
_margins
anchors.left
:
gcsEnableCombo
.
left
anchors.top
:
throttlePWMField
.
bottom
width
:
voltageField
.
width
model
:
[
qsTr
(
"
Disabled
"
),
qsTr
(
"
Land
"
),
qsTr
(
"
Return to Launch
"
)]
currentIndex
:
_failsafeBattEnable
.
value
onActivated
:
_failsafeBattEnable
.
value
=
index
}
QGCCheckBox
{
id
:
voltageLabel
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.baseline
:
voltageField
.
baseline
text
:
qsTr
(
"
Voltage threshold:
"
)
checked
:
_failsafeBattVoltage
.
value
!=
0
onClicked
:
_failsafeBattVoltage
.
value
=
checked
?
10.5
:
0
}
FactTextField
{
id
:
voltageField
anchors.topMargin
:
_margins
/
2
anchors.left
:
gcsEnableCombo
.
left
anchors.top
:
batteryEnableCombo
.
bottom
fact
:
_failsafeBattVoltage
showUnits
:
true
}
QGCCheckBox
{
id
:
mahLabel
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.baseline
:
mahField
.
baseline
text
:
qsTr
(
"
MAH threshold:
"
)
checked
:
_failsafeBattMah
.
value
!=
0
onClicked
:
_failsafeBattMah
.
value
=
checked
?
600
:
0
}
FactTextField
{
id
:
mahField
anchors.topMargin
:
_margins
/
2
anchors.left
:
gcsEnableCombo
.
left
anchors.top
:
voltageField
.
bottom
fact
:
_failsafeBattMah
showUnits
:
true
width
:
ScreenTools
.
defaultFontPixelWidth
*
15
fact
:
_failsafeLeakEnable
indexModel
:
false
}
}
// Rectangle - Failsafe Settings
}
// Column - Failsafe Settings
...
...
@@ -216,11 +135,10 @@ QGCView {
QGCCheckBox
{
id
:
altitudeGeo
enabled
:
false
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.top
:
parent
.
top
text
:
qsTr
(
"
Depth GeoFence enabled
"
)
text
:
qsTr
(
"
Depth GeoFence enabled
\n
(report only)
"
)
checked
:
_fenceEnable
.
value
!=
0
&&
_fenceType
.
value
&
1
onClicked
:
{
...
...
@@ -238,35 +156,8 @@ QGCView {
}
}
QGCRadioButton
{
id
:
geoReportRadio
enabled
:
false
anchors.margins
:
_margins
anchors.left
:
parent
.
left
anchors.top
:
altitudeGeo
.
bottom
text
:
qsTr
(
"
Report only
"
)
exclusiveGroup
:
fenceActionRadioGroup
checked
:
_fenceAction
.
value
==
0
onClicked
:
_fenceAction
.
value
=
0
}
QGCRadioButton
{
id
:
geoRTLRadio
enabled
:
false
anchors.topMargin
:
_margins
/
2
anchors.left
:
altitudeGeo
.
left
anchors.top
:
geoReportRadio
.
bottom
text
:
qsTr
(
"
RTL or Land
"
)
exclusiveGroup
:
fenceActionRadioGroup
checked
:
_fenceAction
.
value
==
1
onClicked
:
_fenceAction
.
value
=
1
}
QGCLabel
{
id
:
fenceAltMaxLabel
enabled
:
false
anchors.left
:
altitudeGeo
.
left
anchors.baseline
:
fenceAltMaxField
.
baseline
text
:
qsTr
(
"
Max depth:
"
)
...
...
@@ -274,11 +165,10 @@ QGCView {
FactTextField
{
id
:
fenceAltMaxField
enabled
:
false
anchors.topMargin
:
_margins
/
2
anchors.leftMargin
:
_margins
anchors.left
:
fenceAltMaxLabel
.
right
anchors.top
:
geoRTLRadi
o
.
bottom
anchors.top
:
altitudeGe
o
.
bottom
fact
:
_fenceAltMax
showUnits
:
true
}
...
...
@@ -313,7 +203,7 @@ QGCView {
anchors.margins
:
_margins
anchors.left
:
leakLogicLabel
.
right
anchors.baseline
:
leakPinLabel
.
baseline
width
:
voltageField
.
w
idth
width
:
ScreenTools
.
defaultFontPixelW
idth
*
15
fact
:
_leakPin
indexModel
:
false
}
...
...
@@ -331,7 +221,7 @@ QGCView {
anchors.margins
:
_margins
anchors.left
:
leakLogicLabel
.
right
anchors.baseline
:
leakLogicLabel
.
baseline
width
:
voltageField
.
w
idth
width
:
ScreenTools
.
defaultFontPixelW
idth
*
15
fact
:
_leakLogic
indexModel
:
false
}
...
...
src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml
View file @
da45a457
...
...
@@ -14,8 +14,8 @@ FactPanel {
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
FactPanelController
{
id
:
controller
;
factPanel
:
panel
}
property
Fact
_failsafe
Batt
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
BATT
_ENABLE
"
)
property
Fact
_failsafe
Thr
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
THR
_ENABLE
"
)
property
Fact
_failsafe
GCS
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
GCS
_ENABLE
"
)
property
Fact
_failsafe
Leak
Enable
:
controller
.
getParameterFact
(
-
1
,
"
FS_
LEAK
_ENABLE
"
)
property
Fact
_fenceAction
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ACTION
"
)
property
Fact
_fenceEnable
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ENABLE
"
)
...
...
@@ -25,58 +25,31 @@ FactPanel {
property
Fact
_armingCheck
:
controller
.
getParameterFact
(
-
1
,
"
ARMING_CHECK
"
)
property
string
_failsafeBattEnableText
property
string
_failsafeThrEnableText
property
string
_failsafeGCSEnableText
Component.onCompleted
:
{
setFailsafeBattEnableText
()
setFailsafeThrEnableText
()
setFailsafeGCSEnableText
()
}
Connections
{
target
:
_failsafe
Batt
Enable
target
:
_failsafe
GCS
Enable
onValueChanged
:
setFailsafe
Batt
EnableText
()
onValueChanged
:
setFailsafe
GCS
EnableText
()
}
Connections
{
target
:
_failsafeThrEnable
onValueChanged
:
setFailsafeThrEnableText
()
}
function
setFailsafeThrEnableText
()
{
switch
(
_failsafeThrEnable
.
value
)
{
case
0
:
_failsafeThrEnableText
=
qsTr
(
"
Disabled
"
)
break
case
1
:
_failsafeThrEnableText
=
qsTr
(
"
Always RTL
"
)
break
case
2
:
_failsafeThrEnableText
=
qsTr
(
"
Continue with Mission in Auto Mode
"
)
break
case
3
:
_failsafeThrEnableText
=
qsTr
(
"
Always Land
"
)
break
default
:
_failsafeThrEnableText
=
qsTr
(
"
Unknown
"
)
}
}
function
setFailsafeBattEnableText
()
{
switch
(
_failsafeBattEnable
.
value
)
{
function
setFailsafeGCSEnableText
()
{
switch
(
_failsafeGCSEnable
.
value
)
{
case
0
:
_failsafe
Batt
EnableText
=
qsTr
(
"
Disabled
"
)
_failsafe
GCS
EnableText
=
qsTr
(
"
Disabled
"
)
break
case
1
:
_failsafe
Batt
EnableText
=
qsTr
(
"
Land
"
)
_failsafe
GCS
EnableText
=
qsTr
(
"
Always RTL
"
)
break
case
2
:
_failsafe
Batt
EnableText
=
qsTr
(
"
Return to Launch
"
)
_failsafe
GCS
EnableText
=
qsTr
(
"
Continue with Mission in Auto Mode
"
)
break
default
:
_failsafe
Thr
EnableText
=
qsTr
(
"
Unknown
"
)
_failsafe
GCS
EnableText
=
qsTr
(
"
Unknown
"
)
}
}
...
...
@@ -89,13 +62,13 @@ FactPanel {
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Throttle
failsafe:
"
)
valueText
:
_failsafe
Thr
EnableText
labelText
:
qsTr
(
"
GCS
failsafe:
"
)
valueText
:
_failsafe
GCS
EnableText
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Battery
failsafe:
"
)
valueText
:
_failsafe
BattEnableText
labelText
:
qsTr
(
"
Leak
failsafe:
"
)
valueText
:
_failsafe
LeakEnable
.
value
?
qsTr
(
"
Enabled
"
)
:
qsTr
(
"
Disabled
"
)
}
VehicleSummaryRow
{
...
...
@@ -108,15 +81,13 @@ FactPanel {
valueText
:
_fenceEnable
.
value
==
0
||
_fenceType
==
0
?
qsTr
(
"
Disabled
"
)
:
(
_fenceType
.
value
==
1
?
qsTr
(
"
Altitude
"
)
:
(
_fenceType
.
value
==
2
?
qsTr
(
"
Circle
"
)
:
qsTr
(
"
Altitude
,Circle
"
)))
qsTr
(
"
Depth
"
)
:
(
_fenceType
.
value
==
2
?
qsTr
(
"
Circle
"
)
:
qsTr
(
"
Depth
,Circle
"
)))
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
GeoFence:
"
)
valueText
:
_fenceAction
.
value
==
0
?
qsTr
(
"
Report only
"
)
:
(
_fenceAction
.
value
==
1
?
qsTr
(
"
RTL or Land
"
)
:
qsTr
(
"
Unknown
"
))
valueText
:
qsTr
(
"
Report only
"
)
visible
:
_fenceEnable
.
value
!=
0
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment