summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/db-wagenreihung2
-rw-r--r--lib/Travel/Status/DE/DBWagenreihung.pm36
2 files changed, 38 insertions, 0 deletions
diff --git a/bin/db-wagenreihung b/bin/db-wagenreihung
index 2594478..7a17c27 100755
--- a/bin/db-wagenreihung
+++ b/bin/db-wagenreihung
@@ -70,6 +70,8 @@ my $wr = Travel::Status::DE::DBWagenreihung->new(
train_number => $train_number,
);
+printf("%s %s in %s Gleis %s\n", $wr->train_type, $wr->train_no, $wr->station_name, $wr->platform);
+
for my $section ( $wr->sections ) {
my $section_length = $section->length_percent;
my $spacing_left = int( ( $section_length - 2 ) / 2 ) - 1;
diff --git a/lib/Travel/Status/DE/DBWagenreihung.pm b/lib/Travel/Status/DE/DBWagenreihung.pm
index 6d4f551..7f5d486 100644
--- a/lib/Travel/Status/DE/DBWagenreihung.pm
+++ b/lib/Travel/Status/DE/DBWagenreihung.pm
@@ -92,6 +92,12 @@ sub direction {
return $self->{direction};
}
+sub platform {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{halt}{gleisbezeichnung};
+}
+
sub sections {
my ($self) = @_;
@@ -119,6 +125,36 @@ sub sections {
return @{ $self->{sections} // [] };
}
+sub station_ds100 {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{halt}{rl100};
+}
+
+sub station_name {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{halt}{bahnhofsname};
+}
+
+sub station_uic {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{halt}{evanummer};
+}
+
+sub train_type {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{zuggattung};
+}
+
+sub train_no {
+ my ($self) = @_;
+
+ return $self->{data}{istformation}{zugnummer};
+}
+
sub wagons {
my ($self) = @_;