Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen

- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 06:06:24 +02:00
1 parent 010f91928a
commit b774f4035c
2785 files changed
+18754 -18316

No files matched your search

@@ -32,7 +32,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate mdm_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS HLA svcMdmCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcMdmCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcMdmCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -60,7 +60,7 @@ SET(SRCS_client
# generate mdm_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcMdmClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY2(AAR SV WS svcMdmClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcMdmClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -88,7 +88,7 @@ SET(SRCS_server
# generate mdm_[d|f]ts.h, mdm_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV svcMdmServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY2(AAR SV svcMdmServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcMdmServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -14,9 +14,8 @@ namespace MeteoDataManagement
{
DdsHandler::DdsHandler(int domainId)
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::AllExercises))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -32,11 +31,11 @@ DdsHandler::~DdsHandler()
bool DdsHandler::init(const QStringList &qosFileList)
{
INFO_LOG(m_logger) << "--- Start MeteoDataManagement DDSHandler.";
INFO_LOG() << "--- Start MeteoDataManagement DDSHandler.";
if (!m_ddsConnector->init(qosFileList))
{
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
ERROR_LOG() << "Error initializing dds connections - aborting";
return false;
}
@@ -53,12 +52,12 @@ bool DdsHandler::init(const QStringList &qosFileList)
// DTS
m_ddsDts = MeteoDataManagement::Interface::Dts::create(m_ddsConnector);
bool bRet = m_ddsDts->enableAll();
INFO_LOG(m_logger) << "Dts initialised";
INFO_LOG() << "Dts initialised";
// FTS
m_ddsFts = MeteoDataManagement::Interface::Fts::create(m_ddsConnector);
bRet &= m_ddsFts->enableAll();
INFO_LOG(m_logger) << "Fts initialised";
INFO_LOG() << "Fts initialised";
return bRet;
@@ -44,7 +44,6 @@ private:
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<MeteoDataManagement::Interface::Dts> m_ddsDts;
std::shared_ptr<MeteoDataManagement::Interface::Fts> m_ddsFts;
NGL::INGLLogger &m_logger;
};
}
@@ -20,27 +20,26 @@ HandlerInfrastructureData::HandlerInfrastructureData(const std::shared_ptr<DdsHa
: QObject(parent)
, m_ddsHandler(ddsHandler)
, m_handlerMeteoDataUnits(handlerMeteoDataUnits)
, m_logger(getLogger("HandlerInfrastructureData"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
bool HandlerInfrastructureData::init()
{
INFO_LOG(m_logger) << "start init() DTC InfrastructureManagement ";
INFO_LOG() << "start init() DTC InfrastructureManagement ";
// DTC InfrastructureManagement
m_dtc = InfrastructureManagement::Interface::Dtc::create(m_ddsHandler->dds());
if (m_dtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create DTC InfrastructureManagement";
ERROR_LOG() << "Could not create DTC InfrastructureManagement";
return false;
}
if (!m_dtc->enableMountingPointAsset() ||
!m_dtc->enableMainStructureElement())
{
ERROR_LOG(m_logger) << "init() DTC InfrastructureManagement failed";
ERROR_LOG() << "init() DTC InfrastructureManagement failed";
return false;
}
@@ -50,7 +49,7 @@ bool HandlerInfrastructureData::init()
m_dtcInstrumentationAssetCF.reset(m_ddsHandler->dds()->createDTC<DTC::InstrumentationAssetCFImpl>(filter));
if (!m_dtcInstrumentationAssetCF)
{
ERROR_LOG(m_logger) << "init() DTC InfrastructureManagement failed";
ERROR_LOG() << "init() DTC InfrastructureManagement failed";
return false;
}
m_dtcInstrumentationAssetCF->setSubscriberCallback([this](const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
@@ -83,7 +82,7 @@ void HandlerInfrastructureData::onAssetChanged(const InfrastructureManagement::I
if (data.mountingPointTypeId() != InfrastructureManagement::MountingPointType::MeteoDataUnit)
return;
INFO_LOG(m_logger) << "onAssetChanged()"
INFO_LOG() << "onAssetChanged()"
<< " assetId: " << data.id()
<< " mountingPointTypeId: " << data.mountingPointTypeId()
<< " name: " << data.name();
@@ -137,7 +136,7 @@ Core::GeoPosition HandlerInfrastructureData::getStructureElementPosition(int ass
const int seId = m_mountingPointAssetsMap.value(assetId);
if (seId <= 0)
{
WARNING_LOG(m_logger) << "Could not find mountingPointAsset for asset id " << assetId;
WARNING_LOG() << "Could not find mountingPointAsset for asset id " << assetId;
return Core::GeoPosition();
}
// Go through all MainStructureElements and search structureElementId
@@ -66,7 +66,7 @@ private: // attributes
QHash<int, int> m_mountingPointAssetsMap; ///< Hold all available structure element ids for meteo data units (key == assetId)
QHash<int, InfrastructureManagement::MainStructureElement> m_mainStructureElements;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace MeteoDataManagement
@@ -24,7 +24,6 @@ HandlerMeteoDataUnit::HandlerMeteoDataUnit(MainHandler *mainHandler,
, m_mainHandler(mainHandler)
, m_asset(asset)
, m_tcpWS(nullptr)
, m_logger(getLogger("HandlerMeteoDataUnit"))
{
init();
} // end of ctor()
@@ -44,7 +43,7 @@ bool HandlerMeteoDataUnit::init()
if (jError.error != QJsonParseError::NoError ||
!doc.isObject())
{
ERROR_LOG(m_logger) << "Can not initialize meteo data unit - properties are not parsable: "
ERROR_LOG() << "Can not initialize meteo data unit - properties are not parsable: "
<< jError.errorString() << " - '" << m_asset.properties() << "'";
return false;
}
@@ -53,7 +52,7 @@ bool HandlerMeteoDataUnit::init()
quint16 windPort = obj[QStringLiteral("windPort")].toInt();
if (climatePort == 0 || windPort == 0)
{
ERROR_LOG(m_logger) << "Can not parse climate and/or wind port from properties: '" <<
ERROR_LOG() << "Can not parse climate and/or wind port from properties: '" <<
m_asset.properties() << "'";
return false;
}
@@ -136,10 +135,10 @@ void HandlerMeteoDataUnit::onPublishData()
ddsData = m_newMeteoData;
ddsData.timeStamp(m_mainHandler->dds()->currentPartitionTime());
INFO_LOG(m_logger) << "Publish dynamic MeteoData to dds: " << ddsData;
INFO_LOG() << "Publish dynamic MeteoData to dds: " << ddsData;
if (!m_mainHandler->dds()->dts()->publish(ddsData))
ERROR_LOG(m_logger) << "Error publishing MdmMeteoData to dds";
ERROR_LOG() << "Error publishing MdmMeteoData to dds";
} // end of onPublishData()
//-----------------------------------------------------------------------------
@@ -59,7 +59,7 @@ private:
TcpWeatherStation *m_tcpWS; ///< Pointer to tcp based meteo data unit
MeteoDataManagement::MeteoData m_lastMeteoData; ///< last received meteo data
MeteoDataManagement::MeteoData m_newMeteoData; ///< new received meteo data
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace MeteoDataManagement
@@ -16,7 +16,6 @@ namespace MeteoDataManagement
HandlerMeteoDataUnits::HandlerMeteoDataUnits(MainHandler *mainHandler)
: m_mainHandler(mainHandler)
, m_logger(getLogger("HandlerMeteoDataUnits"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -29,7 +28,7 @@ HandlerMeteoDataUnits::~HandlerMeteoDataUnits()
bool HandlerMeteoDataUnits::init()
{
INFO_LOG(m_logger) << "HandlerMeteoDataUnits::init().... Initialisation of MDU's will be started from ISM directly. ";
INFO_LOG() << "HandlerMeteoDataUnits::init().... Initialisation of MDU's will be started from ISM directly. ";
return true;
} // end of init()
@@ -37,7 +36,7 @@ bool HandlerMeteoDataUnits::init()
bool HandlerMeteoDataUnits::addMeteoDataUnit(const InfrastructureManagement::InstrumentationAsset &asset)
{
INFO_LOG(m_logger) << "addMeteoDataUnit: " << asset;
INFO_LOG() << "addMeteoDataUnit: " << asset;
removeMeteoDataUnit(asset); // just to be sure
HandlerMeteoDataUnit *hMDU = new HandlerMeteoDataUnit(m_mainHandler, asset);
@@ -49,7 +48,7 @@ bool HandlerMeteoDataUnits::addMeteoDataUnit(const InfrastructureManagement::Ins
bool HandlerMeteoDataUnits::removeMeteoDataUnit(const InfrastructureManagement::InstrumentationAsset &asset)
{
INFO_LOG(m_logger) << "removeMeteoDataUnit: " << asset;
INFO_LOG() << "removeMeteoDataUnit: " << asset;
auto it = m_handlerMeteoDataUnitsMap.find(asset.id());
if (it == m_handlerMeteoDataUnitsMap.end())
return false;
@@ -30,7 +30,7 @@ public:
private:
QMap <int, HandlerMeteoDataUnit *> m_handlerMeteoDataUnitsMap; ///< Hold all meteo data unit handler
MainHandler *m_mainHandler; ///< Pointer to DDS handler
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace MeteoDataManagement
@@ -15,30 +15,29 @@ HandlerStaticMeteoData::HandlerStaticMeteoData(const std::shared_ptr<DdsHandler>
: StaticMeteoDataModifyRequestHandler(ddsHandler->fts())
, m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("HandlerStaticMeteoData"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
bool HandlerStaticMeteoData::init()
{
INFO_LOG(m_logger) << "Start HandlerStaticMeteoData.";
INFO_LOG() << "Start HandlerStaticMeteoData.";
// read data from db-table 'mdm_static_meteo_data'
QVector<Database::MdmStaticMeteoData> dataVec;
if (!m_db->select(dataVec))
{
ERROR_LOG(m_logger) << "Error reading data from database 'mdm_static_meteo_data'!";
ERROR_LOG() << "Error reading data from database 'mdm_static_meteo_data'!";
return false;
}
if (dataVec.isEmpty())
{
WARNING_LOG(m_logger) << "DB table 'mdm_static_meteo_data' is empty! Try to create default entry.";
WARNING_LOG() << "DB table 'mdm_static_meteo_data' is empty! Try to create default entry.";
if (!insertDefaultStaticMeteoDataEntry())
{
ERROR_LOG(m_logger) << "Insert DB table 'mdm_static_meteo_data' failed! No static meteo data may be handled!";
ERROR_LOG() << "Insert DB table 'mdm_static_meteo_data' failed! No static meteo data may be handled!";
return false; // Damit werden alle moeglicherweise erreichbaren MDU's nicht bearbeitet,
// da die Initialisierung des Service im 'SCM' mit Error beendet wird.
}
@@ -48,7 +47,7 @@ bool HandlerStaticMeteoData::init()
m_dbStaticMeteoData.timeStamp = QDateTime::currentMSecsSinceEpoch();
INFO_LOG(m_logger) << "Insert into DB table 'mdm_static_meteo_data' successfully. id: "
INFO_LOG() << "Insert into DB table 'mdm_static_meteo_data' successfully. id: "
<< m_dbStaticMeteoData.id;
onPublishData();
@@ -57,7 +56,7 @@ bool HandlerStaticMeteoData::init()
if (dataVec.size() > 1)
{
WARNING_LOG(m_logger) << "Invalid number of table entries for 'mdm_static_meteo_data' size:"
WARNING_LOG() << "Invalid number of table entries for 'mdm_static_meteo_data' size:"
<< dataVec.size()
<< " The first entry will be used only!";
}
@@ -71,7 +70,7 @@ bool HandlerStaticMeteoData::init()
void HandlerStaticMeteoData::onStaticMeteoDataModifyRequest(const rti::core::SampleIdentity &cookie,
const StaticMeteoDataModifyRequest &request)
{
INFO_LOG(m_logger) << "onStaticMeteoDataModifyRequest: " << request;
INFO_LOG() << "onStaticMeteoDataModifyRequest: " << request;
Core::FunctionReplyObject rep(request.id());
@@ -94,7 +93,7 @@ bool HandlerStaticMeteoData::updateStaticMeteoDatainDB(const StaticMeteoDataModi
{
if (request.id() != m_dbStaticMeteoData.id)
{
WARNING_LOG(m_logger) << "Invalid id for db-table 'mdm_static_meteo_data'"
WARNING_LOG() << "Invalid id for db-table 'mdm_static_meteo_data'"
<< m_dbStaticMeteoData.id
<< " correct id: " << m_dbStaticMeteoData.id;
return false;
@@ -120,10 +119,10 @@ void HandlerStaticMeteoData::onPublishData()
ddsData.note(note);
ddsData.weatherStationId(ddsData.id()); // MDUid == dbId
INFO_LOG(m_logger) << "Publish static MeteoData to dds: " << ddsData;
INFO_LOG() << "Publish static MeteoData to dds: " << ddsData;
if (!m_ddsHandler->dts()->publish(ddsData))
ERROR_LOG(m_logger) << "Error publishing static MdmMeteoData to dds";
ERROR_LOG() << "Error publishing static MdmMeteoData to dds";
} // end of onPublishData()
//-----------------------------------------------------------------------------
@@ -142,7 +141,7 @@ bool HandlerStaticMeteoData::insertDefaultStaticMeteoDataEntry()
if (!m_db->insert(dbData))
{
ERROR_LOG(m_logger) << "insertDefaultStaticMeteoDataEntry for db-table 'mdm_static_meteo_data' failed!";
ERROR_LOG() << "insertDefaultStaticMeteoDataEntry for db-table 'mdm_static_meteo_data' failed!";
return false;
}
return true;
@@ -44,8 +44,6 @@ private: // attributes
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DatabaseInterface> m_db;
Database::MdmStaticMeteoData m_dbStaticMeteoData;
NGL::INGLLogger &m_logger;
};
} // namespace MeteoDataManagement
@@ -9,7 +9,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "mdm_export.h"
#include "svcmdmcommon_export.h"
namespace MeteoDataManagement
{
@@ -23,7 +23,6 @@ MainHandler::MainHandler()
, m_handlerInfrastructureData(nullptr)
, m_handlerStaticMeteoData(nullptr)
, m_gnaService(nullptr)
, m_logger(getLogger("MainHandler"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -41,17 +40,17 @@ MainHandler::~MainHandler()
bool MainHandler::init(int domainId)
{
INFO_LOG(m_logger) << "Start MeteoDataManagement MainHandler.";
INFO_LOG() << "Start MeteoDataManagement MainHandler.";
const QString errStr = initInternal(domainId);
if (!errStr.isEmpty())
{
ERROR_LOG(m_logger) << errStr;
ERROR_LOG() << errStr;
if (m_ddsHandler && m_ddsHandler->pacemaker())
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError, errStr);
return false;
}
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
INFO_LOG(m_logger) << "MeteoDataManagement MainHandler initialized.";
INFO_LOG() << "MeteoDataManagement MainHandler initialized.";
return true;
}
@@ -69,7 +68,7 @@ QString MainHandler::initInternal(int domainId)
return QStringLiteral("Initialisation DbHandler failed.");
// create HandlerMeteoDataUnits
INFO_LOG(m_logger) << "create HandlerMeteoDataUnits.";
INFO_LOG() << "create HandlerMeteoDataUnits.";
m_handlerMeteoDataUnits = std::make_shared<HandlerMeteoDataUnits>(this);
if (!m_handlerMeteoDataUnits->init())
return QStringLiteral("create HandlerMeteoDataUnits failed.");
@@ -50,6 +50,6 @@ private: // attributes
std::shared_ptr<HandlerStaticMeteoData> m_handlerStaticMeteoData; ///< Pointer to static meteo data handler
GuezNasat::Initialization *m_gnaService;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace MeteoDataManagement
@@ -26,7 +26,7 @@ TcpSocket::TcpSocket(const char *logName, QObject *parent)
, m_bSocketErrorWarnedOnce(false)
, m_logger(getLogger(logName))
{
DEBUG_LOG(m_logger) << "CTOR TCP-Socket... " ;
DEBUG_LOG() << "CTOR TCP-Socket... " ;
doConnect();
}
@@ -43,7 +43,7 @@ TcpSocket::~TcpSocket()
void TcpSocket::doConnect()
{
DEBUG_LOG(m_logger) << "doConnect TCP-Socket " ;
DEBUG_LOG() << "doConnect TCP-Socket " ;
if (m_socket)
m_socket->deleteLater();
@@ -60,7 +60,7 @@ void TcpSocket::doConnect()
if (m_tryReconnect)
{
INFO_LOG(m_logger) << "Try reconnect to host " << m_hostName
INFO_LOG() << "Try reconnect to host " << m_hostName
<< ":" << m_hostPort;
m_socket->connectToHost(m_hostName, m_hostPort);
}
@@ -69,7 +69,7 @@ void TcpSocket::doConnect()
void TcpSocket::start(const QString &hostName, quint16 port)
{
INFO_LOG(m_logger) << "Try connect to host: " << hostName
INFO_LOG() << "Try connect to host: " << hostName
<< ": " << port;
m_hostName = hostName;
@@ -81,7 +81,7 @@ void TcpSocket::start(const QString &hostName, quint16 port)
void TcpSocket::onConnected()
{
INFO_LOG(m_logger) << "Connected to "
INFO_LOG() << "Connected to "
<< m_socket->peerAddress().toString()
<< ":" << m_socket->peerPort();
m_bSocketErrorWarnedOnce = false;
@@ -95,46 +95,46 @@ void TcpSocket::onConnected()
// Das Setzen der Systemvariablen war ebenfalls ohne Auswirkung.
// Da diese Programmteile unter Windows eh so nicht zu uebersetzen sind, ist der Codeteil hier in Kommentar gesetzt.
// INFO_LOG(m_logger) << "----Set TCP_KEEPIDLE parameter ";
// INFO_LOG() << "----Set TCP_KEEPIDLE parameter ";
// const int keepAliveOption = 1; // on
// if (setsockopt(m_socket->socketDescriptor(), SOL_SOCKET, SO_KEEPALIVE, &keepAliveOption, sizeof(keepAliveOption)) != 0)
// {
// ERROR_LOG(m_logger) << "Error setting SO_KEEPALIVE: " << errno;
// ERROR_LOG() << "Error setting SO_KEEPALIVE: " << errno;
// }
// const int idleTimeout = 5; // sec
// if (setsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPIDLE, &idleTimeout, sizeof(idleTimeout)) != 0)
// {
// ERROR_LOG(m_logger) << "Error setting TCP_KEEPIDLE: " << errno;
// ERROR_LOG() << "Error setting TCP_KEEPIDLE: " << errno;
// }
// const int keepIntervalCnt = 10; // sec
// if (setsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPINTVL, &keepIntervalCnt, sizeof(keepIntervalCnt)) != 0)
// {
// ERROR_LOG(m_logger) << "Error setting TCP_KEEPINTVL: " << errno;
// ERROR_LOG() << "Error setting TCP_KEEPINTVL: " << errno;
// }
// const int idlePaketCnt = 2; // 2 probes -> detection shoud be comes after 5s + 2 * 10s => 25 sec
// if (setsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPCNT, &idlePaketCnt, sizeof(idlePaketCnt)) != 0)
// {
// ERROR_LOG(m_logger) << "Error setting TCP_KEEPCNT: " << errno;
// ERROR_LOG() << "Error setting TCP_KEEPCNT: " << errno;
// }
// //----- Testausgaben
// int getOption = 0;
// socklen_t optlen = sizeof(getOption);
// getsockopt(m_socket->socketDescriptor(), SOL_SOCKET, SO_KEEPALIVE, &getOption, &optlen);
// ERROR_LOG(m_logger) << "...SO_KEEPALIVE set to: " << getOption;
// ERROR_LOG() << "...SO_KEEPALIVE set to: " << getOption;
// getsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPIDLE, &getOption, &optlen);
// ERROR_LOG(m_logger) << "...TCP_KEEPIDLE set to: " << getOption;
// ERROR_LOG() << "...TCP_KEEPIDLE set to: " << getOption;
// getsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPINTVL, &getOption, &optlen);
// ERROR_LOG(m_logger) << "...TCP_KEEPINTVL set to: " << getOption;
// ERROR_LOG() << "...TCP_KEEPINTVL set to: " << getOption;
// getsockopt(m_socket->socketDescriptor(), SOL_TCP, TCP_KEEPCNT, &getOption, &optlen);
// ERROR_LOG(m_logger) << "...TCP_KEEPCNT set to: " << getOption;
// ERROR_LOG() << "...TCP_KEEPCNT set to: " << getOption;
init(); // pure virtual function
// Auspraegung mit spezieller Sensorinitialisierung durchfuehren
@@ -143,14 +143,14 @@ void TcpSocket::onConnected()
void TcpSocket::onDisonnected()
{
INFO_LOG(m_logger) << "Disconnected from " << m_socket->peerAddress().toString()
INFO_LOG() << "Disconnected from " << m_socket->peerAddress().toString()
<< ":" << m_socket->peerPort();
}
//-------------------------------------------------------------------
void TcpSocket::onError(QAbstractSocket::SocketError err)
{
ERROR_LOG(m_logger) << "Socket error: " << err
ERROR_LOG() << "Socket error: " << err
<< " \"" << m_socket->errorString() << "\""
<< " Hostname: " << m_hostName
<< " Serial Port:" << m_hostPort
@@ -178,7 +178,7 @@ void TcpSocket::onReadyRead()
while (m_socket->canReadLine())
{
const QByteArray line = m_socket->readLine();
DEBUG_LOG(m_logger) << "Read line from sensor: " << line;
DEBUG_LOG() << "Read line from sensor: " << line;
dataAvailable(line); // pure virtual function
// Auspraegung mit spezieller Sensordatenauswertung durchfuehren
@@ -190,14 +190,14 @@ bool TcpSocket::sendCommand(const QByteArray &qba)
{
bool bOk = true;
INFO_LOG(m_logger) << "Send command: " << qba;
INFO_LOG() << "Send command: " << qba;
if (m_socket->state() != QTcpSocket::ConnectedState)
{
if (m_bSocketErrorWarnedOnce)
{
m_bSocketErrorWarnedOnce = true;
WARNING_LOG(m_logger) << "Error on sendCommand(). No socket connection estabilished."
WARNING_LOG() << "Error on sendCommand(). No socket connection estabilished."
<< " Hostname: " << m_hostName;
}
return false;
@@ -208,7 +208,7 @@ bool TcpSocket::sendCommand(const QByteArray &qba)
if (trxBytes != qba.size())
{
bOk = false;
ERROR_LOG(m_logger) << "Insufficient number of tansfered bytes."
ERROR_LOG() << "Insufficient number of tansfered bytes."
<< " Soll: " << trxBytes << " Ist: " << qba.size();
}
m_socket->flush();
@@ -64,7 +64,6 @@ protected:
QTcpSocket *m_socket; ///< pointer to tcpsocket object
bool m_tryReconnect; ///< if true, try reconnection
bool m_bSocketErrorWarnedOnce;
NGL::INGLLogger &m_logger;
};
} // namespace MeteoDataManagement
@@ -33,9 +33,8 @@ TcpWeatherStation::TcpWeatherStation(int id,
, m_speed(0.0)
, m_climateOk(false)
, m_windOk(false)
, m_logger(getLogger("TcpWeatherStation"))
{
INFO_LOG(m_logger) << "Start TcpWeatherStation ip/(hostname): " << m_converterIp
INFO_LOG() << "Start TcpWeatherStation ip/(hostname): " << m_converterIp
<< " climatePort: " << m_climatePort
<< " windPort: " << m_windPort;
@@ -43,7 +42,7 @@ TcpWeatherStation::TcpWeatherStation(int id,
{
m_tcpClimate = new TcpClimate(this);
INFO_LOG(m_logger) << "m_tcpClimate->start(" << m_converterIp << ", "
INFO_LOG() << "m_tcpClimate->start(" << m_converterIp << ", "
<< QString::number(m_climatePort) << ")";
m_tcpClimate->start(m_converterIp, m_climatePort);
@@ -55,7 +54,7 @@ TcpWeatherStation::TcpWeatherStation(int id,
{
m_tcpWind = new TcpWind(this);
INFO_LOG(m_logger) << "m_tcpWind->start(" << m_converterIp << ", "
INFO_LOG() << "m_tcpWind->start(" << m_converterIp << ", "
<< QString::number(m_windPort) << ")";
m_tcpWind->start(m_converterIp, m_windPort);
@@ -69,7 +68,7 @@ TcpWeatherStation::TcpWeatherStation(int id,
void TcpWeatherStation::onClimateDataChanged(float pressure, float temperature, float humidity, bool climateOk)
{
INFO_LOG(m_logger) << "onClimateDataChanged()"
INFO_LOG() << "onClimateDataChanged()"
<< " MDU AssetId: " << m_id
<< " pressure: " << pressure
<< " temperature: " << temperature
@@ -88,7 +87,7 @@ void TcpWeatherStation::onClimateDataChanged(float pressure, float temperature,
void TcpWeatherStation::onWindDataChanged(float direction, float speed, bool windOk)
{
INFO_LOG(m_logger) << "onWindDataChanged()"
INFO_LOG() << "onWindDataChanged()"
<< " MDU AssetId: " << m_id
<< " direction: " << direction
<< " speed: " << speed
@@ -85,6 +85,5 @@ protected:
float m_speed; ///< last speed value from wind sensor
bool m_climateOk; ///< last statecheck climate
bool m_windOk; ///< last statecheck weather
NGL::INGLLogger &m_logger;
};
} // namespace MeteoDataManagement