diff --git a/conf/control_panel.xml.example b/conf/control_panel.xml.example index e1ca1c2ca0..8f9669886d 100644 --- a/conf/control_panel.xml.example +++ b/conf/control_panel.xml.example @@ -80,7 +80,9 @@ - + + + diff --git a/sw/ground_segment/cockpit/gcs.ml b/sw/ground_segment/cockpit/gcs.ml index ee829f71d8..45107127f5 100644 --- a/sw/ground_segment/cockpit/gcs.ml +++ b/sw/ground_segment/cockpit/gcs.ml @@ -345,6 +345,7 @@ let options = "-zoom", Arg.Set_float zoom, "Initial zoom"; "-center", Arg.Set_string center, "Initial map center"; "-center_ac", Arg.Set auto_center_new_ac, "Centers the map on any new A/C"; + "-track_size", Arg.Set_int Live.track_size, (sprintf "Default track length (%d)" !Live.track_size); "-plugin", Arg.Set_string plugin_window, "External X application (launched with the id of the plugin window as argument)"; "-mplayer", Arg.Set_string mplayer, "Launch mplayer with the given argument as X plugin"; "-utm", Arg.Unit (fun () -> projection:=G.Mercator),"Switch to UTM local projection"; diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 5196bf1828..d1a9bda7a5 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -34,6 +34,7 @@ module Ground_Pprz = Pprz.Messages(struct let name = "ground" end) module Alert_Pprz = Pprz.Messages(struct let name = "alert" end) let approaching_alert_time = 3. +let track_size = ref 500 let rotate = fun a (x, y) -> let cosa = cos a and sina = sin a in @@ -290,7 +291,7 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id let fp = ac_menu_fact#add_check_item "Fligh Plan" ~active:true in ignore (fp#connect#toggled (fun () -> show_mission ac_id fp#active)); - let track = new MapTrack.track ~name ~color:color geomap in + let track = new MapTrack.track ~size: !track_size ~name ~color:color geomap in geomap#register_to_fit (track:>MapCanvas.geographic); let center_ac = center geomap track in @@ -535,8 +536,8 @@ let get_fbw_msg = fun _sender vs -> ac.strip#set_label "RC" status; ac.strip#set_color "RC" (match status with - "LOST" | "REALLY_LOST" -> warning_color - | _ -> ok_color) + "OK" -> ok_color + | _ -> warning_color) diff --git a/sw/ground_segment/cockpit/live.mli b/sw/ground_segment/cockpit/live.mli index 64ef6c8410..5d6141312a 100644 --- a/sw/ground_segment/cockpit/live.mli +++ b/sw/ground_segment/cockpit/live.mli @@ -1 +1,31 @@ +(* +* $Id$ +* +* Real time handling of flying A/Cs +* +* Copyright (C) 2004-2006 ENAC, Pascal Brisset, Antoine Drouin +* +* This file is part of paparazzi. +* +* paparazzi is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2, or (at your option) +* any later version. +* +* paparazzi is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with paparazzi; see the file COPYING. If not, write to +* the Free Software Foundation, 59 Temple Place - Suite 330, +* Boston, MA 02111-1307, USA. +* +*) + +val track_size : int ref +(** Default length for A/C tracks on the 2D view *) + val listen_acs_and_msgs : MapCanvas.widget -> GPack.notebook -> Pages.alert -> bool -> unit +(** [listen_acs_and_msgs geomap aircraft_notebook alert_page auto_center_new_ac] *) diff --git a/sw/ground_segment/cockpit/strip.ml b/sw/ground_segment/cockpit/strip.ml index e7cb3441c5..e51a6bc16d 100644 --- a/sw/ground_segment/cockpit/strip.ml +++ b/sw/ground_segment/cockpit/strip.ml @@ -133,15 +133,14 @@ let labels_print = [| |] let gen_int = let i = ref (-1) in fun () -> incr i; !i -let rows = 1 + Array.length labels_name +(** Number of rows: colored line + labels + buttons + user buttons *) +let rows = 1 + Array.length labels_name + 2 + +(** Numnber of columns: battey gauge + labels & values + AGL gauge *) let columns = 1 + 2 * Array.length labels_name.(0) + 1 - - - - - (** add a strip to the panel *) +(** add a strip to the panel *) let add config color center_ac mark = let strip_labels = ref [] in let add_label = fun name value -> @@ -152,16 +151,12 @@ let add config color center_ac mark = let tooltips = GData.tooltips () in (* frame of the strip *) - let strip_ebox = GBin.event_box ~packing:strips_table#add () in + let strip_ebox = GBin.event_box ~packing:strips_table#pack () in let frame = GBin.frame ~shadow_type: `IN ~packing:strip_ebox#add () in let framevb = GPack.vbox ~packing:frame#add () in (** Table (everything except the user buttons) *) - let strip = GPack.table ~rows ~columns ~col_spacings:3 ~packing:framevb#add () in - strip#set_row_spacing 0 2; - strip#set_row_spacing 1 2; - strip#set_row_spacing (rows-1) 2; - strip#set_row_spacing (rows-2) 2; + let strip = GPack.table ~rows ~columns ~col_spacings:3 ~row_spacings:2 ~packing:framevb#pack () in (* Name in top left *) let name = (GMisc.label ~text: (ac_name) ~packing: (strip#attach ~top: 0 ~left: 0) ()) in @@ -187,13 +182,13 @@ let add config color center_ac mark = tooltips#set_tip plane_color#coerce ~text:"Flight time - Block time - Stage time - Block name"; (* battery gauge *) - let bat_da = GMisc.drawing_area ~show:true ~packing:(strip#attach ~top:1 ~bottom:(rows-1) ~left:0) () in + let bat_da = GMisc.drawing_area ~show:true ~packing:(strip#attach ~top:1 ~bottom:3 ~left:0) () in bat_da#misc#realize (); let bat = new gauge bat_da bat_min bat_max in (* AGL gauge *) let agl_box = GBin.event_box ~packing:(strip#attach ~top:1 ~bottom:3 ~left:(columns-1)) () in - let agl_da = GMisc.drawing_area ~width:30 ~show:true ~packing:agl_box#add () in + let agl_da = GMisc.drawing_area ~width:40 ~show:true ~packing:agl_box#add () in agl_da#misc#realize (); tooltips#set_tip agl_box#coerce ~text:"AGL (m)"; let agl = new gauge agl_da 0. agl_max in @@ -206,7 +201,7 @@ let add config color center_ac mark = tooltips#set_tip dta_box#coerce ~text:"Height to target (m)"; (* Telemetry *) - let eb = GBin.event_box ~packing:(strip#attach ~top:(rows-1) ~left:0) () in + let eb = GBin.event_box ~packing:(strip#attach ~top:3 ~left:0) () in let ts = GMisc.label ~text:"N/A" ~packing:eb#add () in add_label "telemetry_status_value" (eb, ts); ts#set_width_chars 3; @@ -226,7 +221,7 @@ let add config color center_ac mark = ) labels_name; (* Buttons *) - let hbox = GPack.hbox ~spacing:2 ~packing:framevb#add () in + let hbox = GPack.hbox ~width:300 ~spacing:2 ~packing:(strip#attach ~top:4 ~left:0 ~right:columns) () in let b = GButton.button ~label:"Center A/C" ~packing:hbox#add () in ignore(b#connect#clicked ~callback:center_ac); let b = GButton.button ~label:"Mark" ~packing:hbox#add () in @@ -238,7 +233,7 @@ let add config color center_ac mark = ignore (b#connect#clicked ~callback:mark); (* User buttons *) - let user_hbox = GPack.hbox ~spacing:2 ~packing:framevb#add () in + let user_hbox = GPack.hbox ~spacing:2 ~packing:(strip#attach ~top:5 ~left:0 ~right:columns) () in object method set_agl value = set_agl agl value diff --git a/sw/ground_segment/tmtc/server.ml b/sw/ground_segment/tmtc/server.ml index f8cd3d118c..8f8ce62f98 100644 --- a/sw/ground_segment/tmtc/server.ml +++ b/sw/ground_segment/tmtc/server.ml @@ -240,7 +240,7 @@ let log_and_parse = fun logging ac_name (a:Aircraft.aircraft) msg values -> if mcu1_status land 0b1 > 0 then "OK" else if mcu1_status land 0b10 > 0 - then "REALLY_LOST" + then "NONE" else "LOST"; a.fbw.rc_mode <- if mcu1_status land 0b1000 > 0 diff --git a/sw/lib/ocaml/mapTrack.ml b/sw/lib/ocaml/mapTrack.ml index 7b70c3b46c..1b48da3f7d 100644 --- a/sw/lib/ocaml/mapTrack.ml +++ b/sw/lib/ocaml/mapTrack.ml @@ -181,7 +181,7 @@ class track = fun ?(name="Noname") ?(size = 500) ?(color="red") (geomap:MapCanva if params_on then begin let last_height = self#height () in - ac_label#set [`TEXT ( name^" \n"^(string_of_float last_height)^" m\n"^(string_of_float last_speed)^" m/s\n" ); `Y 70. ] + ac_label#set [`TEXT (sprintf "%s\n%+.0f m\n%.1f m/s" name last_height last_speed); `Y 70. ] end; ac_label#affine_absolute (affine_pos_and_angle geomap#zoom_adj#value xw yw 0.);