diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-10-25 07:27:30 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-10-25 06:05:33 +0000 |
commit | 80dc774b966adf069e84d9777b27886f357a1bb5 (patch) | |
tree | 23600aec6f72053dba96e73410ae48f5f3c35d08 /tradeshow/iot-sensortag/mqttdataprovider.cpp | |
parent | d59d4b183c3484a978f197ad27e2491138775c92 (diff) |
SensorTag: Fix warnings and cleanup
Change-Id: I2caf3353eebed6dfa3153b94ae88d1653ad7805a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tradeshow/iot-sensortag/mqttdataprovider.cpp')
-rw-r--r-- | tradeshow/iot-sensortag/mqttdataprovider.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tradeshow/iot-sensortag/mqttdataprovider.cpp b/tradeshow/iot-sensortag/mqttdataprovider.cpp index 16bc096..17bafa0 100644 --- a/tradeshow/iot-sensortag/mqttdataprovider.cpp +++ b/tradeshow/iot-sensortag/mqttdataprovider.cpp @@ -154,36 +154,36 @@ void MqttDataProvider::parseMessage(const QString &content, const QString &topic double v1, v2, v3; char c; stream >> v1 >> c >> v2 >> c >> v3; - gyroscopeX_degPerSec = v1; - gyroscopeY_degPerSec = v2; - gyroscopeZ_degPerSec = v3; + gyroscopeX_degPerSec = static_cast<float>(v1); + gyroscopeY_degPerSec = static_cast<float>(v2); + gyroscopeZ_degPerSec = static_cast<float>(v3); } else if (msgType == QStringLiteral("accel")) { QString streamContent = content; QTextStream stream(&streamContent); double v1, v2, v3; char c; stream >> v1 >> c >> v2 >> c >> v3; - accelometerX = v1; - accelometerY = v2; - accelometerZ = v3; + accelometerX = static_cast<float>(v1); + accelometerY = static_cast<float>(v2); + accelometerZ = static_cast<float>(v3); } else if (msgType == QStringLiteral("magnet")) { QString streamContent = content; QTextStream stream(&streamContent); double v1, v2, v3; char c; stream >> v1 >> c >> v2 >> c >> v3; - magnetometerMicroT_xAxis = v1; - magnetometerMicroT_yAxis = v2; - magnetometerMicroT_zAxis = v3; + magnetometerMicroT_xAxis = static_cast<float>(v1); + magnetometerMicroT_yAxis = static_cast<float>(v2); + magnetometerMicroT_zAxis = static_cast<float>(v3); } else if (msgType == QStringLiteral("rotation")) { QString streamContent = content; QTextStream stream(&streamContent); double v1, v2, v3; char c; stream >> v1 >> c >> v2 >> c >> v3; - rotation_x = v1; - rotation_y = v2; - rotation_z = v3; + rotation_x = static_cast<float>(v1); + rotation_y = static_cast<float>(v2); + rotation_z = static_cast<float>(v3); } else if (msgType == QStringLiteral("altitude")) { QString streamContent = content; QTextStream stream(&streamContent); |