4 * @author Toni Jussila <toni.jussila@fudeco.com>
5 * @copyright (c) 2010 Speed Freak team
6 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 #include "maemo5locationprivate.h"
11 #include "maemo5location.h"
14 *Default constructor of this class.
15 *@param QObject pointer to parent object. By default the value is NULL.
17 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
19 ptr = new Maemo5LocationPrivate(this);
21 connect(ptr,SIGNAL(agnss()),this,SIGNAL(agnss()));
22 connect(ptr,SIGNAL(awcp()),this,SIGNAL(awcp()));
23 connect(ptr,SIGNAL(locationUpdated()),this,SIGNAL(locationUpdated()));
24 connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
25 connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
26 connect(ptr, SIGNAL(gps_err(int)), this, SIGNAL(gps_error(int)));
27 connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
28 connect(ptr, SIGNAL(gpsd_stopped()), this, SIGNAL(gpsd_stopped()));
34 *Destructor of this class. Should be used to release all allocated resources.
36 Maemo5Location::~Maemo5Location()
44 double Maemo5Location::getLatitude()
46 return ptr->get_lat();
52 double Maemo5Location::getLongitude()
54 return ptr->get_lon();
58 *Returns number of satellites in use.
60 int Maemo5Location::getSatellitesInUse()
62 return ptr->get_satellites_in_use();
66 *Returns number of satellites in view.
68 int Maemo5Location::getSatellitesInView()
70 return ptr->get_satellites_in_view();
74 *Returns average signal strength of satellites which are in use.
76 int Maemo5Location::getSignalStrength()
78 return ptr->get_signal_strength();
82 *Returns timestamp of the update in seconds.
84 double Maemo5Location::getTime()
86 return ptr->get_time();
90 *Returns time accuracy in seconds.
92 double Maemo5Location::getEpt()
94 return ptr->get_ept();
98 *Returns horizontal position accuracy in cm.
100 double Maemo5Location::getEph()
102 return ptr->get_eph();
106 *Returns fix altitude in meters.
108 double Maemo5Location::getAltitude()
110 return ptr->get_altitude();
114 *Returns altitude accuracy in meters.
116 double Maemo5Location::getEpv()
118 return ptr->get_epv();
122 *Returns direction of motion in degrees(0-359).
124 double Maemo5Location::getTrack()
126 return ptr->get_track();
130 *Returns track accuracy in degrees.
132 double Maemo5Location::getEpd()
134 return ptr->get_epd();
138 *Returns current speed in km/h.
140 double Maemo5Location::getSpeed()
142 return ptr->get_speed();
146 *Returns speed accuracy in km/h.
148 double Maemo5Location::getEps()
150 return ptr->get_eps();
154 *Returns current rate of climb in m/s.
156 double Maemo5Location::getClimb()
158 return ptr->get_climb();
162 *Returns climb accuracy in m/s.
164 double Maemo5Location::getEpc()
166 return ptr->get_epc();
170 *Returns distance between two points in kilometers.
171 *@param latitude of first point
172 *@param longitude of first point
173 *@param latitude of second point
174 *@param longitude of second point
176 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
178 return ptr->distance_between_two_points(latitude_s, longitude_s, latitude_f, longitude_f);