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

@@ -21,7 +21,6 @@ HandlerDynamicParticipantData::HandlerDynamicParticipantData(const std::shared_p
const std::shared_ptr<DatabaseInterface> &db)
: m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("HandlerDynamicParticipantData"))
{
} // end of ctor()
@@ -33,12 +32,12 @@ HandlerDynamicParticipantData::~HandlerDynamicParticipantData()
//-----------------------------------------------------------------------------
bool HandlerDynamicParticipantData::init()
{
DEBUG_LOG(m_logger) << "Creating and initializing PPM DTC, AES DTC, PDM DTC ...";
DEBUG_LOG() << "Creating and initializing PPM DTC, AES DTC, PDM DTC ...";
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_ppmDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create PPM DTC";
ERROR_LOG() << "Could not create PPM DTC";
return false;
}
m_ppmDtc->enableType();
@@ -46,7 +45,7 @@ bool HandlerDynamicParticipantData::init()
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_aesDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create AES DTC";
ERROR_LOG() << "Could not create AES DTC";
return false;
}
@@ -54,7 +53,7 @@ bool HandlerDynamicParticipantData::init()
m_gimDtc = GuezIedManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_gimDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create GIM DTC";
ERROR_LOG() << "Could not create GIM DTC";
return false;
}
#endif
@@ -62,7 +61,7 @@ bool HandlerDynamicParticipantData::init()
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_pdmDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create PDM DTC";
ERROR_LOG() << "Could not create PDM DTC";
return false;
}
m_pdmDtc->enableChargeType();
@@ -81,7 +80,7 @@ bool HandlerDynamicParticipantData::init()
m_aesDtc->enableEffects();
m_aesDtc->waitForHistoricalDataEffects();
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
// read all aesItemViewData
m_aesDtc->aesItemViews([this](const AreaEffectSimulation::AesItemView &aiv) { onAesItemViewChanged(aiv, DataModification::eAdded); });
@@ -106,7 +105,7 @@ bool HandlerDynamicParticipantData::init()
this, &HandlerDynamicParticipantData::onIedChanged);
m_gimDtc->enableIed();
bool gg = m_gimDtc->waitForHistoricalDataIed();
DEBUG_LOG(m_logger) << "waitForHistoricalDataIed = " << gg;
DEBUG_LOG() << "waitForHistoricalDataIed = " << gg;
// read all aesItemViewData
m_gimDtc->ieds([this](const GuezIedManagement::Ied &ied) { onIedChanged(ied, DataModification::eAdded); });
#endif
@@ -115,7 +114,7 @@ bool HandlerDynamicParticipantData::init()
if (!m_bldDtc)
{
ERROR_LOG(m_logger) << "Could not create DTC Buildings";
ERROR_LOG() << "Could not create DTC Buildings";
return false;
}
@@ -130,7 +129,7 @@ bool HandlerDynamicParticipantData::init()
if (!m_ppmDtc->enableDynamicParticipantData())
{
ERROR_LOG(m_logger) << "init() PPM failed";
ERROR_LOG() << "init() PPM failed";
return false;
}
@@ -141,12 +140,12 @@ bool HandlerDynamicParticipantData::init()
if (!m_ppmDtc->enableParticipantGearEvent())
{
ERROR_LOG(m_logger) << "init() PPM failed";
ERROR_LOG() << "init() PPM failed";
return false;
}
#endif
DEBUG_LOG(m_logger) << "... done";
DEBUG_LOG() << "... done";
return true;
} // end of init()
@@ -159,7 +158,7 @@ void HandlerDynamicParticipantData::onParticipantChanged(const ParticipantManage
case DataModification::eAdded:
case DataModification::eModified:
m_partMap[data.id()] = data;
DEBUG_LOG(m_logger) << "added/modified - data.participantId: " << data.id()
DEBUG_LOG() << "added/modified - data.participantId: " << data.id()
<< ", data.partyId: " << data.partyId()
<< ", data.equipmentNumber: " << data.equipmentNumber();
break;
@@ -178,20 +177,20 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
case DataModification::eModified:
{
m_partPositionMap[data.participantId()] = data;
DEBUG_LOG(m_logger) << "added/modified Participant Position - data.participantId: " << data.participantId()
DEBUG_LOG() << "added/modified Participant Position - data.participantId: " << data.participantId()
<< ", data.pos: " << data.pos();
//TransportInitiated (mounted on vehicle)
if (data.mountedOn().is_set())
{
DEBUG_LOG(m_logger) << "Mounted on : " << data.mountedOn().get();
DEBUG_LOG() << "Mounted on : " << data.mountedOn().get();
if (m_isMounted.contains(data.participantId()))
break;
m_isMounted.append(data.participantId());
DEBUG_LOG(m_logger) << "Added mounted participant id " << data.participantId();
DEBUG_LOG() << "Added mounted participant id " << data.participantId();
qint64 timeMounted = getLastSignificantPositionMountedChanged(data.participantId(), data.sampleTime(), data.pos());
if (timeMounted <= 0)
@@ -209,13 +208,13 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
ttData.eventTypeId = ReportManagement::EventType::TransportInitiated;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
WARNING_LOG(m_logger) << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
WARNING_LOG() << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
}
else
{
if (m_isMounted.contains(data.participantId()))
{
DEBUG_LOG(m_logger) << "Removed mounted participant id " << data.participantId();
DEBUG_LOG() << "Removed mounted participant id " << data.participantId();
m_isMounted.remove(m_isMounted.indexOf(data.participantId()));
}
}
@@ -224,7 +223,7 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
}
case DataModification::eRemoved:
{
DEBUG_LOG(m_logger) << "Removed participant id " << data.participantId();
DEBUG_LOG() << "Removed participant id " << data.participantId();
if (m_isMounted.contains(data.participantId()))
m_isMounted.remove(m_isMounted.indexOf(data.participantId()));
m_partPositionMap.remove(data.participantId());
@@ -240,7 +239,7 @@ void HandlerDynamicParticipantData::onAesItemViewChanged(const AreaEffectSimulat
{
case DataModification::eAdded:
case DataModification::eModified:
DEBUG_LOG(m_logger) << "added/modified data.aesItemId(): " << data.aesItemId();
DEBUG_LOG() << "added/modified data.aesItemId(): " << data.aesItemId();
m_aesItemViewMap[data.aesItemId()] = data;
break;
case DataModification::eRemoved:
@@ -259,7 +258,7 @@ void HandlerDynamicParticipantData::onIedChanged(const GuezIedManagement::Ied &d
{
case DataModification::eAdded:
case DataModification::eModified:
DEBUG_LOG(m_logger) << "added/modified data.id(): " << data.id();
DEBUG_LOG() << "added/modified data.id(): " << data.id();
m_iedMap[data.id()] = data;
break;
case DataModification::eRemoved:
@@ -276,7 +275,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "onDynamicParticipantDataChanged(): "
DEBUG_LOG() << "onDynamicParticipantDataChanged(): "
<< " participantId: " << data.participantId()
<< ", size stateHistory: " << data.stateHistory().size()
<< ", size sanMatStock: " << data.sanitationMaterialStock().size();
@@ -299,7 +298,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
itParticipant = m_partMap.constFind(data.participantId());
if (itParticipant == m_partMap.constEnd())
{
WARNING_LOG(m_logger) << "Participant does not exist: participantId: " << data.participantId();
WARNING_LOG() << "Participant does not exist: participantId: " << data.participantId();
return;
}
}
@@ -371,16 +370,16 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (data.stateHistory().size() > 0 && data.stateHistory() != lastDynData.stateHistory())
{
INFO_LOG(m_logger) << "PROCESSING: stateHistory.size() = " << data.stateHistory().size() << " for participant id = " << data.participantId();
INFO_LOG() << "PROCESSING: stateHistory.size() = " << data.stateHistory().size() << " for participant id = " << data.participantId();
const ParticipantManagement::StateInformation &stateInfo = data.stateHistory().at(data.stateHistory().size()-1);
//const ParticipantManagement::StateInformation &stateInfo = m_ppmDtc->youngestStateInformation(data.stateHistory());
const ProjectDataManagement::VulnerabilityState &vulnState = stateInfo.vulnerabilityState();
DEBUG_LOG(m_logger) << "vulnerabilityState: " << vulnState;
DEBUG_LOG() << "vulnerabilityState: " << vulnState;
if (stateInfo.originatorChargeTypeId() > 0)
DEBUG_LOG(m_logger) << "originatorChargeTypeId: " << stateInfo.originatorChargeTypeId();
DEBUG_LOG(m_logger) << "originatorType: " << stateInfo.originatorType();
DEBUG_LOG(m_logger) << "vulnerabilityBits: " << stateInfo.vulnerabilityBits();
DEBUG_LOG() << "originatorChargeTypeId: " << stateInfo.originatorChargeTypeId();
DEBUG_LOG() << "originatorType: " << stateInfo.originatorType();
DEBUG_LOG() << "vulnerabilityBits: " << stateInfo.vulnerabilityBits();
//counting NearMiss and HitWithNoEffect as CombatReady, after discussion with Ulli 08.2021
bool isCombatReady = (vulnState == ProjectDataManagement::VulnerabilityState::CombatReady ||
@@ -402,7 +401,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
{
// Save Treatment Data
if (!m_db->insert(tData))
ERROR_LOG(m_logger) << "Error while inserting treatment data - participantId: " << tData.participantId;
ERROR_LOG() << "Error while inserting treatment data - participantId: " << tData.participantId;
}
// Report Firings
@@ -425,7 +424,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
// Save UnitPower Data
if (!m_db->insert(upData))
ERROR_LOG(m_logger) << "Error while inserting unit power data - participantId: " << upData.participantId;
ERROR_LOG() << "Error while inserting unit power data - participantId: " << upData.participantId;
// Report Mine Area / Report Firings / Report AirSupport
if (vulnState != ProjectDataManagement::VulnerabilityState::CombatReady)
@@ -451,7 +450,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save direct firings data
if (!m_db->insert(fData))
ERROR_LOG(m_logger) << "Error while inserting direct firings data into db for event_time = " << fData.eventTime;
ERROR_LOG() << "Error while inserting direct firings data into db for event_time = " << fData.eventTime;
//save TreatmentTimeline events too
{
@@ -467,7 +466,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -478,7 +477,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
}
@@ -488,7 +487,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation && stateInfo.originatorChargeTypeId() != 0)
{
const AreaEffectSimulation::AesItemView aesItemView = getAesItemView(stateInfo.originatorId());
DEBUG_LOG(m_logger) << "Found indirect fire from AES id = " << stateInfo.originatorId() << ", charge type = " << stateInfo.originatorChargeTypeId();
DEBUG_LOG() << "Found indirect fire from AES id = " << stateInfo.originatorId() << ", charge type = " << stateInfo.originatorChargeTypeId();
if (aesItemView.id() > 0)
{
if (aesItemView.partyId().is_set())
@@ -503,11 +502,11 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save indirect firings data
if (!m_db->insert(fData))
ERROR_LOG(m_logger) << "Error while inserting indirect firings data into db for event_time = " << fData.eventTime;
ERROR_LOG() << "Error while inserting indirect firings data into db for event_time = " << fData.eventTime;
// Save indirect firings - Report AirSupport data
if (!m_db->insert(airSupData))
ERROR_LOG(m_logger) << "Error while inserting indirect firings (for airSupport report) into db for event_time = " << airSupData.eventTime;
ERROR_LOG() << "Error while inserting indirect firings (for airSupport report) into db for event_time = " << airSupData.eventTime;
//save TreatmentTimeline events too
{
@@ -523,7 +522,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -534,7 +533,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
}
@@ -552,7 +551,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save explosive device data
if (!m_db->insert(fData))
ERROR_LOG(m_logger) << "Error while inserting explosive device data into db for event_time = " << fData.eventTime;
ERROR_LOG() << "Error while inserting explosive device data into db for event_time = " << fData.eventTime;
}
#endif
@@ -570,25 +569,25 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
else
nbcData.hit = 0;
DEBUG_LOG(m_logger) << "nbcData.hit: " << nbcData.hit;
DEBUG_LOG() << "nbcData.hit: " << nbcData.hit;
// Check, if effectSimulation is mine area or NBC or Functional Area
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation ||
stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::FunctionalArea)
{
INFO_LOG(m_logger) << "Originator = AreaEffectSimulation or FunctionalArea";
INFO_LOG() << "Originator = AreaEffectSimulation or FunctionalArea";
mbData.mineAreaId = stateInfo.originatorId();
nbcData.nbcId = stateInfo.originatorId();
DEBUG_LOG(m_logger) << "aesItemViewMap.size(): " << m_aesItemViewMap.size();
DEBUG_LOG() << "aesItemViewMap.size(): " << m_aesItemViewMap.size();
const AreaEffectSimulation::AesItemView aesItemView = getAesItemView(nbcData.nbcId);
DEBUG_LOG(m_logger) << "aesItemView.id() = " << aesItemView.id();
DEBUG_LOG() << "aesItemView.id() = " << aesItemView.id();
if (aesItemView.id() > 0)
{
AreaEffectSimulation::AesType aesType = aesItemView.aesTypeId();
DEBUG_LOG(m_logger) << "AesType: " << aesType;
DEBUG_LOG() << "AesType: " << aesType;
if (aesItemView.partyId().is_set())
mbData.mineAreaPartyId = aesItemView.partyId().get();
@@ -605,9 +604,9 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
mbData.mineAreaId = aesItemView.aesItemId();
if (mbData.mineAreaId > 0)
{
DEBUG_LOG(m_logger) << "Inserting Mine Area Data";
DEBUG_LOG() << "Inserting Mine Area Data";
if (!m_db->insert(mbData))
ERROR_LOG(m_logger) << "Error while inserting mine area data participantId: " << mbData.participantId;
ERROR_LOG() << "Error while inserting mine area data participantId: " << mbData.participantId;
}
}
if (aesType == AreaEffectSimulation::AesType::AtBCContamination ||
@@ -619,9 +618,9 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
nbcData.chargeTypeId = aesItemView.chargeStruct().chargeTypeId();
if (nbcData.nbcId > 0 && nbcData.chargeTypeId > 0)
{
DEBUG_LOG(m_logger) << "Inserting NBC Data";
DEBUG_LOG() << "Inserting NBC Data";
if (!m_db->insert(nbcData))
ERROR_LOG(m_logger) << "Error while inserting nbc data participant: " << nbcData.participantId;
ERROR_LOG() << "Error while inserting nbc data participant: " << nbcData.participantId;
}
}
@@ -633,7 +632,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
vrData.timePositionChanged = getLastSignificantParticipantPositionChanged(vrData.participantId, vrData.timeEvent, getLastPosition(vrData.participantId));
if (!m_db->insert(vrData))
ERROR_LOG(m_logger) << "Error while inserting maintenance data for participantId: " << vrData.participantId;
ERROR_LOG() << "Error while inserting maintenance data for participantId: " << vrData.participantId;
// treatment timeline event EnterFunctionalArea
ttData.vulnerabilityState = stateInfo.vulnerabilityState().underlying();
@@ -655,7 +654,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event EnterFunctionalArea for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event EnterFunctionalArea for participantId: " << ttData.participantId;
}
}
@@ -665,7 +664,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
// Treatment reports
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::Sanitation)
{
DEBUG_LOG(m_logger) << "Sanitation";
DEBUG_LOG() << "Sanitation";
// Sanitation info only for Human type class
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(pData.typeId()).typeClass();
if (typeClass == ParticipantManagement::TypeClass::Human)
@@ -720,7 +719,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
toAdd = false;
if (toAdd && !m_db->insert(tData))
ERROR_LOG(m_logger) << "Error while inserting treatment data for participantId: " << tData.participantId;
ERROR_LOG() << "Error while inserting treatment data for participantId: " << tData.participantId;
// now treatment timeline events
{
@@ -736,7 +735,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -747,7 +746,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
// Treatment
@@ -759,7 +758,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event Treatment for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event Treatment for participantId: " << ttData.participantId;
/*
//TransportInitiated (mounted on vehicle)
@@ -770,7 +769,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::TransportInitiated;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
}
*/
}
@@ -791,7 +790,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::NineLinerSet;
ttData.id = 0; //force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event NineLinerSet for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event NineLinerSet for participantId: " << ttData.participantId;
}
else if (stateInfo.originatorChargeTypeId() == 2) // Transport Requested
{
@@ -800,7 +799,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::TransportRequested;
ttData.id = 0; //force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event TransportRequested for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event TransportRequested for participantId: " << ttData.participantId;
}
}
@@ -817,7 +816,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::SetInjury;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event SetInjury for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event SetInjury for participantId: " << ttData.participantId;
}
// Vitality and Vulnerability reset manually
@@ -831,7 +830,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityReset;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VitalityReset for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VitalityReset for participantId: " << ttData.participantId;
}
#ifdef GUEZ_MODE
@@ -845,7 +844,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGSet;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG(m_logger) << "Error while inserting Event VBGSet for participantId: " << ttData.participantId;
ERROR_LOG() << "Error while inserting Event VBGSet for participantId: " << ttData.participantId;
}
#endif
@@ -854,7 +853,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
else
DEBUG_LOG(m_logger) << "No new state history for participant id = " << data.participantId();
DEBUG_LOG() << "No new state history for participant id = " << data.participantId();
// Report Charge Resupply
@@ -894,7 +893,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
crData.chargeRemain = gi.remain();
if (crData.chargeTypeId != gi.chargeTypeId())
WARNING_LOG(m_logger) << "OLD charge id " << gi.chargeTypeId() << " changed in NEW id " << crData.chargeTypeId;
WARNING_LOG() << "OLD charge id " << gi.chargeTypeId() << " changed in NEW id " << crData.chargeTypeId;
QPair<int, int> pair;
pair.first = gi.gearTypeId();
@@ -908,11 +907,11 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
gearMap.insert(pair, gi.remain());
DEBUG_LOG(m_logger) << "gearTypeId: " << crData.gearTypeId << ", chargeTypeId: " << crData.chargeTypeId;
DEBUG_LOG() << "gearTypeId: " << crData.gearTypeId << ", chargeTypeId: " << crData.chargeTypeId;
crData.id = 0; // to force insert without id
if (!m_db->insert(crData))
ERROR_LOG(m_logger) << "Error while inserting charge resupply data for participant: " << data.participantId();
ERROR_LOG() << "Error while inserting charge resupply data for participant: " << data.participantId();
}
// Has Turm/Wanne Map been filled?
@@ -930,14 +929,14 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
gearMap.insert(pair, turmWanneCrData.chargeRemain);
INFO_LOG(m_logger) << "Inserting TurmWanne data gearTypeId: " << turmWanneCrData.gearTypeId
INFO_LOG() << "Inserting TurmWanne data gearTypeId: " << turmWanneCrData.gearTypeId
<< ", chargeTypeId: " << turmWanneCrData.chargeTypeId
<< ", remain: " << turmWanneCrData.chargeRemain
<< ", fired: " << turmWanneCrData.chargeFired ;
turmWanneCrData.id = 0; // to force insert without id
if (!m_db->insert(turmWanneCrData))
ERROR_LOG(m_logger) << "Error while inserting (turm/wanne) charge resupply data for participant: " << data.participantId();
ERROR_LOG() << "Error while inserting (turm/wanne) charge resupply data for participant: " << data.participantId();
}
@@ -947,7 +946,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
for (auto it = gearMap.begin(); it != gearMap.end(); ++it)
{
QPair<int, int> pair = it.key();
DEBUG_LOG(m_logger) << "gearTypeId: " << pair.first << ", chargeTypeId: " << pair.second;
DEBUG_LOG() << "gearTypeId: " << pair.first << ", chargeTypeId: " << pair.second;
if (!containsGearTypeId(data.gear(), pair.first, pair.second))
{
crData.chargeTypeId = -2;
@@ -955,14 +954,14 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
crData.id = 0; // to force insert without id
if (!m_db->insert(crData))
ERROR_LOG(m_logger) << "Error while inserting charge resupply data for participant: " << data.participantId();
ERROR_LOG() << "Error while inserting charge resupply data for participant: " << data.participantId();
}
}
// Report Sanitation Material
if (data.sanitationMaterialStock().size() > 0)
{
INFO_LOG(m_logger) << "sanitationMaterialStock.size() = " << data.sanitationMaterialStock().size() << " for participant id = " << data.participantId();
INFO_LOG() << "sanitationMaterialStock.size() = " << data.sanitationMaterialStock().size() << " for participant id = " << data.participantId();
Database::RepSanitationMaterialData sanData;
@@ -973,7 +972,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
sanData.sanitationUniqueId = data.sanitationUniqueId();
sanData.qualification = data.qualification().underlying();
DEBUG_LOG(m_logger) << "Qualification = " << sanData.qualification;
DEBUG_LOG() << "Qualification = " << sanData.qualification;
for ( ParticipantManagement::SanitationMaterial sanMat : std::as_const(data.sanitationMaterialStock()))
{
@@ -981,10 +980,10 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
sanData.materialAmount = sanMat.materialCount();
sanData.id = 0; // to force insert
DEBUG_LOG(m_logger) << "Inserting SanMat data for participant id = " << data.participantId() << " , materialId = " << sanData.materialId << ", stock = " << sanData.materialAmount;
DEBUG_LOG() << "Inserting SanMat data for participant id = " << data.participantId() << " , materialId = " << sanData.materialId << ", stock = " << sanData.materialAmount;
if (!m_db->insert(sanData))
ERROR_LOG(m_logger) << "Error while inserting sanitation material data for participant: " << data.participantId();
ERROR_LOG() << "Error while inserting sanitation material data for participant: " << data.participantId();
}
}
@@ -1012,7 +1011,7 @@ void HandlerDynamicParticipantData::onBuildingStateChanged(const Buildings::Buil
airSupData.eventTime = data.sampleTime();
if (!m_db->insert(airSupData))
ERROR_LOG(m_logger) << "Error while inserting building state data into db for event_time = " << airSupData.eventTime;
ERROR_LOG() << "Error while inserting building state data into db for event_time = " << airSupData.eventTime;
} // end of onBuildingStateChanged
@@ -1043,7 +1042,7 @@ void HandlerDynamicParticipantData::onAesEffectsChanged(const AreaEffectSimulati
}
if (!m_db->insert(impData))
ERROR_LOG(m_logger) << "Error while inserting air support impact data into db for event_time = " << impData.eventTime;
ERROR_LOG() << "Error while inserting air support impact data into db for event_time = " << impData.eventTime;
} // end of onAesEffectsChanged
@@ -1071,7 +1070,7 @@ bool HandlerDynamicParticipantData::checkVulnerabilityStateChange(ProjectDataMan
// No change?
if (it.value() == vulnState)
{
INFO_LOG(m_logger) << "Same vulnerabilityState: " << vulnState;
INFO_LOG() << "Same vulnerabilityState: " << vulnState;
return false;
}
@@ -1086,10 +1085,10 @@ AreaEffectSimulation::AesItemView HandlerDynamicParticipantData::getAesItemView(
{
// make sure we have all data
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
auto ret = m_aesDtc->aesItemView(effectSimulationId);
DEBUG_LOG(m_logger) << "ret.id() = " << ret.id();
DEBUG_LOG() << "ret.id() = " << ret.id();
if (ret.id() == effectSimulationId)
{
@@ -1098,7 +1097,7 @@ AreaEffectSimulation::AesItemView HandlerDynamicParticipantData::getAesItemView(
}
else
{
DEBUG_LOG(m_logger) << "Not found effectSimulationId = " << effectSimulationId;
DEBUG_LOG() << "Not found effectSimulationId = " << effectSimulationId;
return AreaEffectSimulation::AesItemView();
}
@@ -1115,21 +1114,21 @@ QString HandlerDynamicParticipantData::getAesName(int effectSimulationId)
{
// make sure we have all data
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
auto aesItemView = getAesItemView(effectSimulationId);
ERROR_LOG(m_logger) << "aesType: " << aesItemView.aesTypeId().underlying();
ERROR_LOG() << "aesType: " << aesItemView.aesTypeId().underlying();
if (aesItemView.aesTypeId() == AreaEffectSimulation::AesType_def::AtExplosionCluster)
{
QString aesName = QString::fromStdString(m_aesDtc->explosionCluster(effectSimulationId).name());
ERROR_LOG(m_logger) << "ExplosionCluster aesName: " << aesName;
ERROR_LOG() << "ExplosionCluster aesName: " << aesName;
m_aesNamesMap.insert(effectSimulationId, aesName);
return aesName;
}
else
{
QString aesName = QString::fromStdString(m_aesDtc->airSupportImpact(effectSimulationId).name());
ERROR_LOG(m_logger) << "AirSupport aesName: " << aesName;
ERROR_LOG() << "AirSupport aesName: " << aesName;
m_aesNamesMap.insert(effectSimulationId, aesName);
return aesName;
}
@@ -1161,9 +1160,9 @@ qint32 HandlerDynamicParticipantData::lastVitality(int participantId, qint64 cur
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC LIMIT 1");
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1171,7 +1170,7 @@ qint32 HandlerDynamicParticipantData::lastVitality(int participantId, qint64 cur
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return vit;
}
@@ -1191,9 +1190,9 @@ qint32 HandlerDynamicParticipantData::lastVulnerabilityKind(int participantId, q
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC LIMIT 1");
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1201,7 +1200,7 @@ qint32 HandlerDynamicParticipantData::lastVulnerabilityKind(int participantId, q
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return vuln;
}
@@ -1223,7 +1222,7 @@ Core::GeoPosition HandlerDynamicParticipantData::getLastPosition(int participant
m_ppmDtc->waitForHistoricalDataParticipantPosition();
itParticipant = m_partPositionMap.constFind(participantId);
if (itParticipant == m_partPositionMap.constEnd())
WARNING_LOG(m_logger) << "Participant position not found for participantId: " << participantId;
WARNING_LOG() << "Participant position not found for participantId: " << participantId;
}
else
return itParticipant.value().pos();
@@ -1241,9 +1240,9 @@ qint64 HandlerDynamicParticipantData::getLastSignificantParticipantPositionChang
"WHERE participant_id = :participantId AND (sample_time <= :currTime) "
"ORDER by sample_time DESC");
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1251,7 +1250,7 @@ qint64 HandlerDynamicParticipantData::getLastSignificantParticipantPositionChang
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return time_changed;
}
@@ -1278,9 +1277,9 @@ qint64 HandlerDynamicParticipantData::getLastSignificantPositionMountedChanged(i
"WHERE participant_id = :participantId AND (sample_time <= :currTime) AND mounted_on > 0 "
"ORDER by sample_time DESC");
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1288,7 +1287,7 @@ qint64 HandlerDynamicParticipantData::getLastSignificantPositionMountedChanged(i
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return time_changed;
}
@@ -1311,7 +1310,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "onParticipantGearEventChanged(): "
DEBUG_LOG() << "onParticipantGearEventChanged(): "
<< " participantId: " << data.participantId();
// Report Firings
@@ -1329,7 +1328,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
itOParticipant = m_partMap.constFind(fData.participantId);
if (itOParticipant == m_partMap.constEnd())
{
WARNING_LOG(m_logger) << "Originator participant does not exist: Id = " << fData.participantId;
WARNING_LOG() << "Originator participant does not exist: Id = " << fData.participantId;
return;
}
}
@@ -1347,7 +1346,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
// Save firings data
if (!m_db->insert(fData))
ERROR_LOG(m_logger) << "Error while inserting ParticipantGearEvent firings data into db for event_time = " << fData.eventTime;
ERROR_LOG() << "Error while inserting ParticipantGearEvent firings data into db for event_time = " << fData.eventTime;
}
@@ -1379,11 +1378,11 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC");
DEBUG_LOG(m_logger) << "!!! sinceWhenVitality";
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Vitality = " << vitality;
DEBUG_LOG() << "!!! sinceWhenVitality";
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG() << "Vitality = " << vitality;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1391,7 +1390,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return time;
}
@@ -1407,7 +1406,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
break;
}
DEBUG_LOG(m_logger) << "### Recalculated time vitality = " << time;
DEBUG_LOG() << "### Recalculated time vitality = " << time;
return time;
}
@@ -1423,11 +1422,11 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC");
DEBUG_LOG(m_logger) << "!!! sinceWhenVulnerability";
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Vulnerability = " << vulnerability;
DEBUG_LOG() << "!!! sinceWhenVulnerability";
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG() << "Vulnerability = " << vulnerability;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1435,14 +1434,14 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
return time;
}
while (qSelect.next())
{
int vuln = qSelect.value(1).toInt();
DEBUG_LOG(m_logger) << "Checking - time = " << qSelect.value(0).toLongLong() << ", vuln = " << vuln;
DEBUG_LOG() << "Checking - time = " << qSelect.value(0).toLongLong() << ", vuln = " << vuln;
if (vuln == vulnerability)
{
time = qSelect.value(0).toLongLong();
@@ -1452,7 +1451,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
break;
}
DEBUG_LOG(m_logger) << "### Recalculated time vulnerability = " << time;
DEBUG_LOG() << "### Recalculated time vulnerability = " << time;
return time;
}
@@ -20,7 +20,6 @@ MainHandler::MainHandler(QObject *parent)
, m_ddsHandler(nullptr)
, m_dbHandler(nullptr)
, m_dynPartData(nullptr)
, m_logger(getLogger("MainHandlerAnalyzer"))
{}
MainHandler::~MainHandler()
@@ -35,7 +35,5 @@ private:
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<HandlerDynamicParticipantData> m_dynPartData;
LOGGER_T m_logger;
};
} // namespace ReportManagement
@@ -30,7 +30,7 @@ CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate rep_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcRepCommon SHARED ${SRCS_common})
NGL_ADD_LIBRARY2(AAR SV WS svcRepCommon SHARED ${SRCS_common})
NGL_TARGET_INCLUDE_DIRECTORIES(svcRepCommon
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -60,7 +60,7 @@ SET(SRCS_client
# generate rep_[d|f]tc_impl.[cpp|h]
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV WS svcRepClient SHARED ${SRCS_client})
NGL_ADD_LIBRARY2(AAR SV WS svcRepClient SHARED ${SRCS_client})
NGL_TARGET_INCLUDE_DIRECTORIES(svcRepClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -88,7 +88,7 @@ SET(SRCS_server
# generate rep_[d|f]ts.h, rep_[d|f]ts_impl.[cpp|h]
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV svcRepServer SHARED ${SRCS_server})
NGL_ADD_LIBRARY2(AAR SV svcRepServer SHARED ${SRCS_server})
NGL_TARGET_INCLUDE_DIRECTORIES(svcRepServer
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
@@ -119,7 +119,7 @@ CREATE_TOPIC_TYPE_PLUGIN(${xml_FILE})
#
# Generate rep.sql, rep.xml
CODEGEN_SQL(SHARED_SRCS_exe ${xml_FILE})
NGL_ADD_LIBRARY(AAR SV svcRepCommonExecutable STATIC ${SHARED_SRCS_exe})
NGL_ADD_LIBRARY2(AAR SV svcRepCommonExecutable STATIC ${SHARED_SRCS_exe})
NGL_TARGET_LINK_LIBRARIES(svcRepCommonExecutable
PUBLIC
Qt6::Core
@@ -32,14 +32,13 @@ HandlerReportData::HandlerReportData(const std::shared_ptr<DdsHandler> &ddsHandl
, m_db(db)
, m_ppmDtc(nullptr)
, m_aesDtc(nullptr)
, m_logger(getLogger("HandlerReportData"))
{
} // end of ctor()
//-----------------------------------------------------------------------------
bool HandlerReportData::init()
{
INFO_LOG(m_logger) << "start init() DTC HandlerReportData ";
INFO_LOG() << "start init() DTC HandlerReportData ";
bool bRet = true;
auto cbReport = [this, &bRet](Database::RepReport dbData)
@@ -50,7 +49,7 @@ bool HandlerReportData::init()
if (ret.error())
{
delete ifs;
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
bRet = false;
return;
}
@@ -63,7 +62,7 @@ bool HandlerReportData::init()
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_ppmDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create PPM DTC";
ERROR_LOG() << "Could not create PPM DTC";
return false;
}
m_ppmDtc->enableParticipant();
@@ -73,7 +72,7 @@ bool HandlerReportData::init()
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_aesDtc == nullptr)
{
ERROR_LOG(m_logger) << "Could not create AES DTC";
ERROR_LOG() << "Could not create AES DTC";
return false;
}
m_aesDtc->enableMineArea();
@@ -98,7 +97,7 @@ QString HandlerReportData::intVecToString(const std::vector<int> &intVec)
void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdentity &cookie,
const CreateModifyReportRequest &request)
{
DEBUG_LOG(m_logger) << "onCreateModifyReportRequest" << request;
DEBUG_LOG() << "onCreateModifyReportRequest" << request;
m_updateReportCookie = cookie;
@@ -119,12 +118,12 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
ReportType repType = request.reportType(); // assuming this cannot be changed by this request
ok = removeReportData(reportId, repType); // remove old data
if (!ok)
WARNING_LOG(m_logger) << "Cannot remove old data for report id = " << reportId;
WARNING_LOG() << "Cannot remove old data for report id = " << reportId;
}
if (!insertReportData(request, reportId))
{
ERROR_LOG(m_logger) << "Error while creating report!";
ERROR_LOG() << "Error while creating report!";
m_reply.errorString(tr_lts("dds","Error while creating report"));
m_reply.replyState(Core::FtReplyState::Error);
m_reply.currentTime(QDateTime::currentMSecsSinceEpoch());
@@ -215,7 +214,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
default:
{
WARNING_LOG(m_logger) << "Report Type unknown, not generating.";
WARNING_LOG() << "Report Type unknown, not generating.";
break;
}
}
@@ -226,7 +225,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
objRep->removeObject();
m_objReportMap.remove(reportId);
ERROR_LOG(m_logger) << "Error generating report with type " << request.reportType();
ERROR_LOG() << "Error generating report with type " << request.reportType();
m_reply.errorString(tr_lts("dds", "Error generating report"));
m_reply.replyState(Core::FtReplyState::Error);
m_reply.currentTime(QDateTime::currentMSecsSinceEpoch());
@@ -245,7 +244,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request)
{
DEBUG_LOG(m_logger) << "onRemoveReportRequest " << request;
DEBUG_LOG() << "onRemoveReportRequest " << request;
int reportId = request.id();
@@ -263,7 +262,7 @@ void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &c
ret = ifs->removeObject();
if (ret.error())
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
else
{
// delete ObjectReportInfo
@@ -282,7 +281,7 @@ void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &c
//-----------------------------------------------------------------------------
bool HandlerReportData::removeReportData(int reportId, ReportType repType)
{
INFO_LOG(m_logger) << "IN removeReportData";
INFO_LOG() << "IN removeReportData";
bool ok = true;
@@ -364,13 +363,13 @@ bool HandlerReportData::removeReportData(int reportId, ReportType repType)
}
default:
{
WARNING_LOG(m_logger) << "Report Type unknown, cannot remove generated data";
WARNING_LOG() << "Report Type unknown, cannot remove generated data";
break;
}
}
if (!ok)
WARNING_LOG(m_logger) << "Could not remove old generated data for report id = " << reportId;
WARNING_LOG() << "Could not remove old generated data for report id = " << reportId;
return ok;
}
@@ -379,7 +378,7 @@ bool HandlerReportData::removeReportData(int reportId, ReportType repType)
void HandlerReportData::onReportChangeStatusRequest(const rti::core::SampleIdentity &cookie,
const ReportChangeStatusRequest &request)
{
DEBUG_LOG(m_logger) << "onReportChangeStatusRequest " << request;
DEBUG_LOG() << "onReportChangeStatusRequest " << request;
ObjectReportInfo *ifs = m_objReportMap.value(request.id());
if (ifs == nullptr)
{
@@ -389,7 +388,7 @@ void HandlerReportData::onReportChangeStatusRequest(const rti::core::SampleIdent
}
Core::FunctionReplyObject ret = ifs->changeStatus(request);
if (ret.error())
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
m_ddsHandler->fts()->reportChangeStatusReply(cookie, ret);
}
@@ -497,7 +496,7 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
if (ret.error())
{
delete ifs;
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
return false;
}
m_objReportMap.insert(ifs->getId(), ifs);
@@ -510,14 +509,14 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
ObjectReportInfo *ifs = m_objReportMap.value(reportId);
if (!ifs)
{
ERROR_LOG(m_logger) << "Report not found - report id = " << reportId;
ERROR_LOG() << "Report not found - report id = " << reportId;
return false;
}
Core::FunctionReplyObject ret = ifs->updateObject(data);
if (ret.error())
{
delete ifs;
ERROR_LOG(m_logger) << ret();
ERROR_LOG() << ret();
return false;
}
}
@@ -527,7 +526,7 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
// -----------------------------------------------------------------------------------
bool HandlerReportData::removeReportDataResult(int reportId, const QString &tableName)
{
DEBUG_LOG(m_logger) << "Start removeReportDataResult";
DEBUG_LOG() << "Start removeReportDataResult";
DBTransaction trans(m_db->database());
NSqlQuery q(m_db->database());
@@ -537,17 +536,17 @@ bool HandlerReportData::removeReportDataResult(int reportId, const QString &tabl
q.prepare(stmt);
q.bindValue(QStringLiteral(":reportId"), reportId);
DEBUG_LOG(m_logger) << "Statement: " << stmt;
DEBUG_LOG() << "Statement: " << stmt;
if (!q.exec())
{
ERROR_LOG(m_logger) << "Error removing report data for report id = " << reportId;
ERROR_LOG() << "Error removing report data for report id = " << reportId;
return false;
}
trans.commit();
DEBUG_LOG(m_logger) << " END removeReportDataResult";
DEBUG_LOG() << " END removeReportDataResult";
return true;
}
@@ -555,7 +554,7 @@ bool HandlerReportData::removeReportDataResult(int reportId, const QString &tabl
// -----------------------------------------------------------------------------------
void HandlerReportData::checkElapsedTimer(QElapsedTimer &t)
{
TRACE_LOG(m_logger) << "checkElapsedTimer ...";
TRACE_LOG() << "checkElapsedTimer ...";
if (t.elapsed() > 5 * 1000)
{
t.start();
@@ -566,7 +565,7 @@ void HandlerReportData::checkElapsedTimer(QElapsedTimer &t)
// -----------------------------------------------------------------------------------
void HandlerReportData::updateReportReply()
{
DEBUG_LOG(m_logger) << "updateReportReply: " << m_reply;
DEBUG_LOG() << "updateReportReply: " << m_reply;
m_reply.currentTime(QDateTime::currentMSecsSinceEpoch());
m_ddsHandler->fts()->createModifyReportReply(m_updateReportCookie, m_reply);
m_ddsHandler->pacemaker()->publishState();
@@ -317,7 +317,5 @@ class HandlerReportData final
rti::core::SampleIdentity m_updateReportCookie;
UpdateReportReply m_reply;
LOGGER_T m_logger;
};
} // namespace ReportManagement
@@ -26,7 +26,6 @@ HandlerReportGetData::HandlerReportGetData(const std::shared_ptr<DdsHandler> &dd
: Interface::Fts::GetReportDataRequestHandler(ddsHandler->fts())
, m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("HandlerReportGetData"))
{
}
@@ -43,7 +42,7 @@ void HandlerReportGetData::onGetReportDataRequest(const rti::core::SampleIdentit
if (ret.errorString().size() != 0)
{
Core::FunctionReplyObject fro(ret.id(), ret.errorString(), ret.errorParams());
WARNING_LOG(m_logger) << "error: " << fro();
WARNING_LOG() << "error: " << fro();
}
m_ddsHandler->fts()->getReportDataReply(cookie, ret);
}
@@ -51,7 +50,7 @@ void HandlerReportGetData::onGetReportDataRequest(const rti::core::SampleIdentit
//-----------------------------------------------------------------------------
GetReportDataReply HandlerReportGetData::getReportDataRequest(const GetReportDataRequest &request)
{
INFO_LOG(m_logger) << "IN onGetReportDataRequest";
INFO_LOG() << "IN onGetReportDataRequest";
// Get data per reportType
QByteArray reportData;
@@ -105,7 +104,7 @@ GetReportDataReply HandlerReportGetData::getReportDataRequest(const GetReportDat
reportData = getTreatmentTimelineResult(request.reportId());
break;
default:
WARNING_LOG(m_logger) << "Report Type unknown, no generating.";
WARNING_LOG() << "Report Type unknown, no generating.";
break;
}
@@ -446,14 +445,14 @@ QByteArray HandlerReportGetData::getSanitationMaterialResult(int reportId) const
QString stmt = QLatin1String("SELECT id, material_id, sanitation_unique_id, qualification, amount_start, amount_resupplied, amount_end, amount_used, duration FROM "
"rep_sanitation_material_result WHERE report_id = :reportId ORDER BY sanitation_unique_id, qualification, material_id");
DEBUG_LOG(m_logger) << " stmt: " << stmt;
DEBUG_LOG() << " stmt: " << stmt;
qSelect.prepare(stmt);
qSelect.bindValue(QLatin1String(":reportId"), reportId);
if (!qSelect.exec())
{
ERROR_LOG(m_logger) << "Couldn't select sanitation material result ";
ERROR_LOG() << "Couldn't select sanitation material result ";
return QByteArray();
}
@@ -55,7 +55,7 @@ private: // attributes
std::shared_ptr<DdsHandler> m_ddsHandler; ///< Pointer to DDS handler
std::shared_ptr<DatabaseInterface> m_db;
NGL::INGLLogger &m_logger; ///< Interface to the Logging-Facility
};
} // namespace ReportManagement
@@ -23,7 +23,6 @@ MainHandler::MainHandler(QObject *parent)
, m_ddsHandler(nullptr)
, m_dbHandler(nullptr)
, m_preService(nullptr)
, m_logger(getLogger("MainHandlerGenerator"))
{}
MainHandler::~MainHandler()
@@ -44,7 +44,5 @@ private:
std::shared_ptr<HandlerReportGetData> m_reportGetData;
//external
PresentationManagement::Initialization *m_preService;
LOGGER_T m_logger;
};
} // namespace ReportManagement
@@ -24,7 +24,6 @@ ObjectReportInfo::ObjectReportInfo(const std::shared_ptr<DdsHandler> &ddsHandler
: QObject(parent)
, m_ddsHandler(ddsHandler)
, m_db(db)
, m_logger(getLogger("ObjectReportInfo"))
{
}
@@ -51,7 +50,7 @@ Core::FunctionReplyObject ObjectReportInfo::createObject(Database::RepReport &db
return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting RepReport-data into database"));
m_data.id = dbData.id;
DEBUG_LOG(m_logger) << "New reportId: " << m_data.id;
DEBUG_LOG() << "New reportId: " << m_data.id;
}
// Publish Data via DTS
@@ -70,7 +69,7 @@ Core::FunctionReplyObject ObjectReportInfo::updateObject(const Database::RepRepo
return Core::FunctionReplyObject(dbData.id, tr_lts("dds", "Error updating RepReport-data into database"));
m_data = dbData;
DEBUG_LOG(m_logger) << "Data changed for reportId: " << m_data.id;
DEBUG_LOG() << "Data changed for reportId: " << m_data.id;
// Publish Data via DTS
onPublishData();
@@ -111,11 +110,11 @@ Core::FunctionReplyObject ObjectReportInfo::changeStatus(const ReportChangeStatu
//------------------------------------------------------------------------------
void ObjectReportInfo::onPublishData()
{
INFO_LOG(m_logger) << "Publish ReportInfo-data to dds (" << m_data.id << ") ...";
INFO_LOG() << "Publish ReportInfo-data to dds (" << m_data.id << ") ...";
ReportInfo data = toDdsData(m_data);
if (!m_ddsHandler->dts()->publish(data))
ERROR_LOG(m_logger) << "Error publishing ReportInfo-data to dds";
ERROR_LOG() << "Error publishing ReportInfo-data to dds";
}
// TODO: add in LtsUtils ?
@@ -9,7 +9,7 @@
#include <QObject>
#include "dds_handler.h"
#include <DDS/Core/function_reply_object.h>
#include <DDS/Core/core_types.h>
// Generated
#include <ReportManagement/rep_db.h>
@@ -30,7 +30,6 @@ RepTests::RepTests(QObject *parent)
, m_reportId(0)
, m_operatorId(100)
, m_bTestsSuccessful(true)
, m_logger(getLogger("Test"))
{
qRegisterMetaType<Core::FunctionReply>("Core::FunctionReply");
}
@@ -42,7 +41,7 @@ RepTests::~RepTests()
// ------------------------------------------------------------------
bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int operatorId)
{
INFO_LOG(m_logger) << "init begin";
INFO_LOG() << "init begin";
m_testId = testId;
m_exerciseId = exerciseId;
@@ -53,32 +52,32 @@ bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int
m_ddsConnector.reset(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, m_exerciseId));
if (!m_ddsConnector->init())
return false;
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
m_ddsConnector->initPublisherSubscriber();
// initialize database
m_dbHandler = std::make_shared<DbHandler>();
if(!m_dbHandler->init(m_exerciseId, Settings::settings()))
{
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
ERROR_LOG() << "Initialisation dbHandler failed.";
return false;
}
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
DEBUG_LOG() << "Initialisation dbHandler succesful.";
m_db = m_dbHandler->db();
DEBUG_LOG(m_logger) << "create dtc";
DEBUG_LOG() << "create dtc";
m_dtc = ReportManagement::Interface::Dtc::create(m_ddsConnector);
DEBUG_LOG(m_logger) << "create ftc";
DEBUG_LOG() << "create ftc";
m_ftc = ReportManagement::Interface::Ftc::create(m_ddsConnector);
DEBUG_LOG(m_logger) << "init ftc/dtc";
DEBUG_LOG() << "init ftc/dtc";
bool bRet = m_ftc->enableAll() && m_dtc->enableAll();
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
DEBUG_LOG() << "init end - bRet = " << bRet;
DEBUG_LOG(m_logger) << "Domain Id = " << domainId;
DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId;
DEBUG_LOG(m_logger) << "Test Id = " << testId;
DEBUG_LOG(m_logger) << "Report Id = " << reportId;
DEBUG_LOG(m_logger) << "Operator Id = " << operatorId;
DEBUG_LOG() << "Domain Id = " << domainId;
DEBUG_LOG() << "Exercise Id = " << exerciseId;
DEBUG_LOG() << "Test Id = " << testId;
DEBUG_LOG() << "Report Id = " << reportId;
DEBUG_LOG() << "Operator Id = " << operatorId;
//TODO: add connects
@@ -88,7 +87,7 @@ bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int
// ------------------------------------------------------------------
void RepTests::startTest()
{
INFO_LOG(m_logger) << "startTest";
INFO_LOG() << "startTest";
// create reports
if (m_testId == 11)
tryCreate(ReportManagement::ReportType::UnitPower);
@@ -145,7 +144,7 @@ void RepTests::startTest()
tryChangeStatus();
else
{
ERROR_LOG(m_logger) << "Unknown test case!";
ERROR_LOG() << "Unknown test case!";
failExit();
}
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
@@ -154,7 +153,7 @@ void RepTests::startTest()
// ------------------------------------------------------------------
void RepTests::tryCreate(ReportType repType, VisualisationType visType)
{
INFO_LOG(m_logger) << "trying to send createRequest Report";
INFO_LOG() << "trying to send createRequest Report";
CreateModifyReportRequest request;
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType.underlying());
@@ -481,14 +480,14 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
}
default:
{
ERROR_LOG(m_logger) << "Unknown report type!";
ERROR_LOG() << "Unknown report type!";
break;
}
}
if (!m_ftc->createModifyReportRequest(request, this))
{
ERROR_LOG(m_logger) << "Error requesting create data";
ERROR_LOG() << "Error requesting create data";
failExit();
}
QTest::qWait(2000);
@@ -497,7 +496,7 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
// ------------------------------------------------------------------
void RepTests::tryModify()
{
DEBUG_LOG(m_logger) << "trying to send modify request for report Id = " << m_reportId;
DEBUG_LOG() << "trying to send modify request for report Id = " << m_reportId;
m_dtc->waitForHistoricalDataReportInfo(1000);
ReportInfo rep = m_dtc->reportInfo(m_reportId);
@@ -527,22 +526,22 @@ void RepTests::tryModify()
request.fileStatus(ReportManagement::FileStatus::Valid);
request.lastModified(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG(m_logger) << "Start modify";
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType();
DEBUG_LOG() << "Start modify";
DEBUG_LOG() << "Report type = " << rep.reportType();
if (!m_ftc->createModifyReportRequest(request, this))
{
ERROR_LOG(m_logger) << "Error requesting modify data";
ERROR_LOG() << "Error requesting modify data";
failExit();
}
QTest::qWait(1000);
DEBUG_LOG(m_logger) << "AFTER modify";
DEBUG_LOG() << "AFTER modify";
}
// ------------------------------------------------------------------
void RepTests::tryGetData()
{
DEBUG_LOG(m_logger) << "trying to send get data request for report Id = " << m_reportId;
DEBUG_LOG() << "trying to send get data request for report Id = " << m_reportId;
GetReportDataRequest request;
request.reportId(m_reportId);
@@ -550,7 +549,7 @@ void RepTests::tryGetData()
if (!m_ftc->getReportDataRequest(request, this))
{
ERROR_LOG(m_logger) << "Error requesting modify data";
ERROR_LOG() << "Error requesting modify data";
failExit();
}
QTest::qWait(1000);
@@ -560,7 +559,7 @@ void RepTests::tryGetData()
// ------------------------------------------------------------------
void RepTests::tryChangeStatus()
{
DEBUG_LOG(m_logger) << "trying to send change status request for report Id = " << m_reportId;
DEBUG_LOG() << "trying to send change status request for report Id = " << m_reportId;
ReportChangeStatusRequest request;
request.id(m_reportId);
@@ -570,7 +569,7 @@ void RepTests::tryChangeStatus()
if (!m_ftc->reportChangeStatusRequest(request, this))
{
ERROR_LOG(m_logger) << "Error requesting change status";
ERROR_LOG() << "Error requesting change status";
failExit();
}
QTest::qWait(1000);
@@ -579,10 +578,10 @@ void RepTests::tryChangeStatus()
// ------------------------------------------------------------------
void RepTests::tryDelete()
{
INFO_LOG(m_logger) << "trying to send delete request for report Id = " << m_reportId;
INFO_LOG() << "trying to send delete request for report Id = " << m_reportId;
if (!m_ftc->removeReportRequest(RemoveReportRequest(m_reportId), this))
{
ERROR_LOG(m_logger) << "Error requesting delete data";
ERROR_LOG() << "Error requesting delete data";
failExit();
}
QTest::qWait(1000);
@@ -591,60 +590,60 @@ void RepTests::tryDelete()
// ------------------------------------------------------------------
void RepTests::onCreateModifyReportReply(const CreateModifyReportReply &replyObject)
{
DEBUG_LOG(m_logger) << "END (onCreateModifyReportReply)";
DEBUG_LOG() << "END (onCreateModifyReportReply)";
if (replyObject.errorString().size() > 0)
{
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString();
ERROR_LOG() << "Got onCreateModifyReportReply error: " << replyObject.errorString();
failExit();
return;
}
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id()
INFO_LOG() << "Got createModifyReply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString();
}
// ------------------------------------------------------------------
void RepTests::onRemoveReportReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG(m_logger) << "END (onRemoveReportReply)";
DEBUG_LOG() << "END (onRemoveReportReply)";
if (replyObject.error())
{
ERROR_LOG(m_logger) << "Got onRemoveReportReply error: " << replyObject();
ERROR_LOG() << "Got onRemoveReportReply error: " << replyObject();
failExit();
return;
}
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
INFO_LOG() << "Got removeReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
}
// ------------------------------------------------------------------
void RepTests::onGetReportDataReply(const GetReportDataReply &replyObject)
{
DEBUG_LOG(m_logger) << "END (onGetReportDataReply)";
DEBUG_LOG() << "END (onGetReportDataReply)";
if (replyObject.errorString().size() > 0)
{
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString();
ERROR_LOG() << "Got onGetReportDataReply error: " << replyObject.errorString();
failExit();
return;
}
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
INFO_LOG() << "Got createReply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString();
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData());
DEBUG_LOG(m_logger) << "Size reportData: " << reportData.size();
DEBUG_LOG() << "Size reportData: " << reportData.size();
}
// ------------------------------------------------------------------
void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG(m_logger) << "END (onReportChangeStatusReply)";
DEBUG_LOG() << "END (onReportChangeStatusReply)";
if (replyObject.error())
{
ERROR_LOG(m_logger) << "Got onReportChangeStatusReply error: " << replyObject();
ERROR_LOG() << "Got onReportChangeStatusReply error: " << replyObject();
failExit();
return;
}
INFO_LOG(m_logger) << "Got changeStatusReply with id " << replyObject.id()
INFO_LOG() << "Got changeStatusReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
}
@@ -652,7 +651,7 @@ void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyO
void RepTests::addTestDataTreatmentTimeline()
{
// Report Treatment Timeline
ERROR_LOG(m_logger) << "START addTestDataTreatmentTimeline" ;
ERROR_LOG() << "START addTestDataTreatmentTimeline" ;
ReportManagement::Database::RepTreatmentTimelineData resData;
resData.id = 10;
@@ -670,7 +669,7 @@ void RepTests::addTestDataTreatmentTimeline()
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -681,7 +680,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -694,7 +693,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -705,7 +704,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -716,7 +715,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -728,7 +727,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -739,7 +738,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -750,7 +749,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -764,7 +763,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -775,7 +774,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -786,7 +785,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -795,7 +794,7 @@ void RepTests::addTestDataTreatmentTimeline()
// ------------------------------------------------------------------------------
void RepTests::failExit()
{
ERROR_LOG(m_logger) << "FAIL EXIT !";
ERROR_LOG() << "FAIL EXIT !";
m_bTestsSuccessful = false;
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -16,16 +16,15 @@ namespace ReportManagement
DdsHandler::DdsHandler(int domainId, int exerciseId)
: QObject()
, m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
, m_logger(getLogger("DdsHandler"))
{
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
bool DdsHandler::init(bool bInitFts, const QStringList &qosFileList)
{
if (!m_ddsConnector->init(qosFileList))
{
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
ERROR_LOG() << "Error initializing dds connections - aborting";
return false;
}
@@ -39,11 +38,11 @@ bool DdsHandler::init(bool bInitFts, const QStringList &qosFileList)
m_ddsFts = ReportManagement::Interface::Fts::create(m_ddsConnector);
bool bRet = m_ddsDts->enableAll();
INFO_LOG(m_logger) << "Dts initialised";
INFO_LOG() << "Dts initialised";
if (bInitFts)
bRet &= m_ddsFts->enableAll(); // only needed for Generator, not Analyzer
INFO_LOG(m_logger) << "Fts initialised";
INFO_LOG() << "Fts initialised";
return bRet;
}
@@ -62,8 +62,6 @@ private:
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
std::shared_ptr<ReportManagement::Interface::Dts> m_ddsDts;
std::shared_ptr<ReportManagement::Interface::Fts> m_ddsFts;
NGL::INGLLogger &m_logger;
};
}
@@ -9,7 +9,7 @@
#pragma once
#include <NGLLogger/INGLLogger.h>
#include "rep_export.h"
#include "svcrepcommon_export.h"
namespace ReportManagement
{