Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/org/mtransit/parser/db/DBUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ object DBUtils {
.appendColumn(MSchedule.ARRIVAL, SQLUtilsCommons.INT)
.appendColumn(MSchedule.DEPARTURE, SQLUtilsCommons.INT)
.appendColumn(MSchedule.TRIP_ID, SQLUtilsCommons.INT)
.appendColumn(MSchedule.STOP_SEQUENCE, SQLUtilsCommons.INT)
.appendColumn(MSchedule.WHEELCHAIR_BOARDING, SQLUtilsCommons.INT)
.appendColumn(MSchedule.HEADSIGN_TYPE, SQLUtilsCommons.INT)
.appendColumn(MSchedule.HEADSIGN_VALUE, SQLUtilsCommons.TXT) // string ??
Expand Down Expand Up @@ -375,6 +376,7 @@ object DBUtils {
"${mSchedule.arrival}," +
"${mSchedule.departure}," +
"${mSchedule.tripIdInt}," +
"${mSchedule.stopSequence}," +
"${mSchedule.accessible}," +
"${mSchedule.headsignType}," +
"${mSchedule.headsignValue?.quotesEscape()}" +
Expand Down Expand Up @@ -543,6 +545,7 @@ object DBUtils {
rs.getInt(MSchedule.ARRIVAL),
rs.getInt(MSchedule.DEPARTURE),
rs.getInt(MSchedule.TRIP_ID),
rs.getInt(MSchedule.STOP_SEQUENCE),
rs.getInt(MSchedule.WHEELCHAIR_BOARDING),
rs.getInt(MSchedule.HEADSIGN_TYPE),
rs.getStringOrNull(MSchedule.HEADSIGN_VALUE)?.unquotes(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ private String parseGStopTimes(HashMap<String, MSchedule> mSchedules,
mStopId,
times,
gStopTime.getTripIdInt(),
gStopTime.getStopSequence(),
gTrip.getWheelchairAccessible().getId()
);
if (mSchedules.containsKey(mSchedule.getUID()) //
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/org/mtransit/parser/mt/data/MSchedule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ data class MSchedule( // MStopTime
val arrival: Int, // HHmmss
val departure: Int, // HHmmss
val tripIdInt: Int,
val stopSequence: Int,
val accessible: Int,
var headsignType: Int = -1,
var headsignValue: String? = null,
Expand All @@ -29,6 +30,7 @@ data class MSchedule( // MStopTime
stopId: Int,
times: Pair<Int?, Int?>,
tripIdInt: Int,
stopSequence: Int,
accessible: Int,
) : this(
routeId = routeId,
Expand All @@ -38,6 +40,7 @@ data class MSchedule( // MStopTime
arrival = (times.first ?: 0),
departure = (times.second ?: 0),
tripIdInt = tripIdInt,
stopSequence = stopSequence,
accessible = accessible,
)

Expand Down Expand Up @@ -127,6 +130,9 @@ data class MSchedule( // MStopTime
}
add(_tripId.convertTripId(quotesString = true))
}
if (FeatureFlags.F_EXPORT_STOP_SEQUENCE) {
add(stopSequence.toString())
}
if (headsignType == MDirection.HEADSIGN_TYPE_NO_PICKUP) {
add(MDirection.HEADSIGN_TYPE_NO_PICKUP.toString())
if (FeatureFlags.F_SCHEDULE_NO_QUOTES) {
Expand Down Expand Up @@ -193,6 +199,7 @@ data class MSchedule( // MStopTime
const val ARRIVAL = "arrival"
const val DEPARTURE = "departure"
const val TRIP_ID = "trip_id"
const val STOP_SEQUENCE = "stop_sequence"
const val WHEELCHAIR_BOARDING = "wheelchair_boarding"
const val HEADSIGN_TYPE = "headsign_type"
const val HEADSIGN_VALUE = "headsign_value"
Expand Down