qtmobility/plugins/sensors/maemo6/maemo6rotationsensor.cpp
changeset 8 71781823f776
parent 5 453da2cfceef
child 11 06b8e2af4411
equal deleted inserted replaced
5:453da2cfceef 8:71781823f776
    57         if (m_sensorInterface)
    57         if (m_sensorInterface)
    58             QObject::connect(static_cast<RotationSensorChannelInterface*>(m_sensorInterface), SIGNAL(dataAvailable(const XYZ&)), this, SLOT(slotDataAvailable(const XYZ&)));
    58             QObject::connect(static_cast<RotationSensorChannelInterface*>(m_sensorInterface), SIGNAL(dataAvailable(const XYZ&)), this, SLOT(slotDataAvailable(const XYZ&)));
    59         else
    59         else
    60             qWarning() << "Unable to initialize rotation sensor.";
    60             qWarning() << "Unable to initialize rotation sensor.";
    61 
    61 
       
    62         // metadata
       
    63         addDataRate(23, 23); // 23Hz
       
    64         sensor->setDataRate(23);
       
    65         addOutputRange(-180, 180, 1);
    62         setDescription(QLatin1String("Measures x, y, and z axes rotation"));
    66         setDescription(QLatin1String("Measures x, y, and z axes rotation"));
    63 
    67 
    64         m_initDone = true;
    68         m_initDone = true;
    65     }
    69     }
    66     sensor->setProperty("hasZ", true);
    70     sensor->setProperty("hasZ", true);
    73     m_reading.setZ(data.z());
    77     m_reading.setZ(data.z());
    74     //m_reading.setTimestamp(data.timestamp());
    78     //m_reading.setTimestamp(data.timestamp());
    75     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
    79     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
    76     newReadingAvailable();
    80     newReadingAvailable();
    77 }
    81 }
    78