Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -76,7 +76,7 @@ CesTests::CesTests(QObject *parent)
bool CesTests::init(int domainId, int exerciseId, int testId, int roomId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_roomId = roomId;
@@ -96,7 +96,7 @@ bool CesTests::init(int domainId, int exerciseId, int testId, int roomId)
bRet &= m_aesDts->enableBorderline();
bRet &= m_aesDts->enableDusMineState();
bRet &= m_aesDts->enableMineArea();
DEBUG_LOG() << "AES Dts create interface bRet:" << bRet ;
DEBUG_LOG(m_logger) << "AES Dts create interface bRet:" << bRet ;
m_ismDts = InfrastructureManagement::Interface::Dts::create(m_ddsConnector42);
bRet &= m_ismDts->enableMainStructureElement();
@@ -141,7 +141,7 @@ bool CesTests::init(int domainId, int exerciseId, int testId, int roomId)
void CesTests::startTest()
{
INFO_LOG() << "startTest m_testId:" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId:" << m_testId;
if (m_testId <= 1) // AES-Hit On Buildings area explosions
{
m_countHitOnBuildingReply = 0;
@@ -464,7 +464,7 @@ void CesTests::tryCreateTriggeredExplosion()
ti.bitfield().resize(1);
ti.bitfield()[0] = 0; // 0 = Mine active
DEBUG_LOG() << "Publishing TriggeredExplosions: " << ti;
DEBUG_LOG(m_logger) << "Publishing TriggeredExplosions: " << ti;
if (!m_aesDts->publish(ti))
failExit("Error publishing TriggeredExplosions");
}
@@ -476,7 +476,7 @@ void CesTests::tryCreateExplosionArea()
ea.participantId(m_originatorParticipantId); // In ddsview <not set>
ea.effectStateId(AreaEffectSimulation::AesEffectState::inner_enum::EsPrepared);
DEBUG_LOG() << "Publishing ExplosionArea: " << ea;
DEBUG_LOG(m_logger) << "Publishing ExplosionArea: " << ea;
if (!m_aesDts->publish(ea))
failExit("Error publishing ExplosionArea");
}
@@ -505,7 +505,7 @@ void CesTests::tryCreateExplosionSinglePrepared()
m_es.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_es.chargeStruct().chargeTypeId(m_chargeTypeId);
DEBUG_LOG() << "Publishing ExplosionSingle: " << m_es;
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es;
if (!m_aesDts->publish(m_es))
failExit("Error publishing ExplosionSingle");
}
@@ -521,14 +521,14 @@ void CesTests::tryCreateExplosionSingle()
m_es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
m_es.sampleTime(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG() << "Publishing ExplosionSingle: " << m_es;
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es;
if (!m_aesDts->publish(m_es))
failExit("Error publishing ExplosionSingle");
}
void CesTests::tryCreateAesItemView()
{
INFO_LOG() << "trying to send AesItemView AtExplosionArea";
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionArea";
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
@@ -547,7 +547,7 @@ void CesTests::tryCreateAesItemView()
setPos(m_aiv.form(), m_housePos.geographic(30, 30));
setPos(m_aiv.form(), m_housePos.geographic(30, -10));
DEBUG_LOG() << "Publishing AesItemView: " << m_aiv;
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
}
@@ -557,13 +557,13 @@ void CesTests::tryCreateChargeType()
ProjectDataManagement::ChargeType ct;
ct.id(m_chargeTypeId);
ct.properties("{\"impactRadius\":5}");
DEBUG_LOG() << "Publishing ChargeType: " << ct;
DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct;
if (!m_pdmDts->publish(ct))
failExit("Error publishing ChargeType");
ct.id(40); // old charge type 10040 -> 40, hard-codded?!
ct.properties("{\"impactRadius\":6}");
DEBUG_LOG() << "Publishing ChargeType: " << ct;
DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct;
if (!m_pdmDts->publish(ct))
failExit("Error publishing ChargeType");
}
@@ -591,7 +591,7 @@ void CesTests::tryCreateAesItemViewSingleExplosions()
setPos(m_aiv.form(), m_housePos.geographic(-10, 20));
setPos(m_aiv.form(), m_housePos.geographic(-10, 30));
DEBUG_LOG() << "Publishing AesItemView: " << m_aiv;
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
}
@@ -615,7 +615,7 @@ void CesTests::tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState desir
setPos(m_aiv.form(), m_housePos.geographic(35, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 3));
DEBUG_LOG() << "Publishing AesItemView: " << m_aiv;
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
}
@@ -640,14 +640,14 @@ void CesTests::tryCreateAesItemViewSM()
setPos(m_aiv.form(), m_housePos.geographic(35, 35));
setPos(m_aiv.form(), m_housePos.geographic(35, 3));
DEBUG_LOG() << "Publishing AesItemView: " << m_aiv;
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
}
void CesTests::tryCreateAesItemViewMA()
{
INFO_LOG() << "trying to send AesItemView AtMineArea";
INFO_LOG(m_logger) << "trying to send AesItemView AtMineArea";
m_aiv = AreaEffectSimulation::AesItemView();
m_aiv.aesItemId(m_aesItemId);
@@ -667,7 +667,7 @@ void CesTests::tryCreateAesItemViewMA()
setPos(m_aiv.form(), m_housePos.geographic(37, 37));
setPos(m_aiv.form(), m_housePos.geographic(37, 1));
DEBUG_LOG() << "Publishing AesItemView: " << m_aiv;
DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv;
if (!m_aesDts->publish(m_aiv))
failExit("Error publishing AesItemView");
}
@@ -689,7 +689,7 @@ void CesTests::tryCreateBorderline()
setPos(bl.segments(), m_housePos.geographic(5, 3));
bl.isDeleted(false);
DEBUG_LOG() << "Publishing BorderLine: " << bl;
DEBUG_LOG(m_logger) << "Publishing BorderLine: " << bl;
if (!m_aesDts->publish(bl))
failExit("Error publishing Borderline");
}
@@ -708,7 +708,7 @@ void CesTests::tryCreateMainStructureElement()
m_mse.angle(318.83);
m_mse.modelId(1337);
m_mse.externalWlsId(0);
DEBUG_LOG() << "Publishing MainStructureElement: " << m_mse;
DEBUG_LOG(m_logger) << "Publishing MainStructureElement: " << m_mse;
if (!m_ismDts->publish(m_mse))
failExit("Error publishing MainStructureElement");
}
@@ -739,7 +739,7 @@ void CesTests::tryCreateMainFootprint()
elem.relPosition(Core::RelativePosition(0.0, 10.0, 0.0));
mf.elements().push_back(elem);
DEBUG_LOG() << "Publishing MainFootprint: " << mf;
DEBUG_LOG(m_logger) << "Publishing MainFootprint: " << mf;
if (!m_ismDts->publish(mf))
failExit("Error publishing MainFootprint");
}
@@ -758,7 +758,7 @@ void CesTests::tryCreateDynamicParticipantData()
dp.sampleTime(si.stateTime());
DEBUG_LOG() << "Publishing DynamicParticipantData: " << dp;
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData: " << dp;
if (!m_ppmDts->publish(dp))
failExit("Error publishing DynamicParticipantData");
}
@@ -782,7 +782,7 @@ void CesTests::tryCreateParticipantPosition()
pp.pos(pos);
m_expectedPosition[pp.participantId()] = Core::GeoPosition2D(posF.x(), posF.y());
DEBUG_LOG() << "Publishing ParticipantPosition: " << pp;
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition: " << pp;
if (!m_ppmDts->publish(pp))
failExit("Error publishing ParticipantPosition");
}
@@ -812,7 +812,7 @@ void CesTests::tryCreateBuildingState()
rs.remainingEffectPercent(60);
bs.roomStates().push_back(rs);
DEBUG_LOG() << "Publishing BuildingState: " << bs;
DEBUG_LOG(m_logger) << "Publishing BuildingState: " << bs;
if (!m_bldDts->publish(bs))
failExit("Error publishing BuildingState");
}
@@ -833,7 +833,7 @@ void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &co
// debug und co
m_countHitOnBuildingReply++;
DEBUG_LOG() << "onSendCesHitOnBuildingRequest cnt = " << m_countHitOnBuildingReply << "\n"
DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequest cnt = " << m_countHitOnBuildingReply << "\n"
<< " request: " << request << ", "
<< dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n";
@@ -889,7 +889,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
/* comes out with timeout on STTW
if (request.effectTime() + 1000 < QDateTime::currentMSecsSinceEpoch())
{
DEBUG_LOG() << "onSendCesHitRequest from previous test - ignoring"
DEBUG_LOG(m_logger) << "onSendCesHitRequest from previous test - ignoring"
<< request.effectTime()
<< QDateTime::currentMSecsSinceEpoch();
return;
@@ -897,7 +897,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
*/
// debug und co
const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime()));
DEBUG_LOG() << "onSendCesHitRequest" << "\n"
DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n"
<< " request: " << request << ", "
<< dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n";
if (request.remainEffectPercent())
@@ -924,7 +924,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
// 3 x Enter
if (request.remainEffectPercent() == 1)
m_replyEnterFunctionalArea ++;
DEBUG_LOG()<< "m_replyEnterFunctionalArea=" << m_replyEnterFunctionalArea;
DEBUG_LOG(m_logger)<< "m_replyEnterFunctionalArea=" << m_replyEnterFunctionalArea;
if (m_replyEnterFunctionalArea == 3)
ExitSuccess();
break;
@@ -968,7 +968,7 @@ void CesTests::checkParticipantEvent()
return;
}
DEBUG_LOG() << "Waiting for a participant event: " << expectedType;
DEBUG_LOG(m_logger) << "Waiting for a participant event: " << expectedType;
bool bRet = false;
for (int i = 0; i < 50; ++i)
@@ -1012,7 +1012,7 @@ void CesTests::tryCreateParticipant()
pt.isSimulated(false);
pt.equipmentNumber(4711);
DEBUG_LOG() << "Publishing Participant:" << pt;
DEBUG_LOG(m_logger) << "Publishing Participant:" << pt;
if (!m_ppmDts->publish(pt))
failExit("Error requesting create Participant");
}
@@ -1020,7 +1020,7 @@ void CesTests::tryCreateParticipant()
void CesTests::failExit(const char *reason)
{
ERROR_LOG() << "FailExit: " << reason << " for test case = " << m_testId;
ERROR_LOG(m_logger) << "FailExit: " << reason << " for test case = " << m_testId;
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
@@ -1029,7 +1029,7 @@ void CesTests::ExitSuccess()
{
if (!m_bTestsSuccessful)
return;
INFO_LOG() << "ExitSuccess for test case = " << m_testId;
INFO_LOG(m_logger) << "ExitSuccess for test case = " << m_testId;
m_bTestsSuccessful = true;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
@@ -77,6 +77,7 @@ protected Q_SLOTS:
void testTimeout() { failExit("Test timeout"); }
void ExitSuccess();
private:
NGL::INGLLogger &m_logger;
void onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &cookie,
const Buildings::SendCesHitOnBuildingRequest &request) override;
void onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
@@ -94,6 +95,7 @@ private: // structs
};
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector42;
@@ -33,14 +33,13 @@
namespace CentralEffectSimulation
{
CesTestsBlockedAreas::CesTestsBlockedAreas(QObject *parent)
: QObject(parent)
CesTestsBlockedAreas::CesTestsBlockedAreas(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
, m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_testId(0)
, m_participantIndex(0)
, m_DynamicParticipantIndex(0)
{}
, m_DynamicParticipantIndex(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsBlockedAreas::~CesTestsBlockedAreas()
{}
@@ -48,7 +47,7 @@ CesTestsBlockedAreas::~CesTestsBlockedAreas()
bool CesTestsBlockedAreas::init(int domainId, int exerciseId, int testId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_buildingId = 7; // ism_main_structure_element:id
@@ -83,7 +82,7 @@ bool CesTestsBlockedAreas::init(int domainId, int exerciseId, int testId)
void CesTestsBlockedAreas::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 Participant in BT56
{
QTimer::singleShot(0, this, &CesTestsBlockedAreas::tryCreateParticipantPositionOutside);
@@ -136,7 +135,7 @@ void CesTestsBlockedAreas::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(6000, this, &CesTestsBlockedAreas::failExit);
@@ -158,10 +157,10 @@ void CesTestsBlockedAreas::tryCreateDynamicParticipantData()
dp.sampleTime(esTime);
m_DynamicParticipantIndex++;
DEBUG_LOG() << "Publishing DynamicParticipantData";
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
if (!m_ppmDts->publish(dp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -182,10 +181,10 @@ void CesTestsBlockedAreas::tryCreateParticipantPositionOutside()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -206,10 +205,10 @@ void CesTestsBlockedAreas::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -223,10 +222,10 @@ void CesTestsBlockedAreas::tryCreateParticipant()
pt.id(m_participants[m_participantIndex].participantId);
pt.equipmentNumber(m_participants[m_participantIndex].equipmentNumber);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
}
@@ -248,10 +247,10 @@ void CesTestsBlockedAreas::tryCreateBuildingStateInit()
bs.vulnerabilityState(ProjectDataManagement::VulnerabilityState::CombatReady);
bs.sampleTime(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG() << "Publishing BuildingState";
DEBUG_LOG(m_logger) << "Publishing BuildingState";
if (!m_bldDts->publish(bs))
{
ERROR_LOG() << "Error requesting create BuildingState";
ERROR_LOG(m_logger) << "Error requesting create BuildingState";
failExit();
}
}
@@ -278,30 +277,30 @@ void CesTestsBlockedAreas::tryCreateBuildingState()
bs.roomStates()[0] = rs;
bs.sampleTime(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG() << "Publishing BuildingState";
DEBUG_LOG(m_logger) << "Publishing BuildingState";
if (!m_bldDts->publish(bs))
{
ERROR_LOG() << "Error requesting create BuildingState";
ERROR_LOG(m_logger) << "Error requesting create BuildingState";
failExit();
}
}
void CesTestsBlockedAreas::checkBuildingOwnership()
{
INFO_LOG() << "checkBuildingOwnership";
INFO_LOG(m_logger) << "checkBuildingOwnership";
ExitSuccess();
}
void CesTestsBlockedAreas::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void CesTestsBlockedAreas::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
@@ -65,6 +65,7 @@ private: // structs
};
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector42;
@@ -29,8 +29,7 @@
namespace CentralEffectSimulation
{
CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent)
: QObject(parent)
CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
//, m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD9387781202")))
@@ -41,8 +40,8 @@ CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent)
, m_DynamicParticipantIndex(0)
, m_aesItemId(5)
, m_chargeTypeId(252) // Verdeckte Ladung
, m_countEventBoobyTrap(0)
{}
, m_countEventBoobyTrap(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsBoobyTrap::~CesTestsBoobyTrap()
{}
@@ -52,7 +51,7 @@ bool CesTestsBoobyTrap::init(int domainId, int exerciseId, int testId)
bool bRet = true;
int equipmentTypeIdVehicle = 27;
int equipmentTypeIdSoldier = 55; // dds-Topic Participant-Management::Type
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -117,7 +116,7 @@ bool CesTestsBoobyTrap::init(int domainId, int exerciseId, int testId)
void CesTestsBoobyTrap::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 SMART
{
m_explosionSingle = m_refPos.geographic(5, 5);
@@ -132,7 +131,7 @@ void CesTestsBoobyTrap::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(8000, this, &CesTestsBoobyTrap::failExit);
@@ -158,11 +157,11 @@ void CesTestsBoobyTrap::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition[" << m_participantIndex << "]"
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition[" << m_participantIndex << "]"
<< " pos=" << posF.x() << "/" << posF.y();
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -170,7 +169,7 @@ void CesTestsBoobyTrap::tryCreateParticipantPosition()
void CesTestsBoobyTrap::checkParticipantEvent()
{
INFO_LOG() << "checkParicipantEvent";
INFO_LOG(m_logger) << "checkParicipantEvent";
m_cesDtc->waitForHistoricalDataParticipantEvent();
switch (m_testId)
@@ -178,7 +177,7 @@ void CesTestsBoobyTrap::checkParticipantEvent()
case 1:
if ( m_countEventBoobyTrap == 2)
{
INFO_LOG() << "ExitSuccess";
INFO_LOG(m_logger) << "ExitSuccess";
ExitSuccess();
}
break;
@@ -198,7 +197,7 @@ static void setPos(std::vector<Core::GeoPosition> &cont, const QPointF &pos)
void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrap()
{
INFO_LOG() << "trying to send AesItemView tryCreateAesItemViewBoobyTrap";
INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesItemViewBoobyTrap";
AreaEffectSimulation::AesItemView iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -221,17 +220,17 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrap()
setPos(iv.form(), m_refPos.geographic( 10, 30));
setPos(iv.form(), m_refPos.geographic( 10, -10));
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create tryCreateAesItemViewBoobyTrap";
ERROR_LOG(m_logger) << "Error requesting create tryCreateAesItemViewBoobyTrap";
failExit();
}
}
void CesTestsBoobyTrap::tryCreateAesBoobyTrap()
{
INFO_LOG() << "trying to send AesItemView tryCreateAesBoobyTrap";
INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesBoobyTrap";
AreaEffectSimulation::BoobyTrap iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -251,10 +250,10 @@ void CesTestsBoobyTrap::tryCreateAesBoobyTrap()
iv.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000);
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create tryCreateBoobyTrap";
ERROR_LOG(m_logger) << "Error requesting create tryCreateBoobyTrap";
failExit();
}
}
@@ -262,7 +261,7 @@ void CesTestsBoobyTrap::tryCreateAesBoobyTrap()
void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary()
{
INFO_LOG() << "trying to send AesItemView tryCreateAesItemViewBoobyTrapSecondary";
INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesItemViewBoobyTrapSecondary";
AreaEffectSimulation::AesItemView iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -285,10 +284,10 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary()
setPos(iv.form(), m_refPos.geographic( 50, 50));
setPos(iv.form(), m_refPos.geographic( 50, -20));
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create AesItemViewBoobyTrapSecondary";
ERROR_LOG(m_logger) << "Error requesting create AesItemViewBoobyTrapSecondary";
failExit();
}
}
@@ -296,7 +295,7 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary()
void CesTestsBoobyTrap::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType)
{
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId()
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId()
<< " eventType=" << eventData.eventTypeId()
<< " aesItemId=" << eventData.aesItemId();
if (modType == DataModification::eRemoved ||
@@ -305,7 +304,7 @@ void CesTestsBoobyTrap::onEventChanged(const CentralEffectSimulation::Participan
if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitMine)
{
m_countEventBoobyTrap ++;
DEBUG_LOG() << "m_countEventBoobyTrap=" << m_countEventBoobyTrap
DEBUG_LOG(m_logger) << "m_countEventBoobyTrap=" << m_countEventBoobyTrap
<< " eventData.aesItemId()=" << eventData.aesItemId()
<< " eventData.participantId()=" << eventData.participantId();
}
@@ -321,14 +320,14 @@ Core::FunctionReplyObject CesTestsBoobyTrap::fillFro(int participantId, bool bSu
void CesTestsBoobyTrap::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(200, qApp, QCoreApplication::quit);
}
void CesTestsBoobyTrap::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(200, qApp, &QCoreApplication::quit);
}
@@ -54,6 +54,7 @@ protected Q_SLOTS:
protected:
NGL::INGLLogger &m_logger;
private: // methods
void checkParticipantEvent();
@@ -29,8 +29,7 @@
namespace CentralEffectSimulation
{
CesTestsGasPipe::CesTestsGasPipe(QObject *parent)
: QObject(parent)
CesTestsGasPipe::CesTestsGasPipe(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
, m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_testId(0)
@@ -40,8 +39,8 @@ CesTestsGasPipe::CesTestsGasPipe(QObject *parent)
, m_DynamicParticipantIndex(0)
, m_aesItemId(5)
, m_chargeTypeId(374) // SMART
, m_countEventGasPipe(0)
{}
, m_countEventGasPipe(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsGasPipe::~CesTestsGasPipe()
{}
@@ -51,7 +50,7 @@ bool CesTestsGasPipe::init(int domainId, int exerciseId, int testId)
bool bRet = true;
int equipmentTypeIdVehicle = 35;
int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -137,7 +136,7 @@ bool CesTestsGasPipe::init(int domainId, int exerciseId, int testId)
void CesTestsGasPipe::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 SMART
{
m_explosionSingle = m_refPos.geographic(5, 5);
@@ -162,7 +161,7 @@ void CesTestsGasPipe::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(8000, this, &CesTestsGasPipe::failExit);
@@ -184,10 +183,10 @@ void CesTestsGasPipe::tryCreateDynamicParticipantData()
dp.sampleTime(esTime);
m_DynamicParticipantIndex++;
DEBUG_LOG() << "Publishing DynamicParticipantData";
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
if (!m_ppmDts->publish(dp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -211,10 +210,10 @@ void CesTestsGasPipe::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -228,10 +227,10 @@ void CesTestsGasPipe::tryCreateParticipant()
pt.id(m_id);
pt.equipmentNumber(m_equipmentNumber);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
m_id++;
@@ -240,7 +239,7 @@ void CesTestsGasPipe::tryCreateParticipant()
void CesTestsGasPipe::checkParticipantEvent()
{
INFO_LOG() << "checkParicipantEvent";
INFO_LOG(m_logger) << "checkParicipantEvent";
m_cesDtc->waitForHistoricalDataParticipantEvent();
switch (m_testId)
@@ -273,10 +272,10 @@ void CesTestsGasPipe::tryCreateTypeVehicle()
ty.name("HMMWV Utility");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -294,10 +293,10 @@ void CesTestsGasPipe::tryCreateTypeSoldier()
ty.name("Soldier");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -308,7 +307,7 @@ static void setPos(std::vector<Core::GeoPosition> &cont, const QPointF &pos)
void CesTestsGasPipe::tryCreateAesItemViewGasPipe()
{
INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions";
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions";
AreaEffectSimulation::AesItemView iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -331,30 +330,30 @@ void CesTestsGasPipe::tryCreateAesItemViewGasPipe()
setPos(iv.form(), m_refPos.geographic( 10, 30));
setPos(iv.form(), m_refPos.geographic( 10, -10));
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions";
ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions";
failExit();
}
}
void CesTestsGasPipe::tryCreateChargeType()
{
DEBUG_LOG() << "Publishing ChargeType";
DEBUG_LOG(m_logger) << "Publishing ChargeType";
ProjectDataManagement::ChargeType ct;
ct.id(m_chargeTypeId);
ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}");
if (!m_pdmDts->publish(ct))
{
ERROR_LOG() << "Error publish ChargeType";
ERROR_LOG(m_logger) << "Error publish ChargeType";
failExit();
}
}
void CesTestsGasPipe::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType)
{
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId()
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId()
<< " eventType=" << eventData.eventTypeId();
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
@@ -362,7 +361,7 @@ void CesTestsGasPipe::onEventChanged(const CentralEffectSimulation::ParticipantE
if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitGasPipe)
{
m_countEventGasPipe ++;
DEBUG_LOG() << "m_countEventGasPipe=" << m_countEventGasPipe;
DEBUG_LOG(m_logger) << "m_countEventGasPipe=" << m_countEventGasPipe;
}
}
@@ -376,14 +375,14 @@ Core::FunctionReplyObject CesTestsGasPipe::fillFro(int participantId, bool bSucc
void CesTestsGasPipe::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void CesTestsGasPipe::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(200, qApp, &QCoreApplication::quit);
}
@@ -57,6 +57,7 @@ protected Q_SLOTS:
protected:
NGL::INGLLogger &m_logger;
private: // methods
void checkParticipantEvent();
@@ -32,12 +32,11 @@
namespace CentralEffectSimulation
{
CesTestsGeopairing::CesTestsGeopairing(QObject *parent)
: QObject(parent)
CesTestsGeopairing::CesTestsGeopairing(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
, m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_testId(0)
{}
, m_testId(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsGeopairing::~CesTestsGeopairing()
{}
@@ -45,7 +44,7 @@ CesTestsGeopairing::~CesTestsGeopairing()
bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -80,7 +79,7 @@ bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId)
void CesTestsGeopairing::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
switch (m_testId)
{
case 1:
@@ -92,7 +91,7 @@ void CesTestsGeopairing::startTest()
}
case 2:
{
INFO_LOG() << "Geopairing IGLA";
INFO_LOG(m_logger) << "Geopairing IGLA";
QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData);
QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition);
QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition);
@@ -102,7 +101,7 @@ void CesTestsGeopairing::startTest()
}
case 3:
{
INFO_LOG() << "Geopairing IGLA Damage States";
INFO_LOG(m_logger) << "Geopairing IGLA Damage States";
QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData);
QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition);
QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition);
@@ -112,7 +111,7 @@ void CesTestsGeopairing::startTest()
}
case 4: // MK 19
{
INFO_LOG() << "Geopairing MK 19";
INFO_LOG(m_logger) << "Geopairing MK 19";
QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData);
QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition);
QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition);
@@ -122,7 +121,7 @@ void CesTestsGeopairing::startTest()
}
default:
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
}
@@ -141,10 +140,10 @@ void CesTestsGeopairing::tryCreateMeteoData()
md.windDirection(0.0);
md.temperature(20.0);
md.pressure(1013);
DEBUG_LOG() << "Publishing MeteoData";
DEBUG_LOG(m_logger) << "Publishing MeteoData";
if (!m_mdmDts->publish(md))
{
ERROR_LOG() << "Error requesting create MeteoData";
ERROR_LOG(m_logger) << "Error requesting create MeteoData";
failExit();
}
}
@@ -166,10 +165,10 @@ void CesTestsGeopairing::tryCreateSoldierPosition()
pp.roomId(0);
pp.sampleTime(posTime);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -191,10 +190,10 @@ void CesTestsGeopairing::tryCreateAircraftPosition()
pp.roomId(0);
pp.sampleTime(posTime);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -255,10 +254,10 @@ void CesTestsGeopairing::tryCreateGeopairingData()
const Core::GeoPosition pos(Core::GeoPosition(posF.x(), posF.y(), 0));
gd.position(pos);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -343,10 +342,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLA()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -389,10 +388,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -401,12 +400,12 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19()
void CesTestsGeopairing::checkGeopairing()
{
INFO_LOG() << "checkMessageOnDds";
INFO_LOG(m_logger) << "checkMessageOnDds";
m_aesDtc->waitForHistoricalDataExplosionSingle();
QMap < int ,AreaEffectSimulation::ExplosionSingle> explosionSingles = m_aesDtc->explosionSingles();
INFO_LOG() << "explosionSingles.size()" << explosionSingles.size();
INFO_LOG(m_logger) << "explosionSingles.size()" << explosionSingles.size();
AreaEffectSimulation::ExplosionSingle explosionSingle = explosionSingles.last();
DEBUG_LOG() << "explosionSingle.lat=" << explosionSingle.impactPosition().lat()
DEBUG_LOG(m_logger) << "explosionSingle.lat=" << explosionSingle.impactPosition().lat()
<< " lon=" << explosionSingle.impactPosition().lon();
switch (m_testId)
@@ -428,14 +427,14 @@ void CesTestsGeopairing::checkGeopairing()
void CesTestsGeopairing::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, &QCoreApplication::quit);
}
void CesTestsGeopairing::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(50, qApp, &QCoreApplication::quit);
}
@@ -52,6 +52,8 @@ protected Q_SLOTS:
private: // methods
NGL::INGLLogger &m_logger;
void checkParicipantEvent();
private:
@@ -32,12 +32,11 @@
namespace CentralEffectSimulation
{
CesTestsGeopairing::CesTestsGeopairing(QObject *parent)
: QObject(parent)
CesTestsGeopairing::CesTestsGeopairing(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
, m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_testId(0)
{}
, m_testId(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsGeopairing::~CesTestsGeopairing()
{}
@@ -45,7 +44,7 @@ CesTestsGeopairing::~CesTestsGeopairing()
bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -80,7 +79,7 @@ bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId)
void CesTestsGeopairing::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
switch (m_testId)
{
case 1: // Geopairing Mortar
@@ -91,7 +90,7 @@ void CesTestsGeopairing::startTest()
}
case 2: // IGLA Target Detection
{
INFO_LOG() << "Geopairing IGLA";
INFO_LOG(m_logger) << "Geopairing IGLA";
//QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition);
QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataIGLA);
QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing);
@@ -99,7 +98,7 @@ void CesTestsGeopairing::startTest()
}
case 3: // IGLA Target Fire
{
INFO_LOG() << "Geopairing IGLA Target Fire";
INFO_LOG(m_logger) << "Geopairing IGLA Target Fire";
QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition);
QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataIGLATarget);
QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing);
@@ -107,14 +106,14 @@ void CesTestsGeopairing::startTest()
}
case 4: // MK 19
{
INFO_LOG() << "Geopairing MK 19";
INFO_LOG(m_logger) << "Geopairing MK 19";
QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataMK19);
QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing);
break;
}
default:
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
}
@@ -139,10 +138,10 @@ void CesTestsGeopairing::tryCreateSoldierPosition()
pp.roomId(0);
pp.sampleTime(posTime);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -164,10 +163,10 @@ void CesTestsGeopairing::tryCreateAircraftPosition()
pp.roomId(0);
pp.sampleTime(posTime);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -211,10 +210,10 @@ void CesTestsGeopairing::tryCreateGeopairingData()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -258,10 +257,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLA()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -304,10 +303,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLATarget()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -350,10 +349,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19()
gd.position().lon(lon);
gd.position().lat(lat);
DEBUG_LOG() << "Publishing GeopairingData";
DEBUG_LOG(m_logger) << "Publishing GeopairingData";
if (!m_tabDts->publish(gd))
{
ERROR_LOG() << "Error requesting create GeopairingData";
ERROR_LOG(m_logger) << "Error requesting create GeopairingData";
failExit();
}
@@ -362,7 +361,7 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19()
void CesTestsGeopairing::checkGeopairing()
{
INFO_LOG() << "checkMessageOnDds";
INFO_LOG(m_logger) << "checkMessageOnDds";
switch (m_testId)
{
@@ -370,9 +369,9 @@ void CesTestsGeopairing::checkGeopairing()
{
m_aesDtc->waitForHistoricalDataExplosionSingle();
QMap < int ,AreaEffectSimulation::ExplosionSingle> explosionSingles = m_aesDtc->explosionSingles();
INFO_LOG() << "explosionSingles.size()" << explosionSingles.size();
INFO_LOG(m_logger) << "explosionSingles.size()" << explosionSingles.size();
AreaEffectSimulation::ExplosionSingle explosionSingle = explosionSingles.last();
DEBUG_LOG() << "explosionSingle.lat=" << explosionSingle.impactPosition().lat()
DEBUG_LOG(m_logger) << "explosionSingle.lat=" << explosionSingle.impactPosition().lat()
<< " lon=" << explosionSingle.impactPosition().lon();
if ( (explosionSingle.impactPosition().lat() > 0.9 && explosionSingle.impactPosition().lat() < 1.0)
&& (explosionSingle.impactPosition().lon() > 0.1 && explosionSingle.impactPosition().lon() < 0.2))
@@ -391,14 +390,14 @@ void CesTestsGeopairing::checkGeopairing()
void CesTestsGeopairing::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, &QCoreApplication::quit);
}
void CesTestsGeopairing::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(50, qApp, &QCoreApplication::quit);
}
@@ -52,6 +52,8 @@ protected Q_SLOTS:
private: // methods
NGL::INGLLogger &m_logger;
void checkParicipantEvent();
private:
@@ -68,8 +68,7 @@
namespace CentralEffectSimulation
{
CesTestsMineAreas::CesTestsMineAreas(QObject *parent)
: QObject(parent)
CesTestsMineAreas::CesTestsMineAreas(QObject *parent) : QObject(parent)
, m_bTestsSuccessful(true)
, m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000")))
, m_testId(0)
@@ -79,8 +78,8 @@ CesTestsMineAreas::CesTestsMineAreas(QObject *parent)
, m_DynamicParticipantIndex(0)
, m_aesItemId(5)
, m_chargeTypeId(374) // SMART
, m_countEventMineAreas(0)
{}
, m_countEventMineAreas(0),
m_logger(NGL::NGLLoggerBootstrap::getLogger()) {}
CesTestsMineAreas::~CesTestsMineAreas()
{}
@@ -90,7 +89,7 @@ bool CesTestsMineAreas::init(int domainId, int exerciseId, int testId)
bool bRet = true;
int equipmentTypeIdVehicle = 35;
int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -176,7 +175,7 @@ bool CesTestsMineAreas::init(int domainId, int exerciseId, int testId)
void CesTestsMineAreas::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 SMART
{
m_explosionSingle = m_refPos.geographic(5, 5);
@@ -201,7 +200,7 @@ void CesTestsMineAreas::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(8000, this, &CesTestsMineAreas::failExit);
@@ -223,10 +222,10 @@ void CesTestsMineAreas::tryCreateDynamicParticipantData()
dp.sampleTime(esTime);
m_DynamicParticipantIndex++;
DEBUG_LOG() << "Publishing DynamicParticipantData";
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
if (!m_ppmDts->publish(dp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -250,10 +249,10 @@ void CesTestsMineAreas::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -267,10 +266,10 @@ void CesTestsMineAreas::tryCreateParticipant()
pt.id(m_id);
pt.equipmentNumber(m_equipmentNumber);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
m_id++;
@@ -279,7 +278,7 @@ void CesTestsMineAreas::tryCreateParticipant()
void CesTestsMineAreas::checkParticipantEvent()
{
INFO_LOG() << "checkParicipantEvent";
INFO_LOG(m_logger) << "checkParicipantEvent";
m_cesDtc->waitForHistoricalDataParticipantEvent();
switch (m_testId)
@@ -312,10 +311,10 @@ void CesTestsMineAreas::tryCreateTypeVehicle()
ty.name("HMMWV Utility");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -333,10 +332,10 @@ void CesTestsMineAreas::tryCreateTypeSoldier()
ty.name("Soldier");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -347,7 +346,7 @@ static void setPos(std::vector<Core::GeoPosition> &cont, const QPointF &pos)
void CesTestsMineAreas::tryCreateAesItemViewMineArea()
{
INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions";
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions";
AreaEffectSimulation::AesItemView iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -370,30 +369,30 @@ void CesTestsMineAreas::tryCreateAesItemViewMineArea()
setPos(iv.form(), m_refPos.geographic( 10, 30));
setPos(iv.form(), m_refPos.geographic( 10, -10));
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions";
ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions";
failExit();
}
}
void CesTestsMineAreas::tryCreateChargeType()
{
DEBUG_LOG() << "Publishing ChargeType";
DEBUG_LOG(m_logger) << "Publishing ChargeType";
ProjectDataManagement::ChargeType ct;
ct.id(m_chargeTypeId);
ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}");
if (!m_pdmDts->publish(ct))
{
ERROR_LOG() << "Error publish ChargeType";
ERROR_LOG(m_logger) << "Error publish ChargeType";
failExit();
}
}
void CesTestsMineAreas::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType)
{
DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId()
DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId()
<< " eventType=" << eventData.eventTypeId();
if (modType == DataModification::eRemoved ||
modType == DataModification::eModified)
@@ -401,7 +400,7 @@ void CesTestsMineAreas::onEventChanged(const CentralEffectSimulation::Participan
if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitGasPipe)
{
m_countEventMineAreas ++;
DEBUG_LOG() << "m_countEventMineAreas=" << m_countEventMineAreas;
DEBUG_LOG(m_logger) << "m_countEventMineAreas=" << m_countEventMineAreas;
}
}
@@ -415,14 +414,14 @@ Core::FunctionReplyObject CesTestsMineAreas::fillFro(int participantId, bool bSu
void CesTestsMineAreas::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void CesTestsMineAreas::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(200, qApp, &QCoreApplication::quit);
}
@@ -57,6 +57,7 @@ protected Q_SLOTS:
protected:
NGL::INGLLogger &m_logger;
private: // methods
void checkParticipantEvent();
@@ -48,7 +48,7 @@ CesTestsOwnership::~CesTestsOwnership()
bool CesTestsOwnership::init(int domainId, int exerciseId, int testId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_buildingId = 7; // ism_main_structure_element:id
@@ -111,7 +111,7 @@ bool CesTestsOwnership::init(int domainId, int exerciseId, int testId)
void CesTestsOwnership::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 Participant in BT56
{
QTimer::singleShot(0, this, &CesTestsOwnership::tryCreateParticipantPosition);
@@ -168,7 +168,7 @@ void CesTestsOwnership::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(6000, this, &CesTestsOwnership::failExit);
@@ -190,10 +190,10 @@ void CesTestsOwnership::tryCreateDynamicParticipantData()
dp.sampleTime(esTime);
m_DynamicParticipantIndex++;
DEBUG_LOG() << "Publishing DynamicParticipantData";
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
if (!m_ppmDts->publish(dp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -216,10 +216,10 @@ void CesTestsOwnership::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -233,10 +233,10 @@ void CesTestsOwnership::tryCreateParticipant()
pt.id(m_participants[m_participantIndex].participantId);
pt.equipmentNumber(m_participants[m_participantIndex].equipmentNumber);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
}
@@ -245,32 +245,32 @@ void CesTestsOwnership::trySetOwnershipRequest()
{
int32_t partyId = 0;
DEBUG_LOG() << " request.buildingId() = " << m_buildingId
DEBUG_LOG(m_logger) << " request.buildingId() = " << m_buildingId
<< " request.partyId() = " << m_buildingId;
if (!m_cesFtc->setOwnershipRequest(SetOwnershipRequest(m_buildingId, partyId), this))
{
ERROR_LOG() << "Error requesting create data";
ERROR_LOG(m_logger) << "Error requesting create data";
failExit();
}
}
void CesTestsOwnership::onSetOwnershipReply(const Core::FunctionReplyObject &replyObject)
{
INFO_LOG() << "onSetOwnershipReply() replyObject.id=" << replyObject.id();
INFO_LOG(m_logger) << "onSetOwnershipReply() replyObject.id=" << replyObject.id();
}
void CesTestsOwnership::checkBuildingOwnership()
{
INFO_LOG() << "checkBuildingOwnership";
INFO_LOG(m_logger) << "checkBuildingOwnership";
/*
m_cesDtc->waitForHistoricalDataBuildingOwnership();
QMap < int ,CentralEffectSimulation::BuildingOwnership> buildingOwnership = m_cesDtc->buildingOwnerships();
INFO_LOG() << "Recived ParicipantEvent BuildingOwnership:"<<buildingOwnership.buildingId();
INFO_LOG(m_logger) << "Recived ParicipantEvent BuildingOwnership:"<<buildingOwnership.buildingId();
for (unsigned int i = 0; i < buildingOwnership.ownerships().size(); i++)
{
CentralEffectSimulation::Ownership ownership = buildingOwnership.ownerships().at(i);
INFO_LOG() << "ownership["<<i<<"].floorId="<< ownership.floorId()
INFO_LOG(m_logger) << "ownership["<<i<<"].floorId="<< ownership.floorId()
<< " ownership["<<i<<"].partyId="<< ownership.partyId();
}
switch (m_testId)
@@ -338,14 +338,14 @@ void CesTestsOwnership::checkBuildingOwnership()
void CesTestsOwnership::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void CesTestsOwnership::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
@@ -49,6 +49,7 @@ protected Q_SLOTS:
void ExitSuccess();
protected:
NGL::INGLLogger &m_logger;
void onSetOwnershipReply(const Core::FunctionReplyObject &replyObject) override final;
private: // methods
@@ -46,7 +46,7 @@ cesTestsSimulatedMovement::~cesTestsSimulatedMovement()
bool cesTestsSimulatedMovement::init(int domainId, int exerciseId, int testId)
{
bool bRet = true;
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
@@ -65,7 +65,7 @@ bool cesTestsSimulatedMovement::init(int domainId, int exerciseId, int testId)
void cesTestsSimulatedMovement::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 SMART
{
QTimer::singleShot(0, this, &cesTestsSimulatedMovement::tryCreateParticipant);
@@ -87,7 +87,7 @@ void cesTestsSimulatedMovement::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(8000, this, &cesTestsSimulatedMovement::failExit);
@@ -96,13 +96,13 @@ void cesTestsSimulatedMovement::startTest()
void cesTestsSimulatedMovement::checkParticipantEvent()
{
INFO_LOG() << "checkParticipantEvent";
INFO_LOG(m_logger) << "checkParticipantEvent";
m_cesDtc->waitForHistoricalDataParticipantEvent();
CentralEffectSimulation::ParticipantEvent participantEvent0 = m_cesDtc->participantEvent(0);
CentralEffectSimulation::ParticipantEvent participantEvent1 = m_cesDtc->participantEvent(1);
INFO_LOG() << "Recived ParicipantEvent equipmentNumber:" << participantEvent0.equipmentNumber()
INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:" << participantEvent0.equipmentNumber()
<< " eventType=" << participantEvent0.eventTypeId();
INFO_LOG() << "Recived ParicipantEvent equipmentNumber:" << participantEvent1.equipmentNumber()
INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:" << participantEvent1.equipmentNumber()
<< " eventType=" << participantEvent1.eventTypeId();
switch (m_testId)
@@ -182,7 +182,7 @@ void cesTestsSimulatedMovement::trySimulatedMovementModifyRequest()
if (!m_cesFtc->simulatedMovementModifyRequest(req, this))
{
ERROR_LOG() << "Error requesting create data";
ERROR_LOG(m_logger) << "Error requesting create data";
failExit();
}
@@ -195,7 +195,7 @@ void cesTestsSimulatedMovement::trySimulatedMovementRemoveRequest()
if (!m_cesFtc->simulatedMovementRemoveRequest(SimulatedMovementRemoveRequest(id), this))
{
ERROR_LOG() << "Error requesting remove data";
ERROR_LOG(m_logger) << "Error requesting remove data";
failExit();
}
QTest::qWait(2000);
@@ -210,10 +210,10 @@ void cesTestsSimulatedMovement::tryCreateParticipant()
pt.id(m_participantId);
pt.partyId(5);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
QTest::qWait(2000);
@@ -222,25 +222,25 @@ void cesTestsSimulatedMovement::tryCreateParticipant()
void cesTestsSimulatedMovement::onSimulatedMovementModifyReply(const Core::FunctionReplyObject &replyObject)
{
Q_UNUSED(replyObject);
INFO_LOG() << "onSimulatedMovementModifyReply()";
INFO_LOG(m_logger) << "onSimulatedMovementModifyReply()";
}
void cesTestsSimulatedMovement::onSimulatedMovementRemoveReply(const Core::FunctionReplyObject &replyObject)
{
Q_UNUSED(replyObject);
INFO_LOG() << "onSimulatedMovementRemoveReply()";
INFO_LOG(m_logger) << "onSimulatedMovementRemoveReply()";
}
void cesTestsSimulatedMovement::failExit()
{
ERROR_LOG() << "FailExit";
ERROR_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void cesTestsSimulatedMovement::ExitSuccess()
{
INFO_LOG() << "ExitSuccess";
INFO_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(200, qApp, &QCoreApplication::quit);
}
@@ -50,6 +50,7 @@ protected Q_SLOTS:
protected:
NGL::INGLLogger &m_logger;
private: // methods
void checkParticipantEvent();
@@ -53,7 +53,7 @@ bool CesTestsSmart::init(int domainId, int exerciseId, int testId)
bool bRet = true;
int equipmentTypeIdVehicle = 35;
int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type
INFO_LOG() << "init begin";
INFO_LOG(m_logger) << "init begin";
m_testId = testId;
m_buildingId = 0; // ism_main_structure_element:id
@@ -141,7 +141,7 @@ bool CesTestsSmart::init(int domainId, int exerciseId, int testId)
void CesTestsSmart::startTest()
{
INFO_LOG() << "startTest m_testId=" << m_testId;
INFO_LOG(m_logger) << "startTest m_testId=" << m_testId;
if (m_testId <= 1) // 1 SMART
{
m_explosionSingle = m_housePos.geographic(5, 5);
@@ -163,7 +163,7 @@ void CesTestsSmart::startTest()
}
else
{
ERROR_LOG() << "Unknown test id = " << m_testId;
ERROR_LOG(m_logger) << "Unknown test id = " << m_testId;
failExit();
}
QTimer::singleShot(8000, this, &CesTestsSmart::failExit);
@@ -185,10 +185,10 @@ void CesTestsSmart::tryCreateDynamicParticipantData()
dp.sampleTime(esTime);
m_DynamicParticipantIndex++;
DEBUG_LOG() << "Publishing DynamicParticipantData";
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
if (!m_ppmDts->publish(dp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -212,10 +212,10 @@ void CesTestsSmart::tryCreateParticipantPosition()
pp.sampleTime(posTime);
pp.pos(pos);
DEBUG_LOG() << "Publishing ParticipantPosition";
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
if (!m_ppmDts->publish(pp))
{
ERROR_LOG() << "Error requesting create ParticipantPosition";
ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition";
failExit();
}
}
@@ -229,17 +229,17 @@ void CesTestsSmart::tryCreateParticipant()
pt.id(21);
pt.equipmentNumber(61);
DEBUG_LOG() << "Publishing Participant";
DEBUG_LOG(m_logger) << "Publishing Participant";
if (!m_ppmDts->publish(pt))
{
ERROR_LOG() << "Error requesting create Participant";
ERROR_LOG(m_logger) << "Error requesting create Participant";
failExit();
}
}
void CesTestsSmart::checkParticipantEvent()
{
INFO_LOG() << "checkParicipantEvent m_cesDtc->participantEvents().size() =" << m_cesDtc->participantEvents().size();
INFO_LOG(m_logger) << "checkParicipantEvent m_cesDtc->participantEvents().size() =" << m_cesDtc->participantEvents().size();
m_cesDtc->waitForHistoricalDataParticipantEvent();
CentralEffectSimulation::ParticipantEvent participantEvent0 = m_cesDtc->participantEvent(0);
CentralEffectSimulation::ParticipantEvent participantEvent1 = m_cesDtc->participantEvent(1);
@@ -247,7 +247,7 @@ void CesTestsSmart::checkParticipantEvent()
for ( int i = 0; i < m_cesDtc->participantEvents().size(); i++)
{
CentralEffectSimulation::ParticipantEvent participantEvent = m_cesDtc->participantEvent(i);
INFO_LOG() << "Recived ParicipantEvent equipmentNumber:"<<participantEvent.equipmentNumber()
INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:"<<participantEvent.equipmentNumber()
<< " eventType="<<participantEvent.eventTypeId();
}
@@ -262,7 +262,7 @@ void CesTestsSmart::checkParticipantEvent()
break;
default:
// nothing
ERROR_LOG() << "Error checkParticipantEvent";
ERROR_LOG(m_logger) << "Error checkParticipantEvent";
failExit();
break;
}
@@ -283,10 +283,10 @@ void CesTestsSmart::tryCreateTypeVehicle()
ty.name("HMMWV Utility");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -304,10 +304,10 @@ void CesTestsSmart::tryCreateTypeSoldier()
ty.name("Soldier");
DEBUG_LOG() << "Publishing Type";
DEBUG_LOG(m_logger) << "Publishing Type";
if (!m_ppmDts->publish(ty))
{
ERROR_LOG() << "Error requesting create Type";
ERROR_LOG(m_logger) << "Error requesting create Type";
failExit();
}
}
@@ -318,7 +318,7 @@ static void setPos(std::vector<Core::GeoPosition> &cont, const QPointF &pos)
void CesTestsSmart::tryCreateAesItemViewSingleExplosion()
{
INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions";
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions";
AreaEffectSimulation::AesItemView iv;
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
@@ -343,30 +343,30 @@ void CesTestsSmart::tryCreateAesItemViewSingleExplosion()
setPos(iv.form(), m_housePos.geographic(-10, 20));
setPos(iv.form(), m_housePos.geographic(-10, 30));
DEBUG_LOG() << "Publishing AesItemView";
DEBUG_LOG(m_logger) << "Publishing AesItemView";
if (!m_aesDts->publish(iv))
{
ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions";
ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions";
failExit();
}
}
void CesTestsSmart::tryCreateChargeType()
{
DEBUG_LOG() << "Publishing ChargeType";
DEBUG_LOG(m_logger) << "Publishing ChargeType";
ProjectDataManagement::ChargeType ct;
ct.id(m_chargeTypeId);
ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}");
if (!m_pdmDts->publish(ct))
{
ERROR_LOG() << "Error publish ChargeType";
ERROR_LOG(m_logger) << "Error publish ChargeType";
failExit();
}
}
void CesTestsSmart::tryCreatePrepareExplosionSingle()
{
INFO_LOG() << "trying to send ExplosionSingle";
INFO_LOG(m_logger) << "trying to send ExplosionSingle";
AreaEffectSimulation::ExplosionSingle es;
const qint64 time = QDateTime::currentMSecsSinceEpoch();
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
@@ -382,17 +382,17 @@ void CesTestsSmart::tryCreatePrepareExplosionSingle()
es.isCentral(true);
es.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000);
DEBUG_LOG() << "Publishing ExplosionSingle";
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle";
if (!m_aesDts->publish(es))
{
ERROR_LOG() << "Error publish ExplosionArea";
ERROR_LOG(m_logger) << "Error publish ExplosionArea";
failExit();
}
}
void CesTestsSmart::tryCreateExplosionSingle()
{
INFO_LOG() << "trying to send ExplosionSingle";
INFO_LOG(m_logger) << "trying to send ExplosionSingle";
AreaEffectSimulation::ExplosionSingle es;
const qint64 time = QDateTime::currentMSecsSinceEpoch();
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
@@ -410,10 +410,10 @@ void CesTestsSmart::tryCreateExplosionSingle()
es.sampleTime(esTime);
es.chargeStruct().chargeTypeId(m_chargeTypeId);
DEBUG_LOG() << "Publishing ExplosionSingle";
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle";
if (!m_aesDts->publish(es))
{
ERROR_LOG() << "Error publish ExplosionArea";
ERROR_LOG(m_logger) << "Error publish ExplosionArea";
failExit();
}
}
@@ -433,7 +433,7 @@ void CesTestsSmart::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
QDateTime dateTime;
dateTime.setMSecsSinceEpoch(msecs);
DEBUG_LOG() << "onSendCesHitRequest" << "\n"
DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n"
<< " request.aesId() = " << request.aesId() << "\n"
<< " request.chargeTypeId() = " << request.chargeTypeId() << "\n"
<< " request.equipmentNumber() = " << request.equipmentNumber() << "\n"
@@ -448,14 +448,14 @@ void CesTestsSmart::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
void CesTestsSmart::failExit()
{
DEBUG_LOG() << "FailExit";
DEBUG_LOG(m_logger) << "FailExit";
m_bTestsSuccessful = false;
QTimer::singleShot(50, qApp, QCoreApplication::quit);
}
void CesTestsSmart::ExitSuccess()
{
DEBUG_LOG() << "ExitSuccess";
DEBUG_LOG(m_logger) << "ExitSuccess";
m_bTestsSuccessful = true;
QTimer::singleShot(200, qApp, &QCoreApplication::quit);
}
@@ -59,6 +59,7 @@ protected Q_SLOTS:
protected:
NGL::INGLLogger &m_logger;
private: // methods
void checkParticipantEvent();