From 2beb6c779ffa7138b90a06bb01c49b9ddf4e8d22 Mon Sep 17 00:00:00 2001 From: frederic wagner Date: Fri, 23 Sep 2022 17:05:37 +0200 Subject: [PATCH] changed avg speed --- apps/gipy/app.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/apps/gipy/app.js b/apps/gipy/app.js index a918a7992..24676548b 100644 --- a/apps/gipy/app.js +++ b/apps/gipy/app.js @@ -183,16 +183,7 @@ class Status { if (this.starting_times[orientation] === null) { this.starting_times[orientation] = this.old_times[this.old_times.length - 1]; - if (orientation == 0) { - this.remaining_distances_at_start[orientation] = - this.remaining_distances[this.current_segment + 1] + - this.distance_to_next_point; - } else { - this.remaining_distances_at_start[orientation] = - this.remaining_distances[0] - - this.remaining_distances[this.current_segment] + - this.distance_to_next_point; - } + this.remaining_distances_at_start[orientation] = this.remaining_distance(orientation); } } @@ -308,7 +299,7 @@ class Status { let done_distance = this.remaining_distances_at_start[orientation] - remaining_distance; let done_in = - point_time - this.starting_times[orientation] - this.paused_time; + point_time - this.starting_times[orientation]; // TODO: add pauses if (done_in > 0) { approximate_speed = Math.round((done_distance * 3.6) / done_in); }