summaryrefslogtreecommitdiffstats
path: root/app/ValueSource.qml
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2018-12-17 22:57:51 -0800
committerScott Murray <scott.murray@konsulko.com>2018-12-17 23:03:07 -0800
commit6ec520cca1ae419f02d99c2195626ac89c0d0b6d (patch)
tree2255c690ced127e2f55a62d71458969edd477040 /app/ValueSource.qml
parent98a10ae29d925dbba6b9cb767ce9db00591ade41 (diff)
Add status icons provided by AGL graphics design team, and tweak the animation behavior to simulate power on at the start of the cycle by blinking them. Additionally, the speed has been switched to MPH, and the turn signal animation has been udpated to simulate passing as opposed to a turn at the start of the cycle. Change-Id: If5e3b9d2138d1129a7478bea1f4f2cb6b05f1499 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'app/ValueSource.qml')
-rw-r--r--app/ValueSource.qml39
1 files changed, 37 insertions, 2 deletions
diff --git a/app/ValueSource.qml b/app/ValueSource.qml
index 41d0f96..48e5cf6 100644
--- a/app/ValueSource.qml
+++ b/app/ValueSource.qml
@@ -53,6 +53,8 @@ import QtQuick 2.2
Item {
id: valueSource
property real kph: 0
+ property bool mphDisplay: true
+ property real speedScaling: mphDisplay == true ? 0.621 : 1.0
property real rpm: 1
property real fuel: 0.85
property string gear: {
@@ -80,9 +82,11 @@ Item {
}
return "P";
}
- property int turnSignal: prindle == "P" && !start ? randomDirection() : -1
- property real temperature: 0.6
+
property bool start: true
+ property int turnSignal: -1
+ property bool startUp: false
+ property real temperature: 0.6
function randomDirection() {
return Math.random() > 0.5 ? Qt.LeftArrow : Qt.RightArrow;
@@ -105,6 +109,22 @@ Item {
SequentialAnimation {
loops: Animation.Infinite
+
+ // Simulate startup with indicators blink
+ PropertyAction {
+ target: valueSource
+ property: "startUp"
+ value: true
+ }
+ PauseAnimation {
+ duration: 1000
+ }
+ PropertyAction {
+ target: valueSource
+ property: "startUp"
+ value: false
+ }
+
ParallelAnimation {
NumberAnimation {
target: valueSource
@@ -244,6 +264,13 @@ Item {
}
}
+ // Turn signal on
+ PropertyAction {
+ target: valueSource
+ property: "turnSignal"
+ value: randomDirection()
+ }
+
// Cruise for a while
ParallelAnimation {
NumberAnimation {
@@ -261,6 +288,14 @@ Item {
duration: 10000
}
}
+
+ // Turn signal off
+ PropertyAction {
+ target: valueSource
+ property: "turnSignal"
+ value: -1
+ }
+
ParallelAnimation {
NumberAnimation {
target: valueSource