[6.1.0] map add trace
This commit is contained in:
@@ -25,6 +25,7 @@ import com.mogo.eagle.core.utilcode.util.ThreadUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.map.listener.MogoMapListenerHandler.Companion.mogoMapListenerHandler
|
||||
import com.mogo.map.uicontroller.*
|
||||
import com.mogo.map.utils.MapTraceUtil
|
||||
import com.mogo.map.utils.MogoMapUtils
|
||||
import com.mogo.map.utils.ObjectUtils
|
||||
import com.zhidaoauto.map.data.point.LonLatPoint
|
||||
@@ -50,6 +51,7 @@ import com.zhidaoauto.map.sdk.open.tools.MapTools.getVisibleRegion
|
||||
import com.zhidaoauto.map.sdk.open.tools.MapTools.toScreenLocation
|
||||
import com.zhidaoauto.map.sdk.open.view.MapAutoView
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import java.util.concurrent.atomic.AtomicInteger
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIController,
|
||||
@@ -221,7 +223,7 @@ class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIControlle
|
||||
invokeRoadChange(1, newValue)
|
||||
return@let
|
||||
}
|
||||
if((newValue!!.cross_id_end.isNotEmpty() && oldValue.cross_id_end != newValue.cross_id_end)){
|
||||
if ((newValue!!.cross_id_end.isNotEmpty() && oldValue.cross_id_end != newValue.cross_id_end)) {
|
||||
//路口发生变化
|
||||
i("$M_MAP$TAG", "路段发生变化 上个:${oldValue.cross_id_end} , 下个:${newValue.cross_id_end}")
|
||||
invokeRoadChange(2, newValue)
|
||||
@@ -554,9 +556,25 @@ class AMapViewWrapper(mMapView: MapAutoView) : IMogoMapView, IMogoMapUIControlle
|
||||
}
|
||||
}
|
||||
|
||||
private var reChangeIconCount = AtomicInteger(0)
|
||||
|
||||
override fun changeCurrentIcon(iconId: Int) {
|
||||
if (checkAMapView()) {
|
||||
mMapView.getMapAutoViewHelper()!!.getMyLocationStyle()!!.myLocationIcon(iconId, true)
|
||||
val changeResult = mMapView.getMapAutoViewHelper()!!.getMyLocationStyle()!!
|
||||
.myLocationIcon(iconId, true)
|
||||
if (!changeResult) {
|
||||
val count = reChangeIconCount.incrementAndGet()
|
||||
MapTraceUtil.log(
|
||||
"", ChainConstant.CHAIN_CODE_HD_MAP_ICON_SET, TAG,
|
||||
mapOf("changeCurrentIcon-count" to "$count")
|
||||
)
|
||||
if (count >= 3) {
|
||||
return
|
||||
}
|
||||
UiThreadHandler.postDelayed({ changeCurrentIcon(iconId) }, 3000L,
|
||||
UiThreadHandler.MODE.QUEUE)
|
||||
reChangeIconCount.set(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.mogo.map.utils
|
||||
|
||||
import com.mogo.commons.debug.DebugConfig
|
||||
import com.mogo.eagle.core.data.deva.chain.ChainConstant
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
|
||||
import com.zhjt.service.chain.ChainLog
|
||||
import com.zhjt.service.chain.ChildNodeAlias
|
||||
import com.zhjt.service.chain.ParentNodeAlias
|
||||
|
||||
class MapTraceUtil {
|
||||
|
||||
companion object {
|
||||
|
||||
fun log(pN: String, cN: String, data: Any, data1: Any, end: Boolean = true) {
|
||||
if (end) {
|
||||
logEnd(pN, cN, data, data1)
|
||||
} else {
|
||||
realLog(pN, cN, data, data1)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
paramIndexes = [2, 3],
|
||||
endPoint = false
|
||||
)
|
||||
private fun realLog(
|
||||
@ParentNodeAlias pN: String,
|
||||
@ChildNodeAlias cN: String,
|
||||
data: Any,
|
||||
data1: Any
|
||||
) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.d("${SceneConstant.M_MAP}$data", data1)
|
||||
}
|
||||
}
|
||||
|
||||
@ChainLog(
|
||||
linkChainLog = ChainConstant.CHAIN_TYPE_HD_MAP,
|
||||
linkCode = ChainConstant.CHAIN_SOURCE_MAP,
|
||||
paramIndexes = [2, 3]
|
||||
)
|
||||
private fun logEnd(
|
||||
@ParentNodeAlias pN: String,
|
||||
@ChildNodeAlias cN: String,
|
||||
data: Any,
|
||||
data1: Any
|
||||
) {
|
||||
if (DebugConfig.isDebug()) {
|
||||
CallerLogger.d("${SceneConstant.M_MAP}$data", data1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user