Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Travel-Routing-DE-EFA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
derf
Travel-Routing-DE-EFA
Commits
7e8258ae
Commit
7e8258ae
authored
13 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
Fix display and parsing of delay connections
parent
1d5e4aed
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/efa
+35
-23
35 additions, 23 deletions
bin/efa
lib/Travel/Routing/DE/VRR.pm
+28
-13
28 additions, 13 deletions
lib/Travel/Routing/DE/VRR.pm
lib/Travel/Routing/DE/VRR/Route/Part.pm
+9
-4
9 additions, 4 deletions
lib/Travel/Routing/DE/VRR/Route/Part.pm
with
72 additions
and
40 deletions
bin/efa
+
35
−
23
View file @
7e8258ae
...
...
@@ -105,6 +105,40 @@ sub check_for_error {
return
;
}
sub
display_connection
{
my
(
$c
)
=
@_
;
if
(
$c
->
delay
)
{
printf
(
"
# +%d, scheduled: %s -> %s
\n
",
$c
->
delay
,
$c
->
departure_stime
,
$c
->
arrival_stime
);
}
for
my
$extra
(
$c
->
extra
)
{
if
(
not
(
length
$ignore_info
and
$extra
=~
/$ignore_info/i
)
)
{
say
"
#
$extra
";
}
}
printf
(
"
%-5s ab %-30s %-20s %s
\n
",
$c
->
departure_time
,
$c
->
departure_stop_and_platform
,
$c
->
train_line
,
$c
->
train_destination
,
);
if
(
$opt
->
{'
extended-info
'}
and
$opt
->
{'
extended-info
'}
==
2
)
{
for
my
$via
(
@
{
$c
->
{
via
}
}
)
{
printf
(
"
%-5s %-22s %s
\n
",
@
{
$via
}[
1
..
3
]
);
}
}
printf
(
"
%-5s an %s
\n\n
",
$c
->
arrival_time
,
$c
->
arrival_stop_and_platform
,
);
return
;
}
#<<<
GetOptions
(
$opt
,
...
...
@@ -206,29 +240,7 @@ for my $i ( 0 .. $#routes ) {
}
for
my
$c
(
$route
->
parts
)
{
for
my
$extra
(
$c
->
extra
)
{
if
(
not
(
length
$ignore_info
and
$extra
=~
/$ignore_info/i
)
)
{
say
"
#
$extra
";
}
}
printf
(
"
%-5s ab %-30s %-20s %s
\n
",
$c
->
departure_time
,
$c
->
departure_stop_and_platform
,
$c
->
train_line
,
$c
->
train_destination
,
);
if
(
$opt
->
{'
extended-info
'}
and
$opt
->
{'
extended-info
'}
==
2
)
{
for
my
$via
(
@
{
$c
->
{
via
}
}
)
{
printf
(
"
%-5s %-22s %s
\n
",
@
{
$via
}[
1
..
3
]
);
}
}
printf
(
"
%-5s an %s
\n\n
",
$c
->
arrival_time
,
$c
->
arrival_stop_and_platform
,
);
display_connection
(
$c
);
}
if
(
$i
!=
$#routes
)
{
print
"
------
\n\n
";
...
...
This diff is collapsed.
Click to expand it.
lib/Travel/Routing/DE/VRR.pm
+
28
−
13
View file @
7e8258ae
...
...
@@ -445,9 +445,12 @@ sub parse_part {
my
$xp_time
=
XML::LibXML::
XPathExpression
->
new
('
./itdDateTime/itdTime
');
my
$xp_via
=
XML::LibXML::
XPathExpression
->
new
('
./itdStopSeq/itdPoint
');
# my $xp_tdate = XML::LibXML::XPathExpression->new('./itdDateTimeTarget/itdDate');
# my $xp_ttime = XML::LibXML::XPathExpression->new('./itdDateTimeTarget/itdTime');
my
$xp_mot
=
XML::LibXML::
XPathExpression
->
new
('
./itdMeansOfTransport
');
my
$xp_sdate
=
XML::LibXML::
XPathExpression
->
new
('
./itdDateTimeTarget/itdDate
');
my
$xp_stime
=
XML::LibXML::
XPathExpression
->
new
('
./itdDateTimeTarget/itdTime
');
my
$xp_mot
=
XML::LibXML::
XPathExpression
->
new
('
./itdMeansOfTransport
');
my
$xp_delay
=
XML::LibXML::
XPathExpression
->
new
('
./itdRBLControlled
');
my
$xp_info
=
XML::LibXML::
XPathExpression
->
new
('
./itdInfoTextList/infoTextListElem
');
...
...
@@ -472,24 +475,36 @@ sub parse_part {
for
my
$e
(
$route
->
findnodes
(
$xp_route
)
)
{
my
$e_dep
=
(
$e
->
findnodes
(
$xp_dep
)
)[
0
];
my
$e_arr
=
(
$e
->
findnodes
(
$xp_arr
)
)[
0
];
my
$e_ddate
=
(
$e_dep
->
findnodes
(
$xp_date
)
)[
0
];
my
$e_dtime
=
(
$e_dep
->
findnodes
(
$xp_time
)
)[
0
];
my
$e_adate
=
(
$e_arr
->
findnodes
(
$xp_date
)
)[
0
];
my
$e_atime
=
(
$e_arr
->
findnodes
(
$xp_time
)
)[
0
];
my
$e_mot
=
(
$e
->
findnodes
(
$xp_mot
)
)[
0
];
my
@e_info
=
$e
->
findnodes
(
$xp_info
);
my
$e_dep
=
(
$e
->
findnodes
(
$xp_dep
)
)[
0
];
my
$e_arr
=
(
$e
->
findnodes
(
$xp_arr
)
)[
0
];
my
$e_ddate
=
(
$e_dep
->
findnodes
(
$xp_date
)
)[
0
];
my
$e_dtime
=
(
$e_dep
->
findnodes
(
$xp_time
)
)[
0
];
my
$e_dsdate
=
(
$e_dep
->
findnodes
(
$xp_sdate
)
)[
0
];
my
$e_dstime
=
(
$e_dep
->
findnodes
(
$xp_stime
)
)[
0
];
my
$e_adate
=
(
$e_arr
->
findnodes
(
$xp_date
)
)[
0
];
my
$e_atime
=
(
$e_arr
->
findnodes
(
$xp_time
)
)[
0
];
my
$e_asdate
=
(
$e_arr
->
findnodes
(
$xp_sdate
)
)[
0
];
my
$e_astime
=
(
$e_arr
->
findnodes
(
$xp_stime
)
)[
0
];
my
$e_mot
=
(
$e
->
findnodes
(
$xp_mot
)
)[
0
];
my
$e_delay
=
(
$e
->
findnodes
(
$xp_delay
)
)[
0
];
my
@e_info
=
$e
->
findnodes
(
$xp_info
);
my
$delay
=
$e_delay
?
$e_delay
->
getAttribute
('
delayMinutes
')
:
0
;
my
$hash
=
{
de
parture_time
=>
$self
->
itdtime_str
(
$e_dtime
)
,
de
lay
=>
$delay
,
departure_date
=>
$self
->
itddate_str
(
$e_ddate
),
departure_time
=>
$self
->
itdtime_str
(
$e_dtime
),
departure_sdate
=>
$self
->
itddate_str
(
$e_dsdate
),
departure_stime
=>
$self
->
itdtime_str
(
$e_dstime
),
departure_stop
=>
$e_dep
->
getAttribute
('
name
'),
departure_platform
=>
$e_dep
->
getAttribute
('
platformName
'),
train_line
=>
$e_mot
->
getAttribute
('
name
'),
train_destination
=>
$e_mot
->
getAttribute
('
destination
'),
arrival_time
=>
$self
->
itdtime_str
(
$e_atime
),
arrival_date
=>
$self
->
itddate_str
(
$e_adate
),
arrival_time
=>
$self
->
itdtime_str
(
$e_atime
),
arrival_sdate
=>
$self
->
itddate_str
(
$e_asdate
),
arrival_stime
=>
$self
->
itdtime_str
(
$e_astime
),
arrival_stop
=>
$e_arr
->
getAttribute
('
name
'),
arrival_platform
=>
$e_arr
->
getAttribute
('
platformName
'),
};
...
...
This diff is collapsed.
Click to expand it.
lib/Travel/Routing/DE/VRR/Route/Part.pm
+
9
−
4
View file @
7e8258ae
...
...
@@ -9,8 +9,12 @@ use parent 'Class::Accessor';
our
$VERSION
=
'
1.06
';
Travel::Routing::DE::VRR::Route::
Part
->
mk_ro_accessors
(
qw(arrival_platform arrival_stop arrival_time departure_platform departure_stop departure_time train_line
train_destination)
qw(arrival_platform arrival_stop
arrival_date arrival_time arrival_sdate arrival_stime
delay departure_platform departure_stop
departure_date departure_time departure_sdate departure_stime
train_line train_destination
)
);
sub
new
{
...
...
@@ -24,13 +28,14 @@ sub new {
sub
arrival_stop_and_platform
{
my
(
$self
)
=
@_
;
return
sprintf
('
%s: %s
',
$self
->
get
(
qw(arrival_stop arrival_platform)
));
return
sprintf
(
'
%s: %s
',
$self
->
get
(
qw(arrival_stop arrival_platform)
)
);
}
sub
departure_stop_and_platform
{
my
(
$self
)
=
@_
;
return
sprintf
('
%s: %s
',
$self
->
get
(
qw(departure_stop departure_platform)
));
return
sprintf
(
'
%s: %s
',
$self
->
get
(
qw(departure_stop departure_platform)
)
);
}
sub
extra
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment