diff --git a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt index ada377f31c..6a108df146 100644 --- a/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt +++ b/core/function-impl/mogo-core-function-map/src/main/java/com/mogo/eagle/core/function/view/MapBizView.kt @@ -87,8 +87,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, setExtraGPSData(gnssInfo) } - @Volatile - private var isVisualAngleChanged = false + private var currentLevel:Int = 0 override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) { super.onAutopilotLightSwitchData(lightSwitch) @@ -96,35 +95,28 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context, when (it.number) { Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯 CallerVisualAngleManager.showTurning(true) - showTurn(1) + turn(1) } Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯 CallerVisualAngleManager.showTurning(true) - showTurn(2) - + turn(2) } Chassis.LightSwitch.LIGHT_NONE_VALUE -> { CallerVisualAngleManager.showTurning(false) - hideTurn() + turn(0) } } } } - private fun showTurn(lightNum: Int) { - if (!isVisualAngleChanged) { - isVisualAngleChanged = true + private fun turn(lightNum: Int) { + if (currentLevel != lightNum) { when (lightNum) { + 0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) 1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500) 2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500) } - } - } - - private fun hideTurn() { - if (isVisualAngleChanged) { - isVisualAngleChanged = false - CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500) + currentLevel = lightNum } } diff --git a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt index 08493422d9..a18985d90d 100644 --- a/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt +++ b/core/mogo-core-function-call/src/main/java/com/mogo/eagle/core/function/call/autopilot/CallerChassisLamplightListenerManager.kt @@ -1,6 +1,5 @@ package com.mogo.eagle.core.function.call.autopilot -import android.util.Log import chassis.Chassis import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener import com.mogo.eagle.core.function.call.base.CallerBase