1
0
mirror of git://projects.qi-hardware.com/nanomap.git synced 2024-11-24 08:46:15 +02:00

get direction, speed and altitude from gpsd

This commit is contained in:
Niels 2010-07-21 21:04:58 +02:00
parent 772ed4475a
commit 31392488d2
2 changed files with 12 additions and 0 deletions

View File

@ -60,6 +60,15 @@ void GpsClient::readData()
lat = entry.section(":", 1, 1).toDouble();
} else if (entry.contains("lon")) {
lon = entry.section(":", 1, 1).toDouble();
} else if (entry.contains("alt")) {
qreal alt = entry.section(":", 1, 1).toDouble();
emit altitude(alt);
} else if (entry.contains("track")) {
qreal track = entry.section(":", 1, 1).toDouble();
emit direction(track);
} else if (entry.contains("speed")) {
qreal currentSpeed = entry.section(":", 1, 1).toDouble();
emit speed(currentSpeed);
} else if (entry.contains("mode")) {
// 0: no mode value yet seen
// 1: no fix

View File

@ -36,6 +36,9 @@ public slots:
signals:
void position(const QPointF &pos);
void altitude(qreal alt);
void direction(qreal track);
void speed(qreal speed);
void connected();
void disconnected();