mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-20 19:36:19 +08:00
[srtm] improving information messages about SRTM data
This commit is contained in:
@@ -171,7 +171,7 @@
|
||||
<child>
|
||||
<widget class="GtkEventBox" id="eventbox14">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Above Ground Level (m), climb indicator, vertical speed (m/s)</property>
|
||||
<property name="tooltip" translatable="yes">Above Ground Level from SRTM if available, ground reference otherwise (m), climb indicator, vertical speed (m/s)</property>
|
||||
<child>
|
||||
<widget class="GtkDrawingArea" id="drawingarea_agl">
|
||||
<property name="visible">True</property>
|
||||
|
||||
@@ -645,7 +645,7 @@ object (self)
|
||||
|
||||
|
||||
class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
let srtm = GMenu.check_menu_item ~label:"SRTM" ~active:srtm () in
|
||||
let srtm = GMenu.check_menu_item ~label:"display SRTM alt" ~active:srtm () in
|
||||
let lbl_xy = GMisc.label ()
|
||||
and lbl_geo = GMisc.label ()
|
||||
and lbl_alt = GMisc.label ()
|
||||
@@ -676,6 +676,7 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
let bg_menu = my_check_menu_item "Background" ~active:true ~callback:self#switch_background ~packing:self#file_menu#append () in
|
||||
|
||||
let tooltips = GData.tooltips () in
|
||||
tooltips#set_tip srtm#coerce ~text:"Display SRTM alt at pointer position (will request for download if not available)";
|
||||
|
||||
let b = GButton.button ~packing:toolbar#add () in
|
||||
ignore (b#connect#clicked (fun _ -> bg_menu#activate ()));
|
||||
@@ -777,7 +778,9 @@ class widget = fun ?(height=800) ?(srtm=false) ?width ?projection ?georef () ->
|
||||
|
||||
method display_alt = fun wgs84 ->
|
||||
if srtm#active then
|
||||
lbl_alt#set_text (sprintf " SRTM:%dm"(self#altitude wgs84))
|
||||
lbl_alt#set_text (sprintf " SRTM:%dm"(self#altitude wgs84))
|
||||
else if not (Srtm.available wgs84) then
|
||||
lbl_alt#set_text (sprintf " SRTM: N/A")
|
||||
|
||||
method display_group = fun s -> lbl_group#set_text s
|
||||
|
||||
|
||||
@@ -79,6 +79,9 @@ let of_wgs84 = fun geo ->
|
||||
let of_utm = fun utm ->
|
||||
of_wgs84 (Latlong.of_utm WGS84 utm)
|
||||
|
||||
let available = fun geo ->
|
||||
try ignore(of_wgs84 geo); true with _ -> false
|
||||
|
||||
let area_of_tile = fun tile ->
|
||||
let area = open_compressed "srtm.data.bz2" in
|
||||
let rec _area_of_tile = fun () ->
|
||||
|
||||
@@ -33,11 +33,14 @@ exception Tile_not_found of error
|
||||
|
||||
val error : error -> string
|
||||
|
||||
val available : Latlong.geographic -> bool
|
||||
(** [available wgs84_pos] Returns true if srtm tile is available *)
|
||||
|
||||
val of_utm : Latlong.utm -> int
|
||||
(** [of_utm utm_pos] Returns the altitude of the given UTM position *)
|
||||
|
||||
val of_wgs84 : Latlong.geographic -> int
|
||||
(** [of_utm utm_pos] Returns the altitude of the given geographic position *)
|
||||
(** [of_wgs84 wgs84_pos] Returns the altitude of the given geographic position *)
|
||||
|
||||
val area_of_tile : string -> string
|
||||
|
||||
|
||||
Reference in New Issue
Block a user