Merge branch 'dev_robotaxi-d_240523_6.4.4' of gitlab.zhidaoauto.com:SCA/L4HA/AndroidApp/MoGoEagleEye into dev_robotaxi-d_240523_6.4.4

This commit is contained in:
xinfengkun
2024-06-05 18:09:24 +08:00
26 changed files with 364 additions and 286 deletions

View File

@@ -69,12 +69,19 @@ object DataManager {
}
/**
* FSM消息(缓存数据库时使用)
* FM消息(缓存数据库时使用)
*/
private val fmInfoList by lazy {
mutableListOf<MsgBoxBean>()
}
/**
* FSM消息(缓存数据库时使用)
*/
private val fsmInfoList by lazy {
mutableListOf<MsgBoxBean>()
}
private val scope by lazy {
Utils.getApp().lifeCycleScope
}
@@ -149,6 +156,13 @@ object DataManager {
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg)
}
MsgBoxType.FSM -> {
synchronized(this) {
fsmInfoList.add(msg)
}
CallerMsgBoxListenerManager.invokeListener(MsgCategory.NOTICE, msg)
}
MsgBoxType.SSMINFO -> {// 不存数据库
CallerMsgBoxListenerManager.invokeListener(MsgCategory.SYS_INFO, msg)
}
@@ -346,6 +360,18 @@ object DataManager {
}
}
MsgBoxType.FSM.ordinal -> {
return@map MsgBoxBean(
MsgBoxType.FSM,
GsonUtils.fromJson(json, FSMMsg::class.java)
).apply {
this.timestamp = msgInfo.timeStamp
withContext(Dispatchers.Main) {
cacheNotifyList.add(this@apply)
}
}
}
else -> {
return@map null
}
@@ -396,6 +422,13 @@ object DataManager {
fmInfoList.clear()
}
if (fsmInfoList.isNotEmpty()) {
fsmInfoList.forEach {
msgInfoList.add(MsgBoxInfo(it.bean2Json, it.type.ordinal, it.timestamp))
}
fsmInfoList.clear()
}
if (msgInfoList.isNotEmpty()) {
MsgBoxDb.getDb(context)
.monitorDao()