From 79bbdc7dc1198594d06a278195bbc995ccd3da06 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 19 Dec 2020 16:55:33 +0100 Subject: Override "IC-D" type for non-double-decker IC1 trains --- bin/db-wagenreihung-to-json | 11 +++++++++++ 1 file changed, 11 insertions(+) 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} (? .* ) $ }x ) { if ( length( $map{$number}{route} ) ) { -- cgit v1.2.3