diff options
author | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-15 18:56:13 +0200 |
---|---|---|
committer | Birte Kristina Friesel <derf@finalrewind.org> | 2025-06-15 18:56:13 +0200 |
commit | 22d7855641ece6dfda7eb5689df88802ee1ce8ff (patch) | |
tree | 668f554a8ead4d128fe83b1194ab0322d679158c /bin/efa-m | |
parent | ef9542106adb6b8ea6cc40f9a98c808b305e6a28 (diff) |
Stop: Add is_cancelled accessor
Diffstat (limited to 'bin/efa-m')
-rwxr-xr-x | bin/efa-m | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -233,7 +233,13 @@ sub format_route { if ( $stop->delay ) { $delay = sprintf( '(%+3d)', $stop->delay ); } - if ( defined $stop->arr and defined $stop->dep ) { + if ( $stop->is_cancelled ) { + $output .= sprintf( + " --:-- %s %s %35s %s\n", + $delay, $occupancy, $stop->full_name, $stop->platform // q{}, + ); + } + elsif ( defined $stop->arr and defined $stop->dep ) { if ( $stop->arr->epoch == $stop->dep->epoch ) { $output .= sprintf( " %5s %s %s %35s %s\n", @@ -355,6 +361,10 @@ sub show_stopseq { $delay_len = length( sprintf( '(%+d)', $max_delay ) ) + 1; } + if ( first { $_->is_cancelled } $trip->route and $delay_len < 3 ) { + $delay_len = 3; + } + for my $stop ( $trip->route ) { printf( "%s → %s%${delay_len}s %s (%s) %s\n", @@ -362,8 +372,12 @@ sub show_stopseq { : q{ }, $stop->dep ? $stop->dep->strftime('%H:%M') : q{ }, - $stop->delay ? sprintf( " (%+${inner_delay_len}d)", $stop->delay ) - : q{}, + $stop->is_cancelled ? 'XX' + : ( + $stop->delay + ? sprintf( " (%+${inner_delay_len}d)", $stop->delay ) + : q{} + ), $stop->full_name, $stop->niveau, $stop->platform |