[282 taxi乘客屏] 处理启动自动驾驶按钮卡顿问题
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user