From: Urban Wallasch Date: Tue, 13 Aug 2019 13:26:54 +0000 (+0200) Subject: * Fixed display of invalid negative values for fuel consumption, e.g. in brand new... X-Git-Tag: v0.1.0~24 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=f8b7bd163cb02f56165eea8a69ee566fdff5e455;p=ets2_tele.git * Fixed display of invalid negative values for fuel consumption, e.g. in brand new truck. * Tweaked time to next rest stop warning level threshold to match in-game display. --- diff --git a/dash.html b/dash.html index b3e13c3..f3a5016 100644 --- a/dash.html +++ b/dash.html @@ -422,7 +422,7 @@ function update_cb() { if ( last_fuel != tele.fuel && last_odometer != tele.odometer ) { if ( last_fuel > 0 && last_odometer > 0 ) { var fc = (last_fuel-tele.fuel)*100 / (tele.odometer-last_odometer); - fuel_cons.innerHTML = fc > 999 ? '∞' : fc.toFixed(1); + fuel_cons.innerHTML = fc > 999 ? '∞' : fc < 0 ? '-' : fc.toFixed(1); } last_fuel = tele.fuel; last_odometer = tele.odometer; @@ -457,7 +457,7 @@ function update_cb() { // time until next rest stop: if ( !last_tele || last_tele.next_rest != tele.next_rest ) { next_rest.innerHTML = m2hm(tele.next_rest); - warn( next_rest, tele.next_rest < 60 ? 2 : tele.next_rest < 99 ? 1 : 0 ); + warn( next_rest, tele.next_rest < 67 ? 2 : tele.next_rest < 99 ? 1 : 0 ); } // remaining time until job delivery date: if ( tele.job_isvalid ) {