Loading bin/hafas +16 −2 Original line number Diff line number Diff line Loading @@ -254,8 +254,22 @@ for my $res ( @{ $hafas->{results} } ) { # say "# cancelled\n"; #} my $glance = join( ' - ', map { $_->name } grep { $_->type eq 'JNY' } $res->sections ); my $glance = q{}; for my $sec ( $res->sections ) { if ( $sec->type ne 'JNY' ) { next; } if ( defined $sec->transfer_duration ) { $glance .= sprintf( ' (%01d:%02d) %s', $sec->transfer_duration->in_units( 'hours', 'minutes' ), $sec->name ); } else { $glance .= $sec->name; } } printf( "# %02d:%02d %s %s\n", Loading lib/Travel/Routing/DE/HAFAS/Connection.pm +10 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,16 @@ sub new { ); } my $prev; for my $sec (@sections) { if ( $sec->type eq 'JNY' ) { if ($prev) { $sec->set_transfer_from_previous_section($prev); } $prev = $sec; } } my $tco = {}; for my $tco_id ( @{ $connection->{dTrnCmpSX}{tcocX} // [] } ) { my $tco_kv = $opt{common}{tcocL}[$tco_id]; Loading lib/Travel/Routing/DE/HAFAS/Connection/Section.pm +12 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ use Travel::Routing::DE::HAFAS::Utils; our $VERSION = '0.00'; Travel::Routing::DE::HAFAS::Connection::Section->mk_ro_accessors( qw(type schep_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime arr_delay dep_delay journey distance duration dep_loc arr_loc qw(type schep_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime arr_delay dep_delay journey distance duration transfer_duration dep_loc arr_loc operator id name category category_long class number line line_no load delay direction) ); Loading Loading @@ -132,6 +132,17 @@ sub new { # }}} # {{{ Private sub set_transfer_from_previous_section { my ( $self, $prev_sec ) = @_; my $delta = $self->dep_datetime - $prev_sec->arr_datetime; $self->{transfer_duration} = $delta; } # }}} # {{{ Accessors sub messages { Loading Loading
bin/hafas +16 −2 Original line number Diff line number Diff line Loading @@ -254,8 +254,22 @@ for my $res ( @{ $hafas->{results} } ) { # say "# cancelled\n"; #} my $glance = join( ' - ', map { $_->name } grep { $_->type eq 'JNY' } $res->sections ); my $glance = q{}; for my $sec ( $res->sections ) { if ( $sec->type ne 'JNY' ) { next; } if ( defined $sec->transfer_duration ) { $glance .= sprintf( ' (%01d:%02d) %s', $sec->transfer_duration->in_units( 'hours', 'minutes' ), $sec->name ); } else { $glance .= $sec->name; } } printf( "# %02d:%02d %s %s\n", Loading
lib/Travel/Routing/DE/HAFAS/Connection.pm +10 −0 Original line number Diff line number Diff line Loading @@ -89,6 +89,16 @@ sub new { ); } my $prev; for my $sec (@sections) { if ( $sec->type eq 'JNY' ) { if ($prev) { $sec->set_transfer_from_previous_section($prev); } $prev = $sec; } } my $tco = {}; for my $tco_id ( @{ $connection->{dTrnCmpSX}{tcocX} // [] } ) { my $tco_kv = $opt{common}{tcocL}[$tco_id]; Loading
lib/Travel/Routing/DE/HAFAS/Connection/Section.pm +12 −1 Original line number Diff line number Diff line Loading @@ -13,7 +13,7 @@ use Travel::Routing::DE::HAFAS::Utils; our $VERSION = '0.00'; Travel::Routing::DE::HAFAS::Connection::Section->mk_ro_accessors( qw(type schep_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime arr_delay dep_delay journey distance duration dep_loc arr_loc qw(type schep_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime arr_delay dep_delay journey distance duration transfer_duration dep_loc arr_loc operator id name category category_long class number line line_no load delay direction) ); Loading Loading @@ -132,6 +132,17 @@ sub new { # }}} # {{{ Private sub set_transfer_from_previous_section { my ( $self, $prev_sec ) = @_; my $delta = $self->dep_datetime - $prev_sec->arr_datetime; $self->{transfer_duration} = $delta; } # }}} # {{{ Accessors sub messages { Loading