Merge branch 'dev_robotaxi-d_231205_6.2.6' into dev_robotaxi-d_231218_6.2.6
# Conflicts: # OCH/bus/passenger/src/jinlvvan/java/com/mogo/och/bus/passenger/MogoOCHBusPassenger.java
This commit is contained in:
@@ -2,6 +2,7 @@ package com.mogo.eagle.core.function.call.autopilot
|
||||
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchData
|
||||
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
|
||||
|
||||
@@ -11,7 +12,14 @@ import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
|
||||
object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsListener>() {
|
||||
@Volatile
|
||||
private var isConnected = false
|
||||
|
||||
@Volatile
|
||||
private var isAutopilotAbility: Boolean = false
|
||||
|
||||
@Volatile
|
||||
private var unableLaunchData: UnableLaunchData? = null
|
||||
|
||||
@Volatile
|
||||
private var unableAutopilotReasons: ArrayList<UnableLaunchReason>? = null
|
||||
|
||||
init {
|
||||
@@ -38,6 +46,15 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
|
||||
return isAutopilotAbility
|
||||
}
|
||||
|
||||
//获取域控发的原始数据,目前包括新老SSM和FM数据
|
||||
fun getOriginalData(): String {
|
||||
return unableLaunchData?.json ?: ""
|
||||
}
|
||||
|
||||
fun getUnableLaunchData(): UnableLaunchData? {
|
||||
return unableLaunchData
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取不能启动自驾的原因
|
||||
* null:表示没有任何原因证,证明isAutopilotAbility为true
|
||||
@@ -57,7 +74,9 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
|
||||
|
||||
@Synchronized
|
||||
fun invokeAutopilotAbility(
|
||||
isAutopilotAbility: Boolean, unableAutopilotReasons: ArrayList<UnableLaunchReason>?
|
||||
isAutopilotAbility: Boolean,
|
||||
unableLaunchData: UnableLaunchData,
|
||||
unableAutopilotReasons: ArrayList<UnableLaunchReason>?
|
||||
) {
|
||||
if (isConnected) {
|
||||
var isEquals = true
|
||||
@@ -73,6 +92,7 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
|
||||
!(unableAutopilotReasons != null || this.unableAutopilotReasons != null)
|
||||
if (this.isAutopilotAbility != isAutopilotAbility || !isEquals) {
|
||||
this.isAutopilotAbility = isAutopilotAbility
|
||||
this.unableLaunchData = unableLaunchData
|
||||
this.unableAutopilotReasons = unableAutopilotReasons
|
||||
notification()
|
||||
}
|
||||
@@ -82,7 +102,11 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
|
||||
private fun notification() {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAutopilotAbility(isAutopilotAbility, unableAutopilotReasons)
|
||||
listener.onAutopilotAbility(
|
||||
isAutopilotAbility,
|
||||
unableLaunchData,
|
||||
unableAutopilotReasons
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user