From c29f4e21b6dce6ec4132f9be39ae52a9fb45b0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Mon, 13 Sep 2021 16:09:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DTTS=E9=A2=84=E8=AD=A6?= =?UTF-8?q?=E6=92=AD=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/drawer/TrafficMarkerDrawer.kt | 3 +- .../module/data/enums/WarningDirectionEnum.kt | 8 +-- .../module/obu/mogo/MogoPrivateObuManager.kt | 59 +++++++------------ 3 files changed, 27 insertions(+), 43 deletions(-) diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt index a6fc6fd193..db202b39de 100644 --- a/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/drawer/TrafficMarkerDrawer.kt @@ -237,7 +237,8 @@ object TrafficMarkerDrawer { trafficData.heading.toFloat(), stepTime ) - } catch (e: NullPointerException) { + } catch (e:Exception) { + e.printStackTrace() try { drawObuRecognizedDataMarker(trafficData) } catch (e: Exception) { diff --git a/modules/mogo-module-data/src/main/java/com/mogo/module/data/enums/WarningDirectionEnum.kt b/modules/mogo-module-data/src/main/java/com/mogo/module/data/enums/WarningDirectionEnum.kt index bee6026da3..1d0cb75137 100644 --- a/modules/mogo-module-data/src/main/java/com/mogo/module/data/enums/WarningDirectionEnum.kt +++ b/modules/mogo-module-data/src/main/java/com/mogo/module/data/enums/WarningDirectionEnum.kt @@ -30,19 +30,19 @@ enum class WarningDirectionEnum( ), ALERT_WARNING_TOP_RIGHT( 5, - "正前方" + "右前方" ), ALERT_WARNING_BOTTOM_RIGHT( 6, - "正前方" + "右后方" ), ALERT_WARNING_BOTTOM_LEFT( 7, - "正前方" + "左后方" ), ALERT_WARNING_TOP_LEFT( 8, - "正前方" + "左前方" ), ALERT_WARNING_ALL( 9, diff --git a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt index fb797931f6..7aeae52eef 100644 --- a/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt +++ b/modules/mogo-module-obu-mogo/src/main/java/com/mogo/module/obu/mogo/MogoPrivateObuManager.kt @@ -3,7 +3,6 @@ package com.mogo.module.obu.mogo import android.content.Context import android.util.Log import com.alibaba.android.arouter.launcher.ARouter -import com.mogo.commons.voice.AIAssist import com.mogo.module.common.datacenter.SnapshotLocationDataCenter import com.mogo.module.common.drawer.TrafficMarkerDrawer import com.mogo.module.common.enums.EventTypeEnum @@ -567,8 +566,6 @@ class MogoPrivateObuManager private constructor() { } - private var isStrikeTts = false - /** * 构造对应展示数据和场景 根据obu的场景,add change delete确定是否展示 * @@ -677,32 +674,31 @@ class MogoPrivateObuManager private constructor() { } when (status) { - // 添加, add的时候,可能级别是2, - ObuConstants.STATUS.ADD -> { - Log.d( - MogoObuConst.TAG_MOGO_OBU, - "appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" - ) - //显示警告红边 - mIMoGoWaringProvider?.showWarning(direction) - //显示弹框,语音提示 - mIMoGoWaringProvider?.showWarningV2X( - appId, - alertContent, - if (level == 2||level == 3) ttsContent else "", - appId.toString() - ) - if (level == 2||level == 3) { - isStrikeTts = true - } - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 - TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { - TrafficMarkerDrawer.updateITrafficInfo(it) + // 添加,更新 add的时候,可能级别是2, + ObuConstants.STATUS.ADD, + ObuConstants.STATUS.UPDATE -> { + if (level == 2 || level == 3) { + Log.d( + MogoObuConst.TAG_MOGO_OBU, + "appId2 = $appId --- level = $level ---ttsContent = $ttsContent --- alertContent = $alertContent --- direction = $direction" + ) + //显示警告红边 + mIMoGoWaringProvider?.showWarning(direction) + //显示弹框,语音提示 + mIMoGoWaringProvider?.showWarningV2X( + appId, + alertContent, + ttsContent, + appId.toString() + ) + //更新周边车辆进行预警颜色变换,车辆实时移动和变色 + TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { + TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) + } } } // 删除 ObuConstants.STATUS.DELETE -> { - isStrikeTts = false // 关闭警告红边 mIMoGoWaringProvider!!.showWarning(WarningDirectionEnum.ALERT_WARNING_NON) // 移除顶部弹窗 @@ -713,19 +709,6 @@ class MogoPrivateObuManager private constructor() { TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) } } - // 更新 - else -> { - //显示警告红边 - mIMoGoWaringProvider?.showWarning(direction) - if (!isStrikeTts) { - AIAssist.getInstance(mContext).speakTTSVoice(ttsContent) - isStrikeTts = true - } - //更新周边车辆进行预警颜色变换,车辆实时移动和变色 - TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let { - TrafficMarkerDrawer.updateITrafficThreatLevelInfo(it) - } - } } }