gipy: small fixes

pull/2994/head
frederic wagner 2023-08-22 17:05:41 +02:00
parent e6f30b9dc0
commit 7baa0d2173
3 changed files with 9 additions and 9 deletions

View File

@ -103,3 +103,5 @@
* Jit is back for display functions (10% speed increase)
* Store, parse and display elevation data
* Removed 'lost' indicator (we now change position to purple when lost)
* Powersaving fix : don't powersave when lost
* Bugfix for negative remaining distance when going backwards

View File

@ -41,8 +41,6 @@ JIT: array declaration in jit is buggy
**************************
+ there is still a bug with negative remaining distances (when lost and nearest point is endpoint ?)
+ when lost we still get powersaving
+ try disabling gps for more powersaving
+ when you walk the direction still has a tendency to shift

View File

@ -847,7 +847,6 @@ class Status {
// now check if we strayed away from path or back to it
let lost = this.is_lost(next_segment);
if (this.on_path == lost) {
this.activate();
// if status changes
if (lost) {
Bangle.buzz(); // we lost path
@ -857,6 +856,9 @@ class Status {
}
this.on_path = !lost;
}
if (!this.on_path) {
this.activate();
}
this.current_segment = next_segment;
@ -959,14 +961,12 @@ class Status {
]);
}
remaining_distance() {
let remaining_in_correct_orientation =
this.remaining_distances[this.current_segment + 1] +
this.position.distance(this.path.point(this.current_segment + 1));
if (go_backwards) {
return this.remaining_distances[0] - remaining_in_correct_orientation;
return this.remaining_distances[0] - this.remaining_distances[this.current_segment] +
this.position.distance(this.path.point(this.current_segment));
} else {
return remaining_in_correct_orientation;
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)