[启动自驾 拦截顺序整理]
This commit is contained in:
yangyakun
2024-04-29 15:54:35 +08:00
parent 44a2a284ed
commit 35c19eb812
7 changed files with 134 additions and 83 deletions

View File

@@ -533,7 +533,6 @@ public class OrderModel {
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
// 取消自驾
setTrajectoryStation(null,null,-1L);
// startOrStopQueryPassengerWriteOff(false);
}
}
@@ -621,7 +620,7 @@ public class OrderModel {
// 非自驾状态---->预写日志----> 启动自驾 ---> 自驾启动成功 ----> 上报日志
//  自驾状态---->启动自驾 ---> 自驾启动成功
//根据开关和后台是否发布轨迹启动自驾
//1、判断轨迹url是否可用
if (FunctionBuildConfig.isPassStartAutopilotCommand
&& TextUtils.isEmpty(busRoutesResult.csvFileUrl)
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)
@@ -633,7 +632,7 @@ public class OrderModel {
+ "busRoutesResult.csvFileUrlDPQP = "+busRoutesResult.csvFileUrlDPQP);
return;
}
//2、6个条件判断
if (!CallerAutoPilotControlManager.INSTANCE.isCanStartAutopilot(true)) {
return;
}
@@ -641,14 +640,7 @@ public class OrderModel {
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
triggerUnableStartAPReasonEvent();
return;
}
//3、距离轨迹15m计算
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(TrajectoryAndDistanceManager.errorTypeNoneLineId.equals(resion)){
MogoLocation nextStationPoint = new MogoLocation();
@@ -661,7 +653,7 @@ public class OrderModel {
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
setTrajectoryStation(currentStationPoint,nextStationPoint, (long) currentLineId);
setTrajectoryStation(currentStationPoint,nextStationPoint, (long)busRoutesResult.getLineId());
resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
}
if(!StringUtils.isEmpty(resion)){
@@ -669,6 +661,16 @@ public class OrderModel {
return;
}
//4、ssm 给出数据
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
triggerUnableStartAPReasonEvent();
return;
}
firstStartAutopilot++;
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
@@ -1282,26 +1284,6 @@ public class OrderModel {
return parameters;
}
public void setStation(){
BusStationBean busStationBean = stationList.get(backgroundCurrentStationIndex);
String nextStationName = "";
String nextStationNameKr = "";
MogoLocation nextStationPoint = new MogoLocation();
if (backgroundCurrentStationIndex < stationList.size() - 1) {
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
nextStationName = nextStation.getName();
nextStationNameKr = nextStation.getNameKr();
nextStationPoint.setLongitude(nextStation.getGcjLon());
nextStationPoint.setLatitude(nextStation.getGcjLat());
}
final String currentStationName = busStationBean.getName();
String finalNextStationName = nextStationName;
String finalNextStationNameKr = nextStationNameKr;
MogoLocation currentStationPoint = new MogoLocation();
currentStationPoint.setLongitude(busStationBean.getGcjLon());
currentStationPoint.setLatitude(busStationBean.getGcjLat());
}
public void setTrajectoryStation(MogoLocation startStation,MogoLocation endStation,Long lineId){
TrajectoryAndDistanceManager.INSTANCE.setStationPoint(startStation,endStation,lineId);
}