long time = vp.hasTimestamp() ? vp.getTimestamp() * 1000 : currentTime(); BlockDescriptor bd = getTripDescriptorAsBlockDescriptor(result, td, time);
if (vehicle.hasTimestamp()) gpsTime = vehicle.getTimestamp()*Time.MS_PER_SEC; else {
private void applyVehiclePositionToRecord(MonitoredResult result, BlockDescriptor blockDescriptor, VehiclePosition vehiclePosition, VehicleLocationRecord record) { Position position = vehiclePosition.getPosition(); if (vehiclePosition.hasTimestamp()) { record.setTimeOfLocationUpdate(TimeUnit.SECONDS.toMillis(vehiclePosition.getTimestamp())); //vehicle timestamp is in seconds } record.setCurrentLocationLat(position.getLatitude()); record.setCurrentLocationLon(position.getLongitude()); if (result != null) { result.addLatLon(position.getLatitude(), position.getLongitude()); } if (_scheduleAdherenceFromLocation) { CoordinatePoint location = new CoordinatePoint(position.getLatitude(), position.getLongitude()); double totalDistance = blockDescriptor.getBlockInstance().getBlock().getTotalBlockDistance(); long timestamp = vehiclePosition.hasTimestamp() ? record.getTimeOfLocationUpdate() : record.getTimeOfRecord(); ScheduledBlockLocation loc = _blockGeospatialService.getBestScheduledBlockLocationForLocation( blockDescriptor.getBlockInstance(), location, timestamp, 0, totalDistance); long serviceDateTime = record.getServiceDate(); long effectiveScheduleTime = loc.getScheduledTime() + (serviceDateTime/1000); double deviation = timestamp/1000 - effectiveScheduleTime; double oldDeviation = record.getScheduleDeviation(); record.setScheduleDeviation(deviation); _log.debug("deviation reset to {} from {} for vehicle {}", deviation, oldDeviation, vehiclePosition.getVehicle().getId()); } }
VehiclePositionModel vpm = new VehiclePositionModel(); if (entity.hasVehicle()) { if (entity.getVehicle().hasTimestamp()) { timestamp = entity.getVehicle().getTimestamp() * 1000;
setCurrentStatus(other.getCurrentStatus()); if (other.hasTimestamp()) { setTimestamp(other.getTimestamp());
setCurrentStatus(other.getCurrentStatus()); if (other.hasTimestamp()) { setTimestamp(other.getTimestamp());