Merge branch 'refs/heads/dev_robotaxi-d_240912_6.7.0' into dev_robotaxi-d_240912_6.7.2_local

This commit is contained in:
donghongyu-pc
2024-10-21 18:18:33 +08:00
10 changed files with 161 additions and 6 deletions

View File

@@ -10,6 +10,7 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.map.*
import com.mogo.eagle.core.function.angle.scenes.CrossRoad
import com.mogo.eagle.core.function.angle.scenes.Default
import com.mogo.eagle.core.function.angle.scenes.LongSight
import com.mogo.eagle.core.function.angle.scenes.Roma
import com.mogo.eagle.core.function.api.map.angle.*
import com.mogo.eagle.core.function.api.map.angle.IMoGoVisualAngleChangeProvider.OnMoGoVisualAngleSceneChangeListener
@@ -42,6 +43,8 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
private val prevScene by lazy { AtomicReference<Scene>() }
private var timerJob: Job? = null
private val listener = object : IMoGoMapRoadListener {
private val roadId = AtomicReference<String>()
private val triggerRoadId = AtomicReference<String>()
@@ -187,7 +190,7 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
private fun doChangeAngle(target: Scene) {
val angle = target.getVisualAngleMode()
CallerMapUIServiceManager.getMapUIController()?.also {
CallerMapUIServiceManager.getMapUIController()?.also { itx ->
Log.d(TAG, "--- doChangeAngle --- $target")
val prev = prevScene.get()
try {
@@ -204,7 +207,23 @@ class MoGoVisualAngleChangeProvider: IMoGoVisualAngleChangeProvider {
DOWN -> CallerMapUIServiceManager.getMapUIController()?.setScreenToOriginDis(5.0f)
}
if (target !is Roma) {
it.changeMapVisualAngle(angle, null)
if (target is LongSight) {
timerJob?.safeCancel()
scope.launch {
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(false)
itx.changeMapVisualAngle(angle, null)
delay(3000)
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
}.also {
it.invokeOnCompletion {
CallerMapUIServiceManager.getMapUIController()?.setAllGesturesEnabled(true)
}
timerJob = it
}
} else {
timerJob?.safeCancel()
itx.changeMapVisualAngle(angle, null)
}
}
} finally {
if (prev == null || prev.javaClass != target.javaClass) {