Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
36199bec
Commit
36199bec
authored
Sep 26, 2021
by
Volker Krause
Browse files
Handle arrival times on the next day in the generic boarding pass extractor
parent
88dbffb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/extractors/genericboardingpassextractor.cpp
View file @
36199bec
...
...
@@ -205,15 +205,19 @@ ExtractorResult GenericBoardingPassExtractor::extract(const ExtractorDocumentNod
std
::
sort
(
times
.
begin
(),
times
.
end
());
times
.
erase
(
std
::
unique
(
times
.
begin
(),
times
.
end
()),
times
.
end
());
if
(
times
.
size
()
==
2
)
{
// boarding/departure only, and on the same day
if
(
isPlausibleBoardingTime
(
times
[
0
],
times
[
1
])
&&
!
isPlausibleFlightTime
(
times
[
0
],
times
[
1
],
from
,
to
))
{
applyFlightTimes
(
result
,
times
[
0
],
times
[
1
],
{});
}
}
else
if
(
times
.
size
()
==
3
)
{
// boarding/departure/arrival on the same day
if
(
isPlausibleBoardingTime
(
times
[
0
],
times
[
1
])
&&
isPlausibleFlightTime
(
times
[
1
],
times
[
2
],
from
,
to
))
{
applyFlightTimes
(
result
,
times
[
0
],
times
[
1
],
times
[
2
]);
// boarding/departure on the same day, arrival on the next day
}
else
if
(
isPlausibleBoardingTime
(
times
[
1
],
times
[
2
])
&&
isPlausibleFlightTime
(
times
[
2
],
times
[
0
].
addDays
(
1
),
from
,
to
))
{
applyFlightTimes
(
result
,
times
[
1
],
times
[
2
],
times
[
0
].
addDays
(
1
));
}
// TODO handle arrival past midnight
// TODO handle boarding before midnight
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment