summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/resources/base/AccelChart.qml
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@qt.io>2017-02-21 13:03:54 +0200
committerMaurice Kalinowski <maurice.kalinowski@qt.io>2017-02-22 10:31:51 +0000
commit1bcaaef7d3a30a7bad37b717d0fcad4ba8a27e95 (patch)
tree16a77fb2311c154a84f80b16bf565687b06069c8 /tradeshow/iot-sensortag/resources/base/AccelChart.qml
parenta7f7d382d83bc7e28c770bfeb010a3e8ef43b375 (diff)
iot-sensortag: Clean up onSensorChanged signal handlers
Removed onSensorChanged signal handlers from charts as they are not needed. Instead, react to changes of sensor properties. Change-Id: Ib848d3ddfeed550538d35793b24eeb137a57a171 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/resources/base/AccelChart.qml')
-rw-r--r--tradeshow/iot-sensortag/resources/base/AccelChart.qml16
1 files changed, 3 insertions, 13 deletions
diff --git a/tradeshow/iot-sensortag/resources/base/AccelChart.qml b/tradeshow/iot-sensortag/resources/base/AccelChart.qml
index 92f8b50..10a7758 100644
--- a/tradeshow/iot-sensortag/resources/base/AccelChart.qml
+++ b/tradeshow/iot-sensortag/resources/base/AccelChart.qml
@@ -52,27 +52,17 @@ import SensorTag.DataProvider 1.0
BaseChart {
- property real acceXValue
- property real acceYValue
- property real acceZValue
+ property real acceXValue: sensor ? sensor.accelometer_xAxis.toFixed(1) : 0
+ property real acceYValue: sensor ? sensor.accelometer_yAxis.toFixed(1) : 0
+ property real acceZValue: sensor ? sensor.accelometer_zAxis.toFixed(1) : 0
antialiasing: true
title: qsTr("Accelometer")
rightSide: true
- onSensorChanged: if (sensor) {
- sensor.accelometerChanged.connect(contentItem.updateAcceValues)
- }
-
content: Item {
anchors.fill: parent
- function updateAcceValues() {
- acceXValue = sensor.accelometer_xAxis.toFixed(1)
- acceYValue = sensor.accelometer_yAxis.toFixed(1)
- acceZValue = sensor.accelometer_zAxis.toFixed(1)
- }
-
Row {
id: itemRow
anchors.fill: parent