mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
Bug fixed for bearing/distance indication
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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 *)
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 ->
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user