23 double min = 100.0 * modf(nmeaDegrees / 100.0, °);
24 return deg + (min / 60.0);
33 if (hasFix && parts.
size() > 6 && !parts[6].
isEmpty())
34 *hasFix = parts[6].toInt() > 0;
42 if (parts.
size() > 5 && parts[3].
size() == 1 && parts[5].
size() == 1) {
46 coord.setLatitude(lat);
47 coord.setLongitude(lng);
53 double hdop = parts[8].toDouble(&hasHdop);
60 double alt = parts[9].toDouble(&hasAlt);
62 coord.setAltitude(alt);
74 if (hasFix && parts.
size() > 2 && !parts[2].
isEmpty())
75 *hasFix = parts[2].toInt() > 0;
79 double hdop = parts[16].toDouble(&hasHdop);
86 double vdop = parts[17].toDouble(&hasVdop);
96 if (parts.
size() <= 2)
103 int pnr = pnrString.
toInt(&
ok);
114 if (hasFix && parts.
size() > 6 && !parts[6].
isEmpty())
115 *hasFix = (parts[6][0] ==
'A');
123 if (parts.
size() > 4 && parts[2].
size() == 1 && parts[4].
size() == 1) {
127 coord.setLatitude(lat);
128 coord.setLongitude(lng);
143 if (hasFix && parts.
size() > 2 && !parts[2].
isEmpty())
144 *hasFix = (parts[2][0] ==
'A');
146 if (parts.
size() > 9 && parts[9].
size() == 6) {
155 if (parts.
size() > 6 && parts[4].
size() == 1 && parts[6].
size() == 1) {
159 coord.setLatitude(lat);
160 coord.setLongitude(lng);
167 value = parts[7].toDouble(&parsed);
172 value = parts[8].toDouble(&parsed);
176 if (parts.
size() > 11 && parts[11].
size() == 1
177 && (parts[11][0] ==
'E' || parts[11][0] ==
'W')) {
178 value = parts[10].toDouble(&parsed);
180 if (parts[11][0] ==
'W')
202 value = parts[1].toDouble(&parsed);
207 value = parts[7].toDouble(&parsed);
226 && parts[4].
size() == 4) {
227 int day = parts[2].toInt();
228 int month = parts[3].toInt();
229 int year = parts[4].toInt();
230 if (day > 0 && month > 0 && year > 0)
244 if (
key.startsWith(
"GGA"))
247 if (
key.startsWith(
"GSA"))
250 if (
key.startsWith(
"GSV"))
253 if (
key.startsWith(
"GLL"))
256 if (
key.startsWith(
"RMC"))
259 if (
key.startsWith(
"VTG"))
262 if (
key.startsWith(
"ZDA"))
276 if (
key.startsWith(
"GP"))
280 if (
key.startsWith(
"GL"))
284 if (
key.startsWith(
"GA"))
288 if (
key.startsWith(
"BD") ||
key.startsWith(
"GB"))
292 if (
key.startsWith(
"GQ") ||
key.startsWith(
"PQ") ||
key.startsWith(
"QZ"))
296 if (
key.startsWith(
"GN"))
304 if (satId >= 1 && satId <= 32)
307 if (satId >= 65 && satId <= 96)
310 if (satId >= 193 && satId <= 200)
313 if ((satId >= 201 && satId <= 235) || (satId >= 401 && satId <= 437))
316 if (satId >= 301 && satId <= 336)
323 double uere,
bool *hasFix)
384 if (parts.
size() <= 3) {
389 const int totalSentences = parts.
at(1).toInt(&
ok);
395 const int sentence = parts.
at(2).toInt(&
ok);
401 const int totalSats = parts.
at(3).toInt(&
ok);
410 const int numSatInSentence =
qMin(sentence * 4, totalSats) - (sentence - 1) * 4;
411 if (parts.
size() < (4 + numSatInSentence * 4)) {
417 for (
int i = 0;
i < numSatInSentence; ++
i) {
419 info.setSatelliteSystem(system);
420 int prn = parts.
at(field++).toInt(&
ok);
434 info.setSatelliteIdentifier((
ok) ? prn : 0);
435 const int elevation = parts.
at(field++).toInt(&
ok);
437 const int azimuth = parts.
at(field++).toInt(&
ok);
439 const int snr = parts.
at(field++).toInt(&
ok);
440 info.setSignalStrength((
ok) ? snr : -1);
444 if (sentence == totalSentences)
484 std::for_each(pnrsInUse.
begin(), pnrsInUse.
end(), [](
int &
id) {
496 systemType = tempSystemType;
507 if (asteriskIndex < 0 || asteriskIndex >= bv.
size() - CSUM_LEN)
542 if ((latDirection !=
'N' && latDirection !=
'S')
543 || (lngDirection !=
'E' && lngDirection !=
'W')) {
548 bool hasLong =
false;
549 double tempLat = latString.
toDouble(&hasLat);
550 double tempLng = lngString.
toDouble(&hasLong);
551 if (hasLat && hasLong) {
553 if (latDirection ==
'S')
556 if (lngDirection ==
'W')
int toInt(bool *ok=nullptr, int base=10) const
constexpr QByteArrayView sliced(qsizetype pos) const
constexpr QByteArrayView first(qsizetype n) const
constexpr bool isEmpty() const noexcept
constexpr qsizetype size() const noexcept
constexpr const_pointer data() const noexcept
qsizetype indexOf(QByteArrayView a, qsizetype from=0) const noexcept
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
int toInt(bool *ok=nullptr, int base=10) const
Returns the byte array converted to an int using base base, which is ten by default.
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays.
double toDouble(bool *ok=nullptr) const
Returns the byte array converted to a double value.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray fromRawData(const char *data, qsizetype size)
Constructs a QByteArray that uses the first size bytes of the data array.
\inmodule QtCore\reentrant
\inmodule QtCore \reentrant
constexpr bool isValid() const
Returns true if this date is valid; otherwise returns false.
QDate addYears(int years) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool setDate(int year, int month, int day)
SatelliteSystem
Defines the GNSS system of the satellite.
qsizetype size() const noexcept
bool isEmpty() const noexcept
const_reference at(qsizetype i) const noexcept
void append(parameter_type t)
static QGeoSatelliteInfo::SatelliteSystem getSatInUseFromNmea(QByteArrayView bv, QList< int > &pnrsInUse)
static bool isValidLong(double lng)
static bool getNmeaLatLong(const QByteArray &latString, char latDirection, const QByteArray &lngString, char lngDirection, double *lat, double *lon)
static bool isValidLat(double lat)
static QNmeaSatelliteInfoSource::SatelliteInfoParseStatus getSatInfoFromNmea(QByteArrayView bv, QList< QGeoSatelliteInfo > &infos, QGeoSatelliteInfo::SatelliteSystem &system)
static QGeoSatelliteInfo::SatelliteSystem getSatelliteSystemBySatelliteId(int satId)
static bool getNmeaTime(const QByteArray &bytes, QTime *time)
static QGeoSatelliteInfo::SatelliteSystem getSatelliteSystem(QByteArrayView bv)
static bool hasValidNmeaChecksum(QByteArrayView bv)
static NmeaSentence getNmeaSentenceType(QByteArrayView bv)
static bool getPosInfoFromNmea(QByteArrayView bv, QGeoPositionInfo *info, double uere, bool *hasFix=nullptr)
SatelliteInfoParseStatus
Defines the parse status of satellite information.
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
\inmodule QtCore \reentrant
bool isValid() const
Returns true if the time is valid; otherwise returns false.
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
static quint32 checksum(const QByteArray &table)
static QT_BEGIN_NAMESPACE double qlocationutils_nmeaDegreesToDecimal(double nmeaDegrees)
static void qlocationutils_readZda(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readVtg(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readRmc(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readGll(QByteArrayView bv, QGeoPositionInfo *info, bool *hasFix)
static void qlocationutils_readGga(QByteArrayView bv, QGeoPositionInfo *info, double uere, bool *hasFix)
static void qlocationutils_readGsa(QByteArrayView bv, QGeoPositionInfo *info, double uere, bool *hasFix)
constexpr const T & qMin(const T &a, const T &b)
static void split(QT_FT_Vector *b)
#define QStringLiteral(str)
QFileInfo info(fileName)
[8]