diff --git a/sw/ground_segment/cockpit/editFP.ml b/sw/ground_segment/cockpit/editFP.ml index 94b10896f9..2a5b618031 100644 --- a/sw/ground_segment/cockpit/editFP.ml +++ b/sw/ground_segment/cockpit/editFP.ml @@ -64,7 +64,7 @@ let load_xml_fp = fun geomap editor_frame accel_group ?(xml_file=Env.flight_plan List.iter (fun w -> let (i, w) = fp#index w in - geomap#add_info_georef (sprintf "%s" w#name) w#pos) + geomap#add_info_georef (sprintf "%s" w#name) (w :> < pos : Latlong.geographic >)) fp#waypoints; fp @@ -151,7 +151,7 @@ let create_wp = fun geomap geo -> failwith "create_wp" | Some (fp,_) -> let w = fp#add_waypoint geo in - geomap#add_info_georef (sprintf "%s" w#name) w#pos; + geomap#add_info_georef (sprintf "%s" w#name) (w :> < pos : Latlong.geographic >); w diff --git a/sw/ground_segment/cockpit/live.ml b/sw/ground_segment/cockpit/live.ml index 6d504c45e6..8fa95452ce 100644 --- a/sw/ground_segment/cockpit/live.ml +++ b/sw/ground_segment/cockpit/live.ml @@ -430,7 +430,7 @@ let create_ac = fun alert (geomap:G.widget) (acs_notebook:GPack.notebook) (ac_id List.iter (fun w -> let (i, w) = fp#index w in - geomap#add_info_georef (sprintf "%s.%s" name w#name) w#pos) + geomap#add_info_georef (sprintf "%s.%s" name w#name) (w :> < pos : Latlong.geographic >)) fp#waypoints; (** Add the short cut buttons in the strip *) diff --git a/sw/lib/ocaml/latlong.ml b/sw/lib/ocaml/latlong.ml index bf34715e80..2a23fde55e 100644 --- a/sw/lib/ocaml/latlong.ml +++ b/sw/lib/ocaml/latlong.ml @@ -507,7 +507,7 @@ let unix_time_of_tow = fun tow -> type coordinates_kind = WGS84_dec | WGS84_dms - | Bearing of geographic + | Bearing of < pos : geographic> let string_of_coordinates = fun kind geo -> @@ -517,7 +517,7 @@ let string_of_coordinates = fun kind geo -> | WGS84_dms -> string_dms_of_geographic geo | Bearing georef -> - let (dx, dy) = utm_sub (utm_of WGS84 geo) (utm_of WGS84 georef) in + let (dx, dy) = utm_sub (utm_of WGS84 geo) (utm_of WGS84 georef#pos) in let d = sqrt (dx*.dx+.dy*.dy) in let bearing = (int_of_float ((Rad>>Deg)(atan2 dx dy)) + 360) mod 360 in Printf.sprintf "%4d %4.0f" bearing d @@ -529,5 +529,5 @@ let geographic_of_coordinates = fun kind s -> | WGS84_dms -> of_string ("WGS84_dms " ^ s) | Bearing georef -> - of_string (Printf.sprintf "WGS84_bearing %s %s" (string_degrees_of_geographic georef) s) + of_string (Printf.sprintf "WGS84_bearing %s %s" (string_degrees_of_geographic georef#pos) s) diff --git a/sw/lib/ocaml/latlong.mli b/sw/lib/ocaml/latlong.mli index ae0759ecb6..71bc0d36fd 100644 --- a/sw/lib/ocaml/latlong.mli +++ b/sw/lib/ocaml/latlong.mli @@ -165,7 +165,7 @@ val unix_time_of_tow : int -> float type coordinates_kind = WGS84_dec | WGS84_dms - | Bearing of geographic + | Bearing of < pos : geographic > val string_of_coordinates : coordinates_kind -> geographic -> string val geographic_of_coordinates : coordinates_kind -> string -> geographic diff --git a/sw/lib/ocaml/mapCanvas.ml b/sw/lib/ocaml/mapCanvas.ml index 67a288200c..8afaca9a3c 100644 --- a/sw/lib/ocaml/mapCanvas.ml +++ b/sw/lib/ocaml/mapCanvas.ml @@ -728,7 +728,7 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () -> (** display methods *) method display_xy = fun s -> lbl_xy#set_text s method display_geo = fun geo -> - lbl_geo#set_text (string_of_coordinates selected_georef geo) + lbl_geo#set_text (LL.string_of_coordinates selected_georef geo) method display_alt = fun wgs84 -> diff --git a/sw/lib/ocaml/mapCanvas.mli b/sw/lib/ocaml/mapCanvas.mli index 2fb4da51e0..acdb497567 100644 --- a/sw/lib/ocaml/mapCanvas.mli +++ b/sw/lib/ocaml/mapCanvas.mli @@ -35,7 +35,7 @@ class widget : ?georef:Latlong.geographic -> unit -> object - method add_info_georef : string -> Latlong.geographic -> unit + method add_info_georef : string -> < pos : Latlong.geographic > -> unit method altitude : Latlong.geographic -> int method any_event : GdkEvent.any -> bool method arc : @@ -68,7 +68,7 @@ class widget : method fix_bg_coords : Latlong.fmeter * Latlong.fmeter -> Latlong.fmeter * Latlong.fmeter method frame : GPack.box method georef : Latlong.geographic option - method georefs : (string * Latlong.geographic) list + method georefs : (string * < pos : Latlong.geographic >) list method get_center : unit -> Latlong.geographic method goto : unit -> unit method info : GPack.box