From f7711363389e68309ff9fb279754f82d34a55f66 Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Wed, 8 Apr 2015 10:00:11 -0400 Subject: [PATCH 01/13] comment out postgres params. --- conf/application.conf.template | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/application.conf.template b/conf/application.conf.template index 89d67448..0beedfa6 100644 --- a/conf/application.conf.template +++ b/conf/application.conf.template @@ -117,9 +117,9 @@ date.format=yyyy-MM-dd # db=mysql://user:pwd@host/database # # To connect to a local PostgreSQL9 database, use: - db.url=jdbc:postgresql://127.0.0.1/gtfs-editor - db.driver=org.postgresql.Driver - db.user=postgres +# db.url=jdbc:postgresql://127.0.0.1/gtfs-editor +# db.driver=org.postgresql.Driver +# db.user=postgres # # If you need a full JDBC configuration use the following : # db.url=jdbc:postgresql:database_name From 921fd36b5056fa3c85fb5764bb6c88ab0217c9fd Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 16:22:31 -0400 Subject: [PATCH 02/13] don't set useFrequency on trip patterns. --- public/javascripts/models.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/public/javascripts/models.js b/public/javascripts/models.js index ea9dde69..50008cd5 100755 --- a/public/javascripts/models.js +++ b/public/javascripts/models.js @@ -394,13 +394,11 @@ G.RouteTypes = Backbone.Collection.extend({ useFrequency: function() { this.trips.clearTrips(); - this.set('useFrequency', true); this.save(); }, useTimetable: function() { this.trips.clearTrips(); - this.set('useFrequency', false); this.save() } From 9ec059af652d2ed07b4d70f9547a52a1e3209f6f Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 16:32:13 -0400 Subject: [PATCH 03/13] restore useFrequency to trip patterns. --- app/models/transit/TripPattern.java | 2 ++ public/javascripts/models.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/models/transit/TripPattern.java b/app/models/transit/TripPattern.java index 481d780a..425c8789 100755 --- a/app/models/transit/TripPattern.java +++ b/app/models/transit/TripPattern.java @@ -53,6 +53,8 @@ public class TripPattern extends Model implements Cloneable, Serializable { // if true, use straight-line rather than shape-based distances public boolean useStraightLineDistances; + public boolean useFrequency; + public String routeId; public String agencyId; diff --git a/public/javascripts/models.js b/public/javascripts/models.js index 50008cd5..ea9dde69 100755 --- a/public/javascripts/models.js +++ b/public/javascripts/models.js @@ -394,11 +394,13 @@ G.RouteTypes = Backbone.Collection.extend({ useFrequency: function() { this.trips.clearTrips(); + this.set('useFrequency', true); this.save(); }, useTimetable: function() { this.trips.clearTrips(); + this.set('useFrequency', false); this.save() } From 90e1d155f45367f25c3a9eedf425072ef3618565 Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 16:34:27 -0400 Subject: [PATCH 04/13] et pattern ID when creating frequency trip. --- public/javascripts/views/trip-info-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index 299863f5..49e2df19 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -198,7 +198,7 @@ var GtfsEditor = GtfsEditor || {}; var tripData = { useFrequency: true, - pattern: selectedPatternId, + patternId: selectedPatternId, tripDescription: this.$('[name=name]').val() }; From 4016c84f0a19147a22973107b622ad3c6b3444bf Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 16:38:02 -0400 Subject: [PATCH 05/13] save agency ID along with trip. --- public/javascripts/views/trip-info-view.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index 49e2df19..42ea5d0b 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -199,6 +199,7 @@ var GtfsEditor = GtfsEditor || {}; var tripData = { useFrequency: true, patternId: selectedPatternId, + agencyId: G.session.agencyId, tripDescription: this.$('[name=name]').val() }; From 83378e29df04b5a8bb68a47d20a0fbc869d7f736 Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 17:20:14 -0400 Subject: [PATCH 06/13] work on frequency code. --- app/datastore/AgencyTx.java | 10 ++++++---- app/views/Application/route.html | 4 ++-- public/javascripts/views/trip-info-view.js | 19 ++++++++++++++++--- 3 files changed, 24 insertions(+), 9 deletions(-) diff --git a/app/datastore/AgencyTx.java b/app/datastore/AgencyTx.java index b3494750..c576e53b 100644 --- a/app/datastore/AgencyTx.java +++ b/app/datastore/AgencyTx.java @@ -217,12 +217,14 @@ public LocalDate[] run(String id, ScheduleException ex) { }); tripCountByCalendar = getMap("tripCountByCalendar"); - Bind.histogram(trips, tripCountByCalendar, new Fun.Function2() { + BindUtils.multiHistogram(trips, tripCountByCalendar, new Fun.Function2() { @Override - public String run(String key, Trip trip) { - // TODO Auto-generated method stub - return trip.calendarId; + public String[] run(String key, Trip trip) { + if (trip.calendarId == null) + return new String[] {}; + else + return new String[] { trip.calendarId }; } }); diff --git a/app/views/Application/route.html b/app/views/Application/route.html index 56790776..7b832891 100755 --- a/app/views/Application/route.html +++ b/app/views/Application/route.html @@ -276,7 +276,7 @@

