From 6993d5abe75ff91ff529dcd06476a23499b49182 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Thu, 21 Jul 2022 20:31:18 +0800 Subject: [PATCH] =?UTF-8?q?[282=20taxi=E4=B9=98=E5=AE=A2=E5=B1=8F]=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=90=AF=E5=8A=A8=E8=87=AA=E5=8A=A8=E9=A9=BE?= =?UTF-8?q?=E9=A9=B6=E6=8C=89=E9=92=AE=E5=8D=A1=E9=A1=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/taxi/model/TaxiModel.java | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java index 3f672cc3b6..8b03f98c22 100644 --- a/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java +++ b/OCH/mogo-och-taxi/src/main/java/com/mogo/och/taxi/model/TaxiModel.java @@ -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;