summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-28 11:20:05 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-28 11:20:05 +0200
commit4eb7d9c51742c40d12168abda7cd170934c53420 (patch)
treed1fc4fa4e20dbd779835ae1c5a93e1bae9c12972 /bin
parenta0c313fcce393792c6552a1f0d5f00b034466c13 (diff)
store description and sections in wagon group
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-wagenreihung32
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__