From 77ca59567f79dab6d85874a9a7d9e829d6075bbc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 17 Dec 2018 22:57:51 -0800 Subject: Add status icons and other updates 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 --- app/ValueSource.qml | 39 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 37 insertions(+), 2 deletions(-) (limited to 'app/ValueSource.qml') 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 -- cgit 1.2.3-korg