GPS time, latitude and longitude added to route view.
authorToni Jussila <toni.jussila@fudeco.com>
Thu, 18 Mar 2010 12:09:16 +0000 (14:09 +0200)
committerToni Jussila <toni.jussila@fudeco.com>
Thu, 18 Mar 2010 12:09:16 +0000 (14:09 +0200)
Client/carmainwindow.cpp
Client/carmainwindow.h
Client/carmainwindow.ui

index 354e403..d1249eb 100644 (file)
@@ -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
index e55c914..9d8f573 100644 (file)
@@ -27,6 +27,7 @@
 #include <QBuffer>
 #include <QByteArray>
 #include <QDebug>
+#include <qdatetime.h>
 #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();
index 6267d20..184f91f 100644 (file)
      <widget class="QCheckBox" name="gpsOnCheckBox">
       <property name="geometry">
        <rect>
-        <x>20</x>
+        <x>10</x>
         <y>20</y>
-        <width>94</width>
-        <height>22</height>
+        <width>201</width>
+        <height>41</height>
        </rect>
       </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>16</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
       <property name="text">
        <string>GPS on</string>
       </property>
+      <property name="iconSize">
+       <size>
+        <width>16</width>
+        <height>16</height>
+       </size>
+      </property>
      </widget>
      <widget class="QPushButton" name="startRecPushButton">
       <property name="geometry">
        <rect>
-        <x>30</x>
+        <x>10</x>
         <y>76</y>
-        <width>151</width>
-        <height>51</height>
+        <width>201</width>
+        <height>61</height>
        </rect>
       </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>16</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
       <property name="text">
        <string>Start recording</string>
       </property>
      <widget class="QPushButton" name="stopRecPushButton">
       <property name="geometry">
        <rect>
-        <x>30</x>
-        <y>150</y>
-        <width>151</width>
-        <height>51</height>
+        <x>10</x>
+        <y>160</y>
+        <width>201</width>
+        <height>61</height>
        </rect>
       </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>16</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
       <property name="text">
        <string>Stop recording</string>
       </property>
      <widget class="QPushButton" name="drawRoutePushButton">
       <property name="geometry">
        <rect>
-        <x>30</x>
-        <y>220</y>
-        <width>151</width>
-        <height>51</height>
+        <x>10</x>
+        <y>250</y>
+        <width>201</width>
+        <height>61</height>
        </rect>
       </property>
+      <property name="font">
+       <font>
+        <family>Bitstream Charter</family>
+        <pointsize>16</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
       <property name="text">
        <string>Draw route</string>
       </property>
      </widget>
-     <widget class="QWidget" name="">
+     <widget class="QWidget" name="layoutWidget">
       <property name="geometry">
        <rect>
         <x>310</x>
         <y>16</y>
-        <width>221</width>
+        <width>451</width>
         <height>211</height>
        </rect>
       </property>
         </widget>
        </item>
        <item>
+        <widget class="QLabel" name="labelRouteTabGPSTime">
+         <property name="text">
+          <string>Label GPS Time</string>
+         </property>
+        </widget>
+       </item>
+       <item>
         <widget class="QLabel" name="labelRouteTabLatitude">
          <property name="text">
           <string>Label Latitude</string>