qtmobility/plugins/sensors/maemo6/maemo6magnetometer.cpp
changeset 11 06b8e2af4411
parent 8 71781823f776
child 14 6fbed849b4f4
equal deleted inserted replaced
8:71781823f776 11:06b8e2af4411
     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 
    60 
    61         // metadata
    61         // metadata
    62         addDataRate(43, 43); // 43Hz
    62         addDataRate(43, 43); // 43Hz
    63         sensor->setDataRate(43);
    63         sensor->setDataRate(43);
    64         addOutputRange(-0.000614, 0.000614, 0.0000003); // -600 ... 600 mikroteslas, 0.3 uT resolution
    64         addOutputRange(-0.000614, 0.000614, 0.0000003); // -600 ... 600 mikroteslas, 0.3 uT resolution
    65         setDescription(QLatin1String("Magnetic flux density measured in teslas"));
    65         setDescription(QLatin1String("Measures magnetic flux density measured in teslas"));
    66 
    66 
    67         m_initDone = true;
    67         m_initDone = true;
    68     }
    68     }
    69 }
    69 }
    70 
    70 
    80         m_reading.setX( 0.0000003 * data.rx() );
    80         m_reading.setX( 0.0000003 * data.rx() );
    81         m_reading.setY( 0.0000003 * data.ry() );
    81         m_reading.setY( 0.0000003 * data.ry() );
    82         m_reading.setZ( 0.0000003 * data.rz() );
    82         m_reading.setZ( 0.0000003 * data.rz() );
    83         m_reading.setCalibrationLevel(1);
    83         m_reading.setCalibrationLevel(1);
    84     }
    84     }
    85     //m_reading.setTimestamp(data.timestamp());
    85     m_reading.setTimestamp(data.timestamp());
    86     m_reading.setTimestamp(createTimestamp()); //TODO: use correct timestamp
       
    87     newReadingAvailable();
    86     newReadingAvailable();
    88 }
    87 }