summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-01-10 12:19:33 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-01-10 12:19:33 +0100
commitc1f88f417a7eb91683aca7868f471ed84b06d2ec (patch)
treee36eb8f6e268d5c5121ab61bc6358cfaf11b3f10 /bin
parent4806dd51e536c9b90f2643965c0a862a3baa0ea5 (diff)
add train_descriptions accessor
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-wagenreihung16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung
index e0dd4c9..756785c 100755
--- a/bin/db-wagenreihung
+++ b/bin/db-wagenreihung
@@ -71,7 +71,7 @@ my $wr = Travel::Status::DE::DBWagenreihung->new(
);
printf(
- "%s: %s → %s (%s)\n%s Gleis %s\n\n",
+ "%s: %s → %s\n",
join( ' / ', map { $wr->train_type . ' ' . $_ } $wr->train_numbers ),
join( ' / ', $wr->origins ),
join(
@@ -80,11 +80,10 @@ printf(
sprintf( '%s (%s)', $_->{name}, join( q{}, @{ $_->{sections} } ) )
} $wr->destinations
),
- $wr->train_desc,
- $wr->station_name,
- $wr->platform
);
+printf( "%s Gleis %s\n\n", $wr->station_name, $wr->platform );
+
for my $section ( $wr->sections ) {
my $section_length = $section->length_percent;
my $spacing_left = int( ( $section_length - 2 ) / 2 ) - 1;
@@ -139,6 +138,15 @@ for my $wagon ( $wr->wagons ) {
print $wr->direction == 100 ? '>' : '<';
print "\n\n";
+for my $desc ( $wr->train_descriptions ) {
+ if ( $desc->{text} ) {
+ printf( "%s (%s)\n",
+ $desc->{text}, join( q{}, @{ $desc->{sections} } ) );
+ }
+}
+
+say "";
+
for my $wagon ( $wr->wagons ) {
printf(
"%3s: %3s %10s %s\n",