C
Qt Cluster: Rendering and Recovery from Main UI Failure
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
// This file is part of the Qt Safe Renderer module
import QtQuick
import ClusterDemo
import "../functions.js" as Functions
Item {
id: rpmItem
property real rpmValue: flipable.rpmValue
property alias maxValue: rpmGauge.maxValue
property color iconRed: "#e41e25"
property color iconGreen: "#5caa15"
property color iconYellow: "#face20"
property color iconDark: "#444444"
Item {
id: rpmGauge
anchors.fill: parent
width: height
property bool animated: ValueSource.runningInDesigner ? false : startupAnimationStopped
property real value: animated ? ValueSource.rpm : rpmValue
property real maxValue: 8000
property real maxValueAngle: 90
property real minValueAngle: -90
property real outerRadius: Math.min(width, height) * 0.5
property real needleEndInDegrees: 180 / rpmGauge.maximumValue
Image {
source: "image://etc/Gauge_RPM.png"
anchors.fill: parent
}
Text {
id: gearText
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.verticalCenter
anchors.topMargin: Functions.toPixels(0.12, parent.outerRadius)
font.pixelSize: Functions.toPixels(0.3, parent.outerRadius)
color: "white"
text: ValueSource.gearString
}
CircularIndicator {
anchors.fill: parent
startAngle: rpmGauge.minValueAngle
endAngle: rpmGauge.maxValueAngle
minimumValue: 0
maximumValue: rpmGauge.maxValue
value: rpmGauge.value
padding: 13
backgroundColor: "transparent"
progressColor: "#E31E24"
}
}
CircularIndicator {
id: batteryGauge
anchors.fill: parent
startAngle: 144
endAngle: 108
minimumValue: 0
maximumValue: 100
value: ValueSource.batteryLevel
padding: 12
backgroundColor: "transparent"
progressColor: "#464749"
}
CircularIndicator {
id: engineTempGauge
anchors.fill: parent
endAngle: -108
startAngle: -145
minimumValue: 40
maximumValue: 120
value: ValueSource.engineTemperature
padding: 12
backgroundColor: "transparent"
progressColor: "#464749"
}
}