This commit is contained in:
lixiaopeng
2021-09-09 19:39:58 +08:00
parent a9b8555388
commit ef1b7f3b93
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.WarningTypeEnum
@@ -538,6 +539,8 @@ class MogoPrivateObuManager private constructor() {
}
private var isStrikeTts = false
/**
* 构造对应展示数据和场景 根据obu的场景add change delete确定是否展示
*
@@ -639,7 +642,7 @@ class MogoPrivateObuManager private constructor() {
}
when (status) {
// 添加
// 添加, add的时候可能级别是2
ObuConstants.STATUS.ADD -> {
//显示警告红边
mMogoServiceApis!!.v2XListenerManager.warningChangedForListenerWithDirection(
@@ -657,6 +660,9 @@ class MogoPrivateObuManager private constructor() {
if (level == 3) ttsContent else "",
appId.toString()
)
if (level == 3) {
isStrikeTts = true
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
TrafficMarkerDrawer.updateITrafficInfo(it)
@@ -664,6 +670,7 @@ class MogoPrivateObuManager private constructor() {
}
// 删除
ObuConstants.STATUS.DELETE -> {
isStrikeTts = false
// 移除顶部弹窗
mIMoGoWaringProvider?.disableWarningV2X(appId.toString())
// 移除地图元素
@@ -671,6 +678,10 @@ class MogoPrivateObuManager private constructor() {
}
// 更新
else -> {
if (!isStrikeTts) {
AIAssist.getInstance(mContext).speakTTSVoice(ttsContent)
isStrikeTts = true
}
//更新周边车辆进行预警颜色变换,车辆实时移动和变色
TrafficDataConvertUtils.cvxV2vThreatIndInfo2TrafficData(info)?.let {
TrafficMarkerDrawer.updateITrafficInfo(it)