1 /* Copyright (C) 2015, Jaguar Land Rover. All Rights Reserved.
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
12 property bool metric: false
14 function galToL(value) {
15 return (metric ? 3.78541 : 1) * value
18 function mpgToLp100(value) {
19 return metric ? 235.214583571 / value : value
22 property real baseTank: 25
23 property real tankSize: galToL(baseTank)
24 property real level: tankSize * percentage * 0.01
25 property real percentage: 100
26 property real range: metric ? 100 * level / average : level * average
27 property real baseAverage: 20.7
28 property real average: mpgToLp100(baseAverage + mpgDiff)
29 property real mpgDiff: 0
31 NumberAnimation on percentage {
35 loops: Animation.Infinite
36 easing.type: Easing.CosineCurve
39 NumberAnimation on mpgDiff {
43 loops: Animation.Infinite
44 easing.type: Easing.CosineCurve