Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+120
-121
@@ -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;
|
||||
}
|
||||
|
||||
+3
-4
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user