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
848b864d
Commit
848b864d
authored
Dec 30, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2504 from DonLakeFlyer/ArmingChecks
Arming checks added to Safety
parents
fb04b233
3d66fe06
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
7 deletions
+72
-7
APMSafetyComponentCopter.qml
src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml
+31
-3
APMSafetyComponentSummaryCopter.qml
src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml
+7
-0
APMParameterMetaData.cc
src/FirmwarePlugin/APM/APMParameterMetaData.cc
+34
-4
No files found.
src/AutoPilotPlugins/APM/APMSafetyComponentCopter.qml
View file @
848b864d
...
@@ -58,6 +58,8 @@ QGCView {
...
@@ -58,6 +58,8 @@ QGCView {
property
Fact
_rtlLoitTimeFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_LOIT_TIME
"
)
property
Fact
_rtlLoitTimeFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_LOIT_TIME
"
)
property
Fact
_rtlAltFinalFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_ALT_FINAL
"
)
property
Fact
_rtlAltFinalFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_ALT_FINAL
"
)
property
Fact
_armingCheck
:
controller
.
getParameterFact
(
-
1
,
"
ARMING_CHECK
"
)
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
ExclusiveGroup
{
id
:
fenceActionRadioGroup
}
ExclusiveGroup
{
id
:
fenceActionRadioGroup
}
...
@@ -71,9 +73,8 @@ QGCView {
...
@@ -71,9 +73,8 @@ QGCView {
Flickable
{
Flickable
{
clip
:
true
clip
:
true
anchors.fill
:
parent
anchors.fill
:
parent
boundsBehavior
:
Flickable
.
StopAtBounds
contentHeight
:
armingCheckSettings
.
y
+
armingCheckSettings
.
height
contentHeight
:
rtlSettings
.
y
+
rtlSettings
.
height
contentWidth
:
armingCheckSettings
.
x
+
armingCheckSettings
.
width
flickableDirection
:
Flickable
.
VerticalFlick
QGCLabel
{
QGCLabel
{
id
:
failsafeLabel
id
:
failsafeLabel
...
@@ -447,6 +448,33 @@ QGCView {
...
@@ -447,6 +448,33 @@ QGCView {
showUnits
:
true
showUnits
:
true
}
}
}
// Rectangle - RTL Settings
}
// Rectangle - RTL Settings
QGCLabel
{
id
:
armingCheckLabel
anchors.topMargin
:
_margins
anchors.left
:
parent
.
left
anchors.top
:
rtlSettings
.
bottom
text
:
"
Arming Checks
"
font.weight
:
Font
.
DemiBold
}
Rectangle
{
id
:
armingCheckSettings
anchors.topMargin
:
_margins
/
2
anchors.left
:
parent
.
left
anchors.top
:
armingCheckLabel
.
bottom
width
:
armingCheckColumn
.
x
+
armingCheckColumn
.
width
+
_margins
height
:
armingCheckColumn
.
y
+
armingCheckColumn
.
height
+
_margins
color
:
palette
.
windowShade
Column
{
id
:
armingCheckColumn
spacing
:
_margins
QGCLabel
{
text
:
"
Be very careful when turning off arming checks. Could lead to loss of Vehicle control.
"
}
FactBitmask
{
fact
:
_armingCheck
}
}
}
}
// Flickable
}
// Flickable
}
// QGCViewPanel
}
// QGCViewPanel
}
// QGCView
}
// QGCView
src/AutoPilotPlugins/APM/APMSafetyComponentSummaryCopter.qml
View file @
848b864d
...
@@ -26,6 +26,8 @@ FactPanel {
...
@@ -26,6 +26,8 @@ FactPanel {
property
Fact
_rtlAltFinalFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_ALT_FINAL
"
)
property
Fact
_rtlAltFinalFact
:
controller
.
getParameterFact
(
-
1
,
"
RTL_ALT_FINAL
"
)
property
Fact
_landSpeedFact
:
controller
.
getParameterFact
(
-
1
,
"
LAND_SPEED
"
)
property
Fact
_landSpeedFact
:
controller
.
getParameterFact
(
-
1
,
"
LAND_SPEED
"
)
property
Fact
_armingCheck
:
controller
.
getParameterFact
(
-
1
,
"
ARMING_CHECK
"
)
property
string
_failsafeBattEnableText
property
string
_failsafeBattEnableText
property
string
_failsafeThrEnableText
property
string
_failsafeThrEnableText
...
@@ -85,6 +87,11 @@ FactPanel {
...
@@ -85,6 +87,11 @@ FactPanel {
anchors.fill
:
parent
anchors.fill
:
parent
anchors.margins
:
8
anchors.margins
:
8
VehicleSummaryRow
{
labelText
:
"
Arming Checks:
"
valueText
:
_armingCheck
.
value
&
1
?
"
Enabled
"
:
"
Some disabled
"
}
VehicleSummaryRow
{
VehicleSummaryRow
{
labelText
:
"
Throttle failsafe:
"
labelText
:
"
Throttle failsafe:
"
valueText
:
_failsafeThrEnableText
valueText
:
_failsafeThrEnableText
...
...
src/FirmwarePlugin/APM/APMParameterMetaData.cc
View file @
848b864d
...
@@ -523,21 +523,51 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType)
...
@@ -523,21 +523,51 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType)
bool
ok
=
false
;
bool
ok
=
false
;
unsigned
int
bitSet
=
bitmaskPair
.
first
.
toUInt
(
&
ok
);
unsigned
int
bitSet
=
bitmaskPair
.
first
.
toUInt
(
&
ok
);
bitSet
=
1
<<
bitSet
;
bitSet
=
1
<<
bitSet
;
QVariant
typedBitSet
;
switch
(
fact
->
type
())
{
case
FactMetaData
:
:
valueTypeInt8
:
typedBitSet
=
QVariant
((
signed
char
)
bitSet
);
break
;
case
FactMetaData
:
:
valueTypeInt16
:
typedBitSet
=
QVariant
((
short
int
)
bitSet
);
break
;
case
FactMetaData
:
:
valueTypeInt32
:
typedBitSet
=
QVariant
((
int
)
bitSet
);
break
;
case
FactMetaData
:
:
valueTypeUint8
:
case
FactMetaData
:
:
valueTypeUint16
:
case
FactMetaData
:
:
valueTypeUint32
:
typedBitSet
=
QVariant
(
bitSet
);
break
;
default:
break
;
}
if
(
typedBitSet
.
isNull
())
{
qCDebug
(
APMParameterMetaDataLog
)
<<
"Invalid type for bitmask, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
();
}
if
(
!
ok
)
{
if
(
!
ok
)
{
qCDebug
(
APMParameterMetaDataLog
)
<<
"Invalid bitmask value, name:"
<<
metaData
->
name
()
qCDebug
(
APMParameterMetaDataLog
)
<<
"Invalid bitmask value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
bit
maskPair
.
firs
t
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
bit
Se
t
<<
" error:
"
<<
errorString
;
<<
" error:
toUInt failed"
;
bitmaskStrings
.
clear
();
bitmaskStrings
.
clear
();
bitmaskValues
.
clear
();
bitmaskValues
.
clear
();
break
;
break
;
}
}
if
(
metaData
->
convertAndValidateRaw
(
b
itSet
,
false
/* validate */
,
bitmaskValue
,
errorString
))
{
if
(
metaData
->
convertAndValidateRaw
(
typedB
itSet
,
false
/* validate */
,
bitmaskValue
,
errorString
))
{
bitmaskValues
<<
bitmaskValue
;
bitmaskValues
<<
bitmaskValue
;
bitmaskStrings
<<
bitmaskPair
.
second
;
bitmaskStrings
<<
bitmaskPair
.
second
;
}
else
{
}
else
{
qCDebug
(
APMParameterMetaDataLog
)
<<
"Invalid bitmask value, name:"
<<
metaData
->
name
()
qCDebug
(
APMParameterMetaDataLog
)
<<
"Invalid bitmask value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
bitmaskPair
.
firs
t
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
typedBitSe
t
<<
" error:"
<<
errorString
;
<<
" error:"
<<
errorString
;
bitmaskStrings
.
clear
();
bitmaskStrings
.
clear
();
bitmaskValues
.
clear
();
bitmaskValues
.
clear
();
...
...
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