diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java index 38bb51676b..244289a40e 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/alarm/V2XAlarmServer.java @@ -75,24 +75,32 @@ public class V2XAlarmServer { double eventBearing = eventLocation.getAngle(); double diffAngle = DrivingDirectionUtils.getAngleDiff(carBearing, eventBearing); Log.d("RWJ", "car_bearing:" + carBearing + ",eventBearing:" + eventBearing + ",diffAngle:" + diffAngle); - if (diffAngle < 20) { + if (diffAngle >= 0 && diffAngle <= 20) { // 3、计算当前车辆行驶方向与事件位置之间夹角《20度,保证道路事件在车辆前方 - double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( - currentLocation.getLongitude(), - currentLocation.getLatitude(), - eventLocation.getLon(), - eventLocation.getLat(), - (int) currentLocation.getBearing() - ); +// double eventAngle = DrivingDirectionUtils.getDegreeOfCar2Poi( +// currentLocation.getLongitude(), +// currentLocation.getLatitude(), +// eventLocation.getLon(), +// eventLocation.getLat(), +// (int) currentLocation.getBearing() +// ); +// +// Log.d("RWJ", "eventAngle:" + eventAngle); +// if (0 <= eventAngle && eventAngle <= 20) { +// if (showedEvents.contains(v2XRoadEventEntity)) { +// return null; +// } +// Log.d("RWJ", "showed---"); +// showedEvents.add(v2XRoadEventEntity); +// return v2XRoadEventEntity; +// } - Log.d("RWJ", "eventAngle:" + eventAngle); - if (0 <= eventAngle && eventAngle <= 20) { - if (showedEvents.contains(v2XRoadEventEntity)) { - return null; - } - showedEvents.add(v2XRoadEventEntity); - return v2XRoadEventEntity; + if (showedEvents.contains(v2XRoadEventEntity)) { + return null; } + Log.d("RWJ", "showed---"); + showedEvents.add(v2XRoadEventEntity); + return v2XRoadEventEntity; } } } diff --git a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java index eb0c4eea60..88e13b8217 100644 --- a/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java +++ b/core/function-impl/mogo-core-function-v2x/src/main/java/com/mogo/eagle/core/function/v2x/events/scenario/scene/road/V2XRoadEventScenario.java @@ -41,9 +41,6 @@ import java.util.concurrent.TimeUnit; public class V2XRoadEventScenario extends AbsV2XScenario implements IMoGoWarningStatusListener { private static final String TAG = "V2XRoadEventScenario"; - public V2XRoadEventScenario() { - setV2XMarker(new V2XRoadEventMarker()); - } @Override public void init(V2XMessageEntity v2XMessageEntity) { @@ -120,8 +117,8 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp MarkerLocation eventLocation = noveltyInfo.getLocation(); if (eventLocation != null) { double distance = CoordinateUtils.calculateLineDistance(carLocation.getLongitude(), carLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat()); - alarmText = String.format(alarmText, distance + ""); - ttsText = String.format(ttsText, distance + ""); + alarmText = String.format(alarmText, Math.round(distance) + ""); + ttsText = String.format(ttsText, Math.round(distance) + ""); } } } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt index 1b36458818..2bc57301e2 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/enums/EventTypeEnumNew.kt @@ -486,10 +486,10 @@ enum class EventTypeEnumNew( TYPE_SOCKET_ROAD_SHIGONG( "100061", - "前方%米道路施工", + "前方%s米道路施工", poiTypeSrcVr = R.drawable.v2x_icon_shigong_zhandao, - content = "前方%米道路施工", - tts = "前方%米道路施工" + content = "前方%s米道路施工", + tts = "前方%s米道路施工" ), TYPE_ERROR(