From d30018e251b152ea40fbf8410ec0d20d372100f8 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 8 Dec 2016 10:42:21 +0000 Subject: Moved to new UI project from DemoApps/CES2017 repository Change-Id: I65083c266b07320318b5f040b10b0c0a5a4dc4eb Signed-off-by: Romain Forlot --- app/HVAC.pro | 17 ++ app/hvac-demo-ui.cpp | 46 ++++ app/hvac-demo.qml | 95 +++++++ app/hvac-demo.qrc | 5 + app/images/HMI_HVAC_AC_Active.svg | 90 +++++++ app/images/HMI_HVAC_AC_Inactive.svg | 78 ++++++ app/images/HMI_HVAC_AirDown_Active.svg | 121 +++++++++ app/images/HMI_HVAC_AirDown_Inactive.svg | 69 +++++ app/images/HMI_HVAC_AirRight_Active.svg | 123 +++++++++ app/images/HMI_HVAC_AirRight_Inactive.svg | 72 ++++++ app/images/HMI_HVAC_AirUp_Active.svg | 126 +++++++++ app/images/HMI_HVAC_AirUp_Inactive.svg | 75 ++++++ app/images/HMI_HVAC_Auto_Active.svg | 78 ++++++ app/images/HMI_HVAC_Auto_Inactive.svg | 66 +++++ app/images/HMI_HVAC_ChairIndicator_OFF.svg | 76 ++++++ app/images/HMI_HVAC_ChairIndicator_One.svg | 71 +++++ app/images/HMI_HVAC_ChairIndicator_Two.svg | 77 ++++++ app/images/HMI_HVAC_Circulation_Active.svg | 198 ++++++++++++++ app/images/HMI_HVAC_Circulation_Inactive.svg | 87 +++++++ app/images/HMI_HVAC_Fan_Icon.svg | 81 ++++++ app/images/HMI_HVAC_Fan_Section.svg | 123 +++++++++ app/images/HMI_HVAC_Front_Active.svg | 111 ++++++++ app/images/HMI_HVAC_Front_Inactive.svg | 72 ++++++ app/images/HMI_HVAC_LeftChair_Section.svg | 209 +++++++++++++++ app/images/HMI_HVAC_LeftDetails.svg | 99 +++++++ app/images/HMI_HVAC_Left_Chair_OFF.svg | 87 +++++++ app/images/HMI_HVAC_Left_Chair_ON.svg | 99 +++++++ app/images/HMI_HVAC_Minus.svg | 88 +++++++ app/images/HMI_HVAC_Minus_Push.svg | 90 +++++++ app/images/HMI_HVAC_Plus.svg | 70 +++++ app/images/HMI_HVAC_Rear_Active.svg | 195 ++++++++++++++ app/images/HMI_HVAC_Rear_Inactive.svg | 91 +++++++ app/images/HMI_HVAC_RightChair_Section.svg | 217 ++++++++++++++++ app/images/HMI_HVAC_RightDetails.svg | 98 +++++++ app/images/HMI_HVAC_Right_Chair_OFF.svg | 87 +++++++ app/images/HMI_HVAC_Right_Chair_ON.svg | 100 +++++++ app/images/images.qrc | 36 +++ hvac-demo-binding.c | 374 +++++++++++++++++++++++++++ hvac-demo-bindings.c | 374 --------------------------- qml/HVAC.pro | 17 -- qml/HVAC.qml | 95 ------- qml/images/HMI_HVAC_AC_Active.svg | 90 ------- qml/images/HMI_HVAC_AC_Inactive.svg | 78 ------ qml/images/HMI_HVAC_AirDown_Active.svg | 121 --------- qml/images/HMI_HVAC_AirDown_Inactive.svg | 69 ----- qml/images/HMI_HVAC_AirRight_Active.svg | 123 --------- qml/images/HMI_HVAC_AirRight_Inactive.svg | 72 ------ qml/images/HMI_HVAC_AirUp_Active.svg | 126 --------- qml/images/HMI_HVAC_AirUp_Inactive.svg | 75 ------ qml/images/HMI_HVAC_Auto_Active.svg | 78 ------ qml/images/HMI_HVAC_Auto_Inactive.svg | 66 ----- qml/images/HMI_HVAC_ChairIndicator_OFF.svg | 76 ------ qml/images/HMI_HVAC_ChairIndicator_One.svg | 71 ----- qml/images/HMI_HVAC_ChairIndicator_Two.svg | 77 ------ qml/images/HMI_HVAC_Circulation_Active.svg | 198 -------------- qml/images/HMI_HVAC_Circulation_Inactive.svg | 87 ------- qml/images/HMI_HVAC_Fan_Icon.svg | 81 ------ qml/images/HMI_HVAC_Fan_Section.svg | 123 --------- qml/images/HMI_HVAC_Front_Active.svg | 111 -------- qml/images/HMI_HVAC_Front_Inactive.svg | 72 ------ qml/images/HMI_HVAC_LeftChair_Section.svg | 209 --------------- qml/images/HMI_HVAC_LeftDetails.svg | 99 ------- qml/images/HMI_HVAC_Left_Chair_OFF.svg | 87 ------- qml/images/HMI_HVAC_Left_Chair_ON.svg | 99 ------- qml/images/HMI_HVAC_Minus.svg | 88 ------- qml/images/HMI_HVAC_Minus_Push.svg | 90 ------- qml/images/HMI_HVAC_Plus.svg | 70 ----- qml/images/HMI_HVAC_Rear_Active.svg | 195 -------------- qml/images/HMI_HVAC_Rear_Inactive.svg | 91 ------- qml/images/HMI_HVAC_RightChair_Section.svg | 217 ---------------- qml/images/HMI_HVAC_RightDetails.svg | 98 ------- qml/images/HMI_HVAC_Right_Chair_OFF.svg | 87 ------- qml/images/HMI_HVAC_Right_Chair_ON.svg | 100 ------- qml/images/images.qrc | 36 --- qml/main.cpp | 46 ---- 75 files changed, 3897 insertions(+), 3892 deletions(-) create mode 100644 app/HVAC.pro create mode 100644 app/hvac-demo-ui.cpp create mode 100644 app/hvac-demo.qml create mode 100644 app/hvac-demo.qrc create mode 100644 app/images/HMI_HVAC_AC_Active.svg create mode 100644 app/images/HMI_HVAC_AC_Inactive.svg create mode 100644 app/images/HMI_HVAC_AirDown_Active.svg create mode 100644 app/images/HMI_HVAC_AirDown_Inactive.svg create mode 100644 app/images/HMI_HVAC_AirRight_Active.svg create mode 100644 app/images/HMI_HVAC_AirRight_Inactive.svg create mode 100644 app/images/HMI_HVAC_AirUp_Active.svg create mode 100644 app/images/HMI_HVAC_AirUp_Inactive.svg create mode 100644 app/images/HMI_HVAC_Auto_Active.svg create mode 100644 app/images/HMI_HVAC_Auto_Inactive.svg create mode 100644 app/images/HMI_HVAC_ChairIndicator_OFF.svg create mode 100644 app/images/HMI_HVAC_ChairIndicator_One.svg create mode 100644 app/images/HMI_HVAC_ChairIndicator_Two.svg create mode 100644 app/images/HMI_HVAC_Circulation_Active.svg create mode 100644 app/images/HMI_HVAC_Circulation_Inactive.svg create mode 100644 app/images/HMI_HVAC_Fan_Icon.svg create mode 100644 app/images/HMI_HVAC_Fan_Section.svg create mode 100644 app/images/HMI_HVAC_Front_Active.svg create mode 100644 app/images/HMI_HVAC_Front_Inactive.svg create mode 100644 app/images/HMI_HVAC_LeftChair_Section.svg create mode 100644 app/images/HMI_HVAC_LeftDetails.svg create mode 100644 app/images/HMI_HVAC_Left_Chair_OFF.svg create mode 100644 app/images/HMI_HVAC_Left_Chair_ON.svg create mode 100644 app/images/HMI_HVAC_Minus.svg create mode 100644 app/images/HMI_HVAC_Minus_Push.svg create mode 100644 app/images/HMI_HVAC_Plus.svg create mode 100644 app/images/HMI_HVAC_Rear_Active.svg create mode 100644 app/images/HMI_HVAC_Rear_Inactive.svg create mode 100644 app/images/HMI_HVAC_RightChair_Section.svg create mode 100644 app/images/HMI_HVAC_RightDetails.svg create mode 100644 app/images/HMI_HVAC_Right_Chair_OFF.svg create mode 100644 app/images/HMI_HVAC_Right_Chair_ON.svg create mode 100644 app/images/images.qrc create mode 100644 hvac-demo-binding.c delete mode 100644 hvac-demo-bindings.c delete mode 100644 qml/HVAC.pro delete mode 100644 qml/HVAC.qml delete mode 100644 qml/images/HMI_HVAC_AC_Active.svg delete mode 100644 qml/images/HMI_HVAC_AC_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_AirDown_Active.svg delete mode 100644 qml/images/HMI_HVAC_AirDown_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_AirRight_Active.svg delete mode 100644 qml/images/HMI_HVAC_AirRight_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_AirUp_Active.svg delete mode 100644 qml/images/HMI_HVAC_AirUp_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_Auto_Active.svg delete mode 100644 qml/images/HMI_HVAC_Auto_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_ChairIndicator_OFF.svg delete mode 100644 qml/images/HMI_HVAC_ChairIndicator_One.svg delete mode 100644 qml/images/HMI_HVAC_ChairIndicator_Two.svg delete mode 100644 qml/images/HMI_HVAC_Circulation_Active.svg delete mode 100644 qml/images/HMI_HVAC_Circulation_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_Fan_Icon.svg delete mode 100644 qml/images/HMI_HVAC_Fan_Section.svg delete mode 100644 qml/images/HMI_HVAC_Front_Active.svg delete mode 100644 qml/images/HMI_HVAC_Front_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_LeftChair_Section.svg delete mode 100644 qml/images/HMI_HVAC_LeftDetails.svg delete mode 100644 qml/images/HMI_HVAC_Left_Chair_OFF.svg delete mode 100644 qml/images/HMI_HVAC_Left_Chair_ON.svg delete mode 100644 qml/images/HMI_HVAC_Minus.svg delete mode 100644 qml/images/HMI_HVAC_Minus_Push.svg delete mode 100644 qml/images/HMI_HVAC_Plus.svg delete mode 100644 qml/images/HMI_HVAC_Rear_Active.svg delete mode 100644 qml/images/HMI_HVAC_Rear_Inactive.svg delete mode 100644 qml/images/HMI_HVAC_RightChair_Section.svg delete mode 100644 qml/images/HMI_HVAC_RightDetails.svg delete mode 100644 qml/images/HMI_HVAC_Right_Chair_OFF.svg delete mode 100644 qml/images/HMI_HVAC_Right_Chair_ON.svg delete mode 100644 qml/images/images.qrc delete mode 100644 qml/main.cpp diff --git a/app/HVAC.pro b/app/HVAC.pro new file mode 100644 index 0000000..050106e --- /dev/null +++ b/app/HVAC.pro @@ -0,0 +1,17 @@ +TEMPLATE = app +TARGET = hvac-demo +QT = quickcontrols2 + +config_libhomescreen { + CONFIG += link_pkgconfig + PKGCONFIG += homescreen + DEFINES += HAVE_LIBHOMESCREEN +} + +SOURCES = main.cpp + +RESOURCES += \ + hvac-demo.qrc \ + images/images.qrc \ + images/images.qrc + diff --git a/app/hvac-demo-ui.cpp b/app/hvac-demo-ui.cpp new file mode 100644 index 0000000..c00c43b --- /dev/null +++ b/app/hvac-demo-ui.cpp @@ -0,0 +1,46 @@ +/* + * 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. + */ + +#include +#include +#include +#include + +#ifdef HAVE_LIBHOMESCREEN +#include +#endif + +int main(int argc, char *argv[]) +{ +#ifdef HAVE_LIBHOMESCREEN + LibHomeScreen libHomeScreen; + + if (!libHomeScreen.renderAppToAreaAllowed(0, 1)) { + qWarning() << "renderAppToAreaAllowed is denied"; + return -1; + } +#endif + + QGuiApplication app(argc, argv); + + QQuickStyle::setStyle("AGL"); + + QQmlApplicationEngine engine; + engine.load(QUrl(QStringLiteral("qrc:/hvac-demo.qml"))); + + return app.exec(); +} + diff --git a/app/hvac-demo.qml b/app/hvac-demo.qml new file mode 100644 index 0000000..b2f8e49 --- /dev/null +++ b/app/hvac-demo.qml @@ -0,0 +1,95 @@ +/* + * 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 + +ApplicationWindow { + id: root + + 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: root.width * 0.8 + Slider { + id: fanSpeed + anchors.left: parent.left + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + } + Label { + anchors.left: fanSpeed.left + anchors.top: fanSpeed.bottom + text: 'FAN SPEED' + } + } + } + RowLayout { + Layout.fillHeight: true + Layout.fillWidth: true + ColumnLayout { + Image { + source: './images/HMI_HVAC_LeftChair_Section.svg' + } + } + ColumnLayout { + Layout.fillWidth: true + spacing: root.width / 40 + ToggleButton { + onImage: './images/HMI_HVAC_AC_Active.svg' + offImage: './images/HMI_HVAC_AC_Inactive.svg' + } + ToggleButton { + onImage: './images/HMI_HVAC_Auto_Active.svg' + offImage: './images/HMI_HVAC_Auto_Inactive.svg' + } + ToggleButton { + onImage: './images/HMI_HVAC_Circulation_Active.svg' + offImage: './images/HMI_HVAC_Circulation_Inactive.svg' + } + } + + ColumnLayout { + Image { + source: './images/HMI_HVAC_RightChair_Section.svg' + } + } + } + + 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) + } + } + } + } +} diff --git a/app/hvac-demo.qrc b/app/hvac-demo.qrc new file mode 100644 index 0000000..7e49a98 --- /dev/null +++ b/app/hvac-demo.qrc @@ -0,0 +1,5 @@ + + + hvac-demo.qml + + diff --git a/app/images/HMI_HVAC_AC_Active.svg b/app/images/HMI_HVAC_AC_Active.svg new file mode 100644 index 0000000..608f44d --- /dev/null +++ b/app/images/HMI_HVAC_AC_Active.svg @@ -0,0 +1,90 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/app/images/HMI_HVAC_AC_Inactive.svg b/app/images/HMI_HVAC_AC_Inactive.svg new file mode 100644 index 0000000..1bd338e --- /dev/null +++ b/app/images/HMI_HVAC_AC_Inactive.svg @@ -0,0 +1,78 @@ + + + +image/svg+xmla/c + \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirDown_Active.svg b/app/images/HMI_HVAC_AirDown_Active.svg new file mode 100644 index 0000000..68aebb3 --- /dev/null +++ b/app/images/HMI_HVAC_AirDown_Active.svg @@ -0,0 +1,121 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirDown_Inactive.svg b/app/images/HMI_HVAC_AirDown_Inactive.svg new file mode 100644 index 0000000..a013f4b --- /dev/null +++ b/app/images/HMI_HVAC_AirDown_Inactive.svg @@ -0,0 +1,69 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirRight_Active.svg b/app/images/HMI_HVAC_AirRight_Active.svg new file mode 100644 index 0000000..9ac6103 --- /dev/null +++ b/app/images/HMI_HVAC_AirRight_Active.svg @@ -0,0 +1,123 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirRight_Inactive.svg b/app/images/HMI_HVAC_AirRight_Inactive.svg new file mode 100644 index 0000000..991a773 --- /dev/null +++ b/app/images/HMI_HVAC_AirRight_Inactive.svg @@ -0,0 +1,72 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirUp_Active.svg b/app/images/HMI_HVAC_AirUp_Active.svg new file mode 100644 index 0000000..7428bd1 --- /dev/null +++ b/app/images/HMI_HVAC_AirUp_Active.svg @@ -0,0 +1,126 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_AirUp_Inactive.svg b/app/images/HMI_HVAC_AirUp_Inactive.svg new file mode 100644 index 0000000..39e1fa1 --- /dev/null +++ b/app/images/HMI_HVAC_AirUp_Inactive.svg @@ -0,0 +1,75 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Auto_Active.svg b/app/images/HMI_HVAC_Auto_Active.svg new file mode 100644 index 0000000..e471801 --- /dev/null +++ b/app/images/HMI_HVAC_Auto_Active.svg @@ -0,0 +1,78 @@ + + + +image/svg+xmlauto + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Auto_Inactive.svg b/app/images/HMI_HVAC_Auto_Inactive.svg new file mode 100644 index 0000000..f189931 --- /dev/null +++ b/app/images/HMI_HVAC_Auto_Inactive.svg @@ -0,0 +1,66 @@ + + + +image/svg+xmlauto + \ No newline at end of file diff --git a/app/images/HMI_HVAC_ChairIndicator_OFF.svg b/app/images/HMI_HVAC_ChairIndicator_OFF.svg new file mode 100644 index 0000000..1fcd17f --- /dev/null +++ b/app/images/HMI_HVAC_ChairIndicator_OFF.svg @@ -0,0 +1,76 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_ChairIndicator_One.svg b/app/images/HMI_HVAC_ChairIndicator_One.svg new file mode 100644 index 0000000..c24fa8f --- /dev/null +++ b/app/images/HMI_HVAC_ChairIndicator_One.svg @@ -0,0 +1,71 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_ChairIndicator_Two.svg b/app/images/HMI_HVAC_ChairIndicator_Two.svg new file mode 100644 index 0000000..042b87d --- /dev/null +++ b/app/images/HMI_HVAC_ChairIndicator_Two.svg @@ -0,0 +1,77 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Circulation_Active.svg b/app/images/HMI_HVAC_Circulation_Active.svg new file mode 100644 index 0000000..8a15033 --- /dev/null +++ b/app/images/HMI_HVAC_Circulation_Active.svg @@ -0,0 +1,198 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Circulation_Inactive.svg b/app/images/HMI_HVAC_Circulation_Inactive.svg new file mode 100644 index 0000000..9c7d43f --- /dev/null +++ b/app/images/HMI_HVAC_Circulation_Inactive.svg @@ -0,0 +1,87 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Fan_Icon.svg b/app/images/HMI_HVAC_Fan_Icon.svg new file mode 100644 index 0000000..2676ba1 --- /dev/null +++ b/app/images/HMI_HVAC_Fan_Icon.svg @@ -0,0 +1,81 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Fan_Section.svg b/app/images/HMI_HVAC_Fan_Section.svg new file mode 100644 index 0000000..6ce708a --- /dev/null +++ b/app/images/HMI_HVAC_Fan_Section.svg @@ -0,0 +1,123 @@ + + + +image/svg+xmlFan Speed + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Front_Active.svg b/app/images/HMI_HVAC_Front_Active.svg new file mode 100644 index 0000000..2c873de --- /dev/null +++ b/app/images/HMI_HVAC_Front_Active.svg @@ -0,0 +1,111 @@ + + + +image/svg+xmlFRONT + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Front_Inactive.svg b/app/images/HMI_HVAC_Front_Inactive.svg new file mode 100644 index 0000000..c5d9166 --- /dev/null +++ b/app/images/HMI_HVAC_Front_Inactive.svg @@ -0,0 +1,72 @@ + + + +image/svg+xmlFRONT + \ No newline at end of file diff --git a/app/images/HMI_HVAC_LeftChair_Section.svg b/app/images/HMI_HVAC_LeftChair_Section.svg new file mode 100644 index 0000000..07575ad --- /dev/null +++ b/app/images/HMI_HVAC_LeftChair_Section.svg @@ -0,0 +1,209 @@ + + + +image/svg+xmllo +62° +L. Climate + \ No newline at end of file diff --git a/app/images/HMI_HVAC_LeftDetails.svg b/app/images/HMI_HVAC_LeftDetails.svg new file mode 100644 index 0000000..9527af4 --- /dev/null +++ b/app/images/HMI_HVAC_LeftDetails.svg @@ -0,0 +1,99 @@ + + + +image/svg+xmllo +62° + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Left_Chair_OFF.svg b/app/images/HMI_HVAC_Left_Chair_OFF.svg new file mode 100644 index 0000000..1412266 --- /dev/null +++ b/app/images/HMI_HVAC_Left_Chair_OFF.svg @@ -0,0 +1,87 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Left_Chair_ON.svg b/app/images/HMI_HVAC_Left_Chair_ON.svg new file mode 100644 index 0000000..14faf49 --- /dev/null +++ b/app/images/HMI_HVAC_Left_Chair_ON.svg @@ -0,0 +1,99 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Minus.svg b/app/images/HMI_HVAC_Minus.svg new file mode 100644 index 0000000..3659b8e --- /dev/null +++ b/app/images/HMI_HVAC_Minus.svg @@ -0,0 +1,88 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Minus_Push.svg b/app/images/HMI_HVAC_Minus_Push.svg new file mode 100644 index 0000000..c14820d --- /dev/null +++ b/app/images/HMI_HVAC_Minus_Push.svg @@ -0,0 +1,90 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Plus.svg b/app/images/HMI_HVAC_Plus.svg new file mode 100644 index 0000000..6ede403 --- /dev/null +++ b/app/images/HMI_HVAC_Plus.svg @@ -0,0 +1,70 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Rear_Active.svg b/app/images/HMI_HVAC_Rear_Active.svg new file mode 100644 index 0000000..7c67104 --- /dev/null +++ b/app/images/HMI_HVAC_Rear_Active.svg @@ -0,0 +1,195 @@ + + + +image/svg+xmlREAR + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Rear_Inactive.svg b/app/images/HMI_HVAC_Rear_Inactive.svg new file mode 100644 index 0000000..574c541 --- /dev/null +++ b/app/images/HMI_HVAC_Rear_Inactive.svg @@ -0,0 +1,91 @@ + + + +image/svg+xmlREAR + \ No newline at end of file diff --git a/app/images/HMI_HVAC_RightChair_Section.svg b/app/images/HMI_HVAC_RightChair_Section.svg new file mode 100644 index 0000000..bc06af4 --- /dev/null +++ b/app/images/HMI_HVAC_RightChair_Section.svg @@ -0,0 +1,217 @@ + + + +image/svg+xml62° +Lo +R. Climate + \ No newline at end of file diff --git a/app/images/HMI_HVAC_RightDetails.svg b/app/images/HMI_HVAC_RightDetails.svg new file mode 100644 index 0000000..3e6f7e3 --- /dev/null +++ b/app/images/HMI_HVAC_RightDetails.svg @@ -0,0 +1,98 @@ + + + +image/svg+xml62° +Lo + \ No newline at end of file diff --git a/app/images/HMI_HVAC_Right_Chair_OFF.svg b/app/images/HMI_HVAC_Right_Chair_OFF.svg new file mode 100644 index 0000000..711a942 --- /dev/null +++ b/app/images/HMI_HVAC_Right_Chair_OFF.svg @@ -0,0 +1,87 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/HMI_HVAC_Right_Chair_ON.svg b/app/images/HMI_HVAC_Right_Chair_ON.svg new file mode 100644 index 0000000..319ef67 --- /dev/null +++ b/app/images/HMI_HVAC_Right_Chair_ON.svg @@ -0,0 +1,100 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/app/images/images.qrc b/app/images/images.qrc new file mode 100644 index 0000000..81768a9 --- /dev/null +++ b/app/images/images.qrc @@ -0,0 +1,36 @@ + + + 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 + + diff --git a/hvac-demo-binding.c b/hvac-demo-binding.c new file mode 100644 index 0000000..a341d05 --- /dev/null +++ b/hvac-demo-binding.c @@ -0,0 +1,374 @@ +/* + * Copyright (C) 2015, 2016 "IoT.bzh" + * Author "Romain Forlot" + * Author "Jose Bolo" + * + * 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. + */ +#define _GNU_SOURCE + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#define CAN_DEV "can0" + +#define SIMULATE_HVAC + +static const struct afb_binding_interface *interface; + +// Initialize CAN hvac array that will be sent trough the socket +static struct { + const char *name; + uint8_t value; +} hvac_values[] = { + { "LeftTemperature", 21 }, + { "RightTemperature", 21 }, + { "Temperature", 21 }, + { "FanSpeed", 0 } +}; + +struct can_handler { + int socket; + struct sockaddr_can txAddress; +}; + +static struct can_handler can_handler = { .socket = -1 }; + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** **/ +/** **/ +/** SECTION: HANDLE CAN DEVICE **/ +/** **/ +/** **/ +/*****************************************************************************************/ +/*****************************************************************************************/ + +static int open_can_dev() +{ +#if defined(SIMULATE_HVAC) + DEBUG(interface, "Defining can handler socket to 0 and return"); + can_handler.socket = 0; + return 0; +#else + struct ifreq ifr; + + can_handler.socket = socket(PF_CAN, SOCK_RAW, CAN_RAW); + if (can_handler.socket < 0) + { + ERROR(interface, "socket could not be created"); + } + else + { + // Attempts to open a socket to CAN bus + strcpy(ifr.ifr_name, CAN_DEV); + if(ioctl(can_handler.socket, SIOCGIFINDEX, &ifr) < 0) + { + ERROR(interface, "ioctl failed"); + } + else + { + can_handler.txAddress.can_family = AF_CAN; + can_handler.txAddress.can_ifindex = ifr.ifr_ifindex; + + // And bind it to txAddress + if (bind(can_handler.socket, (struct sockaddr *)&can_handler.txAddress, sizeof(can_handler.txAddress)) < 0) + { + ERROR(interface, "bind failed"); + } + else { + return 0; + } + } + close(can_handler.socket); + can_handler.socket = -1; + } + return -1; +#endif +} + +// Get original get temperature function from cpp hvacplugin code +static uint8_t to_can_temp(uint8_t value) +{ + int result = ((0xF0 - 0x10) / 15) * value - 16; + if (result < 0x10) + result = 0x10; + if (result > 0xF0) + result = 0xF0; + + return (uint8_t)result; +} + +static uint8_t read_temp_left_zone() +{ + return hvac_values[0].value; +} + +static uint8_t read_temp_right_zone() +{ + return hvac_values[1].value; +} + +static uint8_t read_temp() +{ + return (uint8_t)(((int)read_temp_left_zone() + (int)read_temp_right_zone()) >> 1); +} + +static uint8_t read_fanspeed() +{ + return hvac_values[3].value; +} + +static int write_can() +{ + struct can_frame txCanFrame; + int rc = 0; + + rc = can_handler.socket; + if (rc >= 0) + { + // Hardcoded can_id and dlc (data lenght code) + txCanFrame.can_id = 0x30; + txCanFrame.can_dlc = 8; + txCanFrame.data[0] = to_can_temp(read_temp_left_zone()); + txCanFrame.data[1] = to_can_temp(read_temp_right_zone()); + txCanFrame.data[2] = to_can_temp(read_temp()); + txCanFrame.data[3] = 0xf0; + txCanFrame.data[4] = read_fanspeed(); + txCanFrame.data[5] = 1; + txCanFrame.data[6] = 0; + txCanFrame.data[7] = 0; + +#if defined(SIMULATE_HVAC) + DEBUG(interface, "WRITING CAN: %d %d [%02x %02x %02x %02x %02x %02x %02x %02x]\n", + txCanFrame.can_id, txCanFrame.can_dlc, + txCanFrame.data[0], txCanFrame.data[1], txCanFrame.data[2], txCanFrame.data[3], + txCanFrame.data[4], txCanFrame.data[5], txCanFrame.data[6], txCanFrame.data[7]); +#else + rc = sendto(can_handler.socket, &txCanFrame, sizeof(struct can_frame), 0, + (struct sockaddr*)&can_handler.txAddress, sizeof(can_handler.txAddress)); + if (rc < 0) + { + ERROR(interface, "Sending can frame failed"); + } +#endif + } + else + { + ERROR(interface, "socket not initialized"); + } + return rc; +} + +/*****************************************************************************************/ +/*****************************************************************************************/ +/** **/ +/** **/ +/** SECTION: BINDING VERBS IMPLEMENTATION **/ +/** **/ +/** **/ +/*****************************************************************************************/ +/*****************************************************************************************/ + +/* + * @brief Get fan speed HVAC system + * + * @param struct afb_req : an afb request structure + * + */ +static void get_fanspeed(struct afb_req request) +{ + json_object *ret_json; + uint8_t fanspeed = read_fanspeed(); + + ret_json = json_object_new_object(); + json_object_object_add(ret_json, "FanSpeed", json_object_new_int(fanspeed)); + + afb_req_success(request, ret_json, NULL); +} + +/* + * @brief Read Consign right zone temperature for HVAC system + * + * @param struct afb_req : an afb request structure + * + */ +static void get_temp_right_zone(struct afb_req request) +{ + json_object *ret_json; + uint8_t temp = read_temp_right_zone(); + + ret_json = json_object_new_object(); + json_object_object_add(ret_json, "RightTemperature", json_object_new_int(temp)); + + afb_req_success(request, ret_json, NULL); +} + +/* + * @brief Read Consign left zone temperature for HVAC system + * + * @param struct afb_req : an afb request structure + * + */ +static void get_temp_left_zone(struct afb_req request) +{ + json_object *ret_json; + uint8_t temp = read_temp_left_zone(); + + ret_json = json_object_new_object(); + json_object_object_add(ret_json, "LeftTemperature", json_object_new_int(temp)); + + afb_req_success(request, ret_json, NULL); +} + +/* + * @brief Read all values + * + * @param struct afb_req : an afb request structure + * + */ +static void get(struct afb_req request) +{ + DEBUG(interface, "Getting all values"); + json_object *ret_json; + + ret_json = json_object_new_object(); + json_object_object_add(ret_json, "LeftTemperature", json_object_new_int(read_temp_left_zone())); + json_object_object_add(ret_json, "RightTemperature", json_object_new_int(read_temp_right_zone())); + json_object_object_add(ret_json, "FanSpeed", json_object_new_int(read_fanspeed())); + + afb_req_success(request, ret_json, NULL); +} + +/* + * @brief Set a component value using a json object retrieved from request + * + * @param struct afb_req : an afb request structure + * + */ +static void set(struct afb_req request) +{ + int i, rc, x, changed; + struct json_object *query, *val; + uint8_t values[sizeof hvac_values / sizeof *hvac_values]; + uint8_t saves[sizeof hvac_values / sizeof *hvac_values]; + + /* records initial values */ + DEBUG(interface, "Records initial values"); + i = (int)(sizeof hvac_values / sizeof *hvac_values); + while (i) { + i--; + values[i] = saves[i] = hvac_values[i].value; + } + + /* Loop getting arguments */ + query = afb_req_json(request); + changed = 0; + i = (int)(sizeof hvac_values / sizeof *hvac_values); + DEBUG(interface, "Looping for args. i: %d", i); + while (i) + { + i--; + DEBUG(interface, "Searching... query: %s, i: %d, comp: %s", json_object_to_json_string(query), i, hvac_values[i].name); + if (json_object_object_get_ex(query, hvac_values[i].name, &val)) + { + DEBUG(interface, "We got it. Tests if it is an int or not."); + if (!json_object_is_type(val, json_type_int)) + { + afb_req_fail_f(request, "bad-request", + "argument '%s' isn't integer", hvac_values[i].name); + return; + } + DEBUG(interface, "We get an 'int'. Hail for the int: %d", x); + x = json_object_get_int(val); + if (x < 0 || x > 255) + { + afb_req_fail_f(request, "bad-request", + "argument '%s' is out of bounds", hvac_values[i].name); + return; + } + if (values[i] != x) { + values[i] = (uint8_t)x; + changed = 1; + } + } + DEBUG(interface, "Not found !"); + } + + /* attemps to set new values */ + DEBUG(interface, "Diff: %d", changed); + if (changed) + { + i = (int)(sizeof hvac_values / sizeof *hvac_values); + while (i) { + i--; + hvac_values[i].value = values[i]; + } + rc = write_can(); + if (rc >= 0) + afb_req_success(request, NULL, NULL); + else { + /* restore initial values */ + i = (int)(sizeof hvac_values / sizeof *hvac_values); + while (i) { + i--; + hvac_values[i].value = saves[i]; + } + afb_req_fail(request, "error", "CAN error"); + } + } + else { + afb_req_success(request, NULL, "No changes"); + } +} + +// TODO: Have to change session management flag to AFB_SESSION_CHECK to use token auth +static const struct afb_verb_desc_v1 verbs[]= { + {"get_temp_left_zone" , AFB_SESSION_NONE, get_temp_left_zone , "Get the left zone temperature"}, + {"get_temp_right_zone" , AFB_SESSION_NONE, get_temp_right_zone , "Get the right zone temperature"}, + {"get_fanspeed" , AFB_SESSION_NONE, get_fanspeed , "Read fan speed"}, + {"get" , AFB_SESSION_NONE, get , "Read all values"}, + {"set" , AFB_SESSION_NONE, set , "Set a HVAC component value"}, + {NULL} +}; + +static const struct afb_binding binding_desc = { + .type = AFB_BINDING_VERSION_1, + .v1 = { + .info = "hvac service", + .prefix = "hvac", + .verbs = verbs + } +}; + +const struct afb_binding *afbBindingV1Register (const struct afb_binding_interface *itf) +{ + interface = itf; + + return &binding_desc; +} + +int afbBindingV1ServiceInit(struct afb_service service) +{ + return open_can_dev(); +} diff --git a/hvac-demo-bindings.c b/hvac-demo-bindings.c deleted file mode 100644 index a341d05..0000000 --- a/hvac-demo-bindings.c +++ /dev/null @@ -1,374 +0,0 @@ -/* - * Copyright (C) 2015, 2016 "IoT.bzh" - * Author "Romain Forlot" - * Author "Jose Bolo" - * - * 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. - */ -#define _GNU_SOURCE - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -#define CAN_DEV "can0" - -#define SIMULATE_HVAC - -static const struct afb_binding_interface *interface; - -// Initialize CAN hvac array that will be sent trough the socket -static struct { - const char *name; - uint8_t value; -} hvac_values[] = { - { "LeftTemperature", 21 }, - { "RightTemperature", 21 }, - { "Temperature", 21 }, - { "FanSpeed", 0 } -}; - -struct can_handler { - int socket; - struct sockaddr_can txAddress; -}; - -static struct can_handler can_handler = { .socket = -1 }; - -/*****************************************************************************************/ -/*****************************************************************************************/ -/** **/ -/** **/ -/** SECTION: HANDLE CAN DEVICE **/ -/** **/ -/** **/ -/*****************************************************************************************/ -/*****************************************************************************************/ - -static int open_can_dev() -{ -#if defined(SIMULATE_HVAC) - DEBUG(interface, "Defining can handler socket to 0 and return"); - can_handler.socket = 0; - return 0; -#else - struct ifreq ifr; - - can_handler.socket = socket(PF_CAN, SOCK_RAW, CAN_RAW); - if (can_handler.socket < 0) - { - ERROR(interface, "socket could not be created"); - } - else - { - // Attempts to open a socket to CAN bus - strcpy(ifr.ifr_name, CAN_DEV); - if(ioctl(can_handler.socket, SIOCGIFINDEX, &ifr) < 0) - { - ERROR(interface, "ioctl failed"); - } - else - { - can_handler.txAddress.can_family = AF_CAN; - can_handler.txAddress.can_ifindex = ifr.ifr_ifindex; - - // And bind it to txAddress - if (bind(can_handler.socket, (struct sockaddr *)&can_handler.txAddress, sizeof(can_handler.txAddress)) < 0) - { - ERROR(interface, "bind failed"); - } - else { - return 0; - } - } - close(can_handler.socket); - can_handler.socket = -1; - } - return -1; -#endif -} - -// Get original get temperature function from cpp hvacplugin code -static uint8_t to_can_temp(uint8_t value) -{ - int result = ((0xF0 - 0x10) / 15) * value - 16; - if (result < 0x10) - result = 0x10; - if (result > 0xF0) - result = 0xF0; - - return (uint8_t)result; -} - -static uint8_t read_temp_left_zone() -{ - return hvac_values[0].value; -} - -static uint8_t read_temp_right_zone() -{ - return hvac_values[1].value; -} - -static uint8_t read_temp() -{ - return (uint8_t)(((int)read_temp_left_zone() + (int)read_temp_right_zone()) >> 1); -} - -static uint8_t read_fanspeed() -{ - return hvac_values[3].value; -} - -static int write_can() -{ - struct can_frame txCanFrame; - int rc = 0; - - rc = can_handler.socket; - if (rc >= 0) - { - // Hardcoded can_id and dlc (data lenght code) - txCanFrame.can_id = 0x30; - txCanFrame.can_dlc = 8; - txCanFrame.data[0] = to_can_temp(read_temp_left_zone()); - txCanFrame.data[1] = to_can_temp(read_temp_right_zone()); - txCanFrame.data[2] = to_can_temp(read_temp()); - txCanFrame.data[3] = 0xf0; - txCanFrame.data[4] = read_fanspeed(); - txCanFrame.data[5] = 1; - txCanFrame.data[6] = 0; - txCanFrame.data[7] = 0; - -#if defined(SIMULATE_HVAC) - DEBUG(interface, "WRITING CAN: %d %d [%02x %02x %02x %02x %02x %02x %02x %02x]\n", - txCanFrame.can_id, txCanFrame.can_dlc, - txCanFrame.data[0], txCanFrame.data[1], txCanFrame.data[2], txCanFrame.data[3], - txCanFrame.data[4], txCanFrame.data[5], txCanFrame.data[6], txCanFrame.data[7]); -#else - rc = sendto(can_handler.socket, &txCanFrame, sizeof(struct can_frame), 0, - (struct sockaddr*)&can_handler.txAddress, sizeof(can_handler.txAddress)); - if (rc < 0) - { - ERROR(interface, "Sending can frame failed"); - } -#endif - } - else - { - ERROR(interface, "socket not initialized"); - } - return rc; -} - -/*****************************************************************************************/ -/*****************************************************************************************/ -/** **/ -/** **/ -/** SECTION: BINDING VERBS IMPLEMENTATION **/ -/** **/ -/** **/ -/*****************************************************************************************/ -/*****************************************************************************************/ - -/* - * @brief Get fan speed HVAC system - * - * @param struct afb_req : an afb request structure - * - */ -static void get_fanspeed(struct afb_req request) -{ - json_object *ret_json; - uint8_t fanspeed = read_fanspeed(); - - ret_json = json_object_new_object(); - json_object_object_add(ret_json, "FanSpeed", json_object_new_int(fanspeed)); - - afb_req_success(request, ret_json, NULL); -} - -/* - * @brief Read Consign right zone temperature for HVAC system - * - * @param struct afb_req : an afb request structure - * - */ -static void get_temp_right_zone(struct afb_req request) -{ - json_object *ret_json; - uint8_t temp = read_temp_right_zone(); - - ret_json = json_object_new_object(); - json_object_object_add(ret_json, "RightTemperature", json_object_new_int(temp)); - - afb_req_success(request, ret_json, NULL); -} - -/* - * @brief Read Consign left zone temperature for HVAC system - * - * @param struct afb_req : an afb request structure - * - */ -static void get_temp_left_zone(struct afb_req request) -{ - json_object *ret_json; - uint8_t temp = read_temp_left_zone(); - - ret_json = json_object_new_object(); - json_object_object_add(ret_json, "LeftTemperature", json_object_new_int(temp)); - - afb_req_success(request, ret_json, NULL); -} - -/* - * @brief Read all values - * - * @param struct afb_req : an afb request structure - * - */ -static void get(struct afb_req request) -{ - DEBUG(interface, "Getting all values"); - json_object *ret_json; - - ret_json = json_object_new_object(); - json_object_object_add(ret_json, "LeftTemperature", json_object_new_int(read_temp_left_zone())); - json_object_object_add(ret_json, "RightTemperature", json_object_new_int(read_temp_right_zone())); - json_object_object_add(ret_json, "FanSpeed", json_object_new_int(read_fanspeed())); - - afb_req_success(request, ret_json, NULL); -} - -/* - * @brief Set a component value using a json object retrieved from request - * - * @param struct afb_req : an afb request structure - * - */ -static void set(struct afb_req request) -{ - int i, rc, x, changed; - struct json_object *query, *val; - uint8_t values[sizeof hvac_values / sizeof *hvac_values]; - uint8_t saves[sizeof hvac_values / sizeof *hvac_values]; - - /* records initial values */ - DEBUG(interface, "Records initial values"); - i = (int)(sizeof hvac_values / sizeof *hvac_values); - while (i) { - i--; - values[i] = saves[i] = hvac_values[i].value; - } - - /* Loop getting arguments */ - query = afb_req_json(request); - changed = 0; - i = (int)(sizeof hvac_values / sizeof *hvac_values); - DEBUG(interface, "Looping for args. i: %d", i); - while (i) - { - i--; - DEBUG(interface, "Searching... query: %s, i: %d, comp: %s", json_object_to_json_string(query), i, hvac_values[i].name); - if (json_object_object_get_ex(query, hvac_values[i].name, &val)) - { - DEBUG(interface, "We got it. Tests if it is an int or not."); - if (!json_object_is_type(val, json_type_int)) - { - afb_req_fail_f(request, "bad-request", - "argument '%s' isn't integer", hvac_values[i].name); - return; - } - DEBUG(interface, "We get an 'int'. Hail for the int: %d", x); - x = json_object_get_int(val); - if (x < 0 || x > 255) - { - afb_req_fail_f(request, "bad-request", - "argument '%s' is out of bounds", hvac_values[i].name); - return; - } - if (values[i] != x) { - values[i] = (uint8_t)x; - changed = 1; - } - } - DEBUG(interface, "Not found !"); - } - - /* attemps to set new values */ - DEBUG(interface, "Diff: %d", changed); - if (changed) - { - i = (int)(sizeof hvac_values / sizeof *hvac_values); - while (i) { - i--; - hvac_values[i].value = values[i]; - } - rc = write_can(); - if (rc >= 0) - afb_req_success(request, NULL, NULL); - else { - /* restore initial values */ - i = (int)(sizeof hvac_values / sizeof *hvac_values); - while (i) { - i--; - hvac_values[i].value = saves[i]; - } - afb_req_fail(request, "error", "CAN error"); - } - } - else { - afb_req_success(request, NULL, "No changes"); - } -} - -// TODO: Have to change session management flag to AFB_SESSION_CHECK to use token auth -static const struct afb_verb_desc_v1 verbs[]= { - {"get_temp_left_zone" , AFB_SESSION_NONE, get_temp_left_zone , "Get the left zone temperature"}, - {"get_temp_right_zone" , AFB_SESSION_NONE, get_temp_right_zone , "Get the right zone temperature"}, - {"get_fanspeed" , AFB_SESSION_NONE, get_fanspeed , "Read fan speed"}, - {"get" , AFB_SESSION_NONE, get , "Read all values"}, - {"set" , AFB_SESSION_NONE, set , "Set a HVAC component value"}, - {NULL} -}; - -static const struct afb_binding binding_desc = { - .type = AFB_BINDING_VERSION_1, - .v1 = { - .info = "hvac service", - .prefix = "hvac", - .verbs = verbs - } -}; - -const struct afb_binding *afbBindingV1Register (const struct afb_binding_interface *itf) -{ - interface = itf; - - return &binding_desc; -} - -int afbBindingV1ServiceInit(struct afb_service service) -{ - return open_can_dev(); -} diff --git a/qml/HVAC.pro b/qml/HVAC.pro deleted file mode 100644 index 7503812..0000000 --- a/qml/HVAC.pro +++ /dev/null @@ -1,17 +0,0 @@ -TEMPLATE = app -TARGET = hvac -QT = quickcontrols2 - -config_libhomescreen { - CONFIG += link_pkgconfig - PKGCONFIG += homescreen - DEFINES += HAVE_LIBHOMESCREEN -} - -SOURCES = main.cpp - -RESOURCES += \ - hvac.qrc \ - images/images.qrc \ - images/images.qrc - diff --git a/qml/HVAC.qml b/qml/HVAC.qml deleted file mode 100644 index b2f8e49..0000000 --- a/qml/HVAC.qml +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 - -ApplicationWindow { - id: root - - 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: root.width * 0.8 - Slider { - id: fanSpeed - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - } - Label { - anchors.left: fanSpeed.left - anchors.top: fanSpeed.bottom - text: 'FAN SPEED' - } - } - } - RowLayout { - Layout.fillHeight: true - Layout.fillWidth: true - ColumnLayout { - Image { - source: './images/HMI_HVAC_LeftChair_Section.svg' - } - } - ColumnLayout { - Layout.fillWidth: true - spacing: root.width / 40 - ToggleButton { - onImage: './images/HMI_HVAC_AC_Active.svg' - offImage: './images/HMI_HVAC_AC_Inactive.svg' - } - ToggleButton { - onImage: './images/HMI_HVAC_Auto_Active.svg' - offImage: './images/HMI_HVAC_Auto_Inactive.svg' - } - ToggleButton { - onImage: './images/HMI_HVAC_Circulation_Active.svg' - offImage: './images/HMI_HVAC_Circulation_Inactive.svg' - } - } - - ColumnLayout { - Image { - source: './images/HMI_HVAC_RightChair_Section.svg' - } - } - } - - 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) - } - } - } - } -} diff --git a/qml/images/HMI_HVAC_AC_Active.svg b/qml/images/HMI_HVAC_AC_Active.svg deleted file mode 100644 index 608f44d..0000000 --- a/qml/images/HMI_HVAC_AC_Active.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - -image/svg+xmla/c - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AC_Inactive.svg b/qml/images/HMI_HVAC_AC_Inactive.svg deleted file mode 100644 index 1bd338e..0000000 --- a/qml/images/HMI_HVAC_AC_Inactive.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - -image/svg+xmla/c - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirDown_Active.svg b/qml/images/HMI_HVAC_AirDown_Active.svg deleted file mode 100644 index 68aebb3..0000000 --- a/qml/images/HMI_HVAC_AirDown_Active.svg +++ /dev/null @@ -1,121 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirDown_Inactive.svg b/qml/images/HMI_HVAC_AirDown_Inactive.svg deleted file mode 100644 index a013f4b..0000000 --- a/qml/images/HMI_HVAC_AirDown_Inactive.svg +++ /dev/null @@ -1,69 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirRight_Active.svg b/qml/images/HMI_HVAC_AirRight_Active.svg deleted file mode 100644 index 9ac6103..0000000 --- a/qml/images/HMI_HVAC_AirRight_Active.svg +++ /dev/null @@ -1,123 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirRight_Inactive.svg b/qml/images/HMI_HVAC_AirRight_Inactive.svg deleted file mode 100644 index 991a773..0000000 --- a/qml/images/HMI_HVAC_AirRight_Inactive.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirUp_Active.svg b/qml/images/HMI_HVAC_AirUp_Active.svg deleted file mode 100644 index 7428bd1..0000000 --- a/qml/images/HMI_HVAC_AirUp_Active.svg +++ /dev/null @@ -1,126 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_AirUp_Inactive.svg b/qml/images/HMI_HVAC_AirUp_Inactive.svg deleted file mode 100644 index 39e1fa1..0000000 --- a/qml/images/HMI_HVAC_AirUp_Inactive.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Auto_Active.svg b/qml/images/HMI_HVAC_Auto_Active.svg deleted file mode 100644 index e471801..0000000 --- a/qml/images/HMI_HVAC_Auto_Active.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - -image/svg+xmlauto - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Auto_Inactive.svg b/qml/images/HMI_HVAC_Auto_Inactive.svg deleted file mode 100644 index f189931..0000000 --- a/qml/images/HMI_HVAC_Auto_Inactive.svg +++ /dev/null @@ -1,66 +0,0 @@ - - - -image/svg+xmlauto - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_ChairIndicator_OFF.svg b/qml/images/HMI_HVAC_ChairIndicator_OFF.svg deleted file mode 100644 index 1fcd17f..0000000 --- a/qml/images/HMI_HVAC_ChairIndicator_OFF.svg +++ /dev/null @@ -1,76 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_ChairIndicator_One.svg b/qml/images/HMI_HVAC_ChairIndicator_One.svg deleted file mode 100644 index c24fa8f..0000000 --- a/qml/images/HMI_HVAC_ChairIndicator_One.svg +++ /dev/null @@ -1,71 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_ChairIndicator_Two.svg b/qml/images/HMI_HVAC_ChairIndicator_Two.svg deleted file mode 100644 index 042b87d..0000000 --- a/qml/images/HMI_HVAC_ChairIndicator_Two.svg +++ /dev/null @@ -1,77 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Circulation_Active.svg b/qml/images/HMI_HVAC_Circulation_Active.svg deleted file mode 100644 index 8a15033..0000000 --- a/qml/images/HMI_HVAC_Circulation_Active.svg +++ /dev/null @@ -1,198 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Circulation_Inactive.svg b/qml/images/HMI_HVAC_Circulation_Inactive.svg deleted file mode 100644 index 9c7d43f..0000000 --- a/qml/images/HMI_HVAC_Circulation_Inactive.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Fan_Icon.svg b/qml/images/HMI_HVAC_Fan_Icon.svg deleted file mode 100644 index 2676ba1..0000000 --- a/qml/images/HMI_HVAC_Fan_Icon.svg +++ /dev/null @@ -1,81 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Fan_Section.svg b/qml/images/HMI_HVAC_Fan_Section.svg deleted file mode 100644 index 6ce708a..0000000 --- a/qml/images/HMI_HVAC_Fan_Section.svg +++ /dev/null @@ -1,123 +0,0 @@ - - - -image/svg+xmlFan Speed - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Front_Active.svg b/qml/images/HMI_HVAC_Front_Active.svg deleted file mode 100644 index 2c873de..0000000 --- a/qml/images/HMI_HVAC_Front_Active.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - -image/svg+xmlFRONT - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Front_Inactive.svg b/qml/images/HMI_HVAC_Front_Inactive.svg deleted file mode 100644 index c5d9166..0000000 --- a/qml/images/HMI_HVAC_Front_Inactive.svg +++ /dev/null @@ -1,72 +0,0 @@ - - - -image/svg+xmlFRONT - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_LeftChair_Section.svg b/qml/images/HMI_HVAC_LeftChair_Section.svg deleted file mode 100644 index 07575ad..0000000 --- a/qml/images/HMI_HVAC_LeftChair_Section.svg +++ /dev/null @@ -1,209 +0,0 @@ - - - -image/svg+xmllo -62° -L. Climate - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_LeftDetails.svg b/qml/images/HMI_HVAC_LeftDetails.svg deleted file mode 100644 index 9527af4..0000000 --- a/qml/images/HMI_HVAC_LeftDetails.svg +++ /dev/null @@ -1,99 +0,0 @@ - - - -image/svg+xmllo -62° - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Left_Chair_OFF.svg b/qml/images/HMI_HVAC_Left_Chair_OFF.svg deleted file mode 100644 index 1412266..0000000 --- a/qml/images/HMI_HVAC_Left_Chair_OFF.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Left_Chair_ON.svg b/qml/images/HMI_HVAC_Left_Chair_ON.svg deleted file mode 100644 index 14faf49..0000000 --- a/qml/images/HMI_HVAC_Left_Chair_ON.svg +++ /dev/null @@ -1,99 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Minus.svg b/qml/images/HMI_HVAC_Minus.svg deleted file mode 100644 index 3659b8e..0000000 --- a/qml/images/HMI_HVAC_Minus.svg +++ /dev/null @@ -1,88 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Minus_Push.svg b/qml/images/HMI_HVAC_Minus_Push.svg deleted file mode 100644 index c14820d..0000000 --- a/qml/images/HMI_HVAC_Minus_Push.svg +++ /dev/null @@ -1,90 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Plus.svg b/qml/images/HMI_HVAC_Plus.svg deleted file mode 100644 index 6ede403..0000000 --- a/qml/images/HMI_HVAC_Plus.svg +++ /dev/null @@ -1,70 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Rear_Active.svg b/qml/images/HMI_HVAC_Rear_Active.svg deleted file mode 100644 index 7c67104..0000000 --- a/qml/images/HMI_HVAC_Rear_Active.svg +++ /dev/null @@ -1,195 +0,0 @@ - - - -image/svg+xmlREAR - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Rear_Inactive.svg b/qml/images/HMI_HVAC_Rear_Inactive.svg deleted file mode 100644 index 574c541..0000000 --- a/qml/images/HMI_HVAC_Rear_Inactive.svg +++ /dev/null @@ -1,91 +0,0 @@ - - - -image/svg+xmlREAR - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_RightChair_Section.svg b/qml/images/HMI_HVAC_RightChair_Section.svg deleted file mode 100644 index bc06af4..0000000 --- a/qml/images/HMI_HVAC_RightChair_Section.svg +++ /dev/null @@ -1,217 +0,0 @@ - - - -image/svg+xml62° -Lo -R. Climate - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_RightDetails.svg b/qml/images/HMI_HVAC_RightDetails.svg deleted file mode 100644 index 3e6f7e3..0000000 --- a/qml/images/HMI_HVAC_RightDetails.svg +++ /dev/null @@ -1,98 +0,0 @@ - - - -image/svg+xml62° -Lo - \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Right_Chair_OFF.svg b/qml/images/HMI_HVAC_Right_Chair_OFF.svg deleted file mode 100644 index 711a942..0000000 --- a/qml/images/HMI_HVAC_Right_Chair_OFF.svg +++ /dev/null @@ -1,87 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/HMI_HVAC_Right_Chair_ON.svg b/qml/images/HMI_HVAC_Right_Chair_ON.svg deleted file mode 100644 index 319ef67..0000000 --- a/qml/images/HMI_HVAC_Right_Chair_ON.svg +++ /dev/null @@ -1,100 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/qml/images/images.qrc b/qml/images/images.qrc deleted file mode 100644 index 81768a9..0000000 --- a/qml/images/images.qrc +++ /dev/null @@ -1,36 +0,0 @@ - - - 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 - - diff --git a/qml/main.cpp b/qml/main.cpp deleted file mode 100644 index b2133f7..0000000 --- a/qml/main.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -#include -#include -#include -#include - -#ifdef HAVE_LIBHOMESCREEN -#include -#endif - -int main(int argc, char *argv[]) -{ -#ifdef HAVE_LIBHOMESCREEN - LibHomeScreen libHomeScreen; - - if (!libHomeScreen.renderAppToAreaAllowed(0, 1)) { - qWarning() << "renderAppToAreaAllowed is denied"; - return -1; - } -#endif - - QGuiApplication app(argc, argv); - - QQuickStyle::setStyle("AGL"); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/HVAC.qml"))); - - return app.exec(); -} - -- cgit 1.2.3-korg