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 }

보호된 함수

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

위성 정보의 구문 분석 상태를 정의합니다. 위성 정보는 여러 문장으로 분할될 수 있으며, 이를 모두 구문 분석해야 합니다.

Constant설명
QNmeaSatelliteInfoSource::NotParsed0데이터에 위성에 대한 정보가 포함되어 있지 않습니다.
QNmeaSatelliteInfoSource::PartiallyParsed1유효한 위성 정보가 수신되어 구문 분석되었지만 완전하지 않으므로 다른 NMEA 문장을 기다려야 합니다.
QNmeaSatelliteInfoSource::FullyParsed2위성 정보가 완전히 수집 및 구문 분석되었습니다.

enum class QNmeaSatelliteInfoSource::UpdateMode

사용 가능한 업데이트 모드를 정의합니다.

Constant설명
QNmeaSatelliteInfoSource::UpdateMode::RealTimeMode1위성 정보가 사용 가능해지면 데이터 소스에서 위성 정보를 읽고 배포합니다. NMEA 데이터의 라이브 소스(예: GPS 하드웨어 장치)를 사용하는 경우 이 모드를 사용합니다.
QNmeaSatelliteInfoSource::UpdateMode::SimulationMode2위성 정보는 지정된 속도로 데이터 소스에서 읽고 배포됩니다. 속도는 SimulationUpdateInterval 매개변수에 의해 결정됩니다. 데이터 소스에 이전에 기록된 NMEA 데이터가 포함되어 있고 시뮬레이션 목적으로 데이터를 재생하려는 경우 이 모드를 사용합니다.

멤버 함수 문서

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

주어진 parentmodeQNmeaSatelliteInfoSource 인스턴스를 생성합니다.

[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 모드로 열립니다.

소스 장치는 한 번만 설정할 수 있으며 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() 기간 동안 여러 번(또는 전혀) 읽을 수 있습니다.

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