添加转向灯相关注释

This commit is contained in:
lixiaopeng
2023-01-31 18:31:20 +08:00
parent c591a30752
commit fb84e5aaff

View File

@@ -352,14 +352,14 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
mMogoMapView?.setExtraGPSData(gnssInfo)
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f)) {
brakeLight = 1
//设置刹车信息,小于默认认为是刹车
brakeLight = if (gnssInfo.acceleration < SharedPrefsMgr.getInstance(Utils.getApp()).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD, -2.5f)) {
1
} else {
brakeLight = 0
0
}
d(SceneConstant.M_DEVA + "BrakeLight", "---onAutopilotLightSwitchData ---Acceleration = " + gnssInfo.acceleration + "-- brakeLight = " + brakeLight)
if (!isShowTurnLight) {
if (!isShowTurnLight) { //在不展示转向灯的情况下,展示车辆刹车的动效
showBrakeLight(brakeLight)
}
}
@@ -368,7 +368,7 @@ class MapFragment : MvpFragment<MapView?, MapPresenter?>(),
override fun onAutopilotLightSwitchData(lightSwitch: Chassis.LightSwitch?) {
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
val state: Int = setTurnLightState(lightSwitch.number)
val state: Int = setTurnLightState(lightSwitch.number) //对转向灯进行转换
d(SceneConstant.M_DEVA + "TurnLight", "---onAutopilotLightSwitchData ---state = " + state + "---lightSwitch.getNumber() = " + lightSwitch.number)
if (state == 1 || state == 2) {
isShowTurnLight = true