summaryrefslogtreecommitdiff
path: root/lib/DBInfoscreen/Controller
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-07-08 20:47:54 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-07-08 20:47:54 +0200
commit17563a9284665f5f9852ce9da25b94c8bb9389c2 (patch)
tree37dc8c2960b251164d00d746b901fdc0d963e4db /lib/DBInfoscreen/Controller
parente04f4cde71003079789236b9b4ccb6b90b2806cb (diff)
distinguish between 'on time' and 'no realtime data available' in rt=1
Diffstat (limited to 'lib/DBInfoscreen/Controller')
-rw-r--r--lib/DBInfoscreen/Controller/Stationboard.pm20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/DBInfoscreen/Controller/Stationboard.pm b/lib/DBInfoscreen/Controller/Stationboard.pm
index 8e1e7df..f81074b 100644
--- a/lib/DBInfoscreen/Controller/Stationboard.pm
+++ b/lib/DBInfoscreen/Controller/Stationboard.pm
@@ -1875,11 +1875,15 @@ sub handle_result {
} $result->qos_messages
],
},
- station => $result->station,
- moreinfo => $moreinfo,
- delay => $delay,
+ station => $result->station,
+ moreinfo => $moreinfo,
+ delay => $delay,
+ is_bit_delayed =>
+ ( $delay and $delay > 0 and $delay < 5 ? 1 : 0 ),
+ is_delayed => ( $delay and $delay >= 5 ? 1 : 0 ),
arrival_delay => $result->arrival_delay,
departure_delay => $result->departure_delay,
+ has_realtime => $result->has_realtime,
missing_realtime => (
not $result->has_realtime
and $result->start < $now ? 1 : 0
@@ -1939,9 +1943,13 @@ sub handle_result {
station => $result->station,
moreinfo => $moreinfo,
delay => $delay,
- replaced_by => [],
- replacement_for => [],
- route_pre => $admode eq 'arr'
+ is_bit_delayed =>
+ ( $delay and $delay > 0 and $delay < 5 ? 1 : 0 ),
+ is_delayed => ( $delay and $delay >= 5 ? 1 : 0 ),
+ has_realtime => defined $delay ? 1 : 0,
+ replaced_by => [],
+ replacement_for => [],
+ route_pre => $admode eq 'arr'
? [ map { $_->loc->name } $result->route ]
: [],
route_post => $admode eq 'arr' ? []