Merge branch '6.0.0merge2master' into 'master'

6.0.0merge2master

See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!822
This commit is contained in:
pangfan
2023-09-12 02:26:29 +00:00
3672 changed files with 38961 additions and 14144 deletions

View File

@@ -56,7 +56,7 @@ android {
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation rootProject.ext.dependencies.kotlinstdlibjdk7
implementation rootProject.ext.dependencies.kotlinstdlib
implementation rootProject.ext.dependencies.androidxappcompat
implementation rootProject.ext.dependencies.arouter
annotationProcessor rootProject.ext.dependencies.aroutercompiler

View File

@@ -36,6 +36,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.CoordinateUtils;
import com.mogo.eagle.core.utilcode.util.DrivingDirectionUtils;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.StringUtils;
import com.mogo.eagle.core.utilcode.util.ToastUtils;
import com.mogo.eagle.core.utilcode.util.UiThreadHandler;
import com.mogo.och.bus.R;
@@ -62,7 +63,7 @@ import com.mogo.och.common.module.biz.network.OchCommonServiceCallback;
import com.mogo.och.common.module.biz.provider.LoginService;
import com.mogo.och.common.module.callback.OchAdasStartFailureCallback;
import com.mogo.och.common.module.manager.AbnormalFactorsLoopManager;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.distancemamager.ITrajectoryListener;
import com.mogo.och.common.module.manager.distancemamager.TrajectoryAndDistanceManager;
import com.mogo.och.common.module.utils.CoordinateCalculateRouteUtil;
@@ -185,31 +186,31 @@ public class OrderModel {
public void accept(Throwable e) {
if (e instanceof UndeliverableException) {
e = e.getCause();
CallerLogger.INSTANCE.d(M_BUS + TAG, "UndeliverableException");
CallerLogger.d(M_BUS + TAG, "UndeliverableException");
}
if ((e instanceof IOException)) {//
// fine, irrelevant network problem or API that throws on cancellation
CallerLogger.INSTANCE.d(M_BUS + TAG, "IOException");
CallerLogger.d(M_BUS + TAG, "IOException");
return;
}
if (e instanceof InterruptedException) {
// fine, some blocking code was interrupted by a dispose call
CallerLogger.INSTANCE.d(M_BUS + TAG, "InterruptedException");
CallerLogger.d(M_BUS + TAG, "InterruptedException");
return;
}
if ((e instanceof NullPointerException) || (e instanceof IllegalArgumentException)) {
// that's likely a bug in the application
CallerLogger.INSTANCE.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException");
CallerLogger.d(M_BUS + TAG, "NullPointerException or IllegalArgumentException");
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
return;
}
if (e instanceof IllegalStateException) {
// that's a bug in RxJava or in a custom operator
CallerLogger.INSTANCE.d(M_BUS + TAG, "IllegalStateException");
CallerLogger.d(M_BUS + TAG, "IllegalStateException");
Thread.currentThread().getUncaughtExceptionHandler().uncaughtException(Thread.currentThread(), e);
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "Undeliverable exception");
CallerLogger.d(M_BUS + TAG, "Undeliverable exception");
}
});
}
@@ -224,10 +225,10 @@ public class OrderModel {
@Override
public void onMsgReceived(OCHOperationalMessage obj) {
if (obj == null){
CallerLogger.INSTANCE.d(M_BUS + TAG, "onMsgReceived = null");
CallerLogger.d(M_BUS + TAG, "onMsgReceived = null");
return;
}
CallerLogger.INSTANCE.i(M_BUS + TAG,"onMsgReceived = "+obj.getMessage());
CallerLogger.i(M_BUS + TAG,"onMsgReceived = "+obj.getMessage());
OCHSocketMessageManager.INSTANCE.pushAppOperationalMsgBox(DateTimeUtil.getCurrentTimeStamp(),
obj.getMessage(),OCHSocketMessageManager.OPERATION_SYSTEM);
}
@@ -243,7 +244,7 @@ public class OrderModel {
@Override
public void onMsgReceived(WriteOffPassenger passenger) {
//进行播报
CallerLogger.INSTANCE.i(M_BUS + TAG,"passenger = "+ GsonUtil.jsonFromObject(passenger));
CallerLogger.i(M_BUS + TAG,"passenger = "+ GsonUtil.jsonFromObject(passenger));
if (passenger != null && passenger.passengerSize == 0) return;
if (mPassengerCallback != null){
mPassengerCallback.playPassenger(passenger);
@@ -380,9 +381,9 @@ public class OrderModel {
private final OchAdasStartFailureCallback mAdasStartFailureListener = new OchAdasStartFailureCallback() {
@Override
public void onStartAutopilotFailure(@NotNull String startFailedCode, @NonNull String startFailedMessage) {
BusAnalyticsManager.getInstance().triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
BusAnalyticsManager.INSTANCE.triggerStartAutopilotFailureEventByAdas(startFailedCode, startFailedMessage);
if (mADASStatusCallback != null && !FunctionBuildConfig.isDemoMode){
CallerLogger.INSTANCE.e( M_BUS + TAG, "mAdasStartFailureListener = "+startFailedMessage );
CallerLogger.e( M_BUS + TAG, "mAdasStartFailureListener = "+startFailedMessage );
mADASStatusCallback.onStartAdasFailure();
}
}
@@ -408,7 +409,7 @@ public class OrderModel {
private void judgeArrivedStation(MogoLocation location) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "到站数组越界");
CallerLogger.e(M_BUS + TAG, "到站数组越界");
return;
}
BusStationBean upcomingStation = stationList.get(backgroundCurrentStationIndex + 1);
@@ -420,7 +421,7 @@ public class OrderModel {
location.getLongitude(), location.getLatitude());
if (distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE) {//1当前位置和站点围栏15m内
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
CallerLogger.d(M_BUS + TAG, "行程日志-judgeArrivedStation() distance = " + distance
+ " to " + upcomingStation.getName());
//2开始计算当前位置和站点的向量角度 < 90度 未经过 >90度 经过
@@ -431,11 +432,11 @@ public class OrderModel {
startLat,
(int) location.getHeading());
CallerLogger.INSTANCE.d(M_BUS + TAG, "judgeArrivedStation() stationAngle = " + stationAngle);
CallerLogger.d(M_BUS + TAG, "judgeArrivedStation() stationAngle = " + stationAngle);
//3刚过站且过站距离在15m内 提交到站
if (stationAngle > 90 && distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE){
CallerLogger.INSTANCE.d(M_BUS + TAG, "judgeArrivedStation() = 刚过站且在15m内");
CallerLogger.d(M_BUS + TAG, "judgeArrivedStation() = 刚过站且在15m内");
onArriveAt(null); //无自动驾驶到站信息传null
}
@@ -447,7 +448,7 @@ public class OrderModel {
* 查询小巴路线
*/
public void queryBusRoutes() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "查询小巴路线");
CallerLogger.d(M_BUS + TAG, "查询小巴路线");
OrderServiceManager.queryBusRoutes(mContext, new OchCommonServiceCallback<BusRoutesResponse>() {
@Override
public void onSuccess(BusRoutesResponse data) {
@@ -456,7 +457,7 @@ public class OrderModel {
|| data.getResult().getSites() == null
|| data.getResult().getSites().isEmpty()) {
//当为空时,显示无绑定路线图
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
CallerLogger.d(M_BUS + TAG, "获取到小巴路线数据:空 ");
if (refreshBusStationsCallback != null) {
refreshBusStationsCallback.updateEmptyUi();
}
@@ -466,7 +467,7 @@ public class OrderModel {
removeTipRunnables();
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
CallerLogger.d(M_BUS + TAG, "获取到小巴路线数据: " + data);
updateBusStatus(data.getResult());
}
@@ -549,12 +550,12 @@ public class OrderModel {
* 重置路线站点状态--结束路线当前路线恢复到始发站
*/
public void abortTask() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "结束当前路线abortTask");
CallerLogger.d(M_BUS + TAG, "结束当前路线abortTask");
OrderServiceManager.abortTask(mContext, currentTaskId
, new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "abortTask success: " + o);
CallerLogger.d(M_BUS + TAG, "abortTask success: " + o);
if (o.code == 0) { // 重置成功
endOrAbortTaskSuccess();
clearBusStationDatas();
@@ -647,20 +648,25 @@ public class OrderModel {
*/
private void startAutopilot(boolean isRestart, int leaveIndex) {
// 非自驾状态---->预写日志----> 启动自驾 ---> 自驾启动成功 ----> 上报日志
//  自驾状态---->启动自驾 ---> 自驾启动成功
//根据开关和后台是否发布轨迹启动自驾
if (FunctionBuildConfig.isPassStartAutopilotCommand && TextUtils.isEmpty(busRoutesResult.csvFileUrl)
&& TextUtils.isEmpty(busRoutesResult.csvFileUrlDPQP)){
ToastUtils.showLong("无发布轨迹, 请发布后重试");
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand
+ "busRoutesResult.csvFileUrl = "+ busRoutesResult.csvFileUrl
+ "busRoutesResult.csvFileUrlDPQP = "+busRoutesResult.csvFileUrlDPQP);
return;
}
CallerLogger.INSTANCE.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
CallerLogger.e(M_BUS + TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand);
if (!FunctionBuildConfig.isDemoMode && !OCHAdasAbilityManager.getInstance().getAutopilotAbilityStatus()) {
ToastUtils.showLong(OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason() +
", 请稍候重试");
@@ -668,19 +674,28 @@ public class OrderModel {
return;
}
String resion = TrajectoryAndDistanceManager.INSTANCE.canStartAutopilot((long)busRoutesResult.getLineId());
if(!StringUtils.isEmpty(resion)){
ToastUtils.showShort(resion);
return;
}
firstStartAutopilot++;
triggerStartServiceEvent(isRestart, false);
if(CallerAutoPilotStatusListenerManager.INSTANCE.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
// 预写日志
triggerStartServiceEvent(isRestart, false);
}
AutopilotControlParameters parameters = initAutopilotControlParameters(leaveIndex);
if (null == parameters) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.");
CallerLogger.e(M_BUS + TAG, "行程日志-AutopilotControlParameters is empty.");
return;
}
CallerAutoPilotControlManager.INSTANCE.startAutoPilot(parameters);
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
CallerLogger.d(M_BUS + TAG, "行程日志-开启自动驾驶====" + GsonUtil.jsonFromObject(parameters)
+ " startLatLon=" + parameters.startName + "endLatLon=" + parameters.endName +
"isRestart = " + isRestart);
@@ -694,14 +709,14 @@ public class OrderModel {
*/
private void arriveSiteStation() {
if ( backgroundCurrentStationIndex +1 > stationList.size() - 1 ) { //到站短时间内调用多次
CallerLogger.INSTANCE.e( M_BUS + TAG, "数组越界" );
CallerLogger.e( M_BUS + TAG, "数组越界" );
return;
}
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
String arriveStation = stationList.get(arrivedStationIndex).getName();
String arriveStationKr = stationList.get(arrivedStationIndex).getNameKr();
String departureStopName = stationList.get(backgroundCurrentStationIndex).getName();
CallerLogger.INSTANCE.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
CallerLogger.d(M_BUS + TAG, "arriveSiteStation-currentStationIndex = " + arrivedStationIndex);
OrderServiceManager.arriveSiteStation(mContext,
stationList.get(arrivedStationIndex).getSeq(),
@@ -710,7 +725,7 @@ public class OrderModel {
new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
CallerLogger.d(M_BUS + TAG, "行程日志-arriveSiteStation success");
if (o != null && o.code == 0){
queryBusRoutes();
isArrivedStation = true;
@@ -766,7 +781,7 @@ public class OrderModel {
* 离站上报
*/
public void leaveStation() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
CallerLogger.d(M_BUS + TAG, "leaveStation-backgroundCurrentStationIndex = " + backgroundCurrentStationIndex);
String nextStationName = "";
String nextStationNameKr = "";
MogoLocation nextStationPoint = new MogoLocation();
@@ -792,7 +807,7 @@ public class OrderModel {
@Override
public void onSuccess(BaseData o) {
isArrivedStation = false;
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
CallerLogger.d(M_BUS + TAG, "行程日志-离站成功开往下一站====");
//需要更改当前站和下一站的状态 然后渲染
//startOrStopQueryPassengerWriteOff(false);
queryBusRoutes();
@@ -841,7 +856,7 @@ public class OrderModel {
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false; //是否强制绘制引导线
CallerAutoPilotControlManager.INSTANCE.setIgnoreConditionDraw(false);// 同步给乘客屏
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);//是否自动启动自驾
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为false");
CallerLogger.d(M_BUS + TAG, "美化模式-ignore置为false");
}
}
@@ -876,7 +891,7 @@ public class OrderModel {
for (int i = 0; i < stationList.size(); i++) {
BusStationBean s = stationList.get(i);
CallerLogger.INSTANCE.d(M_BUS + "updateBusStationsStatus--",
CallerLogger.d(M_BUS + "updateBusStationsStatus--",
"Index=" + i + " ,name = " + s.getName() + " ," + s.isLeaving() + "," + s.getDrivingStatus());
// 是否正在开往下一站
@@ -909,7 +924,7 @@ public class OrderModel {
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
CallerLogger.INSTANCE.d(M_BUS + TAG,
CallerLogger.d(M_BUS + TAG,
"行程日志-STATION_STATUS_STOPPED-backgroundCurrentStationIndex="
+ backgroundCurrentStationIndex
+ " isLeaving()=" + currentStation.isLeaving());
@@ -919,11 +934,11 @@ public class OrderModel {
&& backgroundCurrentStationIndex <= stationList.size() - 1)) {//行驶过程中设置美化
if (stationList.get(backgroundCurrentStationIndex).isLeaving()) {
startBeautificationMode();
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignore置为true每次滑动出发");
CallerLogger.d(M_BUS + TAG, "美化模式-ignore置为true每次滑动出发");
} else if (backgroundCurrentStationIndex > 0 && backgroundCurrentStationIndex < stationList.size() - 1) {
//美化模式下 中间站点到站 引导线要一直绘制所以此处不出强制绘制不传false
CallerAutoPilotControlManager.INSTANCE.setIPCDemoMode(false);
CallerLogger.INSTANCE.d(M_BUS + TAG, "美化模式-ignorefalse到达中间站");
CallerLogger.d(M_BUS + TAG, "美化模式-ignorefalse到达中间站");
clearStartAutopilotTag();
} else {
closeBeautificationMode();
@@ -1034,7 +1049,7 @@ public class OrderModel {
* 在踩刹车控制方向盘等操作后会停止自动驾驶重启自动驾驶的话相当于重新设置自动驾驶目的地
*/
public void restartAutopilot() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation);
CallerLogger.d(M_BUS + TAG, "行程日志-重启自动驾驶===" + isGoingToNextStation);
//只去启动自动驾驶不再去上报离站
startAutopilot(firstStartAutopilot >= 1, -1);
}
@@ -1049,10 +1064,10 @@ public class OrderModel {
private void travelOver() {
if (backgroundCurrentStationIndex >= stationList.size()) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "travel over index out of station list");
CallerLogger.e(M_BUS + TAG, "travel over index out of station list");
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "单程结束====");
CallerLogger.d(M_BUS + TAG, "单程结束====");
CallerAutoPilotControlManager.INSTANCE.cancelAutoPilot();
setTrajectoryStation(null,null,-1L);
endTask();
@@ -1062,12 +1077,12 @@ public class OrderModel {
* task正常结束
*/
private void endTask() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "任务正常走完endTask()");
CallerLogger.d(M_BUS + TAG, "任务正常走完endTask()");
OrderServiceManager.endTask(mContext, currentTaskId
, new OchCommonServiceCallback<BaseData>() {
@Override
public void onSuccess(BaseData o) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "endTask success: " + o);
CallerLogger.d(M_BUS + TAG, "endTask success: " + o);
if (o.code == 0) {
endOrAbortTaskSuccess();
clearBusStationDatas();
@@ -1109,7 +1124,7 @@ public class OrderModel {
*/
public void onArriveAt(MessagePad.ArrivalNotification data) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束");
CallerLogger.e(M_BUS + TAG, "行程日志-到站异常,取消后续操作结束");
return;
}
@@ -1125,19 +1140,19 @@ public class OrderModel {
String arriveLat = NumberFormatUtil.cutOutNumber(arriveStation.getLat(), 5);
String arriveLon = NumberFormatUtil.cutOutNumber(arriveStation.getLon(), 5);
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-dataLatitude = "+ latitude+
CallerLogger.d(M_BUS + TAG, "行程日志-dataLatitude = "+ latitude+
", dataLongitude = " + longitude + "; arriveLat = " + arriveLat +
", arriveLon = " +arriveLon);
if (!latitude.equals(arriveLat) || !longitude.equals(arriveLon)) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致");
CallerLogger.e(M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致");
return;
}
}
if (isArrivedStation) return;
CallerLogger.INSTANCE.d(M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
CallerLogger.d(M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
+ backgroundCurrentStationIndex);
arriveSiteStation();
@@ -1169,7 +1184,7 @@ public class OrderModel {
}
public void startOrStopOrderLoop(boolean start) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "startOrStopOrderLoop() " + start);
CallerLogger.d(M_BUS + TAG, "startOrStopOrderLoop() " + start);
if (start) {
BusModelLoopManager.getInstance().startHeartbeatLoop();
} else {
@@ -1190,7 +1205,7 @@ public class OrderModel {
}
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
BusAnalyticsManager.getInstance().triggerStartAutopilotEvent(isRestart, send,
BusAnalyticsManager.INSTANCE.triggerStartAutopilotEvent(isRestart, send,
currentStation.getName(), nextStation.getName(), currentLineId);
}
@@ -1200,7 +1215,7 @@ public class OrderModel {
}
BusStationBean currentStation = stationList.get(backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get(backgroundCurrentStationIndex + 1);
BusAnalyticsManager.getInstance().triggerUnableStartAPReasonEvent(
BusAnalyticsManager.INSTANCE.triggerUnableStartAPReasonEvent(
currentStation.getName(), nextStation.getName(), currentLineId,
OCHAdasAbilityManager.getInstance().getAutopilotUnAbilityReason());
}
@@ -1220,15 +1235,15 @@ public class OrderModel {
AutopilotControlParameters parameters = initAutopilotControlParameters(-1);
if (null == parameters) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "AutopilotControlParameters is empty.");
CallerLogger.e(M_BUS + TAG, "AutopilotControlParameters is empty.");
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is update.");
CallerLogger.d(M_BUS + TAG, "AutopilotControlParameters is update.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(parameters);
}
private void clearAutopilotControlParameters() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "AutopilotControlParameters is clear.");
CallerLogger.d(M_BUS + TAG, "AutopilotControlParameters is clear.");
CallerAutoPilotStatusListenerManager.INSTANCE.updateAutopilotControlParameters(null);
}
@@ -1238,14 +1253,14 @@ public class OrderModel {
if (leaveIndex < 0) {
if (backgroundCurrentStationIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition1.");
CallerLogger.e(M_BUS + TAG, "行程日志-mismatch condition1.");
return null;
}
currentStation = stationList.get(backgroundCurrentStationIndex);
nextStation = stationList.get(backgroundCurrentStationIndex + 1);
} else {
if (leaveIndex + 1 > stationList.size() - 1 || !isGoingToNextStation) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "行程日志-mismatch condition2.");
CallerLogger.e(M_BUS + TAG, "行程日志-mismatch condition2.");
return null;
}
currentStation = stationList.get(leaveIndex);
@@ -1264,7 +1279,7 @@ public class OrderModel {
parameters.vehicleType = VEHICLE_TYPE;
if (parameters.autoPilotLine == null) {
parameters.autoPilotLine = new AutopilotControlParameters.AutoPilotLine(
busRoutesResult.getLineId(),
busRoutesResult.getLineId(), busRoutesResult.getName(),
busRoutesResult.csvFileUrl, busRoutesResult.csvFileMd5,
busRoutesResult.txtFileUrl, busRoutesResult.txtFileMd5,
busRoutesResult.contrailSaveTime, busRoutesResult.carModel,

View File

@@ -37,7 +37,7 @@ public class BusProvider implements IMogoOCH {
* 进入鹰眼模式设置手势缩放地图失效
*/
private void stepIntoVrMode() {
CallerLogger.INSTANCE.d(M_BUS + TAG, "进入vr模式");
CallerLogger.d(M_BUS + TAG, "进入vr模式");
CallerMoGoUiSettingManager.INSTANCE.stepInNightMode();//夜间模式 状态栏字体颜色变黑
}
@@ -48,7 +48,7 @@ public class BusProvider implements IMogoOCH {
private void showFragment() {
FragmentManager supportFragmentManager = activity.getSupportFragmentManager();
if (busFragment == null) {
CallerLogger.INSTANCE.d(TAG, "准备add fragment======");
CallerLogger.d(TAG, "准备add fragment======");
Fragment fragmentByTag = supportFragmentManager.findFragmentByTag(BusFragment.TAG);
if (fragmentByTag instanceof BusFragment) {
busFragment = (BusFragment) fragmentByTag;
@@ -60,13 +60,13 @@ public class BusProvider implements IMogoOCH {
}
return;
}
CallerLogger.INSTANCE.d(TAG, "准备show fragment");
CallerLogger.d(TAG, "准备show fragment");
supportFragmentManager.beginTransaction().show(busFragment).commitAllowingStateLoss();
}
private void hideFragment() {
if (busFragment != null) {
CallerLogger.INSTANCE.d(TAG, "准备hide fragment");
CallerLogger.d(TAG, "准备hide fragment");
activity.getSupportFragmentManager().beginTransaction().hide(busFragment).commitAllowingStateLoss();
}

View File

@@ -142,11 +142,11 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (controller != null) {
//切换地图的远近视图
if (controller.getCurrentMapVisualAngle().isLongSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(true);
controller.changeMapVisualAngle(VisualAngleMode.MODE_MEDIUM_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_medium);
} else if (controller.getCurrentMapVisualAngle().isMediumSight()) {
Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
//Objects.requireNonNull(CallerMapUIServiceManager.INSTANCE.getMapUIController()).setLockMode(false);
controller.changeMapVisualAngle(VisualAngleMode.MODE_LONG_SIGHT, null);
mSwitchMapModeImage.setImageResource(R.drawable.bus_switch_map_long);
} else {
@@ -586,6 +586,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
*/
private View busTestBar;
private TextView lineIdTV;
private TextView lineNameTV;
private TextView trajMd5TV;
private TextView stopMd5TV;
private TextView trajMd5DPQPTV;
@@ -595,6 +596,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (busTestBar == null) {
busTestBar = findViewById(R.id.module_mogo_och_bus_test_bar);
lineIdTV = findViewById(R.id.bus_test_bar_current_line_id);
lineNameTV = findViewById(R.id.bus_test_bar_current_line_name);
trajMd5TV = findViewById(R.id.bus_test_bar_current_traj_md5);
stopMd5TV = findViewById(R.id.bus_test_bar_current_stop_md5);
trajMd5DPQPTV = findViewById(R.id.bus_test_bar_current_traj_md5_dpqp);
@@ -606,6 +608,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
} else {
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
lineIdTV.setText("lineId:" + (routesResult == null ? "" : String.valueOf(routesResult.getLineId())));
lineNameTV.setText("lineName:" + (routesResult == null ? "" : routesResult.getName()));
trajMd5TV.setText("TMd5:" + (routesResult == null ? "" : routesResult.csvFileMd5));
stopMd5TV.setText("SMd5:" + (routesResult == null ? "" : routesResult.txtFileMd5));
trajMd5DPQPTV.setText("TMd5DPQP:" + (routesResult == null ? "" : routesResult.csvFileMd5DPQP));
@@ -618,6 +621,7 @@ public abstract class BaseBusTabFragment<V extends IView, P extends Presenter<V>
if (busTestBar != null && busTestBar.getVisibility() == View.VISIBLE) {
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
lineIdTV.setText("lineId:" + (routesResult == null ? "" : String.valueOf(routesResult.getLineId())));
lineNameTV.setText("lineName:" + (routesResult == null ? "" : routesResult.getName()));
trajMd5TV.setText("TMd5:" + (routesResult == null ? "" : routesResult.csvFileMd5));
stopMd5TV.setText("SMd5:" + (routesResult == null ? "" : routesResult.txtFileMd5));
trajMd5DPQPTV.setText("TMd5DPQP:" + (routesResult == null ? "" : routesResult.csvFileMd5DPQP));

View File

@@ -107,7 +107,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
groupStationsPanel = findViewById(R.id.group_stations_panel);
noDataView = findViewById(R.id.no_line_data_view);
CallerLogger.INSTANCE.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getState());
CallerLogger.d(M_BUS + TAG, "initView: " + CallerAutoPilotStatusListenerManager.INSTANCE.getState());
// 初始化的时候设置 UI 按钮状态
showAutopilotBiz();
@@ -125,10 +125,10 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
@Subscribe(threadMode = ThreadMode.MAIN)
public void changeOverview(EventLogout eventLogout){
if (eventLogout.getMessgae() == EventLogout.LOGOUT_TYPE){
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event消息去登出");
CallerLogger.d(M_BUS + TAG,"changeOverview Event消息去登出");
mPresenter.logout();
}else if (eventLogout.getMessgae() == EventLogout.SHOW_QR_TYPE){ //显示二维码
CallerLogger.INSTANCE.d(M_BUS + TAG,"changeOverview Event qrcode");
CallerLogger.d(M_BUS + TAG,"changeOverview Event qrcode");
String qrUrl = String.format(FunctionBuildConfig.urlJson.getBindDriverQRUrl(),
MoGoAiCloudClientConfig.getInstance().getSn());
Bitmap bmQr = QRUtilsKt.createQRCodeWithPicture(
@@ -141,7 +141,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
.cancelStr(getString(R.string.qr_cancel))
.qrBm(bmQr).build(getContext()).show();
}else {
CallerLogger.INSTANCE.d(M_BUS + TAG,"bmQr = null ");
CallerLogger.d(M_BUS + TAG,"bmQr = null ");
}
}
}
@@ -443,7 +443,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
public void clearBusStationsMarkers(){
CallerLogger.INSTANCE.d(M_BUS + TAG,"clearBusStationsMarkers()");
CallerLogger.d(M_BUS + TAG,"clearBusStationsMarkers()");
if (null != startStation) {
setOrRemoveMapMaker(false, BusConst.BUS_START_MAP_MAKER, startStation.getLat()
, startStation.getLon(),R.raw.star_marker);
@@ -454,7 +454,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}
//清除鹰眼右下角小地图轨迹
CallerLogger.INSTANCE.d(SceneConstant.M_BUS, "clearBusStationsMarkers --------->");
CallerLogger.d(SceneConstant.M_BUS, "clearBusStationsMarkers --------->");
smallMapView.clearPolyline();
}
@@ -478,7 +478,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
private void setOrRemoveMapMaker(boolean isAdd, String uuid, double lat, double longi,int resourceId) {
if (isAdd) {
Runnable setMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
CallerLogger.d(M_BUS + "setMapMaker= "+Thread.currentThread().getName(),
uuid + "=latitude=" + lat + ",longitude=" + longi);
Point.Options.Builder builder = new Point.Options.Builder(BusConst.TYPE_MARKER_BUS_ORDER, Level.MAP_MARKER)
@@ -511,7 +511,7 @@ public class BusFragment extends BaseBusTabFragment<BusFragment, BusPresenter>
}else {
Runnable removeMapMarkerRunnable = () -> {
CallerLogger.INSTANCE.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
CallerLogger.d(M_BUS + "RemoveMapMaker="+Thread.currentThread().getName(),
uuid+"=latitude="+lat+",longitude="+longi);
IMoGoOverlayManager overlayManager = CallerMapUIServiceManager.INSTANCE.getOverlayManager();
if (overlayManager != null) {

View File

@@ -37,7 +37,7 @@ public class BusModelLoopManager {
// if (mQueryPassengerDisposable != null && !mQueryPassengerDisposable.isDisposed()) {
// return;
// }
// CallerLogger.INSTANCE.i(M_BUS + TAG, "startQueryPassengerWriteOffLoop()");
// CallerLogger.i(M_BUS + TAG, "startQueryPassengerWriteOffLoop()");
// mQueryPassengerDisposable = Observable.interval(LOOP_DELAY_500,
// LOOP_PASSENGER_5S, TimeUnit.MILLISECONDS)
// .map((aLong -> aLong + 1))
@@ -48,7 +48,7 @@ public class BusModelLoopManager {
// public void stopQueryPassengerWriteOffLoop() {
// if (mQueryPassengerDisposable != null) {
// CallerLogger.INSTANCE.i(M_BUS + TAG, "stopQueryPassengerWriteOffLoop()");
// CallerLogger.i(M_BUS + TAG, "stopQueryPassengerWriteOffLoop()");
// mQueryPassengerDisposable.dispose();
// mQueryPassengerDisposable = null;
// }
@@ -58,7 +58,7 @@ public class BusModelLoopManager {
if (mHeartbeatDisposable != null && !mHeartbeatDisposable.isDisposed()) {
return;
}
CallerLogger.INSTANCE.i(M_BUS + TAG, "startHeartbeatLoop()");
CallerLogger.i(M_BUS + TAG, "startHeartbeatLoop()");
mHeartbeatDisposable = Observable.interval(BusConst.LOOP_DELAY,
BusConst.LOOP_PERIOD_60S, TimeUnit.MILLISECONDS)
.map((aLong -> aLong + 1))
@@ -69,7 +69,7 @@ public class BusModelLoopManager {
public void stopHeartbeatLoop() {
if (mHeartbeatDisposable != null) {
CallerLogger.INSTANCE.i(M_BUS + TAG, "stopHeartbeatLoop()");
CallerLogger.i(M_BUS + TAG, "stopHeartbeatLoop()");
mHeartbeatDisposable.dispose();
mHeartbeatDisposable = null;
}

View File

@@ -31,7 +31,7 @@ import com.mogo.och.bus.util.BusTrajectoryManager;
import com.mogo.och.common.module.biz.bean.DriverStatusQueryRespBean;
import com.mogo.och.common.module.biz.callback.ILoginCallback;
import com.mogo.och.common.module.biz.constant.LoginStatusManager;
import com.mogo.och.common.module.manager.OCHAdasAbilityManager;
import com.mogo.och.common.module.manager.autopilotmanager.OCHAdasAbilityManager;
import com.mogo.och.common.module.voice.VoiceNotice;
import java.util.ArrayList;
@@ -39,6 +39,7 @@ import java.util.List;
import mogo.telematics.pad.MessagePad;
import mogo_msg.MogoReportMsg;
import system_master.SsmInfo;
import system_master.SystemStatusInfo;
/**
@@ -122,7 +123,7 @@ public class BusPresenter extends Presenter<BusFragment>
}else {
mCurrentStation = arrivingOrArrivedIndex -1;
}
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
CallerLogger.d(M_BUS + "BusOrderModel =", " mCurrentStation =" + mCurrentStation);
if (mView != null) {
runOnUIThread(() -> mView.updateBusTaskStatus(lineName,lineTime,
stationList, arrivingOrArrivedIndex, isArrived));
@@ -149,7 +150,7 @@ public class BusPresenter extends Presenter<BusFragment>
@Override
public void onAutopilotArriveAtStation(MessagePad.ArrivalNotification arrivalNotification) {
CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
CallerLogger.e( M_BUS + TAG, "行程日志-onAutopilotArriveAtStation arrive");
OrderModel.getInstance().onArriveAt(arrivalNotification);
}
@@ -170,7 +171,7 @@ public class BusPresenter extends Presenter<BusFragment>
&& OrderModel.getInstance().isGoingToNextStation()
)
) {
CallerLogger.INSTANCE.d(M_BUS + "BusOrderModel=", "有美化功能");
CallerLogger.d(M_BUS + "BusOrderModel=", "有美化功能");
return;
}
// 改变UI自动驾驶状态
@@ -248,9 +249,14 @@ public class BusPresenter extends Presenter<BusFragment>
public void onAutopilotStatusRespByQuery(@NonNull SystemStatusInfo.StatusInfo status) {
}
@Override
public void onSystemStatus(@NonNull SsmInfo.SsmStatusInf statusInf) {
}
@Override
public void loginSuccess(DriverStatusQueryRespBean data) {
CallerLogger.INSTANCE.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
CallerLogger.d(M_BUS + TAG, " loginStatus =" + LoginStatusManager.isLogin());
if(LoginStatusManager.isLogin()){
OrderModel.getInstance().startOrStopOrderLoop(true);
OrderModel.getInstance().queryBusRoutes();

View File

@@ -25,7 +25,7 @@ public class TestBusBroadcastReceiver extends BroadcastReceiver {
try {
this.mContext = context;
int sceneType = intent.getIntExtra(BusConst.BROADCAST_TEST_BUS_CONTROL_TYPE_EXTRA_KEY, 0);
CallerLogger.INSTANCE.d(M_BUS + TAG, "sceneType:" + sceneType);
CallerLogger.d(M_BUS + TAG, "sceneType:" + sceneType);
// 分发场景
dispatchSceneTest(sceneType);

View File

@@ -0,0 +1,108 @@
package com.mogo.och.bus.util
import android.text.TextUtils
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.commons.debug.DebugConfig
import com.mogo.commons.utils.MogoAnalyticUtils
import com.mogo.eagle.core.data.app.AppConfigInfo
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatusListener
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotStatusListenerManager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.DateTimeUtils
import com.mogo.och.bus.constant.BusConst
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
/**
* OCH Bus埋点工具
*
* Created on 2022/3/24
*/
object BusAnalyticsManager {
private var mStartAutopilotKey: String? = null
private val mStartAutopilotParams = HashMap<String, Any>()
var startAutopiloTimeOut: Disposable? = null
fun triggerStartAutopilotFailureEventByAdas(failCode: String, failMsg: String) {
RxUtils.disposeSubscribe(startAutopiloTimeOut)
triggerStartAutopilotFailureEvent(failCode, failMsg)
}
private fun clearStartAutopilotParams() {
mStartAutopilotParams.clear()
}
private fun triggerStartAutopilotFailureEvent(failCode: String, failMsg: String) {
if (mStartAutopilotParams.isEmpty()) return
CallerLogger.e(SceneConstant.M_BUS + "triggerStartAutopilotFailureEvent", failMsg)
if (CallerAutoPilotStatusListenerManager.getState() != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING) {
mStartAutopilotParams[BusConst.EVENT_PARAM_START_FAILURE_CODE] = failCode
mStartAutopilotParams[BusConst.EVENT_PARAM_START_FAILURE_MSG] = failMsg
}
mStartAutopilotParams[BusConst.EVENT_PARAM_START_RESULT] =
CallerAutoPilotStatusListenerManager.getState() == IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING
MogoAnalyticUtils.track(mStartAutopilotKey, mStartAutopilotParams)
clearStartAutopilotParams() //清空参数数据,防止误传
}
/**
* 触发'开启自动驾驶'埋点流程
* 开启自动驾驶15s内成功则发送成功埋点否则发送失败埋点
* @param restart false点击'滑动出发'启动)/true接管后点击'自动驾驶'按钮启动)
* @param send 是否直接发送埋点15s内开启成功则直接发送成功埋点
*/
fun triggerStartAutopilotEvent(
restart: Boolean, send: Boolean, startName: String, endName: String, lineId: Int
) {
mStartAutopilotKey = if (restart) BusConst.EVENT_KEY_RESTART_AUTOPILOT else BusConst.EVENT_KEY_START_SERVICE
if (send) {
if (mStartAutopilotParams.isEmpty()) return
// 开启成功,上报埋点
mStartAutopilotParams[BusConst.EVENT_PARAM_START_FAILURE_CODE] = ""
mStartAutopilotParams[BusConst.EVENT_PARAM_START_FAILURE_MSG] = ""
RxUtils.disposeSubscribe(startAutopiloTimeOut)
mStartAutopilotParams[BusConst.EVENT_PARAM_START_RESULT] = true
MogoAnalyticUtils.track(mStartAutopilotKey, mStartAutopilotParams)
clearStartAutopilotParams() //清空参数数据,防止误传
} else {
val plateNum = AppConfigInfo.plateNumber
mStartAutopilotParams[BusConst.EVENT_PARAM_SN] = MoGoAiCloudClientConfig.getInstance().sn
mStartAutopilotParams[BusConst.EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
mStartAutopilotParams[BusConst.EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
mStartAutopilotParams[BusConst.EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
mStartAutopilotParams[BusConst.EVENT_PARAM_START_NAME] = startName
mStartAutopilotParams[BusConst.EVENT_PARAM_END_NAME] = endName
mStartAutopilotParams[BusConst.EVENT_PARAM_LINE_ID] = lineId
startAutopiloTimeOut = RxUtils.createSubscribeOnOwnThread(BusConst.LOOP_PERIOD_15S) {
// 15s内未开启上报失败埋点
triggerStartAutopilotFailureEvent("", "15s后app等待超时")
}
}
}
/**
* 触发"无法开启自驾已知异常"埋点
* @param startName
* @param endName
* @param lineId
*/
fun triggerUnableStartAPReasonEvent(
startName: String, endName: String, lineId: Int,
reason: String
) {
val plateNum = AppConfigInfo.plateNumber
val params = HashMap<String, Any>()
params[BusConst.EVENT_PARAM_SN] = MoGoAiCloudClientConfig.getInstance().sn
params[BusConst.EVENT_PARAM_PLATE_NUM] = if (TextUtils.isEmpty(plateNum)) "" else plateNum
params[BusConst.EVENT_PARAM_ENV_ONLINE] = DebugConfig.getNetMode() == DebugConfig.NET_MODE_RELEASE
params[BusConst.EVENT_PARAM_TIME] = DateTimeUtils.getTimeText(DateTimeUtils.yyyy_MM_dd_HH_mm_ss)
params[BusConst.EVENT_PARAM_START_NAME] = startName
params[BusConst.EVENT_PARAM_END_NAME] = endName
params[BusConst.EVENT_PARAM_LINE_ID] = lineId
params[BusConst.EVENT_PARAM_UNABLE_START_REASON] = reason
MogoAnalyticUtils.track(BusConst.EVENT_KEY_AP_UNABLE_START_REASON, params)
}
}

View File

@@ -41,7 +41,7 @@ public class BusTrajectoryManager {
private Disposable mSendReqDisposable = null;
public BusTrajectoryManager() {
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(-1,
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(-1, "",
"", "", "", "", 0, "",
"", "", "", "", 0);
}
@@ -54,11 +54,11 @@ public class BusTrajectoryManager {
if (LoginStatusManager.isLogin() && routesResult != null
&& OrderModel.getInstance().getCurrentStationIndex() == 0
&& !OrderModel.getInstance().isGoingToNextStation()) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "syncTrajectoryInfo() start.");
CallerLogger.d(M_BUS + TAG, "syncTrajectoryInfo() start.");
startTrajReqLoop();
} else {
// 无路线信息or当前未在始发站
CallerLogger.INSTANCE.d(M_BUS + TAG, "syncTrajectoryInfo() stop.");
CallerLogger.d(M_BUS + TAG, "syncTrajectoryInfo() stop.");
stopTrajReqLoop();
}
}
@@ -71,40 +71,45 @@ public class BusTrajectoryManager {
if (guardianInfo == null || !guardianInfo.hasCode()) return;
if ("ISYS_INIT_TRAJECTORY_START".equals(guardianInfo.getCode())) {
// 1. 轨迹管理_轨迹开始下载本地已有对应轨迹也触发
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹开始下载");
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹开始下载");
// ToastUtils.showShort("轨迹开始下载");
stopTrajReqLoop();
} else if ("ISYS_INIT_TRAJECTORY_SUCCESS".equals(guardianInfo.getCode())) {
// 2. 轨迹管理_轨迹下载成功本地已有对应轨迹也触发
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载成功");
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载成功");
// ToastUtils.showShort("轨迹下载成功");
stopTrajReqLoop();
} else if ("ISYS_INIT_TRAJECTORY_FAILURE".equals(guardianInfo.getCode())) {
// 3. 轨迹管理_轨迹下载失败本地无对应轨迹
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() " +
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " +
"轨迹下载失败,本地无对应轨迹");
// ToastUtils.showShort("轨迹下载失败,本地无对应轨迹");
} else if ("ISYS_INIT_TRAJECTORY_WARNING".equals(guardianInfo.getCode())) {
// 4. 轨迹管理_轨迹下载失败本地有对应轨迹认为成功
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() " +
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() " +
"轨迹下载失败,本地有对应轨迹,认为成功");
// ToastUtils.showShort("轨迹下载失败,本地有对应轨迹,认为成功");
} else if ("ISYS_INIT_TRAJECTORY_TIMEOUT".equals(guardianInfo.getCode())) {
// 5. 轨迹管理_轨迹下载超时
CallerLogger.INSTANCE.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载超时");
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() 轨迹下载超时");
// ToastUtils.showShort("轨迹下载超时");
} else if ("ISSM_FUNC_AUTO_PILOT_READY".equals(guardianInfo.getCode())) {
// 收到ssm的自动驾驶变为ready再次下发轨迹下载.解决域控重启或者102域控启动太早107节点初始化未完成导致的轨迹未进行下载
CallerLogger.d(M_BUS + TAG, "onAutopilotGuardian() ssm ready再次发起下载");
syncTrajectoryInfo();
}
}
private void setupAutoPilotLine() {
BusRoutesResult routesResult = OrderModel.getInstance().getBusRoutesResult();
if (routesResult == null) {
CallerLogger.INSTANCE.e(M_BUS + TAG,
CallerLogger.e(M_BUS + TAG,
"setupAutoPilotLine(): routesResult is null.");
return;
} else {
if (mAutoPilotLine == null) {
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(routesResult.getLineId(),
mAutoPilotLine = new AutopilotControlParameters.AutoPilotLine(
routesResult.getLineId(), routesResult.getName(),
routesResult.csvFileUrl, routesResult.csvFileMd5,
routesResult.txtFileUrl, routesResult.txtFileMd5,
routesResult.contrailSaveTime, routesResult.carModel,
@@ -113,6 +118,7 @@ public class BusTrajectoryManager {
routesResult.contrailSaveTimeDPQP);
} else {
mAutoPilotLine.setLineId(routesResult.getLineId());
mAutoPilotLine.setLineName(routesResult.getName());
mAutoPilotLine.setTrajUrl(routesResult.csvFileUrl);
mAutoPilotLine.setTrajMd5(routesResult.csvFileMd5);
mAutoPilotLine.setStopUrl(routesResult.txtFileUrl);
@@ -131,6 +137,7 @@ public class BusTrajectoryManager {
private void clearAutoPilotLine() {
if (mAutoPilotLine == null) return;
mAutoPilotLine.setLineId(-1);
mAutoPilotLine.setLineName("");
mAutoPilotLine.setTrajUrl("");
mAutoPilotLine.setTrajMd5("");
mAutoPilotLine.setStopUrl("");
@@ -148,7 +155,7 @@ public class BusTrajectoryManager {
if (mSendReqDisposable != null && !mSendReqDisposable.isDisposed()) {
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "startTrajReqLoop()");
CallerLogger.d(M_BUS + TAG, "startTrajReqLoop()");
setupAutoPilotLine();
mSendReqDisposable = Observable.interval(BusConst.LOOP_DELAY,
BusConst.LOOP_PERIOD_10S, TimeUnit.MILLISECONDS)
@@ -160,14 +167,14 @@ public class BusTrajectoryManager {
stopTrajReqLoop();
return;
}
CallerLogger.INSTANCE.d(M_BUS + TAG, "loop sendTrajectoryReq: " + aLong);
CallerLogger.d(M_BUS + TAG, "loop sendTrajectoryReq: " + aLong);
sendTrajectoryReq();
});
}
public void stopTrajReqLoop() {
if (mSendReqDisposable != null) {
CallerLogger.INSTANCE.d(M_BUS + TAG, "stopTrajReqLoop()");
CallerLogger.d(M_BUS + TAG, "stopTrajReqLoop()");
mSendReqDisposable.dispose();
mSendReqDisposable = null;
clearAutoPilotLine();
@@ -176,31 +183,12 @@ public class BusTrajectoryManager {
private void sendTrajectoryReq() {
if (mAutoPilotLine == null) {
CallerLogger.INSTANCE.e(M_BUS + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!");
CallerLogger.e(M_BUS + TAG, "sendTrajectoryReq(): mAutoPilotLine is null!!!");
return;
}
// TODO: 2022/6/24
// test1
// mAutoPilotLine.setLineId(148);
// mAutoPilotLine.setTrajUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/e27c20c2da32481021d934c3ef084536/traj_148.csv");
// mAutoPilotLine.setTrajMd5("e27c20c2da32481021d934c3ef084536");
// mAutoPilotLine.setStopUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/6224c9dd2c0e2bd990c6482c0464de45/stop_148.txt");
// mAutoPilotLine.setStopMd5("6224c9dd2c0e2bd990c6482c0464de45");
// mAutoPilotLine.setTimestamp(1654596000000L); //20220607 18:00
// mAutoPilotLine.setVehicleModel("红旗H9");
// test2
// mAutoPilotLine.setLineId(148);
// mAutoPilotLine.setTrajUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/8654497cf918be461a59c7ad8e22920d/traj_148.csv");
// mAutoPilotLine.setTrajMd5("8654497cf918be461a59c7ad8e22920d");
// mAutoPilotLine.setStopUrl("http://file-qa.zhidaozhixing.com/fileServer/upload/downloadFileStream?key=fileServer/online_car_hailing/1bb098b244922649bf3e7bada0d3950f/stop_148.txt");
// mAutoPilotLine.setStopMd5("1bb098b244922649bf3e7bada0d3950f");
// mAutoPilotLine.setTimestamp(1654761600000L); //20220609 16:00
// mAutoPilotLine.setVehicleModel("红旗H9");
CallerAutoPilotControlManager.INSTANCE.sendTrajectoryDownloadReq(mAutoPilotLine);
CallerLogger.INSTANCE.d(M_BUS + TAG, "sendTrajectoryReq(): "
CallerLogger.d(M_BUS + TAG, "sendTrajectoryReq(): "
+ GsonUtils.toJson(mAutoPilotLine));
}
}

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 323 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

View File

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 53 KiB

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 491 B

After

Width:  |  Height:  |  Size: 491 B

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 1004 B

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

View File

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 377 B

After

Width:  |  Height:  |  Size: 377 B

Some files were not shown because too many files have changed in this diff Show More