Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+43
-43
@@ -60,12 +60,12 @@ ParseBuildingXml::ParseBuildingXml(const QString &xmlFilename,
|
||||
, m_geoPosition(geoPosition)
|
||||
, m_rotationAngleDegree(rotationAngleDegree)
|
||||
{
|
||||
DEBUG_LOG() << "m_soundAreaFilename=" << m_soundAreaFilename;
|
||||
DEBUG_LOG(m_logger) << "m_soundAreaFilename=" << m_soundAreaFilename;
|
||||
}
|
||||
|
||||
QJsonObject ParseBuildingXml::egcusToJson() const
|
||||
{
|
||||
DEBUG_LOG() << "egcusToJson";
|
||||
DEBUG_LOG(m_logger) << "egcusToJson";
|
||||
if (m_egcus.isEmpty())
|
||||
return QJsonObject();
|
||||
|
||||
@@ -90,7 +90,7 @@ QJsonObject ParseBuildingXml::egcusToJson() const
|
||||
|
||||
QJsonObject ParseBuildingXml::soundAreaToJson() const
|
||||
{
|
||||
DEBUG_LOG() << "soundAreaToJson";
|
||||
DEBUG_LOG(m_logger) << "soundAreaToJson";
|
||||
QJsonObject soundArea;
|
||||
QJsonObject json;
|
||||
QJsonObject jsonEgcu;
|
||||
@@ -117,7 +117,7 @@ QJsonObject ParseBuildingXml::soundAreaToJson() const
|
||||
//-------------------------------------------------------------------------------------------------------------
|
||||
bool ParseBuildingXml::parseXml()
|
||||
{
|
||||
DEBUG_LOG() << "parseXml";
|
||||
DEBUG_LOG(m_logger) << "parseXml";
|
||||
m_request = MainStructureElementModifyRequest();
|
||||
m_request.properties("{}");
|
||||
m_lastError.clear();
|
||||
@@ -141,7 +141,7 @@ bool ParseBuildingXml::parseXml()
|
||||
// catch (const std::exception &ex)
|
||||
// {
|
||||
// m_lastError = QString::fromUtf8(ex.what());
|
||||
// WARNING_LOG() << "Error importing building: " << ex.what();
|
||||
// WARNING_LOG(m_logger) << "Error importing building: " << ex.what();
|
||||
// m_request = MainStructureElementModifyRequest();
|
||||
// return false;
|
||||
// }
|
||||
@@ -151,17 +151,17 @@ bool ParseBuildingXml::parseXml()
|
||||
parseXmlEgcus();
|
||||
QJsonObject egcus = egcusToJson();
|
||||
properties[QStringLiteral("egcusToRooms")] = egcus[QStringLiteral("egcusToRooms")];
|
||||
DEBUG_LOG() << "parseXml vor isEmpty";
|
||||
DEBUG_LOG(m_logger) << "parseXml vor isEmpty";
|
||||
if (!m_soundAreaFilename.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "parseXml vor parseXmlSoundArea";
|
||||
DEBUG_LOG(m_logger) << "parseXml vor parseXmlSoundArea";
|
||||
parseXmlSoundArea();
|
||||
properties[QStringLiteral("soundArea")] = soundAreaToJson();
|
||||
}
|
||||
|
||||
m_request.properties(QJsonDocument(properties).toJson(QJsonDocument::Compact).toStdString());
|
||||
|
||||
DEBUG_LOG() << "Finished import for file " << m_xmlFilename;
|
||||
DEBUG_LOG(m_logger) << "Finished import for file " << m_xmlFilename;
|
||||
return bRet;
|
||||
}
|
||||
|
||||
@@ -170,24 +170,24 @@ ParseBuildingXml::Egcu ParseBuildingXml::parseEgcu(const QDomElement &domEgcu)
|
||||
{
|
||||
ParseBuildingXml::Egcu ret;
|
||||
|
||||
INFO_LOG() << "parseEgcu Egcu: = " << domEgcu.tagName();
|
||||
INFO_LOG(m_logger) << "parseEgcu Egcu: = " << domEgcu.tagName();
|
||||
QDomElement mountpoint = domEgcu.firstChildElement(QStringLiteral("Mountpoint"));
|
||||
INFO_LOG() << "Mountpoint=" << mountpoint.tagName();
|
||||
INFO_LOG(m_logger) << "Mountpoint=" << mountpoint.tagName();
|
||||
QDomElement mountpointSubId = mountpoint.firstChildElement(QStringLiteral("SubId"));
|
||||
INFO_LOG() << "Mountpoint=" << mountpointSubId.tagName()
|
||||
INFO_LOG(m_logger) << "Mountpoint=" << mountpointSubId.tagName()
|
||||
<< " SubId = " << mountpointSubId.attribute(QStringLiteral("SubId"))
|
||||
<< " text= " << mountpointSubId.text();
|
||||
ret.mountpointEgcu = mountpointSubId.text().toInt();
|
||||
|
||||
QDomElement rooms = domEgcu.firstChildElement(QStringLiteral("Rooms"));
|
||||
INFO_LOG() << "Rooms=" << rooms.tagName()
|
||||
INFO_LOG(m_logger) << "Rooms=" << rooms.tagName()
|
||||
<< " SubId = " << rooms.attribute(QStringLiteral("SubId"))
|
||||
<< " text = " << rooms.text();
|
||||
|
||||
QDomElement room = rooms.firstChildElement(QStringLiteral("SubId"));
|
||||
for (; !room.isNull(); room = room.nextSiblingElement(room.tagName()))
|
||||
{
|
||||
INFO_LOG() << "Room=" << room.tagName()
|
||||
INFO_LOG(m_logger) << "Room=" << room.tagName()
|
||||
<< " SubId = " << room.attribute(QStringLiteral("SubId"))
|
||||
<< " text = " << room.text();
|
||||
ret.rooms.append(room.text().toInt());
|
||||
@@ -203,27 +203,27 @@ bool ParseBuildingXml::parseXmlEgcus()
|
||||
try
|
||||
{
|
||||
//parseXmlInternal();
|
||||
INFO_LOG() << "parseXmlEgcus " << m_egcuToRoomFilename;
|
||||
INFO_LOG(m_logger) << "parseXmlEgcus " << m_egcuToRoomFilename;
|
||||
if (!m_egcuToRoomFilename.isEmpty())
|
||||
{
|
||||
INFO_LOG() << "openXml";
|
||||
INFO_LOG(m_logger) << "openXml";
|
||||
QDomDocument doc = openXml(m_egcuToRoomFilename);
|
||||
if (!doc.isNull())
|
||||
{
|
||||
// Evaluate xml file and modify properties in m_request
|
||||
QDomElement root = doc.documentElement();
|
||||
INFO_LOG() << "root.tagName()=" << root.tagName();
|
||||
INFO_LOG(m_logger) << "root.tagName()=" << root.tagName();
|
||||
if (root.tagName() != QStringLiteral("EgcusToRooms"))
|
||||
{
|
||||
WARNING_LOG() << "The file is not EgcusToRooms";
|
||||
WARNING_LOG(m_logger) << "The file is not EgcusToRooms";
|
||||
return false;
|
||||
}
|
||||
QDomElement domEgcu = root.firstChildElement(QStringLiteral("Egcu"));
|
||||
if (domEgcu.isNull())
|
||||
INFO_LOG() << "Keine EGCU's";
|
||||
INFO_LOG(m_logger) << "Keine EGCU's";
|
||||
for (; !domEgcu.isNull(); domEgcu = domEgcu.nextSiblingElement(domEgcu.tagName()))
|
||||
{
|
||||
INFO_LOG() << "parseEgcus=" << domEgcu.tagName()
|
||||
INFO_LOG(m_logger) << "parseEgcus=" << domEgcu.tagName()
|
||||
<< " text=" << domEgcu.text()
|
||||
<< " Name=" << domEgcu.attribute(QStringLiteral("Name"));
|
||||
const Egcu egcu = parseEgcu(domEgcu);
|
||||
@@ -236,7 +236,7 @@ bool ParseBuildingXml::parseXmlEgcus()
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
m_lastError = QString::fromUtf8(ex.what());
|
||||
WARNING_LOG() << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
WARNING_LOG(m_logger) << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -253,34 +253,34 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
try
|
||||
{
|
||||
//parseXmlInternal();
|
||||
INFO_LOG() << "parseXmlSoundArea " << m_soundAreaFilename;
|
||||
INFO_LOG(m_logger) << "parseXmlSoundArea " << m_soundAreaFilename;
|
||||
if (!m_soundAreaFilename.isEmpty())
|
||||
{
|
||||
INFO_LOG() << "openXml";
|
||||
INFO_LOG(m_logger) << "openXml";
|
||||
QDomDocument doc = openXml(m_soundAreaFilename);
|
||||
if (!doc.isNull())
|
||||
{
|
||||
// Evaluate xml file and modify properties in m_request
|
||||
QDomElement root = doc.documentElement();
|
||||
INFO_LOG() << "root.tagName()=" << root.tagName();
|
||||
INFO_LOG(m_logger) << "root.tagName()=" << root.tagName();
|
||||
if (root.tagName() != QStringLiteral("SoundArea"))
|
||||
{
|
||||
WARNING_LOG() << "The file is not SoundArea";
|
||||
WARNING_LOG(m_logger) << "The file is not SoundArea";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "parseSoundArea SoundArea: = " << root.tagName();
|
||||
INFO_LOG(m_logger) << "parseSoundArea SoundArea: = " << root.tagName();
|
||||
|
||||
// Id
|
||||
m_soundArea.id = root.firstChildElement(QStringLiteral("Id")).text().toInt();
|
||||
INFO_LOG() << "Id=" << m_soundArea.id;
|
||||
INFO_LOG(m_logger) << "Id=" << m_soundArea.id;
|
||||
|
||||
// Geometry
|
||||
QDomElement geometry = root.firstChildElement(QStringLiteral("Geometry"));
|
||||
QDomElement point = geometry.firstChildElement(QStringLiteral("Point"));
|
||||
for (; !point.isNull(); point = point.nextSiblingElement(point.tagName()))
|
||||
{
|
||||
INFO_LOG() << "Point=" << point.tagName()
|
||||
INFO_LOG(m_logger) << "Point=" << point.tagName()
|
||||
<< " lat = " << point.firstChildElement(QStringLiteral("lat")).text().toDouble()
|
||||
<< " lon = " << point.firstChildElement(QStringLiteral("lon")).text().toDouble();
|
||||
geoPosition.lat(point.firstChildElement(QStringLiteral("lat")).text().toDouble());
|
||||
@@ -290,7 +290,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
|
||||
// MainEgcuMountpoint
|
||||
m_soundArea.mainEgcuMountpoint = root.firstChildElement(QStringLiteral("MainEgcuMountpoint")).text().toInt();
|
||||
DEBUG_LOG() << "MainEgcuMountpoint Id=" << m_soundArea.mainEgcuMountpoint;
|
||||
DEBUG_LOG(m_logger) << "MainEgcuMountpoint Id=" << m_soundArea.mainEgcuMountpoint;
|
||||
|
||||
// MountpointsEgcu
|
||||
QDomElement egcuMountpoints = root.firstChildElement(QStringLiteral("EgcuMountpoints"));
|
||||
@@ -298,7 +298,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
for (; !id.isNull(); id = id.nextSiblingElement(id.tagName()))
|
||||
{
|
||||
int mountpointEgcu = id.text().toInt();
|
||||
DEBUG_LOG() << "mountpointEgcu=" << mountpointEgcu;
|
||||
DEBUG_LOG(m_logger) << "mountpointEgcu=" << mountpointEgcu;
|
||||
m_soundArea.egcuMountpoints.push_back(mountpointEgcu);
|
||||
}
|
||||
}
|
||||
@@ -308,7 +308,7 @@ bool ParseBuildingXml::parseXmlSoundArea()
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
m_lastError = QString::fromUtf8(ex.what());
|
||||
WARNING_LOG() << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
WARNING_LOG(m_logger) << "Error importing building: wrong XML-File EgcuToRooms: " << ex.what();
|
||||
bRet = false;
|
||||
}
|
||||
|
||||
@@ -367,16 +367,16 @@ QVector<ParseBuildingXml::BuildingMetaInfo> ParseBuildingXml::parseMetaXml(const
|
||||
info.filename = streifElem.attribute(QLatin1String("Name"));
|
||||
if (info.filename.isEmpty())
|
||||
{
|
||||
WARNING_LOG() << "Empty filename (building)!";
|
||||
WARNING_LOG(m_logger) << "Empty filename (building)!";
|
||||
continue;
|
||||
}
|
||||
|
||||
info.rotationAngleDegree = orientationElem.attribute(QLatin1String("Angle")).toDouble(); // correct rotation?
|
||||
INFO_LOG() << "Found Building angle: " << info.rotationAngleDegree;
|
||||
INFO_LOG(m_logger) << "Found Building angle: " << info.rotationAngleDegree;
|
||||
|
||||
info.geoPosition = positionFromElement<Core::GeoPosition>(posElem);
|
||||
|
||||
INFO_LOG() << "Found Building position: (" << info.geoPosition.lon() << ", ("
|
||||
INFO_LOG(m_logger) << "Found Building position: (" << info.geoPosition.lon() << ", ("
|
||||
<< info.geoPosition.lat() << ", ("
|
||||
<< info.geoPosition.z() << ")";
|
||||
|
||||
@@ -397,14 +397,14 @@ void ParseBuildingXml::parseXmlInternal()
|
||||
const QDomElement headerElem = getChildElement(rootElem, QStringLiteral("Header"));
|
||||
const QDomElement baseGroupElem = getChildElement(headerElem, QStringLiteral("Group"));
|
||||
|
||||
DEBUG_LOG() << "Start import for file " << m_xmlFilename;
|
||||
DEBUG_LOG(m_logger) << "Start import for file " << m_xmlFilename;
|
||||
|
||||
m_request.angle(m_rotationAngleDegree);
|
||||
m_request.geoPosition(m_geoPosition);
|
||||
m_request.modelId(getInteger(getChildElement(baseGroupElem, QStringLiteral("ModelId")), QStringLiteral("Id")));
|
||||
m_request.name(getChildElement(baseGroupElem, QStringLiteral("Name")).text().toStdString());
|
||||
m_request.description(m_request.name());
|
||||
INFO_LOG() << "Importing building with name: " << m_request.name();
|
||||
INFO_LOG(m_logger) << "Importing building with name: " << m_request.name();
|
||||
|
||||
InfrastructureManagement::StructureElement seBuilding;
|
||||
seBuilding.name(m_request.name());
|
||||
@@ -483,15 +483,15 @@ void ParseBuildingXml::importExternalReferences(const QDomElement &parent,
|
||||
// we don't care about BCU Mounting positions inside xml file - we create our own
|
||||
if (se.mountingPointTypeId() == MountingPointType::BuildingControlUnit)
|
||||
{
|
||||
INFO_LOG() << "Ignoring xml-internal BuildingControl mounting point - not needed";
|
||||
INFO_LOG(m_logger) << "Ignoring xml-internal BuildingControl mounting point - not needed";
|
||||
continue;
|
||||
}
|
||||
if (se.mountingPointTypeId() == MountingPointType::Unknown)
|
||||
{
|
||||
INFO_LOG() << "Ignoring unknown mounting point type with subId " << se.mountingPointId();
|
||||
INFO_LOG(m_logger) << "Ignoring unknown mounting point type with subId " << se.mountingPointId();
|
||||
continue;
|
||||
}
|
||||
INFO_LOG() << "importExternalReferences: " << se.displayName() << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG(m_logger) << "importExternalReferences: " << se.displayName() << ", parentIdx = " << parentIdx;
|
||||
addElementToRequest(se, parentIdx);
|
||||
}
|
||||
}
|
||||
@@ -507,7 +507,7 @@ void ParseBuildingXml::importFloors(const QDomElement &parent,
|
||||
if (!nameElement.text().startsWith(QLatin1String("floor_"), Qt::CaseInsensitive))
|
||||
continue;
|
||||
|
||||
INFO_LOG() << "importFloors: " << nameElement.text() << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG(m_logger) << "importFloors: " << nameElement.text() << ", parentIdx = " << parentIdx;
|
||||
|
||||
StructureElement se;
|
||||
se.name(nameElement.text().simplified().toStdString());
|
||||
@@ -518,12 +518,12 @@ void ParseBuildingXml::importFloors(const QDomElement &parent,
|
||||
|
||||
// read base height from xml comment
|
||||
const QDomElement commentElement = getChildElement(floorElem, QStringLiteral("Comment"), false);
|
||||
DEBUG_LOG() << "Comment = " << commentElement.text();
|
||||
DEBUG_LOG(m_logger) << "Comment = " << commentElement.text();
|
||||
const QStringList comm = commentElement.text().split(QLatin1Char('='));
|
||||
double baseHeight = 0.00;
|
||||
if (comm.at(0) == QStringLiteral("base_height"))
|
||||
baseHeight = comm.at(1).toDouble();
|
||||
DEBUG_LOG() << "base_height = " << baseHeight;
|
||||
DEBUG_LOG(m_logger) << "base_height = " << baseHeight;
|
||||
se.relPosition().offsetZ(baseHeight);
|
||||
|
||||
addElementToRequest(se, parentIdx);
|
||||
@@ -552,7 +552,7 @@ void ParseBuildingXml::importRooms(const QDomElement &parent,
|
||||
// displayed room names are too long
|
||||
roomName.replace(QStringLiteral("SW_room"), QStringLiteral("R"));
|
||||
|
||||
INFO_LOG() << "importRooms: " << roomName << ", parentIdx = " << parentIdx;
|
||||
INFO_LOG(m_logger) << "importRooms: " << roomName << ", parentIdx = " << parentIdx;
|
||||
|
||||
se.displayName(roomName.toStdString());
|
||||
se.mountingPointId(subId);
|
||||
@@ -567,7 +567,7 @@ void ParseBuildingXml::importRooms(const QDomElement &parent,
|
||||
addElementToRequest(se, parentIdx);
|
||||
const int curIdx = m_request.elements().size() - 1;
|
||||
importExternalReferences(subRoomElem, curIdx);
|
||||
DEBUG_LOG() << "Room=" << se.name()
|
||||
DEBUG_LOG(m_logger) << "Room=" << se.name()
|
||||
<< " Id=" << se.id()
|
||||
<< " mountingPointId=" << se.mountingPointId();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user