summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@qt.io>2017-02-09 12:04:11 +0200
committerKari Hautamäki <kari.hautamaki@qt.io>2017-02-09 12:53:22 +0000
commit4126977c5a683475335df289c088c11439afa548 (patch)
tree5bdd37a28b3eaa1539e07d7eb064d67ef997ad9d
parent5a3616a091224bed3a96f8442ed2e30d08a7493d (diff)
iot-sensortag: Make central gyro visible always and calibratable
Central gyro page is visible always. It is also possible to recalibrate the gyro sensor by clicking the GyroChart. Change-Id: I9805411e03d49571b9e392bcd77a9469aef153a0 Reviewed-by: Kari Hautamäki <kari.hautamaki@qt.io>
-rw-r--r--tradeshow/iot-sensortag/resources/base/GyroChart.qml5
-rw-r--r--tradeshow/iot-sensortag/resources/small/MainSmall.qml25
2 files changed, 11 insertions, 19 deletions
diff --git a/tradeshow/iot-sensortag/resources/base/GyroChart.qml b/tradeshow/iot-sensortag/resources/base/GyroChart.qml
index e14bc62..3faf879 100644
--- a/tradeshow/iot-sensortag/resources/base/GyroChart.qml
+++ b/tradeshow/iot-sensortag/resources/base/GyroChart.qml
@@ -70,6 +70,11 @@ BaseChart {
}
}
+ onClicked: {
+ if (sensor)
+ sensor.recalibrate();
+ }
+
title: qsTr("Gyroscope")
rightSide: true
diff --git a/tradeshow/iot-sensortag/resources/small/MainSmall.qml b/tradeshow/iot-sensortag/resources/small/MainSmall.qml
index f3d49a8..377acd1 100644
--- a/tradeshow/iot-sensortag/resources/small/MainSmall.qml
+++ b/tradeshow/iot-sensortag/resources/small/MainSmall.qml
@@ -144,24 +144,6 @@ Item {
width: rightPane.width
height: rightPane.height * 0.3 - 60
- onClicked: {
- mainContainer.source = "../base/RotationPage.qml";
- gyroConnection.enabled = true;
- sensor.recalibrate();
- }
-
- Connections {
- id: gyroConnection
-
- target: mainContainer
- enabled: false
- onStatusChanged: {
- if (status == Loader.Ready) {
- mainContainer.item.sensor = rotation.sensor;
- gyroConnection.enabled = false;
- }
- }
- }
}
AccelChart {
@@ -172,7 +154,7 @@ Item {
}
}
- Loader {
+ RotationPage {
id: mainContainer
anchors.top: topToolbar.bottom
@@ -181,6 +163,11 @@ Item {
anchors.right: rightPane.left
anchors.rightMargin: 32
anchors.bottom: parent.bottom
+
+ Component.onCompleted: {
+ sensor = rotation.sensor;
+ sensor.recalibrate();
+ }
}