[fix] cleaning

- remove compilation warning in gen_airframe
- better (?) ocaml relative path substitution for editFP
This commit is contained in:
Gautier Hattenberger
2013-09-23 17:36:05 +02:00
parent 70ab7ebfdf
commit 84482d8856
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -51,10 +51,8 @@ let save_fp = fun geomap ->
| Some file ->
let f = open_out 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 = String.concat Filename.dir_sep (Array.to_list (Array.make (List.length l) Filename.parent_dir_name)) in
let fp_dtd = rel_path // "flight_plan.dtd" in
fprintf f "<!DOCTYPE flight_plan SYSTEM \"%s\">\n\n" fp_dtd;
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
fprintf f "<!DOCTYPE flight_plan SYSTEM \"%s%s\">\n\n" rel_path "flight_plan.dtd";
fprintf f "%s\n" (ExtXml.to_string_fmt fp#xml);
close_out f;
current_fp := Some (fp, file);
+1 -1
View File
@@ -281,7 +281,7 @@ let rec parse_section = fun ac_id s ->
List.iter (fun d -> printf " Actuators%sInit();\\\n" d) drivers;
printf "}\n\n";
| "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
printf "/* XML %s */" filename;
nl ();