[V2X][Road]优化代码逻辑

This commit is contained in:
renwj
2022-09-26 16:41:34 +08:00
parent bdb274fca2
commit 32c26e73f9

View File

@@ -36,10 +36,6 @@ object AiRoadMarker {
private val marker by lazy { AtomicReference<Marker>() }
private val curStopLine by lazy { AtomicReference<StopLine>() }
private val lastStopLine by lazy { AtomicReference<StopLine>() }
private val carLocation by lazy { AtomicReference<Triple<Double, Double, Double>>() }
private val overlayManager by lazy { MogoOverlayManager.getInstance() }
@@ -130,14 +126,12 @@ object AiRoadMarker {
if (oldRoadId != roadId) {
if (hasCrossRoad) {
hasCrossRoad = false
lastStopLine.set(curStopLine.get())
}
}
this.roadId = roadId
}
override fun onStopLineInfo(info: StopLine) {
Logger.d(TAG, "--- onStopLineInfo --- info: $info")
curStopLine.set(info)
if (!hasCrossRoad) {
hasCrossRoad = true
}
@@ -190,6 +184,7 @@ object AiRoadMarker {
CallerMapRoadListenerManager.unRegisterRoadListener(TAG)
CallerMapLocationListenerManager.removeListener(TAG)
pool.shutdownNow()
removeRedLine()
}