equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the Qt Mobility Components. |
7 ** This file is part of the Qt Mobility Components. |
8 ** |
8 ** |
60 qWarning() << "Unable to initialize rotation sensor."; |
60 qWarning() << "Unable to initialize rotation sensor."; |
61 |
61 |
62 // metadata |
62 // metadata |
63 addDataRate(23, 23); // 23Hz |
63 addDataRate(23, 23); // 23Hz |
64 sensor->setDataRate(23); |
64 sensor->setDataRate(23); |
65 addOutputRange(-180, 180, 1); |
65 addOutputRange(-179, 180, 1); |
66 setDescription(QLatin1String("Measures x, y, and z axes rotation")); |
66 setDescription(QLatin1String("Measures x, y, and z axes rotation in degrees")); |
67 |
67 |
68 m_initDone = true; |
68 m_initDone = true; |
69 } |
69 } |
70 sensor->setProperty("hasZ", true); |
70 sensor->setProperty("hasZ", true); |
71 } |
71 } |
73 void maemo6rotationsensor::slotDataAvailable(const XYZ& data) |
73 void maemo6rotationsensor::slotDataAvailable(const XYZ& data) |
74 { |
74 { |
75 m_reading.setX(data.x()); |
75 m_reading.setX(data.x()); |
76 m_reading.setY(data.y()); |
76 m_reading.setY(data.y()); |
77 m_reading.setZ(data.z()); |
77 m_reading.setZ(data.z()); |
78 //m_reading.setTimestamp(data.timestamp()); |
78 m_reading.setTimestamp(data.XYZData().timestamp_); |
79 m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp |
|
80 newReadingAvailable(); |
79 newReadingAvailable(); |
81 } |
80 } |