From 83f78e833d265c2de32a8b27ddf48e9021c63d27 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Tue, 17 Jun 2025 13:02:10 +0200 Subject: [PATCH 1/4] shorter error messages --- .../main/java/btools/expressions/BExpressionContext.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java b/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java index 630af03..e94677e 100644 --- a/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java +++ b/brouter-expressions/src/main/java/btools/expressions/BExpressionContext.java @@ -782,7 +782,7 @@ public abstract class BExpressionContext implements IByteArrayUnifier { public void parseFile(File file, String readOnlyContext, Map keyValues) { if (!file.exists()) { - throw new IllegalArgumentException("profile " + file + " does not exist"); + throw new IllegalArgumentException("profile " + file.getName() + " does not exist"); } try { if (readOnlyContext != null) { @@ -813,12 +813,12 @@ public abstract class BExpressionContext implements IByteArrayUnifier { variableData[i] = readOnlyData[i]; } } catch (IllegalArgumentException e) { - throw new IllegalArgumentException("ParseException " + file + " at line " + linenr + ": " + e.getMessage()); + throw new IllegalArgumentException("ParseException " + file.getName() + " at line " + linenr + ": " + e.getMessage()); } catch (Exception e) { throw new RuntimeException(e); } if (expressionList.size() == 0) { - throw new IllegalArgumentException(file.getAbsolutePath() + throw new IllegalArgumentException(file.getName() + " does not contain expressions for context " + context + " (old version?)"); } } From 558e8e59552ea7b3f263d8d46de6f089f30366e3 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Tue, 17 Jun 2025 13:02:41 +0200 Subject: [PATCH 2/4] added new angles --- .../src/main/java/btools/router/VoiceHint.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/brouter-core/src/main/java/btools/router/VoiceHint.java b/brouter-core/src/main/java/btools/router/VoiceHint.java index 691453c..09d38ca 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHint.java +++ b/brouter-core/src/main/java/btools/router/VoiceHint.java @@ -580,7 +580,11 @@ public class VoiceHint { } else if (lowerBadWayAngle >= -100.f && higherBadWayAngle < 45.f) { cmd = KL; } else { - cmd = C; + if (lowerBadWayAngle > -35.f && higherBadWayAngle > 55.f) { + cmd = KR; + } else { + cmd = C; + } } } else if (cmdAngle < 5.f) { if (lowerBadWayAngle > -30.f) { @@ -597,7 +601,11 @@ public class VoiceHint { } else if (lowerBadWayAngle > -45.f && higherBadWayAngle <= 100.f) { cmd = KR; } else { - cmd = C; + if (lowerBadWayAngle < -55.f && higherBadWayAngle < 35.f) { + cmd = KL; + } else { + cmd = C; + } } } else if (cmdAngle < 45.f) { cmd = TSLR; From 156d5f9f9836aca8a6d258caed6328c74d471aa8 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Tue, 17 Jun 2025 13:08:30 +0200 Subject: [PATCH 3/4] made conditions equal --- .../src/main/java/btools/router/VoiceHintProcessor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java index 5df8a67..912b5cf 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java +++ b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java @@ -314,7 +314,13 @@ public final class VoiceHintProcessor { input.cmd == VoiceHint.KR || input.cmd == VoiceHint.KL) && !input.goodWay.isLinktType()) { - if (input.goodWay.getPrio() < input.maxBadPrio && (inputLastSaved != null && inputLastSaved.distanceToNext > catchingRange)) { + if ( + ((Math.abs(input.lowerBadWayAngle) < 35.f || + input.higherBadWayAngle < 35.f) + || input.goodWay.getPrio() < input.maxBadPrio) + && (inputLastSaved != null && inputLastSaved.distanceToNext > minRange) + && (input.distanceToNext > minRange) + ) { results.add(input); } else { if (inputLast != null) { // when drop add distance to last From cfe3ff536ac44a47796d7bad9022c99cd3dec27d Mon Sep 17 00:00:00 2001 From: afischerdev Date: Tue, 17 Jun 2025 13:09:17 +0200 Subject: [PATCH 4/4] added consumed angle for roundabout --- brouter-core/src/main/java/btools/router/VoiceHintProcessor.java | 1 + 1 file changed, 1 insertion(+) diff --git a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java index 912b5cf..83a2ad4 100644 --- a/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java +++ b/brouter-core/src/main/java/btools/router/VoiceHintProcessor.java @@ -116,6 +116,7 @@ public final class VoiceHintProcessor { input.angle = roundAboutTurnAngle; input.goodWay.turnangle = roundAboutTurnAngle; input.distanceToNext = distance; + input.turnAngleConsumed = true; //input.roundaboutExit = startTurn < 0 ? roundaboutExit : -roundaboutExit; input.roundaboutExit = roundAboutTurnAngle < 0 ? roundaboutExit : -roundaboutExit; float tmpangle = 0;