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-18 07:03:29 +0000
commit77ca59567f79dab6d85874a9a7d9e829d6075bbc (patch)
treed8ea8c1879d06dbd3e8023dcbd262c8cda9c1377 /app/ValueSource.qml
parentd9d2667e365f7e4220afd8098a694800666329af (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