Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+19
-19
@@ -38,7 +38,7 @@ bool HandlerArtillerieSound::init()
|
||||
|
||||
if (Settings::cesPlayArtillerieSounds())
|
||||
{
|
||||
DEBUG_LOG() << "init with Artillerie-Sounds";
|
||||
DEBUG_LOG(m_logger) << "init with Artillerie-Sounds";
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
|
||||
dtcAes->enableExplosionSingle();
|
||||
@@ -50,7 +50,7 @@ bool HandlerArtillerieSound::init()
|
||||
this, &HandlerArtillerieSound::onTechnicalAreaChanged);
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "init without Artillerie-Sounds";
|
||||
DEBUG_LOG(m_logger) << "init without Artillerie-Sounds";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -68,7 +68,7 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "Remove SingleExplosion";
|
||||
DEBUG_LOG(m_logger) << "Remove SingleExplosion";
|
||||
m_explosionSingleState.remove(data.id());
|
||||
return;
|
||||
}
|
||||
@@ -77,28 +77,28 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
m_explosionSingleState.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_explosionSingleState.insert(data.id(), data.effectStateId());
|
||||
|
||||
|
||||
DEBUG_LOG() << "Got ExplosionSingle State=" << data.effectStateId()
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle State=" << data.effectStateId()
|
||||
<< " id=" << data.id();
|
||||
if (handleExplosion)
|
||||
{
|
||||
DEBUG_LOG() << "Handle ExplosionSingle (EsActivated) HandlerArtillerieSound";
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated) HandlerArtillerieSound";
|
||||
|
||||
auto assetPositions = m_handlerBuildingData->getAssetPositions();
|
||||
///////////////////////////////////////////////////////////////////
|
||||
/// Play Sound to each EGCU and OSGU volume depends on distance
|
||||
///////////////////////////////////////////////////////////////////
|
||||
INFO_LOG() << "printAssetPositions: ";
|
||||
INFO_LOG(m_logger) << "printAssetPositions: ";
|
||||
QHashIterator<int, CentralEffectSimulation::HandlerBuildingData::AssetPosition> i(assetPositions);
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
INFO_LOG() << "printAssetPositions: "
|
||||
INFO_LOG(m_logger) << "printAssetPositions: "
|
||||
<< i.key() << ": " << i.value().structureElementId
|
||||
<< " type = " << i.value().mountingPointType
|
||||
<< " hostname =" << i.value().hostname
|
||||
@@ -113,7 +113,7 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation
|
||||
const qreal distanceThreshold = Settings::cesDistanceThreshold(); // [m]
|
||||
const qreal factor = Settings::cesFactor();
|
||||
const qreal cesReduceFactor = Settings::cesReduceFactor();
|
||||
INFO_LOG() << "Distance to Explosion =" << distance
|
||||
INFO_LOG(m_logger) << "Distance to Explosion =" << distance
|
||||
<< " hostname =" << i.value().hostname
|
||||
<< " distanceThreshold=" << distanceThreshold
|
||||
<< " factor=" << factor;
|
||||
@@ -138,13 +138,13 @@ void HandlerArtillerieSound::playSound(QString &user, QString &passwd, const QSt
|
||||
url.setUrl(request);
|
||||
url.setUserName(user);
|
||||
url.setPassword(passwd);
|
||||
DEBUG_LOG() << "startRequest: " << url.toString();
|
||||
DEBUG_LOG(m_logger) << "startRequest: " << url.toString();
|
||||
startRequest(url);
|
||||
}
|
||||
|
||||
void HandlerArtillerieSound::startRequest(const QUrl &requestedUrl)
|
||||
{
|
||||
DEBUG_LOG() << "startRequest: " << requestedUrl.toString();
|
||||
DEBUG_LOG(m_logger) << "startRequest: " << requestedUrl.toString();
|
||||
m_httpRequestAborted = false;
|
||||
auto reply = m_qnam.get(QNetworkRequest(requestedUrl));
|
||||
connect(reply, &QNetworkReply::finished, this, &HandlerArtillerieSound::httpFinished);
|
||||
@@ -153,14 +153,14 @@ void HandlerArtillerieSound::startRequest(const QUrl &requestedUrl)
|
||||
|
||||
void HandlerArtillerieSound::httpFinished()
|
||||
{
|
||||
DEBUG_LOG() << "httpFinished";
|
||||
DEBUG_LOG(m_logger) << "httpFinished";
|
||||
auto reply = qobject_cast<QNetworkReply *>(sender());
|
||||
if (!reply)
|
||||
return;
|
||||
|
||||
if (m_httpRequestAborted)
|
||||
{
|
||||
ERROR_LOG() << "httpRequestAborted";
|
||||
ERROR_LOG(m_logger) << "httpRequestAborted";
|
||||
reply->deleteLater();
|
||||
return;
|
||||
}
|
||||
@@ -169,7 +169,7 @@ void HandlerArtillerieSound::httpFinished()
|
||||
{
|
||||
QNetworkRequest request = reply->request();
|
||||
QUrl url = request.url();
|
||||
ERROR_LOG() << "reply->error: " << reply->errorString()
|
||||
ERROR_LOG(m_logger) << "reply->error: " << reply->errorString()
|
||||
<< " host=" << url.host()
|
||||
<< " query='" << url.query()
|
||||
<< "' '" << qUtf8Printable(url.toString()) << "'";
|
||||
@@ -182,7 +182,7 @@ void HandlerArtillerieSound::httpFinished()
|
||||
|
||||
//parse the reply JSON and display result in the UI
|
||||
const QByteArray json(reply->readAll());
|
||||
DEBUG_LOG() << "Sucess " << json;
|
||||
DEBUG_LOG(m_logger) << "Sucess " << json;
|
||||
|
||||
reply->deleteLater();
|
||||
}
|
||||
@@ -199,7 +199,7 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation::
|
||||
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "Remove TechnicalArea";
|
||||
DEBUG_LOG(m_logger) << "Remove TechnicalArea";
|
||||
m_technicalAreas.remove(data.id());
|
||||
return;
|
||||
}
|
||||
@@ -207,14 +207,14 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation::
|
||||
{
|
||||
int zone = -1;
|
||||
m_technicalAreas.insert(data.id(), data);
|
||||
DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id();
|
||||
QPointF cornerButtomLeft = CentralEffectSimulation::geographic2Utm(data.area().cornerBottomLeft(), &zone);
|
||||
qreal x = cornerButtomLeft.x() + data.area().width() / 2;
|
||||
qreal y = cornerButtomLeft.y() + data.area().height() / 2;
|
||||
QPointF center(x, y);
|
||||
DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound cornerButtomLeft = " << cornerButtomLeft.x() << "/" << cornerButtomLeft.y()
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound cornerButtomLeft = " << cornerButtomLeft.x() << "/" << cornerButtomLeft.y()
|
||||
<< " zone=" << zone;
|
||||
DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound center = " << center.x() << "/" << center.y()
|
||||
DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound center = " << center.x() << "/" << center.y()
|
||||
<< " zone=" << zone;
|
||||
}
|
||||
} // onTechnicalAreaChanged
|
||||
|
||||
+3
-3
@@ -61,7 +61,7 @@ bool CesArtillerySoundInterfaceImpl::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;
|
||||
|
||||
@@ -74,11 +74,11 @@ bool CesArtillerySoundInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerArtillerieSound->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerArtillerieSound failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerArtillerieSound failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -78,6 +78,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;
|
||||
|
||||
+11
-11
@@ -25,7 +25,7 @@ HandlerParticipantBorderline::HandlerParticipantBorderline(const std::shared_ptr
|
||||
, m_handlerParticipant(participantHandler)
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.Basic.HandlerParticipantBorderline"))
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantBorderline::HandlerParticipantBorderline";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBorderline::HandlerParticipantBorderline";
|
||||
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -37,7 +37,7 @@ HandlerParticipantBorderline::~HandlerParticipantBorderline()
|
||||
|
||||
bool HandlerParticipantBorderline::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantBorderline::init";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBorderline::init";
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
|
||||
dtcAes->waitForHistoricalDataBorderline(1000);
|
||||
@@ -59,7 +59,7 @@ bool HandlerParticipantBorderline::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantBorderline::init() finished. ";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBorderline::init() finished. ";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -69,7 +69,7 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eRemoved:
|
||||
DEBUG_LOG() << " remove Borderline- data.id()=" << data.id();
|
||||
DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id();
|
||||
m_borderlines.remove(data.id());
|
||||
break;
|
||||
case DataModification::eAdded:
|
||||
@@ -85,7 +85,7 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
case AreaEffectSimulation::AesEffectState_def::EsActivated:
|
||||
{
|
||||
BorderlineUtm borderline(data);
|
||||
DEBUG_LOG() << "m_borderlines.insert id=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id();
|
||||
m_borderlines.insert(data.id(), borderline);
|
||||
break;
|
||||
}
|
||||
@@ -105,12 +105,12 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio
|
||||
|
||||
bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QLineF &linef) const
|
||||
{
|
||||
DEBUG_LOG() << "line to check: " << CentralEffectSimulation::debug(linef.p1()) << " - " << CentralEffectSimulation::debug(linef.p2());
|
||||
DEBUG_LOG(m_logger) << "line to check: " << CentralEffectSimulation::debug(linef.p1()) << " - " << CentralEffectSimulation::debug(linef.p2());
|
||||
QPointF a = polygonf.first();
|
||||
for (const QPointF &b : polygonf)
|
||||
{
|
||||
const QLineF segment(a, b);
|
||||
DEBUG_LOG() << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b);
|
||||
DEBUG_LOG(m_logger) << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b);
|
||||
if (QLineF::BoundedIntersection == linef.intersect(segment, nullptr))
|
||||
return true;
|
||||
a = b;
|
||||
@@ -122,14 +122,14 @@ bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QL
|
||||
void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG() << "ParicipantStep "
|
||||
DEBUG_LOG(m_logger) << "ParicipantStep "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " Anzahl Borderlines=" << m_borderlines.size();
|
||||
|
||||
for (const BorderlineUtm &borderline : std::as_const(m_borderlines))
|
||||
{
|
||||
DEBUG_LOG() << "borderline id = " << borderline.id
|
||||
DEBUG_LOG(m_logger) << "borderline id = " << borderline.id
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(borderline.boundingBox.bottomLeft())
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(borderline.boundingBox.topRight());
|
||||
const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), borderline.zone);
|
||||
@@ -139,7 +139,7 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff
|
||||
// Intersection von Polygon und Line: Polygon = Borderline, Line from last Participant pos to actual participant pos
|
||||
const QLineF utmStep(utmStepPoly[0], utmStepPoly[1]);
|
||||
const bool result = intersect(borderline.points, utmStep);
|
||||
DEBUG_LOG() << "result intersection = " << result;
|
||||
DEBUG_LOG(m_logger) << "result intersection = " << result;
|
||||
if (result)
|
||||
{
|
||||
if (borderline.operatorId <= 0)
|
||||
@@ -175,7 +175,7 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor
|
||||
return;
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
|
||||
+22
-22
@@ -52,18 +52,18 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
QVector<CentralEffectSimulation::Database::CesSimulatedMovement> simMoveVec;
|
||||
if (!m_db->select(simMoveVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'CesSimulatedMovement'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'CesSimulatedMovement'";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "loadSimulatedMovementFromDb size =" << simMoveVec.size();
|
||||
DEBUG_LOG(m_logger) << "loadSimulatedMovementFromDb size =" << simMoveVec.size();
|
||||
|
||||
QVector<CentralEffectSimulation::Database::CesSimulatedMovementSegment> simMoveSegVec;
|
||||
if (!m_db->select(simMoveSegVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'CesSimulatedMovementSegment'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'CesSimulatedMovementSegment'";
|
||||
return false;
|
||||
}
|
||||
DEBUG_LOG() << "loadSimulatedMovementSegmentsFromDb size =" << simMoveSegVec.size();
|
||||
DEBUG_LOG(m_logger) << "loadSimulatedMovementSegmentsFromDb size =" << simMoveSegVec.size();
|
||||
|
||||
// add to internal buffer
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : std::as_const(simMoveVec))
|
||||
@@ -75,7 +75,7 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb()
|
||||
request.participantId(data.participantId);
|
||||
request.repeat(data.repeat);
|
||||
request.nextPoint(data.nextpoint);
|
||||
DEBUG_LOG() << "Loading SimulatedMovement: " << request;
|
||||
DEBUG_LOG(m_logger) << "Loading SimulatedMovement: " << request;
|
||||
|
||||
QMap <int, CentralEffectSimulation::Database::CesSimulatedMovementSegment> segDbMap; // QMap to get it sorted
|
||||
for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segData : std::as_const(simMoveSegVec))
|
||||
@@ -115,7 +115,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
if (!m_db->insert(newSimulatedMovement))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovement' to database"));
|
||||
DEBUG_LOG() << "newSimulatedMovement.id = " << newSimulatedMovement.id;
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id = " << newSimulatedMovement.id;
|
||||
|
||||
CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment;
|
||||
newSegment.simulatedMovementId = newSimulatedMovement.id;
|
||||
@@ -134,7 +134,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe
|
||||
|
||||
trans.commit();
|
||||
|
||||
DEBUG_LOG() << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of insertInDb
|
||||
|
||||
@@ -143,7 +143,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement newSimulatedMovement(SimulationMovement::toDb(request));
|
||||
if (!m_db->update(newSimulatedMovement))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error update 'CesSimulatedMovement' to database"));
|
||||
DEBUG_LOG() << "newSimulatedMovement.id = " << newSimulatedMovement.id;
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id = " << newSimulatedMovement.id;
|
||||
|
||||
|
||||
// First remove all participant-segments
|
||||
@@ -164,14 +164,14 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect
|
||||
++newSegment.positionIndex;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id();
|
||||
return Core::FunctionReplyObject(newSimulatedMovement.id);
|
||||
} // end of updateDb
|
||||
|
||||
|
||||
Core::FunctionReplyObject HandlerSimulatedMovement::removeFromDb(const int32_t id)
|
||||
{
|
||||
DEBUG_LOG() << "removeFromDb: id=" << id;
|
||||
DEBUG_LOG(m_logger) << "removeFromDb: id=" << id;
|
||||
if (!m_db->removeCesSimulatedMovement(id))
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "Error remove 'CesSimulatedMovement' from database"));
|
||||
return Core::FunctionReplyObject(id);
|
||||
@@ -179,7 +179,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeFromDb(const int32_t i
|
||||
|
||||
void HandlerSimulatedMovement::publishSimulatedMovement(const CentralEffectSimulation::SimulatedMovement &request)
|
||||
{
|
||||
INFO_LOG() << "publishSimulatedMovement: " << request;
|
||||
INFO_LOG(m_logger) << "publishSimulatedMovement: " << request;
|
||||
m_ddsHandler->dtsCes()->publish(request);
|
||||
}
|
||||
|
||||
@@ -189,25 +189,25 @@ void HandlerSimulatedMovement::setParticipantAsSimulated(const int &participantI
|
||||
return;
|
||||
ParticipantManagement::SetAsSimulated req(participantId,isSimulated);
|
||||
if (!m_ddsHandler->ftcPpm()->setAsSimulatedRequest(req, this))
|
||||
ERROR_LOG() << "Error modify participant data participantId=" << participantId;
|
||||
ERROR_LOG(m_logger) << "Error modify participant data participantId=" << participantId;
|
||||
}
|
||||
|
||||
void HandlerSimulatedMovement::onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "onModifyParticipantDataReply: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "onModifyParticipantDataReply: " << replyObject();
|
||||
}
|
||||
|
||||
void HandlerSimulatedMovement::onSetAsSimulatedReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "onSetAsSimulatedReply: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "onSetAsSimulatedReply: " << replyObject();
|
||||
}
|
||||
|
||||
void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CentralEffectSimulation::SimulatedMovement &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSimulatedMovementModifyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onSimulatedMovementModifyRequest: " << request;
|
||||
m_jumpToStart = request.jumpToStart();
|
||||
|
||||
// we allow a modify with requestId = 0 and participantId != 0
|
||||
@@ -220,7 +220,7 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
// New Route
|
||||
if (request.jumpToStart())
|
||||
{
|
||||
DEBUG_LOG() << "sm->setJump(true)";
|
||||
DEBUG_LOG(m_logger) << "sm->setJump(true)";
|
||||
sm->setJump(true);
|
||||
}
|
||||
|
||||
@@ -234,14 +234,14 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core:
|
||||
|
||||
setParticipantAsSimulated(request.participantId(), true);
|
||||
|
||||
DEBUG_LOG() << "simulatedMovementModifyReply id=" << reply.id();
|
||||
DEBUG_LOG(m_logger) << "simulatedMovementModifyReply id=" << reply.id();
|
||||
|
||||
m_ddsHandler->ftsCes()->simulatedMovementModifyReply(cookie, reply);
|
||||
} // end onSimulatedMovementModifyRequest
|
||||
|
||||
Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int32_t ddsId)
|
||||
{
|
||||
DEBUG_LOG() << "removeSimulatedMovement with id " << ddsId << ", " << m_simulationMovements.size();
|
||||
DEBUG_LOG(m_logger) << "removeSimulatedMovement with id " << ddsId << ", " << m_simulationMovements.size();
|
||||
|
||||
if (ddsId <= 0)
|
||||
return Core::FunctionReplyObject(0, tr_lts("dds", "remove participant simulation "));
|
||||
@@ -259,7 +259,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int3
|
||||
m_simulationMovements.erase(it);
|
||||
}
|
||||
if (participantId == -1)
|
||||
WARNING_LOG() << "Could not find movement simulation with id " << ddsId << ", " << m_simulationMovements.size();
|
||||
WARNING_LOG(m_logger) << "Could not find movement simulation with id " << ddsId << ", " << m_simulationMovements.size();
|
||||
|
||||
setParticipantAsSimulated(participantId, false);
|
||||
return reply;
|
||||
@@ -270,7 +270,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core:
|
||||
{
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(request.id());
|
||||
if (reply.error())
|
||||
WARNING_LOG() << reply();
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_ddsHandler->ftsCes()->simulatedMovementRemoveReply(cookie, reply);
|
||||
|
||||
} // end onSimulatedMovementRemoveRequest
|
||||
@@ -278,7 +278,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core:
|
||||
void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CentralEffectSimulation::SimulatedMovementRemoveByParticipantId &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSimulatedMovementRemoveByParticipantIdRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onSimulatedMovementRemoveByParticipantIdRequest: " << request;
|
||||
|
||||
int id = 0;
|
||||
for (const SimulationMovement *simMovement : std::as_const(m_simulationMovements))
|
||||
@@ -291,7 +291,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(c
|
||||
}
|
||||
Core::FunctionReplyObject reply = removeSimulatedMovement(id);
|
||||
if (reply.error())
|
||||
WARNING_LOG() << reply();
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_ddsHandler->ftsCes()->simulatedMovementRemoveByParticipantIdReply(cookie, reply);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -49,7 +49,7 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesBasicInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesBasicInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -63,7 +63,7 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerParticipantBorderline->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerParticipantBorderline failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerParticipantBorderline failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -75,11 +75,11 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerSimulatedMovement->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerSimulatedMovement failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerSimulatedMovement failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CentralEffectSimulationBasicInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulationBasicInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ QString CesBasicInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesBasicInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesBasicInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesBasicInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesBasicInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesBasicInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ private Q_SLOTS:
|
||||
bool init(int domainId, int exerciseId) override;
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr};
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
|
||||
+25
-25
@@ -43,7 +43,7 @@ SimulationMovement::SimulationMovement(const std::shared_ptr<CentralEffectSimula
|
||||
|
||||
SimulationMovement::~SimulationMovement()
|
||||
{
|
||||
DEBUG_LOG() << "Delete SimulatedMovement "
|
||||
DEBUG_LOG(m_logger) << "Delete SimulatedMovement "
|
||||
<< " id=" << m_simMovement.id()
|
||||
<< " participantId= " << m_simMovement.participantId();
|
||||
m_ddsHandler->dtsCes()->removeSimulatedMovementByKey(m_simMovement.id());
|
||||
@@ -72,7 +72,7 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
{
|
||||
const Core::GeoPosition2D &pointGeo = point.position();
|
||||
m_points.push_back(m_zone == -1 ? CentralEffectSimulation::geographic2Utm(pointGeo, &m_zone) : CentralEffectSimulation::geographic2Utm(pointGeo, m_zone));
|
||||
DEBUG_LOG() << "pointGeo lat=" << pointGeo.lat() << " lon=" << pointGeo.lon()
|
||||
DEBUG_LOG(m_logger) << "pointGeo lat=" << pointGeo.lat() << " lon=" << pointGeo.lon()
|
||||
<< " point lat=" << point.position().lat() << " lon=" << point.position().lon()
|
||||
<< " utmPoint=" << CentralEffectSimulation::debug(m_points.last());
|
||||
m_segSpeed.append(point.speed());
|
||||
@@ -80,7 +80,7 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
}
|
||||
|
||||
// Only start simulation in future
|
||||
DEBUG_LOG() << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch()
|
||||
DEBUG_LOG(m_logger) << "m_startTime - QDateTime::currentMSecsSinceEpoch()=" << m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_startTime=" << m_simMovement.startTime()
|
||||
<< " currentTime=" << QDateTime::currentMSecsSinceEpoch()
|
||||
<< " m_nextPoint=" << m_simMovement.nextPoint();
|
||||
@@ -92,7 +92,7 @@ void SimulationMovement::setSimulatedMovementRequest(const CentralEffectSimulati
|
||||
m_moveTimer->start(m_simMovement.startTime() - QDateTime::currentMSecsSinceEpoch());
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Service-Start";
|
||||
DEBUG_LOG(m_logger) << "Service-Start";
|
||||
m_moveTimer->start(10); // Service-Start
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ void SimulationMovement::updateNextPointInDb()
|
||||
{
|
||||
if (m_simMovement.id() <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Internal error - id not set!";
|
||||
WARNING_LOG(m_logger) << "Internal error - id not set!";
|
||||
return;
|
||||
}
|
||||
CentralEffectSimulation::Database::CesSimulatedMovement dbSim = toDb(m_simMovement);
|
||||
@@ -111,7 +111,7 @@ void SimulationMovement::updateNextPointInDb()
|
||||
|
||||
void SimulationMovement::startNewSegment()
|
||||
{
|
||||
DEBUG_LOG() << "simulate participantId = " << m_simMovement.participantId()
|
||||
DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint = " << m_simMovement.nextPoint();
|
||||
|
||||
m_moveTime = 1;
|
||||
@@ -123,31 +123,31 @@ void SimulationMovement::startNewSegment()
|
||||
if (pos.participantId() == m_simMovement.participantId())
|
||||
{
|
||||
p1 = CentralEffectSimulation::geographic2Utm(pos.pos(), m_zone);
|
||||
DEBUG_LOG() << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
DEBUG_LOG(m_logger) << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_simStart) // Wait for participantPosition
|
||||
{
|
||||
INFO_LOG() << "Wait for participant position participantId =" << m_simMovement.participantId();
|
||||
INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId();
|
||||
m_segTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (m_simMovement.nextPoint() > 0)
|
||||
{
|
||||
p1 = m_points.at(m_simMovement.participantId() - 1);
|
||||
DEBUG_LOG() << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
p1 = m_points.at(m_points.size() - 1);
|
||||
DEBUG_LOG() << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1);
|
||||
}
|
||||
}
|
||||
const QPointF &p2 = m_points.at(m_simMovement.nextPoint());
|
||||
m_actSegment.setPoints(p1, p2);
|
||||
int curDelay = m_segDelay.at(m_simMovement.nextPoint());
|
||||
DEBUG_LOG() << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2)
|
||||
DEBUG_LOG(m_logger) << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2)
|
||||
<< " delay =" << curDelay;
|
||||
m_moveTimer->start(curDelay);
|
||||
}
|
||||
@@ -165,7 +165,7 @@ void SimulationMovement::startNewSegment()
|
||||
|
||||
void SimulationMovement::setJump(bool jump)
|
||||
{
|
||||
DEBUG_LOG() << "Jump";
|
||||
DEBUG_LOG(m_logger) << "Jump";
|
||||
if (jump)
|
||||
{
|
||||
m_simMovement.nextPoint(1);
|
||||
@@ -175,13 +175,13 @@ void SimulationMovement::setJump(bool jump)
|
||||
m_moveTime = 1;
|
||||
m_simStart = false;
|
||||
publishNewPos();
|
||||
DEBUG_LOG() << "Jump done";
|
||||
DEBUG_LOG(m_logger) << "Jump done";
|
||||
}
|
||||
}
|
||||
|
||||
void SimulationMovement::publishSimulatedMovement()
|
||||
{
|
||||
DEBUG_LOG() << " m_nextPoint= " << m_simMovement.nextPoint();
|
||||
DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint();
|
||||
m_ddsHandler->dtsCes()->publish(m_simMovement);
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ void SimulationMovement::publishNewPos()
|
||||
utmPos.x = m_newPos.x();
|
||||
utmPos.y = m_newPos.y();
|
||||
const QPointF posGeo = utmPos.geographic();
|
||||
DEBUG_LOG() << "participantPos zone=" << utmPos.zone
|
||||
DEBUG_LOG(m_logger) << "participantPos zone=" << utmPos.zone
|
||||
<< " northp=" << utmPos.northp
|
||||
<< " x=" << utmPos.x
|
||||
<< " y=" << utmPos.y;
|
||||
@@ -213,10 +213,10 @@ void SimulationMovement::publishNewPos()
|
||||
|
||||
void SimulationMovement::move()
|
||||
{
|
||||
DEBUG_LOG() << "move";
|
||||
DEBUG_LOG(m_logger) << "move";
|
||||
if (m_simMovement.nextPoint() < 0)
|
||||
{
|
||||
DEBUG_LOG() << "move next point < 0";
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -224,17 +224,17 @@ void SimulationMovement::move()
|
||||
const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos(), m_zone);
|
||||
if (partPos.participantId() != m_simMovement.participantId())
|
||||
{
|
||||
DEBUG_LOG() << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
if (!partPos.positionValid)
|
||||
{
|
||||
DEBUG_LOG() << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId();
|
||||
m_moveTimer->start(1000);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG() << " pos=" << CentralEffectSimulation::debug(participantPosUtm);
|
||||
DEBUG_LOG(m_logger) << " pos=" << CentralEffectSimulation::debug(participantPosUtm);
|
||||
|
||||
QLineF step = m_actSegment;
|
||||
if (m_simStart)
|
||||
@@ -242,7 +242,7 @@ void SimulationMovement::move()
|
||||
m_actSegment.setPoints(participantPosUtm,
|
||||
m_points.at(m_simMovement.nextPoint()));
|
||||
step = m_actSegment;
|
||||
DEBUG_LOG() << "m_simStart set m_actSegment"
|
||||
DEBUG_LOG(m_logger) << "m_simStart set m_actSegment"
|
||||
<< " p1: " << CentralEffectSimulation::debug(m_actSegment.p1())
|
||||
<< " p2: " << CentralEffectSimulation::debug(m_actSegment.p2());
|
||||
m_simStart = false;
|
||||
@@ -250,7 +250,7 @@ void SimulationMovement::move()
|
||||
|
||||
if (m_segSpeed[m_simMovement.nextPoint()] <= 0.0)
|
||||
{
|
||||
DEBUG_LOG() << "move next point < 0";
|
||||
DEBUG_LOG(m_logger) << "move next point < 0";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -261,7 +261,7 @@ void SimulationMovement::move()
|
||||
if (step.length() >= m_actSegment.length() + 0.1 ||
|
||||
step.length() < 0.1) // 0.1 Magic Number but 10 cm distance to Point is arrived
|
||||
{
|
||||
DEBUG_LOG() << "move ready step.length()=" << step.length()
|
||||
DEBUG_LOG(m_logger) << "move ready step.length()=" << step.length()
|
||||
<< " m_actSegment.length()=" << m_actSegment.length();
|
||||
m_simMovement.nextPoint(m_simMovement.nextPoint() + 1);
|
||||
if (m_simMovement.nextPoint() >= m_points.size())
|
||||
@@ -275,7 +275,7 @@ void SimulationMovement::move()
|
||||
}
|
||||
}
|
||||
updateNextPointInDb();
|
||||
DEBUG_LOG() << "ready move participantId = " << m_simMovement.participantId()
|
||||
DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
@@ -291,7 +291,7 @@ void SimulationMovement::move()
|
||||
return;
|
||||
}
|
||||
m_newPos = step.p2();
|
||||
DEBUG_LOG() << "move participantId = " << m_simMovement.participantId()
|
||||
DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId()
|
||||
<< " m_nextPoint =" << m_simMovement.nextPoint()
|
||||
<< " newPos =" << m_newPos.x() << "/" << m_newPos.y()
|
||||
<< " m_moveTime=" << m_moveTime
|
||||
|
||||
+7
-7
@@ -91,14 +91,14 @@ bool BuildingModel::init(
|
||||
)
|
||||
{
|
||||
m_buildingId = buildingId;
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId;
|
||||
|
||||
m_angle = mse.angle() * M_PI / 180.;
|
||||
m_refPosGeo = mse.geoPosition();
|
||||
m_refPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mse.geoPosition().lon(), mse.geoPosition().lat());
|
||||
m_refPos = {m_refPosUtm.x, m_refPosUtm.y, m_refPosGeo.z()};
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId
|
||||
<< ", m_angle=" << m_angle
|
||||
<< ", m_refPosGeo=" << m_refPosGeo
|
||||
<< ", m_refPos=" << m_refPos;
|
||||
@@ -108,7 +108,7 @@ bool BuildingModel::init(
|
||||
m_footprint << QPointF(footprintElement.relPosition().offsetX(), footprintElement.relPosition().offsetY());
|
||||
if (m_footprint.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "Error reading MainFootprint for building " << m_buildingId;
|
||||
ERROR_LOG(m_logger) << "Error reading MainFootprint for building " << m_buildingId;
|
||||
return false;
|
||||
} // if
|
||||
m_boundingRect = m_footprint.boundingRect();
|
||||
@@ -117,7 +117,7 @@ bool BuildingModel::init(
|
||||
// QByteArray array = qUncompress(QByteArray::fromRawData(reinterpret_cast<const char*>(&data[0]), data.size()));
|
||||
if (!BuildingControlUnit::VWM::XmlReader::readBuilding(vmd, *this))
|
||||
{
|
||||
ERROR_LOG() << "Error reading VulnerabilityModelData for building " << m_buildingId;
|
||||
ERROR_LOG(m_logger) << "Error reading VulnerabilityModelData for building " << m_buildingId;
|
||||
return false;
|
||||
} // if
|
||||
|
||||
@@ -130,7 +130,7 @@ bool BuildingModel::init(
|
||||
if (point.z() > m_height)
|
||||
m_height = point.z();
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END, m_buildingId=" << m_buildingId;
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, m_buildingId=" << m_buildingId;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ bool BuildingModel::init(
|
||||
|
||||
bool BuildingModel::hasIntersectionSimplified(const LtsUtils::QPoint3D &start, const LtsUtils::QPoint3D &end) const
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " m_buildingId=" << m_buildingId
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_buildingId=" << m_buildingId
|
||||
<< ", start=" << start << ", end=" << end;
|
||||
|
||||
// keep origin of QRect (topLeft) in mind:
|
||||
@@ -230,7 +230,7 @@ bool BuildingModel::hasIntersection(const LtsUtils::QPoint3D &start, const LtsUt
|
||||
|
||||
bool bHasIntersection = BuildingControlUnit::VWM::Math::hasIntersection(start, end, rooms());
|
||||
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " m_buildingId=" << m_buildingId
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_buildingId=" << m_buildingId
|
||||
<< ", start=" << start << ", end=" << end
|
||||
<< ", rooms().size()" << rooms().size()
|
||||
<< ", bHasIntersection=" << bHasIntersection;
|
||||
|
||||
+80
-80
@@ -91,7 +91,7 @@ bool HandlerAesData::init()
|
||||
|
||||
void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onBoobyTrapChanged"
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapChanged"
|
||||
<< " id=" << data.id()
|
||||
<< " impactPosition=" << data.impactPosition()
|
||||
<< " impactRadius=" << data.impactRadius()
|
||||
@@ -105,7 +105,7 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
|
||||
if (!data.triggered())
|
||||
return;
|
||||
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
<< " data.id=" << data.id()
|
||||
<< " effectStateId=" << data.effectStateId();
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (data.effectStart().get() + data.effectDuration())) > 2000)
|
||||
{
|
||||
INFO_LOG() << "onBoobyTrap outdated";
|
||||
INFO_LOG(m_logger) << "onBoobyTrap outdated";
|
||||
return;
|
||||
}
|
||||
AreaEffectSimulation::AesItemView itemView;
|
||||
@@ -131,16 +131,16 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d
|
||||
|
||||
void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onAesItemViewChanged"
|
||||
DEBUG_LOG(m_logger) << "onAesItemViewChanged"
|
||||
<< " data.aesTypeId()=" << data.aesTypeId();
|
||||
if (modType != DataModification::eAdded &&
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId();
|
||||
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
|
||||
{
|
||||
INFO_LOG() << "AesEffectState_def::EsExpired"
|
||||
INFO_LOG(m_logger) << "AesEffectState_def::EsExpired"
|
||||
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << data.effectStart()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - data.effectStart() ;
|
||||
@@ -153,61 +153,61 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie
|
||||
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
|
||||
{
|
||||
DEBUG_LOG() << "AtOffRouteMineSecondary id=" << data.id() / 1000;
|
||||
DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id() / 1000;
|
||||
auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id() / 1000));
|
||||
if (!offRouteMine.effectStart().is_set())
|
||||
{
|
||||
DEBUG_LOG() << "!offRouteMine.effectStart().is_set()";
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()";
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG() << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << offRouteMine.effectStart()
|
||||
<< " effectDuration=" << offRouteMine.effectDuration()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart().get() + offRouteMine.effectDuration()) ;
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart().get() + offRouteMine.effectDuration())) < 2000)
|
||||
{
|
||||
DEBUG_LOG() << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
checkBuildingsHit(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "outdated return";
|
||||
DEBUG_LOG(m_logger) << "outdated return";
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
|
||||
{
|
||||
DEBUG_LOG() << "AtBoobyTrapSecondary id=" << data.id() / 1000;
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary id=" << data.id() / 1000;
|
||||
//auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int) (data.id() / 1000));
|
||||
auto boobyTrap = m_ddsHandler->dtcAes()->boobyTrap((int)(data.id() / 1000));
|
||||
if (!boobyTrap.effectStart().is_set())
|
||||
{
|
||||
DEBUG_LOG() << "!offRouteMine.effectStart().is_set()";
|
||||
DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()";
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG() << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " effectStart=" << boobyTrap.effectStart()
|
||||
<< " effectDuration=" << boobyTrap.effectDuration()
|
||||
<< " diff = " << m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart().get() + boobyTrap.effectDuration()) ;
|
||||
|
||||
if ((m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart().get() + boobyTrap.effectDuration())) < 2000)
|
||||
{
|
||||
DEBUG_LOG() << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset.";
|
||||
checkBuildingsHit(data);
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "outdated return";
|
||||
DEBUG_LOG(m_logger) << "outdated return";
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "removeStates data";
|
||||
DEBUG_LOG(m_logger) << "removeStates data";
|
||||
removeStates(data);
|
||||
DEBUG_LOG() << "m_aesItemViewsUtm remove id" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "m_aesItemViewsUtm remove id" << data.aesItemId();
|
||||
m_aesItemViewsUtm.remove(data.aesItemId());
|
||||
}
|
||||
}
|
||||
@@ -217,7 +217,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 (CentralEffectSimulation::BitfieldStates &bfs : m_bitfieldStatesBld)
|
||||
bfs.remove(data.aesItemId());
|
||||
@@ -228,7 +228,7 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char
|
||||
const int id)
|
||||
{
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(chargeStruct);
|
||||
DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)"
|
||||
DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)"
|
||||
<< ", m_handlerBuildingData.getFootprints().size =" << m_handlerBuildingData->getFootprints().size();
|
||||
|
||||
QHash<int, CentralEffectSimulation::HandlerBuildingData::Footprint> footprints = m_handlerBuildingData->getFootprints();
|
||||
@@ -241,7 +241,7 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char
|
||||
const Core::GeoPosition2D impactPosition2D(impactPosition.lon(), impactPosition.lat());
|
||||
if (inFootprint(impactPosition, footprint, impactRadius))
|
||||
{
|
||||
DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId
|
||||
DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId
|
||||
<< " chargeTypeId = " << chargeStruct.chargeTypeId()
|
||||
<< " id = " << id
|
||||
<< " currentPartitionTime = " << m_ddsHandler->currentPartitionTime()
|
||||
@@ -260,9 +260,9 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char
|
||||
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
|
||||
|
||||
@@ -275,7 +275,7 @@ void HandlerAesData::startTimer(int id, int msec) {
|
||||
// Timeout-Slot mit echtem SLOT
|
||||
connect(timer, &QTimer::timeout, this, &HandlerAesData::onStartTimeReached);
|
||||
timer->start(msec);
|
||||
DEBUG_LOG() << "Timer " << id << " gestartet fuer " << msec << " ms.";
|
||||
DEBUG_LOG(m_logger) << "Timer " << id << " gestartet fuer " << msec << " ms.";
|
||||
}
|
||||
|
||||
void HandlerAesData::onStartTimeReached()
|
||||
@@ -288,7 +288,7 @@ void HandlerAesData::onStartTimeReached()
|
||||
if (!bOk)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Timer " << chargeEffectId << " ausgeloest!";
|
||||
DEBUG_LOG(m_logger) << "Timer " << chargeEffectId << " ausgeloest!";
|
||||
|
||||
// Timer stoppen und loeschen
|
||||
AreaEffectSimulation::ChargeEffect data = m_chargeEffects.value(chargeEffectId);
|
||||
@@ -300,12 +300,12 @@ void HandlerAesData::onStartTimeReached()
|
||||
|
||||
void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEffect &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged";
|
||||
DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged";
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
const long long effectStart = data.effectStart();
|
||||
|
||||
DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged"
|
||||
DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged"
|
||||
<< ", effectStart=" << effectStart
|
||||
<< ", currentPartitionTime=" << m_ddsHandler->currentPartitionTime();
|
||||
|
||||
@@ -313,14 +313,14 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff
|
||||
// Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden
|
||||
if ( effectStart < m_ddsHandler->currentPartitionTime() - TIMEDIFFVALID )
|
||||
{
|
||||
DEBUG_LOG() << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden";
|
||||
DEBUG_LOG(m_logger) << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden";
|
||||
return;
|
||||
}
|
||||
// Startzeit entspricht der aktuellen Zeit
|
||||
if ( effectStart > m_ddsHandler->currentPartitionTime() - TIMEDIFFVALID
|
||||
&& effectStart < m_ddsHandler->currentPartitionTime() + data.effectDuration() )
|
||||
{
|
||||
DEBUG_LOG() << "Startzeit entspricht der aktuellen Zeit";
|
||||
DEBUG_LOG(m_logger) << "Startzeit entspricht der aktuellen Zeit";
|
||||
AreaEffectSimulation::ChargeStruct chargeStruct;
|
||||
chargeStruct.chargeTypeId(data.chargeTypeId());
|
||||
chargeStruct.igniterTypeId(data.igniterTypeId());
|
||||
@@ -330,13 +330,13 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff
|
||||
else if (effectStart > m_ddsHandler->currentPartitionTime() + data.effectDuration())
|
||||
{
|
||||
// Start mit Timer
|
||||
DEBUG_LOG() << "Startzeit in der Zukunft"
|
||||
DEBUG_LOG(m_logger) << "Startzeit in der Zukunft"
|
||||
<< ", id :" << data.id()
|
||||
<< ", duration=" << effectStart - m_ddsHandler->currentPartitionTime();
|
||||
m_chargeEffects.insert(data.id(), data);
|
||||
startTimer(data.id(), effectStart - m_ddsHandler->currentPartitionTime());
|
||||
}
|
||||
DEBUG_LOG() << "END onChargeEffectChanged";
|
||||
DEBUG_LOG(m_logger) << "END onChargeEffectChanged";
|
||||
|
||||
}
|
||||
|
||||
@@ -352,7 +352,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;
|
||||
}
|
||||
@@ -361,12 +361,12 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos
|
||||
m_explosionSingleState.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_explosionSingleState.insert(data.id(), data.effectStateId());
|
||||
|
||||
DEBUG_LOG() << "Got ExplosionSingle";
|
||||
DEBUG_LOG(m_logger) << "Got ExplosionSingle";
|
||||
if (handleExplosion)
|
||||
{
|
||||
calculateBuildingExplosion(data.chargeStruct(), data.impactPosition(), data.id());
|
||||
@@ -375,7 +375,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.chargeStruct().chargeTypeId(data.chargeStruct().chargeTypeId());
|
||||
@@ -390,20 +390,20 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got TriggeredImpacts";
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts";
|
||||
preCalculateImpacts(data);
|
||||
}
|
||||
|
||||
void HandlerAesData::onEffectsChanged(const AreaEffectSimulation::Effects &effects, DataModification modType)
|
||||
{
|
||||
TRACE_LOG() << " Got Effects " << effects;
|
||||
TRACE_LOG(m_logger) << " Got Effects " << effects;
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << " Got typechecked effects " << effects;
|
||||
DEBUG_LOG(m_logger) << " Got typechecked effects " << effects;
|
||||
|
||||
// calculate for every building of our exercise:
|
||||
const QHash<int, CentralEffectSimulation::HandlerBuildingData::Footprint> &footprints = m_handlerBuildingData->getFootprints();
|
||||
@@ -451,9 +451,9 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition,
|
||||
// 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
|
||||
@@ -472,7 +472,7 @@ 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
|
||||
|
||||
const int aesItemId = data.aesItemId();
|
||||
@@ -485,7 +485,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm
|
||||
if (!dtcAes->aesItemViewFromEntityId(aesItemId, data.aesTypeId(), aesItemView))
|
||||
{
|
||||
static long msgCnt = 0;
|
||||
WARNING_LOG() << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"
|
||||
WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"
|
||||
<< " (cnt=" << ++msgCnt << ")";
|
||||
return;
|
||||
}
|
||||
@@ -504,39 +504,39 @@ 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()
|
||||
<< ", m_handlerBuildingData.getFootprints().size()" << m_handlerBuildingData->getFootprints().size();
|
||||
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::onSendCesHit3DonBuildingReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "m_handlerBuildingData.getFootprints() size " << m_handlerBuildingData->getFootprints().size();
|
||||
DEBUG_LOG(m_logger) << "m_handlerBuildingData.getFootprints() size " << m_handlerBuildingData->getFootprints().size();
|
||||
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send hit3D on building to building service: " << replyObject()
|
||||
WARNING_LOG(m_logger) << "Can not send hit3D on building to building service: " << replyObject()
|
||||
<< ", m_handlerBuildingData.getFootprints().size()" << m_handlerBuildingData->getFootprints().size();
|
||||
else
|
||||
DEBUG_LOG() << "onSendCesHit3DonBuildingReply for id " << replyObject.id() << " success\n"
|
||||
DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingReply 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";
|
||||
}
|
||||
|
||||
void HandlerAesData::onSetBuildingStatesReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
if (reply.error())
|
||||
WARNING_LOG() << "onSetBuildingStatesReply for id " << reply.id() << " failed: " << reply.str();
|
||||
WARNING_LOG(m_logger) << "onSetBuildingStatesReply for id " << reply.id() << " failed: " << reply.str();
|
||||
else
|
||||
DEBUG_LOG() << "onSetBuildingStatesReply for id " << reply.id() << " successful";
|
||||
DEBUG_LOG(m_logger) << "onSetBuildingStatesReply for id " << reply.id() << " successful";
|
||||
}
|
||||
|
||||
// calculate impacts for one building
|
||||
@@ -560,26 +560,26 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
{
|
||||
bIsExplosionCluster = true;
|
||||
ignFuncBase = igniterFunctionBaseExplosionCluster(aesItemId); // assume that fuseType does not differ within a single ExplosionArea
|
||||
DEBUG_LOG() << "Calculate, bIsExplosionCluster = " << bIsExplosionCluster
|
||||
DEBUG_LOG(m_logger) << "Calculate, bIsExplosionCluster = " << bIsExplosionCluster
|
||||
<< ", ignFuncBase = " << ignFuncBase;
|
||||
}
|
||||
else if (s_relevantTypes.contains(data.aesTypeId().underlying()))
|
||||
DEBUG_LOG() << "Calculate";
|
||||
DEBUG_LOG(m_logger) << "Calculate";
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "No Calculation";
|
||||
DEBUG_LOG(m_logger) << "No Calculation";
|
||||
return;
|
||||
}
|
||||
|
||||
if (aesItemId != aesItemView.aesItemId())
|
||||
{
|
||||
WARNING_LOG() << "mismatch: "
|
||||
WARNING_LOG(m_logger) << "mismatch: "
|
||||
<< ", TriggeredExplosions.aesItemId=" << data.aesItemId()
|
||||
<< ", AesItemView.aesItemId=" << aesItemView.aesItemId();
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " aesItemId " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " aesItemId " << aesItemId
|
||||
<< ", bIsExplosionCluster = " << bIsExplosionCluster;
|
||||
|
||||
// get position(s) of impact(s):
|
||||
@@ -587,7 +587,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
CentralEffectSimulation::BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId];
|
||||
QSet<int> &bitfieldState = bitfieldStates[aesItemId];
|
||||
for (int i : std::as_const(bitfieldState))
|
||||
DEBUG_LOG() << "bitfieldState for " << aesItemId << ": " << i;
|
||||
DEBUG_LOG(m_logger) << "bitfieldState for " << aesItemId << ": " << i;
|
||||
|
||||
for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx)
|
||||
{
|
||||
@@ -600,7 +600,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
continue;
|
||||
|
||||
const Core::GeoPosition &impactPosition = aesItemView.form()[bitFieldIdx];
|
||||
DEBUG_LOG() << Q_FUNC_INFO
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon() << " z=" << impactPosition.z()
|
||||
<< " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition));
|
||||
|
||||
@@ -609,13 +609,13 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeStruct());
|
||||
if (inFootprint(impactPosition, footprint, impactRadius))
|
||||
{
|
||||
DEBUG_LOG() << "In Footprint of mseId = " << footprint.mseId;
|
||||
DEBUG_LOG(m_logger) << "In Footprint of mseId = " << footprint.mseId;
|
||||
if (!bitfieldState.contains(bitFieldIdx))
|
||||
{
|
||||
DEBUG_LOG() << "m_bitfieldStates.insert(aesItemId=" << aesItemId << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx;
|
||||
DEBUG_LOG(m_logger) << "m_bitfieldStates.insert(aesItemId=" << aesItemId << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx;
|
||||
bitfieldState.insert(bitFieldIdx);
|
||||
|
||||
DEBUG_LOG() << "sendCesHit mseId = " << footprint.mseId
|
||||
DEBUG_LOG(m_logger) << "sendCesHit mseId = " << footprint.mseId
|
||||
<< ", aesItemId=" << aesItemId
|
||||
<< ", bitFieldIdx= " << bitFieldIdx
|
||||
<< ", ignFuncBase = " << ignFuncBase;
|
||||
@@ -656,7 +656,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
detonationDistance,
|
||||
QStringLiteral("properties").toStdString());
|
||||
|
||||
DEBUG_LOG() << "sendCesHit3DonBuildingRequest for aesItemId=" << aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendCesHit3DonBuildingRequest for aesItemId=" << aesItemId
|
||||
<< " bitFieldIdx= " << bitFieldIdx
|
||||
<< ", requestBld= " << requestBld;
|
||||
|
||||
@@ -675,7 +675,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
Core::GeoPosition(impactPosition.lon(), impactPosition.lat(), 0.0),
|
||||
QStringLiteral("properties").toStdString());
|
||||
|
||||
DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
<< " bitFieldIdx= " << bitFieldIdx
|
||||
<< ", impactPosition= " << impactPosition;
|
||||
|
||||
@@ -684,7 +684,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac
|
||||
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "NOT in Footprint of mseId = " << footprint.mseId;
|
||||
DEBUG_LOG(m_logger) << "NOT in Footprint of mseId = " << footprint.mseId;
|
||||
// if (inFootprint(impactPosition
|
||||
} // foreach Impact
|
||||
} // for (int32_t bitFieldId
|
||||
@@ -696,7 +696,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
return;
|
||||
|
||||
const int aesItemId = effects.aesItemId();
|
||||
DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << aesItemId;
|
||||
|
||||
const AreaEffectSimulation::ExplosionCluster &ec = m_ddsHandler->dtcAes()->explosionCluster(effects.aesItemId());
|
||||
if (ec.id() != aesItemId)
|
||||
@@ -741,19 +741,19 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
QString mseIdAsStr;
|
||||
for (auto mseId : buildingIdsInBetween)
|
||||
mseIdAsStr += QString(QStringLiteral("_coveredByMseId_%1;")).arg(mseId);
|
||||
DEBUG_LOG() << "findBuildingsBetween returns mseIdAsStr =" << mseIdAsStr;
|
||||
DEBUG_LOG(m_logger) << "findBuildingsBetween returns mseIdAsStr =" << mseIdAsStr;
|
||||
|
||||
|
||||
const ProjectDataManagement::BuildingChargeEffect &bldgChargeEffect = m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(ec.chargeStruct().chargeTypeId());
|
||||
if (bldgChargeEffect.id() <= 0)
|
||||
ERROR_LOG() << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct().chargeTypeId();
|
||||
ERROR_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct().chargeTypeId();
|
||||
|
||||
|
||||
qint32 destructiveFactor = bldgChargeEffect.destructiveFactor();
|
||||
qint32 penetrationFactor = bldgChargeEffect.penetrationFactor();
|
||||
|
||||
if ((destructiveFactor <= 0) || (penetrationFactor <= 0))
|
||||
WARNING_LOG() << "getBuildingChargeEffectByChargeTypeId failed, destructiveFactor or penetrationFactor invalid"
|
||||
WARNING_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, destructiveFactor or penetrationFactor invalid"
|
||||
<< ", destructiveFactor = " << destructiveFactor
|
||||
<< ", penetrationFactor = " << penetrationFactor;
|
||||
|
||||
@@ -784,7 +784,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
Core::GeoPosition(impactPositionGeo.lon(), impactPositionGeo.lat(), 0.0),
|
||||
properties.toStdString());
|
||||
|
||||
DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId
|
||||
<< " bitFieldIdx= " << indexBitFieldIdx
|
||||
<< ", impactPositionGeo= " << impactPositionGeo
|
||||
<< ", chargeTypeId= " << ec.chargeStruct().chargeTypeId()
|
||||
@@ -831,7 +831,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec
|
||||
detonationDistance,
|
||||
properties.toStdString());
|
||||
|
||||
DEBUG_LOG() << "SendCesHit3DonBuildingRequest for aesItemId=" << aesItemId
|
||||
DEBUG_LOG(m_logger) << "SendCesHit3DonBuildingRequest for aesItemId=" << aesItemId
|
||||
<< " bitFieldIdx= " << indexBitFieldIdx
|
||||
<< ", impactPosition= " << impactPositionGeo
|
||||
<< ", zPlacement= " << zPlacement
|
||||
@@ -851,9 +851,9 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
QPolygonF polyGeo;
|
||||
|
||||
DEBUG_LOG() << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId();
|
||||
|
||||
DEBUG_LOG() << "AtBoobyTrapSecondary data.form().size()=" << data.form().size();
|
||||
DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary data.form().size()=" << data.form().size();
|
||||
// BoobyTrap
|
||||
polyGeo.reserve(data.form().size());
|
||||
for (const auto &pointGeo : std::as_const(data.form()))
|
||||
@@ -861,7 +861,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
QPointF point;
|
||||
point.setX(pointGeo.lon());
|
||||
point.setY(pointGeo.lat());
|
||||
DEBUG_LOG() << "point= " << point.x() << "/" << point.y();
|
||||
DEBUG_LOG(m_logger) << "point= " << point.x() << "/" << point.y();
|
||||
polyGeo.append(point);
|
||||
}
|
||||
|
||||
@@ -869,13 +869,13 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
bool isGroundLevel = true;
|
||||
const QVector<int> &buildingIdsInside = m_ddsHandler->dtcIsm()->getBuildingByPolygon(exerciseId, polyGeo, completeEnclosed, isGroundLevel);
|
||||
|
||||
DEBUG_LOG() << "buildingsInside.size=" << buildingIdsInside.size()
|
||||
DEBUG_LOG(m_logger) << "buildingsInside.size=" << buildingIdsInside.size()
|
||||
<< " exerciseId=" << exerciseId;
|
||||
// only include buildings within the radius
|
||||
|
||||
for (const int buildingId : std::as_const(buildingIdsInside))
|
||||
{
|
||||
DEBUG_LOG() << " BuildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << " BuildingId=" << buildingId;
|
||||
Buildings::Building tmpBldg;
|
||||
tmpBldg.buildingId(buildingId);
|
||||
|
||||
@@ -898,7 +898,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
QPointF pointGeo = impactPosPoint.geographic();
|
||||
impactPosition.lon(pointGeo.x());
|
||||
impactPosition.lat(pointGeo.y());
|
||||
DEBUG_LOG() << "impactPosition lon/lat=" << impactPosition.lon() << "/" << impactPosition.lat()
|
||||
DEBUG_LOG(m_logger) << "impactPosition lon/lat=" << impactPosition.lon() << "/" << impactPosition.lat()
|
||||
<< " impactPosPoint.zone" << impactPosPoint.zone
|
||||
<< " impactPosPoint=" << impactPosPoint.x << "/" << impactPosPoint.y
|
||||
<< " topRight=" << topRight.x << "/" << topRight.y
|
||||
@@ -916,7 +916,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView &
|
||||
QStringLiteral("properties").toStdString());
|
||||
|
||||
|
||||
DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId()
|
||||
DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId()
|
||||
<< ", impactPosition= " << impactPosition;
|
||||
m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this);
|
||||
}
|
||||
@@ -934,7 +934,7 @@ QVector<int> HandlerAesData::findBuildingsBetween(const LtsCoordTrans::LtsCoordi
|
||||
const LtsCoordTrans::LtsCoordinate targetFootprintPos =
|
||||
LtsCoordTrans::LtsCoordinate::fromUtm(targetFootprint.polyUtm.first(), targetFootprint.zone, 0.0);
|
||||
|
||||
DEBUG_LOG() << "findBuildingsBetween" << " START impactPosition " << impactPositionUTM.mgrs()
|
||||
DEBUG_LOG(m_logger) << "findBuildingsBetween" << " START impactPosition " << impactPositionUTM.mgrs()
|
||||
<< ", maybe effected mseId is = " << targetFootprint.mseId
|
||||
<< " with targetFootprintPos = " << targetFootprintPos.utmCoordinate().mgrs();
|
||||
|
||||
@@ -976,14 +976,14 @@ QVector<int> HandlerAesData::findBuildingsBetween(const LtsCoordTrans::LtsCoordi
|
||||
const bool intersects = impactToFootprintLineMetric.intersects(footprintToCheck.polyUtm);
|
||||
#endif
|
||||
|
||||
DEBUG_LOG() << "findBuildingsBetween"
|
||||
DEBUG_LOG(m_logger) << "findBuildingsBetween"
|
||||
<< " to mseId " << footprintToCheck.mseId
|
||||
<< " with curFpTargetPos " << impactPosition.utmCoordinate().mgrs()
|
||||
<< " -> intersects = " << intersects;
|
||||
|
||||
if (intersects)
|
||||
{
|
||||
DEBUG_LOG() << "findBuildingsBetween"
|
||||
DEBUG_LOG(m_logger) << "findBuildingsBetween"
|
||||
<< " regarding impactPosition " << impactPositionUTM.mgrs()
|
||||
<< " and mseId " << targetFootprint.mseId
|
||||
<< " is concealed/covered by footpriont of mseId = " << footprintToCheck.mseId;
|
||||
|
||||
+61
-61
@@ -52,19 +52,19 @@ HandlerBuildingModel::HandlerBuildingModel(
|
||||
, m_aesDataHandler(aesDataHandler)
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.Buildings.HandlerBuildingModel"))
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
HandlerBuildingModel::~HandlerBuildingModel()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
bool HandlerBuildingModel::init()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
std::shared_ptr<InfrastructureManagement::Interface::Dtc> dtcIsm = m_ddsHandler->dtcIsm();
|
||||
|
||||
dtcIsm->waitForHistoricalDataMainStructureElement(1000);
|
||||
@@ -77,16 +77,16 @@ bool HandlerBuildingModel::init()
|
||||
onMainStructureElementChanged(data, DataModification::eAdded);
|
||||
});
|
||||
|
||||
INFO_LOG() << "HandlerBuildingModel is running."
|
||||
INFO_LOG(m_logger) << "HandlerBuildingModel is running."
|
||||
<< ", m_buildingModels.size() = " << m_buildingModels.size();
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return true;
|
||||
}
|
||||
|
||||
HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingModel::getLineBuildingIntersection(
|
||||
const std::vector<Core::GeoPosition> &line, const std::string &requestIdOpt)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
newRequest.line(line);
|
||||
@@ -105,13 +105,13 @@ HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingMod
|
||||
result.errorParams = reply.errorParams();
|
||||
result.intersection = reply.intersection();
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return result;
|
||||
}
|
||||
|
||||
HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel::getLineBuildingIntersects(const std::vector<Core::GeoPosition> &line, const std::string &requestIdOpt)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
newRequest.line(line);
|
||||
@@ -130,7 +130,7 @@ HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel
|
||||
result.errorParams = reply.errorParams();
|
||||
result.intersects = ! std::isnan(reply.intersection().lat()); // ! std::isnan
|
||||
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
{
|
||||
const int mseBldgId = data.id();
|
||||
|
||||
TRACE_LOG() << "MainStructureElement === " << data;
|
||||
TRACE_LOG(m_logger) << "MainStructureElement === " << data;
|
||||
|
||||
// Always delete m_buildingModels-entry
|
||||
BuildingModel *buildingModelPtr = m_buildingModels.value((mseBldgId));
|
||||
@@ -147,7 +147,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "Building not added or modified id=" << mseBldgId;
|
||||
DEBUG_LOG(m_logger) << "Building not added or modified id=" << mseBldgId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
const Core::GeoPosition &geoPos = data.geoPosition();
|
||||
if (qFuzzyIsNull(geoPos.z()))
|
||||
{
|
||||
INFO_LOG() << "BuildingId " << mseBldgId
|
||||
INFO_LOG(m_logger) << "BuildingId " << mseBldgId
|
||||
<< " kann übersprungen werden, da von Hand importiert."
|
||||
<< ", name: '" << data.name() << "'"
|
||||
<< ", name: '" << data.description() << "'";
|
||||
@@ -175,17 +175,17 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
if (m_ddsHandler->dtcIsm()->isElementAssignedToExercise(data, exerciseId))
|
||||
{
|
||||
DEBUG_LOG() << "BuildingId " << mseBldgId
|
||||
DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId
|
||||
<< ", in Exercise";
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "BuildingId " << mseBldgId
|
||||
DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId
|
||||
<< ", not in Exercise";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "HandlerBuildingData::onMainStructureElementChanged() id=" << mseBldgId
|
||||
DEBUG_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << mseBldgId
|
||||
<< " properties=" << data.properties();
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
|
||||
// InfrastructureManagement::VulnerabilityModelData vulnerabilityModelDataEle;
|
||||
QByteArray vulnerabilityModelData = m_ddsHandler->dtcIsm()->getVulnerabilityModelData(data.id());
|
||||
TRACE_LOG() << "vulnerabilityModelData=" << vulnerabilityModelData
|
||||
TRACE_LOG(m_logger) << "vulnerabilityModelData=" << vulnerabilityModelData
|
||||
<< " id=" << data.id();
|
||||
|
||||
|
||||
@@ -211,27 +211,27 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan
|
||||
// } // for
|
||||
// if (id == -1)
|
||||
// {
|
||||
// WARNING_LOG() << "Missing VulnerabilityModelData for building " << mseBldgId << ". Skip building.";
|
||||
// WARNING_LOG(m_logger) << "Missing VulnerabilityModelData for building " << mseBldgId << ". Skip building.";
|
||||
// return;
|
||||
// } // if
|
||||
|
||||
const InfrastructureManagement::MainFootprint &mainFootprint = m_ddsHandler->dtcIsm()->getFootprintsByExerciseId(exerciseId).value(mseBldgId);
|
||||
|
||||
DEBUG_LOG() << "BuildingId " << mseBldgId;
|
||||
DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId;
|
||||
|
||||
BuildingModel *buildingModel = new BuildingModel(this);
|
||||
const InfrastructureManagement::MainStructureElement &mse = data;
|
||||
if (!buildingModel->init(mainFootprint, mse, vulnerabilityModelData, mseBldgId))
|
||||
{
|
||||
WARNING_LOG() << "Initializing BuildingModel failed for building " << mseBldgId << ". Skipping building.";
|
||||
WARNING_LOG(m_logger) << "Initializing BuildingModel failed for building " << mseBldgId << ". Skipping building.";
|
||||
return;
|
||||
}
|
||||
// if
|
||||
|
||||
INFO_LOG() << "Inserting BuildingModel for building " << mseBldgId;
|
||||
INFO_LOG(m_logger) << "Inserting BuildingModel for building " << mseBldgId;
|
||||
m_buildingModels.insert(mseBldgId, buildingModel);
|
||||
|
||||
INFO_LOG() << "onMainStructureElementChanged: "
|
||||
INFO_LOG(m_logger) << "onMainStructureElementChanged: "
|
||||
<< ", m_buildingModels.size() = " << m_buildingModels.size();
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core:
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionRequest &request)
|
||||
{
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
DEBUG_LOG() << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
|
||||
const bool justForLineOfSight = false;
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply = getLineBuildingIntersectionInternal(request, justForLineOfSight);
|
||||
@@ -253,14 +253,14 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core:
|
||||
// sendReply
|
||||
m_ddsHandler->ftsCes()->getLineBuildingIntersectionReply(cookie, reply);
|
||||
|
||||
DEBUG_LOG() << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId() << "'";
|
||||
}
|
||||
|
||||
void HandlerBuildingModel::onGetLineBuildingIntersectsRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CentralEffectSimulation::GetLineBuildingIntersectsRequest &request)
|
||||
{
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
DEBUG_LOG() << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'";
|
||||
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest;
|
||||
@@ -280,7 +280,7 @@ void HandlerBuildingModel::onGetLineBuildingIntersectsRequest(const rti::core::S
|
||||
|
||||
m_ddsHandler->ftsCes()->getLineBuildingIntersectsReply(cookie, newReply);
|
||||
|
||||
DEBUG_LOG() << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId() << "'";
|
||||
}
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
|
||||
DEBUG_LOG() << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
DEBUG_LOG(m_logger) << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
<< ", request.line().size() = " << request.line().size();
|
||||
|
||||
CentralEffectSimulation::GetLineBuildingIntersectionReply reply;
|
||||
@@ -315,7 +315,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
if (polylineRef.size() < 2)
|
||||
{
|
||||
reply.errorString("insufficiant number of points");
|
||||
WARNING_LOG() << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
WARNING_LOG(m_logger) << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"
|
||||
<< ", error: '" << reply.errorString() << "'";
|
||||
return reply;
|
||||
}
|
||||
@@ -332,9 +332,9 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
DEBUG_LOG() << "relevantBuildings.size=" << relevantBuildings.size();
|
||||
DEBUG_LOG(m_logger) << "relevantBuildings.size=" << relevantBuildings.size();
|
||||
for (const int bldgId : std::as_const(relevantBuildings))
|
||||
DEBUG_LOG() << "relevantBuilding: bldgId = " << bldgId;
|
||||
DEBUG_LOG(m_logger) << "relevantBuilding: bldgId = " << bldgId;
|
||||
}
|
||||
|
||||
|
||||
@@ -364,7 +364,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
const Core::GeoPosition &segStart = polylineRef[lineSegmentIdx];
|
||||
const Core::GeoPosition &segEnd = polylineRef[lineSegmentIdx + 1];
|
||||
|
||||
DEBUG_LOG() << " lineSegmentIdx=" << lineSegmentIdx
|
||||
DEBUG_LOG(m_logger) << " lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", start=" << segStart
|
||||
<< " , end=" << segEnd;
|
||||
|
||||
@@ -375,11 +375,11 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
BuildingModel *buildingModel = m_buildingModels.value(bldgId, nullptr);
|
||||
if (!buildingModel)
|
||||
{
|
||||
WARNING_LOG() << " buildingModel not found, bldgId=" << bldgId;
|
||||
WARNING_LOG(m_logger) << " buildingModel not found, bldgId=" << bldgId;
|
||||
continue;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< " , HEIGHT = " << buildingModel-> height();
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
// if buildingState is not found, assume intact:
|
||||
if (/*(buildingState.id() == bldgId) && */(buildingState.damagePercent() >= 80))
|
||||
{
|
||||
WARNING_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
WARNING_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", damagePercent > 80% (" << buildingState.damagePercent() << ")";
|
||||
continue;
|
||||
@@ -436,29 +436,29 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
const LtsUtils::QPoint3D &relStart = buildingModel->fromGeographic(segStart); // lift / lift_zValueToIfNegative
|
||||
const LtsUtils::QPoint3D &relEnd = buildingModel->fromGeographic(segEnd); // lift / lift_zValueToIfNegative
|
||||
|
||||
DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx;
|
||||
|
||||
DEBUG_LOG() << " segStart=" << segStart << " relStart=" << relStart;
|
||||
DEBUG_LOG() << " segEnd =" << segEnd << " relEnd=" << relEnd;
|
||||
DEBUG_LOG(m_logger) << " segStart=" << segStart << " relStart=" << relStart;
|
||||
DEBUG_LOG(m_logger) << " segEnd =" << segEnd << " relEnd=" << relEnd;
|
||||
|
||||
if (!buildingModel->hasIntersectionSimplified(relStart, relEnd)) // check height and footprint
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", hasIntersectionSimplified was true";
|
||||
|
||||
const Core::GeoPosition &intersection = buildingModel->intersection(relStart, relEnd); // assume intersection and calculate
|
||||
|
||||
DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", intersection = " << intersection;
|
||||
|
||||
if (!BuildingModel::isValid(intersection)) // no intersection
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId()
|
||||
<< ", lineSegmentIdx=" << lineSegmentIdx
|
||||
<< ", has valid intersection = " << intersection;
|
||||
if (buildingIdOut)
|
||||
@@ -468,7 +468,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
if (justForLineOfSight)
|
||||
{
|
||||
reply.intersection(intersection);
|
||||
DEBUG_LOG() << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId() << "'";
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId() << "'";
|
||||
return reply;
|
||||
}
|
||||
// : justForLineOfSight
|
||||
@@ -477,9 +477,9 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
if (dist < distance) // new intersection is closer than the last one
|
||||
{
|
||||
if (buildingId == -1) // first intersection found
|
||||
DEBUG_LOG() << "Building " << buildingModel->buildingId() << " was hit.";
|
||||
DEBUG_LOG(m_logger) << "Building " << buildingModel->buildingId() << " was hit.";
|
||||
else // this building "covers" the last one found
|
||||
DEBUG_LOG() << "Building " << buildingModel->buildingId() << " was hit prior to building " << buildingId << ".";
|
||||
DEBUG_LOG(m_logger) << "Building " << buildingModel->buildingId() << " was hit prior to building " << buildingId << ".";
|
||||
buildingId = buildingModel->buildingId();
|
||||
distance = dist;
|
||||
reply.intersection(intersection);
|
||||
@@ -491,7 +491,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel::
|
||||
} // for (const int bldgId : std::as_const(relevantBuildings))
|
||||
} // for(lineIt = polylineRef.begin(); lineIt != polylineRef.end()-1; ++lineIt)
|
||||
|
||||
DEBUG_LOG() << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'"
|
||||
DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'"
|
||||
<< " buildingIdOut=" << *buildingIdOut;
|
||||
|
||||
return reply;
|
||||
@@ -506,10 +506,10 @@ void HandlerBuildingModel::onDetonationLocationRequest(
|
||||
const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::DetonationLocationRequest &request
|
||||
)
|
||||
{
|
||||
DEBUG_LOG() << "Received DetonationLocationRequest for aesId: " << request.id();
|
||||
DEBUG_LOG(m_logger) << "Received DetonationLocationRequest for aesId: " << request.id();
|
||||
const CentralEffectSimulation::DetonationLocationReply reply = handleDetonationLocationRequest(request);
|
||||
if (!reply.errorString().empty())
|
||||
WARNING_LOG() << "DetonationLocationRequest for aesId " << request.id() << " failed: " << reply.errorString();
|
||||
WARNING_LOG(m_logger) << "DetonationLocationRequest for aesId " << request.id() << " failed: " << reply.errorString();
|
||||
// if
|
||||
m_ddsHandler->ftsCes()->detonationLocationReply(cookie, reply);
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void HandlerBuildingModel::onDetonationLocationRequest(
|
||||
CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDetonationLocationRequest(const CentralEffectSimulation::DetonationLocationRequest &request) const
|
||||
{
|
||||
const int exerciseId = m_ddsHandler->getExerciseId();
|
||||
DEBUG_LOG() << " handleDetonationLocationRequest request=" << request
|
||||
DEBUG_LOG(m_logger) << " handleDetonationLocationRequest request=" << request
|
||||
<< ", m_buildingModels.size() = " << m_buildingModels.size();
|
||||
// AES::
|
||||
// ExplosionCluster most likely has serveral impacts and therefore several trajectories.
|
||||
@@ -542,7 +542,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
|
||||
if (reqTrajRef.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << " handleDetonationLocationRequest request.trajectory() invalid, size =" << reqTrajRef.size();
|
||||
ERROR_LOG(m_logger) << " handleDetonationLocationRequest request.trajectory() invalid, size =" << reqTrajRef.size();
|
||||
return reply;
|
||||
}
|
||||
|
||||
@@ -572,17 +572,17 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
const bool bHasBuildingIntersection = BuildingModel::isValid(bldgIntersectionCoord.geoPosition());
|
||||
if (bHasBuildingIntersection)
|
||||
{
|
||||
DEBUG_LOG() << "RESULT: Trajectory: hasBuildingIntersection YES, at: " << bldgIntersectionCoord.mgrs()
|
||||
DEBUG_LOG(m_logger) << "RESULT: Trajectory: hasBuildingIntersection YES, at: " << bldgIntersectionCoord.mgrs()
|
||||
<< " buildingId=" << buildingId;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "RESULT: Trajectory: hasBuildingIntersection NO";
|
||||
DEBUG_LOG(m_logger) << "RESULT: Trajectory: hasBuildingIntersection NO";
|
||||
|
||||
const bool bIsInTrainingOrCentralArea = true;
|
||||
if (bIsInTrainingOrCentralArea)
|
||||
{
|
||||
DEBUG_LOG() << "RESULT: integrate free area...";
|
||||
DEBUG_LOG(m_logger) << "RESULT: integrate free area...";
|
||||
|
||||
// free area and FuseType_def::IfbDelay:
|
||||
// We can´t move the detonation point _below_ the surface.
|
||||
@@ -610,13 +610,13 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
{
|
||||
if (!bHasBuildingIntersection)
|
||||
{
|
||||
DEBUG_LOG() << "detonationLocation on ground" << detonationLocation.geoPosition()
|
||||
DEBUG_LOG(m_logger) << "detonationLocation on ground" << detonationLocation.geoPosition()
|
||||
<< std::fixed << std::setprecision(3)
|
||||
<< ", heightOverElevation = " << detonationLocation.heightOverElevation();
|
||||
Q_ASSERT_X(std::fabs(detonationLocation.heightOverElevation()) < 1.0, "handleDetonationLocationRequest", "heightOverElevation is to high");
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection
|
||||
DEBUG_LOG(m_logger) << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection
|
||||
<< ", igniterFunctionBase: " << ignFuncBase
|
||||
<< ", detonationDistance: " << detonationDistance
|
||||
<< ", reqTrajRef.size():" << reqTrajRef.size() << " back: " << reqTrajRef.back()
|
||||
@@ -632,7 +632,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
// instead of backtrackTrajectory(), use simply resize and push_back(bldgIntersectionCoord)
|
||||
std::vector<Core::GeoPosition> trajectoryCopy = reqTrajRef;
|
||||
|
||||
DEBUG_LOG() << "validSizeOfOriginalTraj is below zero: " << validSizeOfOriginalTraj << ", exerciseId " << exerciseId << ", buildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "validSizeOfOriginalTraj is below zero: " << validSizeOfOriginalTraj << ", exerciseId " << exerciseId << ", buildingId=" << buildingId;
|
||||
|
||||
// in case of hasBuildingIntersection
|
||||
if (validSizeOfOriginalTraj > 0)
|
||||
@@ -644,7 +644,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
// adjust detonationLocation by taking detonationDistance (!= 0) into account:
|
||||
detonationLocation = LtsCoordTrans::LtsCoordinate(calculateDetonationLocation(trajectoryCopy, detonationDistance));
|
||||
|
||||
DEBUG_LOG() << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection
|
||||
DEBUG_LOG(m_logger) << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection
|
||||
<< ", igniterFunctionBase: " << ignFuncBase
|
||||
<< ", detonationDistance: " << detonationDistance
|
||||
<< ", trajectoryCopy.size()=" << trajectoryCopy.size() << " back: " << trajectoryCopy.back()
|
||||
@@ -661,12 +661,12 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet
|
||||
|
||||
Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::vector<Core::GeoPosition> &trajectoryGeometry, double detonationDistance) const
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << " START";
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
|
||||
const int geometrySize = trajectoryGeometry.size();
|
||||
if (geometrySize < 3)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO << ", trajectoryGeometry not sufficiant";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << ", trajectoryGeometry not sufficiant";
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v
|
||||
|
||||
QVector3D flightVec = segEnd - segStart;
|
||||
|
||||
INFO_LOG() << "flightVec1 "
|
||||
INFO_LOG(m_logger) << "flightVec1 "
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z()
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z()
|
||||
<< ", flightVec " << flightVec;
|
||||
@@ -721,7 +721,7 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v
|
||||
const QPointF &pointDeto = utmDeto.geographic();
|
||||
Core::GeoPosition geoPosDeto(pointDeto.x(), pointDeto.y(), detonationLoc.z());
|
||||
|
||||
DEBUG_LOG() << "flightVec2 "
|
||||
DEBUG_LOG(m_logger) << "flightVec2 "
|
||||
<< ", utm1 " << utm1 << " , z " << p1.z()
|
||||
<< ", utm2 " << utm2 << " , z " << p2.z()
|
||||
<< ", flightVec " << flightVec
|
||||
@@ -774,7 +774,7 @@ Core::GeoPosition HandlerBuildingModel::backtrackTrajectory(const std::vector<Co
|
||||
return startGeo;
|
||||
} // for
|
||||
|
||||
WARNING_LOG() << "Backtracing trajectory for proximity fuse type failed.";
|
||||
WARNING_LOG(m_logger) << "Backtracing trajectory for proximity fuse type failed.";
|
||||
return startGeo;
|
||||
}
|
||||
*/
|
||||
|
||||
+32
-32
@@ -30,7 +30,7 @@ HandlerBuildingOwnership::HandlerBuildingOwnership(const std::shared_ptr<Central
|
||||
, m_db(db)
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.Buildings.HandlerBuildingOwnership"))
|
||||
{
|
||||
INFO_LOG() << "HandlerBuildingOwnership::HandlerBuildingOwnership";
|
||||
INFO_LOG(m_logger) << "HandlerBuildingOwnership::HandlerBuildingOwnership";
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -41,10 +41,10 @@ HandlerBuildingOwnership::~HandlerBuildingOwnership()
|
||||
|
||||
bool HandlerBuildingOwnership::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerBuildingOwnership::init";
|
||||
INFO_LOG(m_logger) << "HandlerBuildingOwnership::init";
|
||||
auto dtcIsm = m_ddsHandler->dtcIsm();
|
||||
|
||||
DEBUG_LOG() << "init";
|
||||
DEBUG_LOG(m_logger) << "init";
|
||||
loadOwnershipsFromDb();
|
||||
|
||||
connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newOutdoorPosition,
|
||||
@@ -83,7 +83,7 @@ bool HandlerBuildingOwnership::init()
|
||||
void HandlerBuildingOwnership::onSetOwnershipRequest(const rti::core::SampleIdentity &cookie,
|
||||
const CentralEffectSimulation::SetOwnershipRequest &request)
|
||||
{
|
||||
INFO_LOG() << "onSetOwnershipRequest: " << request;
|
||||
INFO_LOG(m_logger) << "onSetOwnershipRequest: " << request;
|
||||
|
||||
// remove Ownership, if partyId == 0
|
||||
if (request.partyId() == 0)
|
||||
@@ -103,7 +103,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
|
||||
{
|
||||
|
||||
const int participantId = partPos.participantId();
|
||||
INFO_LOG() << "BuildingOwnership onParticipantPositionChanged participantId=" << participantId
|
||||
INFO_LOG(m_logger) << "BuildingOwnership onParticipantPositionChanged participantId=" << participantId
|
||||
<< " vulnerabilityState=" << partPos.vulnerabilityState
|
||||
<< " buildingId=" << partPos.buildingId()
|
||||
<< " notfightMode=" << partPos.notfightMode;
|
||||
@@ -121,7 +121,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
|
||||
|
||||
int newOwnership = calculateOwnershipByParticipantId(participantId);
|
||||
checkAndSendOwnership(newOwnership, floorId);
|
||||
INFO_LOG() << "END BuildingOwnership onParticipantPositionChanged participantId=" << participantId
|
||||
INFO_LOG(m_logger) << "END BuildingOwnership onParticipantPositionChanged participantId=" << participantId
|
||||
<< " vulnerabilityState=" << partPos.vulnerabilityState;
|
||||
} // end of onParticipantPositionChanged()
|
||||
|
||||
@@ -131,7 +131,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS
|
||||
// ///////////////////////////////////
|
||||
void HandlerBuildingOwnership::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "onMainStructureElementChanged id=" << data.id()
|
||||
INFO_LOG(m_logger) << "onMainStructureElementChanged id=" << data.id()
|
||||
<< " modelId =" << data.modelId();
|
||||
if (modType == DataModification::eRemoved || data.modelId() <= 0)
|
||||
{
|
||||
@@ -140,7 +140,7 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur
|
||||
}
|
||||
|
||||
QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object().value(QLatin1String("available_in_exercise")).toArray();
|
||||
DEBUG_LOG() << "available_in_exercise jsonDocument.size()=" << jsonArray.size();
|
||||
DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument.size()=" << jsonArray.size();
|
||||
QVector<int> result;
|
||||
result.reserve(jsonArray.size());
|
||||
|
||||
@@ -154,11 +154,11 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur
|
||||
|
||||
for (auto it = jsonArray.constBegin(); it != jsonArray.constEnd(); ++it)
|
||||
{
|
||||
DEBUG_LOG() << "available_in_exercise jsonDocument=" << it->toInt();
|
||||
DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument=" << it->toInt();
|
||||
if (m_ddsHandler->getExerciseId() != it->toInt())
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "Got MainStructureElement"
|
||||
DEBUG_LOG(m_logger) << "Got MainStructureElement"
|
||||
<< " data.id()=" << data.id()
|
||||
<< " data.modelId=" << data.modelId();
|
||||
if (!m_buildingOwnership.contains(data.id()))
|
||||
@@ -176,7 +176,7 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur
|
||||
|
||||
void HandlerBuildingOwnership::onParticipantLeavesBuilding(const int participantId)
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership onParticipantLeavesBuilding participantId=" << participantId;
|
||||
INFO_LOG(m_logger) << "BuildingOwnership onParticipantLeavesBuilding participantId=" << participantId;
|
||||
auto it = m_participantFloor.find(participantId);
|
||||
if (it == m_participantFloor.end())
|
||||
return;
|
||||
@@ -184,26 +184,26 @@ void HandlerBuildingOwnership::onParticipantLeavesBuilding(const int participant
|
||||
|
||||
const int floorId = it.value();
|
||||
const int newOwnership = calculateOwnershipByFloorId(floorId);
|
||||
DEBUG_LOG() << "newOwnership=" << newOwnership;
|
||||
DEBUG_LOG(m_logger) << "newOwnership=" << newOwnership;
|
||||
if (newOwnership > 0)
|
||||
checkAndSendOwnership(newOwnership, floorId);
|
||||
} // end of onParticipantLeavesBuilding()
|
||||
|
||||
int HandlerBuildingOwnership::calculateOwnershipByParticipantId(const int participantId)
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership calculateOwnershipByParticipantId participantId=" << participantId;
|
||||
INFO_LOG(m_logger) << "BuildingOwnership calculateOwnershipByParticipantId participantId=" << participantId;
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(participantId);
|
||||
return calculateOwnershipByFloorId(m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId()));
|
||||
}
|
||||
|
||||
int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId)
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership calculateOwnershipByFloorId floorId=" << floorId;
|
||||
INFO_LOG(m_logger) << "BuildingOwnership calculateOwnershipByFloorId floorId=" << floorId;
|
||||
int ownership = -1;
|
||||
if (floorId == -1)
|
||||
return ownership;
|
||||
|
||||
DEBUG_LOG() << "calculateOwnership floorId = " << floorId;
|
||||
DEBUG_LOG(m_logger) << "calculateOwnership floorId = " << floorId;
|
||||
|
||||
QHash <int, int> partyCount; // key = Party, value= Count of Participants;
|
||||
// Suche alle Participants in der Etage
|
||||
@@ -235,7 +235,7 @@ int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId)
|
||||
|
||||
int HandlerBuildingOwnership::getOwnership(int buildingId, int floorId) const
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership getOwnership buildingId=" << buildingId
|
||||
INFO_LOG(m_logger) << "BuildingOwnership getOwnership buildingId=" << buildingId
|
||||
<< " floorId=" << floorId;
|
||||
auto itBldg = m_buildingOwnership.find(buildingId);
|
||||
if (itBldg == m_buildingOwnership.end())
|
||||
@@ -251,18 +251,18 @@ int HandlerBuildingOwnership::getOwnership(int buildingId, int floorId) const
|
||||
|
||||
void HandlerBuildingOwnership::checkAndSendOwnership(const int newOwnership, const int floorId)
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership checkAndSendOwnership";
|
||||
INFO_LOG(m_logger) << "BuildingOwnership checkAndSendOwnership";
|
||||
if (floorId < 0) // outside building
|
||||
return;
|
||||
const int buildingId = m_handlerBuildingData->getBuildingIdFromFloorId(floorId);
|
||||
if (buildingId < 0)
|
||||
{
|
||||
WARNING_LOG() << "Could not find building for floor with id " << floorId << " - ignoring";
|
||||
WARNING_LOG(m_logger) << "Could not find building for floor with id " << floorId << " - ignoring";
|
||||
return;
|
||||
}
|
||||
// prüfe, ob sich die Farbe geändert hat.
|
||||
const int oldOwnership = getOwnership(buildingId, floorId);
|
||||
DEBUG_LOG() << "checkAndSendOwnership buildingId = "
|
||||
DEBUG_LOG(m_logger) << "checkAndSendOwnership buildingId = "
|
||||
<< buildingId
|
||||
<< " floorId=" << floorId
|
||||
<< " oldOwnership=" << oldOwnership
|
||||
@@ -273,23 +273,23 @@ void HandlerBuildingOwnership::checkAndSendOwnership(const int newOwnership, con
|
||||
saveBuildingOwnership(floorId, newOwnership, buildingId);
|
||||
// und Meldung verschicken.
|
||||
sendBuildingOwnership(buildingId);
|
||||
DEBUG_LOG() << "new Building Ownership";
|
||||
DEBUG_LOG(m_logger) << "new Building Ownership";
|
||||
}
|
||||
}
|
||||
|
||||
void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::BuildingOwnership *bo)
|
||||
{
|
||||
INFO_LOG() << "BuildingOwnership updateOwnerships";
|
||||
INFO_LOG(m_logger) << "BuildingOwnership updateOwnerships";
|
||||
QMap <int, int> ownershipMap;
|
||||
|
||||
const QVector<int> floors = m_handlerBuildingData->getFloorsFromBuilding(bo->buildingId());
|
||||
DEBUG_LOG() << "updateOwnerships floors.size= " << floors.size();
|
||||
DEBUG_LOG(m_logger) << "updateOwnerships floors.size= " << floors.size();
|
||||
for (const int floorId : floors)
|
||||
ownershipMap[floorId] = 0;
|
||||
|
||||
for (const CentralEffectSimulation::Ownership &ownership : bo->ownerships())
|
||||
{
|
||||
DEBUG_LOG() << "updateOwnerships floorId=" << ownership.floorId() << ": " << ownership.partyId();
|
||||
DEBUG_LOG(m_logger) << "updateOwnerships floorId=" << ownership.floorId() << ": " << ownership.partyId();
|
||||
ownershipMap[ownership.floorId()] = ownership.partyId();
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::Buildin
|
||||
CentralEffectSimulation::Ownership ownership;
|
||||
for (auto it = ownershipMap.cbegin(); it != ownershipMap.cend(); ++it)
|
||||
{
|
||||
DEBUG_LOG() << it.key() << ": " << it.value();
|
||||
DEBUG_LOG(m_logger) << it.key() << ": " << it.value();
|
||||
ownership.floorId(it.key());
|
||||
ownership.partyId(it.value());
|
||||
bo->ownerships().push_back(ownership);
|
||||
@@ -308,7 +308,7 @@ void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::Buildin
|
||||
}
|
||||
void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, int buildingId)
|
||||
{
|
||||
INFO_LOG() << "saveBuildingOwnership floorId: " << floorId
|
||||
INFO_LOG(m_logger) << "saveBuildingOwnership floorId: " << floorId
|
||||
<< ", partyId: " << partyId
|
||||
<< ", buildingId: " << buildingId;
|
||||
|
||||
@@ -349,7 +349,7 @@ void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, i
|
||||
|
||||
void HandlerBuildingOwnership::sendBuildingOwnership(int buildingId)
|
||||
{
|
||||
INFO_LOG() << "sendBuildingOwnership for building: " << buildingId;
|
||||
INFO_LOG(m_logger) << "sendBuildingOwnership for building: " << buildingId;
|
||||
CentralEffectSimulation::BuildingOwnership bo = m_buildingOwnership.value(buildingId);
|
||||
bo.buildingId(buildingId);
|
||||
bo.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
@@ -363,7 +363,7 @@ void HandlerBuildingOwnership::sendBuildingOwnership(int buildingId)
|
||||
///
|
||||
bool HandlerBuildingOwnership::loadOwnershipsFromDb()
|
||||
{
|
||||
INFO_LOG() << "HandlerBuildingOwnership::loadOwnershipsFromDb ";
|
||||
INFO_LOG(m_logger) << "HandlerBuildingOwnership::loadOwnershipsFromDb ";
|
||||
m_buildingOwnership.clear();
|
||||
auto cbBo = [this](const CentralEffectSimulation::Database::CesOwnership & bo)
|
||||
{
|
||||
@@ -371,7 +371,7 @@ bool HandlerBuildingOwnership::loadOwnershipsFromDb()
|
||||
};
|
||||
if (!m_db->select(cbBo))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database 'CesOwnership'";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database 'CesOwnership'";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -379,7 +379,7 @@ bool HandlerBuildingOwnership::loadOwnershipsFromDb()
|
||||
|
||||
void HandlerBuildingOwnership::removeFromDbBuildingId(const int buildingId)
|
||||
{
|
||||
INFO_LOG() << "HandlerBuildingOwnership::removeFromDbBuildingId buildingId: " << buildingId;
|
||||
INFO_LOG(m_logger) << "HandlerBuildingOwnership::removeFromDbBuildingId buildingId: " << buildingId;
|
||||
m_db->removeCesOwnershipByBuildingId(buildingId);
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ void HandlerBuildingOwnership::insertInDb(const CentralEffectSimulation::Buildin
|
||||
DBTransaction trans(m_db->database());
|
||||
|
||||
removeFromDbBuildingId(bo.buildingId());
|
||||
INFO_LOG() << "insertInDb buildingId: " << bo.buildingId()
|
||||
INFO_LOG(m_logger) << "insertInDb buildingId: " << bo.buildingId()
|
||||
<< ", bo.ownerships().size(): " << bo.ownerships().size();
|
||||
CentralEffectSimulation::Database::CesOwnership newOwnership;
|
||||
newOwnership.buildingId = bo.buildingId();
|
||||
@@ -398,10 +398,10 @@ void HandlerBuildingOwnership::insertInDb(const CentralEffectSimulation::Buildin
|
||||
newOwnership.id = 0;
|
||||
newOwnership.floorId = ownership.floorId();
|
||||
newOwnership.partyId = ownership.partyId();
|
||||
DEBUG_LOG() << "ownership: floorId = " << newOwnership.floorId
|
||||
DEBUG_LOG(m_logger) << "ownership: floorId = " << newOwnership.floorId
|
||||
<< " partyId = " << newOwnership.partyId;
|
||||
if (!m_db->insert(newOwnership))
|
||||
ERROR_LOG() << "Error adding 'CesOwnership' to database "
|
||||
ERROR_LOG(m_logger) << "Error adding 'CesOwnership' to database "
|
||||
<< " buildingId =" << newOwnership.buildingId
|
||||
<< " floorId = " << newOwnership.floorId
|
||||
<< " partyId = " << newOwnership.partyId;
|
||||
|
||||
+48
-48
@@ -102,7 +102,7 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got AesItemView: " << data.effectStateId()
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId()
|
||||
<< " data.aesItemId()" << data.aesItemId()
|
||||
<< " data.aesTypeId()" << data.aesTypeId();
|
||||
switch (data.effectStateId().underlying())
|
||||
@@ -116,21 +116,21 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
{
|
||||
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
|
||||
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
|
||||
DEBUG_LOG() << "AtNContamination: chargeHeight=" << chargeHeight
|
||||
DEBUG_LOG(m_logger) << "AtNContamination: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
else
|
||||
{
|
||||
chargeHeight = m_aesBCContaminations.value(data.aesItemId()).upperOffset();
|
||||
chargeDepression = m_aesBCContaminations.value(data.aesItemId()).lowerOffset();
|
||||
DEBUG_LOG() << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG() << "return1: AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return1: AesItemView: " << data.effectStateId();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,11 +139,11 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
if (volatilityType != ProjectDataManagement::VolatilityType_def::Resident
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG() << "return2: AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return2: AesItemView: " << data.effectStateId();
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId();
|
||||
auto dtcIsm = m_ddsHandler->dtcIsm();
|
||||
// Form in UTM-Polygon wandeln
|
||||
int exerciseId = m_ddsHandler->getExerciseId();
|
||||
@@ -156,7 +156,7 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI
|
||||
bool completeEnclosed = true;
|
||||
bool isGroundLevel = false;
|
||||
const QVector<int> &buildingIds = dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel);
|
||||
DEBUG_LOG() << "buildingIds.size=" << buildingIds.size();
|
||||
DEBUG_LOG(m_logger) << "buildingIds.size=" << buildingIds.size();
|
||||
for (int buildingId : std::as_const(buildingIds))
|
||||
{
|
||||
calculateBuilding(buildingId, data, chargeHeight, chargeDepression);
|
||||
@@ -181,7 +181,7 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
|
||||
{
|
||||
DEBUG_LOG() << "return: NO BC-Contamination AesItemView: " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "return: NO BC-Contamination AesItemView: " << data.effectStateId();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -190,27 +190,27 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
&& data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "buildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "buildingId=" << buildingId;
|
||||
effectedRooms.clear();
|
||||
effectedFloors = getEffectedFloors(buildingId, chargeHeight, chargeDepression);
|
||||
for (int effectedFloor : std::as_const(effectedFloors))
|
||||
effectedRooms += dtcIsm.get()->getRoomIdsFromFloorId(buildingId, effectedFloor);
|
||||
if (!effectedRooms.empty())
|
||||
{
|
||||
DEBUG_LOG() << "effectedRooms.size=" << effectedRooms.size();
|
||||
DEBUG_LOG(m_logger) << "effectedRooms.size=" << effectedRooms.size();
|
||||
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady;
|
||||
|
||||
// [GUEZE-2752] N-Contamination: Only Contamionation inside Range1
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination
|
||||
&& !isInsideRange1(buildingId, data.aesItemId()))
|
||||
{
|
||||
DEBUG_LOG() << "!isInsideRange1 buildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "!isInsideRange1 buildingId=" << buildingId;
|
||||
return;
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBCContamination
|
||||
&& !isInsideBCContamination(buildingId, data.aesItemId()))
|
||||
{
|
||||
DEBUG_LOG() << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return";
|
||||
DEBUG_LOG(m_logger) << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return";
|
||||
return;
|
||||
}
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination
|
||||
@@ -220,15 +220,15 @@ void HandlerContamination::calculateBuilding(int buildingId,
|
||||
// Only actual explosion not old N-Fields
|
||||
if ( m_ddsHandler->dtcCore()->partitionTime().timeStamp() < (data.effectStart() + TIME_2_SECONDS))
|
||||
{
|
||||
DEBUG_LOG() << "VulnerabilityState=CatastrophicKill";
|
||||
DEBUG_LOG(m_logger) << "VulnerabilityState=CatastrophicKill";
|
||||
vulnerabilityState = ProjectDataManagement::VulnerabilityState::CatastrophicKill;
|
||||
}
|
||||
}
|
||||
DEBUG_LOG() << "setBuildingContaminationStateRequest buildingId=" << buildingId
|
||||
DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest buildingId=" << buildingId
|
||||
<< " data.aesTypeId()=" << data.aesTypeId()
|
||||
<< " isInsideInnerCircle(buildingId, data.aesItemId()=" << isInsideInnerCircle(buildingId, data.aesItemId());
|
||||
{
|
||||
DEBUG_LOG() << "isInsideInnerCircle buildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle buildingId=" << buildingId;
|
||||
setBuildingContaminationStateRequest(buildingId, data.aesItemId(), vulnerabilityState, effectedRooms);
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
&& modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
INFO_LOG() << "onBuildingStateChanged"
|
||||
INFO_LOG(m_logger) << "onBuildingStateChanged"
|
||||
<< " id=" << data.id()
|
||||
<< " aesId=" << data.aesId()
|
||||
<< " contaminationStates().size=" << data.contaminationStates().size();
|
||||
@@ -260,7 +260,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
{
|
||||
if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||
{
|
||||
DEBUG_LOG() << "Wirkfeld aesItemView.id()=" << aesItemView.id()
|
||||
DEBUG_LOG(m_logger) << "Wirkfeld aesItemView.id()=" << aesItemView.id()
|
||||
<< " aesItemView.aesItemId()=" << aesItemView.aesItemId()
|
||||
<< " fuer Gebaeude " << data.id() << " neu berechnen";
|
||||
|
||||
@@ -271,7 +271,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
{
|
||||
chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen
|
||||
chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen
|
||||
DEBUG_LOG() << "AtNContamination: chargeHeight=" << chargeHeight
|
||||
DEBUG_LOG(m_logger) << "AtNContamination: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
else
|
||||
@@ -280,12 +280,12 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
{
|
||||
chargeHeight = m_aesBCContaminations.value(aesItemView.aesItemId()).upperOffset();
|
||||
chargeDepression = m_aesBCContaminations.value(aesItemView.aesItemId()).lowerOffset();
|
||||
DEBUG_LOG() << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight
|
||||
<< " chargeDepression=" << chargeDepression;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState
|
||||
if (buildingIds.contains(data.id() ))
|
||||
calculateBuilding(data.id(), aesItemView, chargeHeight, chargeDepression);
|
||||
else
|
||||
DEBUG_LOG() << "Building not in Area BuildingId=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "Building not in Area BuildingId=" << data.id();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -321,7 +321,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
contaminationState.vulnerabilityState(vulnerabilityState);
|
||||
// contaminationState.vulne
|
||||
|
||||
DEBUG_LOG() << "setBuildingContaminationStateRequest"
|
||||
DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest"
|
||||
<< " buildingId=" << buildingId
|
||||
<< " aesId=" << aesId
|
||||
<< " vulnerabilityState=" << vulnerabilityState
|
||||
@@ -331,7 +331,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
{
|
||||
contaminationState.rooms()[i] = rooms[i];
|
||||
contaminationState.vulnerabilityState(vulnerabilityState);
|
||||
DEBUG_LOG() << " room[" << i << "]=" << rooms[i];
|
||||
DEBUG_LOG(m_logger) << " room[" << i << "]=" << rooms[i];
|
||||
}
|
||||
|
||||
Buildings::SetBuildingContaminationStateRequest requestContamination(
|
||||
@@ -341,7 +341,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
// Senden, wenn fuer das Gebaeude noch keine Contamination vorhanden ist.
|
||||
if (!m_contaminationState.contains(buildingId))
|
||||
{
|
||||
DEBUG_LOG() << "Neue Kontamination BuildingId=" << buildingId
|
||||
DEBUG_LOG(m_logger) << "Neue Kontamination BuildingId=" << buildingId
|
||||
<< " requestContamination aesId=" << requestContamination.contaminationState().aesId();
|
||||
|
||||
m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this);
|
||||
@@ -352,19 +352,19 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId,
|
||||
Buildings::SetBuildingContaminationStateRequest lastRequestContamination = m_contaminationState.value(buildingId);
|
||||
if (lastRequestContamination != requestContamination)
|
||||
{
|
||||
DEBUG_LOG() << "Änderung der Kontamination BuildingId=" << buildingId
|
||||
DEBUG_LOG(m_logger) << "Änderung der Kontamination BuildingId=" << buildingId
|
||||
<< " aesId=" << requestContamination.contaminationState().aesId();
|
||||
m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this);
|
||||
m_contaminationState.insert(buildingId, requestContamination);
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG() << "Keine Änderung der Kontamination BuildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "Keine Änderung der Kontamination BuildingId=" << buildingId;
|
||||
}
|
||||
|
||||
QVector<int> HandlerContamination::getEffectedFloors(const int buildingId, const int chargeHeight, const int depression)
|
||||
{
|
||||
auto dtcIsm = m_ddsHandler->dtcIsm();
|
||||
DEBUG_LOG() << "Contaminated-Building=" << buildingId
|
||||
DEBUG_LOG(m_logger) << "Contaminated-Building=" << buildingId
|
||||
<< " chargeHeight=" << chargeHeight
|
||||
<< " depression=" << depression;
|
||||
|
||||
@@ -374,17 +374,17 @@ QVector<int> HandlerContamination::getEffectedFloors(const int buildingId, const
|
||||
for (int floorId : std::as_const(floorIds))
|
||||
{
|
||||
double halfFloorHeight = dtcIsm->getHalfFloorHeight(buildingId, floorId);
|
||||
DEBUG_LOG() << " floorId=" << floorId
|
||||
DEBUG_LOG(m_logger) << " floorId=" << floorId
|
||||
<< " halfFloorHeight=" << halfFloorHeight
|
||||
<< " chargeHeight=" << chargeHeight
|
||||
<< " depression=" << depression;
|
||||
if (depression < 0) // Kellerraeme beruecksichtigen
|
||||
{
|
||||
if (halfFloorHeight > depression)
|
||||
DEBUG_LOG() << "Checke Obergrenze";
|
||||
DEBUG_LOG(m_logger) << "Checke Obergrenze";
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "halfFloorHeight > depression floorId=" << floorId << " continue";
|
||||
DEBUG_LOG(m_logger) << "halfFloorHeight > depression floorId=" << floorId << " continue";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -392,7 +392,7 @@ QVector<int> HandlerContamination::getEffectedFloors(const int buildingId, const
|
||||
{
|
||||
if (halfFloorHeight < 0) // Kellerraeume nicht beruecksichtigen
|
||||
{
|
||||
DEBUG_LOG() << "depression ist nicht < 0"
|
||||
DEBUG_LOG(m_logger) << "depression ist nicht < 0"
|
||||
<< " Kelleretagen nicht beruecksichtigen floorId=" << floorId << " continue";
|
||||
continue;
|
||||
}
|
||||
@@ -407,9 +407,9 @@ QVector<int> HandlerContamination::getEffectedFloors(const int buildingId, const
|
||||
void HandlerContamination::onSetBuildingContaminationStateReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send ContaminationStates on building to building service: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send ContaminationStates on building to building service: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSetBuildingContaminationStateReply for id " << replyObject.id() << " success\n"
|
||||
DEBUG_LOG(m_logger) << "onSetBuildingContaminationStateReply for id " << replyObject.id() << " success\n"
|
||||
<< " replyObject.str() = " << replyObject.str();
|
||||
}
|
||||
|
||||
@@ -429,27 +429,27 @@ bool HandlerContamination::isInsideInnerCircle(int buildingId, int aesId)
|
||||
InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId);
|
||||
AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
|
||||
DEBUG_LOG() << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner()
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner()
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter()
|
||||
<< " impactRadius=" << nContamination.impactRadius();
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone);
|
||||
DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < nContamination.impactRadius() * nContamination.impactRadius())
|
||||
{
|
||||
DEBUG_LOG() << "isInsideInnerCircle return true";
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return true";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "isInsideInnerCircle return false";
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return false";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -462,25 +462,25 @@ bool HandlerContamination::isInsideBCContamination(int buildingId, int aesId)
|
||||
//AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
AreaEffectSimulation::BCContamination bcContamination = m_ddsHandler->dtcAes()->bCContamination(aesId);
|
||||
|
||||
DEBUG_LOG() << " impactRadius=" << bcContamination.impactRadius();
|
||||
DEBUG_LOG(m_logger) << " impactRadius=" << bcContamination.impactRadius();
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(bcContamination.impactPosition(), zone);
|
||||
DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < bcContamination.impactRadius() * bcContamination.impactRadius())
|
||||
{
|
||||
DEBUG_LOG() << "isInsideInnerCircle return true";
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return true";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "isInsideInnerCircle return false";
|
||||
DEBUG_LOG(m_logger) << "isInsideInnerCircle return false";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -492,27 +492,27 @@ bool HandlerContamination::isInsideRange1(int buildingId, int aesId)
|
||||
InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId);
|
||||
AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId);
|
||||
|
||||
DEBUG_LOG() << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner()
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner()
|
||||
<< " borderLengthOuter=" << nContamination.borderLengthOuter()
|
||||
<< " impactRadius=" << nContamination.impactRadius();
|
||||
|
||||
int zone = -1;
|
||||
const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone);
|
||||
DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " zone=" << zone;
|
||||
const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone);
|
||||
DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y();
|
||||
|
||||
double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm);
|
||||
|
||||
if (squareDistance < nContamination.borderLengthInner() * nContamination.borderLengthInner())
|
||||
{
|
||||
DEBUG_LOG() << "isInsideRange1 return true";
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 return true";
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "isInsideRange1 return false";
|
||||
DEBUG_LOG(m_logger) << "isInsideRange1 return false";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
+17
-17
@@ -53,13 +53,13 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesBuildingsInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesBuildingsInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
|
||||
// initialize handlerBuildingOwnership
|
||||
INFO_LOG() << "initialize handlerBuildingOwnership ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize handlerBuildingOwnership ----------------------------";
|
||||
m_handlerBuildingOwnership = std::make_shared<HandlerBuildingOwnership>(m_ddsHandler,
|
||||
m_handlerParticipant,
|
||||
m_handlerBuildingData,
|
||||
@@ -69,47 +69,47 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerBuildingOwnership->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerBuildingOwnership failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerBuildingOwnership failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "end initialize handlerBuildingOwnership ----------------------------";
|
||||
INFO_LOG(m_logger) << "end initialize handlerBuildingOwnership ----------------------------";
|
||||
|
||||
// initialize handlerAesData
|
||||
INFO_LOG() << "initialize handlerAesData ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize handlerAesData ----------------------------";
|
||||
m_handlerAesData = std::make_shared<HandlerAesData>(m_ddsHandler,
|
||||
m_handlerBuildingData,
|
||||
this);
|
||||
if (!m_handlerAesData->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerAesData failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerAesData failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "end initialize HandlerAesData ----------------------------";
|
||||
INFO_LOG(m_logger) << "end initialize HandlerAesData ----------------------------";
|
||||
|
||||
// initialize handlerAesData
|
||||
INFO_LOG() << "initialize handlerContaminations ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize handlerContaminations ----------------------------";
|
||||
m_handlerContaminations = std::make_shared<HandlerContamination>(m_ddsHandler,
|
||||
this);
|
||||
|
||||
if (!m_handlerContaminations->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerContaminations failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerContaminations failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "end initialize HandlerContaminations ----------------------------";
|
||||
INFO_LOG(m_logger) << "end initialize HandlerContaminations ----------------------------";
|
||||
|
||||
|
||||
// initialize handlerBuildingModel
|
||||
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 m_handlerBuildingModel failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerBuildingModel failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "end initialize handlerBuildingModel ----------------------------";
|
||||
INFO_LOG(m_logger) << "end initialize handlerBuildingModel ----------------------------";
|
||||
|
||||
|
||||
// Maybe not all MainStructureElements are processed yet.
|
||||
@@ -121,20 +121,20 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
std::shared_ptr<CentralEffectSimulation::ProxyBuilding> proxyBuilding = m_mainHandler->proxyBuilding();
|
||||
if (proxyBuilding)
|
||||
{
|
||||
INFO_LOG() << "set_handlerBuildingModel ----------------------------";
|
||||
INFO_LOG(m_logger) << "set_handlerBuildingModel ----------------------------";
|
||||
proxyBuilding->set_handlerBuildingModel(m_handlerBuildingModel);
|
||||
}
|
||||
});
|
||||
|
||||
INFO_LOG() << "CesBuildingsInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesBuildingsInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
QString CesBuildingsInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -64,6 +64,7 @@ private Q_SLOTS:
|
||||
bool init(int domainId, int exerciseId) override;
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr};
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
|
||||
+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;
|
||||
|
||||
+1
@@ -45,6 +45,7 @@ public:
|
||||
private Q_SLOTS:
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp;
|
||||
};
|
||||
|
||||
+141
-141
File diff suppressed because it is too large.
Load diff
+33
-33
@@ -65,7 +65,7 @@ bool HandlerVulcano::init()
|
||||
float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg();
|
||||
float vulcanoAlphaDeg = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg();
|
||||
|
||||
DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
|
||||
DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
|
||||
<< " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg
|
||||
<< " vulcanoAlphaDeg=" << vulcanoAlphaDeg;
|
||||
|
||||
@@ -77,9 +77,9 @@ bool HandlerVulcano::init()
|
||||
void HandlerVulcano::onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send TargetPositionsRequest: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send TargetPositionsRequest: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "TargetPositionsRequest for id " << replyObject.id() << " success\n"
|
||||
DEBUG_LOG(m_logger) << "TargetPositionsRequest for id " << replyObject.id() << " success\n"
|
||||
<< " replyObject.str() = " << replyObject.str();
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
|
||||
if (!data.effectStart().is_set())
|
||||
{
|
||||
DEBUG_LOG() << "No effectStart";
|
||||
DEBUG_LOG(m_logger) << "No effectStart";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,13 +113,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
const AreaEffectSimulation::FlightCurve &fcData = data.flightCurve().get();
|
||||
const AreaEffectSimulation::LaserGuiding &lgData = data.laserGuiding().get();
|
||||
|
||||
DEBUG_LOG() << "\n onExplosionClusterChanged id=" << data.id()
|
||||
DEBUG_LOG(m_logger) << "\n onExplosionClusterChanged id=" << data.id()
|
||||
<< " AesEffectState=" << data.effectStateId()
|
||||
<< " lcPrf=" << lgData.lcAttack()
|
||||
<< " originalEffectDuration=" << data.originalEffectDuration()
|
||||
<< " effectStart=" << data.effectStart();
|
||||
|
||||
DEBUG_LOG() << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")"
|
||||
DEBUG_LOG(m_logger) << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")"
|
||||
<< " tapTimepoint=" << lgData.tapTime()
|
||||
<< " currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " Timer interval =" << lgData.tapTime() - m_ddsHandler->currentPartitionTime();
|
||||
@@ -142,7 +142,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration();
|
||||
long long currentPartitionTime = m_ddsHandler->currentPartitionTime();
|
||||
const int timerTimeout = effectStart - calculatedFlightDurationMSec - currentPartitionTime;
|
||||
DEBUG_LOG() << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout;
|
||||
DEBUG_LOG(m_logger) << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout;
|
||||
if (timerTimeout >= 0)
|
||||
timer->start(timerTimeout);
|
||||
}
|
||||
@@ -151,13 +151,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo
|
||||
|
||||
void HandlerVulcano::onFiringTimeTimeout()
|
||||
{
|
||||
DEBUG_LOG() << "++++++++++++++ onFiringTimeTimeout";
|
||||
DEBUG_LOG(m_logger) << "++++++++++++++ onFiringTimeTimeout";
|
||||
QTimer *t = qobject_cast<QTimer *>(sender());
|
||||
int aesId = t->property("aesId").toInt();
|
||||
delete m_aesTimers.value(aesId);
|
||||
m_aesTimers.remove(aesId);
|
||||
|
||||
DEBUG_LOG() << "onTimerTimeout aesId=" << aesId;
|
||||
DEBUG_LOG(m_logger) << "onTimerTimeout aesId=" << aesId;
|
||||
const auto &myEC = m_explosionCluster.value(aesId);
|
||||
if (myEC.id() != aesId)
|
||||
return;
|
||||
@@ -168,7 +168,7 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
//auto dtcPpm = m_ddsHandler->dtcPpm();
|
||||
//auto participantId = dtcPpm.get()->getParticipantFromPrf(prf);
|
||||
//auto dpd = dtcPpm.get()->dynamicParticipantData(participantId);
|
||||
//DEBUG_LOG() << "onTimerTimeout participantId=" << participantId;
|
||||
//DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
|
||||
QTimer *timer = new QTimer(this);
|
||||
timer->setSingleShot(true);
|
||||
QObject::connect(timer, &QTimer::timeout,
|
||||
@@ -186,7 +186,7 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
|
||||
if (trajectoryTimeAware.geometry().size() < 2)
|
||||
{
|
||||
DEBUG_LOG() << "return";
|
||||
DEBUG_LOG(m_logger) << "return";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ void HandlerVulcano::onFiringTimeTimeout()
|
||||
int absTimeAtTap = myEC.effectStart().get() - timeDiffTapToExplosion;
|
||||
// Und die ist in wieviel Sekunden?
|
||||
int relTimeToTap = absTimeAtTap - m_ddsHandler->currentPartitionTime();
|
||||
DEBUG_LOG() << "timer->start timeout= " << relTimeToTap
|
||||
DEBUG_LOG(m_logger) << "timer->start timeout= " << relTimeToTap
|
||||
<< " calculatedFlightDurationMSec= " << calculatedFlightDurationMSec;
|
||||
if (relTimeToTap >= 0)
|
||||
timer->start(relTimeToTap);
|
||||
@@ -228,7 +228,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
|
||||
delete m_aesTimers.value(aesId);
|
||||
m_aesTimers.remove(aesId);
|
||||
DEBUG_LOG() << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId;
|
||||
DEBUG_LOG(m_logger) << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId;
|
||||
const auto &myEC = m_explosionCluster.value(aesId);
|
||||
if (myEC.id() != aesId)
|
||||
return;
|
||||
@@ -243,7 +243,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
auto participantId = dtcPpm->getParticipantFromPrf(prf);
|
||||
auto dpd = dtcPpm->dynamicParticipantData(participantId);
|
||||
const auto &designationsVec = dpd.designations();
|
||||
DEBUG_LOG() << "onTimerTimeout participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId;
|
||||
|
||||
for (const auto &designation : std::as_const(designationsVec))
|
||||
{
|
||||
@@ -252,15 +252,15 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId);
|
||||
const std::vector<Core::GeoPositionRelativeTime> &trajGeometry = trajectoryTimeAware.geometry();
|
||||
|
||||
DEBUG_LOG() << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size();
|
||||
DEBUG_LOG() << "Designation code=" << designation.code()
|
||||
DEBUG_LOG(m_logger) << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size();
|
||||
DEBUG_LOG(m_logger) << "Designation code=" << designation.code()
|
||||
<< " prf=" << prf
|
||||
<< " outputPower=" << designation.outputPower()
|
||||
<< " designation.spotlocation=" << designation.spotLocation().lon() << "/" << designation.spotLocation().lat();
|
||||
|
||||
if (trajGeometry.size() < 2)
|
||||
{
|
||||
DEBUG_LOG() << "return";
|
||||
DEBUG_LOG(m_logger) << "return";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -274,23 +274,23 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
const QPointF &pointToTestPt = CentralEffectSimulation::geographic2Utm(pointToTestGeo, &zone);
|
||||
|
||||
const QVector3D top(topPt.x(), topPt.y(), topGeo.z());
|
||||
DEBUG_LOG() << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone;
|
||||
DEBUG_LOG(m_logger) << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone;
|
||||
|
||||
const QVector3D bottom(bottomPt.x(), bottomPt.y(), bottomGeo.z());
|
||||
DEBUG_LOG() << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone;
|
||||
DEBUG_LOG(m_logger) << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone;
|
||||
|
||||
const QVector3D pointToTest(pointToTestPt.x(), pointToTestPt.y(), designation.spotLocation().z());
|
||||
DEBUG_LOG() << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone;
|
||||
DEBUG_LOG(m_logger) << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone;
|
||||
|
||||
float vulcanoViewAngleDeg = CesExplosions::Settings::vulcanoViewAngleDeg();
|
||||
float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg();
|
||||
|
||||
DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
|
||||
DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg
|
||||
<< " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg;
|
||||
|
||||
if (! isInCone(top, bottom, vulcanoAttackAngleDeg, pointToTest))
|
||||
{
|
||||
DEBUG_LOG() << "Punkt ist ausserhalb des Attack Angles. ";
|
||||
DEBUG_LOG(m_logger) << "Punkt ist ausserhalb des Attack Angles. ";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -304,14 +304,14 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
|
||||
double angle = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg();
|
||||
|
||||
DEBUG_LOG() << "isInAngle fe=" << fe.x() << "/" << fe.y()
|
||||
DEBUG_LOG(m_logger) << "isInAngle fe=" << fe.x() << "/" << fe.y()
|
||||
<< ", lp=" << lp.x() << "/" << lp.y()
|
||||
<< ", observer=" << observer.x() << "/" << observer.y()
|
||||
<< ", angle=" << angle
|
||||
<< ", zone=" << zone;
|
||||
if (! isInCone(lp, fe, angle, observer))
|
||||
{
|
||||
DEBUG_LOG() << "Keine neue Vulcano-Pos: Winkel ist zu gross. ";
|
||||
DEBUG_LOG(m_logger) << "Keine neue Vulcano-Pos: Winkel ist zu gross. ";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -322,7 +322,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout()
|
||||
AreaEffectSimulation::TargetPositionsModifyRequest posModify;
|
||||
posModify.aesItemId(aesId);
|
||||
posModify.positions().push_back(designation.spotLocation());
|
||||
DEBUG_LOG() << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z()
|
||||
DEBUG_LOG(m_logger) << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z()
|
||||
<< " designation.z=" << designation.spotLocation().z()
|
||||
<< " PosVulcano=" << posVulcano.lon() << "/" << posVulcano.lat();
|
||||
m_ddsHandler->ftcAes()->targetPositionsModifyRequest(posModify, this);
|
||||
@@ -339,7 +339,7 @@ AreaEffectSimulation::TrajectoryTimeAware HandlerVulcano::firstTrajectoryTimeAwa
|
||||
ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation);
|
||||
if (trajectories.empty())
|
||||
{
|
||||
DEBUG_LOG() << "no trajectories found for originatorId/aesItemId " << aesId;
|
||||
DEBUG_LOG(m_logger) << "no trajectories found for originatorId/aesItemId " << aesId;
|
||||
return {};
|
||||
}
|
||||
Q_ASSERT_X(trajectories.size() == 1, __FUNCTION__, "For Vulcano there should be just one trajectory");
|
||||
@@ -356,14 +356,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
const qint64 relTime = timeParam - trajectoryTimeAwareValue.trajectoryStartTime();
|
||||
|
||||
//trajectoryTimeAwareValue = trajectoryTimeAware(aesId);
|
||||
DEBUG_LOG() << " getTrajectoryPosFromTime aesId=" << aesId
|
||||
DEBUG_LOG(m_logger) << " getTrajectoryPosFromTime aesId=" << aesId
|
||||
<< " trajectoryTimeAwareValue.id=" << trajectoryTimeAwareValue.id()
|
||||
<< " time=" << timeParam
|
||||
<< " trajectoryStartTime=" << trajectoryTimeAwareValue.trajectoryStartTime()
|
||||
<< " relTime=" << relTime;
|
||||
if (trajectoryTimeAwareValue.geometry().empty())
|
||||
{
|
||||
DEBUG_LOG() << "getTrajectoryPosFromTime no pos available";
|
||||
DEBUG_LOG(m_logger) << "getTrajectoryPosFromTime no pos available";
|
||||
return {};
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
int i = 0;
|
||||
for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry()))
|
||||
{
|
||||
DEBUG_LOG() << "time=" << point.relativeTime();
|
||||
DEBUG_LOG(m_logger) << "time=" << point.relativeTime();
|
||||
if ( (point.relativeTime() > relTime) && (i > 0))
|
||||
{
|
||||
// Beachte: Geschwindigkeit wird _NICHT_ beruecksichtigt
|
||||
@@ -382,14 +382,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long
|
||||
// result.z() = trajectoryTimeAwareValue.geometry()[i -1].z();
|
||||
// and take benefits from downcasting
|
||||
result = geoPosRelTime; // implicit downcast :-)
|
||||
DEBUG_LOG() << "found i=" << i
|
||||
DEBUG_LOG(m_logger) << "found i=" << i
|
||||
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
|
||||
return result;
|
||||
}
|
||||
++i;
|
||||
} // for
|
||||
result = trajectoryTimeAwareValue.geometry().back();
|
||||
DEBUG_LOG() << " return last point result="
|
||||
DEBUG_LOG(m_logger) << " return last point result="
|
||||
<< " result=" << result.lat() << "/" << result.lon() << "/" << result.z();
|
||||
return result;
|
||||
|
||||
@@ -400,14 +400,14 @@ void HandlerVulcano::onDynamicParticipantChanged(const ParticipantManagement::Dy
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "onDynamicParticipantChanged"
|
||||
DEBUG_LOG(m_logger) << "onDynamicParticipantChanged"
|
||||
<< data.participantId()
|
||||
<< data.designations().size();
|
||||
if (data.designations().size() > 0)
|
||||
{
|
||||
for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations()))
|
||||
{
|
||||
DEBUG_LOG() << "gearId=" << designation.gearId()
|
||||
DEBUG_LOG(m_logger) << "gearId=" << designation.gearId()
|
||||
<< " code=" << designation.code()
|
||||
<< " z=" << designation.spotLocation().z()
|
||||
<< " outputPower=" << designation.outputPower();
|
||||
|
||||
+9
-9
@@ -36,7 +36,7 @@ CesExplosionInterfaceImpl::CesExplosionInterfaceImpl(CentralEffectSimulation::Pl
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.Explosions.HandlerExplosions"))
|
||||
{
|
||||
Q_UNUSED(settings)
|
||||
DEBUG_LOG() << "CesExplosionInterfaceImpl";
|
||||
DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl";
|
||||
}
|
||||
|
||||
CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl()
|
||||
@@ -48,11 +48,11 @@ CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl()
|
||||
|
||||
bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << "CesExplosionInterfaceImpl init";
|
||||
DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl init";
|
||||
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesExplosionsInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -66,22 +66,22 @@ bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerExplosions->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerExplosions failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerExplosions failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true";
|
||||
|
||||
// initialize handlerVulcano
|
||||
m_handlerVulcano = std::make_shared<HandlerVulcano>(m_ddsHandler, this);
|
||||
|
||||
if (!m_handlerVulcano->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerVulcano failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerVulcano failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -90,8 +90,8 @@ QString CesExplosionInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesExplosionsInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesExplosionsInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+71
-71
@@ -111,28 +111,28 @@ bool HandlerFunctionalAreas::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantArea::init() finished.";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerFunctionalAreas::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 Area to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send enter/leave Area 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);
|
||||
}
|
||||
}
|
||||
@@ -140,21 +140,21 @@ void HandlerFunctionalAreas::onSendCesHitReply(const Core::FunctionReplyObject &
|
||||
|
||||
void HandlerFunctionalAreas::onDemandInitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onDemandInitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
DEBUG_LOG(m_logger) << "onDemandInitReply for id " << replyObject.id() << " success= " << replyObject.error();
|
||||
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send Init to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send Init to participant in training area: " << replyObject();
|
||||
|
||||
// Send next Request, if available
|
||||
if (!m_sendInitRequestQueue.isEmpty())
|
||||
{
|
||||
DEBUG_LOG() << "m_sendInitRequestQueue.size()=" << m_sendInitRequestQueue.size();
|
||||
DEBUG_LOG(m_logger) << "m_sendInitRequestQueue.size()=" << m_sendInitRequestQueue.size();
|
||||
m_sendInitRequestQueue.dequeue();
|
||||
// Send next Message
|
||||
if (!m_sendInitRequestQueue.isEmpty())
|
||||
{
|
||||
const auto &hr = m_sendInitRequestQueue.head();
|
||||
DEBUG_LOG() << "demandInitRequest: " << hr;
|
||||
DEBUG_LOG(m_logger) << "demandInitRequest: " << hr;
|
||||
m_ddsHandler->ftcTab()->demandInitRequest(hr, this);
|
||||
}
|
||||
}
|
||||
@@ -174,7 +174,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
|
||||
if (!fa.isCentral())
|
||||
{
|
||||
DEBUG_LOG() << " !isCentral"
|
||||
DEBUG_LOG(m_logger) << " !isCentral"
|
||||
" Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
@@ -185,7 +185,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Got AesItemView id: " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", modType: " << modType;
|
||||
@@ -200,7 +200,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
bool isSupplyTruck = false;
|
||||
if (fa.supplyMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
|
||||
{
|
||||
DEBUG_LOG() << "isSupplyTruck = true";
|
||||
DEBUG_LOG(m_logger) << "isSupplyTruck = true";
|
||||
isSupplyTruck = true;
|
||||
}
|
||||
auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], 0, isSupplyTruck));
|
||||
@@ -219,16 +219,16 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
polygon.append(point);
|
||||
}
|
||||
enclosedBuildings = m_handlerBuildingData->polygonEncloseBuildings(polygon);
|
||||
DEBUG_LOG() << "enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
DEBUG_LOG(m_logger) << "enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
// local memory for the results, so that the polygonEncloseBuildings method is only run once for each effective field
|
||||
// and not for each position report
|
||||
m_aesPolygonEncloseBuilding.insert(data.aesItemId(), enclosedBuildings);
|
||||
DEBUG_LOG() << "insert enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
DEBUG_LOG(m_logger) << "insert enclosedBuildings.size=" << enclosedBuildings.size();
|
||||
}
|
||||
|
||||
calculateFunctionalArea(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
DEBUG_LOG() << "insert Functiona Area AesItemView id: " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "insert Functiona Area AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId();
|
||||
break;
|
||||
} // case EsActivated
|
||||
@@ -248,14 +248,14 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae
|
||||
void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulation::AesItemViewUtm &itemView)
|
||||
{
|
||||
bool inForm = false;
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateFunctionalArea aesItemId =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateFunctionalArea aesItemId =" << itemView.aesItemId;
|
||||
const auto participantsMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap)
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "participant id= " << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "participant id= " << participantPos.participantId()
|
||||
<< " buildingId=" << participantPos.buildingId();
|
||||
|
||||
if ( participantPos.buildingId() ==0 )
|
||||
@@ -269,14 +269,14 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati
|
||||
{
|
||||
inForm = true;
|
||||
m_handlerParticipant->setNotfightMode(participantPos.participantId(), true);
|
||||
DEBUG_LOG() << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
<< " aesId=" << itemView.aesItemId
|
||||
<< " in Form = true";
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId()
|
||||
<< " aesId=" << itemView.aesItemId
|
||||
<< " in Form = false";
|
||||
}
|
||||
@@ -290,7 +290,7 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati
|
||||
|
||||
void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
DEBUG_LOG() << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId();
|
||||
|
||||
if (m_handlerParticipant->isOutdated(participantData))
|
||||
return;
|
||||
@@ -298,14 +298,14 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "equipmentNumber <=0";
|
||||
DEBUG_LOG(m_logger) << "equipmentNumber <=0";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.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::AtFunctionalArea:
|
||||
@@ -315,7 +315,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
/// Die Teilnehmer der Partei des Wirkfeldes werden nicht berücksichtig.
|
||||
///
|
||||
AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG() << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
<< " itemView.partyId=" << itemView.partyId
|
||||
<< " participantData.partyId=" << participantData.partyId()
|
||||
<< " insideBuilding=" << participantData.insideBuilding();
|
||||
@@ -333,7 +333,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat
|
||||
|
||||
void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
DEBUG_LOG() << "New Indoor Position paticipantId=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "New Indoor Position paticipantId=" << participantData.participantId();
|
||||
|
||||
if (m_handlerParticipant->isOutdated(participantData))
|
||||
return;
|
||||
@@ -341,14 +341,14 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "equipmentNumber <=0";
|
||||
DEBUG_LOG(m_logger) << "equipmentNumber <=0";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.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::AtFunctionalArea:
|
||||
@@ -358,7 +358,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
/// Die Teilnehmer der Partei des Wirkfeldes werden nicht berücksichtig.
|
||||
///
|
||||
AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG() << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId()
|
||||
<< " itemView.partyId=" << itemView.partyId
|
||||
<< " participantData.partyId=" << participantData.partyId()
|
||||
<< " insideBuilding=" << participantData.insideBuilding();
|
||||
@@ -366,7 +366,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
if ( (itemView.partyId == participantData.partyId())
|
||||
&& (functionalArea.functionalAreaTypeId() == 8)) // Funktionsraum Nicht Kampffaehig [GUEZE-2256]
|
||||
{
|
||||
DEBUG_LOG() << "Position mit Funktionsraum Nicht Kampffähig hat die Partei des Wirkfeldes => nicht beruecksichtigen";
|
||||
DEBUG_LOG(m_logger) << "Position mit Funktionsraum Nicht Kampffähig hat die Partei des Wirkfeldes => nicht beruecksichtigen";
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -396,7 +396,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS
|
||||
|
||||
void HandlerFunctionalAreas::onRestoreRadioReadinessChanged(const int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerArtillery::onRestoreRadioReadinessChanged participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "HandlerArtillery::onRestoreRadioReadinessChanged participantId=" << participantId;
|
||||
m_supplyTimers.remove(participantId);
|
||||
removeParticipant(participantId);
|
||||
}
|
||||
@@ -417,11 +417,11 @@ bool HandlerFunctionalAreas::inBoundingBoxCheck(const CentralEffectSimulation::A
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
<< " inside AesItemView:" << itemView.aesItemId;
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
<< " outside AesItemView:" << itemView.aesItemId;
|
||||
return false;
|
||||
}
|
||||
@@ -437,7 +437,7 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
itemView.boundingBoxTopRight);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos(), itemView.zone);
|
||||
DEBUG_LOG() << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size()
|
||||
@@ -446,7 +446,7 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV
|
||||
if (boundingBox.contains(participantPosUtmPoint) &&
|
||||
itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "inside AES form, paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantData.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId;
|
||||
return true;
|
||||
} // if inside
|
||||
@@ -456,10 +456,10 @@ bool HandlerFunctionalAreas::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;
|
||||
@@ -478,12 +478,12 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
switch (eventType.underlying())
|
||||
{
|
||||
case ProjectDataManagement::EventType_def::EnterFunctionalArea:
|
||||
DEBUG_LOG() << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId;
|
||||
remaining = 1;
|
||||
break;
|
||||
case ProjectDataManagement::EventType_def::LeaveFunctionalArea:
|
||||
remaining = 0;
|
||||
DEBUG_LOG() << "-------------- LeaveFunctionalArea itemView =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "-------------- LeaveFunctionalArea itemView =" << itemView.aesItemId;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -492,26 +492,26 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
if (remaining < 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeStruct)
|
||||
<< " participantId=" << participantData.participantId();
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0";
|
||||
return;
|
||||
}
|
||||
if (participantData.participantId() != 0 &&
|
||||
participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -550,14 +550,14 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae
|
||||
itemView.partyId, // originPartyId
|
||||
mineId
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.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);
|
||||
}
|
||||
}
|
||||
@@ -576,7 +576,7 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "Participant with id " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
|
||||
<< " has invalid typeClass: " << typeClass
|
||||
<< " eventType: " << eventType;
|
||||
return;
|
||||
@@ -585,12 +585,12 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
<< " - participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent" << eventType
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " AesItemId=" << itemView.aesItemId;
|
||||
|
||||
@@ -610,7 +610,7 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
pe.position(participantData.pos());
|
||||
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);
|
||||
@@ -622,17 +622,17 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation:
|
||||
|
||||
void HandlerFunctionalAreas::aesItemViewRemoved(int aesItemId)
|
||||
{
|
||||
DEBUG_LOG() << "aesItemViewRemoved aesItemId=" << aesItemId
|
||||
DEBUG_LOG(m_logger) << "aesItemViewRemoved aesItemId=" << aesItemId
|
||||
<< " m_cesEnterLeaveFunctionalArea.size=" << m_cesEnterLeaveFunctionalArea.size()
|
||||
<< " m_aesItemViews.size=" << m_aesItemViews.size();
|
||||
QHashIterator<QPair<int, int>, EnterLeaveType> i(m_cesEnterLeaveFunctionalArea);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
DEBUG_LOG() << "Key: itemId=" << i.key().first << " participantId=" << i.key().second
|
||||
DEBUG_LOG(m_logger) << "Key: itemId=" << i.key().first << " participantId=" << i.key().second
|
||||
<< " EnterLeaveType=" << i.value().eventType;
|
||||
if (i.key().first == aesItemId )
|
||||
{
|
||||
DEBUG_LOG() << " EnterLeaveType=" << i.value().eventType;
|
||||
DEBUG_LOG(m_logger) << " EnterLeaveType=" << i.value().eventType;
|
||||
CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(i.key().first);
|
||||
sendEnterLeave(itemView, i.key().second, false);
|
||||
m_cesEnterLeaveFunctionalArea.remove(i.key());
|
||||
@@ -644,16 +644,16 @@ void HandlerFunctionalAreas::aesItemViewRemoved(int aesItemId)
|
||||
|
||||
void HandlerFunctionalAreas::removeParticipant(int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "removeParticipant participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "removeParticipant participantId=" << participantId
|
||||
<< " m_cesEnterLeaveFunctionalArea.size=" << m_cesEnterLeaveFunctionalArea.size();
|
||||
QHashIterator<QPair<int, int>, EnterLeaveType> i(m_cesEnterLeaveFunctionalArea);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
DEBUG_LOG() << "Key: itemId=" << i.key().first << " participantId=" << i.key().second
|
||||
DEBUG_LOG(m_logger) << "Key: itemId=" << i.key().first << " participantId=" << i.key().second
|
||||
<< " EnterLeaveType=" << i.value().eventType;
|
||||
if (i.key().second == participantId )
|
||||
{
|
||||
DEBUG_LOG() << " EnterLeaveType=" << i.value().eventType;
|
||||
DEBUG_LOG(m_logger) << " EnterLeaveType=" << i.value().eventType;
|
||||
CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(i.key().first);
|
||||
//sendEnterLeave(itemView, i.key().second, false);
|
||||
m_cesEnterLeaveFunctionalArea.remove(i.key());
|
||||
@@ -670,7 +670,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
if (m_cesEnterLeaveFunctionalArea.contains(key))
|
||||
lastEnterLeaveType = m_cesEnterLeaveFunctionalArea.value(key);
|
||||
|
||||
DEBUG_LOG() << "HandlerFunctionalAreas::sendEnterLeave "
|
||||
DEBUG_LOG(m_logger) << "HandlerFunctionalAreas::sendEnterLeave "
|
||||
<< " aesItemId=" << itemView.aesItemId
|
||||
<< " participantId=" << participantId
|
||||
<< " inForm=" << inForm;
|
||||
@@ -684,7 +684,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
if (!lastEnterLeaveType.isAlreadySupplied)
|
||||
{
|
||||
DEBUG_LOG() << "sendEnterLeave.startSupplyTimer"
|
||||
DEBUG_LOG(m_logger) << "sendEnterLeave.startSupplyTimer"
|
||||
" m_cesEnterLeaveFunctionalArea.insert"
|
||||
<< " aesItemId=" << key.first
|
||||
<< " participantId=" << key.second
|
||||
@@ -699,10 +699,10 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
enterLeaveType.eventType = ProjectDataManagement::EventType_def::LeaveFunctionalArea;
|
||||
if (itemView.isSupplyTruck && lastEnterLeaveType.eventType == ProjectDataManagement::EventType_def::EnterFunctionalArea)
|
||||
{
|
||||
DEBUG_LOG() << "sendEnterLeave.stopSupplyTimer";
|
||||
DEBUG_LOG(m_logger) << "sendEnterLeave.stopSupplyTimer";
|
||||
enterLeaveType.isAlreadySupplied = false;
|
||||
stopSupplyTimer(participantId);
|
||||
DEBUG_LOG() << "sendEnterLeave.startSupplyTimer"
|
||||
DEBUG_LOG(m_logger) << "sendEnterLeave.startSupplyTimer"
|
||||
" m_cesEnterLeaveFunctionalArea.insert"
|
||||
<< " aesItemId=" << key.first
|
||||
<< " participantId=" << key.second
|
||||
@@ -718,16 +718,16 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
sendParticipantEvent(itemView, cesParticipantData, enterLeaveType.eventType);
|
||||
|
||||
const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId);
|
||||
DEBUG_LOG() << "fa.isCentral()=" << fa.isCentral()
|
||||
DEBUG_LOG(m_logger) << "fa.isCentral()=" << fa.isCentral()
|
||||
<< " isSupplyTruck=" << itemView.isSupplyTruck
|
||||
<< " eventType=" << m_cesEnterLeaveFunctionalArea.value(key).eventType
|
||||
<< " isAlreadySupplied=" << enterLeaveType.isAlreadySupplied;
|
||||
if (fa.isCentral() && !itemView.isSupplyTruck)
|
||||
{
|
||||
DEBUG_LOG() << "sendCesHitRequest";
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest";
|
||||
sendCesHitRequest(itemView, cesParticipantData, enterLeaveType.eventType);
|
||||
}
|
||||
DEBUG_LOG() << " m_cesEnterLeaveFunctionalArea.insert"
|
||||
DEBUG_LOG(m_logger) << " m_cesEnterLeaveFunctionalArea.insert"
|
||||
<< " aesItemId=" << key.first
|
||||
<< " participantId=" << key.second
|
||||
<< " enterLeaveType=" << enterLeaveType.eventType;
|
||||
@@ -738,21 +738,21 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt
|
||||
|
||||
void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long time)
|
||||
{
|
||||
DEBUG_LOG() << "startSupplyTimer="
|
||||
DEBUG_LOG(m_logger) << "startSupplyTimer="
|
||||
<< " participantId=" << participantId
|
||||
<< " aesId=" << aesId
|
||||
<< " time=" << time
|
||||
<< " ST participant" << m_aesItemViews[aesId].participantId;
|
||||
if (participantId == m_aesItemViews[aesId].participantId)
|
||||
{
|
||||
DEBUG_LOG() << "No supply for SupplyTruck";
|
||||
DEBUG_LOG(m_logger) << "No supply for SupplyTruck";
|
||||
return;
|
||||
}
|
||||
if (m_supplyTimers.contains(participantId))
|
||||
{
|
||||
if (m_supplyTimers[participantId]->isActive())
|
||||
{
|
||||
DEBUG_LOG() << "SupplyTimer isActive";
|
||||
DEBUG_LOG(m_logger) << "SupplyTimer isActive";
|
||||
return;
|
||||
}
|
||||
else
|
||||
@@ -760,7 +760,7 @@ void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long
|
||||
}
|
||||
SupplyTimer *supplyTimer = new SupplyTimer(participantId,
|
||||
aesId, time);
|
||||
DEBUG_LOG() << "supplyTimer->startTimer();";
|
||||
DEBUG_LOG(m_logger) << "supplyTimer->startTimer();";
|
||||
QObject::connect(supplyTimer, &SupplyTimer::timeToEffectTimeout,
|
||||
this, &HandlerFunctionalAreas::on_supplyFinished);
|
||||
m_supplyTimers.insert(participantId, supplyTimer);
|
||||
@@ -769,7 +769,7 @@ void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long
|
||||
|
||||
void HandlerFunctionalAreas::stopSupplyTimer(int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "stopSupplyTimer="
|
||||
DEBUG_LOG(m_logger) << "stopSupplyTimer="
|
||||
<< "participantId=" << participantId;
|
||||
if (m_supplyTimers.contains(participantId))
|
||||
{
|
||||
@@ -781,7 +781,7 @@ void HandlerFunctionalAreas::stopSupplyTimer(int participantId)
|
||||
|
||||
void HandlerFunctionalAreas::on_supplyFinished(int participantId, int aesId)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerFunctionalAreas::on_supplyFinished participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "HandlerFunctionalAreas::on_supplyFinished participantId=" << participantId
|
||||
<< " aesId =" << aesId;
|
||||
|
||||
sendInitSupplyToTab(participantId,
|
||||
@@ -802,7 +802,7 @@ void HandlerFunctionalAreas::sendInitSupplyToTab(int participantId, int aesId)
|
||||
bool resetVulnerabilityState = false;
|
||||
bool restockSanitationMaterial = false;
|
||||
|
||||
DEBUG_LOG() << "sendInitSupplyToTab"
|
||||
DEBUG_LOG(m_logger) << "sendInitSupplyToTab"
|
||||
<< " participantId=" << participantId
|
||||
<< " aesId=" << aesId;
|
||||
TrainingAreaBase::DemandInitRequest demandInitRequest(
|
||||
@@ -818,7 +818,7 @@ void HandlerFunctionalAreas::sendInitSupplyToTab(int participantId, int aesId)
|
||||
m_sendInitRequestQueue.enqueue(demandInitRequest);
|
||||
if (m_sendInitRequestQueue.size() == 1)
|
||||
{
|
||||
DEBUG_LOG() << "sendInitSupply: " << demandInitRequest;
|
||||
DEBUG_LOG(m_logger) << "sendInitSupply: " << demandInitRequest;
|
||||
m_ddsHandler->ftcTab()->demandInitRequest(demandInitRequest, this);
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -78,6 +78,8 @@ public:
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
void onDemandInitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
|
||||
+5
-5
@@ -48,7 +48,7 @@ bool CES_FUNCTIONAL_AREAInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,11 +62,11 @@ bool CES_FUNCTIONAL_AREAInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerFunctionalAreas->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ QString CES_FUNCTIONAL_AREAInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_FUNCTIONAL_AREAInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+31
-31
@@ -73,7 +73,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:
|
||||
@@ -98,7 +98,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();
|
||||
} // end removeStates
|
||||
|
||||
void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType)
|
||||
@@ -113,7 +113,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;
|
||||
}
|
||||
@@ -121,17 +121,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;
|
||||
@@ -154,7 +154,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()
|
||||
@@ -170,9 +170,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
|
||||
}
|
||||
@@ -180,7 +180,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());
|
||||
@@ -195,7 +195,7 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
|
||||
modType != DataModification::eModified)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Got TriggeredImpacts";
|
||||
DEBUG_LOG(m_logger) << "Got TriggeredImpacts";
|
||||
preCalculateImpacts(data);
|
||||
}
|
||||
|
||||
@@ -208,7 +208,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:
|
||||
@@ -223,8 +223,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)
|
||||
@@ -272,9 +272,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
|
||||
@@ -293,14 +293,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
|
||||
@@ -316,18 +316,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
|
||||
@@ -339,14 +339,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):
|
||||
@@ -355,14 +355,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)
|
||||
@@ -376,7 +376,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));
|
||||
|
||||
@@ -385,14 +385,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
@@ -50,6 +50,7 @@ public:
|
||||
AreaEffectSimulation::AesItemView itemView(const int &aesId) const { return m_aesItemViews.value(aesId); }
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) override final;
|
||||
|
||||
private slots:
|
||||
|
||||
+23
-23
@@ -41,7 +41,7 @@ HandlerParticipantGasPipe::~HandlerParticipantGasPipe()
|
||||
|
||||
bool HandlerParticipantGasPipe::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantGasPipe::init";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantGasPipe::init";
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
dtcAes->waitForHistoricalDataGasPipe(2000);
|
||||
|
||||
@@ -68,7 +68,7 @@ bool HandlerParticipantGasPipe::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantGasPipe::init() finished. ";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantGasPipe::init() finished. ";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -78,14 +78,14 @@ bool HandlerParticipantGasPipe::init()
|
||||
// ///////////////////////////////////
|
||||
void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantGasPipe::onAesItemViewChanged";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantGasPipe::onAesItemViewChanged";
|
||||
//
|
||||
if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtGasPipe)
|
||||
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;
|
||||
@@ -110,14 +110,14 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
|
||||
|
||||
const CentralEffectSimulation::AesItemViewUtm gasPipeUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius);
|
||||
m_gasPipes.insert(data.aesItemId(), gasPipeUtm);
|
||||
DEBUG_LOG() << "Check each participant";
|
||||
DEBUG_LOG(m_logger) << "Check each participant";
|
||||
// Check each participant
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const auto &participantPos : partPosMap)
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
{
|
||||
DEBUG_LOG() << "isOutdated participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId();
|
||||
continue;
|
||||
}
|
||||
const CentralEffectSimulation::AesItemViewUtm gasPipe = m_gasPipes.value(data.aesItemId());
|
||||
@@ -127,7 +127,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
|
||||
}
|
||||
default:
|
||||
{
|
||||
DEBUG_LOG() << "remove GasPipe";
|
||||
DEBUG_LOG(m_logger) << "remove GasPipe";
|
||||
m_gasPipes.remove(aesItemId);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +140,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation:
|
||||
|
||||
void HandlerParticipantGasPipe::onGasPipeChanged(const AreaEffectSimulation::GasPipe &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantGasPipe::onGasPipeChanged id=" << data.id();
|
||||
INFO_LOG(m_logger) << "HandlerParticipantGasPipe::onGasPipeChanged id=" << data.id();
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
return;
|
||||
@@ -149,7 +149,7 @@ void HandlerParticipantGasPipe::onGasPipeChanged(const AreaEffectSimulation::Gas
|
||||
|
||||
bool HandlerParticipantGasPipe::insideGasPipeArea(const QPolygonF &polygonf, const QPointF &participantPos) const
|
||||
{
|
||||
DEBUG_LOG() << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
DEBUG_LOG(m_logger) << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
return polygonf.containsPoint(participantPos, Qt::OddEvenFill);
|
||||
}
|
||||
|
||||
@@ -159,10 +159,10 @@ void HandlerParticipantGasPipe::calculateGasPipeParticipant(const CentralEffectS
|
||||
//const AesItemViewUtm gasPipe = m_gasPipes.value(itemView.aesItemId());
|
||||
const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), gasPipe.zone);
|
||||
|
||||
DEBUG_LOG() << "calculateGasPipeParticipant itemView.id=" << gasPipe.aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateGasPipeParticipant itemView.id=" << gasPipe.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
|
||||
DEBUG_LOG() << "gasPipe id = " << gasPipe.aesItemId
|
||||
DEBUG_LOG(m_logger) << "gasPipe id = " << gasPipe.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(gasPipe.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(gasPipe.boundingBoxTopRight);
|
||||
|
||||
@@ -177,16 +177,16 @@ void HandlerParticipantGasPipe::calculateGasPipeParticipant(const CentralEffectS
|
||||
});
|
||||
if (!boundingBoxGasPipe.containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "not in boundingBox";
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox";
|
||||
return;
|
||||
}
|
||||
const bool result = insideGasPipeArea(gasPipe.form, partPosGeo);
|
||||
DEBUG_LOG() << "result gasPipe Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result gasPipe Explosion = " << result;
|
||||
if (result)
|
||||
{
|
||||
DEBUG_LOG() << "sendParticipantEvent";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent";
|
||||
sendParticipantEvent(gasPipe, participantPosition, ProjectDataManagement::EventType_def::HitGasPipe);
|
||||
DEBUG_LOG() << "sendParticipantHit";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit";
|
||||
sendParticipantHit(gasPipe, participantPosition, ProjectDataManagement::EventType_def::HitGasPipe);
|
||||
}
|
||||
}
|
||||
@@ -195,7 +195,7 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect
|
||||
{
|
||||
bool result = false;
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG() << "ParicipantPos "
|
||||
DEBUG_LOG(m_logger) << "ParicipantPos "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantPos: lat=" << partPos.pos().lat()
|
||||
@@ -209,14 +209,14 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect
|
||||
|
||||
const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(partPos.pos(), gasPipe.zone);
|
||||
|
||||
DEBUG_LOG() << "gasPipe id = " << gasPipe.aesItemId
|
||||
DEBUG_LOG(m_logger) << "gasPipe id = " << gasPipe.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(gasPipe.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(gasPipe.boundingBoxTopRight);
|
||||
|
||||
// if (!m_gasPipes.value(gasPipe.aesItemId).containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
// continue;
|
||||
result = insideGasPipeArea(gasPipe.form, partPosGeo);
|
||||
DEBUG_LOG() << "result gasPipe Explosion = " << result<< gasPipe.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "result gasPipe Explosion = " << result<< gasPipe.aesItemId;
|
||||
if (result)
|
||||
sendParticipantEvent(gasPipe, partPos, ProjectDataManagement::EventType_def::HitGasPipe);
|
||||
}
|
||||
@@ -249,7 +249,7 @@ void HandlerParticipantGasPipe::sendParticipantEvent(const CentralEffectSimulati
|
||||
const AreaEffectSimulation::GasPipe &gp = m_ddsHandler->dtcAes()->gasPipe(gasPipe.aesItemId);
|
||||
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
@@ -278,7 +278,7 @@ void HandlerParticipantGasPipe::sendParticipantHit(const CentralEffectSimulation
|
||||
const int participantId = participantPosition.participantId();
|
||||
const int originatorEquipNo = 0;
|
||||
|
||||
DEBUG_LOG() << "sendParticipantHit participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId
|
||||
<< " equipmentNumber=" << equipNo;
|
||||
|
||||
Core::GeoPosition position;
|
||||
@@ -310,9 +310,9 @@ void HandlerParticipantGasPipe::sendParticipantHit(const CentralEffectSimulation
|
||||
void HandlerParticipantGasPipe::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerParticipantGasPipe::sendFtcCesHitRequestTimeout()
|
||||
@@ -320,7 +320,7 @@ void HandlerParticipantGasPipe::sendFtcCesHitRequestTimeout()
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
}
|
||||
m_requestMap.clear();
|
||||
|
||||
+5
-5
@@ -49,7 +49,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesGasPipesInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,7 +62,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
// if (!m_handlerParticipantBoobyTrap->init())
|
||||
// {
|
||||
// ERROR_LOG() << "Initialisation m_handlerParticipantBoobyTrap failed.";
|
||||
// ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantBoobyTrap failed.";
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@@ -74,7 +74,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
// if (!m_handlerParticipantOffRouteMine->init())
|
||||
// {
|
||||
// ERROR_LOG() << "Initialisation m_handlerParticipantOffRouteMine failed.";
|
||||
// ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantOffRouteMine failed.";
|
||||
// return false;
|
||||
// }
|
||||
|
||||
@@ -85,8 +85,8 @@ QString CesGasPipesInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesGasPipesInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesGasPipesInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesGasPipesInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesGasPipesInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -54,11 +54,11 @@ bool BallisticService::init(const QString &a_configPath,
|
||||
m_configFile = a_configFile;
|
||||
m_ammunitionFile = a_ammunitionFile;
|
||||
|
||||
INFO_LOG() << "init";
|
||||
INFO_LOG(m_logger) << "init";
|
||||
|
||||
m_ammuConfig = N_ConfigSystem::AmmuConfig::getInstance();
|
||||
QString FileName = a_configPath + QLatin1Char('/') + a_ammunitionFile;
|
||||
INFO_LOG() << "FileName=" << FileName;
|
||||
INFO_LOG(m_logger) << "FileName=" << FileName;
|
||||
|
||||
m_ammuConfig->initFilename(FileName);
|
||||
|
||||
@@ -74,15 +74,15 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
ERROR_LOG() << "Class is not initialized" ;
|
||||
ERROR_LOG(m_logger) << "Class is not initialized" ;
|
||||
return false;
|
||||
}
|
||||
|
||||
Ammunition *configuredAmmunition;
|
||||
E_TypeOfImpl e_impl = e_ImplBase;
|
||||
|
||||
DEBUG_LOG() << "Target Interface Pointer : " << app_interface ;
|
||||
DEBUG_LOG() << "Searching in available ammunitions for " << a_ammuName ;
|
||||
DEBUG_LOG(m_logger) << "Target Interface Pointer : " << app_interface ;
|
||||
DEBUG_LOG(m_logger) << "Searching in available ammunitions for " << a_ammuName ;
|
||||
|
||||
//iterate over all Ammunition nodes and find the corresponding Ammunition name
|
||||
bool bAmmunitionFound = false;
|
||||
@@ -95,7 +95,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
//find ammunition
|
||||
configuredAmmunition = &ammunition;
|
||||
|
||||
DEBUG_LOG() << "Ammunition found: " << configuredAmmunition->m_AmmunInfo.m_Name ;
|
||||
DEBUG_LOG(m_logger) << "Ammunition found: " << configuredAmmunition->m_AmmunInfo.m_Name ;
|
||||
|
||||
if (configuredAmmunition->m_AmmunInfo.m_Name == a_ammuName)
|
||||
{
|
||||
@@ -118,7 +118,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
e_impl = e_ImplBase;
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Configured Algorithm not known :"
|
||||
ERROR_LOG(m_logger) << "Configured Algorithm not known :"
|
||||
<< configuredAmmunition->m_AmmunInfo.m_Algorithm;
|
||||
return false;
|
||||
}
|
||||
@@ -128,7 +128,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
|
||||
if (!bAmmunitionFound)
|
||||
{
|
||||
ERROR_LOG() << "Desired ammunition was not found :" << a_ammuName ;
|
||||
ERROR_LOG(m_logger) << "Desired ammunition was not found :" << a_ammuName ;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
p_firecontrol = new FireControlRungeKuttaSimple;
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << "Implementation does not exist: " << e_impl ;
|
||||
ERROR_LOG(m_logger) << "Implementation does not exist: " << e_impl ;
|
||||
*app_interface = nullptr;
|
||||
return false;
|
||||
}
|
||||
@@ -198,7 +198,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
p_trajectorybase = new TrajectoryRungeKuttaSimple;
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << "Implementation does not exist: " << e_impl ;
|
||||
ERROR_LOG(m_logger) << "Implementation does not exist: " << e_impl ;
|
||||
*app_interface = nullptr;
|
||||
return false;
|
||||
}
|
||||
@@ -208,7 +208,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ERROR_LOG() << "Interface does not exist: " << a_typeInterface ;
|
||||
ERROR_LOG(m_logger) << "Interface does not exist: " << a_typeInterface ;
|
||||
*app_interface = nullptr;
|
||||
return false;
|
||||
}
|
||||
|
||||
+15
-15
@@ -63,7 +63,7 @@ bool FireControlBase::init(const Ammunition &a_ammunition)
|
||||
|
||||
if (a_ammunition.m_StandardParams.m_Valid)
|
||||
{
|
||||
TRACE_LOG() << "FireControlBase::init : initialising StandardParams..." ;
|
||||
TRACE_LOG(m_logger) << "FireControlBase::init : initialising StandardParams..." ;
|
||||
|
||||
m_InitialAmmuVelocityV0constX1 = a_ammunition.m_StandardParams.m_Speed.m_V0ConstX1;
|
||||
m_InitialAmmuVelocityV0constX0 = a_ammunition.m_StandardParams.m_Speed.m_V0ConstX0;
|
||||
@@ -76,14 +76,14 @@ bool FireControlBase::init(const Ammunition &a_ammunition)
|
||||
|
||||
m_Initialized = true;
|
||||
|
||||
TRACE_LOG() << "m_InitialAmmuVelocityV0constX1 : " << m_InitialAmmuVelocityV0constX1 ;
|
||||
TRACE_LOG() << "m_InitialAmmuVelocityV0constX0 : " << m_InitialAmmuVelocityV0constX0 ;
|
||||
TRACE_LOG() << "m_CrossWindConstX3 : " << m_CrossWindConstX3 ;
|
||||
TRACE_LOG() << "m_CrossWindConstX2 : " << m_CrossWindConstX2 ;
|
||||
TRACE_LOG() << "m_CrossWindConstX1 : " << m_CrossWindConstX1 ;
|
||||
TRACE_LOG() << "m_CrossWindConstX0 : " << m_CrossWindConstX0 ;
|
||||
TRACE_LOG(m_logger) << "m_InitialAmmuVelocityV0constX1 : " << m_InitialAmmuVelocityV0constX1 ;
|
||||
TRACE_LOG(m_logger) << "m_InitialAmmuVelocityV0constX0 : " << m_InitialAmmuVelocityV0constX0 ;
|
||||
TRACE_LOG(m_logger) << "m_CrossWindConstX3 : " << m_CrossWindConstX3 ;
|
||||
TRACE_LOG(m_logger) << "m_CrossWindConstX2 : " << m_CrossWindConstX2 ;
|
||||
TRACE_LOG(m_logger) << "m_CrossWindConstX1 : " << m_CrossWindConstX1 ;
|
||||
TRACE_LOG(m_logger) << "m_CrossWindConstX0 : " << m_CrossWindConstX0 ;
|
||||
|
||||
TRACE_LOG() << "FireControlBase::init : initialized successfully!" ;
|
||||
TRACE_LOG(m_logger) << "FireControlBase::init : initialized successfully!" ;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -101,13 +101,13 @@ Float64 FireControlBase::getFlightTime(const Float64 a_distance,
|
||||
|
||||
if (!m_Initialized)
|
||||
{
|
||||
WARNING_LOG() << "The class is not initialized" ;
|
||||
WARNING_LOG(m_logger) << "The class is not initialized" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if (a_distance < 1.0 || a_initialAmmuVelocity < 1.0)
|
||||
{
|
||||
ERROR_LOG() << "The parameters are not correct" ;
|
||||
ERROR_LOG(m_logger) << "The parameters are not correct" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ Float64 FireControlBase::getFireAngle(const Float64 a_distance, const Float64 a_
|
||||
|
||||
if (!m_Initialized)
|
||||
{
|
||||
WARNING_LOG() << "The class is not initialized" ;
|
||||
WARNING_LOG(m_logger) << "The class is not initialized" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ Float64 FireControlBase::getFireAngle(const Float64 a_distance, const Float64 a_
|
||||
(a_terrainAngle > M_PI_2) ||
|
||||
(a_terrainAngle < -M_PI_2))
|
||||
{
|
||||
ERROR_LOG() << "The parameters are not correct" ;
|
||||
ERROR_LOG(m_logger) << "The parameters are not correct" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ N_Types::Radian64 FireControlBase::getCrossWindCorrection(const Float64 a_crossW
|
||||
|
||||
if (!m_Initialized)
|
||||
{
|
||||
ERROR_LOG() << "The class is not initialized" ;
|
||||
ERROR_LOG(m_logger) << "The class is not initialized" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ N_Types::Radian64 FireControlBase::getCrossWindCorrection(const Float64 a_crossW
|
||||
m_CrossWindConstX1 == 0 &&
|
||||
m_CrossWindConstX0 == 0)
|
||||
{
|
||||
WARNING_LOG() << "The class uses probably not initialized parameters" ;
|
||||
WARNING_LOG(m_logger) << "The class uses probably not initialized parameters" ;
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ Float64 FireControlBase::getAirDensity(const Float64 a_atmosphericPressure, cons
|
||||
if ((a_atmosphericPressure <= 1.0) ||
|
||||
(a_airTemperature <= -N_SST::ZERO_CELSIUS_IN_KELVIN))
|
||||
{
|
||||
ERROR_LOG() << "The parameters are not correct, Pressure=" << a_atmosphericPressure << ", Temp=" << a_airTemperature ;
|
||||
ERROR_LOG(m_logger) << "The parameters are not correct, Pressure=" << a_atmosphericPressure << ", Temp=" << a_airTemperature ;
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -70,16 +70,16 @@ bool TrajectoryBase::init(const N_Types::Coord3 &a_gunPos, const N_Types::Angle3
|
||||
|
||||
if (m_Deviation != 0)
|
||||
{
|
||||
INFO_LOG() << "Deviation taken into account: " << m_Deviation ;
|
||||
INFO_LOG(m_logger) << "Deviation taken into account: " << m_Deviation ;
|
||||
|
||||
Float64 l_deviationRandomized = m_Deviation * (Float64)(rand() % 100) / 100.0;
|
||||
INFO_LOG() << "l_deviationRandomized = " << l_deviationRandomized ;
|
||||
INFO_LOG(m_logger) << "l_deviationRandomized = " << l_deviationRandomized ;
|
||||
|
||||
N_Types::Coord3 o_dev(l_deviationRandomized, 1000.0, 0.0);
|
||||
//INFO_LOG() << "o_dev = " << o_dev ;
|
||||
//INFO_LOG(m_logger) << "o_dev = " << o_dev ;
|
||||
|
||||
Float64 l_angleRandomized = rand() % 360;
|
||||
INFO_LOG() << "l_angleRandomized = " << l_angleRandomized ;
|
||||
INFO_LOG(m_logger) << "l_angleRandomized = " << l_angleRandomized ;
|
||||
|
||||
N_Types::Radian64 l_angleRad;
|
||||
l_angleRad.setDegree(l_angleRandomized);
|
||||
@@ -90,7 +90,7 @@ bool TrajectoryBase::init(const N_Types::Coord3 &a_gunPos, const N_Types::Angle3
|
||||
o_angle.m_H = o_dev.getPolar3().getAzimuth();
|
||||
o_angle.m_P = o_dev.getPolar3().getElevation();
|
||||
|
||||
//INFO_LOG() << "o_angle = " << o_angle << END_LOG
|
||||
//INFO_LOG(m_logger) << "o_angle = " << o_angle << END_LOG
|
||||
m_GunAngle = m_GunAngle + o_angle;
|
||||
}
|
||||
|
||||
@@ -115,13 +115,13 @@ bool TrajectoryBase::move(const Float64 a_deltaTime)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
WARNING_LOG() << "The class is not initialized" ;
|
||||
WARNING_LOG(m_logger) << "The class is not initialized" ;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!m_Active)
|
||||
{
|
||||
ERROR_LOG() << "Call init(gunPos, gunAngle, ...) first" ;
|
||||
ERROR_LOG(m_logger) << "Call init(gunPos, gunAngle, ...) first" ;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ bool TrajectoryBase::init(const Ammunition &a_ammunition)
|
||||
{
|
||||
m_Initialized = false;
|
||||
|
||||
TRACE_LOG() << "TrajectoryBase::init : initialising..." ;
|
||||
TRACE_LOG(m_logger) << "TrajectoryBase::init : initialising..." ;
|
||||
|
||||
m_TimeOutCycles = a_ammunition.m_AmmunInfo.m_TimeOut / 1000.0;
|
||||
m_TimeOut = m_TimeOutCycles;
|
||||
@@ -178,9 +178,9 @@ bool TrajectoryBase::init(const Ammunition &a_ammunition)
|
||||
m_IsDetonateOnImpact = true;
|
||||
}
|
||||
|
||||
TRACE_LOG() << "TrajectoryBase::init : initialized successfully!" ;
|
||||
TRACE_LOG(m_logger) << "TrajectoryBase::init : initialized successfully!" ;
|
||||
|
||||
TRACE_LOG() << "m_TimeOutCycles : " << m_TimeOutCycles ;
|
||||
TRACE_LOG(m_logger) << "m_TimeOutCycles : " << m_TimeOutCycles ;
|
||||
|
||||
m_Initialized = true;
|
||||
return true;
|
||||
@@ -246,7 +246,7 @@ void TrajectoryBase::setVelAccelOrientTimeOut()
|
||||
|
||||
if (m_TimeOut < 0)
|
||||
{
|
||||
INFO_LOG() << "Bullet timed out : " << m_TimeOutCycles ;
|
||||
INFO_LOG(m_logger) << "Bullet timed out : " << m_TimeOutCycles ;
|
||||
m_Active = false;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -30,7 +30,7 @@ GeoConfig *GeoConfig::getInstance()
|
||||
bool GeoConfig::initFilename(const QString &fileName)
|
||||
{
|
||||
// const QFileInfo qFileInfo(fileName);
|
||||
// INFO_LOG() << Q_FUNC_INFO << " START, GeoConfig::absoluteFilePath ='" << qFileInfo.absoluteFilePath() << "'";
|
||||
// INFO_LOG(m_logger) << Q_FUNC_INFO << " START, GeoConfig::absoluteFilePath ='" << qFileInfo.absoluteFilePath() << "'";
|
||||
|
||||
// AmmunitionMap
|
||||
ConfigSettings::initFilename(fileName);
|
||||
@@ -41,7 +41,7 @@ bool GeoConfig::initFilename(const QString &fileName)
|
||||
|
||||
const QStringList &filePaths_rough_to_fine = elevationName.split(QStringLiteral(";"));
|
||||
|
||||
// INFO_LOG() << Q_FUNC_INFO << " use following file(s) for ElevationMap: '" << elevationName << "'";
|
||||
// INFO_LOG(m_logger) << Q_FUNC_INFO << " use following file(s) for ElevationMap: '" << elevationName << "'";
|
||||
|
||||
if (!m_elevationMapManager)
|
||||
{
|
||||
@@ -49,7 +49,7 @@ bool GeoConfig::initFilename(const QString &fileName)
|
||||
m_elevationMapManager->init(filePaths_rough_to_fine);
|
||||
}
|
||||
|
||||
// TRACE_LOG() << Q_FUNC_INFO << " END, filename ='" << fileName << "'";
|
||||
// TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, filename ='" << fileName << "'";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -78,9 +78,9 @@ void GeoConfig::initializeAmmu()
|
||||
|
||||
QVector<double> l_charges = getFloatVector(QStringLiteral("ChargeMap"), s_ammu_group);
|
||||
m_ChargeMap[i] = l_charges;
|
||||
// INFO_LOG() << "Store ChargeMap Entry: " << " i=" << i << " s_ammu_group = '" << s_ammu_group << "'";
|
||||
// INFO_LOG(m_logger) << "Store ChargeMap Entry: " << " i=" << i << " s_ammu_group = '" << s_ammu_group << "'";
|
||||
// for (int j = 0; j < l_charges.size(); j++)
|
||||
// INFO_LOG() << j << " = " << l_charges[j];
|
||||
// INFO_LOG(m_logger) << j << " = " << l_charges[j];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -37,6 +37,7 @@ namespace N_ConfigSystem
|
||||
class GeoConfig: public ConfigSettings
|
||||
{
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
explicit GeoConfig();
|
||||
~GeoConfig();
|
||||
public:
|
||||
@@ -48,6 +49,7 @@ public:
|
||||
double getElevation(const double lon, const double lat) const;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
friend class CesGeoPairing::HandlerGeoPairing; // for initFilename
|
||||
bool initFilename(const QString &fileName);
|
||||
|
||||
|
||||
+91
-91
@@ -33,34 +33,34 @@ GeoPairing::GeoPairing(const std::shared_ptr<N_Ballistic::BallisticService> &bal
|
||||
m_ballisticService(ballisticService)
|
||||
, m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairing"))
|
||||
{
|
||||
INFO_LOG() << "konfigPath = " << ballisticService->getConfigPath() ;
|
||||
INFO_LOG(m_logger) << "konfigPath = " << ballisticService->getConfigPath() ;
|
||||
|
||||
const QString s_configPath = ballisticService->getConfigPath();
|
||||
INFO_LOG() << "GeoPairing Config location : " << s_configPath ;
|
||||
INFO_LOG(m_logger) << "GeoPairing Config location : " << s_configPath ;
|
||||
|
||||
GeoPairingImpl *l_impl = new GeoPairingImplDted;
|
||||
INFO_LOG() << "--> Installing GeoPairingImplDted..." ;
|
||||
INFO_LOG(m_logger) << "--> Installing GeoPairingImplDted..." ;
|
||||
GeoPairingImplFactory::setImpl(l_impl);
|
||||
readAmmunitionIni();
|
||||
|
||||
// initialize the GeoPairing implementation
|
||||
if (!GeoPairingImplFactory::initialize(s_configPath))
|
||||
{
|
||||
ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!" ;
|
||||
ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!" ;
|
||||
|
||||
l_impl = new GeoPairingImplBalistic();
|
||||
INFO_LOG() << "--> Installing GeoPairingImplBalistic...";
|
||||
INFO_LOG(m_logger) << "--> Installing GeoPairingImplBalistic...";
|
||||
GeoPairingImplFactory::setImpl(l_impl);
|
||||
if (!GeoPairingImplFactory::initialize(s_configPath))
|
||||
{
|
||||
ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!" ;
|
||||
ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!" ;
|
||||
abort();
|
||||
}
|
||||
else
|
||||
INFO_LOG() << "GeoPairingImplBalistic correctly initialized" ;
|
||||
INFO_LOG(m_logger) << "GeoPairingImplBalistic correctly initialized" ;
|
||||
}
|
||||
else
|
||||
INFO_LOG() << "GeoPairingImplDted correctly initialized" ;
|
||||
INFO_LOG(m_logger) << "GeoPairingImplDted correctly initialized" ;
|
||||
|
||||
#ifdef _PSEUDO_TARGETS_
|
||||
// initial lat long position
|
||||
@@ -110,24 +110,24 @@ GeoPairing::GeoPairing(const std::shared_ptr<N_Ballistic::BallisticService> &bal
|
||||
|
||||
#endif
|
||||
|
||||
INFO_LOG() << "Initialization finished";
|
||||
INFO_LOG(m_logger) << "Initialization finished";
|
||||
}
|
||||
|
||||
void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
const QHash<int, CentralEffectSimulation::HandlerParticipant::CesParticipantData> &aircrafts)
|
||||
{
|
||||
INFO_LOG() << "calculateAirFire (IGLA)..." ;
|
||||
INFO_LOG(m_logger) << "calculateAirFire (IGLA)..." ;
|
||||
|
||||
GeoPairingDataFireReport l_Report;
|
||||
if (!l_Report.parse(transparentData))
|
||||
{
|
||||
WARNING_LOG() << "Error: Couldn't parse Fire Report" ;
|
||||
WARNING_LOG(m_logger) << "Error: Couldn't parse Fire Report" ;
|
||||
return;
|
||||
}
|
||||
|
||||
if (aircrafts.size() == 0)
|
||||
{
|
||||
INFO_LOG() << "No Aircraft available";
|
||||
INFO_LOG(m_logger) << "No Aircraft available";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
SInt32 vulnerabilityState = i.value().vulnerabilityState.underlying();
|
||||
Float64 lat = i.value().pos().lat() * 180 / M_PI;
|
||||
Float64 lon = i.value().pos().lon() * 180 / M_PI;
|
||||
DEBUG_LOG() << "GeoPairing::calculateAirFire"
|
||||
DEBUG_LOG(m_logger) << "GeoPairing::calculateAirFire"
|
||||
<< "\nl_Updater->update : " << i.key()
|
||||
<< "\n: participantId=" << i.value().participantId()
|
||||
<< "\n participantTypeId= " << i.value().participantTypeId()
|
||||
@@ -164,7 +164,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
l_SensorData.FireTime = m_Time;
|
||||
l_SensorData.WeaponElevation = 0;
|
||||
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire (createSensorData)"
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (createSensorData)"
|
||||
<< "\nl_SensorData.WeaponPositionLat = " << l_SensorData.WeaponPositionLat
|
||||
<< "\nl_SensorData.WeaponPositionLong = " << l_SensorData.WeaponPositionLong
|
||||
<< "\nl_SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth
|
||||
@@ -173,11 +173,11 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
;
|
||||
SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData);
|
||||
|
||||
INFO_LOG() << "createSensorData -> SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth
|
||||
INFO_LOG(m_logger) << "createSensorData -> SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth
|
||||
<< "\nl_SensorData.WeaponElevation=" << l_SensorData.WeaponElevation;
|
||||
if (l_DeviceID == -1)
|
||||
{
|
||||
ERROR_LOG() << "Couldn't create SensorData" ;
|
||||
ERROR_LOG(m_logger) << "Couldn't create SensorData" ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -189,14 +189,14 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
|
||||
if (l_Report.m_DeviceID == PAN_GP_REQUEST_IGLA)
|
||||
{
|
||||
INFO_LOG() << " -> IGLA : Request Target Detection " ;
|
||||
INFO_LOG(m_logger) << " -> IGLA : Request Target Detection " ;
|
||||
|
||||
QScopedPointer<GeoPairingImplAirTargetCache> l_Cache(GeoPairingImplFactory::createAirTargetCache(m_equipmentNumber));
|
||||
|
||||
int l_TargetPlayerId = 0;
|
||||
uint64_t l_ImpactTime = 0;
|
||||
|
||||
INFO_LOG() << "-> IGLA : Request Target Detection -> searchAirTarget (vor dem aufruf)"
|
||||
INFO_LOG(m_logger) << "-> IGLA : Request Target Detection -> searchAirTarget (vor dem aufruf)"
|
||||
<< "\nl_Elevation = " << l_Elevation
|
||||
<< "\nl_Azimuth = " << l_Azimuth
|
||||
;
|
||||
@@ -204,7 +204,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
|
||||
bool l_TargetFound = searchAirTarget(l_Elevation, l_Azimuth, l_TargetPlayerId, l_ImpactTime);
|
||||
|
||||
INFO_LOG() << "-> IGLA : Request Target Detection -> searchAirTarget (nach dem aufruf)"
|
||||
INFO_LOG(m_logger) << "-> IGLA : Request Target Detection -> searchAirTarget (nach dem aufruf)"
|
||||
<< "\nl_TargetFound = " << l_TargetFound
|
||||
<< "\nl_TargetPlayerId = " << l_TargetPlayerId
|
||||
<< "\nl_ImpactTime = " << l_ImpactTime
|
||||
@@ -213,7 +213,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
bool l_CachedTrackingState = l_Cache->getLatestTrackState(l_TargetPlayerId);
|
||||
UInt32 l_CachedTrackingTime = l_Cache->getLatestTrackTime(l_TargetPlayerId);
|
||||
|
||||
INFO_LOG() << "-> IGLA : Retrieved Target Detection Results from Cache"
|
||||
INFO_LOG(m_logger) << "-> IGLA : Retrieved Target Detection Results from Cache"
|
||||
<< "\nl_CachedTrackingState = " << l_CachedTrackingState
|
||||
<< "\nl_CachedTrackingTime = " << l_CachedTrackingTime
|
||||
;
|
||||
@@ -239,26 +239,26 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
m_reportTarget.send = true;
|
||||
|
||||
// Richtung Gefechtsfeld
|
||||
INFO_LOG() << "<-- EC : Report Target Detection " ;
|
||||
INFO_LOG() << "Target Found : " << l_TargetFound ;
|
||||
INFO_LOG(m_logger) << "<-- EC : Report Target Detection " ;
|
||||
INFO_LOG(m_logger) << "Target Found : " << l_TargetFound ;
|
||||
|
||||
//m_geoPairingData->sendData(m_PlayerId, l_SendData.data(), l_SendData.size() );
|
||||
|
||||
l_Cache->storeLatestTrackState(l_TargetPlayerId, m_Time, l_TargetFound);
|
||||
}
|
||||
}
|
||||
INFO_LOG() << "\n\nPAN_GP_REPORT_IGLA m_DeviceID=" << l_Report.m_DeviceID
|
||||
INFO_LOG(m_logger) << "\n\nPAN_GP_REPORT_IGLA m_DeviceID=" << l_Report.m_DeviceID
|
||||
<< " PAN_GP_REPORT_IGLA=" << PAN_GP_REPORT_IGLA;
|
||||
if (l_Report.m_DeviceID == PAN_GP_REPORT_IGLA)
|
||||
{
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire " ;
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire " ;
|
||||
|
||||
int l_TargetPlayerId = 0;
|
||||
UInt64 l_ImpactTime = 0;
|
||||
|
||||
QScopedPointer<GeoPairingImplAirTargetTracker> l_Tracker(GeoPairingImplFactory::createAirTargetTracker());
|
||||
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire (l_Tracker->setPosition)"
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (l_Tracker->setPosition)"
|
||||
<< "\nm_PositionLat = " << m_PositionLat
|
||||
<< "\nm_PositionLon = " << m_PositionLon
|
||||
<< "\nm_PositionHeight = " << m_PositionHeight
|
||||
@@ -266,12 +266,12 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
|
||||
l_Tracker->setPosition(m_PositionLat, m_PositionLon, m_PositionHeight);
|
||||
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire (setTime)"
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (setTime)"
|
||||
<< "\nm_Time = " << m_Time ;
|
||||
|
||||
l_Tracker->setTime(m_Time);
|
||||
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire (vor l_Tracker->track)"
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (vor l_Tracker->track)"
|
||||
<< "\nl_Azimuth = " << l_Azimuth
|
||||
<< "\nl_Elevation = " << l_Elevation
|
||||
<< "\nl_TargetPlayerId = " << l_TargetPlayerId
|
||||
@@ -280,7 +280,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
|
||||
bool l_TargetFound = l_Tracker->track(l_Azimuth, l_Elevation, l_TargetPlayerId, l_ImpactTime);
|
||||
|
||||
INFO_LOG() << "--> IGLA : Report Target Fire (nach l_Tracker->track)"
|
||||
INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (nach l_Tracker->track)"
|
||||
<< "\nl_TargetFound = " << l_TargetFound ;
|
||||
|
||||
if (l_TargetFound)
|
||||
@@ -295,17 +295,17 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
{
|
||||
//m_surfaceToAir->fire(l_TargetPlayerId, l_ImpactTime, l_AmmunitionType, m_PlayerId, true);
|
||||
m_fireToAircraft.hit = true;
|
||||
INFO_LOG() << "Air Target " << l_TargetPlayerId << " in reach and hit" ;
|
||||
INFO_LOG(m_logger) << "Air Target " << l_TargetPlayerId << " in reach and hit" ;
|
||||
}
|
||||
else
|
||||
{
|
||||
//m_surfaceToAir->fire(l_TargetPlayerId, l_ImpactTime, l_AmmunitionType, m_PlayerId, false);
|
||||
m_fireToAircraft.hit = false;
|
||||
INFO_LOG() << "Air Target " << l_TargetPlayerId << " in reach, but not hit" ;
|
||||
INFO_LOG(m_logger) << "Air Target " << l_TargetPlayerId << " in reach, but not hit" ;
|
||||
}
|
||||
}
|
||||
else
|
||||
INFO_LOG() << "No Air Target withing reach..." ;
|
||||
INFO_LOG(m_logger) << "No Air Target withing reach..." ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
|
||||
void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
const std::shared_ptr<N_Ballistic::BallisticService> &ballisticService)
|
||||
{
|
||||
INFO_LOG() << "calculateAreaFire (MK19)..." ;
|
||||
INFO_LOG(m_logger) << "calculateAreaFire (MK19)..." ;
|
||||
|
||||
// Prepare SensorData for Implementation
|
||||
GeoPairingImplSensorData l_SensorData;
|
||||
@@ -325,20 +325,20 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
GeoPairingDataFireReport l_Report;
|
||||
if (!l_Report.parse(transparentData))
|
||||
{
|
||||
ERROR_LOG() << "Error: Couldn't parse Fire Report" ;
|
||||
ERROR_LOG(m_logger) << "Error: Couldn't parse Fire Report" ;
|
||||
return;
|
||||
}
|
||||
SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData);
|
||||
if (l_DeviceID == -1)
|
||||
{
|
||||
ERROR_LOG() << "Couldn't create SensorData" ;
|
||||
ERROR_LOG(m_logger) << "Couldn't create SensorData" ;
|
||||
return;
|
||||
}
|
||||
|
||||
QScopedPointer<GeoPairingImplFiredBullet> l_FiredBullet(GeoPairingImplFactory::createFiredBullet(l_SensorData));
|
||||
if (l_FiredBullet == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Error: Couldn't create FiredBullet object" ;
|
||||
ERROR_LOG(m_logger) << "Error: Couldn't create FiredBullet object" ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
GeoPairingImplImpactData *l_ImpactData = l_FiredBullet->getImpactData();
|
||||
if (l_ImpactData == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "Error: Couldn't create ImpactData object" ;
|
||||
ERROR_LOG(m_logger) << "Error: Couldn't create ImpactData object" ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -364,15 +364,15 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
case MK19Type_m385:
|
||||
l_AmmunitionType = N_Ballistic::MK19_M385;
|
||||
l_AmmunitionTypeOSAG = N_Ballistic::MK19_M385_OSAG;
|
||||
INFO_LOG() << "Wirkfeld Ammunition MK19_M385" ;
|
||||
INFO_LOG(m_logger) << "Wirkfeld Ammunition MK19_M385" ;
|
||||
break;
|
||||
case MK19Type_m430:
|
||||
l_AmmunitionType = N_Ballistic::MK19_M430;
|
||||
l_AmmunitionTypeOSAG = N_Ballistic::MK19_M430_OSAG;
|
||||
INFO_LOG() << "Wirkfeld Ammunition MK19_M430" ;
|
||||
INFO_LOG(m_logger) << "Wirkfeld Ammunition MK19_M430" ;
|
||||
break;
|
||||
default:
|
||||
ERROR_LOG() << "Default Ammunition. Must not be called : " << l_SensorData.AmmunitionType ;
|
||||
ERROR_LOG(m_logger) << "Default Ammunition. Must not be called : " << l_SensorData.AmmunitionType ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -417,7 +417,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
m_areaFireToCtas.ammunitionTypeOSAG = l_AmmunitionTypeOSAG;
|
||||
m_areaFireToCtas.hit = true;
|
||||
|
||||
INFO_LOG() << "calculateAreaFire m_equipmentNumber=" << m_equipmentNumber
|
||||
INFO_LOG(m_logger) << "calculateAreaFire m_equipmentNumber=" << m_equipmentNumber
|
||||
<< " ImpactTime=" << l_ImpactData->ImpactTime
|
||||
<< " ImpactPositionLat=" << l_ImpactData->ImpactPositionLat
|
||||
<< " ImpactPositionLong=" << l_ImpactData->ImpactPositionLong
|
||||
@@ -431,7 +431,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData,
|
||||
|
||||
void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const std::shared_ptr<N_Ballistic::BallisticService> &ballisticService)
|
||||
{
|
||||
INFO_LOG() << "calculateSingleFire ..." ;
|
||||
INFO_LOG(m_logger) << "calculateSingleFire ..." ;
|
||||
|
||||
ElevationError error_elevation = ElevationError::NoError;
|
||||
int error_charge = 0;
|
||||
@@ -446,10 +446,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
l_SensorData.IgnitionType = -1; // Unknown
|
||||
|
||||
SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData, error_mun);
|
||||
INFO_LOG() << "l_DeviceID=" << l_DeviceID;
|
||||
INFO_LOG(m_logger) << "l_DeviceID=" << l_DeviceID;
|
||||
if (l_DeviceID == -1)
|
||||
{
|
||||
ERROR_LOG() << "Couldn't create SensorData" ;
|
||||
ERROR_LOG(m_logger) << "Couldn't create SensorData" ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
QString pfadQstr = CesGeoPairing::Settings::cesGeopairingIniPath() + QStringLiteral("/");
|
||||
std::string pfad = pfadQstr.toStdString();
|
||||
std::string munart;
|
||||
INFO_LOG() << "Vor switch AmmunitionType=" << l_SensorData.AmmunitionType
|
||||
INFO_LOG(m_logger) << "Vor switch AmmunitionType=" << l_SensorData.AmmunitionType
|
||||
<< " ChargeType=" << l_SensorData.ChargeType;
|
||||
|
||||
// Ammunition HE-M1
|
||||
@@ -471,7 +471,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
{
|
||||
case HE_M1A2:
|
||||
{
|
||||
INFO_LOG() << "HE_M1A2";
|
||||
INFO_LOG(m_logger) << "HE_M1A2";
|
||||
switch (l_SensorData.ChargeType)
|
||||
{
|
||||
case 0:
|
||||
@@ -497,32 +497,32 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
case M60mm_m385:
|
||||
case M60mm_m430:
|
||||
{
|
||||
INFO_LOG() << "M60mm_m385 M60mm_m430";
|
||||
INFO_LOG(m_logger) << "M60mm_m385 M60mm_m430";
|
||||
switch (l_SensorData.IgnitionType) // ChargeType = Ladung...
|
||||
{
|
||||
// Todo: Umbenennen und ggf. Zuordnung korrigieren
|
||||
case 0:
|
||||
INFO_LOG() << "Moerser-60mm-Lad1";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-Lad1";
|
||||
munart = "Moerser-60mm-Lad1";
|
||||
break;
|
||||
case 1:
|
||||
INFO_LOG() << "Moerser-60mm-Lad2";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-Lad2";
|
||||
munart = "Moerser-60mm-Lad2";
|
||||
break;
|
||||
case 2:
|
||||
INFO_LOG() << "Moerser-60mm-Lad3";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-Lad3";
|
||||
munart = "Moerser-60mm-Lad3";
|
||||
break;
|
||||
case 3:
|
||||
INFO_LOG() << "Moerser-60mm-Lad4";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-Lad4";
|
||||
munart = "Moerser-60mm-Lad4";
|
||||
break;
|
||||
case 4:
|
||||
INFO_LOG() << "Moerser-60mm-Lad5";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-Lad5";
|
||||
munart = "Moerser-60mm-Lad5";
|
||||
break;
|
||||
case 5:
|
||||
INFO_LOG() << "Moerser-60mm-La6";
|
||||
INFO_LOG(m_logger) << "Moerser-60mm-La6";
|
||||
munart = "Moerser-60mm-Lad6";
|
||||
break;
|
||||
default:
|
||||
@@ -532,7 +532,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
}
|
||||
case VLAP_M9703:
|
||||
{
|
||||
INFO_LOG() << "VLAP_M9703";
|
||||
INFO_LOG(m_logger) << "VLAP_M9703";
|
||||
// Sonderfall Ammunition VLAP-M64. Da hier nur 5 x M64 Incr als Ladung vorhanden ist.
|
||||
// Sollten wir eine andere Ladung aus dem Gefechtsfeld bekommen, dann Munition HE M1A2 benutzen
|
||||
switch (l_SensorData.ChargeType)
|
||||
@@ -610,7 +610,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
}
|
||||
if (munart.empty())
|
||||
{
|
||||
WARNING_LOG() << "No valid charge type " << l_SensorData.ChargeType <<
|
||||
WARNING_LOG(m_logger) << "No valid charge type " << l_SensorData.ChargeType <<
|
||||
" for ammunition " << l_SensorData.AmmunitionType <<
|
||||
" (internal ids!)" ;
|
||||
munart = "HE-M1-M64Base-TableE";
|
||||
@@ -618,7 +618,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
}
|
||||
|
||||
std::string suffix = ".sus";
|
||||
DEBUG_LOG() << "schusstafel pfad=" << pfad
|
||||
DEBUG_LOG(m_logger) << "schusstafel pfad=" << pfad
|
||||
<< " munart=" << munart
|
||||
<< " suffix=" << suffix;
|
||||
Schusstafel schusstafel(pfad, munart, suffix);
|
||||
@@ -647,10 +647,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
double elevationGrad = l_SensorData.WeaponElevation.getDegree();
|
||||
if (elevationGrad <= 0.0)
|
||||
{
|
||||
INFO_LOG() << "Elevation ist <= 0 Grad. Entfernung wird auf 50% des ersten Wertes aus der Schusstafel festgesetzt" ;
|
||||
INFO_LOG(m_logger) << "Elevation ist <= 0 Grad. Entfernung wird auf 50% des ersten Wertes aus der Schusstafel festgesetzt" ;
|
||||
// Dazu aus der minimal moeglichen Elevation die Entfernung bestimmen und halbieren
|
||||
float minEval = mun.minEleval * MILRAD;
|
||||
DEBUG_LOG() << "schusstafel tafelName=" << tafelName
|
||||
DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName
|
||||
<< " minEval=" << minEval
|
||||
<< "zielhoehenwinkel=" << zielhoehenwinkel;
|
||||
|
||||
@@ -661,10 +661,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
}
|
||||
else if (elevationGrad >= 90.0)
|
||||
{
|
||||
INFO_LOG() << "Elevation ist >= 90 Grad. Entfernung wird auf den letzten Wert aus der Schusstafel festgesetzt" ;
|
||||
INFO_LOG(m_logger) << "Elevation ist >= 90 Grad. Entfernung wird auf den letzten Wert aus der Schusstafel festgesetzt" ;
|
||||
// Dazu aus der maximal moeglichen Elevation die Entfernung bestimmen
|
||||
double maxEval = mun.maxEleval * MILRAD;
|
||||
DEBUG_LOG() << "schusstafel tafelName=" << tafelName
|
||||
DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName
|
||||
<< " maxEval=" << maxEval
|
||||
<< "zielhoehenwinkel=" << zielhoehenwinkel;
|
||||
schusstafel.ST_artillerie(tafelName, maxEval, zielhoehenwinkel, &entfernung1, &aufsatz1, &flugzeit1, &drift1,
|
||||
@@ -672,14 +672,14 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "schusstafel tafelName=" << tafelName
|
||||
DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName
|
||||
<< " arg_wert=" << arg_wert
|
||||
<< "zielhoehenwinkel=" << zielhoehenwinkel;
|
||||
schusstafel.ST_artillerie(tafelName, arg_wert, zielhoehenwinkel, &entfernung1, &aufsatz1, &flugzeit1, &drift1,
|
||||
&entfernung2, &aufsatz2, &flugzeit2, &drift2);
|
||||
}
|
||||
|
||||
INFO_LOG() << "Schusstafel " << munart << ".sus: "
|
||||
INFO_LOG(m_logger) << "Schusstafel " << munart << ".sus: "
|
||||
<< "Entfernung [m]: " << entfernung1
|
||||
<< " Elevation [mil]: " << evalMil
|
||||
<< " Drift [grad]: " << drift1 * 180 / M_PI
|
||||
@@ -691,14 +691,14 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
else
|
||||
{
|
||||
// != G5G6 && != M109
|
||||
INFO_LOG() << "calculate(ballisticService)";
|
||||
INFO_LOG(m_logger) << "calculate(ballisticService)";
|
||||
l_FiredBullet->calculate(ballisticService);
|
||||
}
|
||||
|
||||
GeoPairingImplImpactData *l_ImpactData = l_FiredBullet->getImpactData();
|
||||
if (!l_ImpactData)
|
||||
{
|
||||
ERROR_LOG() << "No impact Data available";
|
||||
ERROR_LOG(m_logger) << "No impact Data available";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -794,7 +794,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st
|
||||
// l_DeviceID);
|
||||
QString latStr = QString::number(l_ImpactData->ImpactPositionLat, 'f', 8);
|
||||
QString lonStr = QString::number(l_ImpactData->ImpactPositionLong, 'f', 8);
|
||||
INFO_LOG() << "calculateSingleFire m_equipmentNumber=" << m_equipmentNumber
|
||||
INFO_LOG(m_logger) << "calculateSingleFire m_equipmentNumber=" << m_equipmentNumber
|
||||
<< " ImpactTime=" << l_ImpactData->ImpactTime
|
||||
<< " ImpactPositionLat=" << latStr
|
||||
<< " ImpactPositionLong=" << lonStr
|
||||
@@ -830,20 +830,20 @@ bool GeoPairing::geoPairingData(const std::shared_ptr<N_Ballistic::BallisticServ
|
||||
m_areaFireToCtas.hit = false;
|
||||
m_reportTarget.send = false;
|
||||
|
||||
INFO_LOG() << "--------------- geoPairingData empfangen! -----------------" ;
|
||||
INFO_LOG() << "playerId = " << m_equipmentNumber ;
|
||||
INFO_LOG() << "time = " << (SInt64) m_Time ;
|
||||
INFO_LOG() << "positionLat = " << m_PositionLat ;
|
||||
INFO_LOG() << "positonLon = " << m_PositionLon ;
|
||||
INFO_LOG() << "tr.Data-Size = " << transparentDataAr.size() ;
|
||||
INFO_LOG(m_logger) << "--------------- geoPairingData empfangen! -----------------" ;
|
||||
INFO_LOG(m_logger) << "playerId = " << m_equipmentNumber ;
|
||||
INFO_LOG(m_logger) << "time = " << (SInt64) m_Time ;
|
||||
INFO_LOG(m_logger) << "positionLat = " << m_PositionLat ;
|
||||
INFO_LOG(m_logger) << "positonLon = " << m_PositionLon ;
|
||||
INFO_LOG(m_logger) << "tr.Data-Size = " << transparentDataAr.size() ;
|
||||
|
||||
INFO_LOG() << "transparentData = " << transparentDataAr.toHex() ;
|
||||
INFO_LOG(m_logger) << "transparentData = " << transparentDataAr.toHex() ;
|
||||
|
||||
QHashIterator<int, CentralEffectSimulation::HandlerParticipant::CesParticipantData> i(aircrafts);
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
DEBUG_LOG() << i.key() << ": participantId=" << i.value().participantId()
|
||||
DEBUG_LOG(m_logger) << i.key() << ": participantId=" << i.value().participantId()
|
||||
<< " participantTypeId= " << i.value().participantTypeId()
|
||||
<< " pos lat=" << i.value().pos().lat()
|
||||
<< " pos lon=" << i.value().pos().lon()
|
||||
@@ -855,18 +855,18 @@ bool GeoPairing::geoPairingData(const std::shared_ptr<N_Ballistic::BallisticServ
|
||||
|
||||
if (!l_Header.parse(transparentDataAr))
|
||||
{
|
||||
ERROR_LOG() << "Error: Couldn't parse header of transparent Data!" ;
|
||||
ERROR_LOG(m_logger) << "Error: Couldn't parse header of transparent Data!" ;
|
||||
return false;
|
||||
}
|
||||
|
||||
UInt8 l_MessageID = l_Header.m_MessageID;
|
||||
PanGeoPairingDeviceId l_DeviceID = l_Header.m_DeviceID;
|
||||
INFO_LOG() << "l_MessageID = " << std::hex << (int)l_MessageID ;
|
||||
INFO_LOG() << "l_DeviceID = " << l_DeviceID ;
|
||||
INFO_LOG(m_logger) << "l_MessageID = " << std::hex << (int)l_MessageID ;
|
||||
INFO_LOG(m_logger) << "l_DeviceID = " << l_DeviceID ;
|
||||
|
||||
if (l_MessageID == 0xE3) // Firing_Report
|
||||
{
|
||||
INFO_LOG() << "--> E3 : Firing Report " ;
|
||||
INFO_LOG(m_logger) << "--> E3 : Firing Report " ;
|
||||
|
||||
switch (l_DeviceID)
|
||||
{
|
||||
@@ -874,7 +874,7 @@ bool GeoPairing::geoPairingData(const std::shared_ptr<N_Ballistic::BallisticServ
|
||||
case PAN_GP_REPORT_G5_G6:
|
||||
case PAN_GP_REPORT_M109:
|
||||
calculateSingleFire(transparentDataAr, ballisticService);
|
||||
INFO_LOG() << "PAN_GP_REPORT_MORTAR PAN_GP_REPORT_G5_G6 PAN_GP_REPORT_M109 calculateSingleFire";
|
||||
INFO_LOG(m_logger) << "PAN_GP_REPORT_MORTAR PAN_GP_REPORT_G5_G6 PAN_GP_REPORT_M109 calculateSingleFire";
|
||||
break;
|
||||
case PAN_GP_REPORT_MK19:
|
||||
calculateAreaFire(transparentDataAr, ballisticService);
|
||||
@@ -882,16 +882,16 @@ bool GeoPairing::geoPairingData(const std::shared_ptr<N_Ballistic::BallisticServ
|
||||
case PAN_GP_REPORT_IGLA:
|
||||
case PAN_GP_REQUEST_IGLA:
|
||||
calculateAirFire(transparentDataAr, aircrafts);
|
||||
INFO_LOG() << "PAN_GP_REPORT_IGLA PAN_GP_REQUEST_IGLA ";
|
||||
INFO_LOG(m_logger) << "PAN_GP_REPORT_IGLA PAN_GP_REQUEST_IGLA ";
|
||||
break;
|
||||
default:
|
||||
WARNING_LOG() << "--> Unknown DeviceID " << l_DeviceID << " used !" ;
|
||||
WARNING_LOG(m_logger) << "--> Unknown DeviceID " << l_DeviceID << " used !" ;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WARNING_LOG() << "--> Unknown MessageID used ! " ;
|
||||
WARNING_LOG(m_logger) << "--> Unknown MessageID used ! " ;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -913,7 +913,7 @@ void GeoPairing::setMeteo(double winddirection, double windspeed, double tempera
|
||||
|
||||
bool GeoPairing::searchAirTarget(double a_elevation, double azimuth, int &playerId, uint64_t &impactTime)
|
||||
{
|
||||
INFO_LOG() << "searchAirTarget (IGLA)..." ;
|
||||
INFO_LOG(m_logger) << "searchAirTarget (IGLA)..." ;
|
||||
|
||||
QScopedPointer<GeoPairingImplAirTargetTracker> l_Tracker(GeoPairingImplFactory::createAirTargetTracker());
|
||||
|
||||
@@ -936,25 +936,25 @@ void GeoPairing::readAmmunitionIni()
|
||||
//Zu erst holen wir uns alle WaffenTypen
|
||||
const QVector<int> typesList = ammuConfig->getIntegerVector(QStringLiteral("WeaponRestriction"), QStringLiteral("Types"));
|
||||
|
||||
DEBUG_LOG() << "typesList.size=" << typesList.size();
|
||||
DEBUG_LOG(m_logger) << "typesList.size=" << typesList.size();
|
||||
//Wir holen uns alle Munitionen die in Frage kommen heraus // evtl mit Liste?
|
||||
const QVector<int> ammoList = ammuConfig->getIntegerVector(QStringLiteral("WeaponRestriction"), QStringLiteral("AmmoList"));
|
||||
DEBUG_LOG() << "ammoList=" << ammoList.size();
|
||||
DEBUG_LOG(m_logger) << "ammoList=" << ammoList.size();
|
||||
for (int ammo : ammoList)
|
||||
{
|
||||
DEBUG_LOG() << "ammoListValue=" << ammo;
|
||||
DEBUG_LOG(m_logger) << "ammoListValue=" << ammo;
|
||||
|
||||
QString eleGroup = QStringLiteral("Ammunition") + QStringLiteral("P") + QString::number(ammo) + QStringLiteral("/CWParams");
|
||||
const QVector<double> minElevataion = ammuConfig->getFloatVector(eleGroup, QStringLiteral("ElevMin"));
|
||||
DEBUG_LOG() << "ammo = " << ammo << " minElevataion.size() =" << minElevataion.size()
|
||||
DEBUG_LOG(m_logger) << "ammo = " << ammo << " minElevataion.size() =" << minElevataion.size()
|
||||
<< " " << eleGroup << "/" << QStringLiteral("ElevMin");
|
||||
|
||||
const QVector<double> maxElevataion = ammuConfig->getFloatVector(eleGroup, QStringLiteral("ElevMax"));
|
||||
DEBUG_LOG() << "ammo = " << ammo << " maxElevataion.size() =" << maxElevataion.size() << eleGroup << "/" << QStringLiteral("ElevMax");
|
||||
DEBUG_LOG(m_logger) << "ammo = " << ammo << " maxElevataion.size() =" << maxElevataion.size() << eleGroup << "/" << QStringLiteral("ElevMax");
|
||||
|
||||
if (minElevataion.size() != maxElevataion.size())
|
||||
{
|
||||
DEBUG_LOG() << "Invalid Ammunition Config for : Ammunition" << ammo ;
|
||||
DEBUG_LOG(m_logger) << "Invalid Ammunition Config for : Ammunition" << ammo ;
|
||||
continue;
|
||||
}
|
||||
// Get Allowd fpr all Types
|
||||
@@ -966,9 +966,9 @@ void GeoPairing::readAmmunitionIni()
|
||||
{
|
||||
QString alloweKey = QStringLiteral("Allowed") + QString::number(weaponTypeId);
|
||||
const QMap<int, bool> allowed = ammuConfig->getBoolMap(eleGroup, alloweKey);
|
||||
DEBUG_LOG() << "alloweKey allowed.size() =" << allowed.size() << " " << eleGroup << "/" << alloweKey;
|
||||
DEBUG_LOG(m_logger) << "alloweKey allowed.size() =" << allowed.size() << " " << eleGroup << "/" << alloweKey;
|
||||
allowedCombi.insert(weaponTypeId, allowed);
|
||||
//DEBUG_LOG() << "allowedCombi.insert(" << weaponTypeId <<", " << allowed << ")";
|
||||
//DEBUG_LOG(m_logger) << "allowedCombi.insert(" << weaponTypeId <<", " << allowed << ")";
|
||||
}
|
||||
|
||||
for (int j = 0; j < minElevataion.size(); j++)
|
||||
@@ -983,13 +983,13 @@ void GeoPairing::readAmmunitionIni()
|
||||
//hier holen wir nur den erlaubtstatus für die jeweilige ChargeElevation und packen sie in die
|
||||
//Map des ChargeType
|
||||
allowedCombiForCharge.insert(weaponTypeId, allowedCombi.value(weaponTypeId).value(j));
|
||||
DEBUG_LOG() << "allowedCombiForCharge.insert(" << weaponTypeId << ", " << allowedCombi.value(weaponTypeId).value(j) << ")";
|
||||
DEBUG_LOG(m_logger) << "allowedCombiForCharge.insert(" << weaponTypeId << ", " << allowedCombi.value(weaponTypeId).value(j) << ")";
|
||||
}
|
||||
GeoPCharge geoPCharge = GeoPCharge(_chargeId, _minEleval, _maxEleval, allowedCombiForCharge);
|
||||
mun.insert(j, geoPCharge);
|
||||
}
|
||||
m_geoPMunMap.insert(ammo, mun);
|
||||
}
|
||||
DEBUG_LOG() << "m_geoPMunMap.size=" << m_geoPMunMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_geoPMunMap.size=" << m_geoPMunMap.size();
|
||||
|
||||
}
|
||||
+3
-3
@@ -35,20 +35,20 @@ bool GeoPairingDataBase::parse(const QByteArray& a_transparentData)
|
||||
|
||||
if (a_transparentData.size() < m_Size)
|
||||
{
|
||||
ERROR_LOG() << "Size of transparent Data not valid :" << a_transparentData.size()
|
||||
ERROR_LOG(m_logger) << "Size of transparent Data not valid :" << a_transparentData.size()
|
||||
<< " instead of " << m_Size;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_MessageID = a_transparentData[startMessageId];
|
||||
int messageId = m_MessageID;
|
||||
INFO_LOG() << "Header -> MessageID : " << messageId;
|
||||
INFO_LOG(m_logger) << "Header -> MessageID : " << messageId;
|
||||
|
||||
UInt8 deviceId;
|
||||
deviceId = a_transparentData[startDevice];
|
||||
|
||||
m_DeviceID = static_cast<PanGeoPairingDeviceId>(deviceId);
|
||||
INFO_LOG() << "Header -> DeviceID : " << m_DeviceID;
|
||||
INFO_LOG(m_logger) << "Header -> DeviceID : " << m_DeviceID;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
+44
-44
@@ -84,23 +84,23 @@ GeoPairingImplAirTargetCache *GeoPairingImpl::createAirTargetCache(UInt32 a_play
|
||||
// ---------------------------------------------------------------
|
||||
SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, const QByteArray& a_transparendData, int &isDefault)
|
||||
{
|
||||
INFO_LOG() << "createSensorData";
|
||||
INFO_LOG(m_logger) << "createSensorData";
|
||||
if (!m_Initialized)
|
||||
{
|
||||
ERROR_LOG() << "Implementation not initialized";
|
||||
ERROR_LOG(m_logger) << "Implementation not initialized";
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!a_sensorData)
|
||||
{
|
||||
ERROR_LOG() << "SensorData Object argument not valid";
|
||||
ERROR_LOG(m_logger) << "SensorData Object argument not valid";
|
||||
return -1;
|
||||
}
|
||||
|
||||
GeoPairingDataFireReport l_Report;
|
||||
if (!l_Report.parse(a_transparendData))
|
||||
{
|
||||
ERROR_LOG() << "Couldn't parse FireReport";
|
||||
ERROR_LOG(m_logger) << "Couldn't parse FireReport";
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -141,9 +141,9 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
|
||||
if (date.isValid())
|
||||
{
|
||||
INFO_LOG() << "GeoMagneticField DateRecord = " << l_DateRecord;
|
||||
INFO_LOG() << "GeoMagneticField Declination = " << l_Declination;
|
||||
INFO_LOG() << "GeoMagneticField ChangePerYear = " << l_ChangePerYear;
|
||||
INFO_LOG(m_logger) << "GeoMagneticField DateRecord = " << l_DateRecord;
|
||||
INFO_LOG(m_logger) << "GeoMagneticField Declination = " << l_Declination;
|
||||
INFO_LOG(m_logger) << "GeoMagneticField ChangePerYear = " << l_ChangePerYear;
|
||||
|
||||
time_t l_TimeNow = time(nullptr);
|
||||
struct tm l_TimeInfo;
|
||||
@@ -157,42 +157,42 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
|
||||
int l_SecondsPerYear = 365 * 24 * 3600;
|
||||
int l_Years = l_TimeDiff / l_SecondsPerYear; // number of years since DateRecords
|
||||
DEBUG_LOG() << "GeoMagneticField Years since DateRecord : " << l_Years;
|
||||
DEBUG_LOG(m_logger) << "GeoMagneticField Years since DateRecord : " << l_Years;
|
||||
|
||||
l_GeoMagneticCorrection = l_Declination + (l_Years * l_ChangePerYear);
|
||||
INFO_LOG() << "GeoMagneticField Azimuth correction [degrees]: " << l_GeoMagneticCorrection;
|
||||
INFO_LOG(m_logger) << "GeoMagneticField Azimuth correction [degrees]: " << l_GeoMagneticCorrection;
|
||||
l_GeoMagneticCorrection *= N_SST::PI_OVER_180;
|
||||
l_Azimuth += l_GeoMagneticCorrection;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
INFO_LOG() << "createSensorData";
|
||||
INFO_LOG(m_logger) << "createSensorData";
|
||||
|
||||
if (l_Report.m_DeviceID == PAN_GP_REPORT_MORTAR)
|
||||
{
|
||||
int l_AmmunitionField = PAN_AMMU_INDEX(l_Report.m_Ammunition);
|
||||
INFO_LOG() << "createSensorData PAN_GP_REPORT_MORTAR l_AmmunitionField=" << +l_AmmunitionField
|
||||
INFO_LOG(m_logger) << "createSensorData PAN_GP_REPORT_MORTAR l_AmmunitionField=" << +l_AmmunitionField
|
||||
<< " l_Report.m_Ammunition=" << +l_Report.m_Ammunition
|
||||
<< " l_Report.m_Ammunition & 0x03=" << +(l_Report.m_Ammunition & 0x03);
|
||||
switch (l_Report.m_Ammunition & 0x03)
|
||||
{
|
||||
case 1:
|
||||
a_sensorData->AmmunitionType = MortarType1;
|
||||
INFO_LOG() << "Using Mortar Ammunition 1";
|
||||
INFO_LOG(m_logger) << "Using Mortar Ammunition 1";
|
||||
break;
|
||||
case 2:
|
||||
a_sensorData->AmmunitionType = MortarType2;
|
||||
INFO_LOG() << "Using Mortar Ammunition 2";
|
||||
INFO_LOG(m_logger) << "Using Mortar Ammunition 2";
|
||||
break;
|
||||
default:
|
||||
a_sensorData->AmmunitionType = MortarType1;
|
||||
ERROR_LOG() << "Ammunition value means 'reserved' : "
|
||||
ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : "
|
||||
<< l_AmmunitionField;
|
||||
return -1;
|
||||
}
|
||||
a_sensorData->IgnitionType = (l_Report.m_Ammunition >> 3) & 0x07;
|
||||
INFO_LOG() << "a_sensorData->IgnitionType= " << a_sensorData->IgnitionType;
|
||||
INFO_LOG(m_logger) << "a_sensorData->IgnitionType= " << a_sensorData->IgnitionType;
|
||||
}
|
||||
else if ((l_Report.m_DeviceID == PAN_GP_REPORT_G5_G6) || (l_Report.m_DeviceID == PAN_GP_REPORT_M109))
|
||||
{
|
||||
@@ -202,38 +202,38 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
case 1:
|
||||
a_sensorData->AmmunitionType = HE_M1A2;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion;
|
||||
INFO_LOG() << "Using HE_M1A2 Percussion";
|
||||
INFO_LOG(m_logger) << "Using HE_M1A2 Percussion";
|
||||
break;
|
||||
case 2:
|
||||
a_sensorData->AmmunitionType = HE_M1A2;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypeProximity;
|
||||
INFO_LOG() << "Using HE_M1A2 Proximity";
|
||||
INFO_LOG(m_logger) << "Using HE_M1A2 Proximity";
|
||||
break;
|
||||
case 3:
|
||||
a_sensorData->AmmunitionType = VLAP_M9703;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion;
|
||||
INFO_LOG() << "Using VLAP_M9703 Percussion";
|
||||
INFO_LOG(m_logger) << "Using VLAP_M9703 Percussion";
|
||||
break;
|
||||
case 4:
|
||||
a_sensorData->AmmunitionType = VLAP_M9703;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypeProximity;
|
||||
INFO_LOG() << "Using VLAP_M9703 Proximity";
|
||||
INFO_LOG(m_logger) << "Using VLAP_M9703 Proximity";
|
||||
break;
|
||||
case 5:
|
||||
a_sensorData->AmmunitionType = SMK_BE_M2;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypeTime;
|
||||
INFO_LOG() << "Using SMK_BE_M2 Time";
|
||||
INFO_LOG(m_logger) << "Using SMK_BE_M2 Time";
|
||||
break;
|
||||
case 6:
|
||||
a_sensorData->AmmunitionType = CLUSTER_HEHC_M9609;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypeTime;
|
||||
INFO_LOG() << "Using CLUSTER_HEHC_M9609 Time";
|
||||
INFO_LOG(m_logger) << "Using CLUSTER_HEHC_M9609 Time";
|
||||
break;
|
||||
default:
|
||||
a_sensorData->AmmunitionType = HE_M1A2;
|
||||
a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion;
|
||||
isDefault = 1;
|
||||
ERROR_LOG() << "Ammunition value means 'reserved' : " << l_AmmunitionField;
|
||||
ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : " << l_AmmunitionField;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -277,15 +277,15 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
{
|
||||
case 1:
|
||||
a_sensorData->AmmunitionType = MK19Type_m385;
|
||||
INFO_LOG() << "Using MK19 Ammunition 1 (m385)";
|
||||
INFO_LOG(m_logger) << "Using MK19 Ammunition 1 (m385)";
|
||||
break;
|
||||
case 2:
|
||||
a_sensorData->AmmunitionType = MK19Type_m430;
|
||||
INFO_LOG() << "Using MK19 Ammunition 2 (m430)";
|
||||
INFO_LOG(m_logger) << "Using MK19 Ammunition 2 (m430)";
|
||||
break;
|
||||
default:
|
||||
a_sensorData->AmmunitionType = MK19Type_m385;
|
||||
ERROR_LOG() << "Ammunition value means 'reserved' : " << l_AmmunitionField;
|
||||
ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : " << l_AmmunitionField;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -293,11 +293,11 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
l_Report.m_DeviceID == PAN_GP_REQUEST_IGLA)
|
||||
{
|
||||
a_sensorData->AmmunitionType = AmmunitionTypeUnknown; // irrelevant
|
||||
INFO_LOG() << "Using IGLA Ammunition 1";
|
||||
INFO_LOG(m_logger) << "Using IGLA Ammunition 1";
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "Couldn't create sensorData for DeviceID : " << l_Report.m_DeviceID;
|
||||
ERROR_LOG(m_logger) << "Couldn't create sensorData for DeviceID : " << l_Report.m_DeviceID;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
a_sensorData->WeaponElevation = l_Elevation;
|
||||
a_sensorData->WeaponTemperature = l_Report.m_Temperature;
|
||||
|
||||
INFO_LOG() << "a_sensorData->ChargeType=" << a_sensorData->ChargeType
|
||||
INFO_LOG(m_logger) << "a_sensorData->ChargeType=" << a_sensorData->ChargeType
|
||||
<< " l_Report.m_Ammunition=" << l_Report.m_Ammunition
|
||||
<< " l_Report.m_DeviceID=" << l_Report.m_DeviceID;
|
||||
|
||||
@@ -329,7 +329,7 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
// a_sensorData->ChargeType = 382;
|
||||
// else
|
||||
// a_sensorData->ChargeType = 385;
|
||||
INFO_LOG() << "PAN_GP_REPORT_MORTAR: l_Report.m_Ammunition" << l_Report.m_Ammunition
|
||||
INFO_LOG(m_logger) << "PAN_GP_REPORT_MORTAR: l_Report.m_Ammunition" << l_Report.m_Ammunition
|
||||
<< " a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
}
|
||||
else if ((l_Report.m_DeviceID != PAN_GP_REPORT_G5_G6) && (l_Report.m_DeviceID != PAN_GP_REPORT_M109))
|
||||
@@ -339,47 +339,47 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData,
|
||||
a_sensorData->IgnitionType = l_Report.m_TimeToDetonate;
|
||||
else
|
||||
a_sensorData->IgnitionType = 0;
|
||||
INFO_LOG() << "if a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
INFO_LOG(m_logger) << "if a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "else a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
INFO_LOG(m_logger) << "else a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
|
||||
SInt32 ch = PAN_AMMU_CHARGE_G5_G6(l_Report.m_Ammunition);
|
||||
|
||||
if (ch == 1) // M64 Base
|
||||
{
|
||||
a_sensorData->ChargeType = 0;
|
||||
INFO_LOG() << "Using Charge M64 Base";
|
||||
INFO_LOG(m_logger) << "Using Charge M64 Base";
|
||||
}
|
||||
else if (ch == 3) // 3 x M64 Incr
|
||||
{
|
||||
a_sensorData->ChargeType = 1;
|
||||
INFO_LOG() << "Using Charge M64 INCR x 3";
|
||||
INFO_LOG(m_logger) << "Using Charge M64 INCR x 3";
|
||||
}
|
||||
else if (ch == 4) // 4 x M64 Incr
|
||||
{
|
||||
a_sensorData->ChargeType = 2;
|
||||
INFO_LOG() << "Using Charge M64 INCR x 4";
|
||||
INFO_LOG(m_logger) << "Using Charge M64 INCR x 4";
|
||||
}
|
||||
else if (ch == 5) // 5 x M64 Incr
|
||||
{
|
||||
a_sensorData->ChargeType = 3;
|
||||
INFO_LOG() << "Using Charge M64 INCR x 5";
|
||||
INFO_LOG(m_logger) << "Using Charge M64 INCR x 5";
|
||||
}
|
||||
else if (ch == 6) // 5 x M64 Incr + Base Bleed
|
||||
{
|
||||
a_sensorData->ChargeType = 4;
|
||||
INFO_LOG() << "Using Charge M64 INCR x 5 + Base Bleed";
|
||||
INFO_LOG(m_logger) << "Using Charge M64 INCR x 5 + Base Bleed";
|
||||
}
|
||||
else
|
||||
{
|
||||
a_sensorData->ChargeType = 0;
|
||||
isDefault = 1;
|
||||
WARNING_LOG() << "Unknown Charge Type. Using Charge M64 Base";
|
||||
WARNING_LOG(m_logger) << "Unknown Charge Type. Using Charge M64 Base";
|
||||
}
|
||||
}
|
||||
INFO_LOG() << "a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
INFO_LOG(m_logger) << "a_sensorData->ChargeType=" << a_sensorData->ChargeType;
|
||||
return l_Report.m_DeviceID;
|
||||
}
|
||||
|
||||
@@ -391,16 +391,16 @@ void GeoPairingImpl::setMeteoData(const GeoPairingImplMeteoData &a_meteoData)
|
||||
{
|
||||
if (!m_Initialized)
|
||||
{
|
||||
ERROR_LOG() << "Implementation not initialized";
|
||||
ERROR_LOG(m_logger) << "Implementation not initialized";
|
||||
return;
|
||||
}
|
||||
m_MeteoData = a_meteoData;
|
||||
|
||||
INFO_LOG() << "---------- Setting Meteo Data ------------";
|
||||
INFO_LOG() << "AirPressure : " << m_MeteoData.AirPressure;
|
||||
INFO_LOG() << "Temperature : " << m_MeteoData.Temperature;
|
||||
INFO_LOG() << "WindDirection : " << m_MeteoData.WindDirection;
|
||||
INFO_LOG() << "WindSpeed : " << m_MeteoData.WindSpeed;
|
||||
INFO_LOG(m_logger) << "---------- Setting Meteo Data ------------";
|
||||
INFO_LOG(m_logger) << "AirPressure : " << m_MeteoData.AirPressure;
|
||||
INFO_LOG(m_logger) << "Temperature : " << m_MeteoData.Temperature;
|
||||
INFO_LOG(m_logger) << "WindDirection : " << m_MeteoData.WindDirection;
|
||||
INFO_LOG(m_logger) << "WindSpeed : " << m_MeteoData.WindSpeed;
|
||||
}
|
||||
|
||||
} // namespace N_GeoPairingImpl
|
||||
+10
-10
@@ -29,7 +29,7 @@ GeoPairingImplAirTarget::GeoPairingImplAirTarget(SInt32 a_playerID)
|
||||
: m_PlayerID(a_playerID),
|
||||
m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplAirTarget"))
|
||||
{
|
||||
INFO_LOG() << "Constructor : PlayerID " << m_PlayerID;
|
||||
INFO_LOG(m_logger) << "Constructor : PlayerID " << m_PlayerID;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,13 +40,13 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po
|
||||
{
|
||||
if (a_positionTime <= m_PositionTime)
|
||||
{
|
||||
INFO_LOG() << "No new position info for Player " << m_PlayerID
|
||||
INFO_LOG(m_logger) << "No new position info for Player " << m_PlayerID
|
||||
<< ", abandon update. PositionTime = "
|
||||
<< a_positionTime;
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "Set new Position for Player " << m_PlayerID;
|
||||
INFO_LOG(m_logger) << "Set new Position for Player " << m_PlayerID;
|
||||
|
||||
N_Math::GeoCoord l_NewPositionUtm;
|
||||
l_NewPositionUtm.setLlPositionDegree(a_positionLat, a_positionLon, a_positionAlt);
|
||||
@@ -56,28 +56,28 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po
|
||||
if (m_PositionTime > 0)
|
||||
{
|
||||
UInt32 l_TimeDiff = a_positionTime - m_PositionTime;
|
||||
INFO_LOG() << "l_TimeDiff [s]: " << l_TimeDiff;
|
||||
INFO_LOG(m_logger) << "l_TimeDiff [s]: " << l_TimeDiff;
|
||||
|
||||
// when new position time is more current than existing one
|
||||
if (l_TimeDiff > 0)
|
||||
{
|
||||
N_Types::Vec3 l_NewDirection = l_NewPosition - m_Position;
|
||||
Float64 l_Distance = l_NewDirection.magnitude();
|
||||
INFO_LOG() << "l_Distance [m]: " << l_Distance;
|
||||
INFO_LOG(m_logger) << "l_Distance [m]: " << l_Distance;
|
||||
l_NewDirection /= l_Distance;
|
||||
m_Direction = l_NewDirection;
|
||||
INFO_LOG() << "m_Direction : " << m_Direction;
|
||||
INFO_LOG(m_logger) << "m_Direction : " << m_Direction;
|
||||
|
||||
m_Speed = l_Distance / l_TimeDiff;
|
||||
INFO_LOG() << "m_Speed [m/s]: " << m_Speed;
|
||||
INFO_LOG(m_logger) << "m_Speed [m/s]: " << m_Speed;
|
||||
}
|
||||
}
|
||||
|
||||
m_Position = l_NewPosition;
|
||||
INFO_LOG() << "m_Position : " << m_Position;
|
||||
INFO_LOG(m_logger) << "m_Position : " << m_Position;
|
||||
|
||||
m_PositionTime = a_positionTime;
|
||||
INFO_LOG() << "m_PositionTime : " << m_PositionTime;
|
||||
INFO_LOG(m_logger) << "m_PositionTime : " << m_PositionTime;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po
|
||||
// ---------------------------------------------------------------
|
||||
void GeoPairingImplAirTarget::updateState(SInt32 a_state)
|
||||
{
|
||||
INFO_LOG() << "Set new State for Player "
|
||||
INFO_LOG(m_logger) << "Set new State for Player "
|
||||
<< m_PlayerID << " : " << a_state;
|
||||
m_State = a_state;
|
||||
}
|
||||
|
||||
+10
-10
@@ -66,20 +66,20 @@ GeoPairingImplAirTargetCacheData *GeoPairingImplAirTargetCache::getLatestCacheDa
|
||||
{
|
||||
if (m_CacheData == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "No global Cache pointer present!";
|
||||
ERROR_LOG(m_logger) << "No global Cache pointer present!";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (m_CacheData->empty())
|
||||
{
|
||||
INFO_LOG() << "Global Cache empty";
|
||||
INFO_LOG(m_logger) << "Global Cache empty";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CacheType::iterator it = m_CacheData->find(m_PlayerID);
|
||||
if (it == m_CacheData->end())
|
||||
{
|
||||
INFO_LOG() << "No Cache present for Player " << m_PlayerID
|
||||
INFO_LOG(m_logger) << "No Cache present for Player " << m_PlayerID
|
||||
<< " tracking Target " << a_targetID;
|
||||
return nullptr;
|
||||
}
|
||||
@@ -88,14 +88,14 @@ GeoPairingImplAirTargetCacheData *GeoPairingImplAirTargetCache::getLatestCacheDa
|
||||
|
||||
if (l_Cache->empty())
|
||||
{
|
||||
INFO_LOG() << "Cache for Player " << m_PlayerID << " is empty";
|
||||
INFO_LOG(m_logger) << "Cache for Player " << m_PlayerID << " is empty";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CacheDataType::iterator itC = l_Cache->find(a_targetID);
|
||||
if (itC == l_Cache->end())
|
||||
{
|
||||
INFO_LOG() << "Target " << a_targetID
|
||||
INFO_LOG(m_logger) << "Target " << a_targetID
|
||||
<< " not found in Cache of Player "
|
||||
<< m_PlayerID;
|
||||
return nullptr;
|
||||
@@ -112,7 +112,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt
|
||||
{
|
||||
if (m_CacheData == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "No global Cache pointer present!";
|
||||
ERROR_LOG(m_logger) << "No global Cache pointer present!";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt
|
||||
if (it == m_CacheData->end())
|
||||
{
|
||||
(*m_CacheData)[m_PlayerID] = new CacheDataType();
|
||||
INFO_LOG() << "Create new Cache for Player " << m_PlayerID;
|
||||
INFO_LOG(m_logger) << "Create new Cache for Player " << m_PlayerID;
|
||||
}
|
||||
|
||||
CacheDataType *l_Cache = (*m_CacheData)[m_PlayerID];
|
||||
@@ -131,7 +131,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt
|
||||
{
|
||||
l_CacheData = new GeoPairingImplAirTargetCacheData();
|
||||
(*l_Cache)[a_targetID] = l_CacheData;
|
||||
INFO_LOG() << "Create new CacheObject for Target "
|
||||
INFO_LOG(m_logger) << "Create new CacheObject for Target "
|
||||
<< a_targetID << " in Cache of Player "
|
||||
<< m_PlayerID;
|
||||
}
|
||||
@@ -141,10 +141,10 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt
|
||||
l_CacheData->m_TrackTime = a_trackingTime;
|
||||
l_CacheData->m_TrackState = a_trackingState;
|
||||
|
||||
INFO_LOG() << "Stored Tracking Time and State for Target "
|
||||
INFO_LOG(m_logger) << "Stored Tracking Time and State for Target "
|
||||
<< a_targetID << " in Cache of Player "
|
||||
<< m_PlayerID;
|
||||
INFO_LOG() << "-> Cached Time : " << a_trackingTime
|
||||
INFO_LOG(m_logger) << "-> Cached Time : " << a_trackingTime
|
||||
<< " State : " << a_trackingState;
|
||||
return true;
|
||||
}
|
||||
|
||||
+40
-40
@@ -30,7 +30,7 @@ GeoPairingImplAirTargetTracker::GeoPairingImplAirTargetTracker(std::vector<GeoPa
|
||||
: m_List(a_listTargets)
|
||||
, m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplAirTargetTracker"))
|
||||
{
|
||||
INFO_LOG() << "Construct Tracker for " << a_listTargets->size()
|
||||
INFO_LOG(m_logger) << "Construct Tracker for " << a_listTargets->size()
|
||||
<< " air targets";
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ void GeoPairingImplAirTargetTracker::setPosition(Float64 a_positionLat,
|
||||
|
||||
N_Types::Coord3 l_Position(l_PositionUtm.utmEasting(), l_PositionUtm.utmNorthing(),
|
||||
l_PositionUtm.height());
|
||||
INFO_LOG() << "Tracker position : " << l_Position;
|
||||
INFO_LOG(m_logger) << "Tracker position : " << l_Position;
|
||||
m_Position = l_Position;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
{
|
||||
if (m_List->size() == 0)
|
||||
{
|
||||
INFO_LOG() << "No air targets to track";
|
||||
INFO_LOG(m_logger) << "No air targets to track";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
l_sensorAngle.m_H.setDegree(-a_azimuth);
|
||||
l_sensorAngle.m_P.setDegree(a_elevation);
|
||||
|
||||
INFO_LOG() << "Tracking angle : " << l_sensorAngle;
|
||||
INFO_LOG(m_logger) << "Tracking angle : " << l_sensorAngle;
|
||||
|
||||
N_Types::Radian64 l_ClosestAzimuth;
|
||||
N_Types::Radian64 l_ClosestElevation;
|
||||
@@ -85,7 +85,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
UInt64 l_ClosestPlayerImpactTime = 0;
|
||||
Float64 l_ClosestPlayerDistance = 0;
|
||||
|
||||
INFO_LOG() << "Iterating through air targets, Count : "
|
||||
INFO_LOG(m_logger) << "Iterating through air targets, Count : "
|
||||
<< m_List->size();
|
||||
for (const auto l_Target : *m_List)
|
||||
{
|
||||
@@ -94,7 +94,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
// Float64 l_TargetSpeed = l_Target->m_Speed;
|
||||
UInt64 l_TargetPosTime = l_Target->m_PositionTime;
|
||||
|
||||
INFO_LOG() << "Position of air target "
|
||||
INFO_LOG(m_logger) << "Position of air target "
|
||||
<< l_Target->m_PlayerID << " @ "
|
||||
<< l_TargetPosTime << " s : "
|
||||
<< l_targetPos;
|
||||
@@ -104,7 +104,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
/* if (l_TimeDiff != 0)
|
||||
{
|
||||
N_Types::Vec3 l_PosDiff = l_TargetDir * (l_TargetSpeed * l_TimeDiff);
|
||||
INFO_LOG() << "l_PosDiff = " << l_PosDiff;
|
||||
INFO_LOG(m_logger) << "l_PosDiff = " << l_PosDiff;
|
||||
|
||||
l_targetPos.m_X += l_PosDiff.m_X;
|
||||
l_targetPos.m_Y += l_PosDiff.m_Y;
|
||||
@@ -114,7 +114,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
// instead of position interpolation we checkout the time difference
|
||||
if (abs(l_TimeDiff) > 2)
|
||||
{
|
||||
WARNING_LOG() << "l_TimeDiff differs by more that 2 s ! m_Time = "
|
||||
WARNING_LOG(m_logger) << "l_TimeDiff differs by more that 2 s ! m_Time = "
|
||||
<< m_Time << " l_TargetPosTime = " << l_TargetPosTime
|
||||
;
|
||||
}
|
||||
@@ -123,30 +123,30 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
N_Types::Polar3 l_LinePolar = l_LineVector.getPolar3();
|
||||
N_Types::Angle3 l_LineAngle(l_LinePolar.m_Azimuth, l_LinePolar.m_Elevation, 0);
|
||||
|
||||
INFO_LOG() << "Line of sight angle to air target : " << l_LineAngle;
|
||||
INFO_LOG(m_logger) << "Line of sight angle to air target : " << l_LineAngle;
|
||||
|
||||
N_Types::Radian64 l_AzimuthDiff = fabs(l_sensorAngle.m_H - l_LineAngle.m_H);
|
||||
DEBUG_LOG() << "l_AzimuthDiff=" << l_AzimuthDiff
|
||||
DEBUG_LOG(m_logger) << "l_AzimuthDiff=" << l_AzimuthDiff
|
||||
<< " l_sensorAngle.m_H=" << l_sensorAngle.m_H
|
||||
<< " l_LineAngle.m_H=" << l_LineAngle.m_H;
|
||||
N_Types::Radian64 l_ElevationDiff = fabs(l_sensorAngle.m_P - l_LineAngle.m_P);
|
||||
|
||||
INFO_LOG() << "l_AzimuthDiff : "
|
||||
INFO_LOG(m_logger) << "l_AzimuthDiff : "
|
||||
<< l_AzimuthDiff.getDegree() << " [Grad] "
|
||||
<< l_AzimuthDiff << " [rad] ";
|
||||
INFO_LOG() << "l_AzimuthWindow : "
|
||||
INFO_LOG(m_logger) << "l_AzimuthWindow : "
|
||||
<< l_AzimuthWindow.getDegree() << " [Grad] "
|
||||
<< l_AzimuthWindow << " [rad] ";
|
||||
INFO_LOG() << "l_ElevationDiff : "
|
||||
INFO_LOG(m_logger) << "l_ElevationDiff : "
|
||||
<< l_ElevationDiff.getDegree() << " [Grad] "
|
||||
<< l_ElevationDiff << " [rad] ";
|
||||
INFO_LOG() << "l_ElevationWindow : "
|
||||
INFO_LOG(m_logger) << "l_ElevationWindow : "
|
||||
<< l_ElevationWindow.getDegree() << " [Grad] "
|
||||
<< l_ElevationWindow << " [rad] ";
|
||||
|
||||
if (fabs(l_AzimuthDiff) > l_AzimuthWindow || fabs(l_ElevationDiff) > l_ElevationWindow)
|
||||
{
|
||||
INFO_LOG() << "-> air target " << l_Target->m_PlayerID
|
||||
INFO_LOG(m_logger) << "-> air target " << l_Target->m_PlayerID
|
||||
<< " is NOT in window"
|
||||
<< " fabs(l_AzimuthDiff)=" << fabs(l_AzimuthDiff)
|
||||
<< " l_AzimuthWindow=" << l_AzimuthWindow
|
||||
@@ -160,7 +160,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
|
||||
if (l_TimeOfFlight > l_TimeRange)
|
||||
{
|
||||
INFO_LOG() << "-> Target flight time " << l_TimeOfFlight
|
||||
INFO_LOG(m_logger) << "-> Target flight time " << l_TimeOfFlight
|
||||
<< " exceeding max time of " << l_TimeRange
|
||||
;
|
||||
continue;
|
||||
@@ -168,7 +168,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
|
||||
if (l_ClosestPlayerId == 0) // as long as no reference
|
||||
{
|
||||
INFO_LOG() << "=> air target " << l_Target->m_PlayerID
|
||||
INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID
|
||||
<< " is in window";
|
||||
l_ClosestAzimuth = l_AzimuthDiff;
|
||||
l_ClosestElevation = l_ElevationDiff;
|
||||
@@ -182,7 +182,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
{
|
||||
if (l_TargetDistance < l_ClosestPlayerDistance)
|
||||
{
|
||||
INFO_LOG() << "=> air target " << l_Target->m_PlayerID
|
||||
INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID
|
||||
<< " is in window";
|
||||
l_ClosestAzimuth = l_AzimuthDiff;
|
||||
l_ClosestElevation = l_ElevationDiff;
|
||||
@@ -192,7 +192,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "=> air target " << l_Target->m_PlayerID
|
||||
INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID
|
||||
<< " is in window, but ID " << l_ClosestPlayerId
|
||||
<< " is closer";
|
||||
}
|
||||
@@ -202,16 +202,16 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth,
|
||||
|
||||
if (l_ClosestPlayerId == 0)
|
||||
{
|
||||
INFO_LOG() << "No air target was within window...";
|
||||
INFO_LOG(m_logger) << "No air target was within window...";
|
||||
return false;
|
||||
}
|
||||
|
||||
a_playerId = l_ClosestPlayerId;
|
||||
a_impactTime = l_ClosestPlayerImpactTime;
|
||||
|
||||
INFO_LOG() << "a_impactTime = " << a_impactTime;
|
||||
INFO_LOG() << "l_TimeOfFlight = " << a_impactTime - m_Time;
|
||||
INFO_LOG() << "Closest air target in window: " << a_playerId;
|
||||
INFO_LOG(m_logger) << "a_impactTime = " << a_impactTime;
|
||||
INFO_LOG(m_logger) << "l_TimeOfFlight = " << a_impactTime - m_Time;
|
||||
INFO_LOG(m_logger) << "Closest air target in window: " << a_playerId;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -225,11 +225,11 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
{
|
||||
if (m_List->size() == 0)
|
||||
{
|
||||
ERROR_LOG() << "No air targets to track, strange at this point!";
|
||||
ERROR_LOG(m_logger) << "No air targets to track, strange at this point!";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "Searching for air target, Count : " << m_List->size();
|
||||
INFO_LOG(m_logger) << "Searching for air target, Count : " << m_List->size();
|
||||
GeoPairingImplAirTarget *l_HitTarget = nullptr;
|
||||
|
||||
for (const auto l_Target : *m_List)
|
||||
@@ -243,7 +243,7 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
|
||||
if (l_HitTarget == nullptr)
|
||||
{
|
||||
ERROR_LOG() << "No air targets found with ID " << a_targetId;
|
||||
ERROR_LOG(m_logger) << "No air targets found with ID " << a_targetId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -252,11 +252,11 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
N_Types::Vec3 l_Line = l_targetPos - m_Position;
|
||||
|
||||
Float64 l_OriginalDistance = l_Line.magnitude();
|
||||
INFO_LOG() << "l_OriginalDistance = " << l_OriginalDistance;
|
||||
INFO_LOG(m_logger) << "l_OriginalDistance = " << l_OriginalDistance;
|
||||
|
||||
l_Line = (l_TargetDir + l_targetPos) - m_Position;
|
||||
Float64 l_DirectionDistance = l_Line.magnitude();
|
||||
INFO_LOG() << "l_DirectionDistance = " << l_DirectionDistance;
|
||||
INFO_LOG(m_logger) << "l_DirectionDistance = " << l_DirectionDistance;
|
||||
|
||||
|
||||
const bool l_FliesTowardsMe = l_DirectionDistance < l_OriginalDistance;
|
||||
@@ -273,14 +273,14 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
|
||||
if (l_OriginalDistance > l_DistanceRange)
|
||||
{
|
||||
INFO_LOG() << "--> Target " << a_targetId << " distance "
|
||||
INFO_LOG(m_logger) << "--> Target " << a_targetId << " distance "
|
||||
<< l_OriginalDistance << " beyond max distance of "
|
||||
<< l_DistanceRange;
|
||||
return false;
|
||||
}
|
||||
if (l_targetPos.m_Z > l_FlightHeightMax)
|
||||
{
|
||||
INFO_LOG() << "--> Target " << a_targetId << " flying on height = "
|
||||
INFO_LOG(m_logger) << "--> Target " << a_targetId << " flying on height = "
|
||||
<< l_targetPos.m_Z << ", max Height for IGLA is "
|
||||
<< l_FlightHeightMax;
|
||||
return false;
|
||||
@@ -289,44 +289,44 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
Float64 l_Probability = l_ModeAutoProbability;
|
||||
if (!a_modeAuto)
|
||||
l_Probability = l_ModeManuProbability;
|
||||
INFO_LOG() << "Basic Probability = " << l_Probability
|
||||
INFO_LOG(m_logger) << "Basic Probability = " << l_Probability
|
||||
<< (a_modeAuto ? " (auto)" : " (manual)");
|
||||
|
||||
/* if (l_FliesTowardsMe == a_changeOverPoint)
|
||||
{
|
||||
INFO_LOG() << "Wrong COP Factor applied";
|
||||
INFO_LOG(m_logger) << "Wrong COP Factor applied";
|
||||
l_Probability *= l_WrongCOPFactor;
|
||||
}
|
||||
*/
|
||||
|
||||
if (a_changeOverPoint)
|
||||
INFO_LOG() << "Depart Button pressed";
|
||||
INFO_LOG(m_logger) << "Depart Button pressed";
|
||||
else
|
||||
INFO_LOG() << "Depart Button released";
|
||||
INFO_LOG(m_logger) << "Depart Button released";
|
||||
|
||||
INFO_LOG() << "l_FliesTowardsMe = " << l_FliesTowardsMe;
|
||||
INFO_LOG(m_logger) << "l_FliesTowardsMe = " << l_FliesTowardsMe;
|
||||
// Wenn der Depart Button nicht gedrueckt ist, und das Ziel vom Schuetzen wegfliegt.
|
||||
if (!l_FliesTowardsMe && !a_changeOverPoint)
|
||||
{
|
||||
INFO_LOG() << "Wrong COP Factor applied";
|
||||
INFO_LOG(m_logger) << "Wrong COP Factor applied";
|
||||
l_Probability *= l_WrongCOPFactor;
|
||||
}
|
||||
|
||||
if (l_HitTarget->m_IRJammer)
|
||||
{
|
||||
INFO_LOG() << "IR Jammer Factor applied";
|
||||
INFO_LOG(m_logger) << "IR Jammer Factor applied";
|
||||
l_Probability *= l_IRJammerFactor;
|
||||
}
|
||||
|
||||
Float64 l_Random = (rand() % 100) / 100.0;
|
||||
if (l_Random > l_Probability)
|
||||
{
|
||||
INFO_LOG() << "--> Target " << a_targetId << " not hit, Probability = "
|
||||
INFO_LOG(m_logger) << "--> Target " << a_targetId << " not hit, Probability = "
|
||||
<< l_Probability << ", Randomizer = " << l_Random;
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "==> Target " << a_targetId << " hit, Probability = "
|
||||
INFO_LOG(m_logger) << "==> Target " << a_targetId << " hit, Probability = "
|
||||
<< l_Probability << ", Randomizer = " << l_Random;
|
||||
return true;
|
||||
}
|
||||
@@ -337,7 +337,7 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId,
|
||||
void GeoPairingImplAirTargetTracker::setTime(UInt64 a_time)
|
||||
{
|
||||
m_Time = a_time;
|
||||
INFO_LOG() << "Set new tracker reference time : " << m_Time;
|
||||
INFO_LOG(m_logger) << "Set new tracker reference time : " << m_Time;
|
||||
}
|
||||
|
||||
} // namespace N_GeoPairingImpl
|
||||
+3
-3
@@ -21,7 +21,7 @@ namespace N_GeoPairingImpl
|
||||
|
||||
GeoPairingImplAirTargetUpdater::~GeoPairingImplAirTargetUpdater()
|
||||
{
|
||||
INFO_LOG() << "Number of updated air targets : " << m_UpdateCount;
|
||||
INFO_LOG(m_logger) << "Number of updated air targets : " << m_UpdateCount;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ GeoPairingImplAirTargetUpdater::GeoPairingImplAirTargetUpdater(std::vector<GeoPa
|
||||
: m_List(a_listTargets)
|
||||
, m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplAirTargetUpdater"))
|
||||
{
|
||||
INFO_LOG() << "Construct Updater for " << a_listTargets->size()
|
||||
INFO_LOG(m_logger) << "Construct Updater for " << a_listTargets->size()
|
||||
<< " air targets";
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void GeoPairingImplAirTargetUpdater::update(SInt32 a_playerID, Float64 a_positio
|
||||
// create new air target
|
||||
if (l_PlayerAirTarget == nullptr)
|
||||
{
|
||||
INFO_LOG() << "Creating a new air target object for Player "
|
||||
INFO_LOG(m_logger) << "Creating a new air target object for Player "
|
||||
<< a_playerID;
|
||||
l_PlayerAirTarget = new GeoPairingImplAirTarget(a_playerID);
|
||||
m_List->push_back(l_PlayerAirTarget);
|
||||
|
||||
+60
-60
@@ -90,21 +90,21 @@ GeoPairingImplFiredBullet::GeoPairingImplFiredBullet(const GeoPairingImplSensorD
|
||||
: m_SensorData(a_sensorData)
|
||||
, m_logger(CesGeoPairing::getLogger(loggerName ? loggerName : "Plugin.GeoPairing.GeoPairingImplFiredBullet"))
|
||||
{
|
||||
INFO_LOG() << "---------- Setting Sensor Data ------------";
|
||||
INFO_LOG() << "WeaponPositionLat : " << m_SensorData.WeaponPositionLat;
|
||||
INFO_LOG() << "WeaponPositionLong : " << m_SensorData.WeaponPositionLong;
|
||||
INFO_LOG() << "WeaponPositionHeight : " << m_SensorData.WeaponPositionHeight;
|
||||
INFO_LOG() << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponAzimuthMin : " << m_SensorData.WeaponAzimuthMin << " (" << m_SensorData.WeaponAzimuthMin.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponAzimuthMax : " << m_SensorData.WeaponAzimuthMax << " (" << m_SensorData.WeaponAzimuthMax.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponElevationMin : " << m_SensorData.WeaponElevationMin << " (" << m_SensorData.WeaponElevationMin.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponElevationMax : " << m_SensorData.WeaponElevationMax << " (" << m_SensorData.WeaponElevationMax.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponTemperature : " << m_SensorData.WeaponTemperature;
|
||||
INFO_LOG() << "AmmunitionType : " << m_SensorData.AmmunitionType;
|
||||
INFO_LOG() << "ChargeType : " << m_SensorData.ChargeType;
|
||||
INFO_LOG() << "IgnitionType : " << m_SensorData.IgnitionType;
|
||||
INFO_LOG() << "FireTime : " << m_SensorData.FireTime;
|
||||
INFO_LOG(m_logger) << "---------- Setting Sensor Data ------------";
|
||||
INFO_LOG(m_logger) << "WeaponPositionLat : " << m_SensorData.WeaponPositionLat;
|
||||
INFO_LOG(m_logger) << "WeaponPositionLong : " << m_SensorData.WeaponPositionLong;
|
||||
INFO_LOG(m_logger) << "WeaponPositionHeight : " << m_SensorData.WeaponPositionHeight;
|
||||
INFO_LOG(m_logger) << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponAzimuthMin : " << m_SensorData.WeaponAzimuthMin << " (" << m_SensorData.WeaponAzimuthMin.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponAzimuthMax : " << m_SensorData.WeaponAzimuthMax << " (" << m_SensorData.WeaponAzimuthMax.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponElevationMin : " << m_SensorData.WeaponElevationMin << " (" << m_SensorData.WeaponElevationMin.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponElevationMax : " << m_SensorData.WeaponElevationMax << " (" << m_SensorData.WeaponElevationMax.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponTemperature : " << m_SensorData.WeaponTemperature;
|
||||
INFO_LOG(m_logger) << "AmmunitionType : " << m_SensorData.AmmunitionType;
|
||||
INFO_LOG(m_logger) << "ChargeType : " << m_SensorData.ChargeType;
|
||||
INFO_LOG(m_logger) << "IgnitionType : " << m_SensorData.IgnitionType;
|
||||
INFO_LOG(m_logger) << "FireTime : " << m_SensorData.FireTime;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
@@ -115,7 +115,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con
|
||||
{
|
||||
Q_UNUSED(ballisticService) // why?
|
||||
|
||||
INFO_LOG() << "----------- Calculating Impact -----------";
|
||||
INFO_LOG(m_logger) << "----------- Calculating Impact -----------";
|
||||
|
||||
N_Math::GeoCoord o_sensorUtm;
|
||||
|
||||
@@ -126,7 +126,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con
|
||||
N_Types::Coord3 o_sensorPos(o_sensorUtm.utmEasting(),
|
||||
o_sensorUtm.utmNorthing(),
|
||||
o_sensorUtm.height());
|
||||
INFO_LOG() << "o_sensorPos : " << o_sensorPos;
|
||||
INFO_LOG(m_logger) << "o_sensorPos : " << o_sensorPos;
|
||||
|
||||
GeoPairingImplTrajectoryData::TrajectoryPoint tpSensor;
|
||||
tpSensor.m_X = o_sensorPos.m_X;
|
||||
@@ -138,18 +138,18 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con
|
||||
N_Types::Angle3 o_sensorAngle(m_SensorData.WeaponAzimuth,
|
||||
m_SensorData.WeaponElevation,
|
||||
0);
|
||||
INFO_LOG() << "o_sensorAngle : " << o_sensorAngle;
|
||||
INFO_LOG(m_logger) << "o_sensorAngle : " << o_sensorAngle;
|
||||
|
||||
// calculate a faked shot
|
||||
Float64 d_shootingDistance = 500.0 + (m_SensorData.AmmunitionType * 200) ;
|
||||
INFO_LOG() << "d_shootingDistance : " << d_shootingDistance;
|
||||
INFO_LOG(m_logger) << "d_shootingDistance : " << d_shootingDistance;
|
||||
|
||||
N_Types::Coord3 o_shot(0, d_shootingDistance, 0);
|
||||
INFO_LOG() << "o_shot : " << o_shot;
|
||||
INFO_LOG(m_logger) << "o_shot : " << o_shot;
|
||||
o_shot = o_shot.rotate(o_sensorAngle);
|
||||
o_sensorPos += o_shot;
|
||||
INFO_LOG() << "o_shot : " << o_shot;
|
||||
INFO_LOG() << "impact : " << o_sensorPos;
|
||||
INFO_LOG(m_logger) << "o_shot : " << o_shot;
|
||||
INFO_LOG(m_logger) << "impact : " << o_sensorPos;
|
||||
|
||||
N_Math::GeoCoord o_impactUtm;
|
||||
o_impactUtm.setTotalUtmPosition(o_sensorPos.m_X, o_sensorPos.m_Y, o_sensorPos.m_Z,
|
||||
@@ -165,7 +165,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con
|
||||
if (m_logger.isInfoEnabled())
|
||||
{
|
||||
for (const auto &tp : m_TrajectoryData.m_Points)
|
||||
INFO_LOG() << tp.m_X << " " << tp.m_Y << " " << tp.m_Z << " " << tp.m_H;
|
||||
INFO_LOG(m_logger) << tp.m_X << " " << tp.m_Y << " " << tp.m_Z << " " << tp.m_H;
|
||||
}
|
||||
|
||||
m_ImpactData.AmmunitionType = m_SensorData.AmmunitionType;
|
||||
@@ -181,7 +181,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6
|
||||
double drift,
|
||||
double flugzeit)
|
||||
{
|
||||
INFO_LOG() << "----------- Calculating Impact -----------";
|
||||
INFO_LOG(m_logger) << "----------- Calculating Impact -----------";
|
||||
|
||||
|
||||
Float64 xOutMgrs = 0.0;
|
||||
@@ -207,7 +207,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6
|
||||
xOutMgrs += xOut;
|
||||
yOutMgrs += yOut;
|
||||
LtsCoordTrans::UtmCoordinate tm2(utm.zone, xOutMgrs, yOutMgrs );
|
||||
INFO_LOG() << "NEW POS " << tm2.geographic().x() << " " << tm2.geographic().y() ;
|
||||
INFO_LOG(m_logger) << "NEW POS " << tm2.geographic().x() << " " << tm2.geographic().y() ;
|
||||
|
||||
//LtsCoordTrans::MGRS2LonLat(xOutMgrs, yOutMgrs, xOutLon, yOutLat);
|
||||
LtsCoordTrans::geocentric2LonLatAlt(xOutMgrs, yOutMgrs, 0.0, xOutLon, yOutLat, zOutAlt);
|
||||
@@ -218,7 +218,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6
|
||||
m_ImpactData.ImpactPositionLong = tm2.geographic().x() * (180 / M_PI);
|
||||
m_ImpactData.ImpactPositionHeight = 0;
|
||||
|
||||
INFO_LOG() << "m_SensorData.WeaponPositionLong=" << m_SensorData.WeaponPositionLong
|
||||
INFO_LOG(m_logger) << "m_SensorData.WeaponPositionLong=" << m_SensorData.WeaponPositionLong
|
||||
<< " m_SensorData.WeaponPositionLat=" << m_SensorData.WeaponPositionLat
|
||||
<< "\n entfernung=" << entfernung
|
||||
<< "\n utm.x=" << utm.x
|
||||
@@ -245,7 +245,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
double &a_lengthField, double &a_duration,
|
||||
double &a_heading)
|
||||
{
|
||||
INFO_LOG() << "----------- Calculating Salve -----------";
|
||||
INFO_LOG(m_logger) << "----------- Calculating Salve -----------";
|
||||
|
||||
if (a_nbrRounds < 1)
|
||||
return GeoPairingImplFiredBullet::e_OUTOFRANGE;
|
||||
@@ -259,7 +259,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
N_Types::Coord3 l_sensorPos(l_sensorUtm.utmEasting(),
|
||||
l_sensorUtm.utmNorthing(),
|
||||
l_sensorUtm.height());
|
||||
INFO_LOG() << "l_sensorPos : " << l_sensorPos;
|
||||
INFO_LOG(m_logger) << "l_sensorPos : " << l_sensorPos;
|
||||
|
||||
Float64 l_TopPos = 0, l_BottomPos = 0, l_LeftPos = 0, l_RightPos = 0, l_BelowPos = 0, l_AbovePos = 0;
|
||||
|
||||
@@ -272,7 +272,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
|
||||
for (int i = 0; i < a_nbrRounds; i++)
|
||||
{
|
||||
INFO_LOG() << "========== Calculating Round " << i + 1 << " of " << a_nbrRounds << " =============";
|
||||
INFO_LOG(m_logger) << "========== Calculating Round " << i + 1 << " of " << a_nbrRounds << " =============";
|
||||
prepareSensorData();
|
||||
|
||||
if (calculate( ballisticService) != e_OK)
|
||||
@@ -287,7 +287,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
l_impactUtm.utmNorthing(),
|
||||
l_impactUtm.height());
|
||||
|
||||
INFO_LOG() << "l_impactPos : " << l_impactPos;
|
||||
INFO_LOG(m_logger) << "l_impactPos : " << l_impactPos;
|
||||
|
||||
l_avgImpactPos += l_impactPos;
|
||||
l_avgImpactCount++;
|
||||
@@ -314,18 +314,18 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
}
|
||||
}
|
||||
|
||||
INFO_LOG() << "========== Summarize Impact Data ==========";
|
||||
INFO_LOG(m_logger) << "========== Summarize Impact Data ==========";
|
||||
|
||||
a_widthField = l_RightPos - l_LeftPos;
|
||||
a_lengthField = l_TopPos - l_BottomPos;
|
||||
|
||||
INFO_LOG() << "a_widthField = " << a_widthField;
|
||||
INFO_LOG() << "a_lengthField = " << a_lengthField;
|
||||
INFO_LOG(m_logger) << "a_widthField = " << a_widthField;
|
||||
INFO_LOG(m_logger) << "a_lengthField = " << a_lengthField;
|
||||
|
||||
// calculate average impact pos for this salve
|
||||
N_Types::Coord3 l_ImpactPos = l_avgImpactPos / std::max(1, l_avgImpactCount);
|
||||
|
||||
INFO_LOG() << "l_ImpactPos (Avg) : " << l_ImpactPos;
|
||||
INFO_LOG(m_logger) << "l_ImpactPos (Avg) : " << l_ImpactPos;
|
||||
|
||||
N_Math::GeoCoord l_impactUtm;
|
||||
l_impactUtm.setTotalUtmPosition(l_ImpactPos.m_X, l_ImpactPos.m_Y, l_ImpactPos.m_Z,
|
||||
@@ -344,10 +344,10 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
Float64 l_RoundsPerMinute = l_config->getFloat(s_MK19, s_RoundsPerMinute, 350);
|
||||
|
||||
a_duration = 60 * a_nbrRounds / l_RoundsPerMinute;
|
||||
INFO_LOG() << "a_duration = " << a_duration;
|
||||
INFO_LOG(m_logger) << "a_duration = " << a_duration;
|
||||
|
||||
Float64 l_Distance = l_ImpactPos.length(l_sensorPos);
|
||||
INFO_LOG() << "l_Distance = " << l_Distance;
|
||||
INFO_LOG(m_logger) << "l_Distance = " << l_Distance;
|
||||
|
||||
N_Types::Radian64 l_AvgHeading = m_SensorData.WeaponAzimuthMax - m_SensorData.WeaponAzimuthMin;
|
||||
l_AvgHeading /= 2.0;
|
||||
@@ -355,7 +355,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv
|
||||
l_AvgHeading += M_PI_2; // rotate 90deg from east
|
||||
|
||||
a_heading = l_AvgHeading.getZeroTo360();
|
||||
INFO_LOG() << "a_heading [deg ] = " << a_heading;
|
||||
INFO_LOG(m_logger) << "a_heading [deg ] = " << a_heading;
|
||||
|
||||
|
||||
return e_OK;
|
||||
@@ -369,16 +369,16 @@ GeoPairingImplImpactData *GeoPairingImplFiredBullet::getImpactData()
|
||||
{
|
||||
if (m_ImpactData.ImpactTime == 0)
|
||||
{
|
||||
ERROR_LOG() << "Impact Data not yet calculated";
|
||||
ERROR_LOG(m_logger) << "Impact Data not yet calculated";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
INFO_LOG() << "---------- Getting Impact Data ------------";
|
||||
INFO_LOG() << "ImpactPositionLat : " << m_ImpactData.ImpactPositionLat;
|
||||
INFO_LOG() << "ImpactPositionLong : " << m_ImpactData.ImpactPositionLong;
|
||||
INFO_LOG() << "ImpactPositionHeight : " << m_ImpactData.ImpactPositionHeight;
|
||||
INFO_LOG() << "ImpactTime : " << m_ImpactData.ImpactTime;
|
||||
INFO_LOG() << "AmmunitionType : " << m_ImpactData.AmmunitionType;
|
||||
INFO_LOG(m_logger) << "---------- Getting Impact Data ------------";
|
||||
INFO_LOG(m_logger) << "ImpactPositionLat : " << m_ImpactData.ImpactPositionLat;
|
||||
INFO_LOG(m_logger) << "ImpactPositionLong : " << m_ImpactData.ImpactPositionLong;
|
||||
INFO_LOG(m_logger) << "ImpactPositionHeight : " << m_ImpactData.ImpactPositionHeight;
|
||||
INFO_LOG(m_logger) << "ImpactTime : " << m_ImpactData.ImpactTime;
|
||||
INFO_LOG(m_logger) << "AmmunitionType : " << m_ImpactData.AmmunitionType;
|
||||
|
||||
return &m_ImpactData;
|
||||
}
|
||||
@@ -391,7 +391,7 @@ GeoPairingImplTrajectoryData *GeoPairingImplFiredBullet::getTrajectoryData()
|
||||
{
|
||||
if (m_ImpactData.ImpactTime == 0)
|
||||
{
|
||||
ERROR_LOG() << "Impact Data not yet calculated";
|
||||
ERROR_LOG(m_logger) << "Impact Data not yet calculated";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -406,11 +406,11 @@ void GeoPairingImplFiredBullet::setMeteoData(const GeoPairingImplMeteoData &a_me
|
||||
{
|
||||
m_MeteoData = a_meteoData;
|
||||
|
||||
INFO_LOG() << "---------- Setting Meteo Data ------------";
|
||||
INFO_LOG() << "AirPressure : " << m_MeteoData.AirPressure;
|
||||
INFO_LOG() << "Temperature : " << m_MeteoData.Temperature;
|
||||
INFO_LOG() << "WindDirection : " << m_MeteoData.WindDirection;
|
||||
INFO_LOG() << "WindSpeed : " << m_MeteoData.WindSpeed;
|
||||
INFO_LOG(m_logger) << "---------- Setting Meteo Data ------------";
|
||||
INFO_LOG(m_logger) << "AirPressure : " << m_MeteoData.AirPressure;
|
||||
INFO_LOG(m_logger) << "Temperature : " << m_MeteoData.Temperature;
|
||||
INFO_LOG(m_logger) << "WindDirection : " << m_MeteoData.WindDirection;
|
||||
INFO_LOG(m_logger) << "WindSpeed : " << m_MeteoData.WindSpeed;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
@@ -422,22 +422,22 @@ void GeoPairingImplFiredBullet::prepareSensorData()
|
||||
if (!m_SensorData.UseMinMax)
|
||||
return;
|
||||
|
||||
INFO_LOG() << "----------- Prepare Sensor Angles -----------";
|
||||
INFO_LOG(m_logger) << "----------- Prepare Sensor Angles -----------";
|
||||
|
||||
N_Types::Radian64 l_AzimuthMin = m_SensorData.WeaponAzimuthMin;
|
||||
N_Types::Radian64 l_AzimuthMax = m_SensorData.WeaponAzimuthMax;
|
||||
|
||||
INFO_LOG() << "WeaponAzimuthMin [deg] = " << m_SensorData.WeaponAzimuthMin.getDegree();
|
||||
INFO_LOG() << "WeaponAzimuthMax [deg] = " << m_SensorData.WeaponAzimuthMax.getDegree();
|
||||
INFO_LOG() << "WeaponElevationMin [deg] = " << m_SensorData.WeaponElevationMin.getDegree();
|
||||
INFO_LOG() << "WeaponElevationMax [deg] = " << m_SensorData.WeaponElevationMax.getDegree();
|
||||
INFO_LOG(m_logger) << "WeaponAzimuthMin [deg] = " << m_SensorData.WeaponAzimuthMin.getDegree();
|
||||
INFO_LOG(m_logger) << "WeaponAzimuthMax [deg] = " << m_SensorData.WeaponAzimuthMax.getDegree();
|
||||
INFO_LOG(m_logger) << "WeaponElevationMin [deg] = " << m_SensorData.WeaponElevationMin.getDegree();
|
||||
INFO_LOG(m_logger) << "WeaponElevationMax [deg] = " << m_SensorData.WeaponElevationMax.getDegree();
|
||||
|
||||
N_Types::Radian64 l_AzimuthDelta = fabs(l_AzimuthMax - l_AzimuthMin);
|
||||
|
||||
// test the +/- 180 deg limit case
|
||||
if (l_AzimuthDelta > M_PI)
|
||||
{
|
||||
INFO_LOG() << "Take short circle path";
|
||||
INFO_LOG(m_logger) << "Take short circle path";
|
||||
l_AzimuthDelta -= M_PI;
|
||||
}
|
||||
|
||||
@@ -447,10 +447,10 @@ void GeoPairingImplFiredBullet::prepareSensorData()
|
||||
m_SensorData.WeaponElevation = m_SensorData.WeaponElevationMin + (drand48() * l_DeltaElevation);
|
||||
m_SensorData.WeaponAzimuth = m_SensorData.WeaponAzimuthMin + (drand48() * l_DeltaAzimuth);
|
||||
|
||||
INFO_LOG() << "l_DeltaElevation : " << l_DeltaElevation << " (" << l_DeltaElevation.getDegree() << ")";
|
||||
INFO_LOG() << "l_DeltaAzimuth : " << l_DeltaAzimuth << " (" << l_DeltaAzimuth.getDegree() << ")";
|
||||
INFO_LOG() << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ;
|
||||
INFO_LOG() << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")";
|
||||
INFO_LOG(m_logger) << "l_DeltaElevation : " << l_DeltaElevation << " (" << l_DeltaElevation.getDegree() << ")";
|
||||
INFO_LOG(m_logger) << "l_DeltaAzimuth : " << l_DeltaAzimuth << " (" << l_DeltaAzimuth.getDegree() << ")";
|
||||
INFO_LOG(m_logger) << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ;
|
||||
INFO_LOG(m_logger) << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")";
|
||||
|
||||
}
|
||||
|
||||
|
||||
+43
-43
@@ -53,38 +53,38 @@ HandlerGeoPairing::HandlerGeoPairing(const std::shared_ptr<CentralEffectSimulati
|
||||
ftcTab->enableSendCesHit();
|
||||
|
||||
connect(m_timer, &QTimer::timeout, this, &HandlerGeoPairing::sendFtcCesHitRequestTimeout);
|
||||
INFO_LOG() << "configPath = " << m_ballisticService->getConfigPath();
|
||||
INFO_LOG() << "configFile = " << m_ballisticService->getConfigFile();
|
||||
INFO_LOG() << "ammunitionFile = " << m_ballisticService->getAmmunitionFile();
|
||||
INFO_LOG(m_logger) << "configPath = " << m_ballisticService->getConfigPath();
|
||||
INFO_LOG(m_logger) << "configFile = " << m_ballisticService->getConfigFile();
|
||||
INFO_LOG(m_logger) << "ammunitionFile = " << m_ballisticService->getAmmunitionFile();
|
||||
|
||||
const QString s_configFile = Settings::cesGeopairingIniPath() + QStringLiteral("/") + Settings::cesGeopairingIniFile();
|
||||
INFO_LOG() << "GeoPairing Config location : " << s_configFile;
|
||||
INFO_LOG(m_logger) << "GeoPairing Config location : " << s_configFile;
|
||||
|
||||
N_GeoPairingImpl::GeoPairingImpl *l_impl = new N_GeoPairingImpl::GeoPairingImplDted;
|
||||
INFO_LOG() << "--> Installing GeoPairingImplDted...";
|
||||
INFO_LOG(m_logger) << "--> Installing GeoPairingImplDted...";
|
||||
N_GeoPairingImpl::GeoPairingImplFactory::setImpl(l_impl);
|
||||
|
||||
// initialize the GeoPairing implementation
|
||||
if (!N_GeoPairingImpl::GeoPairingImplFactory::initialize(Settings::cesGeopairingIniPath()))
|
||||
{
|
||||
ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!";
|
||||
ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!";
|
||||
|
||||
l_impl = new N_GeoPairingImpl::GeoPairingImplBalistic();
|
||||
INFO_LOG() << "--> Installing GeoPairingImplBalistic...";
|
||||
INFO_LOG(m_logger) << "--> Installing GeoPairingImplBalistic...";
|
||||
N_GeoPairingImpl::GeoPairingImplFactory::setImpl(l_impl);
|
||||
if (!N_GeoPairingImpl::GeoPairingImplFactory::initialize(s_configFile))
|
||||
{
|
||||
ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!";
|
||||
ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!";
|
||||
abort();
|
||||
}
|
||||
else
|
||||
INFO_LOG() << "GeoPairingImplBalistic correctly initialized";
|
||||
INFO_LOG(m_logger) << "GeoPairingImplBalistic correctly initialized";
|
||||
}
|
||||
else
|
||||
INFO_LOG() << "GeoPairingImplDted correctly initialized";
|
||||
INFO_LOG(m_logger) << "GeoPairingImplDted correctly initialized";
|
||||
|
||||
|
||||
INFO_LOG() << "Initialization finished";
|
||||
INFO_LOG(m_logger) << "Initialization finished";
|
||||
|
||||
} // end of ctor()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -96,7 +96,7 @@ HandlerGeoPairing::~HandlerGeoPairing()
|
||||
|
||||
bool HandlerGeoPairing::init()
|
||||
{
|
||||
DEBUG_LOG() << "init";
|
||||
DEBUG_LOG(m_logger) << "init";
|
||||
auto dtcTab = m_ddsHandlerAes->dtcTab();
|
||||
auto dtcMdm = m_ddsHandlerAes->dtcMdm();
|
||||
|
||||
@@ -111,12 +111,12 @@ bool HandlerGeoPairing::init()
|
||||
// create GeoConfig for this process && initFilename, just one time, just here
|
||||
GeoConfig *o_config = GeoConfig::getInstance();
|
||||
const QString &fileName = Settings::cesGeopairingIniPath() + QStringLiteral("/") + Settings::cesGeopairingIniFile();
|
||||
DEBUG_LOG() << "fileName= " << fileName;
|
||||
DEBUG_LOG(m_logger) << "fileName= " << fileName;
|
||||
if (!o_config || !o_config->initFilename(fileName))
|
||||
{
|
||||
// Fehlerfall:
|
||||
const QFileInfo qFileInfo(fileName);
|
||||
ERROR_LOG() << Q_FUNC_INFO << " initFilename failed: '" << qFileInfo.absoluteFilePath() << "'";
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " initFilename failed: '" << qFileInfo.absoluteFilePath() << "'";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ bool HandlerGeoPairing::init()
|
||||
|
||||
QString s_filter = o_config->getString(s_group, s_keyOfEntries, s_ammunition);
|
||||
|
||||
DEBUG_LOG() << "s_group=" << s_group
|
||||
DEBUG_LOG(m_logger) << "s_group=" << s_group
|
||||
<< " n_numberOfAmmunitions=" << n_numberOfAmmunitions
|
||||
<< " s_keyOfEntries=" << s_keyOfEntries
|
||||
<< " s_ammunition=" << s_ammunition
|
||||
@@ -139,7 +139,7 @@ bool HandlerGeoPairing::init()
|
||||
QString s_ammu_group = s_filter + QString::number(i + 1);
|
||||
QString s_unknown = QStringLiteral("<unknown>");
|
||||
QString s_ammu_value = o_config->getString(s_group, s_ammu_group, s_unknown);
|
||||
DEBUG_LOG() << "s_ammu_value=" << s_ammu_value
|
||||
DEBUG_LOG(m_logger) << "s_ammu_value=" << s_ammu_value
|
||||
<< " s_group=" << s_group
|
||||
<< " s_ammu_group=" << s_ammu_group;
|
||||
}
|
||||
@@ -151,33 +151,33 @@ bool HandlerGeoPairing::init()
|
||||
void HandlerGeoPairing::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerGeoPairing::onSendCesHitInformationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send hit information on participant to training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send hit information on participant to training area: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendCesHitInformationReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerGeoPairing::onExplosionSingleModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send ExplosionSingleModify: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send ExplosionSingleModify: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onExplosionSingleModifyReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onExplosionSingleModifyReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerGeoPairing::onExplosionAreaModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send ExplosionAreaModify: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send ExplosionAreaModify: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onExplosionAreaModifyReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onExplosionAreaModifyReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
// ///////////////////////////////////
|
||||
@@ -187,13 +187,13 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "onMeteoDataChanged eRemoved";
|
||||
DEBUG_LOG(m_logger) << "onMeteoDataChanged eRemoved";
|
||||
return;
|
||||
}
|
||||
|
||||
m_meteoData = data;
|
||||
|
||||
DEBUG_LOG() << "Got onMeteoDataChanged "
|
||||
DEBUG_LOG(m_logger) << "Got onMeteoDataChanged "
|
||||
<< " id=" << m_meteoData.id()
|
||||
<< " windSpeed=" << m_meteoData.windSpeed()
|
||||
<< " windDirection=" << m_meteoData.windDirection()
|
||||
@@ -208,11 +208,11 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
//{
|
||||
// if (modType == DataModification::eRemoved)
|
||||
// {
|
||||
// DEBUG_LOG() << "onGeoPairingDataChanged eRemoved";
|
||||
// DEBUG_LOG(m_logger) << "onGeoPairingDataChanged eRemoved";
|
||||
// return;
|
||||
// }
|
||||
// m_geoPairingPtr = new GeoPairing(m_ballisticService);
|
||||
// DEBUG_LOG() << "Got onGeoPairingDataChanged "
|
||||
// DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged "
|
||||
// << " equipmentNumber=" << data.equipmentNumber()
|
||||
// << " position lat=" << data.position().lat()
|
||||
// << " lon=" << data.position().lon()
|
||||
@@ -236,7 +236,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
// while (i.hasNext())
|
||||
// {
|
||||
// i.next();
|
||||
// DEBUG_LOG() << i.key() << ": participantId=" << i.value().participantId()
|
||||
// DEBUG_LOG(m_logger) << i.key() << ": participantId=" << i.value().participantId()
|
||||
// << " participantTypeId= " << i.value().participantTypeId();
|
||||
// }
|
||||
|
||||
@@ -276,7 +276,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
|
||||
// if (areaFireToCtas.hit)
|
||||
// {
|
||||
// INFO_LOG() << "AreaFireToCtas"
|
||||
// INFO_LOG(m_logger) << "AreaFireToCtas"
|
||||
// << " playerId=" << areaFireToCtas.playerId
|
||||
// << " impactTime=" << areaFireToCtas.impactTime
|
||||
// << " duration=" << areaFireToCtas.duration
|
||||
@@ -319,7 +319,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
// if (fireToAircaft.hit)
|
||||
// {
|
||||
// TrainingAreaBase::SendCesHitInformation chi;
|
||||
// INFO_LOG() << "send CesHitInformation to Ctas "
|
||||
// INFO_LOG(m_logger) << "send CesHitInformation to Ctas "
|
||||
// << " equipmentNumberGunner: " << fireToAircaft.equipmentNumberGunner
|
||||
// << " participantIdTarget: " << fireToAircaft.participantIdTarget
|
||||
// << " impactTime: " << fireToAircaft.impactTime
|
||||
@@ -348,7 +348,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
// gpd.equipmentNumber(data.equipmentNumber());
|
||||
// gpd.participantId(participantId);
|
||||
// gpd.payload(LtsUtils::convert<std::vector<uint8_t>>(reportTarget.sendData));
|
||||
// INFO_LOG() << " send Geopairing-Data to Ctas"
|
||||
// INFO_LOG(m_logger) << " send Geopairing-Data to Ctas"
|
||||
// << " equipmentNumber: " << data.equipmentNumber()
|
||||
// << " playerId: " << reportTarget.playerId
|
||||
// << " participantId: " << participantId
|
||||
@@ -361,17 +361,17 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData
|
||||
|
||||
void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::GeopairingData &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "Got onGeoPairingDataChanged ";
|
||||
DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged ";
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "onGeoPairingDataChanged eRemoved";
|
||||
DEBUG_LOG(m_logger) << "onGeoPairingDataChanged eRemoved";
|
||||
return;
|
||||
}
|
||||
unsigned char msgType = 0xE3;
|
||||
|
||||
if (static_cast<unsigned char>(data.payload().at(0)) != msgType)
|
||||
{
|
||||
DEBUG_LOG() << "data.payload().at(0) != msgType";
|
||||
DEBUG_LOG(m_logger) << "data.payload().at(0) != msgType";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
v0 = Settings::moerserLoad_6();
|
||||
|
||||
|
||||
DEBUG_LOG() << "Got onGeoPairingDataChanged "
|
||||
DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged "
|
||||
<< "\nequipmentNumber=" << data.equipmentNumber()
|
||||
<< "\nposition lat=" << data.position().lat()
|
||||
<< "/" << data.position().lon()
|
||||
@@ -487,7 +487,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
//QPointF distVector = calculateDistVector ( rw, azimut/10.0);
|
||||
QPointF explosionPosUtm = calculateExplosionPosUtm(rw, azimut / 10.0, posUtm);
|
||||
|
||||
DEBUG_LOG() << "Result: rw=" << rw
|
||||
DEBUG_LOG(m_logger) << "Result: rw=" << rw
|
||||
<< " v0=" << v0
|
||||
<< "\n t1=" << t1
|
||||
<< "\n explosionPosUtm=" << explosionPosUtm.x() << "/" << explosionPosUtm.y();
|
||||
@@ -511,7 +511,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
explosionSingleModifyRequest.partyId(partyId);
|
||||
|
||||
|
||||
DEBUG_LOG() << "impactTime=" << data.sampleTime()
|
||||
DEBUG_LOG(m_logger) << "impactTime=" << data.sampleTime()
|
||||
<< " name=" << name
|
||||
<< " m_ddsHandler->currentPartitionTime=" << m_ddsHandlerAes->currentPartitionTime()
|
||||
<< " participantId=" << participantId << " " << participantId
|
||||
@@ -519,21 +519,21 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi
|
||||
|
||||
if (impactTime > m_ddsHandlerAes->currentPartitionTime())
|
||||
{
|
||||
DEBUG_LOG() << "Send explosionSingleModifyRequest";
|
||||
DEBUG_LOG(m_logger) << "Send explosionSingleModifyRequest";
|
||||
auto ftcAes = m_ddsHandlerAes->ftcAes();
|
||||
ftcAes->explosionSingleModifyRequest(explosionSingleModifyRequest, this);
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "NOT Send explosionSingleModifyRequest impactTime is in the past";
|
||||
DEBUG_LOG(m_logger) << "NOT Send explosionSingleModifyRequest impactTime is in the past";
|
||||
}
|
||||
|
||||
|
||||
void HandlerGeoPairing::onSendGeopairingDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send GeopPairing Data participant : " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send GeopPairing Data participant : " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendGeopairingDataReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendGeopairingDataReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerGeoPairing::sendFtcCesHitRequestTimeout()
|
||||
@@ -541,7 +541,7 @@ void HandlerGeoPairing::sendFtcCesHitRequestTimeout()
|
||||
auto ftcTab = m_ddsHandlerAes->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcCesHitRequest: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequest: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
}
|
||||
m_requestMap.clear();
|
||||
|
||||
+1
@@ -42,6 +42,7 @@ public:
|
||||
eElevationBelowZero = 3
|
||||
};
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
struct GeoPCharge
|
||||
{
|
||||
|
||||
|
||||
+5
-5
@@ -47,7 +47,7 @@ bool CesGeoPairingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesGeoPairingInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -66,11 +66,11 @@ bool CesGeoPairingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerGeoPairing->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerGeoPairing failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerGeoPairing failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CesGeoPairingInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ QString CesGeoPairingInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesGeoPairingInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesGeoPairingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesGeoPairingInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesGeoPairingInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -63,6 +63,7 @@ private Q_SLOTS:
|
||||
bool init(int domainId, int exerciseId) override;
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr};
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
|
||||
+19
-19
@@ -71,14 +71,14 @@ bool HandlerJamming::init()
|
||||
this, &HandlerJamming::onParticipantGearEventChanged);
|
||||
|
||||
|
||||
DEBUG_LOG() << "HandlerJamming::init() finished.";
|
||||
DEBUG_LOG(m_logger) << "HandlerJamming::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType)
|
||||
{
|
||||
ERROR_LOG() << "onParticipantGearEventChanged << modType=" << modType
|
||||
ERROR_LOG(m_logger) << "onParticipantGearEventChanged << modType=" << modType
|
||||
<< " originatorId=" << data.participantId()
|
||||
<< " chargeTypeId=" << data.charge().chargeTypeId()
|
||||
<< " gearTypeId=" << data.charge().gearTypeId()
|
||||
@@ -94,34 +94,34 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
double radius = m_ddsHandler->dtcPdm()->getMaxRange(data.charge().chargeTypeId(), data.charge().gearTypeId());
|
||||
|
||||
// int radius = 15;
|
||||
DEBUG_LOG() << "Radius=" << radius;
|
||||
DEBUG_LOG(m_logger) << "Radius=" << radius;
|
||||
for ( int uasId : uasIds)
|
||||
{
|
||||
DEBUG_LOG() << "uasId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "uasId=" << uasId;
|
||||
CentralEffectSimulation::HandlerParticipant::CesParticipantData cesParticipantData = m_handlerParticipant->position(uasId);
|
||||
if (!cesParticipantData.positionValid)
|
||||
{
|
||||
DEBUG_LOG() << "continue !positionValid participantId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "continue !positionValid participantId=" << uasId;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (LtsUtils::isPositionTimeOutdated(QDateTime::currentMSecsSinceEpoch(), cesParticipantData.sampleTime()))
|
||||
{
|
||||
DEBUG_LOG() << "continue positionTime outdated participantId=" << uasId;
|
||||
DEBUG_LOG(m_logger) << "continue positionTime outdated participantId=" << uasId;
|
||||
continue;
|
||||
}
|
||||
|
||||
long distance = m_handlerParticipant->getDistance(data.participantId(), uasId);
|
||||
DEBUG_LOG() << "distance = " << distance;
|
||||
DEBUG_LOG(m_logger) << "distance = " << distance;
|
||||
if ( distance < radius)
|
||||
{
|
||||
DEBUG_LOG() << " Send Jamming to TAB and destroy uasId";
|
||||
DEBUG_LOG(m_logger) << " Send Jamming to TAB and destroy uasId";
|
||||
//sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData);
|
||||
if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
jammedUasIds.append(uasId);
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "Not in Radius distance=" << distance
|
||||
DEBUG_LOG(m_logger) << "Not in Radius distance=" << distance
|
||||
<< " radius=" << radius;
|
||||
}
|
||||
// [ETB UASETBUAS-33] Equal distribution of jamming failures
|
||||
@@ -133,7 +133,7 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
{
|
||||
// search for an id from the list with an algorithm that contains an equal distribution
|
||||
jammedUasId = jammedUasIds.at(QRandomGenerator::global()->bounded(jammedUasIds.size() - 1));
|
||||
DEBUG_LOG() << "jammedUasId=" << jammedUasId
|
||||
DEBUG_LOG(m_logger) << "jammedUasId=" << jammedUasId
|
||||
<< " jammedUasIds.size()=" << jammedUasIds.size();
|
||||
}
|
||||
|
||||
@@ -145,21 +145,21 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::
|
||||
|
||||
void HandlerJamming::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 Area to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send enter/leave Area 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);
|
||||
}
|
||||
}
|
||||
@@ -182,20 +182,20 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
if (remaining < 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " participantId=" << participantData.participantId();
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
const int originatorEquimentNumber = m_ddsHandler->participantId2EquipNo(originatorId);
|
||||
const int originatorPartyId = m_handlerParticipant->getParticipantPosition(originatorId).partyId();
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
<< " equipNo = " << equipNo
|
||||
<< " chargeTypeId =" << chargeTypeId;
|
||||
|
||||
if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId == 0 CatastrophicKill)";
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId == 0 CatastrophicKill)";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,13 +220,13 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId,
|
||||
originatorPartyId, // originPartyId
|
||||
mineId
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId()
|
||||
<< " chargeTypeId=" << 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);
|
||||
}
|
||||
} // sendCesHitRequest
|
||||
|
||||
+1
@@ -57,6 +57,7 @@ public:
|
||||
bool init();
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
private Q_SLOTS:
|
||||
|
||||
+5
-5
@@ -48,7 +48,7 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,11 +62,11 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerJamming->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ QString CES_JammingInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_JammingInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
+10
-10
@@ -23,16 +23,16 @@ HandlerMineLayingArtillery::HandlerMineLayingArtillery(const std::shared_ptr<Cen
|
||||
, m_ddsHandler(ddsHandler)
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.MineLayingArtillery.HandlerMineLayingArtillery"))
|
||||
{
|
||||
INFO_LOG() << "HandlerMineLayingArtillery::HandlerMineLayingArtillery";
|
||||
INFO_LOG(m_logger) << "HandlerMineLayingArtillery::HandlerMineLayingArtillery";
|
||||
|
||||
m_effectClusterTimer->setInterval(500);
|
||||
}
|
||||
|
||||
HandlerMineLayingArtillery::~HandlerMineLayingArtillery() { INFO_LOG() << "HandlerMineLayingArtillery::~HandlerMineLayingArtillery"; }
|
||||
HandlerMineLayingArtillery::~HandlerMineLayingArtillery() { INFO_LOG(m_logger) << "HandlerMineLayingArtillery::~HandlerMineLayingArtillery"; }
|
||||
|
||||
bool HandlerMineLayingArtillery::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerMineLayingArtillery::init";
|
||||
INFO_LOG(m_logger) << "HandlerMineLayingArtillery::init";
|
||||
|
||||
m_dtcAes = m_ddsHandler->dtcAes();
|
||||
m_ftcAes = m_ddsHandler->ftcAes();
|
||||
@@ -87,7 +87,7 @@ std::vector<AreaEffectSimulation::MineData> HandlerMineLayingArtillery::calculat
|
||||
const double armingTimeOffset = mineLayingPattern[QStringLiteral("armingTimeOffset")].toDouble();
|
||||
const double armingJitter = mineLayingPattern[QStringLiteral("armingJitter")].toDouble();
|
||||
|
||||
DEBUG_LOG() << "[calculateImpacts] ## \n\tappearanceTimeOffset: " << appearanceTimeOffset << "\n\tappearanceJitter: " << appearanceJitter << "\n\tarmingTimeOffset: " << armingTimeOffset<<"\n\ttime: "<<time;
|
||||
DEBUG_LOG(m_logger) << "[calculateImpacts] ## \n\tappearanceTimeOffset: " << appearanceTimeOffset << "\n\tappearanceJitter: " << appearanceJitter << "\n\tarmingTimeOffset: " << armingTimeOffset<<"\n\ttime: "<<time;
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate impactPostionUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(QPointF(impactPositon.lon(), impactPositon.lat()));
|
||||
|
||||
@@ -117,7 +117,7 @@ std::vector<AreaEffectSimulation::MineData> HandlerMineLayingArtillery::calculat
|
||||
const double appearenceTime = time + appearanceTimeOffset + QRandomGenerator::global()->bounded(0, appearanceJitter * 2) - appearanceJitter;
|
||||
const double armingTime = time + armingTimeOffset + QRandomGenerator::global()->bounded(0, armingJitter * 2) - armingJitter;
|
||||
|
||||
DEBUG_LOG() <<"[calculateImpacts] patternCount: "<<patternCounter<< " appearenceTime: " << appearenceTime << " armingTime: " << armingTime;
|
||||
DEBUG_LOG(m_logger) <<"[calculateImpacts] patternCount: "<<patternCounter<< " appearenceTime: " << appearenceTime << " armingTime: " << armingTime;
|
||||
|
||||
mineData.position(Core::GeoPosition2D(transformedImpactPosition.x(), transformedImpactPosition.y()));
|
||||
mineData.appearenceTime(appearenceTime);
|
||||
@@ -126,7 +126,7 @@ std::vector<AreaEffectSimulation::MineData> HandlerMineLayingArtillery::calculat
|
||||
transformedImpacts.push_back(mineData);
|
||||
}
|
||||
|
||||
DEBUG_LOG()<<"[calculateImpacts] ### pattern patterCount: "<< patternCounter <<" patternsArray.size(): "<<patternsArray.size();
|
||||
DEBUG_LOG(m_logger)<<"[calculateImpacts] ### pattern patterCount: "<< patternCounter <<" patternsArray.size(): "<<patternsArray.size();
|
||||
|
||||
return transformedImpacts;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ void HandlerMineLayingArtillery::onChargeTypeChanged(const ProjectDataManagement
|
||||
void HandlerMineLayingArtillery::onChargeEffectModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG()<<"[CES ChargeEffectModifyReply]: "<<replyObject.str();
|
||||
ERROR_LOG(m_logger)<<"[CES ChargeEffectModifyReply]: "<<replyObject.str();
|
||||
}
|
||||
|
||||
void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
@@ -185,11 +185,11 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
const QJsonObject &mineLayingProperties = m_mineLayingChargeTypes[chargeTypeId];
|
||||
const int mineChargeTypeId = mineLayingProperties[QStringLiteral("mineChargeTypeId")].toInt();
|
||||
AreaEffectSimulation::EffectCluster ec = m_dtcAes->effectCluster(chargeEffect.originatorId());
|
||||
DEBUG_LOG()<<" [onChargeEffectChanged] effectClusterId: "<<ec.id()<<" mineChargeTypeId: "<<mineChargeTypeId;
|
||||
DEBUG_LOG(m_logger)<<" [onChargeEffectChanged] effectClusterId: "<<ec.id()<<" mineChargeTypeId: "<<mineChargeTypeId;
|
||||
|
||||
if (mineChargeTypeId <= 0)
|
||||
{
|
||||
ERROR_LOG()<<" [onChargeEffectChanged] mineChargeTypeId invalid!!! chargeEffectId: "<<chargeEffectId;
|
||||
ERROR_LOG(m_logger)<<" [onChargeEffectChanged] mineChargeTypeId invalid!!! chargeEffectId: "<<chargeEffectId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ void HandlerMineLayingArtillery::onEffectClusterTimerTimeout()
|
||||
request.effectDurationMsec(chargeEffectPropsObj[QStringLiteral("effectDurationMsec")].toInt(3 * 60 * 60 * 1000));
|
||||
|
||||
const int ret = m_ftcAes->mineAreaReferenceModifyRequest(request);
|
||||
DEBUG_LOG()<<"[onChargeEffectChanged] ****** mineAreaReferenceModifyRequest \n\tret id: "<< ret
|
||||
DEBUG_LOG(m_logger)<<"[onChargeEffectChanged] ****** mineAreaReferenceModifyRequest \n\tret id: "<< ret
|
||||
<< "\n\tchargeTypeId: " << chargeTypeId
|
||||
<< "\n\tchargeEffectId: " << chargeEffectId << "\n\ttrajectoryId: " << trajectory.id()
|
||||
<< "\n\tangle: " << angle << "\n\ttimeFromLastTrajectoryPointAbsolute: " << timeFromLastTrajectoryPointAbsolute;
|
||||
|
||||
+4
-4
@@ -35,8 +35,8 @@ MineLayingArtilleryPluginInterfaceImpl::MineLayingArtilleryPluginInterfaceImpl(C
|
||||
QString MineLayingArtilleryPluginInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> MineLayingArtilleryPluginInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ bool MineLayingArtilleryPluginInterfaceImpl::init(int domainId, int exerciseId)
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
|
||||
INFO_LOG() << "MineLayingArtilleryPluginInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "MineLayingArtilleryPluginInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
// initialize handlerMineLayingArtillery
|
||||
@@ -53,7 +53,7 @@ bool MineLayingArtilleryPluginInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerMineLayingArtillery->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerMineLayingArtillery failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerMineLayingArtillery failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
+15
-15
@@ -65,7 +65,7 @@ bool CesMissionPlanHandler::init()
|
||||
this, &CesMissionPlanHandler::onMissionPlanChanged);
|
||||
|
||||
|
||||
DEBUG_LOG() << " -- MissionPlanHandler::init() finished.";
|
||||
DEBUG_LOG(m_logger) << " -- MissionPlanHandler::init() finished.";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -80,11 +80,11 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
}
|
||||
|
||||
// check if mission start is in the future before proceeding..
|
||||
DEBUG_LOG()<<" -- [updateMissionPlanList] new missionPlan : "<<data.name()<< " planId: "<<data.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [updateMissionPlanList] new missionPlan : "<<data.name()<< " planId: "<<data.id();
|
||||
|
||||
if (data.missionStart() < m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
WARNING_LOG() << " -- updateMissionPlanList mission startTime ("<<data.missionStart()<<") in the past ignore mission plan id: "<<data.id()
|
||||
WARNING_LOG(m_logger) << " -- updateMissionPlanList mission startTime ("<<data.missionStart()<<") in the past ignore mission plan id: "<<data.id()
|
||||
<< " name: " << data.name() << " - now: " << m_ddsHandler->currentPartitionTime();
|
||||
return;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
const int planId = obj->planId();
|
||||
std::function<void(void)> onDeleteObj = [this, planId]()
|
||||
{
|
||||
DEBUG_LOG()<<" -- remove ces mission object from container planId: "<<planId;
|
||||
DEBUG_LOG(m_logger)<<" -- remove ces mission object from container planId: "<<planId;
|
||||
m_missionPlanObjects.remove(planId);
|
||||
};
|
||||
connect(obj, &CesMissionPlanObject::destroyed, this, onDeleteObj);
|
||||
@@ -107,7 +107,7 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M
|
||||
void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data, DataModification modType)
|
||||
{
|
||||
Q_UNUSED(modType)
|
||||
DEBUG_LOG()<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- onUasChanged : uas.id = "<<data.id() <<" participantId = "<<data.participantId();
|
||||
// get mission object of corresponding uas participant
|
||||
// if drone status is manual mode then cancel mission.
|
||||
if (data.uasState() != ProjectDataManagement::UasState_def::Manual && modType != DataModification::eRemoved)
|
||||
@@ -127,7 +127,7 @@ void CesMissionPlanHandler::onUasChanged(const ParticipantManagement::UAS &data,
|
||||
|
||||
void CesMissionPlanHandler::onMissionPlanChanged(const ParticipantManagement::MissionPlan &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG()<<" -- onMissionPlanChanged : missionPlanName: "<<data.name() << ", modType: " << (int)modType;
|
||||
DEBUG_LOG(m_logger)<<" -- onMissionPlanChanged : missionPlanName: "<<data.name() << ", modType: " << (int)modType;
|
||||
if (data.id() <= 0)
|
||||
return;
|
||||
switch (modType)
|
||||
@@ -159,11 +159,11 @@ bool CesMissionPlanHandler::isUasInAutoMode(int participantId)
|
||||
|
||||
if (uas.id() < 1)
|
||||
{
|
||||
ERROR_LOG() << "no uas for pid " << participantId;
|
||||
ERROR_LOG(m_logger) << "no uas for pid " << participantId;
|
||||
return false;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState().underlying();
|
||||
DEBUG_LOG(m_logger) << "uas with pid " << participantId << " is in mode: " << (int)uas.uasState().underlying();
|
||||
|
||||
return (uas.uasState() == ProjectDataManagement::UasState::Auto);
|
||||
}
|
||||
@@ -181,7 +181,7 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
|
||||
}
|
||||
|
||||
//Current State
|
||||
DEBUG_LOG() << "stateHistory count" << data.stateHistory().size();
|
||||
DEBUG_LOG(m_logger) << "stateHistory count" << data.stateHistory().size();
|
||||
if (data.stateHistory().empty())
|
||||
{
|
||||
return false;
|
||||
@@ -196,7 +196,7 @@ bool CesMissionPlanHandler::isUasCombatReady(int participantId)
|
||||
youngestState.stateTime(0);
|
||||
for (const auto &si : history)
|
||||
{
|
||||
DEBUG_LOG() << "StateInformation "
|
||||
DEBUG_LOG(m_logger) << "StateInformation "
|
||||
<< " time=" << si.stateTime()
|
||||
<< " vulnerabilityBits=" << si.vulnerabilityBits()
|
||||
<< " vulnerabilityKindId=" << si.vulnerabilityKindId();
|
||||
@@ -212,7 +212,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
auto missionPlan = m_missionPlanObjects.value(msa.planId(), nullptr);
|
||||
if (!missionPlan)
|
||||
{
|
||||
DEBUG_LOG()<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId();
|
||||
DEBUG_LOG(m_logger)<<" -- [SEND NEXT MISSION] Object not found. PlanId: "<<msa.planId();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!participant.equipmentNumber())
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav without equipment number";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav without equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!isUasInAutoMode(participantId))
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav that is not in auto mode";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav that is not in auto mode";
|
||||
//TODO: fulfill all other missions or mark as incomplete
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
|
||||
if (!isUasCombatReady(participantId))
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav that is not combat ready";
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav that is not combat ready";
|
||||
//TODO: fulfill all other missions or mark as incomplete
|
||||
return;
|
||||
}
|
||||
@@ -255,7 +255,7 @@ void CesMissionPlanHandler::onSendNextMissionAction(const ParticipantManagement:
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
ERROR_LOG() << "unable to send next mission action to uav: " << ex.what();
|
||||
ERROR_LOG(m_logger) << "unable to send next mission action to uav: " << ex.what();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
@@ -43,6 +43,7 @@ public:
|
||||
bool init();
|
||||
void updateMissionPlanList(const ParticipantManagement::MissionPlan &data);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendNextMissionAction();
|
||||
private Q_SLOTS:
|
||||
|
||||
|
||||
+17
-17
@@ -32,7 +32,7 @@ CesMissionPlanObject::CesMissionPlanObject(const ParticipantManagement::MissionP
|
||||
if (missionPlan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
const int time = m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime();
|
||||
// DEBUG_LOG()<<" -- [CesMissionPlanObject] start mission after << "<<time/1000<<" sec.";
|
||||
// DEBUG_LOG(m_logger)<<" -- [CesMissionPlanObject] start mission after << "<<time/1000<<" sec.";
|
||||
m_missionStartimer->start(time);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
///4- if no actions left send misson plan completed signal
|
||||
///5- else send next mission action to TAB
|
||||
|
||||
//DEBUG_LOG()<<" -- [setMissionActionFullfiled] -> msa.number: "<<msa.actionNumber()<<" planId: "<<msa.planId();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionActionFullfiled] -> msa.number: "<<msa.actionNumber()<<" planId: "<<msa.planId();
|
||||
// actionNumb=-1 && itemNumb=-1 |-> mission will be aborted
|
||||
if (msa.itemNumber() < 0 && msa.actionNumber() < 0)
|
||||
{
|
||||
@@ -60,21 +60,21 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
-1,
|
||||
-1);
|
||||
if ( !m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(abortReq))
|
||||
WARNING_LOG() << " -- unable to abort mission with planId:"<<abortReq.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to abort mission with planId:"<<abortReq.missionId();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (msa.itemNumber() >= static_cast<int>(m_missionPlan.items().size()) )
|
||||
{
|
||||
//WARNING_LOG()<<" -- [setMissionActionFulfilled] item size invalid !!";
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] item size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
const int actionCount = m_missionPlan.items()[msa.itemNumber()].actions().size();
|
||||
if (msa.actionNumber() >= actionCount)
|
||||
{
|
||||
//WARNING_LOG()<<" -- [setMissionActionFulfilled] actions size invalid !!";
|
||||
//WARNING_LOG(m_logger)<<" -- [setMissionActionFulfilled] actions size invalid !!";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ void CesMissionPlanObject::setMissionActionFulfilled(const ParticipantManagement
|
||||
req.missionId(m_missionPlan.id());
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->setMissionActionFulfilledRequest(req))
|
||||
WARNING_LOG() << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId();
|
||||
WARNING_LOG(m_logger) << " -- unable to setMissionActionFulfilledRequest: planId:"<<req.missionId();
|
||||
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ bool CesMissionPlanObject::isMissionFulfilled(const ParticipantManagement::Missi
|
||||
actionCount = 0;
|
||||
for (const auto &a : item.actions())
|
||||
{
|
||||
//DEBUG_LOG()<<" -- [setMissionPlan] action.Num : "<<a.actionNumber()<<" itemNum: "<<a.itemNumber()<<" fulfilled: "<<a.fulfilled();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] action.Num : "<<a.actionNumber()<<" itemNum: "<<a.itemNumber()<<" fulfilled: "<<a.fulfilled();
|
||||
if (a.fulfilled() > 0)
|
||||
actionCount++;
|
||||
else
|
||||
@@ -130,7 +130,7 @@ void CesMissionPlanObject::sendActionAttact()
|
||||
//3- setActionFulfilled
|
||||
int ret = m_ddsHandler->ftcAes()->explosionClusterSingleEffectOnlyModifyRequest(getExplosionCluster());
|
||||
if (!ret)
|
||||
WARNING_LOG()<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id();
|
||||
WARNING_LOG(m_logger)<<" -- sendActionAttact ret error for planId: "<<m_missionPlan.id();
|
||||
|
||||
setMissionActionFulfilled(getNextAction());
|
||||
}
|
||||
@@ -177,12 +177,12 @@ void CesMissionPlanObject::sendNextMissionAction()
|
||||
|
||||
ParticipantManagement::MissionAction action = getNextAction();
|
||||
|
||||
//DEBUG_LOG()<<" -- ########## ###### SEND NEXT ACTION ###### #############";
|
||||
//DEBUG_LOG(m_logger)<<" -- ########## ###### SEND NEXT ACTION ###### #############";
|
||||
|
||||
// set mission plan completed! or aborted
|
||||
if (isMissionFulfilled(m_missionPlan) || m_missionPlan.aborted())
|
||||
{
|
||||
DEBUG_LOG()<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [sendNextMissionAction] No action mission Completed for plan id: "<<m_missionPlan.id();
|
||||
deleteMissionPlanObject();
|
||||
return;
|
||||
}
|
||||
@@ -217,14 +217,14 @@ void CesMissionPlanObject::setMissionPlan(const ParticipantManagement::MissionPl
|
||||
m_missionPlan = plan;
|
||||
if (plan.missionStart() > m_ddsHandler->currentPartitionTime())
|
||||
{
|
||||
//DEBUG_LOG()<<" -- [setMissionPlan] restart Timer for plan.id: "<<plan.id();
|
||||
//DEBUG_LOG(m_logger)<<" -- [setMissionPlan] restart Timer for plan.id: "<<plan.id();
|
||||
m_missionStartimer->start(m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime());
|
||||
return;
|
||||
}
|
||||
|
||||
if (isMissionFulfilled(plan) || plan.aborted())
|
||||
{
|
||||
DEBUG_LOG() << "setMissionPlan deleteMissionPlanObject";
|
||||
DEBUG_LOG(m_logger) << "setMissionPlan deleteMissionPlanObject";
|
||||
deleteMissionPlanObject();
|
||||
return;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ ParticipantManagement::MissionPlan &CesMissionPlanObject::missionPlan()
|
||||
const ParticipantManagement::MissionAction CesMissionPlanObject::getNextAction()
|
||||
{
|
||||
|
||||
DEBUG_LOG()<<" -- [getNextAction]: planId: "<<m_missionPlan.id()<<" itemSize: "<<m_missionPlan.items().size();
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextAction]: planId: "<<m_missionPlan.id()<<" itemSize: "<<m_missionPlan.items().size();
|
||||
std::vector<ParticipantManagement::MissionItem> items = m_missionPlan.items();
|
||||
|
||||
// std::sort(items.begin(), items.end(), [](const ParticipantManagement::MissionItem &itemA, const ParticipantManagement::MissionItem &itemB){ return (itemA.itemNumber() < itemB.itemNumber()); });
|
||||
@@ -253,7 +253,7 @@ const ParticipantManagement::MissionAction CesMissionPlanObject::getNextAction()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG()<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id() << " // action_number " << msa.actionNumber()
|
||||
DEBUG_LOG(m_logger)<<" -- [getNextActopm]mission with planId: " << m_missionPlan.id() << " // action_number " << msa.actionNumber()
|
||||
<< " // action_type " << msa.actionType();
|
||||
|
||||
return msa;
|
||||
@@ -277,7 +277,7 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
req.repeat(msp.repeat());
|
||||
|
||||
if (!m_ddsHandler->ftcPpm()->modifyMissionPlanRequest(req))
|
||||
ERROR_LOG()<<" -- couldn't modify mission plan ";
|
||||
ERROR_LOG(m_logger)<<" -- couldn't modify mission plan ";
|
||||
|
||||
// delete object object is connected with handler
|
||||
// it will be automatically removed from object list in handler
|
||||
@@ -292,7 +292,7 @@ void CesMissionPlanObject::setMissionCompleted()
|
||||
*/
|
||||
void CesMissionPlanObject::abortMission()
|
||||
{
|
||||
DEBUG_LOG()<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id()<<" // uas id: "<<m_missionPlan.participantId();
|
||||
DEBUG_LOG(m_logger)<<" -- [abortMission] abord mission with planId: "<<m_missionPlan.id()<<" // uas id: "<<m_missionPlan.participantId();
|
||||
ParticipantManagement::MissionAction msa = getNextAction();
|
||||
msa.actionNumber(-1);
|
||||
msa.itemNumber(-1);
|
||||
@@ -301,7 +301,7 @@ void CesMissionPlanObject::abortMission()
|
||||
|
||||
void CesMissionPlanObject::deleteMissionPlanObject()
|
||||
{
|
||||
DEBUG_LOG()<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id();
|
||||
DEBUG_LOG(m_logger)<<" -- [DELETE OBJECT] plan fullfiled: delete Object planId: "<<m_missionPlan.id();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ public:
|
||||
int participantId() const; /// uas participantId
|
||||
bool isMissionFulfilled(const ParticipantManagement::MissionPlan &mission);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendActionAttact();
|
||||
AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest getExplosionCluster();
|
||||
ParticipantManagement::MissionPlan &missionPlan();
|
||||
|
||||
+6
-6
@@ -36,7 +36,7 @@ CES_MissionPlanInterfaceImpl::CES_MissionPlanInterfaceImpl(CentralEffectSimulati
|
||||
{
|
||||
Q_UNUSED(settings)
|
||||
|
||||
ERROR_LOG() << " >>> constructor CES_MissionPlanInterfaceImpl";
|
||||
ERROR_LOG(m_logger) << " >>> constructor CES_MissionPlanInterfaceImpl";
|
||||
}
|
||||
|
||||
CES_MissionPlanInterfaceImpl::~CES_MissionPlanInterfaceImpl()
|
||||
@@ -49,7 +49,7 @@ bool CES_MissionPlanInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
ERROR_LOG() << "CES_MissionPlanInterfaceImpl::init()"
|
||||
ERROR_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,11 +62,11 @@ bool CES_MissionPlanInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_missionPlanHandler->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_MissionPlanInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ QString CES_MissionPlanInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_MissionPlanInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_MissionPlanInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+105
-105
@@ -133,28 +133,28 @@ bool HandlerNBC::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantArea::init() finished.";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished.";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void HandlerNBC::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 Area to participant in training area: " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send enter/leave Area 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);
|
||||
}
|
||||
}
|
||||
@@ -170,7 +170,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
double upperOffset = 0;
|
||||
double lowerOffset = 0;
|
||||
bool offsetIsSet = false;
|
||||
TRACE_LOG() << "onAesItemViewChanged"
|
||||
TRACE_LOG(m_logger) << "onAesItemViewChanged"
|
||||
<< " aesItemId=" << data.aesItemId();
|
||||
|
||||
|
||||
@@ -190,7 +190,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
const AreaEffectSimulation::BCContamination &bc = m_ddsHandler->dtcAes()->bCContamination(data.aesItemId());
|
||||
if (!bc.isCentral())
|
||||
{
|
||||
DEBUG_LOG() << "!Central BCContamination id: " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "!Central BCContamination id: " << aesItemId;
|
||||
return;
|
||||
}
|
||||
offsetIsSet = true;
|
||||
@@ -202,7 +202,7 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
const AreaEffectSimulation::DangerArea &da = m_ddsHandler->dtcAes()->dangerArea(data.aesItemId());
|
||||
if (!da.isCentral())
|
||||
{
|
||||
DEBUG_LOG() << "!Central DangerArea id: " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "!Central DangerArea id: " << aesItemId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -211,20 +211,20 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(data.aesItemId());
|
||||
if (!nc.isCentral())
|
||||
{
|
||||
DEBUG_LOG() << "!Central NContamination id: " << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "!Central NContamination id: " << aesItemId;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TRACE_LOG() << "Got AesItemView id: " << aesItemId
|
||||
TRACE_LOG(m_logger) << "Got AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId()
|
||||
<< ", effectState: " << data.effectStateId()
|
||||
<< ", modType: " << modType;
|
||||
|
||||
|
||||
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:
|
||||
@@ -271,13 +271,13 @@ void HandlerNBC::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &d
|
||||
// if new field for this participant send sendCesHitRequest
|
||||
calculateBcContamination(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
// DEBUG_LOG() << "insert AtBCContamination oder AtNContamination AesItemView id: " << aesItemId
|
||||
// DEBUG_LOG(m_logger) << "insert AtBCContamination oder AtNContamination AesItemView id: " << aesItemId
|
||||
// << ", type: " << data.aesTypeId();
|
||||
break;
|
||||
case AreaEffectSimulation::AesType_def::AtDangerArea:
|
||||
calculateDangerArea(aesItemViewUtm);
|
||||
m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm);
|
||||
DEBUG_LOG() << "insert AtDangerArea AesItemView id: " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "insert AtDangerArea AesItemView id: " << aesItemId
|
||||
<< ", type: " << data.aesTypeId();
|
||||
break;
|
||||
default:
|
||||
@@ -336,7 +336,7 @@ void HandlerNBC::onBCContaminationChanged(const AreaEffectSimulation::BCContamin
|
||||
void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "onNContaminationChanged"
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged"
|
||||
<< " id=" << data.id();
|
||||
switch (modType)
|
||||
{
|
||||
@@ -359,7 +359,7 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
DEBUG_LOG() << "onNContaminationChanged participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged participantId=" << participantPos.participantId()
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " buildingId=" << participantPos.buildingId();
|
||||
|
||||
@@ -368,7 +368,7 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
|
||||
|
||||
const EffectType effectType = CES_NBC::EffectType::NContaminationDetonation;
|
||||
const int ctasEffectType = static_cast<int>(effectType) & 0xffff;
|
||||
DEBUG_LOG() << "onNContaminationChanged isInCircle=" << isInCircle
|
||||
DEBUG_LOG(m_logger) << "onNContaminationChanged isInCircle=" << isInCircle
|
||||
<< " aesItemId=" << data.id();
|
||||
if ( isInCircle)
|
||||
{
|
||||
@@ -389,7 +389,7 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
|
||||
m_effectTypeStates.insert(data.id(), effectTypeStatesFromAesItem);
|
||||
|
||||
|
||||
DEBUG_LOG() << "m_participantAes.insert participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "m_participantAes.insert participantId=" << participantPos.participantId()
|
||||
<< " aesId=" << data.id();
|
||||
sendCesHitRequest(ref,
|
||||
participantPos,
|
||||
@@ -410,13 +410,13 @@ void HandlerNBC::onNContaminationChanged(const AreaEffectSimulation::NContaminat
|
||||
|
||||
void HandlerNBC::calculateBcContamination(const CentralEffectSimulation::AesItemViewUtm &itemView)
|
||||
{
|
||||
TRACE_LOG() << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId;
|
||||
TRACE_LOG(m_logger) << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId;
|
||||
const auto participantsMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap)
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
DEBUG_LOG() << "participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "participantId=" << participantPos.participantId()
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " buildingId=" << participantPos.buildingId()
|
||||
<< " roomId=" << participantPos.roomId();
|
||||
@@ -427,7 +427,7 @@ void HandlerNBC::calculateBcContamination(const CentralEffectSimulation::AesItem
|
||||
|
||||
void HandlerNBC::calculateDangerArea(const CentralEffectSimulation::AesItemViewUtm &itemView)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateDangerArea aesItemId =" << itemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateDangerArea aesItemId =" << itemView.aesItemId;
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
inFormCheck(itemView, participantPos);
|
||||
@@ -436,20 +436,20 @@ void HandlerNBC::calculateDangerArea(const CentralEffectSimulation::AesItemViewU
|
||||
void HandlerNBC::deleteDangerArea(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)
|
||||
{
|
||||
sendParticipantEvent(aesItemId, participantPos, ProjectDataManagement::EventType_def::LeaveDangerArea);
|
||||
DEBUG_LOG() << "Participant inside id=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId();
|
||||
}// for all Participants
|
||||
} // deleteDangerArea
|
||||
|
||||
void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData)
|
||||
{
|
||||
bool leave = false;
|
||||
DEBUG_LOG() << "++++++++ onNewOutdoorParticipantPosition participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewOutdoorParticipantPosition participantId=" << participantData.participantId()
|
||||
<< " buildingId=" << participantData.buildingId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
<< " reportingSource=" << participantData.reportingSource()
|
||||
@@ -460,13 +460,13 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(participantData.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;
|
||||
}
|
||||
|
||||
if (m_lastRoomId.value(participantData.participantId()) > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Leave Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Leave Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
<< " m_isInContaminatedRoom.\nremove!!!";
|
||||
|
||||
|
||||
@@ -476,32 +476,32 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
|
||||
if (aesIsAvailable
|
||||
&& (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated))
|
||||
{
|
||||
DEBUG_LOG() << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
m_isInContaminatedRoom.remove(participantData.participantId());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
DEBUG_LOG(m_logger) << "Feld ist nicht mehr da. id=" << aesItemView.aesItemId();
|
||||
sendLeaveEvent(aesItemView.aesItemId(),participantData );
|
||||
}
|
||||
leave = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId());
|
||||
}
|
||||
|
||||
m_lastRoomId.insert(participantData.participantId(), 0);
|
||||
|
||||
|
||||
DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId()
|
||||
<< " m_aesItemViews.size()=" << m_aesItemViews.size();
|
||||
for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews))
|
||||
{
|
||||
DEBUG_LOG() << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
DEBUG_LOG(m_logger) << " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
|
||||
DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId;
|
||||
if (leave)
|
||||
{
|
||||
QHash<int, QSet<EffectType>> effectTypeHash = m_effectTypeStates.value(itemView.aesItemId);
|
||||
@@ -527,12 +527,12 @@ void HandlerNBC::onNewOutdoorParticipantPosition(const CentralEffectSimulation::
|
||||
|
||||
void HandlerNBC::onParticipantDecontaminated(const int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantDecontaminated participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "onParticipantDecontaminated participantId=" << participantId;
|
||||
m_participantAes.remove(participantId);
|
||||
|
||||
for (auto i = m_effectTypeStates.cbegin(), end = m_effectTypeStates.cend(); i != end; ++i)
|
||||
{
|
||||
DEBUG_LOG() << "aesItemId=" << i.key();
|
||||
DEBUG_LOG(m_logger) << "aesItemId=" << i.key();
|
||||
QHash<int, QSet<EffectType>> value = i.value();
|
||||
value.remove(participantId);
|
||||
m_effectTypeStates.insert(i.key(), value);
|
||||
@@ -541,12 +541,12 @@ void HandlerNBC::onParticipantDecontaminated(const int participantId)
|
||||
|
||||
void HandlerNBC::onRestoreRadioReadinessChanged(const int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerNBC::onRestoreRadioReadinessChanged participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "HandlerNBC::onRestoreRadioReadinessChanged participantId=" << participantId
|
||||
<< " m_participantAes.size=" << m_participantAes.size();
|
||||
|
||||
if (!m_participantAes.contains(participantId) )
|
||||
{
|
||||
DEBUG_LOG() << "HandlerNBC::onRestoreRadioReadinessChanged !m_participantAes.contains( participantId=" << participantId << ")";
|
||||
DEBUG_LOG(m_logger) << "HandlerNBC::onRestoreRadioReadinessChanged !m_participantAes.contains( participantId=" << participantId << ")";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -556,7 +556,7 @@ void HandlerNBC::onRestoreRadioReadinessChanged(const int participantId)
|
||||
while (i.hasNext())
|
||||
{
|
||||
i.next();
|
||||
DEBUG_LOG() << "HandlerNBC::onRestoreRadioReadinessChanged remove aesId=" << i.key();
|
||||
DEBUG_LOG(m_logger) << "HandlerNBC::onRestoreRadioReadinessChanged remove aesId=" << i.key();
|
||||
m_participantAes.remove(i.key());
|
||||
m_eventStates.remove(i.key());
|
||||
m_effectTypeStates.remove(i.key());
|
||||
@@ -581,11 +581,11 @@ bool HandlerNBC::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUt
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint))
|
||||
{
|
||||
DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
<< " inside AesItemView:" << itemView.aesItemId;
|
||||
return true;
|
||||
}
|
||||
TRACE_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId()
|
||||
<< " outside AesItemView:" << itemView.aesItemId;
|
||||
return false;
|
||||
}
|
||||
@@ -597,7 +597,7 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesItemId,AreaEffectSimulation::AesType::AtUnknown, aesItemView );
|
||||
|
||||
|
||||
DEBUG_LOG() << "sendEnterEvent, paricipantId: " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendEnterEvent, paricipantId: " << participantData.participantId()
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< ", aesType=" << aesTypeId
|
||||
<< ", isIndoor=" << isIndoor;
|
||||
@@ -611,7 +611,7 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
zone = m_aesItemViews.value(aesItemId).zone;
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "No m_aesItemViews.contains aesItemId=" << aesItemId;
|
||||
ERROR_LOG(m_logger) << "No m_aesItemViews.contains aesItemId=" << aesItemId;
|
||||
}
|
||||
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), zone);
|
||||
@@ -638,7 +638,7 @@ void HandlerNBC::sendEnterEvent(const int aesItemId, const AreaEffectSimulation:
|
||||
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
|
||||
case AreaEffectSimulation::AesType_def::AtMineArea:
|
||||
default:
|
||||
INFO_LOG() << "sendEvent Unhandled AES-Type" << aesTypeId;
|
||||
INFO_LOG(m_logger) << "sendEvent Unhandled AES-Type" << aesTypeId;
|
||||
break;
|
||||
}
|
||||
} // END sendEvent
|
||||
@@ -649,7 +649,7 @@ void HandlerNBC::sendLeaveEvent(const int aesItemId, const CentralEffectSimulati
|
||||
AreaEffectSimulation::AesItemView aesItemView;
|
||||
m_ddsHandler->dtcAes()->aesItemViewFromEntityId(aesItemId, AreaEffectSimulation::AesType_def::AtUnknown, aesItemView);
|
||||
|
||||
DEBUG_LOG() << "sendLeaveEvent"
|
||||
DEBUG_LOG(m_logger) << "sendLeaveEvent"
|
||||
<< " aesId=" << aesItemId
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " aesTypeId=" << aesItemView.aesTypeId();
|
||||
@@ -689,7 +689,7 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
itemView.boundingBoxTopRight);
|
||||
const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone);
|
||||
const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos(), itemView.zone);
|
||||
TRACE_LOG() << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
TRACE_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId()
|
||||
<< ", aesItemId: " << itemView.aesItemId
|
||||
<< ", aesTypeId: " << itemView.aesTypeId
|
||||
<< ", form.size: " << itemView.form.size()
|
||||
@@ -699,7 +699,7 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
if (boundingBoxImpact.contains(participantPosUtmPoint) &&
|
||||
itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "Participant id=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant id=" << participantData.participantId()
|
||||
<< " inside Area"
|
||||
<< " inside Building:" << participantData.insideBuilding()
|
||||
<< " roomId=" << participantData.roomId();
|
||||
@@ -709,7 +709,7 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
InfrastructureManagement::StructureElement structureElement;
|
||||
bool roomFound = m_ddsHandler->dtcIsm()->getStructureElementById(participantData.roomId(), structureElement);
|
||||
|
||||
DEBUG_LOG() << "Participant id=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant id=" << participantData.participantId()
|
||||
<< " pos.z=" << participantData.pos().z()
|
||||
<< " upperOffset =" << itemView.upperOffset
|
||||
<< " lowerOffset=" << itemView.lowerOffset
|
||||
@@ -721,7 +721,7 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
&& ( ( structureElement.relPosition().offsetZ() + 1.5 > itemView.upperOffset )
|
||||
|| ( structureElement.relPosition().offsetZ() + 1.5 < itemView.lowerOffset)))
|
||||
{
|
||||
DEBUG_LOG() << "Participant id=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant id=" << participantData.participantId()
|
||||
<< " pos.z=" << participantData.pos().z()
|
||||
<< " not between upperOffset =" << itemView.upperOffset
|
||||
<< " and lowerOffset=" << itemView.lowerOffset
|
||||
@@ -741,10 +741,10 @@ bool HandlerNBC::inFormCheck(const CentralEffectSimulation::AesItemViewUtm &item
|
||||
#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;
|
||||
@@ -760,20 +760,20 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
|
||||
if (remaining < 0)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeStruct)
|
||||
<< " participantId=" << participantData.participantId();
|
||||
|
||||
const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
<< " equipNo = " << equipNo
|
||||
<< " aesItemId =" << itemView.aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipNo <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -799,14 +799,14 @@ void HandlerNBC::sendCesHitRequest(const CentralEffectSimulation::AesItemViewUtm
|
||||
itemView.partyId, // originPartyId
|
||||
mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.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);
|
||||
}
|
||||
}
|
||||
@@ -829,7 +829,7 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
if ( aesItem.partyId().is_set())
|
||||
partyId = aesItem.partyId().get();
|
||||
legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(aesItem.chargeStruct());
|
||||
DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes="
|
||||
<< " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea()
|
||||
<< " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(aesItem.chargeStruct())
|
||||
<< " participantId=" << participantData.participantId()
|
||||
@@ -838,30 +838,30 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
<< " remaining=" << remaining;
|
||||
|
||||
const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId()
|
||||
<< " equipNo = " << equipmentNumber << " aesItemId =" << aesItemId;
|
||||
|
||||
// participantPosition.participantPosition == 0 -> send to all
|
||||
if (participantData.participantId() != 0 && equipmentNumber <= 0)
|
||||
{
|
||||
DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ;
|
||||
return;
|
||||
} // if
|
||||
|
||||
// Check Protection by buildings
|
||||
else if (effectType == CES_NBC::EffectType::NContaminationEnterArea1)
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea1";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1";
|
||||
if (participantData.buildingId() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea1 Protection by buildings"
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1 Protection by buildings"
|
||||
<< " remaining vorher=" << remaining
|
||||
<< " remaining nachher=2";
|
||||
remaining = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea1 NO Protection by buildings"
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1 NO Protection by buildings"
|
||||
<< " remaining vorher="<< remaining
|
||||
<< " remaining nachher=1";
|
||||
remaining = 1;
|
||||
@@ -869,10 +869,10 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
}
|
||||
else if (effectType == CES_NBC::EffectType::NContaminationEnterArea2)
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea2 NO Protection by buildings"
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea2 NO Protection by buildings"
|
||||
<< " remaining vorher="<< remaining
|
||||
<< " remaining nachher=2";
|
||||
DEBUG_LOG() << "NContaminationEnterArea2";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea2";
|
||||
remaining = 2;
|
||||
}
|
||||
|
||||
@@ -887,13 +887,13 @@ void HandlerNBC::sendCesHitRequest(const int aesItemId,
|
||||
equipmentNumber, participantData.participantId(), legacyChargeTypeId, aesItemId, originatorEquipmentNumber,
|
||||
remaining, pos, effectTime, eventType, partyId, mineFieldBitIndex
|
||||
);
|
||||
DEBUG_LOG() << " participantId=" << participantData.participantId() << " chargeTypeId=" << aesItem.chargeStruct().chargeTypeId()
|
||||
DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId() << " chargeTypeId=" << aesItem.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
|
||||
}
|
||||
@@ -911,7 +911,7 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
typeClass == ParticipantManagement::TypeClass_def::Vessel ||
|
||||
typeClass == ParticipantManagement::TypeClass_def::Unknown)
|
||||
{
|
||||
DEBUG_LOG() << "Participant with id " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId()
|
||||
<< " has invalid typeClass: " << typeClass
|
||||
<< " eventType: " << eventType;
|
||||
return;
|
||||
@@ -921,11 +921,11 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
{
|
||||
if ( m_isInContaminatedRoom.contains(participantData.participantId()) && participantData.roomId() == 0) // Tln leaves Building
|
||||
{
|
||||
DEBUG_LOG() << "Sending Event because Participant leaves Building";
|
||||
DEBUG_LOG(m_logger) << "Sending Event because Participant leaves Building";
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
<< " and aes " << aesItemId << " - already sent";
|
||||
return;
|
||||
}
|
||||
@@ -939,19 +939,19 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
|| eventType == ProjectDataManagement::EventType_def::HitMine
|
||||
|| eventType == ProjectDataManagement::EventType_def::HitN)
|
||||
{
|
||||
DEBUG_LOG() << "send hit events only with central AES Simulation participant=" << participantData.participantId();
|
||||
DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantData.participantId();
|
||||
return;
|
||||
}
|
||||
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId());
|
||||
if (equipmentNumber <= 0)
|
||||
{
|
||||
WARNING_LOG() << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId()
|
||||
<< " - participant has no equipment number";
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent" << eventType
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType
|
||||
<< " participantId=" << participantData.participantId()
|
||||
<< " AesItemId=" << aesItemId;
|
||||
|
||||
@@ -1002,7 +1002,7 @@ void HandlerNBC::sendParticipantEvent(const int aesItemId,
|
||||
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);
|
||||
@@ -1022,14 +1022,14 @@ void HandlerNBC::sendEffectTypeEvent(const int aesItemId,
|
||||
participantData.participantId(),
|
||||
effectType))
|
||||
{
|
||||
DEBUG_LOG() << "Not sending EffectType event " << toString(effectType)
|
||||
DEBUG_LOG(m_logger) << "Not sending EffectType event " << toString(effectType)
|
||||
<< ", participant: " << participantData.participantId()
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< " - already sent";
|
||||
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: " << participantData.participantId()
|
||||
<< ", aesItemId: " << aesItemId
|
||||
<< ", ctasEffectType: " << ctasEffectType;
|
||||
@@ -1051,7 +1051,7 @@ bool HandlerNBC::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";
|
||||
return false;
|
||||
}
|
||||
@@ -1084,7 +1084,7 @@ bool HandlerNBC::eventMustBeSend(int aesItemId,
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DEBUG_LOG() << "eventMustBeSend=true";
|
||||
DEBUG_LOG(m_logger) << "eventMustBeSend=true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,7 @@ bool HandlerNBC::effectTypeMustBeSend(int aesItemId,
|
||||
int participantId,
|
||||
EffectType effectType)
|
||||
{
|
||||
DEBUG_LOG() << "effectTypeMustBeSend"
|
||||
DEBUG_LOG(m_logger) << "effectTypeMustBeSend"
|
||||
<< " aesItemId= " << aesItemId
|
||||
<< " participantId=" << participantId
|
||||
<< " effectType=" << CES_NBC::toString(effectType);
|
||||
@@ -1102,7 +1102,7 @@ bool HandlerNBC::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;
|
||||
}
|
||||
if ( (effectType == EffectType::NContaminationEnterArea1)
|
||||
@@ -1110,7 +1110,7 @@ bool HandlerNBC::effectTypeMustBeSend(int aesItemId,
|
||||
{
|
||||
if (activeEffects.contains(EffectType::NContaminationDetonation))
|
||||
{
|
||||
DEBUG_LOG() << "effectTypeStates.contains(NContaminationDetonation) " << aesItemId
|
||||
DEBUG_LOG(m_logger) << "effectTypeStates.contains(NContaminationDetonation) " << aesItemId
|
||||
<< " return false";
|
||||
return false;
|
||||
}
|
||||
@@ -1188,7 +1188,7 @@ bool HandlerNBC::inCircle(const QPointF ¢erUtm, const double radius, const Q
|
||||
{
|
||||
double squareDist = CentralEffectSimulation::getSquareDistance(centerUtm, pointUtm);
|
||||
double squareRadius = radius * radius;
|
||||
DEBUG_LOG() << "squareDist: " << squareDist << ", squareRadius: " << squareRadius
|
||||
DEBUG_LOG(m_logger) << "squareDist: " << squareDist << ", squareRadius: " << squareRadius
|
||||
<< " centerUtm=" << centerUtm.x() << "/" << centerUtm.y()
|
||||
<< " pointUtm=" << pointUtm.x() << "/" << pointUtm.y()
|
||||
<< " radius = " << radius
|
||||
@@ -1235,59 +1235,59 @@ EffectType HandlerNBC::effectTypeForNContaminationArea(const CentralEffectSimula
|
||||
const AreaEffectSimulation::NContamination &nc = m_ddsHandler->dtcAes()->nContamination(itemView.aesItemId);
|
||||
auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(nc.impactPosition().lon(), nc.impactPosition().lat(), itemView.zone);
|
||||
QPointF impactPositionUtm = QPointF(utm.x, utm.y);
|
||||
DEBUG_LOG() << "HandlerNBC::effectTypeForNContaminationArea itemView.radials.size()=" << itemView.radials.size();
|
||||
DEBUG_LOG(m_logger) << "HandlerNBC::effectTypeForNContaminationArea itemView.radials.size()=" << itemView.radials.size();
|
||||
if (itemView.radials.size() != 3)
|
||||
return EffectType::NContaminationEnterArea2; // not yet known, we only know we're inside the area
|
||||
|
||||
DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y()
|
||||
<< " participantPosUtmPoint=" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y();
|
||||
|
||||
const double squareDist = CentralEffectSimulation::getSquareDistance(impactPositionUtm, participantPosUtmPoint);
|
||||
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)
|
||||
{
|
||||
DEBUG_LOG() << "return EffectType::NContaminationDetonation";
|
||||
DEBUG_LOG(m_logger) << "return EffectType::NContaminationDetonation";
|
||||
return EffectType::NContaminationDetonation;
|
||||
}
|
||||
DEBUG_LOG() << "return EffectType::NContaminationEnterArea2";
|
||||
DEBUG_LOG(m_logger) << "return EffectType::NContaminationEnterArea2";
|
||||
return EffectType::NContaminationEnterArea2;
|
||||
}
|
||||
DEBUG_LOG() << "squareDist=" << squareDist
|
||||
DEBUG_LOG(m_logger) << "squareDist=" << squareDist
|
||||
<< " pow(itemView.radials.at(1), 2)=" << pow(itemView.radials.at(1), 2)
|
||||
<< " itemView.radials.at(1)=" << itemView.radials.at(1);
|
||||
// Bereich 1
|
||||
if (squareDist <= pow(itemView.radials.at(1), 2))
|
||||
{
|
||||
DEBUG_LOG() << "-------------- NContamination Bereich 1 ---------------------";
|
||||
DEBUG_LOG(m_logger) << "-------------- NContamination Bereich 1 ---------------------";
|
||||
if ( isIndoor)
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea1 indoor => NContaminationEnterArea2";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1 indoor => NContaminationEnterArea2";
|
||||
return EffectType::NContaminationEnterArea2;
|
||||
}
|
||||
DEBUG_LOG() << "NContaminationEnterArea1";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea1";
|
||||
return EffectType::NContaminationEnterArea1;
|
||||
}
|
||||
DEBUG_LOG() << "squareDist=" << squareDist
|
||||
DEBUG_LOG(m_logger) << "squareDist=" << squareDist
|
||||
<< " Dist=" << sqrt (squareDist )
|
||||
<< " pow(itemView.radials.at(2), 2)=" << pow(itemView.radials.at(2), 2)
|
||||
<< " itemView.radials.at(2)=" << itemView.radials.at(2);
|
||||
// Bereich 2
|
||||
if (squareDist <= pow(itemView.radials.at(2), 2))
|
||||
{
|
||||
DEBUG_LOG() << "-------------- NContamination Bereich 2 ---------------------";
|
||||
DEBUG_LOG(m_logger) << "-------------- NContamination Bereich 2 ---------------------";
|
||||
if ( isIndoor)
|
||||
{
|
||||
DEBUG_LOG() << "NContaminationEnterArea2 indoor => NContaminationLeave";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea2 indoor => NContaminationLeave";
|
||||
return EffectType::NContaminationLeave;
|
||||
}
|
||||
DEBUG_LOG() << "NContaminationEnterArea2";
|
||||
DEBUG_LOG(m_logger) << "NContaminationEnterArea2";
|
||||
return EffectType::NContaminationEnterArea2;
|
||||
}
|
||||
DEBUG_LOG() << "NContaminationLeave";
|
||||
DEBUG_LOG(m_logger) << "NContaminationLeave";
|
||||
return EffectType::NContaminationLeave;
|
||||
}
|
||||
|
||||
@@ -1318,12 +1318,12 @@ void HandlerNBC::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(aesItemId, m_handlerParticipant->position(itP.key()), effectTypLeave);
|
||||
@@ -1332,12 +1332,12 @@ void HandlerNBC::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.aesItemId, m_handlerParticipant->position(itP.key()), eventTypeLeave);
|
||||
@@ -1357,7 +1357,7 @@ void HandlerNBC::aesItemViewRemoved(int aesItemId)
|
||||
|
||||
int HandlerNBC::getContaminationFromBuildingRoom(const int buildingId, const int roomId) const
|
||||
{
|
||||
DEBUG_LOG() << "getContaminationFromBuildingRoom buildingId=" << buildingId
|
||||
DEBUG_LOG(m_logger) << "getContaminationFromBuildingRoom buildingId=" << buildingId
|
||||
<< " roomId=" << roomId;
|
||||
|
||||
Buildings::BuildingState buildingState = m_ddsHandler->dtcBld()->buildingState(buildingId);
|
||||
@@ -1386,7 +1386,7 @@ void HandlerNBC::onBuildingStateChanged(const Buildings::BuildingState &data, Da
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
<< ", aesId = " << data.aesId()
|
||||
<< ", data.contaminationStates().size()=" << data.contaminationStates().size();
|
||||
// Check each participant
|
||||
@@ -1415,7 +1415,7 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
bool enterBuilding = false;
|
||||
if ( m_lastRoomId.value(participantData.participantId()) == 0)
|
||||
{
|
||||
DEBUG_LOG() << "m_lastRoomId Enter Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId Enter Building m_isInContaminatedRoom.contains participantId=" << participantData.participantId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
<< " m_isInContaminatedRoom. \nremove!!!!";
|
||||
m_isInContaminatedRoom.remove(participantData.participantId());
|
||||
@@ -1424,12 +1424,12 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
DEBUG_LOG(m_logger) << "m_lastRoomId.contains(" << m_lastRoomId.contains(participantData.participantId())
|
||||
<< " roomId=" << m_lastRoomId.value(participantData.participantId());
|
||||
}
|
||||
|
||||
int aesId = getContaminationFromBuildingRoom(participantData.buildingId(), participantData.roomId());
|
||||
DEBUG_LOG() << "++++++++ onNewIndoorParticipantPosition participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "++++++++ onNewIndoorParticipantPosition participantId=" << participantData.participantId()
|
||||
<< " buildingId=" << participantData.buildingId()
|
||||
<< " roomId=" << participantData.roomId()
|
||||
<< " reportingSource=" << participantData.reportingSource()
|
||||
@@ -1452,11 +1452,11 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG() << "aesId=" << aesId;
|
||||
DEBUG_LOG(m_logger) << "aesId=" << aesId;
|
||||
|
||||
if (aesId > 0 && !m_aesItemViews.contains(aesId))
|
||||
{
|
||||
DEBUG_LOG() << "m_isInContaminatedRoom insert participantId=" << participantData.participantId()
|
||||
DEBUG_LOG(m_logger) << "m_isInContaminatedRoom insert participantId=" << participantData.participantId()
|
||||
<< " aesId=" << aesId;
|
||||
m_isInContaminatedRoom.insert(participantData.participantId(), aesId);
|
||||
}
|
||||
@@ -1468,7 +1468,7 @@ void HandlerNBC::onNewIndoorParticipantPosition(const CentralEffectSimulation::H
|
||||
|
||||
AreaEffectSimulation::AesType aesTypeId = aesItemView.aesTypeId();
|
||||
|
||||
DEBUG_LOG() << "onNewIndoorParticipantPosition sendEnterEvent aesTypeId=" << aesTypeId;
|
||||
DEBUG_LOG(m_logger) << "onNewIndoorParticipantPosition sendEnterEvent aesTypeId=" << aesTypeId;
|
||||
sendEnterEvent(aesId,aesTypeId, participantData, true);
|
||||
}
|
||||
else
|
||||
|
||||
+5
-5
@@ -48,7 +48,7 @@ bool CES_NBCInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CES_NBCInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CES_NBCInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -61,11 +61,11 @@ bool CES_NBCInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerNBC->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerNBC failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerNBC failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "CES_NBCInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CES_NBCInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ QString CES_NBCInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_NBCInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_NBCInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CES_NBCInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_NBCInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CES_NBCInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+11
-11
@@ -33,7 +33,7 @@ HandlerBlockedAreas::~HandlerBlockedAreas()
|
||||
|
||||
bool HandlerBlockedAreas::init()
|
||||
{
|
||||
DEBUG_LOG() << "init";
|
||||
DEBUG_LOG(m_logger) << "init";
|
||||
connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newIndoorPosition,
|
||||
this, &HandlerBlockedAreas::onParticipantPositionChanged);
|
||||
connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newOutdoorPosition,
|
||||
@@ -48,16 +48,16 @@ bool HandlerBlockedAreas::init()
|
||||
void HandlerBlockedAreas::onSendParticipantBlockedAreaReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
WARNING_LOG() << "Can not send blocked Area to participant : " << replyObject();
|
||||
WARNING_LOG(m_logger) << "Can not send blocked Area to participant : " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onSendParticipantBlockedAreaReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendParticipantBlockedAreaReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
const int participantId = partPos.participantId();
|
||||
int damagePercentBlockedAreas = 90; // From the percentage damage, blocked area applies Todo Config Value
|
||||
DEBUG_LOG() << "HandlerBlockedAreas onParticipantPositionChanged participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "HandlerBlockedAreas onParticipantPositionChanged participantId=" << participantId;
|
||||
|
||||
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
|
||||
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(partPos.participantId()));
|
||||
@@ -70,7 +70,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
auto it = m_blockedAreas.find(participantId);
|
||||
if (it != m_blockedAreas.end())
|
||||
{
|
||||
DEBUG_LOG() << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Leave);
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.erase(it);
|
||||
@@ -83,7 +83,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
if (m_blockedAreas.contains(participantId) &&
|
||||
(m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId()) < damagePercentBlockedAreas))
|
||||
{
|
||||
DEBUG_LOG() << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
DEBUG_LOG(m_logger) << "Blocked Area Leave equipment-No. =" << pba.equipmentNumber();
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Leave);
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.remove(participantId);
|
||||
@@ -92,9 +92,9 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
}
|
||||
|
||||
|
||||
DEBUG_LOG() << "Room =" << partPos.roomId()
|
||||
DEBUG_LOG(m_logger) << "Room =" << partPos.roomId()
|
||||
<< " DamagePercentRoom=" << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId());
|
||||
DEBUG_LOG() << "1: " << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId())
|
||||
DEBUG_LOG(m_logger) << "1: " << m_handlerParticipantBuilding->getDamagePercentFromRoom(partPos.roomId())
|
||||
<< " damagePercentBlockedAreas= " << damagePercentBlockedAreas << "\n"
|
||||
<< " getDamagePercentFromBuilding=" << m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId()) << "\n"
|
||||
<< "m_blockedAreas.contains(participantId) = " << m_blockedAreas.contains(participantId) ;
|
||||
@@ -105,7 +105,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
|| m_handlerParticipantBuilding->getDamagePercentFromBuilding(partPos.buildingId()) == 100)
|
||||
&& !m_blockedAreas.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "Send Enter Blocked Area to Participant:" << participantId;
|
||||
DEBUG_LOG(m_logger) << "Send Enter Blocked Area to Participant:" << participantId;
|
||||
pba.blockedAreaMode(TrainingAreaBase::BlockedAreaMode_def::Enter);
|
||||
m_ddsHandler->ftcTab()->sendParticipantBlockedAreaRequest(pba, this);
|
||||
m_blockedAreas.insert(participantId, partPos.roomId());
|
||||
@@ -115,7 +115,7 @@ void HandlerBlockedAreas::onParticipantPositionChanged(const CentralEffectSimula
|
||||
|
||||
void HandlerBlockedAreas::onBuildingStateChanged(const int32_t buildingId)
|
||||
{
|
||||
DEBUG_LOG() << "onBuildingStateChanged buildingId:" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "onBuildingStateChanged buildingId:" << buildingId;
|
||||
int damagePercent = m_handlerParticipantBuilding->getDamagePercentFromBuilding(buildingId);
|
||||
if (damagePercent == 0 && !m_blockedAreas.isEmpty()) // init
|
||||
{
|
||||
@@ -124,7 +124,7 @@ void HandlerBlockedAreas::onBuildingStateChanged(const int32_t buildingId)
|
||||
{
|
||||
if (m_blockedAreas.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "remove participantId: " << participantId;
|
||||
DEBUG_LOG(m_logger) << "remove participantId: " << participantId;
|
||||
TrainingAreaBase::SendParticipantBlockedAreaRequest pba;
|
||||
pba.equipmentNumber(m_ddsHandler->participantId2EquipNo(participantId));
|
||||
pba.participantId(participantId);
|
||||
|
||||
+16
-16
@@ -63,7 +63,7 @@ bool HandlerParticipantBuilding::init()
|
||||
//-----------------------------------------------------------------------------
|
||||
int HandlerParticipantBuilding::getDamagePercentFromBuilding(const int buildingId) const
|
||||
{
|
||||
DEBUG_LOG() << "getDamagePercentFromBuilding buildingId=" << buildingId;
|
||||
DEBUG_LOG(m_logger) << "getDamagePercentFromBuilding buildingId=" << buildingId;
|
||||
auto it = m_buildingStates.find(buildingId);
|
||||
return it != m_buildingStates.end() ? it.value().damagePercent() : 0;
|
||||
}
|
||||
@@ -78,14 +78,14 @@ int HandlerParticipantBuilding::getDamagePercentFromRoom(const int roomId) const
|
||||
|
||||
// Exception:
|
||||
// if a building has failed completely, not all individual rooms are set as failed
|
||||
DEBUG_LOG() << "getDamagePercentFromBuilding=" << getDamagePercentFromBuilding(buildingId)
|
||||
DEBUG_LOG(m_logger) << "getDamagePercentFromBuilding=" << getDamagePercentFromBuilding(buildingId)
|
||||
<< " buildingId=" << buildingId
|
||||
<< " roomId=" << roomId;
|
||||
if (buildingId < 0)
|
||||
return -1;
|
||||
if (getDamagePercentFromBuilding(buildingId) == PERCENT_100)
|
||||
{
|
||||
DEBUG_LOG() << "return PERCENT_100:" << PERCENT_100;
|
||||
DEBUG_LOG(m_logger) << "return PERCENT_100:" << PERCENT_100;
|
||||
return PERCENT_100;
|
||||
}
|
||||
return it != m_roomIdDamageState.end() ? it.value().damagePercent : 0;
|
||||
@@ -94,10 +94,10 @@ int HandlerParticipantBuilding::getDamagePercentFromRoom(const int roomId) const
|
||||
void HandlerParticipantBuilding::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
m_requestMap.remove(replyObject.id());
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success"
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success"
|
||||
<< " m_requestMap.remove(" << replyObject.id() << ")"
|
||||
<< " m_requestMap.size=" << m_requestMap.size();
|
||||
|
||||
@@ -114,7 +114,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
return;
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
DEBUG_LOG(m_logger) << "Got BuildingState originatorParticipantId=" << data.originatorParticipantId()
|
||||
<< ", aesId = " << data.aesId()
|
||||
<< ", chargeTypeId = " << data.chargeTypeId()
|
||||
<< ", sampleTime = " << data.sampleTime()
|
||||
@@ -126,7 +126,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
|
||||
if ( (data.originatorParticipantId() == 0) && (data.aesId() == 0) && (data.chargeTypeId()==0))
|
||||
{
|
||||
DEBUG_LOG() << "Not valid return ";
|
||||
DEBUG_LOG(m_logger) << "Not valid return ";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
RoomState rs;
|
||||
rs.buildingId = data.id();
|
||||
m_buildingStates.insert(data.id(), data);
|
||||
DEBUG_LOG() << "m_buildingStates.insert id=" << data.id()
|
||||
DEBUG_LOG(m_logger) << "m_buildingStates.insert id=" << data.id()
|
||||
<< " aesId=" << data.aesId()
|
||||
<< " name=" << data.name();
|
||||
|
||||
@@ -142,7 +142,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
{
|
||||
rs.damagePercent = roomState.damagePercent();
|
||||
m_roomIdDamageState.insert(roomState.id(), rs);
|
||||
DEBUG_LOG() << "m_roomIdDamageState.insert"
|
||||
DEBUG_LOG(m_logger) << "m_roomIdDamageState.insert"
|
||||
<< " RoomId = " << roomState.id()
|
||||
<< ", BuildingId = " << data.id()
|
||||
<< ", destruction = " << roomState.damagePercent();
|
||||
@@ -170,7 +170,7 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
if (roomState.remainingEffectPercent() == 0)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << " RoomId[" << roomState.id() << "]:"
|
||||
DEBUG_LOG(m_logger) << " RoomId[" << roomState.id() << "]:"
|
||||
<< " remainingEffectPercent = " << roomState.remainingEffectPercent()
|
||||
<< " roomState.damagePercent()=" << roomState.damagePercent()
|
||||
<< " roomState.remainingEffectPercent()=" << roomState.remainingEffectPercent();
|
||||
@@ -190,14 +190,14 @@ void HandlerParticipantBuilding::onBuildingStateChanged(const Buildings::Buildin
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << " participantId = " << participantId
|
||||
DEBUG_LOG(m_logger) << " participantId = " << participantId
|
||||
<< " roomId = " << participantPos.roomId()
|
||||
<< " roomState.id=" << roomState.id()
|
||||
<< " participantPos.vulnerabilityState=" << participantPos.vulnerabilityState
|
||||
<< " equipNo=" << m_ddsHandler->participantId2EquipNo(participantId)
|
||||
<< " isOutdated=" << m_handlerParticipant->isOutdated(participantPos);
|
||||
|
||||
DEBUG_LOG() << "sendCesHitToParticipant";
|
||||
DEBUG_LOG(m_logger) << "sendCesHitToParticipant";
|
||||
sendCesHitToParticipant(data, participantId, roomState.remainingEffectPercent());
|
||||
}
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
|
||||
bool itemAvailable = m_ddsHandler->dtcAes()->aesItemFromId(data.aesId(), aesItem);
|
||||
if (itemAvailable)
|
||||
DEBUG_LOG() << "partyId=" << aesItem.partyId()
|
||||
DEBUG_LOG(m_logger) << "partyId=" << aesItem.partyId()
|
||||
<< " chargeTypeId=" << aesItem.chargeStruct().chargeTypeId()
|
||||
<< " duration=" << aesItem.effectDuration();
|
||||
|
||||
@@ -245,7 +245,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
if (itemAvailable) chargeStruct = aesItem.chargeStruct();
|
||||
int remainTasCodeIndirect = m_ddsHandler->remainingTasCode(chargeStruct);
|
||||
|
||||
DEBUG_LOG() << " ftc sendCESHit to Participant equipNo = " << equipNo
|
||||
DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant equipNo = " << equipNo
|
||||
<< " participantId=" << participantId
|
||||
<< " chargeTypeId=" << data.chargeTypeId()
|
||||
<< " originatorEquipNo=" << originatorEquipNo
|
||||
@@ -293,7 +293,7 @@ void HandlerParticipantBuilding::sendCesHitToParticipant(const Buildings::Buildi
|
||||
// }
|
||||
// else
|
||||
{
|
||||
DEBUG_LOG() << "direkter Beschuss remainEffectPercent=" << remainingEffectPercent;
|
||||
DEBUG_LOG(m_logger) << "direkter Beschuss remainEffectPercent=" << remainingEffectPercent;
|
||||
requestTab.remainEffectPercent(remainingEffectPercent);
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ void HandlerParticipantBuilding::sendFtcCesHitRequestTimeout()
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcCesHitRequest: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequest: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
}
|
||||
m_requestMap.clear();
|
||||
|
||||
+9
-9
@@ -51,12 +51,12 @@ bool CesParticipantBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesParticipantBuildingsInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesParticipantBuildingsInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
|
||||
INFO_LOG() << "initialize HandlerParticipantBuilding ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize HandlerParticipantBuilding ----------------------------";
|
||||
m_handlerParticipantBuilding = std::make_shared<HandlerParticipantBuilding>(m_ddsHandler,
|
||||
m_handlerParticipant,
|
||||
m_handlerBuildingData,
|
||||
@@ -64,15 +64,15 @@ bool CesParticipantBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerParticipantBuilding->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerParticipantData failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerParticipantData failed.";
|
||||
return false;
|
||||
}
|
||||
INFO_LOG() << "end initialize HandlerParticipantBuilding ----------------------------";
|
||||
INFO_LOG(m_logger) << "end initialize HandlerParticipantBuilding ----------------------------";
|
||||
|
||||
|
||||
if (Settings::handleBlockedAreas())
|
||||
{
|
||||
INFO_LOG() << "initialize HandlerBlockedAreas ----------------------------";
|
||||
INFO_LOG(m_logger) << "initialize HandlerBlockedAreas ----------------------------";
|
||||
// initialize HandlerBlockedAreas
|
||||
m_handlerBlockedAreas = std::make_shared<HandlerBlockedAreas>(m_ddsHandler,
|
||||
m_handlerParticipant,
|
||||
@@ -82,11 +82,11 @@ bool CesParticipantBuildingsInterfaceImpl::init(int domainId, int exerciseId)
|
||||
// Blocked Areas
|
||||
if (!m_handlerBlockedAreas->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerBlockedAreas failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerBlockedAreas failed.";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
INFO_LOG() << "CesParticipantBuildingsInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "CesParticipantBuildingsInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -94,8 +94,8 @@ QString CesParticipantBuildingsInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CES_FUNCTIONAL_AREAInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesParticipantBuildingsInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesParticipantBuildingsInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
} //namespace CesParticipantBuildings
|
||||
+12
-13
@@ -13,19 +13,18 @@
|
||||
namespace TargetAreas
|
||||
{
|
||||
|
||||
DdsHandlerTargetAreas::DdsHandlerTargetAreas(int domainId, int exerciseId)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
DdsHandlerTargetAreas::DdsHandlerTargetAreas(int domainId, int exerciseId) : m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(domainId, IDL::PartitionType::Exercise, exerciseId))
|
||||
, m_participantEventId(0)
|
||||
, m_exerciseId(exerciseId)
|
||||
{
|
||||
DEBUG_LOG() << "DdsHandlerTargetAreas(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
, m_exerciseId(exerciseId),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
DEBUG_LOG(m_logger) << "DdsHandlerTargetAreas(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
bool DdsHandlerTargetAreas::init(const QStringList &qosFileList)
|
||||
{
|
||||
if (!m_ddsConnector->init(qosFileList))
|
||||
{
|
||||
ERROR_LOG() << "Error initializing dds connections - aborting";
|
||||
ERROR_LOG(m_logger) << "Error initializing dds connections - aborting";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -46,28 +45,28 @@ bool DdsHandlerTargetAreas::init(const QStringList &qosFileList)
|
||||
!m_ftcTab->enableSendParticipantBeStillWarning() ||
|
||||
!m_ftcTab->enableSendControlData())
|
||||
{
|
||||
ERROR_LOG() << "Could not enable SendCesHit";
|
||||
ERROR_LOG(m_logger) << "Could not enable SendCesHit";
|
||||
return false;
|
||||
}
|
||||
m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_ddsConnector);
|
||||
if (!m_dtcPpm->enableDynamicParticipantData())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableDynamicParticipantData data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableDynamicParticipantData data topic client";
|
||||
return false;
|
||||
}
|
||||
if (!m_dtcPpm->enableParticipantPosition())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableParticipantPosition data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableParticipantPosition data topic client";
|
||||
return false;
|
||||
}
|
||||
if (!m_dtcPpm->enableParticipant())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableParticipant data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableParticipant data topic client";
|
||||
return false;
|
||||
}
|
||||
if (!m_dtcPpm->enableType())
|
||||
{
|
||||
ERROR_LOG() << "Could not initialize ParticipantManagement enableType data topic client";
|
||||
ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableType data topic client";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -100,7 +99,7 @@ void DdsHandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Pa
|
||||
{
|
||||
for (auto i = m_partId2EquipNoMap.begin(); i != m_partId2EquipNoMap.end(); ++i)
|
||||
{
|
||||
TRACE_LOG() << " partId2EquipNoMap.size(): " << m_partId2EquipNoMap.size()
|
||||
TRACE_LOG(m_logger) << " partId2EquipNoMap.size(): " << m_partId2EquipNoMap.size()
|
||||
<< " partId: " << i.key()
|
||||
<< " eqNo: " << i.value();
|
||||
}
|
||||
@@ -117,7 +116,7 @@ int DdsHandlerTargetAreas::participantId2EquipNo(const int participantId) const
|
||||
{
|
||||
int ret = m_partId2EquipNoMap.value(participantId, 0);
|
||||
if (ret > 0)
|
||||
INFO_LOG() << "participantId2EquipNo participantId=" << participantId
|
||||
INFO_LOG(m_logger) << "participantId2EquipNo participantId=" << participantId
|
||||
<< " EquipmentNumber=" << ret;
|
||||
return ret;
|
||||
} // end of participantId2EquipNo()
|
||||
|
||||
+2
@@ -53,6 +53,8 @@ private Q_SLOTS:
|
||||
void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType);
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
|
||||
std::shared_ptr<Core::Interface::Dtc> m_dtcCore;
|
||||
|
||||
+44
-44
@@ -75,7 +75,7 @@ bool HandlerTargetAreas::init()
|
||||
};
|
||||
dtcPpm->targetInformations(cb);
|
||||
}
|
||||
INFO_LOG() << "HandlerTargetAreas::init() finished. "
|
||||
INFO_LOG(m_logger) << "HandlerTargetAreas::init() finished. "
|
||||
<< " m_positionsMap.size(): " << m_positionsMap.size();
|
||||
return true;
|
||||
} // end of init()
|
||||
@@ -83,10 +83,10 @@ bool HandlerTargetAreas::init()
|
||||
|
||||
void HandlerTargetAreas::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantPositionChanged: " << data;
|
||||
DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data;
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.participantId();
|
||||
//m_participantsOutsideMap.remove(data.participantId());
|
||||
}
|
||||
else
|
||||
@@ -101,11 +101,11 @@ void HandlerTargetAreas::onParticipantPositionChanged(const ParticipantManagemen
|
||||
partPos.lastGeoPosition = partPosOld.pos(); // save previous position
|
||||
// replace
|
||||
*it = partPos;
|
||||
DEBUG_LOG() << "m_positionsMap.replace=" << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "m_positionsMap.replace=" << data.participantId();
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "m_positionsMap.insert=" << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "m_positionsMap.insert=" << data.participantId();
|
||||
m_positionsMap.insert(data.participantId(), partPos);
|
||||
}
|
||||
|
||||
@@ -113,9 +113,9 @@ void HandlerTargetAreas::onParticipantPositionChanged(const ParticipantManagemen
|
||||
if (equipmentNumber > 0)
|
||||
checkShootbackAreaPosition(data);
|
||||
else
|
||||
INFO_LOG() << "Teilnehmer hat keine Ausstattungsnummer";
|
||||
INFO_LOG(m_logger) << "Teilnehmer hat keine Ausstattungsnummer";
|
||||
|
||||
INFO_LOG() << "onParticipantPositionChanged()"
|
||||
INFO_LOG(m_logger) << "onParticipantPositionChanged()"
|
||||
<< " participantId; " << data.participantId()
|
||||
<< " participantTypeId: " << data.participantTypeId()
|
||||
<< " partyId: " << data.partyId()
|
||||
@@ -130,7 +130,7 @@ void HandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Parti
|
||||
// Remove Participant:
|
||||
if (modType == DataModification::eRemoved || data.isDeleted())
|
||||
{
|
||||
DEBUG_LOG() << "onParticipantChanged m_positionsMap.remove id=" << data.id();
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged m_positionsMap.remove id=" << data.id();
|
||||
m_participantData.remove(data.id());
|
||||
m_positionsMap.remove(data.id());
|
||||
return;
|
||||
@@ -148,12 +148,12 @@ void HandlerTargetAreas::onParticipantChanged(const ParticipantManagement::Parti
|
||||
pos.partyId(data.partyId());
|
||||
pos.participantId(data.id());
|
||||
pos.participantTypeId(data.typeId());
|
||||
DEBUG_LOG() << "onParticipantChanged"
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged"
|
||||
<< " id=" << data.id()
|
||||
<< " typeId=" << data.typeId()
|
||||
<< " designator=" << data.designator();
|
||||
if (typeClass == ParticipantManagement::TypeClass_def::Target)
|
||||
DEBUG_LOG() << "Typeclass = Target";
|
||||
DEBUG_LOG(m_logger) << "Typeclass = Target";
|
||||
}
|
||||
|
||||
void HandlerTargetAreas::onTypeChanged(const ParticipantManagement::Type &data, DataModification modType)
|
||||
@@ -161,20 +161,20 @@ void HandlerTargetAreas::onTypeChanged(const ParticipantManagement::Type &data,
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
m_typeMap.insert(data.id(), data.typeClass());
|
||||
DEBUG_LOG() << "m_typeMap.size()" << m_typeMap.size()
|
||||
DEBUG_LOG(m_logger) << "m_typeMap.size()" << m_typeMap.size()
|
||||
<< " equipmentTypeId=" << data.id()
|
||||
<< " typeClass=" << data.typeClass();
|
||||
}
|
||||
|
||||
void HandlerTargetAreas::onTargetInformationChanged(const ParticipantManagement::TargetInformation &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "onTargetInformationChanged"
|
||||
DEBUG_LOG(m_logger) << "onTargetInformationChanged"
|
||||
<< " participantId=" << data.participantId()
|
||||
<< " data.shootbackAreas().size()=" << data.shootbackAreas().size();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.participantId();
|
||||
DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.participantId();
|
||||
m_shootbackTargets.remove(data.participantId());
|
||||
return;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ void HandlerTargetAreas::onTargetInformationChanged(const ParticipantManagement:
|
||||
// assign shootbackAreasUtm
|
||||
for (unsigned int i = 0; i < data.shootbackAreas().size(); i++)
|
||||
{
|
||||
DEBUG_LOG() << " shootbackAreas i=" << i;
|
||||
DEBUG_LOG(m_logger) << " shootbackAreas i=" << i;
|
||||
ParticipantManagement::ShootbackArea shootbackArea = data.shootbackAreas().at(i);
|
||||
QPolygonF shootbackAreaUtm;
|
||||
|
||||
@@ -202,7 +202,7 @@ void HandlerTargetAreas::onTargetInformationChanged(const ParticipantManagement:
|
||||
|
||||
for (int i = 0; i < shootbackAreaUtm.size(); i++)
|
||||
{
|
||||
DEBUG_LOG() << "i=" << i
|
||||
DEBUG_LOG(m_logger) << "i=" << i
|
||||
<< " x=" << shootbackAreaUtm[i].x()
|
||||
<< " y=" << shootbackAreaUtm[i].y()
|
||||
<< " zone=" << m_zone;
|
||||
@@ -211,7 +211,7 @@ void HandlerTargetAreas::onTargetInformationChanged(const ParticipantManagement:
|
||||
}
|
||||
|
||||
m_shootbackTargets.insert(data.participantId(), shootbackTarget);
|
||||
DEBUG_LOG() << "newShootbackTarget participantId=" << data.participantId()
|
||||
DEBUG_LOG(m_logger) << "newShootbackTarget participantId=" << data.participantId()
|
||||
<< " shootbackTarget.participantId=" << shootbackTarget.participantId
|
||||
<< " shootbackTarget.targetInformation.participantId()=" << shootbackTarget.targetInformation.participantId()
|
||||
<< " shootbackTarget.targetInformation.prewarningInterval()=" << shootbackTarget.targetInformation.prewarningInterval()
|
||||
@@ -237,10 +237,10 @@ int HandlerTargetAreas::getParticipantId(int equipentNumber)
|
||||
|
||||
void HandlerTargetAreas::printQPolygon(const QPolygonF polygon)
|
||||
{
|
||||
DEBUG_LOG() << "printQPolygon polygon.size()=" << polygon.size();
|
||||
DEBUG_LOG(m_logger) << "printQPolygon polygon.size()=" << polygon.size();
|
||||
for (int i = 0; i < polygon.size(); i++)
|
||||
{
|
||||
DEBUG_LOG() << "printQPolygon i=" << i
|
||||
DEBUG_LOG(m_logger) << "printQPolygon i=" << i
|
||||
<< " x=" << polygon[i].x()
|
||||
<< " y=" << polygon[i].y();
|
||||
}
|
||||
@@ -248,7 +248,7 @@ void HandlerTargetAreas::printQPolygon(const QPolygonF polygon)
|
||||
|
||||
void HandlerTargetAreas::printShootbackTarget(const ShootbackTarget &shootbackTarget)
|
||||
{
|
||||
DEBUG_LOG() << "ShootbackTarget "
|
||||
DEBUG_LOG(m_logger) << "ShootbackTarget "
|
||||
<< ", targetParticipantId=" << shootbackTarget.participantId
|
||||
<< ", shootbackAreasUtm.size=" << shootbackTarget.shootbackAreasUtm.size();
|
||||
for (int i = 0; i < shootbackTarget.shootbackAreasUtm.size(); i++)
|
||||
@@ -261,7 +261,7 @@ void HandlerTargetAreas::printShootbackTarget(const ShootbackTarget &shootbackTa
|
||||
|
||||
void HandlerTargetAreas::printShootbackAreas()
|
||||
{
|
||||
DEBUG_LOG() << "printShootbackAreas--------------------";
|
||||
DEBUG_LOG(m_logger) << "printShootbackAreas--------------------";
|
||||
QHashIterator<int, ShootbackTarget> it(m_shootbackTargets);
|
||||
while (it.hasNext())
|
||||
{
|
||||
@@ -269,14 +269,14 @@ void HandlerTargetAreas::printShootbackAreas()
|
||||
ShootbackTarget shootbackTarget = it.value();
|
||||
printShootbackTarget(shootbackTarget);
|
||||
}
|
||||
DEBUG_LOG() << "ENDE printShootbackAreas--------------------";
|
||||
DEBUG_LOG(m_logger) << "ENDE printShootbackAreas--------------------";
|
||||
}
|
||||
|
||||
bool HandlerTargetAreas::checkPosInShootbackTarget(const ShootbackTarget &shootbackTarget,
|
||||
const QPointF &participantPosUtm)
|
||||
{
|
||||
bool inside = false;
|
||||
DEBUG_LOG() << "checkPosInShootbackTarget ShootbackTarget "
|
||||
DEBUG_LOG(m_logger) << "checkPosInShootbackTarget ShootbackTarget "
|
||||
<< ", targetParticipantId=" << shootbackTarget.participantId
|
||||
<< ", shootbackAreasUtm.size=" << shootbackTarget.shootbackAreasUtm.size();
|
||||
for (int i = 0; i < shootbackTarget.shootbackAreasUtm.size(); i++)
|
||||
@@ -285,7 +285,7 @@ bool HandlerTargetAreas::checkPosInShootbackTarget(const ShootbackTarget &shootb
|
||||
printQPolygon(shootbackTarget.shootbackAreasUtm.at(i));
|
||||
if (shootbackTarget.shootbackAreasUtm.at(i).containsPoint(participantPosUtm, Qt::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "inside = true";
|
||||
DEBUG_LOG(m_logger) << "inside = true";
|
||||
inside = true;
|
||||
}
|
||||
}
|
||||
@@ -296,7 +296,7 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
{
|
||||
int participantId = data.participantId();
|
||||
int equipmentNumber = m_ddsHandler->participantId2EquipNo(data.participantId());
|
||||
DEBUG_LOG() << "checkShootbackAreaPosition id= " << data.participantId()
|
||||
DEBUG_LOG(m_logger) << "checkShootbackAreaPosition id= " << data.participantId()
|
||||
<< ", equipmentNumber=" << equipmentNumber
|
||||
<< ", sampleTime=" << data.sampleTime()
|
||||
<< ", time difference = " << QDateTime::currentMSecsSinceEpoch() - data.sampleTime();
|
||||
@@ -308,7 +308,7 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
|
||||
printShootbackAreas();
|
||||
|
||||
DEBUG_LOG() << "Participant pos=" << posActual.pos().lat() << "/" << posActual.pos().lon()
|
||||
DEBUG_LOG(m_logger) << "Participant pos=" << posActual.pos().lat() << "/" << posActual.pos().lon()
|
||||
<< ", Utm=" << participantPosUtm.x() << "/" << participantPosUtm.y()
|
||||
<< " m_zone=" << m_zone;
|
||||
|
||||
@@ -322,20 +322,20 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
int targetPreWarningInterval = shootbackTarget.targetInformation.prewarningInterval() * 1000;
|
||||
int targetTimeToEffectInterval = shootbackTarget.targetInformation.takedownInterval() * 1000;
|
||||
|
||||
DEBUG_LOG() << "ShootbackArea ParticipantID=" << shootbackTarget.participantId
|
||||
DEBUG_LOG(m_logger) << "ShootbackArea ParticipantID=" << shootbackTarget.participantId
|
||||
<< " shootbackTarget.shootbackAreasUtm.size()=" << shootbackTarget.shootbackAreasUtm.size()
|
||||
<< " size= " << it.value().shootbackAreasUtm.size();
|
||||
printShootbackTarget(shootbackTarget);
|
||||
if (checkPosInShootbackTarget(shootbackTarget, participantPosUtm))
|
||||
{
|
||||
// START TARGET TIMER
|
||||
DEBUG_LOG() << "Participant ist in ShootbackArea"
|
||||
DEBUG_LOG(m_logger) << "Participant ist in ShootbackArea"
|
||||
<< ", ParticipantId= " << participantId
|
||||
<< ", ShootbackTargetId=" << shootbackTarget.participantId;
|
||||
if (m_targetTimers.contains(participantId))
|
||||
if (m_targetTimers.value(participantId)->getTimerState() != TargetTimer::TimerState::NOT_ACTIVE)
|
||||
return;
|
||||
DEBUG_LOG() << "START TIMER PARTICIPANT_ID=" << participantId
|
||||
DEBUG_LOG(m_logger) << "START TIMER PARTICIPANT_ID=" << participantId
|
||||
<< " targetPreWarningInterval=" << targetPreWarningInterval
|
||||
<< " targetTimeToEffectInterval=" << targetTimeToEffectInterval
|
||||
<< " m_targetTimers.insert(" << participantId << ")";
|
||||
@@ -355,14 +355,14 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
else
|
||||
{
|
||||
// STOP TARGET TIMER
|
||||
DEBUG_LOG() << "Participant ist nicht in ShootbackArea"
|
||||
DEBUG_LOG(m_logger) << "Participant ist nicht in ShootbackArea"
|
||||
<< ", ParticipantId= " << data.participantId()
|
||||
<< ", ShootbackTargetId=" << shootbackTarget.participantId
|
||||
<< ", m_targetTimers.size=" << m_targetTimers.size()
|
||||
<< ", m_targetTimers.contains(participantId)=" << m_targetTimers.contains(participantId);
|
||||
if (!m_targetTimers.contains(participantId))
|
||||
{
|
||||
DEBUG_LOG() << "continue";
|
||||
DEBUG_LOG(m_logger) << "continue";
|
||||
continue;
|
||||
}
|
||||
else
|
||||
@@ -372,7 +372,7 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
{
|
||||
targetTimer->deleteLater();
|
||||
m_targetTimers.remove(participantId);
|
||||
DEBUG_LOG() << "STOP TIMER PARTICIPANT_ID=" << participantId
|
||||
DEBUG_LOG(m_logger) << "STOP TIMER PARTICIPANT_ID=" << participantId
|
||||
<< " m_targetTimers.remove(" << participantId << ")";
|
||||
}
|
||||
}
|
||||
@@ -383,17 +383,17 @@ void HandlerTargetAreas::checkShootbackAreaPosition(const ParticipantManagement:
|
||||
void HandlerTargetAreas::onSendControlDataReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendControlDataReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendControlDataReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerTargetAreas::onSendCesHitInformationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendCesHitInformationReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
|
||||
@@ -402,7 +402,7 @@ void HandlerTargetAreas::sendRequestsToTab(int participantId,
|
||||
int countBlink,
|
||||
int effectPercent)
|
||||
{
|
||||
DEBUG_LOG() << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
<< " targetParticipantId =" << targetParticipantId;
|
||||
ParticipantManagement::Participant participant = m_participantData.value(participantId);
|
||||
//ShootbackTarget shootbackTarget = m_shootbackTargets.value(participantId);
|
||||
@@ -454,14 +454,14 @@ void HandlerTargetAreas::sendRequestsToTab(int participantId,
|
||||
TrainingAreaBase::SendCesHitRequest hr;
|
||||
hr.aesId(1);
|
||||
|
||||
INFO_LOG() << "sendCesHitRequest: " << hr;
|
||||
INFO_LOG(m_logger) << "sendCesHitRequest: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
|
||||
}
|
||||
|
||||
void HandlerTargetAreas::on_preWarningIntervalFinished(int participantId, int targetParticipantId)
|
||||
{
|
||||
DEBUG_LOG() << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
<< " targetParticipantId =" << targetParticipantId;
|
||||
ParticipantManagement::Participant participant = m_participantData.value(participantId);
|
||||
ShootbackTarget shootbackTarget = m_shootbackTargets.value(targetParticipantId);
|
||||
@@ -500,17 +500,17 @@ void HandlerTargetAreas::on_preWarningIntervalFinished(int participantId, int ta
|
||||
|
||||
void HandlerTargetAreas::on_TimeToEffectFinished(int participantId, int targetParticipantId)
|
||||
{
|
||||
DEBUG_LOG() << "HandlerTargetAreas::on_TimeToEffectFinished participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "HandlerTargetAreas::on_TimeToEffectFinished participantId=" << participantId
|
||||
<< " targetParticipantId=" << targetParticipantId;
|
||||
|
||||
DEBUG_LOG() << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "MainWindow::on_Timer1finished participantId=" << participantId
|
||||
<< " targetParticipantId =" << targetParticipantId;
|
||||
ParticipantManagement::Participant participant = m_participantData.value(participantId);
|
||||
ShootbackTarget shootbackTarget = m_shootbackTargets.value(targetParticipantId);
|
||||
uint8_t countBlink = 1;
|
||||
int32_t effectPercent = 0;
|
||||
|
||||
DEBUG_LOG() << " shootbackTarget.participantId=" << shootbackTarget.participantId
|
||||
DEBUG_LOG(m_logger) << " shootbackTarget.participantId=" << shootbackTarget.participantId
|
||||
<< " shootbackTarget.targetInformation.participantId()=" << shootbackTarget.targetInformation.participantId()
|
||||
<< " shootbackTarget.targetInformation.prewarningInterval()=" << shootbackTarget.targetInformation.prewarningInterval()
|
||||
<< " prewarningEffect=" << shootbackTarget.targetInformation.prewarningEffect()
|
||||
@@ -540,11 +540,11 @@ void HandlerTargetAreas::on_TimeToEffectFinished(int participantId, int targetPa
|
||||
|
||||
void HandlerTargetAreas::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "HandlerTargetAreas::onSendCesHitReply";
|
||||
INFO_LOG(m_logger) << "HandlerTargetAreas::onSendCesHitReply";
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
} // namespace TargetAreas
|
||||
+1
@@ -62,6 +62,7 @@ public:
|
||||
|
||||
};
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSendControlDataReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) override final;
|
||||
void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
+6
-6
@@ -41,7 +41,7 @@ bool TargetAreasInterfaceImpl::init(int domain_id, int exerciseId)
|
||||
{
|
||||
m_domainId = domain_id;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "TargetAreasInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "TargetAreasInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -49,7 +49,7 @@ bool TargetAreasInterfaceImpl::init(int domain_id, int exerciseId)
|
||||
m_ddsHandlerTargetAreas = std::make_shared<DdsHandlerTargetAreas>(m_domainId, m_exerciseId);
|
||||
if (!m_ddsHandlerTargetAreas->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation DdsHandler failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation DdsHandler failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ bool TargetAreasInterfaceImpl::init(int domain_id, int exerciseId)
|
||||
|
||||
if (!m_handlerTargetAreas->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation HandlerTargetAreas failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation HandlerTargetAreas failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "TargetAreasInterfaceImpl::init() return true";
|
||||
INFO_LOG(m_logger) << "TargetAreasInterfaceImpl::init() return true";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -69,8 +69,8 @@ QString TargetAreasInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> TargetAreasInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "TargetAreasInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: TargetAreasInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "TargetAreasInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: TargetAreasInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -48,6 +48,7 @@ private Q_SLOTS:
|
||||
bool init(int domain_id, int exerciseId) override;
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
private:
|
||||
CentralEffectSimulation::Plugin::DataProvider *m_pdp;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
|
||||
+74
-74
@@ -28,7 +28,7 @@ HandlerParticipantBoobyTrap::HandlerParticipantBoobyTrap(const std::shared_ptr<C
|
||||
, m_timer(new QTimer(this))
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.VirtualMines.HandlerParticipantBoobyTrap"))
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::HandlerParticipantBoobyTrap";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::HandlerParticipantBoobyTrap";
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, &QTimer::timeout, this, &HandlerParticipantBoobyTrap::sendFtcCesHitRequestTimeout);
|
||||
} // end of ctor()
|
||||
@@ -36,13 +36,13 @@ HandlerParticipantBoobyTrap::HandlerParticipantBoobyTrap(const std::shared_ptr<C
|
||||
|
||||
HandlerParticipantBoobyTrap::~HandlerParticipantBoobyTrap()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::~HandlerParticipantBoobyTrap";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::~HandlerParticipantBoobyTrap";
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool HandlerParticipantBoobyTrap::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::init";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::init";
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
auto ftcAes = m_ddsHandler->ftcAes();
|
||||
auto dtcCes = m_ddsHandler->dtsCes();
|
||||
@@ -72,7 +72,7 @@ bool HandlerParticipantBoobyTrap::init()
|
||||
return false;
|
||||
}
|
||||
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::init() finished. ";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::init() finished. ";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -95,13 +95,13 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
|
||||
m_boobyTrapItemsSecondary.remove(data.id());
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onBoobyTrapChanged"
|
||||
<< " data.sampleTime=" << data.sampleTime()
|
||||
<< " m_ddsHandler->currentPartitionTime=" << m_ddsHandler->currentPartitionTime()
|
||||
<< " diff=" << m_ddsHandler->currentPartitionTime() - data.sampleTime();
|
||||
if ((m_ddsHandler->currentPartitionTime() - data.sampleTime()) > 2000)
|
||||
{
|
||||
INFO_LOG() << "onBoobyTrap outdated";
|
||||
INFO_LOG(m_logger) << "onBoobyTrap outdated";
|
||||
return;
|
||||
}
|
||||
m_boobyTraps.insert(data.id(), data);
|
||||
@@ -120,7 +120,7 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
|
||||
// m_boobyTrapItems.insert(data.aesItemId(), boobyTrapUtm);
|
||||
// if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
|
||||
// m_boobyTrapItemsSecondary.insert(data.aesItemId(), boobyTrapUtm);
|
||||
// DEBUG_LOG() << "Check each participant"
|
||||
// DEBUG_LOG(m_logger) << "Check each participant"
|
||||
// << " aesTypeId=" << data.aesTypeId();
|
||||
|
||||
// Check each participant
|
||||
@@ -129,21 +129,21 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
{
|
||||
TRACE_LOG() << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
TRACE_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG() << "Check each actuell participant participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Check each actuell participant participantId=" << participantPos.participantId();
|
||||
if (participantPos.insideBuilding())
|
||||
{
|
||||
DEBUG_LOG() << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
continue;
|
||||
}
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
continue;
|
||||
}
|
||||
DEBUG_LOG() << "pos participantId=" << participantPos.participantId()
|
||||
DEBUG_LOG(m_logger) << "pos participantId=" << participantPos.participantId()
|
||||
<< " buildingId=" << participantPos.buildingId()
|
||||
<< " insideBuilding=" << participantPos.insideBuilding()
|
||||
<< " positionValid=" << participantPos.positionValid;
|
||||
@@ -157,8 +157,8 @@ void HandlerParticipantBoobyTrap::onBoobyTrapChanged(const AreaEffectSimulation:
|
||||
|
||||
void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "---------------------------------------------------------------------------";
|
||||
INFO_LOG() << "HandlerParticipantBoobyTrap::onAesItemViewChanged"
|
||||
INFO_LOG(m_logger) << "---------------------------------------------------------------------------";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onAesItemViewChanged"
|
||||
<< " aesTypeId=" << data.aesTypeId()
|
||||
<< " data.effectStateId()=" << data.effectStateId();
|
||||
|
||||
@@ -173,7 +173,7 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
m_boobyTrapItemsSecondary.remove(data.id());
|
||||
m_triggeredMineParticipant.remove(data.id());
|
||||
|
||||
DEBUG_LOG() << "onBoobyTrapChanged remove aesId=" << data.id()
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapChanged remove aesId=" << data.id()
|
||||
<< " m_triggeredMineParticipant.remove(" << data.id() ;
|
||||
}
|
||||
return;
|
||||
@@ -185,7 +185,7 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
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;
|
||||
@@ -208,7 +208,7 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
m_boobyTrapItems.insert(data.aesItemId(), boobyTrapUtm);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary)
|
||||
m_boobyTrapItemsSecondary.insert(data.aesItemId(), boobyTrapUtm);
|
||||
DEBUG_LOG() << "Check each participant"
|
||||
DEBUG_LOG(m_logger) << "Check each participant"
|
||||
<< " aesTypeId=" << data.aesTypeId();
|
||||
// Check each participant
|
||||
// const auto partPosMap = m_handlerParticipant->positions();
|
||||
@@ -216,31 +216,31 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
// {
|
||||
// if (m_handlerParticipant->isOutdated(participantPos))
|
||||
// {
|
||||
// TRACE_LOG() << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
// TRACE_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
// DEBUG_LOG() << "Check each actuell participant participantId=" << participantPos.participantId();
|
||||
// DEBUG_LOG(m_logger) << "Check each actuell participant participantId=" << participantPos.participantId();
|
||||
// if (participantPos.insideBuilding())
|
||||
// {
|
||||
// DEBUG_LOG() << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
// DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
// {
|
||||
// DEBUG_LOG() << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
// DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
// // Nur Positionsmeldungen, die neuer sind als die Mine koennen sie ausloesen!
|
||||
// if ((participantPos.sampleTime() < data.sampleTime())
|
||||
// && (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrap))
|
||||
// {
|
||||
// DEBUG_LOG() << " the time of the participant is older than the BoobyTrap participantId=" << participantPos.participantId()
|
||||
// DEBUG_LOG(m_logger) << " the time of the participant is older than the BoobyTrap participantId=" << participantPos.participantId()
|
||||
// << " participantPos.sampleTime()=" << participantPos.sampleTime()
|
||||
// << " data.sampleTime()=" << data.sampleTime()
|
||||
// << " diff =" << participantPos.sampleTime() - data.sampleTime();
|
||||
// continue;
|
||||
// }
|
||||
// DEBUG_LOG() << "pos participantId=" << participantPos.participantId()
|
||||
// DEBUG_LOG(m_logger) << "pos participantId=" << participantPos.participantId()
|
||||
// << " buildingId=" << participantPos.buildingId()
|
||||
// << " insideBuilding=" << participantPos.insideBuilding()
|
||||
// << " positionValid=" << participantPos.positionValid
|
||||
@@ -252,7 +252,7 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
}
|
||||
default:
|
||||
{
|
||||
DEBUG_LOG() << "default";
|
||||
DEBUG_LOG(m_logger) << "default";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -264,28 +264,28 @@ void HandlerParticipantBoobyTrap::onAesItemViewChanged(const AreaEffectSimulatio
|
||||
|
||||
void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantsSecondary(int aesItemId, int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "calculateBoobyTrapParticipantsSecondary : aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "calculateBoobyTrapParticipantsSecondary : aesItemId=" << aesItemId;
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
{
|
||||
if (participantPos.participantId() == participantId)
|
||||
{
|
||||
DEBUG_LOG() << "is already handled participantId=" << participantId;
|
||||
DEBUG_LOG(m_logger) << "is already handled participantId=" << participantId;
|
||||
continue;
|
||||
}
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
{
|
||||
// DEBUG_LOG() << "isOutdated participantId=" << participantPos.participantId();
|
||||
// DEBUG_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId();
|
||||
continue;
|
||||
}
|
||||
if (participantPos.insideBuilding())
|
||||
{
|
||||
DEBUG_LOG() << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
continue;
|
||||
}
|
||||
if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
continue;
|
||||
}
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemView = m_boobyTrapItemsSecondary.value(aesItemId);
|
||||
@@ -295,7 +295,7 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantsSecondary(int ae
|
||||
|
||||
bool HandlerParticipantBoobyTrap::insideSecondaryArea(const QPolygonF &polygonf, const QPointF &participantPos) const
|
||||
{
|
||||
DEBUG_LOG() << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
DEBUG_LOG(m_logger) << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
return polygonf.containsPoint(participantPos, Qt::OddEvenFill);
|
||||
}
|
||||
|
||||
@@ -306,19 +306,19 @@ bool HandlerParticipantBoobyTrap::enteredOrCrossedArea(const QPolygonF &polygonf
|
||||
#else
|
||||
bool result = polygonf.intersects(participantStep);
|
||||
#endif
|
||||
DEBUG_LOG() << "enteredOrCrossedArea : " << CentralEffectSimulation::debug(participantStep[0])
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : " << CentralEffectSimulation::debug(participantStep[0])
|
||||
<< " to " << CentralEffectSimulation::debug(participantStep[1])
|
||||
<< " result = " << result;
|
||||
for (int i = 0; i < polygonf.size(); i++)
|
||||
{
|
||||
const QPointF point = polygonf[i];
|
||||
DEBUG_LOG() << "polygonf[" << i << "]="
|
||||
DEBUG_LOG(m_logger) << "polygonf[" << i << "]="
|
||||
<< point.x() << "/" << point.y();
|
||||
}
|
||||
for (int i = 0; i < participantStep.size(); i++)
|
||||
{
|
||||
const QPointF point = participantStep[i];
|
||||
DEBUG_LOG() << "participantStep[" << i << "]="
|
||||
DEBUG_LOG(m_logger) << "participantStep[" << i << "]="
|
||||
<< point.x() << "/" << point.y();
|
||||
}
|
||||
//return polygonf.containsPoint(participantStep, Qt::OddEvenFill);
|
||||
@@ -335,10 +335,10 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantSecondary(const C
|
||||
const QPointF impactPosGeo = QPointF(boobyTrap.impactPosition().lon(), boobyTrap.impactPosition().lat());
|
||||
|
||||
|
||||
DEBUG_LOG() << "calculateBoobyTrapParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateBoobyTrapParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
|
||||
DEBUG_LOG() << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight);
|
||||
bool completeEnclosed = false;
|
||||
@@ -352,30 +352,30 @@ void HandlerParticipantBoobyTrap::calculateBoobyTrapParticipantSecondary(const C
|
||||
//dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel);
|
||||
if ( buildingIds.size() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Gebaeude verdeckt den Minentreffer participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "Gebaeude verdeckt den Minentreffer participantId=" << participantPos.participantId();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!aesItemView.boundingBox.containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
DEBUG_LOG() << "not in boundingBox " << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId();
|
||||
else
|
||||
DEBUG_LOG() << "in boundingBox" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "in boundingBox" << participantPos.participantId();
|
||||
// const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), aesItemView.zone);
|
||||
|
||||
|
||||
result = insideSecondaryArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "insideSecondaryArea : "
|
||||
DEBUG_LOG(m_logger) << "insideSecondaryArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "result BoobyTrap Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result BoobyTrap Explosion = " << result;
|
||||
if (result)
|
||||
{
|
||||
DEBUG_LOG() << "sendParticipantEvent";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent";
|
||||
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
DEBUG_LOG() << "sendParticipantHit";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit";
|
||||
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
}
|
||||
} // calculateBoobyTrapParticipantSecondary
|
||||
@@ -385,7 +385,7 @@ bool HandlerParticipantBoobyTrap::intersectsBoundingBoxCheck(const CentralEffect
|
||||
const int participantId)
|
||||
{
|
||||
bool result = false;
|
||||
DEBUG_LOG() << "intersectsBoundingBoxCheck participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "intersectsBoundingBoxCheck participantId=" << participantId
|
||||
<< " itemViewId=" << itemView.aesItemId
|
||||
<< " m_zone=" << itemView.zone;
|
||||
const QPolygonF stepPoly = m_handlerParticipant->getParticipantStep(participantId, itemView.zone);
|
||||
@@ -393,10 +393,10 @@ bool HandlerParticipantBoobyTrap::intersectsBoundingBoxCheck(const CentralEffect
|
||||
return false;
|
||||
|
||||
|
||||
DEBUG_LOG() << "stepPoly von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y()
|
||||
DEBUG_LOG(m_logger) << "stepPoly von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y()
|
||||
<< " bis=" << stepPoly.at(1).x() << "/" << stepPoly.at(1).y()
|
||||
<< " m_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)
|
||||
@@ -404,7 +404,7 @@ bool HandlerParticipantBoobyTrap::intersectsBoundingBoxCheck(const CentralEffect
|
||||
#else
|
||||
result = itemView.boundingBox.intersects(stepPoly);
|
||||
#endif
|
||||
DEBUG_LOG() << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result;
|
||||
DEBUG_LOG(m_logger) << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result;
|
||||
return result;
|
||||
|
||||
}
|
||||
@@ -413,7 +413,7 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "calculateBoobyTrapParticipant itemView.id=" << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateBoobyTrapParticipant itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
|
||||
// Check coverage by a building
|
||||
@@ -433,28 +433,28 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
|
||||
if (buildingIds.size() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "coverage by building id =" << buildingIds[0];
|
||||
DEBUG_LOG(m_logger) << "coverage by building id =" << buildingIds[0];
|
||||
return false;
|
||||
}
|
||||
|
||||
const QPointF partPosUtm = CentralEffectSimulation::geographic2Utm(participantPos.pos(), -1);
|
||||
DEBUG_LOG() << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "BoobyTrap id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight)
|
||||
<< " participantPos=" << partPosUtm.x() << "/" << partPosUtm.y();
|
||||
if (!aesItemView.boundingBox.containsPoint(partPosUtm, Qt::OddEvenFill))
|
||||
{
|
||||
DEBUG_LOG() << "not in boundingBox " << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "not in boundingBox " << participantPos.participantId();
|
||||
bool intersectsBoundingBox = intersectsBoundingBoxCheck(aesItemView, participantPos.participantId());
|
||||
if (!intersectsBoundingBox)
|
||||
{
|
||||
DEBUG_LOG() << "Continue nach Bounding BoxCheck itemView: " << aesItemView.aesItemId << ", "
|
||||
DEBUG_LOG(m_logger) << "Continue nach Bounding BoxCheck itemView: " << aesItemView.aesItemId << ", "
|
||||
<< " paricipantId=" << participantPos.participantId();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
DEBUG_LOG() << "in boundingBox participantId=" << participantPos.participantId();
|
||||
DEBUG_LOG(m_logger) << "in boundingBox participantId=" << participantPos.participantId();
|
||||
const QPolygonF posStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), aesItemView.zone);
|
||||
|
||||
|
||||
@@ -462,19 +462,19 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
return false;
|
||||
|
||||
const bool result = enteredOrCrossedArea(aesItemView.form, posStepPoly);
|
||||
DEBUG_LOG() << "enteredOrCrossedArea : "
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "result BoobyTrap Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result BoobyTrap Explosion = " << result;
|
||||
if (result)
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcBoobyTrapTrigger id=" << aesItemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "sendFtcBoobyTrapTrigger id=" << aesItemView.aesItemId;
|
||||
sendFtcBoobyTrapTrigger(aesItemView.aesItemId);
|
||||
DEBUG_LOG() << "sendParticipantEvent";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent";
|
||||
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
DEBUG_LOG() << "sendParticipantHit";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit";
|
||||
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
//calculateBoobyTrapParticipantsSecondary(aesItemView.aesItemId, participantPos.participantId() );
|
||||
}
|
||||
@@ -484,7 +484,7 @@ bool HandlerParticipantBoobyTrap::calculateBoobyTrapParticipant(const CentralEff
|
||||
void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos)
|
||||
{
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG() << "ParicipantPos "
|
||||
DEBUG_LOG(m_logger) << "ParicipantPos "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " participantPos: lat=" << partPos.pos().lat()
|
||||
@@ -493,13 +493,13 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "Not handle position: participant has vulnerability state CatastrophicKill";
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has vulnerability state CatastrophicKill";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.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;
|
||||
}
|
||||
|
||||
@@ -508,7 +508,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
if (!calculateBoobyTrapParticipant(boobyTrap, partPos))
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "boobyTrap id = " << boobyTrap.aesItemId
|
||||
DEBUG_LOG(m_logger) << "boobyTrap id = " << boobyTrap.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(boobyTrap.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(boobyTrap.boundingBoxTopRight);
|
||||
|
||||
@@ -518,7 +518,7 @@ void HandlerParticipantBoobyTrap::onParticipantPositionChanged(const CentralEffe
|
||||
return;
|
||||
|
||||
const bool result = enteredOrCrossedArea(boobyTrap.form, posStepPoly);
|
||||
DEBUG_LOG() << "result BoobyTrap Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result BoobyTrap Explosion = " << result;
|
||||
if (result)
|
||||
sendParticipantEvent(boobyTrap, partPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
}
|
||||
@@ -536,13 +536,13 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition,
|
||||
const ProjectDataManagement::EventType eventType)
|
||||
{
|
||||
DEBUG_LOG() << "sendParticipantEvent aesItemId=" << boobyTrapItem.aesItemId
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent aesItemId=" << boobyTrapItem.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
|
||||
if ((m_triggeredMineParticipant.contains(boobyTrapItem.aesItemId))
|
||||
&& (m_triggeredMineParticipant.value(boobyTrapItem.aesItemId) == participantPosition.participantId()))
|
||||
{
|
||||
DEBUG_LOG() << "m_triggeredMineParticipant already sent "
|
||||
DEBUG_LOG(m_logger) << "m_triggeredMineParticipant already sent "
|
||||
<< " aesItemId=" << boobyTrapItem.aesItemId
|
||||
<< " participantId=" << participantPosition.participantId();
|
||||
return;
|
||||
@@ -563,7 +563,7 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
if (m_boobyTraps.contains(boobyTrapItem.aesItemId))
|
||||
{
|
||||
INFO_LOG() << "BoobyTrap Position found";
|
||||
INFO_LOG(m_logger) << "BoobyTrap Position found";
|
||||
AreaEffectSimulation::BoobyTrap boobyTrap = m_boobyTraps.value(boobyTrapItem.aesItemId);
|
||||
|
||||
pe.position().lat(boobyTrap.impactPosition().lat());
|
||||
@@ -571,14 +571,14 @@ void HandlerParticipantBoobyTrap::sendParticipantEvent(const CentralEffectSimula
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "No BoobyTrap Position found";
|
||||
INFO_LOG(m_logger) << "No BoobyTrap Position found";
|
||||
pe.position(participantPosition.pos());
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::BoobyTrap &bt = m_ddsHandler->dtcAes()->boobyTrap(boobyTrapItem.aesItemId);
|
||||
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
@@ -622,7 +622,7 @@ void HandlerParticipantBoobyTrap::sendParticipantHit(const CentralEffectSimulati
|
||||
//pos.position(position);
|
||||
//pos.reportingSource(participantPosition.reportingSource());
|
||||
|
||||
DEBUG_LOG() << "sendParticipantHit participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId
|
||||
<< " equipmentNumber=" << equipNo
|
||||
<< " chargeTypeId=" << boobyTrap.chargeStruct.chargeTypeId()
|
||||
<< " eventType=" << eventType
|
||||
@@ -649,17 +649,17 @@ void HandlerParticipantBoobyTrap::sendParticipantHit(const CentralEffectSimulati
|
||||
void HandlerParticipantBoobyTrap::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerParticipantBoobyTrap::onBoobyTrapTriggerReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Can not send BoobyTrapTriggerReply: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Can not send BoobyTrapTriggerReply: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onBoobyTrapTriggerReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onBoobyTrapTriggerReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
|
||||
@@ -669,7 +669,7 @@ void HandlerParticipantBoobyTrap::sendFtcBoobyTrapTrigger(int aesItemId)
|
||||
AreaEffectSimulation::BoobyTrapTriggerRequest hr;
|
||||
hr.id(aesItemId);
|
||||
hr.triggered(true);
|
||||
DEBUG_LOG() << "sendFtcAesRemoveBoobyTrap: id=" << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcAesRemoveBoobyTrap: id=" << hr;
|
||||
ftcAes->boobyTrapTriggerRequest(hr, this);
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ void HandlerParticipantBoobyTrap::sendFtcCesHitRequestTimeout()
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
}
|
||||
m_requestMap.clear();
|
||||
|
||||
+50
-50
@@ -28,7 +28,7 @@ HandlerParticipantOffRouteMine::HandlerParticipantOffRouteMine(const std::shared
|
||||
, m_timer(new QTimer(this))
|
||||
, m_logger(CentralEffectSimulation::getLogger("Plugin.VirtualMines.HandlerParticipantOffRouteMine"))
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::HandlerParticipantOffRouteMine";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::HandlerParticipantOffRouteMine";
|
||||
m_timer->setSingleShot(true);
|
||||
connect(m_timer, &QTimer::timeout, this, &HandlerParticipantOffRouteMine::sendFtcCesHitRequestTimeout);
|
||||
} // end of ctor()
|
||||
@@ -36,13 +36,13 @@ HandlerParticipantOffRouteMine::HandlerParticipantOffRouteMine(const std::shared
|
||||
|
||||
HandlerParticipantOffRouteMine::~HandlerParticipantOffRouteMine()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::~HandlerParticipantOffRouteMine";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::~HandlerParticipantOffRouteMine";
|
||||
} // end of dtor()
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
bool HandlerParticipantOffRouteMine::init()
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::init";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::init";
|
||||
auto dtcAes = m_ddsHandler->dtcAes();
|
||||
auto ftcAes = m_ddsHandler->ftcAes();
|
||||
auto dtcCes = m_ddsHandler->dtsCes();
|
||||
@@ -72,7 +72,7 @@ bool HandlerParticipantOffRouteMine::init()
|
||||
}
|
||||
|
||||
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::init() finished. ";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::init() finished. ";
|
||||
return true;
|
||||
} // end of init()
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -94,13 +94,13 @@ void HandlerParticipantOffRouteMine::onOffRouteMineChanged(const AreaEffectSimul
|
||||
m_offRouteMineItemsSecondary.remove(data.id());
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::onOffRouteMineChanged";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::onOffRouteMineChanged";
|
||||
m_offRouteMines.insert(data.id(), data);
|
||||
}
|
||||
|
||||
void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "HandlerParticipantOffRouteMine::onAesItemViewChanged";
|
||||
INFO_LOG(m_logger) << "HandlerParticipantOffRouteMine::onAesItemViewChanged";
|
||||
if ( data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired
|
||||
|| data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved
|
||||
|| modType == DataModification::eRemoved)
|
||||
@@ -114,7 +114,7 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
|
||||
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;
|
||||
@@ -137,32 +137,32 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
|
||||
m_offRouteMineItems.insert(data.aesItemId(), aesItemViewUtm);
|
||||
if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary)
|
||||
m_offRouteMineItemsSecondary.insert(data.aesItemId(), aesItemViewUtm);
|
||||
// DEBUG_LOG() << "Check each participant";
|
||||
// DEBUG_LOG(m_logger) << "Check each participant";
|
||||
// // Check each participant
|
||||
// const auto partPosMap = m_handlerParticipant->positions();
|
||||
// for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
// {
|
||||
// if (m_handlerParticipant->isOutdated(participantPos))
|
||||
// {
|
||||
// DEBUG_LOG() << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
// DEBUG_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
// if (participantPos.insideBuilding())
|
||||
// {
|
||||
// DEBUG_LOG() << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
// DEBUG_LOG(m_logger) << "inside Building participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
// if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
// {
|
||||
// DEBUG_LOG() << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
// DEBUG_LOG(m_logger) << "CatastrophicKill participantId=" << participantPos.participantId() << " continue";
|
||||
// continue;
|
||||
// }
|
||||
//// if (participantPos.sampleTime() < data.sampleTime())
|
||||
//// {
|
||||
//// DEBUG_LOG() << " the time of the participant is older than the OffRouteMine participantId=" << participantPos.participantId();
|
||||
//// DEBUG_LOG(m_logger) << " the time of the participant is older than the OffRouteMine participantId=" << participantPos.participantId();
|
||||
//// continue;
|
||||
//// }
|
||||
// DEBUG_LOG() << "pos participantId=" << participantPos.participantId()
|
||||
// DEBUG_LOG(m_logger) << "pos participantId=" << participantPos.participantId()
|
||||
// << " buildingId=" << participantPos.buildingId()
|
||||
// << " insideBuilding=" << participantPos.insideBuilding()
|
||||
// << " positionValid=" << participantPos.positionValid;
|
||||
@@ -173,7 +173,7 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
|
||||
}
|
||||
default:
|
||||
{
|
||||
DEBUG_LOG() << "remove OffRouteMine";
|
||||
DEBUG_LOG(m_logger) << "remove OffRouteMine";
|
||||
m_offRouteMineItems.remove(aesItemId);
|
||||
}
|
||||
}
|
||||
@@ -186,13 +186,13 @@ void HandlerParticipantOffRouteMine::onAesItemViewChanged(const AreaEffectSimula
|
||||
|
||||
void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantsSecondary(int aesItemId)
|
||||
{
|
||||
DEBUG_LOG() << "calculateOffRouteMineParticipantsSecondary : aesItemId=" << aesItemId;
|
||||
DEBUG_LOG(m_logger) << "calculateOffRouteMineParticipantsSecondary : aesItemId=" << aesItemId;
|
||||
const auto partPosMap = m_handlerParticipant->positions();
|
||||
for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap)
|
||||
{
|
||||
if (m_handlerParticipant->isOutdated(participantPos))
|
||||
{
|
||||
// DEBUG_LOG() << "isOutdated participantId=" << participantPos.participantId();
|
||||
// DEBUG_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId();
|
||||
continue;
|
||||
}
|
||||
const CentralEffectSimulation::AesItemViewUtm aesItemView = m_offRouteMineItemsSecondary.value(aesItemId);
|
||||
@@ -202,7 +202,7 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantsSecondary(
|
||||
|
||||
bool HandlerParticipantOffRouteMine::insideSecondaryArea(const QPolygonF &polygonf, const QPointF &participantPos) const
|
||||
{
|
||||
DEBUG_LOG() << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
DEBUG_LOG(m_logger) << "pos to check: " << CentralEffectSimulation::debug(participantPos) ;
|
||||
return polygonf.containsPoint(participantPos, Qt::OddEvenFill);
|
||||
}
|
||||
|
||||
@@ -213,19 +213,19 @@ bool HandlerParticipantOffRouteMine::enteredOrCrossedArea(const QPolygonF &polyg
|
||||
#else
|
||||
bool result = polygonf.intersects(participantStep);
|
||||
#endif
|
||||
DEBUG_LOG() << "enteredOrCrossedArea : " << CentralEffectSimulation::debug(participantStep[0])
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : " << CentralEffectSimulation::debug(participantStep[0])
|
||||
<< " to " << CentralEffectSimulation::debug(participantStep[1])
|
||||
<< " result = " << result;
|
||||
for (int i = 0; i < polygonf.size(); i++)
|
||||
{
|
||||
const QPointF point = polygonf[i];
|
||||
DEBUG_LOG() << "polygonf[" << i << "]="
|
||||
DEBUG_LOG(m_logger) << "polygonf[" << i << "]="
|
||||
<< point.x() << "/" << point.y();
|
||||
}
|
||||
for (int i = 0; i < participantStep.size(); i++)
|
||||
{
|
||||
const QPointF point = participantStep[i];
|
||||
DEBUG_LOG() << "participantStep[" << i << "]="
|
||||
DEBUG_LOG(m_logger) << "participantStep[" << i << "]="
|
||||
<< point.x() << "/" << point.y();
|
||||
}
|
||||
//return polygonf.containsPoint(participantStep, Qt::OddEvenFill);
|
||||
@@ -239,10 +239,10 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantSecondary(c
|
||||
bool result;
|
||||
const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPos.pos(), aesItemView.zone);
|
||||
|
||||
DEBUG_LOG() << "calculateOffRouteMineParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateOffRouteMineParticipantSecondary itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
|
||||
DEBUG_LOG() << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight);
|
||||
|
||||
@@ -257,23 +257,23 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipantSecondary(c
|
||||
});
|
||||
// if (!boundingBoxAesItemView.containsPoint(partPosGeo, Qt::OddEvenFill))
|
||||
// {
|
||||
// DEBUG_LOG() << "not in boundingBox";
|
||||
// DEBUG_LOG(m_logger) << "not in boundingBox";
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
result = insideSecondaryArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "insideSecondaryArea : "
|
||||
DEBUG_LOG(m_logger) << "insideSecondaryArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "result OffRouteMine Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result OffRouteMine Explosion = " << result;
|
||||
if (result)
|
||||
{
|
||||
DEBUG_LOG() << "sendParticipantEvent";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent";
|
||||
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine); //69
|
||||
DEBUG_LOG() << "sendParticipantHit";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit";
|
||||
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine); // 49
|
||||
}
|
||||
} // calculateOffRouteMineParticipantSecondary
|
||||
@@ -283,10 +283,10 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipant(const Cent
|
||||
const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "calculateOffRouteMineParticipant itemView.id=" << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "calculateOffRouteMineParticipant itemView.id=" << aesItemView.aesItemId
|
||||
<< " participantId=" << participantPos.participantId();
|
||||
|
||||
DEBUG_LOG() << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
DEBUG_LOG(m_logger) << "OffRouteMine id = " << aesItemView.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(aesItemView.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(aesItemView.boundingBoxTopRight);
|
||||
|
||||
@@ -296,19 +296,19 @@ void HandlerParticipantOffRouteMine::calculateOffRouteMineParticipant(const Cent
|
||||
return;
|
||||
|
||||
const bool result = enteredOrCrossedArea(aesItemView.form, posStepPoly);
|
||||
DEBUG_LOG() << "enteredOrCrossedArea : "
|
||||
DEBUG_LOG(m_logger) << "enteredOrCrossedArea : "
|
||||
<< " participantId=" << participantPos.participantId()
|
||||
<< " aesItemId=" << aesItemView.aesItemId
|
||||
<< " result=" << result;
|
||||
// const bool result = enteredOrCrossedArea(aesItemView.form, partPosGeo);
|
||||
DEBUG_LOG() << "result OffRouteMine Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result OffRouteMine Explosion = " << result;
|
||||
if (result)
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcOffRouteMineTrigger id=" << aesItemView.aesItemId;
|
||||
DEBUG_LOG(m_logger) << "sendFtcOffRouteMineTrigger id=" << aesItemView.aesItemId;
|
||||
sendFtcOffRouteMineTrigger(aesItemView.aesItemId);
|
||||
DEBUG_LOG() << "sendParticipantEvent";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent";
|
||||
sendParticipantEvent(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
DEBUG_LOG() << "sendParticipantHit";
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit";
|
||||
sendParticipantHit(aesItemView, participantPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
calculateOffRouteMineParticipantsSecondary(aesItemView.aesItemId);
|
||||
}
|
||||
@@ -319,7 +319,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(partPos.participantTypeId());
|
||||
|
||||
// Bounding Box von der Linie
|
||||
DEBUG_LOG() << "ParicipantPos "
|
||||
DEBUG_LOG(m_logger) << "ParicipantPos "
|
||||
<< " participantId=" << partPos.participantId()
|
||||
<< " participantTypeId=" << partPos.participantTypeId()
|
||||
<< " typeClass=" << typeClass
|
||||
@@ -329,7 +329,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
|
||||
if (partPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState::inner_enum::CatastrophicKill)
|
||||
{
|
||||
DEBUG_LOG() << "Not handle position: participant has vulnerability state CatastrophicKill";
|
||||
DEBUG_LOG(m_logger) << "Not handle position: participant has vulnerability state CatastrophicKill";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -337,13 +337,13 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
&& typeClass != ParticipantManagement::TypeClass_def::WeaponSystem
|
||||
&& typeClass != ParticipantManagement::TypeClass_def::VehicleWithGear)
|
||||
{
|
||||
INFO_LOG() << "Not handle position: No type vehicle ";
|
||||
INFO_LOG(m_logger) << "Not handle position: No type vehicle ";
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_handlerParticipant->getEquipmentNumber(partPos.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;
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
{
|
||||
calculateOffRouteMineParticipant(offRouteMine, partPos);
|
||||
|
||||
DEBUG_LOG() << "offRouteMine id = " << offRouteMine.aesItemId
|
||||
DEBUG_LOG(m_logger) << "offRouteMine id = " << offRouteMine.aesItemId
|
||||
<< ", Box bottomLeft = " << CentralEffectSimulation::debug(offRouteMine.boundingBoxBottomLeft)
|
||||
<< ", topRight = " << CentralEffectSimulation::debug(offRouteMine.boundingBoxTopRight);
|
||||
|
||||
@@ -376,7 +376,7 @@ void HandlerParticipantOffRouteMine::onParticipantPositionChanged(const CentralE
|
||||
posStepPoly.append(utmStepPoly[0]);
|
||||
posStepPoly.append(utmStepPoly[1]);
|
||||
const bool result = enteredOrCrossedArea(offRouteMine.form, posStepPoly);
|
||||
DEBUG_LOG() << "result offRouteMine Explosion = " << result;
|
||||
DEBUG_LOG(m_logger) << "result offRouteMine Explosion = " << result;
|
||||
if (result)
|
||||
sendParticipantEvent(offRouteMine, partPos, ProjectDataManagement::EventType_def::HitMine);
|
||||
}
|
||||
@@ -409,7 +409,7 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
|
||||
CentralEffectSimulation::ParticipantEvent pe;
|
||||
if (m_offRouteMines.contains(offRouteItem.aesItemId))
|
||||
{
|
||||
INFO_LOG() << "OffRouteMine Position found";
|
||||
INFO_LOG(m_logger) << "OffRouteMine Position found";
|
||||
AreaEffectSimulation::OffRouteMine offRouteMine = m_offRouteMines.value(offRouteItem.aesItemId);
|
||||
|
||||
pe.position().lat(offRouteMine.area().cornerBottomLeft().lat());
|
||||
@@ -417,13 +417,13 @@ void HandlerParticipantOffRouteMine::sendParticipantEvent(const CentralEffectSim
|
||||
}
|
||||
else
|
||||
{
|
||||
INFO_LOG() << "No OffRouteMine Position found";
|
||||
INFO_LOG(m_logger) << "No OffRouteMine Position found";
|
||||
pe.position(participantPosition.pos());
|
||||
}
|
||||
|
||||
const AreaEffectSimulation::OffRouteMine &of = m_ddsHandler->dtcAes()->offRouteMine(offRouteItem.aesItemId);
|
||||
|
||||
DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId()
|
||||
<< " lat= " << participantPosition.pos().lat()
|
||||
<< " lon= " << participantPosition.pos().lon()
|
||||
<< " equipmentNumber=" << equipmentNumber
|
||||
@@ -453,7 +453,7 @@ void HandlerParticipantOffRouteMine::sendParticipantHit(const CentralEffectSimul
|
||||
const int participantId = participantPosition.participantId();
|
||||
const int originatorEquipNo = 0;
|
||||
|
||||
DEBUG_LOG() << "sendParticipantHit participantId=" << participantId
|
||||
DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId
|
||||
<< " equipmentNumber=" << equipNo;
|
||||
|
||||
Core::GeoPosition position;
|
||||
@@ -492,17 +492,17 @@ void HandlerParticipantOffRouteMine::sendParticipantHit(const CentralEffectSimul
|
||||
void HandlerParticipantOffRouteMine::onSendCesHitReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
//if (replyObject.error())
|
||||
// WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject();
|
||||
// WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject();
|
||||
//else
|
||||
DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
void HandlerParticipantOffRouteMine::onOffRouteMineTriggerReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Can not send OffRouteMineTriggerReply: " << replyObject();
|
||||
ERROR_LOG(m_logger) << "Can not send OffRouteMineTriggerReply: " << replyObject();
|
||||
else
|
||||
DEBUG_LOG() << "onOffRouteMineTriggerReply for id " << replyObject.id() << " success";
|
||||
DEBUG_LOG(m_logger) << "onOffRouteMineTriggerReply for id " << replyObject.id() << " success";
|
||||
}
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@ void HandlerParticipantOffRouteMine::sendFtcOffRouteMineTrigger(int aesItemId)
|
||||
AreaEffectSimulation::OffRouteMineTriggerRequest hr;
|
||||
hr.id(aesItemId);
|
||||
hr.triggered(true);
|
||||
DEBUG_LOG() << "send OffRouteMineTriggerRequest: id=" << hr;
|
||||
DEBUG_LOG(m_logger) << "send OffRouteMineTriggerRequest: id=" << hr;
|
||||
ftcAes->offRouteMineTriggerRequest(hr, this);
|
||||
}
|
||||
|
||||
@@ -521,7 +521,7 @@ void HandlerParticipantOffRouteMine::sendFtcCesHitRequestTimeout()
|
||||
auto ftcTab = m_ddsHandler->ftcTab();
|
||||
for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap))
|
||||
{
|
||||
DEBUG_LOG() << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr;
|
||||
ftcTab->sendCesHitRequest(hr, this);
|
||||
}
|
||||
m_requestMap.clear();
|
||||
|
||||
+5
-5
@@ -49,7 +49,7 @@ bool CesVirtualMinesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
{
|
||||
m_domainId = domainId;
|
||||
m_exerciseId = exerciseId;
|
||||
INFO_LOG() << "CesVirtualMinesInterfaceImpl::init()"
|
||||
INFO_LOG(m_logger) << "CesVirtualMinesInterfaceImpl::init()"
|
||||
<< " m_domainId=" << m_domainId
|
||||
<< " m_exerciseId=" << m_exerciseId;
|
||||
|
||||
@@ -62,7 +62,7 @@ bool CesVirtualMinesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerParticipantBoobyTrap->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerParticipantBoobyTrap failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantBoobyTrap failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ bool CesVirtualMinesInterfaceImpl::init(int domainId, int exerciseId)
|
||||
|
||||
if (!m_handlerParticipantOffRouteMine->init())
|
||||
{
|
||||
ERROR_LOG() << "Initialisation m_handlerParticipantOffRouteMine failed.";
|
||||
ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantOffRouteMine failed.";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -85,8 +85,8 @@ QString CesVirtualMinesInterfaceImpl::echo(const QString &message)
|
||||
{
|
||||
|
||||
QString ret(QStringLiteral("<<<< %1 >>>> CesVirtualMinesInterfaceImpl::echo").arg(message));
|
||||
INFO_LOG() << "CesVirtualMinesInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG() << "DEBUG: CesVirtualMinesInterfaceImpl::echo return:" << ret;
|
||||
INFO_LOG(m_logger) << "CesVirtualMinesInterfaceImpl::echo return:" << ret;
|
||||
DEBUG_LOG(m_logger) << "DEBUG: CesVirtualMinesInterfaceImpl::echo return:" << ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user