From 240a5d1785f49653ac82242e3f092f5d175cca0a Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Fri, 9 Dec 2016 12:47:57 +0000 Subject: Updating with files in CES2017 repo Change-Id: Idd89a798f378a6ff09e78bddbe206134a171b01a Signed-off-by: Romain Forlot --- app/.qmake.cache | 1 + app/.qmake.stash | 6 ++++ app/HeatDegree.qml | 55 ++++++++++++++++++++++++++++ app/SeatHeatButton.qml | 78 ++++++++++++++++++++++++++++++++++++++++ app/hvac-demo.cpp | 2 +- app/hvac-demo.pro | 10 +++--- app/hvac-demo.qml | 60 ++++++++++++++++++++++++++----- app/hvac-demo.qrc | 4 ++- app/images/HMI_HVAC_Active.svg | 75 ++++++++++++++++++++++++++++++++++++++ app/images/HMI_HVAC_Inactive.svg | 63 ++++++++++++++++++++++++++++++++ app/images/images.qrc | 14 ++------ 11 files changed, 341 insertions(+), 27 deletions(-) create mode 100644 app/.qmake.cache create mode 100644 app/.qmake.stash create mode 100644 app/HeatDegree.qml create mode 100644 app/SeatHeatButton.qml create mode 100644 app/images/HMI_HVAC_Active.svg create mode 100644 app/images/HMI_HVAC_Inactive.svg diff --git a/app/.qmake.cache b/app/.qmake.cache new file mode 100644 index 0000000..fc7eff3 --- /dev/null +++ b/app/.qmake.cache @@ -0,0 +1 @@ +CONFIG += done_config_libhomescreen diff --git a/app/.qmake.stash b/app/.qmake.stash new file mode 100644 index 0000000..751fc53 --- /dev/null +++ b/app/.qmake.stash @@ -0,0 +1,6 @@ +QMAKE_DEFAULT_INCDIRS = \ + /usr/include \ + /usr/local/include +QMAKE_DEFAULT_LIBDIRS = \ + /lib \ + /usr/lib diff --git a/app/HeatDegree.qml b/app/HeatDegree.qml new file mode 100644 index 0000000..878a9d8 --- /dev/null +++ b/app/HeatDegree.qml @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * 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.Controls 2.0 + +ListView { + id: root + clip: true + width: 318 + height: 219 * 2 + 20 + spacing: 20 + opacity: enabled ? 1 : 0.5 + + property int degree: currentIndex > -1 ? model.get(currentIndex).value : -1 + model: ListModel { + Component.onCompleted: { + append({value: 15, modelData: 'LO'}) + for (var d = 16; d < 30; d++) { + append({value: d, modelData: d.toFixed(0) + '\u00b0'}) + } + append({value: 30, modelData: 'HI'}) + } + } + delegate: Label { + width: ListView.view.width + height: 219 + horizontalAlignment: Label.AlignHCenter + verticalAlignment: Label.AlignVCenter + text: model.modelData + font.pixelSize: height * 0.8 + color: (ListView.view.enabled && ListView.isCurrentItem) ? '#66FF99' : 'white' + } + + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + highlightRangeMode: ListView.StrictlyEnforceRange + highlight: Rectangle { + color: 'white' + opacity: 0.2 + } +} diff --git a/app/SeatHeatButton.qml b/app/SeatHeatButton.qml new file mode 100644 index 0000000..3495cf6 --- /dev/null +++ b/app/SeatHeatButton.qml @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2016 The Qt Company Ltd. + * + * 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 + + +Item { + id: root + implicitWidth: 318 + implicitHeight: 219 + + property string side: 'Left' + property int headLevel: 0 + + Column { + id: background + anchors.centerIn: parent + Image { + id: chair + source: './images/HMI_HVAC_%1_Chair_OFF.svg'.arg(root.side) + states: [ + State { + when: root.headLevel > 0 + PropertyChanges { + target: chair + source: './images/HMI_HVAC_%1_Chair_ON.svg'.arg(root.side) + } + } + ] + } + Image { + id: indicator + width: 178 + height: 18 + source: './images/HMI_HVAC_ChairIndicator_OFF.svg' + states: [ + State { + when: root.headLevel === 1 + PropertyChanges { + target: indicator + source: './images/HMI_HVAC_ChairIndicator_One.svg' + } + }, + State { + when: root.headLevel === 2 + PropertyChanges { + target: indicator + source: './images/HMI_HVAC_ChairIndicator_Two.svg' + } + } + ] + } + + } + + MouseArea { + anchors.fill: parent + onClicked: { + root.headLevel = (root.headLevel + 1) % 3 + } + } +} diff --git a/app/hvac-demo.cpp b/app/hvac-demo.cpp index c00c43b..b2133f7 100644 --- a/app/hvac-demo.cpp +++ b/app/hvac-demo.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) QQuickStyle::setStyle("AGL"); QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/hvac-demo.qml"))); + engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); return app.exec(); } diff --git a/app/hvac-demo.pro b/app/hvac-demo.pro index 7213f37..ed20b4e 100644 --- a/app/hvac-demo.pro +++ b/app/hvac-demo.pro @@ -1,17 +1,19 @@ TEMPLATE = app -TARGET = hvac-demo +TARGET = hvac QT = quickcontrols2 +load(configure) +qtCompileTest(libhomescreen) + config_libhomescreen { CONFIG += link_pkgconfig PKGCONFIG += homescreen DEFINES += HAVE_LIBHOMESCREEN } -SOURCES = hvac-demo.cpp +SOURCES = main.cpp RESOURCES += \ - hvac-demo.qrc \ - images/images.qrc \ + hvac.qrc \ images/images.qrc diff --git a/app/hvac-demo.qml b/app/hvac-demo.qml index b2f8e49..565b108 100644 --- a/app/hvac-demo.qml +++ b/app/hvac-demo.qml @@ -39,10 +39,14 @@ ApplicationWindow { anchors.left: parent.left anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter + onValueChanged: { + console.debug('Fan', value) + } } Label { anchors.left: fanSpeed.left anchors.top: fanSpeed.bottom + font.pixelSize: 32 text: 'FAN SPEED' } } @@ -50,31 +54,66 @@ ApplicationWindow { RowLayout { Layout.fillHeight: true Layout.fillWidth: true + Layout.alignment: Layout.Center + spacing: 20 ColumnLayout { - Image { - source: './images/HMI_HVAC_LeftChair_Section.svg' + Layout.fillWidth: true + spacing: 20 + SeatHeatButton { + id: leftSeat + side: 'Left' + } + HeatDegree { + enabled: leftSeat.headLevel > 0 } } ColumnLayout { Layout.fillWidth: true - spacing: root.width / 40 + spacing: 20 ToggleButton { - onImage: './images/HMI_HVAC_AC_Active.svg' - offImage: './images/HMI_HVAC_AC_Inactive.svg' + onImage: './images/HMI_HVAC_Active.svg' + offImage: './images/HMI_HVAC_Inactive.svg' + Label { + anchors.centerIn: parent + color: parent.checked ? '#66FF99' : '#848286' + text: 'A/C' + font.pixelSize: parent.height / 3 + } + onCheckedChanged: { + console.debug('A/C', checked) + } } ToggleButton { - onImage: './images/HMI_HVAC_Auto_Active.svg' - offImage: './images/HMI_HVAC_Auto_Inactive.svg' + onImage: './images/HMI_HVAC_Active.svg' + offImage: './images/HMI_HVAC_Inactive.svg' + Label { + anchors.centerIn: parent + color: parent.checked ? '#66FF99' : '#848286' + text: 'AUTO' + 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 { - Image { - source: './images/HMI_HVAC_RightChair_Section.svg' + Layout.fillWidth: true + spacing: 20 + SeatHeatButton { + id: rightSeat + side: 'Right' + } + HeatDegree { + enabled: rightSeat.headLevel > 0 } } } @@ -88,6 +127,9 @@ ApplicationWindow { ToggleButton { onImage: './images/HMI_HVAC_%1_Active.svg'.arg(model.modelData) offImage: './images/HMI_HVAC_%1_Inactive.svg'.arg(model.modelData) + onCheckedChanged: { + console.debug(model.modelData, checked) + } } } } diff --git a/app/hvac-demo.qrc b/app/hvac-demo.qrc index 7e49a98..03fbf7d 100644 --- a/app/hvac-demo.qrc +++ b/app/hvac-demo.qrc @@ -1,5 +1,7 @@ - hvac-demo.qml + HVAC.qml + SeatHeatButton.qml + HeatDegree.qml diff --git a/app/images/HMI_HVAC_Active.svg b/app/images/HMI_HVAC_Active.svg new file mode 100644 index 0000000..803a42e --- /dev/null +++ b/app/images/HMI_HVAC_Active.svg @@ -0,0 +1,75 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Inactive.svg b/app/images/HMI_HVAC_Inactive.svg new file mode 100644 index 0000000..b29a74f --- /dev/null +++ b/app/images/HMI_HVAC_Inactive.svg @@ -0,0 +1,63 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/images.qrc b/app/images/images.qrc index 81768a9..036c1f5 100644 --- a/app/images/images.qrc +++ b/app/images/images.qrc @@ -1,36 +1,26 @@ - HMI_HVAC_AC_Active.svg - HMI_HVAC_AC_Inactive.svg HMI_HVAC_AirDown_Active.svg HMI_HVAC_AirDown_Inactive.svg HMI_HVAC_AirRight_Active.svg HMI_HVAC_AirRight_Inactive.svg HMI_HVAC_AirUp_Active.svg HMI_HVAC_AirUp_Inactive.svg - HMI_HVAC_Auto_Active.svg - HMI_HVAC_Auto_Inactive.svg HMI_HVAC_ChairIndicator_OFF.svg HMI_HVAC_ChairIndicator_One.svg HMI_HVAC_ChairIndicator_Two.svg HMI_HVAC_Circulation_Active.svg HMI_HVAC_Circulation_Inactive.svg HMI_HVAC_Fan_Icon.svg - HMI_HVAC_Fan_Section.svg HMI_HVAC_Front_Active.svg HMI_HVAC_Front_Inactive.svg HMI_HVAC_Left_Chair_OFF.svg HMI_HVAC_Left_Chair_ON.svg - HMI_HVAC_LeftChair_Section.svg - HMI_HVAC_LeftDetails.svg - HMI_HVAC_Minus_Push.svg - HMI_HVAC_Minus.svg - HMI_HVAC_Plus.svg HMI_HVAC_Rear_Active.svg HMI_HVAC_Rear_Inactive.svg HMI_HVAC_Right_Chair_OFF.svg HMI_HVAC_Right_Chair_ON.svg - HMI_HVAC_RightChair_Section.svg - HMI_HVAC_RightDetails.svg + HMI_HVAC_Active.svg + HMI_HVAC_Inactive.svg -- cgit 1.2.3-korg