Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
6f3b6bf5
Commit
6f3b6bf5
authored
7 years ago
by
Hamish Willee
Committed by
Lorenz Meier
7 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Update parser to get class information and create separate groups for each class
parent
50140b3d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Tools/px4airframes/markdownout.py
+3
-3
3 additions, 3 deletions
Tools/px4airframes/markdownout.py
Tools/px4airframes/srcparser.py
+12
-65
12 additions, 65 deletions
Tools/px4airframes/srcparser.py
with
15 additions
and
68 deletions
Tools/px4airframes/markdownout.py
+
3
−
3
View file @
6f3b6bf5
...
...
@@ -18,10 +18,10 @@ class MarkdownTablesOutput():
for
group
in
groups
:
if
group
.
Get
Type
()
not
in
type_set
:
if
group
.
Get
Class
()
not
in
type_set
:
#result += '\n<span id="type_%s"></span>\n' % group.GetType().lower()
result
+=
'
## %s
\n\n
'
%
group
.
Get
Type
()
type_set
.
add
(
group
.
type
)
result
+=
'
## %s
\n\n
'
%
group
.
Get
Class
()
type_set
.
add
(
group
.
GetClass
()
)
result
+=
'
### %s
\n\n
'
%
group
.
GetName
()
...
...
This diff is collapsed.
Click to expand it.
Tools/px4airframes/srcparser.py
+
12
−
65
View file @
6f3b6bf5
...
...
@@ -6,68 +6,11 @@ class ParameterGroup(object):
"""
Single parameter group
"""
def
__init__
(
self
,
name
):
def
__init__
(
self
,
name
,
af_class
):
self
.
name
=
name
self
.
af_class
=
af_class
self
.
params
=
[]
if
(
self
.
name
==
"
Standard Plane
"
):
self
.
type
=
"
Plane
"
elif
(
self
.
name
==
"
Flying Wing
"
):
self
.
type
=
"
Plane
"
elif
(
self
.
name
==
"
Quadrotor x
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Quadrotor +
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Hexarotor x
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Hexarotor +
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Octorotor +
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Octorotor x
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Octorotor Coaxial
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Octo Coax Wide
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Quadrotor Wide
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Quadrotor H
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Quadrotor asymmetric
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Simulation
"
):
self
.
type
=
"
Simulation
"
elif
(
self
.
name
==
"
Plane A-Tail
"
):
self
.
type
=
"
Plane
"
elif
(
self
.
name
==
"
VTOL Duo Tailsitter
"
):
self
.
type
=
"
VTOL
"
elif
(
self
.
name
==
"
Standard VTOL
"
):
self
.
type
=
"
VTOL
"
elif
(
self
.
name
==
"
VTOL Quad Tailsitter
"
):
self
.
type
=
"
VTOL
"
elif
(
self
.
name
==
"
VTOL Tiltrotor
"
):
self
.
type
=
"
VTOL
"
elif
(
self
.
name
==
"
Coaxial Helicopter
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Helicopter
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Hexarotor Coaxial
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Y6A
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Tricopter Y-
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Tricopter Y+
"
):
self
.
type
=
"
Copter
"
elif
(
self
.
name
==
"
Rover
"
):
self
.
type
=
"
Rover
"
elif
(
self
.
name
==
"
Boat
"
):
self
.
type
=
"
Boat
"
elif
(
self
.
name
==
"
custom
"
):
self
.
type
=
"
Unknown
"
else
:
self
.
type
=
"
Unknown
"
def
AddParameter
(
self
,
param
):
"""
...
...
@@ -81,11 +24,11 @@ class ParameterGroup(object):
"""
return
self
.
name
def
Get
Type
(
self
):
def
Get
Class
(
self
):
"""
Get parameter group vehicle type.
"""
return
self
.
type
return
self
.
af_class
def
GetImageName
(
self
):
"""
...
...
@@ -462,9 +405,13 @@ class SourceParser(object):
param
.
SetArch
(
arch
,
archs
[
arch
])
# Store the parameter
if
airframe_type
not
in
self
.
param_groups
:
self
.
param_groups
[
airframe_type
]
=
ParameterGroup
(
airframe_type
)
self
.
param_groups
[
airframe_type
].
AddParameter
(
param
)
#Create a class-specific airframe group. This is needed to catch cases where an airframe type might cross classes (e.g. simulation)
class_group_identifier
=
airframe_type
+
airframe_class
if
class_group_identifier
not
in
self
.
param_groups
:
#self.param_groups[airframe_type] = ParameterGroup(airframe_type) #HW TEST REMOVE
self
.
param_groups
[
class_group_identifier
]
=
ParameterGroup
(
airframe_type
,
airframe_class
)
self
.
param_groups
[
class_group_identifier
].
AddParameter
(
param
)
return
True
...
...
@@ -523,6 +470,6 @@ class SourceParser(object):
"""
groups
=
self
.
param_groups
.
values
()
groups
=
sorted
(
groups
,
key
=
lambda
x
:
x
.
GetName
())
groups
=
sorted
(
groups
,
key
=
lambda
x
:
x
.
Get
Type
())
groups
=
sorted
(
groups
,
key
=
lambda
x
:
x
.
Get
Class
())
groups
=
sorted
(
groups
,
key
=
lambda
x
:
self
.
priority
.
get
(
x
.
GetName
(),
0
),
reverse
=
True
)
return
groups
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment