mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 15:12:09 +08:00
[fix] cleaning
- remove compilation warning in gen_airframe - better (?) ocaml relative path substitution for editFP
This commit is contained in:
@@ -51,10 +51,8 @@ let save_fp = fun geomap ->
|
|||||||
| Some file ->
|
| Some file ->
|
||||||
let f = open_out file in
|
let f = open_out file in
|
||||||
let fp_path = Str.replace_first (Str.regexp Env.flight_plans_path) "" (Filename.dirname file) in
|
let fp_path = Str.replace_first (Str.regexp Env.flight_plans_path) "" (Filename.dirname file) in
|
||||||
let l = Str.split (Str.regexp Filename.dir_sep) fp_path in
|
let rel_path = Str.global_replace (Str.regexp (Printf.sprintf "%s[^%s]+" Filename.dir_sep Filename.dir_sep)) (Filename.parent_dir_name // "") fp_path in
|
||||||
let rel_path = String.concat Filename.dir_sep (Array.to_list (Array.make (List.length l) Filename.parent_dir_name)) in
|
fprintf f "<!DOCTYPE flight_plan SYSTEM \"%s%s\">\n\n" rel_path "flight_plan.dtd";
|
||||||
let fp_dtd = rel_path // "flight_plan.dtd" in
|
|
||||||
fprintf f "<!DOCTYPE flight_plan SYSTEM \"%s\">\n\n" fp_dtd;
|
|
||||||
fprintf f "%s\n" (ExtXml.to_string_fmt fp#xml);
|
fprintf f "%s\n" (ExtXml.to_string_fmt fp#xml);
|
||||||
close_out f;
|
close_out f;
|
||||||
current_fp := Some (fp, file);
|
current_fp := Some (fp, file);
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ let rec parse_section = fun ac_id s ->
|
|||||||
List.iter (fun d -> printf " Actuators%sInit();\\\n" d) drivers;
|
List.iter (fun d -> printf " Actuators%sInit();\\\n" d) drivers;
|
||||||
printf "}\n\n";
|
printf "}\n\n";
|
||||||
| "include" ->
|
| "include" ->
|
||||||
let filename = Str.global_replace (Str.regexp "\$AC_ID") ac_id (ExtXml.attrib s "href") in
|
let filename = Str.global_replace (Str.regexp "\\$AC_ID") ac_id (ExtXml.attrib s "href") in
|
||||||
let subxml = Xml.parse_file filename in
|
let subxml = Xml.parse_file filename in
|
||||||
printf "/* XML %s */" filename;
|
printf "/* XML %s */" filename;
|
||||||
nl ();
|
nl ();
|
||||||
|
|||||||
Reference in New Issue
Block a user