&{'route.trip-info-tpl.calendar-create-moda

- {{#items}}{{/items}} @@ -344,7 +344,7 @@

&{'route.trip-info-tpl.calendar-create-moda

- {{#items}}{{/items}} diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index 42ea5d0b..cabb0ea3 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -92,11 +92,11 @@ var GtfsEditor = GtfsEditor || {}; var data = G.Utils.serializeForm($(evt.target)); - data.serviceCalendar = data.frequencyServiceCalendar; + data.calendarId = data.frequencyServiceCalendar; data = _.omit(data, ['file', 'scheduleType', 'frequencyServiceCalendar', 'timetableServiceCalendar']); - data.pattern = selectedPatternId; + data.patternId = selectedPatternId; data.startTime = this.calcTime(data.startTimeString); data.endTime = this.calcTime(data.endTimeString); data.headway = this.calcTime(data.serviceFrequencyString); @@ -203,6 +203,19 @@ var GtfsEditor = GtfsEditor || {}; tripDescription: this.$('[name=name]').val() }; + var arrivalTime = 0, departureTime = 0; + + tripData.stopTimes = _.map(this.model.tripPatterns.get(selectedPatternId).get('patternStops'), function (ps) { + arrivalTime = departureTime + ps.defaultTravelTime; + departureTime = arrivalTime + ps.defaultDwellTime; + + return { + stopId: ps.stopId, + arrivalTime: arrivalTime, + departureTime: departureTime + }; + }); + var view = this; this.model.tripPatterns.get(selectedPatternId).trips.create(tripData, { @@ -238,7 +251,7 @@ var GtfsEditor = GtfsEditor || {}; var tripData = { useFrequency: true, - pattern: selectedPatternId, + patternId: selectedPatternId, tripDescription: this.$('[name=name]').val(), serviceCalendar: serviceCalendarId, startTime: existingTrip.startTime, From cccbc2cbcd9ac95168f153dd7e0f16db7447a5cb Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 17:31:03 -0400 Subject: [PATCH 07/13] store route id in frequency trips. --- public/javascripts/views/trip-info-view.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index cabb0ea3..d688b8da 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -100,6 +100,7 @@ var GtfsEditor = GtfsEditor || {}; data.startTime = this.calcTime(data.startTimeString); data.endTime = this.calcTime(data.endTimeString); data.headway = this.calcTime(data.serviceFrequencyString); + data.routeId = this.tripPatterns.get('selectedPatternId').get('routeId'); delete data.startTimeString; delete data.endTimeString; From b1bdfc8946ee142ae6deb2eb3cfc90ea9c0dae62 Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 17:35:15 -0400 Subject: [PATCH 08/13] don't use quotes around variable name. --- public/javascripts/views/trip-info-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index d688b8da..0af7866c 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -100,7 +100,7 @@ var GtfsEditor = GtfsEditor || {}; data.startTime = this.calcTime(data.startTimeString); data.endTime = this.calcTime(data.endTimeString); data.headway = this.calcTime(data.serviceFrequencyString); - data.routeId = this.tripPatterns.get('selectedPatternId').get('routeId'); + data.routeId = this.tripPatterns.get(selectedPatternId).get('routeId'); delete data.startTimeString; delete data.endTimeString; From 52437df5a2822e424452a275b8ea665fe8255b86 Mon Sep 17 00:00:00 2001 From: Matthew Wigginton Conway Date: Tue, 14 Apr 2015 17:36:52 -0400 Subject: [PATCH 09/13] fix undefined var. --- public/javascripts/views/trip-info-view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/views/trip-info-view.js b/public/javascripts/views/trip-info-view.js index 0af7866c..260751af 100755 --- a/public/javascripts/views/trip-info-view.js +++ b/public/javascripts/views/trip-info-view.js @@ -100,7 +100,7 @@ var GtfsEditor = GtfsEditor || {}; data.startTime = this.calcTime(data.startTimeString); data.endTime = this.calcTime(data.endTimeString); data.headway = this.calcTime(data.serviceFrequencyString); - data.routeId = this.tripPatterns.get(selectedPatternId).get('routeId'); + data.routeId = this.model.tripPatterns.get(selectedPatternId).get('routeId'); delete data.startTimeString; delete data.endTimeString; From 591c27bec3d097fcf459862a6792144cbe57c044 Mon Sep 17 00:00:00 2001 From: Kevin Webb Date: Thu, 16 Apr 2015 13:18:39 -0400 Subject: [PATCH 10/13] fixed otp dependency --- conf/dependencies.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/dependencies.yml b/conf/dependencies.yml index afab04d9..b2aa1d7b 100755 --- a/conf/dependencies.yml +++ b/conf/dependencies.yml @@ -12,7 +12,7 @@ require: - org.geotools -> gt-geojson 12.2 - com.fasterxml.jackson.core -> jackson-core 2.4.4 - com.fasterxml.jackson.core -> jackson-databind 2.4.4 - - org.opentripplanner -> otp 1.0.0-SNAPSHOT + - org.opentripplanner -> otp 0.14.0 - net.sf.opencsv -> opencsv 2.0 - org.mapdb -> mapdb 1.0.7 From 9ba0399a6c6d591025c63b64c20f08c6092c4aff Mon Sep 17 00:00:00 2001 From: Kevin Webb Date: Thu, 16 Apr 2015 13:18:57 -0400 Subject: [PATCH 11/13] fixed account admin --- app/views/Admin/accounts.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/Admin/accounts.html b/app/views/Admin/accounts.html index 1fd4c1e0..dcc2bac4 100755 --- a/app/views/Admin/accounts.html +++ b/app/views/Admin/accounts.html @@ -118,7 +118,7 @@