[dev_arch_opt_3.0] 临时添加obu相关tts和消息的展示频率
This commit is contained in:
@@ -27,13 +27,27 @@ object V2xObuEventManager : IMoGoObuSaveMessageListener {
|
||||
CallerObuSaveMessageListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
private val obuDataMap = mutableMapOf<String, Long>()
|
||||
|
||||
/**
|
||||
* @param type 事件id,类似与uuid
|
||||
* @param content 事件内容
|
||||
* @param tts 事件语音播报
|
||||
* @param tts 事件语音播报 //30秒内同一个事件只出现一次 TODO 临时添加,后面宏宇统一在数据中心处理
|
||||
*/
|
||||
override fun onMoGoObuSaveMessage(type: String, content: String, tts: String, source: DataSourceType) {
|
||||
if (content.isNotEmpty()) {
|
||||
if (obuDataMap.containsKey(type)) {
|
||||
var oldTime = obuDataMap[type]
|
||||
var timeDiff = (System.currentTimeMillis() - oldTime!!) / 1000
|
||||
if (timeDiff < 30) {
|
||||
return
|
||||
}
|
||||
obuDataMap.remove(type)
|
||||
obuDataMap[type] = System.currentTimeMillis()
|
||||
} else {
|
||||
obuDataMap[type] = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
CallerMsgBoxManager.saveMsgBox(
|
||||
MsgBoxBean(
|
||||
MsgBoxType.V2X,
|
||||
|
||||
Reference in New Issue
Block a user