[6.5.0][道路事件] 优化测试用例

This commit is contained in:
renwj
2024-07-15 19:42:24 +08:00
parent 4522dc2ec4
commit 91bc56c338
3 changed files with 34 additions and 16 deletions

View File

@@ -497,19 +497,19 @@ internal object V2NIdentifyDrawer: IEventDismissListener {
}
private fun computeCrossCountBetween(start: Triple<Double, Double, Double>, end: kotlin.Pair<Double, Double>): Int {
val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
val angle = start.third
var count = 1
for (p in points) {
val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
count++
crossId = crossRoad.cross_id
}
}
return count
// val points = V2NUtils.generateIntermediatePoints(kotlin.Pair(start.first, start.second), end, 50.0 * 1e-7)
// V2XBizTrace.onAck(points, "computeCrossCountBetween", true)
// var crossId = MapDataWrapper.getCrossRoad(start.first, start.second, start.third)?.cross_id
// val angle = start.third
// var count = 0
// for (p in points) {
// val crossRoad = MapDataWrapper.getCrossRoad(p.first, p.second, angle)
// if (crossRoad != null && !TextUtils.isEmpty(crossRoad.cross_id) && !TextUtils.equals(crossId, crossRoad.cross_id)) {
// count++
// crossId = crossRoad.cross_id
// }
// }
return 1
}
private fun getAlertContent(poiType: String, distance: Double): String {