Migrates CentralEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across ces service.
This commit is contained in:
24 files changed
+752
-752
No files matched your search
+73
-73
@@ -179,11 +179,11 @@ void CesTestsSmart::tryCreateDynamicParticipantData()
|
||||
const qint64 time = QDateTime::currentMSecsSinceEpoch();
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
ParticipantManagement::StateInformation si;
|
||||
si.stateTime(esTime);
|
||||
si.vulnerabilityState(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill);
|
||||
dp.participantId(m_participants[m_DynamicParticipantIndex].participantId);
|
||||
dp.stateHistory().push_back(si);
|
||||
dp.sampleTime(esTime);
|
||||
si.stateTime = esTime;
|
||||
si.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill;
|
||||
dp.participantId = m_participants[m_DynamicParticipantIndex].participantId;
|
||||
dp.stateHistory.push_back(si);
|
||||
dp.sampleTime = esTime;
|
||||
m_DynamicParticipantIndex++;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData";
|
||||
@@ -204,14 +204,14 @@ void CesTestsSmart::tryCreateParticipantPosition()
|
||||
QPointF posF = m_housePos.geographic(m_participants[m_participantIndex].relX,
|
||||
m_participants[m_participantIndex].relY);
|
||||
const Core::GeoPosition pos(Core::GeoPosition(posF.x(), posF.y(), 0));
|
||||
pp.buildingId(m_participants[m_participantIndex].buildingId);
|
||||
pp.participantId(m_participants[m_participantIndex].participantId);
|
||||
pp.participantTypeId(m_participants[m_participantIndex].participantTypeId);
|
||||
pp.partyId(m_participants[m_participantIndex].partyId);
|
||||
pp.roomId(m_participants[m_participantIndex].roomId);
|
||||
pp.buildingId = m_participants[m_participantIndex].buildingId;
|
||||
pp.participantId = m_participants[m_participantIndex].participantId;
|
||||
pp.participantTypeId = m_participants[m_participantIndex].participantTypeId;
|
||||
pp.partyId = m_participants[m_participantIndex].partyId;
|
||||
pp.roomId = m_participants[m_participantIndex].roomId;
|
||||
m_participantIndex++;
|
||||
pp.sampleTime(posTime);
|
||||
pp.pos(pos);
|
||||
pp.sampleTime = posTime;
|
||||
pp.pos = pos;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing ParticipantPosition";
|
||||
if (!m_ppmDts->publish(pp))
|
||||
@@ -227,8 +227,8 @@ void CesTestsSmart::tryCreateParticipantPosition()
|
||||
void CesTestsSmart::tryCreateParticipant()
|
||||
{
|
||||
ParticipantManagement::Participant pt;
|
||||
pt.id(21);
|
||||
pt.equipmentNumber(61);
|
||||
pt.id = 21;
|
||||
pt.equipmentNumber = 61;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing Participant";
|
||||
if (!m_ppmDts->publish(pt))
|
||||
@@ -248,15 +248,15 @@ void CesTestsSmart::checkParticipantEvent()
|
||||
for ( int i = 0; i < m_cesDtc->participantEvents().size(); i++)
|
||||
{
|
||||
CentralEffectSimulation::ParticipantEvent participantEvent = m_cesDtc->participantEvent(i);
|
||||
INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:"<<participantEvent.equipmentNumber()
|
||||
<< " eventType="<<participantEvent.eventTypeId();
|
||||
INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:"<<participantEvent.equipmentNumber
|
||||
<< " eventType="<<participantEvent.eventTypeId;
|
||||
}
|
||||
|
||||
switch (m_testId)
|
||||
{
|
||||
case 1:
|
||||
if ( participantEvent0.eventTypeId()==ProjectDataManagement::PdmEventType::HitEffectSimulation
|
||||
&& participantEvent1.eventTypeId()==ProjectDataManagement::PdmEventType::HitEffectSimulation)
|
||||
if ( participantEvent0.eventTypeId==ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation
|
||||
&& participantEvent1.eventTypeId==ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation)
|
||||
{
|
||||
ExitSuccess();
|
||||
}
|
||||
@@ -277,11 +277,11 @@ void CesTestsSmart::checkParticipantEvent()
|
||||
void CesTestsSmart::tryCreateTypeVehicle()
|
||||
{
|
||||
ParticipantManagement::Type ty;
|
||||
ty.id(35);
|
||||
ty.typeClass(ParticipantManagement::TypeClass::inner_enum::GroundVehicle);
|
||||
ty.equipmentTypeId(35);
|
||||
ty.symbol("1001");
|
||||
ty.name("HMMWV Utility");
|
||||
ty.id = 35;
|
||||
ty.typeClass = ParticipantManagement::TypeClass::GroundVehicle;
|
||||
ty.equipmentTypeId = 35;
|
||||
ty.symbol = "1001";
|
||||
ty.name = "HMMWV Utility";
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing Type";
|
||||
@@ -298,11 +298,11 @@ void CesTestsSmart::tryCreateTypeVehicle()
|
||||
void CesTestsSmart::tryCreateTypeSoldier()
|
||||
{
|
||||
ParticipantManagement::Type ty;
|
||||
ty.id(11);
|
||||
ty.typeClass(ParticipantManagement::TypeClass::inner_enum::Human);
|
||||
ty.equipmentTypeId(30);
|
||||
ty.symbol("1001");
|
||||
ty.name("Soldier");
|
||||
ty.id = 11;
|
||||
ty.typeClass = ParticipantManagement::TypeClass::Human;
|
||||
ty.equipmentTypeId = 30;
|
||||
ty.symbol = "1001";
|
||||
ty.name = "Soldier";
|
||||
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing Type";
|
||||
@@ -322,27 +322,27 @@ void CesTestsSmart::tryCreateAesItemViewSingleExplosion()
|
||||
INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions";
|
||||
|
||||
AreaEffectSimulation::AesItemView iv;
|
||||
iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
|
||||
iv.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
|
||||
|
||||
iv.aesItemId(m_aesItemId);
|
||||
iv.id(m_aesItemId);
|
||||
iv.aesTypeId(AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions);
|
||||
iv.partyId(5);
|
||||
iv.aesItemId = m_aesItemId;
|
||||
iv.id = m_aesItemId;
|
||||
iv.aesTypeId = AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions;
|
||||
iv.partyId = 5;
|
||||
QPointF bl = m_housePos.geographic(-10, -10);
|
||||
QPointF tr = m_housePos.geographic(30, 30);
|
||||
iv.boundingBoxBottomLeft(Core::GeoPosition2D(bl.x(), bl.y()));
|
||||
iv.boundingBoxTopRight(Core::GeoPosition2D(tr.x(), tr.y()));
|
||||
iv.chargeStruct().chargeTypeId(m_chargeTypeId);
|
||||
iv.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
iv.boundingBoxBottomLeft = Core::GeoPosition2D(bl.x(), bl.y());
|
||||
iv.boundingBoxTopRight = Core::GeoPosition2D(tr.x(), tr.y());
|
||||
iv.chargeStruct.chargeTypeId = m_chargeTypeId;
|
||||
iv.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
|
||||
iv.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000);
|
||||
iv.effectStart = QDateTime::currentMSecsSinceEpoch() + 2000;
|
||||
|
||||
setPos(iv.form(), m_housePos.geographic(-10, -10));
|
||||
setPos(iv.form(), m_housePos.geographic(0, 0));
|
||||
setPos(iv.form(), m_housePos.geographic(5, 5));
|
||||
setPos(iv.form(), m_housePos.geographic(-10, 10));
|
||||
setPos(iv.form(), m_housePos.geographic(-10, 20));
|
||||
setPos(iv.form(), m_housePos.geographic(-10, 30));
|
||||
setPos(iv.form, m_housePos.geographic(-10, -10));
|
||||
setPos(iv.form, m_housePos.geographic(0, 0));
|
||||
setPos(iv.form, m_housePos.geographic(5, 5));
|
||||
setPos(iv.form, m_housePos.geographic(-10, 10));
|
||||
setPos(iv.form, m_housePos.geographic(-10, 20));
|
||||
setPos(iv.form, m_housePos.geographic(-10, 30));
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing AesItemView";
|
||||
if (!m_aesDts->publish(iv))
|
||||
@@ -356,8 +356,8 @@ void CesTestsSmart::tryCreateChargeType()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "Publishing ChargeType";
|
||||
ProjectDataManagement::ChargeType ct;
|
||||
ct.id(m_chargeTypeId);
|
||||
ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}");
|
||||
ct.id = m_chargeTypeId;
|
||||
ct.properties = "{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}";
|
||||
if (!m_pdmDts->publish(ct))
|
||||
{
|
||||
ERROR_LOG(m_logger) << "Error publish ChargeType";
|
||||
@@ -372,16 +372,16 @@ void CesTestsSmart::tryCreatePrepareExplosionSingle()
|
||||
const qint64 time = QDateTime::currentMSecsSinceEpoch();
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
|
||||
es.id(m_aesItemId);
|
||||
es.participantId(m_originatorParticipantId); // In ddsview <not set>
|
||||
es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsPrepared);
|
||||
es.name("Smart tryCreatePrepareExplosionSingle");
|
||||
es.id = m_aesItemId;
|
||||
es.participantId = m_originatorParticipantId; // In ddsview <not set>
|
||||
es.effectStateId = AreaEffectSimulation::AesEffectState::EsPrepared;
|
||||
es.name = "Smart tryCreatePrepareExplosionSingle";
|
||||
|
||||
es.impactPosition(Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y()));
|
||||
es.sampleTime(esTime);
|
||||
es.chargeStruct().chargeTypeId(m_chargeTypeId);
|
||||
es.isCentral(true);
|
||||
es.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000);
|
||||
es.impactPosition = Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y());
|
||||
es.sampleTime = esTime;
|
||||
es.chargeStruct.chargeTypeId = m_chargeTypeId;
|
||||
es.isCentral = true;
|
||||
es.effectStart = QDateTime::currentMSecsSinceEpoch() + 2000;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle";
|
||||
if (!m_aesDts->publish(es))
|
||||
@@ -398,18 +398,18 @@ void CesTestsSmart::tryCreateExplosionSingle()
|
||||
const qint64 time = QDateTime::currentMSecsSinceEpoch();
|
||||
const rti::core::int64 esTime = static_cast<rti::core::int64>(time);
|
||||
|
||||
es.id(m_aesItemId);
|
||||
es.name("Smart tryCreateExplosionSingle");
|
||||
es.id = m_aesItemId;
|
||||
es.name = "Smart tryCreateExplosionSingle";
|
||||
|
||||
es.participantId(m_originatorParticipantId); // In ddsview <not set>
|
||||
es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated);
|
||||
es.participantId = m_originatorParticipantId; // In ddsview <not set>
|
||||
es.effectStateId = AreaEffectSimulation::AesEffectState::EsActivated;
|
||||
|
||||
es.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000);
|
||||
es.isCentral(true);
|
||||
es.effectStart = QDateTime::currentMSecsSinceEpoch() + 2000;
|
||||
es.isCentral = true;
|
||||
|
||||
es.impactPosition(Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y()));
|
||||
es.sampleTime(esTime);
|
||||
es.chargeStruct().chargeTypeId(m_chargeTypeId);
|
||||
es.impactPosition = Core::GeoPosition2D(m_explosionSingle.x(), m_explosionSingle.y());
|
||||
es.sampleTime = esTime;
|
||||
es.chargeStruct.chargeTypeId = m_chargeTypeId;
|
||||
|
||||
DEBUG_LOG(m_logger) << "Publishing ExplosionSingle";
|
||||
if (!m_aesDts->publish(es))
|
||||
@@ -430,20 +430,20 @@ void CesTestsSmart::onSendCesHitRequest(const rti::core::SampleIdentity &cookie,
|
||||
const TrainingAreaBase::SendCesHitRequest &request)
|
||||
{
|
||||
// debug und co
|
||||
qint64 msecs = (qint64) request.effectTime();
|
||||
qint64 msecs = (qint64) request.effectTime;
|
||||
QDateTime dateTime;
|
||||
dateTime.setMSecsSinceEpoch(msecs);
|
||||
|
||||
DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n"
|
||||
<< " request.aesId() = " << request.aesId() << "\n"
|
||||
<< " request.chargeTypeId() = " << request.chargeTypeId() << "\n"
|
||||
<< " request.equipmentNumber() = " << request.equipmentNumber() << "\n"
|
||||
<< " request.originatorEquipmentNumber() = " << request.originatorEquipmentNumber() << "\n"
|
||||
<< " request.originatorPosition() = " << request.position() << "\n"
|
||||
<< " request.effectTime()= " << request.effectTime() << " "
|
||||
<< " request.aesId() = " << request.aesId << "\n"
|
||||
<< " request.chargeTypeId() = " << request.chargeTypeId << "\n"
|
||||
<< " request.equipmentNumber() = " << request.equipmentNumber << "\n"
|
||||
<< " request.originatorEquipmentNumber() = " << request.originatorEquipmentNumber << "\n"
|
||||
<< " request.originatorPosition() = " << request.position << "\n"
|
||||
<< " request.effectTime()= " << request.effectTime << " "
|
||||
<< dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n"
|
||||
<< " request.remainEffectPercent() = " << request.remainEffectPercent();
|
||||
m_tabFts->sendCesHitReply(cookie, Core::FunctionReplyObject(request.equipmentNumber()));
|
||||
<< " request.remainEffectPercent() = " << request.remainEffectPercent;
|
||||
m_tabFts->sendCesHitReply(cookie, Core::FunctionReplyObject(request.equipmentNumber));
|
||||
ExitSuccess();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user