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 } |
보호된 함수
| 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()를 호출하여 현재 가시 범위 내의 위성과 사용 중인 위성에 대한 단일 업데이트를 요청할 수 있습니다.
시야 내 위성에 대한 정보는 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 ` 인스턴스를 생성합니다.
[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 모드로 열립니다.
데이터 소스 장치는 한 번만 설정할 수 있으며, 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() 기간 동안 여러 번(또는 한 번도) 읽기가 발생할 수 있습니다.
© 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.