summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm12
-rw-r--r--lib/Travel/Status/DE/IRIS/Result.pm16
2 files changed, 22 insertions, 6 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 5a3c34e..f326195 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -254,6 +254,7 @@ sub get_realtime {
if ($e_ar) {
$result->add_ar(
arrival_ts => $e_ar->getAttribute('ct'),
+ plan_arrivaL_ts => $e_ar->getAttribute('pt'),
platform => $e_ar->getAttribute('cp'),
route_pre => $e_ar->getAttribute('cpth'),
sched_route_pre => $e_ar->getAttribute('ppth'),
@@ -262,11 +263,12 @@ sub get_realtime {
}
if ($e_dp) {
$result->add_dp(
- departure_ts => $e_dp->getAttribute('ct'),
- platform => $e_dp->getAttribute('cp'),
- route_post => $e_dp->getAttribute('cpth'),
- sched_route_post => $e_dp->getAttribute('ppth'),
- status => $e_dp->getAttribute('cs'),
+ departure_ts => $e_dp->getAttribute('ct'),
+ plan_departure_ts => $e_dp->getAttribute('pt'),
+ platform => $e_dp->getAttribute('cp'),
+ route_post => $e_dp->getAttribute('cpth'),
+ sched_route_post => $e_dp->getAttribute('ppth'),
+ status => $e_dp->getAttribute('cs'),
);
}
diff --git a/lib/Travel/Status/DE/IRIS/Result.pm b/lib/Travel/Status/DE/IRIS/Result.pm
index d4d994e..e1cb513 100644
--- a/lib/Travel/Status/DE/IRIS/Result.pm
+++ b/lib/Travel/Status/DE/IRIS/Result.pm
@@ -102,6 +102,13 @@ sub add_ar {
time_zone => 'Europe/Berlin',
);
+ # unscheduled arrivals may not appear in the plan, but we do need to
+ # know their planned arrival time
+ if ( $attrib{plan_arrival_ts} ) {
+ $self->{sched_arrival}
+ = $strp->parse_datetime( $attrib{plan_arrival_ts} );
+ }
+
if ( $attrib{arrival_ts} ) {
$self->{arrival} = $strp->parse_datetime( $attrib{arrival_ts} );
$self->{delay}
@@ -139,6 +146,13 @@ sub add_dp {
time_zone => 'Europe/Berlin',
);
+ # unscheduled arrivals may not appear in the plan, but we do need to
+ # know their planned arrival time
+ if ( $attrib{plan_departure_ts} ) {
+ $self->{sched_departure}
+ = $strp->parse_datetime( $attrib{plan_departure_ts} );
+ }
+
if ( $attrib{departure_ts} ) {
$self->{departure} = $strp->parse_datetime( $attrib{departure_ts} );
$self->{delay}
@@ -535,7 +549,7 @@ sub translate_msg {
64 => 'Weichenstörung',
55 => 'Technische Störung an einem anderen Zug', # ?
57 => 'Zusätzlicher Halt', # ?
- 58 => 'Umleitung', # ?
+ 58 => 'Umleitung', # ?
61 => 'Türstörung',
62 => 'Behobene technische Störung am Zug',
63 => 'Technische Untersuchung am Zug',