mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-21 01:39:51 +00:00
Parse requested station name for Hafas station boards.
This commit is contained in:
parent
5910c13c75
commit
f2b0467f6b
1 changed files with 19 additions and 1 deletions
|
@ -640,6 +640,22 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.enter(pp, "StationTable");
|
||||
}
|
||||
|
||||
String[] stationPlaceAndName = null;
|
||||
if (XmlPullUtil.test(pp, "St"))
|
||||
{
|
||||
final String evaId = XmlPullUtil.attr(pp, "evaId");
|
||||
if (evaId != null)
|
||||
{
|
||||
if (!evaId.equals(stationId))
|
||||
throw new IllegalStateException("stationId: " + stationId + ", evaId: " + evaId);
|
||||
|
||||
final String name = XmlPullUtil.attr(pp, "name");
|
||||
if (name != null)
|
||||
stationPlaceAndName = splitPlaceAndName(name.trim());
|
||||
}
|
||||
XmlPullUtil.requireSkip(pp, "St");
|
||||
}
|
||||
|
||||
while (XmlPullUtil.test(pp, "Journey"))
|
||||
{
|
||||
final String fpTime = XmlPullUtil.attr(pp, "fpTime");
|
||||
|
@ -777,7 +793,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.requireSkip(pp, "Journey");
|
||||
}
|
||||
|
||||
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, stationId), departures, null));
|
||||
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, stationId,
|
||||
stationPlaceAndName != null ? stationPlaceAndName[0] : null, stationPlaceAndName != null ? stationPlaceAndName[1] : null),
|
||||
departures, null));
|
||||
return result;
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue