mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2025-02-17 18:44:43 +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();
|
lat = entry.section(":", 1, 1).toDouble();
|
||||||
} else if (entry.contains("lon")) {
|
} else if (entry.contains("lon")) {
|
||||||
lon = entry.section(":", 1, 1).toDouble();
|
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")) {
|
} else if (entry.contains("mode")) {
|
||||||
// 0: no mode value yet seen
|
// 0: no mode value yet seen
|
||||||
// 1: no fix
|
// 1: no fix
|
||||||
|
@ -36,6 +36,9 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void position(const QPointF &pos);
|
void position(const QPointF &pos);
|
||||||
|
void altitude(qreal alt);
|
||||||
|
void direction(qreal track);
|
||||||
|
void speed(qreal speed);
|
||||||
void connected();
|
void connected();
|
||||||
void disconnected();
|
void disconnected();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user