mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 08:58:29 -04:00
param_parse.py: emit SIM_ parameters along with everthing else
This commit is contained in:
parent
bc3b923ff6
commit
8de890bc7d
Tools/autotest/param_metadata
@ -6,8 +6,8 @@ import re
|
||||
|
||||
|
||||
class Emit:
|
||||
def __init__(self, sitl=False):
|
||||
self.sitl = sitl
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
prog_values_field = re.compile(r"-?\d*\.?\d+: ?[\w ]+,?")
|
||||
|
||||
|
@ -37,11 +37,6 @@ parser.add_argument("--format",
|
||||
default='all',
|
||||
choices=['all', 'html', 'rst', 'rstlatexpdf', 'wiki', 'xml', 'json', 'edn', 'md', 'xml_mp'],
|
||||
help="what output format to use")
|
||||
parser.add_argument("--sitl",
|
||||
dest='emit_sitl',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help="true to only emit sitl parameters, false to not emit sitl parameters")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@ -163,8 +158,7 @@ def process_vehicle(vehicle):
|
||||
libraries.append(lib)
|
||||
|
||||
param_matches = []
|
||||
if not args.emit_sitl:
|
||||
param_matches = prog_param.findall(p_text)
|
||||
param_matches = prog_param.findall(p_text)
|
||||
|
||||
for param_match in param_matches:
|
||||
(only_vehicles, param_name, field_text) = (param_match[0],
|
||||
@ -213,11 +207,6 @@ process_vehicle(vehicle)
|
||||
|
||||
debug("Found %u documented libraries" % len(libraries))
|
||||
|
||||
if args.emit_sitl:
|
||||
libraries = filter(lambda x : x.name == 'SIM_', libraries)
|
||||
else:
|
||||
libraries = filter(lambda x : x.name != 'SIM_', libraries)
|
||||
|
||||
libraries = list(libraries)
|
||||
|
||||
alllibs = libraries[:]
|
||||
@ -293,7 +282,7 @@ def process_library(vehicle, library, pathprefix=None):
|
||||
seen_values_or_bitmask_for_other_vehicle = False
|
||||
for field in fields:
|
||||
only_for_vehicles = field[1].split(",")
|
||||
only_for_vehicles = [x.rstrip().lstrip() for x in only_for_vehicles]
|
||||
only_for_vehicles = [some_vehicle.rstrip().lstrip() for some_vehicle in only_for_vehicles]
|
||||
delta = set(only_for_vehicles) - set(truename_map.values())
|
||||
if len(delta):
|
||||
error("Unknown vehicles (%s)" % delta)
|
||||
@ -593,16 +582,11 @@ for emitter_name in all_emitters.keys():
|
||||
if args.output_format == 'all' or args.output_format == emitter_name:
|
||||
emitters_to_use.append(emitter_name)
|
||||
|
||||
if args.emit_sitl:
|
||||
# only generate rst for SITL for now:
|
||||
emitters_to_use = ['rst']
|
||||
|
||||
# actually invoke each emitter:
|
||||
for emitter_name in emitters_to_use:
|
||||
emit = all_emitters[emitter_name](sitl=args.emit_sitl)
|
||||
emit = all_emitters[emitter_name]()
|
||||
|
||||
if not args.emit_sitl:
|
||||
emit.emit(vehicle)
|
||||
emit.emit(vehicle)
|
||||
|
||||
emit.start_libraries()
|
||||
|
||||
|
@ -12,8 +12,6 @@ except Exception:
|
||||
# Emit docs in a RST format
|
||||
class RSTEmit(Emit):
|
||||
def blurb(self):
|
||||
if self.sitl:
|
||||
return """SITL parameters"""
|
||||
return """This is a complete list of the parameters which can be set (e.g. via the MAVLink protocol) to control vehicle behaviour. They are stored in persistent storage on the vehicle.
|
||||
|
||||
This list is automatically generated from the latest ardupilot source code, and so may contain parameters which are not yet in the stable released versions of the code.
|
||||
@ -30,10 +28,7 @@ This list is automatically generated from the latest ardupilot source code, and
|
||||
self.f = open(self.output_fname(), mode='w')
|
||||
self.spacer = re.compile("^", re.MULTILINE)
|
||||
self.rstescape = re.compile("([^a-zA-Z0-9\n ])")
|
||||
if self.sitl:
|
||||
parameterlisttype = "SITL Parameter List"
|
||||
else:
|
||||
parameterlisttype = "Complete Parameter List"
|
||||
parameterlisttype = "Complete Parameter List"
|
||||
parameterlisttype += "\n" + "=" * len(parameterlisttype)
|
||||
self.preamble = """.. Dynamically generated list of documented parameters
|
||||
.. This page was generated using {toolname}
|
||||
|
Loading…
Reference in New Issue
Block a user