voice hints update
This commit is contained in:
parent
47cfb4b83c
commit
23968b2a5b
7 changed files with 103 additions and 32 deletions
|
|
@ -13,6 +13,7 @@ final class BExpression
|
|||
private static final int MAX_EXP = 22;
|
||||
private static final int EQUAL_EXP = 23;
|
||||
private static final int GREATER_EXP = 24;
|
||||
private static final int MIN_EXP = 25;
|
||||
|
||||
private static final int SWITCH_EXP = 30;
|
||||
private static final int ASSIGN_EXP = 31;
|
||||
|
|
@ -102,6 +103,10 @@ final class BExpression
|
|||
{
|
||||
exp.typ = MAX_EXP;
|
||||
}
|
||||
else if ( "min".equals( operator ) )
|
||||
{
|
||||
exp.typ = MIN_EXP;
|
||||
}
|
||||
else if ( "equal".equals( operator ) )
|
||||
{
|
||||
exp.typ = EQUAL_EXP;
|
||||
|
|
@ -230,6 +235,7 @@ final class BExpression
|
|||
case ADD_EXP: return op1.evaluate(ctx) + op2.evaluate(ctx);
|
||||
case MULTIPLY_EXP: return op1.evaluate(ctx) * op2.evaluate(ctx);
|
||||
case MAX_EXP: return max( op1.evaluate(ctx), op2.evaluate(ctx) );
|
||||
case MIN_EXP: return min( op1.evaluate(ctx), op2.evaluate(ctx) );
|
||||
case EQUAL_EXP: return op1.evaluate(ctx) == op2.evaluate(ctx) ? 1.f : 0.f;
|
||||
case GREATER_EXP: return op1.evaluate(ctx) > op2.evaluate(ctx) ? 1.f : 0.f;
|
||||
case SWITCH_EXP: return op1.evaluate(ctx) != 0.f ? op2.evaluate(ctx) : op3.evaluate(ctx);
|
||||
|
|
@ -247,4 +253,9 @@ final class BExpression
|
|||
{
|
||||
return v1 > v2 ? v1 : v2;
|
||||
}
|
||||
|
||||
private float min( float v1, float v2 )
|
||||
{
|
||||
return v1 < v2 ? v1 : v2;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import btools.codec.TagValueValidator;
|
|||
public final class BExpressionContextWay extends BExpressionContext implements TagValueValidator
|
||||
{
|
||||
private static String[] buildInVariables =
|
||||
{ "costfactor", "turncost", "uphillcostfactor", "downhillcostfactor", "initialcost", "nodeaccessgranted", "initialclassifier", "trafficsourcedensity", "istrafficbackbone", "priorityclassifier", "onewaydirection", "roundaboutdirection"};
|
||||
{ "costfactor", "turncost", "uphillcostfactor", "downhillcostfactor", "initialcost", "nodeaccessgranted", "initialclassifier", "trafficsourcedensity", "istrafficbackbone", "priorityclassifier", "classifiermask" };
|
||||
|
||||
protected String[] getBuildInVariableNames()
|
||||
{
|
||||
|
|
@ -30,8 +30,7 @@ public final class BExpressionContextWay extends BExpressionContext implements T
|
|||
public float getTrafficSourceDensity() { return getBuildInVariable(7); }
|
||||
public float getIsTrafficBackbone() { return getBuildInVariable(8); }
|
||||
public float getPriorityClassifier() { return getBuildInVariable(9); }
|
||||
public float getOnewayDirection() { return getBuildInVariable(10); }
|
||||
public float getRoundaboutDirection() { return getBuildInVariable(11); }
|
||||
public float getClassifierMask() { return getBuildInVariable(10); }
|
||||
|
||||
public BExpressionContextWay( BExpressionMetaData meta )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue