From b38f8f468fc0480074bb6c66de474329f2049cb7 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 11 Apr 2016 12:55:45 +0200 Subject: add Result->stop_indicator and aseag-m -oi option --- lib/Travel/Status/DE/URA.pm | 36 +++++++++++++++++++----------------- lib/Travel/Status/DE/URA/Result.pm | 8 +++++++- 2 files changed, 26 insertions(+), 18 deletions(-) (limited to 'lib/Travel') diff --git a/lib/Travel/Status/DE/URA.pm b/lib/Travel/Status/DE/URA.pm index d6536f2..2f02b81 100644 --- a/lib/Travel/Status/DE/URA.pm +++ b/lib/Travel/Status/DE/URA.pm @@ -56,9 +56,9 @@ sub new { StopAlso => 'False', # for easier debugging ordered in the returned order - ReturnList => 'stoppointname,stopid,latitude,longitude,lineid,' - . 'linename,directionid,destinationtext,vehicleid,tripid,' - . 'estimatedtime' + ReturnList => 'stoppointname,stopid,stoppointindicator,' + . 'latitude,longitude,lineid,linename,' + . 'directionid,destinationtext,vehicleid,tripid,estimatedtime' }, }; @@ -214,9 +214,10 @@ sub results { for my $dep ( @{ $self->{raw_list} } ) { my ( - $type, $stopname, $stopid, $longitude, - $latitude, $lineid, $linename, $directionid, - $dest, $vehicleid, $tripid, $timestamp + $type, $stopname, $stopid, $stopindicator, + $longitude, $latitude, $lineid, $linename, + $directionid, $dest, $vehicleid, $tripid, + $timestamp ) = @{$dep}; my ( @route_pre, @route_post ); @@ -256,8 +257,8 @@ sub results { if ($full_routes) { my @route - = map { [ $_->[11] / 1000, $_->[1], $_->[2], $_->[3], $_->[4] ] } - grep { $_->[10] == $tripid } + = map { [ $_->[12] / 1000, $_->[1], $_->[2], $_->[4], $_->[5] ] } + grep { $_->[11] == $tripid } grep { $_->[0] == 1 } @{ $self->{raw_list} }; @route_pre = grep { $_->[0] < $ts_dep } @route; @@ -315,15 +316,16 @@ sub results { push( @results, Travel::Status::DE::URA::Result->new( - datetime => $dt_dep, - dt_now => $dt_now, - line => $linename, - line_id => $lineid, - destination => $dest, - route_pre => [@route_pre], - route_post => [@route_post], - stop => $stopname, - stop_id => $stopid, + datetime => $dt_dep, + dt_now => $dt_now, + line => $linename, + line_id => $lineid, + destination => $dest, + route_pre => [@route_pre], + route_post => [@route_post], + stop => $stopname, + stop_id => $stopid, + stop_indicator => $stopindicator, ) ); } diff --git a/lib/Travel/Status/DE/URA/Result.pm b/lib/Travel/Status/DE/URA/Result.pm index 07f07c2..7e38ed7 100644 --- a/lib/Travel/Status/DE/URA/Result.pm +++ b/lib/Travel/Status/DE/URA/Result.pm @@ -11,7 +11,7 @@ use DateTime::Format::Duration; our $VERSION = '1.01'; Travel::Status::DE::URA::Result->mk_ro_accessors( - qw(datetime destination line line_id stop stop_id)); + qw(datetime destination line line_id stop stop_id stop_indicator)); sub new { my ( $obj, %conf ) = @_; @@ -219,6 +219,12 @@ The stop (name, not object) belonging to this departure. The stop ID belonging to this departure. +=item $departure->stop_indicator + +The indicator for this departure at the corresponding stop, usually +describes a platform or sub-stop number. undef if the stop does not +have such a distinction. + =item $departure->time Departure time (HH:MM:SS). -- cgit v1.2.3