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
0e6902e3
Commit
0e6902e3
authored
Nov 07, 2018
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
b974f350
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
ParameterManager.cc
src/FactSystem/ParameterManager.cc
+12
-7
ParameterManager.h
src/FactSystem/ParameterManager.h
+5
-3
No files found.
src/FactSystem/ParameterManager.cc
View file @
0e6902e3
...
...
@@ -351,7 +351,7 @@ void ParameterManager::_parameterUpdate(int vehicleId, int componentId, QString
// When we are getting the very last component param index, reset the group maps to update for the
// new params. By handling this here, we can pick up components which finish up later than the default
// component param set.
_setupCategoryMap
();
_setup
DefaultComponent
CategoryMap
();
}
}
...
...
@@ -529,20 +529,20 @@ QStringList ParameterManager::parameterNames(int componentId)
return
names
;
}
void
ParameterManager
::
_setupCategoryMap
(
void
)
void
ParameterManager
::
_setup
DefaultComponent
CategoryMap
(
void
)
{
// Must be able to handle being called multiple times
_
c
ategoryMap
.
clear
();
_
defaultComponentC
ategoryMap
.
clear
();
for
(
const
QString
&
name
:
_mapParameterName2Variant
[
_vehicle
->
defaultComponentId
()].
keys
())
{
Fact
*
fact
=
_mapParameterName2Variant
[
_vehicle
->
defaultComponentId
()][
name
].
value
<
Fact
*>
();
_
c
ategoryMap
[
fact
->
category
()][
fact
->
group
()]
+=
name
;
_
defaultComponentC
ategoryMap
[
fact
->
category
()][
fact
->
group
()]
+=
name
;
}
}
const
QMap
<
QString
,
QMap
<
QString
,
QStringList
>
>&
ParameterManager
::
getCategoryMap
(
void
)
const
QMap
<
QString
,
QMap
<
QString
,
QStringList
>
>&
ParameterManager
::
get
DefaultComponent
CategoryMap
(
void
)
{
return
_
c
ategoryMap
;
return
_
defaultComponentC
ategoryMap
;
}
/// Requests missing index based parameters from the vehicle.
...
...
@@ -1433,7 +1433,7 @@ void ParameterManager::_loadOfflineEditingParams(void)
}
_addMetaDataToDefaultComponent
();
_setupCategoryMap
();
_setup
DefaultComponent
CategoryMap
();
_parametersReady
=
true
;
_initialLoadComplete
=
true
;
_debugCacheCRC
.
clear
();
...
...
@@ -1567,3 +1567,8 @@ void ParameterManager::_setLoadProgress(double loadProgress)
_loadProgress
=
loadProgress
;
emit
loadProgressChanged
(
loadProgress
);
}
QList
<
int
>
ParameterManager
::
componentIds
(
void
)
{
return
_paramCountMap
.
keys
();
}
src/FactSystem/ParameterManager.h
View file @
0e6902e3
...
...
@@ -49,6 +49,8 @@ public:
/// @return Location of parameter cache file
static
QString
parameterCacheFile
(
int
vehicleId
,
int
componentId
);
QList
<
int
>
componentIds
(
void
);
/// Re-request the full set of parameters from the autopilot
void
refreshAllParameters
(
uint8_t
componentID
=
MAV_COMP_ID_ALL
);
...
...
@@ -75,7 +77,7 @@ public:
/// @param name Parameter name
Fact
*
getParameter
(
int
componentId
,
const
QString
&
name
);
const
QMap
<
QString
,
QMap
<
QString
,
QStringList
>
>&
getCategoryMap
(
void
);
const
QMap
<
QString
,
QMap
<
QString
,
QStringList
>
>&
get
DefaultComponent
CategoryMap
(
void
);
/// Returns error messages from loading
QString
readParametersFromStream
(
QTextStream
&
stream
);
...
...
@@ -128,7 +130,7 @@ protected:
private:
static
QVariant
_stringToTypedVariant
(
const
QString
&
string
,
FactMetaData
::
ValueType_t
type
,
bool
failOk
=
false
);
int
_actualComponentId
(
int
componentId
);
void
_setupCategoryMap
(
void
);
void
_setup
DefaultComponent
CategoryMap
(
void
);
void
_readParameterRaw
(
int
componentId
,
const
QString
&
paramName
,
int
paramIndex
);
void
_writeParameterRaw
(
int
componentId
,
const
QString
&
paramName
,
const
QVariant
&
value
);
void
_writeLocalParamCache
(
int
vehicleId
,
int
componentId
);
...
...
@@ -151,7 +153,7 @@ private:
QMap
<
int
,
QVariantMap
>
_mapParameterName2Variant
;
// Category map of default component parameters
QMap
<
QString
/* category */
,
QMap
<
QString
/* group */
,
QStringList
/* parameter names */
>
>
_
c
ategoryMap
;
QMap
<
QString
/* category */
,
QMap
<
QString
/* group */
,
QStringList
/* parameter names */
>
>
_
defaultComponentC
ategoryMap
;
double
_loadProgress
;
///< Parameter load progess, [0.0,1.0]
bool
_parametersReady
;
///< true: parameter load complete
...
...
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