Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
99d161ed
Commit
99d161ed
authored
Oct 07, 2016
by
Rustom Jehangir
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add safety component for Sub firmware.
parent
a93076dd
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
516 additions
and
0 deletions
+516
-0
qgroundcontrol.qrc
qgroundcontrol.qrc
+2
-0
APMSafetyComponent.cc
src/AutoPilotPlugins/APM/APMSafetyComponent.cc
+6
-0
APMSafetyComponentSub.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
+385
-0
APMSafetyComponentSummarySub.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml
+123
-0
No files found.
qgroundcontrol.qrc
View file @
99d161ed
...
...
@@ -149,9 +149,11 @@
<file alias="APMSafetyComponentCopter.qml">src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml</file>
<file alias="APMSafetyComponentPlane.qml">src/AutoPilotPlugins/APM/APMSafetyComponentPlane.qml</file>
<file alias="APMSafetyComponentRover.qml">src/AutoPilotPlugins/APM/APMSafetyComponentRover.qml</file>
<file alias="APMSafetyComponentSub.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml</file>
<file alias="APMSafetyComponentSummaryCopter.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml</file>
<file alias="APMSafetyComponentSummaryPlane.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryPlane.qml</file>
<file alias="APMSafetyComponentSummaryRover.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummaryRover.qml</file>
<file alias="APMSafetyComponentSummarySub.qml">src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml</file>
<file alias="APMTuningComponentCopter.qml">src/AutoPilotPlugins/APM/APMTuningComponentCopter.qml</file>
<file alias="CameraComponent.qml">src/AutoPilotPlugins/PX4/CameraComponent.qml</file>
<file alias="CameraComponentSummary.qml">src/AutoPilotPlugins/PX4/CameraComponentSummary.qml</file>
...
...
src/AutoPilotPlugins/APM/APMSafetyComponent.cc
View file @
99d161ed
...
...
@@ -69,6 +69,9 @@ QUrl APMSafetyComponent::setupSource(void) const
case
MAV_TYPE_TRICOPTER
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentCopter.qml"
);
break
;
case
MAV_TYPE_SUBMARINE
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentSub.qml"
);
break
;
case
MAV_TYPE_GROUND_ROVER
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentRover.qml"
);
break
;
...
...
@@ -96,6 +99,9 @@ QUrl APMSafetyComponent::summaryQmlSource(void) const
case
MAV_TYPE_TRICOPTER
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentSummaryCopter.qml"
);
break
;
case
MAV_TYPE_SUBMARINE
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentSummarySub.qml"
);
break
;
case
MAV_TYPE_GROUND_ROVER
:
qmlFile
=
QStringLiteral
(
"qrc:/qml/APMSafetyComponentSummaryRover.qml"
);
break
;
...
...
src/AutoPilotPlugins/APM/APMSafetyComponentSub.qml
0 → 100644
View file @
99d161ed
This diff is collapsed.
Click to expand it.
src/AutoPilotPlugins/APM/APMSafetyComponentSummarySub.qml
0 → 100644
View file @
99d161ed
import
QtQuick
2.2
import
QtQuick
.
Controls
1.2
import
QGroundControl
.
FactSystem
1.0
import
QGroundControl
.
FactControls
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
Palette
1.0
FactPanel
{
id
:
panel
anchors.fill
:
parent
color
:
qgcPal
.
windowShadeDark
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
enabled
}
FactPanelController
{
id
:
controller
;
factPanel
:
panel
}
property
Fact
_failsafeBattEnable
:
controller
.
getParameterFact
(
-
1
,
"
FS_BATT_ENABLE
"
)
property
Fact
_failsafeThrEnable
:
controller
.
getParameterFact
(
-
1
,
"
FS_THR_ENABLE
"
)
property
Fact
_fenceAction
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ACTION
"
)
property
Fact
_fenceEnable
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_ENABLE
"
)
property
Fact
_fenceType
:
controller
.
getParameterFact
(
-
1
,
"
FENCE_TYPE
"
)
property
Fact
_leakPin
:
controller
.
getParameterFact
(
-
1
,
"
WD_1_PIN
"
)
property
Fact
_armingCheck
:
controller
.
getParameterFact
(
-
1
,
"
ARMING_CHECK
"
)
property
string
_failsafeBattEnableText
property
string
_failsafeThrEnableText
Component.onCompleted
:
{
setFailsafeBattEnableText
()
setFailsafeThrEnableText
()
}
Connections
{
target
:
_failsafeBattEnable
onValueChanged
:
setFailsafeBattEnableText
()
}
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
)
{
case
0
:
_failsafeBattEnableText
=
qsTr
(
"
Disabled
"
)
break
case
1
:
_failsafeBattEnableText
=
qsTr
(
"
Land
"
)
break
case
2
:
_failsafeBattEnableText
=
qsTr
(
"
Return to Launch
"
)
break
default
:
_failsafeThrEnableText
=
qsTr
(
"
Unknown
"
)
}
}
Column
{
anchors.fill
:
parent
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Arming Checks:
"
)
valueText
:
_armingCheck
.
value
&
1
?
qsTr
(
"
Enabled
"
)
:
qsTr
(
"
Some disabled
"
)
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Throttle failsafe:
"
)
valueText
:
_failsafeThrEnableText
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Battery failsafe:
"
)
valueText
:
_failsafeBattEnableText
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
Leak Detector:
"
)
valueText
:
_leakPin
.
value
>
0
?
qsTr
(
"
Enabled
"
)
:
qsTr
(
"
Disabled
"
)
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
GeoFence:
"
)
valueText
:
_fenceEnable
.
value
==
0
||
_fenceType
==
0
?
qsTr
(
"
Disabled
"
)
:
(
_fenceType
.
value
==
1
?
qsTr
(
"
Altitude
"
)
:
(
_fenceType
.
value
==
2
?
qsTr
(
"
Circle
"
)
:
qsTr
(
"
Altitude,Circle
"
)))
}
VehicleSummaryRow
{
labelText
:
qsTr
(
"
GeoFence:
"
)
valueText
:
_fenceAction
.
value
==
0
?
qsTr
(
"
Report only
"
)
:
(
_fenceAction
.
value
==
1
?
qsTr
(
"
RTL or Land
"
)
:
qsTr
(
"
Unknown
"
))
visible
:
_fenceEnable
.
value
!=
0
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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