add bus not show brake and turnlight

This commit is contained in:
lixiaopeng
2022-04-06 11:30:41 +08:00
parent f4aa520f45
commit 4974ee5c06

View File

@@ -18,6 +18,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotIdentifyListen
import com.mogo.eagle.core.function.call.autopilot.CallerAutopilotVehicleStateListenerManager;
import com.mogo.eagle.core.function.call.bindingcar.CallerBindingcarManager;
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils;
import com.mogo.eagle.core.utilcode.mogo.storage.SharedPrefsMgr;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
@@ -91,15 +92,17 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotLightSwitchData(Chassis.LightSwitch lightSwitch) {
//can数据转发 转向灯状态 0是正常 1是左转 2是右转
if (lightSwitch != null) {
int state = setTurnLightState(lightSwitch.getNumber());
if (state == 1 || state == 2) {
isShowTurnLight = true;
CallerHmiManager.INSTANCE.showBrakeLight(0);
} else {
isShowTurnLight = false;
if (!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //小巴不展示
if (lightSwitch != null) {
int state = setTurnLightState(lightSwitch.getNumber());
if (state == 1 || state == 2) {
isShowTurnLight = true;
CallerHmiManager.INSTANCE.showBrakeLight(0);
} else {
isShowTurnLight = false;
}
CallerHmiManager.INSTANCE.showTurnLight(state);
}
CallerHmiManager.INSTANCE.showTurnLight(state);
}
}
@@ -143,15 +146,17 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotCarStateData(@Nullable MessagePad.GnssInfo gnssInfo) {
//根据加速度判断 是否刹车
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
brakeLight = 1;
} else {
brakeLight = 0;
}
if (!isShowTurnLight) {
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
if (!AppIdentityModeUtils.isBus(FunctionBuildConfig.appIdentityMode)) { //小巴不展示
if (gnssInfo != null) {
//设置刹车信息
if (gnssInfo.getAcceleration() < SharedPrefsMgr.getInstance(mContext).getFloat(MoGoConfig.BRAKE_ACCELERATION_THRESHOLD,-2.5F)) {
brakeLight = 1;
} else {
brakeLight = 0;
}
if (!isShowTurnLight) {
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
}
}
}