summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/resources/base
diff options
context:
space:
mode:
Diffstat (limited to 'tradeshow/iot-sensortag/resources/base')
-rw-r--r--tradeshow/iot-sensortag/resources/base/AirPressureChart.qml82
-rw-r--r--tradeshow/iot-sensortag/resources/base/BaseChart.qml119
-rw-r--r--tradeshow/iot-sensortag/resources/base/BottomToolbar.qml54
-rw-r--r--tradeshow/iot-sensortag/resources/base/ChartPage.qml70
-rw-r--r--tradeshow/iot-sensortag/resources/base/CircularGauge.qml132
-rw-r--r--tradeshow/iot-sensortag/resources/base/GyroChart.qml218
-rw-r--r--tradeshow/iot-sensortag/resources/base/HumidityChart.qml159
-rw-r--r--tradeshow/iot-sensortag/resources/base/LightChart.qml126
-rw-r--r--tradeshow/iot-sensortag/resources/base/LocationPage.qml103
-rw-r--r--tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml226
-rw-r--r--tradeshow/iot-sensortag/resources/base/ObjectTemperatureChart.qml125
-rw-r--r--tradeshow/iot-sensortag/resources/base/SensorTag.qml252
-rw-r--r--tradeshow/iot-sensortag/resources/base/TemperatureChart.qml278
-rw-r--r--tradeshow/iot-sensortag/resources/base/TopToolbar.qml196
-rwxr-xr-xtradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Bold.ttfbin0 -> 59908 bytes
-rwxr-xr-xtradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Regular.ttfbin0 -> 63752 bytes
-rwxr-xr-xtradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-SemiBold.ttfbin0 -> 63044 bytes
-rw-r--r--tradeshow/iot-sensortag/resources/base/main.qml72
18 files changed, 2212 insertions, 0 deletions
diff --git a/tradeshow/iot-sensortag/resources/base/AirPressureChart.qml b/tradeshow/iot-sensortag/resources/base/AirPressureChart.qml
new file mode 100644
index 0000000..df10674
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/AirPressureChart.qml
@@ -0,0 +1,82 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ property string airPressureTxt
+
+ antialiasing: true
+ title: qsTr("Air Pressure")
+
+ onSensorChanged: if (sensor) {
+ sensor.barometer_hPaChanged.connect(this, function() { airPressureTxt = sensor.barometerHPa.toFixed(1); });
+ }
+
+ content: Item {
+ id: container
+
+ anchors.fill: parent
+
+ Image {
+ source: pathPrefix + "AirPressure/AirPre_base_gauge.png"
+ anchors.centerIn: parent
+
+ Text {
+ id: pressureText
+
+ text: airPressureTxt + "\nhPa"
+ horizontalAlignment: Text.AlignHCenter
+ anchors.centerIn: parent
+ color: "white"
+ }
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/BaseChart.qml b/tradeshow/iot-sensortag/resources/base/BaseChart.qml
new file mode 100644
index 0000000..d148acf
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/BaseChart.qml
@@ -0,0 +1,119 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import Style 1.0
+import SensorTag.DataProvider 1.0
+
+Item {
+ id: baseChart
+
+ property var sensor: null
+ property string title
+ property alias contentItem: loader.item
+ property alias content: loader.sourceComponent
+ property bool rightSide: false
+ property alias titlePaneHeight: titleIcon.height
+ property bool hasData: baseChart.sensor ? baseChart.sensor.state === SensorTagData.Connected : false
+
+ signal clicked
+
+ Image {
+ id: titleIcon
+
+ anchors.top: parent.top
+ source: pathPrefix + "General/icon_sensor.png"
+ }
+
+ Text {
+ color: "white"
+ text: title.toUpperCase()
+ font.pixelSize: Style.indicatorTitleFontSize
+ anchors.left: titleIcon.right
+ anchors.leftMargin: 14
+ anchors.top: parent.top
+ anchors.topMargin: -8
+ }
+
+ Loader {
+ id: loader
+
+ anchors.top: titleIcon.bottom
+ anchors.bottom: separator.bottom
+ anchors.bottomMargin: 16
+ anchors.left: parent.left
+ anchors.right: parent.right
+ }
+
+ Image {
+ id: separator
+
+ source: pathPrefix + "General/separator.png"
+ anchors.bottom: parent.bottom
+ transform: Rotation {
+ origin.x: separator.width / 2
+ origin.y: separator.height / 2
+ axis.x: 0
+ axis.y: 1
+ axis.z: 0
+ angle: rightSide ? 180 : 0
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: baseChart.clicked()
+ }
+
+ Rectangle {
+ anchors.fill: parent
+ visible: baseChart.sensor ? baseChart.sensor.state !== SensorTagData.Connected : true
+ opacity: 0.3
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/BottomToolbar.qml b/tradeshow/iot-sensortag/resources/base/BottomToolbar.qml
new file mode 100644
index 0000000..1c6f2f1
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/BottomToolbar.qml
@@ -0,0 +1,54 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+
+Item {
+
+}
diff --git a/tradeshow/iot-sensortag/resources/base/ChartPage.qml b/tradeshow/iot-sensortag/resources/base/ChartPage.qml
new file mode 100644
index 0000000..8a58246
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/ChartPage.qml
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+
+Flickable{
+ id: view
+
+ contentWidth: col.width
+ contentHeight: col.height
+
+ Column {
+ id: col
+ width: view.width
+
+ TemperatureChart{}
+ ObjectTemperatureChart{}
+ HumidityChart{}
+ LightChart{}
+ AirPressureChart{}
+ MagnetometerChart{}
+ }
+}
+
diff --git a/tradeshow/iot-sensortag/resources/base/CircularGauge.qml b/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
new file mode 100644
index 0000000..5ee5b53
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/CircularGauge.qml
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+
+Item {
+ id: gauge
+
+ property real min: 0
+ property real max: 360
+ property real value: 20
+ property real stepCount: 18
+ property bool discreteSteps: true
+
+ property alias background: bgLoader.sourceComponent
+ property alias foreground: fgLoader.sourceComponent
+
+ property real increment: 360 / stepCount
+
+ function incrementStep() {
+ if (value < max - increment)
+ value += increment
+ }
+
+ function decrementStep() {
+ if (value > min + increment)
+ value -= increment;
+ }
+
+ width: bgLoader.item.width
+ height: bgLoader.item.height
+ onValueChanged: maskCanvas.requestPaint()
+
+ Loader {
+ id: bgLoader
+ }
+
+ Loader {
+ id: fgLoader
+
+ visible: false
+ }
+
+ Item {
+ id: mask
+
+ property real range: max - min
+ property real offsetAngle: -77
+ property real startAngle: mask.offsetAngle / 360 * Math.PI * 2
+ property real angleStep: Math.PI * 2 / stepCount
+
+ width: fgLoader.item.width
+ height: fgLoader.item.height
+ visible: false
+
+ Canvas {
+ id: maskCanvas
+
+ anchors.fill: parent
+ onPaint: {
+ var ctx = getContext("2d");
+
+ // could optimize this by clearing only when decrementing value
+ ctx.clearRect(0, 0, width, height);
+
+ var endAngle = mask.startAngle + (value - min) / mask.range * Math.PI * 2;
+ if (discreteSteps)
+ endAngle = Math.floor(endAngle / mask.angleStep) * mask.angleStep;
+ ctx.beginPath();
+ ctx.arc(Math.floor(width / 2), Math.floor(height / 2), mask.width / 2, mask.startAngle, endAngle);
+ ctx.lineTo(mask.width / 2, mask.height / 2)
+ ctx.closePath();
+ ctx.fill();
+ }
+ }
+ }
+
+ OpacityMask {
+ width: mask.width
+ height: mask.height
+ source: fgLoader.item
+ maskSource: mask
+ anchors.centerIn: gauge
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/GyroChart.qml b/tradeshow/iot-sensortag/resources/base/GyroChart.qml
new file mode 100644
index 0000000..681d218
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/GyroChart.qml
@@ -0,0 +1,218 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import QtCharts 2.1
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ id: gyroHolderRect
+
+ // Replace with actual gyro properties
+ property int gyroSeriesIndex: 0
+ property int maxGyroReadings: 24
+
+ readonly property color chartColor: "#15bdff"
+ readonly property color gridColor: "#005b80"
+ readonly property string xColor: "#15bdff"
+ readonly property string yColor: "white"
+ readonly property string zColor: "fuchsia"
+ readonly property color textColor: "white"
+
+ onSensorChanged: {
+ if (sensor) {
+ sensor.rotationValuesChanged.connect(contentItem.updateRotation);
+ }
+ }
+
+ title: qsTr("Gyroscope")
+ rightSide: true
+
+ content: Item {
+ anchors.fill: parent
+
+ function updateRotation() {
+ gyroSeriesX.append(gyroSeriesIndex, sensor.rotationX);
+ gyroSeriesY.append(gyroSeriesIndex, sensor.rotationY);
+ gyroSeriesZ.append(gyroSeriesIndex, sensor.rotationZ);
+
+ if (gyroSeriesIndex >= maxGyroReadings) {
+ gyroSeriesX.remove(gyroSeriesX.at(gyroSeriesIndex-maxGyroReadings));
+ gyroSeriesY.remove(gyroSeriesY.at(gyroSeriesIndex-maxGyroReadings));
+ gyroSeriesZ.remove(gyroSeriesZ.at(gyroSeriesIndex-maxGyroReadings));
+ valueAxisX.min++;
+ valueAxisX.max++;
+ }
+ gyroSeriesIndex++;
+ }
+
+ ChartView {
+ id: chartView
+
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 8
+ anchors.left: parent.left
+ anchors.leftMargin: -40
+ anchors.right: parent.right
+ anchors.rightMargin: -28
+ antialiasing: true
+ backgroundColor: "transparent"
+ legend.visible: false
+ margins.top: 0
+ margins.right: 0
+
+ // Hide the value axis labels; labels are drawn separately.
+ ValueAxis {
+ id: valueAxisX
+ labelsVisible: false
+ min: 0
+ max: maxGyroReadings + 1
+ tickCount: 13
+ minorTickCount: 1
+ color: chartColor
+ gridLineColor: gridColor
+ minorGridLineColor: gridColor
+ }
+
+ ValueAxis {
+ id: valueAxisY
+ labelsVisible: false
+ min: 0
+ max: 360
+ tickCount: 11
+ minorTickCount: 1
+ color: chartColor
+ gridLineColor: gridColor
+ minorGridLineColor: gridColor
+ }
+
+ Column {
+ id: col
+
+ property int step: (valueAxisY.max - valueAxisY.min) / (valueAxisY.tickCount - 1)
+
+ spacing: -7
+
+ y: chartView.plotArea.y - 10
+ x: 30
+
+ Repeater {
+ model: valueAxisY.tickCount
+
+ Text {
+ text: valueAxisY.max - index * col.step
+ horizontalAlignment: Text.AlignRight
+ width: 50
+ color: textColor
+ }
+ }
+ }
+
+ ScatterSeries {
+ id: gyroSeriesX
+ axisX: valueAxisX
+ axisY: valueAxisY
+ color: xColor
+ borderWidth: 0
+ markerSize: 6
+ name: "Gyro X"
+ }
+ ScatterSeries {
+ id: gyroSeriesY
+ axisX: valueAxisX
+ axisY: valueAxisY
+ color: yColor
+ borderWidth: 0
+ markerSize: 6
+ name: "Gyro Y"
+ }
+ ScatterSeries {
+ id: gyroSeriesZ
+ axisX: valueAxisX
+ axisY: valueAxisY
+ color: zColor
+ borderWidth: 0
+ markerSize: 6
+ name: "Gyro Z"
+ }
+ }
+
+ Row {
+ id: xLabelRow
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 28
+ anchors.left: parent.left
+ anchors.leftMargin: chartView.plotArea.x - 40
+ anchors.right: parent.right
+
+ Text {
+ id: xLabel
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + xColor + "\">Roll<br><font color=\"white\">" + (sensor ? sensor.rotationX : 0)
+ lineHeight: 0.7
+ width: (gyroHolderRect.width - xLabelRow.x) / 3
+ }
+
+ Text {
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + yColor + "\">Pitch<br><font color=\"white\">" + (sensor ? sensor.rotationY : 0)
+ lineHeight: 0.7
+ width: xLabel.width
+ }
+
+ Text {
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + zColor + "\">Yaw<br><font color=\"white\">" + (sensor ? sensor.rotationZ : 0)
+ lineHeight: 0.7
+ width: xLabel.width
+ }
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/HumidityChart.qml b/tradeshow/iot-sensortag/resources/base/HumidityChart.qml
new file mode 100644
index 0000000..0a74a68
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/HumidityChart.qml
@@ -0,0 +1,159 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import QtQuick.Controls 2.0
+import QtQuick.Controls.Styles 1.4
+import QtCharts 2.1
+import SensorTag.DataProvider 1.0
+import QtQuick.Extras 1.4
+
+BaseChart {
+ property int humiditySeriesIndex: 0
+ property int maxNumOfHumiReadings: 30
+ property real humidityValue: 0
+
+ antialiasing: true
+ title: qsTr("Humidity")
+
+ onSensorChanged: if (sensor) {
+ sensor.relativeHumidityChanged.connect(contentItem.getMaxOchMinHum)
+ }
+
+ content: Item {
+ anchors.fill: parent
+
+ property alias humiText: humidityMainText.text
+ property real maxHumi: 0
+ property real minHumi: 1000
+
+ function getMaxOchMinHum()
+ {
+ humidityValue = sensor.relativeHumidity;
+ contentItem.humiText = humidityValue.toFixed(1) + " %";
+
+ if (humidityValue > contentItem.maxHumi)
+ {
+ contentItem.maxHumi = humidityValue
+ }
+
+ if (humidityValue < contentItem.minHumi)
+ {
+ contentItem.minHumi = humidityValue;
+ }
+ }
+
+ Image {
+ id: humidityMainImg
+
+ source: pathPrefix + "Humidity/humidity_base_gauge.png"
+ anchors.left: parent.left
+ anchors.leftMargin: 8
+ anchors.bottom: parent.bottom
+
+ Text {
+ id: humidityMainText
+
+ anchors.centerIn: parent
+ color: "white"
+ }
+ }
+
+ Image {
+ source: pathPrefix + "Humidity/humidity_min_hum.png"
+ anchors.left: humidityMainImg.right
+ anchors.leftMargin: -11
+ anchors.bottom: humidityMainImg.bottom
+
+ Text {
+ anchors.bottom: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.horizontalCenterOffset: -10
+ text: "min"
+ color: "white"
+ }
+
+ Text{
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.verticalCenterOffset: 10
+ text: minHumi.toFixed(1) + " %"
+ font.pixelSize: 12
+ horizontalAlignment: Text.AlignRight
+ color: "white"
+ }
+ }
+
+ Image {
+ source: pathPrefix + "Humidity/humidity_max_hum.png"
+ anchors.left: humidityMainImg.right
+ anchors.leftMargin: -22
+ anchors.top: humidityMainImg.top
+
+ Text {
+ anchors.top: parent.top
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.horizontalCenterOffset: -10
+ text: "max"
+ color: "white"
+ }
+
+ Text{
+ anchors.right: parent.right
+ anchors.rightMargin: 10
+ anchors.verticalCenter: parent.verticalCenter
+ text: maxHumi.toFixed(1) + "%"
+ font.pixelSize: 14
+ horizontalAlignment: Text.AlignRight
+ color: "white"
+ }
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/LightChart.qml b/tradeshow/iot-sensortag/resources/base/LightChart.qml
new file mode 100644
index 0000000..34da38a
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/LightChart.qml
@@ -0,0 +1,126 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ height: view.height * 0.4
+ width: view.width
+ antialiasing: true
+ title: qsTr("Light Intensity")
+ rightSide: true
+
+ onSensorChanged: if (sensor) {
+ sensor.lightIntensityChanged.connect(contentItem.getLightText)
+ }
+
+ content: Item {
+ id: container
+
+ anchors.fill: parent
+
+ property alias lightText: lightMainText.text
+ property alias lightImg: brightnessImg
+ property real lightValue: 0
+ property real maxLightValue: 1
+ property real normalizedLightValue: 0
+
+ function getLightText()
+ {
+ lightValue = sensor.lightIntensityLux;
+ contentItem.lightText = lightValue.toFixed(1);
+
+ if (lightValue > maxLightValue)
+ {
+ maxLightValue = lightValue;
+ }
+ normalizedLightValue = lightValue / maxLightValue;
+ lightImg.opacity = normalizedLightValue;
+ }
+
+ Image {
+ id: lightMainImg
+
+ source: pathPrefix + "Light/light_base_gauge.png"
+ anchors.top: parent.top
+ anchors.topMargin: 16
+ anchors.left: container.left
+ anchors.leftMargin: 12
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 500
+ }
+ }
+
+ Text {
+ id: lightMainText
+
+ anchors.centerIn: parent
+ color: "white"
+ }
+ }
+
+ Image {
+ id: brightnessImg
+
+ source: pathPrefix + "Light/light_brightness.png"
+ anchors.left: lightMainImg.right
+ anchors.leftMargin: 24
+ anchors.verticalCenter: lightMainImg.verticalCenter
+
+ Behavior on opacity {
+ NumberAnimation {
+ duration: 500
+ }
+ }
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/LocationPage.qml b/tradeshow/iot-sensortag/resources/base/LocationPage.qml
new file mode 100644
index 0000000..e479ce2
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/LocationPage.qml
@@ -0,0 +1,103 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.6
+import QtPositioning 5.5
+import QtLocation 5.6
+
+Rectangle {
+ id: locationMain
+ property string location: "Home"
+ property string address: "Home address"
+
+ Plugin {
+ id: myPlugin
+ name: "osm"
+ //specify plugin parameters as necessary
+ //PluginParameter {...}
+ //PluginParameter {...}
+ //...
+ }
+
+ GeocodeModel {
+ id: addressProvider
+ plugin: myPlugin
+ autoUpdate: false
+ onLocationsChanged: {
+ if (count)
+ locationMain.address = get(0).address.text;
+ else
+ console.log("no matches");
+ }
+ }
+
+ PositionSource {
+ id: positionProvider
+ updateInterval: 1000
+ active: true
+
+ onPositionChanged: {
+ var coord = positionProvider.position.coordinate;
+ addressProvider.query = coord;
+ addressProvider.update();
+ locationMain.location = "Coordinate: N" + coord.latitude + " E" + coord.longitude;
+ console.log(locationMain.location);
+ }
+ }
+ Column {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ Text {
+ text: locationMain.location
+ }
+ Text {
+ text: locationMain.address
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml b/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml
new file mode 100644
index 0000000..0f18f87
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/MagnetometerChart.qml
@@ -0,0 +1,226 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import QtCharts 2.1
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ id: magnetHolderRect
+
+ property int magneticSeriesIndex: 0
+ property int maxNumOfMagnReadings: 24
+
+ readonly property color chartColor: "#15bdff"
+ readonly property string xColor: "green"
+ readonly property string yColor: "purple"
+ readonly property string zColor: "yellow"
+ readonly property color textColor: "white"
+
+ onSensorChanged: if (sensor) sensor.magnetometerMicroTChanged.connect(contentItem.updateMagneticGraph)
+
+ title: qsTr("Magnetometer")
+ rightSide: true
+
+ content: Item {
+ anchors.fill: parent
+
+ function updateMagneticGraph()
+ {
+ magnSeriesX.append(magneticSeriesIndex, sensor.magnetometerMicroT_xAxis);
+ magnSeriesY.append(magneticSeriesIndex, sensor.magnetometerMicroT_yAxis);
+ magnSeriesZ.append(magneticSeriesIndex, sensor.magnetometerMicroT_zAxis);
+
+ if (magneticSeriesIndex >= maxNumOfMagnReadings) {
+ magnSeriesX.remove(magnSeriesX.at(magneticSeriesIndex-maxNumOfMagnReadings));
+ magnSeriesY.remove(magnSeriesY.at(magneticSeriesIndex-maxNumOfMagnReadings));
+ magnSeriesZ.remove(magnSeriesY.at(magneticSeriesIndex-maxNumOfMagnReadings));
+ valueAxisX.min++;
+ valueAxisX.max++;
+ }
+ magneticSeriesIndex++;
+ }
+
+ Text {
+ id: historyLabel
+ text: "MAGNETIC FIELD HISTORY"
+ color: textColor
+ anchors.top: parent.top
+ anchors.topMargin: 16
+ anchors.left: parent.left
+ anchors.leftMargin: chartView.plotArea.x - 40
+ }
+
+ ChartView {
+ id: chartView
+
+ anchors.top: historyLabel.bottom
+ anchors.topMargin: -26
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 8
+ anchors.left: parent.left
+ anchors.leftMargin: -40
+ anchors.right: parent.right
+ anchors.rightMargin: -28
+ antialiasing: true
+ backgroundColor: "transparent"
+ legend.visible: false
+ margins.top: 0
+ margins.right: 0
+
+ // Hide the value axis labels; labels are drawn separately.
+ ValueAxis {
+ id: valueAxisX
+ labelsVisible: false
+ gridVisible: false
+ min: 0
+ max: maxNumOfMagnReadings + 1
+ tickCount: 2
+ color: chartColor
+ }
+
+ ValueAxis {
+ id: valueAxisY
+
+ min: 0
+ max: 1000
+ color: chartColor
+ gridLineColor: "darkgray"
+ labelsVisible: false
+ tickCount: 11
+ }
+
+ Column {
+ id: col
+
+ property int step: (valueAxisY.max - valueAxisY.min) / (valueAxisY.tickCount - 1)
+
+ spacing: -9
+ y: chartView.plotArea.y - 10
+ x: 30
+
+ Repeater {
+ model: valueAxisY.tickCount
+
+ Text {
+ text: valueAxisY.max - index * col.step
+ horizontalAlignment: Text.AlignRight
+ width: 50
+ color: textColor
+ }
+ }
+ }
+
+ SplineSeries {
+ id: magnSeriesX
+ axisX: valueAxisX
+ axisY: valueAxisY
+ width: 1
+ color: xColor
+ name: "Magnet X"
+ }
+ SplineSeries {
+ id: magnSeriesY
+ axisX: valueAxisX
+ axisY: valueAxisY
+ width: 1
+ color: yColor
+ name: "Magnet Y"
+ }
+ SplineSeries {
+ id: magnSeriesZ
+ axisX: valueAxisX
+ axisY: valueAxisY
+ width: 1
+ color: zColor
+ name: "Magnet Z"
+ }
+ }
+
+ Text {
+ text: "µT"
+ anchors.top: xLabelRow.top
+ anchors.right: xLabelRow.left
+ anchors.rightMargin: 8
+ color: textColor
+ width: 20
+ font.pixelSize: 14
+ }
+
+ Row {
+ id: xLabelRow
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 28
+ anchors.left: historyLabel.left
+ anchors.right: parent.right
+
+ Text {
+ id: xLabel
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + xColor + "\">X<br><font color=\"white\">" + (sensor ? sensor.magnetometerMicroT_xAxis : 0)
+ lineHeight: 0.7
+ width: (magnetHolderRect.width - xLabelRow.x) / 3
+ }
+
+ Text {
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + yColor + "\">Y<br><font color=\"white\">" + (sensor ? sensor.magnetometerMicroT_yAxis : 0)
+ lineHeight: 0.7
+ width: xLabel.width
+ }
+
+ Text {
+ horizontalAlignment: Text.AlignHCenter
+ text: "<font color=\"" + zColor + "\">Z<br><font color=\"white\">" + (sensor ? sensor.magnetometerMicroT_zAxis : 0)
+ lineHeight: 0.7
+ width: xLabel.width
+ }
+ }
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/ObjectTemperatureChart.qml b/tradeshow/iot-sensortag/resources/base/ObjectTemperatureChart.qml
new file mode 100644
index 0000000..e0e612e
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/ObjectTemperatureChart.qml
@@ -0,0 +1,125 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.5
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ id: objTempHolderRect
+
+ property real minValue: Number.MAX_VALUE
+ property real maxValue: Number.MIN_VALUE
+ property real value
+
+ function updateTemps(){
+ value = sensor.infraredCelsiusTemperature.toFixed(1);
+ if (minValue > value)
+ minValue = value;
+ if (maxValue < value)
+ maxValue = value;
+ }
+
+ title: qsTr("Object Temperature")
+
+ onSensorChanged: if (sensor) {
+ sensor.infraredCelsiusTemperatureChanged.connect(updateTemps)
+ }
+
+ content: Item {
+ id: container
+
+ anchors.fill: parent
+
+ CircularGauge {
+ id: gauge
+
+ min: 10
+ max: 40
+ value: objTempHolderRect.value
+ anchors.centerIn: parent
+ background: Image {
+ source: pathPrefix + "ObjectTemperature/objTemp_base_circle.png"
+ }
+ foreground: Image {
+ source: pathPrefix + "ObjectTemperature/objTemp_display_obj.png"
+ }
+ }
+
+ Text {
+ text: (minValue !== Number.MAX_VALUE ? minValue : "--") + "\nLowest"
+ lineHeight: 0.7
+ width: 60
+ horizontalAlignment: Text.Center
+ color: "white"
+ anchors.bottom: gauge.bottom
+ anchors.bottomMargin: 24
+ anchors.right: gauge.left
+ anchors.rightMargin: 12
+ }
+
+ Text {
+ text: value
+ color: "white"
+ anchors.centerIn: gauge
+ }
+
+ Text {
+ text: "Highest\n" + (maxValue !== Number.MIN_VALUE ? maxValue : "--")
+ lineHeight: 0.8
+ width: 60
+ horizontalAlignment: Text.Center
+ color: "white"
+ anchors.top: gauge.top
+ anchors.topMargin: 24
+ anchors.left: gauge.right
+ anchors.leftMargin: 12
+ }
+
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/SensorTag.qml b/tradeshow/iot-sensortag/resources/base/SensorTag.qml
new file mode 100644
index 0000000..a8d38d5
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/SensorTag.qml
@@ -0,0 +1,252 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.7
+import Qt3D.Core 2.0
+import Qt3D.Render 2.0
+import Qt3D.Input 2.0
+import Qt3D.Extras 2.0
+import SensorTag.DataProvider 1.0
+
+Entity {
+ id: sceneRoot
+
+ Camera {
+ id: camera
+ projectionType: CameraLens.PerspectiveProjection
+ fieldOfView: 45
+ aspectRatio: 16/9
+ nearPlane : 0.1
+ farPlane : 1000.0
+ position: Qt.vector3d( 1.0, 1.0, 1.0 )
+ upVector: Qt.vector3d( 1.0, -1.0, 1.0 )
+ viewCenter: Qt.vector3d( 0.0, 0.0, 0.0 )
+ }
+
+ OrbitCameraController {
+ camera: camera
+ }
+
+ components: [
+ RenderSettings {
+ activeFrameGraph: ForwardRenderer {
+ clearColor: Qt.rgba(0, 0, 0, 1)
+ camera: camera
+ }
+ },
+ InputSettings { }
+ ]
+
+ Mesh {
+ id: innerTorusMesh
+ source: "3dModel/innerRing.obj"
+ }
+
+// PhongMaterial {
+// id: temperatureLightMaterial
+// ambient: sensor ? sensor.lightIntensityColor : Qt.rgba(0, 0, 0)
+// diffuse: sensor ? sensor.temperatureColor : Qt.rgba(0, 0, 0)
+// }
+
+// TorusMesh {
+// id: innerTorusMesh
+// radius: 5
+// minorRadius: 1
+// rings: 40
+// slices: 10
+// }
+
+ Transform {
+ id: innerTorusTransform
+ rotationX: sensor ? sensor.gyroscopeX_degPerSec : 0
+ scale3D: Qt.vector3d(1, 1, 1)
+// Behavior on rotationX {
+// NumberAnimation {
+// easing.type: Easing.Linear
+// duration: 1000
+// }
+// }
+ }
+
+ SimpleMaterial {
+ id: temperatureLightMaterial
+
+ diffuse: "texture/gyroscopeSmall.jpg"
+ }
+
+// DiffuseMapMaterial {
+// id: temperatureLightMaterial
+
+// diffuse: "qrc:/resources/base/texture/gyroscope.png"
+// ambient: Qt.rgba(1, 1, 1)
+// //diffuse: Qt.rgba(1, 1, 1)
+// }
+
+// Entity {
+// id: innerTorusEntity
+
+// components: [ innerTorusMesh, temperatureLightMaterial, innerTorusTransform ]
+// }
+
+
+ Mesh {
+ id: middleTorusMesh
+ source: "3dModel/centerRing.obj"
+ }
+
+// TorusMesh {
+// id: middleTorusMesh
+// radius: 8
+// minorRadius: 1
+// rings: 40
+// slices: 10
+// }
+
+ Transform {
+ id: middleTorusTransform
+ rotationY: sensor ? sensor.gyroscopeY_degPerSec : 0
+ scale3D: Qt.vector3d(1, 1, 1)
+// Behavior on rotationY {
+// NumberAnimation {
+// easing.type: Easing.Linear
+// duration: 1000
+// }
+// }
+ }
+
+// Entity {
+// id: middleTorusEntity
+
+// components: [ middleTorusMesh,temperatureLightMaterial, middleTorusTransform ]
+// }
+
+ Mesh {
+ id: outerTorusMesh
+ source: "3dModel/outerRing.obj"
+ }
+
+// TorusMesh {
+// id: outerTorusMesh
+// radius: 11
+// minorRadius: 1
+// rings: 40
+// slices: 10
+// }
+
+ Transform {
+ id: outerTorusTransform
+ /* First rotate on X axis, 90-degree rotation over Y will end up with the result we wish to have. */
+ rotationX: sensor ? sensor.gyroscopeZ_degPerSec : 0
+ rotationY: 90
+ scale3D: Qt.vector3d(1, 1, 1)
+// Behavior on rotationX {
+// NumberAnimation {
+// easing.type: Easing.Linear
+// duration: 1000
+// }
+// }
+ }
+
+ Entity {
+ id: outerTorusEntity
+
+ components: [ outerTorusMesh, temperatureLightMaterial, outerTorusTransform ]
+
+ Entity {
+ id: middleTorusEntity
+
+ components: [ middleTorusMesh,temperatureLightMaterial, middleTorusTransform ]
+
+ Entity {
+ id: innerTorusEntity
+
+ components: [ innerTorusMesh, temperatureLightMaterial, innerTorusTransform ]
+ }
+ }
+ }
+
+// TorusMesh {
+// id: scaleDiskMesh
+// radius: 16
+// minorRadius: 2
+// rings: 40
+// slices: 6
+// }
+
+ Mesh {
+ id: scaleDiskMesh
+
+ source: "3dModel/center.obj"
+ }
+
+ Transform {
+ id: scaleDiskTrasform
+ /* First rotate on X axis, 90-degree rotation over Y will end up with the result we wish to have. */
+ rotationY: 70
+ //scale3D: Qt.vector3d(1, 1, 0.1)
+ }
+
+// PhongMaterial {
+// id: scaleDiskMaterial
+// ambient: Qt.rgba(0.2, 0.2, 0.2, 1)
+// diffuse: Qt.rgba(1, 1, 1, 1)
+// shininess: 0.2
+// }
+
+// SimpleMaterial {
+// id: temperatureLightMaterial
+
+// diffuse: "texture/gyroscope.png"
+// }
+
+ Entity {
+ id: scaleDiskEntity
+ components: [ scaleDiskMesh, temperatureLightMaterial, scaleDiskTrasform ]
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml b/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml
new file mode 100644
index 0000000..0e0b94c
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml
@@ -0,0 +1,278 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.7
+import QtCharts 2.1
+import SensorTag.DataProvider 1.0
+
+BaseChart {
+ id: tempHolderRect
+
+ property int temperatureSeriesIndex: 0
+ property int maxNumOfTempReadings: 240
+ property real minimum: 10
+ property real maximum: 40
+
+ property real minValue: Number.MAX_VALUE
+ property real maxValue: Number.MIN_VALUE
+ readonly property real avgValue: (maxValue - minValue) / 2
+ property real value
+
+ readonly property color legendColor: "white"
+ readonly property color chartColor: "#15bdff"
+
+ onSensorChanged: if (sensor) {
+ sensor.barometerCelsiusTemperatureChanged.connect(contentItem.updateTemperatureGraph)
+ }
+
+ title: qsTr("Temperature")
+
+ content: Item {
+ anchors.fill: parent
+
+ function updateTemperatureGraph() {
+ avgTempSeries.append(temperatureSeriesIndex, sensor.barometerCelsiusTemperature);
+
+ if (temperatureSeriesIndex >= maxNumOfTempReadings) {
+ avgTempSeries.remove(avgTempSeries.at(temperatureSeriesIndex-maxNumOfTempReadings));
+ valueAxisX.min++;
+ valueAxisX.max++;
+ }
+ temperatureSeriesIndex++;
+
+ var value = sensor.barometerCelsiusTemperature;
+ if (minValue > value)
+ minValue = value;
+ if (maxValue < value)
+ maxValue = value;
+ }
+
+ Item {
+ id: valueReading
+
+ anchors.right: parent.right
+ anchors.top: chartView.top
+ anchors.topMargin: chartView.plotArea.y - 16
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Text {
+ id: highValue
+
+ text: "Highest\n" + (maxValue !== Number.MIN_VALUE ? maxValue : "--")
+ lineHeight: 0.7
+ width: 60
+ horizontalAlignment: Text.Center
+ anchors.horizontalCenter: reading.horizontalCenter
+ color: "white"
+ }
+
+ Image {
+ id: reading
+
+ source: pathPrefix + "AmbientTemperature/ambTemp_display_amb.png"
+ anchors.top: highValue.bottom
+ anchors.topMargin: 10
+
+ Text {
+ anchors.centerIn: parent
+ text: sensor.barometerCelsiusTemperature
+ color: "white"
+ }
+ }
+
+ Text {
+ text: (minValue !== Number.MAX_VALUE ? minValue : "--") + "\nLowest"
+ lineHeight: 0.8
+ width: 60
+ horizontalAlignment: Text.Center
+ color: "white"
+ anchors.top: reading.bottom
+ anchors.topMargin: 6
+ anchors.horizontalCenter: reading.horizontalCenter
+ }
+
+ Text {
+ text: "Avg\n" + sensor.barometerTemperatureAverage.toFixed(1)
+ lineHeight: 0.8
+ width: 60
+ horizontalAlignment: Text.Center
+ color: "white"
+ anchors.left: reading.right
+ anchors.verticalCenter: reading.verticalCenter
+ }
+ }
+
+ ChartView {
+ id: chartView
+
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: xLegend.height + 8
+ anchors.left: parent.left
+ anchors.leftMargin: -25
+ anchors.right: valueReading.left
+ anchors.rightMargin: -20
+ antialiasing: true
+ backgroundColor: "transparent"
+ legend.visible: false
+ margins.top: 0
+ margins.bottom: 0
+ margins.left: 0
+
+ // Hide the value axis labels; labels are drawn separately.
+ ValueAxis {
+ id: valueAxisX
+
+ labelsVisible: false
+ min: 0
+ max: maxNumOfTempReadings + 1
+ tickCount: 6
+ labelsColor: legendColor
+ color: chartColor
+ gridLineColor: chartColor
+ }
+
+ ValueAxis {
+ id: valueAxisY
+
+ labelsVisible: false
+ min: minimum
+ max: maximum
+ tickCount: 7
+ color: chartColor
+ gridLineColor: chartColor
+ }
+
+ LineSeries {
+ id: avgTempSeries
+
+ axisX: valueAxisX
+ axisY: valueAxisY
+ color: chartColor
+ width: 1
+ useOpenGL: true
+ }
+
+ Column {
+ id: col
+ property int step: (valueAxisY.max - valueAxisY.min) / (valueAxisY.tickCount - 1)
+ spacing: (valueAxisY.tickCount - 0.7) / 2
+ y: chartView.plotArea.y - 10
+ x: 24
+ z: 5
+
+ Repeater {
+ model: valueAxisY.tickCount
+
+ Text {
+ text: valueAxisY.max - index * col.step
+ horizontalAlignment: Text.AlignRight
+ width: 20
+ color: legendColor
+ font: fontMetrics.font
+ }
+ }
+ }
+
+ Row {
+ id: xLegend
+
+ x: chartView.plotArea.x
+ y: chartView.plotArea.y + chartView.plotArea.height + height + 6
+ spacing: (chartView.plotArea.width) / (valueAxisX.tickCount - 0.7) + 1
+
+ Repeater {
+ model: valueAxisX.tickCount
+
+ // Enclosing Text inside Item allows layouting Text correctly on the axis
+ Item {
+ width: 1
+ height: 1
+
+ Text {
+ id: legendText
+
+ text: index
+ color: legendColor
+ anchors.horizontalCenter: parent.horizontalCenter
+ font: fontMetrics.font
+ }
+ }
+ }
+ }
+
+ Text {
+ text: "°C"
+ anchors.top: parent.top
+ anchors.topMargin: chartView.plotArea.y - height - 4
+ anchors.right: col.right
+ color: legendColor
+ font: fontMetrics.font
+ }
+
+ Text {
+ text: "h"
+ anchors.top: xLegend.top
+ x: chartView.plotArea.x + chartView.plotArea.width + 16
+ color: legendColor
+ font: fontMetrics.font
+ }
+ }
+ }
+
+ // Create TextMetrics to allow easy use of the same font in the ChartView
+ TextMetrics {
+ id: fontMetrics
+
+ font.family: "Titillium Web"
+ font.pixelSize: 14
+ text: "m"
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/TopToolbar.qml b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
new file mode 100644
index 0000000..f3e7e2b
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/TopToolbar.qml
@@ -0,0 +1,196 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.0
+import SensorTag.DataProvider 1.0
+import Style 1.0
+
+Item {
+ id: topToolbar
+
+ height: 100
+ width: implicitWidth
+
+ Rectangle {
+ id: sensorList
+
+ property alias listModelCount: list.count
+
+ width: 200
+ height: 200
+ x: sensorItem.x
+ y: parent.height
+ color: "darkgray"
+ visible: false
+
+ ListView {
+ id: list
+ anchors.fill: parent
+ model: dataProviderPool.dataProviders
+ delegate: Text {
+ text: providerId
+ color: modelData.state === SensorTagData.Connected ? "blue" : "lightsteelblue"
+ }
+ }
+ }
+
+ Item {
+ id: cloudItem
+ height: topToolbar.height
+ anchors.top: parent.top
+ anchors.left: parent.left
+ anchors.leftMargin: 8
+ width: icon.width + cloudText.width + 3 * anchors.leftMargin
+ opacity: dataProviderPool.name === "Cloud" || dataProviderPool.name === "Demo" ? 1.0 : 0.0
+
+ Image {
+ id: icon
+ width: 58
+ height: 40
+ anchors.top: parent.top
+ anchors.margins: 8
+ source: pathPrefix + "Toolbar/icon_topbar_cloud.png"
+ }
+
+ Text {
+ id: cloudText
+ color: "white"
+ text: "CLOUD"
+ width: contentWidth
+ font.pixelSize: Style.topToolbarSmallFontSize
+ anchors.verticalCenter: icon.verticalCenter
+ anchors.left: icon.right
+ anchors.margins: 8
+ }
+ }
+
+ Item {
+ id: sensorItem
+ height: topToolbar.height
+ anchors.top: parent.top
+ anchors.left: cloudItem.right
+ Image {
+ id: sensorIcon
+
+ width: 40
+ height: 40
+ anchors.top: parent.top
+ anchors.margins: 8
+ source: pathPrefix + "Toolbar/icon_topbar_sensor.png"
+
+ Text {
+ anchors.centerIn: parent
+ text: sensorList.listModelCount
+ color: "white"
+ font.pixelSize: Style.topToolbarSmallFontSize
+ }
+ }
+
+ Text {
+ id: sensorButton
+
+ color: "white"
+ text: "SENSORS"
+ font.pixelSize: Style.topToolbarSmallFontSize
+ anchors.verticalCenter: sensorIcon.verticalCenter
+ anchors.left: sensorIcon.right
+ anchors.margins: 8
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: sensorList.visible = !sensorList.visible
+ }
+ }
+ }
+
+ Text {
+ text: Qt.formatDateTime(new Date, "dddd, MMMM d, yyyy")
+ color: "white"
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 16
+ anchors.right: timeLabel.left
+ anchors.rightMargin: 16
+ horizontalAlignment: Text.AlignRight
+ font.pixelSize: Style.topToolbarSmallFontSize
+ font.capitalization: Font.AllUppercase
+ }
+
+ Text {
+ id: timeLabel
+ text: Qt.formatTime(new Date, "HH:mm")
+ color: "white"
+ font.pixelSize: Style.topToolbarLargeFontSize
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.bottom: parent.bottom
+ }
+
+ Text {
+ text: "UTC/GMT"
+ color: "white"
+ anchors.left: timeLabel.right
+ anchors.leftMargin: 16
+ anchors.bottom: parent.bottom
+ anchors.bottomMargin: 16
+ font.pixelSize: Style.topToolbarSmallFontSize
+ Component.onCompleted: {
+ var date = new Date
+ var offsetString = -date.getTimezoneOffset() / 60
+ if (offsetString < 0)
+ text = text + "-"
+ else
+ text = text + "+"
+ text = text + offsetString
+ }
+ }
+
+ Image {
+ anchors.bottom: parent.bottom
+ source: pathPrefix + "Toolbar/topbar_all.png"
+ }
+}
diff --git a/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Bold.ttf b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Bold.ttf
new file mode 100755
index 0000000..0af0fe7
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Bold.ttf
Binary files differ
diff --git a/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Regular.ttf b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Regular.ttf
new file mode 100755
index 0000000..6da8219
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-Regular.ttf
Binary files differ
diff --git a/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-SemiBold.ttf b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-SemiBold.ttf
new file mode 100755
index 0000000..dfdcdbe
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/fonts/titilliumweb/TitilliumWeb-SemiBold.ttf
Binary files differ
diff --git a/tradeshow/iot-sensortag/resources/base/main.qml b/tradeshow/iot-sensortag/resources/base/main.qml
new file mode 100644
index 0000000..8f092ba
--- /dev/null
+++ b/tradeshow/iot-sensortag/resources/base/main.qml
@@ -0,0 +1,72 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of Qt for Device Creation.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+import QtQuick 2.6
+import QtQuick.Window 2.0
+import SensorTag.DataProvider 1.0
+
+Window {
+ id: mainWindow
+
+ property alias contentFile: contentLoader.source
+ property DataProviderPool dataProviderPool
+
+ // Size defaults to the small display
+ width: 1920
+ height: 1080
+ visible: true
+ color: "black"
+
+ Loader {
+ id: contentLoader
+
+ anchors.fill: parent
+ anchors.centerIn: parent
+ }
+}