Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
186f0bff
Commit
186f0bff
authored
Oct 13, 2015
by
Nate Weibley
Browse files
Remove duplicated enum conversion function
parent
c9123adf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/FactSystem/ParameterLoader.cc
View file @
186f0bff
...
...
@@ -602,42 +602,6 @@ void ParameterLoader::_writeLocalParamCache()
ds
<<
cache_map
;
}
static
MAV_PARAM_TYPE
factType2MavParamType
(
int
factType
)
{
MAV_PARAM_TYPE
paramType
;
switch
(
factType
)
{
case
FactMetaData
::
valueTypeUint8
:
paramType
=
MAV_PARAM_TYPE_UINT8
;
break
;
case
FactMetaData
::
valueTypeInt8
:
paramType
=
MAV_PARAM_TYPE_INT8
;
break
;
case
FactMetaData
::
valueTypeUint16
:
paramType
=
MAV_PARAM_TYPE_UINT16
;
break
;
case
FactMetaData
::
valueTypeInt16
:
paramType
=
MAV_PARAM_TYPE_INT16
;
break
;
case
FactMetaData
::
valueTypeUint32
:
paramType
=
MAV_PARAM_TYPE_UINT32
;
break
;
case
FactMetaData
::
valueTypeInt32
:
paramType
=
MAV_PARAM_TYPE_INT32
;
break
;
case
FactMetaData
::
valueTypeFloat
:
paramType
=
MAV_PARAM_TYPE_REAL32
;
break
;
case
FactMetaData
::
valueTypeDouble
:
paramType
=
MAV_PARAM_TYPE_REAL64
;
break
;
default:
paramType
=
MAV_PARAM_TYPE_INT32
;
qCritical
()
<<
"Unsupported fact type"
<<
factType
;
break
;
}
return
paramType
;
}
void
ParameterLoader
::
_tryCacheHashLoad
(
int
uasId
,
QVariant
hash_value
)
{
uint32_t
crc32_value
=
0
;
...
...
@@ -673,7 +637,7 @@ void ParameterLoader::_tryCacheHashLoad(int uasId, QVariant hash_value)
foreach
(
int
id
,
cache_map
[
component
].
keys
())
{
const
QString
&
name
=
cache_map
[
component
][
id
].
first
;
const
QVariant
&
value
=
cache_map
[
component
][
id
].
second
.
second
;
const
int
mavType
=
factType
2
Mav
Param
Type
(
cache_map
[
component
][
id
].
second
.
first
);
const
int
mavType
=
_
factType
To
Mav
Type
(
static_cast
<
FactMetaData
::
Value
Type
_t
>
(
cache_map
[
component
][
id
].
second
.
first
)
)
;
_parameterUpdate
(
uasId
,
component
,
name
,
count
,
id
,
mavType
,
value
);
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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