summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2023-11-09 21:05:40 +0100
committerBirte Kristina Friesel <derf@finalrewind.org>2023-11-09 21:05:40 +0100
commit5582b16066642f60b8fdb884aee415d007477142 (patch)
tree2fd9e6e264e9e8a39d47f393d5dc8d7b6d10bede
parentdd6403668f6417f90b0c3382f3dd4a8f98bf4cd2 (diff)
Connection: pars arr/dep cancellations
-rw-r--r--lib/Travel/Routing/DE/HAFAS/Connection.pm27
1 files changed, 17 insertions, 10 deletions
diff --git a/lib/Travel/Routing/DE/HAFAS/Connection.pm b/lib/Travel/Routing/DE/HAFAS/Connection.pm
index 51e6f3e..1eee1bd 100644
--- a/lib/Travel/Routing/DE/HAFAS/Connection.pm
+++ b/lib/Travel/Routing/DE/HAFAS/Connection.pm
@@ -14,7 +14,7 @@ use Travel::Routing::DE::HAFAS::Connection::Section;
our $VERSION = '0.00';
Travel::Routing::DE::HAFAS::Connection->mk_ro_accessors(
- qw(changes duration sched_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime dep_platform arr_platform dep_loc arr_loc load)
+ qw(changes duration sched_dep rt_dep sched_arr rt_arr dep_datetime arr_datetime dep_platform arr_platform dep_loc arr_loc dep_cancelled arr_cancelled is_cancelled load)
);
# {{{ Constructor
@@ -95,16 +95,23 @@ sub new {
$tco->{ $tco_kv->{c} } = $tco_kv->{r};
}
+ my $dep_cancelled = $connection->{dep}{dCncl} ? 1 : 0;
+ my $arr_cancelled = $connection->{arr}{aCncl} ? 1 : 0;
+ my $is_cancelled = $dep_cancelled || $arr_cancelled;
+
my $ref = {
- duration => $duration,
- changes => $connection->{chg},
- sched_dep => $sched_dep,
- rt_dep => $rt_dep,
- sched_arr => $sched_arr,
- rt_arr => $rt_arr,
- dep_datetime => $rt_dep // $sched_dep,
- arr_datetime => $rt_arr // $sched_arr,
- dep_platform => $connection->{dep}{dPlatfR}
+ duration => $duration,
+ changes => $connection->{chg},
+ sched_dep => $sched_dep,
+ rt_dep => $rt_dep,
+ sched_arr => $sched_arr,
+ rt_arr => $rt_arr,
+ dep_cancelled => $dep_cancelled,
+ arr_cancelled => $arr_cancelled,
+ is_cancelled => $is_cancelled,
+ dep_datetime => $rt_dep // $sched_dep,
+ arr_datetime => $rt_arr // $sched_arr,
+ dep_platform => $connection->{dep}{dPlatfR}
// $connection->{dep}{dPlatfS},
arr_platform => $connection->{arr}{aPlatfR}
// $connection->{arr}{aPlatfS},