Loading bin/efa-m +7 −6 Original line number Diff line number Diff line Loading @@ -266,14 +266,15 @@ sub show_stopseq { $trip->dest_name ); for my $stop ( $trip->route ) { printf( "%s → %s %s\n", $stop->{sched_arr} ? ( $stop->{rt_arr} // $stop->{sched_arr} )->strftime('%H:%M') printf( "%s → %s %s (%s) %s\n", $stop->arr ? $stop->arr->strftime('%H:%M') : q{ }, $stop->{sched_dep} ? ( $stop->{rt_dep} // $stop->{sched_dep} )->strftime('%H:%M') $stop->dep ? $stop->dep->strftime('%H:%M') : q{ }, $stop->{name_full}, $stop->full_name, $stop->niveau, $stop->platform ); } } Loading lib/Travel/Status/DE/EFA/Stop.pm +8 −1 Original line number Diff line number Diff line Loading @@ -9,13 +9,20 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Stop->mk_ro_accessors( qw(arr dep place name full_name id platform)); qw(sched_arr rt_arr arr sched_dep rt_dep dep place name full_name id latlon platform niveau) ); sub new { my ( $obj, %conf ) = @_; my $ref = \%conf; $ref->{arr} //= $ref->{rt_arr} // $ref->{sched_arr}; $ref->{dep} //= $ref->{rt_dep} // $ref->{sched_dep}; return bless( $ref, $obj ); } Loading lib/Travel/Status/DE/EFA/Trip.pm +23 −5 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use warnings; use 5.010; use DateTime::Format::Strptime; use Travel::Status::DE::EFA::Stop; use parent 'Class::Accessor'; Loading Loading @@ -63,20 +64,37 @@ sub route { } for my $stop ( @{ $self->{route_raw} // [] } ) { my $chain = $stop; my ( $platform, $place, $name, $name_full ); while ( $chain->{type} ) { if ( $chain->{type} eq 'platform' ) { $platform = $chain->{properties}{platformName} // $chain->{properties}{platform}; } elsif ( $chain->{type} eq 'stop' ) { $name = $chain->{disassembledName}; $name_full = $chain->{name}; } elsif ( $chain->{type} eq 'locality' ) { $place = $chain->{name}; } $chain = $chain->{parent}; } push( @{ $self->{route} }, { Travel::Status::DE::EFA::Stop->new( sched_arr => $self->parse_dt( $stop->{arrivalTimePlanned} ), sched_dep => $self->parse_dt( $stop->{departureTimePlanned} ), rt_arr => $self->parse_dt( $stop->{arrivalTimeEstimated} ), rt_dep => $self->parse_dt( $stop->{departureTimeEstimated} ), latlon => $stop->{coord}, name_full => $stop->{name}, name => $stop->{parent}{disassembledName}, place => $stop->{parent}{parent}{name}, full_name => $name_full, name => $name, place => $place, niveau => $stop->{niveau}, platform => $platform, id => $stop->{id}, } ) ); } Loading Loading
bin/efa-m +7 −6 Original line number Diff line number Diff line Loading @@ -266,14 +266,15 @@ sub show_stopseq { $trip->dest_name ); for my $stop ( $trip->route ) { printf( "%s → %s %s\n", $stop->{sched_arr} ? ( $stop->{rt_arr} // $stop->{sched_arr} )->strftime('%H:%M') printf( "%s → %s %s (%s) %s\n", $stop->arr ? $stop->arr->strftime('%H:%M') : q{ }, $stop->{sched_dep} ? ( $stop->{rt_dep} // $stop->{sched_dep} )->strftime('%H:%M') $stop->dep ? $stop->dep->strftime('%H:%M') : q{ }, $stop->{name_full}, $stop->full_name, $stop->niveau, $stop->platform ); } } Loading
lib/Travel/Status/DE/EFA/Stop.pm +8 −1 Original line number Diff line number Diff line Loading @@ -9,13 +9,20 @@ use parent 'Class::Accessor'; our $VERSION = '2.02'; Travel::Status::DE::EFA::Stop->mk_ro_accessors( qw(arr dep place name full_name id platform)); qw(sched_arr rt_arr arr sched_dep rt_dep dep place name full_name id latlon platform niveau) ); sub new { my ( $obj, %conf ) = @_; my $ref = \%conf; $ref->{arr} //= $ref->{rt_arr} // $ref->{sched_arr}; $ref->{dep} //= $ref->{rt_dep} // $ref->{sched_dep}; return bless( $ref, $obj ); } Loading
lib/Travel/Status/DE/EFA/Trip.pm +23 −5 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use warnings; use 5.010; use DateTime::Format::Strptime; use Travel::Status::DE::EFA::Stop; use parent 'Class::Accessor'; Loading Loading @@ -63,20 +64,37 @@ sub route { } for my $stop ( @{ $self->{route_raw} // [] } ) { my $chain = $stop; my ( $platform, $place, $name, $name_full ); while ( $chain->{type} ) { if ( $chain->{type} eq 'platform' ) { $platform = $chain->{properties}{platformName} // $chain->{properties}{platform}; } elsif ( $chain->{type} eq 'stop' ) { $name = $chain->{disassembledName}; $name_full = $chain->{name}; } elsif ( $chain->{type} eq 'locality' ) { $place = $chain->{name}; } $chain = $chain->{parent}; } push( @{ $self->{route} }, { Travel::Status::DE::EFA::Stop->new( sched_arr => $self->parse_dt( $stop->{arrivalTimePlanned} ), sched_dep => $self->parse_dt( $stop->{departureTimePlanned} ), rt_arr => $self->parse_dt( $stop->{arrivalTimeEstimated} ), rt_dep => $self->parse_dt( $stop->{departureTimeEstimated} ), latlon => $stop->{coord}, name_full => $stop->{name}, name => $stop->{parent}{disassembledName}, place => $stop->{parent}{parent}{name}, full_name => $name_full, name => $name, place => $place, niveau => $stop->{niveau}, platform => $platform, id => $stop->{id}, } ) ); } Loading