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
15bc15e8
Commit
15bc15e8
authored
Jul 30, 2015
by
Lorenz Meier
Browse files
Airframe component controller: Load from map instead of array
parent
acbacef3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/AutoPilotPlugins/PX4/AirframeComponentController.cc
View file @
15bc15e8
...
...
@@ -58,13 +58,19 @@ AirframeComponentController::AirframeComponentController(void) :
bool
autostartFound
=
false
;
_autostartId
=
getParameterFact
(
FactSystem
::
defaultComponentId
,
"SYS_AUTOSTART"
)
->
value
().
toInt
();
for
(
const
AirframeComponentAirframes
::
AirframeType_t
*
pType
=&
AirframeComponentAirframes
::
rgAirframeTypes
[
0
];
pType
->
name
!=
NULL
;
pType
++
)
{
for
(
unsigned
tindex
=
0
;
tindex
<
AirframeComponentAirframes
::
rgAirframeTypes
.
count
();
tindex
++
)
{
const
AirframeComponentAirframes
::
AirframeType_t
*
pType
=
&
AirframeComponentAirframes
::
rgAirframeTypes
.
values
().
at
(
tindex
);
AirframeType
*
airframeType
=
new
AirframeType
(
pType
->
name
,
pType
->
imageResource
,
this
);
Q_CHECK_PTR
(
airframeType
);
int
index
=
0
;
for
(
const
AirframeComponentAirframes
::
AirframeInfo_t
*
pInfo
=&
pType
->
rgAirframeInfo
[
0
];
pInfo
->
name
!=
NULL
;
pInfo
++
)
{
for
(
unsigned
index
=
0
;
index
<
pType
->
rgAirframeInfo
.
count
();
index
++
)
{
const
AirframeComponentAirframes
::
AirframeInfo_t
*
pInfo
=
&
pType
->
rgAirframeInfo
.
at
(
index
);
if
(
_autostartId
==
pInfo
->
autostartId
)
{
Q_ASSERT
(
!
autostartFound
);
autostartFound
=
true
;
...
...
@@ -73,7 +79,6 @@ AirframeComponentController::AirframeComponentController(void) :
_currentVehicleIndex
=
index
;
}
airframeType
->
addAirframe
(
pInfo
->
name
,
pInfo
->
autostartId
);
index
++
;
}
_airframeTypes
.
append
(
QVariant
::
fromValue
(
airframeType
));
...
...
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