[2.13.0-arch-opt]v2x code style
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.mogo.eagle.core.function.datacenter.aicloud
|
||||
|
||||
import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.cloud.socket.SocketManager
|
||||
import com.mogo.commons.AbsMogoApplication
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
import com.mogo.eagle.core.function.api.base.IMoGoFunctionServerProvider
|
||||
|
||||
@Route(path = MogoServicePaths.PATH_AI_CLOUD)
|
||||
class AiCloudSocketBizProvider : IMoGoFunctionServerProvider {
|
||||
override val functionName: String
|
||||
get() = "AiCloudSocketBizProvider"
|
||||
|
||||
override fun init(context: Context?) {
|
||||
SocketManager.getInstance().init(AbsMogoApplication.getApp(), 0.0, 0.0)
|
||||
SocketManager.getInstance().registerOnMessageListener(401012, V2XMessageListener401012())
|
||||
SocketManager.getInstance().registerOnMessageListener(401018, V2XMessageListener401018())
|
||||
SocketManager.getInstance().registerOnMessageListener(402000, V2XMessageListener402000())
|
||||
SocketManager.getInstance().registerOnMessageListener(404000, V2XMessageListener404000())
|
||||
//SocketManager.getInstance().registerOnMessageListener(503000, V2XMessageListener503000())
|
||||
SocketManager.getInstance().registerOnMessageListener(70001, V2XMessageListener70001())
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.mogo.eagle.core.function.datacenter.aicloud
|
||||
|
||||
import com.mogo.cloud.socket.IMogoCloudSocketOnMessageListener
|
||||
import com.mogo.eagle.core.data.v2x.*
|
||||
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
|
||||
import roadwork.Road
|
||||
|
||||
internal class V2XMessageListener70001: IMogoCloudSocketOnMessageListener<V2XRoadXData> {
|
||||
|
||||
override fun target(msgType: Int): Class<V2XRoadXData> = V2XRoadXData::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: V2XRoadXData?) {
|
||||
if (msgType != 70001) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.RoadEventX(data = data))
|
||||
}
|
||||
}
|
||||
|
||||
internal class V2XMessageListener401012: IMogoCloudSocketOnMessageListener<V2XMarkerCardResult> {
|
||||
|
||||
override fun target(msgType: Int): Class<V2XMarkerCardResult> = V2XMarkerCardResult::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: V2XMarkerCardResult?) {
|
||||
if (msgType != 401012) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.Road(data = data))
|
||||
}
|
||||
}
|
||||
|
||||
internal class V2XMessageListener401018: IMogoCloudSocketOnMessageListener<V2XWarningTarget> {
|
||||
|
||||
override fun target(msgType: Int): Class<V2XWarningTarget> = V2XWarningTarget::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: V2XWarningTarget?) {
|
||||
if (msgType != 401018) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.Warning(data = data))
|
||||
}
|
||||
}
|
||||
|
||||
internal class V2XMessageListener402000: IMogoCloudSocketOnMessageListener<V2XOptimalRoute> {
|
||||
|
||||
override fun target(msgType: Int): Class<V2XOptimalRoute> = V2XOptimalRoute::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: V2XOptimalRoute?) {
|
||||
if (msgType != 402000) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.OptimalRoute(data = data))
|
||||
}
|
||||
}
|
||||
|
||||
internal class V2XMessageListener404000: IMogoCloudSocketOnMessageListener<V2XAdvanceWarning> {
|
||||
|
||||
override fun target(msgType: Int): Class<V2XAdvanceWarning> = V2XAdvanceWarning::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: V2XAdvanceWarning?) {
|
||||
if (msgType != 404000) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.ForwardsWarning(data = data))
|
||||
}
|
||||
}
|
||||
|
||||
internal class V2XMessageListener503000: IMogoCloudSocketOnMessageListener<Road.RW_PB> {
|
||||
|
||||
override fun target(msgType: Int): Class<Road.RW_PB> = Road.RW_PB::class.java
|
||||
|
||||
override fun onMsgReceived(msgType: Int, data: Road.RW_PB?) {
|
||||
if (msgType != 503000) {
|
||||
return
|
||||
}
|
||||
if (data == null) {
|
||||
return
|
||||
}
|
||||
CallerCloudListenerManager.invokeSocketAck(V2XEvent.RoadAI(data = data))
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.adapter
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.commons.debug.DebugConfig.*
|
||||
import com.mogo.eagle.core.data.config.FunctionBuildConfig
|
||||
@@ -27,12 +28,15 @@ class MoGoAdasMsgConnectStatusListenerImpl :
|
||||
OnAdasConnectStatusListener,
|
||||
IMoGoAutopilotStatusListener,
|
||||
IMoGoCloudListener {
|
||||
private val TAG = "ConnectStatus"
|
||||
|
||||
companion object{
|
||||
private const val TAG = "ConnectStatus"
|
||||
}
|
||||
|
||||
private var connectStatus = false
|
||||
|
||||
init {
|
||||
CallerCloudListenerManager.registerCloudListener(TAG, this)
|
||||
CallerCloudListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
override fun onConnectionIPCStatus(ipcConnectionStatus: Int, reason: String?) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.datacenter.autopilot.server
|
||||
|
||||
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.datacenter.v2x
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.function.api.v2x.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.ILimitingVelocityListener
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerLimitingVelocityListenerManager
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,7 +6,7 @@ import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
import com.mogo.eagle.core.data.trafficlight.*
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
|
||||
import com.mogo.eagle.core.function.api.v2x.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.union.IMoGoTrafficLightListener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListenerManager
|
||||
import com.mogo.eagle.core.function.call.v2x.CallerTrafficLightListenerManager
|
||||
import perception.TrafficLightOuterClass
|
||||
|
||||
@@ -4,7 +4,7 @@ import android.content.Context
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths.PATH_MSG_BOX_MODULE
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxProvider
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxProvider
|
||||
import com.mogo.eagle.core.function.msgbox.DataManager.saveAllMessages2Disk
|
||||
|
||||
@Route(path = PATH_MSG_BOX_MODULE)
|
||||
|
||||
Reference in New Issue
Block a user