Skip to content

Commit 4ef6ab1

Browse files
less confusing altitude graphs for grounded payloads
1 parent 3048945 commit 4ef6ab1

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

cache.manifest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# version 40
2+
# version 44
33

44
# gogole maps files
55
http://maps.google.com/maps/api/js?v=3.10&sensor=false&key=AIzaSyCOqkcNey4CCyG4X0X5qxHAhCgD8g5DwXg

js/tracker.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ function addPosition(position) {
703703
prediction_traget: null,
704704
prediction_burst: null,
705705
alt_list: [0],
706-
alt_last: 0,
707-
alt_max: 0
706+
time_last_alt: 0,
707+
alt_max: 100
708708
};
709709
vehicles.push(vehicle_info);
710710
}
@@ -718,8 +718,6 @@ function addPosition(position) {
718718
// if position array has at least 1 position
719719
if(vehicle.num_positions > 0) {
720720
if((new Date(vehicle.curr_position.gps_time)).getTime() >= (new Date(position.gps_time)).getTime()) {
721-
//if(vehicle.curr_position.gps_lat == position.gps_lat
722-
// && vehicle.curr_position.gps_lon == position.gps_lon) {
723721
if (("," + vehicle.curr_position.callsign + ",").indexOf("," + position.callsign + ",") === -1) {
724722
vehicle.curr_position.callsign += "," + position.callsign;
725723
}
@@ -736,8 +734,8 @@ function addPosition(position) {
736734
// if vehicle is not a car, record altitude
737735
if(vehicle.vehicle_type != "car") {
738736
// only record altitude values in 10minute interval
739-
if(convert_time(vehicle.curr_position.gps_time) - vehicle.alt_last >= 120) { // 120s = 2minutes
740-
vehicle.alt_last = convert_time(vehicle.curr_position.gps_time);
737+
if(convert_time(vehicle.curr_position.gps_time) - vehicle.time_last_alt >= 120) { // 120s = 2minutes
738+
vehicle.time_last_alt = convert_time(vehicle.curr_position.gps_time);
741739
var alt = parseInt(vehicle.curr_position.gps_alt);
742740

743741
if(alt > vehicle.alt_max) vehicle.alt_max = alt; // larged value in the set is required for encoding later

0 commit comments

Comments
 (0)