diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/db-wagenreihung | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung index c1daac1..0f13c54 100755 --- a/bin/db-wagenreihung +++ b/bin/db-wagenreihung @@ -149,22 +149,30 @@ for my $wagon ( $wr->wagons ) { print $wr->direction == 100 ? '>' : '<'; print "\n\n"; -for my $desc ( $wr->train_descriptions ) { - if ( $desc->{text} ) { +for my $group ( $wr->groups ) { + if ( $group->has_sections ) { printf( "%s (%s)\n", - $desc->{text}, join( q{}, @{ $desc->{sections} } ) ); + $group->description || 'Zug', + join( q{}, $group->sections ) ); + } + else { + say $group->description || 'Zug'; } -} - -say ""; - -for my $wagon ( $wr->wagons ) { printf( - "%3s: %3s %10s %s\n", - $wagon->is_closed ? 'X' : ( $wagon->number || '?' ), - $wagon->model || '???', - $wagon->type, join( q{ }, $wagon->attributes ) + "%s %s %s → %s\n\n", + $wr->train_type, $group->train_no, + $group->origin, $group->destination ); + + for my $wagon ( $group->wagons ) { + printf( + "%3s: %3s %10s %s\n", + $wagon->is_closed ? 'X' : ( $wagon->number || '?' ), + $wagon->model || '???', + $wagon->type, join( q{ }, $wagon->attributes ) + ); + } + say ""; } __END__ |