@@ -225,9 +225,9 @@ public AlarmInfo getMostImportantAlarm(SpeedConstants sc, boolean showCameras) {
225
225
Location lastProjection = app .getRoutingHelper ().getLastProjection ();
226
226
float mxspeed = route .getCurrentMaxSpeed ();
227
227
float delta = app .getSettings ().SPEED_LIMIT_EXCEED_KMH .get () / 3.6f ;
228
- AlarmInfo speedAlarm = createSpeedAlarm (sc , mxspeed , lastProjection , delta );
228
+ AlarmInfo speedAlarm = createSpeedAlarm (mxspeed , lastProjection , delta );
229
229
if (speedAlarm != null ) {
230
- getVoiceRouter ().announceSpeedAlarm (speedAlarm .getIntValue ( ), lastProjection .getSpeed ());
230
+ getVoiceRouter ().announceSpeedAlarm (speedAlarm .getMaxSpeed ( sc ), lastProjection .getSpeed ());
231
231
}
232
232
AlarmInfo mostImportant = speedAlarm ;
233
233
int value = speedAlarm != null ? speedAlarm .updateDistanceAndGetPriority (0 , 0 ) : Integer .MAX_VALUE ;
@@ -329,9 +329,9 @@ public AlarmInfo calculateMostImportantAlarm(RouteDataObject ro, Location loc, M
329
329
SpeedConstants sc , boolean showCameras ) {
330
330
float mxspeed = ro .getMaximumSpeed (ro .bearingVsRouteDirection (loc ));
331
331
float delta = app .getSettings ().SPEED_LIMIT_EXCEED_KMH .get () / 3.6f ;
332
- AlarmInfo speedAlarm = createSpeedAlarm (sc , mxspeed , loc , delta );
332
+ AlarmInfo speedAlarm = createSpeedAlarm (mxspeed , loc , delta );
333
333
if (speedAlarm != null ) {
334
- getVoiceRouter ().announceSpeedAlarm (speedAlarm .getIntValue ( ), loc .getSpeed ());
334
+ getVoiceRouter ().announceSpeedAlarm (speedAlarm .getMaxSpeed ( sc ), loc .getSpeed ());
335
335
return speedAlarm ;
336
336
}
337
337
for (int i = 0 ; i < ro .getPointsLength (); i ++) {
@@ -366,17 +366,11 @@ public AlarmInfo calculateMostImportantAlarm(RouteDataObject ro, Location loc, M
366
366
return null ;
367
367
}
368
368
369
- private static AlarmInfo createSpeedAlarm (SpeedConstants sc , float mxspeed , Location loc , float delta ) {
369
+ private static AlarmInfo createSpeedAlarm (float mxspeed , Location loc , float delta ) {
370
370
AlarmInfo speedAlarm = null ;
371
371
if (mxspeed != 0 && loc != null && loc .hasSpeed () && mxspeed != RouteDataObject .NONE_MAX_SPEED ) {
372
372
if (loc .getSpeed () > mxspeed + delta ) {
373
- int speed ;
374
- if (sc .imperial ) {
375
- speed = Math .round (mxspeed * 3.6f / 1.6f );
376
- } else {
377
- speed = Math .round (mxspeed * 3.6f );
378
- }
379
- speedAlarm = AlarmInfo .createSpeedLimit (speed , loc );
373
+ speedAlarm = AlarmInfo .createSpeedLimit (mxspeed , loc );
380
374
}
381
375
}
382
376
return speedAlarm ;
@@ -493,7 +487,7 @@ public void announceVisibleLocations() {
493
487
// Set actual distance and copy max speed to speed camera
494
488
if (alarmCopy .getType () == AlarmInfoType .SPEED_CAMERA ) {
495
489
alarmCopy .setFloatValue (route .getDistanceToPoint (alarm .getLocationIndex ()));
496
- alarmCopy .setIntValue (alarm .getIntValue ());
490
+ alarmCopy .setMaxSpeed (alarm .getMaxSpeed ());
497
491
}
498
492
499
493
voiceRouter .announceAlarm (alarmCopy , lastKnownLocation .getSpeed ());
0 commit comments