[3.2.0] fix bug of track obj type init

This commit is contained in:
zhongchao
2023-05-31 11:21:09 +08:00
parent 5191cd4bf2
commit 734e7e3ae4
2 changed files with 15 additions and 6 deletions

View File

@@ -5,8 +5,9 @@ import android.os.Message
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.data.traffic.TrafficData
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.api.datacenter.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager.getAutoPilotStatusInfo
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotCarConfigListenerManager
import com.mogo.eagle.core.function.call.obu.CallerObuWarningListenerManager
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils.isTaxi
import com.mogo.eagle.core.utilcode.mogo.thread.WorkThreadHandler
@@ -16,7 +17,7 @@ import mogo.telematics.pad.MessagePad
import mogo.telematics.pad.MessagePad.TrackedObject
import mogo.yycp.api.proto.SocketDownData
object IdentifyFactory : Identify, IMoGoObuStatusListener {
object IdentifyFactory : Identify, IMoGoObuStatusListener, IMoGoAutopilotCarConfigListener {
private const val TAG = "IdentifyFactory"
@@ -35,8 +36,16 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
private var identify: Identify? = null
private var aiCloudIdentify: Identify? = null
init {
val dockerVersion = getAutoPilotStatusInfo().dockVersion
fun initType(){
drawType("默认开启感知优化,等待docker版本")
identify = UserIdentify.beautifyDataDrawer
aiCloudIdentify = AiIdentify.aiCloudDataDrawer
CallerAutopilotCarConfigListenerManager.addListener(TAG, this)
CallerObuWarningListenerManager.addListener(TAG, this)
}
override fun onAutopilotCarConfig(carConfigResp: MessagePad.CarConfigResp) {
val dockerVersion = carConfigResp.dockVersion
if (dockerVersion != null && dockerVersion.isNotEmpty()) {
try {
val version = ParseVersionUtils.parseVersion(true, dockerVersion)
@@ -54,8 +63,6 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
identify = UserIdentify.beautifyDataDrawer
}
}
aiCloudIdentify = AiIdentify.aiCloudDataDrawer
CallerObuWarningListenerManager.addListener(TAG, this)
}
@ChainLog(
@@ -182,4 +189,5 @@ object IdentifyFactory : Identify, IMoGoObuStatusListener {
message.obj = trafficData
mDrawerHandler.sendMessage(message)
}
}

View File

@@ -34,6 +34,7 @@ class MapIdentifySubscriber private constructor() : IMoGoSubscriber,
}
override fun onCrate() {
IdentifyFactory.initType()
CallerAutopilotIdentifyListenerManager.addListener(TAG, this)
CallerObuWarningListenerManager.addListener(TAG, this)
}