change the callerlogger

This commit is contained in:
zhongchao
2022-03-14 21:50:11 +08:00
parent e19ff59a89
commit 6102e55ed3
1315 changed files with 4162 additions and 61965 deletions

View File

@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.autopilot.AutopilotStatusInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import mogo_msg.MogoReportMsg
import java.util.concurrent.ConcurrentHashMap
@@ -16,7 +15,6 @@ import java.util.concurrent.ConcurrentHashMap
* 域控制器相关的回调监听
*/
object CallerAutoPilotStatusListenerManager : CallerBase() {
private val TAG = "CallerAutoPilotStatusListenerManager"
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mAutopilotStatusInfo: AutopilotStatusInfo = AutopilotStatusInfo()
@@ -49,7 +47,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotStatusListener
) {
if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
@@ -62,7 +59,6 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)
@@ -94,12 +90,10 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
*/
@Synchronized
fun invokeAutoPilotStatus(autopilotStatusInfo: AutopilotStatusInfo) {
//LogUtils.dTag(TAG, "$autopilotStatusInfo")
mAutopilotStatusInfo = autopilotStatusInfo
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotStatusResponse(mAutopilotStatusInfo)
}
}
@@ -122,11 +116,9 @@ object CallerAutoPilotStatusListenerManager : CallerBase() {
*/
@Synchronized
fun invokeAutopilotSNRequest() {
//LogUtils.dTag(TAG, "")
M_AUTOPILOT_STATUS_LISTENERS.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotSNRequest()
}
}

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
@@ -11,7 +10,6 @@ import java.util.concurrent.ConcurrentHashMap
* 车辆地盘数据 回调监听
*/
object CallerAutopilotCarConfigListenerManager : CallerBase() {
private val TAG = "CallerAutopilotCarConfigListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_CAR_CONFIG_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotCarConfigListener> =
@@ -27,7 +25,6 @@ object CallerAutopilotCarConfigListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotCarConfigListener
) {
if (M_AUTOPILOT_CAR_CONFIG_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_CAR_CONFIG_LISTENERS[tag] = listener
@@ -39,7 +36,6 @@ object CallerAutopilotCarConfigListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_CAR_CONFIG_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_CAR_CONFIG_LISTENERS.remove(tag)

View File

@@ -1,10 +1,8 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutopilotCarStateInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
@@ -14,7 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
* 车辆状态&定位 数据 数据 回调监听
*/
object CallerAutopilotCarStatusListenerManager : CallerBase() {
private val TAG = "CallerAutopilotCarStatusListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_STATUS_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotCarStateListener> =
@@ -31,7 +28,6 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotCarStateListener
) {
if (M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_STATUS_LISTENERS[tag] = listener
@@ -43,7 +39,6 @@ object CallerAutopilotCarStatusListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_STATUS_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_STATUS_LISTENERS.remove(tag)

View File

@@ -1,10 +1,8 @@
package com.mogo.eagle.core.function.call.autopilot
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.AutopilotWarnMessage
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotIdentifyListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import record_cache.RecordPanelOuterClass
import java.util.concurrent.ConcurrentHashMap
@@ -15,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
* 域控制器感知数据
*/
object CallerAutopilotIdentifyListenerManager : CallerBase() {
private val TAG = "CallerAutopilotIdentifyListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_IDENTIFY_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotIdentifyListener> =
@@ -31,7 +28,6 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotIdentifyListener
) {
if (M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_IDENTIFY_LISTENERS[tag] = listener
@@ -43,7 +39,6 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_IDENTIFY_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_IDENTIFY_LISTENERS.remove(tag)
@@ -65,7 +60,7 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
* 识别交通元素数据发生更新 回调
*/
@Synchronized
fun invokeAutopilotIdentifyDataUpdate(trafficData: ArrayList<MessagePad.TrackedObject>?) {
fun invokeAutopilotIdentifyDataUpdate(trafficData: List<MessagePad.TrackedObject>?) {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value
@@ -92,7 +87,6 @@ object CallerAutopilotIdentifyListenerManager : CallerBase() {
M_AUTOPILOT_IDENTIFY_LISTENERS.forEach {
val tag = it.key
val listener = it.value
LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotRecordResult(recordPanel)
}
}

View File

@@ -4,7 +4,6 @@ import androidx.annotation.Nullable
import com.mogo.eagle.core.data.autopilot.ADASTrajectoryInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotPlanningListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import mogo.telematics.pad.MessagePad
import java.util.concurrent.ConcurrentHashMap
@@ -14,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
* 规划路径相关回调
*/
object CallerAutopilotPlanningListenerManager : CallerBase() {
private val TAG = "CallerAutopilotPlanningListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_PLANNING_LISTENER: ConcurrentHashMap<String, IMoGoAutopilotPlanningListener> =
@@ -31,7 +29,6 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotPlanningListener
) {
if (M_AUTOPILOT_PLANNING_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_PLANNING_LISTENER[tag] = listener
@@ -43,7 +40,6 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_PLANNING_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_PLANNING_LISTENER.remove(tag)
@@ -67,11 +63,9 @@ object CallerAutopilotPlanningListenerManager : CallerBase() {
*/
@Synchronized
fun invokeAutopilotTrajectory(trajectoryInfo: ArrayList<ADASTrajectoryInfo>) {
//LogUtils.dTag(TAG, "$trajectoryInfo")
M_AUTOPILOT_PLANNING_LISTENER.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onAutopilotTrajectory(trajectoryInfo)
}
}

View File

@@ -4,14 +4,12 @@ import androidx.annotation.Nullable
import chassis.Chassis
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotVehicleStateListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
* 车辆地盘数据 回调监听
*/
object CallerAutopilotVehicleStateListenerManager : CallerBase() {
private val TAG = "CallerAutopilotVehicleStateListenerManager"
// 存储所有注册了监听的对象invokeXXXX进行遍历回调将信息同步
private val M_AUTOPILOT_VEHICLE_LISTENERS: ConcurrentHashMap<String, IMoGoAutopilotVehicleStateListener> =
@@ -27,7 +25,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
@Nullable listener: IMoGoAutopilotVehicleStateListener
) {
if (M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_AUTOPILOT_VEHICLE_LISTENERS[tag] = listener
@@ -39,7 +36,6 @@ object CallerAutopilotVehicleStateListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!M_AUTOPILOT_VEHICLE_LISTENERS.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_AUTOPILOT_VEHICLE_LISTENERS.remove(tag)

View File

@@ -3,7 +3,7 @@ package com.mogo.eagle.core.function.call.base;
import com.alibaba.android.arouter.facade.template.IProvider;
import com.alibaba.android.arouter.launcher.ARouter;
import com.mogo.eagle.core.function.call.CallerBusManager;
import com.mogo.eagle.core.utilcode.util.LogUtils;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
/**
* @author xiaoyuzhou
@@ -23,7 +23,7 @@ public class CallerBase {
T newInst = (T) ARouter.getInstance().build(path).navigation();
try {
CallerBusManager.registerApi(clazz, newInst);
LogUtils.dTag(TAG, "keep IProvider instance to SingletonHolder: path = %s", path);
CallerLogger.INSTANCE.d(TAG, "keep IProvider instance to SingletonHolder: path :" + path);
} catch (Exception e) {
e.printStackTrace();
}

View File

@@ -2,13 +2,10 @@ package com.mogo.eagle.core.function.call.devatools
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.devatools.IMoGoDevaToolsListener
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
object CallerDevaToolsListenerManager {
private const val TAG = "CallDevaToolsListenerManager"
private val M_DEVA_TOOLS_LISTENER: ConcurrentHashMap<String, IMoGoDevaToolsListener> =
ConcurrentHashMap()
@@ -22,7 +19,6 @@ object CallerDevaToolsListenerManager {
@Nullable listener: IMoGoDevaToolsListener
) {
if (M_DEVA_TOOLS_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_DEVA_TOOLS_LISTENER[tag] = listener
@@ -34,7 +30,6 @@ object CallerDevaToolsListenerManager {
*/
fun unRegisterDevaToolsLogCatchListener(@Nullable tag: String) {
if (!M_DEVA_TOOLS_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_DEVA_TOOLS_LISTENER.remove(tag)
@@ -46,7 +41,6 @@ object CallerDevaToolsListenerManager {
*/
fun unRegisterDevaToolsLogCatchListener(@Nullable listener: IMoGoDevaToolsListener) {
if (!M_DEVA_TOOLS_LISTENER.containsValue(listener)) {
LogUtils.eTag(TAG, "listener:$listener not exists")
return
}
M_DEVA_TOOLS_LISTENER.forEach {

View File

@@ -1,9 +1,8 @@
package com.mogo.eagle.core.function.call.devatools
import android.view.View
import com.mogo.eagle.core.data.autopilot.AutoPilotRecordResult
import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainLogParam
import com.mogo.eagle.core.data.chain.ChainLogParam
import com.mogo.eagle.core.function.api.devatools.IDevaToolsProvider
import com.mogo.eagle.core.function.call.base.CallerBase
import record_cache.RecordPanelOuterClass

View File

@@ -1,93 +0,0 @@
package com.mogo.eagle.core.function.call.devatools.scene
import android.util.ArrayMap
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ADAS
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_DEVA
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_NETWORK
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_OTHER
import com.mogo.eagle.core.data.deva.scene.SceneConstant.Companion.M_ROUTE
import com.mogo.eagle.core.data.deva.scene.SceneLogCache
import java.util.*
class Scene {
companion object {
private val sceneCache: MutableMap<String, SceneLogCache> =
Collections.synchronizedMap(ArrayMap())
val scene: Scene by lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
Scene()
}
}
init {
//初始化网络
val networkMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_NETWORK] = networkMap
//初始化ADAS
val adasMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_ADAS] = adasMap
//初始化deva
val devaMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_DEVA] = devaMap
//初始化路径规划
val routeMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_ROUTE] = routeMap
//初始化其他模块,方便定位索引
val otherMap = SceneLogCache(mutableMapOf(), true)
sceneCache[M_OTHER] = otherMap
}
fun check(tag: String): Boolean {
return if (canLog()) {
classifyLog(tag)
} else {
false
}
}
//前置收口
private fun canLog(): Boolean {
return true
}
/**
* log分类,现阶段通过控制模块等级来限制,后续有需要再细分至模块对应类层级
*/
private fun classifyLog(tag: String): Boolean {
var moduleName: String? = null
var businessName: String? = null
if (tag.contains("_")) {
val tagSplit = tag.split("_")
moduleName = tagSplit[0]
if (tagSplit.size > 1) {
businessName = tagSplit[1]
}
}
if (moduleName.isNullOrEmpty()) {
val otherLogCache = sceneCache[M_OTHER]
otherLogCache!!.tagMap!![tag] = true
return otherLogCache.logger
}
if (businessName.isNullOrEmpty()) {
return false
}
//此处存在用户自定义方式,可根据过滤找到对应不符合标准的模块
var logCache = sceneCache[moduleName]
if (logCache == null) {
logCache = SceneLogCache(mutableMapOf(), true)
logCache.tagMap!![businessName] = true
}
sceneCache[moduleName] = logCache
return logCache.logger
}
}

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.call.hmi
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.hmi.autopilot.IMoGoCheckAutoPilotBtnListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
@@ -13,8 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
*/
object CallerHmiListenerManager : CallerBase() {
private val TAG = "CallerHmiListenerManager"
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mIsChecked: Boolean = false
@@ -33,7 +30,6 @@ object CallerHmiListenerManager : CallerBase() {
@Nullable listener: IMoGoCheckAutoPilotBtnListener
) {
if (mAutoPilotBtnListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
mAutoPilotBtnListeners[tag] = listener
@@ -46,7 +42,6 @@ object CallerHmiListenerManager : CallerBase() {
*/
fun removeCheckAutoPilotBtnListener(@Nullable tag: String) {
if (!mAutoPilotBtnListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
mAutoPilotBtnListeners.remove(tag)
@@ -57,12 +52,10 @@ object CallerHmiListenerManager : CallerBase() {
* @param isChecked 选中状态
*/
fun invokeCheckAutoPilotBtnListener(isChecked: Boolean) {
//LogUtils.dTag(TAG, "isChecked:$isChecked")
mIsChecked = isChecked
mAutoPilotBtnListeners.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onCheck(mIsChecked)
}
}

View File

@@ -1,32 +0,0 @@
package com.mogo.eagle.core.function.call.logger
import com.mogo.eagle.core.function.call.devatools.scene.Scene.Companion.scene
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
object CallerLogger {
fun i(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.i(tag, message, any)
}
}
fun d(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.d(tag, message, any)
}
}
fun w(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.w(tag, message, any)
}
}
fun e(tag: String, message: String, any: Any? = null) {
if (scene.check(tag)) {
Logger.e(tag, message, any)
}
}
}

View File

@@ -1,11 +1,9 @@
package com.mogo.eagle.core.function.call.map
import android.util.Log
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.map.MogoLocation
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapLocationListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
@@ -14,7 +12,6 @@ import java.util.concurrent.ConcurrentHashMap
* 地图 位置改变 监听管理
*/
object CallerMapLocationListenerManager : CallerBase() {
private val TAG = "CallerMapLocationListenerManager"
// 记录地图最后一次位置
private var mLocation: MogoLocation? = null
@@ -40,7 +37,6 @@ object CallerMapLocationListenerManager : CallerBase() {
@Nullable listener: IMoGoMapLocationListener
) {
if (mMapStyleChangeListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
mMapStyleChangeListeners[tag] = listener
@@ -53,7 +49,6 @@ object CallerMapLocationListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!mMapStyleChangeListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
mMapStyleChangeListeners.remove(tag)
@@ -65,7 +60,6 @@ object CallerMapLocationListenerManager : CallerBase() {
*/
fun removeListener(@Nullable listener: IMoGoMapLocationListener) {
if (!mMapStyleChangeListeners.containsValue(listener)) {
LogUtils.eTag(TAG, "Tag:$listener not exists")
return
}
mMapStyleChangeListeners.forEach {
@@ -87,18 +81,10 @@ object CallerMapLocationListenerManager : CallerBase() {
* @param location 选中状态
*/
fun invokeMapLocationChangeListener(location: MogoLocation?) {
//LogUtils.dTag(TAG, "mapStyleMode:$location")
// val longitude = "${location?.longitude}"
// if (longitude.length>12){
// Log.e("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
// }else{
// Log.w("DHY-location", "${location?.longitude},${location?.latitude} CallerMapLocationListenerManager-invokeMapLocationChangeListener")
// }
mLocation = location
mMapStyleChangeListeners.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onLocationChanged(location)
}
}

View File

@@ -3,7 +3,6 @@ package com.mogo.eagle.core.function.call.map
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.map.listener.IMoGoMapStyleChangeListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
@@ -12,7 +11,6 @@ import java.util.concurrent.ConcurrentHashMap
* 地图 样式改变 监听管理
*/
object CallerMapStyleListenerManager : CallerBase() {
private val TAG = "CallerMapStyleListenerManager"
// 记录地图样式
private var mMapStyleMode = 0
@@ -38,7 +36,6 @@ object CallerMapStyleListenerManager : CallerBase() {
@Nullable listener: IMoGoMapStyleChangeListener
) {
if (mMapStyleChangeListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
mMapStyleChangeListeners[tag] = listener
@@ -51,7 +48,6 @@ object CallerMapStyleListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!mMapStyleChangeListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
mMapStyleChangeListeners.remove(tag)
@@ -63,7 +59,6 @@ object CallerMapStyleListenerManager : CallerBase() {
*/
fun removeListener(@Nullable listener: IMoGoMapStyleChangeListener) {
if (!mMapStyleChangeListeners.containsValue(listener)) {
LogUtils.eTag(TAG, "Tag:$listener not exists")
return
}
mMapStyleChangeListeners.forEach {
@@ -85,12 +80,10 @@ object CallerMapStyleListenerManager : CallerBase() {
* @param mapStyleMode 选中状态
*/
fun invokeMapStyleChange(mapStyleMode: Int) {
//LogUtils.dTag(TAG, "mapStyleMode:$mapStyleMode")
mMapStyleMode = mapStyleMode
mMapStyleChangeListeners.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onMapStyleModeChange(mMapStyleMode)
}
}

View File

@@ -5,7 +5,6 @@ import com.mogo.eagle.core.data.obu.ObuStatusInfo
import com.mogo.eagle.core.function.api.obu.IMoGoObuStatusListener
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
/**
@@ -14,7 +13,6 @@ import java.util.concurrent.ConcurrentHashMap
* OBU 监听管理
*/
object CallerObuListenerManager : CallerBase() {
private val TAG = "CallerObuListenerManager"
// 存储最后一次回调的数据,当有新当位置注册了监听将此数据回调过去,防止有些模块注册顺序问题导致无法获取最新状态
private var mObuStatusInfo: ObuStatusInfo = ObuStatusInfo()
@@ -47,7 +45,6 @@ object CallerObuListenerManager : CallerBase() {
@Nullable listener: IMoGoObuStatusListener
) {
if (mObuStatusListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
mObuStatusListeners[tag] = listener
@@ -60,7 +57,6 @@ object CallerObuListenerManager : CallerBase() {
*/
fun removeListener(@Nullable tag: String) {
if (!mObuStatusListeners.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
mObuStatusListeners.remove(tag)
@@ -72,7 +68,6 @@ object CallerObuListenerManager : CallerBase() {
*/
fun removeListener(@Nullable listener: IMoGoObuStatusListener) {
if (!mObuStatusListeners.containsValue(listener)) {
LogUtils.eTag(TAG, "Tag:$listener not exists")
return
}
mObuStatusListeners.forEach {
@@ -94,12 +89,10 @@ object CallerObuListenerManager : CallerBase() {
* @param obuStatusInfo 选中状态
*/
fun invokeListener(obuStatusInfo: ObuStatusInfo) {
//LogUtils.dTag(TAG, "obuStatusInfo:$obuStatusInfo")
mObuStatusInfo = obuStatusInfo
mObuStatusListeners.forEach {
val tag = it.key
val listener = it.value
//LogUtils.dTag(TAG, "tag:$tag listener:$listener")
listener.onObuStatusResponse(mObuStatusInfo)
}
}

View File

@@ -3,13 +3,10 @@ package com.mogo.eagle.core.function.call.trafficlight
import androidx.annotation.Nullable
import com.mogo.eagle.core.data.trafficlight.TrafficLightResult
import com.mogo.eagle.core.function.api.trafficlight.IMoGoTrafficLightListener
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
object CallTrafficLightListenerManager {
private const val TAG = "CallTrafficLightListenerManager"
private val M_TRAFFIC_LIGHT_LISTENER: ConcurrentHashMap<String, IMoGoTrafficLightListener> =
ConcurrentHashMap()
@@ -25,7 +22,6 @@ object CallTrafficLightListenerManager {
@Nullable listener: IMoGoTrafficLightListener
) {
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
trafficLightResult?.let {
@@ -40,7 +36,6 @@ object CallTrafficLightListenerManager {
*/
fun unRegisterTrafficLightListener(@Nullable tag: String) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
@@ -52,7 +47,6 @@ object CallTrafficLightListenerManager {
*/
fun unRegisterTrafficLightListener(@Nullable listener: IMoGoTrafficLightListener) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
LogUtils.eTag(TAG, "listener:$listener not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.forEach {
@@ -72,7 +66,6 @@ object CallTrafficLightListenerManager {
@Nullable listener: IMoGoTrafficLightListener
) {
if (M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
M_TRAFFIC_LIGHT_LISTENER[tag] = listener
@@ -84,7 +77,6 @@ object CallTrafficLightListenerManager {
*/
fun unRegisterEnterCrossRoadListener(@Nullable tag: String) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.remove(tag)
@@ -96,7 +88,6 @@ object CallTrafficLightListenerManager {
*/
fun unRegisterEnterCrossRoadListener(@Nullable listener: IMoGoTrafficLightListener) {
if (!M_TRAFFIC_LIGHT_LISTENER.containsValue(listener)) {
LogUtils.eTag(TAG, "listener:$listener not exists")
return
}
M_TRAFFIC_LIGHT_LISTENER.forEach {
@@ -110,7 +101,6 @@ object CallTrafficLightListenerManager {
this.trafficLightResult = trafficLightResult
M_TRAFFIC_LIGHT_LISTENER.forEach {
val tag = it.key
//LogUtils.dTag(TAG, "invokeTrafficLightStatus tag is : $tag")
val listener = it.value
listener.onTrafficLightStatus(trafficLightResult)
}

View File

@@ -2,13 +2,10 @@ package com.mogo.eagle.core.function.call.vip
import androidx.annotation.Nullable
import com.mogo.eagle.core.function.api.vip.IMoGoVipSetListener
import com.mogo.eagle.core.utilcode.util.LogUtils
import java.util.concurrent.ConcurrentHashMap
object CallVipSetListenerManager {
private const val TAG = "CallVipSetListenerManager"
private val M_VIP_SET_LISTENER: ConcurrentHashMap<String, IMoGoVipSetListener> =
ConcurrentHashMap()
@@ -24,7 +21,6 @@ object CallVipSetListenerManager {
@Nullable listener: IMoGoVipSetListener
) {
if (M_VIP_SET_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag already exists,please use other tag")
return
}
listener.onVipSet(vipSet)
@@ -37,7 +33,6 @@ object CallVipSetListenerManager {
*/
fun unRegisterVipSetListener(@Nullable tag: String) {
if (!M_VIP_SET_LISTENER.containsKey(tag)) {
LogUtils.eTag(TAG, "Tag:$tag not exists")
return
}
M_VIP_SET_LISTENER.remove(tag)
@@ -49,7 +44,6 @@ object CallVipSetListenerManager {
*/
fun unRegisterVipSetListener(@Nullable listener: IMoGoVipSetListener) {
if (!M_VIP_SET_LISTENER.containsValue(listener)) {
LogUtils.eTag(TAG, "listener:$listener not exists")
return
}
M_VIP_SET_LISTENER.forEach {