summaryrefslogtreecommitdiff
path: root/lib/Travel/Status
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2022-10-28 08:24:27 +0200
committerDaniel Friesel <derf@finalrewind.org>2022-10-28 08:24:27 +0200
commita9d5268457783df67c77b3bce67d9f750ba14df1 (patch)
tree59026175d891658e53ed0be332349da60ba3b401 /lib/Travel/Status
parent9317d6e3bef2d3e018ad4c9ee5f32f40c0c2df09 (diff)
station board: parse load (tcocX) as well
Diffstat (limited to 'lib/Travel/Status')
-rw-r--r--lib/Travel/Status/DE/HAFAS/Journey.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Travel/Status/DE/HAFAS/Journey.pm b/lib/Travel/Status/DE/HAFAS/Journey.pm
index 750d1e8..5f1290b 100644
--- a/lib/Travel/Status/DE/HAFAS/Journey.pm
+++ b/lib/Travel/Status/DE/HAFAS/Journey.pm
@@ -15,7 +15,7 @@ our $VERSION = '3.01';
Travel::Status::DE::HAFAS::Journey->mk_ro_accessors(
qw(datetime sched_datetime rt_datetime is_cancelled operator delay
platform sched_platform rt_platform
- id name type type_long number line
+ id name type type_long number line load
route_end route_start origin destination direction)
);
@@ -216,6 +216,15 @@ sub new {
else {
$ref->{datetime} = $ref->{sched_datetime};
}
+
+ my %tco;
+ for my $tco_id ( @{ $journey->{stbStop}{dTrnCmpSX}{tcocX} // [] } ) {
+ my $tco_kv = $tcocL[$tco_id];
+ $tco{ $tco_kv->{c} } = $tco_kv->{r};
+ }
+ if (%tco) {
+ $ref->{load} = \%tco;
+ }
}
if ( $opt{polyline} ) {
$ref->{polyline} = $opt{polyline};