if (hasFrequency)
bean.setScheduledDepartureTime(bean.getPredictedDepartureTime());
}
BlockStopTimeEntry stopTime = instance.getBlockStopTime();
BlockLocation blockLocation = instance.getBlockLocation();
if (blockLocation == null)
return;
bean.setPredicted(blockLocation.isPredicted());
// Distance from stop
if (blockLocation.isDistanceAlongBlockSet()) {
double distanceFromStop = stopTime.getDistanceAlongBlock()
- blockLocation.getDistanceAlongBlock();
bean.setDistanceFromStop(distanceFromStop);
} else {
double distanceFromStop = stopTime.getDistanceAlongBlock()
- blockLocation.getScheduledDistanceAlongBlock();
bean.setDistanceFromStop(distanceFromStop);
}
// Number of stops away
if (blockLocation.getNextStop() != null) {
BlockStopTimeEntry nextStopTime = blockLocation.getNextStop();
bean.setNumberOfStopsAway(stopTime.getBlockSequence()
- nextStopTime.getBlockSequence());
}
if (blockLocation.getLastUpdateTime() > 0)
bean.setLastUpdateTime(blockLocation.getLastUpdateTime());
if (blockLocation.getVehicleId() != null)
bean.setVehicleId(AgencyAndIdLibrary.convertToString(blockLocation.getVehicleId()));
TripStatusBean tripStatusBean = _tripDetailsBeanService.getBlockLocationAsStatusBean(
blockLocation, targetTime);
bean.setTripStatus(tripStatusBean);
}