diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-01-02 18:03:34 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-01-02 18:03:34 +0100 |
commit | 836cd8a39a2c6c64e3cd23239a18fe1c6ea8515c (patch) | |
tree | 32bd695624cdb2e7c987548fb72e47190c1a063c /lib/DBInfoscreen/Controller | |
parent | 9958706954315a7db9a69662cd0c1b093f940385 (diff) |
show exit direction in wagon order3.9.3
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r-- | lib/DBInfoscreen/Controller/Wagenreihung.pm | 17 |
1 files changed, 17 insertions, 0 deletions
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, ); } |