mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 08:39:50 +00:00
workaround for highspeed train product selection
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@580 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
36059cc37e
commit
178e877ca2
1 changed files with 18 additions and 1 deletions
|
@ -1935,34 +1935,51 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
return location.name;
|
||||
}
|
||||
|
||||
protected static final String productParams(final String products)
|
||||
private static final String productParams(final String products)
|
||||
{
|
||||
if (products == null)
|
||||
return "";
|
||||
|
||||
final StringBuilder params = new StringBuilder("&includedMeans=checkbox");
|
||||
|
||||
boolean hasI = false;
|
||||
for (final char p : products.toCharArray())
|
||||
{
|
||||
if (p == 'I' || p == 'R')
|
||||
{
|
||||
params.append("&inclMOT_0=on");
|
||||
if (p == 'I')
|
||||
hasI = true;
|
||||
}
|
||||
|
||||
if (p == 'S')
|
||||
params.append("&inclMOT_1=on");
|
||||
|
||||
if (p == 'U')
|
||||
params.append("&inclMOT_2=on");
|
||||
|
||||
if (p == 'T')
|
||||
params.append("&inclMOT_3=on&inclMOT_4=on");
|
||||
|
||||
if (p == 'B')
|
||||
params.append("&inclMOT_5=on&inclMOT_6=on&inclMOT_7=on");
|
||||
|
||||
if (p == 'P')
|
||||
params.append("&inclMOT_10=on");
|
||||
|
||||
if (p == 'F')
|
||||
params.append("&inclMOT_9=on");
|
||||
|
||||
if (p == 'C')
|
||||
params.append("&inclMOT_8=on");
|
||||
|
||||
params.append("&inclMOT_11=on"); // TODO always show 'others', for now
|
||||
}
|
||||
|
||||
// workaround for highspeed trains: fails when you want highspeed, but not regional
|
||||
if (!hasI)
|
||||
params.append("&lineRestriction=403"); // means: all but ice
|
||||
|
||||
return params.toString();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue