summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller/Wagenreihung.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-02 18:03:34 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-02 18:03:34 +0100
commit836cd8a39a2c6c64e3cd23239a18fe1c6ea8515c (patch)
tree32bd695624cdb2e7c987548fb72e47190c1a063c /lib/DBInfoscreen/Controller/Wagenreihung.pm
parent9958706954315a7db9a69662cd0c1b093f940385 (diff)
show exit direction in wagon order3.9.3
Diffstat (limited to 'lib/DBInfoscreen/Controller/Wagenreihung.pm')
-rw-r--r--lib/DBInfoscreen/Controller/Wagenreihung.pm17
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,
);
}