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
d542a9f1
Commit
d542a9f1
authored
Jul 31, 2015
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update airframe meta handler
parent
815fa1e4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
AirframeComponentAirframes.cc
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
+24
-2
AirframeComponentAirframes.h
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.h
+1
-0
No files found.
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.cc
View file @
d542a9f1
...
@@ -30,6 +30,7 @@ QMap<QString, AirframeComponentAirframes::AirframeType_t*> AirframeComponentAirf
...
@@ -30,6 +30,7 @@ QMap<QString, AirframeComponentAirframes::AirframeType_t*> AirframeComponentAirf
QMap
<
QString
,
AirframeComponentAirframes
::
AirframeType_t
*>&
AirframeComponentAirframes
::
get
()
{
QMap
<
QString
,
AirframeComponentAirframes
::
AirframeType_t
*>&
AirframeComponentAirframes
::
get
()
{
#if 0
// Set a single airframe to prevent the UI from going crazy
// Set a single airframe to prevent the UI from going crazy
if (rgAirframeTypes.count() == 0) {
if (rgAirframeTypes.count() == 0) {
// Standard planes
// Standard planes
...
@@ -45,18 +46,39 @@ QMap<QString, AirframeComponentAirframes::AirframeType_t*>& AirframeComponentAir
...
@@ -45,18 +46,39 @@ QMap<QString, AirframeComponentAirframes::AirframeType_t*>& AirframeComponentAir
// Flying wings
// Flying wings
}
}
#endif
return
rgAirframeTypes
;
return
rgAirframeTypes
;
}
}
void
AirframeComponentAirframes
::
insert
(
QString
&
group
,
QString
&
image
,
QString
&
name
,
int
id
)
{
AirframeType_t
*
g
;
if
(
!
rgAirframeTypes
.
contains
(
group
))
{
g
=
new
AirframeType_t
;
g
->
name
=
group
;
g
->
imageResource
=
QString
(
"qrc:/qmlimages/"
).
append
(
image
);
qDebug
()
<<
"IMAGE:"
<<
g
->
imageResource
;
rgAirframeTypes
.
insert
(
group
,
g
);
}
else
{
g
=
rgAirframeTypes
.
value
(
group
);
}
AirframeInfo_t
*
i
=
new
AirframeInfo_t
;
i
->
name
=
name
;
i
->
autostartId
=
id
;
g
->
rgAirframeInfo
.
append
(
i
);
}
void
AirframeComponentAirframes
::
clear
()
{
void
AirframeComponentAirframes
::
clear
()
{
// Run through all and delete them
// Run through all and delete them
for
(
unsigned
tindex
=
0
;
tindex
<
AirframeComponentAirframes
::
get
().
count
();
tindex
++
)
{
for
(
int
tindex
=
0
;
tindex
<
AirframeComponentAirframes
::
get
().
count
();
tindex
++
)
{
const
AirframeComponentAirframes
::
AirframeType_t
*
pType
=
AirframeComponentAirframes
::
get
().
values
().
at
(
tindex
);
const
AirframeComponentAirframes
::
AirframeType_t
*
pType
=
AirframeComponentAirframes
::
get
().
values
().
at
(
tindex
);
for
(
unsigned
index
=
0
;
index
<
pType
->
rgAirframeInfo
.
count
();
index
++
)
{
for
(
int
index
=
0
;
index
<
pType
->
rgAirframeInfo
.
count
();
index
++
)
{
const
AirframeComponentAirframes
::
AirframeInfo_t
*
pInfo
=
pType
->
rgAirframeInfo
.
at
(
index
);
const
AirframeComponentAirframes
::
AirframeInfo_t
*
pInfo
=
pType
->
rgAirframeInfo
.
at
(
index
);
delete
pInfo
;
delete
pInfo
;
}
}
...
...
src/AutoPilotPlugins/PX4/AirframeComponentAirframes.h
View file @
d542a9f1
...
@@ -52,6 +52,7 @@ public:
...
@@ -52,6 +52,7 @@ public:
static
QMap
<
QString
,
AirframeComponentAirframes
::
AirframeType_t
*>&
get
();
static
QMap
<
QString
,
AirframeComponentAirframes
::
AirframeType_t
*>&
get
();
static
void
clear
();
static
void
clear
();
static
void
insert
(
QString
&
group
,
QString
&
image
,
QString
&
name
,
int
id
);
protected:
protected:
static
QMap
<
QString
,
AirframeType_t
*>
rgAirframeTypes
;
static
QMap
<
QString
,
AirframeType_t
*>
rgAirframeTypes
;
...
...
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