Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+31
-31
@@ -115,7 +115,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
|
||||
switch (data.effectStateId().underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState_def::EsUnknown:
|
||||
@@ -141,7 +141,7 @@ void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data)
|
||||
{
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea)
|
||||
return;
|
||||
DEBUG_LOG() << "Remove aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId();
|
||||
// remove State for each building
|
||||
for (BitfieldStates &bfs : m_bitfieldStatesBld)
|
||||
bfs.remove(data.aesItemId());
|
||||
@@ -159,7 +159,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "Remove SingleExplosion";
|
||||
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
|
||||
m_explosionSingleState.remove(data.id());
|
||||
return;
|
||||
}
|
||||
@@ -167,17 +167,17 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared
|
||||
&& data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
|
||||
{
|
||||
DEBUG_LOG() << "Handle SingleExplosion";
|
||||
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
|
||||
handleExplosion = true;
|
||||
}
|
||||
m_explosionSingleState.insert(data.id(), data.effectStateId());
|
||||
|
||||
|
||||
DEBUG_LOG() << "Got ExplosionSingle";
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle";
|
||||
if (handleExplosion)
|
||||
{
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId());
|
||||
DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)";
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)";
|
||||
|
||||
// Bounding-Box-Check
|
||||
// QMap<int, Footprint> m_footprints;
|
||||
@@ -200,7 +200,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
const Core::GeoPosition2D impactPosition(data.impactPosition().lon(), data.impactPosition().lat());
|
||||
if (inFootprint(impactPosition, impactRadius, footprint))
|
||||
{
|
||||
DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId
|
||||
DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId
|
||||
<< " chargeTypeId = " << data.chargeTypeId()
|
||||
<< " id = " << data.id()
|
||||
<< " currentPartitionTime = " << m_ddsHandler->currentPartitionTime()
|
||||
@@ -216,9 +216,9 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this);
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Not sendCESHitOnBuilding mseId = " << footprint.mseId;
|
||||
DEBUG_LOG(m_logger) << "Not sendCESHitOnBuilding mseId = " << footprint.mseId;
|
||||
|
||||
DEBUG_LOG() << "boundingBoxImpact.contains(footprint)";
|
||||
DEBUG_LOG(m_logger) << "boundingBoxImpact.contains(footprint)";
|
||||
}
|
||||
} // for
|
||||
}
|
||||
@@ -226,7 +226,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
|
||||
void HandlerAesData::onAirSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "Got onAirSupportImpactChanged()";
|
||||
DEBUG_LOG(m_logger) << "Got onAirSupportImpactChanged()";
|
||||
AreaEffectSimulation::ExplosionSingle esData;
|
||||
esData.id(data.id());
|
||||
esData.chargeTypeId(data.chargeTypeId());
|
||||
@@ -241,7 +241,7 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got TriggeredImpacts";
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts";
|
||||
preCalculateImpacts(data);
|
||||
}
|
||||
|
||||
@@ -254,7 +254,7 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
case DataModification::eModified:
|
||||
DEBUG_LOG() << "Got MainFootprint (Building)";
|
||||
DEBUG_LOG(m_logger) << "Got MainFootprint (Building)";
|
||||
calculateFootprint(data);
|
||||
break;
|
||||
case DataModification::eRemoved:
|
||||
@@ -269,8 +269,8 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main
|
||||
|
||||
void HandlerAesData::calculateFootprint(const InfrastructureManagement::MainFootprint &mainFootprint)
|
||||
{
|
||||
DEBUG_LOG() << "Footprint: " << mainFootprint.id() << ": " << mainFootprint;
|
||||
DEBUG_LOG() << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size();
|
||||
DEBUG_LOG(m_logger) << "Footprint: " << mainFootprint.id() << ": " << mainFootprint;
|
||||
DEBUG_LOG(m_logger) << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size();
|
||||
|
||||
// If poly is Empty continue with next Footprint
|
||||
if (mainFootprint.elements().size() <= 0)
|
||||
@@ -318,9 +318,9 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition, const d
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
const QPointF utmBuilding(CentralEffectSimulation::geographic2Utm(footPrint.geoPosition, footPrint.zone));
|
||||
DEBUG_LOG() << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding);
|
||||
DEBUG_LOG(m_logger) << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding);
|
||||
for (int i = 0; i < footPrint.polyUtm.length(); i++)
|
||||
DEBUG_LOG() << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding);
|
||||
DEBUG_LOG(m_logger) << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding);
|
||||
}
|
||||
|
||||
// Check, if hit direct on building
|
||||
@@ -339,14 +339,14 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
{
|
||||
if (data.id() <= 0)
|
||||
return;
|
||||
DEBUG_LOG() << "preCalculateImpacts";
|
||||
DEBUG_LOG(m_logger) << "preCalculateImpacts";
|
||||
// Find AES ItemView and set Bounding-Box of Aes-Field
|
||||
|
||||
// Search corresponding itemView and get boundingBox data in UTM
|
||||
const bool bFound = m_aesItemViews.contains(data.aesItemId());
|
||||
if (!bFound)
|
||||
{
|
||||
WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId();
|
||||
WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId();
|
||||
return;
|
||||
}
|
||||
// Bounding-Box-Check
|
||||
@@ -362,18 +362,18 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
void HandlerAesData::onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send hit on building to building service: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send hit on building to building service: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n"
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n"
|
||||
<< " replyObject.str() = " << replyObject.str();
|
||||
}
|
||||
|
||||
void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
if (reply.error())
|
||||
WARNING_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str();
|
||||
WARNING_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str();
|
||||
else
|
||||
DEBUG_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " successful";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " successful";
|
||||
}
|
||||
|
||||
// calculate impacts for one building
|
||||
@@ -385,14 +385,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionArea:
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
|
||||
DEBUG_LOG() << "Calculate";
|
||||
DEBUG_LOG(m_logger) << "Calculate";
|
||||
break;
|
||||
default:
|
||||
DEBUG_LOG() << "No Calculation";
|
||||
DEBUG_LOG(m_logger) << "No Calculation";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId();
|
||||
|
||||
|
||||
// get position(s) of impact(s):
|
||||
@@ -401,14 +401,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
auto it = m_aesItemViews.constFind(data.aesItemId());
|
||||
if (it == m_aesItemViews.constEnd())
|
||||
{
|
||||
WARNING_LOG() << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available";
|
||||
WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available";
|
||||
return;
|
||||
}
|
||||
|
||||
BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[data.aesItemId()];
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG() << "bitfieldState for " << data.aesItemId() << ": " << i;
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << data.aesItemId() << ": " << i;
|
||||
|
||||
const AreaEffectSimulation::AesItemView &aesItemView = *it;
|
||||
for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx)
|
||||
@@ -422,7 +422,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
continue;
|
||||
|
||||
const Core::GeoPosition2D &impactPosition = aesItemView.form()[bitFieldIdx];
|
||||
DEBUG_LOG() << Q_FUNC_INFO
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon()
|
||||
<< " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition));
|
||||
|
||||
@@ -431,14 +431,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeTypeId());
|
||||
if (inFootprint(impactPosition, impactRadius, footprint))
|
||||
{
|
||||
DEBUG_LOG() << "In Footprint mseId = " << footprint.mseId;
|
||||
DEBUG_LOG(m_logger) << "In Footprint mseId = " << footprint.mseId;
|
||||
if (!bitfieldState.contains(bitFieldIdx))
|
||||
{
|
||||
bitfieldState.insert(bitFieldIdx);
|
||||
|
||||
DEBUG_LOG() << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx;
|
||||
DEBUG_LOG(m_logger) << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx;
|
||||
|
||||
DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ;
|
||||
DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ;
|
||||
Buildings::SendCesHitOnBuildingRequest requestBld(
|
||||
footprint.mseId,
|
||||
aesItemView.chargeTypeId(),
|
||||
|
||||
+1
@@ -55,6 +55,7 @@ public:
|
||||
AreaEffectSimulation::AesItemView itemView(const int &aesId) const { return m_aesItemViews.value(aesId); }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) override final;
|
||||
|
||||
|
||||
+75
-75
@@ -86,7 +86,7 @@ bool HandlerParticipantArea::init()
|
||||
{
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
|
||||
DEBUG_LOG() << "Settings::calculateCentralAes() =" << Settings::calculateCentralAes();
|
||||
DEBUG_LOG(m_logger) << "Settings::calculateCentralAes() =" << Settings::calculateCentralAes();
|
||||
|
||||
dtcAes->enableBCContamination();
|
||||
connect(dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::bCContaminationChanged,
|
||||
@@ -193,28 +193,28 @@ bool HandlerParticipantArea::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantArea::init() finished.";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerParticipantArea::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject();
|
||||
|
||||
// Send next Request, if available
|
||||
if (!m_sendCesHitRequestQueue.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size();
|
||||
DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size();
|
||||
m_sendCesHitRequestQueue.dequeue();
|
||||
// Send next Message
|
||||
if (!m_sendCesHitRequestQueue.isEmpty())
|
||||
{
|
||||
const auto &hr = m_sendCesHitRequestQueue.head();
|
||||
DEBUG_LOG() << "sendCesHitRequest: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr;
|
||||
m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this);
|
||||
}
|
||||
}
|
||||
@@ -248,12 +248,12 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
|
||||
if (m_ddsHandler->isSmartChargeType(data.chargeTypeId()))
|
||||
{
|
||||
DEBUG_LOG() << "isSmartType = TRUE";
|
||||
DEBUG_LOG(m_logger) << "isSmartType = TRUE";
|
||||
return;
|
||||
}
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
DEBUG_LOG() << "Got AesItemView id: " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", modType: " << modType;
|
||||
@@ -278,7 +278,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId());
|
||||
DEBUG_LOG() << "impactRadius=" << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
|
||||
switch (effectState.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
|
||||
@@ -356,7 +356,7 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation::
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState_def::EsActivated:
|
||||
{
|
||||
//DEBUG_LOG() << "Got onDusSingleMineChanged data.id()=" << data.id();
|
||||
//DEBUG_LOG(m_logger) << "Got onDusSingleMineChanged data.id()=" << data.id();
|
||||
CentralEffectSimulation::AesItemViewUtm itemView;
|
||||
itemView.aesItemId = data.id();
|
||||
itemView.chargeTypeId = data.chargeTypeId();
|
||||
@@ -448,7 +448,7 @@ void HandlerParticipantArea::onNContaminationChanged(const AreaEffectSimulation:
|
||||
|
||||
void HandlerParticipantArea::calculateBcContamination(const CentralEffectSimulation::AesItemViewUtm &itemView)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId;
|
||||
const auto participantsMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap)
|
||||
{
|
||||
@@ -460,7 +460,7 @@ void HandlerParticipantArea::calculateBcContamination(const CentralEffectSimulat
|
||||
|
||||
void HandlerParticipantArea::calculateFunctionArea(const CentralEffectSimulation::AesItemViewUtm &itemView)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateFunctionArea aesItemId =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateFunctionArea aesItemId =" << itemView.aesItemId;
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
{
|
||||
@@ -473,7 +473,7 @@ void HandlerParticipantArea::calculateFunctionArea(const CentralEffectSimulation
|
||||
void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId)
|
||||
{
|
||||
CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(aesItemId);
|
||||
DEBUG_LOG() << "delete " << itemView.aesItemId << ", aesItemId: " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "delete " << itemView.aesItemId << ", aesItemId: " << aesItemId;
|
||||
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
@@ -488,7 +488,7 @@ void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId)
|
||||
}
|
||||
else
|
||||
sendParticipantEvent(itemView, participantPos, ProjectDataManagement::EventType_def::LeaveDangerArea);
|
||||
DEBUG_LOG() << "Participant inside id=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
|
||||
} // for all Participants
|
||||
} // deleteFunctionalArea
|
||||
|
||||
@@ -497,10 +497,10 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPos.participantId();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesType_def::AtMineArea:
|
||||
@@ -542,7 +542,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
|
||||
bool bOutOfBounds = false;
|
||||
for (const auto &itPos : itemView.formMines)
|
||||
{
|
||||
DEBUG_LOG() << "participantPositionUtm: " << CentralEffectSimulation::debug(participantPosUtmPoint)
|
||||
DEBUG_LOG(m_logger) << "participantPositionUtm: " << CentralEffectSimulation::debug(participantPosUtmPoint)
|
||||
<< ", MinePosUtm: " << CentralEffectSimulation::debug(itPos);
|
||||
// Check, if mine is active
|
||||
// already triggered (bit is already 0)
|
||||
@@ -558,7 +558,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae
|
||||
// Check, if participant is inside danger-radius of the mine
|
||||
if (inCircle(itPos, impactRadius, participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG() << "Mine Hit for aesItemId: " << itemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "Mine Hit for aesItemId: " << itemView.aesItemId
|
||||
<< ", mineIdx: " << mineIdx
|
||||
<< ", participantId: " << participantPosition.participantId();
|
||||
sendEffectTypeEvent(itemView, participantPosition, EffectType::EffectiveMineRangeEnter, mineIdx, -1);
|
||||
@@ -590,11 +590,11 @@ bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::A
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
<< " inside AesItemView:" << itemView.aesItemId;
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
<< " outside AesItemView:" << itemView.aesItemId;
|
||||
return false;
|
||||
}
|
||||
@@ -613,7 +613,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
itemView.boundingBoxTopRight);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantPosition.pos(), itemView.zone);
|
||||
DEBUG_LOG() << "inFormCheck start, paricipantId: " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantPosition.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size()
|
||||
@@ -622,7 +622,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint) &&
|
||||
itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "inside AES form, paricipantId: " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
switch (itemView.aesTypeId.underlying())
|
||||
{
|
||||
@@ -646,7 +646,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
sendEffectTypeEvent(itemView, participantPosition, effectTypeForNContaminationArea(itemView, participantPosUtmPoint, participantPosition.sampleTime()), -1, -1);
|
||||
break;
|
||||
default:
|
||||
INFO_LOG() << "inFormCheck Unhandled AES-Type" << itemView.aesTypeId;
|
||||
INFO_LOG(m_logger) << "inFormCheck Unhandled AES-Type" << itemView.aesTypeId;
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -680,10 +680,10 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
#if 0
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
DEBUG_LOG() << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId;
|
||||
DEBUG_LOG() << "ParticipantPos = " << debug(participantPosUtmPoint);
|
||||
DEBUG_LOG(m_logger) << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "ParticipantPos = " << debug(participantPosUtmPoint);
|
||||
for (const auto &itPos : itemView.form)
|
||||
DEBUG_LOG() << "itemView =" << debug(itPos);
|
||||
DEBUG_LOG(m_logger) << "itemView =" << debug(itPos);
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
@@ -696,7 +696,7 @@ void HandlerParticipantArea::onTriggeredImpactsChanged(const AreaEffectSimulatio
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got TriggeredImpacts: " << data;
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data;
|
||||
switch (data.aesTypeId().underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionArea:
|
||||
@@ -723,7 +723,7 @@ void HandlerParticipantArea::onExplosionAreaChanged(const AreaEffectSimulation::
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId();
|
||||
if (data.participantId().is_set())
|
||||
m_aesItemId2partIdMap.insert(data.id(), data.participantId().get());
|
||||
else
|
||||
@@ -738,7 +738,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
|
||||
if (m_ddsHandler->isSmartChargeType(data.chargeTypeId()))
|
||||
{
|
||||
DEBUG_LOG() << "isSmartType = TRUE";
|
||||
DEBUG_LOG(m_logger) << "isSmartType = TRUE";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -748,7 +748,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "Remove SingleExplosion";
|
||||
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
|
||||
m_explosionSingleStates.remove(data.id());
|
||||
return;
|
||||
}
|
||||
@@ -757,7 +757,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) &&
|
||||
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated)
|
||||
{
|
||||
DEBUG_LOG() << "Handle SingleExplosion";
|
||||
DEBUG_LOG(m_logger) << "Handle SingleExplosion";
|
||||
handleExplosion = true;
|
||||
}
|
||||
m_explosionSingleStates.insert(data.id(), data.effectStateId());
|
||||
@@ -765,10 +765,10 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
if (!handleExplosion)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "isSmartType = " << m_ddsHandler->isSmartChargeType(data.chargeTypeId());
|
||||
DEBUG_LOG(m_logger) << "isSmartType = " << m_ddsHandler->isSmartChargeType(data.chargeTypeId());
|
||||
if (m_ddsHandler->isSmartChargeType(data.chargeTypeId()))
|
||||
{
|
||||
DEBUG_LOG() << "isSmartType = TRUE";
|
||||
DEBUG_LOG(m_logger) << "isSmartType = TRUE";
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -776,7 +776,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
const QPointF impactPos(CentralEffectSimulation::geographic2Utm(data.impactPosition(), &impactPosZone));
|
||||
const CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(data.id());
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId());
|
||||
DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)";
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)";
|
||||
const auto participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : participantPositions)
|
||||
{
|
||||
@@ -787,16 +787,16 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
continue;
|
||||
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), impactPosZone);
|
||||
DEBUG_LOG() << "impact pos: " << CentralEffectSimulation::debug(impactPos)
|
||||
DEBUG_LOG(m_logger) << "impact pos: " << CentralEffectSimulation::debug(impactPos)
|
||||
<< " with radius " << impactRadius
|
||||
<< " and participant position " << CentralEffectSimulation::debug(participantPosUtm);
|
||||
if (inCircle(impactPos, impactRadius, participantPosUtm))
|
||||
{
|
||||
DEBUG_LOG() << "participantId = " << participantPosition.participantId() << " inCircle = true";
|
||||
DEBUG_LOG(m_logger) << "participantId = " << participantPosition.participantId() << " inCircle = true";
|
||||
sendEffectTypeEvent(itemView, participantPosition, EffectType::ExplosionSingle, -1, QDateTime::currentMSecsSinceEpoch());
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "participantId = " << participantPosition.participantId() << " inCircle = false";
|
||||
DEBUG_LOG(m_logger) << "participantId = " << participantPosition.participantId() << " inCircle = false";
|
||||
}
|
||||
}
|
||||
} // onExplosionSingleChanged
|
||||
@@ -808,7 +808,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) // EsExpired? EsError? EsUnknown?
|
||||
{
|
||||
DEBUG_LOG() << "Remove ExplosionSingleCentral with aesId = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Remove ExplosionSingleCentral with aesId = " << data.id();
|
||||
m_explosionSingleCentralStates.remove(data.id());
|
||||
return;
|
||||
} // if
|
||||
@@ -822,7 +822,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
|
||||
} // if
|
||||
|
||||
m_explosionSingleCentralStates.insert(data.id(), data.effectStateId());
|
||||
DEBUG_LOG() << "Handle ExplosionSingleCentral with aesId = " << data.id();
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingleCentral with aesId = " << data.id();
|
||||
|
||||
// pre-calculate geometric data
|
||||
const AreaEffectSimulation::AesItemView &itemView = m_handlerAesData->itemView(data.id());
|
||||
@@ -857,7 +857,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
|
||||
const BuildingModel *buildingModel = it.value();
|
||||
if (buildingModel->hasIntersection(centerGeo, participantPosition.lastGeoPosition))
|
||||
{
|
||||
DEBUG_LOG() << "Participant " << participantPosition.participantId() << " is covered by building " << it.key();
|
||||
DEBUG_LOG(m_logger) << "Participant " << participantPosition.participantId() << " is covered by building " << it.key();
|
||||
isCovered = true;
|
||||
break;
|
||||
} // if
|
||||
@@ -866,7 +866,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim
|
||||
if (isCovered)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "Participant " << participantPosition.participantId() << " is hit";
|
||||
DEBUG_LOG(m_logger) << "Participant " << participantPosition.participantId() << " is hit";
|
||||
sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(), effectType, -1);
|
||||
} // for
|
||||
}
|
||||
@@ -877,7 +877,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge
|
||||
auto it = m_aesItemViews.find(data.aesItemId());
|
||||
if (it == m_aesItemViews.end())
|
||||
{
|
||||
WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId();
|
||||
WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId();
|
||||
return;
|
||||
}
|
||||
CentralEffectSimulation::AesItemViewUtm &aesItemView = *it;
|
||||
@@ -904,7 +904,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge
|
||||
// already checked (bit is already 0)
|
||||
if (!LtsUtils::BitArray::testBit(aesItemView.handledImpacts, bitFieldIdx))
|
||||
continue;
|
||||
DEBUG_LOG() << "New impact at idx " << bitFieldIdx;
|
||||
DEBUG_LOG(m_logger) << "New impact at idx " << bitFieldIdx;
|
||||
bitsToCheck += bitFieldIdx;
|
||||
}
|
||||
|
||||
@@ -933,7 +933,7 @@ void HandlerParticipantArea::calculateImpacts(const CentralEffectSimulation::Aes
|
||||
{
|
||||
const bool bIsSmartChargeType = m_ddsHandler->isSmartChargeType(itemView.chargeTypeId);
|
||||
|
||||
DEBUG_LOG() << "calculateImpacts, isSMart: " << bIsSmartChargeType;
|
||||
DEBUG_LOG(m_logger) << "calculateImpacts, isSMart: " << bIsSmartChargeType;
|
||||
|
||||
// get radius of munition
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(itemView.chargeTypeId);
|
||||
@@ -970,30 +970,30 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
if (remaining < 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes()
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes()
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeTypeId)
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
if (!m_ddsHandler->isSmartChargeType(itemView.chargeTypeId))
|
||||
{
|
||||
DEBUG_LOG() << "don't sendCesHitRequest Smart Type return";
|
||||
DEBUG_LOG(m_logger) << "don't sendCesHitRequest Smart Type return";
|
||||
return;
|
||||
}
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantPosition.participantId() != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
}
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1018,14 +1018,14 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
itemView.partyId, // originPartyId
|
||||
mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId()
|
||||
<< " chargeTypeId=" << itemView.chargeTypeId
|
||||
<< " legacyChargeTypeId=" << legacyChargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
if (m_sendCesHitRequestQueue.size() == 1)
|
||||
{
|
||||
DEBUG_LOG() << "SendCesHitRequest: " << requestTab;
|
||||
DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab;
|
||||
m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this);
|
||||
}
|
||||
}
|
||||
@@ -1041,26 +1041,26 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
|
||||
|
||||
int32_t legacyChargeTypeId = 0;
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeTypeId());
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes()
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes()
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeTypeId())
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId()
|
||||
<< " equipNo = " << equipmentNumber << " aesItemId =" << itemView.aesItemId();
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantPosition.participantId() != 0 && equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
} // if
|
||||
|
||||
if (participantPosition.participantId() != 0 &&
|
||||
participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
} // if
|
||||
|
||||
@@ -1074,13 +1074,13 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt
|
||||
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
|
||||
remaining, pos, effectTime, itemView.partyId().get(), mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId()
|
||||
<< " legacyChargeTypeId=" << legacyChargeTypeId;
|
||||
|
||||
m_sendCesHitRequestQueue.enqueue(requestTab);
|
||||
if (m_sendCesHitRequestQueue.size() == 1)
|
||||
{
|
||||
DEBUG_LOG() << "SendCesHitRequest: " << requestTab;
|
||||
DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab;
|
||||
m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this);
|
||||
} // if
|
||||
}
|
||||
@@ -1099,7 +1099,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "Participant with id " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantPosition.participantId()
|
||||
<< " has invalid typeClass: " << typeClass
|
||||
<< " eventType: " << eventType;
|
||||
return;
|
||||
@@ -1108,7 +1108,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
|
||||
if (!eventMustBeSend(itemView.aesItemId, participantPosition.participantId(), eventType))
|
||||
{
|
||||
DEBUG_LOG() << "Not sending Event " << eventType << " for participant " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantPosition.participantId()
|
||||
<< " and aes " << itemView.aesItemId << " - already sent";
|
||||
return;
|
||||
}
|
||||
@@ -1125,7 +1125,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
calculateAes = true;
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "!participantPosition.insideWlsArea()";
|
||||
DEBUG_LOG(m_logger) << "!participantPosition.insideWlsArea()";
|
||||
calculateAes = false;
|
||||
}
|
||||
}
|
||||
@@ -1138,19 +1138,19 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
|| eventType == ProjectDataManagement::EventType_def::HitMine
|
||||
|| eventType == ProjectDataManagement::EventType_def::HitN))
|
||||
{
|
||||
DEBUG_LOG() << "send hit events only with central AES Simulation participant=" << participantPosition.participantId();
|
||||
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantPosition.participantId();
|
||||
return;
|
||||
}
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Not sending Event " << eventType << " for participant " << participantPosition.participantId()
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantPosition.participantId()
|
||||
<< " - participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent" << eventType
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " AesItemId=" << itemView.aesItemId;
|
||||
|
||||
@@ -1182,7 +1182,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation:
|
||||
else
|
||||
pe.friendlyFire(false);
|
||||
|
||||
INFO_LOG() << "sendParticipantEvent: " << pe
|
||||
INFO_LOG(m_logger) << "sendParticipantEvent: " << pe
|
||||
<< ", currentMSecsSinceEpoch = " << QDateTime::currentMSecsSinceEpoch()
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime();
|
||||
m_ddsHandler->dtsCes()->publish(pe);
|
||||
@@ -1208,7 +1208,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation::
|
||||
case Settings::AES_CALCUALTION_ONLY_IN_WLS_AREA:
|
||||
if (!participantPosition.insideWlsArea())
|
||||
{
|
||||
DEBUG_LOG() << "!participantPosition.insideWlsArea()";
|
||||
DEBUG_LOG(m_logger) << "!participantPosition.insideWlsArea()";
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1229,7 +1229,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation::
|
||||
effectType, mineFieldBitIndex,
|
||||
participantPosition.insideBuilding()))
|
||||
{
|
||||
DEBUG_LOG() << "Not sending EffectType event " << toString(effectType)
|
||||
DEBUG_LOG(m_logger) << "Not sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantPosition.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< mfb
|
||||
@@ -1237,7 +1237,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation::
|
||||
return;
|
||||
}
|
||||
const int ctasEffectType = static_cast<int>(effectType) & 0xffff;
|
||||
DEBUG_LOG() << "Sending EffectType event " << toString(effectType)
|
||||
DEBUG_LOG(m_logger) << "Sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantPosition.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< mfb
|
||||
@@ -1259,7 +1259,7 @@ bool HandlerParticipantArea::eventMustBeSend(int aesItemId,
|
||||
// - only send event if it was not already sent
|
||||
if (activeEvents.contains(eventType))
|
||||
{
|
||||
DEBUG_LOG() << "activeEvents=" << eventType;
|
||||
DEBUG_LOG(m_logger) << "activeEvents=" << eventType;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1309,7 +1309,7 @@ bool HandlerParticipantArea::effectTypeMustBeSend(int aesItemId,
|
||||
// - only send event if it was not already sent
|
||||
if (activeEffects.contains(effectType))
|
||||
{
|
||||
DEBUG_LOG() << "effectTypeStates already contains aesItemId " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "effectTypeStates already contains aesItemId " << aesItemId;
|
||||
return false;
|
||||
}
|
||||
activeEffects += effectType;
|
||||
@@ -1416,7 +1416,7 @@ bool HandlerParticipantArea::inCircle(const QPointF ¢erUtm, const double rad
|
||||
{
|
||||
double squareDist = CentralEffectSimulation::getSquareDistance(centerUtm, pointUtm);
|
||||
double squareRadius = radius * radius;
|
||||
DEBUG_LOG() << "squareDist: " << squareDist << ", squareRadius: " << squareRadius;
|
||||
DEBUG_LOG(m_logger) << "squareDist: " << squareDist << ", squareRadius: " << squareRadius;
|
||||
return (squareDist < squareRadius);
|
||||
} // inCircle
|
||||
|
||||
@@ -1465,7 +1465,7 @@ EffectType HandlerParticipantArea::effectTypeForNContaminationArea(const Central
|
||||
if (squareDist <= pow(itemView.radials.at(0), 2))
|
||||
{
|
||||
// 5s delay
|
||||
DEBUG_LOG() << "partPosSampleTime: " << partPosSampleTime
|
||||
DEBUG_LOG(m_logger) << "partPosSampleTime: " << partPosSampleTime
|
||||
<< ", itemView.effectStart: " << itemView.effectStart;
|
||||
if (partPosSampleTime < itemView.effectStart + 5000)
|
||||
return EffectType::NContaminationDetonation;
|
||||
@@ -1499,12 +1499,12 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId)
|
||||
const auto effectTypLeave = leaveEffectTypeForAesType(aiv.aesTypeId);
|
||||
if (effectTypLeave != EffectType::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "aesItemViewRemoved, leaveEffectType: " << toString(effectTypLeave);
|
||||
DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEffectType: " << toString(effectTypLeave);
|
||||
auto it = m_effectTypeStates.find(aesItemId);
|
||||
if (it != m_effectTypeStates.end())
|
||||
{
|
||||
const QHash<int, QSet<EffectType>> &participants = it.value();
|
||||
DEBUG_LOG() << "aesItemViewRemoved, sending leave events to " << participants.size()
|
||||
DEBUG_LOG(m_logger) << "aesItemViewRemoved, sending leave events to " << participants.size()
|
||||
<< " participants";
|
||||
for (auto itP = participants.begin(); itP != participants.end(); ++ itP)
|
||||
sendEffectTypeEvent(aiv, m_handlerParticipant->position(itP.key()), effectTypLeave, -1, -1);
|
||||
@@ -1513,12 +1513,12 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId)
|
||||
const auto eventTypeLeave = leaveEventTypeForAesType(aiv.aesTypeId);
|
||||
if (eventTypeLeave != ProjectDataManagement::EventType::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave;
|
||||
DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave;
|
||||
auto it = m_eventStates.find(aesItemId);
|
||||
if (it != m_eventStates.end())
|
||||
{
|
||||
const QHash<int, QSet<ProjectDataManagement::EventType>> &participants = it.value();
|
||||
DEBUG_LOG() << "aesItemViewRemoved, sending leave events to " << participants.size()
|
||||
DEBUG_LOG(m_logger) << "aesItemViewRemoved, sending leave events to " << participants.size()
|
||||
<< " participants";
|
||||
for (auto itP = participants.begin(); itP != participants.end(); ++ itP)
|
||||
sendParticipantEvent(aiv, m_handlerParticipant->position(itP.key()), eventTypeLeave);
|
||||
|
||||
+1
@@ -70,6 +70,7 @@ public:
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
+8
-8
@@ -58,7 +58,7 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -69,15 +69,15 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerAesData->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerAesData failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerAesData failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "initialize HandlerBuildingModel ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize HandlerBuildingModel ----------------------------";
|
||||
m_handlerBuildingModel = std::make_shared<HandlerBuildingModel>(m_ddsHandler, m_handlerAesData, this);
|
||||
if (!m_handlerBuildingModel->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerBuildingModel failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerBuildingModel failed.";
|
||||
return false;
|
||||
} // if
|
||||
|
||||
@@ -91,11 +91,11 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerParticipantArea->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerParticipantArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerParticipantArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -103,8 +103,8 @@ QString Ces2DInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CentralEffectSimulation2DInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CentralEffectSimulation2DInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CentralEffectSimulation2DInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -65,6 +65,7 @@ private Q_SLOTS:
|
||||
bool init(int domainId, int exerciseId) override;
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
|
||||
Reference in new issue
Block a user