Commit 1c8b0256 authored by Volker Krause's avatar Volker Krause
Browse files

Handle stairs like elevators and escalators in path maneuvers

parent e74c883e
......@@ -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;
......
......@@ -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
};
......
......@@ -27,6 +27,8 @@ Kirigami.ScrollablePage {
Layout.rowSpan: 2
text: {
switch (modelData.maneuver) {
case PathSection.Stairs:
return "🪜";
case PathSection.Elevator:
return "🛗";
case PathSection.Escalator:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment