mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 11:37:06 +08:00
Altitude buttons removed if "flight_altitude" is not available from the settings.
Warning issued.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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) ->
|
||||
|
||||
Reference in New Issue
Block a user