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
a8efc635
Unverified
Commit
a8efc635
authored
Nov 16, 2019
by
Don Gagne
Committed by
GitHub
Nov 16, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8047 from DonLakeFlyer/NoMetdata
ArduPilot: Group parameters with no metadata correctly
parents
3eec1ca0
4eb9fb49
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
APMParameterMetaData.cc
src/FirmwarePlugin/APM/APMParameterMetaData.cc
+10
-2
APMParameterMetaData.h
src/FirmwarePlugin/APM/APMParameterMetaData.h
+1
-0
No files found.
src/FirmwarePlugin/APM/APMParameterMetaData.cc
View file @
a8efc635
...
...
@@ -129,6 +129,13 @@ QString APMParameterMetaData::mavTypeToString(MAV_TYPE vehicleTypeEnum)
return
vehicleName
;
}
QString
APMParameterMetaData
::
_groupFromParameterName
(
const
QString
&
name
)
{
QString
group
=
name
.
split
(
'_'
).
first
();
return
group
.
remove
(
QRegExp
(
"[0-9]*$"
));
// remove any numbers from the end
}
void
APMParameterMetaData
::
loadParameterFactMetaDataFile
(
const
QString
&
metaDataFile
)
{
if
(
_parameterMetaDataLoaded
)
{
...
...
@@ -232,8 +239,7 @@ void APMParameterMetaData::loadParameterFactMetaDataFile(const QString& metaData
if
(
name
.
contains
(
':'
))
{
name
=
name
.
split
(
':'
).
last
();
}
QString
group
=
name
.
split
(
'_'
).
first
();
group
=
group
.
remove
(
QRegExp
(
"[0-9]*$"
));
// remove any numbers from the end
QString
group
=
_groupFromParameterName
(
name
);
QString
category
=
xml
.
attributes
().
value
(
"user"
).
toString
();
if
(
category
.
isEmpty
())
{
...
...
@@ -435,6 +441,8 @@ void APMParameterMetaData::addMetaDataToFact(Fact* fact, MAV_TYPE vehicleType)
// we don't have data for this fact
if
(
!
rawMetaData
)
{
metaData
->
setCategory
(
QStringLiteral
(
"Advanced"
));
metaData
->
setGroup
(
_groupFromParameterName
(
fact
->
name
()));
fact
->
setMetaData
(
metaData
);
qCDebug
(
APMParameterMetaDataLog
)
<<
"No metaData for "
<<
fact
->
name
()
<<
"using generic metadata"
;
return
;
...
...
src/FirmwarePlugin/APM/APMParameterMetaData.h
View file @
a8efc635
...
...
@@ -80,6 +80,7 @@ private:
bool
parseParameterAttributes
(
QXmlStreamReader
&
xml
,
APMFactMetaDataRaw
*
rawMetaData
);
void
correctGroupMemberships
(
ParameterNametoFactMetaDataMap
&
parameterToFactMetaDataMap
,
QMap
<
QString
,
QStringList
>&
groupMembers
);
QString
mavTypeToString
(
MAV_TYPE
vehicleTypeEnum
);
QString
_groupFromParameterName
(
const
QString
&
name
);
bool
_parameterMetaDataLoaded
;
///< true: parameter meta data already loaded
QMap
<
QString
,
ParameterNametoFactMetaDataMap
>
_vehicleTypeToParametersMap
;
///< Maps from a vehicle type to paramametertoFactMeta map>
...
...
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