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
5e4f36cc
Commit
5e4f36cc
authored
Aug 25, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support 'FOO<#>_BAR` param name metadata
parent
6776c676
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9732 additions
and
14181 deletions
+9732
-14181
CompInfoParam.cc
src/Vehicle/CompInfoParam.cc
+13
-2
CompInfoParam.h
src/Vehicle/CompInfoParam.h
+1
-1
MockLink.Parameter.MetaData.json
src/comm/MockLink.Parameter.MetaData.json
+9718
-14178
No files found.
src/Vehicle/CompInfoParam.cc
View file @
5e4f36cc
...
...
@@ -22,7 +22,8 @@ QGC_LOGGING_CATEGORY(CompInfoParamLog, "CompInfoParamLog")
const
char
*
CompInfoParam
::
_jsonScopeKey
=
"scope"
;
const
char
*
CompInfoParam
::
_jsonParametersKey
=
"parameters"
;
const
char
*
CompInfoParam
::
_cachedMetaDataFilePrefix
=
"ParameterFactMetaData"
;
const
char
*
CompInfoParam
::
_cachedMetaDataFilePrefix
=
"ParameterFactMetaData"
;
const
char
*
CompInfoParam
::
_parameterIndexTag
=
"<#>"
;
CompInfoParam
::
CompInfoParam
(
uint8_t
compId
,
Vehicle
*
vehicle
,
QObject
*
parent
)
:
CompInfo
(
COMP_METADATA_TYPE_PARAMETER
,
compId
,
vehicle
,
parent
)
...
...
@@ -84,10 +85,20 @@ FactMetaData* CompInfoParam::factMetaDataForName(const QString& name, FactMetaDa
if
(
_opaqueParameterMetaData
)
{
return
vehicle
->
firmwarePlugin
()
->
_getMetaDataForFact
(
_opaqueParameterMetaData
,
name
,
type
,
vehicle
->
vehicleType
());
}
else
{
QString
indexTagName
=
name
;
if
(
!
_nameToMetaDataMap
.
contains
(
name
))
{
// Checked for indexed parameter names: "FOO<#>_BAR" will match "FOO1_BAR"
QRegularExpression
regex
(
"
\\
d+"
);
indexTagName
=
indexTagName
.
replace
(
regex
,
_parameterIndexTag
);
if
(
!
_nameToMetaDataMap
.
contains
(
indexTagName
))
{
indexTagName
.
clear
();
}
}
if
(
indexTagName
.
isEmpty
())
{
indexTagName
=
name
;
_nameToMetaDataMap
[
name
]
=
new
FactMetaData
(
type
,
this
);
}
return
_nameToMetaDataMap
[
n
ame
];
return
_nameToMetaDataMap
[
indexTagN
ame
];
}
}
...
...
src/Vehicle/CompInfoParam.h
View file @
5e4f36cc
...
...
@@ -49,7 +49,7 @@ private:
QObject
*
_opaqueParameterMetaData
=
nullptr
;
static
const
char
*
_cachedMetaDataFilePrefix
;
static
const
char
*
_jsonScopeKey
;
static
const
char
*
_jsonParametersKey
;
static
const
char
*
_parameterIndexTag
;
};
src/comm/MockLink.Parameter.MetaData.json
View file @
5e4f36cc
This diff is collapsed.
Click to expand it.
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