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
Libraries
KPublicTransport
Commits
5efc8d6e
Commit
5efc8d6e
authored
Jun 16, 2021
by
Volker Krause
Browse files
Parse alternate EFA journey section note format used by VRT
parent
65484fcc
Changes
4
Hide whitespace changes
Inline
Side-by-side
autotests/data/efa/trip-response-full-vrt.json
0 → 100644
View file @
5efc8d6e
[
{
"sections"
:
[
{
"disruptionEffect"
:
"NormalService"
,
"distance"
:
31678
,
"expectedArrivalPlatform"
:
"3"
,
"expectedArrivalTime"
:
"2021-06-16T21:58:00"
,
"expectedDeparturePlatform"
:
"13 Nord"
,
"expectedDepartureTime"
:
"2021-06-16T21:33:00"
,
"from"
:
{
"identifier"
:
{
"ifopt"
:
"de:07211:1318:10:13N"
,
"testid"
:
"17001318"
},
"latitude"
:
49.75804138183594
,
"locality"
:
"Trier"
,
"longitude"
:
6.653649806976318
,
"name"
:
"Trier, Hauptbahnhof"
,
"type"
:
"Stop"
},
"mode"
:
"PublicTransport"
,
"notes"
:
[
"Linie RE1: Maskenpflicht nach gesetzl. Regelung; denken Sie an eine FFP2-Maske"
,
"Linie RE1: Fahrradmitnahme begrenzt möglich"
,
"Linie RE1: Reservierung an DB-Automaten/Reisezentren/vielen DB-Agenturen möglich"
,
"Linie RE1: Rollstuhlstellplatz"
,
"Linie RE1: Fahrzeuggebundene Einstiegshilfe vorhanden"
,
"Linie RE1: Laptop-Steckdosen"
,
"Linie RE1: Klimaanlage"
],
"route"
:
{
"direction"
:
"Koblenz Hauptbahnhof"
,
"line"
:
{
"mode"
:
"Train"
,
"modeString"
:
"R-Bahn"
,
"name"
:
"RE1"
}
},
"scheduledArrivalPlatform"
:
"3"
,
"scheduledArrivalTime"
:
"2021-06-16T21:56:00"
,
"scheduledDeparturePlatform"
:
"13 Nord"
,
"scheduledDepartureTime"
:
"2021-06-16T21:31:00"
,
"to"
:
{
"identifier"
:
{
"ifopt"
:
"de:07231:40916:1:3"
,
"testid"
:
"17040916"
},
"latitude"
:
49.97304153442383
,
"locality"
:
"Wittlich"
,
"longitude"
:
6.943630218505859
,
"name"
:
"Wittlich, Hauptbahnhof"
,
"type"
:
"Stop"
}
}
]
}
]
autotests/data/efa/trip-response-full-vrt.xml
0 → 100644
View file @
5efc8d6e
<?xml version="1.0" encoding="UTF-8"?>
<itdRequest
version=
"10.3.10.3"
language=
"de"
lengthUnit=
"METER"
>
<itdTripRequest
requestID=
"0"
>
<itdItinerary>
<itdRouteList>
<itdRoute
active=
"1"
selected=
"1"
changes=
"0"
distance=
"0"
optValue=
"0"
routeIndex=
"1"
routeTripIndex=
"1"
alternative=
"0"
print=
"0"
delete=
"0"
searchMode=
"1"
cTime=
"20210616213551387"
method=
"itp"
vehicleTime=
"25"
idx=
"3"
publicDuration=
"00:25"
>
<itdPartialRouteList>
<itdPartialRoute
type=
"PT"
active=
"1"
timeMinute=
"25"
bookingCode=
"S0R0T0PR0"
partialRouteType=
"normalPartialRoute"
bufBef=
"-1"
bufAft=
"-1"
>
<itdPoint
stopID=
"17001318"
area=
"10"
platform=
"13Nor"
gid=
"de:07211:1318"
areaGid=
"de:07211:1318:10"
pointGid=
"de:07211:1318:10:13N"
name=
"Trier, Hauptbahnhof"
nameWO=
"Hauptbahnhof"
place=
"Trier"
platformName=
"13 Nord"
plannedPlatformName=
"13 Nord"
usage=
"departure"
pointType=
"Gleis"
x=
"6.65365"
y=
"49.75804"
mapName=
"WGS84[DD.ddddd]"
niveau=
"0"
omc=
"7211000"
placeID=
"1"
locality=
"Trier"
georef=
"1009491987:19:MRCV:100"
>
<itdDateTime>
<itdDate
year=
"2021"
month=
"6"
day=
"16"
weekday=
"4"
/>
<itdTime
hour=
"21"
minute=
"33"
second=
"0"
/>
</itdDateTime>
<itdDateTimeTarget>
<itdDate
year=
"2021"
month=
"6"
day=
"16"
weekday=
"4"
/>
<itdTime
hour=
"21"
minute=
"31"
second=
"0"
/>
</itdDateTimeTarget>
<genAttrList>
<genAttrElem>
<name>
AREA_NIVEAU_DIVA
</name>
<value>
0
</value>
</genAttrElem>
</genAttrList>
</itdPoint>
<itdPoint
stopID=
"17040916"
area=
"1"
platform=
"3"
gid=
"de:07231:40916"
areaGid=
"de:07231:40916:1"
pointGid=
"de:07231:40916:1:3"
name=
"Wittlich, Hauptbahnhof"
nameWO=
"Hauptbahnhof"
place=
"Wittlich"
platformName=
"3"
plannedPlatformName=
"3"
usage=
"arrival"
pointType=
"Gleis"
x=
"6.94363"
y=
"49.97304"
mapName=
"WGS84[DD.ddddd]"
niveau=
"0"
omc=
"7231134"
placeID=
"7"
locality=
"Wittlich"
georef=
"1021181204:10:MRCV:100"
>
<itdDateTime>
<itdDate
year=
"2021"
month=
"6"
day=
"16"
weekday=
"4"
/>
<itdTime
hour=
"21"
minute=
"58"
second=
"0"
/>
</itdDateTime>
<itdDateTimeTarget>
<itdDate
year=
"2021"
month=
"6"
day=
"16"
weekday=
"4"
/>
<itdTime
hour=
"21"
minute=
"56"
second=
"0"
/>
</itdDateTimeTarget>
<genAttrList>
<genAttrElem>
<name>
AREA_NIVEAU_DIVA
</name>
<value>
0
</value>
</genAttrElem>
</genAttrList>
</itdPoint>
<itdMeansOfTransport
name=
"R-Bahn RE1"
shortname=
"RE1"
symbol=
"RE1"
type=
"6"
motType=
"0"
mtSubcode=
"0"
productName=
"R-Bahn"
productId=
"8"
destination=
"Koblenz Hauptbahnhof"
network=
"ddb"
TTB=
"0"
STT=
"0"
ROP=
"0"
destID=
"15010117"
spTr=
""
stateless=
"ddb:90S01: :R:j21"
tC=
"4135"
>
<motDivaParams
line=
"90S01"
project=
"j21"
direction=
"R"
supplement=
" "
network=
"ddb"
/>
</itdMeansOfTransport>
<itdRBLControlled
delayMinutes=
"2"
delayMinutesArr=
"2"
/>
<itdInfoTextList>
<infoTextListElem
code=
"PF"
>
Linie RE1: Maskenpflicht nach gesetzl. Regelung; denken Sie an eine FFP2-Maske
</infoTextListElem>
<infoTextListElem
code=
"FB"
>
Linie RE1: Fahrradmitnahme begrenzt möglich
</infoTextListElem>
<infoTextListElem
code=
"RC"
>
Linie RE1: Reservierung an DB-Automaten/Reisezentren/vielen DB-Agenturen möglich
</infoTextListElem>
<infoTextListElem
code=
"RO"
>
Linie RE1: Rollstuhlstellplatz
</infoTextListElem>
<infoTextListElem
code=
"EH"
>
Linie RE1: Fahrzeuggebundene Einstiegshilfe vorhanden
</infoTextListElem>
<infoTextListElem
code=
"LS"
>
Linie RE1: Laptop-Steckdosen
</infoTextListElem>
<infoTextListElem
code=
"KL"
>
Linie RE1: Klimaanlage
</infoTextListElem>
</itdInfoTextList>
</itdPartialRoute>
</itdPartialRouteList>
</itdRoute>
</itdRouteList>
</itdItinerary>
</itdTripRequest>
</itdRequest>
autotests/efaparsertest.cpp
View file @
5efc8d6e
...
...
@@ -181,6 +181,9 @@ private Q_SLOTS:
QTest
::
newRow
(
"vgn-trip-indoor-path"
)
<<
s
(
SOURCE_DIR
"/data/efa/trip-response-full-indoor-path-vgn.xml"
)
<<
s
(
SOURCE_DIR
"/data/efa/trip-response-full-indoor-path-vgn.json"
);
QTest
::
newRow
(
"vrt-trip-alternative-notes"
)
<<
s
(
SOURCE_DIR
"/data/efa/trip-response-full-vrt.xml"
)
<<
s
(
SOURCE_DIR
"/data/efa/trip-response-full-vrt.json"
);
}
void
testParseTrips
()
...
...
src/lib/backends/efaxmlparser.cpp
View file @
5efc8d6e
...
...
@@ -336,6 +336,13 @@ JourneySection EfaXmlParser::parseTripPartialRoute(ScopedXmlStreamReader &&reade
}
}
else
if
(
reader
.
name
()
==
QLatin1String
(
"infoLink"
))
{
section
.
addNotes
(
parseInfoLink
(
reader
.
subReader
()));
}
else
if
(
reader
.
name
()
==
QLatin1String
(
"itdInfoTextList"
))
{
auto
subReader
=
reader
.
subReader
();
while
(
subReader
.
readNextSibling
())
{
if
(
subReader
.
name
()
==
QLatin1String
(
"infoTextListElem"
))
{
section
.
addNote
(
subReader
.
readElementText
());
}
}
}
else
if
(
reader
.
name
()
==
QLatin1String
(
"itdStopSeq"
))
{
section
.
setIntermediateStops
(
parsePartialTripStopSequence
(
reader
.
subReader
()));
}
else
if
(
reader
.
name
()
==
QLatin1String
(
"itdPathCoordinates"
))
{
...
...
Write
Preview
Markdown
is supported
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