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
1c8b0256
Commit
1c8b0256
authored
Aug 12, 2021
by
Volker Krause
Browse files
Handle stairs like elevators and escalators in path maneuvers
parent
e74c883e
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/lib/backends/efaxmlparser.cpp
View file @
1c8b0256
...
...
@@ -481,7 +481,9 @@ std::vector<EfaXmlParser::PathDescription> EfaXmlParser::parsePathDescriptionLis
}
else
if
(
elemReader
.
name
()
==
QLatin1String
(
"genAttrList"
))
{
const
auto
attrs
=
parseGenericAttributeList
(
elemReader
.
subReader
());
const
auto
indoorType
=
attrs
.
value
(
QLatin1String
(
"INDOOR_TYPE"
));
if
(
indoorType
==
QLatin1String
(
"LIFT"
))
{
if
(
indoorType
==
QLatin1String
(
"STAIRS"
))
{
desc
.
maneuver
=
PathSection
::
Stairs
;
}
else
if
(
indoorType
==
QLatin1String
(
"LIFT"
))
{
desc
.
maneuver
=
PathSection
::
Elevator
;
}
else
if
(
indoorType
==
QLatin1String
(
"ESCALATOR"
))
{
desc
.
maneuver
=
PathSection
::
Escalator
;
...
...
@@ -503,7 +505,7 @@ void EfaXmlParser::resolvePathDescription(std::vector<PathDescription> &descs) c
}
for
(
auto
it
=
std
::
next
(
descs
.
begin
());
it
!=
std
::
prev
(
descs
.
end
());
++
it
)
{
if
((
*
it
).
maneuver
!=
PathSection
::
Elevator
&&
(
*
it
).
maneuver
!=
PathSection
::
Escalator
)
{
if
((
*
it
).
maneuver
!=
PathSection
::
Stairs
&&
(
*
it
).
maneuver
!=
PathSection
::
Elevator
&&
(
*
it
).
maneuver
!=
PathSection
::
Escalator
)
{
continue
;
}
const
auto
niveauBefore
=
(
*
std
::
prev
(
it
)).
niveau
;
...
...
src/lib/datatypes/path.h
View file @
1c8b0256
...
...
@@ -45,6 +45,7 @@ public:
/** Maneuver associated with a path section. */
enum
Maneuver
{
Move
,
///< Move/drive with the default mode of transport for this path
Stairs
,
///< Walk up or down stairs
Elevator
,
///< Take an elevator
Escalator
,
///< Take an escalator
};
...
...
tests/PathPage.qml
View file @
1c8b0256
...
...
@@ -27,6 +27,8 @@ Kirigami.ScrollablePage {
Layout.rowSpan
:
2
text
:
{
switch
(
modelData
.
maneuver
)
{
case
PathSection
.
Stairs
:
return
"
🪜
"
;
case
PathSection
.
Elevator
:
return
"
🛗
"
;
case
PathSection
.
Escalator
:
...
...
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