[supervision] don't launch sitl if popup was canceled

This commit is contained in:
Felix Ruess
2013-03-24 13:23:21 +01:00
parent 7e02b677b5
commit 9fbac4faa7
+8 -6
View File
@@ -161,17 +161,21 @@ let supervision = fun ?file gui log (ac_combo : Gtk_tools.combo) (target_combo :
run_and_monitor ?file gui log "GCS" ""
and run_server = fun args ->
run_and_monitor ?file gui log "Server" args
and run_sitl = fun ac_name ->
and choose_and_run_sitl = fun ac_name ->
let get_args = fun simtype ac_name ->
match simtype with
"sim" -> sprintf "-a %s -t %s --boot --norc" ac_name simtype
| "jsbsim" -> sprintf "-a %s -t %s" ac_name simtype
| "nps" -> sprintf "-a %s -t %s" ac_name simtype
| _ -> sprintf "-a %s" ac_name
| _ -> "none"
in
let sim_type = get_simtype target_combo in
let args = get_args sim_type ac_name in
run_and_monitor ?file gui log "Simulator" args
if args <> "none" then begin
run_and_monitor ?file gui log "Simulator" args;
run_and_monitor ?file gui log "GCS" "";
run_and_monitor ?file gui log "Server" "-n"
end
in
(* Sessions *)
@@ -219,9 +223,7 @@ let supervision = fun ?file gui log (ac_combo : Gtk_tools.combo) (target_combo :
(* Simulations *)
let simulation = fun () ->
run_sitl (Gtk_tools.combo_value ac_combo);
run_gcs ();
run_server "-n" in
choose_and_run_sitl (Gtk_tools.combo_value ac_combo) in
(* Run session *)
let callback = fun () ->