このページでは

QNmeaSatelliteInfoSource Class

QNmeaSatelliteInfoSource クラスは、NMEAデータソースを使用して衛星情報を提供します。詳細...

ヘッダー: #include <QNmeaSatelliteInfoSource>
CMake: find_package(Qt6 REQUIRED COMPONENTS Positioning)
target_link_libraries(mytarget PRIVATE Qt6::Positioning)
qmake: QT += positioning
以下のように: Qt 6.2
継承元: QGeoSatelliteInfoSource

パブリック型

enum class UpdateMode { RealTimeMode, SimulationMode }

パブリック関数

QNmeaSatelliteInfoSource(QNmeaSatelliteInfoSource::UpdateMode mode, QObject *parent = nullptr)
virtual ~QNmeaSatelliteInfoSource() override
QIODevice *device() const
void setDevice(QIODevice *device)
QNmeaSatelliteInfoSource::UpdateMode updateMode() const

再実装されたパブリック関数

virtual QVariant backendProperty(const QString &name) const override
virtual QGeoSatelliteInfoSource::Error error() const override
virtual int minimumUpdateInterval() const override
virtual bool setBackendProperty(const QString &name, const QVariant &value) override
virtual void setUpdateInterval(int msec) override

パブリック・スロット

virtual void requestUpdate(int msec = 0) override
virtual void startUpdates() override
virtual void stopUpdates() override

静的パブリックメンバー

プロテクトされた型

enum SatelliteInfoParseStatus { NotParsed, PartiallyParsed, FullyParsed }

プロテクトされた関数

QNmeaSatelliteInfoSource(const QNmeaSatelliteInfoSource &)
virtual QNmeaSatelliteInfoSource::SatelliteInfoParseStatus parseSatelliteInfoFromNmea(const char *data, int size, QList<QGeoSatelliteInfo> &infos, QGeoSatelliteInfo::SatelliteSystem &system)
virtual QGeoSatelliteInfo::SatelliteSystem parseSatellitesInUseFromNmea(const char *data, int size, QList<int> &pnrsInUse)
QNmeaSatelliteInfoSource &operator=(const QNmeaSatelliteInfoSource &)

詳細な説明

NMEAは、ある時点における自身の全球位置を指定するために広く使用されているプロトコルです。QNmeaSatelliteInfoSource クラスはNMEAデータを読み取り、それを利用して、視野内にある衛星および使用中の衛星に関する情報を、QGeoSatelliteInfo オブジェクトのリストとして提供します。

QNmeaSatelliteInfoSource インスタンスは、RealTimeMode またはSimulationMode のいずれかのモードで動作します。これらのモードにより、NMEA データをライブのデータソースから読み込むか、シミュレーションの目的で以前に記録された NMEA データを再生することができます。

NMEAデータのソースは、setDevice() によって設定されます。

startUpdates() を使用して衛星情報の定期的な更新の受信を開始し、stopUpdates() を使用してこれらの更新を停止します。更新がたまにしか必要ない場合は、requestUpdate() を呼び出して、視野内の衛星と使用中の衛星の両方について、1回の更新を要求することができます。

視野内の衛星に関する情報は、satellitesInViewUpdated() シグナルを介して受信されます。

使用中の衛星に関する情報は、satellitesInUseUpdated ()信号を介して受信されます。

メンバ・タイプのドキュメント

enum QNmeaSatelliteInfoSource::SatelliteInfoParseStatus

衛星情報の構文解析ステータスを定義します。衛星情報は複数の文に分割される場合があり、それらすべてを構文解析する必要があります。

定数値説明
QNmeaSatelliteInfoSource::NotParsed0データに衛星に関する情報が含まれていません。
QNmeaSatelliteInfoSource::PartiallyParsed1有効な衛星情報が受信され、解析されましたが、情報が不完全であるため、別の NMEA 文を待つ必要があります。
QNmeaSatelliteInfoSource::FullyParsed2衛星情報が完全に収集され、解析されました。

enum class QNmeaSatelliteInfoSource::UpdateMode

利用可能な更新モードを定義します。

定数値説明
QNmeaSatelliteInfoSource::UpdateMode::RealTimeMode1衛星情報は、利用可能になり次第、データソースから読み取られ、配信されます。NMEA データのライブソース(GPS ハードウェアデバイスなど)を使用している場合は、このモードを使用してください。
QNmeaSatelliteInfoSource::UpdateMode::SimulationMode2データソースから衛星情報が読み込まれ、指定されたレートで配信されます。レートは、SimulationUpdateInterval パラメータによって決定されます。データソースに以前に記録されたNMEAデータが含まれており、シミュレーションの目的でそのデータを再生したい場合に、このモードを使用してください。

メンバ関数のドキュメント

[explicit] QNmeaSatelliteInfoSource::QNmeaSatelliteInfoSource(QNmeaSatelliteInfoSource::UpdateMode mode, QObject *parent = nullptr)

指定されたparent およびmode を使用して、QNmeaSatelliteInfoSource インスタンスを作成します。

[protected delete] QNmeaSatelliteInfoSource::QNmeaSatelliteInfoSource(const QNmeaSatelliteInfoSource &)

QNmeaSatelliteInfoSource のインスタンスをコピーして生成します。この関数は削除されています。

