X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=app%2FHVAC.qml;h=0d60cbdc3cee6e3068efaa9ca58aa84bd7222964;hb=refs%2Ftags%2Fchinook%2F3.0.2;hp=565b108e7f251011b1d3b928f3a9dfb46ab9059c;hpb=560062626becb4d211a9948bf3008921129711cf;p=apps%2Fhvac.git diff --git a/app/HVAC.qml b/app/HVAC.qml index 565b108..0d60cbd 100644 --- a/app/HVAC.qml +++ b/app/HVAC.qml @@ -18,10 +18,17 @@ import QtQuick 2.6 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 import AGL.Demo.Controls 1.0 +import 'api' as API ApplicationWindow { id: root + API.Binding { + id: binding + url: bindingAddress + onFanSpeedChanged: fanSpeedSlider.value = fanSpeed + } + ColumnLayout { anchors.fill: parent anchors.topMargin: width / 10 @@ -35,17 +42,20 @@ ApplicationWindow { Item { width: root.width * 0.8 Slider { - id: fanSpeed + id: fanSpeedSlider anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter + from: 0.0 + to: 255.0 + stepSize: 1.0 onValueChanged: { - console.debug('Fan', value) + binding.fanSpeed = value } } Label { - anchors.left: fanSpeed.left - anchors.top: fanSpeed.bottom + anchors.left: fanSpeedSlider.left + anchors.top: fanSpeedSlider.bottom font.pixelSize: 32 text: 'FAN SPEED' } @@ -64,7 +74,10 @@ ApplicationWindow { side: 'Left' } HeatDegree { - enabled: leftSeat.headLevel > 0 + onCurrentItemChanged: { + console.log("Left Temp changed",degree) + binding.leftTemperature = degree + } } } ColumnLayout { @@ -113,7 +126,10 @@ ApplicationWindow { side: 'Right' } HeatDegree { - enabled: rightSeat.headLevel > 0 + onCurrentItemChanged: { + console.log("Right Temp changed",degree) + binding.rightTemperature = degree + } } } }