[2.13.0-arch-opt]v2x code style
This commit is contained in:
@@ -16,7 +16,7 @@ import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
*/
|
||||
object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocationGCJ02Listener>() {
|
||||
|
||||
val TAG = "CallerChassisLocationGCJ20ListenerManager"
|
||||
private const val TAG = "CallerChassisLocationGCJ20ListenerManager"
|
||||
|
||||
@Volatile
|
||||
private var mGnssInfo: MogoLocation? = null
|
||||
@@ -36,6 +36,8 @@ object CallerChassisLocationGCJ02ListenerManager : CallerBase<IMoGoChassisLocati
|
||||
setListenerHz(tag, callBackHz)
|
||||
}
|
||||
|
||||
//todo 宏宇 添加HZ的移除操作
|
||||
|
||||
fun getChassisLocationGCJ02(): MogoLocation? {
|
||||
return mGnssInfo
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.mogo.eagle.core.function.call.biz
|
||||
|
||||
import androidx.annotation.MainThread
|
||||
import com.mogo.eagle.core.data.map.Infrastructure
|
||||
import com.mogo.eagle.core.data.v2x.V2XEvent
|
||||
import com.mogo.eagle.core.function.api.v2x.IFuncBizProvider
|
||||
import com.mogo.eagle.core.data.v2x.V2XEventData
|
||||
import com.mogo.eagle.core.function.api.biz.IFuncBizProvider
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerFuncBizListenerManager: CallerBase<IFuncBizProvider>() {
|
||||
@@ -24,10 +24,10 @@ object CallerFuncBizListenerManager: CallerBase<IFuncBizProvider>() {
|
||||
}
|
||||
|
||||
@MainThread
|
||||
fun invokeV2XEvents(v2xEvents: List<V2XEvent>?) {
|
||||
fun invokeV2XEvents(v2XEventData: List<V2XEventData>?) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onV2XEvents(v2xEvents)
|
||||
listener.onV2XEvents(v2XEventData)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +1,26 @@
|
||||
package com.mogo.eagle.core.function.call.cloud
|
||||
|
||||
import com.mogo.eagle.core.data.v2x.V2XEvent
|
||||
import com.mogo.eagle.core.function.api.cloud.IMoGoCloudListener
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
object CallerCloudListenerManager {
|
||||
|
||||
private val M_CLOUD_LISTENER: ConcurrentHashMap<String, IMoGoCloudListener> =
|
||||
ConcurrentHashMap()
|
||||
|
||||
/**
|
||||
* 添加监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
* @param listener 监听回调
|
||||
*/
|
||||
fun registerCloudListener(
|
||||
tag: String,
|
||||
listener: IMoGoCloudListener
|
||||
) {
|
||||
if (M_CLOUD_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_CLOUD_LISTENER[tag] = listener
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param tag 标记,用来注销监听使用
|
||||
*/
|
||||
fun unRegisterCloudListener(tag: String) {
|
||||
if (!M_CLOUD_LISTENER.containsKey(tag)) {
|
||||
return
|
||||
}
|
||||
M_CLOUD_LISTENER.remove(tag)
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除监听
|
||||
* @param listener 要删除的监听对象
|
||||
*/
|
||||
fun unRegisterCloudListener(listener: IMoGoCloudListener) {
|
||||
if (!M_CLOUD_LISTENER.containsValue(listener)) {
|
||||
return
|
||||
}
|
||||
M_CLOUD_LISTENER.forEach {
|
||||
if (it.value == listener) {
|
||||
M_CLOUD_LISTENER.remove(it.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
object CallerCloudListenerManager : CallerBase<IMoGoCloudListener>() {
|
||||
|
||||
/**
|
||||
* 分发获取到的设备sn
|
||||
*/
|
||||
fun invokeCloudTokenGot(token: String, sn: String) {
|
||||
M_CLOUD_LISTENER.forEach {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.tokenGot(token, sn)
|
||||
}
|
||||
}
|
||||
|
||||
fun invokeSocketAck(event: V2XEvent) {
|
||||
M_LISTENERS.forEach {
|
||||
val listener = it.value
|
||||
listener.onAck(event)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,9 +14,6 @@ import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
* 小地图调用者管理,这里对外及其他模块提供小地图功能的调用,用啥写啥,不要过度设计,不允许直接将Provider暴露出去
|
||||
*/
|
||||
object CallerSmpManager : CallerBase<Any>() {
|
||||
// private val mogoSmallMapProvider: IMogoSmallMapProvider
|
||||
// get() = ARouter.getInstance().build(MoGoFragmentPaths.PATH_FRAGMENT_SMP)
|
||||
// .navigation() as IMogoSmallMapProvider
|
||||
|
||||
private val v2xProvider: IV2XEventProvider
|
||||
get() = ARouter.getInstance().build(MogoServicePaths.PATH_V2X_MODULE)
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package com.mogo.eagle.core.function.call.msgbox
|
||||
|
||||
import androidx.annotation.Nullable
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxEventListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
import java.util.concurrent.ConcurrentHashMap
|
||||
|
||||
/**
|
||||
* @author XuXinChao
|
||||
|
||||
@@ -2,7 +2,7 @@ package com.mogo.eagle.core.function.call.msgbox
|
||||
|
||||
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
|
||||
import com.mogo.eagle.core.data.msgbox.MsgCategory
|
||||
import com.mogo.eagle.core.function.api.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.api.datacenter.msgbox.IMsgBoxListener
|
||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.msgbox
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.constants.MogoServicePaths
|
||||
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.call.base.CallerBase
|
||||
|
||||
object CallerMsgBoxManager {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.mogo.eagle.core.function.call.v2x
|
||||
|
||||
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.base.CallerBase
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.v2x
|
||||
import com.mogo.eagle.core.data.enums.DataSourceType
|
||||
import com.mogo.eagle.core.data.enums.TrafficLightEnum
|
||||
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.base.CallerBase
|
||||
|
||||
object CallerTrafficLightListenerManager : CallerBase<IMoGoTrafficLightListener>() {
|
||||
|
||||
Reference in New Issue
Block a user