From: Toni Jussila Date: Thu, 18 Mar 2010 12:10:00 +0000 (+0200) Subject: Merge branch 'development/GPS' X-Git-Tag: v0.1~26 X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=f66af8d6fa2a29704224b8fc1abf759fe8dd7ae1;hp=0c0a99608a4887eb4af4defa6b0edfd439baa148 Merge branch 'development/GPS' --- diff --git a/Client/carmainwindow.cpp b/Client/carmainwindow.cpp index 4218139..68ecd57 100644 --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@ -46,6 +46,7 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca location = new Maemo5Location(this); gpsData = new GPSData(location); connect(location,SIGNAL(agnss()),this,SLOT(gpsStatus())); + gpsTime = new QDateTime(); time = 0; speed = 0; @@ -102,6 +103,8 @@ CarMainWindow::~CarMainWindow() myRoute = NULL; delete gpsData; gpsData = NULL; + delete gpsTime; + gpsTime = NULL; } /** @@ -758,7 +761,16 @@ void CarMainWindow::gpsStatus() { if (location->getSatellitesInUse() >= 4) { + //Set status ui->labelRouteTabGPSStatus->setText("GPS ready"); + + //Set time + gpsTime->setTime_t(location->getTime()); + ui->labelRouteTabGPSTime->setText(gpsTime->toString()); + + //Set latitude & longitude + ui->labelRouteTabLatitude->setText("Lat: " + QString::number(location->getLatitude())); + ui->labelRouteTabLongitude->setText("Lon: " + QString::number(location->getLongitude())); } else diff --git a/Client/carmainwindow.h b/Client/carmainwindow.h index e55c914..9d8f573 100644 --- a/Client/carmainwindow.h +++ b/Client/carmainwindow.h @@ -27,6 +27,7 @@ #include #include #include +#include #include "resultdialog.h" //#include "measuredialog.h" #include "welcomedialog.h" @@ -120,6 +121,8 @@ private: QString horsepower; QString totalTime; + QDateTime *gpsTime; + signals: void speedAchieved(); void userNameChanged(); diff --git a/Client/carmainwindow.ui b/Client/carmainwindow.ui index 6267d20..184f91f 100644 --- a/Client/carmainwindow.ui +++ b/Client/carmainwindow.ui @@ -467,25 +467,47 @@ - 20 + 10 20 - 94 - 22 + 201 + 41 + + + Bitstream Charter + 16 + 75 + true + + GPS on + + + 16 + 16 + + - 30 + 10 76 - 151 - 51 + 201 + 61 + + + Bitstream Charter + 16 + 75 + true + + Start recording @@ -493,12 +515,20 @@ - 30 - 150 - 151 - 51 + 10 + 160 + 201 + 61 + + + Bitstream Charter + 16 + 75 + true + + Stop recording @@ -506,22 +536,30 @@ - 30 - 220 - 151 - 51 + 10 + 250 + 201 + 61 + + + Bitstream Charter + 16 + 75 + true + + Draw route - + 310 16 - 221 + 451 211 @@ -534,6 +572,13 @@ + + + Label GPS Time + + + + Label Latitude