[6.4.4] increase the autopilot statistics status notice in msgbox

This commit is contained in:
EmArrow
2024-06-04 18:31:22 +08:00
parent 78ad824b9e
commit b01178831d
8 changed files with 253 additions and 3 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()