[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

@@ -1,13 +1,45 @@
package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.msgbox.FSMMsg
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.trace.CallerTrace
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
import kotlin.properties.Delegates
object CallerAutopilotStatisticsListenerManager : CallerBase<IMoGoAutopilotStatisticsListener>() {
private var autopilotStatistics: AutopilotStatistics? by Delegates.observable(null) { _, _, newV ->
newV?.let {
if (!FunctionBuildConfig.isDemoMode && FunctionBuildConfig.isTakeoverRemind &&
it.status == AutopilotStatistics.AUTOPILOT_START_STATUS.FAILED) {
CallerMsgBoxManager.saveMsgBox(
MsgBoxBean(
MsgBoxType.FSM,
FSMMsg(
0,
"自动驾驶启动失败",
it.failedMessage.msg,
System.currentTimeMillis()
)
)
)
} else {
CallerTrace.write("AutopilotStatistics", mapOf("autopilotStatistics" to it,
"isDemoMode" to FunctionBuildConfig.isDemoMode,
"isTakeoverRemind" to FunctionBuildConfig.isTakeoverRemind))
}
}
}
@Synchronized
fun invokeAutopilotStatistics(statistics: AutopilotStatistics?) {
autopilotStatistics = statistics
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatistics(statistics)