Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -18,10 +18,9 @@
using namespace ReportManagement;
//-----------------------------------------------------------------------------
HandlerDynamicParticipantData::HandlerDynamicParticipantData(const std::shared_ptr<DdsHandler> &ddsHandler,
const std::shared_ptr<DatabaseInterface> &db)
: m_ddsHandler(ddsHandler)
, m_db(db)
{
const std::shared_ptr<DatabaseInterface> &db) : m_ddsHandler(ddsHandler)
, m_db(db),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -32,12 +31,12 @@ HandlerDynamicParticipantData::~HandlerDynamicParticipantData()
//-----------------------------------------------------------------------------
bool HandlerDynamicParticipantData::init()
{
DEBUG_LOG() << "Creating and initializing PPM DTC, AES DTC, PDM DTC ...";
DEBUG_LOG(m_logger) << "Creating and initializing PPM DTC, AES DTC, PDM DTC ...";
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_ppmDtc == nullptr)
{
ERROR_LOG() << "Could not create PPM DTC";
ERROR_LOG(m_logger) << "Could not create PPM DTC";
return false;
}
m_ppmDtc->enableType();
@@ -45,7 +44,7 @@ bool HandlerDynamicParticipantData::init()
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_aesDtc == nullptr)
{
ERROR_LOG() << "Could not create AES DTC";
ERROR_LOG(m_logger) << "Could not create AES DTC";
return false;
}
@@ -53,7 +52,7 @@ bool HandlerDynamicParticipantData::init()
m_gimDtc = GuezIedManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_gimDtc == nullptr)
{
ERROR_LOG() << "Could not create GIM DTC";
ERROR_LOG(m_logger) << "Could not create GIM DTC";
return false;
}
#endif
@@ -61,7 +60,7 @@ bool HandlerDynamicParticipantData::init()
m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_pdmDtc == nullptr)
{
ERROR_LOG() << "Could not create PDM DTC";
ERROR_LOG(m_logger) << "Could not create PDM DTC";
return false;
}
m_pdmDtc->enableChargeType();
@@ -80,7 +79,7 @@ bool HandlerDynamicParticipantData::init()
m_aesDtc->enableEffects();
m_aesDtc->waitForHistoricalDataEffects();
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
// read all aesItemViewData
m_aesDtc->aesItemViews([this](const AreaEffectSimulation::AesItemView &aiv) { onAesItemViewChanged(aiv, DataModification::eAdded); });
@@ -105,7 +104,7 @@ bool HandlerDynamicParticipantData::init()
this, &HandlerDynamicParticipantData::onIedChanged);
m_gimDtc->enableIed();
bool gg = m_gimDtc->waitForHistoricalDataIed();
DEBUG_LOG() << "waitForHistoricalDataIed = " << gg;
DEBUG_LOG(m_logger) << "waitForHistoricalDataIed = " << gg;
// read all aesItemViewData
m_gimDtc->ieds([this](const GuezIedManagement::Ied &ied) { onIedChanged(ied, DataModification::eAdded); });
#endif
@@ -114,7 +113,7 @@ bool HandlerDynamicParticipantData::init()
if (!m_bldDtc)
{
ERROR_LOG() << "Could not create DTC Buildings";
ERROR_LOG(m_logger) << "Could not create DTC Buildings";
return false;
}
@@ -129,7 +128,7 @@ bool HandlerDynamicParticipantData::init()
if (!m_ppmDtc->enableDynamicParticipantData())
{
ERROR_LOG() << "init() PPM failed";
ERROR_LOG(m_logger) << "init() PPM failed";
return false;
}
@@ -140,12 +139,12 @@ bool HandlerDynamicParticipantData::init()
if (!m_ppmDtc->enableParticipantGearEvent())
{
ERROR_LOG() << "init() PPM failed";
ERROR_LOG(m_logger) << "init() PPM failed";
return false;
}
#endif
DEBUG_LOG() << "... done";
DEBUG_LOG(m_logger) << "... done";
return true;
} // end of init()
@@ -158,7 +157,7 @@ void HandlerDynamicParticipantData::onParticipantChanged(const ParticipantManage
case DataModification::eAdded:
case DataModification::eModified:
m_partMap[data.id()] = data;
DEBUG_LOG() << "added/modified - data.participantId: " << data.id()
DEBUG_LOG(m_logger) << "added/modified - data.participantId: " << data.id()
<< ", data.partyId: " << data.partyId()
<< ", data.equipmentNumber: " << data.equipmentNumber();
break;
@@ -177,20 +176,20 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
case DataModification::eModified:
{
m_partPositionMap[data.participantId()] = data;
DEBUG_LOG() << "added/modified Participant Position - data.participantId: " << data.participantId()
DEBUG_LOG(m_logger) << "added/modified Participant Position - data.participantId: " << data.participantId()
<< ", data.pos: " << data.pos();
//TransportInitiated (mounted on vehicle)
if (data.mountedOn().is_set())
{
DEBUG_LOG() << "Mounted on : " << data.mountedOn().get();
DEBUG_LOG(m_logger) << "Mounted on : " << data.mountedOn().get();
if (m_isMounted.contains(data.participantId()))
break;
m_isMounted.append(data.participantId());
DEBUG_LOG() << "Added mounted participant id " << data.participantId();
DEBUG_LOG(m_logger) << "Added mounted participant id " << data.participantId();
qint64 timeMounted = getLastSignificantPositionMountedChanged(data.participantId(), data.sampleTime(), data.pos());
if (timeMounted <= 0)
@@ -208,13 +207,13 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
ttData.eventTypeId = ReportManagement::EventType::TransportInitiated;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
WARNING_LOG() << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
WARNING_LOG(m_logger) << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
}
else
{
if (m_isMounted.contains(data.participantId()))
{
DEBUG_LOG() << "Removed mounted participant id " << data.participantId();
DEBUG_LOG(m_logger) << "Removed mounted participant id " << data.participantId();
m_isMounted.remove(m_isMounted.indexOf(data.participantId()));
}
}
@@ -223,7 +222,7 @@ void HandlerDynamicParticipantData::onParticipantPositionChanged(const Participa
}
case DataModification::eRemoved:
{
DEBUG_LOG() << "Removed participant id " << data.participantId();
DEBUG_LOG(m_logger) << "Removed participant id " << data.participantId();
if (m_isMounted.contains(data.participantId()))
m_isMounted.remove(m_isMounted.indexOf(data.participantId()));
m_partPositionMap.remove(data.participantId());
@@ -239,7 +238,7 @@ void HandlerDynamicParticipantData::onAesItemViewChanged(const AreaEffectSimulat
{
case DataModification::eAdded:
case DataModification::eModified:
DEBUG_LOG() << "added/modified data.aesItemId(): " << data.aesItemId();
DEBUG_LOG(m_logger) << "added/modified data.aesItemId(): " << data.aesItemId();
m_aesItemViewMap[data.aesItemId()] = data;
break;
case DataModification::eRemoved:
@@ -258,7 +257,7 @@ void HandlerDynamicParticipantData::onIedChanged(const GuezIedManagement::Ied &d
{
case DataModification::eAdded:
case DataModification::eModified:
DEBUG_LOG() << "added/modified data.id(): " << data.id();
DEBUG_LOG(m_logger) << "added/modified data.id(): " << data.id();
m_iedMap[data.id()] = data;
break;
case DataModification::eRemoved:
@@ -275,7 +274,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG() << "onDynamicParticipantDataChanged(): "
DEBUG_LOG(m_logger) << "onDynamicParticipantDataChanged(): "
<< " participantId: " << data.participantId()
<< ", size stateHistory: " << data.stateHistory().size()
<< ", size sanMatStock: " << data.sanitationMaterialStock().size();
@@ -298,7 +297,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
itParticipant = m_partMap.constFind(data.participantId());
if (itParticipant == m_partMap.constEnd())
{
WARNING_LOG() << "Participant does not exist: participantId: " << data.participantId();
WARNING_LOG(m_logger) << "Participant does not exist: participantId: " << data.participantId();
return;
}
}
@@ -370,16 +369,16 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (data.stateHistory().size() > 0 && data.stateHistory() != lastDynData.stateHistory())
{
INFO_LOG() << "PROCESSING: stateHistory.size() = " << data.stateHistory().size() << " for participant id = " << data.participantId();
INFO_LOG(m_logger) << "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() << "vulnerabilityState: " << vulnState;
DEBUG_LOG(m_logger) << "vulnerabilityState: " << vulnState;
if (stateInfo.originatorChargeTypeId() > 0)
DEBUG_LOG() << "originatorChargeTypeId: " << stateInfo.originatorChargeTypeId();
DEBUG_LOG() << "originatorType: " << stateInfo.originatorType();
DEBUG_LOG() << "vulnerabilityBits: " << stateInfo.vulnerabilityBits();
DEBUG_LOG(m_logger) << "originatorChargeTypeId: " << stateInfo.originatorChargeTypeId();
DEBUG_LOG(m_logger) << "originatorType: " << stateInfo.originatorType();
DEBUG_LOG(m_logger) << "vulnerabilityBits: " << stateInfo.vulnerabilityBits();
//counting NearMiss and HitWithNoEffect as CombatReady, after discussion with Ulli 08.2021
bool isCombatReady = (vulnState == ProjectDataManagement::VulnerabilityState::CombatReady ||
@@ -401,7 +400,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
{
// Save Treatment Data
if (!m_db->insert(tData))
ERROR_LOG() << "Error while inserting treatment data - participantId: " << tData.participantId;
ERROR_LOG(m_logger) << "Error while inserting treatment data - participantId: " << tData.participantId;
}
// Report Firings
@@ -424,7 +423,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
// Save UnitPower Data
if (!m_db->insert(upData))
ERROR_LOG() << "Error while inserting unit power data - participantId: " << upData.participantId;
ERROR_LOG(m_logger) << "Error while inserting unit power data - participantId: " << upData.participantId;
// Report Mine Area / Report Firings / Report AirSupport
if (vulnState != ProjectDataManagement::VulnerabilityState::CombatReady)
@@ -450,7 +449,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save direct firings data
if (!m_db->insert(fData))
ERROR_LOG() << "Error while inserting direct firings data into db for event_time = " << fData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting direct firings data into db for event_time = " << fData.eventTime;
//save TreatmentTimeline events too
{
@@ -466,7 +465,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -477,7 +476,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
}
@@ -487,7 +486,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation && stateInfo.originatorChargeTypeId() != 0)
{
const AreaEffectSimulation::AesItemView aesItemView = getAesItemView(stateInfo.originatorId());
DEBUG_LOG() << "Found indirect fire from AES id = " << stateInfo.originatorId() << ", charge type = " << stateInfo.originatorChargeTypeId();
DEBUG_LOG(m_logger) << "Found indirect fire from AES id = " << stateInfo.originatorId() << ", charge type = " << stateInfo.originatorChargeTypeId();
if (aesItemView.id() > 0)
{
if (aesItemView.partyId().is_set())
@@ -502,11 +501,11 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save indirect firings data
if (!m_db->insert(fData))
ERROR_LOG() << "Error while inserting indirect firings data into db for event_time = " << fData.eventTime;
ERROR_LOG(m_logger) << "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() << "Error while inserting indirect firings (for airSupport report) into db for event_time = " << airSupData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting indirect firings (for airSupport report) into db for event_time = " << airSupData.eventTime;
//save TreatmentTimeline events too
{
@@ -522,7 +521,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -533,7 +532,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
}
@@ -551,7 +550,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
// Save explosive device data
if (!m_db->insert(fData))
ERROR_LOG() << "Error while inserting explosive device data into db for event_time = " << fData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting explosive device data into db for event_time = " << fData.eventTime;
}
#endif
@@ -569,25 +568,25 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
else
nbcData.hit = 0;
DEBUG_LOG() << "nbcData.hit: " << nbcData.hit;
DEBUG_LOG(m_logger) << "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() << "Originator = AreaEffectSimulation or FunctionalArea";
INFO_LOG(m_logger) << "Originator = AreaEffectSimulation or FunctionalArea";
mbData.mineAreaId = stateInfo.originatorId();
nbcData.nbcId = stateInfo.originatorId();
DEBUG_LOG() << "aesItemViewMap.size(): " << m_aesItemViewMap.size();
DEBUG_LOG(m_logger) << "aesItemViewMap.size(): " << m_aesItemViewMap.size();
const AreaEffectSimulation::AesItemView aesItemView = getAesItemView(nbcData.nbcId);
DEBUG_LOG() << "aesItemView.id() = " << aesItemView.id();
DEBUG_LOG(m_logger) << "aesItemView.id() = " << aesItemView.id();
if (aesItemView.id() > 0)
{
AreaEffectSimulation::AesType aesType = aesItemView.aesTypeId();
DEBUG_LOG() << "AesType: " << aesType;
DEBUG_LOG(m_logger) << "AesType: " << aesType;
if (aesItemView.partyId().is_set())
mbData.mineAreaPartyId = aesItemView.partyId().get();
@@ -604,9 +603,9 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
mbData.mineAreaId = aesItemView.aesItemId();
if (mbData.mineAreaId > 0)
{
DEBUG_LOG() << "Inserting Mine Area Data";
DEBUG_LOG(m_logger) << "Inserting Mine Area Data";
if (!m_db->insert(mbData))
ERROR_LOG() << "Error while inserting mine area data participantId: " << mbData.participantId;
ERROR_LOG(m_logger) << "Error while inserting mine area data participantId: " << mbData.participantId;
}
}
if (aesType == AreaEffectSimulation::AesType::AtBCContamination ||
@@ -618,9 +617,9 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
nbcData.chargeTypeId = aesItemView.chargeStruct().chargeTypeId();
if (nbcData.nbcId > 0 && nbcData.chargeTypeId > 0)
{
DEBUG_LOG() << "Inserting NBC Data";
DEBUG_LOG(m_logger) << "Inserting NBC Data";
if (!m_db->insert(nbcData))
ERROR_LOG() << "Error while inserting nbc data participant: " << nbcData.participantId;
ERROR_LOG(m_logger) << "Error while inserting nbc data participant: " << nbcData.participantId;
}
}
@@ -632,7 +631,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
vrData.timePositionChanged = getLastSignificantParticipantPositionChanged(vrData.participantId, vrData.timeEvent, getLastPosition(vrData.participantId));
if (!m_db->insert(vrData))
ERROR_LOG() << "Error while inserting maintenance data for participantId: " << vrData.participantId;
ERROR_LOG(m_logger) << "Error while inserting maintenance data for participantId: " << vrData.participantId;
// treatment timeline event EnterFunctionalArea
ttData.vulnerabilityState = stateInfo.vulnerabilityState().underlying();
@@ -654,7 +653,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event EnterFunctionalArea for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event EnterFunctionalArea for participantId: " << ttData.participantId;
}
}
@@ -664,7 +663,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
// Treatment reports
if (stateInfo.originatorType() == ProjectDataManagement::StateChangeOriginator::Sanitation)
{
DEBUG_LOG() << "Sanitation";
DEBUG_LOG(m_logger) << "Sanitation";
// Sanitation info only for Human type class
ParticipantManagement::TypeClass typeClass = m_ppmDtc->type(pData.typeId()).typeClass();
if (typeClass == ParticipantManagement::TypeClass::Human)
@@ -719,7 +718,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
toAdd = false;
if (toAdd && !m_db->insert(tData))
ERROR_LOG() << "Error while inserting treatment data for participantId: " << tData.participantId;
ERROR_LOG(m_logger) << "Error while inserting treatment data for participantId: " << tData.participantId;
// now treatment timeline events
{
@@ -735,7 +734,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VBGChanged for participantId: " << ttData.participantId;
}
// VitalityChanged
@@ -746,7 +745,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityChanged;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VitalityChanged for participantId: " << ttData.participantId;
}
// Treatment
@@ -758,7 +757,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event Treatment for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event Treatment for participantId: " << ttData.participantId;
/*
//TransportInitiated (mounted on vehicle)
@@ -769,7 +768,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::TransportInitiated;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event TransportInitiated for participantId: " << ttData.participantId;
}
*/
}
@@ -790,7 +789,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::NineLinerSet;
ttData.id = 0; //force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event NineLinerSet for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event NineLinerSet for participantId: " << ttData.participantId;
}
else if (stateInfo.originatorChargeTypeId() == 2) // Transport Requested
{
@@ -799,7 +798,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::TransportRequested;
ttData.id = 0; //force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event TransportRequested for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event TransportRequested for participantId: " << ttData.participantId;
}
}
@@ -816,7 +815,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::SetInjury;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event SetInjury for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event SetInjury for participantId: " << ttData.participantId;
}
// Vitality and Vulnerability reset manually
@@ -830,7 +829,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VitalityReset;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VitalityReset for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VitalityReset for participantId: " << ttData.participantId;
}
#ifdef GUEZ_MODE
@@ -844,7 +843,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
ttData.eventTypeId = ReportManagement::EventType::VBGSet;
ttData.id = 0; // force insert
if (!m_db->insert(ttData))
ERROR_LOG() << "Error while inserting Event VBGSet for participantId: " << ttData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event VBGSet for participantId: " << ttData.participantId;
}
#endif
@@ -853,7 +852,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
else
DEBUG_LOG() << "No new state history for participant id = " << data.participantId();
DEBUG_LOG(m_logger) << "No new state history for participant id = " << data.participantId();
// Report Charge Resupply
@@ -893,7 +892,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
crData.chargeRemain = gi.remain();
if (crData.chargeTypeId != gi.chargeTypeId())
WARNING_LOG() << "OLD charge id " << gi.chargeTypeId() << " changed in NEW id " << crData.chargeTypeId;
WARNING_LOG(m_logger) << "OLD charge id " << gi.chargeTypeId() << " changed in NEW id " << crData.chargeTypeId;
QPair<int, int> pair;
pair.first = gi.gearTypeId();
@@ -907,11 +906,11 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
gearMap.insert(pair, gi.remain());
DEBUG_LOG() << "gearTypeId: " << crData.gearTypeId << ", chargeTypeId: " << crData.chargeTypeId;
DEBUG_LOG(m_logger) << "gearTypeId: " << crData.gearTypeId << ", chargeTypeId: " << crData.chargeTypeId;
crData.id = 0; // to force insert without id
if (!m_db->insert(crData))
ERROR_LOG() << "Error while inserting charge resupply data for participant: " << data.participantId();
ERROR_LOG(m_logger) << "Error while inserting charge resupply data for participant: " << data.participantId();
}
// Has Turm/Wanne Map been filled?
@@ -929,14 +928,14 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
}
gearMap.insert(pair, turmWanneCrData.chargeRemain);
INFO_LOG() << "Inserting TurmWanne data gearTypeId: " << turmWanneCrData.gearTypeId
INFO_LOG(m_logger) << "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() << "Error while inserting (turm/wanne) charge resupply data for participant: " << data.participantId();
ERROR_LOG(m_logger) << "Error while inserting (turm/wanne) charge resupply data for participant: " << data.participantId();
}
@@ -946,7 +945,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
for (auto it = gearMap.begin(); it != gearMap.end(); ++it)
{
QPair<int, int> pair = it.key();
DEBUG_LOG() << "gearTypeId: " << pair.first << ", chargeTypeId: " << pair.second;
DEBUG_LOG(m_logger) << "gearTypeId: " << pair.first << ", chargeTypeId: " << pair.second;
if (!containsGearTypeId(data.gear(), pair.first, pair.second))
{
crData.chargeTypeId = -2;
@@ -954,14 +953,14 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
crData.id = 0; // to force insert without id
if (!m_db->insert(crData))
ERROR_LOG() << "Error while inserting charge resupply data for participant: " << data.participantId();
ERROR_LOG(m_logger) << "Error while inserting charge resupply data for participant: " << data.participantId();
}
}
// Report Sanitation Material
if (data.sanitationMaterialStock().size() > 0)
{
INFO_LOG() << "sanitationMaterialStock.size() = " << data.sanitationMaterialStock().size() << " for participant id = " << data.participantId();
INFO_LOG(m_logger) << "sanitationMaterialStock.size() = " << data.sanitationMaterialStock().size() << " for participant id = " << data.participantId();
Database::RepSanitationMaterialData sanData;
@@ -972,7 +971,7 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
sanData.sanitationUniqueId = data.sanitationUniqueId();
sanData.qualification = data.qualification().underlying();
DEBUG_LOG() << "Qualification = " << sanData.qualification;
DEBUG_LOG(m_logger) << "Qualification = " << sanData.qualification;
for ( ParticipantManagement::SanitationMaterial sanMat : std::as_const(data.sanitationMaterialStock()))
{
@@ -980,10 +979,10 @@ void HandlerDynamicParticipantData::onDynamicParticipantDataChanged(const Partic
sanData.materialAmount = sanMat.materialCount();
sanData.id = 0; // to force insert
DEBUG_LOG() << "Inserting SanMat data for participant id = " << data.participantId() << " , materialId = " << sanData.materialId << ", stock = " << sanData.materialAmount;
DEBUG_LOG(m_logger) << "Inserting SanMat data for participant id = " << data.participantId() << " , materialId = " << sanData.materialId << ", stock = " << sanData.materialAmount;
if (!m_db->insert(sanData))
ERROR_LOG() << "Error while inserting sanitation material data for participant: " << data.participantId();
ERROR_LOG(m_logger) << "Error while inserting sanitation material data for participant: " << data.participantId();
}
}
@@ -1011,7 +1010,7 @@ void HandlerDynamicParticipantData::onBuildingStateChanged(const Buildings::Buil
airSupData.eventTime = data.sampleTime();
if (!m_db->insert(airSupData))
ERROR_LOG() << "Error while inserting building state data into db for event_time = " << airSupData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting building state data into db for event_time = " << airSupData.eventTime;
} // end of onBuildingStateChanged
@@ -1042,7 +1041,7 @@ void HandlerDynamicParticipantData::onAesEffectsChanged(const AreaEffectSimulati
}
if (!m_db->insert(impData))
ERROR_LOG() << "Error while inserting air support impact data into db for event_time = " << impData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting air support impact data into db for event_time = " << impData.eventTime;
} // end of onAesEffectsChanged
@@ -1070,7 +1069,7 @@ bool HandlerDynamicParticipantData::checkVulnerabilityStateChange(ProjectDataMan
// No change?
if (it.value() == vulnState)
{
INFO_LOG() << "Same vulnerabilityState: " << vulnState;
INFO_LOG(m_logger) << "Same vulnerabilityState: " << vulnState;
return false;
}
@@ -1085,10 +1084,10 @@ AreaEffectSimulation::AesItemView HandlerDynamicParticipantData::getAesItemView(
{
// make sure we have all data
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
auto ret = m_aesDtc->aesItemView(effectSimulationId);
DEBUG_LOG() << "ret.id() = " << ret.id();
DEBUG_LOG(m_logger) << "ret.id() = " << ret.id();
if (ret.id() == effectSimulationId)
{
@@ -1097,7 +1096,7 @@ AreaEffectSimulation::AesItemView HandlerDynamicParticipantData::getAesItemView(
}
else
{
DEBUG_LOG() << "Not found effectSimulationId = " << effectSimulationId;
DEBUG_LOG(m_logger) << "Not found effectSimulationId = " << effectSimulationId;
return AreaEffectSimulation::AesItemView();
}
@@ -1114,21 +1113,21 @@ QString HandlerDynamicParticipantData::getAesName(int effectSimulationId)
{
// make sure we have all data
bool ww = m_aesDtc->waitForHistoricalDataAesItemView();
DEBUG_LOG() << "waitForHistoricalDataAesItemView = " << ww;
DEBUG_LOG(m_logger) << "waitForHistoricalDataAesItemView = " << ww;
auto aesItemView = getAesItemView(effectSimulationId);
ERROR_LOG() << "aesType: " << aesItemView.aesTypeId().underlying();
ERROR_LOG(m_logger) << "aesType: " << aesItemView.aesTypeId().underlying();
if (aesItemView.aesTypeId() == AreaEffectSimulation::AesType_def::AtExplosionCluster)
{
QString aesName = QString::fromStdString(m_aesDtc->explosionCluster(effectSimulationId).name());
ERROR_LOG() << "ExplosionCluster aesName: " << aesName;
ERROR_LOG(m_logger) << "ExplosionCluster aesName: " << aesName;
m_aesNamesMap.insert(effectSimulationId, aesName);
return aesName;
}
else
{
QString aesName = QString::fromStdString(m_aesDtc->airSupportImpact(effectSimulationId).name());
ERROR_LOG() << "AirSupport aesName: " << aesName;
ERROR_LOG(m_logger) << "AirSupport aesName: " << aesName;
m_aesNamesMap.insert(effectSimulationId, aesName);
return aesName;
}
@@ -1160,9 +1159,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() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1170,7 +1169,7 @@ qint32 HandlerDynamicParticipantData::lastVitality(int participantId, qint64 cur
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return vit;
}
@@ -1190,9 +1189,9 @@ qint32 HandlerDynamicParticipantData::lastVulnerabilityKind(int participantId, q
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC LIMIT 1");
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1200,7 +1199,7 @@ qint32 HandlerDynamicParticipantData::lastVulnerabilityKind(int participantId, q
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return vuln;
}
@@ -1222,7 +1221,7 @@ Core::GeoPosition HandlerDynamicParticipantData::getLastPosition(int participant
m_ppmDtc->waitForHistoricalDataParticipantPosition();
itParticipant = m_partPositionMap.constFind(participantId);
if (itParticipant == m_partPositionMap.constEnd())
WARNING_LOG() << "Participant position not found for participantId: " << participantId;
WARNING_LOG(m_logger) << "Participant position not found for participantId: " << participantId;
}
else
return itParticipant.value().pos();
@@ -1240,9 +1239,9 @@ qint64 HandlerDynamicParticipantData::getLastSignificantParticipantPositionChang
"WHERE participant_id = :participantId AND (sample_time <= :currTime) "
"ORDER by sample_time DESC");
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1250,7 +1249,7 @@ qint64 HandlerDynamicParticipantData::getLastSignificantParticipantPositionChang
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return time_changed;
}
@@ -1277,9 +1276,9 @@ qint64 HandlerDynamicParticipantData::getLastSignificantPositionMountedChanged(i
"WHERE participant_id = :participantId AND (sample_time <= :currTime) AND mounted_on > 0 "
"ORDER by sample_time DESC");
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG(m_logger) << "Statement: " << stmtSelect;
DEBUG_LOG(m_logger) << "Participant Id = " << participantId;
DEBUG_LOG(m_logger) << "Time = " << currTime;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1287,7 +1286,7 @@ qint64 HandlerDynamicParticipantData::getLastSignificantPositionMountedChanged(i
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return time_changed;
}
@@ -1310,7 +1309,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG() << "onParticipantGearEventChanged(): "
DEBUG_LOG(m_logger) << "onParticipantGearEventChanged(): "
<< " participantId: " << data.participantId();
// Report Firings
@@ -1328,7 +1327,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
itOParticipant = m_partMap.constFind(fData.participantId);
if (itOParticipant == m_partMap.constEnd())
{
WARNING_LOG() << "Originator participant does not exist: Id = " << fData.participantId;
WARNING_LOG(m_logger) << "Originator participant does not exist: Id = " << fData.participantId;
return;
}
}
@@ -1346,7 +1345,7 @@ void HandlerDynamicParticipantData::onParticipantGearEventChanged(const Particip
// Save firings data
if (!m_db->insert(fData))
ERROR_LOG() << "Error while inserting ParticipantGearEvent firings data into db for event_time = " << fData.eventTime;
ERROR_LOG(m_logger) << "Error while inserting ParticipantGearEvent firings data into db for event_time = " << fData.eventTime;
}
@@ -1378,11 +1377,11 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC");
DEBUG_LOG() << "!!! sinceWhenVitality";
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG() << "Vitality = " << vitality;
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;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1390,7 +1389,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return time;
}
@@ -1406,7 +1405,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVitality(int participantId, int v
break;
}
DEBUG_LOG() << "### Recalculated time vitality = " << time;
DEBUG_LOG(m_logger) << "### Recalculated time vitality = " << time;
return time;
}
@@ -1422,11 +1421,11 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
"WHERE participant_id = :participantId AND (event_time <= :currTime) "
"ORDER BY event_time DESC");
DEBUG_LOG() << "!!! sinceWhenVulnerability";
DEBUG_LOG() << "Statement: " << stmtSelect;
DEBUG_LOG() << "Participant Id = " << participantId;
DEBUG_LOG() << "Time = " << currTime;
DEBUG_LOG() << "Vulnerability = " << vulnerability;
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;
qSelect.prepare(stmtSelect);
qSelect.bindValue(QStringLiteral(":currTime"), currTime);
@@ -1434,14 +1433,14 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
if (!qSelect.exec())
{
ERROR_LOG() << "Error selecting data for participant id = " << participantId;
ERROR_LOG(m_logger) << "Error selecting data for participant id = " << participantId;
return time;
}
while (qSelect.next())
{
int vuln = qSelect.value(1).toInt();
DEBUG_LOG() << "Checking - time = " << qSelect.value(0).toLongLong() << ", vuln = " << vuln;
DEBUG_LOG(m_logger) << "Checking - time = " << qSelect.value(0).toLongLong() << ", vuln = " << vuln;
if (vuln == vulnerability)
{
time = qSelect.value(0).toLongLong();
@@ -1451,7 +1450,7 @@ qint64 HandlerDynamicParticipantData::sinceWhenVulnerability(int participantId,
break;
}
DEBUG_LOG() << "### Recalculated time vulnerability = " << time;
DEBUG_LOG(m_logger) << "### Recalculated time vulnerability = " << time;
return time;
}
@@ -15,12 +15,11 @@
namespace ReportManagement
{
MainHandler::MainHandler(QObject *parent)
: QObject(parent)
MainHandler::MainHandler(QObject *parent) : QObject(parent)
, m_ddsHandler(nullptr)
, m_dbHandler(nullptr)
, m_dynPartData(nullptr)
{}
, m_dynPartData(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
MainHandler::~MainHandler()
{
@@ -32,6 +32,8 @@ public:
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<HandlerDynamicParticipantData> m_dynPartData;
@@ -38,7 +38,7 @@ HandlerReportData::HandlerReportData(const std::shared_ptr<DdsHandler> &ddsHandl
//-----------------------------------------------------------------------------
bool HandlerReportData::init()
{
INFO_LOG() << "start init() DTC HandlerReportData ";
INFO_LOG(m_logger) << "start init() DTC HandlerReportData ";
bool bRet = true;
auto cbReport = [this, &bRet](Database::RepReport dbData)
@@ -49,7 +49,7 @@ bool HandlerReportData::init()
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
bRet = false;
return;
}
@@ -62,7 +62,7 @@ bool HandlerReportData::init()
m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_ppmDtc == nullptr)
{
ERROR_LOG() << "Could not create PPM DTC";
ERROR_LOG(m_logger) << "Could not create PPM DTC";
return false;
}
m_ppmDtc->enableParticipant();
@@ -72,7 +72,7 @@ bool HandlerReportData::init()
m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector());
if (m_aesDtc == nullptr)
{
ERROR_LOG() << "Could not create AES DTC";
ERROR_LOG(m_logger) << "Could not create AES DTC";
return false;
}
m_aesDtc->enableMineArea();
@@ -97,7 +97,7 @@ QString HandlerReportData::intVecToString(const std::vector<int> &intVec)
void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdentity &cookie,
const CreateModifyReportRequest &request)
{
DEBUG_LOG() << "onCreateModifyReportRequest" << request;
DEBUG_LOG(m_logger) << "onCreateModifyReportRequest" << request;
m_updateReportCookie = cookie;
@@ -118,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() << "Cannot remove old data for report id = " << reportId;
WARNING_LOG(m_logger) << "Cannot remove old data for report id = " << reportId;
}
if (!insertReportData(request, reportId))
{
ERROR_LOG() << "Error while creating report!";
ERROR_LOG(m_logger) << "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());
@@ -214,7 +214,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
default:
{
WARNING_LOG() << "Report Type unknown, not generating.";
WARNING_LOG(m_logger) << "Report Type unknown, not generating.";
break;
}
}
@@ -225,7 +225,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
objRep->removeObject();
m_objReportMap.remove(reportId);
ERROR_LOG() << "Error generating report with type " << request.reportType();
ERROR_LOG(m_logger) << "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());
@@ -244,7 +244,7 @@ void HandlerReportData::onCreateModifyReportRequest(const rti::core::SampleIdent
void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request)
{
DEBUG_LOG() << "onRemoveReportRequest " << request;
DEBUG_LOG(m_logger) << "onRemoveReportRequest " << request;
int reportId = request.id();
@@ -262,7 +262,7 @@ void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &c
ret = ifs->removeObject();
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
else
{
// delete ObjectReportInfo
@@ -281,7 +281,7 @@ void HandlerReportData::onRemoveReportRequest(const rti::core::SampleIdentity &c
//-----------------------------------------------------------------------------
bool HandlerReportData::removeReportData(int reportId, ReportType repType)
{
INFO_LOG() << "IN removeReportData";
INFO_LOG(m_logger) << "IN removeReportData";
bool ok = true;
@@ -363,13 +363,13 @@ bool HandlerReportData::removeReportData(int reportId, ReportType repType)
}
default:
{
WARNING_LOG() << "Report Type unknown, cannot remove generated data";
WARNING_LOG(m_logger) << "Report Type unknown, cannot remove generated data";
break;
}
}
if (!ok)
WARNING_LOG() << "Could not remove old generated data for report id = " << reportId;
WARNING_LOG(m_logger) << "Could not remove old generated data for report id = " << reportId;
return ok;
}
@@ -378,7 +378,7 @@ bool HandlerReportData::removeReportData(int reportId, ReportType repType)
void HandlerReportData::onReportChangeStatusRequest(const rti::core::SampleIdentity &cookie,
const ReportChangeStatusRequest &request)
{
DEBUG_LOG() << "onReportChangeStatusRequest " << request;
DEBUG_LOG(m_logger) << "onReportChangeStatusRequest " << request;
ObjectReportInfo *ifs = m_objReportMap.value(request.id());
if (ifs == nullptr)
{
@@ -388,7 +388,7 @@ void HandlerReportData::onReportChangeStatusRequest(const rti::core::SampleIdent
}
Core::FunctionReplyObject ret = ifs->changeStatus(request);
if (ret.error())
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
m_ddsHandler->fts()->reportChangeStatusReply(cookie, ret);
}
@@ -496,7 +496,7 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
return false;
}
m_objReportMap.insert(ifs->getId(), ifs);
@@ -509,14 +509,14 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
ObjectReportInfo *ifs = m_objReportMap.value(reportId);
if (!ifs)
{
ERROR_LOG() << "Report not found - report id = " << reportId;
ERROR_LOG(m_logger) << "Report not found - report id = " << reportId;
return false;
}
Core::FunctionReplyObject ret = ifs->updateObject(data);
if (ret.error())
{
delete ifs;
ERROR_LOG() << ret();
ERROR_LOG(m_logger) << ret();
return false;
}
}
@@ -526,7 +526,7 @@ bool HandlerReportData::insertReportData(const CreateModifyReportRequest &reques
// -----------------------------------------------------------------------------------
bool HandlerReportData::removeReportDataResult(int reportId, const QString &tableName)
{
DEBUG_LOG() << "Start removeReportDataResult";
DEBUG_LOG(m_logger) << "Start removeReportDataResult";
DBTransaction trans(m_db->database());
NSqlQuery q(m_db->database());
@@ -536,17 +536,17 @@ bool HandlerReportData::removeReportDataResult(int reportId, const QString &tabl
q.prepare(stmt);
q.bindValue(QStringLiteral(":reportId"), reportId);
DEBUG_LOG() << "Statement: " << stmt;
DEBUG_LOG(m_logger) << "Statement: " << stmt;
if (!q.exec())
{
ERROR_LOG() << "Error removing report data for report id = " << reportId;
ERROR_LOG(m_logger) << "Error removing report data for report id = " << reportId;
return false;
}
trans.commit();
DEBUG_LOG() << " END removeReportDataResult";
DEBUG_LOG(m_logger) << " END removeReportDataResult";
return true;
}
@@ -554,7 +554,7 @@ bool HandlerReportData::removeReportDataResult(int reportId, const QString &tabl
// -----------------------------------------------------------------------------------
void HandlerReportData::checkElapsedTimer(QElapsedTimer &t)
{
TRACE_LOG() << "checkElapsedTimer ...";
TRACE_LOG(m_logger) << "checkElapsedTimer ...";
if (t.elapsed() > 5 * 1000)
{
t.start();
@@ -565,7 +565,7 @@ void HandlerReportData::checkElapsedTimer(QElapsedTimer &t)
// -----------------------------------------------------------------------------------
void HandlerReportData::updateReportReply()
{
DEBUG_LOG() << "updateReportReply: " << m_reply;
DEBUG_LOG(m_logger) << "updateReportReply: " << m_reply;
m_reply.currentTime(QDateTime::currentMSecsSinceEpoch());
m_ddsHandler->fts()->createModifyReportReply(m_updateReportCookie, m_reply);
m_ddsHandler->pacemaker()->publishState();
@@ -192,6 +192,8 @@ class HandlerReportData final
bool init();
private: // methods
NGL::INGLLogger &m_logger;
static QString intVecToString(const std::vector<int> &intVec);
void onCreateModifyReportRequest(const rti::core::SampleIdentity &cookie, const CreateModifyReportRequest &request) override final;
void onRemoveReportRequest(const rti::core::SampleIdentity &cookie, const Core::RemoveElementRequest &request) override final;
@@ -42,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() << "error: " << fro();
WARNING_LOG(m_logger) << "error: " << fro();
}
m_ddsHandler->fts()->getReportDataReply(cookie, ret);
}
@@ -50,7 +50,7 @@ void HandlerReportGetData::onGetReportDataRequest(const rti::core::SampleIdentit
//-----------------------------------------------------------------------------
GetReportDataReply HandlerReportGetData::getReportDataRequest(const GetReportDataRequest &request)
{
INFO_LOG() << "IN onGetReportDataRequest";
INFO_LOG(m_logger) << "IN onGetReportDataRequest";
// Get data per reportType
QByteArray reportData;
@@ -104,7 +104,7 @@ GetReportDataReply HandlerReportGetData::getReportDataRequest(const GetReportDat
reportData = getTreatmentTimelineResult(request.reportId());
break;
default:
WARNING_LOG() << "Report Type unknown, no generating.";
WARNING_LOG(m_logger) << "Report Type unknown, no generating.";
break;
}
@@ -445,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() << " stmt: " << stmt;
DEBUG_LOG(m_logger) << " stmt: " << stmt;
qSelect.prepare(stmt);
qSelect.bindValue(QLatin1String(":reportId"), reportId);
if (!qSelect.exec())
{
ERROR_LOG() << "Couldn't select sanitation material result ";
ERROR_LOG(m_logger) << "Couldn't select sanitation material result ";
return QByteArray();
}
@@ -32,6 +32,8 @@ public:
bool init();
private: // methods
NGL::INGLLogger &m_logger;
void onGetReportDataRequest(const rti::core::SampleIdentity &cookie,
const GetReportDataRequest &request) override final;
GetReportDataReply getReportDataRequest(const GetReportDataRequest &request);
@@ -18,12 +18,11 @@
namespace ReportManagement
{
MainHandler::MainHandler(QObject *parent)
: QObject(parent)
MainHandler::MainHandler(QObject *parent) : QObject(parent)
, m_ddsHandler(nullptr)
, m_dbHandler(nullptr)
, m_preService(nullptr)
{}
, m_preService(nullptr),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
MainHandler::~MainHandler()
{
@@ -38,6 +38,8 @@ public:
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<HandlerReportData> m_reportData;
@@ -20,11 +20,10 @@ namespace ReportManagement
{
ObjectReportInfo::ObjectReportInfo(const std::shared_ptr<DdsHandler> &ddsHandler,
const std::shared_ptr<DatabaseInterface> &db,
QObject *parent)
: QObject(parent)
QObject *parent) : QObject(parent)
, m_ddsHandler(ddsHandler)
, m_db(db)
{
, m_db(db),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
}
//------------------------------------------------------------------------------
@@ -50,7 +49,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() << "New reportId: " << m_data.id;
DEBUG_LOG(m_logger) << "New reportId: " << m_data.id;
}
// Publish Data via DTS
@@ -69,7 +68,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() << "Data changed for reportId: " << m_data.id;
DEBUG_LOG(m_logger) << "Data changed for reportId: " << m_data.id;
// Publish Data via DTS
onPublishData();
@@ -110,11 +109,11 @@ Core::FunctionReplyObject ObjectReportInfo::changeStatus(const ReportChangeStatu
//------------------------------------------------------------------------------
void ObjectReportInfo::onPublishData()
{
INFO_LOG() << "Publish ReportInfo-data to dds (" << m_data.id << ") ...";
INFO_LOG(m_logger) << "Publish ReportInfo-data to dds (" << m_data.id << ") ...";
ReportInfo data = toDdsData(m_data);
if (!m_ddsHandler->dts()->publish(data))
ERROR_LOG() << "Error publishing ReportInfo-data to dds";
ERROR_LOG(m_logger) << "Error publishing ReportInfo-data to dds";
}
// TODO: add in LtsUtils ?
@@ -41,7 +41,7 @@ RepTests::~RepTests()
// ------------------------------------------------------------------
bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int operatorId)
{
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_exerciseId = exerciseId;
@@ -52,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() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG(m_logger) << "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() << "Initialisation dbHandler failed.";
ERROR_LOG(m_logger) << "Initialisation dbHandler failed.";
return false;
}
DEBUG_LOG() << "Initialisation dbHandler succesful.";
DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful.";
m_db = m_dbHandler->db();
DEBUG_LOG() << "create dtc";
DEBUG_LOG(m_logger) << "create dtc";
m_dtc = ReportManagement::Interface::Dtc::create(m_ddsConnector);
DEBUG_LOG() << "create ftc";
DEBUG_LOG(m_logger) << "create ftc";
m_ftc = ReportManagement::Interface::Ftc::create(m_ddsConnector);
DEBUG_LOG() << "init ftc/dtc";
DEBUG_LOG(m_logger) << "init ftc/dtc";
bool bRet = m_ftc->enableAll() && m_dtc->enableAll();
DEBUG_LOG() << "init end - bRet = " << bRet;
DEBUG_LOG(m_logger) << "init end - bRet = " << bRet;
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;
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;
//TODO: add connects
@@ -87,7 +87,7 @@ bool RepTests::init(int domainId, int exerciseId, int testId, int reportId, int
// ------------------------------------------------------------------
void RepTests::startTest()
{
INFO_LOG() << "startTest";
INFO_LOG(m_logger) << "startTest";
// create reports
if (m_testId == 11)
tryCreate(ReportManagement::ReportType::UnitPower);
@@ -144,7 +144,7 @@ void RepTests::startTest()
tryChangeStatus();
else
{
ERROR_LOG() << "Unknown test case!";
ERROR_LOG(m_logger) << "Unknown test case!";
failExit();
}
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
@@ -153,7 +153,7 @@ void RepTests::startTest()
// ------------------------------------------------------------------
void RepTests::tryCreate(ReportType repType, VisualisationType visType)
{
INFO_LOG() << "trying to send createRequest Report";
INFO_LOG(m_logger) << "trying to send createRequest Report";
CreateModifyReportRequest request;
QString repName = QStringLiteral("Test Report - type ") + QString::number(repType.underlying());
@@ -480,14 +480,14 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
}
default:
{
ERROR_LOG() << "Unknown report type!";
ERROR_LOG(m_logger) << "Unknown report type!";
break;
}
}
if (!m_ftc->createModifyReportRequest(request, this))
{
ERROR_LOG() << "Error requesting create data";
ERROR_LOG(m_logger) << "Error requesting create data";
failExit();
}
QTest::qWait(2000);
@@ -496,7 +496,7 @@ void RepTests::tryCreate(ReportType repType, VisualisationType visType)
// ------------------------------------------------------------------
void RepTests::tryModify()
{
DEBUG_LOG() << "trying to send modify request for report Id = " << m_reportId;
DEBUG_LOG(m_logger) << "trying to send modify request for report Id = " << m_reportId;
m_dtc->waitForHistoricalDataReportInfo(1000);
ReportInfo rep = m_dtc->reportInfo(m_reportId);
@@ -526,22 +526,22 @@ void RepTests::tryModify()
request.fileStatus(ReportManagement::FileStatus::Valid);
request.lastModified(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG() << "Start modify";
DEBUG_LOG() << "Report type = " << rep.reportType();
DEBUG_LOG(m_logger) << "Start modify";
DEBUG_LOG(m_logger) << "Report type = " << rep.reportType();
if (!m_ftc->createModifyReportRequest(request, this))
{
ERROR_LOG() << "Error requesting modify data";
ERROR_LOG(m_logger) << "Error requesting modify data";
failExit();
}
QTest::qWait(1000);
DEBUG_LOG() << "AFTER modify";
DEBUG_LOG(m_logger) << "AFTER modify";
}
// ------------------------------------------------------------------
void RepTests::tryGetData()
{
DEBUG_LOG() << "trying to send get data request for report Id = " << m_reportId;
DEBUG_LOG(m_logger) << "trying to send get data request for report Id = " << m_reportId;
GetReportDataRequest request;
request.reportId(m_reportId);
@@ -549,7 +549,7 @@ void RepTests::tryGetData()
if (!m_ftc->getReportDataRequest(request, this))
{
ERROR_LOG() << "Error requesting modify data";
ERROR_LOG(m_logger) << "Error requesting modify data";
failExit();
}
QTest::qWait(1000);
@@ -559,7 +559,7 @@ void RepTests::tryGetData()
// ------------------------------------------------------------------
void RepTests::tryChangeStatus()
{
DEBUG_LOG() << "trying to send change status request for report Id = " << m_reportId;
DEBUG_LOG(m_logger) << "trying to send change status request for report Id = " << m_reportId;
ReportChangeStatusRequest request;
request.id(m_reportId);
@@ -569,7 +569,7 @@ void RepTests::tryChangeStatus()
if (!m_ftc->reportChangeStatusRequest(request, this))
{
ERROR_LOG() << "Error requesting change status";
ERROR_LOG(m_logger) << "Error requesting change status";
failExit();
}
QTest::qWait(1000);
@@ -578,10 +578,10 @@ void RepTests::tryChangeStatus()
// ------------------------------------------------------------------
void RepTests::tryDelete()
{
INFO_LOG() << "trying to send delete request for report Id = " << m_reportId;
INFO_LOG(m_logger) << "trying to send delete request for report Id = " << m_reportId;
if (!m_ftc->removeReportRequest(RemoveReportRequest(m_reportId), this))
{
ERROR_LOG() << "Error requesting delete data";
ERROR_LOG(m_logger) << "Error requesting delete data";
failExit();
}
QTest::qWait(1000);
@@ -590,60 +590,60 @@ void RepTests::tryDelete()
// ------------------------------------------------------------------
void RepTests::onCreateModifyReportReply(const CreateModifyReportReply &replyObject)
{
DEBUG_LOG() << "END (onCreateModifyReportReply)";
DEBUG_LOG(m_logger) << "END (onCreateModifyReportReply)";
if (replyObject.errorString().size() > 0)
{
ERROR_LOG() << "Got onCreateModifyReportReply error: " << replyObject.errorString();
ERROR_LOG(m_logger) << "Got onCreateModifyReportReply error: " << replyObject.errorString();
failExit();
return;
}
INFO_LOG() << "Got createModifyReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got createModifyReply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString();
}
// ------------------------------------------------------------------
void RepTests::onRemoveReportReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG() << "END (onRemoveReportReply)";
DEBUG_LOG(m_logger) << "END (onRemoveReportReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onRemoveReportReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onRemoveReportReply error: " << replyObject();
failExit();
return;
}
INFO_LOG() << "Got removeReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
}
// ------------------------------------------------------------------
void RepTests::onGetReportDataReply(const GetReportDataReply &replyObject)
{
DEBUG_LOG() << "END (onGetReportDataReply)";
DEBUG_LOG(m_logger) << "END (onGetReportDataReply)";
if (replyObject.errorString().size() > 0)
{
ERROR_LOG() << "Got onGetReportDataReply error: " << replyObject.errorString();
ERROR_LOG(m_logger) << "Got onGetReportDataReply error: " << replyObject.errorString();
failExit();
return;
}
INFO_LOG() << "Got createReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id()
<< " and errorString " << replyObject.errorString();
QByteArray reportData = LtsUtils::toQByteArray(replyObject.reportData());
DEBUG_LOG() << "Size reportData: " << reportData.size();
DEBUG_LOG(m_logger) << "Size reportData: " << reportData.size();
}
// ------------------------------------------------------------------
void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyObject)
{
DEBUG_LOG() << "END (onReportChangeStatusReply)";
DEBUG_LOG(m_logger) << "END (onReportChangeStatusReply)";
if (replyObject.error())
{
ERROR_LOG() << "Got onReportChangeStatusReply error: " << replyObject();
ERROR_LOG(m_logger) << "Got onReportChangeStatusReply error: " << replyObject();
failExit();
return;
}
INFO_LOG() << "Got changeStatusReply with id " << replyObject.id()
INFO_LOG(m_logger) << "Got changeStatusReply with id " << replyObject.id()
<< " and errorString " << replyObject.translated();
}
@@ -651,7 +651,7 @@ void RepTests::onReportChangeStatusReply(const Core::FunctionReplyObject &replyO
void RepTests::addTestDataTreatmentTimeline()
{
// Report Treatment Timeline
ERROR_LOG() << "START addTestDataTreatmentTimeline" ;
ERROR_LOG(m_logger) << "START addTestDataTreatmentTimeline" ;
ReportManagement::Database::RepTreatmentTimelineData resData;
resData.id = 10;
@@ -669,7 +669,7 @@ void RepTests::addTestDataTreatmentTimeline()
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -680,7 +680,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -693,7 +693,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -704,7 +704,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -715,7 +715,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -727,7 +727,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -738,7 +738,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -749,7 +749,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -763,7 +763,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString();
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -774,7 +774,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -785,7 +785,7 @@ void RepTests::addTestDataTreatmentTimeline()
resData.properties = QString::fromStdString(json);
if (!m_db->insert(resData))
{
ERROR_LOG() << "Error while inserting Event for participantId: " << resData.participantId;
ERROR_LOG(m_logger) << "Error while inserting Event for participantId: " << resData.participantId;
failExit();
}
@@ -794,7 +794,7 @@ void RepTests::addTestDataTreatmentTimeline()
// ------------------------------------------------------------------------------
void RepTests::failExit()
{
ERROR_LOG() << "FAIL EXIT !";
ERROR_LOG(m_logger) << "FAIL EXIT !";
m_bTestsSuccessful = false;
QTimer::singleShot(0, qApp, &QCoreApplication::quit);
}
@@ -17,14 +17,14 @@ DdsHandler::DdsHandler(int domainId, int exerciseId)
: QObject()
, m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
{
DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
}
bool DdsHandler::init(bool bInitFts, const QStringList &qosFileList)
{
if (!m_ddsConnector->init(qosFileList))
{
ERROR_LOG() << "Error initializing dds connections - aborting";
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
return false;
}
@@ -38,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() << "Dts initialised";
INFO_LOG(m_logger) << "Dts initialised";
if (bInitFts)
bRet &= m_ddsFts->enableAll(); // only needed for Generator, not Analyzer
INFO_LOG() << "Fts initialised";
INFO_LOG(m_logger) << "Fts initialised";
return bRet;
}
@@ -57,6 +57,7 @@ public:
}
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;