[gcs] immediately update intruder after adding new one

so that a new intruder is displayed at correct location
This commit is contained in:
Felix Ruess
2015-10-06 17:33:45 +02:00
parent fed13bdbe8
commit 27242d50b3
+3 -5
View File
@@ -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)