locus transport mode fix
This commit is contained in:
parent
7cc6314397
commit
52e6754bfc
3 changed files with 11 additions and 10 deletions
|
@ -390,11 +390,7 @@ public final class OsmTrack
|
|||
|
||||
if ( turnInstructionMode == 2 )
|
||||
{
|
||||
int routeType = voiceHints.getLocusRouteType();
|
||||
if ( routeType != 4 ) // 4 = car = default seems to work better as default
|
||||
{
|
||||
sb.append( " <extensions><locus:rteComputeType>" ).append( voiceHints.getLocusRouteType() ).append( "</locus:rteComputeType></extensions>\n" );
|
||||
}
|
||||
sb.append( " <extensions><locus:rteComputeType>" ).append( voiceHints.getLocusRouteType() ).append( "</locus:rteComputeType></extensions>\n" );
|
||||
sb.append( " <extensions><locus:rteSimpleRoundabouts>1</locus:rteSimpleRoundabouts></extensions>\n" );
|
||||
}
|
||||
|
||||
|
@ -640,7 +636,7 @@ public final class OsmTrack
|
|||
public void processVoiceHints( RoutingContext rc )
|
||||
{
|
||||
voiceHints = new VoiceHintList();
|
||||
voiceHints.setTransportMode( rc.carMode );
|
||||
voiceHints.setTransportMode( rc.carMode, rc.bikeMode );
|
||||
voiceHints.turnInstructionMode = rc.turnInstructionMode;
|
||||
|
||||
if ( detourMap == null )
|
||||
|
|
|
@ -51,6 +51,7 @@ public final class RoutingContext implements DistanceChecker
|
|||
public int uphillcostdiv;
|
||||
public int uphillcutoff;
|
||||
public boolean carMode;
|
||||
public boolean bikeMode;
|
||||
public boolean forceSecondaryData;
|
||||
public double pass1coefficient;
|
||||
public double pass2coefficient;
|
||||
|
@ -63,6 +64,7 @@ public final class RoutingContext implements DistanceChecker
|
|||
public double changetime;
|
||||
public double buffertime;
|
||||
public double waittimeadjustment;
|
||||
public double inittimeadjustment;
|
||||
public double starttimeoffset;
|
||||
|
||||
public void readGlobalConfig( BExpressionContext expctxGlobal )
|
||||
|
@ -74,6 +76,8 @@ public final class RoutingContext implements DistanceChecker
|
|||
if ( downhillcostdiv != 0 ) downhillcostdiv = 1000000/downhillcostdiv;
|
||||
if ( uphillcostdiv != 0 ) uphillcostdiv = 1000000/uphillcostdiv;
|
||||
carMode = 0.f != expctxGlobal.getVariableValue( "validForCars", 0.f );
|
||||
bikeMode = 0.f != expctxGlobal.getVariableValue( "validForBikes", 0.f );
|
||||
|
||||
forceSecondaryData = 0.f != expctxGlobal.getVariableValue( "forceSecondaryData", 0.f );
|
||||
pass1coefficient = expctxGlobal.getVariableValue( "pass1coefficient", 1.5f );
|
||||
pass2coefficient = expctxGlobal.getVariableValue( "pass2coefficient", 0.f );
|
||||
|
@ -86,6 +90,7 @@ public final class RoutingContext implements DistanceChecker
|
|||
changetime = expctxGlobal.getVariableValue( "changetime", 180.f );
|
||||
buffertime = expctxGlobal.getVariableValue( "buffertime", 120.f );
|
||||
waittimeadjustment = expctxGlobal.getVariableValue( "waittimeadjustment", 0.9f );
|
||||
inittimeadjustment = expctxGlobal.getVariableValue( "inittimeadjustment", 0.2f );
|
||||
starttimeoffset = expctxGlobal.getVariableValue( "starttimeoffset", 0.f );
|
||||
|
||||
farTrafficWeight = expctxGlobal.getVariableValue( "farTrafficWeight", 2.f );
|
||||
|
|
|
@ -15,9 +15,9 @@ public class VoiceHintList
|
|||
int turnInstructionMode;
|
||||
ArrayList<VoiceHint> list = new ArrayList<VoiceHint>();
|
||||
|
||||
public void setTransportMode( boolean isCar )
|
||||
public void setTransportMode( boolean isCar, boolean isBike )
|
||||
{
|
||||
transportMode = isCar ? "car" : "bike";
|
||||
transportMode = isCar ? "car" : ( isBike ? "bike" : "foot" );
|
||||
}
|
||||
|
||||
public String getTransportMode()
|
||||
|
@ -29,12 +29,12 @@ public class VoiceHintList
|
|||
{
|
||||
if ( "car".equals( transportMode ) )
|
||||
{
|
||||
return 4;
|
||||
return 0;
|
||||
}
|
||||
if ( "bike".equals( transportMode ) )
|
||||
{
|
||||
return 5;
|
||||
}
|
||||
return 5; // ??
|
||||
return 3; // foot
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue