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"
15 *Default constructor of this class.
16 *@param QObject pointer to parent object. By default the value is NULL.
18 Maemo5Location::Maemo5Location(QObject* parent):QObject(parent)
20 qDebug() << "__Maemo5Location";
21 ptr = new Maemo5LocationPrivate(this);
23 connect(ptr, SIGNAL(agnss()), this, SIGNAL(agnss()));
24 connect(ptr, SIGNAL(awcp()), this, SIGNAL(awcp()));
25 connect(ptr, SIGNAL(locationUpdated()), this, SIGNAL(locationUpdated()));
26 connect(ptr, SIGNAL(gps_connected()), this, SIGNAL(gps_connected()));
27 connect(ptr, SIGNAL(gps_disconnected()), this, SIGNAL(gps_disconnected()));
28 connect(ptr, SIGNAL(gps_error(int)), this, SIGNAL(gps_error(int)));
29 connect(ptr, SIGNAL(gpsd_running()), this, SIGNAL(gpsd_running()));
30 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()
38 qDebug() << "__~Maemo5Location";
46 void Maemo5Location::startPollingGPS()
48 qDebug() << "__Maemo5Location: startPollingGPS";
55 void Maemo5Location::stopPollingGPS()
57 qDebug() << "__Maemo5Location: stopPollingGPS";
62 *Returns number of satellites in use.
64 int Maemo5Location::getSatellitesInUse()
66 return ptr->get_satellites_in_use();
70 *Returns number of satellites in view.
72 int Maemo5Location::getSatellitesInView()
74 return ptr->get_satellites_in_view();
78 *Returns average signal strength of satellites which are in use.
80 int Maemo5Location::getSignalStrength()
82 return ptr->get_signal_strength();
88 bool Maemo5Location::getGpsOnline()
90 return ptr->get_gps_online();
96 double Maemo5Location::getLatitude()
98 return ptr->get_lat();
104 double Maemo5Location::getLongitude()
106 return ptr->get_lon();
110 *Returns timestamp of the update in seconds.
112 double Maemo5Location::getTime()
114 return ptr->get_time();
118 *Returns time accuracy in seconds.
120 double Maemo5Location::getEpt()
122 return ptr->get_ept();
126 *Returns horizontal position accuracy in cm.
128 double Maemo5Location::getEph()
130 return ptr->get_eph();
134 *Returns fix altitude in meters.
136 double Maemo5Location::getAltitude()
138 return ptr->get_altitude();
142 *Returns altitude accuracy in meters.
144 double Maemo5Location::getEpv()
146 return ptr->get_epv();
150 *Returns direction of motion in degrees(0-359).
152 double Maemo5Location::getTrack()
154 return ptr->get_track();
158 *Returns track accuracy in degrees.
160 double Maemo5Location::getEpd()
162 return ptr->get_epd();
166 *Returns current speed in km/h.
168 double Maemo5Location::getSpeed()
170 return ptr->get_speed();
174 *Returns speed accuracy in km/h.
176 double Maemo5Location::getEps()
178 return ptr->get_eps();
182 *Returns current rate of climb in m/s.
184 double Maemo5Location::getClimb()
186 return ptr->get_climb();
190 *Returns climb accuracy in m/s.
192 double Maemo5Location::getEpc()
194 return ptr->get_epc();
198 *Returns distance between two points in kilometers.
199 *@param latitude of first point
200 *@param longitude of first point
201 *@param latitude of second point
202 *@param longitude of second point
204 double Maemo5Location::distance_between_two_points(double latitude_s, double longitude_s, double latitude_f, double longitude_f)
206 return ptr->distance_between_two_points(latitude_s, longitude_s, latitude_f, longitude_f);