From e43f6c404ee9b3ccb65f7c32c79f829b949429c8 Mon Sep 17 00:00:00 2001 From: renwj Date: Sat, 14 Jan 2023 16:53:26 +0800 Subject: [PATCH] =?UTF-8?q?[2.13.2]=E4=BC=98=E5=8C=96=E9=81=93=E8=B7=AF?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=9A=84=E8=AF=AD=E9=9F=B3=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scene/road/V2XRoadEventScenario.java | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) 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 b96d19cd12..4eb32d0dc2 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 @@ -27,6 +27,7 @@ import com.mogo.eagle.core.function.v2x.events.scenario.view.IV2XMarker; import com.mogo.eagle.core.network.utils.GsonUtil; import java.util.HashMap; import java.util.Map; +import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -72,16 +73,23 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp try { if (getV2XMessageEntity() != null && getV2XMessageEntity().getContent() != null) { //只展示不播报 不广播 - boolean onlyShow = getV2XMessageEntity().isOnlyShow(); + V2XMessageEntity entity = getV2XMessageEntity(); + boolean onlyShow = entity.isOnlyShow(); if (!onlyShow) { // 设置TTS - getV2XMessageEntity().getContent().getTts(false); + V2XRoadEventEntity content = entity.getContent(); + if (content != null && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGONG.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_JINGZHI.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_SHIGU.getPoiType()) + && !Objects.equals(content.getPoiType(), EventTypeEnumNew.TYPE_SOCKET_ROAD_CONGESTION.getPoiType())) { + content.getTts(false); + } } showWindow(); - String poiType = getV2XMessageEntity().getContent().getPoiType(); - String lat = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLat()); - String lon = String.valueOf(getV2XMessageEntity().getContent().getLocation().getLon()); - String infoId = getV2XMessageEntity().getContent().getNoveltyInfo().getInfoId(); + String poiType = entity.getContent().getPoiType(); + String lat = String.valueOf(entity.getContent().getLocation().getLat()); + String lon = String.valueOf(entity.getContent().getLocation().getLon()); + String infoId = entity.getContent().getNoveltyInfo().getInfoId(); String style = "1"; Map properties = new HashMap<>(); properties.put("dbid", infoId); @@ -117,7 +125,7 @@ public class V2XRoadEventScenario extends AbsV2XScenario imp if (carLocation != null && noveltyInfo != null) { MarkerLocation eventLocation = noveltyInfo.getLocation(); if (eventLocation != null) { - double distance = CoordinateUtils.calculateLineDistance(carLocation.getLongitude(), carLocation.getLatitude(), eventLocation.getLon(), eventLocation.getLat()); + double distance = content.getDistance(); alarmText = String.format(alarmText, Math.round(distance) + ""); ttsText = String.format(ttsText, Math.round(distance) + ""); }