mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 16:58:48 +08:00
[gcs] immediately update intruder after adding new one
so that a new intruder is displayed at correct location
This commit is contained in:
@@ -1469,11 +1469,9 @@ let get_intruders = fun (geomap:G.widget) _sender vs ->
|
||||
and lat = (i "lat") /. 1e7
|
||||
and lon = (i "lon") /. 1e7 in
|
||||
let pos = { posn_lat=(Deg>>Rad)lat; posn_long=(Deg>>Rad)lon } in
|
||||
if Intruders.intruder_exist id
|
||||
then
|
||||
Intruders.update_intruder id pos (f "course") ((i "alt") /. 1000.) (f "speed") (f "climb") time
|
||||
else
|
||||
Intruders.new_intruder id name time geomap
|
||||
if not (Intruders.intruder_exist id) then
|
||||
Intruders.new_intruder id name time geomap;
|
||||
Intruders.update_intruder id pos (f "course") ((i "alt") /. 1000.) (f "speed") (f "climb") time
|
||||
|
||||
let listen_intruders = fun (geomap:G.widget) ->
|
||||
safe_bind "INTRUDER" (get_intruders geomap)
|
||||
|
||||
Reference in New Issue
Block a user