summaryrefslogtreecommitdiff
path: root/bin/db-iris
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-04-27 18:14:57 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-04-27 18:14:57 +0200
commit6d8a390dcff71ef1c4b7755dac97c0e1111e5230 (patch)
tree420fd3a425d1e2f4b130cf0b01dfe41a12bfda63 /bin/db-iris
parenta99025f2d9ba31399e38d34ba95427f56866308d (diff)
parse <ref> in fchg, add replacement support to backend and frontend
Diffstat (limited to 'bin/db-iris')
-rwxr-xr-xbin/db-iris52
1 files changed, 39 insertions, 13 deletions
diff --git a/bin/db-iris b/bin/db-iris
index f2b65b0..91a1d88 100755
--- a/bin/db-iris
+++ b/bin/db-iris
@@ -85,17 +85,18 @@ if ($time) {
for my $efield (@edata_pre) {
given ($efield) {
- when ('a') { $edata{additional} = 1 }
- when ('c') { $edata{canceled} = 1 }
- when ('d') { $edata{delay} = 1 }
- when ('D') { $edata{delays} = 1 }
- when ('f') { $edata{fullroute} = 1 }
- when ('m') { $edata{messages} = 1 }
- when ('q') { $edata{qos} = 1 }
- when ('r') { $edata{route} = 1 }
- when ('t') { $edata{times} = 1 }
- when ('!') { $edata{debug} = 1 }
- default { $edata{$efield} = 1 }
+ when ('a') { $edata{additional} = 1 }
+ when ('c') { $edata{canceled} = 1 }
+ when ('d') { $edata{delay} = 1 }
+ when ('D') { $edata{delays} = 1 }
+ when ('f') { $edata{fullroute} = 1 }
+ when ('m') { $edata{messages} = 1 }
+ when ('q') { $edata{qos} = 1 }
+ when ('r') { $edata{route} = 1 }
+ when ('R') { $edata{replacements} = 1 }
+ when ('t') { $edata{times} = 1 }
+ when ('!') { $edata{debug} = 1 }
+ default { $edata{$efield} = 1 }
}
}
@@ -263,6 +264,23 @@ sub display_result {
print "\n";
}
+ if ( $edata{replacements} ) {
+ for my $e ( $d->replaced_by ) {
+ printf(
+ "Ersatzzug: %s%s %s\n",
+ $e->type, $e->line_no // q{},
+ $e->train_no
+ );
+ }
+ for my $e ( $d->replacement_for ) {
+ printf(
+ "Ersatzzug für: %s%s %s\n",
+ $e->type, $e->line_no // q{},
+ $e->train_no
+ );
+ }
+ }
+
if ( $edata{additional} and $d->additional_stops ) {
printf( "Zusätzlicher Halt in: %s\n",
join( q{, }, $d->additional_stops ) );
@@ -368,9 +386,12 @@ for my $d ( $status->results() ) {
push(
@output,
[
- $timestr, $d->train . ($d->is_unscheduled ? ' !' : q{}),
+ $timestr,
+ $d->train . ( $d->is_unscheduled ? ' !' : q{} ),
$edata{route} ? join( q{ }, $d->route_interesting ) : q{},
- $d->route_end, $platformstr // q{}, $d
+ $d->route_end,
+ $platformstr // q{},
+ $d
]
);
@@ -507,6 +528,11 @@ omitted, use the m / messages type to see those as well.
Show up to three stops between I<station> and the train's destination.
+=item R / replacements
+
+For cancelled trains: Print their replacement train(s), if present.
+For unplanned trains: Print the train(s) they replace, if present.
+
=item t / times
Show both scheduled and expected arrival and departure times.