QMagnetometerReading Class

QMagnetometerReading クラスは、磁力計からの 1 つの読み取り値を表します。詳細...

ヘッダー #include <QMagnetometerReading>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
継承: QSensorReading

プロパティ

パブリック機能

qreal calibrationLevel() const
void setCalibrationLevel(qreal calibrationLevel)
void setX(qreal x)
void setY(qreal y)
void setZ(qreal z)
qreal x() const
qreal y() const
qreal z() const

詳細説明

QMagnetometerReading 単位

磁力計は3軸の磁束密度の値を返します。値のスケールはテスラです。軸は以下のように配置されています。

磁力計は、生の磁束値または地磁気磁束値のいずれかを報告できます。デフォルトでは、生の磁束値を返します。地磁気フラックス値を返すには、QMagnetometer::returnGeoValues プロパティを設定する必要があります。

生の磁束値と地磁気値の主な違いは、地磁気値から局所的な磁気の干渉を除去するための特別な処理が行われるため、地球の磁場の影響のみを表すことになります。この処理は完全ではなく、各測定値の精度は変化する可能性があります。

下の画像は、磁気干渉を受けている携帯電話の地磁気(左)と生の読み取り値(右)の違いを示しています。

各測定値の精度は、0から1までの数値で測定されます。1の値はデバイスがサポートできる最高レベルで、0は最低レベルです。

キャリブレーション

装置が低い精度を報告している場合、許容可能な測定値を提供する前に校正が必要な場合があります。基本的な較正は、通常、デバイスを8の字に回転させるか、またはデバイスを3つの軸に沿ってそれぞれ回転させることによって行うことができます。詳細については、磁気センサーの較正方法に関するデバイスのマニュアルを確認してください。

プロパティ・ドキュメント

[read-only] calibrationLevel : const qreal

このプロパティは、読み取り精度を保持する。

0 から 1 までの値で測定され、値が高いほど優れている。

これは地磁気磁束密度を測定するときのみ変化することに注意してください。生の磁束の読み取り値は常に 1 です。

アクセス関数:

qreal calibrationLevel() const

QMagnetometerReading Units およびCalibrationも参照のこと

[read-only] x : const qreal

このプロパティは、X 軸の生の磁束密度を保持する。

テスラとして測定される。

アクセス関数:

qreal x() const

QMagnetometerReading Unitsも参照

[read-only] y : const qreal

このプロパティは、Y 軸の生の磁束密度を保持する。

テスラとして測定される。

アクセス関数:

qreal y() const

QMagnetometerReading Unitsも参照

[read-only] z : const qreal

このプロパティは、Z 軸の生の磁束密度を保持する。

テスラとして測定される。

アクセス関数:

qreal z() const

QMagnetometerReading Unitsも参照

メンバ関数ドキュメント

void QMagnetometerReading::setCalibrationLevel(qreal calibrationLevel)

読み取り精度をcalibrationLevel に設定する。

calibrationLevel()も参照のこと

void QMagnetometerReading::setX(qreal x)

X 軸の生の磁束密度をx に設定する。

x()も参照

void QMagnetometerReading::setY(qreal y)

Y 軸の生の磁束密度をy に設定する。

y()も参照

void QMagnetometerReading::setZ(qreal z)

Z 軸の生の磁束密度をz に設定する。

z()も参照

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.