summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvglasow <michael@vonglasow.com>2018-05-07 23:28:24 +0200
committerGitHub <noreply@github.com>2018-05-07 23:28:24 +0200
commit03f3aa8637fff3e8e09d3bde21b28654454011fd (patch)
treefd29a51bb665396d2ff9ea52b1f0599698a42753
parentebb2cc69aba2293a227b1c5a91c4251872b6d1f0 (diff)
parentde8303d46df6fc023fcbaa3c729f9793e34068ed (diff)
downloadnavit-03f3aa8637fff3e8e09d3bde21b28654454011fd.tar.gz
Merge pull request #551 from navit-gps/fix_log_replay
fix:core:fix log replay
-rw-r--r--navit/track.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/navit/track.c b/navit/track.c
index 9217b192f..bf0d22d3f 100644
--- a/navit/track.c
+++ b/navit/track.c
@@ -1,6 +1,6 @@
/**
* Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
+ * Copyright (C) 2005-2018 Navit Team
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -671,13 +671,11 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
}
if (!vehicle_get_attr(tr->vehicle, attr_position_speed, &speed_attr, NULL) ||
!vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL) ||
- !vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL) ||
- !vehicle_get_attr(tr->vehicle, attr_position_time_iso8601, &time_attr, NULL)) {
- dbg(lvl_error,"failed to get position data %d %d %d %d",
+ !vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL)) {
+ dbg(lvl_error,"failed to get position data %d %d %d",
vehicle_get_attr(tr->vehicle, attr_position_speed, &speed_attr, NULL),
vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL),
- vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL),
- vehicle_get_attr(tr->vehicle, attr_position_time_iso8601, &time_attr, NULL));
+ vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL));
return;
}
if (tr->tunnel_extrapolation) {
@@ -696,7 +694,6 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
dbg(lvl_debug,"Using defaults for static position detection");
}
dbg(lvl_info,"Static speed: %ld, static distance: %ld",static_speed.u.num, static_distance.u.num);
- time=iso8601_to_secs(time_attr.u.str);
speed=*speed_attr.u.numd;
direction=*direction_attr.u.numd;
tr->valid=attr_position_valid_valid;
@@ -717,6 +714,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
} else if (vehicle_get_attr(tr->vehicle, attr_lag, &lag, NULL) && lag.u.num > 0) {
double espeed;
+ time=iso8601_to_secs(time_attr.u.str);
int edirection;
if (time-tr->time == 1) {
dbg(lvl_debug,"extrapolating speed from %f and %f (%f)",tr->speed, speed, speed-tr->speed);
@@ -731,9 +729,9 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
dbg(lvl_debug,"lag %ld speed %f direction %d",lag.u.num,espeed,edirection);
dbg(lvl_debug,"old 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
transform_project(pro, &tr->curr_in, espeed*lag.u.num/36, edirection, &tr->curr_in);
+ tr->time=time;
dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
}
- tr->time=time;
tr->pro=pro;
tr->curr_angle=tr->direction=direction;
tr->speed=speed;