[290 bus/taxi]taxi司机端开始计算数据为0优化
This commit is contained in:
@@ -1287,30 +1287,32 @@ public class TaxiModel {
|
||||
* 实时计算当前剩余里程和时间
|
||||
*/
|
||||
public void dynamicCalculateRouteInfo() {
|
||||
List<LatLng> lastPoints = CoordinateCalculateRouteUtil
|
||||
.getRemainPointListByCompare(mRoutePoints, mLongitude, mLatitude);
|
||||
if (mRoutePoints.size() > 0){
|
||||
List<LatLng> lastPoints = CoordinateCalculateRouteUtil
|
||||
.getRemainPointListByCompare(mRoutePoints, mLongitude, mLatitude);
|
||||
|
||||
float lastSumLength = 0;
|
||||
float lastSumLength = 0;
|
||||
|
||||
if (lastPoints.size() == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
lastPoints.get(0).longitude, lastPoints.get(0).latitude,
|
||||
mLongitude, mLatitude);
|
||||
} else {
|
||||
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
|
||||
if (lastPoints.size() == 1) { //只是最后一个点,计算当前位置和最后一个点的距离
|
||||
lastSumLength = CoordinateUtils.calculateLineDistance(
|
||||
lastPoints.get(0).longitude, lastPoints.get(0).latitude,
|
||||
mLongitude, mLatitude);
|
||||
} else {
|
||||
lastSumLength = CoordinateCalculateRouteUtil.calculateRouteSumLength(lastPoints);
|
||||
}
|
||||
|
||||
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
|
||||
Logger.d(M_TAXI + "dynamicCalculateRouteInfo"
|
||||
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
|
||||
+ " thread = "+ Thread.currentThread().getName());
|
||||
|
||||
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
|
||||
}
|
||||
|
||||
reportOrderRemain((long) lastSumLength, (long) lastTime);
|
||||
}
|
||||
|
||||
double lastTime = lastSumLength / TaxiConst.TAXI_AVERAGE_SPEED * 3.6; //秒
|
||||
Logger.d(M_TAXI + "dynamicCalculateRouteInfo"
|
||||
, "---lastSumLength: " + lastSumLength + "----lastTime : " + lastTime
|
||||
+ " thread = "+ Thread.currentThread().getName());
|
||||
|
||||
mCurrentOCHOrder.decreaseTravelDistance(lastSumLength);
|
||||
if (mOrderStatusCallback != null) {
|
||||
mOrderStatusCallback.onCurrentOrderDistToEndChanged((long) lastSumLength, (long) lastTime);
|
||||
}
|
||||
|
||||
reportOrderRemain((long) lastSumLength, (long) lastTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user