Migrates residual Lts sources to generated rtiddsgen API

Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
This commit is contained in:
berrux-dev committed 2026-09-23 12:05:37 +02:00
1 parent 5485a90385
commit 881d44f4dd
512 files changed
+6887 -6426

No files matched your search

@@ -12,7 +12,7 @@ namespace BuildingControlUnit
XmlReader::XmlReader(QObject *parent)
: QObject(parent)
.getNGLLogger("XmlReader"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("XmlReader"))
{
}
@@ -188,7 +188,7 @@ Action *XmlReader::parseAction(QXmlStreamReader &xml)
if (xml.name() == QStringLiteral("bsm"))
return parseBsmAction(xml);
WARNING_LOG(m_logger) << "--- parseUnknownAction with name '" << xml.name().string() << "'cannot be handled.";
WARNING_LOG(m_logger) << "--- parseUnknownAction with name '" << xml.name().toString() << "'cannot be handled.";
return {};
}
@@ -40,6 +40,7 @@ if(QT6_GUI_AVAILABLE)
Qt6::Core
${Qt6_Gui}
LtsUtilsCoreHeaderOnly
LtsUtilsCore
BuildingControlCommon
)
endif()
@@ -26,6 +26,7 @@ BuildingControlHandler::BuildingControlHandler(MainHandler *mainHandler)
, Interface::Fts::TriggerBsmFlashRequestHandler(mainHandler->ddsHandler()->fts())
, Interface::Fts::SwitchRelayRequestHandler(mainHandler->ddsHandler()->fts())
, m_mainHandler(mainHandler)
, m_logger(getLogger("BuildingControlHandler"))
{}
BuildingControlHandler::~BuildingControlHandler()
@@ -66,12 +67,12 @@ bool BuildingControlHandler::init()
for (auto it = latestStates.begin(); it != latestStates.end(); ++it)
{
const Buildings::HistoryState &historyState = it.value();
if (!m_mainHandler->ismHandler()->isElementAssignedToExercise(historyState.mseId(),m_mainHandler->exerciseId() ))
if (!m_mainHandler->ismHandler()->isElementAssignedToExercise(historyState.mseId,m_mainHandler->exerciseId() ))
{
DEBUG_LOG(m_logger)<<"[INIT] [recordReplay]>>>>>>> mseId=" << historyState.mseId() << " not in execise";
DEBUG_LOG(m_logger)<<"[INIT] [recordReplay]>>>>>>> mseId=" << historyState.mseId << " not in execise";
continue;
}
m_historyStates.insert(historyState.mseId(), historyState);
m_historyStates.insert(historyState.mseId, historyState);
DEBUG_LOG(m_logger)<<"[INIT] [recordReplay]>>>>>>> "<<historyState;
}
}
@@ -118,17 +119,17 @@ void BuildingControlHandler::onBuildingChanged(const BuildingInfo &buildingInfo,
if ( m_historyStates.contains(buildingInfo.mseId))
{
historyState = m_historyStates.value(buildingInfo.mseId);
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState contains historyState.mseId=" << historyState.mseId()
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState contains historyState.mseId=" << historyState.mseId
<< " buildingInfo.mseId=" << buildingInfo.mseId;
}
else
{
historyState.mseId (buildingInfo.mseId);
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState insert historyState.mseId=" << historyState.mseId()
historyState.mseId = buildingInfo.mseId;
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState insert historyState.mseId=" << historyState.mseId
<< " buildingInfo.mseId=" << buildingInfo.mseId;
m_historyStates.insert(historyState.mseId(), historyState);
m_historyStates.insert(historyState.mseId, historyState);
}
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState historyState.mseId=" << historyState.mseId()
DEBUG_LOG(m_logger) << "onBuildingChanged setHistoryState historyState.mseId=" << historyState.mseId
<< " buildingInfo.mseId=" << buildingInfo.mseId;
bldg->setHistoryState(m_historyStates.value(buildingInfo.mseId));
}
@@ -196,13 +197,13 @@ void BuildingControlHandler::onTriggerBsmFlashRequest(const rti::core::SampleIde
Core::FunctionReplyObject BuildingControlHandler::onSetBuildingContaminationStateRequestInternal(const SetBuildingContaminationStateRequest &data)
{
const auto it = m_buildings.find(data.buildingId());
const auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
BuildingProcess *bldg = it.value();
if (!bldg->setContaminationState(data.buildingId(), data.contaminationState()))
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send contamination state to building control process."));
if (!bldg->setContaminationState(data.buildingId, data.contaminationState))
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not send contamination state to building control process."));
return Core::FunctionReplyObject();
}
@@ -210,45 +211,45 @@ Core::FunctionReplyObject BuildingControlHandler::onSetBuildingContaminationStat
Core::FunctionReplyObject BuildingControlHandler::onSetBuildingStatesRequestInternal(const SetBuildingStatesRequest &data)
{
std::vector<int> roomIds;
for (const auto &building : data.buildings())
for (const auto &building : data.buildings)
{
const auto it = m_buildings.find(building.buildingId());
const auto it = m_buildings.find(building.buildingId);
if (it == m_buildings.end())
return Core::FunctionReplyObject(building.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(building.buildingId());
return Core::FunctionReplyObject(building.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(building.buildingId);
BuildingProcess *bldg = it.value();
if (data.resetContamination().is_set())
if (data.resetContamination.is_set())
{
if (data.resetContamination().get() && !bldg->resetContaminationState())
return Core::FunctionReplyObject(building.buildingId(), tr_lts("dds", "reset contamination of building with id %1 failed.")).arg(building.buildingId());
if (data.resetContamination.get() && !bldg->resetContaminationState())
return Core::FunctionReplyObject(building.buildingId, tr_lts("dds", "reset contamination of building with id %1 failed.")).arg(building.buildingId);
}
if (data.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::NoChange)
if (data.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange)
continue;
if (data.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::CatastrophicKill &&
data.vulnerabilityState() != ProjectDataManagement::VulnerabilityState::CombatReady )
return Core::FunctionReplyObject(building.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(building.buildingId());
if (data.vulnerabilityState != ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill &&
data.vulnerabilityState != ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady )
return Core::FunctionReplyObject(building.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(building.buildingId);
if (building.roomIds().is_set())
roomIds = building.roomIds().get();
if (building.roomIds.is_set())
roomIds = building.roomIds.get();
if (!bldg->setVulnerabilityState(data.vulnerabilityState(), roomIds))
return Core::FunctionReplyObject(building.buildingId(), tr_lts("dds", "Can not send vulnerability state to building control process."));
if (!bldg->setVulnerabilityState(data.vulnerabilityState, roomIds))
return Core::FunctionReplyObject(building.buildingId, tr_lts("dds", "Can not send vulnerability state to building control process."));
}
return Core::FunctionReplyObject();
}
Core::FunctionReplyObject BuildingControlHandler::onSetFortifyFactorRequestInternal(const SetFortifyFactorRequest &data)
{
auto it = m_buildings.find(data.buildingId());
auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
BuildingProcess *bldg = it.value();
if (!bldg->setFortifyFactors(data.fortifyFactors()))
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send fortify factors to building control process."));
if (!bldg->setFortifyFactors(data.fortifyFactors))
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not send fortify factors to building control process."));
return Core::FunctionReplyObject();
}
@@ -271,9 +272,9 @@ void BuildingControlHandler::setEffectStates(const int buildingId, const int ass
void BuildingControlHandler::onRelayInfoChanged(const AssetManagement::RelayInfo &info, const DataModification mod)
{
if (mod != DataModification::eRemoved)
m_relayInfos.insert(info.id(), info);
m_relayInfos.insert(info.id, info);
else
m_relayInfos.remove(info.id());
m_relayInfos.remove(info.id);
for(auto *bldg : std::as_const(m_buildings))
bldg->newRelayInfos(m_relayInfos);
@@ -283,20 +284,20 @@ void BuildingControlHandler::onRelayInfoChanged(const AssetManagement::RelayInfo
Core::FunctionReplyObject BuildingControlHandler::onSendCesHitOnBuildingRequestInternal(const SendCesHitOnBuildingRequest &data)
{
DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal";
auto it = m_buildings.find(data.buildingId());
auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
{
DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal return";
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
}
BuildingProcess *bldg = it.value();
if (!bldg->sendCesHitOnBuilding(data.effectTime(), data.chargeTypeId(), data.destructiveFactor(), data.penetrationFactor(),
data.aesId(), data.impactPosition(),
QString::fromStdString(data.properties())))
if (!bldg->sendCesHitOnBuilding(data.effectTime, data.chargeTypeId, data.destructiveFactor, data.penetrationFactor,
data.aesId, data.impactPosition,
QString::fromStdString(data.properties)))
{
DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal return Can not send ces hit to building control process";
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send ces hit to building control process."));
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not send ces hit to building control process."));
}
DEBUG_LOG(m_logger) << "FunctionReplyObject";
return Core::FunctionReplyObject();
@@ -306,20 +307,20 @@ Core::FunctionReplyObject BuildingControlHandler::onSendCesHit3DonBuildingReques
{
DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal";
auto it = m_buildings.find(data.buildingId());
auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
{
DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal return";
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
}
BuildingProcess *bldg = it.value();
if (!bldg->sendCesHit3DonBuilding(data.effectTime(), data.chargeTypeId(), data.destructiveFactor(), data.penetrationFactor(),
data.aesId(), data.impactPosition(), data.detonationLocation(), data.detonationDistance(),
QString::fromStdString(data.properties())))
if (!bldg->sendCesHit3DonBuilding(data.effectTime, data.chargeTypeId, data.destructiveFactor, data.penetrationFactor,
data.aesId, data.impactPosition, data.detonationLocation, data.detonationDistance,
QString::fromStdString(data.properties)))
{
DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal return Can not send ces hit to building control process";
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send ces hit to building control process."));
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not send ces hit to building control process."));
}
DEBUG_LOG(m_logger) << "FunctionReplyObject";
return Core::FunctionReplyObject();
@@ -332,22 +333,22 @@ Core::FunctionReplyObject BuildingControlHandler::onTriggerBsmFlashInternal(cons
{
auto it = m_buildings.find(data.buildingId());
auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
BuildingProcess *bldg = it.value();
BuildingInfo buildingInfo= bldg->buildingInfo();
BsmInfo bsmInfo = buildingInfo.bsms.value(data.assetId());
BsmInfo bsmInfo = buildingInfo.bsms.value(data.assetId);
DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId()
DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId
<< " assetId=" << bsmInfo.assetId
<< " hostname=" << bsmInfo.hostname;
if (!bldg->triggerFlashlight(data))
{
DEBUG_LOG(m_logger) << "onTriggerBsmFlashInternal return Can not send trigger flashlight to building control process";
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send trigger flashlight to building control process"));
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not send trigger flashlight to building control process"));
}
}
DEBUG_LOG(m_logger) << "FunctionReplyObject";
@@ -368,12 +369,12 @@ void BuildingControlHandler::onSwitchRelayRequest(const rti::core::SampleIdentit
Core::FunctionReplyObject BuildingControlHandler::onSwitchRelayInternal(const SwitchRelayRequest &data)
{
DEBUG_LOG(m_logger) << "onSwitchRelayInternal " << data;
auto it = m_buildings.find(data.buildingId());
auto it = m_buildings.find(data.buildingId);
if (it == m_buildings.end())
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId());
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId);
BuildingProcess *bldg = it.value();
if (!bldg->switchRelay(data))
return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not set relay to building control process."));
return Core::FunctionReplyObject(data.buildingId, tr_lts("dds", "Can not set relay to building control process."));
return Core::FunctionReplyObject();
}
@@ -53,6 +53,7 @@ BuildingProcess::BuildingProcess(MainHandler *mainHandler,
, m_hitLineInfoTimer(new QTimer(this))
, m_hitLineId(info.mseId << 16)
, m_initBuilding(initBuilding)
, m_logger(getLogger("BuildingProcess"))
{
m_proc.setProgram(procName);
m_proc.setReadChannel(QProcess::StandardOutput);
@@ -86,7 +87,7 @@ void BuildingProcess::onStructureElementUpdateEffectOverrideReply(const Core::Fu
bool BuildingProcess::start()
{
DEBUG_LOG(m_logger) << "BuildingProcess::start mseId = " << m_buildingInfo.mseId
<< " m_historyState.size() = " << m_historyState.stateHistory().size()
<< " m_historyState.size() = " << m_historyState.stateHistory.size()
<< " m_initBuilding=" << m_initBuilding;
if (m_buildingInfo.mseId <= 0)
{
@@ -201,11 +202,11 @@ void BuildingProcess::shutdown()
void BuildingProcess::setHistoryState(const Buildings::HistoryState &historyState)
{
DEBUG_LOG(m_logger) << "BuildingProcess::setHistoryState size =" << historyState.stateHistory().size();
DEBUG_LOG(m_logger) << "BuildingProcess::setHistoryState size =" << historyState.stateHistory.size();
ERROR_LOG(m_logger) << "[BuildingProcess::setHistoryState]>>> history =" << historyState;
m_historyState = historyState;
m_historyState.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_historyState.sampleTime = QDateTime::currentMSecsSinceEpoch();
m_mainHandler->ddsHandler()->dts()->publish(m_historyState);
}
@@ -215,7 +216,7 @@ bool BuildingProcess::setVulnerabilityState(ProjectDataManagement::Vulnerability
if (!m_wsSocket || !m_wsSocket->isValid())
return false;
BuildingControlUnit::Json::Telegrams::SetDamageState tele;
tele.damageState = (state == ProjectDataManagement::VulnerabilityState::CatastrophicKill ?
tele.damageState = (state == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill ?
BuildingControlUnit::DamageState::Destroyed :
BuildingControlUnit::DamageState::NoDamage);
tele.roomIds.reserve(roomIds.size());
@@ -236,12 +237,12 @@ bool BuildingProcess::setContaminationState(const int &bldId, const Contaminatio
return false;
BuildingControlUnit::Json::Telegrams::SetContaminationState tele;
BuildingControlUnit::ContaminationState contState;
contState.aesId = contaminationState.aesId();
if ( contaminationState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CatastrophicKill )
contState.aesId = contaminationState.aesId;
if ( contaminationState.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill )
contState.damagePercentNew = 100;
else
contState.damagePercentNew = 0;
contState.rooms = contaminationState.rooms();
contState.rooms = contaminationState.rooms;
tele.contaminationStates.push_back(contState);
DEBUG_LOG(m_logger) << "SetContaminationState websocket send: " << QString::fromUtf8(tele.toJson());
@@ -271,8 +272,8 @@ bool BuildingProcess::setFortifyFactors(const std::vector<Buildings::FortifyFact
for (const auto &ff : fortifyFactors)
{
BuildingControlUnit::Json::Telegrams::SetFortifyFactor::FortifyInfo info;
info.roomId = m_buildingInfo.roomId2SubId.value(ff.roomId());
info.fortifyFactor = ff.fortifyFactor();
info.roomId = m_buildingInfo.roomId2SubId.value(ff.roomId);
info.fortifyFactor = ff.fortifyFactor;
tele.fortifyFactors.push_back(info);
}
@@ -402,8 +403,8 @@ bool BuildingProcess::relayState(const std::vector<Buildings::RelayStateItem> &r
for (const auto &ff : relayStates)
{
BuildingControlUnit::Json::Telegrams::RelayState::RelayStateInfo info;
info.id = ff.id();
info.state = ff.state();
info.id = ff.id;
info.state = ff.state;
tele.relayStates.push_back(info);
}
@@ -427,21 +428,21 @@ bool BuildingProcess::sendCesHitOnBuilding(const qint64 effectTimeMSec,
return false;
const LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(m_buildingInfo.absPosition.lon(),
m_buildingInfo.absPosition.lat()));
const LtsCoordTrans::UtmCoordinate impact(LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition.lon(),
impactPosition.lat(),
const LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(m_buildingInfo.absPosition.lon,
m_buildingInfo.absPosition.lat));
const LtsCoordTrans::UtmCoordinate impact(LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition.lon,
impactPosition.lat,
coord.zone));
Core::RelativePosition relPos(impact.x - coord.x,
impact.y - coord.y,
impactPosition.z() - m_buildingInfo.absPosition.z());
impactPosition.z - m_buildingInfo.absPosition.z);
double xRot, yRot;
QTransform m;
m.rotate(-m_buildingInfo.angle);
m.map(relPos.offsetX(), relPos.offsetY(), &xRot, &yRot);
relPos.offsetX(xRot);
relPos.offsetY(yRot);
m.map(relPos.offsetX, relPos.offsetY, &xRot, &yRot);
relPos.offsetX = xRot;
relPos.offsetY = yRot;
BuildingControlUnit::Json::Telegrams::CentralEffectSimulationHit tele;
@@ -450,9 +451,9 @@ bool BuildingProcess::sendCesHitOnBuilding(const qint64 effectTimeMSec,
tele.destructiveFactor = destructiveFactor;
tele.penetrationFactor = penetrationFactor;
tele.aesId = aesId;
tele.relPosition.x = relPos.offsetX();
tele.relPosition.y = relPos.offsetY();
tele.relPosition.z = relPos.offsetZ();
tele.relPosition.x = relPos.offsetX;
tele.relPosition.y = relPos.offsetY;
tele.relPosition.z = relPos.offsetZ;
tele.properties = properties;
DEBUG_LOG(m_logger) << "sendCesHitOnBuilding websocket send: " << QString::fromUtf8(tele.toJson());
@@ -469,27 +470,27 @@ bool BuildingProcess::sendCesHit3DonBuilding(const qint64 effectTimeMSec, const
return false;
const LtsCoordTrans::UtmCoordinate &coord(LtsCoordTrans::UtmCoordinate::fromGeographic(m_buildingInfo.absPosition.lon(),
m_buildingInfo.absPosition.lat()));
const LtsCoordTrans::UtmCoordinate &coord(LtsCoordTrans::UtmCoordinate::fromGeographic(m_buildingInfo.absPosition.lon,
m_buildingInfo.absPosition.lat));
Core::RelativePosition relImpactPos;
{
const LtsCoordTrans::UtmCoordinate &impactUtm(LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition.lon(),
impactPosition.lat(),
const LtsCoordTrans::UtmCoordinate &impactUtm(LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition.lon,
impactPosition.lat,
coord.zone));
relImpactPos = Core::RelativePosition(impactUtm.x - coord.x,
impactUtm.y - coord.y,
impactPosition.z() - m_buildingInfo.absPosition.z());
impactPosition.z - m_buildingInfo.absPosition.z);
}
Core::RelativePosition relDetoLoc;
{
const LtsCoordTrans::UtmCoordinate &detonationLocationUtm(LtsCoordTrans::UtmCoordinate::fromGeographic(detonationLocation.lon(),
detonationLocation.lat(),
const LtsCoordTrans::UtmCoordinate &detonationLocationUtm(LtsCoordTrans::UtmCoordinate::fromGeographic(detonationLocation.lon,
detonationLocation.lat,
coord.zone));
relDetoLoc = Core::RelativePosition(detonationLocationUtm.x - coord.x,
detonationLocationUtm.y - coord.y,
detonationLocation.z() - m_buildingInfo.absPosition.z());
detonationLocation.z - m_buildingInfo.absPosition.z);
}
@@ -498,13 +499,13 @@ bool BuildingProcess::sendCesHit3DonBuilding(const qint64 effectTimeMSec, const
m.rotate(-m_buildingInfo.angle);
m.map(relImpactPos.offsetX(), relImpactPos.offsetY(), &xRot, &yRot);
relImpactPos.offsetX(xRot);
relImpactPos.offsetY(yRot);
m.map(relImpactPos.offsetX, relImpactPos.offsetY, &xRot, &yRot);
relImpactPos.offsetX = xRot;
relImpactPos.offsetY = yRot;
m.map(relDetoLoc.offsetX(), relDetoLoc.offsetY(), &xRot, &yRot);
relDetoLoc.offsetX(xRot);
relDetoLoc.offsetY(yRot);
m.map(relDetoLoc.offsetX, relDetoLoc.offsetY, &xRot, &yRot);
relDetoLoc.offsetX = xRot;
relDetoLoc.offsetY = yRot;
BuildingControlUnit::Json::Telegrams::CentralEffectSimulationHit3D tele;
@@ -514,13 +515,13 @@ bool BuildingProcess::sendCesHit3DonBuilding(const qint64 effectTimeMSec, const
tele.penetrationFactor = penetrationFactor;
tele.aesId = aesId;
tele.impactPosition.x = relImpactPos.offsetX();
tele.impactPosition.y = relImpactPos.offsetY();
tele.impactPosition.z = relImpactPos.offsetZ();
tele.impactPosition.x = relImpactPos.offsetX;
tele.impactPosition.y = relImpactPos.offsetY;
tele.impactPosition.z = relImpactPos.offsetZ;
tele.detonationLocation.x = relDetoLoc.offsetX();
tele.detonationLocation.y = relDetoLoc.offsetY();
tele.detonationLocation.z = relDetoLoc.offsetZ();
tele.detonationLocation.x = relDetoLoc.offsetX;
tele.detonationLocation.y = relDetoLoc.offsetY;
tele.detonationLocation.z = relDetoLoc.offsetZ;
tele.detonationDistance = detonationDistance;
tele.properties = properties;
@@ -537,9 +538,9 @@ bool BuildingProcess::switchRelay(const SwitchRelayRequest &data)
if (!m_wsSocket || !m_wsSocket->isValid())
return false;
DEBUG_LOG(m_logger) << "switchRelay"
<< " buildingId=" << data.buildingId()
<< " assetId=" << data.assetId()
<< data.state();
<< " buildingId=" << data.buildingId
<< " assetId=" << data.assetId
<< data.state;
for (const EgcuInfo &egcu : std::as_const(m_buildingInfo.egcus))
@@ -547,19 +548,19 @@ bool BuildingProcess::switchRelay(const SwitchRelayRequest &data)
DEBUG_LOG(m_logger) << "EGCU: " << egcu.assetName
<< " assetId=" << egcu.assetId
<< " hostname=" << egcu.hostname;
DEBUG_LOG(m_logger) << "data.assetId()=" << data.assetId()
DEBUG_LOG(m_logger) << "data.assetId()=" << data.assetId
<< "egcu.assetId=" << egcu.assetId;
if ( data.assetId() != egcu.assetId)
if ( data.assetId != egcu.assetId)
continue;
tele.segment = egcu.hostname;
tele.switchRelayValues.id = data.number();
tele.switchRelayValues.bcuRelayState = static_cast <BuildingControlUnit::BcuRelayState>(data.state().underlying());
if ( data.state() == StateSetRelay_def::Pulse)
tele.switchRelayValues.id = data.number;
tele.switchRelayValues.bcuRelayState = static_cast <BuildingControlUnit::BcuRelayState>(static_cast<int>(data.state));
if ( data.state == StateSetRelay::Pulse)
{
tele.switchRelayValues.count = data.pulseAttributes().get().count();
tele.switchRelayValues.delay = data.pulseAttributes().get().delay();
tele.switchRelayValues.pulse = data.pulseAttributes().get().pulse();
tele.switchRelayValues.count = data.pulseAttributes.get().count;
tele.switchRelayValues.delay = data.pulseAttributes.get().delay;
tele.switchRelayValues.pulse = data.pulseAttributes.get().pulse;
}
DEBUG_LOG(m_logger) << "switchRelay websocket send: " << QString::fromUtf8(tele.toJson());
m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson()));
@@ -575,8 +576,8 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data)
if (!m_wsSocket || !m_wsSocket->isValid())
return false;
DEBUG_LOG(m_logger) << "triggerFlashlight"
<< " BuildingId=" << data.buildingId()
<< " assetId=" << data.assetId()
<< " BuildingId=" << data.buildingId
<< " assetId=" << data.assetId
<< " m_buildingInfo.bsms.size()" << m_buildingInfo.bsms.size();
QMapIterator<int, BsmInfo> i(m_buildingInfo.bsms);
@@ -589,10 +590,10 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data)
<< " port=" << i.value().port;
}
if ( m_buildingInfo.bsms.contains(data.assetId()))
if ( m_buildingInfo.bsms.contains(data.assetId))
{
BsmInfo bsmInfo = m_buildingInfo.bsms.value(data.assetId());
DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId()
BsmInfo bsmInfo = m_buildingInfo.bsms.value(data.assetId);
DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId
<< " assetId=" << bsmInfo.assetId
<< " hostname=" << bsmInfo.hostname;
@@ -664,21 +665,21 @@ void BuildingProcess::onTextMessageReceived(const QString &message)
void BuildingProcess::handleBsmState(BuildingControlUnit::Json::Telegrams::BsmState *tel)
{
BuildingStateTechnical state;
state.id(m_buildingInfo.mseId);
state.assetId(m_buildingInfo.assetId);
state.structureElementId(m_buildingInfo.structureElementId);
state.sampleTime(QDateTime::currentMSecsSinceEpoch());
state.bsmStates().resize(tel->bsmStates.size());
state.id = m_buildingInfo.mseId;
state.assetId = m_buildingInfo.assetId;
state.structureElementId = m_buildingInfo.structureElementId;
state.sampleTime = QDateTime::currentMSecsSinceEpoch();
state.bsmStates.resize(tel->bsmStates.size());
BsmState s;
for (int i = 0; i < tel->bsmStates.size(); ++i)
{
const BuildingControlUnit::Json::Telegrams::BsmState::BsmStateInfo &info = tel->bsmStates.at(i);
s.id(info.id);
s.connected(info.connected);
s.hostport(info.port);
s.hostname(info.hostname.toStdString());
s.versionInfo(info.versionInfo.toStdString());
state.bsmStates()[i] = s;
s.id = info.id;
s.connected = info.connected;
s.hostport = info.port;
s.hostname = info.hostname.toStdString();
s.versionInfo = info.versionInfo.toStdString();
state.bsmStates[i] = s;
m_bsmStates.insert(info.id, s);
}
@@ -687,32 +688,32 @@ void BuildingProcess::handleBsmState(BuildingControlUnit::Json::Telegrams::BsmSt
void BuildingProcess::historyState(const BuildingState &state)
{
if (state.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady
&& state.damagePercent() == 0
&& state.originatorParticipantId() == 0
&& state.contaminationStates().size() == 0)
if (state.vulnerabilityState == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady
&& state.damagePercent == 0
&& state.originatorParticipantId == 0
&& state.contaminationStates.size() == 0)
{
DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << state.id();
m_historyState.stateHistory().resize(0);
DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << state.id;
m_historyState.stateHistory.resize(0);
}
HistoryStateItem historyStateItem;
historyStateItem.aesId(state.aesId());
historyStateItem.chargeTypeId(state.chargeTypeId());
historyStateItem.damagePercent(state.damagePercent());
historyStateItem.damagePercentOld(state.damagePercentOld());
historyStateItem.originatorParticipantId(state.originatorParticipantId());
historyStateItem.originatorType() = state.originatorType();
historyStateItem.time(state.sampleTime());
historyStateItem.vulnerabilityState() = state.vulnerabilityState();
historyStateItem.contaminationStates() = state.contaminationStates();
historyStateItem.aesId = state.aesId;
historyStateItem.chargeTypeId = state.chargeTypeId;
historyStateItem.damagePercent = state.damagePercent;
historyStateItem.damagePercentOld = state.damagePercentOld;
historyStateItem.originatorParticipantId = state.originatorParticipantId;
historyStateItem.originatorType = state.originatorType;
historyStateItem.time = state.sampleTime;
historyStateItem.vulnerabilityState = state.vulnerabilityState;
historyStateItem.contaminationStates = state.contaminationStates;
m_historyState.stateHistory().push_back(std::move(historyStateItem));
m_historyState.stateHistory.push_back(std::move(historyStateItem));
DEBUG_LOG(m_logger) << "BuildingProcess::historyState contaminationStates:" << state;
m_historyState.mseId(state.id());
DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << m_historyState.mseId();
m_historyState.sampleTime(QDateTime::currentMSecsSinceEpoch());
m_historyState.mseId = state.id;
DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << m_historyState.mseId;
m_historyState.sampleTime = QDateTime::currentMSecsSinceEpoch();
m_mainHandler->ddsHandler()->dts()->publish(m_historyState);
}
@@ -722,78 +723,78 @@ void BuildingProcess::handleHitResult(BuildingControlUnit::Json::Telegrams::HitR
BuildingState state;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " data.hitOnRoomId=" << data.hitOnRoomId;
state.id(m_buildingInfo.mseId);
state.id = m_buildingInfo.mseId;
int assetId = m_mainHandler->ddsHandler()->dtcIsm()->getAssetIdFromMountingPointId(m_buildingInfo.mseId, data.sensorId);
DEBUG_LOG(m_logger) << "handleHitResult assetId=" << assetId;
state.assetId(assetId);
state.assetId = assetId;
InfrastructureManagement::StructureElement se;
m_mainHandler->ddsHandler()->dtcIsm()->getStructureElementInMntPointAssetByAssetId(assetId, se);
DEBUG_LOG(m_logger) << "handleHitResult structureElementId=" << se.id();
state.structureElementId(se.id());
state.sampleTime(QDateTime::currentMSecsSinceEpoch());
DEBUG_LOG(m_logger) << "handleHitResult structureElementId=" << se.id;
state.structureElementId = se.id;
state.sampleTime = QDateTime::currentMSecsSinceEpoch();
if (data.originatorType == BuildingControlUnit::OriginatorType::DirectHit)
{
state.originatorParticipantId(m_mainHandler->ppmHandler()->equipmentNumberToParticipantId(data.originatorId));
state.chargeTypeId(data.chargeTypeId);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::Participant);
state.originatorParticipantId = m_mainHandler->ppmHandler()->equipmentNumberToParticipantId(data.originatorId);
state.chargeTypeId = data.chargeTypeId;
state.originatorType = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Participant;
}
else if (data.originatorType == BuildingControlUnit::OriginatorType::CesHit)
{
state.aesId(data.originatorId);
state.aesId = data.originatorId;
state.chargeTypeId(data.chargeTypeId);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation);
state.chargeTypeId = data.chargeTypeId;
state.originatorType = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation;
}
else if (data.originatorType == BuildingControlUnit::OriginatorType::OC)
{
state.originatorParticipantId(0);
state.chargeTypeId(data.chargeTypeId);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ObserverController);
state.originatorParticipantId = 0;
state.chargeTypeId = data.chargeTypeId;
state.originatorType = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ObserverController;
}
else
{
state.originatorParticipantId(0);
state.chargeTypeId(data.chargeTypeId);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ExerciseControl);
state.originatorParticipantId = 0;
state.chargeTypeId = data.chargeTypeId;
state.originatorType = ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ExerciseControl;
}
state.damagePercent(data.damagePercentNew);
state.damagePercentOld(data.damagePercentOld);
state.vulnerabilityState(data.damageState == BuildingControlUnit::DamageState::Destroyed ?
ProjectDataManagement::VulnerabilityState::CatastrophicKill :
ProjectDataManagement::VulnerabilityState::CombatReady);
state.hitOnRoomId(data.hitOnRoomId);
state.roomStates().reserve(data.rooms.size());
state.damagePercent = data.damagePercentNew;
state.damagePercentOld = data.damagePercentOld;
state.vulnerabilityState = data.damageState == BuildingControlUnit::DamageState::Destroyed ?
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill :
ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
state.hitOnRoomId = data.hitOnRoomId;
state.roomStates.reserve(data.rooms.size());
RoomState s;
for (const auto &info : data.rooms)
{
s.id(m_buildingInfo.subId2RoomId.value(info.roomId));
s.mountingPointId(info.roomId);
s.damagePercent(info.damagePercent);
s.remainingEffectPercent(info.remainingEffectPercent);
s.fortifyFactor(info.fortifyFactor);
state.roomStates().push_back(s);
s.id = m_buildingInfo.subId2RoomId.value(info.roomId);
s.mountingPointId = info.roomId;
s.damagePercent = info.damagePercent;
s.remainingEffectPercent = info.remainingEffectPercent;
s.fortifyFactor = info.fortifyFactor;
state.roomStates.push_back(s);
}
ContaminationState cs;
state.contaminationStates().reserve(data.contaminations.count());
state.contaminationStates.reserve(data.contaminations.count());
for (const auto &csi : data.contaminations)
{
cs.aesId(csi.aesId);
cs.rooms().assign(csi.rooms.begin(), csi.rooms.end());
state.contaminationStates().push_back(cs);
cs.aesId = csi.aesId;
cs.rooms.assign(csi.rooms.begin(), csi.rooms.end());
state.contaminationStates.push_back(cs);
}
if (m_historyState.mseId() != 0)
if (m_historyState.mseId != 0)
historyState(state);
else
{
m_historyState.mseId(m_buildingInfo.mseId);
m_historyState.mseId = m_buildingInfo.mseId;
}
m_mainHandler->ddsHandler()->dts()->publish(state);
@@ -823,7 +824,7 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment)
if (m_effectOverridesReconnect.value(relayId) >= 0)
{
InfrastructureManagement::EffectOverride override = InfrastructureManagement::EffectOverride_def::PermanentOff;
InfrastructureManagement::EffectOverride override = InfrastructureManagement::EffectOverride::PermanentOff;
int structureElementIdMp = m_mainHandler->ddsHandler()->dtcIsm()->getStructueElementIdFromAssetId(egcu.assetId);
@@ -837,9 +838,9 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment)
InfrastructureManagement::StructureElementUpdateEffectOverrideRequest request;
request.structureElementId(structureElementIdMp);
request.effectId(relayId);
request.effectOverride(override);
request.structureElementId = structureElementIdMp;
request.effectId = relayId;
request.effectOverride = override;
DEBUG_LOG(m_logger) << "Vor structureElementUpdateEffectOverrideRequest";
int result = m_mainHandler->ismHandler()->ftcIsm()->structureElementUpdateEffectOverrideRequest(request, this);
DEBUG_LOG(m_logger) << "Nach structureElementUpdateEffectOverrideRequest result=" << result;
@@ -875,9 +876,9 @@ void BuildingProcess::handleRelayState(BuildingControlUnit::Json::Telegrams::Rel
<< " assetId=" << egcu.assetId
<< " hostname='" << egcu.hostname
<< "' buildingName=" << egcu.buildingName;
state.id(egcu.assetId);
state.stateTime(tel->stateTime);
state.offlineTime(tel->offlineTime);
state.id = egcu.assetId;
state.stateTime = tel->stateTime;
state.offlineTime = tel->offlineTime;
break;
}
}
@@ -885,10 +886,10 @@ void BuildingProcess::handleRelayState(BuildingControlUnit::Json::Telegrams::Rel
RelayStateItem item;
for (const auto &info : std::as_const(tel->relayStates))
{
item.id(info.id);
item.state(info.state);
item.id = info.id;
item.state = info.state;
state.relayStates().push_back(item);
state.relayStates.push_back(item);
}
@@ -914,85 +915,85 @@ void BuildingProcess::handleEffectOverride(BuildingControlUnit::Json::Telegrams:
<< " structureElementId=" << m_buildingInfo.structureElementId
<< " structureElementIdMp=" << structureElementIdMp;
request.structureElementId(structureElementIdMp);
request.structureElementId = structureElementIdMp;
}
for ( int j = 0; j < tel->overrides.size(); j++ )
{
request.effectId(tel->overrides.at(j).id);
request.effectId = tel->overrides.at(j).id;
switch (tel->overrides.at(j).effectOverride)
{
case -1:
{
request.effectOverride(InfrastructureManagement::EffectOverride_def::Automatic);
request.effectOverride = InfrastructureManagement::EffectOverride::Automatic;
break;
}
case 0:
{
request.effectOverride(InfrastructureManagement::EffectOverride_def::PermanentOff);
request.effectOverride = InfrastructureManagement::EffectOverride::PermanentOff;
break;
}
case 1:
{
request.effectOverride(InfrastructureManagement::EffectOverride_def::PermanentOn);
request.effectOverride = InfrastructureManagement::EffectOverride::PermanentOn;
break;
}
}
DEBUG_LOG(m_logger) << "Send Override Request"
<< " structureElementId=" << request.structureElementId()
<< " effectId=" << request.effectId()
<< " effectOverride=" << request.effectOverride();
if ( request.structureElementId() > 0)
<< " structureElementId=" << request.structureElementId
<< " effectId=" << request.effectId
<< " effectOverride=" << request.effectOverride;
if ( request.structureElementId > 0)
m_mainHandler->ddsHandler()->ftcIsm()->structureElementUpdateEffectOverrideRequest(request, this);
else
ERROR_LOG(m_logger) << "request.structureElementId() =" << request.structureElementId() << " NOT VALID!!!";
ERROR_LOG(m_logger) << "request.structureElementId() =" << request.structureElementId << " NOT VALID!!!";
}
}
}
bool BuildingProcess::isValidPos(const Core::GeoPosition &pos)
{
if (qFuzzyIsNull(pos.lat()) && qFuzzyIsNull(pos.lon()))
if (qFuzzyIsNull(pos.lat) && qFuzzyIsNull(pos.lon))
return false;
return !std::isnan(pos.lat()) && !std::isnan(pos.lon());
return !std::isnan(pos.lat) && !std::isnan(pos.lon);
}
void BuildingProcess::sendHitLine(const BuildingState &state)
{
if (state.originatorParticipantId() <= 0)
if (state.originatorParticipantId <= 0)
return;
const ParticipantManagement::ParticipantPosition participantPosition = m_mainHandler->ppmHandler()->participantPosition(state.originatorParticipantId());
if (!isValidPos(participantPosition.pos()))
const ParticipantManagement::ParticipantPosition participantPosition = m_mainHandler->ppmHandler()->participantPosition(state.originatorParticipantId);
if (!isValidPos(participantPosition.pos))
return;
BuildingHitLineInfo buildingHitLineInfo;
InfrastructureManagement::MainStructureElement mainStructureElement = m_mainHandler->ismHandler()->mainStructureElement(state.id());
InfrastructureManagement::MainStructureElement mainStructureElement = m_mainHandler->ismHandler()->mainStructureElement(state.id);
buildingHitLineInfo.id(m_hitLineId);
buildingHitLineInfo.buildingId(m_buildingInfo.mseId);
buildingHitLineInfo.buildingPos(mainStructureElement.geoPosition());
if (state.hitOnRoomId() > 0)
buildingHitLineInfo.id = m_hitLineId;
buildingHitLineInfo.buildingId = m_buildingInfo.mseId;
buildingHitLineInfo.buildingPos = mainStructureElement.geoPosition;
if (state.hitOnRoomId > 0)
{
for (const auto &se : mainStructureElement.elements())
for (const auto &se : mainStructureElement.elements)
{
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room &&
se.mountingPointId() == state.hitOnRoomId())
if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Room &&
se.mountingPointId == state.hitOnRoomId)
{
buildingHitLineInfo.buildingPos(se.geoPosition());
buildingHitLineInfo.buildingPos = se.geoPosition;
break;
}
}
}
buildingHitLineInfo.chargeTypeId(state.chargeTypeId());
buildingHitLineInfo.originatorParticipantId(state.originatorParticipantId());
buildingHitLineInfo.originatorPos(participantPosition.pos());
buildingHitLineInfo.originatorPartyId(participantPosition.partyId());
buildingHitLineInfo.sampleTime(state.sampleTime());
buildingHitLineInfo.hitOnRoomId(state.hitOnRoomId());
buildingHitLineInfo.contaminationStates(state.contaminationStates());
buildingHitLineInfo.chargeTypeId = state.chargeTypeId;
buildingHitLineInfo.originatorParticipantId = state.originatorParticipantId;
buildingHitLineInfo.originatorPos = participantPosition.pos;
buildingHitLineInfo.originatorPartyId = participantPosition.partyId;
buildingHitLineInfo.sampleTime = state.sampleTime;
buildingHitLineInfo.hitOnRoomId = state.hitOnRoomId;
buildingHitLineInfo.contaminationStates = state.contaminationStates;
m_mainHandler->ddsHandler()->dts()->publish(buildingHitLineInfo);
m_hitLineInfoMap.insert(buildingHitLineInfo.id(), buildingHitLineInfo);
m_hitLineInfoMap.insert(buildingHitLineInfo.id, buildingHitLineInfo);
++m_hitLineId;
}
@@ -1003,9 +1004,9 @@ void BuildingProcess::onHitLineInfoTimeout()
auto it = m_hitLineInfoMap.begin();
while (it != m_hitLineInfoMap.end())
{
if (!LtsUtils::isPositionTimeOutdated(tNow, it.value().sampleTime()))
if (!LtsUtils::isPositionTimeOutdated(tNow, it.value().sampleTime))
break;
m_mainHandler->ddsHandler()->dts()->removeBuildingHitLineInfoByKey(it.value().id());
m_mainHandler->ddsHandler()->dts()->removeBuildingHitLineInfoByKey(it.value().id);
it = m_hitLineInfoMap.erase(it);
}
@@ -1037,16 +1038,16 @@ static void outputBsmData(QXmlStreamWriter &sw, const BsmInfo &bsm)
sw.writeStartElement(QStringLiteral("Position"));
{
sw.writeAttribute(QStringLiteral("x"), QString::number(bsm.relPosition.offsetX(), 'f', 10));
sw.writeAttribute(QStringLiteral("y"), QString::number(bsm.relPosition.offsetY(), 'f', 10));
sw.writeAttribute(QStringLiteral("z"), QString::number(bsm.relPosition.offsetZ(), 'f', 10));
sw.writeAttribute(QStringLiteral("x"), QString::number(bsm.relPosition.offsetX, 'f', 10));
sw.writeAttribute(QStringLiteral("y"), QString::number(bsm.relPosition.offsetY, 'f', 10));
sw.writeAttribute(QStringLiteral("z"), QString::number(bsm.relPosition.offsetZ, 'f', 10));
}
sw.writeEndElement();
sw.writeStartElement(QStringLiteral("Direction"));
{
sw.writeAttribute(QStringLiteral("x"), QString::number(bsm.orientation.heave(), 'f', 10));
sw.writeAttribute(QStringLiteral("y"), QString::number(bsm.orientation.pitch(), 'f', 10));
sw.writeAttribute(QStringLiteral("z"), QString::number(bsm.orientation.roll(), 'f', 10));
sw.writeAttribute(QStringLiteral("x"), QString::number(bsm.orientation.heave, 'f', 10));
sw.writeAttribute(QStringLiteral("y"), QString::number(bsm.orientation.pitch, 'f', 10));
sw.writeAttribute(QStringLiteral("z"), QString::number(bsm.orientation.roll, 'f', 10));
}
sw.writeEndElement();
}
@@ -1077,7 +1078,6 @@ QByteArray BuildingProcess::generateBuildingConfigData() const
QXmlStreamWriter sw(&ret);
sw.setAutoFormatting(true);
sw.setAutoFormattingIndent(2);
sw.setCodec("UTF-8");
sw.writeStartDocument(QStringLiteral("1.0"), true);
sw.writeStartElement(QStringLiteral("BuildingConfiguration"));
{
@@ -1103,31 +1103,30 @@ QByteArray BuildingProcess::generateChargesData() const
QXmlStreamWriter sw(&ret);
sw.setAutoFormatting(true);
sw.setAutoFormattingIndent(2);
sw.setCodec("UTF-8");
sw.writeStartDocument(QStringLiteral("1.0"), true);
sw.writeStartElement(QStringLiteral("Charges"));
{
for (const ProjectDataManagement::BuildingChargeEffect &charge : buildingCharges)
{
auto it = chargeTypes.find(charge.chargeTypeId());
auto it = chargeTypes.find(charge.chargeTypeId);
if (it == chargeTypes.end())
{
WARNING_LOG(m_logger) << "Could not find charge type with id " << charge.chargeTypeId() << " - skipping";
WARNING_LOG(m_logger) << "Could not find charge type with id " << charge.chargeTypeId << " - skipping";
continue;
}
ProjectDataManagement::ChargeTypeProperty chargeTypeProperty = m_mainHandler->ddsHandler()->dtcPdm()->getChargeTypeSpecialProperty(charge.chargeTypeId(),0,0);
ProjectDataManagement::ChargeTypeProperty chargeTypeProperty = m_mainHandler->ddsHandler()->dtcPdm()->getChargeTypeSpecialProperty(charge.chargeTypeId,0,0);
sw.writeStartElement(QStringLiteral("Charge"));
sw.writeTextElement(QStringLiteral("Id"), QString::number(charge.id()));
sw.writeTextElement(QStringLiteral("ChargeTypeId"), QString::number(charge.chargeTypeId()));
sw.writeTextElement(QStringLiteral("DestructiveFactor"), QString::number(charge.destructiveFactor()));
sw.writeTextElement(QStringLiteral("PenetrationEffect"), QString::number(charge.penetrationFactor()));
sw.writeTextElement(QStringLiteral("Id"), QString::number(charge.id));
sw.writeTextElement(QStringLiteral("ChargeTypeId"), QString::number(charge.chargeTypeId));
sw.writeTextElement(QStringLiteral("DestructiveFactor"), QString::number(charge.destructiveFactor));
sw.writeTextElement(QStringLiteral("PenetrationEffect"), QString::number(charge.penetrationFactor));
sw.writeTextElement(QStringLiteral("properties"), properties);
sw.writeTextElement(QStringLiteral("EffectSound"), QString::number(charge.hitSound()));
sw.writeTextElement(QStringLiteral("DifcueLight"), QString::number(charge.difcueLight()));
sw.writeTextElement(QStringLiteral("DifcuePyro"), QString::number(charge.difcuePyro()));
if (chargeTypeProperty == ProjectDataManagement::ChargeTypeProperty_def::None)
if (charge.destructiveFactor() > 0)
sw.writeTextElement(QStringLiteral("EffectSound"), QString::number(charge.hitSound));
sw.writeTextElement(QStringLiteral("DifcueLight"), QString::number(charge.difcueLight));
sw.writeTextElement(QStringLiteral("DifcuePyro"), QString::number(charge.difcuePyro));
if (chargeTypeProperty == ProjectDataManagement::ChargeTypeProperty::None)
if (charge.destructiveFactor > 0)
sw.writeTextElement(QStringLiteral("showHitLine"), QString::number(1));
else
sw.writeTextElement(QStringLiteral("showHitLine"), QString::number(0));
@@ -4,6 +4,7 @@
#include "ism_handler.h"
#include <utility>
#include "main_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QTimer>
#include <QtCore/QJsonDocument>
#include <QJsonParseError>
@@ -79,40 +80,40 @@ bool IsmHandler::isElementAssignedToExercise(const int mseId, int exerciseId)
void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
{
if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::BuildingSensorModule ||
data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
if (data.mountingPointTypeId == InfrastructureManagement::MountingPointType::BuildingSensorModule ||
data.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
{
switch (modType)
{
case DataModification::eAdded:
case DataModification::eModified:
m_instAssets.insert(data.id(), data);
m_instAssets.insert(data.id, data);
break;
case DataModification::eRemoved:
m_instAssets.remove(data.id());
m_instAssets.remove(data.id);
break;
}
m_changeTimeoutTimer->start();
return;
}
if (data.mountingPointTypeId() == InfrastructureManagement::MountingPointType::BuildingControlUnit)
if (data.mountingPointTypeId == InfrastructureManagement::MountingPointType::BuildingControlUnit)
{
switch (modType)
{
case DataModification::eAdded:
case DataModification::eModified:
{
const int exerciseId = data.availableInExercise().size() == 0 ? 0 : data.availableInExercise().at(0);
DEBUG_LOG(m_logger) << "setting asset " << data.id() << " available in exercise " << exerciseId;
m_assetMainStructureElementInExercise.insert(data.id(), exerciseId);
const int exerciseId = data.availableInExercise.size() == 0 ? 0 : data.availableInExercise.at(0);
DEBUG_LOG(m_logger) << "setting asset " << data.id << " available in exercise " << exerciseId;
m_assetMainStructureElementInExercise.insert(data.id, exerciseId);
break;
}
case DataModification::eRemoved:
{
const int exerciseId = data.availableInExercise().size() == 0 ? 0 : data.availableInExercise().at(0);
DEBUG_LOG(m_logger) << "removing asset " << data.id() << " from exercise " << exerciseId;
m_assetMainStructureElementInExercise.remove(data.id());
const int exerciseId = data.availableInExercise.size() == 0 ? 0 : data.availableInExercise.at(0);
DEBUG_LOG(m_logger) << "removing asset " << data.id << " from exercise " << exerciseId;
m_assetMainStructureElementInExercise.remove(data.id);
break;
}
}
@@ -126,12 +127,12 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou
{
case DataModification::eAdded:
case DataModification::eModified:
DEBUG_LOG(m_logger) << "mounting asset " << data.assetId() << " on structure element id " << data.structureElementId();
m_structureElementId2AssetId.insert(data.structureElementId(), data.assetId());
DEBUG_LOG(m_logger) << "mounting asset " << data.assetId << " on structure element id " << data.structureElementId;
m_structureElementId2AssetId.insert(data.structureElementId, data.assetId);
break;
case DataModification::eRemoved:
DEBUG_LOG(m_logger) << "unmounting asset " << m_structureElementId2AssetId.value(data.structureElementId()) << " from structure element " << data.structureElementId();
m_structureElementId2AssetId.remove(data.structureElementId());
DEBUG_LOG(m_logger) << "unmounting asset " << m_structureElementId2AssetId.value(data.structureElementId) << " from structure element " << data.structureElementId;
m_structureElementId2AssetId.remove(data.structureElementId);
break;
}
m_changeTimeoutTimer->start();
@@ -145,16 +146,16 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
case DataModification::eAdded:
case DataModification::eModified:
{
if (!isElementAssignedToExercise (data.id(),m_mainHandler->exerciseId() ) )
if (!isElementAssignedToExercise (data.id,m_mainHandler->exerciseId() ) )
{
m_mainStructureElements.remove(data.id());
DEBUG_LOG(m_logger) << "Building not in exercise id=" << data.id();
m_mainStructureElements.remove(data.id);
DEBUG_LOG(m_logger) << "Building not in exercise id=" << data.id;
return;
}
DEBUG_LOG(m_logger) << "Building=" << data.name()
<< " properties=" << data.properties();
DEBUG_LOG(m_logger) << "Building=" << data.name
<< " properties=" << data.properties;
QJsonParseError parserError;
QByteArray content = QByteArray::fromStdString(data.properties());
QByteArray content = QByteArray::fromStdString(data.properties);
const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError));
if (parserError.error != QJsonParseError::NoError)
@@ -170,19 +171,19 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
bool startBuildingProcess = objProperties.value(QStringLiteral("start_building_process")).toBool();
if (!startBuildingProcess)
{
DEBUG_LOG(m_logger) << "Building=" << data.name()
DEBUG_LOG(m_logger) << "Building=" << data.name
<< " start_building_process = false ";
return;
}
}
DEBUG_LOG(m_logger) << "##### onMainStructureElementChanged - ID = " << data.id();
checkOverride( m_mainStructureElements[data.id()], data);
m_mainStructureElements[data.id()] = data;
DEBUG_LOG(m_logger) << "##### onMainStructureElementChanged - ID = " << data.id;
checkOverride( m_mainStructureElements[data.id], data);
m_mainStructureElements[data.id] = data;
break;
}
case DataModification::eRemoved:
m_mainStructureElements.remove(data.id());
m_mainStructureElements.remove(data.id);
break;
}
m_changeTimeoutTimer->start();
@@ -197,12 +198,12 @@ void IsmHandler::onBridgeStatusChanged(const InfrastructureManagement::BridgeCha
case DataModification::eAdded:
case DataModification::eModified:
{
DEBUG_LOG(m_logger) << "##### onBridgeStatusChanged - buildingId = " << data.buildingId();
DEBUG_LOG(m_logger) << "##### onBridgeStatusChanged - buildingId = " << data.buildingId;
BridgeStatus bs;
bs.id(s_id++);
bs.buildingId(data.buildingId());
bs.sampleTime(data.sampleTime());
bs.status(m_dtcIsm->getBridgeStatus(data.buildingId()).underlying());
bs.id = s_id++;
bs.buildingId = data.buildingId;
bs.sampleTime = data.sampleTime;
bs.status = static_cast<int>(m_dtcIsm->getBridgeStatus(data.buildingId));
m_mainHandler->ddsHandler()->dts()->publish(bs);
break;
}
@@ -214,9 +215,9 @@ void IsmHandler::onBridgeStatusChanged(const InfrastructureManagement::BridgeCha
void IsmHandler::getEgcuToRoom(const InfrastructureManagement::MainStructureElement &mse, QVector<EgcuInfo> &eis)
{
INFO_LOG(m_logger) << "properties=" << mse.properties();
INFO_LOG(m_logger) << "properties=" << mse.properties;
QJsonParseError parserError;
QByteArray content = QByteArray::fromStdString(mse.properties());
QByteArray content = QByteArray::fromStdString(mse.properties);
const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError));
if (parserError.error != QJsonParseError::NoError)
@@ -275,34 +276,34 @@ void IsmHandler::buildingsChanged(bool init)
INFO_LOG(m_logger) << "Updating building config m_mainStructureElements.size=" << m_mainStructureElements.size();
for (const InfrastructureManagement::MainStructureElement &mse : std::as_const(m_mainStructureElements))
{
DEBUG_LOG(m_logger) << "Checking building " << mse.id() << " - " << mse.name();
DEBUG_LOG(m_logger) << "Checking building " << mse.id << " - " << mse.name;
BuildingInfo bi;
bi.mseId = mse.id();
bi.modelId = mse.modelId();
bi.externalWlsId = mse.externalWlsId();
bi.name = QString::fromStdString(mse.name());
bi.absPosition = mse.geoPosition();
bi.angle = mse.angle();
bi.structureElementId = mse.structureElementId();
bi.mseId = mse.id;
bi.modelId = mse.modelId;
bi.externalWlsId = mse.externalWlsId;
bi.name = QString::fromStdString(mse.name);
bi.absPosition = mse.geoPosition;
bi.angle = mse.angle;
bi.structureElementId = mse.structureElementId;
for (const InfrastructureManagement::StructureElement &se : mse.elements())
for (const InfrastructureManagement::StructureElement &se : mse.elements)
{
if (se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::BuildingSensorModule)
if (se.mountingPointTypeId == InfrastructureManagement::MountingPointType::BuildingSensorModule)
handleBuildingSensorModule(se, bi);
else if (se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::BuildingControlUnit)
else if (se.mountingPointTypeId == InfrastructureManagement::MountingPointType::BuildingControlUnit)
handleBuildingControlUnit(se, bi);
else if (se.mountingPointTypeId() == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
else if (se.mountingPointTypeId == InfrastructureManagement::MountingPointType::EffectGenerationControlUnit)
handleEffectGenerationControlUnit(se, bi);
else if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
else if (se.structureElementTypeId == InfrastructureManagement::StructureElementType::Room)
{
bi.subId2RoomId.insert(se.mountingPointId(), se.id());
bi.roomId2SubId.insert(se.id(), se.mountingPointId());
bi.roomName2RoomId.insert(QString::fromStdString(se.name()), se.mountingPointId());
INFO_LOG(m_logger) << " Room: mountingPointId: " << se.mountingPointId()
<< ", roomId: " << se.id()
<< ", Name: " << se.name();
m_roomId2RoomName.insert(se.id(), QString::fromStdString(se.name()));
bi.subId2RoomId.insert(se.mountingPointId, se.id);
bi.roomId2SubId.insert(se.id, se.mountingPointId);
bi.roomName2RoomId.insert(QString::fromStdString(se.name), se.mountingPointId);
INFO_LOG(m_logger) << " Room: mountingPointId: " << se.mountingPointId
<< ", roomId: " << se.id
<< ", Name: " << se.name;
m_roomId2RoomName.insert(se.id, QString::fromStdString(se.name));
}
}
if (m_mainHandler->exerciseId() != bi.currentExerciseId)
@@ -313,8 +314,8 @@ void IsmHandler::buildingsChanged(bool init)
<< " buildingName" << bi.name;
continue;
}
INFO_LOG(m_logger) << "Adding building configuration for " << mse.id() << " - " << mse.name();
availableBuildingIds += mse.id();
INFO_LOG(m_logger) << "Adding building configuration for " << mse.id << " - " << mse.name;
availableBuildingIds += mse.id;
getEgcuToRoom(mse, bi.egcus);
newBuildingConfiguration.insert(bi.mseId, bi);
}
@@ -356,7 +357,7 @@ void IsmHandler::buildingsChanged(bool init)
void IsmHandler::handleBuildingSensorModule(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const
{
auto itMpa = m_structureElementId2AssetId.find(se.id());
auto itMpa = m_structureElementId2AssetId.find(se.id);
if (itMpa == m_structureElementId2AssetId.end())
return;
const int assetId = itMpa.value();
@@ -366,11 +367,11 @@ void IsmHandler::handleBuildingSensorModule(const InfrastructureManagement::Stru
const InfrastructureManagement::InstrumentationAsset &ia = itAsset.value();
BsmInfo bsi;
bsi.assetId = assetId;
bsi.bsmId = se.mountingPointId();
bsi.hostname = QString::fromStdString(ia.hostname());
bsi.port = getBsmPortFromJSon(ia.properties());
bsi.relPosition = se.relPosition();
bsi.orientation = se.orientation();
bsi.bsmId = se.mountingPointId;
bsi.hostname = QString::fromStdString(ia.hostname);
bsi.port = getBsmPortFromJSon(ia.properties);
bsi.relPosition = se.relPosition;
bsi.orientation = se.orientation;
DEBUG_LOG(m_logger) << "adding bsm sensor module to building " << bi.mseId << ": " << bsi.assetId << ", " << bsi.bsmId << ", " << bsi.hostname;
bi.bsms.insert(bsi.assetId, bsi);
}
@@ -383,10 +384,10 @@ void IsmHandler::handleBuildingControlUnit(const InfrastructureManagement::Struc
auto itMpa = m_structureElementId2AssetId.find(se.id());
auto itMpa = m_structureElementId2AssetId.find(se.id);
if (itMpa == m_structureElementId2AssetId.end())
{
INFO_LOG(m_logger) << "structure element id " << se.id() << " not (yet)found"
INFO_LOG(m_logger) << "structure element id " << se.id << " not (yet)found"
<< " bi.mseId=" << bi.mseId
<< " bi.assetId=" << bi.assetId
<< " bi.egcus.size=" << bi.egcus.size()
@@ -410,8 +411,8 @@ void IsmHandler::handleBuildingControlUnit(const InfrastructureManagement::Struc
void IsmHandler::handleEffectGenerationControlUnit(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const
{
DEBUG_LOG(m_logger) << "BuildingId=" << bi.mseId
<< " se.id=" << se.id();
auto itMpa = m_structureElementId2AssetId.find(se.id());
<< " se.id=" << se.id;
auto itMpa = m_structureElementId2AssetId.find(se.id);
if (itMpa == m_structureElementId2AssetId.end())
{
INFO_LOG(m_logger) << "Return m_structureElementId2AssetId.size()=" << m_structureElementId2AssetId.size();
@@ -428,12 +429,12 @@ void IsmHandler::handleEffectGenerationControlUnit(const InfrastructureManagemen
EgcuInfo egcu;
egcu.buildingName = bi.name;
egcu.mountPointName = QString::fromStdString(se.name());
egcu.mountPointId = se.mountingPointId();
egcu.hostname = QString::fromStdString(ia.hostname());
egcu.mountPointName = QString::fromStdString(se.name);
egcu.mountPointId = se.mountingPointId;
egcu.hostname = QString::fromStdString(ia.hostname);
egcu.assetId = assetId;
DEBUG_LOG(m_logger) << "Egcu.hostname=" << egcu.hostname;
INFO_LOG(m_logger) << "properties=" << ia.properties();
INFO_LOG(m_logger) << "properties=" << ia.properties;
bi.egcus.push_back(egcu);
@@ -470,38 +471,38 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << "mseOld.elements().size()=" << mseOld.elements().size()
<< " mseNew.elements().size()=" << mseNew.elements().size();
DEBUG_LOG(m_logger) << "mseOld.elements.size()=" << mseOld.elements.size()
<< " mseNew.elements.size()=" << mseNew.elements.size();
for (const InfrastructureManagement::StructureElement &se : mseNew.elements())
for (const InfrastructureManagement::StructureElement &se : mseNew.elements)
{
DEBUG_LOG(m_logger) << "se=" << se.id()
<< " name=" << se.name()
<< " displayName=" << se.displayName()
<< " properties=" << se.properties();
DEBUG_LOG(m_logger) << "se=" << se.id
<< " name=" << se.name
<< " displayName=" << se.displayName
<< " properties=" << se.properties;
for (const InfrastructureManagement::StructureElement &seOld : mseOld.elements())
for (const InfrastructureManagement::StructureElement &seOld : mseOld.elements)
{
DEBUG_LOG(m_logger) << "seOld.id=" << seOld.id()
<< " se.id=" << se.id();
if ( seOld.id() == se.id())
DEBUG_LOG(m_logger) << "seOld.id=" << seOld.id
<< " se.id=" << se.id;
if ( seOld.id == se.id)
{
DEBUG_LOG(m_logger) << "Properties =" << se.properties()
<< " se.id=" << se.id()
<< " se.name=" << se.name()
<< " mountingPointId=" << se.mountingPointId();
DEBUG_LOG(m_logger) << "se.properties()=" << se.properties()
<< " seOld.properties()=" << seOld.properties();
if (se.properties() != seOld.properties() )
DEBUG_LOG(m_logger) << "Properties =" << se.properties
<< " se.id=" << se.id
<< " se.name=" << se.name
<< " mountingPointId=" << se.mountingPointId;
DEBUG_LOG(m_logger) << "se.properties=" << se.properties
<< " seOld.properties=" << seOld.properties;
if (se.properties != seOld.properties )
{
DEBUG_LOG(m_logger) << "HandleOverrides"
"<< m_currentBuildingConfiguration.size=" << m_currentBuildingConfiguration.size();
if ( se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
if ( se.structureElementTypeId == InfrastructureManagement::StructureElementType::Building)
{
DEBUG_LOG(m_logger) << "BSM-Flash, no EGCU";
QByteArray properties = QByteArray::fromStdString(se.properties());
emit setEffectStates(mseNew.id(), 0, properties );
QByteArray properties = QByteArray::fromStdString(se.properties);
emit setEffectStates(mseNew.id, 0, properties );
continue;
}
for (auto it = m_currentBuildingConfiguration.begin(); it != m_currentBuildingConfiguration.end(); ++it)
@@ -517,15 +518,15 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem
<< " assetName=" << egcu.assetName
<< " hostname=" << egcu.hostname
<< " egcu.mountPointId=" << egcu.mountPointId
<< " se.mountingPointId()=" << se.mountingPointId();
if (egcu.mountPointId == se.mountingPointId())
<< " se.mountingPointId=" << se.mountingPointId;
if (egcu.mountPointId == se.mountingPointId)
{
QByteArray properties = QByteArray::fromStdString(se.properties());
QByteArray properties = QByteArray::fromStdString(se.properties);
DEBUG_LOG(m_logger) << "Send Json SetEffectStates to BuildingProcess"
<< " buildingId="
<< " assetId="<< egcu.assetId
<< " properties =" << properties;
emit setEffectStates(mseNew.id(), egcu.assetId, properties );
emit setEffectStates(mseNew.id, egcu.assetId, properties );
}
}
}
@@ -539,22 +540,22 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem
}
if (mseOld.elements().size() == 0)
if (mseOld.elements.size() == 0)
{
QByteArray properties = QByteArray::fromStdString(se.properties());
QByteArray properties = QByteArray::fromStdString(se.properties);
QByteArray overrides("Overrides");
if (properties.contains(overrides))
{
int assetId;
bool foundAssetId = m_dtcIsm->getAssetIdFromMountingPoint(se.id(), se.mountingPointId(), assetId);
bool foundAssetId = m_dtcIsm->getAssetIdFromMountingPoint(se.id, se.mountingPointId, assetId);
DEBUG_LOG(m_logger) << "Send Overrides to BuildingProcess (EGCU)"
<< " foundAssetId=" << foundAssetId
<< " structureElementId=" << mseNew.id()
<< " se.id=" << se.id()
<< " mountingPointId=" << se.mountingPointId()
<< " structureElementId=" << mseNew.id
<< " se.id=" << se.id
<< " mountingPointId=" << se.mountingPointId
<< " assetId=" << assetId;
emit setEffectStates(mseNew.id(), assetId, properties );
emit setEffectStates(mseNew.id, assetId, properties );
}
}
@@ -37,7 +37,7 @@ bool MainHandler::init(int domainId, int exerciseId)
DEBUG_LOG(m_logger) << "WebSocketInterfaceHandler initialized Port=" << m_webSocketHandler->listenPort();
m_ddsHandler->pacemaker()->addPort(m_webSocketHandler->listenPort(), Core::PortType::WebSocketServer);
m_ddsHandler->pacemaker()->addPort(m_webSocketHandler->listenPort(), Core::CorePortType::WebSocketServer);
if (bRet)
{
@@ -4,6 +4,7 @@
#include "pdm_handler.h"
#include "main_handler.h"
#include <ProjectDataManagement/pdm_dtc.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace Buildings
{
@@ -3,6 +3,7 @@
#include "ppm_handler.h"
#include "main_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace Buildings
{
@@ -47,7 +48,7 @@ ParticipantManagement::ParticipantPosition PpmHandler::participantPosition(int p
void PpmHandler::onEquipmentExerciseMappingChanged(const ParticipantManagement::EquipmentExerciseMapping &data, DataModification modType)
{
if (data.exerciseId() != m_mainHandler->exerciseId())
if (data.exerciseId != m_mainHandler->exerciseId())
return;
m_equipmentNumber2ParticipantId.clear();
@@ -55,8 +56,8 @@ void PpmHandler::onEquipmentExerciseMappingChanged(const ParticipantManagement::
{
case DataModification::eAdded:
case DataModification::eModified:
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping())
m_equipmentNumber2ParticipantId[e2p.equipmentNumber()] = e2p.participantId();
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping)
m_equipmentNumber2ParticipantId[e2p.equipmentNumber] = e2p.participantId;
break;
case DataModification::eRemoved:
break;
@@ -69,10 +70,10 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
{
case DataModification::eAdded:
case DataModification::eModified:
m_participantPositions[data.participantId()] = data;
m_participantPositions[data.participantId] = data;
break;
case DataModification::eRemoved:
m_participantPositions.remove(data.participantId());
m_participantPositions.remove(data.participantId);
break;
}
}
@@ -3,6 +3,7 @@
#pragma once
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <QtCore/QHash>
#include "logger.h"
@@ -10,6 +10,7 @@ RelayInfoHandler::RelayInfoHandler(MainHandler *mainHandler)
: QObject()
, Interface::Fts::SetRelayInfoRequestHandler(mainHandler->ddsHandler()->fts())
, m_mainHandler(mainHandler)
, m_logger(getLogger("RelayInfoHandler"))
{}
RelayInfoHandler::~RelayInfoHandler()
@@ -3,6 +3,7 @@
#pragma once
#include <ParticipantManagement/ppm.hpp>
#include <QtCore/QObject>
#include <QtCore/QHash>
#include "logger.h"
#include <bld_fts.h>
@@ -40,7 +40,7 @@ T fromJson(const QByteArray &json)
QJsonObject frequencyPlanningJson(QJsonObject obj, const QString &name, FrequencyBand freqBand, int radioStationId)
{
obj.insert(QStringLiteral("Name"), name);
obj.insert(QStringLiteral("FrequencyBand"), freqBand);
obj.insert(QStringLiteral("FrequencyBand"), static_cast<int>(freqBand));
obj.insert(QStringLiteral("RadioStationId"), radioStationId);
return obj;
}
@@ -59,8 +59,8 @@ bool RadioCircuitHF::isValid() const
QJsonObject RadioCircuitHF::toJson() const
{
QJsonObject obj;
obj.insert(QStringLiteral("ModulationType"), modulationType);
obj.insert(QStringLiteral("ChannelSpacing"), channelSpacing);
obj.insert(QStringLiteral("ModulationType"), static_cast<int>(modulationType));
obj.insert(QStringLiteral("ChannelSpacing"), static_cast<int>(channelSpacing));
obj.insert(QStringLiteral("Frequency"), frequency);
obj.insert(QStringLiteral("Squelch"), squelch);
@@ -94,8 +94,8 @@ bool RadioCircuitUHF::isValid() const
QJsonObject RadioCircuitUHF::toJson() const
{
QJsonObject obj;
obj.insert(QStringLiteral("ModulationType"), modulationType);
obj.insert(QStringLiteral("ChannelSpacing"), channelSpacing);
obj.insert(QStringLiteral("ModulationType"), static_cast<int>(modulationType));
obj.insert(QStringLiteral("ChannelSpacing"), static_cast<int>(channelSpacing));
obj.insert(QStringLiteral("Frequency"), frequency);
obj.insert(QStringLiteral("Squelch"), squelchDB);
obj.insert(QStringLiteral("Clipper"), clipper);
@@ -128,7 +128,7 @@ RadioCircuitUHF* RadioCircuitUHF::fromJson(const QJsonObject &obj)
QJsonObject RadioCircuitVHF::toJson() const
{
QJsonObject obj;
obj.insert(QStringLiteral("OperatingMode"), operatingMode);
obj.insert(QStringLiteral("OperatingMode"), static_cast<int>(operatingMode));
obj.insert(QStringLiteral("FrequencySetDataId"), freqSetDataId);
obj.insert(QStringLiteral("PilotTone"), pilotTone);
@@ -33,7 +33,7 @@ struct SVCCNRHELPER_EXPORT RadioCircuit
virtual ~RadioCircuit() = default;
QString name;
FrequencyBand freqBand {FrequencyBand::VHF_v};
FrequencyBand freqBand {FrequencyBand::VHF};
int radioStationId {0};
@@ -92,7 +92,7 @@ struct SVCCNRHELPER_EXPORT RadioCircuitUHF: public RadioCircuit
struct SVCCNRHELPER_EXPORT RadioCircuitVHF: public RadioCircuit
{
RcOperatingMode operatingMode {RcOperatingMode::FixedFreqEncNone_v};
RcOperatingMode operatingMode {RcOperatingMode::FixedFreqEncNone};
int freqSetDataId {0};
bool pilotTone {false};
@@ -44,19 +44,19 @@ void ActiveExercises::onExerciseChanged(const ExerciseManagement::Exercise &exer
break;
case DataModification::eRemoved:
tryDeactivate(exercise.id());
tryDeactivate(exercise.id);
break;
}
}
void ActiveExercises::check(const ExerciseManagement::Exercise &exercise)
{
Q_ASSERT(exercise.id() > 0);
Q_ASSERT(exercise.id > 0);
if (isActive(exercise.state()))
tryActivate(exercise.id());
if (isActive(exercise.state))
tryActivate(exercise.id);
else
tryDeactivate(exercise.id());
tryDeactivate(exercise.id);
}
void ActiveExercises::tryActivate(int exerciseId)
@@ -3,6 +3,7 @@
#include "config_cnr.h"
#include <utility>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "helper.h"
#include <AudioVideoManagement/avm_dtc.h>
#include <AudioVideoManagement/avm_translation.h>
@@ -53,22 +54,22 @@ void ConfigCnr::buildConfigCnrData()
return;
}
AudioVideoManagement::FrequencySet frequencySet = m_avmDtc->frequencySet(plan->frequencySetId());
AudioVideoManagement::FrequencySet frequencySet = m_avmDtc->frequencySet(plan->frequencySetId);
QMap<int, AudioVideoManagement::FrequencySetDataWithId> fsdMap;
for (const auto &fsd : std::as_const(frequencySet.data()))
fsdMap.insert(fsd.id(), fsd);
for (const auto &fsd : std::as_const(frequencySet.data))
fsdMap.insert(fsd.id, fsd);
configCnr.setId = plan->frequencySetId();
configCnr.time = QDateTime::fromMSecsSinceEpoch(plan->date()).toString(Qt::ISODate);
configCnr.radioCircuit.reserve(plan->data().size());
configCnr.setId = plan->frequencySetId;
configCnr.time = QDateTime::fromMSecsSinceEpoch(plan->date).toString(Qt::ISODate);
configCnr.radioCircuit.reserve(plan->data.size());
for (const auto &currentData : plan->data())
for (const auto &currentData : plan->data)
{
WebSocketInterface::Messages::ConfigCnrMessage::RadioCircuit radioCircuit;
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(currentData.cnrConfigId());
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId());
QVector<AudioVideoManagement::RadioCircuit*> circuits = AudioVideoManagement::fromJson(currentData.properties());
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(currentData.cnrConfigId);
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId);
QVector<AudioVideoManagement::RadioCircuit*> circuits = AudioVideoManagement::fromJson(currentData.properties);
int subCircuitCount = 0;
for (AudioVideoManagement::RadioCircuit* circuit : std::as_const(circuits))
@@ -78,9 +79,9 @@ void ConfigCnr::buildConfigCnrData()
WebSocketInterface::Messages::ConfigCnrMessage::SubRadioCircuit subCircuit;
switch (circuit->freqBand.underlying())
switch (circuit->freqBand)
{
case AudioVideoManagement::FrequencyBand_def::VHF:
case AudioVideoManagement::FrequencyBand::VHF:
{
AudioVideoManagement::RadioCircuitVHF *rcVhf = dynamic_cast<AudioVideoManagement::RadioCircuitVHF*>(circuit);
if (!rcVhf)
@@ -88,19 +89,19 @@ void ConfigCnr::buildConfigCnrData()
AudioVideoManagement::FrequencySetDataWithId &fsd = fsdMap[rcVhf->freqSetDataId];
subCircuit.agc = false;
subCircuit.akw = fsd.akwBundle().is_set() ? fsd.akwBundle().get() : 0;
subCircuit.akw = fsd.akwBundle.is_set() ? fsd.akwBundle.get() : 0;
subCircuit.channelSpacing = 0;
subCircuit.clipper = false;
subCircuit.comsec = fsd.comsec().is_set() ? fsd.comsec().get() : 0;
subCircuit.comsec = fsd.comsec.is_set() ? fsd.comsec.get() : 0;
subCircuit.crossbeam = 0;
subCircuit.frequency = fsd.frequency() * 1000;
subCircuit.frequencyBand = fsd.frequencyBand().underlying();
subCircuit.fsb = fsd.fsbBundle().is_set() ? fsd.fsbBundle().get() : 0;
subCircuit.frequency = fsd.frequency * 1000;
subCircuit.frequencyBand = static_cast<int>(fsd.frequencyBand);
subCircuit.fsb = fsd.fsbBundle.is_set() ? fsd.fsbBundle.get() : 0;
subCircuit.modulationType = 0;
subCircuit.orientation = 0;
subCircuit.ptSig = rcVhf->pilotTone;
subCircuit.rcAkw = fsd.akwRadioCircuit().is_set() ? fsd.akwRadioCircuit().get() : 0;
subCircuit.rcMode = rcVhf->operatingMode.underlying();
subCircuit.rcAkw = fsd.akwRadioCircuit.is_set() ? fsd.akwRadioCircuit.get() : 0;
subCircuit.rcMode = static_cast<int>(rcVhf->operatingMode);
subCircuit.rcSubId = toRcIdString(cnrChannel);
subCircuit.rcSubName = rcVhf->name;
subCircuit.rcType = 2;
@@ -109,7 +110,7 @@ void ConfigCnr::buildConfigCnrData()
break;
}
case AudioVideoManagement::FrequencyBand_def::UHF:
case AudioVideoManagement::FrequencyBand::UHF:
{
AudioVideoManagement::RadioCircuitUHF *rcUhf = dynamic_cast<AudioVideoManagement::RadioCircuitUHF*>(circuit);
if (!rcUhf)
@@ -117,14 +118,14 @@ void ConfigCnr::buildConfigCnrData()
subCircuit.agc = rcUhf->agc;
subCircuit.akw = 0;
subCircuit.channelSpacing = rcUhf->channelSpacing.underlying();
subCircuit.channelSpacing = static_cast<int>(rcUhf->channelSpacing);
subCircuit.clipper = rcUhf->clipper;
subCircuit.comsec = 0;
subCircuit.crossbeam = 0;
subCircuit.frequency = rcUhf->frequency;
subCircuit.frequencyBand = 0;
subCircuit.fsb = 0;
subCircuit.modulationType = rcUhf->modulationType.underlying();
subCircuit.modulationType = static_cast<int>(rcUhf->modulationType);
subCircuit.orientation = 0;
subCircuit.ptSig = 0;
subCircuit.rcAkw = 0;
@@ -136,7 +137,7 @@ void ConfigCnr::buildConfigCnrData()
subCircuit.station = stationId(radioStation);
break;
}
case AudioVideoManagement::FrequencyBand_def::HF:
case AudioVideoManagement::FrequencyBand::HF:
{
AudioVideoManagement::RadioCircuitHF *rcHf = dynamic_cast<AudioVideoManagement::RadioCircuitHF*>(circuit);
if (!rcHf)
@@ -144,14 +145,14 @@ void ConfigCnr::buildConfigCnrData()
subCircuit.agc = 0;
subCircuit.akw = 0;
subCircuit.channelSpacing = rcHf->channelSpacing.underlying();
subCircuit.channelSpacing = static_cast<int>(rcHf->channelSpacing);
subCircuit.clipper = 0;
subCircuit.comsec = 0;
subCircuit.crossbeam = 0;
subCircuit.frequency = rcHf->frequency;
subCircuit.frequencyBand = 0;
subCircuit.fsb = 0;
subCircuit.modulationType = rcHf->modulationType.underlying();
subCircuit.modulationType = static_cast<int>(rcHf->modulationType);
subCircuit.orientation = 0;
subCircuit.ptSig = 0;
subCircuit.rcAkw = 0;
@@ -173,8 +174,8 @@ void ConfigCnr::buildConfigCnrData()
qDeleteAll(circuits);
radioCircuit.rcId = toRcIdString(cnrChannel);
radioCircuit.rcName = QString::fromStdString(cnrConfig.radioCircuit());
radioCircuit.ssrc = cnrChannel.ssrc();
radioCircuit.rcName = QString::fromStdString(cnrConfig.radioCircuit);
radioCircuit.ssrc = cnrChannel.ssrc;
configCnr.radioCircuit.append(radioCircuit);
}
@@ -188,10 +189,10 @@ boost::optional<AudioVideoManagement::FrequencyPlanning> ConfigCnr::activePlan()
{
AudioVideoManagement::ActiveFrequencyPlanning activePlanning = m_avmDtc->activeFrequencyPlanning(m_exerciseId);
if (activePlanning.exerciseId() != m_exerciseId)
if (activePlanning.exerciseId != m_exerciseId)
return boost::none;
AudioVideoManagement::FrequencyPlanning frequencyPlanning = m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId());
AudioVideoManagement::FrequencyPlanning frequencyPlanning = m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId);
return frequencyPlanning;
}
@@ -201,7 +202,7 @@ void ConfigCnr::onActiveFrequencyPlanningChanged(const AudioVideoManagement::Act
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data;
Q_UNUSED(modType);
if (data.exerciseId() == m_exerciseId)
if (data.exerciseId == m_exerciseId)
m_timer.start();
}
@@ -215,7 +216,7 @@ void ConfigCnr::onFrequencyPlanningChanged(const AudioVideoManagement::Frequency
if (!plan)
return;
if (data.id() == plan->id() || !data.exerciseId().is_set())
if (data.id == plan->id || !data.exerciseId.is_set())
m_timer.start();
}
@@ -225,8 +226,8 @@ void ConfigCnr::onCnrConfigChanged(const AudioVideoManagement::CnrConfig &data,
DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data;
Q_UNUSED(modType);
bool isGlobal = !data.exerciseId().is_set();
if ((isGlobal || data.exerciseId().get() == m_exerciseId) && modType != DataModification::eAdded && isInActiveFrequencyPlanning(data))
bool isGlobal = !data.exerciseId.is_set();
if ((isGlobal || data.exerciseId.get() == m_exerciseId) && modType != DataModification::eAdded && isInActiveFrequencyPlanning(data))
m_timer.start();
}
@@ -234,17 +235,17 @@ void ConfigCnr::onCnrConfigChanged(const AudioVideoManagement::CnrConfig &data,
bool ConfigCnr::isInActiveFrequencyPlanning(const AudioVideoManagement::CnrConfig &data)
{
if(!data.exerciseId().is_set())
if(!data.exerciseId.is_set())
return true;
const auto activePlans = m_avmDtc->activeFrequencyPlannings();
for (const AudioVideoManagement::ActiveFrequencyPlanning &activePlan : activePlans)
{
const auto frequencyPlannings = m_avmDtc->frequencyPlanning(activePlan.frequencyPlanningId());
for(const auto &frequencyPlanningData : frequencyPlannings.data())
const auto frequencyPlannings = m_avmDtc->frequencyPlanning(activePlan.frequencyPlanningId);
for(const auto &frequencyPlanningData : frequencyPlannings.data)
{
if(frequencyPlanningData.cnrConfigId() == data.id())
if(frequencyPlanningData.cnrConfigId == data.id)
return true;
}
}
@@ -3,6 +3,7 @@
#include "dds_handler_exercise.h"
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <DDS/DDSConnector/dds_connector.h>
#include <QtGlobal>
@@ -65,7 +65,8 @@ public:
ExerciseManager::ExerciseManager(ActiveExercises *activeExercises, DdsHandler *ddsHandler)
: m_activeExercises(activeExercises)
: m_logger(getLogger("ExerciseManager"))
, m_activeExercises(activeExercises)
, m_ddsHandler(ddsHandler)
{
Q_ASSERT(activeExercises);
@@ -216,15 +217,15 @@ void ExerciseManager::stopPositionsUpdate()
void ExerciseManager::onNewClientConnection(qint64 id)
{
AudioVideoManagement::ModifyFrequencyPlanningStatusRequest request;
request.client(id);
request.isActive(true);
request.client = id;
request.isActive = true;
m_ddsHandler->avmFtc()->modifyFrequencyPlanningStatusRequest(request, this);
}
void ExerciseManager::onClientConnectionClosed(qint64 id)
{
AudioVideoManagement::RemoveFrequencyPlanningStatusByClientRequest request;
request.client(id);
request.client = id;
m_ddsHandler->avmFtc()->removeFrequencyPlanningStatusByClientRequest(request, this);
}
@@ -237,33 +238,33 @@ void ExerciseManager::onClearFrequencyPlanningStatus()
void ExerciseManager::onConfigCnrSent(qint64 id, const QString &uuid, const QString &requester, bool isActiveClient)
{
AudioVideoManagement::ModifyFrequencyPlanningStatusRequest request;
request.client(id);
request.uuid(uuid.toStdString());
request.sent(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
request.requester(requester.toStdString());
request.isActive(isActiveClient);
request.client = id;
request.uuid = uuid.toStdString();
request.sent = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
request.requester = requester.toStdString();
request.isActive = isActiveClient;
m_ddsHandler->avmFtc()->modifyFrequencyPlanningStatusRequest(request, this);
}
void ExerciseManager::onConfigCnrReceived(qint64 id, const QString &uuid)
{
AudioVideoManagement::ModifyFrequencyPlanningStatusRequest request;
request.client(id);
request.uuid(uuid.toStdString());
request.received(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
request.client = id;
request.uuid = uuid.toStdString();
request.received = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
m_ddsHandler->avmFtc()->modifyFrequencyPlanningStatusRequest(request, this);
}
void ExerciseManager::onConfigCnrProcessed(qint64 id, const QString &uuid, const QJsonObject &configCnrData)
{
AudioVideoManagement::ModifyFrequencyPlanningStatusRequest request;
request.client(id);
request.uuid(uuid.toStdString());
request.activated(QDateTime::currentDateTimeUtc().toMSecsSinceEpoch());
request.content(QJsonDocument(configCnrData).toJson().toStdString());
request.requester(QJsonDocument(configCnrData).object()[QStringLiteral("requester")].toString().toStdString());
request.reason(static_cast<AudioVideoManagement::TransmissionReason::inner_enum>(QJsonDocument(configCnrData).object()[QStringLiteral("reason")].toInt(0)));
request.isActive(true);
request.client = id;
request.uuid = uuid.toStdString();
request.activated = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
request.content = QJsonDocument(configCnrData).toJson().toStdString();
request.requester = QJsonDocument(configCnrData).object()[QStringLiteral("requester")].toString().toStdString();
request.reason = static_cast<AudioVideoManagement::TransmissionReason>(QJsonDocument(configCnrData).object()[QStringLiteral("reason")].toInt(0));
request.isActive = true;
m_ddsHandler->avmFtc()->modifyFrequencyPlanningStatusRequest(request, this);
}
@@ -291,7 +292,7 @@ void ExerciseManager::onExerciseActivated(int exerciseId)
if (isFirstActiveExercise)
{
ExerciseManagement::Exercise exercise = m_ddsHandler->exmDtc()->exercise(exerciseId);
m_trainingArea.reset(new TrainingArea(exercise.trainingAreaId(), m_ddsHandler->asmDtc(), m_ddsHandler->ismDtc()));
m_trainingArea.reset(new TrainingArea(exercise.trainingAreaId, m_ddsHandler->asmDtc(), m_ddsHandler->ismDtc()));
}
emit essentialsUpdate();
@@ -13,12 +13,12 @@ namespace CombatNetRadio
int stationId(const InfrastructureManagement::MainStructureElement &radioStation)
{
return LtsUtils::JsonObject::fromJson(radioStation.properties()).valueOr<int>("stationId", 0);
return LtsUtils::JsonObject::fromJson(radioStation.properties).valueOr<int>("stationId", 0);
}
QString toRcIdString(const AudioVideoManagement::CnrChannel &cnrChannel)
{
QString result = QString::fromStdString(cnrChannel.name());
QString result = QString::fromStdString(cnrChannel.name);
result.remove(1, 2);
return result;
}
@@ -7,6 +7,7 @@
#include "helper.h"
#include <AudioVideoManagement/avm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <LtsUtils/LtsUtilsCore/outdated_position.h>
#include <QtGlobal>
#include <QtCore/QDateTime>
@@ -22,13 +23,13 @@ QSet<int> participantIdsFromParty(const QMap<int32_t, ParticipantManagement::Par
{
ret.reserve(participants.size());
for (const auto &p : participants)
ret += p.id();
ret += p.id;
}
else
{
for (const auto &participant : participants)
if (participant.partyId() == partyId)
ret += participant.id();
if (participant.partyId == partyId)
ret += participant.id;
}
return ret;
}
@@ -61,10 +62,10 @@ WebSocketInterface::Messages::PositionsCnrMessage::PositionsCnrMessageData Posit
if (!plan)
return positionsData;
for (const auto &entry : plan->data())
for (const auto &entry : plan->data)
{
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(entry.cnrConfigId());
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId());
AudioVideoManagement::CnrConfig cnrConfig = m_avmDtc->cnrConfig(entry.cnrConfigId);
AudioVideoManagement::CnrChannel cnrChannel = m_avmDtc->cnrChannel(cnrConfig.cnrChannelId);
positionsData.radioCircuit.push_back({toRcIdString(cnrChannel), positionsFor(cnrConfig)});
}
@@ -74,14 +75,14 @@ WebSocketInterface::Messages::PositionsCnrMessage::PositionsCnrMessageData Posit
QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::positionsForGlobal(const AudioVideoManagement::CnrConfig &config) const
{
bool isGlobal = !config.exerciseId().is_set();
bool isGlobal = !config.exerciseId.is_set();
Q_ASSERT(isGlobal);
return positionsForLocal(config);
}
QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::positionsFor(const AudioVideoManagement::CnrConfig &config) const
{
bool isLocal = config.exerciseId().is_set();
bool isLocal = config.exerciseId.is_set();
if (isLocal)
return positionsForLocal(config);
else
@@ -95,12 +96,12 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
auto allParticipants = m_ppmDtc->participants();
QSet<int> participantIdsInUnit;
if (config.unitId().is_set())
m_ppmDtc->participantIdsByUnit(config.unitId().get(), allParticipants, participantIdsInUnit);
if (config.unitId.is_set())
m_ppmDtc->participantIdsByUnit(config.unitId.get(), allParticipants, participantIdsInUnit);
else
{
bool isGlobal = !config.exerciseId().is_set();
participantIdsInUnit = participantIdsFromParty(allParticipants, config.partyId(), isGlobal);
bool isGlobal = !config.exerciseId.is_set();
participantIdsInUnit = participantIdsFromParty(allParticipants, config.partyId, isGlobal);
}
const qint64 now = QDateTime::currentMSecsSinceEpoch();
@@ -109,21 +110,24 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
for (int participantId : std::as_const(participantIdsInUnit))
{
const ParticipantManagement::Participant &participant = allParticipants.value(participantId);
if (!participant.equipmentNumber().is_set())
if (!participant.equipmentNumber.is_set())
continue;
const ParticipantManagement::Type &type = m_ppmDtc->type(participant.typeId());
if (type.radioCount() < 1)
continue;
const ParticipantManagement::Type &type = m_ppmDtc->type(participant.typeId);
if (type.radioCount < 1)
continue;
const auto &pos = m_ppmDtc->participantPosition(participantId);
if (pos.participantId() != participantId)
continue;
if (pos.participantId != participantId)
continue;
if (LtsUtils::isPositionTimeOutdated(now, pos.sampleTime()))
continue;
if (LtsUtils::isPositionTimeOutdated(now, pos.sampleTime))
continue;
positions.push_back({toDeg(pos.pos().lon()), toDeg(pos.pos().lat())});
WebSocketInterface::Messages::ReplyMessage::LonLatPoint point;
point.lon = toDeg(pos.pos.lon);
point.lat = toDeg(pos.pos.lat);
positions.push_back(point);
}
return positions;
@@ -132,9 +136,9 @@ QVector<WebSocketInterface::Messages::ReplyMessage::LonLatPoint> PositionsCnr::p
boost::optional<AudioVideoManagement::FrequencyPlanning> PositionsCnr::activePlan() const
{
AudioVideoManagement::ActiveFrequencyPlanning activePlanning = m_avmDtc->activeFrequencyPlanning(m_exerciseId);
if (activePlanning.exerciseId() != m_exerciseId)
if (activePlanning.exerciseId != m_exerciseId)
return boost::none;
return m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId());
return m_avmDtc->frequencyPlanning(activePlanning.frequencyPlanningId);
}
}
@@ -29,7 +29,7 @@ void TrainingArea::getTrainingArea(int trainingAreaId, AssetManagement::Interfac
{
AssetManagement::TrainingArea ddsTrainingArea = asmDtc->trainingArea(trainingAreaId);
m_trainingAreaData.designation = QString::fromStdString(ddsTrainingArea.name());
m_trainingAreaData.designation = QString::fromStdString(ddsTrainingArea.name);
m_trainingAreaData.id = trainingAreaId;
m_trainingAreaData.refPoint.lat = -1.;
m_trainingAreaData.refPoint.lon = -1.;
@@ -37,25 +37,25 @@ void TrainingArea::getTrainingArea(int trainingAreaId, AssetManagement::Interfac
WebSocketInterface::Messages::ReplyMessage::LonLatPoint point;
LtsCoordTrans::UtmCoordinate utmCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(ddsTrainingArea.bottomLeft().lon(), ddsTrainingArea.bottomLeft().lat());
point.lat = toDeg(ddsTrainingArea.bottomLeft().lat());
point.lon = toDeg(ddsTrainingArea.bottomLeft().lon());
LtsCoordTrans::UtmCoordinate utmCoordinate = LtsCoordTrans::UtmCoordinate::fromGeographic(ddsTrainingArea.bottomLeft.lon, ddsTrainingArea.bottomLeft.lat);
point.lat = toDeg(ddsTrainingArea.bottomLeft.lat);
point.lon = toDeg(ddsTrainingArea.bottomLeft.lon);
m_trainingAreaData.path << point;
QPointF coord = utmCoordinate.geographic(ddsTrainingArea.width());
QPointF coord = utmCoordinate.geographic(ddsTrainingArea.width);
point.lon = toDeg(coord.x());
point.lat = toDeg(coord.y());
m_trainingAreaData.path << point;
coord = utmCoordinate.geographic(ddsTrainingArea.width(), ddsTrainingArea.height());
coord = utmCoordinate.geographic(ddsTrainingArea.width, ddsTrainingArea.height);
point.lon = toDeg(coord.x());
point.lat = toDeg(coord.y());
m_trainingAreaData.path << point;
coord = utmCoordinate.geographic(0, ddsTrainingArea.height());
coord = utmCoordinate.geographic(0, ddsTrainingArea.height);
point.lon = toDeg(coord.x());
point.lat = toDeg(coord.y());
m_trainingAreaData.path << point;
@@ -65,7 +65,7 @@ void TrainingArea::getRadioStations(InfrastructureManagement::Interface::Dtc *is
{
auto cb = [this](const InfrastructureManagement::MainStructureElement &mse)
{
if (mse.structureElementTypeId() != InfrastructureManagement::StructureElementType::RadioStation || mse.isDeleted())
if (mse.structureElementTypeId != InfrastructureManagement::StructureElementType::RadioStation || mse.isDeleted)
return;
WebSocketInterface::Messages::RadioStationMessage::RadioStationData data;
@@ -73,13 +73,13 @@ void TrainingArea::getRadioStations(InfrastructureManagement::Interface::Dtc *is
if (data.id == 0)
{
WARNING_LOG(m_logger) << "Got MainStructureElement of type 'RadioStation' but property 'stationId' was not set"
<< " - database id: " << mse.id() << " - ignoring!";
<< " - database id: " << mse.id << " - ignoring!";
return;
}
data.geoPoint.lon = toDeg(mse.geoPosition().lon());
data.geoPoint.lat = toDeg(mse.geoPosition().lat());
data.geoPoint.lon = toDeg(mse.geoPosition.lon);
data.geoPoint.lat = toDeg(mse.geoPosition.lat);
data.trainingAreaId = m_trainingAreaData.id;
data.designation = QString::fromStdString(mse.name());
data.designation = QString::fromStdString(mse.name);
m_radioStations.push_back(data);
};
@@ -6,6 +6,7 @@
#include <QtCore/QTimer>
#include <QtNetwork/QHostAddress>
#include <QtCore/QDateTime>
#include <NGLLogger/NGLLoggerBootstrap.h>
@@ -50,7 +51,7 @@ bool CheckmkHandler::initialize(const QString &checkMkServerHostname, int checkM
}
connect(m_socket, &QTcpSocket::stateChanged, this, &CheckmkHandler::onStateChanged);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error),
connect(m_socket, qOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error),
this, &CheckmkHandler::onSocketError);
connect(m_socket, &QTcpSocket::connected,
@@ -7,6 +7,7 @@
#include <QtCore/QTimer>
#include <QtNetwork/QHostAddress>
#include <QtCore/QDateTime>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace ComponentMonitor
{
@@ -14,6 +15,7 @@ namespace ComponentMonitor
CheckmkHandlerScheduleCheck::CheckmkHandlerScheduleCheck(const std::shared_ptr<DdsHandler> &ddsHandler)
: QObject()
, TriggerUpdateRequestHandler(ddsHandler->fts())
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_socket(new QTcpSocket(this))
, m_ddsHandler(ddsHandler)
{
@@ -49,7 +51,7 @@ bool CheckmkHandlerScheduleCheck::initialize(const QString &checkMkServerHostnam
}
connect(m_socket, &QTcpSocket::stateChanged, this, &CheckmkHandlerScheduleCheck::onStateChanged);
connect(m_socket, QOverload<QAbstractSocket::SocketError>::of(&QAbstractSocket::error),
connect(m_socket, qOverload<QAbstractSocket::SocketError>(&QAbstractSocket::error),
this, &CheckmkHandlerScheduleCheck::onSocketError);
connect(m_socket, &QTcpSocket::connected,
@@ -192,7 +194,7 @@ void CheckmkHandlerScheduleCheck::onTriggerUpdateRequest(const rti::core::Sample
const std::vector< std::string >& hostnames = request.hostnames();
const std::vector< std::string >& hostnames = request.hostnames;
QStringList sl;
sl.reserve(hostnames.size());
@@ -6,6 +6,7 @@
#include "dds_handler.h"
#include <ComponentMonitor/cmo.hpp>
#include <ComponentMonitor/cmo_dts.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QTimer>
@@ -75,7 +76,7 @@ std::vector<std::string> ComponentStatusHandler::getHostnames() const
ret.reserve(m_statusMap.size());
for (CONST_ITERATOR_T it = m_statusMap.cbegin(); it != m_statusMap.cend(); ++it)
ret.push_back(it->hostname());
ret.push_back(it->hostname);
return ret;
}
@@ -83,28 +84,28 @@ std::vector<std::string> ComponentStatusHandler::getHostnames() const
void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &iAsset,
DataModification dataMod)
{
const InfrastructureManagement::MountingPointType_def::type mpType = iAsset.mountingPointTypeId().underlying();
if ((mpType != InfrastructureManagement::MountingPointType_def::IndoorCamera) &&
(mpType != InfrastructureManagement::MountingPointType_def::OutdoorCamera) &&
(mpType != InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit) &&
(mpType != InfrastructureManagement::MountingPointType_def::BuildingSensorModule)
const InfrastructureManagement::MountingPointType mpType = static_cast<InfrastructureManagement::MountingPointType>(iAsset.mountingPointTypeId);
if ((mpType != InfrastructureManagement::MountingPointType::IndoorCamera) &&
(mpType != InfrastructureManagement::MountingPointType::OutdoorCamera) &&
(mpType != InfrastructureManagement::MountingPointType::EffectGenerationControlUnit) &&
(mpType != InfrastructureManagement::MountingPointType::BuildingSensorModule)
)
return;
static int assetChangedCounter = 0;
const int iAssetId = iAsset.id();
const int iAssetId = iAsset.id;
DEBUG_LOG(m_logger) << Q_FUNC_INFO
<< ", iAssetId=" << iAssetId
<< " (assetChangedCounter=" << ++assetChangedCounter << ")";
const bool bIsMounted = iAsset.assetStateId() == InfrastructureManagement::InstrumentationAssetState_def::Mounted;
const bool bIsMounted = iAsset.assetStateId == InfrastructureManagement::InstrumentationAssetState::Mounted;
if (!bIsMounted)
dataMod = DataModification::eRemoved;
const bool bNoHostname = iAsset.hostname().empty();
const bool bNoHostname = iAsset.hostname.empty();
if (bNoHostname)
dataMod = DataModification::eRemoved;
@@ -116,9 +117,9 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM
case DataModification::eModified:
{
ComponentStatus cs;
cs.id(iAssetId);
cs.hostname(iAsset.hostname());
cs.state(ComponentMonitor::ComponentState::Undefined);
cs.id = iAssetId;
cs.hostname = iAsset.hostname;
cs.state = ComponentMonitor::ComponentState::Undefined;
addUpdateInstrumentationAsset(it, cs);
}
@@ -150,9 +151,9 @@ void ComponentStatusHandler::dump()
DEBUG_LOG(m_logger) << " REACHABLE:";
for (const ComponentStatus &status : std::as_const(m_statusMap))
{
if (status.state().underlying() == ComponentState_def::Reachable)
if (status.state == ComponentState::Reachable)
{
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable";
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Reachable";
++counter;
}
}
@@ -164,9 +165,9 @@ void ComponentStatusHandler::dump()
DEBUG_LOG(m_logger) << " UNREACHABLE:";
for (const ComponentStatus &status : std::as_const(m_statusMap))
{
if (status.state().underlying() == ComponentState_def::Unreachable)
if (status.state == ComponentState::Unreachable)
{
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable";
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Unreachable";
++counter;
}
}
@@ -178,9 +179,9 @@ void ComponentStatusHandler::dump()
DEBUG_LOG(m_logger) << " UNDEFINED:";
for (const ComponentStatus &status : std::as_const(m_statusMap))
{
if (status.state().underlying() == ComponentState_def::Undefined)
if (status.state == ComponentState::Undefined)
{
DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined";
DEBUG_LOG(m_logger) << " id=" << status.id << ", host '" << status.hostname.c_str() << " -> Undefined";
++counter;
}
}
@@ -202,14 +203,14 @@ void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable,
for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it)
{
const QString hname = QString::fromStdString(it->hostname());
const QString hname = QString::fromStdString(it->hostname);
if (hname.compare(hostname, Qt::CaseInsensitive) == 0)
{
ComponentState_def::type newStateInner = reachable ? ComponentState_def::Reachable : ComponentState_def::Unreachable;
ComponentState newStateInner = reachable ? ComponentState::Reachable : ComponentState::Unreachable;
ComponentStatus newCs = (*it);
newCs.state(newStateInner);
newCs.last_check(lastCheckSec);
newCs.state = newStateInner;
newCs.last_check = lastCheckSec;
addUpdateInstrumentationAsset(it, newCs);
}
@@ -223,23 +224,23 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host
for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it)
{
ComponentStatus &cs = *it;
const QString &curHostname = QString::fromStdString(cs.hostname());
const QString &curHostname = QString::fromStdString(cs.hostname);
if (!hostnamesForUpdateLastCheckTime.contains(curHostname, Qt::CaseInsensitive))
continue;
if (lastCheckSec <= cs.last_check())
if (lastCheckSec <= cs.last_check)
continue;
const ComponentState_def::type curState = cs.state().underlying();
if ((curState == ComponentState_def::Reachable) ||
(curState == ComponentState_def::Unreachable))
const ComponentState curState = cs.state;
if ((curState == ComponentState::Reachable) ||
(curState == ComponentState::Unreachable))
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updateLastCheckTimeDirect"
<< " host: '" << curHostname << "'"
<< " newLastCheck= " << lastCheckSec;
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it);
cs.last_check(lastCheckSec);
cs.last_check = lastCheckSec;
INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it);
m_ddsHandler->dts()->publish(cs);
}
@@ -251,7 +252,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START add/Update: cs=" << cs
<< ", curSize=" << m_statusMap.size() << ")";
const int id = cs.id();
const int id = cs.id;
if (it != m_statusMap.end())
{
@@ -280,7 +281,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle
bool ComponentStatusHandler::removeInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it)
{
const int id = it.value().id();
const int id = it.value().id;
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " remove: id=" << id;
m_statusMap.remove(id);
m_ddsHandler->dts()->removeComponentStatusByKey(id);
@@ -161,17 +161,17 @@ void HandlerNasatAircraftParticipant::participantRemoved(int exerciseId, int par
}
}
bool isExerciseStateValid(ExerciseManagement::ExerciseState::type state)
bool isExerciseStateValid(ExerciseManagement::ExerciseState state)
{
switch (state)
{
case ExerciseManagement::ExerciseState_def::Created:
case ExerciseManagement::ExerciseState_def::Paused:
case ExerciseManagement::ExerciseState_def::Started:
case ExerciseManagement::ExerciseState_def::Stopped:
case ExerciseManagement::ExerciseState::Created:
case ExerciseManagement::ExerciseState::Paused:
case ExerciseManagement::ExerciseState::Started:
case ExerciseManagement::ExerciseState::Stopped:
return true;
case ExerciseManagement::ExerciseState_def::Unknown:
case ExerciseManagement::ExerciseState_def::Terminated:
case ExerciseManagement::ExerciseState::Unknown:
case ExerciseManagement::ExerciseState::Terminated:
return false;
}
return false;
@@ -137,7 +137,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
ecReq.effectStart = impactTimeMsec > tNow ? impactTimeMsec : tNow;
ecReq.name = QStringLiteral("NASAT_%1_%2_%3").arg(nasatId).arg(munitionCode).arg(dtNow.toString(QStringLiteral("dd hh:mm:ss"))).toStdString();
ecReq.element = ecReq.name;
ecReq.impactPosition(Core::GeoPosition2D(pos.lon, pos.lat));
ecReq.impactPosition = Core::GeoPosition2D(pos.lon, pos.lat);
ecReq.chargeTypeId = chargeTypeIdVal;
@@ -166,7 +166,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
ecCommonModifyRequest.chargeStruct.chargeTypeId = chargeTypeIdVal;
ecCommonModifyRequest.chargeStruct.igniterTypeId = fuseTypeToPdmIgniterType(fuseType);
ecCommonModifyRequest.area.cornerBottomLeft(Core::GeoPosition2D(pos.lon, pos.lat));
ecCommonModifyRequest.area.cornerBottomLeft = Core::GeoPosition2D(pos.lon, pos.lat);
ecCommonModifyRequest.name = QStringLiteral("NASAT_%1_%2_%3").arg(nasatId).arg(munitionCode).arg(dtNow.toString(QStringLiteral("dd hh:mm:ss"))).toStdString();
ecCommonModifyRequest.element = ecReq.name;
@@ -30,16 +30,16 @@ ProjectDataManagement::VulnerabilityState DamageModel::vulnerabilityStateFromDam
switch(status)
{
case rpr2::DamageStatusEnum32::NoDamage:
vs = ProjectDataManagement::VulnerabilityState_def::CombatReady;
vs = ProjectDataManagement::VulnerabilityState::CombatReady;
break;
case rpr2::DamageStatusEnum32::SlightDamage:
vs = ProjectDataManagement::VulnerabilityState_def::LightDamage;
vs = ProjectDataManagement::VulnerabilityState::LightDamage;
break;
case rpr2::DamageStatusEnum32::ModerateDamage:
vs = ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
vs = ProjectDataManagement::VulnerabilityState::HeavyDamage;
break;
case rpr2::DamageStatusEnum32::Destroyed:
vs = ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
vs = ProjectDataManagement::VulnerabilityState::CatastrophicKill;
break;
}
@@ -63,31 +63,31 @@ rpr2::DamageStatusEnum32::ET DamageModel::damageState(qint64 simTimeMSec) const
switch (m_vulnerabilityStates.at(idx).vulnerabilityState.underlying())
{
case ProjectDataManagement::VulnerabilityState_def::CombatReady:
case ProjectDataManagement::VulnerabilityState::CombatReady:
return rpr2::DamageStatusEnum32::NoDamage;
case ProjectDataManagement::VulnerabilityState_def::LightDamage:
case ProjectDataManagement::VulnerabilityState::LightDamage:
return rpr2::DamageStatusEnum32::SlightDamage;
case ProjectDataManagement::VulnerabilityState_def::MediumDamage:
case ProjectDataManagement::VulnerabilityState_def::HeavyDamage:
case ProjectDataManagement::VulnerabilityState_def::MobilityKill:
case ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill:
case ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::MediumDamage:
case ProjectDataManagement::VulnerabilityState::HeavyDamage:
case ProjectDataManagement::VulnerabilityState::MobilityKill:
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill:
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage:
return rpr2::DamageStatusEnum32::ModerateDamage;
case ProjectDataManagement::VulnerabilityState_def::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
return rpr2::DamageStatusEnum32::Destroyed;
case ProjectDataManagement::VulnerabilityState_def::TemporarySeverance:
case ProjectDataManagement::VulnerabilityState_def::NearMiss:
case ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect:
case ProjectDataManagement::VulnerabilityState::TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::NearMiss:
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect:
return rpr2::DamageStatusEnum32::NoDamage;
case ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged:
case ProjectDataManagement::VulnerabilityState_def::Reserved:
case ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged:
case ProjectDataManagement::VulnerabilityState::Reserved:
return rpr2::DamageStatusEnum32::NoDamage;
case ProjectDataManagement::VulnerabilityState_def::NContamination:
case ProjectDataManagement::VulnerabilityState_def::BContamination:
case ProjectDataManagement::VulnerabilityState_def::CContamination:
case ProjectDataManagement::VulnerabilityState::NContamination:
case ProjectDataManagement::VulnerabilityState::BContamination:
case ProjectDataManagement::VulnerabilityState::CContamination:
return rpr2::DamageStatusEnum32::SlightDamage;
case ProjectDataManagement::VulnerabilityState_def::NotReady:
case ProjectDataManagement::VulnerabilityState::NotReady:
return rpr2::DamageStatusEnum32::NoDamage;
}
return rpr2::DamageStatusEnum32::NoDamage;
@@ -98,9 +98,9 @@ bool DamageModel::immobilized(qint64 simTimeMSec) const
int idx = indexForTime(simTimeMSec);
if (idx < 0)
return false;
if (m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::MobilityKill ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::MobilityKill ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::VisibleMobilityKill ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
return true;
return false;
}
@@ -110,9 +110,9 @@ bool DamageModel::firePowerDisabled(qint64 simTimeMSec) const
int idx = indexForTime(simTimeMSec);
if (idx < 0)
return false;
if (m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)
if (m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::WeaponSystemDamage ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage ||
m_vulnerabilityStates.at(idx).vulnerabilityState == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
return true;
return false;
}
@@ -149,7 +149,7 @@ ProjectDataManagement::VulnerabilityState DamageModel::vulnerabilityState(qint64
{
int idx = indexForTime(simTimeMSec);
if (idx < 0)
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
return m_vulnerabilityStates.at(idx).vulnerabilityState;
}
@@ -26,7 +26,7 @@ public:
explicit DamageModel(const ProjectDataManagement::VulnerabilityState &state);
explicit DamageModel(const IdentifierStruct &is, const rpr2::DamageStatusEnum32::ET &status);
explicit DamageModel(const IdentifierStruct &is)
: DamageModel(is, ProjectDataManagement::VulnerabilityState_def::CombatReady)
: DamageModel(is, ProjectDataManagement::VulnerabilityState::CombatReady)
{}
const IdentifierStruct &identifierStruct() const { return m_is; }
@@ -986,10 +986,10 @@ void NgsConnector::onBaseEntityEntityIdentifierChanged(const rpr2::EntityIdentif
GuezHitStruct hs;
hs.originatorType = ProjectDataManagement::StateChangeOriginator_def::Initialization;
hs.originatorType = ProjectDataManagement::StateChangeOriginator::Initialization;
hs.sampleTime = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
hs.targetId = is.entityNumber();
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
QTimer::singleShot(STATUS_WAIT_INTERVAL, this, [this, hs, obj, simTimeMSecs]() mutable
{
@@ -1048,10 +1048,10 @@ void NgsConnector::onEmbeddedSystemEntityIdentifierChanged(const rpr2::EntityIde
GuezHitStruct hs;
hs.originatorType = ProjectDataManagement::StateChangeOriginator_def::Initialization;
hs.originatorType = ProjectDataManagement::StateChangeOriginator::Initialization;
hs.sampleTime = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
hs.targetId = is.entityNumber();
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
QTimer::singleShot(STATUS_WAIT_INTERVAL, this, [this, hs, obj, simTimeMSecs]() mutable
{
@@ -1149,11 +1149,11 @@ bool NgsConnector::onDamageStateChanged(const rpr2::EntityIdentifierStruct &eis,
GuezHitStruct hitStruct;
hitStruct.originatorChargeTypeEtsString = TypeStruct::fromDisInt(0).toString();
hitStruct.originatorId = 0;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
hitStruct.position = m_observerPositions[is.entityNumber()].toGeoPosition();
hitStruct.sampleTime = simTimeMSecs;
hitStruct.targetId = is.entityNumber();
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
hitStruct.vulnerabilityKind = 0;
@@ -1303,7 +1303,7 @@ void NgsConnector::onNewEngagementReply(const rpr2::IObserverEngagementReplyIntI
ParticipantPosition pPos = interaction.isValidDetonationLocation() ? ParticipantPosition(interaction.getDetonationLocation()) : m_observerPositions.value(receiver);
TrainingAreaBase::TabPosition tPos;
tPos.position(pPos.toGeoPosition());
tPos.reportingSource(Core::PositionReportingSource_def::External);
tPos.reportingSource(Core::PositionReportingSource::External);
TrainingAreaBase::EquipmentState state;
@@ -1317,7 +1317,7 @@ void NgsConnector::onNewEngagementReply(const rpr2::IObserverEngagementReplyIntI
if (sender > 0)
{
state.originatorId(sender);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::Participant);
state.originatorType(ProjectDataManagement::StateChangeOriginator::Participant);
}
else
{
@@ -1326,28 +1326,28 @@ void NgsConnector::onNewEngagementReply(const rpr2::IObserverEngagementReplyIntI
if (source == QLatin1String("excon"))
{
state.originatorId(0);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ExerciseControl);
state.originatorType(ProjectDataManagement::StateChangeOriginator::ExerciseControl);
}
else if (source == QLatin1String("cis"))
{
state.originatorId(1);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ExerciseControl);
state.originatorType(ProjectDataManagement::StateChangeOriginator::ExerciseControl);
}
else if (source == QLatin1String("greenkey"))
{
state.originatorId(0);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ObserverController);
state.originatorType(ProjectDataManagement::StateChangeOriginator::ObserverController);
}
else if (source == QLatin1String("optical"))
{
state.originatorId(0);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ObserverController);
state.originatorType(ProjectDataManagement::StateChangeOriginator::ObserverController);
}
else
{
state.originatorId(2);
state.originatorType(ProjectDataManagement::StateChangeOriginator_def::ExerciseControl);
state.originatorType(ProjectDataManagement::StateChangeOriginator::ExerciseControl);
}
}
state.sampleTime(simTimeToMSec(interaction.getReceiveTimeStamp()));
@@ -1708,16 +1708,16 @@ bool NgsConnector::setParticipantHit(int eqNo, const ParticipantManagement::Stat
switch (originatorType.underlying()) {
case ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation:
case ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation:
{
break;
}
case ProjectDataManagement::StateChangeOriginator_def::ExerciseControl:
case ProjectDataManagement::StateChangeOriginator::ExerciseControl:
break;
case ProjectDataManagement::StateChangeOriginator_def::ObserverController:
case ProjectDataManagement::StateChangeOriginator::ObserverController:
break;
case ProjectDataManagement::StateChangeOriginator_def::Participant:
if (originatorType == ProjectDataManagement::StateChangeOriginator_def::Participant)
case ProjectDataManagement::StateChangeOriginator::Participant:
if (originatorType == ProjectDataManagement::StateChangeOriginator::Participant)
{
if (m_playerMap.contains(originatorEqNo))
is = IdentifierStruct(originatorEqNo);
@@ -1731,14 +1731,14 @@ bool NgsConnector::setParticipantHit(int eqNo, const ParticipantManagement::Stat
break;
}
Q_FALLTHROUGH();
case ProjectDataManagement::StateChangeOriginator_def::Initialization:
case ProjectDataManagement::StateChangeOriginator_def::FunctionalArea:
case ProjectDataManagement::StateChangeOriginator_def::MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator_def::Unknown:
case ProjectDataManagement::StateChangeOriginator_def::WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator::Initialization:
case ProjectDataManagement::StateChangeOriginator::FunctionalArea:
case ProjectDataManagement::StateChangeOriginator::MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator::Unknown:
case ProjectDataManagement::StateChangeOriginator::WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator_def::ImprovisedExplosiveDevice:
case ProjectDataManagement::StateChangeOriginator_def::DusMine:
case ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice:
case ProjectDataManagement::StateChangeOriginator::DusMine:
break;
}
@@ -113,12 +113,12 @@ struct GuezHitStruct
{
qint32 targetId = 0;
qint64 sampleTime = 0;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::get_default();
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::get_default();
qint32 vulnerabilityKind = 0;
qint32 vulnerabilityBits = 0;
Core::GeoPosition position = Core::GeoPosition(0, 0, 0);
qint32 originatorId = 0;
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator_def::get_default();
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator::get_default();
QString originatorChargeTypeEtsString;
};
@@ -116,7 +116,7 @@ bool PpmHandler::init()
ParticipantManagement::Role PpmHandler::roleForPartyId(int partyId)
{
if (partyId <= 0)
return ParticipantManagement::Role_def::Unknown;
return ParticipantManagement::Role::Unknown;
auto it = m_partyData.constFind(partyId);
if (it == m_partyData.constEnd())
{
@@ -124,7 +124,7 @@ ParticipantManagement::Role PpmHandler::roleForPartyId(int partyId)
m_partyData = m_dtcPpm->partys();
it = m_partyData.constFind(partyId);
if (it == m_partyData.constEnd())
return ParticipantManagement::Role_def::Unknown;
return ParticipantManagement::Role::Unknown;
}
return it.value().role();
}
@@ -430,31 +430,31 @@ rpr2::DetonationResultCodeEnum8::ET PpmHandler::rpr2DetonationResultFromVulnerab
rpr2::DetonationResultCodeEnum8::ET status = rpr2::DetonationResultCodeEnum8::None;
switch(vulnerabilityState)
{
case TrainingAreaBase::TetraIcd::VulnerabilityState::CombatReady:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CombatReady:
status = rpr2::DetonationResultCodeEnum8::None;
break;
case TrainingAreaBase::TetraIcd::VulnerabilityState::LightDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::MediumDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::HeavyDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::MobilityKill:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VisibleMobilityKill:
case TrainingAreaBase::TetraIcd::VulnerabilityState::WeaponSystemDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VisibleWeaponSystemDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_LightDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_MediumDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_HeavyDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_MobilityKill:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_VisibleMobilityKill:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_WeaponSystemDamage:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_VisibleWeaponSystemDamage:
status = rpr2::DetonationResultCodeEnum8::AirHit;
break;
case TrainingAreaBase::TetraIcd::VulnerabilityState::CatastrophicKill:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CatastrophicKill:
status = rpr2::DetonationResultCodeEnum8::EntityImpact;
break;
case TrainingAreaBase::TetraIcd::VulnerabilityState::TemporarySeverance:
case TrainingAreaBase::TetraIcd::VulnerabilityState::NearMiss:
case TrainingAreaBase::TetraIcd::VulnerabilityState::HitWithNoEffect:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_TemporarySeverance:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_NearMiss:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_HitWithNoEffect:
status = rpr2::DetonationResultCodeEnum8::EntityProximateDetonation;
break;
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityBitsChanged:
case TrainingAreaBase::TetraIcd::VulnerabilityState::Reserved:
case TrainingAreaBase::TetraIcd::VulnerabilityState::NContamination:
case TrainingAreaBase::TetraIcd::VulnerabilityState::BContamination:
case TrainingAreaBase::TetraIcd::VulnerabilityState::CContamination:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_VulnerabilityBitsChanged:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_Reserved:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_NContamination:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_BContamination:
case TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CContamination:
status = rpr2::DetonationResultCodeEnum8::Other;
break;
}
@@ -514,22 +514,22 @@ void PpmHandler::createParticipant(const ParticipantManagement::Participant &par
bool bCreated;
switch (partType.typeClass().underlying())
{
case ParticipantManagement::TypeClass_def::Human:
case ParticipantManagement::TypeClass::Human:
bCreated = createHuman(participant);
break;
case ParticipantManagement::TypeClass_def::GroundVehicle:
case ParticipantManagement::TypeClass_def::VehicleWithGear:
case ParticipantManagement::TypeClass_def::WeaponSystem:
case ParticipantManagement::TypeClass::GroundVehicle:
case ParticipantManagement::TypeClass::VehicleWithGear:
case ParticipantManagement::TypeClass::WeaponSystem:
bCreated = createGroundVehicle(participant);
break;
case ParticipantManagement::TypeClass_def::Aircraft:
case ParticipantManagement::TypeClass::Aircraft:
bCreated = createAircraft(participant);
break;
case ParticipantManagement::TypeClass_def::SupportEntity:
case ParticipantManagement::TypeClass_def::Unit:
case ParticipantManagement::TypeClass::SupportEntity:
case ParticipantManagement::TypeClass::Unit:
case ParticipantManagement::TypeClass_def::Vessel:
case ParticipantManagement::TypeClass::Vessel:
default:
@@ -617,7 +617,7 @@ ProjectDataManagement::VulnerabilityState PpmHandler::currentVulnerabilityState(
return ts;
}
}
ts = ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
ts = ProjectDataManagement::VulnerabilityState::TemporarySeverance;
return ts;
}
@@ -729,97 +729,97 @@ rpr2::ForceIdentifierEnum8::ET PpmHandler::getRprForceIdentifierFromPpmForceIden
{
rpr2::ForceIdentifierEnum8::ET eqfi = rpr2::ForceIdentifierEnum8::Other;
switch (ppmForceIdentifier.underlying()) {
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_1:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_1:
eqfi = rpr2::ForceIdentifierEnum8::Friendly;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_2:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_2:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_3:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_3:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_4:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_4:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_5:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_5:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_6:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_6:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_7:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_7:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_8:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_8:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_9:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_9:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_10:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_10:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_1:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_1:
eqfi = rpr2::ForceIdentifierEnum8::Opposing;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_2:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_2:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_3:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_3:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_4:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_4:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_5:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_5:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_6:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_6:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_7:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_7:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_8:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_8:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_9:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_9:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_10:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_10:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_1:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_1:
eqfi = rpr2::ForceIdentifierEnum8::Neutral;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_2:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_2:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_3:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_3:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_4:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_4:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_5:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_5:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_6:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_6:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_7:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_7:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_8:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_8:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_9:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_9:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_10:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_10:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Other:
case ParticipantManagement::HlaForceIdentifierEnum::Other:
eqfi = rpr2::ForceIdentifierEnum8::Other;
break;
}
@@ -894,15 +894,15 @@ void PpmHandler::onParticipantHit(const GuezHitStruct &hitStruct)
TrainingAreaBase::TabPosition pos;
pos.position(hitStruct.position);
pos.reportingSource(Core::PositionReportingSource_def::External);
pos.reportingSource(Core::PositionReportingSource::External);
TrainingAreaBase::EquipmentState es;
es.equipmentNumber(hitStruct.targetId);
es.originatorChargeTypeId(ct.id());
if (hitStruct.originatorType.underlying() == ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation)
if (hitStruct.originatorType.underlying() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
{
int aesItemId = 0;
if (m_dtcAes->aesItemIdFromExternalId(hitStruct.originatorId, aesItemId) == AreaEffectSimulation::AesType_def::AtUnknown)
if (m_dtcAes->aesItemIdFromExternalId(hitStruct.originatorId, aesItemId) == AreaEffectSimulation::AesType::AtUnknown)
es.originatorId(hitStruct.originatorId % 10);
else
es.originatorId(aesItemId);
@@ -971,7 +971,7 @@ void PpmHandler::onEquipmentState(const TrainingAreaBase::EquipmentState &event)
bool PpmHandler::onExconEngagement(int eqNo, const ProjectDataManagement::VulnerabilityState &state)
{
if (state != ProjectDataManagement::VulnerabilityState_def::CombatReady)
if (state != ProjectDataManagement::VulnerabilityState::CombatReady)
{
TrainingAreaBase::DemandVulnerabilityStateChangeRequest req;
req.equipmentNumbers().push_back(eqNo);
@@ -203,14 +203,14 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification
}
else if (data.effectStateId() == AesEffectState::EsPrepared &&
data.aesTypeId() == AesType_def::AtExplosionAreaSingleExplosions)
data.aesTypeId() == AesType::AtExplosionAreaSingleExplosions)
{
DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " added";
m_aesItemViews.insert(data.aesItemId(), data);
m_takenIndicesForAesItem.insert(data.aesItemId(), QVector<int32_t>());
}
else if (data.aesTypeId() == AesType_def::AtBCContamination)
else if (data.aesTypeId() == AesType::AtBCContamination)
{
m_ngsHandler->ngsConnector()->setItemForm(data.aesItemId(), data.aesTypeId().underlying(), data.form());
DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " directly updated in ngsConnector";
@@ -247,7 +247,7 @@ void AesHandler::onTriggeredImpactsChanged(const TriggeredImpacts &data, DataMod
m_takenIndicesForAesItem.remove(data.aesItemId());
return;
}
if (data.aesTypeId() != AesType_def::AtExplosionAreaSingleExplosions)
if (data.aesTypeId() != AesType::AtExplosionAreaSingleExplosions)
return;
if (!m_aesItemViews.contains(data.aesItemId()))
@@ -289,7 +289,7 @@ void AesHandler::onEffectsChanged(const Effects &data, DataModification modType)
m_handledImpactsStorage.removeAesItem(aesItemId);
return;
}
if (data.aesTypeId() != AesType_def::AtExplosionClusterSingleExplosions)
if (data.aesTypeId() != AesType::AtExplosionClusterSingleExplosions)
return;
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects();
@@ -324,7 +324,7 @@ void AesHandler::onEffectsChanged(const Effects &data, DataModification modType)
{
++curSeIndex;
if (se.singleEffectState() != AreaEffectSimulation::AesSingleEffectState_def::SesTriggered)
if (se.singleEffectState() != AreaEffectSimulation::AesSingleEffectState::SesTriggered)
continue;
@@ -478,10 +478,10 @@ void AesHandler::onAesBCContaminationChanged(const BCContamination &data, DataMo
bool AesHandler::isModifiable(const AreaEffectSimulation::AesItem &item)
{
return (item.effectStateId() == AesEffectState_def::EsCreated ||
item.effectStateId() == AesEffectState_def::EsPrepared ||
item.effectStateId() == AesEffectState_def::EsUnknown ||
item.effectStateId() == AesEffectState_def::EsReceived);
return (item.effectStateId() == AesEffectState::EsCreated ||
item.effectStateId() == AesEffectState::EsPrepared ||
item.effectStateId() == AesEffectState::EsUnknown ||
item.effectStateId() == AesEffectState::EsReceived);
}
@@ -493,9 +493,9 @@ void AesHandler::onAesNameChanged(qint64 identifierInt, const std::string &newNa
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
MineCorridorModifyRequest *req = static_cast<MineCorridorModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -509,7 +509,7 @@ void AesHandler::onAesNameChanged(qint64 identifierInt, const std::string &newNa
req->name(newName);
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -523,34 +523,34 @@ void AesHandler::onAesNameChanged(qint64 identifierInt, const std::string &newNa
req->name(newName);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
@@ -567,9 +567,9 @@ void AesHandler::onAesRemoveItem(qint64 identifierInt)
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
m_requestHelper->startSingleRequest([req, this]()
{
@@ -577,7 +577,7 @@ void AesHandler::onAesRemoveItem(qint64 identifierInt)
});
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
m_requestHelper->startSingleRequest([req, this]()
{
@@ -585,34 +585,34 @@ void AesHandler::onAesRemoveItem(qint64 identifierInt)
});
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
return;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
return;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
return;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
return;
}
@@ -629,9 +629,9 @@ void AesHandler::onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSi
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
MineCorridorModifyRequest *req = static_cast<MineCorridorModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -645,7 +645,7 @@ void AesHandler::onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSi
req->effectStart(msecsSinceEpoch);
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
DEBUG_LOG(m_logger) << "onAesActivationTimeChanged / MineArea";
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
@@ -661,34 +661,34 @@ void AesHandler::onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSi
req->effectStart(msecsSinceEpoch);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
}
@@ -701,9 +701,9 @@ void AesHandler::onAesForceIdentifierChanged(qint64 identifierInt, int partyId)
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
MineCorridorModifyRequest *req = static_cast<MineCorridorModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -717,7 +717,7 @@ void AesHandler::onAesForceIdentifierChanged(qint64 identifierInt, int partyId)
req->partyId(partyId);
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -731,34 +731,34 @@ void AesHandler::onAesForceIdentifierChanged(qint64 identifierInt, int partyId)
req->partyId(partyId);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
}
@@ -784,9 +784,9 @@ void AesHandler::onAesDurationChanged(qint64 identifierInt, quint32 u_time)
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
MineCorridorModifyRequest *req = static_cast<MineCorridorModifyRequest*>(m_pendingRequests.value(aesItemId));
const int timeMSec = checkDuration(u_time, 60 * 60 * 1000, m_logger);
@@ -801,7 +801,7 @@ void AesHandler::onAesDurationChanged(qint64 identifierInt, quint32 u_time)
req->effectDuration(timeMSec);
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
const int timeMSec = checkDuration(u_time, 60 * 60 * 1000, m_logger);
@@ -816,34 +816,34 @@ void AesHandler::onAesDurationChanged(qint64 identifierInt, quint32 u_time)
req->effectDuration(timeMSec);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
@@ -856,11 +856,11 @@ void AesHandler::onAesChargeChanged(qint64 identifierInt, int chargeTypeId)
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
break;
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -874,34 +874,34 @@ void AesHandler::onAesChargeChanged(qint64 identifierInt, int chargeTypeId)
req->chargeStruct().chargeTypeId(chargeTypeId);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
}
@@ -962,9 +962,9 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
switch (type.underlying())
{
case AreaEffectSimulation::AesType_def::AtBCContamination:
case AreaEffectSimulation::AesType::AtBCContamination:
break;
case AreaEffectSimulation::AesType_def::AtMineCorridor:
case AreaEffectSimulation::AesType::AtMineCorridor:
{
MineCorridorModifyRequest *req = static_cast<MineCorridorModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -987,7 +987,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
req->width(width);
break;
}
case AreaEffectSimulation::AesType_def::AtMineArea:
case AreaEffectSimulation::AesType::AtMineArea:
{
MineAreaModifyRequest *req = static_cast<MineAreaModifyRequest*>(m_pendingRequests.value(aesItemId));
if (!req)
@@ -1011,34 +1011,34 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector<
req->width(width);
break;
}
case AreaEffectSimulation::AesType_def::AtNContamination:
case AreaEffectSimulation::AesType::AtNContamination:
break;
case AreaEffectSimulation::AesType_def::AtExplosionArea:
case AreaEffectSimulation::AesType::AtExplosionArea:
break;
case AreaEffectSimulation::AesType_def::AtExplosionSingle:
case AreaEffectSimulation::AesType::AtExplosionSingle:
break;
case AreaEffectSimulation::AesType_def::AtAirSupportImpact:
case AreaEffectSimulation::AesType::AtAirSupportImpact:
break;
case AreaEffectSimulation::AesType_def::AtUnknown:
case AreaEffectSimulation::AesType_def::AtDangerArea:
case AreaEffectSimulation::AesType_def::AtFunctionalArea:
case AreaEffectSimulation::AesType_def::AtBorderline:
case AreaEffectSimulation::AesType_def::AtTechnicalArea:
case AreaEffectSimulation::AesType_def::AtReconArea:
case AreaEffectSimulation::AesType_def::AtDusSingleMine:
case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType_def::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType_def::AtGasPipe:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType_def::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType_def::AtBoobyTrap:
case AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType_def::AtExplosionCluster:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType_def::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType_def::AtExplosionClusterGunToTargetLine:
case AreaEffectSimulation::AesType::AtUnknown:
case AreaEffectSimulation::AesType::AtDangerArea:
case AreaEffectSimulation::AesType::AtFunctionalArea:
case AreaEffectSimulation::AesType::AtBorderline:
case AreaEffectSimulation::AesType::AtTechnicalArea:
case AreaEffectSimulation::AesType::AtReconArea:
case AreaEffectSimulation::AesType::AtDusSingleMine:
case AreaEffectSimulation::AesType::AtExplosionAreaSingleExplosions:
case AreaEffectSimulation::AesType::AtMineAreaSingleMines:
case AreaEffectSimulation::AesType::AtGasPipe:
case AreaEffectSimulation::AesType::AtExplosionSingleCentral:
case AreaEffectSimulation::AesType::AtExplosionSingleCentralTrajectory:
case AreaEffectSimulation::AesType::AtBoobyTrap:
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary:
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary:
case AreaEffectSimulation::AesType::AtExplosionCluster:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions:
case AreaEffectSimulation::AesType::AtExplosionClusterSingleTrajectory:
case AreaEffectSimulation::AesType::AtExplosionClusterGunToTargetLine:
break;
}
}
@@ -215,35 +215,35 @@ ProjectDataManagement::VulnerabilityState DamageModel::vulnerabilityState(qint64
{
int idx = indexForTime(simTimeMSec);
if (idx < 0)
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
switch (m_tacticalStates.at(idx).tss.TacticalStatus)
{
case rpr2::TacticalStatusEnum8::CombatReady:
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
case rpr2::TacticalStatusEnum8::LightHit:
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
return ProjectDataManagement::VulnerabilityState::LightDamage;
case rpr2::TacticalStatusEnum8::MediumHit:
return ProjectDataManagement::VulnerabilityState_def::MediumDamage;
return ProjectDataManagement::VulnerabilityState::MediumDamage;
case rpr2::TacticalStatusEnum8::HeavyHit:
return ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
return ProjectDataManagement::VulnerabilityState::HeavyDamage;
case rpr2::TacticalStatusEnum8::Immobilized:
return ProjectDataManagement::VulnerabilityState_def::MobilityKill;
return ProjectDataManagement::VulnerabilityState::MobilityKill;
case rpr2::TacticalStatusEnum8::ImmobilizedVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill;
return ProjectDataManagement::VulnerabilityState::VisibleMobilityKill;
case rpr2::TacticalStatusEnum8::WeaponKill:
return ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::WeaponSystemDamage;
case rpr2::TacticalStatusEnum8::WeaponKillVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage;
case rpr2::TacticalStatusEnum8::TotalKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::TacticalStatusEnum8::TemporaryFailure:
return ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
return ProjectDataManagement::VulnerabilityState::TemporarySeverance;
case rpr2::TacticalStatusEnum8::NearMiss:
return ProjectDataManagement::VulnerabilityState_def::NearMiss;
return ProjectDataManagement::VulnerabilityState::NearMiss;
case rpr2::TacticalStatusEnum8::HitWithoutEffect:
return ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect;
return ProjectDataManagement::VulnerabilityState::HitWithNoEffect;
}
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
}
int DamageModel::indexForTime(qint64 simTimeMSec) const
@@ -647,8 +647,8 @@ bool NgsConnector::guezMineField(const AreaEffectSimulation::MineArea &data)
const QList<rpr2::IPlayerEnvironmentObjectObjInstance *> icbs = m_environmentObjects.values(data.id());
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
for (rpr2::IPlayerEnvironmentObjectObjInstance *item : icbs)
item->deleteObjectInstance(ngs::SimTime(true));
@@ -657,11 +657,11 @@ bool NgsConnector::guezMineField(const AreaEffectSimulation::MineArea &data)
return true;
}
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPaused &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived)
return false;
QVector<rpr2::IPlayerGuezMineFieldObjInstance *> minefields;
@@ -705,9 +705,9 @@ bool NgsConnector::guezMineField(const AreaEffectSimulation::MineArea &data)
const AreaEffectSimulation::MineSegment &segment = data.segments()[i];
icb->setActivationTime(getClockTimeStruct(data.effectStart().is_set() ? data.effectStart().get() : 0));
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState_def::EsActivated);
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState::EsActivated);
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsRemoved)
icb->setPercentComplete(100);
else
icb->setPercentComplete(0);
@@ -739,8 +739,8 @@ bool NgsConnector::guezMineFieldBreach(const AreaEffectSimulation::MineCorridor
const QList<rpr2::IPlayerEnvironmentObjectObjInstance *> icbs = m_environmentObjects.values(data.id());
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved)
{
for (rpr2::IPlayerEnvironmentObjectObjInstance *item : icbs)
item->deleteObjectInstance(ngs::SimTime(true));
@@ -749,11 +749,11 @@ bool NgsConnector::guezMineFieldBreach(const AreaEffectSimulation::MineCorridor
return true;
}
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPaused)
return false;
QMap<int, rpr2::IPlayerGuezMineFieldBreachObjInstance *> map;
@@ -799,9 +799,9 @@ bool NgsConnector::guezMineFieldBreach(const AreaEffectSimulation::MineCorridor
icb->setActivationTime(getClockTimeStruct(data.effectStart().is_set() ? data.effectStart().get() : 0));
icb->setAreaEffectSimulationName(rpr2::OMT13string(data.name()));
icb->setPointsData(positionArray(mineCorridorSegment(data.segments().at(i), data.segments().at(i + 1), data.width())));
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState_def::EsActivated);
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState::EsActivated);
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsRemoved)
icb->setPercentComplete(100);
else
icb->setPercentComplete(0);
@@ -827,8 +827,8 @@ bool NgsConnector::guezNuclearAgent(const AreaEffectSimulation::NContamination &
if (icb &&
(data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved))
(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved))
{
icb->deleteObjectInstance(ngs::SimTime(true));
m_environmentObjects.remove(data.id());
@@ -836,11 +836,11 @@ bool NgsConnector::guezNuclearAgent(const AreaEffectSimulation::NContamination &
return true;
}
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPaused)
return false;
if (!icb)
@@ -881,8 +881,8 @@ bool NgsConnector::guezChemicalAgent(const AreaEffectSimulation::BCContamination
if (icb &&
(data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved))
(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved))
{
icb->deleteObjectInstance(ngs::SimTime(true));
m_environmentObjects.remove(data.id());
@@ -890,11 +890,11 @@ bool NgsConnector::guezChemicalAgent(const AreaEffectSimulation::BCContamination
return true;
}
if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused)
if (data.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPrepared &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsActivated &&
data.effectStateId() != AreaEffectSimulation::AesEffectState::EsPaused)
return false;
if (!icb)
@@ -922,13 +922,13 @@ bool NgsConnector::guezChemicalAgent(const AreaEffectSimulation::BCContamination
}
is.setEntityNumber(10 * data.id());
icb->setObjectIdentifier(is.toEIS());
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState_def::EsActivated);
icb->setDeactivated(data.effectStateId().underlying() != AreaEffectSimulation::AesEffectState::EsActivated);
icb->setActivationTime(getClockTimeStruct(data.effectStart().is_set() ? data.effectStart().get() : 0));
icb->setAreaEffectSimulationName(rpr2::OMT13string(data.name()));
icb->setDuration(data.effectDuration() / 1000 / 60);
icb->setDetonationLocation(pos.toWorldLocation());
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState_def::EsRemoved)
if (data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsExpired ||
data.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsRemoved)
icb->setPercentComplete(100);
else
icb->setPercentComplete(0);
@@ -961,26 +961,26 @@ bool NgsConnector::setItemForm(int aesItemId, int aesTypeId, const std::vector<C
std::vector<Core::GeoPosition> reducedForm;
switch (aesTypeId)
{
case AesType_def::AtBCContamination:
case AesType::AtBCContamination:
reducedForm = bcReduction(form);
break;
case AesType_def::AtMineCorridor:
case AesType_def::AtExplosionArea:
case AesType_def::AtExplosionSingle:
case AesType_def::AtMineArea:
case AesType_def::AtNContamination:
case AesType::AtMineCorridor:
case AesType::AtExplosionArea:
case AesType::AtExplosionSingle:
case AesType::AtMineArea:
case AesType::AtNContamination:
return true;
case AesType_def::AtUnknown:
case AesType_def::AtDangerArea:
case AesType_def::AtFunctionalArea:
case AesType_def::AtBorderline:
case AesType_def::AtTechnicalArea:
case AesType_def::AtReconArea:
case AesType_def::AtDusSingleMine:
case AesType_def::AtExplosionAreaSingleExplosions:
case AesType_def::AtMineAreaSingleMines:
case AesType_def::AtGasPipe:
case AesType::AtUnknown:
case AesType::AtDangerArea:
case AesType::AtFunctionalArea:
case AesType::AtBorderline:
case AesType::AtTechnicalArea:
case AesType::AtReconArea:
case AesType::AtDusSingleMine:
case AesType::AtExplosionAreaSingleExplosions:
case AesType::AtMineAreaSingleMines:
case AesType::AtGasPipe:
return true;
}
@@ -1577,33 +1577,33 @@ rpr2::HitResultEnum16::ET NgsConnector::getHitResultEnum(const ProjectDataManage
{
switch (ts.underlying())
{
case ProjectDataManagement::VulnerabilityState_def::CombatReady:
case ProjectDataManagement::VulnerabilityState::CombatReady:
return rpr2::HitResultEnum16::Reset;
case ProjectDataManagement::VulnerabilityState_def::LightDamage:
case ProjectDataManagement::VulnerabilityState::LightDamage:
return rpr2::HitResultEnum16::LightDamage;
case ProjectDataManagement::VulnerabilityState_def::MediumDamage:
case ProjectDataManagement::VulnerabilityState::MediumDamage:
return rpr2::HitResultEnum16::MediumDamage;
case ProjectDataManagement::VulnerabilityState_def::HeavyDamage:
case ProjectDataManagement::VulnerabilityState::HeavyDamage:
return rpr2::HitResultEnum16::HeavyDamage;
case ProjectDataManagement::VulnerabilityState_def::MobilityKill:
case ProjectDataManagement::VulnerabilityState::MobilityKill:
return rpr2::HitResultEnum16::MobilityKill;
case ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill:
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill:
return rpr2::HitResultEnum16::MobilityKillVisible;
case ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage:
return rpr2::HitResultEnum16::WeaponDamage;
case ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage:
return rpr2::HitResultEnum16::WeaponDamageVisible;
case ProjectDataManagement::VulnerabilityState_def::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
return rpr2::HitResultEnum16::TotalKill;
case ProjectDataManagement::VulnerabilityState_def::TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::TemporarySeverance:
return rpr2::HitResultEnum16::TemporaryFailure;
case ProjectDataManagement::VulnerabilityState_def::NearMiss:
case ProjectDataManagement::VulnerabilityState::NearMiss:
return rpr2::HitResultEnum16::NearMiss;
case ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect:
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect:
return rpr2::HitResultEnum16::HitWithNoEffect;
case ProjectDataManagement::VulnerabilityState_def::NContamination:
case ProjectDataManagement::VulnerabilityState_def::BContamination:
case ProjectDataManagement::VulnerabilityState_def::CContamination:
case ProjectDataManagement::VulnerabilityState::NContamination:
case ProjectDataManagement::VulnerabilityState::BContamination:
case ProjectDataManagement::VulnerabilityState::CContamination:
return rpr2::HitResultEnum16::Contaminated;
default:
return rpr2::HitResultEnum16::Reset;
@@ -1616,37 +1616,37 @@ ProjectDataManagement::VulnerabilityState NgsConnector::getTacticalStatusEnum(co
switch (hr)
{
case rpr2::HitResultEnum16::Reset:
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
case rpr2::HitResultEnum16::LightDamage:
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
return ProjectDataManagement::VulnerabilityState::LightDamage;
case rpr2::HitResultEnum16::MediumDamage:
return ProjectDataManagement::VulnerabilityState_def::MediumDamage;
return ProjectDataManagement::VulnerabilityState::MediumDamage;
case rpr2::HitResultEnum16::HeavyDamage:
return ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
return ProjectDataManagement::VulnerabilityState::HeavyDamage;
case rpr2::HitResultEnum16::MobilityKill:
return ProjectDataManagement::VulnerabilityState_def::MobilityKill;
return ProjectDataManagement::VulnerabilityState::MobilityKill;
case rpr2::HitResultEnum16::MobilityKillVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill;
return ProjectDataManagement::VulnerabilityState::VisibleMobilityKill;
case rpr2::HitResultEnum16::WeaponDamage:
return ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::WeaponSystemDamage;
case rpr2::HitResultEnum16::WeaponDamageVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage;
case rpr2::HitResultEnum16::TotalKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::HitResultEnum16::CheatingKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::HitResultEnum16::NearMiss:
return ProjectDataManagement::VulnerabilityState_def::NearMiss;
return ProjectDataManagement::VulnerabilityState::NearMiss;
case rpr2::HitResultEnum16::HitWithNoEffect:
return ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect;
return ProjectDataManagement::VulnerabilityState::HitWithNoEffect;
case rpr2::HitResultEnum16::Contaminated:
return ProjectDataManagement::VulnerabilityState_def::CContamination;
return ProjectDataManagement::VulnerabilityState::CContamination;
case rpr2::HitResultEnum16::TemporaryFailure:
return ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
return ProjectDataManagement::VulnerabilityState::TemporarySeverance;
default:
return ProjectDataManagement::VulnerabilityState_def::NoChange;
return ProjectDataManagement::VulnerabilityState::NoChange;
}
return ProjectDataManagement::VulnerabilityState_def::NoChange;
return ProjectDataManagement::VulnerabilityState::NoChange;
}
QPolygonF NgsConnector::utmToGeogrphic(const QPolygonF &polyUtm, const LtsCoordTrans::UtmCoordinate &base)
@@ -1681,10 +1681,10 @@ void NgsConnector::onEntityIdentifierChanged(const rpr2::EntityIdentifierStruct
GuezHitStruct hs;
hs.originatorType = ProjectDataManagement::StateChangeOriginator_def::Initialization;
hs.originatorType = ProjectDataManagement::StateChangeOriginator::Initialization;
hs.sampleTime = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
hs.targetId = is.entityNumber();
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
QTimer::singleShot(STATUS_WAIT_INTERVAL, this, [this, hs, obj]() mutable
{
@@ -2083,11 +2083,11 @@ bool NgsConnector::onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &e
GuezHitStruct hitStruct;
hitStruct.originatorChargeTypeEtsString = TypeStruct::fromDisInt(0).toString();
hitStruct.originatorId = 0;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
hitStruct.position = m_observerPositions[is.entityNumber()].toGeoPosition();
hitStruct.sampleTime = simTimeMSecs;
hitStruct.targetId = is.entityNumber();
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
hitStruct.vulnerabilityKind = 0;
const auto vulnerabilityBits = m_damageModelMap[is.entityNumber()]->totalState(hitStruct.sampleTime);
@@ -2423,31 +2423,31 @@ void NgsConnector::onNewGuezHit(const rpr2::IObserverGuezHitIntInstance &interac
GuezHitStruct hitStruct;
hitStruct.originatorChargeTypeEtsString = TypeStruct(interaction.getMunition()).toString();
hitStruct.originatorId = interaction.getOriginatorIdentifier().EntityNumber;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
switch (interaction.getOriginatorType())
{
case rpr2::OriginatorTypeEnum16::Unknown:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
break;
case rpr2::OriginatorTypeEnum16::NoMedicalTreatment:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Participant;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Participant;
if (hitStruct.originatorId == 0)
hitStruct.originatorId = hitStruct.targetId;
break;
case rpr2::OriginatorTypeEnum16::Participant:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Participant;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Participant;
if (hitStruct.originatorId == 0)
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ExerciseControl;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ExerciseControl;
break;
case rpr2::OriginatorTypeEnum16::AreaEffectSimulation:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation;
hitStruct.originatorId = IdentifierStruct(interaction.getOriginatorIdentifier()).toInt64();
break;
case rpr2::OriginatorTypeEnum16::ObserverController:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ObserverController;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ObserverController;
break;
case rpr2::OriginatorTypeEnum16::ExerciseControl:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ExerciseControl;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ExerciseControl;
break;
}
hitStruct.position = ParticipantPosition(interaction.getTargetLocation()).toGeoPosition();
@@ -2458,16 +2458,16 @@ void NgsConnector::onNewGuezHit(const rpr2::IObserverGuezHitIntInstance &interac
hitStruct.vulnerabilityState = getTacticalStatusEnum(interaction.getHitResult());
if ((hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator_def::ExerciseControl ||
hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator_def::ObserverController
if ((hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator::ExerciseControl ||
hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator::ObserverController
)
&& hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect)
&& hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState::HitWithNoEffect)
{
auto ptr = m_damageModelMap.value(eqNo);
if (ptr)
{
hitStruct.vulnerabilityState = ptr->vulnerabilityState(hitStruct.sampleTime);
if (hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
if (hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
ptr->setTacticalStatus(rpr2::HitResultEnum16::Reset, simTimeToMSec(interaction.getReceiveTimeStamp()));
}
}
@@ -2714,7 +2714,7 @@ bool NgsConnector::setParticipantHit(int eqNo, const ParticipantManagement::Stat
switch (originatorType.underlying())
{
case ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation:
case ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation:
{
if (m_environmentObjects.contains(originatorEqNo))
is = IdentifierStruct(10 * originatorEqNo);
@@ -2734,14 +2734,14 @@ bool NgsConnector::setParticipantHit(int eqNo, const ParticipantManagement::Stat
originatorTypeRpr = rpr2::OriginatorTypeEnum16::AreaEffectSimulation;
break;
}
case ProjectDataManagement::StateChangeOriginator_def::ExerciseControl:
case ProjectDataManagement::StateChangeOriginator::ExerciseControl:
originatorTypeRpr = rpr2::OriginatorTypeEnum16::ExerciseControl;
break;
case ProjectDataManagement::StateChangeOriginator_def::ObserverController:
case ProjectDataManagement::StateChangeOriginator::ObserverController:
originatorTypeRpr = rpr2::OriginatorTypeEnum16::ObserverController;
break;
case ProjectDataManagement::StateChangeOriginator_def::Participant:
if (originatorType == ProjectDataManagement::StateChangeOriginator_def::Participant)
case ProjectDataManagement::StateChangeOriginator::Participant:
if (originatorType == ProjectDataManagement::StateChangeOriginator::Participant)
{
if (m_playerMap.contains(originatorEqNo))
is = IdentifierStruct(originatorEqNo);
@@ -2756,16 +2756,16 @@ bool NgsConnector::setParticipantHit(int eqNo, const ParticipantManagement::Stat
break;
}
Q_FALLTHROUGH();
case ProjectDataManagement::StateChangeOriginator_def::Initialization:
case ProjectDataManagement::StateChangeOriginator_def::FunctionalArea:
case ProjectDataManagement::StateChangeOriginator_def::MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator_def::Unknown:
case ProjectDataManagement::StateChangeOriginator_def::WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator_def::MedicalTimeout:
case ProjectDataManagement::StateChangeOriginator_def::Sanitation:
case ProjectDataManagement::StateChangeOriginator::Initialization:
case ProjectDataManagement::StateChangeOriginator::FunctionalArea:
case ProjectDataManagement::StateChangeOriginator::MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator::Unknown:
case ProjectDataManagement::StateChangeOriginator::WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator::MedicalTimeout:
case ProjectDataManagement::StateChangeOriginator::Sanitation:
case ProjectDataManagement::StateChangeOriginator_def::ImprovisedExplosiveDevice:
case ProjectDataManagement::StateChangeOriginator_def::DusMine:
case ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice:
case ProjectDataManagement::StateChangeOriginator::DusMine:
originatorTypeRpr = rpr2::OriginatorTypeEnum16::Unknown;
break;
}
@@ -130,12 +130,12 @@ struct GuezHitStruct
{
qint32 targetId = 0;
qint64 sampleTime = 0;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::get_default();
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::get_default();
qint32 vulnerabilityKind = 0;
qint32 vulnerabilityBits = 0;
Core::GeoPosition position = Core::GeoPosition(0, 0, 0);
qint64 originatorId = 0;
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator_def::get_default();
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator::get_default();
QString originatorChargeTypeEtsString;
};
@@ -120,7 +120,7 @@ bool PpmHandler::init()
ParticipantManagement::Role PpmHandler::roleForPartyId(int partyId)
{
if (partyId <= 0)
return ParticipantManagement::Role_def::Unknown;
return ParticipantManagement::Role::Unknown;
auto it = m_partyData.constFind(partyId);
if (it == m_partyData.constEnd())
{
@@ -128,7 +128,7 @@ ParticipantManagement::Role PpmHandler::roleForPartyId(int partyId)
m_partyData = m_dtcPpm->partys();
it = m_partyData.constFind(partyId);
if (it == m_partyData.constEnd())
return ParticipantManagement::Role_def::Unknown;
return ParticipantManagement::Role::Unknown;
}
return it.value().role();
}
@@ -381,8 +381,8 @@ void PpmHandler::onParticipantReceivedInit(int eqId, qint64 simTimeMSecs)
init.equipmentNumber(eqId);
init.sampleTime(simTimeMSecs);
init.vulnerabilityBits(1);
init.vulnerabilityState(ProjectDataManagement::VulnerabilityState_def::CombatReady);
init.originatorType(ProjectDataManagement::StateChangeOriginator_def::ExerciseControl);
init.vulnerabilityState(ProjectDataManagement::VulnerabilityState::CombatReady);
init.originatorType(ProjectDataManagement::StateChangeOriginator::ExerciseControl);
m_dtsTab->publish(init);
}
@@ -490,15 +490,15 @@ void PpmHandler::createParticipant(const ParticipantManagement::Participant &par
bool bCreated;
switch (partType.typeClass().underlying())
{
case ParticipantManagement::TypeClass_def::Human:
case ParticipantManagement::TypeClass::Human:
bCreated = createHuman(participant);
break;
case ParticipantManagement::TypeClass_def::GroundVehicle:
case ParticipantManagement::TypeClass_def::VehicleWithGear:
case ParticipantManagement::TypeClass_def::WeaponSystem:
case ParticipantManagement::TypeClass::GroundVehicle:
case ParticipantManagement::TypeClass::VehicleWithGear:
case ParticipantManagement::TypeClass::WeaponSystem:
bCreated = createGroundVehicle(participant);
break;
case ParticipantManagement::TypeClass_def::SupportEntity:
case ParticipantManagement::TypeClass::SupportEntity:
bCreated = createObserverController(participant);
break;
default:
@@ -661,97 +661,97 @@ rpr2::ForceIdentifierEnum8::ET PpmHandler::getRprForceIdentifierFromPpmForceIden
{
rpr2::ForceIdentifierEnum8::ET eqfi = rpr2::ForceIdentifierEnum8::Other;
switch (ppmForceIdentifier.underlying()) {
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_1:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_1:
eqfi = rpr2::ForceIdentifierEnum8::Friendly;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_2:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_2:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_3:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_3:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_4:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_4:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_5:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_5:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_6:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_6:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_7:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_7:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_8:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_8:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_9:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_9:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Friendly_10:
case ParticipantManagement::HlaForceIdentifierEnum::Friendly_10:
eqfi = rpr2::ForceIdentifierEnum8::Friendly_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_1:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_1:
eqfi = rpr2::ForceIdentifierEnum8::Opposing;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_2:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_2:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_3:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_3:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_4:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_4:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_5:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_5:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_6:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_6:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_7:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_7:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_8:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_8:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_9:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_9:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Opposing_10:
case ParticipantManagement::HlaForceIdentifierEnum::Opposing_10:
eqfi = rpr2::ForceIdentifierEnum8::Opposing_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_1:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_1:
eqfi = rpr2::ForceIdentifierEnum8::Neutral;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_2:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_2:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_2;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_3:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_3:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_3;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_4:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_4:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_4;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_5:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_5:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_5;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_6:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_6:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_6;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_7:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_7:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_7;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_8:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_8:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_8;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_9:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_9:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_9;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Neutral_10:
case ParticipantManagement::HlaForceIdentifierEnum::Neutral_10:
eqfi = rpr2::ForceIdentifierEnum8::Neutral_10;
break;
case ParticipantManagement::HlaForceIdentifierEnum_def::Other:
case ParticipantManagement::HlaForceIdentifierEnum::Other:
eqfi = rpr2::ForceIdentifierEnum8::Other;
break;
}
@@ -826,15 +826,15 @@ void PpmHandler::onParticipantHit(const GuezHitStruct &hitStruct)
TrainingAreaBase::TabPosition pos;
pos.position(hitStruct.position);
pos.reportingSource(Core::PositionReportingSource_def::External);
pos.reportingSource(Core::PositionReportingSource::External);
TrainingAreaBase::EquipmentState es;
es.equipmentNumber(hitStruct.targetId);
es.originatorChargeTypeId(ct.id());
if (hitStruct.originatorType.underlying() == ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation)
if (hitStruct.originatorType.underlying() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
{
int aesItemId = 0;
if (m_dtcAes->aesItemIdFromExternalId(hitStruct.originatorId, aesItemId) == AreaEffectSimulation::AesType_def::AtUnknown)
if (m_dtcAes->aesItemIdFromExternalId(hitStruct.originatorId, aesItemId) == AreaEffectSimulation::AesType::AtUnknown)
es.originatorId((hitStruct.originatorId & 0xffff) / 10);
else
es.originatorId(aesItemId);
@@ -963,25 +963,25 @@ bool PpmHandler::onExconInit(int eqNo, rpr2::ResetPlayerEnum8::ET rp, rpr2::Acti
});
}
ProjectDataManagement::WphMode helmet = ProjectDataManagement::WphMode_def::NoChange;;
ProjectDataManagement::WphMode vest = ProjectDataManagement::WphMode_def::NoChange;
ProjectDataManagement::WphMode helmet = ProjectDataManagement::WphMode::NoChange;;
ProjectDataManagement::WphMode vest = ProjectDataManagement::WphMode::NoChange;
bool bNoChange = false;
switch (aho) {
case rpr2::ActivateHelmetObservationEnum8::WithoutHelmetWithoutVest:
helmet = ProjectDataManagement::WphMode_def::Without;
vest = ProjectDataManagement::WphMode_def::Without;
helmet = ProjectDataManagement::WphMode::Without;
vest = ProjectDataManagement::WphMode::Without;
break;
case rpr2::ActivateHelmetObservationEnum8::HelmetWithoutVest:
helmet = ProjectDataManagement::WphMode_def::With;
vest = ProjectDataManagement::WphMode_def::Without;
helmet = ProjectDataManagement::WphMode::With;
vest = ProjectDataManagement::WphMode::Without;
break;
case rpr2::ActivateHelmetObservationEnum8::HelmetAndVest:
helmet = ProjectDataManagement::WphMode_def::With;
vest = ProjectDataManagement::WphMode_def::With;
helmet = ProjectDataManagement::WphMode::With;
vest = ProjectDataManagement::WphMode::With;
break;
case rpr2::ActivateHelmetObservationEnum8::NoChange:
helmet = ProjectDataManagement::WphMode_def::NoChange;
vest = ProjectDataManagement::WphMode_def::NoChange;
helmet = ProjectDataManagement::WphMode::NoChange;
vest = ProjectDataManagement::WphMode::NoChange;
bNoChange = true;
break;
}
@@ -215,35 +215,35 @@ ProjectDataManagement::VulnerabilityState DamageModel::vulnerabilityState(qint64
{
int idx = indexForTime(simTimeMSec);
if (idx < 0)
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
switch (m_tacticalStates.at(idx).tss.TacticalStatus)
{
case rpr2::TacticalStatusEnum8::CombatReady:
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
case rpr2::TacticalStatusEnum8::LightHit:
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
return ProjectDataManagement::VulnerabilityState::LightDamage;
case rpr2::TacticalStatusEnum8::MediumHit:
return ProjectDataManagement::VulnerabilityState_def::MediumDamage;
return ProjectDataManagement::VulnerabilityState::MediumDamage;
case rpr2::TacticalStatusEnum8::HeavyHit:
return ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
return ProjectDataManagement::VulnerabilityState::HeavyDamage;
case rpr2::TacticalStatusEnum8::Immobilized:
return ProjectDataManagement::VulnerabilityState_def::MobilityKill;
return ProjectDataManagement::VulnerabilityState::MobilityKill;
case rpr2::TacticalStatusEnum8::ImmobilizedVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill;
return ProjectDataManagement::VulnerabilityState::VisibleMobilityKill;
case rpr2::TacticalStatusEnum8::WeaponKill:
return ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::WeaponSystemDamage;
case rpr2::TacticalStatusEnum8::WeaponKillVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage;
case rpr2::TacticalStatusEnum8::TotalKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::TacticalStatusEnum8::TemporaryFailure:
return ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
return ProjectDataManagement::VulnerabilityState::TemporarySeverance;
case rpr2::TacticalStatusEnum8::NearMiss:
return ProjectDataManagement::VulnerabilityState_def::NearMiss;
return ProjectDataManagement::VulnerabilityState::NearMiss;
case rpr2::TacticalStatusEnum8::HitWithoutEffect:
return ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect;
return ProjectDataManagement::VulnerabilityState::HitWithNoEffect;
}
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
}
int DamageModel::indexForTime(qint64 simTimeMSec) const
@@ -1231,33 +1231,33 @@ rpr2::HitResultEnum16::ET NgsConnector::getHitResultEnum(const ProjectDataManage
{
switch (ts.underlying())
{
case ProjectDataManagement::VulnerabilityState_def::CombatReady:
case ProjectDataManagement::VulnerabilityState::CombatReady:
return rpr2::HitResultEnum16::Reset;
case ProjectDataManagement::VulnerabilityState_def::LightDamage:
case ProjectDataManagement::VulnerabilityState::LightDamage:
return rpr2::HitResultEnum16::LightDamage;
case ProjectDataManagement::VulnerabilityState_def::MediumDamage:
case ProjectDataManagement::VulnerabilityState::MediumDamage:
return rpr2::HitResultEnum16::MediumDamage;
case ProjectDataManagement::VulnerabilityState_def::HeavyDamage:
case ProjectDataManagement::VulnerabilityState::HeavyDamage:
return rpr2::HitResultEnum16::HeavyDamage;
case ProjectDataManagement::VulnerabilityState_def::MobilityKill:
case ProjectDataManagement::VulnerabilityState::MobilityKill:
return rpr2::HitResultEnum16::MobilityKill;
case ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill:
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill:
return rpr2::HitResultEnum16::MobilityKillVisible;
case ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage:
return rpr2::HitResultEnum16::WeaponDamage;
case ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage:
return rpr2::HitResultEnum16::WeaponDamageVisible;
case ProjectDataManagement::VulnerabilityState_def::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
return rpr2::HitResultEnum16::TotalKill;
case ProjectDataManagement::VulnerabilityState_def::TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::TemporarySeverance:
return rpr2::HitResultEnum16::TemporaryFailure;
case ProjectDataManagement::VulnerabilityState_def::NearMiss:
case ProjectDataManagement::VulnerabilityState::NearMiss:
return rpr2::HitResultEnum16::NearMiss;
case ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect:
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect:
return rpr2::HitResultEnum16::HitWithNoEffect;
case ProjectDataManagement::VulnerabilityState_def::NContamination:
case ProjectDataManagement::VulnerabilityState_def::BContamination:
case ProjectDataManagement::VulnerabilityState_def::CContamination:
case ProjectDataManagement::VulnerabilityState::NContamination:
case ProjectDataManagement::VulnerabilityState::BContamination:
case ProjectDataManagement::VulnerabilityState::CContamination:
return rpr2::HitResultEnum16::Contaminated;
default:
return rpr2::HitResultEnum16::Reset;
@@ -1270,37 +1270,37 @@ ProjectDataManagement::VulnerabilityState NgsConnector::getTacticalStatusEnum(co
switch (hr)
{
case rpr2::HitResultEnum16::Reset:
return ProjectDataManagement::VulnerabilityState_def::CombatReady;
return ProjectDataManagement::VulnerabilityState::CombatReady;
case rpr2::HitResultEnum16::LightDamage:
return ProjectDataManagement::VulnerabilityState_def::LightDamage;
return ProjectDataManagement::VulnerabilityState::LightDamage;
case rpr2::HitResultEnum16::MediumDamage:
return ProjectDataManagement::VulnerabilityState_def::MediumDamage;
return ProjectDataManagement::VulnerabilityState::MediumDamage;
case rpr2::HitResultEnum16::HeavyDamage:
return ProjectDataManagement::VulnerabilityState_def::HeavyDamage;
return ProjectDataManagement::VulnerabilityState::HeavyDamage;
case rpr2::HitResultEnum16::MobilityKill:
return ProjectDataManagement::VulnerabilityState_def::MobilityKill;
return ProjectDataManagement::VulnerabilityState::MobilityKill;
case rpr2::HitResultEnum16::MobilityKillVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleMobilityKill;
return ProjectDataManagement::VulnerabilityState::VisibleMobilityKill;
case rpr2::HitResultEnum16::WeaponDamage:
return ProjectDataManagement::VulnerabilityState_def::WeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::WeaponSystemDamage;
case rpr2::HitResultEnum16::WeaponDamageVisible:
return ProjectDataManagement::VulnerabilityState_def::VisibleWeaponSystemDamage;
return ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage;
case rpr2::HitResultEnum16::TotalKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::HitResultEnum16::CheatingKill:
return ProjectDataManagement::VulnerabilityState_def::CatastrophicKill;
return ProjectDataManagement::VulnerabilityState::CatastrophicKill;
case rpr2::HitResultEnum16::NearMiss:
return ProjectDataManagement::VulnerabilityState_def::NearMiss;
return ProjectDataManagement::VulnerabilityState::NearMiss;
case rpr2::HitResultEnum16::HitWithNoEffect:
return ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect;
return ProjectDataManagement::VulnerabilityState::HitWithNoEffect;
case rpr2::HitResultEnum16::Contaminated:
return ProjectDataManagement::VulnerabilityState_def::CContamination;
return ProjectDataManagement::VulnerabilityState::CContamination;
case rpr2::HitResultEnum16::TemporaryFailure:
return ProjectDataManagement::VulnerabilityState_def::TemporarySeverance;
return ProjectDataManagement::VulnerabilityState::TemporarySeverance;
default:
return ProjectDataManagement::VulnerabilityState_def::NoChange;
return ProjectDataManagement::VulnerabilityState::NoChange;
}
return ProjectDataManagement::VulnerabilityState_def::NoChange;
return ProjectDataManagement::VulnerabilityState::NoChange;
}
QPolygonF NgsConnector::utmToGeogrphic(const QPolygonF &polyUtm, const LtsCoordTrans::UtmCoordinate &base)
@@ -1335,10 +1335,10 @@ void NgsConnector::onEntityIdentifierChanged(const rpr2::EntityIdentifierStruct
GuezHitStruct hs;
hs.originatorType = ProjectDataManagement::StateChangeOriginator_def::Initialization;
hs.originatorType = ProjectDataManagement::StateChangeOriginator::Initialization;
hs.sampleTime = QDateTime::currentDateTimeUtc().toMSecsSinceEpoch();
hs.targetId = is.entityNumber();
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hs.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
QTimer::singleShot(STATUS_WAIT_INTERVAL, this, [this, hs, obj]() mutable
{
@@ -1619,11 +1619,11 @@ bool NgsConnector::onTacticalStatusChanged(const rpr2::EntityIdentifierStruct &e
GuezHitStruct hitStruct;
hitStruct.originatorChargeTypeEtsString = TypeStruct::fromDisInt(0).toString();
hitStruct.originatorId = 0;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
hitStruct.position = m_observerPositions[is.entityNumber()].toGeoPosition();
hitStruct.sampleTime = simTimeMSecs;
hitStruct.targetId = is.entityNumber();
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::VulnerabilityBitsChanged;
hitStruct.vulnerabilityState = ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged;
hitStruct.vulnerabilityKind = 0;
const auto vulnerabilityBits = m_damageModelMap[is.entityNumber()]->totalState(hitStruct.sampleTime);
@@ -1910,31 +1910,31 @@ void NgsConnector::onNewGuezHit(const rpr2::IObserverGuezHitIntInstance &interac
GuezHitStruct hitStruct;
hitStruct.originatorChargeTypeEtsString = TypeStruct(interaction.getMunition()).toString();
hitStruct.originatorId = interaction.getOriginatorIdentifier().EntityNumber;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
switch (interaction.getOriginatorType())
{
case rpr2::OriginatorTypeEnum16::Unknown:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Unknown;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Unknown;
break;
case rpr2::OriginatorTypeEnum16::NoMedicalTreatment:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Participant;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Participant;
if (hitStruct.originatorId == 0)
hitStruct.originatorId = hitStruct.targetId;
break;
case rpr2::OriginatorTypeEnum16::Participant:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::Participant;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::Participant;
if (hitStruct.originatorId == 0)
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ExerciseControl;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ExerciseControl;
break;
case rpr2::OriginatorTypeEnum16::AreaEffectSimulation:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::AreaEffectSimulation;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation;
hitStruct.originatorId = IdentifierStruct(interaction.getOriginatorIdentifier()).toInt64();
break;
case rpr2::OriginatorTypeEnum16::ObserverController:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ObserverController;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ObserverController;
break;
case rpr2::OriginatorTypeEnum16::ExerciseControl:
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator_def::ExerciseControl;
hitStruct.originatorType = ProjectDataManagement::StateChangeOriginator::ExerciseControl;
break;
}
hitStruct.position = ParticipantPosition(interaction.getTargetLocation()).toGeoPosition();
@@ -1945,16 +1945,16 @@ void NgsConnector::onNewGuezHit(const rpr2::IObserverGuezHitIntInstance &interac
hitStruct.vulnerabilityState = getTacticalStatusEnum(interaction.getHitResult());
if ((hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator_def::ExerciseControl ||
hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator_def::ObserverController
if ((hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator::ExerciseControl ||
hitStruct.originatorType == ProjectDataManagement::StateChangeOriginator::ObserverController
)
&& hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::HitWithNoEffect)
&& hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState::HitWithNoEffect)
{
auto ptr = m_damageModelMap.value(eqNo);
if (ptr)
{
hitStruct.vulnerabilityState = ptr->vulnerabilityState(hitStruct.sampleTime);
if (hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady)
if (hitStruct.vulnerabilityState == ProjectDataManagement::VulnerabilityState::CombatReady)
ptr->setTacticalStatus(rpr2::HitResultEnum16::Reset, simTimeToMSec(interaction.getReceiveTimeStamp()));
}
}
@@ -130,12 +130,12 @@ struct GuezHitStruct
{
qint32 targetId = 0;
qint64 sampleTime = 0;
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState_def::get_default();
ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::get_default();
qint32 vulnerabilityKind = 0;
qint32 vulnerabilityBits = 0;
Core::GeoPosition position = Core::GeoPosition(0, 0, 0);
qint64 originatorId = 0;
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator_def::get_default();
ProjectDataManagement::StateChangeOriginator originatorType = ProjectDataManagement::StateChangeOriginator::get_default();
QString originatorChargeTypeEtsString;
};
@@ -109,7 +109,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
ERROR_LOG(m_logger) << "Try send notification0";
m_aesId = replyObject.id();
ProjectDataManagement::EffectSource effectSource
= static_cast<ProjectDataManagement::EffectSource::type>(propertiesObject.value(QStringLiteral("effectSource")).toInt());
= static_cast<ProjectDataManagement::EffectSource>(propertiesObject.value(QStringLiteral("effectSource")).toInt());
ERROR_LOG(m_logger) << "Try send notification1 " << effectSource;
if (effectSource != ProjectDataManagement::EffectSource::ES_ADLER)
@@ -178,7 +178,7 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep
addr.isRead(false);
const OperatorManagement::User user = m_mainDispatcher->ddsHandler()->dtcOpm()->user(recipientId);
addr.name(user.name());
addr.addressType(NotificationManagement::AddressType_def::Operator);
addr.addressType(NotificationManagement::AddressType::Operator);
recipentVec.emplace_back(addr);
}
req.notification().recipientIds(recipentVec);
@@ -252,7 +252,7 @@ void AesHandler::onAirSupportImpactModifyReply(const Core::FunctionReplyObject &
void AesHandler::handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::CreateSingleExplosion &data)
{
auto strFromObj = QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact);
m_singleExplosions.insert(data.aesDdsId, AreaEffectSimulation::AesEffectState_def::EsCreated);
m_singleExplosions.insert(data.aesDdsId, AreaEffectSimulation::AesEffectState::EsCreated);
DEBUG_LOG(m_logger) << "TEST SINGLE EXPLOSION CREATED " << strFromObj;
}
@@ -958,11 +958,11 @@ QList<qint32> AesHandler::findAllPendingEffectCluster(int partyId)
{
if (effectCluster.partyId() != partyId)
continue;
if (effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsReceived
&& effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsCreated)
if (effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState::EsReceived
&& effectCluster.effectStateId() != AreaEffectSimulation::AesEffectState::EsCreated)
continue;
if (effectCluster.effectSourceId() != ProjectDataManagement::EffectSource_def::ES_ADLER /*&&
effectCluster.effectSourceId() != ProjectDataManagement::EffectSource_def::ES_ADLER_STANDALONE*/)
if (effectCluster.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER /*&&
effectCluster.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE*/)
continue;
ret.append(effectCluster.id());
@@ -1096,8 +1096,8 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS
m_singleExplosions.insert(data.id(), data.effectStateId());
return;
}
if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated
&& m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState_def::EsActivated)
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated
&& m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState::EsActivated)
{
const auto state = data.effectStateId();
DEBUG_LOG(m_logger) << "----------------- switch state ------------- " << state;
@@ -173,8 +173,8 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
int prio = s->getInteger(QStringLiteral("NOM/notificationPriority"), 3);
DEBUG_LOG(m_logger) << " Setting: NotificationPriority: " << prio;
notif.priority(static_cast<NotificationManagement::Priority_def::type>(prio));
notif.processedPriority(NotificationManagement::Priority_def::Low);
notif.priority(static_cast<NotificationManagement::Priority>(prio));
notif.processedPriority(NotificationManagement::Priority::Low);
notif.exerciseId(m_exerciseId);
for (const auto &userId : m_opmDtc->getOperatorsByOperatorRight(OperatorRights::FileManagementFilesEdit))
@@ -183,7 +183,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con
addr.addressId(userId);
addr.isRead(false);
addr.name(m_opmDtc->user(userId).name());
addr.addressType(NotificationManagement::AddressType_def::Operator);
addr.addressType(NotificationManagement::AddressType::Operator);
notif.recipientIds().push_back(addr);
}
@@ -120,7 +120,7 @@ int JsonDispatcher::getAssetId(const QString &saaName) const
for (const auto &currAsset : m_mainDispatcher->asmHandler()->getDtc()->assets())
{
if (currAsset.assetTypeId() != AssetManagement::AssetType_def::AdlerSAA)
if (currAsset.assetTypeId() != AssetManagement::AssetType::AdlerSAA)
continue;
const auto &dbSaa = saaNameFromProps(currAsset.properties());
@@ -335,7 +335,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const
DEBUG_LOG(m_logger) << "onSAARegistration modifyParty"
<< " ==> SAA name " << saaName;
createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "Reconnect to SAA")),
NotificationManagement::MessageType_def::Success,
NotificationManagement::MessageType::Success,
NotificationManagement::NotificationType::AdlerNotification,
saaName,
{});
@@ -357,7 +357,7 @@ void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId)
const int assetId = getAssetId(saa->getSAAName());
DEBUG_LOG(m_logger) << "Deregistation from " << saa->getSAAName();
createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "SAADeregistration")),
NotificationManagement::MessageType_def::Info,
NotificationManagement::MessageType::Info,
NotificationManagement::NotificationType::AdlerNotification,
saa->getSAAName(),
{});
@@ -424,7 +424,7 @@ void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status)
}
createNotificationRequest(wsId,
title,
NotificationManagement::MessageType_def::Success,
NotificationManagement::MessageType::Success,
NotificationManagement::NotificationType::AdlerNotification,
saa->getSAAName(),
{});
@@ -465,7 +465,7 @@ void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten
args << exceptionStatus.beschreibung;
createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification","Error Message from SAA")),
NotificationManagement::MessageType_def::Error,
NotificationManagement::MessageType::Error,
NotificationManagement::NotificationType::AdlerNotification,
content,
args);
@@ -547,7 +547,7 @@ void JsonDispatcher::sendParticipantInfoNotification(const int wsId, const int p
createNotificationRequest(wsId,
QString::fromUtf8(tr_lts("Notification","Loading Point Position Report")),
NotificationManagement::MessageType_def::Info,
NotificationManagement::MessageType::Info,
NotificationManagement::NotificationType::AdlerNotification,
content,
args);
@@ -664,7 +664,7 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer
}
createNotificationRequest(wsId,
QString::fromUtf8(tr_lts("Notification","Hold your fire")),
NotificationManagement::MessageType_def::Info,
NotificationManagement::MessageType::Info,
NotificationManagement::NotificationType::CombatOrder,
saa->getSAAName(),
{});
@@ -811,7 +811,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.koordinate.longitude = request.positionTarget().lon() * 180.0 / M_PI;
exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.hoehe = request.positionTarget().z();
exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = ProjectDataManagement::L26_EffectingSystemType::inner_enum(request.weaponSystemType().underlying() + 1);
exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = ProjectDataManagement::L26_EffectingSystemType(request.weaponSystemType().underlying() + 1);
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying();
DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem;
@@ -917,8 +917,8 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
notif.contentArgs(args);
notif.timeStamp(currentTime);
notif.expiryTime(expiryTime);
notif.priority(NotificationManagement::Priority_def::High);
notif.processedPriority(NotificationManagement::Priority_def::High);
notif.priority(NotificationManagement::Priority::High);
notif.processedPriority(NotificationManagement::Priority::High);
notif.exerciseId(m_mainDispatcher->exerciseId());
const QVector<int> recipientIds = m_mainDispatcher->ddsHandler()->dtcOpm()->getNotificationRecipents(m_mainDispatcher->exerciseId(),
@@ -937,7 +937,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
addr.isRead(false);
const OperatorManagement::User user = m_mainDispatcher->ddsHandler()->dtcOpm()->user(recipientId);
addr.name(user.name());
addr.addressType(NotificationManagement::AddressType_def::Operator);
addr.addressType(NotificationManagement::AddressType::Operator);
notif.recipientIds().push_back(addr);
DEBUG_LOG(m_logger) << "recipientId=" << addr.name()
<< ", addr.addressId=" << addr.addressId();
@@ -945,7 +945,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId,
NotificationManagement::Address addrSender;
addrSender.name(saa->getSAAName().toStdString());
addrSender.addressType(NotificationManagement::AddressType_def::Service);
addrSender.addressType(NotificationManagement::AddressType::Service);
notif.sender(addrSender);
data.notification(notif);
@@ -105,7 +105,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::Init &data)
msg.originatorType = TrainingAreaBase::TetraIcd::OriginatorType::ExerciseControl;
msg.tasVitality = 100;
msg.vulnerabilityBits = 0;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::CombatReady;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CombatReady;
m_sendToDds->rxData(msg);
return true;
@@ -193,7 +193,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::CesHitRequest &data)
msg.chargeTypeId = data.chargeTasCodeDirect;
msg.header.equipmentNumber = eqId;
msg.header.timeStamp = data.header.timeStamp;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::CatastrophicKill;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CatastrophicKill;
msg.originatorId = data.originatorEquipmentNumber;
DEBUG_LOG(m_logger) << "sending state change direct (kill) with jamming for eqId " << msg.header.equipmentNumber;
@@ -213,7 +213,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::DemandVulnerabilityStateC
const auto &pData = m_dtcPpm->dynamicParticipantData(p);
for (const auto &dyn : pData.stateHistory())
{
if (dyn.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CatastrophicKill)
if (dyn.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
{
return false;
}
@@ -235,7 +235,7 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA
msg.originatorType = TrainingAreaBase::TetraIcd::OriginatorType::Initialisation;
msg.tasVitality = 100;
msg.vulnerabilityBits = 0;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::CombatReady;
msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::VulnerabilityState_CombatReady;
m_sendToDds->rxData(msg);
@@ -6,6 +6,8 @@
#include "WebSocketInterface/json_keys.h"
#include "WebSocketInterface/data_manager.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonDocument>
#include <QtCore/QUuid>
@@ -42,12 +44,14 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS
ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: LtsWebSocket::AbstractClientMessage(client, type, typeId, uuid, data)
, m_dataManager(dataManager)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
SendBiteRequest::SendBiteRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data) : ClientMessage(dataManager, client, type, typeId, uuid, data),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
SendBiteRequest::SendBiteRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data)
: ClientMessage(dataManager, client, type, typeId, uuid, data)
{}
void SendBiteRequest::process()
{
@@ -108,9 +108,9 @@ PositionMessage::PositionMessage(const PositionMessage::PositionData &data, cons
{
m_jsonRepresentation.insert(DATA(),
QJsonObject({{EQUIP_NO(), data.equipNo},
{POS_LAT(), data.pos.lat()},
{POS_LON(), data.pos.lon()},
{POS_Z(), data.pos.z()},
{POS_LAT(), data.pos.lat},
{POS_LON(), data.pos.lon},
{POS_Z(), data.pos.z},
{LAST_POSITION_UPDATE(), data.gpsTime}
}));
}
@@ -23,9 +23,9 @@ DataManager::DataManager(MainHandler *mainHandler)
LtsWebSocket::ReplyMessage* DataManager::sendBiteRequest(const QString &uuid, int equipNo)
{
DemandBiteRequest request;
request.equipmentNumbers().push_back(equipNo);
request.withSelfTest(true);
request.requestId(s_requestId++);
request.equipmentNumbers.push_back(equipNo);
request.withSelfTest = true;
request.requestId = s_requestId++;
rti::core::SampleIdentity sampleIdentity;
m_mainHandler->ftsHandler()->onDemandBiteRequest(sampleIdentity, request);
@@ -7,6 +7,7 @@
#include "WebSocketInterface/Messages/client_message.h"
#include "WebSocketInterface/Messages/reply_message.h"
#include "settings.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace TrainingAreaBase
{
@@ -19,6 +20,7 @@ WebSocketInterfaceHandler::WebSocketInterfaceHandler(MainHandler *mainHandler, Q
, m_messageFactory(nullptr)
, m_dataManager(nullptr)
, m_mainHandler(mainHandler)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
}
@@ -60,7 +60,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
assert(m_dtcPartitionTime.get());
m_dtcPartitionTime->setSubscriberCallback([this](const Core::PartitionTime & data, DataModification)
{
m_curMSecSinceEpoch = data.timeStamp();
m_curMSecSinceEpoch = data.timeStamp;
});
// default dts:...
@@ -3,12 +3,14 @@
#include "exm_handler.h"
#include "main_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace TrainingAreaBase
{
ExmHandler::ExmHandler(MainHandler *mainHandler)
: m_mainHandler(mainHandler)
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_mainHandler(mainHandler)
{}
bool ExmHandler::init()
@@ -35,7 +37,7 @@ ExerciseManagement::Exercise ExmHandler::exercise(int exerciseId)
void ExmHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
{
if (!data.radioGroupId().is_set() || data.radioGroupId().get() == 0)
if (!data.radioGroupId.is_set() || data.radioGroupId.get() == 0)
modType = DataModification::eRemoved;
bool bExercise2RadioGroupChanged = false;
@@ -44,17 +46,17 @@ void ExmHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, Dat
case DataModification::eAdded:
case DataModification::eModified:
{
auto &val = m_exercise2RadioGroup[data.id()];
if (val != data.radioGroupId().get())
auto &val = m_exercise2RadioGroup[data.id];
if (val != data.radioGroupId.get())
{
bExercise2RadioGroupChanged = true;
val = data.radioGroupId().get();
val = data.radioGroupId.get();
}
break;
}
case DataModification::eRemoved:
{
auto it = m_exercise2RadioGroup.find(data.id());
auto it = m_exercise2RadioGroup.find(data.id);
if (it != m_exercise2RadioGroup.end())
{
bExercise2RadioGroupChanged = true;
@@ -5,6 +5,7 @@
#include <utility>
#include "main_handler.h"
#include "settings.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QJsonDocument>
#include <QJsonParseError>
#include <QtCore/QJsonObject>
@@ -114,8 +115,8 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode)
void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::InstrumentationAsset &data, DataModification modType)
{
if (data.mountingPointTypeId() != InfrastructureManagement::MountingPointType::IndoorIPS &&
data.mountingPointTypeId() != InfrastructureManagement::MountingPointType::OutdoorIPS)
if (data.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorIPS &&
data.mountingPointTypeId != InfrastructureManagement::MountingPointType::OutdoorIPS)
return;
switch (modType)
{
@@ -127,19 +128,19 @@ void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::I
QHashIterator<int, OpsData> i(m_opsData);
while (i.hasNext()) {
i.next();
if ( i.value().assetId == data.id())
if ( i.value().assetId == data.id)
{
opsCode = i.value().opsCode;
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id();
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id;
break;
}
}
OpsData &d = m_opsData[opsCode];
d.assetId = data.id();
d.opsCode = getOpsCodeFromJSon(data.properties());
d.opsTunnel = getIsOpsTunnel(data.properties());
d.mountingPointTypeId = data.mountingPointTypeId().underlying();
d.assetId = data.id;
d.opsCode = getOpsCodeFromJSon(data.properties);
d.opsTunnel = getIsOpsTunnel(data.properties);
d.mountingPointTypeId = static_cast<int>(data.mountingPointTypeId);
updateOpsData(d);
break;
}
@@ -149,10 +150,10 @@ void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::I
QHashIterator<int, OpsData> i(m_opsData);
while (i.hasNext()) {
i.next();
if ( i.value().assetId == data.id())
if ( i.value().assetId == data.id)
{
opsCode = i.value().opsCode;
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id();
DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id;
break;
}
}
@@ -171,17 +172,17 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou
{
OpsData opsData;
opsData.opsCode = m_dtcIsm->getOpticalCodeFromAssetId(data.assetId());
opsData.assetId = data.assetId();
opsData.opsCode = m_dtcIsm->getOpticalCodeFromAssetId(data.assetId);
opsData.assetId = data.assetId;
updateOpsData(opsData, true);
break;
}
case DataModification::eRemoved:
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged Unmount id=" << data.id()
<< " assetId=" << data.assetId();
DEBUG_LOG(m_logger) << "onMountingPointAssetChanged Unmount id=" << data.id
<< " assetId=" << data.assetId;
removeOpsAsset(data.assetId());
removeOpsAsset(data.assetId);
break;
}
}
@@ -196,12 +197,12 @@ void IsmHandler::rotateBuildingFootprint(int mseId)
return;
}
InfrastructureManagement::MainStructureElement mse = m_dtcIsm->mainStructureElement(mseId);
TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition());
TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition);
DEBUG_LOG(m_logger) << " mainStructureElements.Rotate id=" << mseId;
QTransform matrix;
QPolygonF relBuildingFootprintMgrs;
qreal angle = mse.angle();
qreal angle = mse.angle;
matrix.rotate(angle);
const QPolygonF relBuildingFootprint = m_relBuildingFootprints.value(mseId);
const QPolygonF relBuildingFootprintRotated = matrix.map(relBuildingFootprint);
@@ -233,21 +234,21 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
int exerciseId = m_mainHandler->ddsHandler()->getExerciseId();
if ( !m_dtcIsm->isElementAssignedToExercise(data, exerciseId))
{
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove";
INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id << " remove";
m_buildingBoundingBoxes.remove(data.id());
m_relBuildingFootprints.remove(data.id());
m_relBuildingFootprintsRotated.remove((data.id()));
m_buildingBoundingBoxesMgrs.remove(data.id());
m_relBuildingFootprintsRotatedMgrs.remove(data.id());
m_buildingBoundingBoxes.remove(data.id);
m_relBuildingFootprints.remove(data.id);
m_relBuildingFootprintsRotated.remove((data.id));
m_buildingBoundingBoxesMgrs.remove(data.id);
m_relBuildingFootprintsRotatedMgrs.remove(data.id);
for (const auto &se : data.elements())
for (const auto &se : data.elements)
{
if (se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::OutdoorIPS)
if (se.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId != InfrastructureManagement::MountingPointType::OutdoorIPS)
continue;
removeOpsDataByStructureElementId(se.id());
removeOpsDataByStructureElementId(se.id);
}
@@ -255,7 +256,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
while (iter.hasNext())
{
iter.next();
if (iter.value().mainStructureElementId == data.id())
if (iter.value().mainStructureElementId == data.id)
{
DEBUG_LOG(m_logger) << "remove from m_opsData, key=" << iter.key();
iter.remove();
@@ -270,36 +271,36 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
for (const InfrastructureManagement::StructureElement &se : data.elements())
for (const InfrastructureManagement::StructureElement &se : data.elements)
{
if (se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::OutdoorIPS)
if (se.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId != InfrastructureManagement::MountingPointType::OutdoorIPS)
continue;
auto it = std::find_if(m_opsData.begin(), m_opsData.end(), [se](const OpsData & d)
{
return d.structureElementId == se.id();
return d.structureElementId == se.id;
});
if (it != m_opsData.end())
updateOpsData(it.value());
}
DEBUG_LOG(m_logger) << " mainStructureElements Vor Rotate id=" << data.id();
DEBUG_LOG(m_logger) << " mainStructureElements Vor Rotate id=" << data.id;
QMap<int, InfrastructureManagement::MainFootprint> mainFootprints = m_dtcIsm->getFootprintsByExerciseId(exerciseId);
if (mainFootprints.contains(data.id()))
if (mainFootprints.contains(data.id))
{
rotateBuildingFootprint(data.id());
rotateBuildingFootprint(data.id);
}
break;
}
case DataModification::eRemoved:
for (const auto &se : data.elements())
for (const auto &se : data.elements)
{
if (se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId() != InfrastructureManagement::MountingPointType::OutdoorIPS)
if (se.mountingPointTypeId != InfrastructureManagement::MountingPointType::IndoorIPS &&
se.mountingPointTypeId != InfrastructureManagement::MountingPointType::OutdoorIPS)
continue;
removeOpsDataByStructureElementId(se.id());
removeOpsDataByStructureElementId(se.id);
}
break;
}
@@ -307,8 +308,8 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M
void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFootprint &data, DataModification modType)
{
DEBUG_LOG(m_logger) << "onMainFootprintChanged id=" << data.id()
<< " size=" << data.elements().size();
DEBUG_LOG(m_logger) << "onMainFootprintChanged id=" << data.id
<< " size=" << data.elements.size();
switch (modType)
{
@@ -317,22 +318,22 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot
{
DEBUG_LOG(m_logger) << "mainStructureElements onMainFootprintChanged id=" << data.id();
DEBUG_LOG(m_logger) << "mainStructureElements onMainFootprintChanged id=" << data.id;
double minX = 0;
double maxX = 0;
double minY = 0;
double maxY = 0;
QPolygonF relBuildingFootprint;
relBuildingFootprint.reserve(data.elements().size());
for (const InfrastructureManagement::FootprintElement &fpElem : data.elements())
relBuildingFootprint.reserve(data.elements.size());
for (const InfrastructureManagement::FootprintElement &fpElem : data.elements)
{
const Core::RelativePosition &relPos = fpElem.relPosition();
minX = std::min(minX, relPos.offsetX());
maxX = std::max(maxX, relPos.offsetX());
minY = std::min(minY, relPos.offsetY());
maxY = std::min(maxY, relPos.offsetY());
const Core::RelativePosition &relPos = fpElem.relPosition;
minX = std::min(minX, relPos.offsetX);
maxX = std::max(maxX, relPos.offsetX);
minY = std::min(minY, relPos.offsetY);
maxY = std::min(maxY, relPos.offsetY);
QPointF point(relPos.offsetX(), relPos.offsetY());
QPointF point(relPos.offsetX, relPos.offsetY);
relBuildingFootprint.append(point);
DEBUG_LOG(m_logger) << "relBuildingFootprint.append() " << point.x() << "/" << point.y() << ")";
@@ -349,12 +350,12 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot
QPointF boundingBoxBottomRight(maxX + m_distanceIpsToGps, minY - m_distanceIpsToGps);
QRectF BoundingBox(boundingBoxTopLeft, boundingBoxBottomRight);
m_buildingBoundingBoxes.insert(data.id(), BoundingBox);
m_buildingBoundingBoxes.insert(data.id, BoundingBox);
m_relBuildingFootprints.insert(data.id(), relBuildingFootprint);
m_relBuildingFootprints.insert(data.id, relBuildingFootprint);
for (const QPointF &p : std::as_const(relBuildingFootprint))
DEBUG_LOG(m_logger) << "relBuildingFootprint = " << p.x() << "/" << p.y();
rotateBuildingFootprint(data.id());
rotateBuildingFootprint(data.id);
break;
}
case DataModification::eRemoved:
@@ -451,24 +452,24 @@ void IsmHandler::updateOpsData(OpsData &data, bool force)
if (!force && !m_dtcIsm->isElementAssignedToExercise(mse, exerciseId))
continue;
for (const InfrastructureManagement::StructureElement &se : mse.elements())
for (const InfrastructureManagement::StructureElement &se : mse.elements)
{
if (se.id() == seId)
if (se.id == seId)
{
data.structureElementId = seId;
data.mainStructureElementId = mse.id();
data.mainStructureElementId = mse.id;
if (se.path().size() > 1)
data.roomId = se.path().at(se.path().size() - 2);
data.position = se.geoPosition();
data.position.z(data.position.z() - mse.geoPosition().z());
m_structure_ElementId2AssetTypeId[seId] = se.mountingPointTypeId().underlying();
if (se.path.size() > 1)
data.roomId = se.path.at(se.path.size() - 2);
data.position = se.geoPosition;
data.position.z = data.position.z - mse.geoPosition.z;
m_structure_ElementId2AssetTypeId[seId] = static_cast<int>(se.mountingPointTypeId);
DEBUG_LOG(m_logger) << "found position for asset " << data.assetId << " with se id " << seId
<< " " << data.position.lon() << "/" << data.position.lat() << "/" << data.position.z()
<< " name=" << se.name()
<< " type=" << se.mountingPointTypeId()
<< " " << data.position.lon << "/" << data.position.lat << "/" << data.position.z
<< " name=" << se.name
<< " type=" << se.mountingPointTypeId
<< " m_structure_ElementId2AssetTypeId.size()=" << m_structure_ElementId2AssetTypeId.size();
data.mountingPointTypeId = se.mountingPointTypeId().underlying();
data.mountingPointTypeId = static_cast<int>(se.mountingPointTypeId);
m_opsData[data.opsCode] = data;
return;
@@ -487,11 +488,11 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons
return false;
switch (mountPointTypeId) {
case InfrastructureManagement::MountingPointType_def::OutdoorIPS:
case static_cast<int>(InfrastructureManagement::MountingPointType::OutdoorIPS):
DEBUG_LOG(m_logger) << "posInExtendedBuildingFootprint Distance = m_distanceOpsToGps";
distance = m_distanceOpsToGps;
break;
case InfrastructureManagement::MountingPointType_def::IndoorIPS:
case static_cast<int>(InfrastructureManagement::MountingPointType::IndoorIPS):
DEBUG_LOG(m_logger) << "posInExtendedBuildingFootprint Distance = m_distanceIpsToGps";
distance = m_distanceIpsToGps;
break;
@@ -516,7 +517,7 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons
return false;
TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition());
TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition);
TetraIcd::RelativePosition relPosition = m_mainHandler->posHandler()->geographicToRelative(position);
DEBUG_LOG(m_logger) << "relBldgPosition=" << relBldgPosition.offsetX << "/" << relBldgPosition.offsetY
<< ", relPosition=" << relPosition.offsetX << "/" << relPosition.offsetY;
@@ -178,7 +178,7 @@ bool MainHandler::init(int domainId, int exerciseId)
ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed.";
return false;
}
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::CorePortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}"));
DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful.";
@@ -199,15 +199,15 @@ ProjectDataManagement::RadioGroup MainHandler::exerciseRadioGroup() const
const QMap<int, ProjectDataManagement::RadioGroup> radioGrps = m_pdmHandler->radioGroups();
for (auto it = radioGrps.begin(); it != radioGrps.end(); ++it)
if (it.value().base_group())
if (it.value().base_group)
return it.value();
return ProjectDataManagement::RadioGroup();
}
const auto ex = m_exmHandler->exercise(exerciseId());
if (ex.radioGroupId().is_set())
return m_pdmHandler->radioGroup(ex.radioGroupId().get());
if (ex.radioGroupId.is_set())
return m_pdmHandler->radioGroup(ex.radioGroupId.get());
return ProjectDataManagement::RadioGroup();
}
@@ -252,7 +252,7 @@ TetraIcd::ExerciseEnvironmentData MainHandler::exerciseEnvironmentData() const
exData.utmZone = baseCoord.zone;
exData.grid = zone.mid(3, 2).toStdString();
exData.utmBand = zone.mid(2, 1).at(0).toLatin1();
exData.timeZone = m_exerciseData.defaultTimeZone();
exData.timeZone = m_exerciseData.defaultTimeZone;
return exData;
}
@@ -261,11 +261,11 @@ TetraIcd::ExerciseStateData MainHandler::exerciseStateData() const
{
TetraIcd::ExerciseStateData exData;
if (m_exerciseData.id() != exerciseId())
if (m_exerciseData.id != exerciseId())
return exData;
exData.exerciseId = m_exerciseData.id();
exData.exerciseState = static_cast<TetraIcd::ExerciseStateData::ExerciseState>(m_exerciseData.state().underlying());
exData.exerciseId = m_exerciseData.id;
exData.exerciseState = static_cast<TetraIcd::ExerciseStateData::ExerciseState>(m_exerciseData.state);
return exData;
}
@@ -279,7 +279,7 @@ TetraIcd::ExerciseEquipmentAssignmentComplete MainHandler::exerciseEquipmentAssi
for (const auto &it : exercises)
{
const ProjectDataManagement::RadioGroup rg = radioGroups.value(it.second);
if (rg.id() == 0)
if (rg.id == 0)
{
WARNING_LOG(m_logger) << "Got a radio group id " << it.second << " for exercise " << it.first
<< " but could not find valid data for it - ignoring!";
@@ -287,9 +287,9 @@ TetraIcd::ExerciseEquipmentAssignmentComplete MainHandler::exerciseEquipmentAssi
}
TrainingAreaBase::TetraIcd::GroupIssiInformation gissi;
gissi.exerciseId = it.first;
gissi.serverIssi = rg.issi();
gissi.broadcastIssi1 = rg.group_issi1();
gissi.broadcastIssi2 = rg.group_issi2();
gissi.serverIssi = rg.issi;
gissi.broadcastIssi1 = rg.group_issi1;
gissi.broadcastIssi2 = rg.group_issi2;
eeac.groupIssiInformation.push_back(std::move(gissi));
}
return eeac;
@@ -325,7 +325,7 @@ int MainHandler::domainId() const
void MainHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
{
if (data.id() != exerciseId())
if (data.id != exerciseId())
return;
m_exerciseData = data;
@@ -359,9 +359,8 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState)
DEBUG_LOG(m_logger) << "Publishing connection states: " << m_ifcConnectionState.size();
TrainingAreaBase::Connections connections;
connections.id(1);
for (auto it = m_ifcConnectionState.cbegin(); it != m_ifcConnectionState.cend(); ++it)
connections.connections().push_back(
connections.id = 1; for (auto it = m_ifcConnectionState.cbegin(); it != m_ifcConnectionState.cend(); ++it)
connections.connections.push_back(
TrainingAreaBase::ConnectionState(it.key().toStdString(), it.value()));
m_ddsHandler->dtsTab()->publish(connections);
@@ -395,9 +394,9 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
QString isOk;
for (const ProjectDataManagement::CanComponentString &ccs : qAsConst(m_ccsMap))
{
if (ccs.bitMask() == bitValue)
if (ccs.pdm_bitMask == bitValue)
{
name = m_pdmHandler->dtc()->trCanComponentStringName(ccs.id());
name = m_pdmHandler->dtc()->trCanComponentStringName(ccs.id);
break;
}
}
@@ -442,28 +441,24 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
QString text;
QJsonObject error = ele.toObject();
ParticipantManagement::BiteError bitError;
bitError.canDeviceNumber(error.value(QStringLiteral("canDeviceNumber")).toInt());
bitError.errorNumber(error.value(QStringLiteral("errorNumber")).toInt());
bitError.subdeviceNumber(error.value(QStringLiteral("subdeviceNumber")).toInt());
bitError.uniqueId(error.value(QStringLiteral("uniqueId")).toInt());
if (bitError.subdeviceNumber() != 0)
bitError.canDeviceNumber = error.value(QStringLiteral("canDeviceNumber")).toInt(); bitError.errorNumber = error.value(QStringLiteral("errorNumber")).toInt(); bitError.subdeviceNumber = error.value(QStringLiteral("subdeviceNumber")).toInt(); bitError.uniqueId = error.value(QStringLiteral("uniqueId")).toInt();
if (bitError.subdeviceNumber != 0)
text = (tr("Error: %1 \nComponent: %2 \nSubdev: %3 \nUId: %4 ")
.arg(getErrorString(bitError),
getCanDeviceName(bitError.canDeviceNumber()),
getSubDeviceName(bitError.subdeviceNumber()))
.arg(QString::number( bitError.uniqueId(), 16 ).toUpper()));
getCanDeviceName(bitError.canDeviceNumber),
getSubDeviceName(bitError.subdeviceNumber))
.arg(QString::number( bitError.uniqueId, 16 ).toUpper()));
else if (bitError.canDeviceNumber() != 0)
else if (bitError.canDeviceNumber != 0)
text = (tr("Error: %1 \nComponent: %2")
.arg(getErrorString(bitError),
getCanDeviceName(bitError.canDeviceNumber())));
getCanDeviceName(bitError.canDeviceNumber)));
WebSocketInterface::Messages::BiteDataMessage::BiteError biteErrorLocal;
biteErrorLocal.deviceId = bitError.canDeviceNumber();
biteErrorLocal.subDevice = bitError.subdeviceNumber();
biteErrorLocal.errorNo = bitError.errorNumber();
biteErrorLocal.uniqueId = bitError.uniqueId();
biteErrorLocal.deviceId = bitError.canDeviceNumber;
biteErrorLocal.subDevice = bitError.subdeviceNumber;
biteErrorLocal.errorNo = bitError.errorNumber;
biteErrorLocal.uniqueId = bitError.uniqueId;
WebSocketInterface::Messages::BiteDataMessage::ErrorText errorT;
errorT.lang = QStringLiteral("de_DE");
@@ -483,22 +478,22 @@ void MainHandler::onDirectMessage(const QByteArray &jsonMessage)
QString MainHandler::getErrorString(const ParticipantManagement::BiteError &error) const
{
const bool subDevice = (error.subdeviceNumber() != 0);
const bool subDevice = (error.subdeviceNumber != 0);
for (const ProjectDataManagement::BiteComponentText &bct : m_bctMap)
{
if (((subDevice && bct.subDeviceId() == error.subdeviceNumber()) ||
(bct.canDeviceId() == error.canDeviceNumber())) &&
(bct.errorNumber() == error.errorNumber()))
return m_pdmHandler->dtc()->trBiteComponentTextName(bct.id());
if (((subDevice && bct.subDeviceId == error.subdeviceNumber) ||
(bct.canDeviceId == error.canDeviceNumber)) &&
(bct.errorNumber == error.errorNumber))
return m_pdmHandler->dtc()->trBiteComponentTextName(bct.id);
}
return tr("Unknown (%1)").arg(error.errorNumber());
return tr("Unknown (%1)").arg(error.errorNumber);
}
QString MainHandler::getCanDeviceName(int id) const
{
for (const ProjectDataManagement::CanComponentString &ccs : m_ccsMap)
{
if (ccs.canDeviceId() == id)
return m_pdmHandler->dtc()->trCanComponentStringName(ccs.id());
if (ccs.canDeviceId == id)
return m_pdmHandler->dtc()->trCanComponentStringName(ccs.id);
}
return tr("Unknown (%1)").arg(id);
}
@@ -507,8 +502,8 @@ QString MainHandler::getSubDeviceName(int id) const
{
for (const ProjectDataManagement::CanComponentString &ccs : m_ccsMap)
{
if (ccs.subDeviceId() == id)
return m_pdmHandler->dtc()->trCanComponentStringName(ccs.id());
if (ccs.subDeviceId == id)
return m_pdmHandler->dtc()->trCanComponentStringName(ccs.id);
}
return tr("Unknown (%1)").arg(id);
}
@@ -517,8 +512,8 @@ void MainHandler::onPositionChanged(int equipNo, const ParticipantManagement::Pa
{
WebSocketInterface::Messages::PositionMessage::PositionData positionData;
positionData.equipNo = equipNo;
positionData.pos = pos.pos();
positionData.gpsTime = pos.sampleTime();
positionData.pos = pos.pos;
positionData.gpsTime = pos.sampleTime;
WebSocketInterface::Messages::PositionMessage *msg = new WebSocketInterface::Messages::PositionMessage(positionData, QUuid::createUuid().toString());
@@ -98,7 +98,7 @@ private:
std::shared_ptr<DbHandler> m_dbHandler;
std::shared_ptr<RecvFromTab> m_rxHandler;
std::shared_ptr<RecvFromDdsFts> m_ftsHandler;
std::shared_ptr<SendToTab> m_txHandler;
std::shared_ptr<TxMixin> m_txHandler;
std::shared_ptr<RecvFromDdsAes> m_aesHandler;
std::shared_ptr<IsmHandler> m_ismHandler;
std::shared_ptr<ExmHandler> m_exmHandler;
@@ -6,6 +6,7 @@
#include "main_handler.h"
#include <ProjectDataManagement/pdm_dtc.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace TrainingAreaBase
{
@@ -66,9 +67,9 @@ bool PdmHandler::initializePdm()
auto cbTasVulKind = [this](const ProjectDataManagement::VulnerabilityKind &k)
{
const int realTasKindId = k.taVulnerabilityKind() & 0x00FFFFFF;
const int realTypeId = (k.taVulnerabilityKind() & 0x00FF0000) >> 16;
const int fallbackTypeId = (k.taVulnerabilityKind() & 0xFF000000) >> 24;
const int realTasKindId = k.taVulnerabilityKind & 0x00FFFFFF;
const int realTypeId = (k.taVulnerabilityKind & 0x00FF0000) >> 16;
const int fallbackTypeId = (k.taVulnerabilityKind & 0xFF000000) >> 24;
m_vulnerabilityKinds[realTasKindId] = k;
TRACE_LOG(m_logger) << "realTasKindId: " << realTasKindId << ", realTypeId: " << realTypeId << ", fallbackTypeId: " << fallbackTypeId;
if (fallbackTypeId)
@@ -107,10 +108,10 @@ ProjectDataManagement::GearClass PdmHandler::gearClassFromChargeTypeId(int charg
for (const auto &gearType2ChargeType : std::as_const(m_gearTypeChargeTypes))
{
if (gearType2ChargeType.chargeTypeId() == chargeTypeId)
if (gearType2ChargeType.chargeTypeId == chargeTypeId)
{
const auto gearType = m_gearTypes.value(gearType2ChargeType.gearTypeId());
return gearType.gearClassId();
const auto gearType = m_gearTypes.value(gearType2ChargeType.gearTypeId);
return gearType.gearClassId;
}
}
return ProjectDataManagement::GearClass::GearClass_Unknown;
@@ -134,7 +135,7 @@ ProjectDataManagement::BuildingChargeEffect PdmHandler::buildingChargeEffect(int
for (const auto &bce : std::as_const(m_buildingChargeEffects))
{
if (bce.chargeTypeId() == chargeTypeId)
if (bce.chargeTypeId == chargeTypeId)
return bce;
}
return {};
@@ -172,7 +173,7 @@ int PdmHandler::vulnerabilityKindId(int tasVulnerabilityKindId, int equipmentNum
DEBUG_LOG(m_logger) << "vulnerability type with id " << typeId
<< " and index " << index << " is using fallback typeId " << fallBackTypeId;
}
return it.value().taVulnerabilityKind();
return it.value().taVulnerabilityKind;
}
@@ -216,11 +217,11 @@ int PdmHandler::chargeTypeIdFromGearAndChargeTasCode(int gearTasCode, int charge
{
for (const auto &gearType2ChargeType : std::as_const(m_gearTypeChargeTypes))
{
if (gearType2ChargeType.gearTypeId() == gearTasCode)
if (gearType2ChargeType.gearTypeId == gearTasCode)
{
const auto chargeType = m_chargeTypes.value(gearType2ChargeType.chargeTypeId());
if (chargeType.id() == chargeTasCode)
return chargeType.id();
const auto chargeType = m_chargeTypes.value(gearType2ChargeType.chargeTypeId);
if (chargeType.id == chargeTasCode)
return chargeType.id;
}
}
}
@@ -246,8 +247,8 @@ int PdmHandler::gearTypeIdFromTasGearTasCode(int gearTasCode)
for (const auto &gearType : std::as_const(m_gearTypes))
{
if (gearType.tasCode() == gearTasCode)
return gearType.id();
if (gearType.tasCode == gearTasCode)
return gearType.id;
}
WARNING_LOG(m_logger) << "Got unmapped training area gear type id "
@@ -257,32 +258,32 @@ int PdmHandler::gearTypeIdFromTasGearTasCode(int gearTasCode)
int PdmHandler::legacyChargeTypeIgniterType(int chargeTypeId, int igniterTypeId, int igniterFunctionId)
{
return m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeTypeId, igniterTypeId, igniterFunctionId).chargeLegacyId();
return m_dtcPdm->getChargeTypeIgniterTypeIgniterFunction(chargeTypeId, igniterTypeId, igniterFunctionId).chargeLegacyId;
}
double PdmHandler::impactRadius(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->impactRadius(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->impactRadius(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
double PdmHandler::impactEdgeLength(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->impactEdgeLength(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->impactEdgeLength(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isSmartChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->isSmart(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->isSmart(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isIedChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->isIed(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->isIed(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isReactivatableChargeType(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->isReactivatable(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->isReactivatable(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isIndirect(int chargeTypeId) const
@@ -291,16 +292,16 @@ bool PdmHandler::isIndirect(int chargeTypeId) const
}
int PdmHandler::hazardDistance(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->hazardDistance(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->hazardDistance(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isLaserGuidable(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->isLaserGuidable(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->isLaserGuidable(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
bool PdmHandler::isUasDroppable(const AreaEffectSimulation::ChargeStruct &chargeStruct) const
{
return m_dtcPdm->isUasDroppable(chargeStruct.chargeTypeId(), chargeStruct.igniterTypeId(), chargeStruct.igniterFunctionId());
return m_dtcPdm->isUasDroppable(chargeStruct.chargeTypeId, chargeStruct.igniterTypeId, chargeStruct.igniterFunctionId);
}
}
@@ -4,6 +4,7 @@
#include "position_handler.h"
#include "exm_handler.h"
#include "logger.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <AssetManagement/asm_dtc.h>
using namespace TrainingAreaBase;
@@ -28,7 +29,7 @@ bool PositionHandler::initCoordinateConversion() const
constexpr int ddsTimeout = 10 * 1000;
const auto ex = m_mainHandler->exmHandler()->exercise(m_mainHandler->exerciseId());
if (ex.id() <= 0)
if (ex.id <= 0)
{
ERROR_LOG(m_logger) << "Can not retrieve exercise information for id " << m_mainHandler->exerciseId();
return false;
@@ -38,18 +39,18 @@ bool PositionHandler::initCoordinateConversion() const
ERROR_LOG(m_logger) << "Error initializing AssetManagement DTC";
return false;
}
const auto ta = m_dtcAsm->trainingArea(ex.trainingAreaId());
if (ta.id() <= 0)
const auto ta = m_dtcAsm->trainingArea(ex.trainingAreaId);
if (ta.id <= 0)
{
ERROR_LOG(m_logger) << "Can not retrieve training are information for id " << ex.trainingAreaId();
ERROR_LOG(m_logger) << "Can not retrieve training are information for id " << ex.trainingAreaId;
return false;
}
m_dtcAsm.reset();
const LtsCoordTrans::UtmCoordinate bottomLeft(LtsCoordTrans::UtmCoordinate::fromGeographic(ta.bottomLeft().lon(), ta.bottomLeft().lat()));
const QPointF mid(bottomLeft.geographic(ta.width() / 2, ta.height() / 2));
const LtsCoordTrans::UtmCoordinate bottomLeft(LtsCoordTrans::UtmCoordinate::fromGeographic(ta.bottomLeft.lon, ta.bottomLeft.lat));
const QPointF mid(bottomLeft.geographic(ta.width / 2, ta.height / 2));
@@ -60,8 +61,8 @@ bool PositionHandler::initCoordinateConversion() const
m_utm2Geographic = LtsCoordTrans::UtmCoordinate::fromMgrs(mgrs);
LtsCoordTrans::UtmCoordinate topRight(bottomLeft);
topRight.x += ta.width();
topRight.y += ta.height();
topRight.x += ta.width;
topRight.y += ta.height;
m_relPosBottomLeft = bottomLeft.relativeTo(m_utm2Geographic);
m_relPosTopRight = topRight.relativeTo(m_utm2Geographic);
@@ -69,8 +70,8 @@ bool PositionHandler::initCoordinateConversion() const
NOTICE_LOG(m_logger) << "Training area bottomLeft: " << m_relPosBottomLeft.x() << "," << m_relPosBottomLeft.y()
<< ", topRight: " << m_relPosTopRight.x() << "," << m_relPosTopRight.y()
<< ", base point: " << mgrs
<< ", width:" << ta.width()
<< ", height: " << ta.height();
<< ", width:" << ta.width
<< ", height: " << ta.height;
return true;
}
@@ -84,13 +85,13 @@ Core::GeoPosition2D PositionHandler::relativeToGeographic2D(const TetraIcd::Rela
{
const QPointF point(m_utm2Geographic.geographic(p.offsetX, p.offsetY));
ret.lon(point.x());
ret.lat(point.y());
ret.lon = point.x();
ret.lat = point.y();
}
else
{
ret.lon(nan(""));
ret.lat(nan(""));
ret.lon = nan("");
ret.lat = nan("");
}
return ret;
}
@@ -99,17 +100,17 @@ Core::GeoPosition PositionHandler::relativeToGeographic(const TetraIcd::Relative
{
const Core::GeoPosition2D pos2d(relativeToGeographic2D(p));
Core::GeoPosition ret;
ret.lon(pos2d.lon());
ret.lat(pos2d.lat());
ret.z(p.offsetZ);
ret.lon = pos2d.lon;
ret.lat = pos2d.lat;
ret.z = p.offsetZ;
DEBUG_LOG(m_logger) << "x/y -> lon/lat: " << p.offsetX << "," << p.offsetY
<< " -> " << ret.lon() * LtsCoordTrans::rad2deg() << "," << ret.lat() * LtsCoordTrans::rad2deg();
<< " -> " << ret.lon * LtsCoordTrans::rad2deg() << "," << ret.lat * LtsCoordTrans::rad2deg();
return ret;
}
QPointF PositionHandler::geographicToRelativePointF(const Core::GeoPosition2D &p) const
{
return geographicToRelativePointF(Core::GeoPosition(p.lon(), p.lat(), 0));
return geographicToRelativePointF(Core::GeoPosition(p.lon, p.lat, 0));
}
QPointF PositionHandler::geographicToRelativePointF(const Core::GeoPosition &p) const
@@ -117,21 +118,21 @@ QPointF PositionHandler::geographicToRelativePointF(const Core::GeoPosition &p)
initCoordinateConversion();
const LtsCoordTrans::UtmCoordinate point(LtsCoordTrans::UtmCoordinate::fromGeographic(p.lon(), p.lat(), m_utm2Geographic.zone));
const LtsCoordTrans::UtmCoordinate point(LtsCoordTrans::UtmCoordinate::fromGeographic(p.lon, p.lat, m_utm2Geographic.zone));
return QPointF(point.x - m_utm2Geographic.x, point.y - m_utm2Geographic.y);
}
TetraIcd::RelativePosition PositionHandler::geographicToRelative(const Core::GeoPosition2D &p, double z) const
{
return geographicToRelative(Core::GeoPosition(p.lon(), p.lat(), z));
return geographicToRelative(Core::GeoPosition(p.lon, p.lat, z));
}
TetraIcd::RelativePosition PositionHandler::geographicToRelative(const Core::GeoPosition &p) const
{
const QPointF rel(geographicToRelativePointF(p));
const TetraIcd::RelativePosition ret(qRound(rel.x()), qRound(rel.y()), p.z());
DEBUG_LOG(m_logger) << "lon/lat -> x/y: " << p.lon() * LtsCoordTrans::rad2deg() << "," << p.lat() * LtsCoordTrans::rad2deg()
const TetraIcd::RelativePosition ret(qRound(rel.x()), qRound(rel.y()), p.z);
DEBUG_LOG(m_logger) << "lon/lat -> x/y: " << p.lon * LtsCoordTrans::rad2deg() << "," << p.lat * LtsCoordTrans::rad2deg()
<< " -> " << ret.offsetX << "," << ret.offsetY;
return ret;
}
@@ -153,7 +154,7 @@ double PositionHandler::speed (const TetraIcd::RelativePosition &relPos, const i
if (deltaTime == 0)
return 0.0;
TetraIcd::RelativePosition lastRelPosition = geographicToRelative(lastParticipantPosition.pos.position());
TetraIcd::RelativePosition lastRelPosition = geographicToRelative(lastParticipantPosition.pos.position);
QLineF line(QPointF(lastRelPosition.offsetX, lastRelPosition.offsetY),
QPointF(relPos.offsetX, relPos.offsetY));
@@ -191,7 +192,7 @@ TrainingAreaBase::TabPosition PositionHandler::lastPosition(int equipNo) const
lastPos = m_lastPosition.value(equipNo);
return lastPos.pos;
}
ret.position(Core::GeoPosition(nan(""), nan(""), nan("")));
ret.position = Core::GeoPosition(nan(""), nan(""), nan(""));
return ret;
}
@@ -4,12 +4,14 @@
#include "ppm_handler.h"
#include "main_handler.h"
#include "send_to_tab.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QTimer>
namespace TrainingAreaBase
{
PpmHandler::PpmHandler(MainHandler *mainHandler)
: m_mainHandler(mainHandler)
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_mainHandler(mainHandler)
, m_equipExerciseMappingTimer(new QTimer(this))
{
m_equipExerciseMappingTimer->setSingleShot(true);
@@ -46,10 +48,10 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti
if (modType == DataModification::eRemoved)
return;
ParticipantManagement::Participant participant = m_ppmDtc->participant(data.participantId());
ParticipantManagement::Participant participant = m_ppmDtc->participant(data.participantId);
int equipNo = 0;
if (participant.equipmentNumber().is_set())
equipNo = participant.equipmentNumber().get();
if (participant.equipmentNumber.is_set())
equipNo = participant.equipmentNumber.get();
if (equipNo > 0)
emit position(equipNo, data);
@@ -64,15 +66,15 @@ void PpmHandler::onEquipmentExerciseMappingChanged(const ParticipantManagement::
case DataModification::eAdded:
case DataModification::eModified:
{
std::unordered_set<int> &equipmentNumbers = m_exerciseEquipmentAssignments[data.exerciseId()];
std::unordered_set<int> &equipmentNumbers = m_exerciseEquipmentAssignments[data.exerciseId];
equipmentNumbers.clear();
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping())
equipmentNumbers.insert(e2p.equipmentNumber());
for (const ParticipantManagement::Equipment2ParticipantId &e2p : data.mapping)
equipmentNumbers.insert(e2p.equipmentNumber);
break;
}
case DataModification::eRemoved:
{
auto it = m_exerciseEquipmentAssignments.find(data.exerciseId());
auto it = m_exerciseEquipmentAssignments.find(data.exerciseId);
if (it != m_exerciseEquipmentAssignments.end())
m_exerciseEquipmentAssignments.erase(it);
break;
@@ -2,7 +2,10 @@
#pragma once
#include <QtCore/QObject>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <unordered_map>
#include <unordered_set>
#include "logger.h"
@@ -8,6 +8,7 @@
#include <AreaEffectSimulation/Utils/polygons.h>
#include <AreaEffectSimulation/aes_translation.h>
#include <ngldb/db_service_handler.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <TrainingAreaBase/tab_fts.h>
#include <QtGui/QTransform>
@@ -17,9 +18,10 @@ namespace TrainingAreaBase
AesStateHandler::AesStateHandler(MainHandler *mainHandler) : m_dbInterface(mainHandler->dbHandler()->db())
, m_exerciseId(mainHandler->exerciseId()),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {}
AesStateHandler::AesStateHandler(MainHandler *mainHandler)
: m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_dbInterface(mainHandler->dbHandler()->db())
, m_exerciseId(mainHandler->exerciseId()) {}
template<>
@@ -112,6 +114,7 @@ RecvFromDdsAes::RecvFromDdsAes(MainHandler *mainHandler,
const std::shared_ptr<SendToTab> &txCallback,
QObject *parent)
: QObject(parent)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
, m_ddsConnector(mainHandler->ddsHandler()->ddsConnector())
, m_txCallback(txCallback)
, m_aesStateHandler(new AesStateHandler(mainHandler))
@@ -211,67 +214,67 @@ int RecvFromDdsAes::aesChargeId(int aesId) const
{
auto it = m_currentBCContaminations.find(aesId);
if (it != m_currentBCContaminations.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentExplosionArea.find(aesId);
if (it != m_currentExplosionArea.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentExplosionCluster.find(aesId);
if (it != m_currentExplosionCluster.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentExplosionSingle.find(aesId);
if (it != m_currentExplosionSingle.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentMineArea.find(aesId);
if (it != m_currentMineArea.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentNContamination.find(aesId);
if (it != m_currentNContamination.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentDusSingleMine.find(aesId);
if (it != m_currentDusSingleMine.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentGasPipes.find(aesId);
if (it != m_currentGasPipes.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentFunctionalArea.find(aesId);
if (it != m_currentFunctionalArea.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentBoobyTraps.find(aesId);
if (it != m_currentBoobyTraps.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentOffRouteMines.find(aesId);
if (it != m_currentOffRouteMines.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentTechnicalArea.find(aesId);
if (it != m_currentTechnicalArea.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
{
auto it = m_currentAirSupportImpacts.find(aesId);
if (it != m_currentAirSupportImpacts.end())
return it->second.chargeStruct().chargeTypeId();
return it->second.chargeStruct.chargeTypeId;
}
return -1;
}
@@ -344,18 +347,18 @@ TetraIcd::AreaEffectSimulationType RecvFromDdsAes::aesTypeFromId(int aesId) cons
bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
{
AreaEffectSimulation::ExplosionSingle data;
data.chargeStruct().chargeTypeId(request.chargeTypeId());
data.effectDuration(1);
data.effectStart(request.effectTime());
data.id(request.aesId());
data.impactPosition(request.position().position());
data.isDeleted(false);
data.participantId(request.participantId());
data.partyId(request.partyId());
data.chargeStruct.chargeTypeId = request.chargeTypeId;
data.effectDuration = 1;
data.effectStart = request.effectTime;
data.id = request.aesId;
data.impactPosition = request.position.position;
data.isDeleted = false;
data.participantId = request.participantId;
data.partyId = request.partyId;
bool bAlreadyExists = false;
const int aesTetraId = m_aesStateHandler->createAesTetraId(request.aesId(), bAlreadyExists);
const int aesTetraId = m_aesStateHandler->createAesTetraId(request.aesId, bAlreadyExists);
if (!bAlreadyExists)
{
@@ -364,8 +367,8 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
dataChanged(data, bOnlyNameChanged);
}
sendCreateEffectSimulation(data, aesTetraId, request.equipmentNumber());
m_aesStateHandler->update(request.aesId(), aesTetraId, true);
sendCreateEffectSimulation(data, aesTetraId, request.equipmentNumber);
m_aesStateHandler->update(request.aesId, aesTetraId, true);
return true;
}
@@ -375,19 +378,19 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request)
template <typename T>
void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modType, TetraIcd::AreaEffectSimulationType aesType)
{
DEBUG_LOG(m_logger) << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id()
DEBUG_LOG(m_logger) << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id
<< ", modType: " << static_cast<int>(modType)
<< ", type=" << static_cast<int>(aesType)
<< ", name: " << data.name()
<< ", state: " << data.effectStateId()
<< ", old state: " << m_currentEffectState.value(data.id()) << ")";
<< ", name: " << data.name
<< ", state: " << data.effectStateId
<< ", old state: " << m_currentEffectState.value(data.id) << ")";
if (std::is_same<T, AreaEffectSimulation::ExplosionSingle>::value ||
std::is_same<T, AreaEffectSimulation::ExplosionArea>::value ||
std::is_same<T, AreaEffectSimulation::ExplosionCluster>::value
)
{
if (m_mainHandler->pdmHandler()->isSmartChargeType(data.chargeStruct()))
if (m_mainHandler->pdmHandler()->isSmartChargeType(data.chargeStruct))
{
DEBUG_LOG(m_logger) << "Do not send SMART Single/AreaFire to Tetra as broadcast, hits are send directly.";
return;
@@ -401,28 +404,28 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
case DataModification::eRemoved:
{
if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsPaused &&
m_currentEffectState.value(data.id()) != AreaEffectSimulation::AesEffectState::EsPaused)
if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsPaused &&
m_currentEffectState.value(data.id) != AreaEffectSimulation::AesEffectState::EsPaused)
{
const int aesTetraId = m_aesStateHandler->getAesTetraId(data.id());
const int aesTetraId = m_aesStateHandler->getAesTetraId(data.id);
if (aesTetraId <= 0)
{
handleSendToTetra(data, aesType);
}
sendPauseEffectSimulation(data.id());
sendPauseEffectSimulation(data.id);
}
else if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated &&
m_currentEffectState.value(data.id()) == AreaEffectSimulation::AesEffectState::EsPaused)
else if (data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated &&
m_currentEffectState.value(data.id) == AreaEffectSimulation::AesEffectState::EsPaused)
{
sendResumeEffectSimulation(data);
}
else if (!data.effectStart().is_set() ||
data.effectStart().get() == 0 ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsRemoved ||
data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
else if (!data.effectStart.is_set() ||
data.effectStart.get() == 0 ||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsRemoved ||
data.effectStateId == AreaEffectSimulation::AesEffectState::EsExpired)
{
if (modType == DataModification::eAdded)
@@ -434,7 +437,7 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
sendRemoveEffectSimulation(aesType, data.id());
sendRemoveEffectSimulation(aesType, data.id);
resetStartTime(data);
}
else
@@ -442,10 +445,10 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT
if (!(std::is_same<T, AreaEffectSimulation::FunctionalArea>::value) ||
(data.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated))
(data.effectStateId == AreaEffectSimulation::AesEffectState::EsActivated))
handleSendToTetra(data, aesType);
}
m_currentEffectState[data.id()] = data.effectStateId();
m_currentEffectState[data.id] = data.effectStateId;
break;
}
}
@@ -456,7 +459,7 @@ void RecvFromDdsAes::handleSendToTetra(const T &data, TetraIcd::AreaEffectSimul
{
bool bAlreadyExists = false;
const int aesTetraId = m_aesStateHandler->createAesTetraId(data.id(), bAlreadyExists);
const int aesTetraId = m_aesStateHandler->createAesTetraId(data.id, bAlreadyExists);
bool bOnlyNameChanged = false;
@@ -475,15 +478,15 @@ void RecvFromDdsAes::handleSendToTetra(const T &data, TetraIcd::AreaEffectSimul
!std::is_same<T, AreaEffectSimulation::TechnicalArea>::value)
{
sendModifyEffectSimulationName(aesType,
m_aesStateHandler->getAesTetraId(data.id()),
data.name(),
data.id());
m_aesStateHandler->update(data.id(), aesTetraId, true);
m_aesStateHandler->getAesTetraId(data.id),
data.name,
data.id);
m_aesStateHandler->update(data.id, aesTetraId, true);
}
else if (bSomethingChanged)
{
sendCreateEffectSimulation(data, aesTetraId);
m_aesStateHandler->update(data.id(), aesTetraId, true);
m_aesStateHandler->update(data.id, aesTetraId, true);
}
}
@@ -513,11 +516,11 @@ void RecvFromDdsAes::onMineAreaChanged(const AreaEffectSimulation::MineArea &dat
handleEffectSimulation(data, modType, TetraIcd::AreaEffectSimulationType::MineArea);
auto it = m_temporarySingleMineState.find(data.id());
auto it = m_temporarySingleMineState.find(data.id);
if (it != m_temporarySingleMineState.end())
{
onTriggeredImpactsChanged(it->second, DataModification::eModified);
m_temporarySingleMineState.erase(data.id());
m_temporarySingleMineState.erase(data.id);
}
}
@@ -540,29 +543,29 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
{
if (modType == DataModification::eRemoved)
return;
if (data.aesTypeId() != AreaEffectSimulation::AesType::AtMineAreaSingleMines)
if (data.aesTypeId != AreaEffectSimulation::AesType::AtMineAreaSingleMines)
return;
if (data.aesItemId() == 0)
if (data.aesItemId == 0)
return;
bool completeUntriggered = true;
for (size_t i = 0; i < data.bitfield().size() && completeUntriggered; ++i)
for (size_t i = 0; i < data.bitfield.size() && completeUntriggered; ++i)
{
if ((i + 1) * 8 <= static_cast<unsigned long>(data.impactCount()))
if ((i + 1) * 8 <= static_cast<unsigned long>(data.impactCount))
{
if (data.bitfield().at(i) != 0xFF)
if (data.bitfield.at(i) != 0xFF)
completeUntriggered = false;
}
else
{
uint8_t endMask = 0;
for (uint32_t j = 0; j < (static_cast<unsigned long>(data.impactCount()) - i * 8); ++j)
for (uint32_t j = 0; j < (static_cast<unsigned long>(data.impactCount) - i * 8); ++j)
endMask |= 0x80 >> j;
if (data.bitfield().at(i) != endMask)
if (data.bitfield.at(i) != endMask)
completeUntriggered = false;
}
}
@@ -570,24 +573,24 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
return;
auto it = m_currentMineArea.find(data.aesItemId());
auto it = m_currentMineArea.find(data.aesItemId);
if (it != m_currentMineArea.end())
{
const auto &mineArea = it->second;
if (mineArea.isDus() || mineArea.isConcrete())
if (mineArea.isDus || mineArea.isConcrete)
{
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - is a DUS mineArea";
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId << " - is a DUS mineArea";
return;
}
switch (mineArea.effectStateId().underlying())
switch (mineArea.effectStateId)
{
case AreaEffectSimulation::AesEffectState::EsError:
case AreaEffectSimulation::AesEffectState::EsExpired:
case AreaEffectSimulation::AesEffectState::EsRemoved:
case AreaEffectSimulation::AesEffectState::EsUnknown:
{
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId());
INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId);
return;
}
default:
@@ -596,18 +599,18 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg
}
else
{
INFO_LOG(m_logger) << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId();
m_temporarySingleMineState[data.aesItemId()] = data;
INFO_LOG(m_logger) << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId;
m_temporarySingleMineState[data.aesItemId] = data;
return;
}
TetraIcd::MineAreaSingleMineState out;
out.aesDdsId = data.aesItemId();
out.aesDdsId = data.aesItemId;
out.mineCount = data.impactCount();
out.mineState.reserve(data.bitfield().size());
for (const auto &c : data.bitfield())
out.mineCount = data.impactCount;
out.mineState.reserve(data.bitfield.size());
for (const auto &c : data.bitfield)
out.mineState.push_back(c);
txData(out);
@@ -618,7 +621,7 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt
if (modType == DataModification::eRemoved)
return;
const auto &vec = data.mines();
const auto &vec = data.mines;
if (vec.size() == 0)
return;
@@ -627,26 +630,26 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt
{
if (!m_mainHandler->pdmHandler()->isReactivatableChargeType({mine.chargeTypeId(), 0,0}))
if (!m_mainHandler->pdmHandler()->isReactivatableChargeType({mine.chargeTypeId, 0,0}))
continue;
if (mine != m_allReactivatableDusMines.value(mine.eqId()))
if (mine != m_allReactivatableDusMines.value(mine.eqId))
{
if (!mine.triggered() &&
m_allReactivatableDusMines.contains(mine.eqId()) && m_allReactivatableDusMines.value(mine.eqId()).triggered()
if (!mine.triggered &&
m_allReactivatableDusMines.contains(mine.eqId) && m_allReactivatableDusMines.value(mine.eqId).triggered
)
m_minesToSend << mine.eqId();
m_minesToSend << mine.eqId;
m_allReactivatableDusMines.insert(mine.eqId(), mine);
m_allReactivatableDusMines.insert(mine.eqId, mine);
}
}
if (!m_minesToSend.isEmpty())
m_sendDusMineReactivtionTimer->start();
else
INFO_LOG(m_logger) << "Nothing changed in DusMineState of MineArea: " << data.id();
INFO_LOG(m_logger) << "Nothing changed in DusMineState of MineArea: " << data.id;
}
void RecvFromDdsAes::onSendDusMineReactivationTimeout()
@@ -655,7 +658,7 @@ void RecvFromDdsAes::onSendDusMineReactivationTimeout()
out.dusSerialNumbers.reserve(m_minesToSend.size());
for (const auto &mineId : std::as_const(m_minesToSend))
{
m_allReactivatableDusMines[mineId].triggered(false);
m_allReactivatableDusMines[mineId].triggered = false;
out.dusSerialNumbers.push_back(mineId);
}
m_minesToSend.clear();
@@ -693,19 +696,19 @@ void RecvFromDdsAes::onExplosionClusterChanged(const AreaEffectSimulation::Explo
template<typename T, typename S>
void setCommonParams(T &out, const S &in, const int aesTetraId)
{
out.aesDdsId = in.id();
out.aesDdsId = in.id;
Q_UNUSED(aesTetraId);
out.name = in.name();
out.partyId = in.partyId().is_set() ? in.partyId().get() : 0;
out.name = in.name;
out.partyId = in.partyId.is_set() ? in.partyId.get() : 0;
}
template<typename T, typename S>
void setCommonCombatParams(T &out, const S &in, const int aesTetraId)
{
setCommonParams(out, in, aesTetraId);
out.effectStart = in.effectStart().is_set() ? in.effectStart().get() : 0;
out.effectDuration = in.effectDuration();
out.effectStart = in.effectStart.is_set() ? in.effectStart.get() : 0;
out.effectDuration = in.effectDuration;
}
@@ -718,27 +721,27 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
if (data.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions)
if (data.aesTypeId != AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions)
return;
const int aesItemId = data.aesItemId();
const int aesItemId = data.aesItemId;
if (aesItemId <= 0)
return;
const AreaEffectSimulation::ExplosionCluster &aes = m_dtcAes->explosionCluster(aesItemId);
if (aes.id() != aesItemId)
if (aes.id != aesItemId)
return;
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct());
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
if (!bIsLaserGuidable)
return;
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects();
const std::vector<AreaEffectSimulation::SingleEffect> &singleEffectsRef = data.singleEffects;
if (!singleEffectsRef.empty())
{
@@ -762,23 +765,23 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
const AreaEffectSimulation::SingleEffect &firstSingleEffect = singleEffectsRef.front();
const Core::GeoPosition &fsePosition = firstSingleEffect.position();
const Core::GeoPosition &fsePosition = firstSingleEffect.position;
cAes.relCorner = m_posHandler->geographicToRelative(fsePosition);
cAes.width = qRound(aes.area().width());
cAes.height = qRound(aes.area().height());
cAes.rotationAngle = aes.area().rotation();
cAes.mhpRotation = aes.mhpRotation();
cAes.mhpWidth = aes.mhpWidth();
cAes.mhpLength = aes.mhpLength();
cAes.impactCount = aes.impactCount();
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct());
cAes.width = qRound(aes.area.width);
cAes.height = qRound(aes.area.height);
cAes.rotationAngle = aes.area.rotation;
cAes.mhpRotation = aes.mhpRotation;
cAes.mhpWidth = aes.mhpWidth;
cAes.mhpLength = aes.mhpLength;
cAes.impactCount = aes.impactCount;
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct);
std::vector<TetraIcd::RelativePosition> &mhPointsRef = cAes.mhPoints;
mhPointsRef.clear();
mhPointsRef.reserve(aes.mhPoints().size());
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints()))
mhPointsRef.reserve(aes.mhPoints.size());
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints))
mhPointsRef.emplace_back(m_posHandler->geographicToRelative(pos, 0));
@@ -795,9 +798,9 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data,
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirSupportImpact &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(AirSupportImpact, "
@@ -807,13 +810,13 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.header.equipmentNumber = 0;
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct()));
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct));
if (cAes.chargeTypeId <= 0)
return;
@@ -823,33 +826,33 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCContamination &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::CContamination, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::CContamination, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(BCContamination, "
<< aesTetraId << ")";
TetraIcd::CreateCContamination cAes;
cAes.expansionFactor = pdm()->dtc()->expansionFactor(aes.chargeStruct().chargeTypeId(),
aes.chargeStruct().igniterTypeId(),
aes.chargeStruct().igniterFunctionId());
cAes.expansionFactor = pdm()->dtc()->expansionFactor(aes.chargeStruct.chargeTypeId,
aes.chargeStruct.igniterTypeId,
aes.chargeStruct.igniterFunctionId);
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
cAes.effectRadius = qRound(aes.impactRadius());
cAes.propagationDirection = aes.propagationDirection();
cAes.windSpeed = qRound(aes.windSpeed());
cAes.validityTimeWind = aes.weatherTimestamp();
cAes.relPositionValidityTimeWind = m_posHandler->geographicToRelative(aes.weatherPosition(), 0);
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
cAes.effectRadius = qRound(aes.impactRadius);
cAes.propagationDirection = aes.propagationDirection;
cAes.windSpeed = qRound(aes.windSpeed);
cAes.validityTimeWind = aes.weatherTimestamp;
cAes.relPositionValidityTimeWind = m_posHandler->geographicToRelative(aes.weatherPosition, 0);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
switch (pdm()->dtc()->volatilityTypeId(aes.chargeStruct().chargeTypeId(),
aes.chargeStruct().igniterTypeId(),
aes.chargeStruct().igniterFunctionId()).underlying())
switch (pdm()->dtc()->volatilityTypeId(aes.chargeStruct.chargeTypeId,
aes.chargeStruct.igniterTypeId,
aes.chargeStruct.igniterFunctionId))
{
case ProjectDataManagement::VolatilityType::Floating:
cAes.volatility = TetraIcd::CreateCContamination::Volatiliy::Floating;
@@ -870,9 +873,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCCo
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionArea &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, "
@@ -880,17 +883,17 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
TetraIcd::CreateAreaExplosion cAes;
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
cAes.width = qRound(aes.area().width());
cAes.height = qRound(aes.area().height());
cAes.rotationAngle = aes.area().rotation();
cAes.impactCount = aes.cannonCount() * aes.cannonRounds();
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct());
cAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
cAes.width = qRound(aes.area.width);
cAes.height = qRound(aes.area.height);
cAes.rotationAngle = aes.area.rotation;
cAes.impactCount = aes.cannonCount * aes.cannonRounds;
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
cAes.hazardDistance = m_mainHandler->pdmHandler()->hazardDistance(aes.chargeStruct);
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
if (cAes.chargeTypeId <= 0)
return;
@@ -901,7 +904,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes, int aesTetraId)
{
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct());
const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct);
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation "
<< ", aes " << aes
@@ -914,9 +917,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
return;
}
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, "
@@ -926,25 +929,25 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
cAes.width = qRound(aes.area().width());
cAes.height = qRound(aes.area().height());
cAes.rotationAngle = aes.area().rotation();
cAes.mhpRotation = aes.mhpRotation();
cAes.mhpWidth = aes.mhpWidth();
cAes.mhpLength = aes.mhpLength();
cAes.impactCount = aes.impactCount();
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct()));
cAes.impactRadius = m_mainHandler->pdmHandler()->impactRadius(aes.chargeStruct());
cAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
cAes.width = qRound(aes.area.width);
cAes.height = qRound(aes.area.height);
cAes.rotationAngle = aes.area.rotation;
cAes.mhpRotation = aes.mhpRotation;
cAes.mhpWidth = aes.mhpWidth;
cAes.mhpLength = aes.mhpLength;
cAes.impactCount = aes.impactCount;
cAes.impactEdgeLength = qRound(pdm()->impactEdgeLength(aes.chargeStruct));
cAes.impactRadius = m_mainHandler->pdmHandler()->impactRadius(aes.chargeStruct);
std::vector<TetraIcd::RelativePosition> &mhPointsRef = cAes.mhPoints;
mhPointsRef.clear();
mhPointsRef.reserve(aes.mhPoints().size());
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints()))
mhPointsRef.reserve(aes.mhPoints.size());
for (const Core::GeoPosition2D &pos : std::as_const(aes.mhPoints))
mhPointsRef.emplace_back(m_posHandler->geographicToRelative(pos, 0));
int chargeTypeId = 0;
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
chargeTypeId = pdm()->legacyChargeTypeIgniterType(aes.chargeStruct().chargeTypeId(), aes.chargeStruct().igniterTypeId(), aes.chargeStruct().igniterFunctionId());
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
chargeTypeId = pdm()->legacyChargeTypeIgniterType(aes.chargeStruct.chargeTypeId, aes.chargeStruct.igniterTypeId, aes.chargeStruct.igniterFunctionId);
@@ -952,7 +955,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
cAes.chargeTypeId = chargeTypeId;
else
{
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
}
if (cAes.chargeTypeId <= 0)
@@ -963,9 +966,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::ExplosionSingle &aes, int aesTetraId, int equipmentNumber)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionSingle, "
@@ -974,12 +977,12 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.header.equipmentNumber = equipmentNumber;
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct()));
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
cAes.effectDiameter = qRound(2 * pdm()->impactRadius(aes.chargeStruct));
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
if (cAes.chargeTypeId <= 0)
return;
@@ -989,9 +992,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::MineArea &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::MineArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::MineArea, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(MineArea, "
@@ -1002,33 +1005,33 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine
cAes.layingDepth = aes.width();
cAes.layingDensity = aes.density();
cAes.layingDepth = aes.width;
cAes.layingDensity = aes.density;
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
cAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
cAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
TetraIcd::MineAreaSegment segment;
cAes.segments.reserve(aes.segments().size());
for (size_t i = 0; i < aes.segments().size(); ++i)
cAes.segments.reserve(aes.segments.size());
for (size_t i = 0; i < aes.segments.size(); ++i)
{
const AreaEffectSimulation::MineSegment &s = aes.segments().at(i);
if (aes.isCenterLine())
const AreaEffectSimulation::MineSegment &s = aes.segments.at(i);
if (aes.isCenterLine)
{
segment.relStart = m_posHandler->geographicToRelative(s.positionStart(), 0);
segment.relEnd = m_posHandler->geographicToRelative(s.positionEnd(), 0);
segment.relStart = m_posHandler->geographicToRelative(s.positionStart, 0);
segment.relEnd = m_posHandler->geographicToRelative(s.positionEnd, 0);
}
else
{
const QPointF relStart = m_posHandler->geographicToRelativePointF(s.positionStart());
const QPointF relEnd = m_posHandler->geographicToRelativePointF(s.positionEnd());
const QPointF relStart = m_posHandler->geographicToRelativePointF(s.positionStart);
const QPointF relEnd = m_posHandler->geographicToRelativePointF(s.positionEnd);
const QLineF line({relStart.x(), relStart.y()}, {relEnd.x(), relEnd.y()});
DEBUG_LOG(m_logger) << "relStart: x: " << relStart.x() << ", y: " << relStart.y();
DEBUG_LOG(m_logger) << "relEnd: x: " << relEnd.x() << ", y: " << relEnd.y();
QTransform trans;
trans.rotate(0-line.angle());
const QPointF ofs = trans.map(QPointF(aes.width() / 2, 0));
const QPointF ofs = trans.map(QPointF(aes.width / 2, 0));
DEBUG_LOG(m_logger) << "ofs: x: " << ofs.x() << ", y: " << ofs.y();
segment.relStart.offsetX = qRound(relStart.x() + ofs.y());
@@ -1050,9 +1053,9 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NContamination &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::NContamination, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::NContamination, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(NContamination, "
@@ -1060,23 +1063,23 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NCon
TetraIcd::CreateNContamination cAes;
setCommonCombatParams(cAes, aes, aesTetraId);
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition(), 0);
cAes.innerRadius = qRound(aes.impactRadius());
cAes.borderLengthInner = qRound(aes.borderLengthInner());
cAes.borderLengthOuter = qRound(aes.borderLengthOuter());
cAes.spanAngle = aes.spanAngle();
cAes.rotationAngle = aes.rotationAngle();
cAes.relEffectPosition = m_posHandler->geographicToRelative(aes.impactPosition, 0);
cAes.innerRadius = qRound(aes.impactRadius);
cAes.borderLengthInner = qRound(aes.borderLengthInner);
cAes.borderLengthOuter = qRound(aes.borderLengthOuter);
cAes.spanAngle = aes.spanAngle;
cAes.rotationAngle = aes.rotationAngle;
cAes.chargeTypeId = aes.chargeStruct().chargeTypeId();
cAes.chargeTypeId = aes.chargeStruct.chargeTypeId;
txData(cAes);
}
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::FunctionalArea &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::FunctionalArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::FunctionalArea, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(FunctionalArea, "
@@ -1084,24 +1087,24 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Func
TetraIcd::CreateFunctionalArea fAes;
setCommonParams(fAes, aes, aesTetraId);
fAes.relEffectPosition = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
fAes.width = qRound(aes.area().width());
fAes.height = qRound(aes.area().height());
fAes.deconMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.deconMode().underlying());
fAes.deconTimeout = aes.deconTime();
fAes.maintenanceMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.maintMode().underlying());
fAes.maintenanceTimeout = aes.maintTime();
fAes.medicalMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.medicMode().underlying());
fAes.medicalTimeout = aes.medicTime();
fAes.relEffectPosition = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
fAes.width = qRound(aes.area.width);
fAes.height = qRound(aes.area.height);
fAes.deconMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.deconMode);
fAes.deconTimeout = aes.deconTime;
fAes.maintenanceMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.maintMode);
fAes.maintenanceTimeout = aes.maintTime;
fAes.medicalMode = static_cast<TetraIcd::FunctionalAreaOperatingMode>(aes.medicMode);
fAes.medicalTimeout = aes.medicTime;
txData(fAes);
}
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::TechnicalArea &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::TechnicalArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::TechnicalArea, aes.id);
return;
}
@@ -1109,22 +1112,22 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Tech
<< aesTetraId << ")";
TetraIcd::TechnicalArea fAes;
fAes.aesDdsId = aes.id();
fAes.aesDdsId = aes.id;
fAes.name = aes.name();
fAes.taType = static_cast<TetraIcd::TechnicalArea::Type>(aes.type().underlying());
fAes.relCorner = m_posHandler->geographicToRelative(aes.area().cornerBottomLeft(), 0);
fAes.width = qRound(aes.area().width());
fAes.height = qRound(aes.area().height());
fAes.name = aes.name;
fAes.taType = static_cast<TetraIcd::TechnicalArea::Type>(aes.type);
fAes.relCorner = m_posHandler->geographicToRelative(aes.area.cornerBottomLeft, 0);
fAes.width = qRound(aes.area.width);
fAes.height = qRound(aes.area.height);
txData(fAes);
}
void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusSingleMine &aes, int aesTetraId)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::DusSingleMineSimulator, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::DusSingleMineSimulator, aes.id);
return;
}
DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(DusSingleMine, "
@@ -1132,13 +1135,13 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusS
TetraIcd::CreateDusSingleMine dAes;
setCommonParams(dAes, aes, aesTetraId);
dAes.relEffectPosition = m_posHandler->geographicToRelative(aes.position(), 0);
dAes.effectStart = aes.effectStart().get();
dAes.effectDuration = aes.effectDuration();
dAes.mineId = aes.mineId();
dAes.relEffectPosition = m_posHandler->geographicToRelative(aes.position, 0);
dAes.effectStart = aes.effectStart.get();
dAes.effectDuration = aes.effectDuration;
dAes.mineId = aes.mineId;
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct().chargeTypeId()));
dAes.chargeTypeId = chargeType.legacyId() > 0 ? chargeType.legacyId() : chargeType.id();
const auto chargeType(pdm()->chargeTypeFromId(aes.chargeStruct.chargeTypeId));
dAes.chargeTypeId = chargeType.legacyId > 0 ? chargeType.legacyId : chargeType.id;
txData(dAes);
}
@@ -1242,15 +1245,15 @@ void RecvFromDdsAes::sendPauseEffectSimulation(int aesDdsId)
template<>
void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::ExplosionArea &aes)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
return;
}
const int aesDdsId = aes.id();
const int aesDdsId = aes.id;
if (aesDdsId == 0)
return;
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id());
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id);
if (aesTetraId == 0)
{
DEBUG_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ;
@@ -1265,15 +1268,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
<< ", tetraId=" << aesTetraId << ")";
TetraIcd::ResumeEffectSimulation dAes;
dAes.aesDdsId = aes.id();
dAes.aesDdsId = aes.id;
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id(),
aes.cannonCount() * aes.cannonRounds(),
aes.originalEffectDuration(),
aes.effectDuration());
dAes.nextImpact = aes.remainExplosionNumber();
dAes.resumeTime = aes.effectStart().is_set() ? aes.effectStart().get() : 0;
dAes.remainDuration = aes.effectDuration();
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id,
aes.cannonCount * aes.cannonRounds,
aes.originalEffectDuration,
aes.effectDuration);
dAes.nextImpact = aes.remainExplosionNumber;
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
dAes.remainDuration = aes.effectDuration;
txData(dAes);
}
@@ -1282,15 +1285,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
template<>
void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::ExplosionCluster &aes)
{
if (aes.isCentral())
if (aes.isCentral)
{
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id());
sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id);
return;
}
const int aesDdsId = aes.id();
const int aesDdsId = aes.id;
if (aesDdsId == 0)
return;
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id());
const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id);
if (aesTetraId == 0)
{
WARNING_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ;
@@ -1305,15 +1308,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl
<< ", tetraId=" << aesTetraId << ")";
TetraIcd::ResumeEffectSimulation dAes;
dAes.aesDdsId = aes.id();
dAes.aesDdsId = aes.id;
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id(),
aes.impactCount(),
aes.originalEffectDuration(),
aes.effectDuration());
dAes.nextImpact = aes.remainExplosionNumber();
dAes.resumeTime = aes.effectStart().is_set() ? aes.effectStart().get() : 0;
dAes.remainDuration = aes.effectDuration();
dAes.sequelNumber = AreaEffectSimulation::Polygons::getSequelNumber(aes.id,
aes.impactCount,
aes.originalEffectDuration,
aes.effectDuration);
dAes.nextImpact = aes.remainExplosionNumber;
dAes.resumeTime = aes.effectStart.is_set() ? aes.effectStart.get() : 0;
dAes.remainDuration = aes.effectDuration;
txData(dAes);
}
@@ -1355,7 +1358,7 @@ void RecvFromDdsAes::resetAllDusMines()
QTimer::singleShot(300, this, [this]()
{
for (AreaEffectSimulation::DusMine &mine : m_allReactivatableDusMines)
mine.triggered(false);
mine.triggered = false;
m_minesToSend.clear();
connect(m_sendDusMineReactivtionTimer, &QTimer::timeout,
this, &RecvFromDdsAes::onSendDusMineReactivationTimeout);
@@ -51,7 +51,8 @@ public:
}
private:
NGL::INGLLogger &m_logger;
QMap<int, int> m_tetraId2ddsId;
QMap<int, int> m_ddsId2TetraId;
QSet<int> m_aesInTetraAvailable;
@@ -149,8 +150,7 @@ private:
void doSpecialization(const AreaEffectSimulation::ExplosionArea &data, std::unordered_map<int, AreaEffectSimulation::ExplosionArea> &cont)
{
cont[data.id()].remainExplosionNumber(data.remainExplosionNumber());
}
cont[data.id].remainExplosionNumber = data.remainExplosionNumber; }
template<typename T>
void doSpecialization(const T &data, std::unordered_map<int, T> &cont)
{
@@ -161,20 +161,18 @@ private:
bool dataChanged(const T &data, std::unordered_map<int, T> &cont, bool &onlyNameChanged)
{
onlyNameChanged = false;
auto it = cont.find(data.id());
auto it = cont.find(data.id);
T dataTmp(data);
dataTmp.sampleTime(0);
dataTmp.sampleTime = 0;
if (it == cont.end())
{
cont.emplace(std::make_pair(data.id(), std::move(dataTmp)));
cont.emplace(std::make_pair(data.id, std::move(dataTmp)));
DEBUG_LOG(m_logger) << "new AES Item: " << data;
return true;
}
it->second.effectStateId(data.effectStateId());
it->second.effectStateId = data.effectStateId;
doSpecialization(data, cont);
@@ -186,9 +184,7 @@ private:
T tmp(it->second);
tmp.name(data.name());
tmp.sampleTime(data.sampleTime());
onlyNameChanged = (tmp == data);
tmp.name = data.name; tmp.sampleTime = data.sampleTime; onlyNameChanged = (tmp == data);
std::swap(it->second, dataTmp);
@@ -207,15 +203,13 @@ private:
{
AreaEffectSimulation::ExplosionArea copy(current);
copy.remainExplosionNumber(0);
return dataChanged(copy, m_currentExplosionArea, onlyNameChanged);
copy.remainExplosionNumber = 0; return dataChanged(copy, m_currentExplosionArea, onlyNameChanged);
}
bool dataChanged(const AreaEffectSimulation::ExplosionCluster &current, bool &onlyNameChanged)
{
AreaEffectSimulation::ExplosionCluster copy(current);
copy.remainExplosionNumber(0);
return dataChanged(copy, m_currentExplosionCluster, onlyNameChanged);
copy.remainExplosionNumber = 0; return dataChanged(copy, m_currentExplosionCluster, onlyNameChanged);
}
bool dataChanged(const AreaEffectSimulation::ExplosionSingle &current, bool &onlyNameChanged)
@@ -270,60 +264,59 @@ private:
auto it = cont.find(aesDdsId);
if (it == cont.end())
return;
it->second.effectStart(0);
}
it->second.effectStart = 0; }
void resetStartTime(const AreaEffectSimulation::AirSupportImpact &current)
{
resetStartTime(current.id(), m_currentBCContaminations);
resetStartTime(current.id, m_currentBCContaminations);
}
void resetStartTime(const AreaEffectSimulation::BCContamination &current)
{
resetStartTime(current.id(), m_currentBCContaminations);
resetStartTime(current.id, m_currentBCContaminations);
}
void resetStartTime(const AreaEffectSimulation::ExplosionArea &current)
{
resetStartTime(current.id(), m_currentExplosionArea);
resetStartTime(current.id, m_currentExplosionArea);
}
void resetStartTime(const AreaEffectSimulation::ExplosionCluster &current)
{
resetStartTime(current.id(), m_currentExplosionCluster);
resetStartTime(current.id, m_currentExplosionCluster);
}
void resetStartTime(const AreaEffectSimulation::ExplosionSingle &current)
{
resetStartTime(current.id(), m_currentExplosionSingle);
resetStartTime(current.id, m_currentExplosionSingle);
}
void resetStartTime(const AreaEffectSimulation::MineArea &current)
{
resetStartTime(current.id(), m_currentMineArea);
resetStartTime(current.id, m_currentMineArea);
}
void resetStartTime(const AreaEffectSimulation::NContamination &current)
{
resetStartTime(current.id(), m_currentNContamination);
resetStartTime(current.id, m_currentNContamination);
}
void resetStartTime(const AreaEffectSimulation::FunctionalArea &current)
{
resetStartTime(current.id(), m_currentFunctionalArea);
resetStartTime(current.id, m_currentFunctionalArea);
}
void resetStartTime(const AreaEffectSimulation::TechnicalArea &current)
{
resetStartTime(current.id(), m_currentTechnicalArea);
resetStartTime(current.id, m_currentTechnicalArea);
}
void resetStartTime(const AreaEffectSimulation::DusSingleMine &current)
{
resetStartTime(current.id(), m_currentDusSingleMine);
resetStartTime(current.id, m_currentDusSingleMine);
}
void resetStartTime(const AreaEffectSimulation::GasPipe &current)
{
resetStartTime(current.id(), m_currentGasPipes);
resetStartTime(current.id, m_currentGasPipes);
}
void resetStartTime(const AreaEffectSimulation::BoobyTrap &current)
{
resetStartTime(current.id(), m_currentBoobyTraps);
resetStartTime(current.id, m_currentBoobyTraps);
}
void resetStartTime(const AreaEffectSimulation::OffRouteMine &current)
{
resetStartTime(current.id(), m_currentOffRouteMines);
resetStartTime(current.id, m_currentOffRouteMines);
}
std::shared_ptr<PdmHandler> pdm();
@@ -342,6 +335,7 @@ private:
void onSendDusMineReactivationTimeout();
private:
NGL::INGLLogger &m_logger;
std::unordered_map<int, AreaEffectSimulation::AirSupportImpact> m_currentAirSupportImpacts;
std::unordered_map<int, AreaEffectSimulation::BCContamination> m_currentBCContaminations;
std::unordered_map<int, AreaEffectSimulation::ExplosionArea> m_currentExplosionArea;
@@ -62,104 +62,104 @@ RecvFromDdsFts::RecvFromDdsFts(MainHandler *mainHandler, const std::shared_ptr<I
void RecvFromDdsFts::onDemandBiteRequest(const rti::core::SampleIdentity &cookie, const DemandBiteRequest &request)
{
TetraIcd::DemandBite data;
data.withSelfTest = request.withSelfTest();
data.withSelfTest = request.withSelfTest;
bool bRet = true;
// TODO: fixme
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
if (!m_txCallback->txData(data))
bRet = false;
}
m_ftsTab->demandBiteReply(cookie, fillFro(request.requestId(), bRet));
m_ftsTab->demandBiteReply(cookie, fillFro(request.requestId, bRet));
}
void RecvFromDdsFts::onDemandInitRequest(const rti::core::SampleIdentity &cookie, const DemandInitRequest &request)
{
TetraIcd::Init data;
data.workstationId = request.workstationId();
data.resetManipulation = request.resetManipulation();
data.resetVulnerabilityState = request.resetVulnerabilityState();
data.restockCharges = request.restockCharges();
data.restockSanitationMaterial = request.restockSanitationMaterial();
data.workstationId = request.workstationId;
data.resetManipulation = request.resetManipulation;
data.resetVulnerabilityState = request.resetVulnerabilityState;
data.restockCharges = request.restockCharges;
data.restockSanitationMaterial = request.restockSanitationMaterial;
bool bRet = true;
// TODO: fixme
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
if (!m_txCallback->txData(data))
bRet = false;
}
m_ftsTab->demandInitReply(cookie, fillFro(request.requestId(), bRet));
m_ftsTab->demandInitReply(cookie, fillFro(request.requestId, bRet));
}
void RecvFromDdsFts::onSendSetVulnerabilityModelRequest(const rti::core::SampleIdentity &cookie, const SendSetVulnerabilityModelRequest &request)
{
TetraIcd::SetVulnerabilityModel data;
data.header.equipmentNumber = request.equipmentNumber();
data.vulnerabilityModelMineIed = request.vulnerabilityModelMineIed();
data.vulnerabilityModelAreaFire = request.vulnerabilityModelAreaFire();
data.vulnerabilityModelOperatingResource = request.vulnerabilityModelOperationalResource();
data.vulnerabilityModelAcWeaponry = request.vulnerabilityModelACWeaponry();
data.header.equipmentNumber = request.equipmentNumber;
data.vulnerabilityModelMineIed = request.vulnerabilityModelMineIed;
data.vulnerabilityModelAreaFire = request.vulnerabilityModelAreaFire;
data.vulnerabilityModelOperatingResource = request.vulnerabilityModelOperationalResource;
data.vulnerabilityModelAcWeaponry = request.vulnerabilityModelACWeaponry;
m_ftsTab->sendSetVulnerabilityModelReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendSetVulnerabilityModelReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onDemandConfigurationReportRequest(const rti::core::SampleIdentity &cookie, const DemandConfigurationReportRequest &request)
{
TetraIcd::DemandEquipmentConfigurationReport data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
m_ftsTab->demandConfigurationReportReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->demandConfigurationReportReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onDemandVulnerabilityStateChangeRequest(const rti::core::SampleIdentity &cookie, const DemandVulnerabilityStateChangeRequest &request)
{
TetraIcd::DemandVulnerabilityStateChange data;
data.reqestedState = static_cast<TetraIcd::VulnerabilityState>(request.vulnerabilityState().underlying());
data.workstationId = request.workstationId();
data.vulnerabilityVitalityIndex = getVulnerabilityVitalityIndexFromVitalityAndVba(request.vulnerabilityKind(), request.vitality());
data.reqestedState = static_cast<TetraIcd::VulnerabilityState>(request.vulnerabilityState);
data.workstationId = request.workstationId;
data.vulnerabilityVitalityIndex = getVulnerabilityVitalityIndexFromVitalityAndVba(request.vulnerabilityKind, request.vitality);
bool bRet = true;
// TODO: fixme
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
if (!m_txCallback->txData(data))
bRet = false;
}
m_ftsTab->demandVulnerabilityStateChangeReply(cookie, fillFro(request.requestId(), bRet));
m_ftsTab->demandVulnerabilityStateChangeReply(cookie, fillFro(request.requestId, bRet));
}
void RecvFromDdsFts::onSendLanguageSelectionRequest(const rti::core::SampleIdentity &cookie, const SendLanguageSelectionRequest &request)
{
TetraIcd::LanguageSelection data;
data.header.equipmentNumber = request.equipmentNumber();
data.languageSelection = static_cast<TetraIcd::Language>(request.language().underlying());
data.header.equipmentNumber = request.equipmentNumber;
data.languageSelection = static_cast<TetraIcd::Language>(request.language);
m_ftsTab->sendLanguageSelectionReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendLanguageSelectionReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdentity &cookie, const SendEquipmentMessageRequest &request)
{
if (request.sender().is_set() &&
request.subject().is_set() &&
request.message().is_set())
if (request.sender.is_set() &&
request.subject.is_set() &&
request.message.is_set())
{
// Message to O/C
TetraIcd::EquipmentMessageOC data;
data.senderId = request.sender().get();
data.subject = request.subject().get();
data.message = request.message().get();
data.senderId = request.sender.get();
data.subject = request.subject.get();
data.message = request.message.get();
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
bool bRet = true;
// TODO: fixme
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
data.receiverId = equipNo;
@@ -172,10 +172,10 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
else
{
TetraIcd::EquipmentMessage data;
if (request.messageId().is_set())
data.msgId = request.messageId().get();
else if (request.message().is_set())
data.message = request.message().get();
if (request.messageId.is_set())
data.msgId = request.messageId.get();
else if (request.message.is_set())
data.message = request.message.get();
else
{
m_ftsTab->sendEquipmentMessageReply(cookie, fillFro(0, false));
@@ -184,14 +184,14 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti
}
bool bRet = true;
// TODO: fixme
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
if (!m_txCallback->txData(data))
bRet = false;
}
m_ftsTab->sendEquipmentMessageReply(cookie, fillFro(request.requestId(), bRet));
m_ftsTab->sendEquipmentMessageReply(cookie, fillFro(request.requestId, bRet));
}
}
@@ -199,82 +199,82 @@ void RecvFromDdsFts::onSendOcDataRequest(const rti::core::SampleIdentity &cookie
{
TetraIcd::OpaquePayloadDataOut data;
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::OC;
data.header.equipmentNumber = request.equipmentNumber();
data.payload = request.payload();
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendOcDataReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendOcDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendFireSmokeMarkerDataRequest(const rti::core::SampleIdentity &cookie, const SendFireSmokeMarkerDataRequest &request)
{
TetraIcd::OpaquePayloadDataOut data;
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::FireSmokeMarker;
data.header.equipmentNumber = request.equipmentNumber();
data.payload = request.payload();
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendFireSmokeMarkerDataReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendFireSmokeMarkerDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendGeopairingDataRequest(const rti::core::SampleIdentity &cookie, const SendGeopairingDataRequest &request)
{
TetraIcd::OpaquePayloadDataOut data;
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::Geopairing;
data.header.equipmentNumber = request.equipmentNumber();
data.payload = request.payload();
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendGeopairingDataReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendGeopairingDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendTargetDataRequest(const rti::core::SampleIdentity &cookie, const SendTargetDataRequest &request)
{
TetraIcd::OpaquePayloadDataOut data;
data.payloadType = TetraIcd::OpaquePayloadDataBase::Type::Target;
data.header.equipmentNumber = request.equipmentNumber();
data.payload = request.payload();
data.header.equipmentNumber = request.equipmentNumber;
data.payload = request.payload;
m_ftsTab->sendTargetDataReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendTargetDataReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendCesHitInformationRequest(const rti::core::SampleIdentity &cookie, const SendCesHitInformation &request)
{
TetraIcd::CesHitInformation data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.timeStamp = request.effectTime();
data.originatorEquipmentNumber = request.originatorEquipmentNumber();
const auto &ct = m_mainHandler->pdmHandler()->chargeTypeFromId(request.chargeTypeId());
data.chargeTasCodeDirect = ct.id();
data.chargeTasCodeIndirect = ct.id();
data.directionDegree = request.directionDegree();
data.distance = request.distanceToOrignator();
data.effectPercent = request.effectPercent();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = request.effectTime;
data.originatorEquipmentNumber = request.originatorEquipmentNumber;
const auto &ct = m_mainHandler->pdmHandler()->chargeTypeFromId(request.chargeTypeId);
data.chargeTasCodeDirect = ct.id;
data.chargeTasCodeIndirect = ct.id;
data.directionDegree = request.directionDegree;
data.distance = request.distanceToOrignator;
data.effectPercent = request.effectPercent;
m_ftsTab->sendCesHitInformationReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendCesHitInformationReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, const SendCesHitRequest &request)
{
DEBUG_LOG(m_logger) << "onSendCesHitRequest: " << request.equipmentNumber() << " - " << request.effectTime()
<< " request.chargeTypeId=" << request.chargeTypeId()
<< " request.eventType()=" << request.eventType()
<< " request.aesId()=" << request.aesId()
<< " aesTypeFromId=" << m_mainHandler->aesHandler()->aesTypeFromId(request.aesId());
DEBUG_LOG(m_logger) << "onSendCesHitRequest: " << request.equipmentNumber << " - " << request.effectTime
<< " request.chargeTypeId=" << request.chargeTypeId
<< " request.pdmEventType=" << request.pdmEventType
<< " request.aesId()=" << request.aesId
<< " aesTypeFromId=" << m_mainHandler->aesHandler()->aesTypeFromId(request.aesId);
// NOTE: igniterType/IgniterFunciton = 0 as long as SendCesHitRequest does not contain values
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId(), 0,0}))
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId, 0,0}))
{
// special handling for smart - must be send as singleFire
m_ftsTab->sendCesHitReply(cookie,
fillFro(request.participantId(),
fillFro(request.participantId,
m_mainHandler->aesHandler()->sendSingleFireSMArt(request)));
return;
}
TetraIcd::CesHitRequest data;
//test
data.reserve2 = request.originatorEquipmentNumber();
data.reserve1 = request.chargeTypeId();
data.header.equipmentNumber = request.equipmentNumber();
data.header.timeStamp = request.effectTime();
const auto &ct = m_mainHandler->pdmHandler()->chargeTypeFromId(request.chargeTypeId());
data.reserve2 = request.originatorEquipmentNumber;
data.reserve1 = request.chargeTypeId;
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = request.effectTime;
const auto &ct = m_mainHandler->pdmHandler()->chargeTypeFromId(request.chargeTypeId);
// GUEZE-359 Steilfeuer mit Sekundaerwirkung wird als Mun 371, ... gesendet. Fuehrt zu Treffer DUS statt WirkSim
//#ifdef GUEZ_MODE
// if ( request.chargeTypeId() > 370 && request.chargeTypeId() < 390 )
@@ -288,78 +288,78 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
// data.chargeTasCodeIndirect = ct.id();
// }
//#else
if ((request.eventType() == ProjectDataManagement::EventType::HitBuilding) && (ct.legacyId() > 0))
if ((request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_HitBuilding) && (ct.legacyId > 0))
{
data.chargeTasCodeDirect = 201; // immer den direkten code (fuer wirkfelder: pseudo-osag code >= 201)
data.chargeTasCodeIndirect = 201;
}
else if (ct.legacyId() > 0)
else if (ct.legacyId > 0)
{
data.chargeTasCodeDirect = ct.legacyId();
data.chargeTasCodeIndirect = ct.legacyId();
data.chargeTasCodeDirect = ct.legacyId;
data.chargeTasCodeIndirect = ct.legacyId;
}
else
{
data.chargeTasCodeDirect = ct.id();
data.chargeTasCodeIndirect = ct.id();
data.chargeTasCodeDirect = ct.id;
data.chargeTasCodeIndirect = ct.id;
}
//#endif
data.mineId = request.mineId();
if (request.aesId() != 0)
data.mineId = request.mineId;
if (request.aesId != 0)
{
//data.aesTetraIdUnused = m_mainHandler->aesHandler()->tetraIdFromDdsId(request.aesId());
data.aesDdsId = request.aesId();
data.aesDdsId = request.aesId;
//TODO: !!!!!! Use new EventType to check which AreaEffectSimulationType will be chosen.
if (request.eventType() == ProjectDataManagement::EventType::ExplosionCluster)
if (request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_ExplosionCluster)
data.aesType = TetraIcd::AreaEffectSimulationType::ExplosionArea;
else
data.aesType = m_mainHandler->aesHandler()->aesTypeFromId(request.aesId());
data.aesType = m_mainHandler->aesHandler()->aesTypeFromId(request.aesId);
/*!
\brief Take the new event type attribute to check if its is a HazardArea(DangerZone/Gefahrenbereich)
*
* */
if ((request.eventType() == ProjectDataManagement::EventType::LeaveHazardDistance) ||
(request.eventType() == ProjectDataManagement::EventType::EnterHazardDistance))
if ((request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_LeaveHazardDistance) ||
(request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_EnterHazardDistance))
{
INFO_LOG(m_logger) << "HarzardArea: " << request.effectTime();
data.reserve1 = request.mineId();
INFO_LOG(m_logger) << "HarzardArea: " << request.effectTime;
data.reserve1 = request.mineId;
data.aesType = TetraIcd::AreaEffectSimulationType::DangerZoneExplosion;
}
else if (request.eventType() == ProjectDataManagement::EventType::AirSupport)
else if (request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_AirSupport)
{
data.aesType = TetraIcd::AreaEffectSimulationType::AirSupport;
}
}
else
data.originatorEquipmentNumber = request.originatorEquipmentNumber();
const auto &tabPos = request.position();
data.buildingId = tabPos.moutObjectId().is_set() ? tabPos.moutObjectId().get() : 0;
data.roomId = tabPos.moutRoomId().is_set() ? tabPos.moutRoomId().get() : 0;
data.remainEffectPercent = request.remainEffectPercent();
data.relPosition = m_mainHandler->posHandler()->geographicToRelative(tabPos.position());
data.originatorEquipmentNumber = request.originatorEquipmentNumber;
const auto &tabPos = request.position;
data.buildingId = tabPos.moutObjectId.is_set() ? tabPos.moutObjectId.get() : 0;
data.roomId = tabPos.moutRoomId.is_set() ? tabPos.moutRoomId.get() : 0;
data.remainEffectPercent = request.remainEffectPercent;
data.relPosition = m_mainHandler->posHandler()->geographicToRelative(tabPos.position);
// NOTE: igniterType/IgniterFunciton = 0 as long as SendCesHitRequest does not contain values
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId(),0,0}))
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
else if ((request.eventType() == ProjectDataManagement::EventType::HitBuilding) ||
(request.eventType() == ProjectDataManagement::EventType::HitEffectSimulation) // GUEZE-2873 / GUEZE-2888
if (m_mainHandler->pdmHandler()->isSmartChargeType({request.chargeTypeId,0,0}))
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id, request.remainEffectPercent);
else if ((request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_HitBuilding) ||
(request.pdmEventType == ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation) // GUEZE-2873 / GUEZE-2888
) //Gebäude Sekudärwirkung
{
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
DEBUG_LOG(m_logger) << "PDM::EventType = " << request.eventType()
<< " equipmentNumber=" << request.equipmentNumber()
data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id, request.remainEffectPercent);
DEBUG_LOG(m_logger) << "PDM::EventType = " << request.pdmEventType
<< " equipmentNumber=" << request.equipmentNumber
<< " originatorEquipmentNumber=" << data.originatorEquipmentNumber
<< " chargeType=" << ct.id()
<< " remainEffectPercent()=" << request.remainEffectPercent()
<< " chargeType=" << ct.id
<< " remainEffectPercent()=" << request.remainEffectPercent
<< " -> remainEffectTasCodeDirect=" << data.remainEffectTasCodeDirect ;
}
else
data.remainEffectTasCodeDirect = request.remainEffectPercent();//calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
data.remainEffectTasCodeDirect = request.remainEffectPercent;//calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent());
// [GUEZE-3469] Funktionsraum dekontaminiert faelschlicherweise
if (m_mainHandler->aesHandler()->aesTypeFromId(request.aesId()) == TetraIcd::AreaEffectSimulationType::FunctionalArea)
if (m_mainHandler->aesHandler()->aesTypeFromId(request.aesId) == TetraIcd::AreaEffectSimulationType::FunctionalArea)
{
// GUEZSB60_ICD_52_Zentrale-TNE
// 3.3.2.5.9.6 Trefferereignis Sekundärwirkung
@@ -370,39 +370,39 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
// Feld Reserve1: Betriebsmodus (MS-Byte) / Wartezeit (LS-Byte) für Instandsetzungsmaßnahmen
// Feld Reserve2: Betriebsmodus (MS-Byte) / Wartezeit (LS-Byte) für San.-dienstliche Versorgung
AreaEffectSimulation::FunctionalArea fa = m_mainHandler->aesHandler()->dtcAes()->functionalArea(request.aesId());
DEBUG_LOG(m_logger) << "fa maintMode=" << fa.maintMode()
<< " maintTime=" <<fa.maintTime()
<< " deconMode=" << fa.deconMode()
<< " deconTime=" << fa.deconTime()
<< " medicMode=" << fa.medicMode()
<< " medicTime=" << fa.medicTime();
AreaEffectSimulation::FunctionalArea fa = m_mainHandler->aesHandler()->dtcAes()->functionalArea(request.aesId);
DEBUG_LOG(m_logger) << "fa maintMode=" << fa.maintMode
<< " maintTime=" <<fa.maintTime
<< " deconMode=" << fa.deconMode
<< " deconTime=" << fa.deconTime
<< " medicMode=" << fa.medicMode
<< " medicTime=" << fa.medicTime;
data.chargeTasCodeDirect = 0;
data.reserve1 = 0;
data.reserve2 = 0;
if (fa.deconMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
if (fa.deconMode == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
{
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
qint32 lsb = fa.deconTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
qint32 msb = static_cast<qint32>(AreaEffectSimulation::AesOperatingMode::OmWaitingTime) << 8;
qint32 lsb = fa.deconTime / 1000 / 60 / 10; // dissolution in 10 minute steps
data.chargeTasCodeIndirect = msb | lsb;
DEBUG_LOG(m_logger) << "deconMode: remainEffectTasCodeDirect=" << data.chargeTasCodeIndirect
<< " msb=" << msb
<< " lsb=" << lsb;
}
if (fa.maintMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
if (fa.maintMode == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
{
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
qint32 lsb = fa.maintTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
qint32 msb = static_cast<qint32>(AreaEffectSimulation::AesOperatingMode::OmWaitingTime) << 8;
qint32 lsb = fa.maintTime / 1000 / 60 / 10; // dissolution in 10 minute steps
data.reserve1 = msb | lsb;
DEBUG_LOG(m_logger) << "maintMode: reserve1=" << data.reserve1
<< " msb=" << msb
<< " lsb=" << lsb;
}
if (fa.medicMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime)
if (fa.medicMode == AreaEffectSimulation::AesOperatingMode::OmWaitingTime)
{
qint32 msb = AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime << 8;
qint32 lsb = fa.medicTime() / 1000 / 60 / 10; // dissolution in 10 minute steps
qint32 msb = static_cast<qint32>(AreaEffectSimulation::AesOperatingMode::OmWaitingTime) << 8;
qint32 lsb = fa.medicTime / 1000 / 60 / 10; // dissolution in 10 minute steps
data.reserve2 = msb | lsb;
DEBUG_LOG(m_logger) << "medicMode: reserve2=" << data.reserve2
<< " msb=" << msb
@@ -410,130 +410,130 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie
}
}
m_ftsTab->sendCesHitReply(cookie, fillFro(request.participantId(), m_txCallback->txData(data)));
m_ftsTab->sendCesHitReply(cookie, fillFro(request.participantId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendParticipantSwVerionsRequest(const rti::core::SampleIdentity &cookie, const SendParticipantSwVerionsRequest &request)
{
DEBUG_LOG(m_logger) << "onSendParticipantSwVerionsRequest: " << request.equipmentNumber() << " - " << request.equipmentFunctionId();
DEBUG_LOG(m_logger) << "onSendParticipantSwVerionsRequest: " << request.equipmentNumber << " - " << request.equipmentFunctionId;
TetraIcd::ParticipantSwVersionsRequest data;
data.header.equipmentNumber = request.equipmentNumber();
data.equipmentFunctionId = request.equipmentFunctionId();
data.header.equipmentNumber = request.equipmentNumber;
data.equipmentFunctionId = request.equipmentFunctionId;
m_ftsTab->sendParticipantSwVerionsReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->sendParticipantSwVerionsReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendParticipantModeRequest(const rti::core::SampleIdentity &cookie, const SendParticipantModeRequest &request)
{
TetraIcd::ParticipantMode data;
data.header.equipmentNumber = request.equipmentNumber();
data.language = static_cast<TetraIcd::Language>(request.language().underlying());
data.operationMode = static_cast<TetraIcd::ParticipantMode::OperationMode>(request.operationMode().underlying());
data.reactivationDetoxication = request.reactivationDetoxication();
data.reactivationMaintenance = request.reactivationMaintenance();
data.reactivationMedic = request.reactivationMedic();
data.modeVest = static_cast<TetraIcd::ParticipantMode::WphMode>(request.protectionModeVest().underlying());
data.modeHelmet = static_cast<TetraIcd::ParticipantMode::WphMode>(request.protectionModeHelmet().underlying());
data.personellProtectionMode = static_cast<TetraIcd::ParticipantMode::PersonellProtection>(request.personellProtection().underlying());
data.protectionLevel = static_cast<TetraIcd::ParticipantMode::ProtectionLevel>(request.protectionLevel().underlying());
data.handgrenadeSearchMode = static_cast<TetraIcd::ParticipantMode::HandgrenadeSearchMode>(request.handgrenadeSearchMode().underlying());
data.internationalMode = static_cast<TetraIcd::ParticipantMode::InternationalMode>(request.internationalMode().underlying());
data.abcProtectionMode = static_cast<TetraIcd::ParticipantMode::ABCProtectionMode>(request.abcProtectionMode().underlying());
data.header.equipmentNumber = request.equipmentNumber;
data.language = static_cast<TetraIcd::Language>(request.language);
data.operationMode = static_cast<TetraIcd::ParticipantMode::OperationMode>(request.operationMode);
data.reactivationDetoxication = request.reactivationDetoxication;
data.reactivationMaintenance = request.reactivationMaintenance;
data.reactivationMedic = request.reactivationMedic;
data.modeVest = static_cast<TetraIcd::ParticipantMode::WphMode>(request.protectionModeVest);
data.modeHelmet = static_cast<TetraIcd::ParticipantMode::WphMode>(request.protectionModeHelmet);
data.personellProtectionMode = static_cast<TetraIcd::ParticipantMode::PersonellProtection>(request.personellProtection);
data.protectionLevel = static_cast<TetraIcd::ParticipantMode::ProtectionLevel>(request.protectionLevel);
data.handgrenadeSearchMode = static_cast<TetraIcd::ParticipantMode::HandgrenadeSearchMode>(request.handgrenadeSearchMode);
data.internationalMode = static_cast<TetraIcd::ParticipantMode::InternationalMode>(request.internationalMode);
data.abcProtectionMode = static_cast<TetraIcd::ParticipantMode::ABCProtectionMode>(request.abcProtectionMode);
m_ftsTab->sendParticipantModeReply(cookie, fillFro(request.requestId(), m_txCallback->txData(data)));
m_ftsTab->sendParticipantModeReply(cookie, fillFro(request.requestId, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onDemandParticipantModeRequest(const rti::core::SampleIdentity &cookie, const DemandParticipantModeRequest &request)
{
TetraIcd::DemandParticipantMode data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
m_ftsTab->demandParticipantModeReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->demandParticipantModeReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendParticipantConfigurationRequest(const rti::core::SampleIdentity &cookie, const SendParticipantConfigurationRequest &request)
{
TetraIcd::ParticipantConfiguration data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
// positioning
data.positionIntervallVehicle = request.positionIntervallVehicle();
data.positionIntervallPersonell = request.positionIntervallPersonell();
data.positionIntervallAircraft = request.positionIntervallAircraft();
data.positionTransmissionIntervall = request.positionTransmissionIntervall();
data.heightbarrier = request.heightbarrier();
data.faultPositionHandling = static_cast<TetraIcd::ParticipantConfiguration::FaultPositionHandling>(request.faultPositionHandling().underlying());
data.switchingPositionIntervall = static_cast<TetraIcd::ParticipantConfiguration::SwitchingPositionIntervall>(request.switchingPositionIntervall().underlying());
data.positionIntervallVehicle = request.positionIntervallVehicle;
data.positionIntervallPersonell = request.positionIntervallPersonell;
data.positionIntervallAircraft = request.positionIntervallAircraft;
data.positionTransmissionIntervall = request.positionTransmissionIntervall;
data.heightbarrier = request.heightbarrier;
data.faultPositionHandling = static_cast<TetraIcd::ParticipantConfiguration::FaultPositionHandling>(request.faultPositionHandling);
data.switchingPositionIntervall = static_cast<TetraIcd::ParticipantConfiguration::SwitchingPositionIntervall>(request.switchingPositionIntervall);
// radio protocoll parameter
data.waittimeAdditionalBroadcastDemand = request.waittimeAdditionalBroadcastDemand();
data.factorWaittimeIncreaseAtHighload = request.factorWaittimeIncreaseHighload();
data.waittimeAdditionalBroadcastDemand = request.waittimeAdditionalBroadcastDemand;
data.factorWaittimeIncreaseAtHighload = request.factorWaittimeIncreaseHighload;
// automatic vulnerability increase
data.waittimeAutomaticVulnerabilityIncreaseLevel1 = request.waittimeAutomaticVulnerabilityIncreaseLevel1();
data.waittimeAutomaticVulnerabilityIncreaseLevel2 = request.waittimeAutomaticVulnerabilityIncreaseLevel2();
data.waittimeAutomaticVulnerabilityIncreaseLevel3 = request.waittimeAutomaticVulnerabilityIncreaseLevel3();
data.waittimeAutomaticVulnerabilityIncreaseLevel1 = request.waittimeAutomaticVulnerabilityIncreaseLevel1;
data.waittimeAutomaticVulnerabilityIncreaseLevel2 = request.waittimeAutomaticVulnerabilityIncreaseLevel2;
data.waittimeAutomaticVulnerabilityIncreaseLevel3 = request.waittimeAutomaticVulnerabilityIncreaseLevel3;
// optical code
data.opticalCode = static_cast<TetraIcd::ParticipantConfiguration::OpticalCode>(request.opticalCode().underlying());
data.opticalCode = static_cast<TetraIcd::ParticipantConfiguration::OpticalCode>(request.opticalCode);
// vulnerability model
data.vulnerabilityModel = request.vulnerabilityModel();
data.validTimeOps = request.validTimeOps();
data.vulnerabilityModel = request.vulnerabilityModel;
data.validTimeOps = request.validTimeOps;
m_ftsTab->sendParticipantConfigurationReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->sendParticipantConfigurationReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendParticipantBlockedAreaRequest(const rti::core::SampleIdentity &cookie, const SendParticipantBlockedAreaRequest &request)
{
TetraIcd::CesHitRequest data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); // TODO
data.aesType = TetraIcd::AreaEffectSimulationType::SpecialArea;
data.remainEffectPercent = request.blockedAreaMode() == BlockedAreaMode::Enter ? 1 : 0;
data.remainEffectPercent = request.blockedAreaMode == BlockedAreaMode::Enter ? 1 : 0;
m_ftsTab->sendParticipantBlockedAreaReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->sendParticipantBlockedAreaReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendParticipantBeStillWarningRequest(const rti::core::SampleIdentity &cookie, const SendParticipantBeStillWarningRequest &request)
{
TetraIcd::CesHitRequest data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); // TODO
data.aesType = TetraIcd::AreaEffectSimulationType::BeStillWarning;
data.remainEffectPercent = 0;
WARNING_LOG(m_logger) << "sendParticipantBeStillWarningReply equipmentNumber=" << request.equipmentNumber();
m_ftsTab->sendParticipantBeStillWarningReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
WARNING_LOG(m_logger) << "sendParticipantBeStillWarningReply equipmentNumber=" << request.equipmentNumber;
m_ftsTab->sendParticipantBeStillWarningReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendSetSanitationRequest(const rti::core::SampleIdentity &cookie, const SendSetSanitationRequest &request)
{
TetraIcd::Sanitation data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
data.proceduresTaken = request.sanitationProceduresTaken();
data.proceduresTaken = request.sanitationProceduresTaken;
data.sanitationResult = TetraIcd::SanitationResult::NoEffect;
data.sanitationEvaluation = TetraIcd::SanitationEvaluation::Okay; // To have a 0 for TETRA
data.uniqeId = 0;
data.originatorEquipmentNumber = request.originatorEquipmentNumber();
data.qualification = static_cast<TetraIcd::Qualification>(request.qualification().underlying());
m_ftsTab->sendSetSanitationReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
data.originatorEquipmentNumber = request.originatorEquipmentNumber;
data.qualification = static_cast<TetraIcd::Qualification>(request.qualification);
m_ftsTab->sendSetSanitationReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendSelectiveReammunitionRequest(const rti::core::SampleIdentity &cookie, const SendSelectiveReammunitionRequest &request)
{
DEBUG_LOG(m_logger) << "onSendSelectiveReammunitionRequest for equipment number: " << request.equipmentNumber();
DEBUG_LOG(m_logger) << "onSendSelectiveReammunitionRequest for equipment number: " << request.equipmentNumber;
TetraIcd::SelectiveReammunition data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
data.gearId = request.gearId();
for(auto ra : request.reammunition())
data.gearId = request.gearId;
for(auto ra : request.reammunition)
{
TetraIcd::Reammunition tra;
tra.chargeTypeId = ra.chargeTypeId();
tra.newDefaultStock = ra.newDefaultStock();
tra.newStock = ra.newStock();
tra.tracerRatio = ra.tracerRatio();
tra.chargeTypeId = ra.chargeTypeId;
tra.newDefaultStock = ra.newDefaultStock;
tra.newStock = ra.newStock;
tra.tracerRatio = ra.tracerRatio;
data.reammunitions.push_back(tra);
}
m_ftsTab->sendSelectiveReammunitionReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->sendSelectiveReammunitionReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSendResetAllDusMinesRequest(const rti::core::SampleIdentity &cookie, const SendResetAllDusMinesRequest &request)
@@ -549,20 +549,20 @@ void RecvFromDdsFts::onSendResetAllDusMinesRequest(const rti::core::SampleIdenti
void RecvFromDdsFts::onDemandParticipantConfigurationRequest(const rti::core::SampleIdentity &cookie, const DemandParticipantConfigurationRequest &request)
{
TetraIcd::DemandParticipantConfiguration data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
m_ftsTab->demandParticipantConfigurationReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->demandParticipantConfigurationReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onSetDevicePowerRequest(const rti::core::SampleIdentity &cookie, const SetDevicePowerRequest &request)
{
TetraIcd::SetDevicePowerRequest data;
data.header.equipmentNumber = request.equipmentNumber();
data.header.equipmentNumber = request.equipmentNumber;
data.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
data.powerType = static_cast<TetraIcd::PowerMethod>(request.powerType().underlying());
data.subdeviceId = request.subdeviceId();
data.powerType = static_cast<TetraIcd::PowerMethod>(request.powerType);
data.subdeviceId = request.subdeviceId;
m_ftsTab->setDevicePowerReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(data)));
m_ftsTab->setDevicePowerReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(data)));
}
void RecvFromDdsFts::onAdlerCalculateTrajectoryRequest(const rti::core::SampleIdentity &cookie, const AdlerCalculateTrajectoryRequest &request)
@@ -574,30 +574,30 @@ void RecvFromDdsFts::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId
void RecvFromDdsFts::onSendOcCommandRequest(const rti::core::SampleIdentity &cookie, const SendOcCommandRequest &request)
{
TetraIcd::OcCommand data;
data.action = request.action();
data.action = request.action;
bool bRet = true;
for (const int equipNo : request.equipmentNumbers())
for (const int equipNo : request.equipmentNumbers)
{
data.header.equipmentNumber = equipNo;
if (!m_txCallback->txData(data))
bRet = false;
}
m_ftsTab->sendOcCommandReply(cookie, fillFro(request.requestId(), bRet));
m_ftsTab->sendOcCommandReply(cookie, fillFro(request.requestId, bRet));
}
void RecvFromDdsFts::onSendUasWaypointRequest(const rti::core::SampleIdentity &cookie, const SendUasWaypointRequest &request)
{
TetraIcd::UAVPerformMission mission;
mission.header.equipmentNumber = request.equipmentNumber();
mission.header.equipmentNumber = request.equipmentNumber;
mission.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
mission.missionName = QString::fromStdString(request.name());
mission.missionId = request.planId();
mission.missionName = QString::fromStdString(request.name);
mission.missionId = request.planId;
ERROR_LOG(m_logger) << "####################### request.equipmentNumber(): " << request.equipmentNumber() << ", request.name(): " << request.name() << ", mission.header.equipmentNumber: " << mission.header.equipmentNumber << ", properties: " << request.properties();
ERROR_LOG(m_logger) << "####################### request.equipmentNumber(): " << request.equipmentNumber << ", request.name(): " << request.name << ", mission.header.equipmentNumber: " << mission.header.equipmentNumber << ", properties: " << request.properties;
TetraIcd::UAVAction action;
action.task = TetraIcd::UAVActionTask::Loiter;
@@ -610,7 +610,7 @@ void RecvFromDdsFts::onSendUasWaypointRequest(const rti::core::SampleIdentity &c
try
{
const auto props = LtsUtils::JsonObject::fromJsonSafe(request.properties());
const auto props = LtsUtils::JsonObject::fromJsonSafe(request.properties);
lat = props.value<double>("location_y");
lon = props.value<double>("location_x");
@@ -619,7 +619,7 @@ void RecvFromDdsFts::onSendUasWaypointRequest(const rti::core::SampleIdentity &c
catch (const std::exception &ex)
{
ERROR_LOG(m_logger) << "props is missing critical values: " << ex.what();
m_ftsTab->sendUasWaypointReply(cookie, fillFro(request.equipmentNumber(), false));
m_ftsTab->sendUasWaypointReply(cookie, fillFro(request.equipmentNumber, false));
return;
}
@@ -630,16 +630,16 @@ void RecvFromDdsFts::onSendUasWaypointRequest(const rti::core::SampleIdentity &c
mission.actions.push_back(action);
bool ret = m_txCallback->txData(mission); // send waypoint to uav via uas tab plugin
m_ftsTab->sendUasWaypointReply(cookie, fillFro(request.equipmentNumber(), ret));
m_ftsTab->sendUasWaypointReply(cookie, fillFro(request.equipmentNumber, ret));
}
void RecvFromDdsFts::onSendModifyUasStateRequest(const rti::core::SampleIdentity &cookie, const SendModifyUasStateRequest &request)
{
TetraIcd::UAVChangeState changeState;
changeState.header.equipmentNumber = request.equipmentNumber();
changeState.header.equipmentNumber = request.equipmentNumber;
changeState.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
changeState.requestedState = static_cast<TetraIcd::UAVState>(request.uasState().underlying());
m_ftsTab->sendModifyUasStateReply(cookie, fillFro(request.equipmentNumber(), m_txCallback->txData(changeState)));
changeState.requestedState = static_cast<TetraIcd::UAVState>(request.uasState);
m_ftsTab->sendModifyUasStateReply(cookie, fillFro(request.equipmentNumber, m_txCallback->txData(changeState)));
}
void RecvFromDdsFts::onSendExFireReadinessRequest(const rti::core::SampleIdentity &cookie, const SendExFireReadinessRequest &request)
@@ -647,37 +647,37 @@ void RecvFromDdsFts::onSendExFireReadinessRequest(const rti::core::SampleIdentit
TetraIcd::ExFireReadiness fireReadiness;
fireReadiness.header.equipmentNumber = 100;
fireReadiness.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
fireReadiness.partyId = request.partyId();
fireReadiness.reference = QString::fromStdString(request.reference());
fireReadiness.partyId = request.partyId;
fireReadiness.reference = QString::fromStdString(request.reference);
m_ftsTab->sendExFireReadinessReply(cookie, fillFro(request.participantId(), m_txCallback->txData(fireReadiness)));
m_ftsTab->sendExFireReadinessReply(cookie, fillFro(request.participantId, m_txCallback->txData(fireReadiness)));
}
void RecvFromDdsFts::onSendExFiredReportRequest(const rti::core::SampleIdentity &cookie, const SendExFiredReportRequest &request)
{
TetraIcd::ExFiredReport firedReport;
firedReport.header.equipmentNumber = request.participantId();
firedReport.header.equipmentNumber = request.participantId;
firedReport.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
firedReport.partyId = request.partyId();
firedReport.reference = QString::fromStdString(request.reference());
firedReport.unitIdentifier = QString::fromStdString(request.unitIdentifier());
firedReport.identifier = QString::fromStdString(request.identifier());
firedReport.partyId = request.partyId;
firedReport.reference = QString::fromStdString(request.reference);
firedReport.unitIdentifier = QString::fromStdString(request.unitIdentifier);
firedReport.identifier = QString::fromStdString(request.identifier);
m_ftsTab->sendExFiredReportReply(cookie, fillFro(request.participantId(), m_txCallback->txData(firedReport)));
m_ftsTab->sendExFiredReportReply(cookie, fillFro(request.participantId, m_txCallback->txData(firedReport)));
}
void RecvFromDdsFts::onSendExConfirmationReportRequest(const rti::core::SampleIdentity &cookie, const SendExConfirmationReportRequest &request)
{
TetraIcd::ExConfirmationReport confirmationReport;
confirmationReport.header.equipmentNumber = request.participantId();
confirmationReport.header.equipmentNumber = request.participantId;
confirmationReport.header.timeStamp = QDateTime::currentMSecsSinceEpoch();
confirmationReport.partyId = request.partyId();
confirmationReport.reference = QString::fromStdString(request.reference());
confirmationReport.unitIdentifier = QString::fromStdString(request.unitIdentifier());
confirmationReport.identifier = QString::fromStdString(request.identifier());
confirmationReport.partyId = request.partyId;
confirmationReport.reference = QString::fromStdString(request.reference);
confirmationReport.unitIdentifier = QString::fromStdString(request.unitIdentifier);
confirmationReport.identifier = QString::fromStdString(request.identifier);
m_ftsTab->sendExConfirmationReportReply(cookie, fillFro(request.participantId(), m_txCallback->txData(confirmationReport)));
m_ftsTab->sendExConfirmationReportReply(cookie, fillFro(request.participantId, m_txCallback->txData(confirmationReport)));
}
@@ -757,7 +757,7 @@ int RecvFromDdsFts::calculateRemainEffectTasCode(int chargeTypeIdBase, int remai
if (remainEffectPercent > 100)
remainEffectPercent = 100;
const int destructiveFactor = m_mainHandler->pdmHandler()->buildingChargeEffect(chargeTypeIdBase).destructiveFactor();
const int destructiveFactor = m_mainHandler->pdmHandler()->buildingChargeEffect(chargeTypeIdBase).destructiveFactor;
const int categorie = getDestructiveCategorie(destructiveFactor);
const auto &value = m_categorieData.value(categorie);
File diff suppressed because it is too large. Load diff
@@ -335,9 +335,9 @@ void HandlerAesData::bcContaminations(const QByteArray &data)
LtsUtils::get3Byte(data, pos, x);
req.weatherPosition(dds::core::optional<Core::GeoPosition2D>(relativeToGeoPosition(x, y)));
LtsUtils::get1Byte(data, pos, tmp);
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Chemical, tmp));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Chemical, tmp));
if (req.chargeTypeId() == 0)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Biological, tmp));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Biological, tmp));
LtsUtils::get1Byte(data, pos, tmp);
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req;
@@ -423,11 +423,11 @@ void HandlerAesData::explosionAreas(const QByteArray &data)
LtsUtils::get2Byte(data, pos, tmp);
LtsUtils::get1Byte(data, pos, tmp);
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Artillery, tmp));
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Artillery, tmp));
if (req.chargeStruct().chargeTypeId() == 0)
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Mortar, tmp));
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Mortar, tmp));
if (req.chargeStruct().chargeTypeId() == 0)
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::AirSupport, tmp));
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::AirSupport, tmp));
LtsUtils::get2Byte(data, pos, tmp);
@@ -499,9 +499,9 @@ void HandlerAesData::explosionSingles(const QByteArray &data)
else
LtsUtils::get1Byte(data, pos, tmp);
LtsUtils::get1Byte(data, pos, tmp);
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Artillery, tmp));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Artillery, tmp));
if (req.chargeTypeId() == 0)
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Mortar, tmp));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Mortar, tmp));
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req;
aesToBeDeleted.removeAll(req.id());
@@ -558,15 +558,15 @@ void HandlerAesData::functionalAreas(const QByteArray &data)
LtsUtils::get1Byte(data, pos, tmp);
req.deconMode(static_cast<AreaEffectSimulation::AesOperatingMode::inner_enum>(tmp));
req.deconMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
LtsUtils::get1Byte(data, pos, tmp);
req.deconTime(tmp * 10 * 60 * 1000);
LtsUtils::get1Byte(data, pos, tmp);
req.maintMode(static_cast<AreaEffectSimulation::AesOperatingMode::inner_enum>(tmp));
req.maintMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
LtsUtils::get1Byte(data, pos, tmp);
req.maintTime(tmp * 10 * 60 * 1000);
LtsUtils::get1Byte(data, pos, tmp);
req.medicMode(static_cast<AreaEffectSimulation::AesOperatingMode::inner_enum>(tmp));
req.medicMode(static_cast<AreaEffectSimulation::AesOperatingMode>(tmp));
LtsUtils::get1Byte(data, pos, tmp);
req.medicTime(tmp * 10 * 60 * 1000);
req.chargeTypeId(411);
@@ -626,7 +626,7 @@ void HandlerAesData::nContaminations(const QByteArray &data)
LtsUtils::get2Byte(data, pos, tmp);
req.rotationAngle(mathToCompassAngle(tmp));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Nuclear, 1));
req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::Nuclear, 1));
DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req;
@@ -676,7 +676,7 @@ void HandlerAesData::mineAreas(const QByteArray &data)
LtsUtils::get1Byte(data, pos, tmp);
if (217 > tmp && 210 < tmp)
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::MineArea, tmp));
req.chargeStruct().chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass::MineArea, tmp));
else
req.chargeStruct().chargeTypeId(tmp);
@@ -80,7 +80,7 @@ void SendToDds::rxData(const OcTelegrams::SpecificsEquipment &inData)
outData.equipmentNumber(inData.equipmentNumber);
outData.playerType(inData.playerType);
outData.language(static_cast<ProjectDataManagement::LanguageConfiguration::inner_enum>(inData.language));
outData.language(static_cast<ProjectDataManagement::LanguageConfiguration>(inData.language));
outData.pyrotechnics(inData.pyrotechnics);
outData.voiceOutput(inData.voiceOutput);
outData.exerciseBreak(inData.exerciseBreak);
@@ -16,6 +16,7 @@ namespace WarehouseManagement
ClientMessageFactory::ClientMessageFactory(DataManager *dataManager)
: LtsWebSocket::AbstractClientMessageFactory(getLogger("ClientMessageFactory"))
, m_logger(getLogger("ClientMessageFactory"))
, m_dataManager(dataManager)
{}
@@ -265,7 +266,7 @@ ParticipantRegisterInExconReply::ParticipantRegisterInExconReply(int exerciseId,
QJsonObject obj;
obj[::WebSocketInterface::JsonKeys::EXERCISE_ID()] = exerciseId;
obj[::WebSocketInterface::JsonKeys::PARTICIPANT_ID()] = participantId;
obj[::WebSocketInterface::JsonKeys::REGISTRATION_RETURN_VALUE()] = (int) retValue.underlying();
obj[::WebSocketInterface::JsonKeys::REGISTRATION_RETURN_VALUE()] = static_cast<int>(retValue);
m_jsonRepresentation.insert(LtsWebSocket::JsonKeys::DATA(), obj);
}
@@ -275,21 +276,21 @@ void DataManager::handleEquipmentTypes(const ::EquipmentTypes &eTypes)
INFO_LOG(m_logger) << "equipTypeMap size: " << equipTypeMap.size();
ParticipantManagement::ModifyEquipmentTypeDataRequest request;
request.deleteAll(true);
auto &dataVec = request.data();
request.deleteAll = true;
auto &dataVec = request.data;
dataVec.reserve(equipTypeMap.size());
for (const IWMS2ECC::EquipmentType &et : equipTypeMap)
{
ParticipantManagement::EquipmentType pEt;
pEt.id(et.id);
pEt.name(et.name.toStdString());
pEt.minEquipNo(et.minEquipNo);
pEt.maxEquipNo(et.maxEquipNo);
pEt.traPlayerTypeId(et.taPlayerTypeId);
pEt.deletedInWms(et.deletedInWMS);
pEt.traVulnerabilityModelId(et.taVulnerabilityModelId);
ParticipantManagement::WmsTypeClass wmsTypeClass = static_cast<ParticipantManagement::WmsTypeClass_def::type>(et.specialType);
pEt.wmsTypeClass(wmsTypeClass);
pEt.id = et.id;
pEt.name = et.name.toStdString();
pEt.minEquipNo = et.minEquipNo;
pEt.maxEquipNo = et.maxEquipNo;
pEt.traPlayerTypeId = et.taPlayerTypeId;
pEt.deletedInWms = et.deletedInWMS;
pEt.traVulnerabilityModelId = et.taVulnerabilityModelId;
ParticipantManagement::WmsTypeClass wmsTypeClass = static_cast<ParticipantManagement::WmsTypeClass>(et.specialType);
pEt.wmsTypeClass = wmsTypeClass;
dataVec.push_back(std::move(pEt));
}
@@ -331,7 +332,7 @@ void DataManager::onParticipantChanged(const ParticipantManagement::Participant
if (!m_clientConnection || !m_wms2ecc)
return;
DEBUG_LOG(m_logger) << "partyId: " << data.partyId() << "participantId: " << data.id();
DEBUG_LOG(m_logger) << "partyId: " << data.partyId << "participantId: " << data.id;
IWMS2ECC::PlayerInfo pl = m_wms2ecc->convert(data, exerciseId);
pl.playerId = (exerciseId* 1000000) + pl.playerId;
m_clientConnection->addReply(new ParticipantUpdate(pl, modType));
@@ -342,7 +343,7 @@ void DataManager::onExerciseChanged(const ExerciseManagement::Exercise &data, Da
if (!m_clientConnection)
return;
INFO_LOG(m_logger) << "IN onExerciseChanged: ExerciseUpdate: id = " << data.id();
INFO_LOG(m_logger) << "IN onExerciseChanged: ExerciseUpdate: id = " << data.id;
IWMS2ECC::Exercise exeData = IWMS2ECC_Impl::convert(data);
m_clientConnection->addReply(new ExerciseUpdate(exeData, modType));
@@ -45,7 +45,7 @@ bool DdsHandler::init(const QStringList &qosFileList)
m_ppmFtc = ParticipantManagement::Interface::Ftc::create(m_ddsConnector);
bRet &= m_ppmFtc->enableModifyEquipmentTypeData();
m_pacemaker->setNewState(Core::RunningState::inner_enum::Starting);
m_pacemaker->setNewState(Core::RunningState::Starting);
return bRet;
}
@@ -77,25 +77,25 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId,
const dds::core::optional<QString> &info)
{
ParticipantManagement::RegisterParticipantRequest req;
req.assignState(assignState);
req.assignState = assignState;
if (equipNo.is_set())
req.equipmentNumber(equipNo.get());
req.equipmentNumber = equipNo.get();
if (identification.is_set())
req.identification(identification.get().toStdString());
req.identification = identification.get().toStdString();
if (info.is_set())
req.info(info.get().toStdString());
req.info = info.get().toStdString();
if (!equipNo.is_set() || !info.is_set() || !identification.is_set())
{
const auto participant = m_ddsHandlerExercise->ppmDtc()->participant(participantId);
if (!equipNo.is_set() && participant.equipmentNumber().is_set())
req.equipmentNumber(participant.equipmentNumber().get());
if (!equipNo.is_set() && participant.equipmentNumber.is_set())
req.equipmentNumber = participant.equipmentNumber.get();
if (!info.is_set())
req.info(participant.info());
req.info = participant.info;
if (!identification.is_set())
req.identification(participant.identification());
req.identification = participant.identification;
}
req.participantId(participantId);
req.participantId = participantId;
INFO_LOG(m_logger) << "IN ::registerParticipant, ParticipantId: " << participantId
<< ", equipNo: " << equipNo << ", assignState: " << assignState;
@@ -105,18 +105,18 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId,
void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantManagement::RegisterReply &reply)
{
INFO_LOG(m_logger) << "RegisterReply id " << reply.id()
<< " - registerReturnValue: " << reply.registerReturnValue()
<< " for exercise " << reply.exerciseId();
INFO_LOG(m_logger) << "RegisterReply id " << reply.id
<< " - registerReturnValue: " << reply.registerReturnValue
<< " for exercise " << reply.exerciseId;
Core::FunctionReplyObject fro;
fro.setStr(reply.errorString().c_str());
for (const auto &arg : reply.errorParams())
fro.setStr(reply.errorString.c_str());
for (const auto &arg : reply.errorParams)
fro = fro.arg(arg);
emit registrationReturnValue(reply.exerciseId(), reply.id(), reply.registerReturnValue());
emit registrationReturnValue(reply.exerciseId, reply.id, reply.registerReturnValue);
if (fro.error())
ERROR_LOG(m_logger) << "Error: " << fro();
@@ -125,13 +125,13 @@ void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantMan
void ExerciseParticipantHandler::participantAdded(const ParticipantManagement::Participant &participant)
{
if (!participant.equipmentNumber().is_set() || participant.equipmentNumber().get() == 0)
if (!participant.equipmentNumber.is_set() || participant.equipmentNumber.get() == 0)
{
INFO_LOG(m_logger) << "New participant but no equipment number - ignoring";
return;
}
addParticipant(participant.id(), participant.equipmentNumber().get());
addParticipant(participant.id, participant.equipmentNumber.get());
}
void ExerciseParticipantHandler::participantModified(const ParticipantManagement::Participant &participant)
@@ -145,50 +145,50 @@ void ExerciseParticipantHandler::participantModified(const ParticipantManagement
const auto itEquipNumber = m_participantId2EquipmentNumber.constFind(participant.id());
const auto itEquipNumber = m_participantId2EquipmentNumber.constFind(participant.id);
if (itEquipNumber == m_participantId2EquipmentNumber.constEnd())
{
if (!participant.equipmentNumber().is_set() || participant.equipmentNumber() == 0)
if (!participant.equipmentNumber.is_set() || participant.equipmentNumber.get() == 0)
{
return;
}
addParticipant(participant.id(), participant.equipmentNumber().get());
addParticipant(participant.id, participant.equipmentNumber.get());
return;
}
if (itEquipNumber.value() == participant.equipmentNumber())
if (participant.equipmentNumber.is_set() && itEquipNumber.value() == participant.equipmentNumber.get())
{
return;
}
if (participant.equipmentNumber().is_set())
if (participant.equipmentNumber.is_set())
{
INFO_LOG(m_logger) << "Participant with id " << participant.id() << " changed its equipment number from "
<< itEquipNumber.value() << " to " << participant.equipmentNumber().get();
INFO_LOG(m_logger) << "Participant with id " << participant.id << " changed its equipment number from "
<< itEquipNumber.value() << " to " << participant.equipmentNumber.get();
}
if (participant.equipmentNumber() == 0)
if (participant.equipmentNumber.is_set() && participant.equipmentNumber.get() == 0)
{
removeParticipant(participant.id(), participant.equipmentNumber().get());
removeParticipant(participant.id, participant.equipmentNumber.get());
return;
}
removeParticipant(itEquipNumber.key(), itEquipNumber.value());
if (participant.equipmentNumber().is_set())
addParticipant(participant.id(), participant.equipmentNumber().get());
if (participant.equipmentNumber.is_set())
addParticipant(participant.id, participant.equipmentNumber.get());
}
void ExerciseParticipantHandler::participantRemoved(const ParticipantManagement::Participant &participant)
{
const auto itEquipNumber = m_participantId2EquipmentNumber.find(participant.id());
const auto itEquipNumber = m_participantId2EquipmentNumber.find(participant.id);
if (itEquipNumber == m_participantId2EquipmentNumber.end())
{
@@ -200,10 +200,10 @@ void ExerciseParticipantHandler::participantRemoved(const ParticipantManagement:
void ExerciseParticipantHandler::emitChangedForInferiors(const ParticipantManagement::Participant &participant)
{
for (const int inferior : participant.inferiorIds())
for (const int inferior : participant.inferiorIds)
{
const auto inf = m_ddsHandlerExercise->ppmDtc()->participant(inferior);
if (inf.id() != 0)
if (inf.id != 0)
emit participantChanged(inf, DataModification::eModified, m_exerciseId);
emitChangedForInferiors(inf);
}
@@ -258,10 +258,10 @@ void ExerciseParticipantHandler::onPartyChanged(const ParticipantManagement::Par
{
case DataModification::eAdded:
case DataModification::eModified:
m_partyMap[data.id()] = data;
m_partyMap[data.id] = data;
break;
case DataModification::eRemoved:
m_partyMap.remove(data.id());
m_partyMap.remove(data.id);
break;
}
}
@@ -8,7 +8,8 @@ namespace WarehouseManagement
{
ExercisesHandler::ExercisesHandler(const std::shared_ptr<DdsHandler> &ddsHandler)
: m_ddsHandler(ddsHandler)
: m_logger(getLogger("ExercisesHandler"))
, m_ddsHandler(ddsHandler)
{}
ExercisesHandler::~ExercisesHandler()
@@ -23,7 +24,7 @@ bool ExercisesHandler::init()
auto cb = [this](const ExerciseManagement::Exercise &exercise)
{
exerciseAdded(exercise.id());
exerciseAdded(exercise.id);
};
m_ddsHandler->exmDtc()->exercises(cb);
@@ -50,9 +51,9 @@ ParticipantManagement::TypeClass ExercisesHandler::typeClassIdFromEquipmentTypeI
std::function<bool(const ParticipantManagement::Type &data)> cb =
[equipTypeId, &ret](const ParticipantManagement::Type &t) -> bool
{
if (t.equipmentTypeId() != equipTypeId)
if (t.equipmentTypeId != equipTypeId)
return false;
ret = t.typeClass();
ret = t.typeClass;
return true;
};
m_ddsHandler->ppmDtc()->types(cb);
@@ -132,7 +133,7 @@ bool ExercisesHandler::unregisterParticipant(int exerciseId, qint32 equipNo)
return false;
ParticipantManagement::ParticipantAssignState assignState = ParticipantManagement::ParticipantAssignState_def::NotAssigned;
ParticipantManagement::ParticipantAssignState assignState = ParticipantManagement::ParticipantAssignState::NotAssigned;
m_exerciseHandler.value(exerciseId)->registerParticipant(participantId, assignState, 0, {}, {});
return true;
@@ -142,8 +143,8 @@ bool ExercisesHandler::modifyEquipmentTypes(const std::vector<ParticipantManagem
{
ParticipantManagement::ModifyEquipmentTypeDataRequest req;
req.data(vectorEquipTypes);
req.deleteAll(true);
req.data = vectorEquipTypes;
req.deleteAll = true;
return m_ddsHandler->ppmFtc()->modifyEquipmentTypeDataRequest(req, this);
}
@@ -254,19 +255,19 @@ QMultiHash<int, ParticipantInfoStruct>::iterator ExercisesHandler::findParticipa
void ExercisesHandler::onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType)
{
if (!data.sendToWMS())
if (!data.sendToWMS)
{
if (m_exerciseHandler.contains(data.id()))
exerciseRemoved(data.id());
if (m_exerciseHandler.contains(data.id))
exerciseRemoved(data.id);
emit exerciseChanged(data, DataModification::eRemoved);
}
else
{
if (!m_exerciseHandler.contains(data.id()))
if (!m_exerciseHandler.contains(data.id))
{
modType = DataModification::eAdded;
exerciseAdded(data.id());
exerciseAdded(data.id);
}
else
{
@@ -16,7 +16,8 @@ namespace WarehouseManagement
{
IWMS2ECC_Impl::IWMS2ECC_Impl(const std::shared_ptr<ExercisesHandler> &exercisesHandler)
: m_exercisesHandler(exercisesHandler)
: m_logger(getLogger("Wms2Ecc"))
, m_exercisesHandler(exercisesHandler)
{
connect(m_exercisesHandler.get(), &ExercisesHandler::registrationReturnValue,
this, &IWMS2ECC_Impl::onRegistrationReturnValue);
@@ -25,17 +26,17 @@ IWMS2ECC_Impl::IWMS2ECC_Impl(const std::shared_ptr<ExercisesHandler> &exercisesH
IWMS2ECC::Exercise IWMS2ECC_Impl::convert(const ExerciseManagement::Exercise &ex)
{
IWMS2ECC::Exercise ret;
ret.id = ex.id();
ret.name = QString::fromStdString(ex.name());
if (ex.state() == ExerciseManagement::ExerciseState_def::Started ||
ex.state() == ExerciseManagement::ExerciseState_def::Paused)
ret.id = ex.id;
ret.name = QString::fromStdString(ex.name);
if (ex.state == ExerciseManagement::ExerciseState::Started ||
ex.state == ExerciseManagement::ExerciseState::Paused)
ret.actExercise = 1;
else
ret.actExercise = 0;
ret.start = ex.beginTime() / 1000;
ret.end = ex.endTime() / 1000;
ret.stateAsString = ExerciseManagement::toString(ex.state());
ret.start = ex.beginTime / 1000;
ret.end = ex.endTime / 1000;
ret.stateAsString = ExerciseManagement::toString(ex.state);
return ret;
}
@@ -43,42 +44,42 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::convert(const ParticipantManagement::Partici
{
IWMS2ECC::PlayerInfo pi;
pi.alias = QString::fromStdString(part.identification());
pi.assignState = convert(part.assignState());
pi.designator = QString::fromStdString(part.designator());
if (part.equipmentNumber().is_set())
pi.equipNo = part.equipmentNumber().get();
else if (part.assignState() == ParticipantManagement::ParticipantAssignState_def::HandoutExcon)
pi.alias = QString::fromStdString(part.identification);
pi.assignState = convert(part.assignState);
pi.designator = QString::fromStdString(part.designator);
if (part.equipmentNumber.is_set())
pi.equipNo = part.equipmentNumber.get();
else if (part.assignState == ParticipantManagement::ParticipantAssignState::HandoutExcon)
pi.equipNo = 0;
pi.exerciseId = exerciseId;
pi.forceId = part.partyId();
pi.forceId = part.partyId;
DEBUG_LOG(m_logger) << "Force Id = " << pi.forceId;
pi.info = QString::fromStdString(part.info());
pi.parentPlayerId = part.superiorId();
pi.playerId = part.id();
pi.playerState = part.isDeleted() ? IWMS2ECC::PlayerState::DELETED : IWMS2ECC::PlayerState::FOUND;
pi.info = QString::fromStdString(part.info);
pi.parentPlayerId = part.superiorId;
pi.playerId = part.id;
pi.playerState = part.isDeleted ? IWMS2ECC::PlayerState::DELETED : IWMS2ECC::PlayerState::FOUND;
pi.tactIdent = QString::fromStdString(part.tacticalIdentifier());
const ParticipantManagement::Type partType = m_exercisesHandler->participantType(part.typeId());
if (partType.id() == part.typeId())
pi.tactIdent = QString::fromStdString(part.tacticalIdentifier);
const ParticipantManagement::Type partType = m_exercisesHandler->participantType(part.typeId);
if (partType.id == part.typeId)
{
pi.equipTypeId = partType.equipmentTypeId();
pi.typeClassId = convert(partType.typeClass());
TRACE_LOG(m_logger) << "Found participant type with id " << part.typeId() << ", " << pi.typeClassId << ", " << pi.equipTypeId;
pi.equipTypeId = partType.equipmentTypeId;
pi.typeClassId = convert(partType.typeClass);
TRACE_LOG(m_logger) << "Found participant type with id " << part.typeId << ", " << pi.typeClassId << ", " << pi.equipTypeId;
}
else
WARNING_LOG(m_logger) << "Can not find participant type with id " << part.typeId();
pi.typeId = part.typeId();
pi.isDeleted = part.isDeleted();
WARNING_LOG(m_logger) << "Can not find participant type with id " << part.typeId;
pi.typeId = part.typeId;
pi.isDeleted = part.isDeleted;
pi.hierarchy = m_exercisesHandler->getHierarchyFromParticipant(part.id(), exerciseId, allParticipants);
const ParticipantManagement::Party party = m_exercisesHandler->getParty(part.partyId(), exerciseId);
pi.forceName = QString::fromStdString(party.name());
pi.hierarchy = m_exercisesHandler->getHierarchyFromParticipant(part.id, exerciseId, allParticipants);
const ParticipantManagement::Party party = m_exercisesHandler->getParty(part.partyId, exerciseId);
pi.forceName = QString::fromStdString(party.name);
pi.symbolColor = party.color();
pi.symbolColor = party.color;
DEBUG_LOG(m_logger) << "party.name: " << pi.forceName;
DEBUG_LOG(m_logger) << "symbolColor: " << pi.symbolColor << ", playerId: " << pi.playerId << ", exerciseId: " << exerciseId;
@@ -93,8 +94,8 @@ IWMS2ECC::exerciseMap IWMS2ECC_Impl::getExercises() const
IWMS2ECC::exerciseMap retMap;
for (const ExerciseManagement::Exercise &ex : exMap)
{
if (ex.sendToWMS())
retMap.insert(ex.id(), convert(ex));
if (ex.sendToWMS)
retMap.insert(ex.id, convert(ex));
}
INFO_LOG(m_logger) << "IN getExercises, exMap.size(): " << exMap.size()
@@ -204,7 +205,7 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::getPlayerInfo(int playerId, int exerciseId)
ParticipantManagement::Participant part = m_exercisesHandler->getParticipant(playerId, exerciseId);
IWMS2ECC::PlayerInfo pi;
if (part.assignState() == ParticipantManagement::ParticipantAssignState_def::HandoutExcon)
if (part.assignState == ParticipantManagement::ParticipantAssignState::HandoutExcon)
{
pi.playerState = NOT_FOUND;
return pi;
@@ -212,7 +213,7 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::getPlayerInfo(int playerId, int exerciseId)
pi = convert(part, exerciseId);
pi.forceName = QString::fromStdString(m_exercisesHandler->getParty(part.partyId(), exerciseId).name());
pi.forceName = QString::fromStdString(m_exercisesHandler->getParty(part.partyId, exerciseId).name);
pi.playerState = FOUND;
@@ -236,10 +237,10 @@ QMap<int, int> IWMS2ECC_Impl::getEquipRequirements(int exerciseId) const
for (const ParticipantManagement::Participant &part : map)
{
if (part.isDeleted())
if (part.isDeleted)
continue;
reqPartTypes[part.typeId()]++;
reqPartTypes[part.typeId]++;
}
QMap<int, int> reqEquipTypes;
@@ -248,12 +249,12 @@ QMap<int, int> IWMS2ECC_Impl::getEquipRequirements(int exerciseId) const
{
const int typeId = cIt.key();
const ParticipantManagement::Type partType = m_exercisesHandler->participantType(typeId);
if (partType.id() == typeId)
if (partType.id == typeId)
{
DEBUG_LOG(m_logger) << "Key: " << typeId;
ParticipantManagement::TypeClass typeClass = partType.typeClass();
int equipTypeId = partType.equipmentTypeId();
if (typeClass != ParticipantManagement::TypeClass_def::Unit && typeClass != ParticipantManagement::TypeClass_def::SupportUnit)
ParticipantManagement::TypeClass typeClass = partType.typeClass;
int equipTypeId = partType.equipmentTypeId;
if (typeClass != ParticipantManagement::TypeClass::Unit && typeClass != ParticipantManagement::TypeClass::SupportUnit)
{
reqEquipTypes[equipTypeId] = cIt.value();
DEBUG_LOG(m_logger) << "equipTypeId: " << equipTypeId << ", amount: " << cIt.value();
@@ -287,29 +288,29 @@ QByteArray IWMS2ECC_Impl::getSymbol(int symbolId, int exerciseId, const QColor &
IWMS2ECC::EquipmentType IWMS2ECC_Impl::convert(const ParticipantManagement::EquipmentType &et)
{
IWMS2ECC::EquipmentType ret;
ret.id = et.id();
ret.name = QString::fromStdString(et.name());
ret.minEquipNo = et.minEquipNo();
ret.maxEquipNo = et.maxEquipNo();
ret.specialType = int(et.wmsTypeClass().underlying());
ret.taVulnerabilityModelId = et.traVulnerabilityModelId();
ret.taPlayerTypeId = et.traPlayerTypeId();
ret.deletedInWMS = et.deletedInWms();
ret.id = et.id;
ret.name = QString::fromStdString(et.name);
ret.minEquipNo = et.minEquipNo;
ret.maxEquipNo = et.maxEquipNo;
ret.specialType = static_cast<int>(et.wmsTypeClass);
ret.taVulnerabilityModelId = et.traVulnerabilityModelId;
ret.taPlayerTypeId = et.traPlayerTypeId;
ret.deletedInWMS = et.deletedInWms;
return ret;
}
ParticipantManagement::EquipmentType IWMS2ECC_Impl::convert(const IWMS2ECC::EquipmentType &et)
{
ParticipantManagement::EquipmentType ret;
ret.id(et.id);
ret.name(et.name.toStdString());
ret.minEquipNo(et.minEquipNo);
ret.maxEquipNo(et.maxEquipNo);
ret.id = et.id;
ret.name = et.name.toStdString();
ret.minEquipNo = et.minEquipNo;
ret.maxEquipNo = et.maxEquipNo;
ParticipantManagement::WmsTypeClass wmsTypeClass = convert(et.specialType);
ret.wmsTypeClass(wmsTypeClass);
ret.traVulnerabilityModelId(et.taVulnerabilityModelId);
ret.traPlayerTypeId(et.taPlayerTypeId);
ret.deletedInWms(et.deletedInWMS);
ret.wmsTypeClass = wmsTypeClass;
ret.traVulnerabilityModelId = et.taVulnerabilityModelId;
ret.traPlayerTypeId = et.taPlayerTypeId;
ret.deletedInWms = et.deletedInWMS;
return ret;
}
@@ -318,26 +319,26 @@ ParticipantManagement::WmsTypeClass IWMS2ECC_Impl::convert(int specialType)
switch (specialType)
{
case 0:
return ParticipantManagement::WmsTypeClass_def::None;
return ParticipantManagement::WmsTypeClass::None;
case 1:
return ParticipantManagement::WmsTypeClass_def::Building;
return ParticipantManagement::WmsTypeClass::Building;
case 2:
return ParticipantManagement::WmsTypeClass_def::Vehicle;
return ParticipantManagement::WmsTypeClass::Vehicle;
case 3:
return ParticipantManagement::WmsTypeClass_def::Human;
return ParticipantManagement::WmsTypeClass::Human;
case 4:
return ParticipantManagement::WmsTypeClass_def::TargetVehicle;
return ParticipantManagement::WmsTypeClass::TargetVehicle;
case 5:
return ParticipantManagement::WmsTypeClass_def::TargetHuman;
return ParticipantManagement::WmsTypeClass::TargetHuman;
case 6:
return ParticipantManagement::WmsTypeClass_def::Airborne;
return ParticipantManagement::WmsTypeClass::Airborne;
case 7:
return ParticipantManagement::WmsTypeClass_def::VehicleMarker;
return ParticipantManagement::WmsTypeClass::VehicleMarker;
default:
Q_ASSERT(false);
break;
}
return ParticipantManagement::WmsTypeClass_def::None;
return ParticipantManagement::WmsTypeClass::None;
}
ParticipantManagement::TypeClass IWMS2ECC_Impl::convertTypeClass(int typeClass)
@@ -345,49 +346,49 @@ ParticipantManagement::TypeClass IWMS2ECC_Impl::convertTypeClass(int typeClass)
switch (typeClass)
{
case 1:
return ParticipantManagement::TypeClass_def::Unit;
return ParticipantManagement::TypeClass::Unit;
case 2:
return ParticipantManagement::TypeClass_def::VehicleWithGear;
return ParticipantManagement::TypeClass::VehicleWithGear;
case 3:
case 4:
return ParticipantManagement::TypeClass_def::GroundVehicle;
return ParticipantManagement::TypeClass::GroundVehicle;
case 5:
return ParticipantManagement::TypeClass_def::Human;
return ParticipantManagement::TypeClass::Human;
case 6:
case 7:
return ParticipantManagement::TypeClass_def::SupportEntity;
return ParticipantManagement::TypeClass::SupportEntity;
case 8:
return ParticipantManagement::TypeClass_def::Aircraft;
return ParticipantManagement::TypeClass::Aircraft;
case 10:
return ParticipantManagement::TypeClass_def::SupportUnit;
return ParticipantManagement::TypeClass::SupportUnit;
default:
Q_ASSERT(false);
break;
}
return ParticipantManagement::TypeClass_def::Unit;
return ParticipantManagement::TypeClass::Unit;
}
int IWMS2ECC_Impl::convert(ParticipantManagement::TypeClass typeClass)
{
switch (typeClass.underlying())
switch (typeClass)
{
case ParticipantManagement::TypeClass_def::Unknown:
case ParticipantManagement::TypeClass::Unknown:
return 0;
case ParticipantManagement::TypeClass_def::Unit:
case ParticipantManagement::TypeClass::Unit:
return 1;
case ParticipantManagement::TypeClass_def::Human:
case ParticipantManagement::TypeClass::Human:
return 5;
case ParticipantManagement::TypeClass_def::VehicleWithGear:
case ParticipantManagement::TypeClass_def::WeaponSystem:
case ParticipantManagement::TypeClass::VehicleWithGear:
case ParticipantManagement::TypeClass::WeaponSystem:
return 2;
case ParticipantManagement::TypeClass_def::GroundVehicle:
case ParticipantManagement::TypeClass::GroundVehicle:
return 3;
case ParticipantManagement::TypeClass_def::SupportUnit:
case ParticipantManagement::TypeClass::SupportUnit:
return 10;
case ParticipantManagement::TypeClass_def::SupportEntity:
case ParticipantManagement::TypeClass::SupportEntity:
return 7;
case ParticipantManagement::TypeClass_def::Aircraft:
case ParticipantManagement::TypeClass::Aircraft:
return 8;
default:
Q_ASSERT(false);
@@ -420,17 +421,17 @@ bool IWMS2ECC_Impl::setEquipmentTypes(const equipTypeMap &map)
IWMS2ECC::PlayerAssignState IWMS2ECC_Impl::convert(const ParticipantManagement::ParticipantAssignState &state)
{
switch (state.underlying())
switch (state)
{
case ParticipantManagement::ParticipantAssignState_def::NotAssigned:
case ParticipantManagement::ParticipantAssignState::NotAssigned:
return IWMS2ECC::NOT_ASSIGNED;
case ParticipantManagement::ParticipantAssignState_def::AssignedWms:
case ParticipantManagement::ParticipantAssignState::AssignedWms:
return IWMS2ECC::ASSIGNED;
case ParticipantManagement::ParticipantAssignState_def::HandoutWms:
case ParticipantManagement::ParticipantAssignState::HandoutWms:
return IWMS2ECC::HANDOUT_WMS;
case ParticipantManagement::ParticipantAssignState_def::HandoutExcon:
case ParticipantManagement::ParticipantAssignState::HandoutExcon:
return IWMS2ECC::HANDOUT_EXCON;
case ParticipantManagement::ParticipantAssignState_def::ExconWmsOverruled:
case ParticipantManagement::ParticipantAssignState::ExconWmsOverruled:
return IWMS2ECC::HANDOUT_EXCON_OVERRULED_WMS;
}
@@ -443,38 +444,38 @@ ParticipantManagement::ParticipantAssignState IWMS2ECC_Impl::convert(const IWMS2
switch (state)
{
case IWMS2ECC::UNDEFINED:
return ParticipantManagement::ParticipantAssignState_def::NotAssigned;
return ParticipantManagement::ParticipantAssignState::NotAssigned;
case IWMS2ECC::NOT_ASSIGNED:
return ParticipantManagement::ParticipantAssignState_def::NotAssigned;
return ParticipantManagement::ParticipantAssignState::NotAssigned;
case IWMS2ECC::ASSIGNED:
return ParticipantManagement::ParticipantAssignState_def::AssignedWms;
return ParticipantManagement::ParticipantAssignState::AssignedWms;
case IWMS2ECC::HANDOUT_WMS:
return ParticipantManagement::ParticipantAssignState_def::HandoutWms;
return ParticipantManagement::ParticipantAssignState::HandoutWms;
case IWMS2ECC::HANDOUT_EXCON:
return ParticipantManagement::ParticipantAssignState_def::HandoutExcon;
return ParticipantManagement::ParticipantAssignState::HandoutExcon;
case IWMS2ECC::HANDOUT_EXCON_OVERRULED_WMS:
return ParticipantManagement::ParticipantAssignState_def::ExconWmsOverruled;
return ParticipantManagement::ParticipantAssignState::ExconWmsOverruled;
}
Q_ASSERT(false);
return ParticipantManagement::ParticipantAssignState_def::NotAssigned;
return ParticipantManagement::ParticipantAssignState::NotAssigned;
}
IWMS2ECC::RegisterReturnValue IWMS2ECC_Impl::convert(const ParticipantManagement::RegisterReturnValue retValue)
{
switch (retValue.underlying())
switch (retValue)
{
case ParticipantManagement::RegisterReturnValue_def::AssignmentIncorrect:
case ParticipantManagement::RegisterReturnValue::AssignmentIncorrect:
return IWMS2ECC::AssignmentIncorrect;
case ParticipantManagement::RegisterReturnValue_def::PlayerDeleted:
case ParticipantManagement::RegisterReturnValue::PlayerDeleted:
return IWMS2ECC::PlayerDeleted;
case ParticipantManagement::RegisterReturnValue_def::PlayerNotFound:
case ParticipantManagement::RegisterReturnValue::PlayerNotFound:
return IWMS2ECC::PlayerNotFound;
case ParticipantManagement::RegisterReturnValue_def::RegistrationFailed:
case ParticipantManagement::RegisterReturnValue::RegistrationFailed:
return IWMS2ECC::RegistrationFailed;
case ParticipantManagement::RegisterReturnValue_def::RegistrationOk:
case ParticipantManagement::RegisterReturnValue::RegistrationOk:
return IWMS2ECC::RegistrationOk;
case ParticipantManagement::RegisterReturnValue_def::EquipNoAlreadyAssigned:
case ParticipantManagement::RegisterReturnValue::EquipNoAlreadyAssigned:
return IWMS2ECC::EquipNoAlreadyAssigned;
}
@@ -48,7 +48,7 @@ bool MainHandler::init(int domainId)
connect(m_exercisesHandler.get(), &ExercisesHandler::registrationReturnValue, m_dataManager,
&DataManager::onRegistrationReturnValue);
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::Running);
m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running);
return true;
}