diff --git a/config.template.js b/config.template.js index 3b5f9ce..d5373b6 100644 --- a/config.template.js +++ b/config.template.js @@ -19,7 +19,8 @@ BR.conf.profiles = [ 'trekking', 'fastbike', - 'car-test', + 'car-eco', + 'car-fast', 'safety', 'shortest', 'trekking-ignore-cr', @@ -48,7 +49,8 @@ 'fastbike', 'shortest', 'moped', - 'car-test' + 'car-eco', + 'car-fast' ]; BR.conf.host = 'http://0.0.0.0:17777'; diff --git a/index.html b/index.html index 4366844..957343e 100644 --- a/index.html +++ b/index.html @@ -209,6 +209,14 @@
0 km
+0 min
+0 (0)
+0 (0) m
diff --git a/js/control/TrackStats.js b/js/control/TrackStats.js index 09de1ca..f6abc9d 100644 --- a/js/control/TrackStats.js +++ b/js/control/TrackStats.js @@ -3,11 +3,19 @@ BR.TrackStats = L.Class.extend({ var stats = this.calcStats(polyline, segments), length1 = L.Util.formatNum(stats.trackLength/1000,1), length3 = L.Util.formatNum(stats.trackLength/1000,3), - meanCostFactor = stats.trackLength ? L.Util.formatNum(stats.cost / stats.trackLength, 2) : '' + meanCostFactor = stats.trackLength ? L.Util.formatNum(stats.cost / stats.trackLength, 2) : '', + formattedTime = L.Util.formatNum(stats.totalTime / 60., 1), + formattedEnergy = L.Util.formatNum(stats.totalEnergy / 3600000., 2), + meanEnergy = stats.trackLength ? L.Util.formatNum(stats.totalEnergy / 36. / stats.trackLength, 2) : ''; $('#distance').html(length1 + ' km'); $('#ascend').html(stats.filteredAscend + ' (' + stats.plainAscend +')' + ' m'); $('#cost').html(stats.cost + ' (' + meanCostFactor + ')'); + $('#totaltime').html(formattedTime + ' min'); + $('#totalenergy').html(formattedEnergy + ' (' + meanEnergy +') kWh'); + + document.getElementById('totaltime').parentElement.hidden = !stats.totalTime; + document.getElementById('totalenergy').parentElement.hidden = !stats.totalEnergy; }, calcStats: function(polyline, segments) { @@ -15,6 +23,8 @@ BR.TrackStats = L.Class.extend({ trackLength: 0, filteredAscend: 0, plainAscend: 0, + totalTime: 0, + totalEnergy: 0, cost: 0 }; var i, props; @@ -24,6 +34,8 @@ BR.TrackStats = L.Class.extend({ stats.trackLength += +props['track-length']; stats.filteredAscend += +props['filtered ascend']; stats.plainAscend += +props['plain-ascend']; + stats.totalTime += +props['total-time']; + stats.totalEnergy += +props['total-energy']; stats.cost += +props['cost']; }