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:
2785 files changed
+18754
-18316
No files matched your search
+7
-7
@@ -36,7 +36,7 @@ bool ClientConnection::init()
|
||||
{
|
||||
if (m_socket == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Initialisation failed due to an invalid socket";
|
||||
ERROR_LOG() << "Initialisation failed due to an invalid socket";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,17 +57,17 @@ void ClientConnection::addMessage(const WarehouseGuez::WsBiteInterface::Messages
|
||||
if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState)
|
||||
{
|
||||
m_messageQueue.enqueue(message);
|
||||
DEBUG_LOG(m_logger) << "Adding message to queue, size: " << m_messageQueue.size();
|
||||
DEBUG_LOG() << "Adding message to queue, size: " << m_messageQueue.size();
|
||||
return;
|
||||
}
|
||||
const QString msg(message.toJsonString());
|
||||
TRACE_LOG(m_logger) << "Send msg: " << msg;
|
||||
TRACE_LOG() << "Send msg: " << msg;
|
||||
m_socket->sendTextMessage(msg);
|
||||
}
|
||||
|
||||
void ClientConnection::onNewTextMessageFromSocket(const QString &message)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Recv msg: " << message;
|
||||
DEBUG_LOG() << "Recv msg: " << message;
|
||||
emit newTextMessage(this, message);
|
||||
}
|
||||
|
||||
@@ -79,15 +79,15 @@ void ClientConnection::sendMessagesFromQueue()
|
||||
{
|
||||
Messages::ReplyMessage message = m_messageQueue.dequeue();
|
||||
const QString msg(message.toJsonString());
|
||||
TRACE_LOG(m_logger) << "Send msg: " << msg;
|
||||
TRACE_LOG() << "Send msg: " << msg;
|
||||
m_socket->sendTextMessage(msg);
|
||||
DEBUG_LOG(m_logger) << "Sent message from queue, new size: " << m_messageQueue.size();
|
||||
DEBUG_LOG() << "Sent message from queue, new size: " << m_messageQueue.size();
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::onSocketDisconnect()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Client with ip "
|
||||
DEBUG_LOG() << "Client with ip "
|
||||
<< m_ip.toString()
|
||||
<< " disconnected";
|
||||
emit disconnected(this);
|
||||
|
||||
-2
@@ -52,8 +52,6 @@ private: // attributes
|
||||
QWebSocket *m_socket;
|
||||
QQueue<Messages::ReplyMessage> m_messageQueue;
|
||||
QHostAddress m_ip;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
}; // class ClientConnection
|
||||
} // namespace Connection
|
||||
} // namespace WsBiteInterface
|
||||
|
||||
+6
-7
@@ -21,7 +21,6 @@ using namespace WarehouseGuez::WsBiteInterface::Connection;
|
||||
|
||||
ConnectionHandler::ConnectionHandler()
|
||||
: m_server(nullptr)
|
||||
, m_logger(getLogger("ConnectionHandler"))
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,13 +48,13 @@ bool ConnectionHandler::init()
|
||||
// TODO: read port from config?
|
||||
int port = NGL::Connections::port(NGL::Connections::eConnection::LVS);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Trying to listen to port " << port;
|
||||
DEBUG_LOG() << "Trying to listen to port " << port;
|
||||
if (!m_server->listen(QHostAddress::Any, port))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Not possible to listen to port " << port;
|
||||
ERROR_LOG() << "Not possible to listen to port " << port;
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG(m_logger) << "... ok - port: " << port;
|
||||
DEBUG_LOG() << "... ok - port: " << port;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -67,7 +66,7 @@ void ConnectionHandler::onNewMessage(WarehouseGuez::WsBiteInterface::Messages::M
|
||||
|
||||
void ConnectionHandler::onServerError(QWebSocketProtocol::CloseCode closeCode)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Got server error with close code " << closeCode;
|
||||
ERROR_LOG() << "Got server error with close code " << closeCode;
|
||||
}
|
||||
|
||||
void ConnectionHandler::onNewConnection()
|
||||
@@ -79,7 +78,7 @@ void ConnectionHandler::onNewConnection()
|
||||
|
||||
if (!newConnection->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to initialise new client";
|
||||
ERROR_LOG() << "Failed to initialise new client";
|
||||
delete newConnection;
|
||||
newConnection = nullptr;
|
||||
continue;
|
||||
@@ -89,7 +88,7 @@ void ConnectionHandler::onNewConnection()
|
||||
connect(newConnection, &ClientConnection::disconnected, this, &ConnectionHandler::onDisconnected);
|
||||
|
||||
m_connections.append(newConnection);
|
||||
DEBUG_LOG(m_logger) << "New client with ip " << newConnection->ip().toString() << " connected";
|
||||
DEBUG_LOG() << "New client with ip " << newConnection->ip().toString() << " connected";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-2
@@ -52,8 +52,6 @@ private Q_SLOTS:
|
||||
private: // attributes
|
||||
QWebSocketServer *m_server;
|
||||
QVector<ClientConnection *> m_connections;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace Connection
|
||||
} // namespace WsBiteInterface
|
||||
|
||||
-1
@@ -20,7 +20,6 @@ namespace Messages
|
||||
|
||||
MessageHandler::MessageHandler(DataManager *dataManager)
|
||||
: m_dataManager(dataManager)
|
||||
, m_logger(getLogger("MessageHandler"))
|
||||
{
|
||||
Q_ASSERT(dataManager);
|
||||
}
|
||||
|
||||
-2
@@ -35,8 +35,6 @@ public Q_SLOTS:
|
||||
|
||||
private:
|
||||
DataManager *m_dataManager;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
};
|
||||
} // namespace Messages
|
||||
} // namespace WsBiteInterface
|
||||
|
||||
+22
-22
@@ -44,7 +44,7 @@ DataManager::DataManager(std::shared_ptr<DdsHandler> ddsHandler)
|
||||
m_tabDtc = TrainingAreaBase::Interface::Dtc::create(m_ddsHandler->dds());
|
||||
if (m_tabDtc == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Could not create DTC TrainingAreaBase";
|
||||
ERROR_LOG() << "Could not create DTC TrainingAreaBase";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ DataManager::~DataManager()
|
||||
|
||||
void DataManager::onConnected()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "SCM websocket port connected";
|
||||
DEBUG_LOG() << "SCM websocket port connected";
|
||||
|
||||
connect(m_scmWebSocket, &QWebSocket::textMessageReceived, this, &DataManager::onTextMessageFromScm);
|
||||
|
||||
@@ -81,26 +81,26 @@ void DataManager::onTimerTimeout()
|
||||
|
||||
void DataManager::onTextMessageFromScm(const QString &message)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onTextMessageFromScm from scm: " << message;
|
||||
DEBUG_LOG() << "onTextMessageFromScm from scm: " << message;
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8());
|
||||
const QJsonArray exercises = doc.object().value(DATA()).toArray();
|
||||
for (const QJsonValue &valEx : exercises)
|
||||
{
|
||||
const QJsonObject &exercise = valEx.toObject();
|
||||
const int exerciseId = exercise.value(EXERCISE_ID()).toInt();
|
||||
DEBUG_LOG(m_logger) << "textMessageFromScm from scm - exerciseId " << exerciseId;
|
||||
DEBUG_LOG() << "textMessageFromScm from scm - exerciseId " << exerciseId;
|
||||
|
||||
const QJsonArray services = exercise.value(SERVICES()).toArray();
|
||||
for (const QJsonValue &valSvc : services)
|
||||
{
|
||||
const QJsonObject &service = valSvc.toObject();
|
||||
const QString svcName = service.value(NAME_ABBREVATION()).toString().toUpper();
|
||||
DEBUG_LOG(m_logger) << "textMessageFromScm from scm - svcName " << svcName;
|
||||
DEBUG_LOG() << "textMessageFromScm from scm - svcName " << svcName;
|
||||
|
||||
if (svcName != QStringLiteral("TAB"))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG(m_logger) << "service TAB ";
|
||||
DEBUG_LOG() << "service TAB ";
|
||||
|
||||
const QJsonArray ports = service.value(PORTS()).toArray();
|
||||
for (const QJsonValue &valPort : ports)
|
||||
@@ -110,7 +110,7 @@ void DataManager::onTextMessageFromScm(const QString &message)
|
||||
if (typeId == Core::PortType::WebSocketServer)
|
||||
{
|
||||
int tabPort = port.value(NUMBER()).toInt();
|
||||
DEBUG_LOG(m_logger) << "connect to TAB - port: " << tabPort;
|
||||
DEBUG_LOG() << "connect to TAB - port: " << tabPort;
|
||||
connectToTabWebSocket(tabPort, exerciseId);
|
||||
}
|
||||
}
|
||||
@@ -120,7 +120,7 @@ void DataManager::onTextMessageFromScm(const QString &message)
|
||||
|
||||
void DataManager::onConnectedTab()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "TAB connected";
|
||||
DEBUG_LOG() << "TAB connected";
|
||||
}
|
||||
|
||||
void DataManager::connectToTabWebSocket(int port, int exerciseId)
|
||||
@@ -131,7 +131,7 @@ void DataManager::connectToTabWebSocket(int port, int exerciseId)
|
||||
// Websocket connection already exists?
|
||||
if (tabData.port == port)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Connection to port " << port << " already exists.";
|
||||
INFO_LOG() << "Connection to port " << port << " already exists.";
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -142,7 +142,7 @@ void DataManager::connectToTabWebSocket(int port, int exerciseId)
|
||||
}
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "New connection: exercise: " << exerciseId << ", port: " << port;
|
||||
INFO_LOG() << "New connection: exercise: " << exerciseId << ", port: " << port;
|
||||
|
||||
const QUrl url(QStringLiteral("ws://%1:%2").arg(NGL::Connections::hostName(NGL::Connections::eConnection::SCM_WEBSOCKET)).arg(port));
|
||||
|
||||
@@ -152,7 +152,7 @@ void DataManager::connectToTabWebSocket(int port, int exerciseId)
|
||||
connect(webSocketTab, &QWebSocket::disconnected, this, &DataManager::closedTab);
|
||||
connect(webSocketTab, &QWebSocket::textMessageReceived, this, &DataManager::onTextMessageFromTab);
|
||||
|
||||
DEBUG_LOG(m_logger) << "Trying to connect to TAB at " << url.toString();
|
||||
DEBUG_LOG() << "Trying to connect to TAB at " << url.toString();
|
||||
webSocketTab->open(url);
|
||||
|
||||
TabData data;
|
||||
@@ -168,7 +168,7 @@ void DataManager::onClientDisconnect(Messages::MessageTransmitter *transmitter)
|
||||
{
|
||||
if (ed.transmitter == transmitter)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "removed dead transmitter";
|
||||
DEBUG_LOG() << "removed dead transmitter";
|
||||
ed.transmitter = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -176,13 +176,13 @@ void DataManager::onClientDisconnect(Messages::MessageTransmitter *transmitter)
|
||||
|
||||
void DataManager::onTextMessageFromTab(const QString &message)
|
||||
{
|
||||
INFO_LOG(m_logger) << "onTextMessageFromTab : " << message;
|
||||
INFO_LOG() << "onTextMessageFromTab : " << message;
|
||||
const QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8());
|
||||
|
||||
if (doc.object().value(TYPE()) != BITE_DATA() && doc.object().value(TYPE()) != POSITION_DATA())
|
||||
return;
|
||||
|
||||
INFO_LOG(m_logger) << "TYPE: " << doc.object().value(TYPE()).toString();
|
||||
INFO_LOG() << "TYPE: " << doc.object().value(TYPE()).toString();
|
||||
|
||||
QJsonObject data = doc.object().value(DATA()).toObject();
|
||||
|
||||
@@ -190,7 +190,7 @@ void DataManager::onTextMessageFromTab(const QString &message)
|
||||
|
||||
int equipNo = data.value(EQUIP_NO()).toInt();
|
||||
|
||||
INFO_LOG(m_logger) << "equipNo: " << equipNo;
|
||||
INFO_LOG() << "equipNo: " << equipNo;
|
||||
if (equipNo <= 0)
|
||||
return;
|
||||
|
||||
@@ -200,7 +200,7 @@ void DataManager::onTextMessageFromTab(const QString &message)
|
||||
if (doc.object().value(TYPE()) == POSITION_DATA())
|
||||
{
|
||||
m_equipDataMap[equipNo].lastPositionUpdate = data.value(LAST_POSITION_UPDATE()).toDouble();
|
||||
INFO_LOG(m_logger) << "lastPosUpdate: " << m_equipDataMap[equipNo].lastPositionUpdate;
|
||||
INFO_LOG() << "lastPosUpdate: " << m_equipDataMap[equipNo].lastPositionUpdate;
|
||||
}
|
||||
|
||||
if (m_equipDataMap[equipNo].boxId >= 0)
|
||||
@@ -209,7 +209,7 @@ void DataManager::onTextMessageFromTab(const QString &message)
|
||||
|
||||
if (transmitter == nullptr)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "transmitter for eqId " << equipNo << " no longer available";
|
||||
ERROR_LOG() << "transmitter for eqId " << equipNo << " no longer available";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ void DataManager::onTextMessageFromTab(const QString &message)
|
||||
biteData.insert(BOX(), boxId);
|
||||
biteData.insert(LAST_POSITION_UPDATE(), m_equipDataMap[equipNo].lastPositionUpdate);
|
||||
transmitter->addMessage(Messages::BiteDataMessage(biteData, m_equipDataMap[equipNo].uuid));
|
||||
INFO_LOG(m_logger) << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo;
|
||||
INFO_LOG() << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo;
|
||||
if (boxId == 0)
|
||||
boxId = -1; // only single request
|
||||
}
|
||||
@@ -226,7 +226,7 @@ void DataManager::onTextMessageFromTab(const QString &message)
|
||||
|
||||
void DataManager::setEquipNoBoxId(int equipNo, int boxId, Messages::MessageTransmitter *transmitter, const QString &uuid)
|
||||
{
|
||||
INFO_LOG(m_logger) << "equipNo: " << equipNo << ", boxId = " << boxId;
|
||||
INFO_LOG() << "equipNo: " << equipNo << ", boxId = " << boxId;
|
||||
|
||||
// erase abonnement, no further biteData telegrams
|
||||
if (equipNo == 0)
|
||||
@@ -259,7 +259,7 @@ void DataManager::setEquipNoBoxId(int equipNo, int boxId, Messages::MessageTrans
|
||||
data.insert(BOX(), boxId);
|
||||
data.insert(LAST_POSITION_UPDATE(), equipData.lastPositionUpdate);
|
||||
transmitter->addMessage(Messages::BiteDataMessage(data, equipData.uuid));
|
||||
INFO_LOG(m_logger) << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo;
|
||||
INFO_LOG() << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -273,7 +273,7 @@ void DataManager::setEquipNoBoxId(int equipNo, int boxId, Messages::MessageTrans
|
||||
equipData.biteMessage = data;
|
||||
|
||||
transmitter->addMessage(Messages::BiteDataMessage(data, equipData.uuid));
|
||||
INFO_LOG(m_logger) << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo << ", lastUpdate 0";
|
||||
INFO_LOG() << "Send Message with boxId: " << boxId << ", equipNo: " << equipNo << ", lastUpdate 0";
|
||||
|
||||
// send bite request
|
||||
QJsonObject biteData;
|
||||
@@ -283,7 +283,7 @@ void DataManager::setEquipNoBoxId(int equipNo, int boxId, Messages::MessageTrans
|
||||
biteData.insert(UUID_(), QUuid::createUuid().toString());
|
||||
|
||||
QString message = QString::fromStdString(QJsonDocument(biteData).toJson(QJsonDocument::Compact).toStdString());
|
||||
INFO_LOG(m_logger) << "message: " << message;
|
||||
INFO_LOG() << "message: " << message;
|
||||
for (TabData dataTab : m_tabWebSocketMap)
|
||||
dataTab.websocket->sendTextMessage(message);
|
||||
|
||||
|
||||
-2
@@ -92,8 +92,6 @@ private: // attributes
|
||||
std::shared_ptr<DdsHandler> m_ddsHandler;
|
||||
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_tabDtc; ///< Pointer to DTC Training Area Base interface object
|
||||
QTimer *m_timer = nullptr;
|
||||
|
||||
LOGGER_T m_logger;
|
||||
}; // class DataManager
|
||||
} // namespace WsBiteInterface
|
||||
} // namespace WarehouseGuez
|
||||
+1
-2
@@ -23,7 +23,6 @@ WsBiteInterfaceHandler::WsBiteInterfaceHandler(DataManager *dataManager)
|
||||
: m_dataManager(dataManager)
|
||||
, m_connectionHandler(nullptr)
|
||||
, m_messageHandler(nullptr)
|
||||
, m_logger(getLogger("WsBiteInterfaceHandler"))
|
||||
{
|
||||
Q_ASSERT(dataManager);
|
||||
}
|
||||
@@ -41,7 +40,7 @@ bool WsBiteInterfaceHandler::init()
|
||||
m_connectionHandler = new Connection::ConnectionHandler;
|
||||
if (!m_connectionHandler->init())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to initialise ConnectionHandler";
|
||||
ERROR_LOG() << "Failed to initialise ConnectionHandler";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user