aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/.qmake.cache1
-rw-r--r--app/.qmake.stash6
-rw-r--r--app/HeatDegree.qml55
-rw-r--r--app/SeatHeatButton.qml78
-rw-r--r--app/hvac-demo.cpp2
-rw-r--r--app/hvac-demo.pro10
-rw-r--r--app/hvac-demo.qml60
-rw-r--r--app/hvac-demo.qrc4
-rw-r--r--app/images/HMI_HVAC_Active.svg75
-rw-r--r--app/images/HMI_HVAC_Inactive.svg63
-rw-r--r--app/images/images.qrc14
11 files changed, 341 insertions, 27 deletions
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 @@
<RCC>
<qresource prefix="/">
- <file>hvac-demo.qml</file>
+ <file>HVAC.qml</file>
+ <file>SeatHeatButton.qml</file>
+ <file>HeatDegree.qml</file>
</qresource>
</RCC>
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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:i="&amp;#38;ns_ai;"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_2"
+ x="0px"
+ y="0px"
+ viewBox="0 0 318 219"
+ style="enable-background:new 0 0 318 219;"
+ xml:space="preserve"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="HMI_HVAC_Active.svg"><metadata
+ id="metadata30"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs28" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2560"
+ inkscape:window-height="1464"
+ id="namedview26"
+ showgrid="false"
+ inkscape:zoom="1.0776256"
+ inkscape:cx="-50.091615"
+ inkscape:cy="35.262715"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_2" /><style
+ type="text/css"
+ id="style3">
+ .st0{fill:#00FF00;}
+ .st1{font-family:'Roboto-Light';}
+ .st2{font-size:88.6888px;}
+ .st3{letter-spacing:3;}
+ .st4{letter-spacing:-3;}
+ .st5{fill:none;stroke:url(#SVGID_1_);stroke-miterlimit:10;}
+</style><switch
+ id="switch5"><g
+ i:extraneous="self"
+ id="g7"><g
+ id="g9"><linearGradient
+ id="SVGID_1_"
+ gradientUnits="userSpaceOnUse"
+ x1="20.6039"
+ y1="240.7292"
+ x2="297.3961"
+ y2="-21.7292"><stop
+ offset="0"
+ style="stop-color:#59FF7F"
+ id="stop20" /><stop
+ offset="1"
+ style="stop-color:#6BFBFF"
+ id="stop22" /></linearGradient><rect
+ x="0.5"
+ y="0.5"
+ class="st5"
+ width="317"
+ height="218"
+ id="rect24" /></g></g></switch></svg> \ 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 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 21.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+
+<svg
+ xmlns:i="&amp;#38;ns_ai;"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_2"
+ x="0px"
+ y="0px"
+ viewBox="0 0 318 219"
+ style="enable-background:new 0 0 318 219;"
+ xml:space="preserve"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="HMI_HVAC_Inactive.svg"><metadata
+ id="metadata25"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs23" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="2560"
+ inkscape:window-height="1464"
+ id="namedview21"
+ showgrid="false"
+ inkscape:zoom="1.0776256"
+ inkscape:cx="-72.805888"
+ inkscape:cy="109.5"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="Layer_2" /><style
+ type="text/css"
+ id="style3">
+ .st0{fill:#848286;}
+ .st1{font-family:'Roboto-Light';}
+ .st2{font-size:88.6888px;}
+ .st3{letter-spacing:3;}
+ .st4{letter-spacing:-3;}
+ .st5{fill:none;stroke:#848286;stroke-miterlimit:10;}
+</style><switch
+ id="switch5"><g
+ i:extraneous="self"
+ id="g7"><g
+ id="g9"><rect
+ x="0.5"
+ y="0.5"
+ class="st5"
+ width="317"
+ height="218"
+ id="rect19" /></g></g></switch></svg> \ 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 @@
<RCC>
<qresource prefix="/images">
- <file>HMI_HVAC_AC_Active.svg</file>
- <file>HMI_HVAC_AC_Inactive.svg</file>
<file>HMI_HVAC_AirDown_Active.svg</file>
<file>HMI_HVAC_AirDown_Inactive.svg</file>
<file>HMI_HVAC_AirRight_Active.svg</file>
<file>HMI_HVAC_AirRight_Inactive.svg</file>
<file>HMI_HVAC_AirUp_Active.svg</file>
<file>HMI_HVAC_AirUp_Inactive.svg</file>
- <file>HMI_HVAC_Auto_Active.svg</file>
- <file>HMI_HVAC_Auto_Inactive.svg</file>
<file>HMI_HVAC_ChairIndicator_OFF.svg</file>
<file>HMI_HVAC_ChairIndicator_One.svg</file>
<file>HMI_HVAC_ChairIndicator_Two.svg</file>
<file>HMI_HVAC_Circulation_Active.svg</file>
<file>HMI_HVAC_Circulation_Inactive.svg</file>
<file>HMI_HVAC_Fan_Icon.svg</file>
- <file>HMI_HVAC_Fan_Section.svg</file>
<file>HMI_HVAC_Front_Active.svg</file>
<file>HMI_HVAC_Front_Inactive.svg</file>
<file>HMI_HVAC_Left_Chair_OFF.svg</file>
<file>HMI_HVAC_Left_Chair_ON.svg</file>
- <file>HMI_HVAC_LeftChair_Section.svg</file>
- <file>HMI_HVAC_LeftDetails.svg</file>
- <file>HMI_HVAC_Minus_Push.svg</file>
- <file>HMI_HVAC_Minus.svg</file>
- <file>HMI_HVAC_Plus.svg</file>
<file>HMI_HVAC_Rear_Active.svg</file>
<file>HMI_HVAC_Rear_Inactive.svg</file>
<file>HMI_HVAC_Right_Chair_OFF.svg</file>
<file>HMI_HVAC_Right_Chair_ON.svg</file>
- <file>HMI_HVAC_RightChair_Section.svg</file>
- <file>HMI_HVAC_RightDetails.svg</file>
+ <file>HMI_HVAC_Active.svg</file>
+ <file>HMI_HVAC_Inactive.svg</file>
</qresource>
</RCC>