-
- All Implemented Interfaces:
public class AutoZoomControllerUtils
Utils for an AutoZoomController
-
-
Field Summary
Fields Modifier and Type Field Description private final Double
feetToMeters
private final Float
defaultTolerance
private final Float
speedTolerance
private final Double
mpsToMphMultiplier
private final Float
hoursMultiplier
private final Set<Integer>
veryHighRangeRoadTypes
private final Set<Integer>
highRangeRoadTypes
private final Set<Integer>
midRangeRoadTypes
private final Set<Integer>
lowRangeRoadTypes
public final static AutoZoomControllerUtils
INSTANCE
-
Method Summary
Modifier and Type Method Description final Boolean
compareFloat(Float val1, Float val2, Float tolerance)
final Boolean
isHighSpeedTurn(Integer turnAction)
final Float
speedValueToMetersPerSecond(Float value)
final Float
convertSpeedFromMetersPerSecond(Float value)
Converts speed in meters per second to KPH or MPH final Integer
computeCurrentLad(ThresholdDistances thresholdDistances, Integer distanceToNext)
Computes LAD value corresponding with the distance traveled between the current thresholds. final Integer
getLookAheadDistanceForFreeDrive(AutoZoomRange range, AutoZoomConfiguration config)
Retrieves look ahead distance from config final ActiveNavStatus
computeActiveNavStatus(StepInfo nextManeuver, RenderMode renderMode, AutoZoomConfiguration config)
Retrieves autozoom state and desired LAD when approaching maneuver during navigation final ThresholdDistances
computeThresholdDistancesAndLAD(StepInfo nextManeuver, AutoZoomState state, AutoZoomConfiguration config)
Retrieves the distance threshold and look ahead distance final AutoZoomRange
computeAutoZoomRangeForRoadType(SpeedInfo speedInfo, AutoZoomConfiguration config, Boolean considerSpeedLimit)
Computes range based on the current road type final AutoZoomRange
computeAutoZoomRangeForSpeedLimit(SpeedInfo speedInfo, AutoZoomConfiguration config)
Computes range based on speed final Float
getSpeedLimitValueFromConfig(SpeedLimitLevel level, AutoZoomConfiguration config)
Retrieves speed value from config considering unit and level. final Boolean
isSpeedLimitValid(Float speedLimit)
Verifies that the speed value is within valid range final AutoZoomRange
pickHigherRangeOf(AutoZoomRange range1, AutoZoomRange range2)
Get higher range of 2 values final AutoZoomRange
nextRangeTo(AutoZoomRange range)
Get higher range to provided final AutoZoomRange
previousRangeTo(AutoZoomRange range)
Get lower range to provided final Double
getFeetToMeters()
Feet to meters conversion constant. final Float
getDefaultTolerance()
Tolerance for comparing float values final Float
getSpeedTolerance()
Tolerance for comparing float values final Double
getMpsToMphMultiplier()
Multiplier for conversion of meters per second to miles per hour final Float
getHoursMultiplier()
Multiplier for conversion of meters per second speed values final Set<Integer>
getVeryHighRangeRoadTypes()
Define free drive very high range road types final Set<Integer>
getHighRangeRoadTypes()
Define free drive high range road types final Set<Integer>
getMidRangeRoadTypes()
Define free drive mid range road types final Set<Integer>
getLowRangeRoadTypes()
Define free drive low range road types -
-
Method Detail
-
compareFloat
final Boolean compareFloat(Float val1, Float val2, Float tolerance)
-
isHighSpeedTurn
final Boolean isHighSpeedTurn(Integer turnAction)
-
speedValueToMetersPerSecond
final Float speedValueToMetersPerSecond(Float value)
-
convertSpeedFromMetersPerSecond
final Float convertSpeedFromMetersPerSecond(Float value)
Converts speed in meters per second to KPH or MPH
-
computeCurrentLad
final Integer computeCurrentLad(ThresholdDistances thresholdDistances, Integer distanceToNext)
Computes LAD value corresponding with the distance traveled between the current thresholds.
- Parameters:
thresholdDistances
-input threshold distances
distanceToNext
-distance to the next threshold
-
getLookAheadDistanceForFreeDrive
final Integer getLookAheadDistanceForFreeDrive(AutoZoomRange range, AutoZoomConfiguration config)
Retrieves look ahead distance from config
- Parameters:
range
-input range
config
-input config
-
computeActiveNavStatus
final ActiveNavStatus computeActiveNavStatus(StepInfo nextManeuver, RenderMode renderMode, AutoZoomConfiguration config)
Retrieves autozoom state and desired LAD when approaching maneuver during navigation
- Parameters:
nextManeuver
-input next maneuver
renderMode
-input rendering mode
config
-input config
-
computeThresholdDistancesAndLAD
final ThresholdDistances computeThresholdDistancesAndLAD(StepInfo nextManeuver, AutoZoomState state, AutoZoomConfiguration config)
Retrieves the distance threshold and look ahead distance
- Parameters:
nextManeuver
-input next maneuver
state
-input state
config
-input config
-
computeAutoZoomRangeForRoadType
final AutoZoomRange computeAutoZoomRangeForRoadType(SpeedInfo speedInfo, AutoZoomConfiguration config, Boolean considerSpeedLimit)
Computes range based on the current road type
- Parameters:
speedInfo
-speed info of current road type
config
-input config
considerSpeedLimit
-input consider speed limit option
-
computeAutoZoomRangeForSpeedLimit
final AutoZoomRange computeAutoZoomRangeForSpeedLimit(SpeedInfo speedInfo, AutoZoomConfiguration config)
Computes range based on speed
- Parameters:
config
-input config
-
getSpeedLimitValueFromConfig
final Float getSpeedLimitValueFromConfig(SpeedLimitLevel level, AutoZoomConfiguration config)
Retrieves speed value from config considering unit and level.
- Parameters:
level
-input level
config
-input config
-
isSpeedLimitValid
final Boolean isSpeedLimitValid(Float speedLimit)
Verifies that the speed value is within valid range
- Parameters:
speedLimit
-the speed limit, can be both KPH and MPH
-
pickHigherRangeOf
final AutoZoomRange pickHigherRangeOf(AutoZoomRange range1, AutoZoomRange range2)
Get higher range of 2 values
-
nextRangeTo
final AutoZoomRange nextRangeTo(AutoZoomRange range)
Get higher range to provided
-
previousRangeTo
final AutoZoomRange previousRangeTo(AutoZoomRange range)
Get lower range to provided
-
getFeetToMeters
final Double getFeetToMeters()
Feet to meters conversion constant.
-
getDefaultTolerance
final Float getDefaultTolerance()
Tolerance for comparing float values
-
getSpeedTolerance
final Float getSpeedTolerance()
Tolerance for comparing float values
-
getMpsToMphMultiplier
final Double getMpsToMphMultiplier()
Multiplier for conversion of meters per second to miles per hour
-
getHoursMultiplier
final Float getHoursMultiplier()
Multiplier for conversion of meters per second speed values
-
getVeryHighRangeRoadTypes
final Set<Integer> getVeryHighRangeRoadTypes()
Define free drive very high range road types
-
getHighRangeRoadTypes
final Set<Integer> getHighRangeRoadTypes()
Define free drive high range road types
-
getMidRangeRoadTypes
final Set<Integer> getMidRangeRoadTypes()
Define free drive mid range road types
-
getLowRangeRoadTypes
final Set<Integer> getLowRangeRoadTypes()
Define free drive low range road types
-
-
-
-