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
+49
-49
@@ -90,7 +90,7 @@ LtsWebSocket::ReplyMessage *DataManager::equipmentTypes(const QString &uuid) con
|
||||
|
||||
|
||||
QJsonObject obj = eTypes.toJsonAll();
|
||||
INFO_LOG(m_logger) << "equipTypeMap.size: " << etMap.size() << ", " << QJsonDocument(obj).toJson();
|
||||
INFO_LOG() << "equipTypeMap.size: " << etMap.size() << ", " << QJsonDocument(obj).toJson();
|
||||
return new EquipmentTypesMessage(obj, uuid);
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ void DataManager::newExerciseInformationsFromEXCON(const EXCON::Exercises &ex)
|
||||
{
|
||||
const IWMS2ECC::exerciseMap exMap = ex.getExercises();
|
||||
|
||||
DEBUG_LOG(m_logger) << "Exercises map.size: " << exMap.size();
|
||||
DEBUG_LOG() << "Exercises map.size: " << exMap.size();
|
||||
|
||||
QVector<Database::Exercise> dataVec;
|
||||
m_mainHandler->db()->select(dataVec);
|
||||
@@ -121,7 +121,7 @@ void DataManager::newExerciseInformationsFromEXCON(const EXCON::Exercises &ex)
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while insert/update in exercise";
|
||||
ERROR_LOG() << "Error while insert/update in exercise";
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -175,15 +175,15 @@ void DataManager::participantsFromEXCON(const PlayerInfo &pl)
|
||||
|
||||
if (plMap.isEmpty())
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "No valid exercise -> no participants";
|
||||
DEBUG_LOG() << "No valid exercise -> no participants";
|
||||
return;
|
||||
}
|
||||
|
||||
// first get exerciseId
|
||||
int exerciseId = plMap.firstKey() / s_exerciseOffset;
|
||||
|
||||
DEBUG_LOG(m_logger) << "ExerciseId: " << exerciseId;
|
||||
DEBUG_LOG(m_logger) << "plMap.size(): " << plMap.size();
|
||||
DEBUG_LOG() << "ExerciseId: " << exerciseId;
|
||||
DEBUG_LOG() << "plMap.size(): " << plMap.size();
|
||||
|
||||
// table is created at exercise creation
|
||||
QString tlnOut = tlnTable(exerciseId);
|
||||
@@ -192,28 +192,28 @@ void DataManager::participantsFromEXCON(const PlayerInfo &pl)
|
||||
|
||||
// If entries exist delete them
|
||||
QString stmt = QStringLiteral("DELETE FROM ") + tlnOut;
|
||||
DEBUG_LOG(m_logger) << "Executing delete statement: " << stmt;
|
||||
DEBUG_LOG() << "Executing delete statement: " << stmt;
|
||||
q.exec(stmt);
|
||||
|
||||
stmt = QStringLiteral("INSERT INTO ") + tlnOut + QStringLiteral("( id, hierarchie, typ_id, ausstg_typ_id, ausstg_nr, zuordnung, y_nr, info, loeschkennung, zeit ) VALUES (" )
|
||||
+ QStringLiteral(":id, :hierarchie, :typ_id, :ausstg_typ_id, :ausstg_nr, :zuordnung, :y_nr, :info, :loeschkennung, :zeit )");
|
||||
|
||||
DEBUG_LOG(m_logger) << "Preparing insert statement: " << stmt;
|
||||
DEBUG_LOG() << "Preparing insert statement: " << stmt;
|
||||
q.prepare(stmt);
|
||||
|
||||
for (const IWMS2ECC::PlayerInfo &pl : plMap)
|
||||
{
|
||||
bindPlayer(q, pl);
|
||||
DEBUG_LOG(m_logger) << "Executing insert statement for participant: " << pl.playerId;
|
||||
DEBUG_LOG() << "Executing insert statement for participant: " << pl.playerId;
|
||||
|
||||
if (!q.exec())
|
||||
ERROR_LOG(m_logger) << "Error inserting data for participantId: " << pl.playerId;
|
||||
ERROR_LOG() << "Error inserting data for participantId: " << pl.playerId;
|
||||
}
|
||||
}
|
||||
|
||||
bool DataManager::participantFromEXCON(const IWMS2ECC::PlayerInfo &pl, int modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "IN participantFromEXCON: modType: " << modType << ", participantId: " << pl.playerId;
|
||||
DEBUG_LOG() << "IN participantFromEXCON: modType: " << modType << ", participantId: " << pl.playerId;
|
||||
|
||||
DataModification modificationType = static_cast<DataModification>(modType);
|
||||
int exerciseId = pl.playerId / s_exerciseOffset;
|
||||
@@ -221,7 +221,7 @@ bool DataManager::participantFromEXCON(const IWMS2ECC::PlayerInfo &pl, int modTy
|
||||
|
||||
NSqlQuery q(m_mainHandler->db()->database());
|
||||
|
||||
DEBUG_LOG(m_logger) << "Executing delete statement: " << QStringLiteral("DELETE FROM %1 WHERE id = %2").arg(tlnOut).arg(pl.playerId);
|
||||
DEBUG_LOG() << "Executing delete statement: " << QStringLiteral("DELETE FROM %1 WHERE id = %2").arg(tlnOut).arg(pl.playerId);
|
||||
q.exec(QStringLiteral("DELETE FROM %1 WHERE id = %2").arg(tlnOut).arg(pl.playerId));
|
||||
|
||||
switch(modificationType)
|
||||
@@ -234,16 +234,16 @@ bool DataManager::participantFromEXCON(const IWMS2ECC::PlayerInfo &pl, int modTy
|
||||
QStringLiteral(":id, :hierarchie, :typ_id, :ausstg_typ_id, :ausstg_nr, :zuordnung, :y_nr, :info, :loeschkennung, :zeit )");
|
||||
if (!q.prepare(stmt))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while preparing insert stmt: " << stmt;
|
||||
ERROR_LOG() << "Error while preparing insert stmt: " << stmt;
|
||||
return false;
|
||||
}
|
||||
|
||||
bindPlayer(q, pl);
|
||||
DEBUG_LOG(m_logger) << "Executing insert statement: " << stmt;
|
||||
DEBUG_LOG() << "Executing insert statement: " << stmt;
|
||||
|
||||
if (!q.exec())
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error inserting data for participantId: " << pl.playerId;
|
||||
ERROR_LOG() << "Error inserting data for participantId: " << pl.playerId;
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
@@ -257,7 +257,7 @@ bool DataManager::participantFromEXCON(const IWMS2ECC::PlayerInfo &pl, int modTy
|
||||
|
||||
bool DataManager::exerciseChanged(const IWMS2ECC::Exercise &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "IN exerciseChanged: id = " << data.id << ", actExercise: " << data.actExercise;
|
||||
DEBUG_LOG() << "IN exerciseChanged: id = " << data.id << ", actExercise: " << data.actExercise;
|
||||
|
||||
Database::Exercise exData;
|
||||
exData.id = data.id;
|
||||
@@ -276,7 +276,7 @@ bool DataManager::exerciseChanged(const IWMS2ECC::Exercise &data, DataModificati
|
||||
{
|
||||
if (!m_mainHandler->db()->update(exData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while updating exerciseData for exercise: " << data.id;
|
||||
ERROR_LOG() << "Error while updating exerciseData for exercise: " << data.id;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -284,7 +284,7 @@ bool DataManager::exerciseChanged(const IWMS2ECC::Exercise &data, DataModificati
|
||||
{
|
||||
if (!m_mainHandler->db()->insert(exData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while inserting exerciseData for exercise: " << data.id;
|
||||
ERROR_LOG() << "Error while inserting exerciseData for exercise: " << data.id;
|
||||
return false;
|
||||
}
|
||||
createTableTlnOut(exData.id);
|
||||
@@ -296,7 +296,7 @@ bool DataManager::exerciseChanged(const IWMS2ECC::Exercise &data, DataModificati
|
||||
{
|
||||
if (!m_mainHandler->db()->update(exData))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while updating exerciseData for exercise: " << data.id;
|
||||
ERROR_LOG() << "Error while updating exerciseData for exercise: " << data.id;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -305,20 +305,20 @@ bool DataManager::exerciseChanged(const IWMS2ECC::Exercise &data, DataModificati
|
||||
{
|
||||
if (!m_mainHandler->db()->removeExercise(data.id))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error while removing exerciseData for exercise: " << data.id;
|
||||
ERROR_LOG() << "Error while removing exerciseData for exercise: " << data.id;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
ERROR_LOG(m_logger) << "DataModification Type: " << modType << " not handled in switch";
|
||||
ERROR_LOG() << "DataModification Type: " << modType << " not handled in switch";
|
||||
return false;
|
||||
}
|
||||
|
||||
void DataManager::createTableTlnOut(int exerciseId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "createTableTlnOut";
|
||||
ERROR_LOG() << "createTableTlnOut";
|
||||
// xmlPath
|
||||
const QString xmlPath = NGL::directory(NGL::FileType::ConfigFile, QLatin1String("xml"));
|
||||
QString xmlFile = xmlPath + QStringLiteral("/whg.xml");
|
||||
@@ -326,7 +326,7 @@ void DataManager::createTableTlnOut(int exerciseId)
|
||||
CodeGen::SqlGenerator sqlGen(xmlFile);
|
||||
|
||||
QString tlnOut = tlnTable(exerciseId);
|
||||
ERROR_LOG(m_logger) << "tlnOut: " << tlnOut;
|
||||
ERROR_LOG() << "tlnOut: " << tlnOut;
|
||||
|
||||
sqlGen.createStatementsForTable(QStringLiteral("tln"), tlnOut);
|
||||
|
||||
@@ -337,18 +337,18 @@ void DataManager::createTableTlnOut(int exerciseId)
|
||||
NSqlQuery q(m_mainHandler->db()->database());
|
||||
for (const QString &stmt : stmts.createTables)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "stmt: " << stmt;
|
||||
ERROR_LOG() << "stmt: " << stmt;
|
||||
if (record.isEmpty())
|
||||
{
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error executing stmt: " << stmt;
|
||||
ERROR_LOG() << "Error executing stmt: " << stmt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DataManager::createTableTlnZuordnung(int exerciseId)
|
||||
{
|
||||
ERROR_LOG(m_logger) << "in createTableTlnZuordnung";
|
||||
ERROR_LOG() << "in createTableTlnZuordnung";
|
||||
// xmlPath
|
||||
const QString xmlPath = NGL::directory(NGL::FileType::ConfigFile, QLatin1String("xml"));
|
||||
QString xmlFile = xmlPath + QStringLiteral("/whg.xml");
|
||||
@@ -356,7 +356,7 @@ void DataManager::createTableTlnZuordnung(int exerciseId)
|
||||
CodeGen::SqlGenerator sqlGen(xmlFile);
|
||||
|
||||
const QString tlnZuordnung = tlnZuordnungTable(exerciseId);
|
||||
ERROR_LOG(m_logger) << "tlnZuordnung: " << tlnZuordnung;
|
||||
ERROR_LOG() << "tlnZuordnung: " << tlnZuordnung;
|
||||
sqlGen.createStatementsForTable(QStringLiteral("tln_zuordnung"), tlnZuordnung);
|
||||
|
||||
const CodeGen::SqlGenerator::SqlStatements stmts = sqlGen.getStatements(CodeGen::Global);
|
||||
@@ -366,20 +366,20 @@ void DataManager::createTableTlnZuordnung(int exerciseId)
|
||||
NSqlQuery q(m_mainHandler->db()->database());
|
||||
for (const QString &stmt : stmts.createTables)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "stmt: " << stmt;
|
||||
DEBUG_LOG() << "stmt: " << stmt;
|
||||
if (record.isEmpty())
|
||||
{
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error executing stmt: " << stmt;
|
||||
ERROR_LOG() << "Error executing stmt: " << stmt;
|
||||
}
|
||||
}
|
||||
for (const QString &stmt : stmts.createSequences)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "stmt: " << stmt;
|
||||
DEBUG_LOG() << "stmt: " << stmt;
|
||||
if (record.isEmpty())
|
||||
{
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error executing stmt: " << stmt;
|
||||
ERROR_LOG() << "Error executing stmt: " << stmt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ void DataManager::createTriggerForExercise(NSqlQuery &q, int exerciseId)
|
||||
stmt = QLatin1String("DROP TRIGGER IF EXISTS ") + triggerNameExercise +
|
||||
QLatin1String(" ON ") + tlnZuordnungTableExercise;
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error dropping possible old trigger: " << stmt;
|
||||
ERROR_LOG() << "Error dropping possible old trigger: " << stmt;
|
||||
|
||||
// Create trigger
|
||||
stmt = QLatin1String("CREATE OR REPLACE FUNCTION public.") + triggerNameExercise +
|
||||
@@ -408,14 +408,14 @@ void DataManager::createTriggerForExercise(NSqlQuery &q, int exerciseId)
|
||||
"$$ LANGUAGE plpgsql;");
|
||||
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error while creating function in statement: " << stmt;
|
||||
ERROR_LOG() << "Error while creating function in statement: " << stmt;
|
||||
|
||||
stmt = QLatin1String("CREATE TRIGGER ") + triggerNameExercise +
|
||||
QLatin1String(" AFTER INSERT ON ") + tlnZuordnungTableExercise +
|
||||
QLatin1String(" FOR EACH ROW EXECUTE PROCEDURE public.") + triggerNameExercise + QLatin1String("();");
|
||||
|
||||
if (!q.exec(stmt))
|
||||
ERROR_LOG(m_logger) << "Error while creating trigger in statement: " << stmt;
|
||||
ERROR_LOG() << "Error while creating trigger in statement: " << stmt;
|
||||
|
||||
QSqlDriver *driver = m_mainHandler->db()->database().driver();
|
||||
|
||||
@@ -424,14 +424,14 @@ void DataManager::createTriggerForExercise(NSqlQuery &q, int exerciseId)
|
||||
this, &DataManager::onNotification, Qt::UniqueConnection);
|
||||
|
||||
if (!driver->subscribeToNotification(triggerNameExercise))
|
||||
WARNING_LOG(m_logger) << "Error subscribing to DB notification " << triggerNameExercise;
|
||||
WARNING_LOG() << "Error subscribing to DB notification " << triggerNameExercise;
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Sucessfully subscribed to DB notification " << triggerNameExercise;
|
||||
DEBUG_LOG() << "Sucessfully subscribed to DB notification " << triggerNameExercise;
|
||||
}
|
||||
|
||||
void DataManager::onInsertParticipantAssignment(int participantId, int exerciseId)
|
||||
{
|
||||
INFO_LOG(m_logger) << "Reading ParticipantAssignment from database!";
|
||||
INFO_LOG() << "Reading ParticipantAssignment from database!";
|
||||
|
||||
NSqlQuery q(m_mainHandler->db()->database());
|
||||
|
||||
@@ -445,7 +445,7 @@ void DataManager::onInsertParticipantAssignment(int participantId, int exerciseI
|
||||
|
||||
if (!q.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error selecting data for participantId: " << participantId << ", exerciseId: " << exerciseId;
|
||||
ERROR_LOG() << "Error selecting data for participantId: " << participantId << ", exerciseId: " << exerciseId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ void DataManager::onInsertParticipantAssignment(int participantId, int exerciseI
|
||||
{
|
||||
// use the 'correct' participant id in case participantId == 0 was given (happens during startup)
|
||||
participantId = q.value(0).toInt() - (exerciseId * s_exerciseOffset);
|
||||
DEBUG_LOG(m_logger) << "participantId: " << participantId;
|
||||
DEBUG_LOG() << "participantId: " << participantId;
|
||||
|
||||
Registration reg;
|
||||
reg.setPlayerId(participantId);
|
||||
@@ -472,7 +472,7 @@ void DataManager::onInsertParticipantAssignment(int participantId, int exerciseI
|
||||
|
||||
Messages::ParticipantRegisterInExconRequest *msg = new Messages::ParticipantRegisterInExconRequest(reg.toJson(),
|
||||
QLatin1String("blub"));
|
||||
INFO_LOG(m_logger) << "registration: " << msg->toJsonString();
|
||||
INFO_LOG() << "registration: " << msg->toJsonString();
|
||||
m_webSocketServer->sendToAllClients(msg);
|
||||
}
|
||||
}
|
||||
@@ -482,7 +482,7 @@ void DataManager::onNotification(const QString &name, QSqlDriver::NotificationSo
|
||||
Q_UNUSED(source);
|
||||
// search coresponding signal
|
||||
|
||||
INFO_LOG(m_logger) << "IN onNotification name: " << name;
|
||||
INFO_LOG() << "IN onNotification name: " << name;
|
||||
|
||||
const QString triggerNameEx0 = triggerName(0);
|
||||
if (name.contains(triggerNameEx0))
|
||||
@@ -491,7 +491,7 @@ void DataManager::onNotification(const QString &name, QSqlDriver::NotificationSo
|
||||
name_ = name_.mid(triggerNameEx0.size() + 1);
|
||||
int exerciseId = name_.toInt();
|
||||
int participantId = payload.toInt();
|
||||
INFO_LOG(m_logger) << "exerciseId: " << exerciseId << ", participantId: " << participantId;
|
||||
INFO_LOG() << "exerciseId: " << exerciseId << ", participantId: " << participantId;
|
||||
onInsertParticipantAssignment(participantId, exerciseId);
|
||||
}
|
||||
}
|
||||
@@ -512,7 +512,7 @@ void DataManager::reconnectSignals()
|
||||
|
||||
void DataManager::registerReply(int exerciseId, qint32 participantId, int returnValue)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "registerReply for exercise id = " << exerciseId << ", participant id = " << participantId << ", return value = " << returnValue;
|
||||
DEBUG_LOG() << "registerReply for exercise id = " << exerciseId << ", participant id = " << participantId << ", return value = " << returnValue;
|
||||
|
||||
NSqlQuery q(m_mainHandler->db()->database());
|
||||
|
||||
@@ -523,15 +523,15 @@ void DataManager::registerReply(int exerciseId, qint32 participantId, int return
|
||||
QLatin1String(" WHERE id = ") + QString::number(newParticipantId) +
|
||||
QLatin1String(" AND gesendet = false");
|
||||
|
||||
DEBUG_LOG(m_logger) << "registerReply: stmt = " << stmt;
|
||||
DEBUG_LOG() << "registerReply: stmt = " << stmt;
|
||||
if (!q.exec(stmt))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot update reply entry for participant: " << participantId
|
||||
ERROR_LOG() << "Cannot update reply entry for participant: " << participantId
|
||||
<< " in exercise: " << exerciseId << ", returnValue: " << returnValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Update successful for participant " << participantId << " in exercise: " << exerciseId;
|
||||
INFO_LOG() << "Update successful for participant " << participantId << " in exercise: " << exerciseId;
|
||||
}
|
||||
|
||||
if (returnValue != 0)
|
||||
@@ -541,16 +541,16 @@ void DataManager::registerReply(int exerciseId, qint32 participantId, int return
|
||||
QLatin1String(" SET ausstg_nr = -1, zeit = ") + QString::number(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch()) +
|
||||
QLatin1String(" WHERE id = ") + QString::number(newParticipantId);
|
||||
|
||||
DEBUG_LOG(m_logger) << "registerReply: stmt1 = " << stmt1;
|
||||
DEBUG_LOG() << "registerReply: stmt1 = " << stmt1;
|
||||
|
||||
if (!q.exec(stmt1))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Cannot update austtg_nr for participant: " << participantId
|
||||
ERROR_LOG() << "Cannot update austtg_nr for participant: " << participantId
|
||||
<< " in exercise: " << exerciseId << ", returnValue: " << returnValue;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG(m_logger) << "Update ausstg_nr successful for participant " << participantId << " in exercise: " << exerciseId;
|
||||
INFO_LOG() << "Update ausstg_nr successful for participant " << participantId << " in exercise: " << exerciseId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user