Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
4da0d6da69
3 changed files with 19 additions and 2 deletions
|
@ -72,6 +72,8 @@ public class RoutingHelper {
|
|||
|
||||
private RouteCalculationProgressCallback progressRoute;
|
||||
|
||||
private boolean announceBackOnRoute = false;
|
||||
|
||||
|
||||
// private ProgressBar progress;
|
||||
// private Handler progressHandler;
|
||||
|
@ -272,6 +274,7 @@ public class RoutingHelper {
|
|||
}
|
||||
if(dist > 350) {
|
||||
voiceRouter.announceOffRoute(dist);
|
||||
announceBackOnRoute = true;
|
||||
}
|
||||
}
|
||||
// 3. Identify wrong movement direction
|
||||
|
@ -321,6 +324,10 @@ public class RoutingHelper {
|
|||
if(!thread.isParamsChanged()) {
|
||||
thread.stopCalculation();
|
||||
}
|
||||
if (announceBackOnRoute){
|
||||
voiceRouter.announceBackOnRoute();
|
||||
announceBackOnRoute = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -222,6 +222,13 @@ public class VoiceRouter {
|
|||
}
|
||||
}
|
||||
|
||||
public void announceBackOnRoute() {
|
||||
CommandBuilder p = getNewCommandPlayerToPlay();
|
||||
if (p != null) {
|
||||
p.backOnRoute().play();
|
||||
}
|
||||
}
|
||||
|
||||
public void announceWaypoint(List<LocationPointWrapper> points) {
|
||||
CommandBuilder p = getNewCommandPlayerToPlay();
|
||||
if (p == null){
|
||||
|
|
|
@ -37,6 +37,7 @@ public class CommandBuilder {
|
|||
protected static final String C_SPEAD_ALARM = "speed_alarm"; //$NON-NLS-1$
|
||||
protected static final String C_ATTENTION = "attention"; //$NON-NLS-1$
|
||||
protected static final String C_OFF_ROUTE = "off_route"; //$NON-NLS-1$
|
||||
protected static final String C_BACK_ON_ROUTE ="back_on_route"; //$NON-NLS-1$
|
||||
|
||||
|
||||
protected static final String C_BEAR_LEFT = "bear_left"; //$NON-NLS-1$
|
||||
|
@ -134,7 +135,9 @@ public class CommandBuilder {
|
|||
return addCommand(C_OFF_ROUTE, dist);
|
||||
}
|
||||
|
||||
|
||||
public CommandBuilder backOnRoute(){
|
||||
return addCommand(C_BACK_ON_ROUTE);
|
||||
}
|
||||
|
||||
public CommandBuilder makeUT(double dist, Term streetName){
|
||||
return alt(prepareStruct(C_MAKE_UT, dist, streetName), prepareStruct(C_MAKE_UT, dist));
|
||||
|
|
Loading…
Reference in a new issue