Examples of MonitoredVehicleJourney


Examples of org.onebusaway.siri.model.MonitoredVehicleJourney

  public static MonitoredVehicleJourney getMonitoredVehicleJourney(
      TripDetailsBean trip, Date serviceDate, String vehicleId) {
    TripBean tripBean = trip.getTrip();

    MonitoredVehicleJourney monitoredVehicleJourney = new MonitoredVehicleJourney();

    monitoredVehicleJourney.CourseOfJourneyRef = getIdWithoutAgency(trip.getTripId());
    RouteBean route = tripBean.getRoute();
    monitoredVehicleJourney.LineRef = getIdWithoutAgency(route.getId());
    monitoredVehicleJourney.DirectionRef = tripBean.getDirectionId();
View Full Code Here

Examples of org.onebusaway.siri.model.MonitoredVehicleJourney

        }
        activity.MonitoredVehicleJourney.OnwardCalls = SiriUtils.getOnwardCalls(
            stopTimes, serviceDateMillis, distance, tripStatus.getNextStop());
      }
    } else {
      activity.MonitoredVehicleJourney = new MonitoredVehicleJourney();
    }
    activity.MonitoredVehicleJourney.Monitored = true;

    activity.MonitoredVehicleJourney.VehicleRef = vehicleStatus.getVehicleId();
View Full Code Here

Examples of uk.org.siri.siri.VehicleActivityStructure.MonitoredVehicleJourney

      Date time = vehicleActivity.getRecordedAtTime();
      if (time == null)
        time = now;

      MonitoredVehicleJourney mvj = vehicleActivity.getMonitoredVehicleJourney();

      Duration delay = mvj.getDelay();
      if (delay == null)
        continue;

      VehicleRefStructure vehicleRef = mvj.getVehicleRef();
      if (vehicleRef == null || vehicleRef.getValue() == null)
        continue;

      BlockEntry block = getBlockForMonitoredVehicleJourney(mvj,
          endpointDetails);
      if (block == null) {
        TripEntry trip = getTripForMonitoredVehicleJourney(mvj, endpointDetails);
        if (trip != null)
          block = trip.getBlock();
      }

      if (block == null)
        continue;

      List<BlockInstance> instances = _blockCalendarService.getActiveBlocks(
          block.getId(), timeFrom, timeTo);

      // TODO : We currently assume that a block won't overlap with itself
      if (instances.size() != 1)
        continue;

      BlockInstance instance = instances.get(0);

      VehicleLocationRecord r = new VehicleLocationRecord();
      r.setTimeOfRecord(time.getTime());
      r.setServiceDate(instance.getServiceDate());
      r.setBlockId(block.getId());

      String agencyId = block.getId().getAgencyId();
      r.setVehicleId(new AgencyAndId(agencyId, vehicleRef.getValue()));

      r.setScheduleDeviation(delay.getTimeInMillis(now) / 1000);

      LocationStructure location = mvj.getVehicleLocation();
      if (location != null) {
        r.setCurrentLocationLat(location.getLatitude().doubleValue());
        r.setCurrentLocationLon(location.getLongitude().doubleValue());
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.