[2.13.2]fix bug of aicloud fusion problem and add limit of visual long sight
This commit is contained in:
@@ -1,17 +1,19 @@
|
||||
package com.mogo.eagle.core.function.business.ai
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener
|
||||
import com.mogo.cloud.socket.SocketManager
|
||||
import com.mogo.cloud.socket.entity.SocketDownData.SocketDownDataProto
|
||||
import com.mogo.aicloud.services.socket.IMogoOnMessageListener
|
||||
import com.mogo.aicloud.services.socket.MogoAiCloudSocketManager
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.business.ai.net.AiCloudIdentifyNetWorkModel
|
||||
import com.mogo.eagle.core.function.business.identify.MapIdentifySubscriber
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapIdentifyManager
|
||||
import com.mogo.eagle.core.function.call.map.CallerMapUIServiceManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
|
||||
import com.mogo.map.listener.IMogoMapListener
|
||||
import com.mogo.map.uicontroller.VisualAngleMode
|
||||
import com.mogo.module.common.MogoApisHandler
|
||||
import com.mogo.realtime.constant.RealTimeConstant
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
|
||||
class AiCloudIdentifyDataManager : IMogoMapListener {
|
||||
|
||||
@@ -32,16 +34,20 @@ class AiCloudIdentifyDataManager : IMogoMapListener {
|
||||
|
||||
fun init(mContext: Context) {
|
||||
MogoApisHandler.getInstance().apis.registerCenterApi.registerMogoMapListener(TAG, this)
|
||||
SocketManager.getInstance()
|
||||
MogoAiCloudSocketManager.getInstance(mContext)
|
||||
.registerOnMessageListener(
|
||||
RealTimeConstant.LOW_FREQUENCY_CHANNEL_ID,
|
||||
object : IMogoCloudSocketOnMessageListener<SocketDownDataProto> {
|
||||
override fun target(msgType: Int): Class<SocketDownDataProto> {
|
||||
return SocketDownDataProto::class.java
|
||||
0x040003, //低频数据
|
||||
object : IMogoOnMessageListener<SocketDownData.SocketDownDataProto> {
|
||||
override fun target(): Class<SocketDownData.SocketDownDataProto> {
|
||||
return SocketDownData.SocketDownDataProto::class.java
|
||||
}
|
||||
|
||||
override fun onMsgReceived(msgType: Int, obj: SocketDownDataProto?) {
|
||||
override fun onMsgReceived(obj: SocketDownData.SocketDownDataProto?) {
|
||||
CallerLogger.d("$M_MAP$TAG", "SocketDownDataProto obj : $obj")
|
||||
if(!FunctionBuildConfig.isDrawAiCloudFusion){
|
||||
MapIdentifySubscriber.instance.clearAiCloudRoma()
|
||||
return
|
||||
}
|
||||
obj?.let {
|
||||
obj.data?.let {
|
||||
if (showAiCloud) {
|
||||
@@ -74,9 +80,14 @@ class AiCloudIdentifyDataManager : IMogoMapListener {
|
||||
|
||||
override fun onMapVisualAngleChanged(visualAngleMode: VisualAngleMode) {
|
||||
super.onMapVisualAngleChanged(visualAngleMode)
|
||||
showAiCloud = when {
|
||||
visualAngleMode.isLongSight -> true
|
||||
else -> false
|
||||
when {
|
||||
visualAngleMode.isLongSight -> {
|
||||
showAiCloud = true
|
||||
}
|
||||
else -> {
|
||||
showAiCloud = false
|
||||
CallerMapIdentifyManager.clearAiCloudRoma()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import com.mogo.cloud.socket.entity.SocketDownData
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
|
||||
interface Identify {
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import androidx.collection.ArraySet
|
||||
import com.mogo.cloud.socket.entity.SocketDownData
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.commons.module.status.MogoStatusManager
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.w
|
||||
import com.mogo.map.MogoMarkerManager
|
||||
import mogo.telematics.pad.MessagePad.PlanningObject
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
class IdentifyAiCloudDataDrawer : Identify {
|
||||
@@ -62,7 +62,7 @@ class IdentifyAiCloudDataDrawer : Identify {
|
||||
it.remove()
|
||||
mMarkersCaches.remove(key)
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.removeMarker(key)
|
||||
.removeMarker(key.hashCode().toString())
|
||||
}
|
||||
|
||||
val filterList = filterTrafficData(resultList)
|
||||
@@ -86,15 +86,19 @@ class IdentifyAiCloudDataDrawer : Identify {
|
||||
val uuid = "" + data.uuid
|
||||
mMarkersCaches[uuid] = data
|
||||
trafficDataUuidList.add(uuid)
|
||||
mFilterTrafficData[uuid] = data
|
||||
}
|
||||
return mFilterTrafficData
|
||||
}
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
override fun clearAiMarker() {
|
||||
if(trafficDataUuidList.size == 0){
|
||||
return
|
||||
}
|
||||
for (uuid in trafficDataUuidList) {
|
||||
MogoMarkerManager.getInstance(AbsMogoApplication.getApp())
|
||||
.removeMarker(uuid)
|
||||
.removeMarker(uuid.hashCode().toString())
|
||||
}
|
||||
trafficDataUuidList.clear()
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import com.mogo.cloud.socket.entity.SocketDownData
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.traffic.TrafficData
|
||||
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
|
||||
@@ -10,6 +9,7 @@ import com.mogo.eagle.core.function.call.obu.CallerObuListenerManager
|
||||
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
|
||||
object IdentifyFactory : Identify, IMoGoObuStatusListener {
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.mogo.eagle.core.function.business.identify
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.socket.entity.SocketDownData
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_IDENTIFY
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
@@ -13,6 +12,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
import mogo.yycp.api.proto.SocketDownData
|
||||
|
||||
/**
|
||||
* 订阅感知数据的订阅者
|
||||
|
||||
Reference in New Issue
Block a user