mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-08 02:15:53 +08:00
send ACINFO only if more than 1 aircraft flying
This commit is contained in:
@@ -565,17 +565,21 @@ let send_aircraft_msg = fun ac ->
|
||||
"agl", f a.agl;
|
||||
"climb", f a.climb] in
|
||||
Ground_Pprz.message_send my_id "FLIGHT_PARAM" values;
|
||||
(** build ACINFO messages *)
|
||||
let cm_of_m = fun f -> Pprz.Int (truncate (100. *. f)) in
|
||||
let ac_info = ["ac_id", Pprz.String ac;
|
||||
"utm_east", cm_of_m a.pos.utm_x;
|
||||
"utm_north", cm_of_m a.pos.utm_y;
|
||||
"course", Pprz.Int (truncate (10. *. (Geometry_2d.rad2deg a.course)));
|
||||
"alt", cm_of_m a.alt;
|
||||
"speed", cm_of_m a.gspeed;
|
||||
"climb", cm_of_m a.climb;
|
||||
"itow", Pprz.Int32 a.itow] in
|
||||
Dl_Pprz.message_send my_id "ACINFO" ac_info;
|
||||
|
||||
(** send ACINFO messages if more than one A/C registered *)
|
||||
if Hashtbl.length aircrafts > 1 then
|
||||
begin
|
||||
let cm_of_m = fun f -> Pprz.Int (truncate (100. *. f)) in
|
||||
let ac_info = ["ac_id", Pprz.String ac;
|
||||
"utm_east", cm_of_m a.pos.utm_x;
|
||||
"utm_north", cm_of_m a.pos.utm_y;
|
||||
"course", Pprz.Int (truncate (10. *. (Geometry_2d.rad2deg a.course)));
|
||||
"alt", cm_of_m a.alt;
|
||||
"speed", cm_of_m a.gspeed;
|
||||
"climb", cm_of_m a.climb;
|
||||
"itow", Pprz.Int32 a.itow] in
|
||||
Dl_Pprz.message_send my_id "ACINFO" ac_info;
|
||||
end;
|
||||
|
||||
if !kml then
|
||||
update_kml_ac a;
|
||||
|
||||
Reference in New Issue
Block a user