summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-12-14 10:42:15 +0100
committerDaniel Friesel <derf@finalrewind.org>2019-12-14 10:42:15 +0100
commit8a8fb37507d9a1922d8412e88441baaac8f0d2e3 (patch)
treea9b8f220c35103825f5d0e571c0665cbe4072a4a /lib
parentf26ffa675facd0f47356a6637afd6e309db4c7a8 (diff)
train_subtype: distinguish between ICE 3 and ICE 3 Redesign
Diffstat (limited to 'lib')
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung.pm22
1 files changed, 15 insertions, 7 deletions
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm
index 75eaafa..8f639f9 100644
--- a/lib/Travel/Status/DE/DBWagenreihung.pm
+++ b/lib/Travel/Status/DE/DBWagenreihung.pm
@@ -272,7 +272,8 @@ sub train_subtype {
return $self->{train_subtype};
}
- my @wagons = $self->wagons;
+ my @wagons = $self->wagons;
+ my $with_restaurant = 0;
my %ml = (
'ICE 1' => 0,
@@ -289,6 +290,9 @@ sub train_subtype {
if ( not $wagon->model ) {
next;
}
+ if ( $wagon->type eq 'WRmz' ) {
+ $with_restaurant = 1;
+ }
if ( $wagon->model == 401
or ( $wagon->model >= 801 and $wagon->model <= 804 ) )
{
@@ -303,18 +307,18 @@ sub train_subtype {
$ml{'ICE 3'}++;
}
elsif ( $wagon->model == 407 ) {
- $ml{'ICE 3 V'}++;
+ $ml{'ICE 3 Velaro'}++;
}
elsif ( $wagon->model == 412 or $wagon->model == 812 ) {
$ml{'ICE 4'}++;
}
- elsif ( $wagon->model == 411 ) {
- $ml{'ICE T 411'}++;
+ elsif ( $wagon->model == 411 or $wagon->model == 415 ) {
+ $ml{'ICE T'}++;
}
- elsif ( $wagon->model == 415 ) {
- $ml{'ICE T 415'}++;
+ elsif ( $wagon->model == 475 ) {
+ $ml{'TGV'}++;
}
- elsif ( $wagon->is_dosto ) {
+ elsif ( $self->train_type eq 'IC' and $wagon->is_dosto ) {
$ml{'IC2'}++;
}
}
@@ -328,6 +332,10 @@ sub train_subtype {
}
$self->{train_subtype} = $likelihood[0];
+
+ if ( $self->{train_subtype} eq 'ICE 3' and $with_restaurant ) {
+ $self->{train_subtype} = 'ICE 3 Redesign';
+ }
return $self->{train_subtype};
}