aboutsummaryrefslogtreecommitdiffstats
path: root/app/qml/InfoWindow.qml
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2020-01-15 10:53:13 -0500
committerScott Murray <scott.murray@konsulko.com>2020-01-17 16:50:05 +0000
commit59d23c161921890425e8d2e91441381d0fef0a32 (patch)
tree3a89fa7e2afd3d7314379015dcd48b3456d53a43 /app/qml/InfoWindow.qml
parentac85ae4ce0a2e5c3bd433db2882422a86539b203 (diff)
Add info page selected by steering wheel eventhalibut_8.0.6halibut_8.0.5halibut/8.0.6halibut/8.0.58.0.68.0.5halibut
Add a information window that can be switched to based on the "event.info" event from signal composer that the steering wheel "Info" button results in. For now, it simply displays the vehicle and engine speed in numeric form in a larger font, and a small time display. The speeds are also driven by the corresponding signal composer events that are hooked to the underlying CAN messages. Bug-AGL: SPEC-3109 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ibe66ecdb94b854d4ebc7f98ad7e1bf01fc615f1a
Diffstat (limited to 'app/qml/InfoWindow.qml')
-rw-r--r--app/qml/InfoWindow.qml101
1 files changed, 101 insertions, 0 deletions
diff --git a/app/qml/InfoWindow.qml b/app/qml/InfoWindow.qml
new file mode 100644
index 0000000..4acba5d
--- /dev/null
+++ b/app/qml/InfoWindow.qml
@@ -0,0 +1,101 @@
+import QtQuick 2.9
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+
+Rectangle {
+ id: infoWindow
+
+ anchors.fill: parent
+ color: "black"
+
+ property date now: new Date
+ Timer {
+ interval: 100; running: true; repeat: true;
+ onTriggered: parent.now = new Date
+ }
+
+ ColumnLayout {
+ anchors.fill: parent
+ spacing: 0
+
+ Text {
+ Layout.fillWidth: true
+ Layout.fillHeight: false
+ Layout.alignment: Qt.AlignHCenter
+ Layout.topMargin: parent.height / 10
+
+ text: now.toLocaleString(Qt.locale("en_US"), 'h:mm A')
+ font.pixelSize: 40
+ color: "white"
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ padding: 0
+ }
+
+ Text {
+ id: speedText
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ Layout.topMargin: parent.height / 10
+
+ text: tbtnavi.vehicleSpeed.toFixed(0)
+ color: "white"
+ font.pixelSize: 280
+ // Slight hack to shrink the border around the text by tweaking
+ // the line height, note that it is font size dependent
+ lineHeight: 0.8
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ padding: 0
+ }
+ Text {
+ id: speedLabel
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+
+ text: "MPH"
+ color: "white"
+ font.pixelSize: 32
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ padding: 0
+ }
+
+ Text {
+ id: rpmText
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ Layout.topMargin: parent.height / 16
+
+ text: tbtnavi.engineSpeed.toFixed(0)
+ color: "white"
+ font.pixelSize: 64
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ padding: 0
+ }
+ Text {
+ id: rpmLabel
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+
+ text: "RPM"
+ color: "white"
+ font.pixelSize: 32
+ font.bold: true
+ horizontalAlignment: Text.AlignHCenter
+ verticalAlignment: Text.AlignVCenter
+ padding: 0
+ }
+
+ // Use height filling rectangle to push things together,
+ // saving tinkering with minimum/preferred heights
+ Rectangle {
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ color: "black"
+ }
+ }
+}