From c005c4b09d9746f29d6d2e0bc9d10eeddea469f9 Mon Sep 17 00:00:00 2001 From: Toni Jussila Date: Thu, 18 Mar 2010 14:09:16 +0200 Subject: [PATCH] GPS time, latitude and longitude added to route view. --- Client/carmainwindow.cpp | 12 ++++++++ Client/carmainwindow.h | 3 ++ Client/carmainwindow.ui | 77 ++++++++++++++++++++++++++++++++++++---------- 3 files changed, 76 insertions(+), 16 deletions(-) diff --git a/Client/carmainwindow.cpp b/Client/carmainwindow.cpp index 354e403..d1249eb 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; @@ -103,6 +104,8 @@ CarMainWindow::~CarMainWindow() myRoute = NULL; delete gpsData; gpsData = NULL; + delete gpsTime; + gpsTime = NULL; } /** @@ -763,7 +766,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 -- 1.7.9.5