summaryrefslogtreecommitdiffstats
path: root/app/HVAC.qml
diff options
context:
space:
mode:
authorzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-04-08 18:09:20 +0900
committerzheng_wenlong <wenlong_zheng@nexty-ele.com>2019-04-10 09:44:12 +0900
commit36b6338c8c610028daf88033b80a8af3a813e2cd (patch)
treedcf9906feb9277571c3efe2e843749802dfe4598 /app/HVAC.qml
Add demo3 havc source code for cluster mode. [Patch Set 2]Update LICENSE file. Change-Id: I0dbbf7d35779072f0ca8ad22a89a3158e58dd88e BUG-AGL: SPEC-2261 Signed-off-by: zheng_wenlong <wenlong_zheng@nexty-ele.com>
Diffstat (limited to 'app/HVAC.qml')
-rw-r--r--app/HVAC.qml176
1 files changed, 176 insertions, 0 deletions
diff --git a/app/HVAC.qml b/app/HVAC.qml
new file mode 100644
index 0000000..55251c7
--- /dev/null
+++ b/app/HVAC.qml
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) 2016 The Qt Company Ltd.
+ * Copyright (c) 2019 TOYOTA MOTOR CORPORATION
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import QtQuick 2.6
+import QtQuick.Layouts 1.1
+import QtQuick.Controls 2.0
+import AGL.Demo.Controls 1.0
+import Translator 1.0
+import 'api' as API
+
+ApplicationWindow {
+ id: root
+
+ width: container.width * container.scale
+ height: container.height * container.scale
+
+ Translator {
+ id: translator
+ language: binding.language
+ }
+
+ API.Binding {
+ id: binding
+ url: bindingAddress
+ onFanSpeedChanged: fanSpeedSlider.value = fanSpeed
+ onLanguageChanged: translator.language = language
+ }
+
+ Item {
+ id: container
+// anchors.centerIn: parent
+ x: 555
+ y: -465
+ width: 720
+ height: 1920
+ rotation: -90
+ scale: screenInfo.scale_factor()
+
+ ColumnLayout {
+ anchors.fill: parent
+ anchors.topMargin: width / 10
+ anchors.bottomMargin: width / 10
+
+ RowLayout {
+ Layout.fillHeight: true
+ Layout.alignment: Qt.AlignHCenter
+ Image {
+ source: './images/HMI_HVAC_Fan_Icon.svg'
+ }
+ Item {
+ width: container.width * 0.8
+ Slider {
+ id: fanSpeedSlider
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.verticalCenter: parent.verticalCenter
+ from: 0.0
+ to: 255.0
+ stepSize: 1.0
+ onValueChanged: {
+ binding.fanSpeed = value
+ }
+ }
+ Label {
+ anchors.left: fanSpeedSlider.left
+ anchors.top: fanSpeedSlider.bottom
+ font.pixelSize: 32
+ text: translator.translate(qsTr('FAN SPEED'), translator.language)
+ }
+ }
+ }
+ RowLayout {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ Layout.alignment: Qt.AlignHCenter
+ rotation: 90
+ spacing: 20
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 20
+ SeatHeatButton {
+ id: leftSeat
+ side: 'Left'
+ }
+ HeatDegree {
+ onCurrentItemChanged: {
+ console.log("Left Temp changed",degree)
+ binding.leftTemperature = degree
+ }
+ }
+ }
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 20
+ ToggleButton {
+ onImage: './images/HMI_HVAC_Active.svg'
+ offImage: './images/HMI_HVAC_Inactive.svg'
+ Label {
+ anchors.centerIn: parent
+ color: parent.checked ? '#00ADDC' : '#848286'
+ text: translator.translate(qsTr('A/C'), translator.language)
+ font.pixelSize: parent.height / 3
+ }
+ onCheckedChanged: {
+ console.debug('A/C', checked)
+ }
+ }
+ ToggleButton {
+ onImage: './images/HMI_HVAC_Active.svg'
+ offImage: './images/HMI_HVAC_Inactive.svg'
+ Label {
+ anchors.centerIn: parent
+ color: parent.checked ? '#00ADDC' : '#848286'
+ text: translator.translate(qsTr('AUTO'), translator.language)
+ font.pixelSize: parent.height / 3
+ }
+ onCheckedChanged: {
+ console.debug('AUTO', checked)
+ }
+ }
+ ToggleButton {
+ onImage: './images/HMI_HVAC_Circulation_Active.svg'
+ offImage: './images/HMI_HVAC_Circulation_Inactive.svg'
+ onCheckedChanged: {
+ console.debug('Circulation', checked)
+ }
+ }
+ }
+
+ ColumnLayout {
+ Layout.fillWidth: true
+ spacing: 20
+ SeatHeatButton {
+ id: rightSeat
+ side: 'Right'
+ }
+ HeatDegree {
+ onCurrentItemChanged: {
+ console.log("Right Temp changed",degree)
+ binding.rightTemperature = degree
+ }
+ }
+ }
+ }
+ RowLayout {
+ Layout.fillHeight: true
+ Layout.alignment: Qt.AlignHCenter
+ Repeater {
+ model: ['AirDown', 'AirUp', 'AirRight', 'Rear', 'Front']
+ ToggleButton {
+ onImage: './images/HMI_HVAC_%1_Active.svg'.arg(model.modelData)
+ offImage: './images/HMI_HVAC_%1_Inactive.svg'.arg(model.modelData)
+ rotation: 90
+ onCheckedChanged: {
+ console.debug(model.modelData, checked)
+ }
+ }
+ }
+ }
+ }
+}
+}