summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2020-12-19 16:55:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2020-12-19 16:55:33 +0100
commit79bbdc7dc1198594d06a278195bbc995ccd3da06 (patch)
tree4bbb4336c16e5c6dc90e616c317626d31f303bb3 /bin
parent60f310abd8f8363d2246ab7c9f61c2cbb84b709a (diff)
Override "IC-D" type for non-double-decker IC1 trains
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-wagenreihung-to-json11
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/db-wagenreihung-to-json b/bin/db-wagenreihung-to-json
index 28eade5..52d6663 100755
--- a/bin/db-wagenreihung-to-json
+++ b/bin/db-wagenreihung-to-json
@@ -317,6 +317,17 @@ for my $line (@lines) {
$map{$number}{short} = '3V';
}
}
+ elsif ( $number and $line =~ m{^\d*\s+[AB][pv]m} ) {
+ if ( $map{$number}{type} eq 'IC2' or $map{$number}{type} eq 'IC2 KISS' )
+ {
+ # Zugbildungsplan go home, you're drunk. Wagons of IC2 double decker
+ # trains must start with D (indicating that they double decker
+ # wagons). If an IC2 train has other wagons, it isn't really an IC2
+ # train. Observed on IC 2006 Stuttgart – Dortmund, which is planned as
+ # IC-D, but actually uses IC1 wagons.
+ $map{$number}{type} = 'IC';
+ }
+ }
if ( $state eq "route" and $line =~ m{ ^ \s{2,6} (?<route> .* ) $ }x ) {
if ( length( $map{$number}{route} ) ) {