summaryrefslogtreecommitdiffstats
path: root/tradeshow/iot-sensortag/resources
diff options
context:
space:
mode:
Diffstat (limited to 'tradeshow/iot-sensortag/resources')
-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();
+ }
}