diff --git a/src/server.js b/src/server.js index 6e0a7f1..d1029ae 100644 --- a/src/server.js +++ b/src/server.js @@ -147,13 +147,13 @@ function adsb2dd(key, json) { } // skip if no change to lat/lon/alt - if (dict[key]['out'][hexCode]['lat'] === aircraft['lat'] && - dict[key]['out'][hexCode]['lon'] === aircraft['lon'] && - dict[key]['out'][hexCode]['alt'] === aircraft['alt_geom']) { + if (dict[key]['proc'][hexCode]['lat'] === aircraft['lat'] && + dict[key]['proc'][hexCode]['lon'] === aircraft['lon'] && + dict[key]['proc'][hexCode]['alt'] === aircraft['alt_geom']) { continue; } - dict[key]['out'][hexCode]['timestamp'] = json.now + aircraft.seen_pos; + dict[key]['out'][hexCode]['timestamp'] = json.now - aircraft.seen_pos; dict[key]['out'][hexCode]['flight'] = (aircraft.flight); dict[key]['proc'][hexCode]['lat'] = aircraft['lat']; dict[key]['proc'][hexCode]['lon'] = aircraft['lon']; @@ -173,7 +173,7 @@ function adsb2dd(key, json) { // store bistatic delay/timestamps for Doppler dict[key]['proc'][hexCode]['delays'].push(delay); - dict[key]['proc'][hexCode]['timestamps'].push(json.now + aircraft.seen_pos); + dict[key]['proc'][hexCode]['timestamps'].push(json.now - aircraft.seen_pos); // bistatic Doppler (Hz) if (dict[key]['proc'][hexCode]['delays'].length >= 2) {