diff options
4 files changed, 10 insertions, 6 deletions
diff --git a/tradeshow/iot-sensortag/bluetoothdataprovider.cpp b/tradeshow/iot-sensortag/bluetoothdataprovider.cpp index 8e4f152..4737987 100644 --- a/tradeshow/iot-sensortag/bluetoothdataprovider.cpp +++ b/tradeshow/iot-sensortag/bluetoothdataprovider.cpp @@ -142,9 +142,12 @@ void BluetoothDataProvider::motionReceived(MotionSensorData &data) gyroscopeX_degPerSec = data.gyroScope_x; gyroscopeY_degPerSec = data.gyroScope_y; gyroscopeZ_degPerSec = data.gyroScope_z; + emit gyroscopeDegPerSecChanged(); + rotation_x += countRotationDegrees(data.gyroScope_x, data.msSincePreviousData); rotation_y += countRotationDegrees(data.gyroScope_y, data.msSincePreviousData); rotation_z += countRotationDegrees(data.gyroScope_z, data.msSincePreviousData); + if (rotation_x > 360) rotation_x -= 360; else if (rotation_x < 0) @@ -157,13 +160,13 @@ void BluetoothDataProvider::motionReceived(MotionSensorData &data) rotation_z -= 360; else if (rotation_z < 0) rotation_z += 360; - emit gyroscopeDegPerSecChanged(); emit rotationXChanged(); emit rotationYChanged(); emit rotationZChanged(); // Signal that all values have changed, for easier // value change handling in clients emit rotationValuesChanged(); + accelometer_mG_xAxis = data.accelometer_x; accelometer_mG_yAxis = data.accelometer_y; accelometer_mG_zAxis = data.accelometer_z; diff --git a/tradeshow/iot-sensortag/bluetoothdevice.cpp b/tradeshow/iot-sensortag/bluetoothdevice.cpp index 0e43956..66faf5a 100644 --- a/tradeshow/iot-sensortag/bluetoothdevice.cpp +++ b/tradeshow/iot-sensortag/bluetoothdevice.cpp @@ -309,6 +309,7 @@ void BluetoothDevice::serviceScanDone() connect(motionService, &QLowEnergyService::characteristicRead, this, &BluetoothDevice::characteristicsRead); motionService->discoverDetails(); } + attitudeChangeInterval.restart(); } } diff --git a/tradeshow/iot-sensortag/resources/base/GyroChart.qml b/tradeshow/iot-sensortag/resources/base/GyroChart.qml index 681d218..37ee21f 100644 --- a/tradeshow/iot-sensortag/resources/base/GyroChart.qml +++ b/tradeshow/iot-sensortag/resources/base/GyroChart.qml @@ -195,21 +195,21 @@ BaseChart { Text { id: xLabel horizontalAlignment: Text.AlignHCenter - text: "<font color=\"" + xColor + "\">Roll<br><font color=\"white\">" + (sensor ? sensor.rotationX : 0) + text: "<font color=\"" + xColor + "\">Roll<br><font color=\"white\">" + (sensor ? sensor.rotationX.toFixed(0) : 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) + text: "<font color=\"" + yColor + "\">Pitch<br><font color=\"white\">" + (sensor ? sensor.rotationY.toFixed(0) : 0) lineHeight: 0.7 width: xLabel.width } Text { horizontalAlignment: Text.AlignHCenter - text: "<font color=\"" + zColor + "\">Yaw<br><font color=\"white\">" + (sensor ? sensor.rotationZ : 0) + text: "<font color=\"" + zColor + "\">Yaw<br><font color=\"white\">" + (sensor ? sensor.rotationZ.toFixed(0) : 0) lineHeight: 0.7 width: xLabel.width } diff --git a/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml b/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml index 0e0b94c..d4878a4 100644 --- a/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml +++ b/tradeshow/iot-sensortag/resources/base/TemperatureChart.qml @@ -122,7 +122,7 @@ BaseChart { Text { anchors.centerIn: parent - text: sensor.barometerCelsiusTemperature + text: sensor ? sensor.barometerCelsiusTemperature : "" color: "white" } } @@ -139,7 +139,7 @@ BaseChart { } Text { - text: "Avg\n" + sensor.barometerTemperatureAverage.toFixed(1) + text: "Avg\n" + (sensor ? sensor.barometerTemperatureAverage.toFixed(1) : "") lineHeight: 0.8 width: 60 horizontalAlignment: Text.Center |