mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2024-11-24 08:39:21 +02:00
get direction, speed and altitude from gpsd
This commit is contained in:
parent
772ed4475a
commit
31392488d2
@ -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
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user