using milliseconds for delta_t when calculating speed, supports Suunto Ambit gpx datafiles

This commit is contained in:
Walter
2014-01-18 23:32:51 +01:00
parent b8e07dbcdd
commit ca6f0882c1

View File

@@ -170,7 +170,8 @@ bool
// compute the elapsed time and distance traveled since the
// last recorded trackpoint
double delta_t = last_time.secsTo(time);
// use msec in case there are msec in QDateTime
double delta_t_ms = last_time.msecsTo(time);
if (delta_d<0)
{
delta_d=0;
@@ -181,9 +182,9 @@ bool
// for the first trackpoint -- so set speed to 0.0 instead of
// dividing by zero.
double speed = 0.0;
if (delta_t > 0.0)
if (delta_t_ms > 0.0)
{
speed=delta_d / delta_t * 3600.0;
speed= 1000.0 * delta_d / delta_t_ms * 3600.0;
}
// Time from beginning of activity