From 596f6deb1adef4200ddb3df4f02e6e98525a33a6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 19 May 2019 11:26:22 +0200 Subject: show wagon order even if exact positions on platform are unknown --- lib/DBInfoscreen/Controller/Wagenreihung.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index 2279da3..986019b 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -16,6 +16,17 @@ sub wagenreihung { train_number => $train, ); + if ( $wr->has_bad_wagons ) { + + # create fake positions as the correct ones are not available + my $pos = 0; + for my $wagon ( $wr->wagons ) { + $wagon->{position}{start_percent} = $pos; + $wagon->{position}{end_percent} = $pos + 4; + $pos += 4; + } + } + $self->render( 'wagenreihung', wr => $wr, -- cgit v1.2.3