mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-07 01:04:19 +08:00
Changes to add px4fmu-v2_lpe config.
This commit is contained in:
committed by
Lorenz Meier
parent
338804606a
commit
434dddedea
@@ -53,6 +53,7 @@ import argparse
|
||||
from px4params import srcscanner, srcparser, xmlout, dokuwikiout, dokuwikirpc, scope, cmakeparser
|
||||
|
||||
import re
|
||||
import json
|
||||
import codecs
|
||||
|
||||
def main():
|
||||
@@ -112,6 +113,10 @@ def main():
|
||||
help="DokuWiki page edit summary")
|
||||
parser.add_argument('-v', '--verbose', action='store_true', help="verbose output")
|
||||
parser.add_argument('--scope', default=None, action='store', help="pass the scope (list of compiled modules)")
|
||||
parser.add_argument("-o", "--overrides",
|
||||
default="{}",
|
||||
metavar="OVERRIDES",
|
||||
help="a dict of overrides in the form of a json string")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
@@ -155,6 +160,16 @@ def main():
|
||||
if len(param_groups) == 0:
|
||||
print("Warning: no parameters found")
|
||||
|
||||
override_dict = json.loads(args.overrides)
|
||||
if len(override_dict.keys()) > 0:
|
||||
for group in param_groups:
|
||||
for param in group.GetParams():
|
||||
name = param.GetName()
|
||||
if name in override_dict.keys():
|
||||
val = str(override_dict[param.GetName()])
|
||||
param.default = val
|
||||
print("OVERRIDING {:s} to {:s}!!!!!".format(name, val))
|
||||
|
||||
# Output to XML file
|
||||
if args.xml:
|
||||
if args.verbose: print("Creating XML file " + args.xml)
|
||||
|
||||
Reference in New Issue
Block a user