[dev_arch_opt_3.0] 添加必要的日志

This commit is contained in:
lixiaopeng
2023-02-27 15:19:45 +08:00
parent 6af8c12967
commit 9777008d46
4 changed files with 29 additions and 15 deletions

View File

@@ -39,6 +39,7 @@ import com.mogo.eagle.core.function.hmi.ui.widget.StatusBarView
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_HMI
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.zhjt.service_biz.BizConfig
@@ -87,6 +88,8 @@ class MoGoHmiProvider : IMoGoHmiProvider {
)
}
private val ttsMap = mutableMapOf<String, Long>()
/**
* 不展示顶部弹窗,其它保留
*/
@@ -99,6 +102,19 @@ class MoGoHmiProvider : IMoGoHmiProvider {
direction: WarningDirectionEnum,
expireTime: Long
) {
//30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
if (ttsMap.containsKey(v2xType)) {
var oldTime = ttsMap[v2xType]
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
if (timeDiff < 30) {
return
}
ttsMap.remove(v2xType)
ttsMap[v2xType] = System.currentTimeMillis()
} else {
ttsMap[v2xType] = System.currentTimeMillis()
}
CallerLogger.d("${SceneConstant.M_OBU}${TAG}", "warningV2X v2xType = $v2xType ---alertContent = $alertContent ---ttsContent = $ttsContent ")
val playTTS = !AppIdentityModeUtils.isPassenger(FunctionBuildConfig.appIdentityMode)
context?.let {
val warningContent = alertContent ?: EventTypeEnumNew.getWarningContent(v2xType)