Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+20
-21
@@ -26,23 +26,22 @@ namespace AreaEffectSimulation
|
||||
|
||||
|
||||
|
||||
AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent)
|
||||
: QObject(parent)
|
||||
, m_effector(parent)
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent) : QObject(parent)
|
||||
, m_effector(parent),
|
||||
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
AbstractFiringStrategy::~AbstractFiringStrategy()
|
||||
{
|
||||
TRACE_LOG() << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG() << Q_FUNC_INFO << " END";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
void AbstractFiringStrategy::calculateDispersionTrajectory()
|
||||
{
|
||||
DEBUG_LOG() << "calculateDispersionTrajectory";
|
||||
DEBUG_LOG(m_logger) << "calculateDispersionTrajectory";
|
||||
// 1. Neuen Zielpunkt berechnen
|
||||
|
||||
const auto &intendendTrajectory = m_effector->intendendTrajectory();
|
||||
@@ -50,7 +49,7 @@ void AbstractFiringStrategy::calculateDispersionTrajectory()
|
||||
// sanity check:
|
||||
if (intendendTrajectory.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of intendendTrajectory not sufficiant, size=" << intendendTrajectory.size();
|
||||
return;
|
||||
}
|
||||
@@ -73,7 +72,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// sanity check:
|
||||
if (relativeTrajectory.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of relativeTrajectory not sufficiant, size=" << relativeTrajectory.size();
|
||||
return {};
|
||||
}
|
||||
@@ -89,7 +88,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365
|
||||
for (const TrajectoryPoint &trajPntRelPos : std::as_const(relativeTrajectory))
|
||||
{
|
||||
DEBUG_LOG() << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
|
||||
DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<:
|
||||
|
||||
// // geographic offers nice feature to add an offset:
|
||||
// const QPointF &trajectoryAbsGeo = launchUtm.geographic(trajPntRelPos);
|
||||
@@ -104,7 +103,7 @@ std::vector<Core::GeoPositionRelativeTime> AbstractFiringStrategy::buildTrajecto
|
||||
// Position des Participants mit der m_participantId
|
||||
const double zValue = effectorPositionGeo.z() + trajPntRelPos.position.z(); // trajPntRelPos.position.z() ist die Hoehe
|
||||
|
||||
DEBUG_LOG() << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo;
|
||||
DEBUG_LOG(m_logger) << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo;
|
||||
geometry.emplace_back(Core::GeoPositionRelativeTime(trajPntAbsGeo.x(), trajPntAbsGeo.y(), zValue, trajPntRelPos.time));
|
||||
}
|
||||
return geometry;
|
||||
@@ -115,7 +114,7 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std::
|
||||
// sanity check:
|
||||
if (trajectoryGeometry.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of trajectoryGeometry not sufficiant, size=" << trajectoryGeometry.size();
|
||||
return {};
|
||||
}
|
||||
@@ -133,14 +132,14 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std::
|
||||
|
||||
int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajectoryTimeAware, const QJsonObject &properties)
|
||||
{
|
||||
DEBUG_LOG() << "sendChargeEffect";
|
||||
DEBUG_LOG(m_logger) << "sendChargeEffect";
|
||||
|
||||
const auto &trajGeometry = trajectoryTimeAware.geometry();
|
||||
|
||||
// sanity check:
|
||||
if (trajGeometry.size() < 2)
|
||||
{
|
||||
ERROR_LOG() << Q_FUNC_INFO
|
||||
ERROR_LOG(m_logger) << Q_FUNC_INFO
|
||||
<< " size of trajectoryTimeAware.geometry not sufficiant, size=" << trajGeometry.size();
|
||||
return -1;
|
||||
}
|
||||
@@ -165,7 +164,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto
|
||||
chargeEffect.trajectoryTimeAware(trajectoryTimeAware);
|
||||
|
||||
const auto &reply = m_effector->mainHandler()->chargeEffectHandler()->createChargeEffect(chargeEffect);
|
||||
DEBUG_LOG() << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId();
|
||||
DEBUG_LOG(m_logger) << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId();
|
||||
return reply.id();
|
||||
}
|
||||
|
||||
@@ -178,21 +177,21 @@ Core::GeoPosition AbstractFiringStrategy::participantPosition(int participantId)
|
||||
|
||||
int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId)
|
||||
{
|
||||
DEBUG_LOG() << "getGearTypeId"
|
||||
DEBUG_LOG(m_logger) << "getGearTypeId"
|
||||
<< ", chargeTypeId:" << chargeTypeId << ", participantId:" << participantId;
|
||||
|
||||
m_effector->mainHandler()->dds()->ppmDtc()->enableDynamicParticipantData(true);
|
||||
m_effector->mainHandler()->dds()->ppmDtc()->waitForHistoricalDataDynamicParticipantData(1000);
|
||||
const ParticipantManagement::DynamicParticipantData &dynamicParticipantData = m_effector->mainHandler()->dds()->ppmDtc()->dynamicParticipantData(participantId);
|
||||
DEBUG_LOG() << "gearSize " << dynamicParticipantData.gear().size();
|
||||
DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size();
|
||||
|
||||
const auto& participantData_gear = dynamicParticipantData.gear();
|
||||
for (const auto &gear : std::as_const(participantData_gear))
|
||||
{
|
||||
DEBUG_LOG() << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId;
|
||||
DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId;
|
||||
if (gear.chargeTypeId() == chargeTypeId)
|
||||
{
|
||||
DEBUG_LOG() << "getGearTypeId return: " << gear.gearTypeId();
|
||||
DEBUG_LOG(m_logger) << "getGearTypeId return: " << gear.gearTypeId();
|
||||
if (gear.gearTypeId() != 0)
|
||||
return gear.gearTypeId();
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user