mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 00:30:31 +00:00
parse intermediate stop arrival and departure times for efa based providers
This commit is contained in:
parent
b5faeadb8b
commit
d37af7e32c
1 changed files with 18 additions and 6 deletions
|
@ -2042,21 +2042,33 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
while (XmlPullUtil.test(pp, "itdPoint"))
|
||||
{
|
||||
final Location stopLocation = processItdPointAttributes(pp);
|
||||
|
||||
final String stopPosition;
|
||||
if (!suppressPositions)
|
||||
stopPosition = normalizePlatform(pp.getAttributeValue(null, "platform"),
|
||||
pp.getAttributeValue(null, "platformName"));
|
||||
else
|
||||
stopPosition = null;
|
||||
|
||||
XmlPullUtil.enter(pp, "itdPoint");
|
||||
XmlPullUtil.require(pp, "itdDateTime");
|
||||
final boolean success1 = processItdDateTime(pp, time);
|
||||
final boolean success2 = XmlPullUtil.test(pp, "itdDateTime") ? processItdDateTime(pp, time) : false;
|
||||
final Date stopTime = time.getTime(); // TODO arrival/departure, planned/predicted?
|
||||
XmlPullUtil.exit(pp, "itdPoint");
|
||||
|
||||
if (success1 || success2)
|
||||
intermediateStops.add(new Stop(stopLocation, null, null, stopTime, stopPosition));
|
||||
final Date stopArrivalTime;
|
||||
if (processItdDateTime(pp, time))
|
||||
stopArrivalTime = time.getTime();
|
||||
else
|
||||
stopArrivalTime = null;
|
||||
|
||||
final Date stopDepartureTime;
|
||||
if (XmlPullUtil.test(pp, "itdDateTime") && processItdDateTime(pp, time))
|
||||
stopDepartureTime = time.getTime();
|
||||
else
|
||||
stopDepartureTime = null;
|
||||
|
||||
intermediateStops.add(new Stop(stopLocation, stopArrivalTime, stopPosition, stopDepartureTime, stopPosition));
|
||||
// TODO planned/predicted?
|
||||
|
||||
XmlPullUtil.exit(pp, "itdPoint");
|
||||
}
|
||||
XmlPullUtil.exit(pp, "itdStopSeq");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue