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/DashboardGaugeStyle.qml | 3 +- app/ValueSource.qml | 39 +++++++++- app/cluster-gauges.qml | 104 +++++++++++++++++++++++++-- app/images/AGL_Icons_ABS.svg | 1 + app/images/AGL_Icons_ABS_red.svg | 1 + app/images/AGL_Icons_ABS_yellow.svg | 1 + app/images/AGL_Icons_Battery.svg | 1 + app/images/AGL_Icons_Battery_red.svg | 1 + app/images/AGL_Icons_Battery_yellow.svg | 1 + app/images/AGL_Icons_Engine.svg | 1 + app/images/AGL_Icons_Engine_red.svg | 1 + app/images/AGL_Icons_Engine_yellow.svg | 1 + app/images/AGL_Icons_Lights.svg | 1 + app/images/AGL_Icons_Lights_red.svg | 1 + app/images/AGL_Icons_Lights_yellow.svg | 1 + app/images/AGL_Icons_Oil.svg | 1 + app/images/AGL_Icons_Oil_red.svg | 1 + app/images/AGL_Icons_Oil_yellow.svg | 1 + app/images/AGL_Icons_OpenDoor.svg | 1 + app/images/AGL_Icons_OpenDoor_red.svg | 1 + app/images/AGL_Icons_OpenDoor_yellow.svg | 1 + app/images/AGL_Icons_ParkingBrake.svg | 1 + app/images/AGL_Icons_ParkingBrake_red.svg | 1 + app/images/AGL_Icons_ParkingBrake_yellow.svg | 1 + app/images/AGL_Icons_Seatbelt.svg | 1 + app/images/AGL_Icons_Seatbelt_red.svg | 1 + app/images/AGL_Icons_Seatbelt_yellow.svg | 1 + app/images/images.qrc | 24 +++++++ 28 files changed, 185 insertions(+), 9 deletions(-) create mode 100644 app/images/AGL_Icons_ABS.svg create mode 100644 app/images/AGL_Icons_ABS_red.svg create mode 100644 app/images/AGL_Icons_ABS_yellow.svg create mode 100644 app/images/AGL_Icons_Battery.svg create mode 100644 app/images/AGL_Icons_Battery_red.svg create mode 100644 app/images/AGL_Icons_Battery_yellow.svg create mode 100644 app/images/AGL_Icons_Engine.svg create mode 100644 app/images/AGL_Icons_Engine_red.svg create mode 100644 app/images/AGL_Icons_Engine_yellow.svg create mode 100644 app/images/AGL_Icons_Lights.svg create mode 100644 app/images/AGL_Icons_Lights_red.svg create mode 100644 app/images/AGL_Icons_Lights_yellow.svg create mode 100644 app/images/AGL_Icons_Oil.svg create mode 100644 app/images/AGL_Icons_Oil_red.svg create mode 100644 app/images/AGL_Icons_Oil_yellow.svg create mode 100644 app/images/AGL_Icons_OpenDoor.svg create mode 100644 app/images/AGL_Icons_OpenDoor_red.svg create mode 100644 app/images/AGL_Icons_OpenDoor_yellow.svg create mode 100644 app/images/AGL_Icons_ParkingBrake.svg create mode 100644 app/images/AGL_Icons_ParkingBrake_red.svg create mode 100644 app/images/AGL_Icons_ParkingBrake_yellow.svg create mode 100644 app/images/AGL_Icons_Seatbelt.svg create mode 100644 app/images/AGL_Icons_Seatbelt_red.svg create mode 100644 app/images/AGL_Icons_Seatbelt_yellow.svg diff --git a/app/DashboardGaugeStyle.qml b/app/DashboardGaugeStyle.qml index d765a70..aafe50f 100644 --- a/app/DashboardGaugeStyle.qml +++ b/app/DashboardGaugeStyle.qml @@ -131,7 +131,8 @@ CircularGaugeStyle { readonly property int kphInt: control.value } Text { - text: "km/h" + id: speedLabel + text: valueSource.mphDisplay ? "MPH" : "km/h" color: "white" font.pixelSize: toPixels(0.09) anchors.top: speedText.bottom 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 diff --git a/app/cluster-gauges.qml b/app/cluster-gauges.qml index 013a0c1..a48d71c 100644 --- a/app/cluster-gauges.qml +++ b/app/cluster-gauges.qml @@ -81,7 +81,7 @@ ApplicationWindow { id: statusFrame x: (parent.width - width) / 2 y: 80 - width: 960 + width: 1152 height: 96 radius: height / 5 @@ -92,13 +92,13 @@ ApplicationWindow { Row { width: parent.width height: parent.height * 0.75 - spacing: (parent.width - (10 * parent.height * 0.75)) / 11 + spacing: (parent.width - (12 * parent.height * 0.75)) / 13 anchors.fill: parent anchors.topMargin: (parent.height - height) /2 anchors.bottomMargin: (parent.height - height) /2 - anchors.leftMargin: (parent.width - (10 * parent.height * 0.75)) / 11 - anchors.rightMargin: (parent.width - (10 * parent.height * 0.75)) / 11 + anchors.leftMargin: (parent.width - (12 * parent.height * 0.75)) / 13 + anchors.rightMargin: (parent.width - (12 * parent.height * 0.75)) / 13 Rectangle { width: height @@ -129,6 +129,34 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_Engine_yellow.svg' : './images/AGL_Icons_Engine.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } + } + + Rectangle { + width: height + height: parent.height + radius: height / 5 + + color: "black" + border.width: 2 + border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_Oil_red.svg' : './images/AGL_Icons_Oil.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -139,6 +167,15 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_ABS_red.svg' : './images/AGL_Icons_ABS.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -149,6 +186,15 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_Battery_red.svg' : './images/AGL_Icons_Battery.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -202,6 +248,34 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_Seatbelt_red.svg' : './images/AGL_Icons_Seatbelt.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } + } + + Rectangle { + width: height + height: parent.height + radius: height / 5 + + color: "black" + border.width: 2 + border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_OpenDoor_red.svg' : './images/AGL_Icons_OpenDoor.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -212,6 +286,15 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_Lights_red.svg' : './images/AGL_Icons_Lights.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -222,6 +305,15 @@ ApplicationWindow { color: "black" border.width: 2 border.color: "grey" + + Image { + source: valueSource.startUp ? './images/AGL_Icons_ParkingBrake_red.svg' : './images/AGL_Icons_ParkingBrake.svg' + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + width: height + height: parent.height * 0.75 + fillMode: Image.PreserveAspectFit + } } Rectangle { @@ -260,8 +352,8 @@ ApplicationWindow { width: parent.width * 0.9 height: width - maximumValue: 220 - value: valueSource.kph + maximumValue: valueSource.mphDisplay ? 140 : 220 + value: valueSource.kph * valueSource.speedScaling style: DashboardGaugeStyle {} } diff --git a/app/images/AGL_Icons_ABS.svg b/app/images/AGL_Icons_ABS.svg new file mode 100644 index 0000000..edbedf9 --- /dev/null +++ b/app/images/AGL_Icons_ABS.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_ABS_red.svg b/app/images/AGL_Icons_ABS_red.svg new file mode 100644 index 0000000..eee96ff --- /dev/null +++ b/app/images/AGL_Icons_ABS_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_ABS_yellow.svg b/app/images/AGL_Icons_ABS_yellow.svg new file mode 100644 index 0000000..253d732 --- /dev/null +++ b/app/images/AGL_Icons_ABS_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Battery.svg b/app/images/AGL_Icons_Battery.svg new file mode 100644 index 0000000..a98e6ba --- /dev/null +++ b/app/images/AGL_Icons_Battery.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Battery_red.svg b/app/images/AGL_Icons_Battery_red.svg new file mode 100644 index 0000000..e2354b5 --- /dev/null +++ b/app/images/AGL_Icons_Battery_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Battery_yellow.svg b/app/images/AGL_Icons_Battery_yellow.svg new file mode 100644 index 0000000..5ab1800 --- /dev/null +++ b/app/images/AGL_Icons_Battery_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Engine.svg b/app/images/AGL_Icons_Engine.svg new file mode 100644 index 0000000..2a878bc --- /dev/null +++ b/app/images/AGL_Icons_Engine.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Engine_red.svg b/app/images/AGL_Icons_Engine_red.svg new file mode 100644 index 0000000..c78cf80 --- /dev/null +++ b/app/images/AGL_Icons_Engine_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Engine_yellow.svg b/app/images/AGL_Icons_Engine_yellow.svg new file mode 100644 index 0000000..fb70571 --- /dev/null +++ b/app/images/AGL_Icons_Engine_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Lights.svg b/app/images/AGL_Icons_Lights.svg new file mode 100644 index 0000000..889582f --- /dev/null +++ b/app/images/AGL_Icons_Lights.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Lights_red.svg b/app/images/AGL_Icons_Lights_red.svg new file mode 100644 index 0000000..fd3ee5e --- /dev/null +++ b/app/images/AGL_Icons_Lights_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Lights_yellow.svg b/app/images/AGL_Icons_Lights_yellow.svg new file mode 100644 index 0000000..b06dcc8 --- /dev/null +++ b/app/images/AGL_Icons_Lights_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Oil.svg b/app/images/AGL_Icons_Oil.svg new file mode 100644 index 0000000..4448b89 --- /dev/null +++ b/app/images/AGL_Icons_Oil.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Oil_red.svg b/app/images/AGL_Icons_Oil_red.svg new file mode 100644 index 0000000..6a0681a --- /dev/null +++ b/app/images/AGL_Icons_Oil_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Oil_yellow.svg b/app/images/AGL_Icons_Oil_yellow.svg new file mode 100644 index 0000000..8af8c0e --- /dev/null +++ b/app/images/AGL_Icons_Oil_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_OpenDoor.svg b/app/images/AGL_Icons_OpenDoor.svg new file mode 100644 index 0000000..9f99ab2 --- /dev/null +++ b/app/images/AGL_Icons_OpenDoor.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_OpenDoor_red.svg b/app/images/AGL_Icons_OpenDoor_red.svg new file mode 100644 index 0000000..f4aca7b --- /dev/null +++ b/app/images/AGL_Icons_OpenDoor_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_OpenDoor_yellow.svg b/app/images/AGL_Icons_OpenDoor_yellow.svg new file mode 100644 index 0000000..18c2777 --- /dev/null +++ b/app/images/AGL_Icons_OpenDoor_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_ParkingBrake.svg b/app/images/AGL_Icons_ParkingBrake.svg new file mode 100644 index 0000000..01fa7ef --- /dev/null +++ b/app/images/AGL_Icons_ParkingBrake.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_ParkingBrake_red.svg b/app/images/AGL_Icons_ParkingBrake_red.svg new file mode 100644 index 0000000..d9dec37 --- /dev/null +++ b/app/images/AGL_Icons_ParkingBrake_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_ParkingBrake_yellow.svg b/app/images/AGL_Icons_ParkingBrake_yellow.svg new file mode 100644 index 0000000..8e99d11 --- /dev/null +++ b/app/images/AGL_Icons_ParkingBrake_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Seatbelt.svg b/app/images/AGL_Icons_Seatbelt.svg new file mode 100644 index 0000000..8664864 --- /dev/null +++ b/app/images/AGL_Icons_Seatbelt.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Seatbelt_red.svg b/app/images/AGL_Icons_Seatbelt_red.svg new file mode 100644 index 0000000..901da9c --- /dev/null +++ b/app/images/AGL_Icons_Seatbelt_red.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/AGL_Icons_Seatbelt_yellow.svg b/app/images/AGL_Icons_Seatbelt_yellow.svg new file mode 100644 index 0000000..4871125 --- /dev/null +++ b/app/images/AGL_Icons_Seatbelt_yellow.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/images/images.qrc b/app/images/images.qrc index 8767add..9a8e2de 100644 --- a/app/images/images.qrc +++ b/app/images/images.qrc @@ -4,5 +4,29 @@ Utility_Logo_Grey-01.svg fuel-icon.png temperature-icon.png + AGL_Icons_ABS.svg + AGL_Icons_ABS_red.svg + AGL_Icons_ABS_yellow.svg + AGL_Icons_Battery.svg + AGL_Icons_Battery_red.svg + AGL_Icons_Battery_yellow.svg + AGL_Icons_Engine.svg + AGL_Icons_Engine_red.svg + AGL_Icons_Engine_yellow.svg + AGL_Icons_Lights.svg + AGL_Icons_Lights_red.svg + AGL_Icons_Lights_yellow.svg + AGL_Icons_Oil.svg + AGL_Icons_Oil_red.svg + AGL_Icons_Oil_yellow.svg + AGL_Icons_OpenDoor.svg + AGL_Icons_OpenDoor_red.svg + AGL_Icons_OpenDoor_yellow.svg + AGL_Icons_ParkingBrake.svg + AGL_Icons_ParkingBrake_red.svg + AGL_Icons_ParkingBrake_yellow.svg + AGL_Icons_Seatbelt.svg + AGL_Icons_Seatbelt_red.svg + AGL_Icons_Seatbelt_yellow.svg -- cgit 1.2.3-korg