mirror of https://github.com/f4exb/sdrangel.git
Fixing course, latitude calculation, latitude character appending
This commit is contained in:
parent
2d397207a6
commit
cd9bf5770e
|
@ -1020,11 +1020,11 @@ bool APRSPacket::parseMicE(QString& info, int& idx, QString& dest)
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
int charInt = charToInt(dest, i);
|
int charInt = charToInt(dest, i);
|
||||||
if (inRange(48, 57, charInt)) {
|
if (inRange(48, 57, charInt)) {
|
||||||
latDigits.append(static_cast<char>(dest[i] % 48));
|
latDigits.append(static_cast<char>(charToInt(dest, i) % 48));
|
||||||
} else if (inRange(65, 74, charInt)) {
|
} else if (inRange(65, 74, charInt)) {
|
||||||
latDigits.append(static_cast<char>(dest[i] % 65));
|
latDigits.append(static_cast<char>(charToInt(dest, i) % 65));
|
||||||
} else if (inRange(80, 89, charInt)) {
|
} else if (inRange(80, 89, charInt)) {
|
||||||
latDigits.append(static_cast<char>(dest[i] % 80));
|
latDigits.append(static_cast<char>(charToInt(dest, i) % 80));
|
||||||
} else {
|
} else {
|
||||||
latDigits.append(' ');
|
latDigits.append(' ');
|
||||||
}
|
}
|
||||||
|
@ -1061,7 +1061,7 @@ bool APRSPacket::parseMicE(QString& info, int& idx, QString& dest)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_latitude = (((float)latDigits.mid(0, 2)) + latDigits.mid(2, 2)/60.00 + latDigits.mid(4, 2)/60.0/100.0) * latitudeDirection;
|
m_latitude = (latDigits.mid(0, 2).toFloat() + latDigits.mid(2, 2).toFloat()/60.00 + latDigits.mid(4, 2).toFloat()/60.0/100.0) * latitudeDirection;
|
||||||
m_hasPosition = true;
|
m_hasPosition = true;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -1107,7 +1107,7 @@ bool APRSPacket::parseMicE(QString& info, int& idx, QString& dest)
|
||||||
float decoded_speed_course = (charToInt(info, idx+4) - 28) / 10;
|
float decoded_speed_course = (charToInt(info, idx+4) - 28) / 10;
|
||||||
speed += floor(decoded_speed_course); // Speed in 1 kt units, added to above
|
speed += floor(decoded_speed_course); // Speed in 1 kt units, added to above
|
||||||
int course = (((charToInt(info, idx+4) - 28) % 10) * 100) % 400;
|
int course = (((charToInt(info, idx+4) - 28) % 10) * 100) % 400;
|
||||||
int course += charToInt(info, idx+5) - 28;
|
course += charToInt(info, idx+5) - 28;
|
||||||
|
|
||||||
m_longitude = (((float)deg) + min/60.00 + hundreths/60.0/100.0) * longitudeDirection;
|
m_longitude = (((float)deg) + min/60.00 + hundreths/60.0/100.0) * longitudeDirection;
|
||||||
m_hasPosition = true;
|
m_hasPosition = true;
|
||||||
|
|
Loading…
Reference in New Issue