Complete Qt6/rtiddsgen migration of residual Lts service sources
This commit is contained in:
86 files changed
+1235
-1128
No files matched your search
@@ -67,7 +67,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
|
||||
|
||||
qint64 DdsHandler::currentPartitionTime() const
|
||||
{
|
||||
return m_dtcCore->partitionTime().timeStamp();
|
||||
return m_dtcCore->partitionTime().timeStamp;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
||||
+11
-11
@@ -80,13 +80,13 @@ bool HandlerInfrastructureData::init()
|
||||
void HandlerInfrastructureData::onAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
|
||||
{
|
||||
// nur die MountingPointType::MeteoDataUnit bearbeiten...
|
||||
if (data.mountingPointTypeId() != InfrastructureManagement::MountingPointType::MeteoDataUnit)
|
||||
if (data.mountingPointTypeId != InfrastructureManagement::MountingPointType::MeteoDataUnit)
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "onAssetChanged()"
|
||||
<< " assetId: " << data.id()
|
||||
<< " mountingPointTypeId: " << data.mountingPointTypeId()
|
||||
<< " name: " << data.name();
|
||||
<< " assetId: " << data.id
|
||||
<< " mountingPointTypeId: " << data.mountingPointTypeId
|
||||
<< " name: " << data.name;
|
||||
|
||||
switch (modType)
|
||||
{
|
||||
@@ -108,10 +108,10 @@ void HandlerInfrastructureData::onMountingPointAssetChanged(const Infrastructure
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_mountingPointAssetsMap.insert(data.assetId(), data.structureElementId());
|
||||
m_mountingPointAssetsMap.insert(data.assetId, data.structureElementId);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_mountingPointAssetsMap.remove(data.assetId());
|
||||
m_mountingPointAssetsMap.remove(data.assetId);
|
||||
break;
|
||||
}
|
||||
} // end of onMountingPointAssetChanged()
|
||||
@@ -123,10 +123,10 @@ void HandlerInfrastructureData::onMainStructureElementChanged(const Infrastructu
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
m_mainStructureElements.insert(data.id(), data);
|
||||
m_mainStructureElements.insert(data.id, data);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
m_mainStructureElements.remove(data.id());
|
||||
m_mainStructureElements.remove(data.id);
|
||||
break;
|
||||
}
|
||||
} // end of onMountingPointAssetChanged()
|
||||
@@ -143,10 +143,10 @@ Core::GeoPosition HandlerInfrastructureData::getStructureElementPosition(int ass
|
||||
// Go through all MainStructureElements and search structureElementId
|
||||
for (const InfrastructureManagement::MainStructureElement &mse : m_mainStructureElements)
|
||||
{
|
||||
for (const InfrastructureManagement::StructureElement &se : mse.elements())
|
||||
for (const InfrastructureManagement::StructureElement &se : mse.elements)
|
||||
{
|
||||
if (se.id() == seId)
|
||||
return mse.geoPosition();
|
||||
if (se.id == seId)
|
||||
return mse.geoPosition;
|
||||
}
|
||||
}
|
||||
return Core::GeoPosition();
|
||||
|
||||
+28
-28
@@ -40,12 +40,12 @@ bool HandlerMeteoDataUnit::init()
|
||||
{
|
||||
delete m_tcpWS;
|
||||
QJsonParseError jError;
|
||||
QJsonDocument doc(QJsonDocument::fromJson(m_asset.properties().c_str(), &jError));
|
||||
QJsonDocument doc(QJsonDocument::fromJson(m_asset.properties.c_str(), &jError));
|
||||
if (jError.error != QJsonParseError::NoError ||
|
||||
!doc.isObject())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not initialize meteo data unit - properties are not parsable: "
|
||||
<< jError.errorString() << " - '" << m_asset.properties() << "'";
|
||||
<< jError.errorString() << " - '" << m_asset.properties << "'";
|
||||
return false;
|
||||
}
|
||||
QJsonObject obj(doc.object());
|
||||
@@ -54,35 +54,35 @@ bool HandlerMeteoDataUnit::init()
|
||||
if (climatePort == 0 || windPort == 0)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Can not parse climate and/or wind port from properties: '" <<
|
||||
m_asset.properties() << "'";
|
||||
m_asset.properties << "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
m_tcpWS = new TcpWeatherStation(m_asset.id(),
|
||||
QString::fromStdString(m_asset.hostname()),
|
||||
m_tcpWS = new TcpWeatherStation(m_asset.id,
|
||||
QString::fromStdString(m_asset.hostname),
|
||||
climatePort,
|
||||
windPort);
|
||||
|
||||
// init local MeteoData Values for compare
|
||||
m_newMeteoData.id(m_asset.id());
|
||||
m_newMeteoData.weatherStationId(m_asset.id());
|
||||
m_newMeteoData.note(m_asset.name());
|
||||
m_newMeteoData.isStaticMeteoData(false);
|
||||
m_newMeteoData.id = m_asset.id;
|
||||
m_newMeteoData.weatherStationId = m_asset.id;
|
||||
m_newMeteoData.note = m_asset.name;
|
||||
m_newMeteoData.isStaticMeteoData = false;
|
||||
|
||||
// Position der MDU eintragen (GeoPosition2D)
|
||||
if (m_mainHandler->ism())
|
||||
{
|
||||
const Core::GeoPosition geoPos = m_mainHandler->ism()->getStructureElementPosition(m_asset.id());
|
||||
const Core::GeoPosition geoPos = m_mainHandler->ism()->getStructureElementPosition(m_asset.id);
|
||||
//GeoPos->GeoPos2D
|
||||
m_newMeteoData.pos(Core::GeoPosition2D(geoPos.lon(), geoPos.lat()));
|
||||
m_newMeteoData.pos = Core::GeoPosition2D(geoPos.lon, geoPos.lat);
|
||||
}
|
||||
|
||||
|
||||
m_newMeteoData.pressure(800.0);
|
||||
m_newMeteoData.humidity(0.0);
|
||||
m_newMeteoData.temperature(0.0);
|
||||
m_newMeteoData.windSpeed(0.0);
|
||||
m_newMeteoData.windDirection(0.0);
|
||||
m_newMeteoData.pressure = 800.0;
|
||||
m_newMeteoData.humidity = 0.0;
|
||||
m_newMeteoData.temperature = 0.0;
|
||||
m_newMeteoData.windSpeed = 0.0;
|
||||
m_newMeteoData.windDirection = 0.0;
|
||||
|
||||
m_lastMeteoData = m_newMeteoData;
|
||||
|
||||
@@ -98,22 +98,22 @@ void HandlerMeteoDataUnit::onMeteoDataChanged(int id,
|
||||
float pressure, float temperature, float humidity,
|
||||
float direction, float speed, bool climateOk, bool windOk)
|
||||
{
|
||||
m_newMeteoData.id(id);
|
||||
m_newMeteoData.pressure(pressure); // in hPa
|
||||
m_newMeteoData.temperature(temperature); // in Grad Celsius
|
||||
m_newMeteoData.humidity(humidity); // % rel. Feuchte
|
||||
m_newMeteoData.windDirection(direction); // Grad, Nordbezogen mathem. negativ
|
||||
m_newMeteoData.windSpeed(speed); // in m/s
|
||||
m_newMeteoData.climateOk(climateOk);
|
||||
m_newMeteoData.windOk(windOk);
|
||||
m_newMeteoData.id = id;
|
||||
m_newMeteoData.pressure = pressure; // in hPa
|
||||
m_newMeteoData.temperature = temperature; // in Grad Celsius
|
||||
m_newMeteoData.humidity = humidity; // % rel. Feuchte
|
||||
m_newMeteoData.windDirection = direction; // Grad, Nordbezogen mathem. negativ
|
||||
m_newMeteoData.windSpeed = speed; // in m/s
|
||||
m_newMeteoData.climateOk = climateOk;
|
||||
m_newMeteoData.windOk = windOk;
|
||||
|
||||
// Position der MDU eintragen (falls sie noch nicht beim init() ermittelt werden konnte)
|
||||
if (m_lastMeteoData.pos() == Core::GeoPosition2D())
|
||||
if (m_lastMeteoData.pos == Core::GeoPosition2D())
|
||||
{
|
||||
if (m_mainHandler->ism())
|
||||
{
|
||||
const Core::GeoPosition geoPos = m_mainHandler->ism()->getStructureElementPosition(m_asset.id());
|
||||
m_newMeteoData.pos(Core::GeoPosition2D(geoPos.lon(), geoPos.lat()));
|
||||
const Core::GeoPosition geoPos = m_mainHandler->ism()->getStructureElementPosition(m_asset.id);
|
||||
m_newMeteoData.pos = Core::GeoPosition2D(geoPos.lon, geoPos.lat);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void HandlerMeteoDataUnit::onPublishData()
|
||||
MeteoDataManagement::MeteoData ddsData;
|
||||
|
||||
ddsData = m_newMeteoData;
|
||||
ddsData.timeStamp(m_mainHandler->dds()->currentPartitionTime());
|
||||
ddsData.timeStamp = m_mainHandler->dds()->currentPartitionTime();
|
||||
|
||||
INFO_LOG(m_logger) << "Publish dynamic MeteoData to dds: " << ddsData;
|
||||
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ bool HandlerMeteoDataUnits::addMeteoDataUnit(const InfrastructureManagement::Ins
|
||||
removeMeteoDataUnit(asset); // just to be sure
|
||||
|
||||
HandlerMeteoDataUnit *hMDU = new HandlerMeteoDataUnit(m_mainHandler, asset);
|
||||
m_handlerMeteoDataUnitsMap.insert(asset.id(), hMDU);
|
||||
m_handlerMeteoDataUnitsMap.insert(asset.id, hMDU);
|
||||
|
||||
return false;
|
||||
} // end of addMeteoDataUnit()
|
||||
@@ -50,7 +50,7 @@ bool HandlerMeteoDataUnits::addMeteoDataUnit(const InfrastructureManagement::Ins
|
||||
bool HandlerMeteoDataUnits::removeMeteoDataUnit(const InfrastructureManagement::InstrumentationAsset &asset)
|
||||
{
|
||||
INFO_LOG(m_logger) << "removeMeteoDataUnit: " << asset;
|
||||
auto it = m_handlerMeteoDataUnitsMap.find(asset.id());
|
||||
auto it = m_handlerMeteoDataUnitsMap.find(asset.id);
|
||||
if (it == m_handlerMeteoDataUnitsMap.end())
|
||||
return false;
|
||||
|
||||
|
||||
+20
-20
@@ -73,11 +73,11 @@ void HandlerStaticMeteoData::onStaticMeteoDataModifyRequest(const rti::core::Sam
|
||||
{
|
||||
INFO_LOG(m_logger) << "onStaticMeteoDataModifyRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject rep(request.id());
|
||||
Core::FunctionReplyObject rep(request.id);
|
||||
|
||||
if (!updateStaticMeteoDatainDB(request))
|
||||
{
|
||||
rep = Core::FunctionReplyObject(request.id(), tr_lts("dds", "Update database failed"));
|
||||
rep = Core::FunctionReplyObject(request.id, tr_lts("dds", "Update database failed"));
|
||||
m_ddsHandler->fts()->staticMeteoDataModifyReply(cookie, rep);
|
||||
return;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ void HandlerStaticMeteoData::onStaticMeteoDataModifyRequest(const rti::core::Sam
|
||||
|
||||
bool HandlerStaticMeteoData::updateStaticMeteoDatainDB(const StaticMeteoDataModifyRequest &request)
|
||||
{
|
||||
if (request.id() != m_dbStaticMeteoData.id)
|
||||
if (request.id != m_dbStaticMeteoData.id)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Invalid id for db-table 'mdm_static_meteo_data'"
|
||||
<< m_dbStaticMeteoData.id
|
||||
@@ -116,9 +116,9 @@ void HandlerStaticMeteoData::onPublishData()
|
||||
|
||||
const auto note(tr_lts("dds", "static data"));
|
||||
|
||||
ddsData.isStaticMeteoData(true);
|
||||
ddsData.note(note);
|
||||
ddsData.weatherStationId(ddsData.id()); // MDUid == dbId
|
||||
ddsData.isStaticMeteoData = true;
|
||||
ddsData.note = note;
|
||||
ddsData.weatherStationId = ddsData.id; // MDUid == dbId
|
||||
|
||||
INFO_LOG(m_logger) << "Publish static MeteoData to dds: " << ddsData;
|
||||
|
||||
@@ -153,13 +153,13 @@ Database::MdmStaticMeteoData HandlerStaticMeteoData::ddsInputDataToDbData(const
|
||||
{
|
||||
Database::MdmStaticMeteoData dbData;
|
||||
|
||||
dbData.id = ddsData.id();
|
||||
dbData.timeStamp = ddsData.timeStamp();
|
||||
dbData.windDirection = ddsData.windDirection();
|
||||
dbData.windSpeed = ddsData.windSpeed();
|
||||
dbData.temperature = ddsData.temperature();
|
||||
dbData.pressure = ddsData.pressure();
|
||||
dbData.humidity = ddsData.humidity();
|
||||
dbData.id = ddsData.id;
|
||||
dbData.timeStamp = ddsData.timeStamp;
|
||||
dbData.windDirection = ddsData.windDirection;
|
||||
dbData.windSpeed = ddsData.windSpeed;
|
||||
dbData.temperature = ddsData.temperature;
|
||||
dbData.pressure = ddsData.pressure;
|
||||
dbData.humidity = ddsData.humidity;
|
||||
|
||||
return dbData;
|
||||
} // end of toDbData()
|
||||
@@ -169,13 +169,13 @@ MeteoData HandlerStaticMeteoData::toDdsData(const Database::MdmStaticMeteoData &
|
||||
{
|
||||
MeteoData ddsData;
|
||||
|
||||
ddsData.id(dbData.id);
|
||||
ddsData.timeStamp(dbData.timeStamp);
|
||||
ddsData.windDirection(dbData.windDirection);
|
||||
ddsData.windSpeed(dbData.windSpeed);
|
||||
ddsData.temperature(dbData.temperature);
|
||||
ddsData.pressure(dbData.pressure);
|
||||
ddsData.humidity(dbData.humidity);
|
||||
ddsData.id = dbData.id;
|
||||
ddsData.timeStamp = dbData.timeStamp;
|
||||
ddsData.windDirection = dbData.windDirection;
|
||||
ddsData.windSpeed = dbData.windSpeed;
|
||||
ddsData.temperature = dbData.temperature;
|
||||
ddsData.pressure = dbData.pressure;
|
||||
ddsData.humidity = dbData.humidity;
|
||||
|
||||
return ddsData;
|
||||
} // end of toDdsData()
|
||||
|
||||
@@ -53,7 +53,7 @@ void TcpSocket::doConnect()
|
||||
this, &TcpSocket::onConnected);
|
||||
connect(m_socket, &QTcpSocket::disconnected,
|
||||
this, &TcpSocket::onDisonnected);
|
||||
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QTcpSocket::error),
|
||||
connect(m_socket, &QTcpSocket::errorOccurred,
|
||||
this, &TcpSocket::onError);
|
||||
connect(m_socket, &QTcpSocket::readyRead,
|
||||
this, &TcpSocket::onReadyRead);
|
||||
|
||||
Reference in new issue
Block a user