introduce better reset for when route should be recalculated to save some internet traffic

This commit is contained in:
sonora 2012-03-16 12:25:17 +01:00
parent 5638b379be
commit 5f859054c6

View file

@ -418,6 +418,10 @@ public class RoutingHelper {
if(isFollowingMode){ if(isFollowingMode){
tryMarkPassedRoute(start); tryMarkPassedRoute(start);
directionDetection(start); directionDetection(start);
// reset evalWaitInterval only if new route is in forward direction
if(!suppressTurnPrompt){
evalWaitInterval = 3001;
}
voiceRouter.newRouteIsCalculated(updateRoute, suppressTurnPrompt); voiceRouter.newRouteIsCalculated(updateRoute, suppressTurnPrompt);
} }
currentRoute = 0; currentRoute = 0;
@ -569,7 +573,8 @@ public class RoutingHelper {
if (res.isCalculated()) { if (res.isCalculated()) {
setNewRoute(res, start); setNewRoute(res, start);
// reset error wait interval // reset error wait interval
evalWaitInterval = 3001; // reset evalWaitInterval in setNewRoute and only if new route is in forward direction
// evalWaitInterval = 3001;
} else { } else {
evalWaitInterval = evalWaitInterval * 4 / 3; evalWaitInterval = evalWaitInterval * 4 / 3;
if (evalWaitInterval > 120000) { if (evalWaitInterval > 120000) {