mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-31 12:23:23 +08:00
speed displayed
This commit is contained in:
@@ -134,7 +134,7 @@ let load_mission = fun color geomap url ->
|
||||
fp
|
||||
|
||||
|
||||
let aircraft_pos_msg = fun track utm_x_ utm_y_ heading altitude ->
|
||||
let aircraft_pos_msg = fun track utm_x_ utm_y_ heading altitude speed ->
|
||||
match !map_ref with
|
||||
None -> ()
|
||||
| Some utm0 ->
|
||||
@@ -146,7 +146,7 @@ let aircraft_pos_msg = fun track utm_x_ utm_y_ heading altitude ->
|
||||
with
|
||||
_ -> truncate altitude
|
||||
in
|
||||
track#move_icon en heading altitude (float_of_int h)
|
||||
track#move_icon en heading altitude (float_of_int h) speed
|
||||
|
||||
let carrot_pos_msg = fun track utm_x utm_y ->
|
||||
match !map_ref with
|
||||
@@ -264,7 +264,7 @@ let listen_flight_params = fun () ->
|
||||
try
|
||||
let ac = Hashtbl.find live_aircrafts ac_id in
|
||||
let a = fun s -> Pprz.float_assoc s vs in
|
||||
aircraft_pos_msg ac.track (a "east") (a "north") (a "course") (a "alt")
|
||||
aircraft_pos_msg ac.track (a "east") (a "north") (a "course") (a "alt") (a "speed")
|
||||
with Not_found -> ()
|
||||
in
|
||||
ignore (Ground_Pprz.message_bind "FLIGHT_PARAM" get_fp);
|
||||
@@ -284,7 +284,7 @@ let listen_flight_params = fun () ->
|
||||
try
|
||||
let ac = Hashtbl.find live_aircrafts ac_id in
|
||||
let a = fun s -> Pprz.float_assoc s vs in
|
||||
cam_pos_msg ac.track (a "cam_east") (a "cam_north") (a "target_east") (a "target_north")
|
||||
cam_pos_msg ac.track (a "cam_east") (a "cam_north") (a "target_east") (a "target_north")
|
||||
with Not_found -> ()
|
||||
in ignore (Ground_Pprz.message_bind "CAM_STATUS" get_cam_status);
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ class track = fun ?(name="coucou") ?(size = 500) ?(color="red") (geomap:MapCanva
|
||||
val mutable last = None
|
||||
val mutable last_heading = 0.0
|
||||
val mutable last_altitude = 0.0
|
||||
val mutable last_speed = 0.0
|
||||
val mutable last_height = 0.0
|
||||
val mutable last_xw = 0.0
|
||||
val mutable last_yw = 0.0
|
||||
@@ -127,7 +128,7 @@ class track = fun ?(name="coucou") ?(size = 500) ?(color="red") (geomap:MapCanva
|
||||
end;
|
||||
self#incr;
|
||||
last <- Some en
|
||||
method move_icon = fun en heading altitude relief_height ->
|
||||
method move_icon = fun en heading altitude relief_height speed ->
|
||||
let (xw,yw) = geomap#world_of_en en in
|
||||
aircraft#affine_absolute (affine_pos_and_angle geomap#zoom_adj#value xw yw heading);
|
||||
last_heading <- heading;
|
||||
@@ -135,8 +136,9 @@ class track = fun ?(name="coucou") ?(size = 500) ?(color="red") (geomap:MapCanva
|
||||
last_xw <- xw;
|
||||
last_yw <- yw;
|
||||
last_height <- (altitude -. relief_height);
|
||||
last_speed <- speed ;
|
||||
if params_on then
|
||||
ac_label#set [`TEXT ( name^" \n"^(string_of_float last_height)^" m\n" ); `Y 70. ] else
|
||||
ac_label#set [`TEXT ( name^" \n"^(string_of_float last_height)^" m\n"^(string_of_float last_speed)^" m/s\n" ); `Y 70. ] else
|
||||
ac_label#set [`TEXT name; `Y 25.];
|
||||
ac_label#affine_absolute (affine_pos_and_angle geomap#zoom_adj#value xw yw 0.)
|
||||
method move_carrot = fun en ->
|
||||
|
||||
@@ -83,7 +83,7 @@ let _ =
|
||||
let speed = GData.adjustment ~value:1. ~lower:0.05 ~upper:10.
|
||||
~step_incr:0.25 ~page_incr:1.0 () in
|
||||
|
||||
let bus = ref "127.255.255.255:2010" in
|
||||
let bus = ref "127.255.255.255:3333" in
|
||||
Arg.parse
|
||||
[ "-b", Arg.String (fun x -> bus := x), "Bus\tDefault is 127.255.255.25:2010"]
|
||||
(fun x -> load_log window adj x)
|
||||
|
||||
Reference in New Issue
Block a user