From b52cc3290bdc317624d74dcb7d3d83f493a4a316 Mon Sep 17 00:00:00 2001 From: Birte Kristina Friesel Date: Thu, 3 Oct 2024 19:57:20 +0200 Subject: EFA departure board: add (bit_)delayed annotations --- lib/DBInfoscreen/Controller/Stationboard.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib/DBInfoscreen/Controller/Stationboard.pm') 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 ], -- cgit v1.2.3