summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller/Stationboard.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-10-03 19:57:20 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-10-03 19:57:20 +0200
commitb52cc3290bdc317624d74dcb7d3d83f493a4a316 (patch)
tree52f90f15570215cdf2cff77b70b3366f2cfd154d /lib/DBInfoscreen/Controller/Stationboard.pm
parent655addf1dcdfaecb6dc420c99a4857a4f6bd4571 (diff)
EFA departure board: add (bit_)delayed annotations
Diffstat (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 14ac3be..417fa0c 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1524,6 +1524,9 @@ sub handle_efa {
elsif ( $linetype eq 'sonstige' ) {
$linetype = 'ext';
}
+
+ my $delay = $result->delay;
+
push(
@departures,
{
@@ -1548,9 +1551,12 @@ sub handle_efa {
platform => $result->platform,
is_cancelled => $result->is_cancelled,
linetype => $linetype,
- delay => $result->delay,
- occupancy => $result->occupancy,
- replaced_by => [],
+ delay => $delay,
+ is_bit_delayed =>
+ ( $delay and $delay > 0 and $delay < 5 ? 1 : 0 ),
+ is_delayed => ( $delay and $delay >= 5 ? 1 : 0 ),
+ occupancy => $result->occupancy,
+ replaced_by => [],
replacement_for => [],
route_pre => [ map { $_->full_name } $result->route_pre ],
route_post => [ map { $_->full_name } $result->route_post ],