From e81433515863cb53eb00a50d3f6ca6bf5c82faf2 Mon Sep 17 00:00:00 2001 From: wangmingjun Date: Thu, 29 Sep 2022 14:51:27 +0800 Subject: [PATCH] =?UTF-8?q?[2.11.0/1.6.0]=20bus=E5=8F=B8=E6=9C=BA=E7=AB=AF?= =?UTF-8?q?=E5=88=B0=E7=AB=99=E5=9B=B4=E6=A0=8Fbug=EF=BC=8Ctaxi=E5=8F=B8?= =?UTF-8?q?=E6=9C=BA=E7=AB=AF=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/mogo/och/bus/model/BusOrderModel.java | 21 +++++++-------- .../com/mogo/och/taxi/model/TaxiModel.java | 26 +++++++++---------- 2 files changed, 23 insertions(+), 24 deletions(-) diff --git a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java index e76b271851..df6a0d1ea0 100644 --- a/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java +++ b/OCH/mogo-och-bus/src/main/java/com/mogo/och/bus/model/BusOrderModel.java @@ -326,15 +326,16 @@ public class BusOrderModel { //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 if (isGoingToNextStation && !isArrivedStation){ - judgeStartStation(location); + judgeArrivedStation(location); } } }; - //根据围栏判断,是否到达起点 - private void judgeStartStation(Location location) { + //根据围栏判断,是否到达站点 + private void judgeArrivedStation(Location location) { if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){ + CallerLogger.INSTANCE.e( M_BUS + TAG, "到站数组越界" ); return; } BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1); @@ -345,13 +346,8 @@ public class BusOrderModel { startLon, startLat, location.getLongitude(), location.getLatitude() ); - CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeStartStation() distance = " + distance); - - if ( distance > BusConst.ARRIVE_AT_END_STATION_DISTANCE ) { - distance = CoordinateUtils.calculateLineDistance(startLon, startLat, - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), - CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); - } + CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeArrivedStation() distance = " + distance + +" to " + upcomingStation.getName()); if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) { onArriveAt(null); //无自动驾驶到站信息传null @@ -493,9 +489,12 @@ public class BusOrderModel { */ private void startAutopilot(boolean isRestart) { + if (backgroundCurrentStationIndex +1 > stationList.size() - 1 || !isGoingToNextStation){ + return; + } + triggerStartServiceEvent(isRestart, false); - isArrivedStation = false; BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex); BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1); 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 5362bf5930..d18442ea0f 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 @@ -909,17 +909,17 @@ public class TaxiModel { startLon, startLat, location.getLongitude(), location.getLatitude()); - if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { - // ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue()); - } +// if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { +// // ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue()); +// } CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeStartStation() 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) { +// distance = CoordinateUtils.calculateLineDistance(startLon, startLat, +// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), +// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); +// } if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { arrivedStartPoint(); @@ -1007,11 +1007,11 @@ public class TaxiModel { 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) { +// distance = CoordinateUtils.calculateLineDistance(startLon, startLat, +// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), +// CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); +// } if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { if (!checkCurrentOCHOrder()