diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 0f1ae8539f..607bc0c29c 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -508,14 +508,15 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id begin match dl_settings_page with Some settings_tab -> - let flight_altitude_id, _flight_altitude_label = + begin try - settings_tab#assoc "flight_altitude" + let flight_altitude_id, _flight_altitude_label = + settings_tab#assoc "flight_altitude" in + strip#connect_shift_alt + (fun x ->dl_setting_callback flight_altitude_id (ac.target_alt+.x)) with Not_found -> - failwith "flight_altitude not setable" in - strip#connect_shift_alt - (fun x -> - dl_setting_callback flight_altitude_id (ac.target_alt +. x)); + prerr_endline "Warning: Flight_altitude not setable from GCS strip (i.e. not listed in the xml settings file)" + end | None -> () end diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index e51a6bc16d..31e3e4ea47 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -227,9 +227,9 @@ let add config color center_ac mark = let b = GButton.button ~label:"Mark" ~packing:hbox#add () in ignore (b#connect#clicked ~callback:mark); - let minus5 = GButton.button ~label:"-5m" ~packing:hbox#add () - and plus5 = GButton.button ~label:"+5m" ~packing:hbox#add () - and plus30 = GButton.button ~label:"+30m" ~packing:hbox#add () in + let minus5 = GButton.button ~label:"-5m" ~packing:hbox#add ~show:false () + and plus5 = GButton.button ~label:"+5m" ~packing:hbox#add ~show:false () + and plus30 = GButton.button ~label:"+30m" ~packing:hbox#add ~show:false () in ignore (b#connect#clicked ~callback:mark); (* User buttons *) @@ -244,7 +244,10 @@ let add config color center_ac mark = method connect_shift_alt callback = ignore (plus5#connect#clicked (fun () -> callback 5.)); ignore (plus30#connect#clicked (fun () -> callback 30.)); - ignore (minus5#connect#clicked (fun () -> callback (-5.))) + ignore (minus5#connect#clicked (fun () -> callback (-5.))); + minus5#misc#show (); + plus5#misc#show (); + plus30#misc#show (); method hide_buttons () = hbox#misc#hide (); user_hbox#misc#hide () method show_buttons () = hbox#misc#show (); user_hbox#misc#show () method connect = fun (select: unit -> unit) ->