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
+27
-28
@@ -32,7 +32,6 @@ ObjectExercise::ObjectExercise(const std::shared_ptr<DdsHandler> &ddsHandler,
|
||||
, m_exTblGen(exTblGen)
|
||||
, m_exerciseHandler(exHandler)
|
||||
, m_copyExercise(nullptr)
|
||||
, m_logger(getLogger("ObjectExercise"))
|
||||
{
|
||||
m_stateMachine = new ExerciseStateMachine(this);
|
||||
}
|
||||
@@ -71,12 +70,12 @@ Core::FunctionReplyObject ObjectExercise::createObject(const Database::ExmExerci
|
||||
if (!m_db->insert(m_data))
|
||||
{
|
||||
QString errText = m_db->getLastError().databaseText();
|
||||
ERROR_LOG(m_logger) << "Error inserting exercise into database: " << errText;
|
||||
ERROR_LOG() << "Error inserting exercise into database: " << errText;
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting ExmExercise-data into database: %1")).arg(errText);
|
||||
}
|
||||
|
||||
// Id is serial -> will be generated by db => inside m_data after db-insert
|
||||
DEBUG_LOG(m_logger) << "New exerciseId: " << m_data.id;
|
||||
DEBUG_LOG() << "New exerciseId: " << m_data.id;
|
||||
|
||||
// Create exercise-schema
|
||||
if (!m_exTblGen->createExerciseSchema(m_data.id))
|
||||
@@ -95,7 +94,7 @@ Core::FunctionReplyObject ObjectExercise::createObject(const Database::ExmExerci
|
||||
if (m_logger.isDebugEnabled())
|
||||
m_exTblGen->writeExerciseServicesSql(m_data.id);
|
||||
|
||||
INFO_LOG(m_logger) << "Exercise created sucessfully.";
|
||||
INFO_LOG() << "Exercise created sucessfully.";
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -107,7 +106,7 @@ void ObjectExercise::initStateMachine()
|
||||
{
|
||||
// Start ExerciseStateMachine
|
||||
m_stateMachine->init();
|
||||
INFO_LOG(m_logger) << "StateMachine: currentState" << m_stateMachine->getCurrentState();
|
||||
INFO_LOG() << "StateMachine: currentState" << m_stateMachine->getCurrentState();
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject ObjectExercise::updateObject(const Database::ExmExercise &data)
|
||||
@@ -137,12 +136,12 @@ Core::FunctionReplyObject ObjectExercise::updateObject(const Database::ExmExerci
|
||||
|
||||
fixupTimeZone();
|
||||
|
||||
INFO_LOG(m_logger) << "Trying to updateObject ExerciseData with id = " << data.id;
|
||||
INFO_LOG() << "Trying to updateObject ExerciseData with id = " << data.id;
|
||||
|
||||
if (!m_db->update(m_data))
|
||||
{
|
||||
QString errText = m_db->getLastError().databaseText();
|
||||
ERROR_LOG(m_logger) << "Failed to update ExerciseData with id = " << data.id << ": " << m_db->getLastError().databaseText();
|
||||
ERROR_LOG() << "Failed to update ExerciseData with id = " << data.id << ": " << m_db->getLastError().databaseText();
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating ExmExercise-data in database: %1")).arg(errText);
|
||||
}
|
||||
|
||||
@@ -154,7 +153,7 @@ Core::FunctionReplyObject ObjectExercise::updateObject(const Database::ExmExerci
|
||||
return retOb;
|
||||
}
|
||||
|
||||
INFO_LOG(m_logger) << "ExerciseData changed sucessfully.";
|
||||
INFO_LOG() << "ExerciseData changed sucessfully.";
|
||||
|
||||
onPublishData();
|
||||
|
||||
@@ -176,14 +175,14 @@ Core::FunctionReplyObject ObjectExercise::removeObject(bool force)
|
||||
if (!m_db->removeExmExercise(m_data.id))
|
||||
{
|
||||
QString errText = m_db->getLastError().databaseText();
|
||||
ERROR_LOG(m_logger) << "Cannot remove exercise id = " << m_data.id << "from database: " << errText;
|
||||
ERROR_LOG() << "Cannot remove exercise id = " << m_data.id << "from database: " << errText;
|
||||
return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Exercise %1 (%2) can not be removed: %3")).arg(m_data.name).arg(m_data.id).arg(errText);
|
||||
}
|
||||
|
||||
m_ddsHandler->dts()->removeExerciseByKey(m_data.id);
|
||||
sendStateToServiceManagement(m_data.exerciseStateId); // terminated
|
||||
|
||||
INFO_LOG(m_logger) << "Exercise dropped sucessfully.";
|
||||
INFO_LOG() << "Exercise dropped sucessfully.";
|
||||
|
||||
return Core::FunctionReplyObject(m_data.id);
|
||||
}
|
||||
@@ -193,7 +192,7 @@ bool ObjectExercise::setLinkedExerciseId(int newLinkedExerciseId)
|
||||
m_data.linkedExerciseId = newLinkedExerciseId;
|
||||
if (!m_db->update(m_data))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to update ExerciseData with id = " << m_data.id << " : " << m_db->getLastError().text();
|
||||
ERROR_LOG() << "Failed to update ExerciseData with id = " << m_data.id << " : " << m_db->getLastError().text();
|
||||
return false;
|
||||
}
|
||||
onPublishData();
|
||||
@@ -205,7 +204,7 @@ bool ObjectExercise::setSendToWms(bool bSend)
|
||||
m_data.sendToWms = bSend;
|
||||
if (!m_db->update(m_data))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Failed to update ExerciseData with id = " << m_data.id << " : " << m_db->getLastError().text();
|
||||
ERROR_LOG() << "Failed to update ExerciseData with id = " << m_data.id << " : " << m_db->getLastError().text();
|
||||
return false;
|
||||
}
|
||||
onPublishData();
|
||||
@@ -220,12 +219,12 @@ bool ObjectExercise::setExerciseState(const ExerciseState &exerciseState)
|
||||
|
||||
if (!isValid() || !isEditable())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Trying to update an already removed ExmExercise object";
|
||||
WARNING_LOG() << "Trying to update an already removed ExmExercise object";
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG(m_logger) << "## m_data.exerciseStateId = " << m_data.exerciseStateId;
|
||||
DEBUG_LOG(m_logger) << "## exerciseState = " << exerciseState;
|
||||
DEBUG_LOG() << "## m_data.exerciseStateId = " << m_data.exerciseStateId;
|
||||
DEBUG_LOG() << "## exerciseState = " << exerciseState;
|
||||
|
||||
m_data.exerciseStateId = exerciseState;
|
||||
if (m_data.exerciseStateId == ExerciseManagement::ExerciseState::Stopped ||
|
||||
@@ -243,7 +242,7 @@ bool ObjectExercise::setExerciseState(const ExerciseState &exerciseState)
|
||||
|
||||
if (!m_db->update(m_data))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error updating ExmExercise-data in database (exerciseState) for exercise id = " << m_data.id << " : " << m_db->getLastError().text();;
|
||||
ERROR_LOG() << "Error updating ExmExercise-data in database (exerciseState) for exercise id = " << m_data.id << " : " << m_db->getLastError().text();;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -256,7 +255,7 @@ bool ObjectExercise::setExerciseState(const ExerciseState &exerciseState)
|
||||
|
||||
// record exerciseStateChange
|
||||
if (!m_db->insert(stateChange))
|
||||
WARNING_LOG(m_logger) << "Recording change of exerciseState failed: " << m_db->getLastError().text();;
|
||||
WARNING_LOG() << "Recording change of exerciseState failed: " << m_db->getLastError().text();;
|
||||
|
||||
// Publish Data via DTS
|
||||
onPublishData();
|
||||
@@ -266,10 +265,10 @@ bool ObjectExercise::setExerciseState(const ExerciseState &exerciseState)
|
||||
|
||||
void ObjectExercise::onPublishData()
|
||||
{
|
||||
INFO_LOG(m_logger) << "Publish ExmExercise-data to dds (" << m_data.id << ", " << m_data.name << ") ...";
|
||||
INFO_LOG() << "Publish ExmExercise-data to dds (" << m_data.id << ", " << m_data.name << ") ...";
|
||||
|
||||
if (!m_ddsHandler->dts()->publish(convert(m_data)))
|
||||
ERROR_LOG(m_logger) << "Error publishing ExmExercise-data to dds";
|
||||
ERROR_LOG() << "Error publishing ExmExercise-data to dds";
|
||||
|
||||
}
|
||||
|
||||
@@ -285,7 +284,7 @@ void ObjectExercise::fixupTimeZone()
|
||||
Core::FunctionReplyObject ObjectExercise::switchToState(const ExerciseState &newExerciseState, int operatorId, int workstationId)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
INFO_LOG(m_logger) << "-------------- switchToState: " << newExerciseState
|
||||
INFO_LOG() << "-------------- switchToState: " << newExerciseState
|
||||
<< ", currentState = " << m_stateMachine->getCurrentState();
|
||||
m_data.operatorId = operatorId;
|
||||
m_data.workstationId = workstationId;
|
||||
@@ -328,9 +327,9 @@ bool ObjectExercise::sendStateToServiceManagement(ExerciseState state)
|
||||
return false;
|
||||
|
||||
if (sgt != Core::ServiceGroupType::Master)
|
||||
DEBUG_LOG(m_logger) << "Ex " << m_data.id << " - Trying to enable service group " << sgt;
|
||||
DEBUG_LOG() << "Ex " << m_data.id << " - Trying to enable service group " << sgt;
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Ex " << m_data.id << " - Trying to stop all services";
|
||||
DEBUG_LOG() << "Ex " << m_data.id << " - Trying to stop all services";
|
||||
|
||||
// if there is an old group, stop them
|
||||
ServiceManagement::GroupRequest request(sgt,
|
||||
@@ -342,14 +341,14 @@ bool ObjectExercise::sendStateToServiceManagement(ExerciseState state)
|
||||
#ifndef EXM_OBJECT_EXERCISE_NO_HANDLER
|
||||
if (!m_exerciseHandler || !m_exerciseHandler->startGroupRequest(request))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Ex " << m_data.id << " - Failed to start group " << sgt;
|
||||
ERROR_LOG() << "Ex " << m_data.id << " - Failed to start group " << sgt;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (sgt != Core::ServiceGroupType::Master)
|
||||
DEBUG_LOG(m_logger) << "Ex " << m_data.id << " - Sent start group " << sgt;
|
||||
DEBUG_LOG() << "Ex " << m_data.id << " - Sent start group " << sgt;
|
||||
else
|
||||
DEBUG_LOG(m_logger) << "Ex " << m_data.id << " - Sent stop all services";
|
||||
DEBUG_LOG() << "Ex " << m_data.id << " - Sent stop all services";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -375,7 +374,7 @@ bool ObjectExercise::transferExerciseToEvaluationDb()
|
||||
Settings::evaluationDatabaseName()) ||
|
||||
!m_copyExercise->doCopy())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Could not backup exercise database to evaluation server";
|
||||
WARNING_LOG() << "Could not backup exercise database to evaluation server";
|
||||
return false;
|
||||
}
|
||||
NOTICE_LOG(m_logger) << "Ex " << m_data.id << " - Started copying exercise from "
|
||||
@@ -392,7 +391,7 @@ void ObjectExercise::onTransferDbFinished()
|
||||
|
||||
m_data.transferred = true;
|
||||
if (!m_db->update(m_data))
|
||||
ERROR_LOG(m_logger) << "Error updating ExmExercise-data (transferred) in database (exerciseState) for exercise id = " << m_data.id << " : " << m_db->getLastError().text();;
|
||||
ERROR_LOG() << "Error updating ExmExercise-data (transferred) in database (exerciseState) for exercise id = " << m_data.id << " : " << m_db->getLastError().text();;
|
||||
|
||||
delete m_copyExercise;
|
||||
m_copyExercise = nullptr;
|
||||
@@ -403,7 +402,7 @@ void ObjectExercise::onTransferDbFinished()
|
||||
|
||||
void ObjectExercise::onErrorOccured()
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Ex " << m_data.id << " - Copying exercise from "
|
||||
WARNING_LOG() << "Ex " << m_data.id << " - Copying exercise from "
|
||||
<< Settings::serverDatabaseHost() << ":" << Settings::serverDatabaseName()
|
||||
<< " to " << Settings::evaluationDatabaseHost() << ":" << Settings::evaluationDatabaseName();
|
||||
delete m_copyExercise;
|
||||
|
||||
Reference in new issue
Block a user