Complete Qt6/rtiddsgen migration of residual Lts service sources
This commit is contained in:
86 files changed
+1235
-1128
No files matched your search
+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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user