Skip to content
This repository was archived by the owner on Aug 16, 2019. It is now read-only.

Commit 6ecf03a

Browse files
author
Matt Conway
committed
Thru routes weren't quite being ignored (#43). It seemed like they actually
worked OK though, although obviously they said offboard->onboard when they could say ride through. Maybe it's time to think about transfers (#44).
1 parent f1276ee commit 6ecf03a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tbdhotel.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -625,8 +625,10 @@ com.transitboard.hotel.prototype.getTripPlanOnly = function (dest) {
625625
return;
626626

627627
// We don't handle throughroutes yet (issue 43)
628-
if (Number(itin.find('numberOfTripLegs').text()) > 3)
628+
if (Number(itin.find('numberOfTripLegs').text()) > 3) {
629629
console.log('Too many trip legs, probably issue 43!');
630+
return;
631+
}
630632

631633
// route 90 is an alternate number for MAX
632634
var freqService = ['4', '6', '8', '9', '12', '14',
@@ -997,15 +999,21 @@ com.transitboard.hotel.prototype.getTransitGeometry = function (leg) {
997999
* Get real time arrivals for a given stop and line
9981000
* It is assumed that the headsign that is passed in is the same as the
9991001
* one returned by the trip planning service. It is further assumed that the
1000-
* stopId is one that arrivals have been requested for; this function will
1001-
* return null (not undefined) if it is not.
1002+
* stopId is one that arrivals have been requested for; no checking is
1003+
* performed
10021004
* @param {string} stopId The stop ID arrivals are being requested for
10031005
* @param {string} route The route this vehicle is serving
10041006
* @param {string} headsign The headsign of the requested vehicle
1007+
* @returns {arrivalsQueue} A queue of transit arrivals.
10051008
*/
10061009
com.transitboard.hotel.prototype.getRealTimeArrivals = function (stopId,
10071010
route,
10081011
headsign) {
1012+
// TODO: order for efficiency?
1013+
return this.realTimeArrivals.arrivalsQueue
1014+
.byStop()[stopId]
1015+
.byLine()[route]
1016+
.byDest()[headsign]; // this really means byHeadsign
10091017

10101018
}
10111019

0 commit comments

Comments
 (0)