[CallerAutoPilotStatusListenerManager -> OchAutoPilotStatusListenerManager]
This commit is contained in:
yangyakun
2024-04-19 16:34:41 +08:00
parent 9606e5689d
commit fb2abb828b
27 changed files with 244 additions and 309 deletions

View File

@@ -46,6 +46,9 @@ import com.mogo.och.common.module.manager.socket.lan.bean.DPMsgType
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager
import com.mogo.och.common.module.manager.socket.cloud.OCHSocketMessageManager.pushAppOperationalMsgBox
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.common.module.manager.autopilot.autopilot.ArrivedStation
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
import com.mogo.och.common.module.network.OchCommonServiceCallback
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.startLoopAbnormalFactors
import com.mogo.och.common.module.manager.socket.cloud.AbnormalFactorsLoopManager.stopLoopAbnormalFactors
@@ -331,7 +334,7 @@ object BusPassengerModel {
private fun initListeners() {
// 2021.11.1重构自动驾驶 实现接口 IMoGoAutopilotStatusListener 注册监听 替换IMogoAdasOCHCallback接口
CallerAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
OchAutoPilotStatusListenerManager.addListener(TAG, mGoAutopilotStatusListener)
IntentManager.getInstance()
.registerIntentListener(ConnectivityManager.CONNECTIVITY_ACTION, mNetWorkIntentListener)
MogoStatusManager.getInstance().registerStatusChangedListener(
@@ -360,7 +363,7 @@ object BusPassengerModel {
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
MogoAiCloudSocketManager.getInstance(mContext)
.unregisterLifecycleListener(10010)
CallerAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
OchAutoPilotStatusListenerManager.removeListener(mGoAutopilotStatusListener)
CallerTelematicListenerManager.removeListener(TAG)
stopLoopAbnormalFactors()
}
@@ -471,8 +474,8 @@ object BusPassengerModel {
}
}
}
private val mGoAutopilotStatusListener: IMoGoAutopilotStatusListener =
object : IMoGoAutopilotStatusListener {
private val mGoAutopilotStatusListener: IOchAutopilotStatusListener =
object : IOchAutopilotStatusListener {
private var arriveAtEnd = false //乘客app专用字段
override fun onAutopilotStatusResponse(state: Int) {
if (state == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
@@ -499,7 +502,7 @@ object BusPassengerModel {
}
}
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivalNotification?) {
override fun onAutopilotArriveAtStation(arrivalNotification: ArrivedStation?) {
if (FunctionBuildConfig.isDemoMode
&& isPassenger(FunctionBuildConfig.appIdentityMode)
) {

View File

@@ -40,6 +40,8 @@ import com.mogo.och.data.bean.BusStationBean
import com.mogo.och.data.bean.BusTransferData
import com.mogo.och.bus.passenger.bean.PM2RoutesResponse
import com.mogo.och.bus.passenger.network.BusPassengerServiceManager
import com.mogo.och.common.module.manager.autopilot.autopilot.IOchAutopilotStatusListener
import com.mogo.och.common.module.manager.autopilot.autopilot.OchAutoPilotStatusListenerManager
import com.mogo.och.common.module.manager.distance.IDistanceListener
import com.mogo.och.common.module.manager.distance.TrajectoryAndDistanceManager
import com.mogo.och.common.module.manager.loop.BizLoopManager
@@ -109,7 +111,7 @@ class PM2DrivingModel private constructor() {
private fun initListener() {
//自动驾驶状态监听
CallerAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
OchAutoPilotStatusListenerManager.addListener(TAG, mAutoPilotStatusListener)
// 定位监听
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, 3, mMapLocationListener)
@@ -267,8 +269,8 @@ class PM2DrivingModel private constructor() {
mDrivingInfoCallback?.updateSpeed(speedKM)
}
private val mAutoPilotStatusListener: IMoGoAutopilotStatusListener =
object : IMoGoAutopilotStatusListener {
private val mAutoPilotStatusListener: IOchAutopilotStatusListener =
object : IOchAutopilotStatusListener {
override fun onAutopilotStatusResponse(state: Int) {
super.onAutopilotStatusResponse(state)