summaryrefslogtreecommitdiff
path: root/bin/efa
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-06-16 22:28:53 +0200
committerDaniel Friesel <derf@finalrewind.org>2015-06-16 22:28:53 +0200
commitffbf7ca613885ce8093cc4325d04cd14e147ab80 (patch)
tree8f712aaa60ae9d695b9b660bb07e8970c842e282 /bin/efa
parent7e3cd10ffba1b29cea5fc48e518884cb0aa67cd2 (diff)
parse footpaths, print them when efa -E is used
Diffstat (limited to 'bin/efa')
-rwxr-xr-xbin/efa31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/efa b/bin/efa
index 6c1649f..3cbd03c 100755
--- a/bin/efa
+++ b/bin/efa
@@ -114,6 +114,29 @@ sub check_for_error {
return;
}
+sub format_footpath {
+ my @parts = @_;
+ my $str = q{};
+
+ for my $path_elem (@parts) {
+ my ( $type, $level ) = @{$path_elem};
+ if ( $level eq 'UP' ) {
+ $str .= ' ↗';
+ }
+ elsif ( $level eq 'DOWN' ) {
+ $str .= ' ↘';
+ }
+ elsif ( $level eq 'LEVEL' ) {
+ $str .= ' →';
+ }
+ else {
+ $str .= " [unhandled level, please report a bug : $level]";
+ }
+ }
+
+ return $str;
+}
+
sub display_connection {
my ($c) = @_;
@@ -153,6 +176,14 @@ sub display_connection {
printf( "%-5s an %s\n", $c->arrival_time, $c->arrival_stop_and_platform, );
print "\n";
+ if ( $opt->{'extended-info'}
+ and $c->footpath_duration
+ and $c->footpath_type ne 'IDEST' )
+ {
+ printf( "%5d min Umsteigedauer: %s\n\n",
+ $c->footpath_duration, format_footpath( $c->footpath_parts ) );
+ }
+
return;
}