mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 09:29:49 +00:00
Fix products for Luxembourg.
This commit is contained in:
parent
e3108b8ea7
commit
3eed013c47
1 changed files with 30 additions and 6 deletions
|
@ -36,7 +36,7 @@ public class LuProvider extends AbstractHafasProvider
|
|||
|
||||
public LuProvider()
|
||||
{
|
||||
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 10, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 9, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -53,6 +53,31 @@ public class LuProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected char intToProduct(final int value)
|
||||
{
|
||||
if (value == 1)
|
||||
return 'I';
|
||||
if (value == 2)
|
||||
return 'I';
|
||||
if (value == 4)
|
||||
return 'I';
|
||||
if (value == 8)
|
||||
return 'R';
|
||||
if (value == 16)
|
||||
return 'S';
|
||||
if (value == 32)
|
||||
return 'B';
|
||||
if (value == 64)
|
||||
return 'B';
|
||||
if (value == 128)
|
||||
return 'B';
|
||||
if (value == 256)
|
||||
return 'B';
|
||||
|
||||
throw new IllegalArgumentException("cannot handle: " + value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setProductBits(final StringBuilder productBits, final Product product)
|
||||
{
|
||||
|
@ -72,23 +97,22 @@ public class LuProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (product == Product.SUBWAY)
|
||||
{
|
||||
productBits.setCharAt(7, '1'); // U-Bahn
|
||||
}
|
||||
else if (product == Product.TRAM)
|
||||
{
|
||||
productBits.setCharAt(8, '1'); // Straßenbahn
|
||||
}
|
||||
else if (product == Product.BUS)
|
||||
{
|
||||
productBits.setCharAt(5, '1'); // Bus
|
||||
productBits.setCharAt(5, '1');
|
||||
productBits.setCharAt(6, '1');
|
||||
productBits.setCharAt(7, '1');
|
||||
productBits.setCharAt(8, '1');
|
||||
}
|
||||
else if (product == Product.ON_DEMAND)
|
||||
{
|
||||
productBits.setCharAt(9, '1'); // AST/Rufbus
|
||||
}
|
||||
else if (product == Product.FERRY)
|
||||
{
|
||||
productBits.setCharAt(6, '1'); // Schiff
|
||||
}
|
||||
else if (product == Product.CABLECAR)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue