Search in sources :

Example 1 with SchedTerminalCombo

use of gov.wa.wsdot.ferries.schedule.SchedTerminalCombo in project onebusaway-gtfs-modules by OneBusAway.

the class WSFScheduleService method setBlockIdsFromSchedResponse.

private void setBlockIdsFromSchedResponse(SchedResponse resp) {
    List<SchedTerminalCombo> combos = resp.getTerminalCombos().getValue().getSchedTerminalCombo();
    for (SchedTerminalCombo stc : combos) {
        String depart = stc.getDepartingTerminalID().toString();
        String arrive = stc.getArrivingTerminalID().toString();
        for (SchedTime sched : schedTime(stc)) {
            long time = ts(sched.getDepartingTime());
            Trip trip = _tripResolutionService.resolve(depart, time, arrive);
            if (trip != null) {
                trip.setBlockId(sched.getVesselID().toString());
            } else {
                _log.warn("Skipping schedTime due to no matching trip {}", sched.toString());
            }
        }
    }
}
Also used : Trip(org.onebusaway.gtfs.model.Trip) SchedTerminalCombo(gov.wa.wsdot.ferries.schedule.SchedTerminalCombo) SchedTime(gov.wa.wsdot.ferries.schedule.SchedTime)

Aggregations

SchedTerminalCombo (gov.wa.wsdot.ferries.schedule.SchedTerminalCombo)1 SchedTime (gov.wa.wsdot.ferries.schedule.SchedTime)1 Trip (org.onebusaway.gtfs.model.Trip)1