diff options
author | Daniel Friesel <derf@finalrewind.org> | 2023-02-08 19:40:06 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2023-02-08 19:40:06 +0100 |
commit | c2817912d261c625d74d5142e562af67972ce078 (patch) | |
tree | e7462cebe6ce7bb00bafb432f005845177ab080f /lib/Travel | |
parent | 78e08b0475fb36f347a9ffdd645b6d0c4b16b0c5 (diff) |
Journey->route: add platform data
Diffstat (limited to 'lib/Travel')
-rw-r--r-- | lib/Travel/Status/DE/HAFAS/Journey.pm | 52 |
1 files changed, 35 insertions, 17 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm index e472c06..dbe708e 100644 --- a/lib/Travel/Status/DE/HAFAS/Journey.pm +++ b/lib/Travel/Status/DE/HAFAS/Journey.pm @@ -97,6 +97,12 @@ sub new { my $sched_dep = $stop->{dTimeS}; my $rt_dep = $stop->{dTimeR}; + # dIn. / aOut. -> may passengers enter / exit the train? + + my $sched_platform = $stop->{aPlatfS} // $stop->{dPlatfS}; + my $rt_platform = $stop->{aPlatfR} // $stop->{dPlatfR}; + my $changed_platform = $stop->{aPlatfCh} // $stop->{dPlatfCh}; + for my $timestr ( $sched_arr, $rt_arr, $sched_dep, $rt_dep ) { if ( not defined $timestr ) { next; @@ -133,23 +139,27 @@ sub new { push( @stops, { - name => $loc->{name}, - eva => $loc->{extId} + 0, - lon => $loc->{crd}{x} * 1e-6, - lat => $loc->{crd}{y} * 1e-6, - sched_arr => $sched_arr, - rt_arr => $rt_arr, - arr => $rt_arr // $sched_arr, - arr_delay => $arr_delay, - arr_cancelled => $arr_cancelled, - sched_dep => $sched_dep, - rt_dep => $rt_dep, - dep => $rt_dep // $sched_dep, - dep_delay => $dep_delay, - dep_cancelled => $dep_cancelled, - delay => $dep_delay // $arr_delay, - direction => $stop->{dDirTxt}, - load => $tco, + name => $loc->{name}, + eva => $loc->{extId} + 0, + lon => $loc->{crd}{x} * 1e-6, + lat => $loc->{crd}{y} * 1e-6, + sched_arr => $sched_arr, + rt_arr => $rt_arr, + arr => $rt_arr // $sched_arr, + arr_delay => $arr_delay, + arr_cancelled => $arr_cancelled, + sched_dep => $sched_dep, + rt_dep => $rt_dep, + dep => $rt_dep // $sched_dep, + dep_delay => $dep_delay, + dep_cancelled => $dep_cancelled, + delay => $dep_delay // $arr_delay, + direction => $stop->{dDirTxt}, + sched_platform => $sched_platform, + rt_platform => $rt_platform, + is_changed_platform => $changed_platform, + platform => $rt_platform // $sched_platform, + load => $tco, } ); $route_end = $loc->{name}; @@ -621,6 +631,14 @@ entire route. Each hash contains the following keys: =item * direction (direction signage from this stop on, undef if unchanged) +=item * rt_platform (actual platform) + +=item * sched_platform (scheduled platform) + +=item * platform (actual or scheduled platform) + +=item * is_changed_platform (true if real-time and scheduled platform disagree) + =item * load (expected utilization / passenger load from this stop on) =back |