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
711ee0b2
Commit
711ee0b2
authored
Jul 04, 2016
by
Don Gagne
Committed by
GitHub
Jul 04, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3723 from dagar/px4_bitmask
PX4 add bitmask for param metadata
parents
4d65ea29
1bbda886
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
492 additions
and
426 deletions
+492
-426
AirframeFactMetaData.xml
src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
+91
-87
PX4ParameterFactMetaData.xml
src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
+375
-339
PX4ParameterMetaData.cc
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
+26
-0
No files found.
src/AutoPilotPlugins/PX4/AirframeFactMetaData.xml
View file @
711ee0b2
This diff is collapsed.
Click to expand it.
src/FirmwarePlugin/PX4/PX4ParameterFactMetaData.xml
View file @
711ee0b2
This diff is collapsed.
Click to expand it.
src/FirmwarePlugin/PX4/PX4ParameterMetaData.cc
View file @
711ee0b2
...
...
@@ -312,6 +312,32 @@ void PX4ParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
metaData
->
convertAndValidateRaw
(
0
,
false
/* validate */
,
enumValue
,
errorString
);
metaData
->
addEnumInfo
(
tr
(
"Disabled"
),
enumValue
);
}
else
if
(
elementName
==
"bitmask"
)
{
// doing nothing individual bits will follow anyway. May be used for sanity checking.
}
else
if
(
elementName
==
"bit"
)
{
bool
ok
=
false
;
unsigned
char
bit
=
xml
.
attributes
().
value
(
"index"
).
toString
().
toUInt
(
&
ok
);
if
(
ok
)
{
QString
bitDescription
=
xml
.
readElementText
();
qCDebug
(
PX4ParameterMetaDataLog
)
<<
"parameter value:"
<<
"index:"
<<
bit
<<
"description:"
<<
bitDescription
;
if
(
bit
<
31
)
{
QVariant
bitmaskRawValue
=
1
<<
bit
;
QVariant
bitmaskValue
;
QString
errorString
;
if
(
metaData
->
convertAndValidateRaw
(
bitmaskRawValue
,
true
,
bitmaskValue
,
errorString
))
{
metaData
->
addBitmaskInfo
(
bitDescription
,
bitmaskValue
);
}
else
{
qCDebug
(
PX4ParameterMetaDataLog
)
<<
"Invalid bitmask value, name:"
<<
metaData
->
name
()
<<
" type:"
<<
metaData
->
type
()
<<
" value:"
<<
bitmaskValue
<<
" error:"
<<
errorString
;
}
}
else
{
qCWarning
(
PX4ParameterMetaDataLog
)
<<
"Invalid value for bitmask, bit:"
<<
bit
;
}
}
}
else
{
qCDebug
(
PX4ParameterMetaDataLog
)
<<
"Unknown element in XML: "
<<
elementName
;
}
...
...
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