Merge branch 'master' into workingToni

This commit is contained in:
toni
2017-03-10 15:39:48 +01:00
3 changed files with 48 additions and 1 deletions

View File

@@ -105,6 +105,7 @@ namespace Floorplan {
if (std::string("obstacles") == n->Name()) {floor->obstacles = parseFloorObstacles(n);}
if (std::string("accesspoints") == n->Name()) {floor->accesspoints = parseFloorAccessPoints(n);}
if (std::string("beacons") == n->Name()) {floor->beacons = parseFloorBeacons(n);}
if (std::string("fingerprints") == n->Name()) {floor->fpLocations = parseFingerprintLocations(n);}
if (std::string("regions") == n->Name()) {floor->regions = parseFloorRegions(n);}
if (std::string("underlays") == n->Name()) {floor->underlays = parseFloorUnderlays(n);}
if (std::string("pois") == n->Name()) {floor->pois = parseFloorPOIs(n);}
@@ -310,6 +311,28 @@ namespace Floorplan {
return b;
}
/** parse <fingerprints> <location>s */
static std::vector<FingerprintLocation*> parseFingerprintLocations(const XMLElem* el) {
assertNode("fingerprints", el);
std::vector<FingerprintLocation*> vec;
FOREACH_NODE(n, el) {
if (std::string("location") == n->Name()) { vec.push_back(parseFingerprintLocation(n)); }
}
return vec;
}
/** parse one fingerprint <location> */
static FingerprintLocation* parseFingerprintLocation(const XMLElem* n) {
assertNode("location", n);
FingerprintLocation* fpl = new FingerprintLocation();
fpl->name = n->Attribute("name");
fpl->posOnFloor.x = n->FloatAttribute("x");
fpl->posOnFloor.y = n->FloatAttribute("y");
fpl->heightAboveFloor = n->FloatAttribute("dz");
const XMLElem* meta = n->FirstChildElement("meta");
if (meta) {fpl->setMeta(parseMetaElement(meta));}
return fpl;
}
static std::vector<FloorRegion*> parseFloorRegions(const XMLElem* el) {
std::vector<FloorRegion*> vec;