[6.3.0][V2N新链路] 添加调试日志

This commit is contained in:
renwj
2024-03-11 18:58:51 +08:00
parent aa4f03d91e
commit 883af483e9

View File

@@ -3,6 +3,7 @@ package com.mogo.eagle.function.biz.v2x.v2n.pnc
import android.os.Handler
import android.os.HandlerThread
import android.os.Message
import android.util.Log
import androidx.core.util.Pair
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.data.enums.CommunicationType
@@ -30,6 +31,7 @@ import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager.saveMsgBox
import com.mogo.eagle.core.utilcode.util.CoordinateTransform
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.function.biz.v2x.V2XBizTrace
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker
import com.mogo.eagle.function.biz.v2x.v2n.scenario.scene.airoad.AiRoadMarker.Marker
@@ -57,6 +59,11 @@ internal object V2NIdentifyDrawer {
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu" to ""), true)
return@Callback true
}
if (msg.what == MSG_WHAT_DRAW_SHIGONE) {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGong --- 1 ---")
} else {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- 1 ---")
}
val car = CallerChassisLocationWGS84ListenerManager.getChassisLocationWGS84()
val filtered = events.filterIsInstance(TrackedObject::class.java).filter { itx ->
DrivingDirectionUtils.getDegreeOfCar2Poi(
@@ -68,9 +75,19 @@ internal object V2NIdentifyDrawer {
) < 90
}
if (filtered.isEmpty()) {
if (msg.what == MSG_WHAT_DRAW_SHIGONE) {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGong --- filter is empty return ---")
} else {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- filter is empty return---")
}
V2XBizTrace.onAck(TAG, mapOf("shiGong-shiGu-filter" to ""), true)
return@Callback true
}
if (msg.what == MSG_WHAT_DRAW_SHIGONE) {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGong --- 2 ---:data: ${ filtered.joinToString(",") { GsonUtils.toJson(it) } }")
} else {
Log.d("V2NIdentifyDrawer", "---callback -- drawShiGu --- 2 ---data: ${ filtered.joinToString(",") { GsonUtils.toJson(it) } }")
}
filtered.forEach { itx ->
val id = itx.uuid.toString()
AiRoadMarker.aiMakers.getOrPut(id) {
@@ -157,8 +174,10 @@ internal object V2NIdentifyDrawer {
}.receive()
}
} else if (msg.what == MSG_WHAT_DRAW_YONGDU) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 1 ---")
val events = msg.obj as? List<*>
if (events == null || events.isEmpty()) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 1 filter is empty ---")
V2XBizTrace.onAck(TAG, mapOf("yongDu" to ""), true)
return@Callback true
}
@@ -179,9 +198,11 @@ internal object V2NIdentifyDrawer {
) < 90
}
if (filtered.isEmpty()) {
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 2 filter is empty ---")
V2XBizTrace.onAck(TAG, mapOf("yongDu-filter" to ""), true)
return@Callback true
}
Log.d("V2NIdentifyDrawer", "---callback -- drawYongDu --- 2 ---data: ${ filtered.joinToString(",") }")
filtered.forEach { itx ->
val id = itx.rteId.toString()
val lon = itx.eventPos?.offsetLL?.positionLatLon?.lon?.let { it * 1.0 / 10_000_000 }
@@ -344,13 +365,16 @@ internal object V2NIdentifyDrawer {
}
private fun drawShiGong(events: List<TrackedObject>) {
Log.d("V2NIdentifyDrawer", "---drawShiGong --- 1 ---:${events.size}, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]")
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
Log.d("V2NIdentifyDrawer", "---drawShiGong --- 2 ---")
handler.removeMessages(MSG_WHAT_DRAW_SHIGONE)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGONE, events))
}
}
private fun drawShiGu(events: List<TrackedObject>) {
Log.d("V2NIdentifyDrawer", "---drawShiGu --- 1 ---:${events.size}, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]")
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
handler.removeMessages(MSG_WHAT_DRAW_SHIGU)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_SHIGU, events))
@@ -358,6 +382,7 @@ internal object V2NIdentifyDrawer {
}
private fun drawYongDu(events: List<MogoV2X.RTEData_PB>) {
Log.d("V2NIdentifyDrawer", "---drawYongDu --- 1 ---:${events.size}, [${FunctionBuildConfig.v2nMainSwitch}, ${FunctionBuildConfig.isNewV2NData}]")
if (V2NCarTypeCheck.verifyCarType() && FunctionBuildConfig.v2nMainSwitch && FunctionBuildConfig.isNewV2NData) {
handler.removeMessages(MSG_WHAT_DRAW_YONGDU)
handler.sendMessage(Message.obtain(handler, MSG_WHAT_DRAW_YONGDU, events))