summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-03-13 12:00:31 +0100
committerDaniel Friesel <derf@finalrewind.org>2021-03-13 12:00:31 +0100
commit2ccac68c6be4c2003168c6e552c6f2bd402626d1 (patch)
tree05fe94a58efdf2f3b5c651a89ce40e7c7c6534e0
parentba3d72eb472fa92ee8382b7c07adb3ffc1c0fcc4 (diff)
show occupancy data if available
-rwxr-xr-xbin/efa-m14
-rw-r--r--lib/Travel/Status/DE/EFA.pm4
-rw-r--r--lib/Travel/Status/DE/EFA/Result.pm2
3 files changed, 18 insertions, 2 deletions
diff --git a/bin/efa-m b/bin/efa-m
index 326d2cb..e30a6fb 100755
--- a/bin/efa-m
+++ b/bin/efa-m
@@ -296,6 +296,20 @@ sub show_results {
$output_line[3]
= join( q{ }, map { $_->name_suf } $d->route_interesting );
}
+ elsif ( $d->occupancy ) {
+ if ( $d->occupancy eq 'MANY_SEATS' ) {
+ $output_line[3] = '_';
+ }
+ elsif ( $d->occupancy eq 'FEW_SEATS' ) {
+ $output_line[3] = '*';
+ }
+ elsif ( $d->occupancy eq 'STANDING_ONLY' ) {
+ $output_line[3] = '!';
+ }
+ else {
+ $output_line[3] = '?';
+ }
+ }
if ( $edata{fullroute} ) {
$output_line[6]
diff --git a/lib/Travel/Status/DE/EFA.pm b/lib/Travel/Status/DE/EFA.pm
index d79f3d1..ca18273 100644
--- a/lib/Travel/Status/DE/EFA.pm
+++ b/lib/Travel/Status/DE/EFA.pm
@@ -437,11 +437,12 @@ sub results {
my $platform = $e->getAttribute('platform');
my $platform_name = $e->getAttribute('platformName');
+ my $countdown = $e->getAttribute('countdown');
+ my $occupancy = $e->getAttribute('occupancy');
my $line = $e_line->getAttribute('number');
my $dest = $e_line->getAttribute('direction');
my $info = $e_info->textContent;
my $key = $e_line->getAttribute('key');
- my $countdown = $e->getAttribute('countdown');
my $delay = $e_info->getAttribute('delay');
my $type = $e_info->getAttribute('name');
my $mot = $e_line->getAttribute('motType');
@@ -498,6 +499,7 @@ sub results {
lineref => $line_obj[0] // undef,
line => $line,
destination => $dest,
+ occupancy => $occupancy,
countdown => $countdown,
info => $info,
delay => $delay,
diff --git a/lib/Travel/Status/DE/EFA/Result.pm b/lib/Travel/Status/DE/EFA/Result.pm
index b8553d7..20241f7 100644
--- a/lib/Travel/Status/DE/EFA/Result.pm
+++ b/lib/Travel/Status/DE/EFA/Result.pm
@@ -12,7 +12,7 @@ our $VERSION = '1.17';
Travel::Status::DE::EFA::Result->mk_ro_accessors(
qw(countdown date delay destination is_cancelled info key line lineref
- mot platform platform_db platform_name sched_date sched_time time type)
+ mot occupancy operator platform platform_db platform_name sched_date sched_time time type)
);
my @mot_mapping = qw{