gipy: better position in elevation profiles

pull/3022/head
frederic wagner 2023-09-21 11:44:29 +02:00
parent 88f45b6714
commit a7a845fae4
3 changed files with 20 additions and 11 deletions

View File

@ -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

View File

@ -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]);

View File

@ -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",