[2.11.0 fix] bus司机端解决Map280版本到站返回密集中间站滑动出发立马到站问题

This commit is contained in:
wangmingjun
2022-10-18 19:04:55 +08:00
parent 3879bcde7c
commit c9bd42373d

View File

@@ -858,7 +858,23 @@ public class BusOrderModel {
if (isArrivedStation) return;
isArrivedStation = true;
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-到站==backgroundCurrentStationIndex=" + backgroundCurrentStationIndex);
//MAP 280 每隔100ms左右返回一次到站 导致在到达中间站后再次滑动出发后会有时间差,收到一次到站,出现问题
//此处比对 自驾告诉的到站站点坐标和本地应到站站点坐标, 一致时才能到站
if (data != null && data.getEndLocation() != null){
double latitude = data.getEndLocation().getLatitude(); //wgs
double longitude = data.getEndLocation().getLongitude();
int arrivedStationIndex = backgroundCurrentStationIndex + 1;
BusStationBean arriveStation = stationList.get(arrivedStationIndex);
if (Double.doubleToLongBits(latitude) != Double.doubleToLongBits(arriveStation.getLat())
|| Double.doubleToLongBits(longitude) != Double.doubleToLongBits(arriveStation.getLon())){
CallerLogger.INSTANCE.e( M_BUS + TAG, "行程日志-到站拦截,到站坐标不一致" );
return;
}
}
CallerLogger.INSTANCE.d( M_BUS + TAG, "行程日志-当前==backgroundCurrentStationIndex="
+ backgroundCurrentStationIndex);
isGoingToNextStation = false;
arriveSiteStation();