Paparazzi Center Exception Handling (tnx to: Serge Le Huitouze)

This commit is contained in:
Christophe De Wagter
2010-12-11 16:20:43 +01:00
parent 6309583e59
commit a5ff37bce4
2 changed files with 46 additions and 41 deletions
+4 -2
View File
@@ -98,9 +98,11 @@ let write_preferences = fun (gui:Gtk_pc.window) file (ac_combo:Gtk_tools.combo)
add_entry xml "last session" session_name in
(* Save target *)
let xml =
let xml = (
try
let name = Gtk_tools.combo_value target_combo in
add_entry xml "last target" name in
add_entry xml "last target" name
with _ -> xml) in
let xml =
try
+5 -2
View File
@@ -166,6 +166,7 @@ let parse_ac_targets = fun target_combo ac_file ->
store#clear ();
(** Clear ComboBox
**)
(try
let af_xml = Xml.parse_file (Env.paparazzi_src // "conf" // ac_file) in
List.iter (fun tag ->
if ExtXml.tag_is tag "firmware" then begin
@@ -199,7 +200,7 @@ let parse_ac_targets = fun target_combo ac_file ->
(**
Gtk_tools.combo (!strings) target_combo
**)
with _ -> ())
(* Link A/C to airframe & flight_plan labels *)
@@ -332,10 +333,12 @@ let build_handler = fun ~file gui ac_combo (target_combo:Gtk_tools.combo) (log:s
(* Build button *)
let callback = fun () ->
try (
let ac_name = Gtk_tools.combo_value ac_combo
and target = Gtk_tools.combo_value target_combo in
let target = if target="sim" then target else sprintf "%s.compile" target in
Utils.command ~file gui log ac_name target in
Utils.command ~file gui log ac_name target
) with _ -> log "ERROR: Nothing to build!!!\n" in
ignore (gui#button_build#connect#clicked ~callback);
(* Upload button *)