[282 taxi乘客屏] 处理启动自动驾驶按钮卡顿问题

This commit is contained in:
wangmingjun
2022-07-21 20:31:18 +08:00
parent a594ad2092
commit 6993d5abe7

View File

@@ -1015,7 +1015,12 @@ public class TaxiModel {
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToStart) {
judgeStartStation(location);
}
if (getCurOrderStatus() == TaxiOrderStatusEnum.OnTheWayToEnd &&
mPrevAPStatus != IMoGoAutopilotStatusListener.STATUS_AUTOPILOT_RUNNING){
judgeEndStation(location);
}
}
mLongitude = location.getLongitude();
mLatitude = location.getLatitude();
if (mControllerStatusCallback != null) {
@@ -1024,6 +1029,37 @@ public class TaxiModel {
}
};
private void judgeEndStation(Location location) {
if (mCurrentOCHOrder == null || mCurrentOCHOrder.endSiteGcjPoint == null
|| mCurrentOCHOrder.endSiteGcjPoint.size() < 2) {
return;
}
double startLon = mCurrentOCHOrder.endSiteGcjPoint.get(0);
double startLat = mCurrentOCHOrder.endSiteGcjPoint.get(1);
double distance = CoordinateUtils.calculateLineDistance(
startLon, startLat,
location.getLongitude(), location.getLatitude());
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() distance = " + distance);
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
}
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
if (!checkCurrentOCHOrder()
|| (getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtEnd)) {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "order exception or order ArriveAtEnd");
return;
}
arriveTerminal();
return;
}
}
/**
* 订单流转debug START
*/
@@ -1134,10 +1170,8 @@ public class TaxiModel {
|| (getCurOrderStatus() == TaxiOrderStatusEnum.ArriveAtEnd)) {
return;
}
if (DebugConfig.isDebug()) {
// ToastUtils.showShort("到达目的地");
}
arriveTerminal();
if (FunctionBuildConfig.isDemoMode) {
// 当美化模式(演示模式)开启时: 到达目的地置false
FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData = false;