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 |
静的パブリックメンバ
QString | SimulationUpdateInterval |
保護された型
enum | SatelliteInfoParseStatus { NotParsed, PartiallyParsed, FullyParsed } |
保護された関数
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) |
詳細説明
NMEAは、ある時点での自分の全地球的な位置を指定するためによく使われるプロトコルです。QNmeaSatelliteInfoSource クラスは NMEA データを読み取り、それを使用してQGeoSatelliteInfo オブジェクトのリストの形で、視界にある衛星と使用中の衛星に関する情報を提供します。
QNmeaSatelliteInfoSource インスタンスは、RealTimeMode またはSimulationMode のいずれかで動作します。 これらのモードでは、NMEA データをライブのデータ・ソースから読み込むか、または以前に記録した NMEA データをシミュレーション用に再生します。
NMEA データのソースはsetDevice() で設定します。
定期的な衛星情報更新の受信を開始するにはstartUpdates ()、これらの更新を停止するにはstopUpdates ()を使用します。たまにしか更新を必要としない場合は、requestUpdate ()を呼び出すと、表示中の衛星と使用中の衛星の両方の更新を一度に要求することができます。
表示中の衛星の情報は、satellitesInViewUpdated ()信号で受信する。
使用中の衛星に関する情報は、satellitesInUseUpdated ()シグナルで受け取る。
メンバ型ドキュメント
enum QNmeaSatelliteInfoSource::SatelliteInfoParseStatus
衛星情報の解析状態を定義する。衛星情報は複数のセンテンスに分割されることがあり、それらをすべてパースする必要があります。
定数 | 値 | 説明 |
---|---|---|
QNmeaSatelliteInfoSource::NotParsed | 0 | データに衛星情報が含まれていない。 |
QNmeaSatelliteInfoSource::PartiallyParsed | 1 | 有効な衛星情報が受信され、解析されたが、完全ではないので、別のNMEAセンテンスを待つ必要がある。 |
QNmeaSatelliteInfoSource::FullyParsed | 2 | 衛星情報は完全に収集され、解析された。 |
enum class QNmeaSatelliteInfoSource::UpdateMode
利用可能な更新モードを定義します。
定数 | 値 | 説明 |
---|---|---|
QNmeaSatelliteInfoSource::UpdateMode::RealTimeMode | 1 | 衛星情報は、利用可能になるとデータソースから読み込まれ、配信されます。NMEAデータのライブ・ソース(GPSハードウェア・デバイスなど)を使用している場合は、このモードを使用します。 |
QNmeaSatelliteInfoSource::UpdateMode::SimulationMode | 2 | 衛星情報は、指定されたレートでデータソースから読み込まれ、配信されます。レートはSimulationUpdateInterval パラメータで決定します。データソースに以前に記録されたNMEAデータがあり、シミュレーションのためにデータを再生したい場合は、このモードを使用します。 |
メンバー関数ドキュメント
[explicit]
QNmeaSatelliteInfoSource::QNmeaSatelliteInfoSource(QNmeaSatelliteInfoSource::UpdateMode mode, QObject *parent = nullptr)
与えられたparent とmode で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 リストを埋めます。
文の解析に成功した場合はシステム・タイプを返し、そうでない場合はQGeoSatelliteInfo::Undefined を返し、pnrsInUse を変更すべきではありません。
[override virtual slot]
void QNmeaSatelliteInfoSource::requestUpdate(int msec = 0)
再インプリメント:QGeoSatelliteInfoSource::requestUpdate(intタイムアウト)。
[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
更新モードを返します。
メンバ変数の説明
QString QNmeaSatelliteInfoSource::SimulationUpdateInterval
この変数は、SimulationMode のデータ読み取り速度のバックエンド・プロパティ名を保持する。 このプロパティの値は、後続の読み取り間のミリ秒数を表す整数値である。このパラメータは、setBackendProperty() およびbackendProperty() メソッドで使用します。
注意: このプロパティは、setUpdateInterval() で設定できる間隔とは異なります。setUpdateInterval() で設定される値は、ユーザ通知用の間隔を表し、このパラメータは、ソース・ ファイルからデータを読み取る内部的な頻度を指定します。つまり、updateInterval()期間中に複数回(または1回も)読み取りを行うことができる。
© 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.