[Change]
迁移感知绘制数据监听MapIdentifySubscriber Signed-off-by: donghongyu <donghongyu@zhidaoauto.com>
This commit is contained in:
@@ -38,7 +38,7 @@ public class MapFrameController implements IMogoMapFrameController {
|
||||
|
||||
@Override
|
||||
public void init(Context context) {
|
||||
|
||||
MapIdentifySubscriber.Companion.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.mogo.eagle.core.function.map
|
||||
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoSubscriber
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.module.common.drawer.IdentifyDataDrawer
|
||||
import mogo.telematics.pad.MessagePad
|
||||
import mogo.telematics.pad.MessagePad.TrackedObject
|
||||
|
||||
/**
|
||||
* 订阅感知数据的订阅者
|
||||
* 数据来源:工控机、OBU、云端下发
|
||||
*
|
||||
* @author donghongyu
|
||||
*/
|
||||
class MapIdentifySubscriber private constructor() : IMoGoSubscriber, IMoGoAutopilotIdentifyListener {
|
||||
|
||||
private val TAG = "MapIdentifySubscriber"
|
||||
|
||||
init {
|
||||
onCrate()
|
||||
}
|
||||
|
||||
companion object {
|
||||
val instance: MapIdentifySubscriber by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
|
||||
MapIdentifySubscriber()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCrate() {
|
||||
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
|
||||
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
CallerAutopilotIdentifyListenerManager.removeListener(TAG)
|
||||
|
||||
}
|
||||
|
||||
override fun onAutopilotIdentifyDataUpdate(trafficData: List<TrackedObject>?) {
|
||||
try {
|
||||
if (FunctionBuildConfig.isDrawIdentifyData) {
|
||||
ThreadUtils.getSinglePool().execute { IdentifyDataDrawer.getInstance().renderAdasRecognizedResult(trafficData) }
|
||||
} else {
|
||||
IdentifyDataDrawer.getInstance().clearOldMarker()
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onAutopilotWarnMessage(warn: MessagePad.Warn?) {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user