[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)
|
||||
}
|
||||
|
||||
@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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user