mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 00:30:31 +00:00
parse position in departures
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@673 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
4893baeee3
commit
0852203ea5
1 changed files with 6 additions and 2 deletions
|
@ -110,12 +110,13 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
, Pattern.DOTALL);
|
||||
private static final Pattern P_DEPARTURES_COARSE = Pattern.compile("<p class=\"journey\">\r\n(.*?)</p>", Pattern.DOTALL);
|
||||
private static final Pattern P_DEPARTURES_FINE = Pattern.compile(".*?" //
|
||||
+ "<strong>(.*?)</strong>.*?" // line
|
||||
+ "<strong>([^<]*)</strong>.*?" // line
|
||||
+ ">>\r\n" //
|
||||
+ "(.*?)\r\n" // destination
|
||||
+ "<br />\r\n" //
|
||||
+ "<strong>(\\d{1,2}:\\d{2})</strong>\r\n" // time
|
||||
+ "(?:<span class=\"delay\">([+-]?\\d+|Ausfall)</span>\r\n)?" // delay
|
||||
+ "(?:<span class=\"delay\">Aktivierung</span>\r\n)?" + "(?:([^<]*)<br />\r\n)?" // position
|
||||
, Pattern.DOTALL);
|
||||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
|
@ -165,7 +166,10 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
|
||||
mDepFine.group(4); // TODO delay
|
||||
|
||||
final Departure dep = new Departure(parsedTime.getTime(), line, line != null ? lineColors(line) : null, null, 0, destination);
|
||||
final String position = mDepFine.group(5);
|
||||
|
||||
final Departure dep = new Departure(parsedTime.getTime(), line, line != null ? lineColors(line) : null, position, 0,
|
||||
destination);
|
||||
|
||||
if (!departures.contains(dep))
|
||||
departures.add(dep);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue