From 1ca1a97aff0cef49228b13ed34eb83c0798472cc Mon Sep 17 00:00:00 2001 From: aibingbing Date: Wed, 10 Jul 2024 09:53:01 +0800 Subject: [PATCH] =?UTF-8?q?[6.5.0]=20refactor:=20=E9=80=9A=E7=94=A8?= =?UTF-8?q?=E5=BC=B9=E6=A1=86=E5=A2=9E=E5=8A=A0tts=20=E6=96=87=E6=A1=88?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../biz/v2x/busstation/PassBusStationEventManager.kt | 4 ++++ .../function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt | 4 +++- .../function/hmi/ui/v2n/RoadV2NEventWindowView.kt | 3 ++- .../eagle/core/data/v2x/RoadV2NEventWindowBean.kt | 3 ++- .../hmi/CallerRoadV2NEventWindowListenerManager.kt | 11 ++++++++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt index 1b033096b0..31d352aaee 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/busstation/PassBusStationEventManager.kt @@ -170,6 +170,10 @@ object PassBusStationEventManager : IMoGoChassisLocationWGS84Listener { it.notifyDistance ), isDriverScreen, + String.format( + EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType), + it.notifyDistance + ), UriUtils.res2Uri( EventTypeEnumNew.getPoiTypeBg( EventTypeEnumNew.TYPE_USECASE_ROAD_BUS_STATION.poiType, diff --git a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt index 8e0b3d1082..e276d94b4d 100644 --- a/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt +++ b/core/function-impl/mogo-core-function-biz/src/main/java/com/mogo/eagle/function/biz/v2x/v2n/pnc/V2NIdentifyDrawer.kt @@ -203,7 +203,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener { } } val alert = sb.toString() - CallerRoadV2NEventWindowListenerManager.showLiveVideo("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, itx.cameraIp, itx.longitude, itx.latitude) + CallerRoadV2NEventWindowListenerManager.showLiveVideo("${itx.longitude}-${itx.latitude}", itx.systemTime.toLong(), EventTypeEnumNew.getUpdateIconRes(poiType), alert, isDriver, alert, itx.cameraIp, itx.longitude, itx.latitude) } } //消息埋点 @@ -350,6 +350,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener { EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt()), isDriver, + String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_OTHER_RETROGRADE_VEHICLE.poiType), distance.toInt()), cameraIp.toString(), event.longitude, event.latitude) @@ -410,6 +411,7 @@ internal object V2NIdentifyDrawer: IEventDismissListener { EventTypeEnumNew.getUpdateIconRes(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), String.format(EventTypeEnumNew.getAlarmContent(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt()), isDriver, + String.format(EventTypeEnumNew.getWarningTts(EventTypeEnumNew.TYPE_SOCKET_ROAD_PEOPLE_CROSS.poiType), distance.toInt()), cameraIp.toString(), data.longitude, data.latitude) diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt index aa58c81c53..5c87856b10 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/v2n/RoadV2NEventWindowView.kt @@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.hmi.ui.v2n import android.content.Context import android.graphics.Color +import android.text.TextUtils import android.util.AttributeSet import android.util.TypedValue import android.view.LayoutInflater @@ -283,7 +284,7 @@ class RoadV2NEventWindowView @JvmOverloads constructor( tvV2XHintContent.text = dataBean.hintStr tvV2XTimeStr.text = "更新时间:${DateTimeUtils.getTimeText(dataBean.timestamp, DateTimeUtils.HH_mm_ss)}" - if (dataBean.isNeedTTS) { + if (dataBean.isNeedTTS && !TextUtils.isEmpty(dataBean.ttsStr)) { AIAssist.getInstance(context) .speakTTSVoiceWithLevel(dataBean.hintStr, AIAssist.LEVEL0) } diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/RoadV2NEventWindowBean.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/RoadV2NEventWindowBean.kt index dd65605242..9d30761f1e 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/RoadV2NEventWindowBean.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/v2x/RoadV2NEventWindowBean.kt @@ -10,13 +10,14 @@ data class RoadV2NEventWindowBean( var iconResId: Int, //事件icon res id var hintStr: String, //事件提示文案 var isNeedTTS: Boolean = false, //事件文案是否需要同步tts + var ttsStr: String = "", //TTS的文案 var contentImageUrl: String, // Image 类型时图片 url var cameraIp: String, // 路侧camera ip,用于请求获取拉流地址 var lon: Double, //事件坐标-经度 var lat: Double, //事件坐标-纬度 ) { override fun toString(): String { - return "RoadV2NEventWindowBean(eventType=$eventType, eventId='$eventId', timestamp=$timestamp, iconResId='$iconResId', hintStr='$hintStr', isNeedTTS=$isNeedTTS, contentImageUrl='$contentImageUrl', cameraIp='$cameraIp', lon=$lon, lat=$lat)" + return "RoadV2NEventWindowBean(eventType=$eventType, eventId='$eventId', timestamp=$timestamp, iconResId=$iconResId, hintStr='$hintStr', isNeedTTS=$isNeedTTS, ttsStr='$ttsStr', contentImageUrl='$contentImageUrl', cameraIp='$cameraIp', lon=$lon, lat=$lat)" } } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerRoadV2NEventWindowListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerRoadV2NEventWindowListenerManager.kt index 182f9dcbea..aa5f8cbe7a 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerRoadV2NEventWindowListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/hmi/CallerRoadV2NEventWindowListenerManager.kt @@ -21,13 +21,15 @@ object CallerRoadV2NEventWindowListenerManager : CallerBase