Merge pull request #741 from afischerdev/beeline

Enable beeline voicehints when there are no detours
This commit is contained in:
afischerdev 2024-11-18 17:31:21 +01:00 committed by GitHub
commit f2cba63c8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 8 deletions

View File

@ -452,7 +452,8 @@ public final class OsmTrack {
voiceHints.setTransportMode(rc.carMode, rc.bikeMode);
voiceHints.turnInstructionMode = rc.turnInstructionMode;
if (detourMap == null) {
if (detourMap == null && !rc.hasDirectRouting) {
// only when no direct way points
return;
}
int nodeNr = nodes.size() - 1;
@ -487,6 +488,7 @@ public final class OsmTrack {
input.distanceToNext = node.calcDistance(node.origin);
}
}
if (detourMap != null) {
OsmPathElementHolder detours = detourMap.get(node.origin.getIdFromPos());
if (nodeNr >= 0 && detours != null) {
OsmPathElementHolder h = detours;
@ -496,6 +498,7 @@ public final class OsmTrack {
h = h.nextHolder;
}
}
}
/* else if (nodeNr == 0 && detours != null) {
OsmPathElementHolder h = detours;
OsmPathElement e = h.node;

View File

@ -203,6 +203,7 @@ public final class RoutingContext {
public boolean showSpeedProfile;
public boolean inverseRouting;
public boolean showTime;
public boolean hasDirectRouting;
public String outputFormat = "gpx";
public boolean exportWaypoints = false;

View File

@ -631,6 +631,8 @@ public class RoutingEngine extends Thread {
}
}
routingContext.hasDirectRouting = hasDirectRouting;
OsmPath.seg = 1; // set segment counter
for (int i = 0; i < matchedWaypoints.size() - 1; i++) {
if (lastTracks[i] != null) {

View File

@ -294,6 +294,11 @@ public final class VoiceHintProcessor {
nextInput = inputs.get(hintIdx + 1);
}
if (input.cmd == VoiceHint.BL) {
results.add(input);
continue;
}
if (nextInput == null) {
if ((input.cmd == VoiceHint.C ||
input.cmd == VoiceHint.KR ||