This commit is contained in:
lixiaopeng
2021-09-09 19:39:58 +08:00
committed by chenfufeng
parent 2f409311d3
commit 69f1fb3916
2 changed files with 13 additions and 1 deletions

View File

@@ -95,6 +95,7 @@ class MoGoWarningFragment : MvpFragment<MoGoWarningContract.View?, WaringPresent
.show()
// 创建弹窗成功才进行TTS播报
Logger.d("MoGoWarningFragment", " mWarningFloat = " + mWarningFloat + "---ttsContent = " + ttsContent)
if (mWarningFloat != null && !TextUtils.isEmpty(ttsContent)) {
Logger.d("MoGoWarningFragment", "---> ttsContent = $ttsContent")
AIAssist.getInstance(activity)

View File

@@ -3,6 +3,7 @@ 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
@@ -537,6 +538,8 @@ class MogoPrivateObuManager private constructor() {
}
private var isStrikeTts = false
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
*
@@ -638,7 +641,7 @@ class MogoPrivateObuManager private constructor() {
}
when (status) {
// 添加
// 添加, add的时候可能级别是2
ObuConstants.STATUS.ADD -> {
//显示警告红边
mMogoServiceApis!!.v2XListenerManager.warningChangedForListenerWithDirection(
@@ -656,6 +659,9 @@ class MogoPrivateObuManager private constructor() {
if (level == 3) ttsContent else "",
appId.toString()
)
if (level == 3) {
isStrikeTts = true
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
TrafficMarkerDrawer.updateITrafficInfo(it)
@@ -663,6 +669,7 @@ class MogoPrivateObuManager private constructor() {
}
// 删除
ObuConstants.STATUS.DELETE -> {
isStrikeTts = false
// 移除顶部弹窗
mIMoGoWaringProvider?.disableWarningV2X(appId.toString())
// 移除地图元素
@@ -670,6 +677,10 @@ class MogoPrivateObuManager private constructor() {
}
// 更新
else -> {
if (!isStrikeTts) {
AIAssist.getInstance(mContext).speakTTSVoice(ttsContent)
isStrikeTts = true
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
TrafficMarkerDrawer.updateITrafficInfo(it)