[660][adas][data-center] FSM与Can Adapter自动驾驶状态兼容,鹰眼全局自动驾驶状态新增来源字段,新增Can Adapter自驾状态回调接口

This commit is contained in:
xinfengkun
2024-08-23 15:21:14 +08:00
parent 9b39ee7244
commit 45d5576288
12 changed files with 111 additions and 26 deletions

View File

@@ -145,9 +145,23 @@ object CallerAutoPilotStatusListenerManager : CallerBase<IMoGoAutopilotStatusLis
mAutopilotStatusInfo.locationStatus = true
invokeAutoPilotStatus()
}
private var autopilotStateFromCan: Int by Delegates.observable(0) { _, oldValue, newValue ->
if (oldValue != newValue) {
CallerTrace.write("AutoPilotStatusFromCan", mapOf("AutoPilotStatusFromCan" to newValue))
M_LISTENERS.forEach {
val listener = it.value
listener.onAutopilotStatusResponseFromCan(newValue)
}
}
}
fun updateAutoPilotStatus(autopilotState: Int, autopilotMode: Int) {
fun updateAutoPilotStatusFromCan(autopilotState: Int) {
this.autopilotStateFromCan = autopilotState
}
fun updateAutoPilotStatus(autopilotStateSource: Int,autopilotState: Int, autopilotMode: Int) {
mAutopilotStatusInfo.state = autopilotState
mAutopilotStatusInfo.autopilotStateSource = autopilotStateSource
this.autopilotState = autopilotState
mAutopilotStatusInfo.pilotmode = autopilotMode
invokeAutoPilotStatus()