Migrates InfrastructureManagement to generated rtiddsgen API

Converts accessor calls to plain member access across ism service.
This commit is contained in:
berrux-dev committed 2026-09-21 02:45:09 +02:00
1 parent 472f537313
commit 82356f23e5
30 files changed
+1322 -1314

No files matched your search

@@ -32,32 +32,32 @@ Core::FunctionReplyObject ObjectSpecialArea::createObject(const SpecialArea &dat
onPublishData(); // publish data via DDS
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
Core::FunctionReplyObject ObjectSpecialArea::updateObject(const SpecialArea &data)
{
m_data = data;
DEBUG_LOG(m_logger) << "Data changed for Id: " << m_data.id();
DEBUG_LOG(m_logger) << "Data changed for Id: " << m_data.id;
onPublishData(); // publish data via DTS
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
Core::FunctionReplyObject ObjectSpecialArea::removeObject()
{
if (!dts()->removeSpecialAreaByKey(m_data.id()))
return Core::FunctionReplyObject(m_data.id(), tr_lts("dds", "SpecialArea with id %1 can not be removed from DDS")).arg(m_data.id());
if (!dts()->removeSpecialAreaByKey(m_data.id))
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "SpecialArea with id %1 can not be removed from DDS")).arg(m_data.id);
return Core::FunctionReplyObject(m_data.id());
return Core::FunctionReplyObject(m_data.id);
}
//-----------------------------------------------------------------------------------------------------------------------------
void ObjectSpecialArea::onPublishData()
{
INFO_LOG(m_logger) << "Publish IsmSpecialArea-data to dds (" << m_data.id() << ") ...";
INFO_LOG(m_logger) << "Publish IsmSpecialArea-data to dds (" << m_data.id << ") ...";
if (!dts()->publish(m_data))
ERROR_LOG(m_logger) << "Error publishing IsmSpecialArea-data to dds";
@@ -69,36 +69,36 @@ SpecialArea ObjectSpecialArea::toDdsData(const Database::IsmSpecialArea &dbData)
{
SpecialArea ddsData;
ddsData.id(dbData.id);
ddsData.name(dbData.name.toStdString());
ddsData.specialType(dbData.specialType.underlying());
ddsData.id = dbData.id;
ddsData.name = dbData.name.toStdString();
ddsData.specialType = dbData.specialType;
const QJsonDocument doc(QJsonDocument::fromJson(dbData.polygon.toUtf8()));
const QJsonObject obj(doc.object());
const QJsonArray arrPoly = obj.value(QStringLiteral("polygon")).toArray();
ddsData.polygon().reserve(arrPoly.size());
ddsData.polygon.reserve(arrPoly.size());
for (const auto &ele : arrPoly)
{
const QJsonObject objSeg(ele.toObject());
Core::GeoPosition2D element;
element.lat(objSeg[QStringLiteral("lat")].toDouble());
element.lon(objSeg[QStringLiteral("lon")].toDouble());
ddsData.polygon().push_back(std::move(element));
element.lat = objSeg[QStringLiteral("lat")].toDouble();
element.lon = objSeg[QStringLiteral("lon")].toDouble();
ddsData.polygon.push_back(std::move(element));
}
//End elements
QPolygonF tmp;
tmp.reserve(ddsData.polygon().size());
for (const Core::GeoPosition2D &pos : qAsConst(ddsData.polygon()))
tmp.push_back(QPointF(pos.lon(),pos.lat()));
tmp.reserve(ddsData.polygon.size());
for (const Core::GeoPosition2D &pos : qAsConst(ddsData.polygon))
tmp.push_back(QPointF(pos.lon, pos.lat));
QRectF boundingBox = tmp.boundingRect();
ddsData.boundingBoxBottomLeft() = Core::GeoPosition2D(boundingBox.bottomLeft().x(), boundingBox.bottomLeft().y());
ddsData.boundingBoxTopRight() = Core::GeoPosition2D(boundingBox.topRight().x(), boundingBox.topRight().y());
ddsData.boundingBoxBottomLeft = Core::GeoPosition2D(boundingBox.bottomLeft().x(), boundingBox.bottomLeft().y());
ddsData.boundingBoxTopRight = Core::GeoPosition2D(boundingBox.topRight().x(), boundingBox.topRight().y());
// init data not in db
ddsData.isDeleted(false);
ddsData.isUsed(false);
ddsData.isDeleted = false;
ddsData.isUsed = false;
return ddsData;
}