summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2015-01-02 23:32:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2015-01-02 23:32:53 +0100
commitd13e9426c6733206bd92d813c8ff2cd2a5d7c734 (patch)
tree92381a49e365cb38e098094801e423d96c29d302
parent380e2f0e744c994db851b51a65c1a0f476ec4c70 (diff)
add debug foo for ar / dp hi flag
-rwxr-xr-xbin/db-iris10
-rw-r--r--lib/Travel/Status/DE/IRIS.pm4
2 files changed, 13 insertions, 1 deletions
diff --git a/bin/db-iris b/bin/db-iris
index e30dc9b..3920f53 100755
--- a/bin/db-iris
+++ b/bin/db-iris
@@ -92,6 +92,7 @@ for my $efield (@edata_pre) {
when ('q') { $edata{qos} = 1 }
when ('r') { $edata{route} = 1 }
when ('t') { $edata{times} = 1 }
+ when ('!') { $edata{debug} = 1 }
default { $edata{$efield} = 1 }
}
}
@@ -239,6 +240,15 @@ sub display_result {
}
+ if ( $edata{debug} ) {
+ if ( $d->{unk_ar_hi} ) {
+ say "[DEBUG] arr:hi = $d->{unk_ar_hi}";
+ }
+ if ( $d->{unk_dp_hi} ) {
+ say "[DEBUG] dep:hi = $d->{unk_dp_hi}";
+ }
+ }
+
if ( $edata{messages} ) {
for my $message ( $d->messages ) {
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 520932a..a93a42d 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -129,6 +129,7 @@ sub add_result {
$data{route_start} = $e_ar->getAttribute('pde');
$data{transfer} = $e_ar->getAttribute('tra');
$data{arrival_wings} = $e_ar->getAttribute('wings');
+ $data{unk_ar_hi} = $e_ar->getAttribute('hi');
}
if ($e_dp) {
@@ -138,6 +139,7 @@ sub add_result {
$data{route_end} = $e_dp->getAttribute('pde');
$data{transfer} = $e_dp->getAttribute('tra');
$data{departure_wings} = $e_dp->getAttribute('wings');
+ $data{unk_dp_hi} = $e_dp->getAttribute('hi');
}
my $result = Travel::Status::DE::IRIS::Result->new(%data);
@@ -226,7 +228,7 @@ sub get_realtime {
# 0 and 1 (with key "f") are related to canceled trains and
# do not appear to hold information
- if (defined $value and $value > 1) {
+ if ( defined $value and $value > 1 ) {
$messages{$msgid} = [ $ts, $type, $value ];
}
}