Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
f4f4fd6bf7
2 changed files with 13 additions and 3 deletions
|
@ -1214,7 +1214,7 @@ public class RouteResultPreparation {
|
|||
double mpi = Math.abs(MapUtils.degreesDiff(prevSegm.getBearingEnd(), attached.getBearingBegin()));
|
||||
int rsSpeakPriority = highwaySpeakPriority(attached.getObject().getHighway());
|
||||
int lanes = countLanesMinOne(attached);
|
||||
int[] turnLanes = parseTurnLanes(attached.getObject(), attached.getBearingBegin());
|
||||
int[] turnLanes = parseTurnLanes(attached.getObject(), attached.getBearingBegin() * Math.PI / 180);
|
||||
boolean smallStraightVariation = mpi < TURN_DEGREE_MIN;
|
||||
boolean smallTargetVariation = Math.abs(ex) < TURN_DEGREE_MIN;
|
||||
boolean attachedOnTheRight = ex >= 0;
|
||||
|
|
|
@ -68,6 +68,7 @@ public class WaypointHelper {
|
|||
public static final int ALARMS = 4;
|
||||
public static final int MAX = 5;
|
||||
public static final int[] SEARCH_RADIUS_VALUES = {50, 100, 200, 500, 1000, 2000, 5000};
|
||||
private static final double DISTANCE_IGNORE_DOUBLE_SPEEDCAMS = 150;
|
||||
|
||||
private List<List<LocationPointWrapper>> locationPoints = new ArrayList<List<LocationPointWrapper>>();
|
||||
private ConcurrentHashMap<LocationPoint, Integer> locationPointsStates = new ConcurrentHashMap<LocationPoint, Integer>();
|
||||
|
@ -570,12 +571,20 @@ public class WaypointHelper {
|
|||
|
||||
|
||||
private void calculateAlarms(RouteCalculationResult route, List<LocationPointWrapper> array, ApplicationMode mode) {
|
||||
AlarmInfo prevSpeedCam = null;
|
||||
for (AlarmInfo i : route.getAlarmInfo()) {
|
||||
if (i.getType() == AlarmInfoType.SPEED_CAMERA) {
|
||||
if (app.getSettings().SHOW_CAMERAS.getModeValue(mode) || app.getSettings().SPEAK_SPEED_CAMERA.getModeValue(mode)) {
|
||||
LocationPointWrapper lw = new LocationPointWrapper(route, ALARMS, i, 0, i.getLocationIndex());
|
||||
lw.setAnnounce(app.getSettings().SPEAK_SPEED_CAMERA.get());
|
||||
array.add(lw);
|
||||
if(prevSpeedCam != null &&
|
||||
MapUtils.getDistance(prevSpeedCam.getLatitude(), prevSpeedCam.getLongitude(),
|
||||
i.getLatitude(), i.getLongitude()) < DISTANCE_IGNORE_DOUBLE_SPEEDCAMS) {
|
||||
// ignore double speed cams
|
||||
} else {
|
||||
lw.setAnnounce(app.getSettings().SPEAK_SPEED_CAMERA.get());
|
||||
array.add(lw);
|
||||
prevSpeedCam = i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (app.getSettings().SHOW_TRAFFIC_WARNINGS.getModeValue(mode) || app.getSettings().SPEAK_TRAFFIC_WARNINGS.getModeValue(mode)) {
|
||||
|
@ -584,6 +593,7 @@ public class WaypointHelper {
|
|||
array.add(lw);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue