diff options
author | Egor Nemtsev <enemtsev@luxoft.com> | 2019-01-28 12:47:27 +0300 |
---|---|---|
committer | Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com> | 2019-02-01 17:26:28 +0000 |
commit | 5b06412482fb1f96304569b6b4b1067597930fb8 (patch) | |
tree | b7b35bdd43e9e36cc88ae9ad1f830d8e7977195f /src/remotesettings | |
parent | 5c248bc4a4c54177efb4f134b097af65560e04c3 (diff) |
[lucee] add new Cluster style
Change-Id: I3e5c42d6087b84e5608429f0c6cadf54a38e006c
Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r-- | src/remotesettings/app/ClusterPage.qml | 155 | ||||
-rw-r--r-- | src/remotesettings/settings.qface | 27 |
2 files changed, 182 insertions, 0 deletions
diff --git a/src/remotesettings/app/ClusterPage.qml b/src/remotesettings/app/ClusterPage.qml index 410a35ea..5b82367d 100644 --- a/src/remotesettings/app/ClusterPage.qml +++ b/src/remotesettings/app/ClusterPage.qml @@ -165,6 +165,135 @@ Flickable { onClicked: instrumentCluster.hideGauges = checked } + /*! + Outside Temperature + */ + Label { + text: qsTr("Outside temperature: " + outsideTemperature.value.toFixed(1).padStart(6) + " °C") + } + Slider { + id: outsideTemperature + value: instrumentCluster.outsideTempCelsius + from: -100 + stepSize: 0.5 + to: 100.0 + onValueChanged: if (pressed) { instrumentCluster.outsideTempCelsius = value } + } + + /*! + Mileage in km + */ + Label { + text: qsTr("Mileage km") + } + Slider { + id: mileageKm + value: instrumentCluster.mileageKm + from: 0 + stepSize: 0.5 + to: 9E6 + onValueChanged: if (pressed) { instrumentCluster.mileageKm = value } + } + + /*! + DrivingMode field + */ + Label { + text: qsTr("Driving mode:") + } + + ComboBox { + id: driveingModeComboBox + model: [qsTr("Normal"), qsTr("ECO"), qsTr("Sport")] + currentIndex: instrumentCluster.drivingMode + onActivated: instrumentCluster.drivingMode = currentIndex + } + + /*! + Driving mode range Field + */ + Label { + text: qsTr("Driving mode range:") + } + Dial { + id: drivingModeRangeDial + from: 0 + to: 1000 + stepSize: 1.0 + value: instrumentCluster.drivingModeRangeKm + onMoved: instrumentCluster.drivingModeRangeKm = value + + + + Label { + text: Math.round(parent.value) + anchors.top: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + } + } + + /*! + ECO mode range Field + */ + Label { + text: qsTr("ECO mode range:") + } + Dial { + id: ecoModeRangeDial + from: 0 + to: 500 + stepSize: 1.0 + value: instrumentCluster.drivingModeECORangeKm + onMoved: instrumentCluster.drivingModeECORangeKm = value + + + + Label { + text: Math.round(parent.value) + anchors.top: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + } + } + + /*! + Route progress + */ + Label { + text: qsTr("Route progress, %:") + } + + Dial { + id: routeProgressDial + from: 0 + to: 1.0 + stepSize: 0.01 + value: instrumentCluster.navigationProgressPercents + onMoved: instrumentCluster.navigationProgressPercents = value + + + + Label { + text: Math.round(parent.value * 100.0) + anchors.top: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + } + } + + /*! + Route distance + */ + Label { + text: qsTr("Route distance, km") + } + Slider { + id: routeDistance + value: instrumentCluster.navigationRouteDistanceKm + from: 0 + stepSize: 0.5 + to: 25000 + onValueChanged: if (pressed) { instrumentCluster.navigationRouteDistanceKm = value } + } + Timer { interval: 1000 running: root.simulationEnabled @@ -187,6 +316,32 @@ Flickable { } else { instrumentCluster.speedCruise = 0; } + + if (instrumentCluster.mileageKm < 100000) { + instrumentCluster.mileageKm = instrumentCluster.mileageKm + Math.random(100) + } else { + instrumentCluster.mileageKm = 0 + } + + if (instrumentCluster.drivingModeRangeKm < 1000) { + instrumentCluster.drivingModeRangeKm = instrumentCluster.mileageKm + Math.random(20) + } else { + instrumentCluster.drivingModeRangeKm = 0 + } + + if (instrumentCluster.navigationProgressPercents < 1.0) { + instrumentCluster.navigationProgressPercents = instrumentCluster.navigationProgressPercents + + 0.01 + } else { + instrumentCluster.navigationProgressPercents = 0.0 + } + + if (instrumentCluster.navigationRouteDistanceKm < 130.0) { + instrumentCluster.navigationRouteDistanceKm = instrumentCluster.navigationRouteDistanceKm + + Math.random(10) + } else { + instrumentCluster.navigationRouteDistanceKm = 0.0 + } } } } diff --git a/src/remotesettings/settings.qface b/src/remotesettings/settings.qface index f1385b2b..1f49f446 100644 --- a/src/remotesettings/settings.qface +++ b/src/remotesettings/settings.qface @@ -69,6 +69,33 @@ interface InstrumentCluster { bool brakeFailure; bool airbagFailure; + /* + * outside tempterature in celsius degrees + */ + real outsideTempCelsius; + + /* + * Mileage in km + */ + real mileageKm; + + /* + * 0 - normal + * 1 - eco + * 2 - sport + */ + int drivingMode; + int drivingModeRangeKm; + int drivingModeECORangeKm; + + /* + * Navigation + * progress 0.0 - 1.0 + * distance in km + */ + real navigationProgressPercents; + real navigationRouteDistanceKm; + /* * Whether the instrument cluster should be in navigation mode * in this mode its gauges etc will be reshaped to give more room |