Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+83
-83
@@ -47,24 +47,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
if (!m_ftcAes->enableAirSupportImpactModify() || !m_dtcAes->enableExplosionSingle())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableAirSupportImpactModify or enableExplosionSingle";
|
||||
ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify or enableExplosionSingle";
|
||||
|
||||
}
|
||||
|
||||
if (!m_dtcAes->enableExplosionCluster() || !m_ftcAes->enableExplosionClusterModify() || !m_ftcAes->enableExplosionClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableExplosionClusterPauseResume() || !m_ftcAes->enableTrajectoryAdlerModify() || !m_ftcAes->enableEffectClusterFireHalt())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableExplosionCluster or enableExplosionClusterModify";
|
||||
ERROR_LOG(m_logger) << "Can not enableExplosionCluster or enableExplosionClusterModify";
|
||||
|
||||
}
|
||||
if (!m_dtcAes->enableEffectCluster() || !m_ftcAes->enableEffectClusterModify() || !m_ftcAes->enableEffectClusterReleaseReceived()
|
||||
|| !m_ftcAes->enableEffectClusterPauseResume() || !m_ftcAes->enableEffectClusterRemove())
|
||||
{
|
||||
ERROR_LOG() << "Can not enableEffectnCluster or enableEffectClusterModify";
|
||||
ERROR_LOG(m_logger) << "Can not enableEffectnCluster or enableEffectClusterModify";
|
||||
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "------ Connect Explosion Single Changed ------- ";
|
||||
DEBUG_LOG(m_logger) << "------ Connect Explosion Single Changed ------- ";
|
||||
connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::explosionSingleChanged, this, &AesHandler::onExplosionSingleChanged);
|
||||
connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::effectClusterChanged, this, &AesHandler::onEffectClusterChanged);
|
||||
|
||||
@@ -73,24 +73,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
void AesHandler::onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onOffRouteMineModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onOffRouteMineModifyReply"
|
||||
<< ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated();
|
||||
};
|
||||
|
||||
void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
DEBUG_LOG() << "onEffectClusterModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onEffectClusterModifyReply"
|
||||
<< ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated()
|
||||
<< ", additinal Info :" << replyObject.additionalInfo();
|
||||
m_requestHelper->requestReply(replyObject);
|
||||
|
||||
DEBUG_LOG() << "Got Reply";
|
||||
DEBUG_LOG(m_logger) << "Got Reply";
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
|
||||
|
||||
DEBUG_LOG() << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated();
|
||||
DEBUG_LOG(m_logger) << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated();
|
||||
ExTqTechnischeQuittung extq;
|
||||
extq.technischeDaten.beschreibung = replyObject.translated();
|
||||
extq.technischeDaten.status = Status_L32::DAT;
|
||||
@@ -100,11 +100,11 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
}
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object();
|
||||
|
||||
ERROR_LOG() << "Try send notification0";
|
||||
ERROR_LOG(m_logger) << "Try send notification0";
|
||||
m_aesId = replyObject.id();
|
||||
ProjectDataManagement::EffectSource effectSource
|
||||
= static_cast<ProjectDataManagement::EffectSource::type>(propertiesObject.value(QStringLiteral("effectSource")).toInt());
|
||||
ERROR_LOG() << "Try send notification1 " << effectSource;
|
||||
ERROR_LOG(m_logger) << "Try send notification1 " << effectSource;
|
||||
|
||||
if (effectSource != ProjectDataManagement::EffectSource::ES_ADLER)
|
||||
return;
|
||||
@@ -181,14 +181,14 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
|
||||
m_mainDispatcher->ddsHandler()->ftcNom()->createNotificationRequest(req, this);
|
||||
}
|
||||
else
|
||||
WARNING_LOG() << "No recipent found for exercise";
|
||||
WARNING_LOG(m_logger) << "No recipent found for exercise";
|
||||
|
||||
}
|
||||
|
||||
void AesHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
if (replyObject.error())
|
||||
ERROR_LOG() << "Got onCreateNotificationReply ERROR: " << replyObject.translated();
|
||||
ERROR_LOG(m_logger) << "Got onCreateNotificationReply ERROR: " << replyObject.translated();
|
||||
}
|
||||
|
||||
bool AesHandler::sendAesModifyRequest(const QJsonObject &data)
|
||||
@@ -247,7 +247,7 @@ void AesHandler::handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::C
|
||||
{
|
||||
auto strFromObj = QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact);
|
||||
m_singleExplosions.insert(data.aesDdsId, AreaEffectSimulation::AesEffectState_def::EsCreated);
|
||||
DEBUG_LOG() << "TEST SINGLE EXPLOSION CREATED " << strFromObj;
|
||||
DEBUG_LOG(m_logger) << "TEST SINGLE EXPLOSION CREATED " << strFromObj;
|
||||
}
|
||||
|
||||
void AesHandler::handleEXFire(const Feuerkampfdaten &data, int wsId)
|
||||
@@ -280,7 +280,7 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
|
||||
const auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
|
||||
|
||||
DEBUG_LOG() << "[EX-FQ(nFN)] data from SSA " << wsId << " : "
|
||||
DEBUG_LOG(m_logger) << "[EX-FQ(nFN)] data from SSA " << wsId << " : "
|
||||
<< "verein: " << data.verein << " "
|
||||
<< "kenner: " << data.kenner.underlying() << " "
|
||||
<< "feuerkampfReferenz: " << data.feuerkampfReferenz;
|
||||
@@ -295,18 +295,18 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId)
|
||||
|
||||
void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "onTrajectoryAdlerModifyReply"
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply"
|
||||
<< ", aesId :" << reply.id() << ", str :" << reply.str() << ", m_wirkmittelIndex :" << m_wirkmittelIndex
|
||||
<< ", m_data.feuerkommando.wirkmittel.size() :" << m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size();
|
||||
if (reply.error())
|
||||
ERROR_LOG() << reply.translated();
|
||||
ERROR_LOG(m_logger) << reply.translated();
|
||||
if (m_wirkmittelIndex == m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "TAB->SAA EX-MQ"
|
||||
DEBUG_LOG(m_logger) << "TAB->SAA EX-MQ"
|
||||
<< ", feuerkampfReferenz :" << m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
|
||||
DEBUG_LOG() << "onTrajectoryAdlerModifyReply " << reply.id();
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply " << reply.id();
|
||||
ExFeuerbereit exFB;
|
||||
|
||||
exFB.feuerkampfdaten.feuerkampfReferenz = m_wirkfeldPlanungsData.feuerkampfReferenz;
|
||||
@@ -318,7 +318,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r
|
||||
if (m_wirkmittelIndex < m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1)
|
||||
{
|
||||
m_wirkmittelIndex++;
|
||||
DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest"
|
||||
DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest"
|
||||
<< ", m_participantId :" << m_participantId << ", m_wirkmittelIndex :" << m_wirkmittelIndex << ", m_aesId :" << m_aesId;
|
||||
sendTrajectoryAdlerModifyRequest(m_wirkfeldPlanungsData, m_participantId, m_wirkmittelIndex, m_aesId);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r
|
||||
void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest"
|
||||
DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest"
|
||||
<< ", participantId :" << participantId << ", wirkmittelIndex :" << wirkmittelIndex << ", aesId:" << aesId;
|
||||
std::vector<Core::RelativePositionRelativeTime> geometryRef;
|
||||
geometryRef.clear();
|
||||
@@ -338,7 +338,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
|
||||
for (int subordinate : std::as_const(subordinates))
|
||||
{
|
||||
DEBUG_LOG() << "subordinates(" << participantId << ") :" << subordinate;
|
||||
DEBUG_LOG(m_logger) << "subordinates(" << participantId << ") :" << subordinate;
|
||||
subordinatePositions.append(m_dtcPpm->participantPosition(subordinate));
|
||||
}
|
||||
|
||||
@@ -385,10 +385,10 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
matrix.rotate(-grad);
|
||||
|
||||
QPointF point(pntGeo.x(), pntGeo.y());
|
||||
DEBUG_LOG() << " POS bevore rot: " << point;
|
||||
DEBUG_LOG(m_logger) << " POS bevore rot: " << point;
|
||||
|
||||
auto rotatePoint = matrix.map(point);
|
||||
DEBUG_LOG() << " POS after rot: " << rotatePoint;
|
||||
DEBUG_LOG(m_logger) << " POS after rot: " << rotatePoint;
|
||||
|
||||
pntGeo.setX(rotatePoint.x());
|
||||
pntGeo.setY(rotatePoint.y());
|
||||
@@ -410,11 +410,11 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
impactPosition.z(data.zieldaten.koordinate.hoehe);
|
||||
newRequest->impactPosition(impactPosition);
|
||||
newRequest->geometry(geometryRef);
|
||||
DEBUG_LOG() << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size();
|
||||
DEBUG_LOG(m_logger) << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size();
|
||||
|
||||
if (newRequest->aesItemId() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "newRequest->aesItemId() <=0"
|
||||
ERROR_LOG(m_logger) << "newRequest->aesItemId() <=0"
|
||||
<< ", aesItemId :" << newRequest->aesItemId();
|
||||
return;
|
||||
}
|
||||
@@ -428,12 +428,12 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat
|
||||
|
||||
void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)"
|
||||
DEBUG_LOG(m_logger) << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)"
|
||||
<< ", feuerkampfReferenz :" << data.feuerkampfReferenz << ", wirkmittel.size() :" << data.feuerkommando.wirkmittel.size();
|
||||
|
||||
if (!m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId))
|
||||
{
|
||||
ERROR_LOG() << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return";
|
||||
ERROR_LOG(m_logger) << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return";
|
||||
return;
|
||||
}
|
||||
const QString &verein = data.feuerkommando.verein;
|
||||
@@ -448,7 +448,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
if (part.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Got EffectClusterData for " << verein << " but unit not found";
|
||||
ERROR_LOG(m_logger) << "Got EffectClusterData for " << verein << " but unit not found";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -472,7 +472,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AreaEffectSimulation::AesExplosionGeometry geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
AreaEffectSimulation::Area area;
|
||||
const bool createArea = data.zieldaten.breiteRadius == 0 && data.zieldaten.tiefe == 0;
|
||||
ERROR_LOG() << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe;
|
||||
ERROR_LOG(m_logger) << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe;
|
||||
|
||||
if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Point)
|
||||
{
|
||||
@@ -485,7 +485,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
area.height(impactRadius * 2);
|
||||
area.width(impactRadius * 2);
|
||||
}
|
||||
@@ -515,28 +515,28 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG() << "centerUtm="
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
|
||||
const QPointF &bottomLeft = centerUtm.geographic(bl);
|
||||
DEBUG_LOG() << "bl="
|
||||
DEBUG_LOG(m_logger) << "bl="
|
||||
<< ", x :" << bl.x() << ", y :" << bl.y();
|
||||
DEBUG_LOG() << "bottomLeft="
|
||||
DEBUG_LOG(m_logger) << "bottomLeft="
|
||||
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
|
||||
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
DEBUG_LOG() << "area.cornerBottomLeft="
|
||||
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
|
||||
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
||||
DEBUG_LOG() << "cornerBottomLeftUtm="
|
||||
DEBUG_LOG(m_logger) << "cornerBottomLeftUtm="
|
||||
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << " Need to generate area";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area";
|
||||
if (data.feuerkommando.wirkmittel.size() == 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << " Need to generate area SINGLE";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area SINGLE";
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
|
||||
|
||||
@@ -549,7 +549,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
area.height(impactRadius * 2);
|
||||
area.width(impactRadius * 2);
|
||||
|
||||
@@ -561,25 +561,25 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft());
|
||||
const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint);
|
||||
DEBUG_LOG() << "centerUtm="
|
||||
DEBUG_LOG(m_logger) << "centerUtm="
|
||||
<< ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone;
|
||||
const QPointF bottomLeft = centerUtm.geographic(bl);
|
||||
DEBUG_LOG() << "bl="
|
||||
DEBUG_LOG(m_logger) << "bl="
|
||||
<< ", x :" << bl.x() << ", y :" << bl.y();
|
||||
DEBUG_LOG() << "bottomLeft="
|
||||
DEBUG_LOG(m_logger) << "bottomLeft="
|
||||
<< ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y();
|
||||
area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y()));
|
||||
DEBUG_LOG() << "area.cornerBottomLeft="
|
||||
DEBUG_LOG(m_logger) << "area.cornerBottomLeft="
|
||||
<< ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat();
|
||||
|
||||
const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
||||
ERROR_LOG() << "cornerBottomLeftUtm="
|
||||
ERROR_LOG(m_logger) << "cornerBottomLeftUtm="
|
||||
<< ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone;
|
||||
}
|
||||
else if (data.feuerkommando.wirkmittel.size() > 1)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << " Need to generate area AREA";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
@@ -590,7 +590,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion);
|
||||
const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId);
|
||||
|
||||
DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius;
|
||||
|
||||
|
||||
QList<AreaEffectSimulation::Area> areas;
|
||||
@@ -628,11 +628,11 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG() << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
}
|
||||
else if (data.feuerkommando.wirkmittelRakete.size() > 0)
|
||||
{
|
||||
DEBUG_LOG() << " Need to generate area AREA";
|
||||
DEBUG_LOG(m_logger) << " Need to generate area AREA";
|
||||
|
||||
geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea;
|
||||
|
||||
@@ -677,7 +677,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
|
||||
area = createMinimumRect(zone, vecPoints);
|
||||
DEBUG_LOG() << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -725,9 +725,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
|
||||
effectorData.chargeStruct().igniterFunctionId()
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
|
||||
DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG() << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
|
||||
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
|
||||
effectorData.participantId()
|
||||
= m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id();
|
||||
std::vector<Core::RelativePositionRelativeTime> flightCurve;
|
||||
@@ -735,20 +735,20 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
|
||||
const auto &startPos = m_dtcPpm->participantPosition(effectorData.participantId());
|
||||
const auto coordStart = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.pos().lon(), startPos.pos().lat());
|
||||
DEBUG_LOG() << "Start point: " << coordStart;
|
||||
DEBUG_LOG(m_logger) << "Start point: " << coordStart;
|
||||
|
||||
const auto coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0),
|
||||
effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0));
|
||||
DEBUG_LOG() << "End point: " << coordEnd;
|
||||
DEBUG_LOG(m_logger) << "End point: " << coordEnd;
|
||||
LtsCoordTrans::UtmCoordinate coordDiff = coordEnd;
|
||||
|
||||
coordDiff.x = coordDiff.x - coordStart.x;
|
||||
coordDiff.y = coordDiff.y - coordStart.y;
|
||||
DEBUG_LOG() << "Last point: " << coordDiff.x << " " << coordDiff.y;
|
||||
DEBUG_LOG() << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x);
|
||||
DEBUG_LOG(m_logger) << "Last point: " << coordDiff.x << " " << coordDiff.y;
|
||||
DEBUG_LOG(m_logger) << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x);
|
||||
|
||||
const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG() << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG(m_logger) << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
|
||||
for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt))
|
||||
{
|
||||
@@ -761,10 +761,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
QTransform matrix;
|
||||
matrix.rotate(useNewGrad);
|
||||
const QPointF point(flightPoint.offsetX(), flightPoint.offsetY());
|
||||
TRACE_LOG() << " POS bevore rot: " << point;
|
||||
TRACE_LOG(m_logger) << " POS bevore rot: " << point;
|
||||
|
||||
const auto rotatePoint = matrix.map(point);
|
||||
TRACE_LOG() << " POS after rot: " << rotatePoint;
|
||||
TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint;
|
||||
|
||||
flightPoint.offsetX() = rotatePoint.x();
|
||||
flightPoint.offsetY() = rotatePoint.y();
|
||||
@@ -785,8 +785,8 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.mhpScatterLengthDetonationHeight() = effectorAdler.streuung.laengsstreuungH;
|
||||
effectorData.mhpScatterWidth() = effectorAdler.streuung.seitenstreuung;
|
||||
effectorData.mhpScatterWidthDetonationHeight() = effectorAdler.streuung.seitenstreuungH;
|
||||
DEBUG_LOG() << effectorAdler.kenner;
|
||||
DEBUG_LOG() << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name()
|
||||
DEBUG_LOG(m_logger) << effectorAdler.kenner;
|
||||
DEBUG_LOG(m_logger) << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name()
|
||||
<< " effectorname: " << waffensystemkennerMap.key(effectorAdler.kenner);
|
||||
effectorData.peakHeight() = effectorAdler.gipfelhoehe;
|
||||
effectorVec.push_back(effectorData);
|
||||
@@ -809,14 +809,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
effectorData.chargeStruct().igniterFunctionId()
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion);
|
||||
|
||||
DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG() << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
|
||||
DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte;
|
||||
DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId();
|
||||
DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId();
|
||||
|
||||
effectorData.participantId()
|
||||
= m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id();
|
||||
if (effectorData.participantId() == 0)
|
||||
WARNING_LOG() << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner;
|
||||
WARNING_LOG(m_logger) << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner;
|
||||
effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender);
|
||||
effectorData.interval() = effectorAdler.geschoss.intervall;
|
||||
|
||||
@@ -852,7 +852,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
AreaEffectSimulation::TrajectoryGeoPosition trajectoryWithoutTime;
|
||||
|
||||
if (!AreaEffectSimulation::TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime))
|
||||
ERROR_LOG() << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein;
|
||||
ERROR_LOG(m_logger) << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein;
|
||||
|
||||
|
||||
|
||||
@@ -897,12 +897,12 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
req.tla(data.zieldaten.zog);
|
||||
|
||||
if (data.feuerkommando.wirkmittel.empty())
|
||||
DEBUG_LOG() << "flugzeit :"
|
||||
DEBUG_LOG(m_logger) << "flugzeit :"
|
||||
<< " -";
|
||||
else
|
||||
DEBUG_LOG() << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit;
|
||||
DEBUG_LOG(m_logger) << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit;
|
||||
|
||||
DEBUG_LOG() << "SEND " << data.feuerkampfReferenz << " ";
|
||||
DEBUG_LOG(m_logger) << "SEND " << data.feuerkampfReferenz << " ";
|
||||
int ammoCounter = 0;
|
||||
std::vector<ProjectDataManagement::L27_EffectorId> refWirkmittel;
|
||||
refWirkmittel.reserve(data.feuerkommando.wirkmittel.size());
|
||||
@@ -910,7 +910,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId)
|
||||
for (const auto &wm : std::as_const(data.feuerkommando.wirkmittel))
|
||||
{
|
||||
ammoCounter += wm.geschoss.anzahl;
|
||||
DEBUG_LOG() << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
|
||||
DEBUG_LOG(m_logger) << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner;
|
||||
refWirkmittel.push_back(wm.kenner);
|
||||
}
|
||||
|
||||
@@ -966,7 +966,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
bool outOfAmmo = false;
|
||||
const int newAmmoAmount = std::max(0, refAmmoCounter - 1);
|
||||
|
||||
DEBUG_LOG() << "Handle ammo count - ID: " << aes.id() << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter
|
||||
DEBUG_LOG(m_logger) << "Handle ammo count - ID: " << aes.id() << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter
|
||||
<< " | newAmmoCount: " << newAmmoAmount;
|
||||
|
||||
if (newAmmoAmount <= 0)
|
||||
@@ -991,7 +991,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo
|
||||
exvm.feuerkampfdaten.kenner = kenner;
|
||||
exvm.feuerkampfdaten.verein = data.verein;
|
||||
|
||||
DEBUG_LOG() << "------------ SENDE ExVollzugsmeldung für ------------ " << kenner;
|
||||
DEBUG_LOG(m_logger) << "------------ SENDE ExVollzugsmeldung für ------------ " << kenner;
|
||||
|
||||
m_mainDispatcher->jsonDispatcher()->sendExVollzugsmeldung(exvm, saaPartyId);
|
||||
}
|
||||
@@ -1014,15 +1014,15 @@ void AesHandler::removeAllPendingEffectCluster(int partyId)
|
||||
if (effectClusterIds.isEmpty())
|
||||
return;
|
||||
|
||||
INFO_LOG() << "Pending effect cluster size: " << effectClusterIds.size();
|
||||
INFO_LOG(m_logger) << "Pending effect cluster size: " << effectClusterIds.size();
|
||||
Core::RemoveElementRequest req;
|
||||
for (const qint32 id : std::as_const(effectClusterIds))
|
||||
{
|
||||
req.id(id);
|
||||
INFO_LOG() << "Remove effect cluster id: " << id;
|
||||
INFO_LOG(m_logger) << "Remove effect cluster id: " << id;
|
||||
|
||||
qint32 ret = m_ftcAes->effectClusterRemoveRequest(req);
|
||||
INFO_LOG() << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret;
|
||||
INFO_LOG(m_logger) << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1046,13 +1046,13 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
{
|
||||
DEBUG_LOG() << "----------------- remove area ------------- ";
|
||||
DEBUG_LOG(m_logger) << "----------------- remove area ------------- ";
|
||||
m_singleExplosions.remove(data.id());
|
||||
return;
|
||||
}
|
||||
if (modType == DataModification::eAdded)
|
||||
{
|
||||
DEBUG_LOG() << "----------------- add area ------------- " << data.effectStateId();
|
||||
DEBUG_LOG(m_logger) << "----------------- add area ------------- " << data.effectStateId();
|
||||
m_singleExplosions.insert(data.id(), data.effectStateId());
|
||||
return;
|
||||
}
|
||||
@@ -1060,7 +1060,7 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
&& m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState_def::EsActivated)
|
||||
{
|
||||
const auto state = data.effectStateId();
|
||||
DEBUG_LOG() << "----------------- switch state ------------- " << state;
|
||||
DEBUG_LOG(m_logger) << "----------------- switch state ------------- " << state;
|
||||
m_singleExplosions.insert(data.id(), state);
|
||||
QJsonObject telegram;
|
||||
telegram[QStringLiteral("typeId")] = 80082;
|
||||
@@ -1089,12 +1089,12 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
|
||||
|
||||
void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << "Try auto handle effectCluster: " << data.name();
|
||||
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: " << data.name();
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "Try auto handle effectCluster: probs: " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "Try auto handle effectCluster: probs: " << data.properties();
|
||||
|
||||
if (data.properties().empty())
|
||||
return;
|
||||
@@ -1102,20 +1102,20 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
if (!data.partyId().is_set())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "has PARTY " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "has PARTY " << data.properties();
|
||||
|
||||
if (!data.participantId().is_set())
|
||||
return;
|
||||
|
||||
if (data.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER)
|
||||
return;
|
||||
DEBUG_LOG() << "has PARTICIPANTID " << data.properties();
|
||||
DEBUG_LOG(m_logger) << "has PARTICIPANTID " << data.properties();
|
||||
|
||||
QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object();
|
||||
if (!propertiesObject.value(QStringLiteral("useReceived")).toBool())
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "has USE RECEIVED " << data.effectStateId().underlying();
|
||||
DEBUG_LOG(m_logger) << "has USE RECEIVED " << data.effectStateId().underlying();
|
||||
|
||||
switch (data.effectStateId().underlying())
|
||||
{
|
||||
@@ -1136,7 +1136,7 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste
|
||||
|
||||
|
||||
m_aesIdToFeuerkampfReferenz.remove(data.id());
|
||||
DEBUG_LOG() << "SEND MQ for " << data.name() << " " << reference;
|
||||
DEBUG_LOG(m_logger) << "SEND MQ for " << data.name() << " " << reference;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -60,16 +60,19 @@ class AesHandler
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> getFtc() { return m_ftcAes; };
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
AreaEffectSimulation::Area createMinimumRect(int zone, const QVector<QPointF> &points);
|
||||
|
||||
signals:
|
||||
void explosionSingleChanged(const QJsonObject &jsonObj);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QList<qint32> findAllPendingEffectCluster(int partyId);
|
||||
void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainDispatcher *m_mainDispatcher;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_ftcAes;
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Dtc> m_dtcAes;
|
||||
|
||||
+3
-3
@@ -25,7 +25,7 @@ bool AsmHandler::init(MainDispatcher* mainDispatcher)
|
||||
m_dtcAsm = AssetManagement::Interface::Dtc::create(mainDispatcher->ddsHandler()->ddsConnector());
|
||||
if (!m_dtcAsm->enableAsset())
|
||||
{
|
||||
ERROR_LOG()<<" Can't read data from ASM";
|
||||
ERROR_LOG(m_logger)<<" Can't read data from ASM";
|
||||
return false;
|
||||
}
|
||||
m_exerciseId = mainDispatcher->exerciseId();
|
||||
@@ -37,7 +37,7 @@ bool AsmHandler::init(MainDispatcher* mainDispatcher)
|
||||
|
||||
void AsmHandler::modifyAssetAdlerProperties(int assetId, bool isSaaConnected)
|
||||
{
|
||||
WARNING_LOG()<<">> modify asset properties: set exerciseId: "<<m_exerciseId<<" assetName: "<<assetId;
|
||||
WARNING_LOG(m_logger)<<">> modify asset properties: set exerciseId: "<<m_exerciseId<<" assetName: "<<assetId;
|
||||
|
||||
AssetManagement::Asset asset = m_dtcAsm->asset(assetId);
|
||||
if (asset.id() <= 0)
|
||||
@@ -51,7 +51,7 @@ void AsmHandler::modifyAssetAdlerProperties(int assetId, bool isSaaConnected)
|
||||
|
||||
void AsmHandler::onAssetModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got Function Reply error ? "<<reply.error();
|
||||
DEBUG_LOG(m_logger) << "Got Function Reply error ? "<<reply.error();
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -34,9 +34,11 @@ public:
|
||||
std::shared_ptr<AssetManagement::Interface::Ftc> getFtc() { return m_ftcAsm; }
|
||||
void modifyAssetAdlerProperties(int assetId, bool isSaaConnected = false);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onAssetModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<AssetManagement::Interface::Dtc> m_dtcAsm;
|
||||
std::shared_ptr<AssetManagement::Interface::Ftc> m_ftcAsm;
|
||||
int m_exerciseId;
|
||||
|
||||
+18
-18
@@ -48,7 +48,7 @@ bool FlmHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungsnummer, const QJsonObject &obj)
|
||||
{
|
||||
ERROR_LOG() << "exerciseId: " << m_exerciseId << ", partyId: " << partyId
|
||||
ERROR_LOG(m_logger) << "exerciseId: " << m_exerciseId << ", partyId: " << partyId
|
||||
<< ", name: " << name
|
||||
<< ", meldungsnummer: " << meldungsnummer;
|
||||
|
||||
@@ -58,11 +58,11 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
|
||||
const QString folderName = QStringLiteral("Messages");
|
||||
int folderHXMessagesId = m_dtcFlm->findFolder(partyFolderId, folderName);
|
||||
|
||||
ERROR_LOG() << "folderHXMessagesId: " << folderHXMessagesId;
|
||||
ERROR_LOG(m_logger) << "folderHXMessagesId: " << folderHXMessagesId;
|
||||
|
||||
if (folderHXMessagesId <= 0)
|
||||
{
|
||||
ERROR_LOG() << "Folder Messages does not exist for exerciseId: " << m_exerciseId << ", partyId: " << partyId;
|
||||
ERROR_LOG(m_logger) << "Folder Messages does not exist for exerciseId: " << m_exerciseId << ", partyId: " << partyId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
|
||||
fileContentReq.exerciseId(m_exerciseId);
|
||||
fileContentReq.operatorId(99);
|
||||
|
||||
DEBUG_LOG() << "HQ: name: " << fileContentReq.name() << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "HQ: name: " << fileContentReq.name() << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId;
|
||||
|
||||
|
||||
QRegularExpression re(QStringLiteral("_\\d+$"));
|
||||
@@ -93,12 +93,12 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
|
||||
|
||||
|
||||
baseName = baseName.normalized(QString::NormalizationForm_C);
|
||||
ERROR_LOG() << "BaseName: " << baseName << "|";
|
||||
ERROR_LOG(m_logger) << "BaseName: " << baseName << "|";
|
||||
|
||||
QStringList fileNames;
|
||||
if (!m_dtcFlm->getAllFiles(fileContentReq.fileType(), folderHXMessagesId, fileNames, true))
|
||||
{
|
||||
ERROR_LOG() << "Error while reading fileNames for folderId: " << folderHXMessagesId;
|
||||
ERROR_LOG(m_logger) << "Error while reading fileNames for folderId: " << folderHXMessagesId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -106,13 +106,13 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
|
||||
for (const QString &fileName : std::as_const(fileNames))
|
||||
{
|
||||
QString normalizedName = fileName.normalized(QString::NormalizationForm_C);
|
||||
DEBUG_LOG() << "normalized fileName: " << normalizedName << "|";
|
||||
DEBUG_LOG(m_logger) << "normalized fileName: " << normalizedName << "|";
|
||||
|
||||
if (!normalizedName.startsWith(baseName))
|
||||
continue;
|
||||
|
||||
QString rest = fileName.mid(baseName.length());
|
||||
DEBUG_LOG() << "rest: " << rest;
|
||||
DEBUG_LOG(m_logger) << "rest: " << rest;
|
||||
if (rest.contains(QStringLiteral(".")))
|
||||
rest = rest.section(QStringLiteral("."), 0, 0);
|
||||
|
||||
@@ -128,12 +128,12 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs
|
||||
if (ok)
|
||||
maxNumber = std::max(maxNumber, currentNum);
|
||||
}
|
||||
DEBUG_LOG() << " maxNumber: " << maxNumber;
|
||||
DEBUG_LOG(m_logger) << " maxNumber: " << maxNumber;
|
||||
}
|
||||
|
||||
const QString newName = baseName
|
||||
+ QStringLiteral("_") + QString::number(++maxNumber);
|
||||
DEBUG_LOG() << "newName : " << newName;
|
||||
DEBUG_LOG(m_logger) << "newName : " << newName;
|
||||
fileContentReq.name(newName.toStdString());
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
|
||||
notif.expiryTime(expiryTime);
|
||||
|
||||
int prio = s->getInteger(QStringLiteral("NOM/notificationPriority"), 3);
|
||||
DEBUG_LOG() << " Setting: NotificationPriority: " << prio;
|
||||
DEBUG_LOG(m_logger) << " Setting: NotificationPriority: " << prio;
|
||||
notif.priority(static_cast<NotificationManagement::Priority_def::type>(prio));
|
||||
notif.processedPriority(NotificationManagement::Priority_def::Low);
|
||||
notif.exerciseId(m_exerciseId);
|
||||
@@ -191,7 +191,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
|
||||
notifReq.notification(notif);
|
||||
|
||||
if (!m_ftcNom->createNotificationRequest(notifReq, this))
|
||||
ERROR_LOG() << "Error requesting create Notification data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create Notification data";
|
||||
}
|
||||
|
||||
void FlmHandler::initHQFolders(int partyId)
|
||||
@@ -201,7 +201,7 @@ void FlmHandler::initHQFolders(int partyId)
|
||||
|
||||
if (exerciseFolderId <= 0)
|
||||
{
|
||||
ERROR_LOG() << "No exercise Folder for exerciseId: " << m_exerciseId;
|
||||
ERROR_LOG(m_logger) << "No exercise Folder for exerciseId: " << m_exerciseId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -220,27 +220,27 @@ void FlmHandler::initHQFolders(int partyId)
|
||||
|
||||
void FlmHandler::onFileContentModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got Function Reply: " << reply.translated();
|
||||
DEBUG_LOG(m_logger) << "Got Function Reply: " << reply.translated();
|
||||
|
||||
if (reply.error())
|
||||
ERROR_LOG() << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error();
|
||||
ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error();
|
||||
else
|
||||
createHQNotification(m_partyId, m_folderHXMessagesId, reply.id());
|
||||
}
|
||||
|
||||
void FlmHandler::onPathCreateReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got Function Reply: " << reply.translated();
|
||||
DEBUG_LOG(m_logger) << "Got Function Reply: " << reply.translated();
|
||||
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG() << "Error while creating folders: " << reply.translated() << ", error: " << reply.error();
|
||||
ERROR_LOG(m_logger) << "Error while creating folders: " << reply.translated() << ", error: " << reply.error();
|
||||
}
|
||||
}
|
||||
|
||||
void FlmHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "FlmHandler: Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
INFO_LOG(m_logger) << "FlmHandler: Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
}
|
||||
|
||||
bool FlmHandler::parseContent(const QString &contentString, QMap<QString, QString> &retMap)
|
||||
|
||||
+2
@@ -41,12 +41,14 @@ class FlmHandler
|
||||
void initHQFolders(int partyId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onFileContentModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onPathCreateReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
bool parseContent(const QString &contentString, QMap<QString, QString> &retMap);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainDispatcher *m_mainDispatcher = nullptr;
|
||||
int m_exerciseId;
|
||||
int m_parentFolderId;
|
||||
|
||||
+97
-97
@@ -44,7 +44,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
, m_webSocketReconnectTimer(new QTimer(this))
|
||||
, m_bWarnedOnce(false)
|
||||
{
|
||||
DEBUG_LOG() << "JsonDispatcher::JsonDispatcher";
|
||||
DEBUG_LOG(m_logger) << "JsonDispatcher::JsonDispatcher";
|
||||
|
||||
m_sendToWebsocket->setWSInterface(m_webSocketInterface);
|
||||
connect(m_webSocketInterface.get(), &TrainingAreaBase::WebSocketInterface::recivedTelegram, this, &JsonDispatcher::onRecivedTelegram, Qt::UniqueConnection);
|
||||
@@ -55,19 +55,19 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
bool JsonDispatcher::init() { return true; }
|
||||
void JsonDispatcher::connectWebsocket()
|
||||
{
|
||||
DEBUG_LOG() << "JsonDispatcher::connectWebsocket()";
|
||||
DEBUG_LOG(m_logger) << "JsonDispatcher::connectWebsocket()";
|
||||
if (!m_webSocketInterface->init(Settings::getWebSocketServerPortRange(3)))
|
||||
{
|
||||
DEBUG_LOG() << "Adler Could not open WebSocketInterface";
|
||||
DEBUG_LOG(m_logger) << "Adler Could not open WebSocketInterface";
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Adler Could open WebSocketInterface on port " << m_webSocketInterface->getPort();
|
||||
DEBUG_LOG(m_logger) << "Adler Could open WebSocketInterface on port " << m_webSocketInterface->getPort();
|
||||
}
|
||||
emit websocketConnected(m_webSocketInterface->getPort());
|
||||
const QUrl url(webSocketUrl());
|
||||
if (!m_bWarnedOnce)
|
||||
DEBUG_LOG() << "Adler: Using WebSocket url: " << url.toString();
|
||||
DEBUG_LOG(m_logger) << "Adler: Using WebSocket url: " << url.toString();
|
||||
if (m_webSocket->state() != QAbstractSocket::ConnectedState)
|
||||
m_webSocket->open(url);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ void JsonDispatcher::onKeepAliveTimerTimeout()
|
||||
{
|
||||
QTimer *timer = qobject_cast<QTimer *>(sender());
|
||||
int wsId = m_connectionKeepaliveTimer.key(timer);
|
||||
DEBUG_LOG() << "onKeepAliveTimerTimeout Timeout from " << wsId << " still in list " << (getSAAByWs(wsId) != nullptr);
|
||||
DEBUG_LOG(m_logger) << "onKeepAliveTimerTimeout Timeout from " << wsId << " still in list " << (getSAAByWs(wsId) != nullptr);
|
||||
|
||||
auto saa = getSAAByWs(wsId);
|
||||
|
||||
@@ -86,14 +86,14 @@ void JsonDispatcher::onKeepAliveTimerTimeout()
|
||||
const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::NoHeartbeat;
|
||||
const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected);
|
||||
const int assetId = getAssetId(saa->getSAAName());
|
||||
DEBUG_LOG() << "Timeout from " << saa->getSAAName() << " ==> SAA URL: " << saaUrl.toString();
|
||||
DEBUG_LOG(m_logger) << "Timeout from " << saa->getSAAName() << " ==> SAA URL: " << saaUrl.toString();
|
||||
m_ppmHandler
|
||||
->modifyPartyAdlerProperties(wsId, assetId, saa->getPartyId(), saa->getSAAName(), saa->getSzenarName(), connectState, saa->getIsVerbund());
|
||||
m_mainDispatcher->asmHandler()->modifyAssetAdlerProperties(assetId, isSaaConnected);
|
||||
saa->setIsAlive(false);
|
||||
}
|
||||
else
|
||||
ERROR_LOG() << "Trying to remove an saa after timeout with the websocketId: " << wsId << " that is not connected";
|
||||
ERROR_LOG(m_logger) << "Trying to remove an saa after timeout with the websocketId: " << wsId << " that is not connected";
|
||||
|
||||
m_connectionKeepaliveTimer.remove(wsId);
|
||||
timer->stop();
|
||||
@@ -131,11 +131,11 @@ std::shared_ptr<TrainingAreaBase::SendToTab> JsonDispatcher::sendToTab() { retur
|
||||
bool JsonDispatcher::canSendData() const { return m_webSocket && m_webSocket->state() == QAbstractSocket::ConnectedState; }
|
||||
void JsonDispatcher::onNewWebsocketConnected(const int wsId, const QString &address, qint16 port)
|
||||
{
|
||||
DEBUG_LOG() << "New Connection from: " << address << ", port: " << port << ", with id: " << wsId;
|
||||
DEBUG_LOG(m_logger) << "New Connection from: " << address << ", port: " << port << ", with id: " << wsId;
|
||||
}
|
||||
void JsonDispatcher::onWSDisconnected(const int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "Connection disconnect wsId: " << wsId;
|
||||
DEBUG_LOG(m_logger) << "Connection disconnect wsId: " << wsId;
|
||||
auto saa = getSAAByWs(wsId);
|
||||
|
||||
if (saa)
|
||||
@@ -143,7 +143,7 @@ void JsonDispatcher::onWSDisconnected(const int wsId)
|
||||
}
|
||||
std::shared_ptr<SAAInterface> JsonDispatcher::getSAAByParty(const int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "getSAAByParty partyId: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "getSAAByParty partyId: " << partyId;
|
||||
if (m_saaInterfaces.empty())
|
||||
return nullptr;
|
||||
auto it
|
||||
@@ -159,9 +159,9 @@ std::shared_ptr<SAAInterface> JsonDispatcher::getSAAByName(const QString &saaNam
|
||||
|
||||
std::shared_ptr<SAAInterface> JsonDispatcher::getSAAByWs(const int wsId)
|
||||
{
|
||||
TRACE_LOG() << "m_saaInterfaces.size :" << m_saaInterfaces.size() << ", wsId=" << wsId;
|
||||
TRACE_LOG(m_logger) << "m_saaInterfaces.size :" << m_saaInterfaces.size() << ", wsId=" << wsId;
|
||||
for (int i = 0; i < m_saaInterfaces.size(); i++)
|
||||
TRACE_LOG() << "i=" << i << ", getPartyId :" << m_saaInterfaces[i]->getPartyId() << ", getWsId :" << m_saaInterfaces[i]->getWsId();
|
||||
TRACE_LOG(m_logger) << "i=" << i << ", getPartyId :" << m_saaInterfaces[i]->getPartyId() << ", getWsId :" << m_saaInterfaces[i]->getWsId();
|
||||
|
||||
auto it = std::find_if(m_saaInterfaces.begin(), m_saaInterfaces.end(), [wsId](const std::shared_ptr<SAAInterface> &saa) { return saa.get()->getWsId() == wsId; });
|
||||
return it != m_saaInterfaces.end() ? *it : nullptr;
|
||||
@@ -169,11 +169,11 @@ std::shared_ptr<SAAInterface> JsonDispatcher::getSAAByWs(const int wsId)
|
||||
|
||||
bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "TRY SEND EXFeuerbereit attempt for party " << partyId;
|
||||
DEBUG_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for party " << partyId;
|
||||
auto saa = getSAAByParty(partyId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "sendExFeuerbereit no saa for paty:" << partyId;
|
||||
ERROR_LOG(m_logger) << "sendExFeuerbereit no saa for paty:" << partyId;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const in
|
||||
exFB.sender = QStringLiteral("EXCON@GUEZ.DE");
|
||||
exFB.receiver = saa->getSAAName();
|
||||
exFB.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
WARNING_LOG() << "TRY SEND EXFeuerbereit attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
WARNING_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exFB.toJson());
|
||||
|
||||
return true;
|
||||
@@ -189,7 +189,7 @@ bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const in
|
||||
|
||||
bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "TRY SEND EXFeuerbereit attempt for party " << partyId;
|
||||
DEBUG_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for party " << partyId;
|
||||
auto saa = getSAAByParty(partyId);
|
||||
if (!saa)
|
||||
return false;
|
||||
@@ -198,7 +198,7 @@ bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int
|
||||
exAF.sender = QStringLiteral("EXCON@GUEZ.DE");
|
||||
exAF.receiver = saa->getSAAName();
|
||||
exAF.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
WARNING_LOG() << "TRY SEND sendExAbgefeuert attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
WARNING_LOG(m_logger) << "TRY SEND sendExAbgefeuert attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exAF.toJson());
|
||||
|
||||
return true;
|
||||
@@ -206,7 +206,7 @@ bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int
|
||||
|
||||
bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDataIn, int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for party " << partyId;
|
||||
DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for party " << partyId;
|
||||
auto saa = getSAAByParty(partyId);
|
||||
if (!saa)
|
||||
return false;
|
||||
@@ -215,7 +215,7 @@ bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDa
|
||||
exMQ.sender = QStringLiteral("EXCON@GUEZ.DE");
|
||||
exMQ.receiver = saa->getSAAName();
|
||||
exMQ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exMQ.toJson());
|
||||
|
||||
return true;
|
||||
@@ -223,7 +223,7 @@ bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDa
|
||||
|
||||
bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &exTQDataIn, int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "TRY SEND ExTqTechnischeQuittung attempt for party " << partyId;
|
||||
DEBUG_LOG(m_logger) << "TRY SEND ExTqTechnischeQuittung attempt for party " << partyId;
|
||||
auto saa = getSAAByParty(partyId);
|
||||
if (!saa)
|
||||
return false;
|
||||
@@ -232,7 +232,7 @@ bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &ex
|
||||
exMQ.sender = QStringLiteral("EXCON@GUEZ.DE");
|
||||
exMQ.receiver = saa->getSAAName();
|
||||
exMQ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId();
|
||||
m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exMQ.toJson());
|
||||
|
||||
return true;
|
||||
@@ -240,7 +240,7 @@ bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &ex
|
||||
|
||||
bool JsonDispatcher::sendExVollzugsmeldung(const ExVollzugsmeldung &exVZDataIn, int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "TRY SEND ExVollzugsmeldung attempt for party " << partyId;
|
||||
DEBUG_LOG(m_logger) << "TRY SEND ExVollzugsmeldung attempt for party " << partyId;
|
||||
auto saa = getSAAByParty(partyId);
|
||||
if (!saa)
|
||||
return false;
|
||||
@@ -249,33 +249,33 @@ bool JsonDispatcher::sendExVollzugsmeldung(const ExVollzugsmeldung &exVZDataIn,
|
||||
exVZ.sender = QStringLiteral("EXCON@GUEZ.DE");
|
||||
exVZ.receiver = saa->getSAAName();
|
||||
exVZ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
WARNING_LOG() << "TRY SEND ExVollzugsmeldung attempt for SAA NAME " << saa->getSAAName() << " WSID " << saa->getWsId();
|
||||
WARNING_LOG(m_logger) << "TRY SEND ExVollzugsmeldung attempt for SAA NAME " << saa->getSAAName() << " WSID " << saa->getWsId();
|
||||
m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exVZ.toJson());
|
||||
return true;
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const QString &saaName, const QString &szenarName, bool isVerbund, const QString &uuid)
|
||||
{
|
||||
DEBUG_LOG() << "Registration attempt from " << saaName << " for party " << partyId << ", saaName: " << saaName << ", uuid: " << uuid << ", wsId: " << wsId;
|
||||
DEBUG_LOG(m_logger) << "Registration attempt from " << saaName << " for party " << partyId << ", saaName: " << saaName << ", uuid: " << uuid << ", wsId: " << wsId;
|
||||
ExAnmeldebestaetigung exRC;
|
||||
exRC.referenceUuid = uuid;
|
||||
exRC.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Ok;
|
||||
auto saa = getSAAByName(saaName);
|
||||
DEBUG_LOG() << "is saa " << saa;
|
||||
DEBUG_LOG(m_logger) << "is saa " << saa;
|
||||
if (saa)
|
||||
{
|
||||
DEBUG_LOG() << "saa.get()->getPartyId(): " << saa.get()->getPartyId() << " partyId: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "saa.get()->getPartyId(): " << saa.get()->getPartyId() << " partyId: " << partyId;
|
||||
if (saa.get()->getPartyId() == partyId)
|
||||
{
|
||||
DEBUG_LOG() << "saa already connected, reconnect!";
|
||||
DEBUG_LOG(m_logger) << "saa already connected, reconnect!";
|
||||
|
||||
onSAADeregistration(saa.get()->getWsId(), partyId);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "other saa connected to this party";
|
||||
DEBUG_LOG(m_logger) << "other saa connected to this party";
|
||||
|
||||
|
||||
|
||||
@@ -283,7 +283,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
}
|
||||
else if (getSAAByParty(partyId))
|
||||
{
|
||||
DEBUG_LOG() << "party is used by other saa";
|
||||
DEBUG_LOG(m_logger) << "party is used by other saa";
|
||||
|
||||
|
||||
}
|
||||
@@ -296,10 +296,10 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
m_saaInterfaces.append(newSaa);
|
||||
|
||||
int adlerOffset = m_settings->settings()->value(QLatin1String("TrainingAreaBase/AdlerKeepalive"), 30000).toInt();
|
||||
DEBUG_LOG() << "adlerOffset =" << adlerOffset;
|
||||
DEBUG_LOG(m_logger) << "adlerOffset =" << adlerOffset;
|
||||
if (adlerOffset > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Started SAA with Keppalive Timer: " << adlerOffset;
|
||||
DEBUG_LOG(m_logger) << "Started SAA with Keppalive Timer: " << adlerOffset;
|
||||
QTimer *keepaliveTimer = new QTimer(this);
|
||||
keepaliveTimer->setInterval(adlerOffset);
|
||||
m_connectionKeepaliveTimer.insert(wsId, keepaliveTimer);
|
||||
@@ -309,7 +309,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
saa = newSaa;
|
||||
|
||||
|
||||
DEBUG_LOG() << "emit or answer without error wsId: " << wsId;
|
||||
DEBUG_LOG(m_logger) << "emit or answer without error wsId: " << wsId;
|
||||
}
|
||||
exRC.sender = getSender();
|
||||
exRC.receiver = saa->getSAAName();
|
||||
@@ -326,7 +326,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Connected;
|
||||
const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected);
|
||||
const int assetId = getAssetId(saaName);
|
||||
DEBUG_LOG() << "onSAARegistration modifyParty"
|
||||
DEBUG_LOG(m_logger) << "onSAARegistration modifyParty"
|
||||
<< " ==> SAA name " << saaName;
|
||||
createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "Reconnect to SAA")),
|
||||
NotificationManagement::MessageType_def::Success,
|
||||
@@ -340,7 +340,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
|
||||
|
||||
void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "onSAADeregistration"
|
||||
DEBUG_LOG(m_logger) << "onSAADeregistration"
|
||||
<< " wsId: " << wsId << ", partyId: " << partyId;
|
||||
auto saa = getSAAByWs(wsId);
|
||||
|
||||
@@ -349,7 +349,7 @@ void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId)
|
||||
const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Disconnected;
|
||||
const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected);
|
||||
const int assetId = getAssetId(saa->getSAAName());
|
||||
DEBUG_LOG() << "Deregistation from " << saa->getSAAName();
|
||||
DEBUG_LOG(m_logger) << "Deregistation from " << saa->getSAAName();
|
||||
createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "SAADeregistration")),
|
||||
NotificationManagement::MessageType_def::Info,
|
||||
NotificationManagement::NotificationType::AdlerNotification,
|
||||
@@ -360,12 +360,12 @@ void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId)
|
||||
m_saaInterfaces.removeOne(saa);
|
||||
}
|
||||
else
|
||||
ERROR_LOG() << "Trying to remove an saa with the websocketId: " << wsId << " that is not connected";
|
||||
ERROR_LOG(m_logger) << "Trying to remove an saa with the websocketId: " << wsId << " that is not connected";
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid)
|
||||
{
|
||||
DEBUG_LOG() << "onSAAConnectionTest"
|
||||
DEBUG_LOG(m_logger) << "onSAAConnectionTest"
|
||||
<< " wsId: " << wsId << ", uuid: " << uuid;
|
||||
|
||||
auto saa = getSAAByWs(wsId);
|
||||
@@ -379,10 +379,10 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid)
|
||||
QTimer *connectionTimer = m_connectionKeepaliveTimer.value(wsId);
|
||||
if (connectionTimer)
|
||||
{
|
||||
DEBUG_LOG() << "connectionTimer->start()";
|
||||
DEBUG_LOG(m_logger) << "connectionTimer->start()";
|
||||
connectionTimer->start();
|
||||
}
|
||||
DEBUG_LOG() << "ConnectionTest from " << saa->getSAAName();
|
||||
DEBUG_LOG(m_logger) << "ConnectionTest from " << saa->getSAAName();
|
||||
EXConnectionTestReply exCTR;
|
||||
exCTR.referenceUuid = uuid;
|
||||
exCTR.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate);
|
||||
@@ -392,13 +392,13 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid)
|
||||
}
|
||||
void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status)
|
||||
{
|
||||
DEBUG_LOG() << "onSAAStatus"
|
||||
DEBUG_LOG(m_logger) << "onSAAStatus"
|
||||
<< " wsId: " << wsId << ", status: " << static_cast<int>(status.status);
|
||||
auto saa = getSAAByWs(wsId);
|
||||
|
||||
if (saa)
|
||||
{
|
||||
DEBUG_LOG() << "Status from " << saa->getSAAName() << AdlerJson::szenarstatusToStr(status.status);
|
||||
DEBUG_LOG(m_logger) << "Status from " << saa->getSAAName() << AdlerJson::szenarstatusToStr(status.status);
|
||||
saa->setStatus(status.status);
|
||||
QString title;
|
||||
switch (status.status)
|
||||
@@ -429,7 +429,7 @@ void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status)
|
||||
QString JsonDispatcher::getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund)
|
||||
{
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(verein, partyId, isVerbund);
|
||||
DEBUG_LOG() << "ParticipantId=" << part.id();
|
||||
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id();
|
||||
|
||||
QString ppmlink = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br />"))
|
||||
.arg(part.id());
|
||||
@@ -440,11 +440,11 @@ QString JsonDispatcher::getParticipantInfoLink(const QString &verein, const int
|
||||
|
||||
void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten &exceptionStatus)
|
||||
{
|
||||
DEBUG_LOG() << "onSAAExceptionStatus"
|
||||
DEBUG_LOG(m_logger) << "onSAAExceptionStatus"
|
||||
<< ", wsId: " << wsId << ", status: " << StatusL32Map.key(exceptionStatus.status) << ", beschreibung: " << exceptionStatus.beschreibung;
|
||||
const auto saa = getSAAByWs(wsId);
|
||||
|
||||
DEBUG_LOG() << "Sende Notification Technische Quittung";
|
||||
DEBUG_LOG(m_logger) << "Sende Notification Technische Quittung";
|
||||
|
||||
QString content = QString::fromUtf8(tr_lts("Notification", "<B>Status: </B>%1<br /><B> Description: </B>%2"));
|
||||
|
||||
@@ -467,7 +467,7 @@ void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten
|
||||
|
||||
void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
|
||||
{
|
||||
DEBUG_LOG() << "onSAASQWS";
|
||||
DEBUG_LOG(m_logger) << "onSAASQWS";
|
||||
const bool isVerbund = true;
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
@@ -481,7 +481,7 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
|
||||
args.append(QString::number(exSQWS.einheit.r));
|
||||
args.append(exSQWS.einheit.verein);
|
||||
|
||||
DEBUG_LOG() << "Stellungsmeldung Waffensystem content=" << content;
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Waffensystem content=" << content;
|
||||
createNotificationRequest(wsId,
|
||||
QString::fromUtf8(tr_lts("Notification","Weapon System Position Report")),
|
||||
NotificationManagement::MessageType_def::Info,
|
||||
@@ -494,7 +494,7 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS)
|
||||
|
||||
void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS)
|
||||
{
|
||||
DEBUG_LOG() << "onSAASQFS";
|
||||
DEBUG_LOG(m_logger) << "onSAASQFS";
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
const bool isVerbund = true;
|
||||
@@ -508,7 +508,7 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS
|
||||
args.append(QString::number(exSQFS.feuereinheit.r));
|
||||
args.append(exSQFS.feuereinheit.verein);
|
||||
|
||||
DEBUG_LOG() << "Stellungsmeldung Feuerstellung content=" << content;
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Feuerstellung content=" << content;
|
||||
createNotificationRequest(wsId,
|
||||
QString::fromUtf8(tr_lts("Notification","Position Report: Firing Unit")),
|
||||
NotificationManagement::MessageType_def::Info,
|
||||
@@ -521,14 +521,14 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS
|
||||
|
||||
void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
|
||||
{
|
||||
DEBUG_LOG() << "onSAASQLP";
|
||||
DEBUG_LOG(m_logger) << "onSAASQLP";
|
||||
auto saa = getSAAByWs(wsId);
|
||||
int partyId = saa->getPartyId();
|
||||
const bool isVerbund = true;
|
||||
QStringList args;
|
||||
|
||||
const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQLP.einheit.verein, partyId, isVerbund);
|
||||
DEBUG_LOG() << "ParticipantId=" << part.id();
|
||||
DEBUG_LOG(m_logger) << "ParticipantId=" << part.id();
|
||||
|
||||
QString content = QString::fromUtf8(tr_lts("Notification","<a href='lts://ParticipantInfo/%1'>Show Participant Info</a><br /><B>Unit:</B> %2/%3/%4"));
|
||||
|
||||
@@ -543,29 +543,29 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP)
|
||||
NotificationManagement::NotificationType::AdlerNotification,
|
||||
content,
|
||||
args);
|
||||
DEBUG_LOG() << "Stellungsmeldung Ladeplatz content=" << content;
|
||||
DEBUG_LOG(m_logger) << "Stellungsmeldung Ladeplatz content=" << content;
|
||||
|
||||
m_ppmHandler->parseSQLP(exSQLP, wsId);
|
||||
}
|
||||
|
||||
void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &exFlugbahndaten, const QString referenceUuid)
|
||||
{
|
||||
DEBUG_LOG() << "onSAATrajectoryData wsId=" << wsId << ", referenceUuid :" << referenceUuid;
|
||||
DEBUG_LOG(m_logger) << "onSAATrajectoryData wsId=" << wsId << ", referenceUuid :" << referenceUuid;
|
||||
auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "onSAATrajectoryData but SAA with wsId " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "onSAATrajectoryData but SAA with wsId " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
QString referenceUuidAlt = referenceUuid;
|
||||
referenceUuidAlt = referenceUuidAlt.replace(QStringLiteral("-"), QStringLiteral(""));
|
||||
if (!m_trajectoryIdentifier.contains(referenceUuidAlt))
|
||||
{
|
||||
DEBUG_LOG() << "referenceUuid not found in m_trajectoryIdentifier"
|
||||
DEBUG_LOG(m_logger) << "referenceUuid not found in m_trajectoryIdentifier"
|
||||
<< ", referenceUuid : " << referenceUuidAlt;
|
||||
for (auto it = m_trajectoryIdentifier.constBegin(); it != m_trajectoryIdentifier.constEnd(); ++it)
|
||||
{
|
||||
DEBUG_LOG() << "m_trajectoryIdentifier key : " << it.key() << ", value aesItemId :" << it.value().aesItemId << ", explosionId :" << it.value().explosionId;
|
||||
DEBUG_LOG(m_logger) << "m_trajectoryIdentifier key : " << it.key() << ", value aesItemId :" << it.value().aesItemId << ", explosionId :" << it.value().explosionId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -583,7 +583,7 @@ void JsonDispatcher::onSAAHXGuidingLines(const int wsId, const Koordinierungsdat
|
||||
auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ HX (K) from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ HX (K) from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -598,7 +598,7 @@ void JsonDispatcher::onSAAHXGuidingLinesAndBoundaries(const int wsId, const Fueh
|
||||
auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ HX (G) from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ HX (G) from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -614,10 +614,10 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
|
||||
const auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "EX-FH from SSA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "EX-FH from SSA but SAA with id " << wsId << " not found";
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "[EX-FH] data from SSA " << wsId << " : "
|
||||
DEBUG_LOG(m_logger) << "[EX-FH] data from SSA " << wsId << " : "
|
||||
<< "verein: " << feuerhaltdaten.verein << " "
|
||||
<< "kenner: " << feuerhaltdaten.kenner.underlying() << " "
|
||||
<< "kategorie: " << feuerhaltdaten.kategorie.underlying() << " "
|
||||
@@ -683,7 +683,7 @@ void JsonDispatcher::onWebSocketError()
|
||||
if (!m_webSocket)
|
||||
return;
|
||||
if (!m_bWarnedOnce)
|
||||
WARNING_LOG() << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString();
|
||||
WARNING_LOG(m_logger) << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString();
|
||||
m_webSocket->close();
|
||||
m_webSocketReconnectTimer->start(5000);
|
||||
m_bWarnedOnce = true;
|
||||
@@ -715,11 +715,11 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
QJsonDocument doc(telegram);
|
||||
if (!isConnectionTest(doc))
|
||||
{
|
||||
DEBUG_LOG() << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
|
||||
DEBUG_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
|
||||
}
|
||||
else
|
||||
{
|
||||
TRACE_LOG() << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
|
||||
TRACE_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId;
|
||||
}
|
||||
|
||||
int errorcode = 0;
|
||||
@@ -728,7 +728,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
|
||||
|
||||
|
||||
TRACE_LOG() << "errorcode = " << errorcode;
|
||||
TRACE_LOG(m_logger) << "errorcode = " << errorcode;
|
||||
const int typeId = telegram[JsonKeys::TYPE_ID()].toInt();
|
||||
if (typeId != TelegramIds::EX_FLUGBAHNDATEN())
|
||||
return;
|
||||
@@ -738,7 +738,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
QString errorStr = FehlercodeMap.key(fehlercode);
|
||||
|
||||
QString completeErrorStr = QStringLiteral("Calculate Trajectory failed: ") + errorStr;
|
||||
DEBUG_LOG() << "errorStr :" << errorStr << ", completeErrorStr :" << completeErrorStr;
|
||||
DEBUG_LOG(m_logger) << "errorStr :" << errorStr << ", completeErrorStr :" << completeErrorStr;
|
||||
|
||||
Core::FunctionReplyObject reply = Core::FunctionReplyObject(-1, tr_lts("dds", completeErrorStr.toStdString()), {errorStr.toStdString()});
|
||||
reply.setId(m_explosionIndex);
|
||||
@@ -753,7 +753,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram)
|
||||
}
|
||||
void JsonDispatcher::onTextMessageReceived(const QByteArray &message)
|
||||
{
|
||||
DEBUG_LOG() << "Text Message received: " << message;
|
||||
DEBUG_LOG(m_logger) << "Text Message received: " << message;
|
||||
|
||||
m_recvFromWebsocket->handleTelegram(message);
|
||||
}
|
||||
@@ -765,7 +765,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
Core::FunctionReplyObject ret;
|
||||
m_explosionIndex = request.explosionIndex();
|
||||
m_cookieCalculateTrajectoryAdler = cookie;
|
||||
DEBUG_LOG() << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
|
||||
DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
|
||||
<< ", m_saaInterfaces.size=" << m_saaInterfaces.size();
|
||||
|
||||
int wsId = 0;
|
||||
@@ -775,13 +775,13 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
|
||||
if (wsId == 0)
|
||||
{
|
||||
DEBUG_LOG() << " No wsId found wsId=" << wsId << " return";
|
||||
DEBUG_LOG(m_logger) << " No wsId found wsId=" << wsId << " return";
|
||||
ret.setId(request.explosionIndex());
|
||||
m_ftsTab->adlerCalculateTrajectoryReply(cookie, ret);
|
||||
|
||||
return;
|
||||
}
|
||||
DEBUG_LOG() << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
|
||||
DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest"
|
||||
<< " connect to SAA and send data"
|
||||
<< ", partyId :" << request.partyId() << ", wsId :" << wsId;
|
||||
ExFlugbahnberechnung exFlugbahnberechnung;
|
||||
@@ -790,7 +790,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
exFlugbahnberechnung.receiver = saa->getSAAName();
|
||||
@@ -806,27 +806,27 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.hoehe = request.positionTarget().z();
|
||||
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = ProjectDataManagement::L26_EffectingSystemType::inner_enum(request.weaponSystemType().underlying() + 1);
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying();
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying();
|
||||
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem;
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem;
|
||||
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->adlerChargeTypeName(request.trajectory().chargeTypeId());
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory().chargeTypeId();
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 geschosssorte " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte;
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory().chargeTypeId();
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 geschosssorte " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte;
|
||||
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender = m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterTypeName(request.trajectory().igniterTypeId());
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory().igniterTypeId();
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuender " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender;
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory().igniterTypeId();
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuender " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender;
|
||||
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion
|
||||
= m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterFunctionName(request.trajectory().igniterFunctionId());
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory().igniterFunctionId();
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuenderFunktion " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion;
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory().igniterFunctionId();
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuenderFunktion " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion;
|
||||
|
||||
if (request.trajectory().loadTypeId() > 0)
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung = m_mainDispatcher->pdmHandler()->getDtc()->adlerLoadTypeName(request.trajectory().loadTypeId());
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 ladung " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung;
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 ladung " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung;
|
||||
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast<int>(request.explosionHeight());
|
||||
exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup().underlying());
|
||||
@@ -835,12 +835,12 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
|
||||
|
||||
if (request.properties().empty())
|
||||
ERROR_LOG() << "No properties available";
|
||||
DEBUG_LOG() << ", request.aesItemId() :" << request.aesItemId();
|
||||
ERROR_LOG(m_logger) << "No properties available";
|
||||
DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId();
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG() << "UUID=" << exFlugbahnberechnung.uuid;
|
||||
DEBUG_LOG(m_logger) << "UUID=" << exFlugbahnberechnung.uuid;
|
||||
TrajectoryIdentifier trajectoryIdentifier;
|
||||
|
||||
trajectoryIdentifier.aesItemId = request.aesItemId();
|
||||
@@ -851,7 +851,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
|
||||
|
||||
QJsonObject telegram;
|
||||
telegram = exFlugbahnberechnung.toJson();
|
||||
DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 " << QJsonDocument(telegram).toJson(QJsonDocument::JsonFormat::Compact);
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 " << QJsonDocument(telegram).toJson(QJsonDocument::JsonFormat::Compact);
|
||||
m_sendToWebsocket->onGenericTelegram1(wsId, telegram);
|
||||
}
|
||||
|
||||
@@ -859,7 +859,7 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int
|
||||
{
|
||||
|
||||
|
||||
DEBUG_LOG() << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId;
|
||||
DEBUG_LOG(m_logger) << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId;
|
||||
|
||||
const auto copy = m_saaInterfaces;
|
||||
for (const auto &saa : copy)
|
||||
@@ -867,7 +867,7 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int
|
||||
if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName)
|
||||
|| (wsId > 0 && saa.get()->getWsId() == wsId))
|
||||
{
|
||||
DEBUG_LOG() << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId();
|
||||
DEBUG_LOG(m_logger) << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId();
|
||||
m_saaInterfaces.removeOne(saa);
|
||||
}
|
||||
}
|
||||
@@ -894,7 +894,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
const auto saa = getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
WARNING_LOG() << "No valid SAA for wsId";
|
||||
WARNING_LOG(m_logger) << "No valid SAA for wsId";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -919,7 +919,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
partyId,
|
||||
OperatorRights::AdlerExplosionClusterEdit,
|
||||
data.notification().notificationType().underlying());
|
||||
DEBUG_LOG() << "getCreateNotificationRequestData recipientIds.size=" << recipientIds.size()
|
||||
DEBUG_LOG(m_logger) << "getCreateNotificationRequestData recipientIds.size=" << recipientIds.size()
|
||||
<< ", exerciseId=" << m_mainDispatcher->exerciseId();
|
||||
std::vector<NotificationManagement::Address> recipientIdsDds;
|
||||
recipientIdsDds.reserve(recipientIds.size());
|
||||
@@ -933,7 +933,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
|
||||
addr.name(user.name());
|
||||
addr.addressType(NotificationManagement::AddressType_def::Operator);
|
||||
notif.recipientIds().push_back(addr);
|
||||
DEBUG_LOG() << "recipientId=" << addr.name()
|
||||
DEBUG_LOG(m_logger) << "recipientId=" << addr.name()
|
||||
<< ", addr.addressId=" << addr.addressId();
|
||||
}
|
||||
|
||||
@@ -952,44 +952,44 @@ void JsonDispatcher::createNotificationRequest(const int wsId,
|
||||
const QString &content,
|
||||
const QStringList &args)
|
||||
{
|
||||
DEBUG_LOG() << "createNotificationRequest"
|
||||
DEBUG_LOG(m_logger) << "createNotificationRequest"
|
||||
<< ", content=" << content;
|
||||
NotificationManagement::CreateNotification req;
|
||||
getCreateNotificationRequestData(wsId, title, req, content, args);
|
||||
if (req.notification().content().empty())
|
||||
{
|
||||
INFO_LOG() << "req.notification().content().empty()";
|
||||
INFO_LOG(m_logger) << "req.notification().content().empty()";
|
||||
return;
|
||||
}
|
||||
req.notification().messageType(messageType);
|
||||
req.notification().notificationType(notificationType);
|
||||
|
||||
INFO_LOG() << "trying to send CreateNotificationRequest";
|
||||
INFO_LOG(m_logger) << "trying to send CreateNotificationRequest";
|
||||
if (req.notification().recipientIds().size() == 0)
|
||||
{
|
||||
INFO_LOG() << "req.notification().recipientIds().size() == 0";
|
||||
INFO_LOG(m_logger) << "req.notification().recipientIds().size() == 0";
|
||||
return;
|
||||
}
|
||||
INFO_LOG() << "CreateNotificationRequest";
|
||||
INFO_LOG(m_logger) << "CreateNotificationRequest";
|
||||
if (!m_ftcNom->createNotificationRequest(req, this))
|
||||
{
|
||||
ERROR_LOG() << "Error requesting create data";
|
||||
ERROR_LOG(m_logger) << "Error requesting create data";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject)
|
||||
{
|
||||
INFO_LOG() << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated();
|
||||
|
||||
if (replyObject.error())
|
||||
{
|
||||
ERROR_LOG() << "Error requesting CreateNotification";
|
||||
ERROR_LOG(m_logger) << "Error requesting CreateNotification";
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
@@ -115,6 +115,7 @@ class JsonDispatcher final
|
||||
void websocketConnected(quint16 port);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QUrl webSocketUrl() const;
|
||||
bool isConnectionTest(QJsonDocument &doc);
|
||||
QString getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund);
|
||||
@@ -122,6 +123,7 @@ class JsonDispatcher final
|
||||
std::shared_ptr<SAAInterface> getSAAByName(const QString &saaName);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
std::shared_ptr<JsonHandlerRx> m_recvFromWebsocket;
|
||||
std::shared_ptr<JsonHandlerTx> m_sendToWebsocket;
|
||||
|
||||
+36
-37
@@ -14,15 +14,14 @@ JsonHandlerRx::JsonHandlerRx(const std::shared_ptr<TrainingAreaBase::RecvFromTab
|
||||
const std::shared_ptr<TrainingAreaBase::TxMixin> &sendToTabCb,
|
||||
JsonDispatcher *dispatcher,
|
||||
AesHandler *aesHandler,
|
||||
PpmHandler *ppmHandler)
|
||||
: m_rxHandler(recvFromTabCb)
|
||||
PpmHandler *ppmHandler) : m_rxHandler(recvFromTabCb)
|
||||
, m_txHandler(sendToTabCb)
|
||||
, m_dispatcher(dispatcher)
|
||||
, m_bWarnedOnce(false)
|
||||
, m_bWarnedOnceTx(false)
|
||||
, m_aesHandler(aesHandler)
|
||||
, m_ppmHandler(ppmHandler)
|
||||
{
|
||||
, m_ppmHandler(ppmHandler),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
}
|
||||
bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &errorcode)
|
||||
{
|
||||
@@ -31,7 +30,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
|
||||
if (!telegram.contains(JsonKeys::TYPE_ID()))
|
||||
{
|
||||
ERROR_LOG() << "telegram not contains typeId";
|
||||
ERROR_LOG(m_logger) << "telegram not contains typeId";
|
||||
}
|
||||
|
||||
const int typeId = telegram[JsonKeys::TYPE_ID()].toInt();
|
||||
@@ -39,7 +38,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
const QString uuid = telegram[JsonKeys::UUID_()].toString();
|
||||
const QString referenceUuid = telegram[JsonKeys::REFERENCE_UUID()].toString();
|
||||
|
||||
INFO_LOG() << "[handleTelegram] typeId=" << typeId << " typeName=" << typeName << " uuid=" << uuid << " referenceUuid=" << referenceUuid;
|
||||
INFO_LOG(m_logger) << "[handleTelegram] typeId=" << typeId << " typeName=" << typeName << " uuid=" << uuid << " referenceUuid=" << referenceUuid;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -53,7 +52,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
QString szenarName = dataObj.value(JsonKeys::SZENAR()).toString();
|
||||
bool isVerbund = dataObj.value(JsonKeys::ADLER_VERBUND()).toBool();
|
||||
m_dispatcher->onSAARegistration(wsId, partyId, saaName, szenarName, isVerbund, uuid);
|
||||
WARNING_LOG() << "On Register ------------------- partyId= " << partyId << ", saaName= " << saaName << ", szenarName= " << szenarName
|
||||
WARNING_LOG(m_logger) << "On Register ------------------- partyId= " << partyId << ", saaName= " << saaName << ", szenarName= " << szenarName
|
||||
<< ", isVerbund= " << isVerbund << ", wsId= " << wsId;
|
||||
break;
|
||||
}
|
||||
@@ -61,18 +60,18 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
{
|
||||
const int partyId = telegram[JsonKeys::DATA()].toObject().value(JsonKeys::PARTY_ID()).toInt(0);
|
||||
m_dispatcher->onSAADeregistration(wsId, partyId);
|
||||
WARNING_LOG() << "[EX_DEREGISTRATION_REQUEST] EX-Abmeldung -------------------------------------";
|
||||
WARNING_LOG(m_logger) << "[EX_DEREGISTRATION_REQUEST] EX-Abmeldung -------------------------------------";
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_CONNECTION_TEST_REQUEST():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_CONNECTION_TEST_REQUEST] EX-Verbindungsanfrage -------------------------------------";
|
||||
DEBUG_LOG(m_logger) << "[EX_CONNECTION_TEST_REQUEST] EX-Verbindungsanfrage -------------------------------------";
|
||||
m_dispatcher->onSAAConnectionTest(wsId, uuid);
|
||||
break;
|
||||
}
|
||||
case TelegramIds::EX_STATUS():
|
||||
{
|
||||
WARNING_LOG() << "[EX_STATUS] EX-Status -------------------------------------";
|
||||
WARNING_LOG(m_logger) << "[EX_STATUS] EX-Status -------------------------------------";
|
||||
auto data = telegram[JsonKeys::DATA()];
|
||||
const QString status = data.toObject().value(JsonKeys::STATUS()).toString(QStringLiteral(""));
|
||||
|
||||
@@ -84,7 +83,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_TQ():
|
||||
{
|
||||
WARNING_LOG() << "[EX_TQ] Technische Quittierung -------------------------------------";
|
||||
WARNING_LOG(m_logger) << "[EX_TQ] Technische Quittierung -------------------------------------";
|
||||
const auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
bool bOk = true;
|
||||
TechnischeDaten technischeDaten;
|
||||
@@ -94,7 +93,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_FIRE():
|
||||
{
|
||||
WARNING_LOG() << "[EX-FQ(FN)] EX-Feuern -------------------------------------";
|
||||
WARNING_LOG(m_logger) << "[EX-FQ(FN)] EX-Feuern -------------------------------------";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
bool bOk = true;
|
||||
Feuerkampfdaten exFire;
|
||||
@@ -107,12 +106,12 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_AWES_PLANNING():
|
||||
{
|
||||
WARNING_LOG() << "[EX_AWES_PLANNING] EX-FQ(BA-BB-FK) Wirkfeldplanung";
|
||||
WARNING_LOG(m_logger) << "[EX_AWES_PLANNING] EX-FQ(BA-BB-FK) Wirkfeldplanung";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
WirkfeldplanungData wirkfeldplanungData;
|
||||
bool bOk = true;
|
||||
wirkfeldplanungDataFromJson(data, wirkfeldplanungData, bOk);
|
||||
DEBUG_LOG() << "\n-------------------"
|
||||
DEBUG_LOG(m_logger) << "\n-------------------"
|
||||
<< "\nwirkfeldplanungData"
|
||||
<< "\n dauer: " << wirkfeldplanungData.dauer << "\n abfeuerungsArt: " << static_cast<int>(wirkfeldplanungData.abfeuerungsArt)
|
||||
<< "\n feuerkampfReferenz: '" << wirkfeldplanungData.feuerkampfReferenz << "'"
|
||||
@@ -124,14 +123,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_WEAPON():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_POSITION_REPORT_WEAPON] Ex-SQ(WS) Stellungsmeldung Waffensystem";
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_WEAPON] Ex-SQ(WS) Stellungsmeldung Waffensystem";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Waffensystemdaten exSQWS;
|
||||
bool bOk = true;
|
||||
waffensystemdatenFromJson(data, exSQWS, bOk);
|
||||
if (!bOk)
|
||||
{
|
||||
ERROR_LOG() << "Received Ex-SQ(WS) but couldn't parse the jsondata ";
|
||||
ERROR_LOG(m_logger) << "Received Ex-SQ(WS) but couldn't parse the jsondata ";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -141,14 +140,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_FIRE():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_POSITION_REPORT_FIRE] Ex-SQ(FS) Stellungsmeldung Feuerstellung";
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_FIRE] Ex-SQ(FS) Stellungsmeldung Feuerstellung";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Feuerstellungsdaten exSQFS;
|
||||
bool bOk = true;
|
||||
feuerstellungsdatenFromJson(data, exSQFS, bOk);
|
||||
if (!bOk)
|
||||
{
|
||||
ERROR_LOG() << "Received Ex-SQ(FS) but couldn't parse the jsondata ";
|
||||
ERROR_LOG(m_logger) << "Received Ex-SQ(FS) but couldn't parse the jsondata ";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -158,14 +157,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_POSITION_REPORT_LOADING_PLACE():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_POSITION_REPORT_LOADING_PLACE] EX-SQ(LP)Stellungsmeldung Ladeplatz";
|
||||
DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_LOADING_PLACE] EX-SQ(LP)Stellungsmeldung Ladeplatz";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Ladeplatzdaten exSQLP;
|
||||
bool bOk = true;
|
||||
ladeplatzdatenFromJson(data, exSQLP, bOk);
|
||||
if (!bOk)
|
||||
{
|
||||
ERROR_LOG() << "Received Ex-SQ(LP) but couldn't parse the jsondata ";
|
||||
ERROR_LOG(m_logger) << "Received Ex-SQ(LP) but couldn't parse the jsondata ";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -175,17 +174,17 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_FLUGBAHNDATEN():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_FLUGBAHNDATEN] EX-Flugbahndaten";
|
||||
DEBUG_LOG(m_logger) << "[EX_FLUGBAHNDATEN] EX-Flugbahndaten";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Flugbahndaten flugbahndaten;
|
||||
bool bOk = true;
|
||||
flugbahndatenFromJson(data, flugbahndaten, bOk);
|
||||
if (!bOk)
|
||||
{
|
||||
ERROR_LOG() << "Received EX-Flugbahndaten but couldn't parse the jsondata ";
|
||||
ERROR_LOG(m_logger) << "Received EX-Flugbahndaten but couldn't parse the jsondata ";
|
||||
break;
|
||||
}
|
||||
DEBUG_LOG() << "Vor onSAATrajectoryData wsId=" << wsId;
|
||||
DEBUG_LOG(m_logger) << "Vor onSAATrajectoryData wsId=" << wsId;
|
||||
if (static_cast<int>(flugbahndaten.fehlercode) == 0)
|
||||
m_dispatcher->onSAATrajectoryData(wsId, flugbahndaten, referenceUuid);
|
||||
else
|
||||
@@ -194,7 +193,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_GUIDING_LINES():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_GUIDING_LINES] EX-HQ Koordinierungsmassnahmen";
|
||||
DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES] EX-HQ Koordinierungsmassnahmen";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Koordinierungsdaten koordinierungsdaten;
|
||||
bool bOk = true;
|
||||
@@ -210,7 +209,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_GUIDING_LINES_AND_BOUNDARIES():
|
||||
{
|
||||
DEBUG_LOG() << "[EX_GUIDING_LINES_AND_BOUNDARIES] EX-HQ(G)Fuehrungslinien und Grenzen ";
|
||||
DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES_AND_BOUNDARIES] EX-HQ(G)Fuehrungslinien und Grenzen ";
|
||||
auto data = telegram[JsonKeys::DATA()].toObject();
|
||||
Fuehrungsdaten fuehrungsdaten;
|
||||
bool bOk = true;
|
||||
@@ -226,7 +225,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_FIRE_HALT():
|
||||
{
|
||||
WARNING_LOG() << "[EX_FIRE_HALT] Feuerhalt";
|
||||
WARNING_LOG(m_logger) << "[EX_FIRE_HALT] Feuerhalt";
|
||||
|
||||
auto data = telegram[QStringLiteral("data")].toObject();
|
||||
bool bOk = true;
|
||||
@@ -239,7 +238,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
case TelegramIds::EX_DONT_FIRE():
|
||||
{
|
||||
WARNING_LOG() << "[EX_DONT_FIRE] Dont Fire";
|
||||
WARNING_LOG(m_logger) << "[EX_DONT_FIRE] Dont Fire";
|
||||
auto data = telegram[QStringLiteral("data")].toObject();
|
||||
bool bOk = true;
|
||||
Feuerkampfdaten feuerkampfdaten;
|
||||
@@ -251,20 +250,20 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e
|
||||
}
|
||||
default:
|
||||
{
|
||||
WARNING_LOG() << "Cant handle Telegram typeId=" << typeId;
|
||||
WARNING_LOG(m_logger) << "Cant handle Telegram typeId=" << typeId;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
WARNING_LOG() << "Could not parse json: " << e.what() << " (" << ")";
|
||||
WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << ")";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool JsonHandlerRx::handleTelegram(const QByteArray &baJson)
|
||||
{
|
||||
DEBUG_LOG() << "JsonHandlerRx::handleTelegram";
|
||||
DEBUG_LOG(m_logger) << "JsonHandlerRx::handleTelegram";
|
||||
|
||||
if (baJson.isEmpty())
|
||||
return false;
|
||||
@@ -273,19 +272,19 @@ bool JsonHandlerRx::handleTelegram(const QByteArray &baJson)
|
||||
const QJsonValue typeId = obj.value(QStringLiteral("typeId"));
|
||||
if (!typeId.isDouble())
|
||||
{
|
||||
ERROR_LOG() << "Can not read type id: " << baJson;
|
||||
ERROR_LOG(m_logger) << "Can not read type id: " << baJson;
|
||||
return false;
|
||||
}
|
||||
const QJsonObject data = obj.value(QStringLiteral("data")).toObject();
|
||||
if (typeId.toInt() != 21)
|
||||
ERROR_LOG() << "Telegram before filter: " << baJson;
|
||||
ERROR_LOG(m_logger) << "Telegram before filter: " << baJson;
|
||||
try
|
||||
{
|
||||
QJsonValue header = data[QStringLiteral("header")];
|
||||
|
||||
QJsonObject obj = header.toObject();
|
||||
|
||||
ERROR_LOG() << "Telegram header: " << obj.count();
|
||||
ERROR_LOG(m_logger) << "Telegram header: " << obj.count();
|
||||
if (!obj.isEmpty())
|
||||
{
|
||||
int eqNo = obj[QStringLiteral("equipmentNumber")].toInt(0);
|
||||
@@ -295,11 +294,11 @@ bool JsonHandlerRx::handleTelegram(const QByteArray &baJson)
|
||||
return false;
|
||||
}
|
||||
if (typeId.toInt() != 21)
|
||||
ERROR_LOG() << "Telegram after filter: " << baJson;
|
||||
ERROR_LOG(m_logger) << "Telegram after filter: " << baJson;
|
||||
}
|
||||
catch (const std::exception &e)
|
||||
{
|
||||
WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")";
|
||||
WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -313,7 +312,7 @@ template <typename T> void JsonHandlerRx::rxData(const T &data)
|
||||
{
|
||||
if (!m_bWarnedOnce)
|
||||
{
|
||||
ERROR_LOG() << "No RecvFromTab available";
|
||||
ERROR_LOG(m_logger) << "No RecvFromTab available";
|
||||
m_bWarnedOnce = true;
|
||||
}
|
||||
return;
|
||||
@@ -328,7 +327,7 @@ template <typename T> void JsonHandlerRx::txData(const T &data)
|
||||
{
|
||||
if (!m_bWarnedOnceTx)
|
||||
{
|
||||
ERROR_LOG() << "No RecvFromTab available";
|
||||
ERROR_LOG(m_logger) << "No RecvFromTab available";
|
||||
m_bWarnedOnceTx = true;
|
||||
}
|
||||
return;
|
||||
|
||||
+4
-4
@@ -39,7 +39,7 @@ void JsonHandlerTx::onWebsocketConnectedToExternalSystem(bool bConnected)
|
||||
{
|
||||
m_bWebsocketConnectedToExternalSystem = bConnected;
|
||||
|
||||
INFO_LOG() << "Connected to SAA";
|
||||
INFO_LOG(m_logger) << "Connected to SAA";
|
||||
const auto tele2 = m_pdp->exerciseEnvironmentData();
|
||||
sendToTx(&tele2, true);
|
||||
connect(m_mainDispatcher->aesHandler().get(), &AesHandler::explosionSingleChanged, this, &JsonHandlerTx::onGenericTelegram, Qt::UniqueConnection);
|
||||
@@ -353,7 +353,7 @@ bool JsonHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExConfirmationRepor
|
||||
|
||||
void JsonHandlerTx::onParticipantConnectionState(const int equipmentNumber, const bool dataCommunicationPossible)
|
||||
{
|
||||
INFO_LOG() << "onParticipantConnectionState - " << equipmentNumber
|
||||
INFO_LOG(m_logger) << "onParticipantConnectionState - " << equipmentNumber
|
||||
<< ", communication possible: " << dataCommunicationPossible;
|
||||
if (equipmentNumber == -1)
|
||||
m_dataCommunicationPossible.clear();
|
||||
@@ -365,7 +365,7 @@ void JsonHandlerTx::onGenericTelegram(const QJsonObject &telegram)
|
||||
if (!m_webSocket || !m_bWebsocketConnectedToExternalSystem)
|
||||
return;
|
||||
const QByteArray ba = QJsonDocument(telegram).toJson(QJsonDocument::Compact);
|
||||
DEBUG_LOG() << "Sending tele: " << ba;
|
||||
DEBUG_LOG(m_logger) << "Sending tele: " << ba;
|
||||
m_webSocket->sendTextMessage(QString::fromUtf8(ba));
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ bool JsonHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTeleg
|
||||
telegram[QStringLiteral("data")] = data->toJson();
|
||||
telegram[QStringLiteral("type")] = data->type();
|
||||
telegram[QStringLiteral("typeId")] = data->id();
|
||||
ERROR_LOG() << QJsonDocument(telegram).toJson(QJsonDocument::Compact).toStdString();
|
||||
ERROR_LOG(m_logger) << QJsonDocument(telegram).toJson(QJsonDocument::Compact).toStdString();
|
||||
onGenericTelegram(telegram);
|
||||
return true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp,
|
||||
, m_domainId(pdp->domainId())
|
||||
, m_exerciseId(pdp->exerciseId())
|
||||
{
|
||||
INFO_LOG() << "Plugin AdlerJson started";
|
||||
INFO_LOG(m_logger) << "Plugin AdlerJson started";
|
||||
}
|
||||
|
||||
MainDispatcher::~MainDispatcher()
|
||||
@@ -79,7 +79,7 @@ bool MainDispatcher::init()
|
||||
}
|
||||
void MainDispatcher::onWebsocketConnected(quint16 port)
|
||||
{
|
||||
ERROR_LOG() << "ApAdler started, Domain Id: " << QString::number(port);
|
||||
ERROR_LOG(m_logger) << "ApAdler started, Domain Id: " << QString::number(port);
|
||||
m_ddsHandler->pacemaker()->addPort(port, Core::PortType::WebSocketAdlerServer);
|
||||
|
||||
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
|
||||
|
||||
+1
@@ -55,6 +55,7 @@ public:
|
||||
const char *name () const override { return tr_lts("dds", "ApHlaJson"); }
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
JsonDispatcher *m_adlerDispatcher;
|
||||
|
||||
std::shared_ptr<TrainingAreaBase::RecvFromTab> m_recvFromTabCb;
|
||||
|
||||
+5
-6
@@ -10,9 +10,8 @@ namespace AdlerJson
|
||||
{
|
||||
|
||||
|
||||
PdmHandler::PdmHandler(QObject *parent)
|
||||
: QObject(parent)
|
||||
{}
|
||||
PdmHandler::PdmHandler(QObject *parent) : QObject(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
|
||||
|
||||
bool PdmHandler::init(MainDispatcher* mainDispatcher)
|
||||
{
|
||||
@@ -20,7 +19,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher)
|
||||
|
||||
if (!m_dtcPdm->enableChargeType())
|
||||
{
|
||||
ERROR_LOG() << "Can not read data from Pdm";
|
||||
ERROR_LOG(m_logger) << "Can not read data from Pdm";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -33,7 +32,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher)
|
||||
|
||||
void PdmHandler::getChargeTypes()
|
||||
{
|
||||
DEBUG_LOG() << "Get Charge Types";
|
||||
DEBUG_LOG(m_logger) << "Get Charge Types";
|
||||
QJsonObject obj;
|
||||
QJsonArray dataArray;
|
||||
obj[QStringLiteral("type")] = QStringLiteral("ApacheHlaSendChargeTypes");
|
||||
@@ -43,7 +42,7 @@ void PdmHandler::getChargeTypes()
|
||||
QMap<qint32, ProjectDataManagement::ChargeType> chargeTypes = m_dtcPdm->chargeTypes();
|
||||
QMap<qint32, ProjectDataManagement::GearType> gearTypes = m_dtcPdm->gearTypes();
|
||||
QMap<qint32, ProjectDataManagement::GearTypeChargeType> gearTypeChargeTypes = m_dtcPdm->gearTypeChargeTypes();
|
||||
DEBUG_LOG() << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though.";
|
||||
DEBUG_LOG(m_logger) << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though.";
|
||||
|
||||
for(const ProjectDataManagement::ChargeType &charge : chargeTypes)
|
||||
{
|
||||
|
||||
+1
@@ -32,6 +32,7 @@ public slots:
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_dtcPdm;
|
||||
};
|
||||
|
||||
|
||||
+38
-38
@@ -36,10 +36,10 @@ bool PpmHandler::init(MainDispatcher *mainDispatcher)
|
||||
|
||||
m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_mainDispatcher->ddsHandler()->ddsConnector());
|
||||
|
||||
DEBUG_LOG() << "-------------<><><>------" << m_mainDispatcher->exerciseId();
|
||||
DEBUG_LOG(m_logger) << "-------------<><><>------" << m_mainDispatcher->exerciseId();
|
||||
if (!m_dtcPpm->enableParticipant() || !m_dtcPpm->enableDynamicParticipantData() || !m_dtcPpm->enableParticipantPosition())
|
||||
{
|
||||
ERROR_LOG() << "Can not read data from Ppm";
|
||||
ERROR_LOG(m_logger) << "Can not read data from Ppm";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
|
||||
const ParticipantManagement::ConnectState &connectState,
|
||||
const bool isVerbund)
|
||||
{
|
||||
DEBUG_LOG() << "modifyParty"
|
||||
DEBUG_LOG(m_logger) << "modifyParty"
|
||||
<< " assetId=" << assetId << " partyId=" << partyId << " saaName=" << saaName << " szenarName=" << szenarName << " connectState=" << connectState
|
||||
<< " isVerbund=" << isVerbund;
|
||||
|
||||
@@ -93,11 +93,11 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
|
||||
|
||||
if (parserError.error != QJsonParseError::NoError)
|
||||
{
|
||||
ERROR_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'";
|
||||
doc = QJsonDocument();
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "json to parse: " << doc.toJson();
|
||||
DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson();
|
||||
|
||||
QJsonObject obj(doc.object());
|
||||
obj[QStringLiteral("Adler")] = adlerPropertiesObj;
|
||||
@@ -110,11 +110,11 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId,
|
||||
|
||||
void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "Start parse SQFS";
|
||||
DEBUG_LOG(m_logger) << "Start parse SQFS";
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
const QString &verein = exSQFS.feuereinheit.verein;
|
||||
@@ -179,7 +179,7 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Append FS Unit to root Unit";
|
||||
DEBUG_LOG(m_logger) << "Append FS Unit to root Unit";
|
||||
list.push_back(root);
|
||||
}
|
||||
|
||||
@@ -214,11 +214,11 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId)
|
||||
|
||||
void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "Start parse SQWS";
|
||||
DEBUG_LOG(m_logger) << "Start parse SQWS";
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
const ProjectDataManagement::L27_EffectorId &internalName = exSQWS.kenner;
|
||||
@@ -253,7 +253,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
if (pp.id() > 0)
|
||||
{
|
||||
|
||||
DEBUG_LOG() << "Found Participant only update pos";
|
||||
DEBUG_LOG(m_logger) << "Found Participant only update pos";
|
||||
sendPositionFromTempMap(currentRandomNumber, saa->getPartyId(), saa->getIsVerbund());
|
||||
sendChargesFromTempMap(currentRandomNumber, saa->getPartyId(), saa->getIsVerbund());
|
||||
|
||||
@@ -267,10 +267,10 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
|
||||
const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), false, saa->getIsVerbund());
|
||||
DEBUG_LOG() << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType);
|
||||
DEBUG_LOG(m_logger) << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType);
|
||||
if (type.id() <= 0)
|
||||
{
|
||||
ERROR_LOG() << "NO Type Found";
|
||||
ERROR_LOG(m_logger) << "NO Type Found";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,12 +280,12 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
uint superiorModId = QRandomGenerator::global()->generate() / 2;
|
||||
|
||||
ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund());
|
||||
DEBUG_LOG() << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId();
|
||||
DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId();
|
||||
|
||||
if (pUdata.modId() > 0)
|
||||
{
|
||||
superiorModId = pUdata.modId();
|
||||
DEBUG_LOG() << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber;
|
||||
DEBUG_LOG(m_logger) << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber;
|
||||
}
|
||||
else if (pUnit.id() > 0)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
list.push_back(pUData);
|
||||
m_tempPartDataList.insert(currentRandomNumber, list);
|
||||
DEBUG_LOG() << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber;
|
||||
DEBUG_LOG(m_logger) << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber;
|
||||
ParticipantManagement::Participant tmp = pUnit;
|
||||
while (tmp.superiorId() > 0)
|
||||
{
|
||||
@@ -314,11 +314,11 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber;
|
||||
DEBUG_LOG(m_logger) << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber;
|
||||
list.push_back(root);
|
||||
}
|
||||
const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund());
|
||||
DEBUG_LOG() << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber;
|
||||
DEBUG_LOG(m_logger) << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber;
|
||||
ParticipantManagement::ParticipantData data;
|
||||
data.id(0);
|
||||
data.partyId(saa->getPartyId());
|
||||
@@ -337,7 +337,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
list.push_back(data);
|
||||
}
|
||||
|
||||
DEBUG_LOG() << "Create new Participant"
|
||||
DEBUG_LOG(m_logger) << "Create new Participant"
|
||||
<< " RND: " << currentRandomNumber;
|
||||
|
||||
ParticipantManagement::ParticipantData data;
|
||||
@@ -366,11 +366,11 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId)
|
||||
|
||||
void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
{
|
||||
DEBUG_LOG() << "START parse SQLP";
|
||||
DEBUG_LOG(m_logger) << "START parse SQLP";
|
||||
auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId);
|
||||
if (!saa)
|
||||
{
|
||||
ERROR_LOG() << "SQ LP from SAA but SAA with id " << wsId << " not found";
|
||||
ERROR_LOG(m_logger) << "SQ LP from SAA but SAA with id " << wsId << " not found";
|
||||
return;
|
||||
}
|
||||
const QString &verein = exSQLP.einheit.verein;
|
||||
@@ -409,7 +409,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
|
||||
|
||||
|
||||
DEBUG_LOG() << "Create new Participant LP";
|
||||
DEBUG_LOG(m_logger) << "Create new Participant LP";
|
||||
std::vector<ParticipantManagement::ParticipantData> list;
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId)
|
||||
const auto root = findRootUnit(saa->getPartyId());
|
||||
if (root.id() > 0)
|
||||
{
|
||||
DEBUG_LOG() << "Append LP to Unit";
|
||||
DEBUG_LOG(m_logger) << "Append LP to Unit";
|
||||
list.push_back(root);
|
||||
}
|
||||
|
||||
@@ -471,7 +471,7 @@ void PpmHandler::removeAllSAAParticipants(const int partyId)
|
||||
list.push_back(pToDel);
|
||||
}
|
||||
req.data(list);
|
||||
DEBUG_LOG() << "Remove all participants (without Units): " << list.size();
|
||||
DEBUG_LOG(m_logger) << "Remove all participants (without Units): " << list.size();
|
||||
m_ftcPpm->modifyParticipantDataRequest(req, this);
|
||||
}
|
||||
|
||||
@@ -676,7 +676,7 @@ void PpmHandler::onSendParticipantDataTimeout()
|
||||
{
|
||||
m_sendParticipantDataTimer->stop();
|
||||
if (m_randomNumbers.empty())
|
||||
ERROR_LOG() << "Cant Send ParticipantData RandomNumbers is empty";
|
||||
ERROR_LOG(m_logger) << "Cant Send ParticipantData RandomNumbers is empty";
|
||||
ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest();
|
||||
int currentRandomNumber = m_randomNumbers.first();
|
||||
newRequest->requestId(currentRandomNumber);
|
||||
@@ -707,7 +707,7 @@ void PpmHandler::handleParticipantPositionChangedExternal(const ParticipantManag
|
||||
|
||||
void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position)
|
||||
{
|
||||
DEBUG_LOG() << "handleParticipantPositionChangedInternal";
|
||||
DEBUG_LOG(m_logger) << "handleParticipantPositionChangedInternal";
|
||||
ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId());
|
||||
|
||||
const bool hasMountedParticipants = position.mountedParticipants().is_set() && position.mountedParticipants().get().size() > 0;
|
||||
@@ -739,7 +739,7 @@ void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManag
|
||||
void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &part, const ParticipantManagement::Participant &partToBeMounted)
|
||||
{
|
||||
m_mountedParticipants.insert(part.equipmentNumber().get(), partToBeMounted.equipmentNumber().get());
|
||||
ERROR_LOG() << "Mount Participant";
|
||||
ERROR_LOG(m_logger) << "Mount Participant";
|
||||
QJsonObject telegram;
|
||||
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantMount");
|
||||
@@ -759,7 +759,7 @@ void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &
|
||||
void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant &participant)
|
||||
{
|
||||
m_mountedParticipants.remove(participant.equipmentNumber().get());
|
||||
DEBUG_LOG() << "Unmount Participant";
|
||||
DEBUG_LOG(m_logger) << "Unmount Participant";
|
||||
QJsonObject telegram;
|
||||
|
||||
telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantUnmount");
|
||||
@@ -800,7 +800,7 @@ void PpmHandler::sendParticipantPositionChanged(const ParticipantManagement::Par
|
||||
|
||||
void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "Got Function Reply " << reply.str();
|
||||
DEBUG_LOG(m_logger) << "Got Function Reply " << reply.str();
|
||||
|
||||
if (!reply.error())
|
||||
{
|
||||
@@ -815,7 +815,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r
|
||||
|
||||
const bool isVerbund = m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId)->getIsVerbund();
|
||||
|
||||
DEBUG_LOG() << "Got ModifyParticipant Reply SEND from temp Maps (partyId: " << partyId << " , isVerbund: " << isVerbund << ")";
|
||||
DEBUG_LOG(m_logger) << "Got ModifyParticipant Reply SEND from temp Maps (partyId: " << partyId << " , isVerbund: " << isVerbund << ")";
|
||||
|
||||
if (m_tempPositionMap.contains(reply.id()))
|
||||
sendPositionFromTempMap(reply.id(), partyId, isVerbund);
|
||||
@@ -828,7 +828,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r
|
||||
}
|
||||
else
|
||||
{
|
||||
ERROR_LOG() << "GOT ModifyParticipant Replay with error " << reply.translated();
|
||||
ERROR_LOG(m_logger) << "GOT ModifyParticipant Replay with error " << reply.translated();
|
||||
}
|
||||
|
||||
|
||||
@@ -845,7 +845,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r
|
||||
m_tempPartDataList.remove(reply.id());
|
||||
}
|
||||
|
||||
void PpmHandler::onModifyPartyDataReply(const Core::FunctionReplyObject &reply) { DEBUG_LOG() << "Got Function Reply " << reply.str(); }
|
||||
void PpmHandler::onModifyPartyDataReply(const Core::FunctionReplyObject &reply) { DEBUG_LOG(m_logger) << "Got Function Reply " << reply.str(); }
|
||||
|
||||
QList<ParticipantManagement::Participant> PpmHandler::findAllSAAParticipants(const int partyId)
|
||||
{
|
||||
@@ -908,7 +908,7 @@ ParticipantManagement::ParticipantData PpmHandler::findRootUnit(const int partyI
|
||||
ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(const QString &internalName, const int partyId, const bool isVerbund)
|
||||
{
|
||||
ParticipantManagement::Participant pp;
|
||||
DEBUG_LOG() << "START find participant: " << internalName;
|
||||
DEBUG_LOG(m_logger) << "START find participant: " << internalName;
|
||||
auto participantMap = m_dtcPpm->participants();
|
||||
for (const auto &part : std::as_const(participantMap))
|
||||
{
|
||||
@@ -931,13 +931,13 @@ ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(con
|
||||
|
||||
void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataModification modType)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << ", modType: " << modType;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", modType: " << modType;
|
||||
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
|
||||
const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id());
|
||||
DEBUG_LOG() << "++++ connectState: " << connectState;
|
||||
DEBUG_LOG(m_logger) << "++++ connectState: " << connectState;
|
||||
|
||||
|
||||
if (connectState != ParticipantManagement::ConnectState::Disconnecting)
|
||||
@@ -947,7 +947,7 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo
|
||||
if (!saa)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "++++ szenarName: " << saa->getSzenarName() << ", wsId: " << saa->getWsId();
|
||||
DEBUG_LOG(m_logger) << "++++ szenarName: " << saa->getSzenarName() << ", wsId: " << saa->getWsId();
|
||||
|
||||
EXStatus status;
|
||||
status.status = Szenarstatus::Gestoppt;
|
||||
@@ -1015,7 +1015,7 @@ void PpmHandler::sendChargesFromTempMap(const int rndNmbr, const int partyId, co
|
||||
if (chargeTypeId <= 0)
|
||||
continue;
|
||||
|
||||
DEBUG_LOG() << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : "");
|
||||
DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : "");
|
||||
|
||||
QVector<int> gearTypesIds = m_mainDispatcher->pdmHandler()->getDtc()->gearTypeIdFromChargeTypeId(chargeTypeId);
|
||||
|
||||
@@ -1059,7 +1059,7 @@ int PpmHandler::convertStatus_L28(const ProjectDataManagement::L28_Status &statu
|
||||
return ADLER_NOT_OPERATIONAL;
|
||||
|
||||
default:
|
||||
WARNING_LOG() << "Status " << status << " not handled in switch";
|
||||
WARNING_LOG(m_logger) << "Status " << status << " not handled in switch";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -65,6 +65,7 @@ private slots:
|
||||
void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
|
||||
void onSendParticipantDataTimeout();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position);
|
||||
void handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position);
|
||||
|
||||
@@ -85,6 +86,7 @@ private:
|
||||
|
||||
QVector<AdlerJson::Geschoss> sumUpAnzahlForSameGeschoss(const QVector<AdlerJson::Geschoss> &geschosse) const;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
MainDispatcher *m_mainDispatcher;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_dtcPpm;
|
||||
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftcPpm;
|
||||
|
||||
+17
-17
@@ -73,7 +73,7 @@ bool SAAInterface::init(std::shared_ptr<PpmHandler> ppmHandler,
|
||||
|
||||
m_ftcAes = m_aesHandler->getFtc();
|
||||
|
||||
DEBUG_LOG() << "INIT SAA Interface";
|
||||
DEBUG_LOG(m_logger) << "INIT SAA Interface";
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -123,7 +123,7 @@ static Core::RelativePositionRelativeTime convertFlugbahnpunkt(const Flugbahnpun
|
||||
|
||||
void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int aesItemId, int exposionId, const Core::GeoPosition &positionLaunch)
|
||||
{
|
||||
DEBUG_LOG() << "SAAInterface::parseFlugbahndaten";
|
||||
DEBUG_LOG(m_logger) << "SAAInterface::parseFlugbahndaten";
|
||||
|
||||
std::vector<Core::RelativePositionRelativeTime> geometryRef;
|
||||
geometryRef.clear();
|
||||
@@ -138,22 +138,22 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
const auto &utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon(), positionLaunch.lat(), zone);
|
||||
|
||||
|
||||
DEBUG_LOG() << " mmilirad: " << flugbahndaten.schussrichtung;
|
||||
DEBUG_LOG(m_logger) << " mmilirad: " << flugbahndaten.schussrichtung;
|
||||
double grad = (flugbahndaten.schussrichtung / 6400.) * 360.0;
|
||||
DEBUG_LOG() << " milli rad to degree" << (flugbahndaten.schussrichtung / 6400.) * 360;
|
||||
DEBUG_LOG() << "Degree to target" << grad;
|
||||
DEBUG_LOG(m_logger) << " milli rad to degree" << (flugbahndaten.schussrichtung / 6400.) * 360;
|
||||
DEBUG_LOG(m_logger) << "Degree to target" << grad;
|
||||
|
||||
DEBUG_LOG() << "Start point: " << positionLaunch;
|
||||
DEBUG_LOG(m_logger) << "Start point: " << positionLaunch;
|
||||
|
||||
const auto &coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(flugbahndaten.zielkoordinate.koordinate.longitude * (M_PI / 180.0),
|
||||
flugbahndaten.zielkoordinate.koordinate.latitude * (M_PI / 180.0));
|
||||
DEBUG_LOG() << "End point: " << coordEnd;
|
||||
DEBUG_LOG(m_logger) << "End point: " << coordEnd;
|
||||
LtsCoordTrans::UtmCoordinate coordDiff = coordEnd;
|
||||
|
||||
coordDiff.x = coordDiff.x - utmLaunch.x;
|
||||
coordDiff.y = coordDiff.y - utmLaunch.y;
|
||||
const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI);
|
||||
DEBUG_LOG() << "use new Degree " << useNewGrad;
|
||||
DEBUG_LOG(m_logger) << "use new Degree " << useNewGrad;
|
||||
|
||||
QTransform matrix;
|
||||
matrix.rotate(useNewGrad);
|
||||
@@ -169,11 +169,11 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
const auto &fbPosRelative = convertFlugbahnpunkt(pos, matrix, utmLaunch, m_logger);
|
||||
DEBUG_LOG() << " fbPosRelative " << fbPosRelative;
|
||||
DEBUG_LOG(m_logger) << " fbPosRelative " << fbPosRelative;
|
||||
}
|
||||
|
||||
|
||||
TRACE_LOG() << "Flugbahnpunkt:"
|
||||
TRACE_LOG(m_logger) << "Flugbahnpunkt:"
|
||||
<< ", xRelativ :" << pos.xRelativ
|
||||
<< ", yRelativ :" << pos.yRelativ
|
||||
<< ", zRelativ :" << pos.zRelativ
|
||||
@@ -198,7 +198,7 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
utmCoord.zone = utmLaunch.zone;
|
||||
QPointF pntGeo = utmCoord.geographic();
|
||||
|
||||
TRACE_LOG() << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid()
|
||||
TRACE_LOG(m_logger) << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid()
|
||||
<< ", pntGeo :" << pntGeo.x() << " / " << pntGeo.y() << " / " << z;
|
||||
QTransform matrix;
|
||||
matrix.rotate(useNewGrad);
|
||||
@@ -210,15 +210,15 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
flightPoint.relativeTime() = pos.zeit;
|
||||
QPointF point(flightPoint.offsetX(), flightPoint.offsetY());
|
||||
|
||||
TRACE_LOG() << " POS bevore rot: " << point;
|
||||
TRACE_LOG(m_logger) << " POS bevore rot: " << point;
|
||||
|
||||
auto rotatePoint = matrix.map(point);
|
||||
TRACE_LOG() << " POS after rot: " << rotatePoint;
|
||||
TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint;
|
||||
|
||||
pntGeo.setX(rotatePoint.x());
|
||||
pntGeo.setY(rotatePoint.y());
|
||||
|
||||
TRACE_LOG() << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid()
|
||||
TRACE_LOG(m_logger) << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid()
|
||||
<< ", pntGeo :" << pntGeo.x() << " / " << pntGeo.y() << " / " << z;
|
||||
|
||||
|
||||
@@ -245,7 +245,7 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
newRequest->mhpScatterWidthDetonationHeight(flugbahndaten.streuung.seitenstreuungH);
|
||||
newRequest->shootDirection((flugbahndaten.schussrichtung / 6400.) * 360);
|
||||
newRequest->errorcode(static_cast<int>(flugbahndaten.fehlercode));
|
||||
DEBUG_LOG() << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size()
|
||||
DEBUG_LOG(m_logger) << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size()
|
||||
<< ", newRequest->errorcode :" << newRequest->errorcode() << ", newRequest->Peak:" << newRequest->peakAltitude()
|
||||
<< ", newRequest->direction:" << newRequest->shootDirection() << ", flugbahndaten.fehlercode :" << static_cast<int>(flugbahndaten.fehlercode);
|
||||
|
||||
@@ -254,10 +254,10 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae
|
||||
|
||||
void SAAInterface::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply)
|
||||
{
|
||||
DEBUG_LOG() << "onTrajectoryAdlerModifyReply";
|
||||
DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply";
|
||||
if (reply.error())
|
||||
{
|
||||
ERROR_LOG() << reply.translated();
|
||||
ERROR_LOG(m_logger) << reply.translated();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -75,6 +75,8 @@ public:
|
||||
void rxData (const T &data );
|
||||
|
||||
private:
|
||||
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
int m_wsId;
|
||||
|
||||
+11
-11
@@ -58,25 +58,25 @@ bool WebSocketHandler::sendTelegram(int typeId, const QJsonObject *data, int exe
|
||||
|
||||
bool WebSocketHandler::sendTelegram(const int wsId, const QJsonObject *data)
|
||||
{
|
||||
DEBUG_LOG() << "Send Telegram esId=" << wsId
|
||||
DEBUG_LOG(m_logger) << "Send Telegram esId=" << wsId
|
||||
<< ", m_connections.size=" << m_connections.size();
|
||||
|
||||
for (auto it = m_connections.begin(); it != m_connections.end(); it++)
|
||||
DEBUG_LOG() << "key: " << it.key();
|
||||
DEBUG_LOG(m_logger) << "key: " << it.key();
|
||||
|
||||
const QString jsonStr = QString::fromUtf8(QJsonDocument(*data).toJson(QJsonDocument::Compact));
|
||||
if(!m_connections.contains(wsId))
|
||||
{
|
||||
DEBUG_LOG() << "!m_connections.contains(" << wsId << ") return false;";
|
||||
DEBUG_LOG(m_logger) << "!m_connections.contains(" << wsId << ") return false;";
|
||||
return false;
|
||||
}
|
||||
std::shared_ptr<WebSocketWrapper> ws = m_connections.value(wsId);
|
||||
|
||||
DEBUG_LOG() << "Send Telegram to SAA: " << jsonStr<< " \n LocalPort" << ws->webSocket()->localAddress().toString()
|
||||
DEBUG_LOG(m_logger) << "Send Telegram to SAA: " << jsonStr<< " \n LocalPort" << ws->webSocket()->localAddress().toString()
|
||||
<< "." << ws->webSocket()->localPort()
|
||||
<< " PeerPort " << ws->webSocket()->peerAddress().toString()
|
||||
<< ":" <<ws->webSocket()->peerPort();
|
||||
DEBUG_LOG() << "VERSION " << ws->webSocket()->version();
|
||||
DEBUG_LOG(m_logger) << "VERSION " << ws->webSocket()->version();
|
||||
return ws->sendTextMessage(jsonStr);
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ bool WebSocketHandler::disconnectWs(int wsId)
|
||||
{
|
||||
if(!m_connections.contains(wsId))
|
||||
{
|
||||
DEBUG_LOG() << "!m_connections.contains(" << wsId << ") return false;";
|
||||
DEBUG_LOG(m_logger) << "!m_connections.contains(" << wsId << ") return false;";
|
||||
return false;
|
||||
}
|
||||
std::shared_ptr<WebSocketWrapper> ws = m_connections.value(wsId);
|
||||
@@ -124,7 +124,7 @@ int WebSocketHandler::getExerciseId(int wsId) const
|
||||
|
||||
void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson)
|
||||
{
|
||||
DEBUG_LOG() << "Receive Telegram from SAA <<<<< " << baJson;
|
||||
DEBUG_LOG(m_logger) << "Receive Telegram from SAA <<<<< " << baJson;
|
||||
using namespace TrainingAreaBase::TetraIcd;
|
||||
|
||||
WebSocketWrapper *wsw = qobject_cast<WebSocketWrapper *>(sender());
|
||||
@@ -147,7 +147,7 @@ void WebSocketHandler::onNewConnection()
|
||||
if (!ws)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
|
||||
DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort();
|
||||
auto wsw = std::make_shared<WebSocketWrapper>(ws);
|
||||
int wsId = m_nextWsId;
|
||||
|
||||
@@ -158,7 +158,7 @@ void WebSocketHandler::onNewConnection()
|
||||
wsw->setWsId(wsId);
|
||||
emit newConnection( wsId, ws->peerAddress().toString(),ws->peerPort());
|
||||
m_connections.insert(wsId ,wsw);
|
||||
DEBUG_LOG() << "m_connections.insert"
|
||||
DEBUG_LOG(m_logger) << "m_connections.insert"
|
||||
<< ", wsId :" << wsId;
|
||||
m_nextWsId++;
|
||||
|
||||
@@ -181,10 +181,10 @@ void WebSocketHandler::onWebSocketDisconnected()
|
||||
for (auto it = copy.begin(); it != copy.end(); ++it)
|
||||
{
|
||||
auto wsw = *it;
|
||||
DEBUG_LOG() << "peerPort :" << wsw->webSocket()->peerPort() << ", localPort :" << wsw->webSocket()->localPort();
|
||||
DEBUG_LOG(m_logger) << "peerPort :" << wsw->webSocket()->peerPort() << ", localPort :" << wsw->webSocket()->localPort();
|
||||
if (wsw->webSocket() == ws)
|
||||
{
|
||||
DEBUG_LOG() << it.key() << " Emit Disconnect ------------------------------------- esId=" << it.key();
|
||||
DEBUG_LOG(m_logger) << it.key() << " Emit Disconnect ------------------------------------- esId=" << it.key();
|
||||
emit wsDisconnected(it.key());
|
||||
m_connections.remove(it.key());
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user