Exemplo n.º 1
0
void QmlCompassReading::readingUpdate()
{
    qreal azm = m_sensor->reading()->azimuth();
    if (m_azimuth != azm) {
        m_azimuth = azm;
        Q_EMIT azimuthChanged();
    }
    qreal calLevel = m_sensor->reading()->calibrationLevel();
    if (m_calibrationLevel != calLevel) {
        m_calibrationLevel = calLevel;
        Q_EMIT calibrationLevelChanged();
    }
}
void QmlMagnetometerReading::readingUpdate()
{
    qreal magX = m_sensor->reading()->x();
    if (m_x != magX) {
        m_x = magX;
        Q_EMIT xChanged();
    }
    qreal magY = m_sensor->reading()->y();
    if (m_y != magY) {
        m_y = magY;
        Q_EMIT yChanged();
    }
    qreal magZ = m_sensor->reading()->z();
    if (m_z != magZ) {
        m_z = magZ;
        Q_EMIT zChanged();
    }
    qreal calLevel = m_sensor->reading()->calibrationLevel();
    if (m_calibrationLevel != calLevel) {
        m_calibrationLevel = calLevel;
        Q_EMIT calibrationLevelChanged();
    }
}