diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-04-11 12:55:45 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-04-11 12:55:45 +0200 |
commit | b38f8f468fc0480074bb6c66de474329f2049cb7 (patch) | |
tree | f24755e4a6f23ff2ee434012ff8cd28728f6de57 /lib/Travel/Status | |
parent | 5367d716ca7726e522c7dbef0ac548413b0f5f19 (diff) |
add Result->stop_indicator and aseag-m -oi option
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r-- | lib/Travel/Status/DE/URA.pm | 36 | ||||
-rw-r--r-- | lib/Travel/Status/DE/URA/Result.pm | 8 |
2 files changed, 26 insertions, 18 deletions
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). |