Skip to content
Draft
Show file tree
Hide file tree
Changes from 18 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
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ var Schedule.Timestamp.originalDepartureDelay: Duration

val Schedule.Timestamp.originalDeparture get() = departure - originalDepartureDelay

val Schedule.Timestamp.maxDate get() = maxOf(originalDeparture, departure, originalArrival, arrival)
val Schedule.Timestamp.minDate get() = minOf(originalDeparture, departure, originalArrival, arrival)

/**
* It's better to be early at the stop, than late and miss the vehicle departure -> truncate (floor by) to early w/ precision
*/
Expand Down Expand Up @@ -223,4 +226,4 @@ fun Schedule.Timestamp.toStringShort() = buildString {
append("[OLD]")
}
append("}")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ private List<ServiceUpdate> loadAgencyServiceUpdateDataFromWWW(@NonNull Context
final GtfsRealtime.Alert gAlert = gAlertAndId.getFirst();
final String feedEntityId = gAlertAndId.getSecond();
if (Constants.DEBUG) {
MTLog.d(this, "loadAgencyServiceUpdateDataFromWWW() > - GTFS[%s] %s", feedEntityId, GtfsRealtimeExt.toStringExt(gAlert));
MTLog.d(this, "loadAgencyServiceUpdateDataFromWWW() > GTFS - [%s] %s", feedEntityId, GtfsRealtimeExt.toStringExt(gAlert));
}
final Set<ServiceUpdate> alertsServiceUpdates = processAlerts(context, sourceLabel, feedEntityId, newLastUpdateInMs, gAlert, ignoreDirection);
if (alertsServiceUpdates != null && !alertsServiceUpdates.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ object GtfsRealtimeExt {
val GTripUpdate.optTimestamp get() = if (hasTimestamp()) timestamp else null
val GTripUpdate.optTimestampMs get() = optTimestamp?.secToMs()
val GTripUpdate.optDelay get() = if (hasDelay()) delay else null
val GTripUpdate.optDelayMs get() = this.optDelay?.secToMs()
val GTripUpdate.optDelayDuration get() = this.optDelay?.seconds
val GTripUpdate.optTripProperties get() = if (hasTripProperties()) tripProperties else null

Expand Down Expand Up @@ -281,6 +282,7 @@ object GtfsRealtimeExt {
}

val GTUStopTimeEvent.optDelay get() = if (hasDelay()) delay else null
val GTUStopTimeEvent.optDelayMs get() = this.optDelay?.secToMs()
val GTUStopTimeEvent.optDelayDuration: Duration? get() = this.optDelay?.seconds
val GTUStopTimeEvent.optTime get() = if (hasTime()) time else null
val GTUStopTimeEvent.optTimeMs get() = optTime?.secToMs()
Expand Down
Loading