[dev_arch_opt_3.0]

[Change]
[1、将Call中注册,反注册操作下沉CallerBase]

Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
donghongyu
2023-01-04 20:00:32 +08:00
parent 9559cfc131
commit 06810f339c
54 changed files with 373 additions and 1454 deletions

View File

@@ -83,10 +83,9 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
}
fun listenTrafficLight() {
CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
CallerTrafficLightListenerManager.addListener(TAG, this)
CallerMapLocationListenerManager.addListener(TAG, this, false)
CallVipSetListenerManager.registerVipSetListener(TAG, this)
CallVipSetListenerManager.addListener(TAG, this)
}
private fun handleRedLightWarning(
@@ -269,9 +268,8 @@ class RedLightWarningManager : IMoGoTrafficLightListener, IMoGoVipSetListener,
}
fun onDestroy() {
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
CallVipSetListenerManager.unRegisterVipSetListener(TAG)
CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
CallVipSetListenerManager.removeListener(TAG)
CallerTrafficLightListenerManager.removeListener(TAG)
CallerMapLocationListenerManager.removeListener(TAG,false)
}

View File

@@ -33,12 +33,8 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh
fun initServer(context: Context){
mContext = context
//注册监听AI云获取红绿灯状态
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
//注册监听AI云进入路口
CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
//注册监听红绿灯请求失败
CallerTrafficLightListenerManager.registerTrafficRequestErrorListener(TAG,this)
//注册监听AI云获取红绿灯状态,注册监听AI云进入路口,注册监听红绿灯请求失败
CallerTrafficLightListenerManager.addListener(TAG, this)
//注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
}
@@ -122,14 +118,10 @@ class TrafficLightDispatcher : IMoGoAutopilotIdentifyListener , IMoGoTrafficLigh
fun destroy(){
//取消注册监听AI云获取红绿灯状态
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
//取消注册监听AI云获取红绿灯状态,取消注册监听红绿灯请求失败,取消注册监听AI云进入路口
CallerTrafficLightListenerManager.removeListener(TAG)
//取消注册监听工控机感知红绿灯
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
//取消注册监听红绿灯请求失败
CallerTrafficLightListenerManager.unRegisterTrafficRequestErrorListener(TAG)
//取消注册监听AI云进入路口
CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
}
}

View File

@@ -14,7 +14,10 @@ import com.mogo.eagle.core.data.enums.EventTypeEnum
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.data.msgbox.V2XMsg
import com.mogo.eagle.core.data.trafficlight.*
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.data.trafficlight.currentRoadTrafficLight
import com.mogo.eagle.core.data.trafficlight.isGreen
import com.mogo.eagle.core.data.trafficlight.isRed
import com.mogo.eagle.core.data.v2x.VipMessage
import com.mogo.eagle.core.function.api.hmi.warning.IMoGoWarningStatusListener
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
@@ -155,8 +158,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
)
CallerHmiManager.vipIdentification(true)
CallVipSetListenerManager.invokeVipSetStatus(true)
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
CallerTrafficLightListenerManager.registerEnterCrossRoadListener(TAG, this)
CallerTrafficLightListenerManager.addListener(TAG, this)
}
private fun cancelVip() {
@@ -167,8 +169,7 @@ class VipCarManager : IMogoOnMessageListener<VipMessage>, IMoGoTrafficLightListe
resetConditions()
CallerHmiManager.vipIdentification(false)
CallVipSetListenerManager.invokeVipSetStatus(false)
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
CallerTrafficLightListenerManager.unRegisterEnterCrossRoadListener(TAG)
CallerTrafficLightListenerManager.removeListener(TAG)
}
private fun requestVip() {