modify brake

This commit is contained in:
lixiaopeng
2022-03-28 15:12:51 +08:00
parent be10bd216a
commit 3ed423938d
5 changed files with 47 additions and 15 deletions

View File

@@ -127,12 +127,15 @@ class MoGoAdasListenerImpl : OnAdasListener {
MogoApisHandler.getInstance().apis.adasControllerApi.lastLon = gnssInfo.longitude
MogoApisHandler.getInstance().apis.adasControllerApi.satelliteTime =
java.lang.Double.valueOf(gnssInfo.satelliteTime).toLong()
if (1 == FunctionBuildConfig.gpsProvider) {
CallerMapUIServiceManager.getMapUIController()?.syncLocation2Map(
gnssInfo
)
SnapshotLocationDataCenter.getInstance().syncAdasLocationInfo(gnssInfo)
}
//根据加速度判断 是否刹车
CallerAutopilotVehicleStateListenerManager.invokeAutopilotBrakeLightByAcceleration(gnssInfo.acceleration)
}
}

View File

@@ -1,7 +1,5 @@
package com.mogo.eagle.core.function.autopilot.adapter;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
import android.text.TextUtils;
import android.util.Log;
@@ -17,8 +15,6 @@ import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.module.common.drawer.IdentifyDataDrawer;
import com.zhidao.support.adas.high.OnAdasConnectStatusListener;
import com.zhidao.support.adas.high.common.Constants;
import org.jetbrains.annotations.NotNull;
@@ -28,10 +24,12 @@ import chassis.Chassis;
import mogo.telematics.pad.MessagePad;
import record_cache.RecordPanelOuterClass;
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_DEVA;
public class MoGoHandAdasMsgManager implements
IMoGoAutopilotIdentifyListener,
IMoGoAutopilotVehicleStateListener,
IMoGoAutopilotCarConfigListener {
IMoGoAutopilotCarConfigListener{
private final String TAG = "AdasEventManager";
@@ -58,6 +56,8 @@ public class MoGoHandAdasMsgManager implements
private boolean isOnTurnLight = false;
private int turnLight = 0;
private volatile boolean isShowTurnLight = false;
private int brakeLight = -1;
private int setTurnLightState(int turn_light) {
if (turn_light == 0) {
@@ -98,11 +98,10 @@ public class MoGoHandAdasMsgManager implements
@Override
public void onAutopilotBrakeLightData(boolean brakeLight) {
//设置刹车信息
CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotBrakeLightData -- brakeLight = $brakeLight ---$isShowTurnLight");
if (!isShowTurnLight) {
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight ? 1 : 0);
}
// CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotBrakeLightData -- brakeLight = $brakeLight ---$isShowTurnLight");
// if (!isShowTurnLight) {
// CallerHmiManager.INSTANCE.showBrakeLight(brakeLight ? 1 : 0);
// }
}
@Override
@@ -130,15 +129,30 @@ public class MoGoHandAdasMsgManager implements
}
private volatile boolean isIPCConnect = false;
@Override
public void onAutopilotCarConfig(@NotNull MessagePad.CarConfigResp carConfigResp) {
if (carConfigResp != null && !TextUtils.isEmpty(carConfigResp.getMacAddress())) {
// Log.d("liyz", " carConfigResp.getMacAddress() = " + carConfigResp.getMacAddress());
// CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress());
CallerLogger.INSTANCE.d(M_DEVA + TAG, " carConfigResp.getMacAddress() = " + carConfigResp.getMacAddress() + "--mac = " + carConfigResp.getMacAddress().replaceAll(".{2}(?=.)", "$0:"));
CallerBindingcarManager.getBindingcarProvider().getBindingcarInfo(carConfigResp.getMacAddress().replaceAll(".{2}(?=.)", "$0:"));
}
}
/**
* 根据加速度判断是否刹车
* @param acceleration
*/
@Override
public void onAutopilotBrakeLightByAcceleration(double acceleration) {
//设置刹车信息
if (acceleration < -2.5) {
brakeLight = 1;
} else {
brakeLight = 0;
}
CallerLogger.INSTANCE.d(M_DEVA + TAG, "onAutopilotBrakeLightByAcceleration -- acceleration = " + acceleration);
if (!isShowTurnLight) {
CallerHmiManager.INSTANCE.showBrakeLight(brakeLight);
}
}
}

View File

@@ -55,7 +55,6 @@ public class BindingcarProvider implements IMoGoBindingcarProvider {
@Override
public void modifyCarInfo(BindingcarCallBack callBack) {
Log.d("liyz", "BindingcarProvider modifyCarInfo mAddress = " + mAddress);
BindingcarNetWorkManager.getInstance().modifyBindingcar(mAddress, callBack);
}