[override virtual noexcept] QNmeaSatelliteInfoSource::~QNmeaSatelliteInfoSource()

衛星の情報源を破壊する。

[override virtual] QVariant QNmeaSatelliteInfoSource::backendProperty(const QString &name) const

QGeoSatelliteInfoSource::backendProperty(const QString &name) const を再実装します。

setBackendProperty()も参照してください 。

QIODevice *QNmeaSatelliteInfoSource::device() const

NMEA データソースを返します。

setDevice()も参照してください 。

[override virtual] QGeoSatelliteInfoSource::Error QNmeaSatelliteInfoSource::error() const

QGeoSatelliteInfoSource::error() const を再実装します。

[override virtual] int QNmeaSatelliteInfoSource::minimumUpdateInterval() const

プロパティ「QGeoSatelliteInfoSource::minimumUpdateInterval 」のアクセス関数を再実装します。

[virtual protected] QNmeaSatelliteInfoSource::SatelliteInfoParseStatus QNmeaSatelliteInfoSource::parseSatelliteInfoFromNmea(const char *data, int size, QList<QGeoSatelliteInfo> &infos, QGeoSatelliteInfo::SatelliteSystem &system)

NMEA文の文字列を解析し、視野内にある衛星に関する情報を抽出します。

デフォルトの実装では、標準的なNMEA $GPGSVセンテンスを解析します。非標準のNMEAセンテンスを扱う必要が生じた場合は、サブクラスでこのメソッドを再実装する必要があります。

パーサーは、data からsize バイトを読み取り、その情報を使用してinfos リストに値を設定します。

解析結果を含むSatelliteInfoParseStatus を返します。PartiallyParsed またはFullyParsed が返された場合、infos リストを更新します。また、system を正しい衛星システムタイプに設定します。これは、視界内に衛星が存在しない場合にシステムタイプを判定するために必要です。

[virtual protected] QGeoSatelliteInfo::SatelliteSystem QNmeaSatelliteInfoSource::parseSatellitesInUseFromNmea(const char *data, int size, QList<int> &pnrsInUse)

NMEA文の文字列を解析し、使用中の衛星のIDを抽出します。

デフォルトの実装では、標準的なNMEA $GPGSAセンテンスを解析します。非標準のNMEAセンテンスを扱う必要が生じた場合は、サブクラスでこのメソッドを再実装する必要があります。

パーサーは、data からsize バイトを読み取り、その情報を使用してpnrsInUse リストを埋めます。

文の解析に成功した場合は system 型を返し、失敗した場合はQGeoSatelliteInfo::Undefined を返し、pnrsInUse を変更してはなりません。

[override virtual slot] void QNmeaSatelliteInfoSource::requestUpdate(int msec = 0)

QGeoSatelliteInfoSource::requestUpdate (int timeout)を再実装します。

[override virtual] bool QNmeaSatelliteInfoSource::setBackendProperty(const QString &name, const QVariant &value)

QGeoSatelliteInfoSource::setBackendProperty(const QString &name, const QVariant &value) を再実装します。

backendProperty()も参照してください 。

void QNmeaSatelliteInfoSource::setDevice(QIODevice *device)

NMEAデータソースをdevice に設定します。デバイスが開かれていない場合は、ReadOnly モードで開かれます。

データソースとなるデバイスの設定は1回のみ可能であり、startUpdates() またはrequestUpdate() を呼び出す前に設定する必要があります。

注: 読み取り可能なデータが利用可能になった際にソースに通知されるためには、device が QIODevice::readyRead()を発行する必要があります。QNmeaSatelliteInfoSource は デバイスの所有権を取得しないため、破棄時にデバイスを解放することはありません。

device()も参照してください 。

[override virtual] void QNmeaSatelliteInfoSource::setUpdateInterval(int msec)

プロパティ「QGeoSatelliteInfoSource::updateInterval 」のアクセス関数を再実装します。

[override virtual slot] void QNmeaSatelliteInfoSource::startUpdates()

QGeoSatelliteInfoSource::startUpdates() を再実装します。

[override virtual slot] void QNmeaSatelliteInfoSource::stopUpdates()

QGeoSatelliteInfoSource::stopUpdates() を再実装しています。

QNmeaSatelliteInfoSource::UpdateMode QNmeaSatelliteInfoSource::updateMode() const

更新モードを返します。

[protected delete] QNmeaSatelliteInfoSource &QNmeaSatelliteInfoSource::operator=(const QNmeaSatelliteInfoSource &)

other をこのQNmeaSatelliteInfoSource インスタンスにコピー代入します。この関数は削除されました。

メンバ変数のドキュメント

QString QNmeaSatelliteInfoSource::SimulationUpdateInterval

この変数は、SimulationMode におけるデータ読み取りレートのバックエンドプロパティ名を保持します。このプロパティの値は、連続する読み取り操作間の間隔をミリ秒単位で表す整数です。このパラメータは、setBackendProperty() およびbackendProperty() メソッドで使用します。

注:この プロパティは 、setUpdateInterval() を通じて設定できる間隔とは異なります。setUpdateInterval() を通じて設定される値はユーザーへの通知間隔を表すのに対し、このパラメータはソースファイルからデータを読み込む内部的な頻度を指定します。つまり、updateInterval() の実行期間中に、複数回(あるいは0回)の読み取りが行われる可能性があります。

© 2026 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.