[2.11.0/1.6.0] bus司机端到站围栏bug,taxi司机端删除无用代码

This commit is contained in:
wangmingjun
2022-09-29 14:51:27 +08:00
parent c6a7e13945
commit e814335158
2 changed files with 23 additions and 24 deletions

View File

@@ -326,15 +326,16 @@ public class BusOrderModel {
//是否到站的围栏判断 离站状态并且自动驾驶还未触发到站 //是否到站的围栏判断 离站状态并且自动驾驶还未触发到站
if (isGoingToNextStation && !isArrivedStation){ if (isGoingToNextStation && !isArrivedStation){
judgeStartStation(location); judgeArrivedStation(location);
} }
} }
}; };
//根据围栏判断,是否到达 //根据围栏判断,是否到达
private void judgeStartStation(Location location) { private void judgeArrivedStation(Location location) {
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){ if (backgroundCurrentStationIndex +1 > stationList.size() - 1 ){
CallerLogger.INSTANCE.e( M_BUS + TAG, "到站数组越界" );
return; return;
} }
BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1); BusStationBean upcomingStation = stationList.get( backgroundCurrentStationIndex +1);
@@ -345,13 +346,8 @@ public class BusOrderModel {
startLon, startLat, startLon, startLat,
location.getLongitude(), location.getLatitude() ); location.getLongitude(), location.getLatitude() );
CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeStartStation() distance = " + distance); CallerLogger.INSTANCE.d(M_BUS + TAG,"judgeArrivedStation() distance = " + distance
+" to " + upcomingStation.getName());
if ( distance > BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
}
if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) { if ( distance <= BusConst.ARRIVE_AT_END_STATION_DISTANCE ) {
onArriveAt(null); //无自动驾驶到站信息传null onArriveAt(null); //无自动驾驶到站信息传null
@@ -493,9 +489,12 @@ public class BusOrderModel {
*/ */
private void startAutopilot(boolean isRestart) { private void startAutopilot(boolean isRestart) {
if (backgroundCurrentStationIndex +1 > stationList.size() - 1 || !isGoingToNextStation){
return;
}
triggerStartServiceEvent(isRestart, false); triggerStartServiceEvent(isRestart, false);
isArrivedStation = false;
BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex); BusStationBean currentStation = stationList.get( backgroundCurrentStationIndex);
BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1); BusStationBean nextStation = stationList.get( backgroundCurrentStationIndex + 1);

View File

@@ -909,17 +909,17 @@ public class TaxiModel {
startLon, startLat, startLon, startLat,
location.getLongitude(), location.getLatitude()); location.getLongitude(), location.getLatitude());
if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) { // if (DebugConfig.isDebug() && mCurrentOCHOrder.orderStatus == TaxiOrderStatusEnum.OnTheWayToStart.getCode()) {
// ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue()); // // ToastUtils.showShort("距离上车点:" + Double.valueOf(distance).intValue());
} // }
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeStartStation() distance = " + distance); CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeStartStation() distance = " + distance);
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { // if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat, // distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), // CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); // CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
} // }
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
arrivedStartPoint(); arrivedStartPoint();
@@ -1007,11 +1007,11 @@ public class TaxiModel {
CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() distance = " + distance); CallerLogger.INSTANCE.i(M_TAXI + TAG, "judgeEndStation() distance = " + distance);
if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { // if (distance > TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
distance = CoordinateUtils.calculateLineDistance(startLon, startLat, // distance = CoordinateUtils.calculateLineDistance(startLon, startLat,
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(), // CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lon(),
CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat()); // CallerAutoPilotStatusListenerManager.INSTANCE.getCurWgs84Lat());
} // }
if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) { if (distance <= TaxiConst.ARRIVE_AT_START_STATION_DISTANCE) {
if (!checkCurrentOCHOrder() if (!checkCurrentOCHOrder()