Skip to content

Commit

Permalink
autotest: stop emitting duplicate rangefinder headings
Browse files Browse the repository at this point in the history
This was only an issue for the Wasp rangefinder block, which drops stuff
in at the top level by specifying the same subgroup name as the top
level.
  • Loading branch information
peterbarker authored and tridge committed Jun 1, 2020
1 parent 93d8458 commit ffaa60b
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Tools/autotest/param_metadata/param_parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,21 +231,34 @@ def process_library(vehicle, library, pathprefix=None):
group_matches = prog_groups.findall(p_text)
debug("Found %u groups" % len(group_matches))
debug(group_matches)
done_groups = dict()
for group_match in group_matches:
group = group_match[0]
debug("Group: %s" % group)
lib = Library(group)
do_append = True
if group in done_groups:
# this is to handle cases like the RangeFinder
# parameters, where the wasp stuff gets tack into the
# same RNGFND1_ group
lib = done_groups[group]
do_append = False
else:
lib = Library(group)
done_groups[group] = lib

fields = prog_param_fields.findall(group_match[1])
for field in fields:
if field[0] in known_group_fields:
setattr(lib, field[0], field[1])
else:
error("unknown parameter metadata field '%s'" % field[0])
if not any(lib.name == parsed_l.name for parsed_l in libraries):
lib.name = library.name + lib.name
if do_append:
lib.name = library.name + lib.name
debug("Group name: %s" % lib.name)
process_library(vehicle, lib, os.path.dirname(libraryfname))
alllibs.append(lib)
if do_append:
alllibs.append(lib)

current_file = None

Expand Down

0 comments on commit ffaa60b

Please sign in to comment.