Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+100
-100
@@ -70,7 +70,7 @@ HandlerMineAreas::HandlerMineAreas(const std::shared_ptr<CentralEffectSimulation
|
||||
, m_handlerParticipant(participantHandler)
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.MineAreas.HandlerMineAreas"))
|
||||
{
|
||||
DEBUG_LOG() << "HandlerMineAreas::HandlerMineAreas";
|
||||
DEBUG_LOG(m_logger) << "HandlerMineAreas::HandlerMineAreas";
|
||||
m_aesItemViews.clear();
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -93,7 +93,7 @@ bool HandlerMineAreas::init()
|
||||
dtcAes->waitForHistoricalDataMineArea(2000);
|
||||
dtcAes->waitForHistoricalDataMineCorridor(2000);
|
||||
|
||||
DEBUG_LOG() << "HandlerMineAreas::init";
|
||||
DEBUG_LOG(m_logger) << "HandlerMineAreas::init";
|
||||
|
||||
dtcAes->enableTriggeredImpacts();
|
||||
connect(dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::triggeredImpactsChanged,
|
||||
@@ -109,7 +109,7 @@ bool HandlerMineAreas::init()
|
||||
this, &HandlerMineAreas::onAesItemViewChanged);
|
||||
|
||||
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
// Get 'static' data for all onAesItemView
|
||||
{
|
||||
auto cb = [this](const AreaEffectSimulation::AesItemView & aiv)
|
||||
@@ -119,7 +119,7 @@ bool HandlerMineAreas::init()
|
||||
if (!dtcAes->aesItemViews(cb))
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newOutdoorPosition,
|
||||
this, &HandlerMineAreas::onNewOutdoorPosition);
|
||||
@@ -127,28 +127,28 @@ bool HandlerMineAreas::init()
|
||||
connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newParticipantState,
|
||||
this, &HandlerMineAreas::onNewParticipantState);
|
||||
|
||||
INFO_LOG() << "HandlerParticipantArea::init() finished.";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerMineAreas::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);
|
||||
}
|
||||
}
|
||||
@@ -157,9 +157,9 @@ void HandlerMineAreas::onSendCesHitReply(const Core::FunctionReplyObject &replyO
|
||||
void HandlerMineAreas::onMineTriggeredReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Can not send MineTriggerReply: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Can not send MineTriggerReply: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "MineTriggerReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "MineTriggerReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
// ///////////////////////////////////
|
||||
// A E S (AreaEffectSimulation)
|
||||
@@ -170,12 +170,12 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineArea
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineCorridor)
|
||||
{
|
||||
DEBUG_LOG() << "AesItemView return";
|
||||
DEBUG_LOG(m_logger) << "AesItemView return";
|
||||
return;
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::MineArea &ma = m_ddsHandler->dtcAes()->mineArea(data.aesItemId());
|
||||
DEBUG_LOG() << "aesItemId=" << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "aesItemId=" << data.aesItemId()
|
||||
<< " chargeTypeId=" << data.chargeStruct().chargeTypeId()
|
||||
<< " isCentral=" << ma.isCentral();
|
||||
|
||||
@@ -186,29 +186,29 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired)
|
||||
{
|
||||
DEBUG_LOG() << "AesItemView expired return id=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "AesItemView expired return id=" << data.aesItemId();
|
||||
aesItemViewRemoved(data.aesItemId());
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_ddsHandler->isDus(data.chargeStruct()))
|
||||
{
|
||||
DEBUG_LOG() << "isDus aesItemId=" << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "isDus aesItemId=" << data.aesItemId()
|
||||
<< " chargeTypeId=" << data.chargeStruct().chargeTypeId() << " do not consider";
|
||||
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;
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << " aesItemViewRemoved aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << " aesItemViewRemoved aesItemId=" << aesItemId;
|
||||
aesItemViewRemoved(aesItemId);
|
||||
return;
|
||||
}
|
||||
@@ -217,15 +217,15 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
{
|
||||
if (!m_aesItemViews.contains(aesItemId))
|
||||
{
|
||||
DEBUG_LOG() << " !m_aesItemViews.contains aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << " !m_aesItemViews.contains aesItemId=" << aesItemId;
|
||||
return;
|
||||
}
|
||||
// build Polygon Mines:
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
auto &formMines = m_aesItemViews[data.aesItemId()].formMines;
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
int &zone = m_aesItemViews[data.aesItemId()].zone;
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
formMines.clear();
|
||||
formMines.reserve(data.form().size());
|
||||
for (const Core::GeoPosition2D &pointGeo : data.form())
|
||||
@@ -235,7 +235,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
|
||||
const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId();
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct());
|
||||
DEBUG_LOG() << "impactRadius=" << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius;
|
||||
switch (effectState.underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesEffectState_def::EsPrepared:
|
||||
@@ -246,10 +246,10 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
{
|
||||
const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius));
|
||||
|
||||
DEBUG_LOG() << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId()
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
printAesItemViews();
|
||||
break;
|
||||
@@ -266,7 +266,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV
|
||||
// do nothing
|
||||
break;
|
||||
} // switch effectStateId
|
||||
DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
printAesItemViews();
|
||||
} // onAesItemViewChanged
|
||||
|
||||
@@ -279,7 +279,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantPosition.participantId()) == 0)
|
||||
{
|
||||
DEBUG_LOG() << "Not handle position: participant has no equipment number";
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "return New Position Participant with id " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "return New Position Participant with id " << participantPosition.participantId()
|
||||
<< " has invalid typeClass: " << typeClass;
|
||||
return;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
TRACE_LOG() << "return New Position - participant has no equipment number"
|
||||
TRACE_LOG(m_logger) << "return New Position - participant has no equipment number"
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " typeClass=" << typeClass;
|
||||
return;
|
||||
@@ -308,21 +308,21 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
|
||||
if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "New Position CatastrophicKill return";
|
||||
DEBUG_LOG(m_logger) << "New Position CatastrophicKill return";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mineLists.contains(participantPosition.participantId()))
|
||||
{
|
||||
DEBUG_LOG() << "Naechste Mine schicken ohne Bounding-Box-Check... return"
|
||||
DEBUG_LOG(m_logger) << "Naechste Mine schicken ohne Bounding-Box-Check... return"
|
||||
<< " Anzahl Minen in Liste:" << m_mineLists[participantPosition.participantId()].size()
|
||||
<< " cesMaxPeriodForCashedMines=" << Settings::cesPeriodStoredMinesOutdated();
|
||||
//DEBUG_LOG() << "Settings::cesMaxPeriodForCashedMines() =" << Settings::cesMaxPeriodForCashedMines();
|
||||
//DEBUG_LOG(m_logger) << "Settings::cesMaxPeriodForCashedMines() =" << Settings::cesMaxPeriodForCashedMines();
|
||||
|
||||
if ((m_mineLists[participantPosition.participantId()].size() > 0)
|
||||
&& (QDateTime::currentMSecsSinceEpoch() - m_mineLists[participantPosition.participantId()][0].time < Settings::cesPeriodStoredMinesOutdated()))
|
||||
{
|
||||
DEBUG_LOG() << "Send Stored mines";
|
||||
DEBUG_LOG(m_logger) << "Send Stored mines";
|
||||
// Search mine with the next no distance
|
||||
int distance = m_mineLists[participantPosition.participantId()][0].distance;
|
||||
int index = 0;
|
||||
@@ -344,7 +344,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
sendEffectTypeEvent(m_aesItemViews[aesItemId], participantPosition, EffectType::EffectiveMineRangeEnter, mineIndex - 1, -1);
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData minePosition = participantPosition;
|
||||
// TODO convert minePos to geographic and set minePosGeo
|
||||
// DEBUG_LOG() << "minePosGeo lat=" << minePosGeo.lat()
|
||||
// DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat()
|
||||
// << " lon=" << minePosGeo.lon()
|
||||
// << " z=" << minePosGeo.z();
|
||||
sendParticipantEvent(m_aesItemViews[aesItemId], minePosition, ProjectDataManagement::EventType_def::HitMine);
|
||||
@@ -360,7 +360,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Stored mines are outdated!"
|
||||
DEBUG_LOG(m_logger) << "Stored mines are outdated!"
|
||||
<< " actTime=" << QDateTime::currentMSecsSinceEpoch()
|
||||
<< " Settings::cesPeriodStoredMinesOutdated()=" << Settings::cesPeriodStoredMinesOutdated();
|
||||
m_mineLists[participantPosition.participantId()].clear();
|
||||
@@ -369,7 +369,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId()
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
|
||||
// const QVector<QPointF> utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), m_zone);
|
||||
@@ -377,7 +377,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct);
|
||||
DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId
|
||||
<< " remainingTasCode=" << remaining;
|
||||
|
||||
if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated)
|
||||
@@ -385,7 +385,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
|
||||
if (typeClass == ParticipantManagement::TypeClass_def::Human && remaining > 50)
|
||||
{
|
||||
DEBUG_LOG() << "ParticipantManagement::TypeClass_def::Human && remaining > 50 continue";
|
||||
DEBUG_LOG(m_logger) << "ParticipantManagement::TypeClass_def::Human && remaining > 50 continue";
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -402,31 +402,31 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(itemView, participantPosition.participantId());
|
||||
if (!intersectsBoundingBox)
|
||||
{
|
||||
DEBUG_LOG() << "Continue nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
DEBUG_LOG(m_logger) << "Continue nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPosition.participantId();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << "Weiter nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
DEBUG_LOG(m_logger) << "Weiter nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPosition.participantId();
|
||||
|
||||
bool inFormCheckResult = inFormCheck(itemView, participantPosition);
|
||||
if (!inFormCheckResult)
|
||||
{
|
||||
DEBUG_LOG() << "!inForm";
|
||||
DEBUG_LOG(m_logger) << "!inForm";
|
||||
if (!intersectFormCheck(itemView, participantPosition.participantId()))
|
||||
{
|
||||
DEBUG_LOG() << "!intersectForm continue";
|
||||
DEBUG_LOG(m_logger) << "!intersectForm continue";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << "Weiter nach inFormCheck und intersectFormCheck";
|
||||
DEBUG_LOG(m_logger) << "Weiter nach inFormCheck und intersectFormCheck";
|
||||
sendParticipantEventEnterLeave(itemView, participantPosition, inFormCheckResult);
|
||||
|
||||
DEBUG_LOG() << "intersectMineRadiusCheck ";
|
||||
DEBUG_LOG(m_logger) << "intersectMineRadiusCheck ";
|
||||
if (intersectMineRadiusCheck(itemView, participantPosition))
|
||||
{
|
||||
DEBUG_LOG() << "intersectMineRadiusCheck=true return";
|
||||
DEBUG_LOG(m_logger) << "intersectMineRadiusCheck=true return";
|
||||
return;
|
||||
}
|
||||
} // if AtMineArea
|
||||
@@ -435,17 +435,17 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl
|
||||
|
||||
void HandlerMineAreas::onNewParticipantState(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
|
||||
{
|
||||
DEBUG_LOG() << "onNewParticipantState ";
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState ";
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
|
||||
{
|
||||
DEBUG_LOG() << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId());
|
||||
DEBUG_LOG(m_logger) << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId());
|
||||
if (m_mineLists.contains(participantPos.participantId()))
|
||||
{
|
||||
DEBUG_LOG() << "onNewParticipantState CombatReady, loesche Minenliste Eintrag";
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste Eintrag";
|
||||
m_mineLists[participantPos.participantId()].clear();
|
||||
m_mineLists.remove(participantPos.participantId());
|
||||
}
|
||||
DEBUG_LOG() << "onNewParticipantState CombatReady, loesche Minenliste";
|
||||
DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -468,7 +468,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantPosition.participantId(), itemView.zone);
|
||||
for (const auto &itPos : itemView.formMines)
|
||||
{
|
||||
DEBUG_LOG() << " itemId=" << itemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << " itemId=" << itemView.aesItemId
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId()
|
||||
<< ", MinePosUtm: " << CentralEffectSimulation::debug(itPos)
|
||||
<< " utmStep:" << utmStep[0].x() << utmStep[0].y()
|
||||
@@ -481,7 +481,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
if (!LtsUtils::BitArray::testBit(triggeredImpact.bitfield(), bitFieldIdx))
|
||||
{
|
||||
++bitFieldIdx;
|
||||
DEBUG_LOG() << "Mine is active continue bitFieldIdx=" << bitFieldIdx;
|
||||
DEBUG_LOG(m_logger) << "Mine is active continue bitFieldIdx=" << bitFieldIdx;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -491,10 +491,10 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
|
||||
// Check, if participant is inside danger-radius of the mine
|
||||
distance = crossCircle(itPos, impactRadius, participantPosition.participantId(), itemView.zone);
|
||||
DEBUG_LOG() << "distance=" << distance;
|
||||
DEBUG_LOG(m_logger) << "distance=" << distance;
|
||||
if (distance < 0.0)
|
||||
{
|
||||
DEBUG_LOG() << "distance < 0.0 continue";
|
||||
DEBUG_LOG(m_logger) << "distance < 0.0 continue";
|
||||
++bitFieldIdx;
|
||||
continue;
|
||||
}
|
||||
@@ -509,12 +509,12 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
mineListItem.time = QDateTime::currentMSecsSinceEpoch();
|
||||
m_mineLists[participantPosition.participantId()].append(mineListItem);
|
||||
mineListIndex++;
|
||||
DEBUG_LOG() << " m_mineLists[" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << " m_mineLists[" << participantPosition.participantId()
|
||||
<< "].length=" << m_mineLists[participantPosition.participantId()].length();
|
||||
|
||||
if (distance < lastDistance)
|
||||
{
|
||||
DEBUG_LOG() << " distance < lastDistance crossCircle for aesItemId: " << itemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << " distance < lastDistance crossCircle for aesItemId: " << itemView.aesItemId
|
||||
<< ", mineIdx: " << mineIdx
|
||||
<< ", impactRadius:" << impactRadius
|
||||
<< ", participantId: " << participantPosition.participantId()
|
||||
@@ -528,19 +528,19 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A
|
||||
bitFieldIdx++;
|
||||
} // for each mine
|
||||
|
||||
DEBUG_LOG() << "End of for-loop participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "End of for-loop participantId=" << participantPosition.participantId()
|
||||
<< " mineIndex=" << mineIndex
|
||||
<< " lastDistance=" << lastDistance;
|
||||
if (lastDistance > 0)
|
||||
{
|
||||
DEBUG_LOG() << "sendEffectTypeEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendEffectTypeEvent participantId=" << participantPosition.participantId()
|
||||
<< " mineIndex=" << mineIndex;
|
||||
// TODO Minenposition fuer den Event nehmen und nicht die Participant-Position
|
||||
sendFtcMineTrigger(itemView.aesItemId, mineIndex - 1);
|
||||
sendEffectTypeEvent(itemView, participantPosition, EffectType::EffectiveMineRangeEnter, mineIndex - 1, -1);
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData minePosition = participantPosition;
|
||||
// TODO convert minePos to geographic and set minePosGeo
|
||||
// DEBUG_LOG() << "minePosGeo lat=" << minePosGeo.lat()
|
||||
// DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat()
|
||||
// << " lon=" << minePosGeo.lon()
|
||||
// << " z=" << minePosGeo.z();
|
||||
sendParticipantEvent(itemView, minePosition, ProjectDataManagement::EventType_def::HitMine);
|
||||
@@ -555,17 +555,17 @@ bool HandlerMineAreas::intersectsBoundingBoxCheck(const CentralEffectSimulation:
|
||||
const int participantId)
|
||||
{
|
||||
bool result = false;
|
||||
DEBUG_LOG() << "intersectsBoundingBoxCheck participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "intersectsBoundingBoxCheck participantId=" << participantId
|
||||
<< " itemViewId=" << itemView.aesItemId
|
||||
<< " zone=" << itemView.zone;
|
||||
const QPolygonF stepPoly = m_handlerParticipant->getParticipantStep(participantId, itemView.zone);
|
||||
if (stepPoly.size() < 2)
|
||||
return false;
|
||||
|
||||
DEBUG_LOG() << "utmStep von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y()
|
||||
DEBUG_LOG(m_logger) << "utmStep von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y()
|
||||
<< " bis=" << stepPoly.at(1).x() << "/" << stepPoly.at(1).y()
|
||||
<< " zone=" << itemView.zone;
|
||||
DEBUG_LOG() << "ItemView Bounding Box BottomLeft=" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y()
|
||||
DEBUG_LOG(m_logger) << "ItemView Bounding Box BottomLeft=" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y()
|
||||
<< " boundingBoxTopRight=" << itemView.boundingBoxTopRight.x() << "/" << itemView.boundingBoxTopRight.y();
|
||||
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5,10,0)
|
||||
@@ -573,7 +573,7 @@ bool HandlerMineAreas::intersectsBoundingBoxCheck(const CentralEffectSimulation:
|
||||
#else
|
||||
result = itemView.boundingBox.intersects(stepPoly);
|
||||
#endif
|
||||
DEBUG_LOG() << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result;
|
||||
DEBUG_LOG(m_logger) << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result;
|
||||
return result;
|
||||
|
||||
}
|
||||
@@ -594,7 +594,7 @@ bool HandlerMineAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItem
|
||||
QPointF boundingBoxBottomLeft = QPointF(boundingBoxBottomLeftX, boundingBoxBottomLeftY);
|
||||
QPointF boundingBoxTopRight = QPointF(boundingBoxTopRightX, boundingBoxTopRightY);
|
||||
|
||||
DEBUG_LOG() << " impactRadius=" << impactRadius
|
||||
DEBUG_LOG(m_logger) << " impactRadius=" << impactRadius
|
||||
<< " itemView.boundingBoxBottomLeft" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y()
|
||||
<< " itemView.boundingBoxTopRight" << itemView.boundingBoxTopRight.x() << "/" << itemView.boundingBoxTopRight.y()
|
||||
<< " boundingBoxBottomLeft=" << boundingBoxBottomLeft.x() << "/" << boundingBoxBottomLeft.y()
|
||||
@@ -608,11 +608,11 @@ bool HandlerMineAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItem
|
||||
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";
|
||||
return true;
|
||||
}
|
||||
DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId()
|
||||
<< " outside AesItemView:" << itemView.aesItemId << " return false";
|
||||
return false;
|
||||
}
|
||||
@@ -623,14 +623,14 @@ bool HandlerMineAreas::inFormCheck(const CentralEffectSimulation::AesItemViewUtm
|
||||
{
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(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();
|
||||
|
||||
if (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;
|
||||
return true;
|
||||
} // if inside
|
||||
@@ -644,7 +644,7 @@ bool HandlerMineAreas::intersectFormCheck(const CentralEffectSimulation::AesItem
|
||||
{
|
||||
const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantId, itemView.zone);
|
||||
|
||||
DEBUG_LOG() << "intersectFormCheck start, paricipantId: " << participantId
|
||||
DEBUG_LOG(m_logger) << "intersectFormCheck start, paricipantId: " << participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size();
|
||||
@@ -655,7 +655,7 @@ bool HandlerMineAreas::intersectFormCheck(const CentralEffectSimulation::AesItem
|
||||
if (itemView.form.intersects(utmStep))
|
||||
#endif
|
||||
{
|
||||
DEBUG_LOG() << "intersect AES form, paricipantId: " << participantId
|
||||
DEBUG_LOG(m_logger) << "intersect AES form, paricipantId: " << participantId
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
return true;
|
||||
} // if inside
|
||||
@@ -669,7 +669,7 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got TriggeredImpacts: ";
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts: ";
|
||||
switch (data.aesTypeId().underlying())
|
||||
{
|
||||
case AreaEffectSimulation::AesType_def::AtExplosionArea:
|
||||
@@ -702,7 +702,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp
|
||||
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;
|
||||
@@ -729,7 +729,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp
|
||||
// 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;
|
||||
}
|
||||
|
||||
@@ -740,7 +740,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp
|
||||
const auto participantPositions = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : participantPositions)
|
||||
{
|
||||
DEBUG_LOG() << "pos participantId=" << pPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << pPos.participantId()
|
||||
<< " buildingId=" << pPos.buildingId()
|
||||
<< " insideBuilding=" << pPos.insideBuilding()
|
||||
<< " positionValid=" << pPos.positionValid;
|
||||
@@ -787,24 +787,24 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
|
||||
{
|
||||
int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct);
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest "
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest "
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -831,13 +831,13 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV
|
||||
itemView.partyId, // originPartyId
|
||||
mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId()
|
||||
<< " chargeTypeId=" << itemView.chargeStruct.chargeTypeId();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -851,25 +851,25 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
|
||||
|
||||
int32_t legacyChargeTypeId = 0;
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeStruct());
|
||||
DEBUG_LOG() << "sendCesHitRequest"
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest"
|
||||
<< " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea()
|
||||
<< " 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
|
||||
|
||||
@@ -885,13 +885,13 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView
|
||||
equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber,
|
||||
remaining, pos, effectTime, eventType, itemView.partyId().get(), mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().chargeTypeId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().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
|
||||
}
|
||||
@@ -938,7 +938,7 @@ void HandlerMineAreas::sendParticipantEvent(const CentralEffectSimulation::AesIt
|
||||
{
|
||||
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent " << itemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent " << itemView.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " eventType=" << eventType
|
||||
<< " pos=" << participantPosition.pos().lat()
|
||||
@@ -977,7 +977,7 @@ void HandlerMineAreas::sendFtcMineTrigger(int aesItemId, int mineIndex)
|
||||
tr.mineAreaId(aesItemId);
|
||||
tr.mineId(mineIndex);
|
||||
tr.chargeTypeId(ma.chargeStruct().chargeTypeId());
|
||||
DEBUG_LOG() << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId()
|
||||
DEBUG_LOG(m_logger) << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId()
|
||||
<< " MineIndex=" << tr.mineId();
|
||||
ftcAes->mineTriggeredRequest(tr, this);
|
||||
}
|
||||
@@ -988,7 +988,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte
|
||||
int mineFieldBitIndex,
|
||||
qint64 effectTime)
|
||||
{
|
||||
DEBUG_LOG() << "sendEffectTypeEvent aesItemId=" << itemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendEffectTypeEvent aesItemId=" << itemView.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId()
|
||||
<< " effectType=" << effectTime
|
||||
<< " mineFieldBitIndex=" << mineFieldBitIndex;
|
||||
@@ -1000,7 +1000,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte
|
||||
if (mineFieldBitIndex >= 0)
|
||||
mfb = ", mineFieldBitIndex: " + QByteArray::number(mineFieldBitIndex);
|
||||
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
|
||||
@@ -1039,7 +1039,7 @@ qreal HandlerMineAreas::crossCircle(const QPointF ¢erUtm, const double radiu
|
||||
QLineF line;
|
||||
line.setP1(stepPoly[0]);
|
||||
line.setP2(centerUtm);
|
||||
DEBUG_LOG() << "crossCircle distance =" << line.length();
|
||||
DEBUG_LOG(m_logger) << "crossCircle distance =" << line.length();
|
||||
return line.length();
|
||||
}
|
||||
return result;
|
||||
@@ -1051,13 +1051,13 @@ bool HandlerMineAreas::inCircle(const QPointF ¢erUtm, const double radius, c
|
||||
{
|
||||
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
|
||||
|
||||
void HandlerMineAreas::aesItemViewRemoved(int aesItemId)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerMineAreas::aesItemViewRemoved aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "HandlerMineAreas::aesItemViewRemoved aesItemId=" << aesItemId;
|
||||
|
||||
m_effectTypeStates.remove(aesItemId);
|
||||
m_effectTypeBitFieldIndexes.remove(aesItemId);
|
||||
@@ -1072,7 +1072,7 @@ void HandlerMineAreas::printAesItemViews()
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
DEBUG_LOG() << "printAesItemViews key=" << i.key() << ": "
|
||||
DEBUG_LOG(m_logger) << "printAesItemViews key=" << i.key() << ": "
|
||||
<< " aesItemId=" << i.value().aesItemId
|
||||
<< " aesTypeId=" << i.value().aesTypeId;
|
||||
}
|
||||
@@ -1088,7 +1088,7 @@ bool HandlerMineAreas::inExtededFormCheck(const CentralEffectSimulation::AesItem
|
||||
///////////////////////////////////////////////////////////
|
||||
// Check whether the position is within an expanded form //
|
||||
///////////////////////////////////////////////////////////
|
||||
DEBUG_LOG() << "itemView.form.size=" << itemView.form.size();
|
||||
DEBUG_LOG(m_logger) << "itemView.form.size=" << itemView.form.size();
|
||||
for (int i = 0; i < itemView.form.size() ; i++)
|
||||
{
|
||||
int nextPoint = i + 1;
|
||||
@@ -1098,17 +1098,17 @@ bool HandlerMineAreas::inExtededFormCheck(const CentralEffectSimulation::AesItem
|
||||
const QPointF l1(itemView.form[i].x(), itemView.form[i].y());
|
||||
const QPointF l2(itemView.form[nextPoint].x(), itemView.form[nextPoint].y());
|
||||
double distancePointLineValue = distancePointLine(participantPosUtmPoint, l1, l2);
|
||||
DEBUG_LOG() << "distancePointLineValue=" << distancePointLineValue
|
||||
DEBUG_LOG(m_logger) << "distancePointLineValue=" << distancePointLineValue
|
||||
<< " ParticipantPos =" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y()
|
||||
<< " Line=" << l1.x() << "/" << l1.y()
|
||||
<< " " << l2.x() << "/" << l2.y();
|
||||
if (distancePointLineValue < distance)
|
||||
{
|
||||
DEBUG_LOG() << "posInExtendedForm return true";
|
||||
DEBUG_LOG(m_logger) << "posInExtendedForm return true";
|
||||
return true;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << "posInExtendedForm return false";
|
||||
DEBUG_LOG(m_logger) << "posInExtendedForm return false";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1,
|
||||
qreal length2 = pToP2.length();
|
||||
if (length1 < length2)
|
||||
{
|
||||
DEBUG_LOG() << "a distancePointLine p=" << p.x() << "/" << p.y()
|
||||
DEBUG_LOG(m_logger) << "a distancePointLine p=" << p.x() << "/" << p.y()
|
||||
<< " line: p1=" << l1.x() << "/" << l1.y()
|
||||
<< " p2=" << l2.x() << "/" << l2.y()
|
||||
<< " distance=" << length1
|
||||
@@ -1135,7 +1135,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1,
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "b distancePointLine p=" << p.x() << "/" << p.y()
|
||||
DEBUG_LOG(m_logger) << "b distancePointLine p=" << p.x() << "/" << p.y()
|
||||
<< " line: p1=" << l1.x() << "/" << l1.y()
|
||||
<< " p2=" << l2.x() << "/" << l2.y()
|
||||
<< " distance=" << length2
|
||||
@@ -1149,7 +1149,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1,
|
||||
|
||||
/* double distance = sqrt(squareLen(p, intersectPnt));
|
||||
|
||||
DEBUG_LOG() << "c distancePointLine p=" << p.x() << "/" << p.y()
|
||||
DEBUG_LOG(m_logger) << "c distancePointLine p=" << p.x() << "/" << p.y()
|
||||
<< " line: p1=" << l1.x() << "/" << l1.y()
|
||||
<< " p2=" << l2.x() << "/" << l2.y()
|
||||
<< " distance=" << distance;
|
||||
|
||||
+5
-5
@@ -48,7 +48,7 @@ bool CesMineAreasInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesMineAreasInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -59,11 +59,11 @@ bool CesMineAreasInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerMineAreas->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation handlerMineAreas failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation handlerMineAreas failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CesMineAreasInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -71,8 +71,8 @@ QString CesMineAreasInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesMineAreasInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesMineAreasInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesMineAreasInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesMineAreasInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user