From 836cd8a39a2c6c64e3cd23239a18fe1c6ea8515c Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 2 Jan 2021 18:03:34 +0100 Subject: show exit direction in wagon order --- lib/DBInfoscreen/Controller/Wagenreihung.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'lib') diff --git a/lib/DBInfoscreen/Controller/Wagenreihung.pm b/lib/DBInfoscreen/Controller/Wagenreihung.pm index 349c4d2..219212a 100644 --- a/lib/DBInfoscreen/Controller/Wagenreihung.pm +++ b/lib/DBInfoscreen/Controller/Wagenreihung.pm @@ -182,6 +182,22 @@ sub wagenreihung { } } + my $exit_dir = 'unknown'; + if ( defined $wr->direction and $exit_side ) { + if ( $wr->direction == 0 and $exit_side eq 'l' ) { + $exit_dir = 'left'; + } + elsif ( $wr->direction == 0 and $exit_side eq 'r' ) { + $exit_dir = 'right'; + } + elsif ( $wr->direction == 100 and $exit_side eq 'l' ) { + $exit_dir = 'right'; + } + elsif ( $wr->direction == 100 and $exit_side eq 'r' ) { + $exit_dir = 'left'; + } + } + $wref = b64_encode( encode_json($wref) ); $self->render( @@ -192,6 +208,7 @@ sub wagenreihung { train_no => $train, wr => $wr, wref => $wref, + exit_dir => $exit_dir, hide_opts => 1, ); } -- cgit v1.2.3