mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-05 15:30:08 +08:00
Paparazzi Center Exception Handling (tnx to: Serge Le Huitouze)
This commit is contained in:
@@ -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
|
add_entry xml "last session" session_name in
|
||||||
|
|
||||||
(* Save target *)
|
(* Save target *)
|
||||||
let xml =
|
let xml = (
|
||||||
|
try
|
||||||
let name = Gtk_tools.combo_value target_combo in
|
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 =
|
let xml =
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -166,6 +166,7 @@ let parse_ac_targets = fun target_combo ac_file ->
|
|||||||
store#clear ();
|
store#clear ();
|
||||||
(** Clear ComboBox
|
(** Clear ComboBox
|
||||||
**)
|
**)
|
||||||
|
(try
|
||||||
let af_xml = Xml.parse_file (Env.paparazzi_src // "conf" // ac_file) in
|
let af_xml = Xml.parse_file (Env.paparazzi_src // "conf" // ac_file) in
|
||||||
List.iter (fun tag ->
|
List.iter (fun tag ->
|
||||||
if ExtXml.tag_is tag "firmware" then begin
|
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
|
Gtk_tools.combo (!strings) target_combo
|
||||||
**)
|
**)
|
||||||
|
with _ -> ())
|
||||||
|
|
||||||
|
|
||||||
(* Link A/C to airframe & flight_plan labels *)
|
(* 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 *)
|
(* Build button *)
|
||||||
let callback = fun () ->
|
let callback = fun () ->
|
||||||
|
try (
|
||||||
let ac_name = Gtk_tools.combo_value ac_combo
|
let ac_name = Gtk_tools.combo_value ac_combo
|
||||||
and target = Gtk_tools.combo_value target_combo in
|
and target = Gtk_tools.combo_value target_combo in
|
||||||
let target = if target="sim" then target else sprintf "%s.compile" target 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);
|
ignore (gui#button_build#connect#clicked ~callback);
|
||||||
|
|
||||||
(* Upload button *)
|
(* Upload button *)
|
||||||
|
|||||||
Reference in New Issue
Block a user