diff options
author | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-27 10:52:09 +0300 |
---|---|---|
committer | Grigorii Zimin <gzimin@luxoft.com> | 2020-03-30 10:00:11 +0000 |
commit | 1b6b284525db7bbd3da7368c06ba4273ce3404ab (patch) | |
tree | 07629c67b38f3d929fff004c58e26b6d5ff0d432 /src/remotesettings | |
parent | 8ca81721d2ad98347c665b588b03fb6dd99adc2c (diff) |
[companion, cluster, drivedata] add property to control simulation
-add button in companion app (dev page) to enable/disable simulation
-simulation is ENABLED by default
Fixes: AUTOSUITE-1498
Change-Id: I18bfcc3c909c3fa819399f7c2fb91dd97ef07125
Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r-- | src/remotesettings/app/DevelopmentPage.qml | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/src/remotesettings/app/DevelopmentPage.qml b/src/remotesettings/app/DevelopmentPage.qml index 484caa38..3f1e2937 100644 --- a/src/remotesettings/app/DevelopmentPage.qml +++ b/src/remotesettings/app/DevelopmentPage.qml @@ -1,6 +1,6 @@ -/**************************************************************************** +/**************************************************************************** ** -** Copyright (C) 2019 Luxoft Sweden AB +** Copyright (C) 2019-2020 Luxoft Sweden AB ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Neptune 3 UI. @@ -74,6 +74,16 @@ Flickable { font.bold: true } + Button { + Layout.alignment: Qt.AlignHCenter + text: instrumentCluster.enableSimulation + ? qsTr("Disable simulation") + : qsTr("Enable simulation") + onClicked: { + instrumentCluster.enableSimulation = !instrumentCluster.enableSimulation; + } + } + GridLayout { Layout.alignment: Qt.AlignHCenter columns: root.width < neptuneScale(100) ? 2 : 4 @@ -100,7 +110,7 @@ Flickable { } GridLayout { - enabled: instrumentCluster.isConnected + enabled: instrumentCluster.isConnected && !instrumentCluster.enableSimulation Layout.alignment: Qt.AlignHCenter columns: root.width > 2 * (outsideTemperatureLabel.width + outsideTemperature.width + columnSpacing) ? 4 : 2 @@ -185,7 +195,7 @@ Flickable { RowLayout { - enabled: instrumentCluster.isConnected + enabled: instrumentCluster.isConnected && !instrumentCluster.enableSimulation Layout.alignment: Qt.AlignHCenter // driveTrainState field Label { @@ -246,7 +256,7 @@ Flickable { } GridLayout { - enabled: instrumentCluster.isConnected + enabled: instrumentCluster.isConnected && !instrumentCluster.enableSimulation Layout.alignment: Qt.AlignHCenter columns: root.width < neptuneScale(100) ? 2 : 4 @@ -287,7 +297,7 @@ Flickable { CheckBox { id: stabilityControlCheckbox checked: instrumentCluster.stabilityControl - enabled: false + onClicked: instrumentCluster.stabilityControl = checked } // leftTurn Field @@ -317,7 +327,7 @@ Flickable { CheckBox { id: seatBeltNotFastenedCheckbox checked: instrumentCluster.seatBeltNotFastened - enabled: false + onClicked: instrumentCluster.seatBeltNotFastened = checked } // ABSFailure Field @@ -327,7 +337,7 @@ Flickable { CheckBox { id: absFailureCheckbox checked: instrumentCluster.ABSFailure - enabled: false + onClicked: instrumentCluster.ABSFailure = checked } // parkBrake Field @@ -337,7 +347,7 @@ Flickable { CheckBox { id: parkBrakeCheckbox checked: instrumentCluster.parkBrake - enabled: false + onClicked: instrumentCluster.parkBrake = checked } // tyrePressureLow Field @@ -347,7 +357,7 @@ Flickable { CheckBox { id: tyrePressureLowCheckbox checked: instrumentCluster.tyrePressureLow - enabled: false + onClicked: instrumentCluster.tyrePressureLow = checked } // brakeFailure Field @@ -357,7 +367,7 @@ Flickable { CheckBox { id: brakeFailureCheckBox checked: instrumentCluster.brakeFailure - enabled: false + onClicked: instrumentCluster.brakeFailure = checked } // airbagFailure Field @@ -367,7 +377,7 @@ Flickable { CheckBox { id: airbagFailureCheckBox checked: instrumentCluster.airbagFailure - enabled: false + onClicked: instrumentCluster.airbagFailure = checked } } |