diff --git a/sw/ground_segment/cockpit/gcs.glade b/sw/ground_segment/cockpit/gcs.glade index bf65a71f00..b8d367cb4d 100644 --- a/sw/ground_segment/cockpit/gcs.glade +++ b/sw/ground_segment/cockpit/gcs.glade @@ -71,40 +71,6 @@ 0 0 - - - 50 - True - Throttle - - - 2 - 3 - 0 - 1 - 1 - fill - fill - - - - - - 50 - True - Ground speed - - - 1 - 2 - 0 - 1 - 2 - fill - fill - - - 50 @@ -126,11 +92,18 @@ 0 - - 50 + True - Battery - GDK_POINTER_MOTION_MASK + Battery level (V) + True + False + + + + 50 + True + + @@ -197,6 +170,7 @@ True + Navigation mode. Click to get out of HOME mode True False @@ -230,6 +204,7 @@ True + Radio Command status True False @@ -263,6 +238,7 @@ True + GPS status True False @@ -350,8 +326,17 @@ 0 - + True + Above Ground Level (m), climb indicator, vertical speed (m/s) + True + False + + + + True + + @@ -412,6 +397,7 @@ True + Telemetry status: seconds since the last battery level message True False @@ -492,22 +478,31 @@ 0 - + True - <b>-30m</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Current altitude minus target altitude + True + False + + + + True + <b>-30m</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + @@ -572,22 +567,31 @@ 0 - + True - <b>185m</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Current altitude + True + False + + + + True + <b>185m</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + 0 @@ -622,22 +626,31 @@ - + True - <b>215m</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Target altitude + True + False + + + + True + <b>215m</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + 0 @@ -711,62 +724,6 @@ 0 0 - - - True - <i>ETA</i> - False - True - GTK_JUSTIFY_RIGHT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 2 - 3 - fill - - - - - - - True - <i>N/A</i> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 2 - 3 - fill - - - - True @@ -795,34 +752,6 @@ - - - True - <b>1:10</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 1 - 2 - 1 - 2 - fill - - - - True @@ -852,22 +781,68 @@ - + True - <b>2:20</b> - False - True - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + Estimated Time of Arrival: seconds to the next waypoint + True + False + + + + True + <i>ETA</i> + False + True + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 0 + 1 + 2 + 3 + fill + + + + + + + True + Block time + True + False + + + + True + <b>2:20</b> + False + True + GTK_JUSTIFY_CENTER + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + 1 @@ -878,6 +853,80 @@ + + + + True + Stage time + True + False + + + + True + <b>1:10</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 1 + 2 + 1 + 2 + fill + + + + + + + True + Estimated Time of Arrival: seconds to the next waypoint + True + False + + + + True + <i>N/A</i> + False + True + GTK_JUSTIFY_RIGHT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 1 + 2 + 2 + 3 + fill + + + @@ -916,38 +965,10 @@ - - - 85 - True - <i>N/A</i> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 3 - 4 - 0 - 1 - fill - - - - True + Flight time. Click to reset True False @@ -980,6 +1001,92 @@ + + + + True + Throttle + True + False + + + + True + + + + + 2 + 3 + 0 + 1 + 2 + fill + fill + + + + + + True + Ground speed + True + False + + + + True + + + + + 1 + 2 + 0 + 1 + 2 + fill + fill + + + + + + True + Current navigation block + True + False + + + + 85 + True + <i>N/A</i> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + + + 3 + 4 + 0 + 1 + fill + + + 0 diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index afbf9424ee..e54dd53111 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -598,7 +598,9 @@ let one_new_ac = fun alert (geomap:G.widget) fp_notebook ac -> let get_wind_msg = fun (geomap:G.widget) _sender vs -> let ac = get_ac vs in let value = fun field_name -> Pprz.float_assoc field_name vs in - ac.misc_page#set_mean_aspeed (sprintf "%.1f" (value "mean_aspeed")); + let airspeed = value "mean_aspeed" in + ac.strip#set_airspeed airspeed; + ac.misc_page#set_mean_aspeed (sprintf "%.1f" airspeed); ac.wind_speed <- value "wspeed"; let deg_dir = value "dir" in ac.wind_dir <- (Deg>>Rad)deg_dir; diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index cee9d80c45..b16748c7c8 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -24,6 +24,8 @@ * *) +open Printf + let (//) = Filename.concat type t = @@ -38,6 +40,7 @@ type t = set_bat : float -> unit; set_throttle : float -> unit; set_speed : float -> unit; + set_airspeed : float -> unit; set_climb : float -> unit; set_color : string -> string -> unit; set_label : string -> string -> unit; @@ -60,12 +63,12 @@ let strips_table = GPack.vbox ~spacing:5 ~packing:scrolled#add_with_viewport () let set_label labels name value = try let _eb, l = List.assoc (name^"_value") labels in - let value = Printf.sprintf "%s" value in + let value = sprintf "%s" value in if l#text <> value then l#set_label value with Not_found -> - Printf.fprintf stderr "Strip.set_label: '%s' unknown\n%!" name + fprintf stderr "Strip.set_label: '%s' unknown\n%!" name (** set a color *) let set_color labels name color = @@ -184,7 +187,7 @@ let add = fun config color center_ac mark -> strips_table#pack strip#toplevel#coerce; (* Name in top left *) - strip#label_ac_name#set_label (Printf.sprintf "%s" ac_name); + strip#label_ac_name#set_label (sprintf "%s" ac_name); (* Color *) let plane_color = strip#eventbox_strip in @@ -244,10 +247,16 @@ let add = fun config color center_ac mark -> method set_climb = fun v -> climb <- v method set_agl value = let arrow = max (min 0.5 (climb /. 5.)) (-0.5) in - agl#set ~arrow value [0.2, (Printf.sprintf "%3.0f" value); 0.8, Printf.sprintf "%+.1f" climb] + agl#set ~arrow value [0.2, (sprintf "%3.0f" value); 0.8, sprintf "%+.1f" climb] method set_bat value = bat#set value [0.5, (string_of_float value)] - method set_throttle value = throttle#set value (Printf.sprintf "%.0f%%" value) - method set_speed value = speed#set value (Printf.sprintf "%.1fm/s" value) + method set_throttle value = throttle#set value (sprintf "%.0f%%" value) + method set_speed value = speed#set value (sprintf "%.1fm/s" value) + + method set_airspeed value = + let text = sprintf "Ground speed (est. airspeed: %.1fm/s)" value in + let tooltips = GData.tooltips () in + tooltips#set_tip strip#eventbox_speed#coerce ~text + method set_label name value = set_label !strip_labels name value method set_color name value = set_color !strip_labels name value method add_widget w = strip#hbox_user#pack ~fill:false w @@ -266,7 +275,7 @@ let add = fun config color center_ac mark -> method connect_kill = fun callback -> let callback = fun x -> if x = 1. then - match GToolbox.question_box ~title:"Kill throttle" ~buttons:["Kill"; "Cancel"] (Printf.sprintf "Kill throttle of A/C %s ?" ac_name) with + match GToolbox.question_box ~title:"Kill throttle" ~buttons:["Kill"; "Cancel"] (sprintf "Kill throttle of A/C %s ?" ac_name) with 1 -> callback 1. | _ -> () else (* No confirmation for resurrect *) @@ -282,7 +291,7 @@ let add = fun config color center_ac mark -> method connect_mode = fun callback -> let callback = fun _ -> (* Back in AUTO2 *) - match GToolbox.question_box ~title:"Back to auto" ~buttons:["AUTO"; "Cancel"] (Printf.sprintf "Restore AUTO mode for A/C %s ?" ac_name) with + match GToolbox.question_box ~title:"Back to auto" ~buttons:["AUTO"; "Cancel"] (sprintf "Restore AUTO mode for A/C %s ?" ac_name) with 1 -> callback 2.; true | _ -> true in ignore(strip#eventbox_mode#event#connect#button_press ~callback) @@ -290,7 +299,7 @@ let add = fun config color center_ac mark -> (* Reset the flight time *) method connect_flight_time = fun callback -> let callback = fun _ -> (* Reset flight time *) - match GToolbox.question_box ~title:"Reset flight time" ~buttons:["Reset"; "Cancel"] (Printf.sprintf "Reset flight time for A/C %s ?" ac_name) with + match GToolbox.question_box ~title:"Reset flight time" ~buttons:["Reset"; "Cancel"] (sprintf "Reset flight time for A/C %s ?" ac_name) with 1 -> callback 0.; true | _ -> true in ignore(strip#eventbox_flight_time#event#connect#button_press ~callback) diff --git a/sw/ground_segment/cockpit/strip.mli b/sw/ground_segment/cockpit/strip.mli index afb2602b08..a5cb0f0e05 100644 --- a/sw/ground_segment/cockpit/strip.mli +++ b/sw/ground_segment/cockpit/strip.mli @@ -10,6 +10,7 @@ type t = < set_bat : float -> unit; set_throttle : float -> unit; set_speed : float -> unit; + set_airspeed : float -> unit; set_climb : float -> unit; set_color : string -> string -> unit; set_label : string -> string -> unit;