[m1-p-1.1.0] fix bug of mapview model light
This commit is contained in:
@@ -87,8 +87,7 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
|
|||||||
setExtraGPSData(gnssInfo)
|
setExtraGPSData(gnssInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Volatile
|
private var currentLevel:Int = 0
|
||||||
private var isVisualAngleChanged = false
|
|
||||||
|
|
||||||
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
|
||||||
super.onAutopilotLightSwitchData(lightSwitch)
|
super.onAutopilotLightSwitchData(lightSwitch)
|
||||||
@@ -96,35 +95,28 @@ class MapBizView(context: Context?, attrs: AttributeSet?) : MogoMapView(context,
|
|||||||
when (it.number) {
|
when (it.number) {
|
||||||
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯
|
Chassis.LightSwitch.LIGHT_LEFT_VALUE -> { //左转灯
|
||||||
CallerVisualAngleManager.showTurning(true)
|
CallerVisualAngleManager.showTurning(true)
|
||||||
showTurn(1)
|
turn(1)
|
||||||
}
|
}
|
||||||
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯
|
Chassis.LightSwitch.LIGHT_RIGHT_VALUE -> { //右转灯
|
||||||
CallerVisualAngleManager.showTurning(true)
|
CallerVisualAngleManager.showTurning(true)
|
||||||
showTurn(2)
|
turn(2)
|
||||||
|
|
||||||
}
|
}
|
||||||
Chassis.LightSwitch.LIGHT_NONE_VALUE -> {
|
Chassis.LightSwitch.LIGHT_NONE_VALUE -> {
|
||||||
CallerVisualAngleManager.showTurning(false)
|
CallerVisualAngleManager.showTurning(false)
|
||||||
hideTurn()
|
turn(0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun showTurn(lightNum: Int) {
|
private fun turn(lightNum: Int) {
|
||||||
if (!isVisualAngleChanged) {
|
if (currentLevel != lightNum) {
|
||||||
isVisualAngleChanged = true
|
|
||||||
when (lightNum) {
|
when (lightNum) {
|
||||||
|
0 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
||||||
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
1 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(4, 500)
|
||||||
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
2 -> CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(2, 500)
|
||||||
}
|
}
|
||||||
}
|
currentLevel = lightNum
|
||||||
}
|
|
||||||
|
|
||||||
private fun hideTurn() {
|
|
||||||
if (isVisualAngleChanged) {
|
|
||||||
isVisualAngleChanged = false
|
|
||||||
CallerMapUIServiceManager.getMapUIController()?.setCarLightsType(3, 500)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.mogo.eagle.core.function.call.autopilot
|
package com.mogo.eagle.core.function.call.autopilot
|
||||||
|
|
||||||
import android.util.Log
|
|
||||||
import chassis.Chassis
|
import chassis.Chassis
|
||||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLamplightListener
|
||||||
import com.mogo.eagle.core.function.call.base.CallerBase
|
import com.mogo.eagle.core.function.call.base.CallerBase
|
||||||
|
|||||||
Reference in New Issue
Block a user