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
- API.Binding {
- id: binding
- url: bindingAddress
- onFanSpeedChanged: fanSpeedSlider.value = fanSpeed
+ 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
source: './images/HMI_HVAC_Fan_Icon.svg'
}
Item {
- width: root.width * 0.8
+ width: container.width * 0.8
Slider {
id: fanSpeedSlider
anchors.left: parent.left
anchors.left: fanSpeedSlider.left
anchors.top: fanSpeedSlider.bottom
font.pixelSize: 32
- text: 'FAN SPEED'
+ text: translator.translate(qsTr('FAN SPEED'), translator.language)
}
}
}
RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
- Layout.alignment: Layout.Center
+ Layout.alignment: Qt.AlignHCenter
+ rotation: 90
spacing: 20
ColumnLayout {
Layout.fillWidth: true
side: 'Left'
}
HeatDegree {
- enabled: leftSeat.headLevel > 0
onCurrentItemChanged: {
- console.log("Left Temp changed",degree)
- binding.leftTemperature = degree
+ console.log("Left Temp changed",degree)
+ binding.leftTemperature = degree
}
}
}
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
- color: parent.checked ? '#66FF99' : '#848286'
- text: 'A/C'
+ color: parent.checked ? '#00ADDC' : '#848286'
+ text: translator.translate(qsTr('A/C'), translator.language)
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
offImage: './images/HMI_HVAC_Inactive.svg'
Label {
anchors.centerIn: parent
- color: parent.checked ? '#66FF99' : '#848286'
- text: 'AUTO'
+ color: parent.checked ? '#00ADDC' : '#848286'
+ text: translator.translate(qsTr('AUTO'), translator.language)
font.pixelSize: parent.height / 3
}
onCheckedChanged: {
side: 'Right'
}
HeatDegree {
- enabled: rightSeat.headLevel > 0
onCurrentItemChanged: {
console.log("Right Temp changed",degree)
binding.rightTemperature = degree
}
}
}
-
RowLayout {
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
- spacing: root.width / 20
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)
}
}
}
}
+}