diff --git a/apps/gipy/ChangeLog b/apps/gipy/ChangeLog index 09637df1b..bbca5846c 100644 --- a/apps/gipy/ChangeLog +++ b/apps/gipy/ChangeLog @@ -107,3 +107,8 @@ * Bugfix for negative remaining distance when going backwards * New settings for powersaving * Adjustments to powersaving algorithm + +0.22: + * Powersaving disabled by default + * Default choice for powersaving in the settings + * Better position in elevation profiles \ No newline at end of file diff --git a/apps/gipy/app.js b/apps/gipy/app.js index bbbe543e7..d3293959d 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -966,11 +966,16 @@ class Status { } remaining_distance() { if (go_backwards) { - return this.remaining_distances[0] - this.remaining_distances[this.current_segment] + - this.position.distance(this.path.point(this.current_segment)); + return ( + this.remaining_distances[0] - + this.remaining_distances[this.current_segment] + + this.position.distance(this.path.point(this.current_segment)) + ); } else { - return this.remaining_distances[this.current_segment + 1] + - this.position.distance(this.path.point(this.current_segment + 1)); + return ( + this.remaining_distances[this.current_segment + 1] + + this.position.distance(this.path.point(this.current_segment + 1)) + ); } } // check if we are lost (too far from segment we think we are on) @@ -1000,12 +1005,11 @@ class Status { } else { let current_position = 0; if (this.current_segment !== null) { - if (go_backwards) { - current_position = this.remaining_distance(); - } else { current_position = - this.remaining_distances[0] - this.remaining_distance(); - } + this.remaining_distances[this.current_segment + 1] + + this.projected_point.distance( + this.path.point(this.current_segment + 1) + ); } if (this.screen == HEIGHTS_FULL) { this.display_heights(0, current_position, this.remaining_distances[0]); @@ -1044,7 +1048,7 @@ class Status { break; } } - end_point_index = Math.min(end_point_index+1, this.path.len -1); + end_point_index = Math.min(end_point_index + 1, this.path.len - 1); let max_height = Number.NEGATIVE_INFINITY; let min_height = Number.POSITIVE_INFINITY; for (let i = start_point_index; i <= end_point_index; i++) { diff --git a/apps/gipy/metadata.json b/apps/gipy/metadata.json index d6b5e1405..53176f61f 100644 --- a/apps/gipy/metadata.json +++ b/apps/gipy/metadata.json @@ -2,7 +2,7 @@ "id": "gipy", "name": "Gipy", "shortName": "Gipy", - "version": "0.21", + "version": "0.22", "description": "Follow gpx files using the gps. Don't get lost in your bike trips and hikes.", "allow_emulator":false, "icon": "gipy.png",