[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

@@ -76,7 +76,7 @@ class DispatchAutoPilotManager private constructor() :
MogoAiCloudSocketManager.getInstance(context)
.registerOnMessageListener(MSG_SOCKET_TYPE, this)
// 添加自动驾驶按钮选中监听
CallerHmiListenerManager.addCheckAutoPilotBtnListener(TAG, this)
CallerHmiListenerManager.addListener(TAG, this)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
// 添加 ADAS状态 监听
@@ -86,7 +86,7 @@ class DispatchAutoPilotManager private constructor() :
fun release() {
// 添加自动驾驶按钮选中监听
CallerHmiListenerManager.removeCheckAutoPilotBtnListener(TAG)
CallerHmiListenerManager.removeListener(TAG)
// 添加 规划路径相关回调 监听
CallerAutopilotPlanningListenerManager.removeListener(TAG)
// 添加 ADAS状态 监听

View File

@@ -28,7 +28,7 @@ import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LO
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_TRAFFIC_LIGHT
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_TRAJECTORY
import com.mogo.eagle.core.data.deva.chain.ChainConstant.Companion.CHAIN_LINK_LOG_WEB_SOCKET_VEHICLE
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeArriveAtStation
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.invokeAutoPilotStatus
@@ -38,18 +38,15 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotActionsListenerManager.invokeAutopilotAbility
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager.invokeAutopilotCarConfigData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager.invokeAutopilotCarStateData
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyDataUpdate
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotIdentifyPlanningObj
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager.invokeAutopilotWarnMessage
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningActionsListenerManager.invokePNCActions
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotRotting
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPlanningListenerManager.invokeAutopilotTrajectory
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotPointCloudListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordConfig
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotRecordListenerManager.invokeAutopilotRecordResult
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotStatisticsListenerManager.invokeAutopilotStatistics
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerStartAutopilotFailedListenerManager.invokeStartAutopilotFailed
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
@@ -158,9 +155,9 @@ class MoGoAdasListenerImpl : OnAdasListener {
if (vehicleState != null) {
//转向灯数据
CallerAutopilotVehicleStateListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
CallerChassisLamplightListenerManager.invokeAutopilotLightSwitchData(vehicleState.light)
//刹车灯数据
CallerAutopilotVehicleStateListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
CallerChassisLamplightListenerManager.invokeAutopilotBrakeLightData(vehicleState.brakeLightStatus)
//方向盘转向角数据
CallerAutopilotVehicleStateListenerManager.invokeAutopilotSteeringData(vehicleState.steering)
//挂挡档位数据

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.data.constants.MoGoConfig;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener;
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener;
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarStatusListenerManager;
@@ -31,7 +32,8 @@ import mogo.telematics.pad.MessagePad;
public class MoGoHandAdasMsgManager implements
IMoGoAutopilotVehicleStateListener,
IMoGoAutopilotCarConfigListener,
IMoGoAutopilotCarStateListener {
IMoGoAutopilotCarStateListener,
IMoGoChassisLamplightListener {
private final String TAG = "AdasEventManager";

View File

@@ -22,7 +22,7 @@ class AsyncDataToAutopilotServer private constructor() : IMoGoTrafficLightListen
}
fun initServer() {
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
CallerTrafficLightListenerManager.addListener(TAG, this)
}
override fun onTrafficLightStatus(trafficLightResult: TrafficLightResult) {

View File

@@ -1,21 +1,32 @@
package com.zhjt.mogo_core_function_devatools.status.flow.can
import android.content.*
import android.content.Context
import android.util.Log
import chassis.Chassis.GearPosition
import chassis.Chassis.LightSwitch
import chassis.VehicleStateOuterClass
import com.mogo.eagle.core.function.api.autopilot.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.utilcode.kotlin.*
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager
import com.mogo.eagle.core.utilcode.kotlin.safeCancel
import com.zhjt.mogo_core_function_devatools.status.entity.CanStatus
import kotlinx.coroutines.*
import com.zhjt.mogo_core_function_devatools.status.flow.IFlow
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import mogo_msg.MogoReportMsg.MogoReportMessage
import system_master.SystemStatusInfo.StatusInfo
import java.util.concurrent.atomic.*
import java.util.concurrent.atomic.AtomicInteger
internal class CanImpl(ctx: Context): IFlow<CanStatus>(ctx), IMoGoAutopilotVehicleStateListener, IMoGoAutopilotStatusListener {
internal class CanImpl(ctx: Context):
IFlow<CanStatus>(ctx),
IMoGoAutopilotVehicleStateListener,
IMoGoAutopilotStatusListener,
IMoGoChassisLamplightListener{
companion object {
const val TAG = "CanImpl"

View File

@@ -49,14 +49,14 @@ class PncActionsView @JvmOverloads constructor(
super.onAttachedToWindow()
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerAutopilotPlanningActionsListenerManager.addListener(TAG, this)
CallerTrafficLightListenerManager.registerTrafficLightListener(TAG, this)
CallerTrafficLightListenerManager.addListener(TAG, this)
}
override fun onDetachedFromWindow() {
super.onDetachedFromWindow()
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerAutopilotPlanningActionsListenerManager.removeListener(TAG)
CallerTrafficLightListenerManager.unRegisterTrafficLightListener(TAG)
CallerTrafficLightListenerManager.removeListener(TAG)
}
override fun onAutopilotStatusResponse(autoPilotStatusInfo: AutopilotStatusInfo) {

View File

@@ -7,7 +7,6 @@ import android.content.ClipboardManager
import android.content.Context
import android.graphics.Color
import android.os.Build
import android.telecom.Call
import android.text.Html
import android.util.AttributeSet
import android.view.LayoutInflater
@@ -48,6 +47,7 @@ import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsFuncConfigListen
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.business.routeoverlay.*
import com.mogo.eagle.core.function.call.autopilot.*
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsFuncConfigListenerManager
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsListenerManager
@@ -60,6 +60,7 @@ import com.mogo.eagle.core.function.call.map.CallerSmpManager
import com.mogo.eagle.core.function.call.obu.CallerOBUManager
import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
import com.mogo.eagle.core.function.call.setting.CallerMoGoUiSettingManager
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.function.hmi.R
import com.mogo.eagle.core.function.hmi.ui.logcatch.ILogViewListener
import com.mogo.eagle.core.function.hmi.ui.logcatch.LogInfoView
@@ -71,18 +72,15 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.LogLevel
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr
import com.mogo.eagle.core.utilcode.mogo.toast.TipToast
import com.mogo.eagle.core.utilcode.util.*
import com.mogo.map.uicontroller.VisualAngleMode
import com.mogo.map.uicontroller.VisualAngleMode.*
import com.mogo.eagle.core.function.business.routeoverlay.*
import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager
import com.mogo.eagle.core.utilcode.mogo.permissions.BackgrounderPermission
import com.zhidao.easysocket.utils.L
import com.zhjt.mogo_core_function_devatools.env.*
import kotlinx.android.synthetic.main.view_debug_setting.view.*
import kotlinx.android.synthetic.main.view_debug_setting.view.tbRouteDynamicEffect
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.text.SimpleDateFormat
@@ -100,11 +98,17 @@ class DebugSettingView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyleAttr: Int = 0
) : ConstraintLayout(context, attrs, defStyleAttr), IMoGoObuStatusListener,
IMoGoAutopilotStatusListener, IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener, IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener,
IMoGoAutopilotVehicleStateListener, IMoGoDevaToolsFuncConfigListener {
) : ConstraintLayout(context, attrs, defStyleAttr),
IMoGoObuStatusListener,
IMoGoAutopilotStatusListener,
IMoGoAutopilotCarStateListener,
IMoGoMapLocationListener,
IMoGoAutopilotIdentifyListener,
IMoGoAutopilotPlanningListener,
IMoGoAutopilotVehicleStateListener,
IMoGoDevaToolsFuncConfigListener,
IMoGoChassisLamplightListener,
IMoGoDevaToolsListener{
private val TAG = "DebugSettingView"
@@ -197,6 +201,8 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotPlanningListenerManager.addListener(TAG, this)
//添加 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.addListener(TAG, this)
//添加 开发套件工具接口 监听
CallerDevaToolsListenerManager.addListener(TAG, this)
//添加 业务配置监听
CallerDevaToolsFuncConfigListenerManager.registerDevaToolsFuncConfigListener(
@@ -230,6 +236,8 @@ class DebugSettingView @JvmOverloads constructor(
CallerAutopilotPlanningListenerManager.removeListener(TAG)
// 移除 车辆底盘数据回调 监听
CallerAutopilotVehicleStateListenerManager.removeListener(TAG)
// 移除 开发套件工具接口 监听
CallerDevaToolsListenerManager.removeListener(TAG)
// 移除 业务配置监听
CallerDevaToolsFuncConfigListenerManager.unRegisterDevaToolsFuncConfigListener( FuncBizConfig.FOUNDATION, TAG)
@@ -1385,54 +1393,6 @@ class DebugSettingView @JvmOverloads constructor(
CallerDevaToolsManager.stopCatchLog()
}
}
CallerDevaToolsListenerManager.registerDevaToolsLogCatchListener(TAG,
object : IMoGoDevaToolsListener {
override fun onLogCatchStart() {
super.onLogCatchStart()
tbLogCatch.isChecked = true
}
override fun onLogCatchClose() {
super.onLogCatchClose()
tbLogCatch.isChecked = false
}
override fun onLogCatch(lineLog: String) {
logInfoView?.let {
if (logViewAttach) {
it.onLogCatch(lineLog)
}
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
//模块日志 tag 发生变化,需要更新对应 UI
setLogCheckedChangeListener()
}
override fun upgradeVersionUrls(urls: Map<String, String>?) {
//版本信息更新
urls?.let {
upgradeVersionList.clear()
it.iterator().forEach { map ->
val name =
if (map.key.contains("{")) map.key.replace("{", "") else map.key
val url = if (map.value.contains("}")) map.value.replace(
"}",
""
) else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(), url))
}
upgradeVersionList.sortByDescending { upgradeVersionEntity -> upgradeVersionEntity.name }
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
upgradeListAdapter?.notifyDataSetChanged()
}
}
})
/**
* 展示、关闭日志过滤面板
@@ -2233,5 +2193,50 @@ class DebugSettingView @JvmOverloads constructor(
fun showReportListWindow(show: Boolean)
}
override fun onLogCatchStart() {
super.onLogCatchStart()
tbLogCatch.isChecked = true
}
override fun onLogCatchClose() {
super.onLogCatchClose()
tbLogCatch.isChecked = false
}
override fun onLogCatch(lineLog: String) {
logInfoView?.let {
if (logViewAttach) {
it.onLogCatch(lineLog)
}
}
}
override fun fwThreadClose() {
refreshTraceInfo()
}
override fun moduleLogChanged(moduleTag: MutableMap<String, SceneModule>) {
//模块日志 tag 发生变化,需要更新对应 UI
setLogCheckedChangeListener()
}
override fun upgradeVersionUrls(urls: Map<String, String>?) {
//版本信息更新
urls?.let {
upgradeVersionList.clear()
it.iterator().forEach { map ->
val name =
if (map.key.contains("{")) map.key.replace("{", "") else map.key
val url = if (map.value.contains("}")) map.value.replace(
"}",
""
) else map.value
upgradeVersionList.add(UpgradeVersionEntity(name.trim(), url))
}
upgradeVersionList.sortByDescending { upgradeVersionEntity -> upgradeVersionEntity.name }
upgradeListAdapter?.setDada(dataFilter(upgradeVersionList))
upgradeListAdapter?.notifyDataSetChanged()
}
}
}

View File

@@ -1,5 +1,7 @@
package com.mogo.eagle.core.function.hmi.ui.widget;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
import android.content.Context;
import android.graphics.BlurMaskFilter;
import android.util.AttributeSet;
@@ -32,8 +34,6 @@ import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import system_master.SystemStatusInfo;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS_P;
/**
* @author Jing
* @description 方向盘
@@ -185,22 +185,6 @@ public class SteeringWheelView extends ConstraintLayout {
}
/**
* 车辆转向灯
* @param lightSwitch
*/
@Override
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
}
/**
* 刹车灯
* @param brakeLight
*/
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
}
/**
* 车辆加速度
* @param carAcc

View File

@@ -274,7 +274,7 @@ class SystemVersionView @JvmOverloads constructor(
return
}
CallerAutoPilotStatusListenerManager.addListener(TAG, this)
CallerBindingCarListenerManager.registerDevaToolsLogCatchListener(TAG,this)
CallerBindingCarListenerManager.addListener(TAG,this)
needQueryContainers = true
}
@@ -284,7 +284,7 @@ class SystemVersionView @JvmOverloads constructor(
return
}
CallerAutoPilotStatusListenerManager.removeListener(TAG)
CallerBindingCarListenerManager.unRegisterDevaToolsLogCatchListener(TAG)
CallerBindingCarListenerManager.removeListener(TAG)
needQueryContainers = false
}

View File

@@ -27,7 +27,6 @@ import org.jetbrains.annotations.NotNull;
import chassis.Chassis;
import chassis.VehicleStateOuterClass;
import mogo.telematics.pad.MessagePad;
/**
* @author Jing
@@ -127,26 +126,6 @@ public class TrafficDataView extends ConstraintLayout {
public void onSweeperFutianCleanSystemState(@NonNull VehicleStateOuterClass.SweeperFuTianCleanSystemState cleanSystemState) {
}
/**
* 车辆转向灯
* @param lightSwitch
*/
@Override
public void onAutopilotLightSwitchData(@org.jetbrains.annotations.Nullable Chassis.LightSwitch lightSwitch) {
if (lightSwitch != null) {
CallerLogger.INSTANCE.d(TAG, "车辆转向灯:" + lightSwitch.toString());
}
}
/**
* 刹车灯
* @param brakeLight
*/
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
CallerLogger.INSTANCE.d(TAG, "刹车灯:" + brakeLight);
}
/**
* 方向盘转向角 左+右-
* @param steering

View File

@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.main;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_HMI;
import android.app.NotificationManager;
import android.annotation.SuppressLint;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Process;
@@ -27,7 +27,6 @@ import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsManager;
import com.mogo.eagle.core.function.call.devatools.CallerDevaToolsUpgradeListenerManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager;
import com.mogo.eagle.core.function.hmi.R;
import com.mogo.eagle.core.function.msgbox.db.MsgBoxDb;
import com.mogo.eagle.core.function.overview.OverviewDb;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
@@ -136,6 +135,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
}).start();
}
// TODO 李小鹏 这里需要将逻辑抽离出去,单独使用更新服务控制
private void upgradeProgressListener() {
final NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
// builder.setSmallIcon(R.mipmap.icon1001);//todo emArrow 更换图标,去除地图下载图标的依赖关系
@@ -143,7 +143,7 @@ public abstract class MainMoGoApplication extends AbsMogoApplication {
builder.setContentText("正在下载");
final NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
CallerDevaToolsUpgradeListenerManager.INSTANCE.registerDevaToolsUpgradeListener(TAG, new IMogoDevaToolsUpgradeListener() {
CallerDevaToolsUpgradeListenerManager.INSTANCE.addListener(TAG, new IMogoDevaToolsUpgradeListener() {
@Override
public void onStart(@Nullable String url) {

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() {