mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-26 08:22:43 +08:00
[settings] possibility to exclude targets
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<!DOCTYPE settings SYSTEM "../settings.dtd">
|
||||
|
||||
<settings target="ap|nps">
|
||||
<settings target="!sim">
|
||||
<dl_settings>
|
||||
<dl_settings NAME="body2imu">
|
||||
<dl_setting MAX="90" MIN="-90" STEP="0.5" VAR="imu.body_to_imu.eulers_f.phi" shortname="b2i phi" module="subsystems/imu" param="IMU_BODY_TO_IMU_PHI" unit="rad" alt_unit="deg" handler="SetBodyToImuPhi"/>
|
||||
|
||||
@@ -276,6 +276,17 @@ let parse_rc_mode = fun xml ->
|
||||
let parse_rc_modes = fun xml ->
|
||||
List.iter parse_rc_mode (Xml.children xml)
|
||||
|
||||
(*
|
||||
Check if target t is marked as supported in the targets string.
|
||||
The targets string is a pipe delimited list of supported targets, e.g. "ap|nps"
|
||||
To specifiy a list with unsupported targets, prefix with !
|
||||
e.g. "!sim|nps" to mark support for all targets except sim and nps.
|
||||
*)
|
||||
let supports_target = fun t targets ->
|
||||
if (String.get targets 0) = '!' then
|
||||
not (Str.string_match (Str.regexp (".*"^t^".*")) targets 0)
|
||||
else
|
||||
Str.string_match (Str.regexp (".*"^t^".*")) targets 0
|
||||
|
||||
let join_xml_files = fun xml_files ->
|
||||
let dl_settings = ref []
|
||||
@@ -302,7 +313,7 @@ let join_xml_files = fun xml_files ->
|
||||
if List.exists (fun n ->
|
||||
if Xml.tag n = "makefile" then begin
|
||||
let t = ExtXml.attrib_or_default n "target" Env.default_module_targets in
|
||||
Str.string_match (Str.regexp (".*"^target^".*")) t 0
|
||||
supports_target target t
|
||||
end
|
||||
else false
|
||||
) (Xml.children xml)
|
||||
@@ -313,7 +324,7 @@ let join_xml_files = fun xml_files ->
|
||||
(* if the top <settings> node has a target attribute,
|
||||
only add if matches current target *)
|
||||
let t = ExtXml.attrib_or_default xml "target" "" in
|
||||
if t = "" || Str.string_match (Str.regexp (".*"^target^".*")) t 0 then
|
||||
if t = "" || (supports_target target t) then
|
||||
[xml]
|
||||
else
|
||||
[]
|
||||
|
||||
Reference in New Issue
Block a user