Merge feature/qt6-migration-basis-modules-services into feature/qt6-migration-basis-modules
Resolves 17 conflicts against legacy Qt5 semantics; validates with BUILD_RTI=ON BUILD_GRANTLEE=ON.
This commit is contained in:
1200 files changed
+20421
-18259
No files matched your search
+8
@@ -14,6 +14,14 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
# <logger.h> from the subdirectories (BSM, Json, VWM, ControlEffects) must
|
||||
# resolve to this directory's logger.h (namespace BuildingControlUnit), as in
|
||||
# the qt5 build. The root CMakeLists puts Lts/Proxies/TrainingAreaBase on the
|
||||
# global include path, which would otherwise shadow it with
|
||||
# TrainingAreaBase/logger.h (whose svctabcommon_export.h lives only in the
|
||||
# build tree), breaking these targets.
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
ADD_SUBDIRECTORY(BSM)
|
||||
if(BUILDINGCONTROLJSON_AVAILABLE)
|
||||
ADD_SUBDIRECTORY(Json)
|
||||
|
||||
+2
-2
@@ -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 {};
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -37,7 +37,6 @@ private Q_SLOTS:
|
||||
void onSwitchRelayRequest(const QString &hostname, const SwitchRelayValues &switchRelayValues);
|
||||
void webSocketSendInitialData(QWebSocket *ws);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
QVector<int> getAffectedRoomIds(const QVector<HitRoom> &allHitRooms) const;
|
||||
QVector<int> getSegmentDamage(const QVector<HitRoom> &allHitRooms, const int damagePercentNew) const;
|
||||
int getHitRoomId(const QVector<HitRoom> &allHitRooms) const;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
# Make ${Qt6_Gui} optional
|
||||
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Gui)
|
||||
set(Qt6_Gui ${Qt6_Gui})
|
||||
set(Qt6_Gui Qt6::Gui)
|
||||
else()
|
||||
set(Qt6_Gui "")
|
||||
endif()
|
||||
@@ -42,12 +42,6 @@ CODEGEN_DATABASE(SRCS_common ${xml_FILE})
|
||||
|
||||
# Generate *.cpp/*.hpp from idl
|
||||
RTIDDSGEN(SRCS_common bld_enums.idl)
|
||||
# Stub file for compilation (fallback when no IDL exists)
|
||||
CONFIGURE_FILE(
|
||||
${CMAKE_SOURCE_DIR}/include/Buildings/bld_enums.hpp.stub
|
||||
${CMAKE_BINARY_DIR}/Lts/Proxies/Buildings/bld_enums.hpp
|
||||
COPYONLY
|
||||
)
|
||||
RTIDDSGEN(SRCS_common bld.idl)
|
||||
|
||||
# Generate bld_dt[s,c]_types.h, bld_ft[s,c]_types.h
|
||||
@@ -85,6 +79,11 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcBldClient SHARED ${SRCS_client})
|
||||
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
|
||||
# MAKE_<SYMBOL>_LIB compile guard, but the generated bld_[d|f]tc_impl.h
|
||||
# headers that this target compiles carry such a guard — same situation as
|
||||
# ddscore, which defines MAKE_DDSCORE_LIB explicitly for the same reason.
|
||||
TARGET_COMPILE_DEFINITIONS(svcBldClient PRIVATE MAKE_SVCBLDCLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcBldClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -113,6 +112,9 @@ SET(SRCS_server
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV svcBldServer SHARED ${SRCS_server})
|
||||
# Same guard rationale as svcBldClient above: the generated
|
||||
# bld_[d|f]ts_impl.h headers require MAKE_SVCBLDSERVER_LIB.
|
||||
TARGET_COMPILE_DEFINITIONS(svcBldServer PRIVATE MAKE_SVCBLDSERVER_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcBldServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
namespace DDS { class Topic; }
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ public Q_SLOTS:
|
||||
void setEffectStates(const int buildingId, const int assetId, const QByteArray &properties);
|
||||
void onRelayInfoChanged(const AssetManagement::RelayInfo &info, const DataModification mod);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onSetBuildingContaminationStateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const SetBuildingContaminationStateRequest &request) override;
|
||||
void onSetBuildingStatesRequest(const rti::core::SampleIdentity &cookie,
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@ public:
|
||||
QMap<int, ProjectDataManagement::BuildingChargeEffect> buildingChargeEffects();
|
||||
QMap<int, ProjectDataManagement::ChargeType> chargeTypes();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void initializePdm();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -28,7 +28,6 @@ public:
|
||||
bool sendPosition();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool sendTelegramInternal() const;
|
||||
bool sendbuildingInfos() const;
|
||||
QJsonObject ObjectFromString(const QString& in);
|
||||
|
||||
+22
-22
@@ -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.underlying());
|
||||
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.underlying());
|
||||
obj.insert(QStringLiteral("ChannelSpacing"), channelSpacing.underlying());
|
||||
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);
|
||||
|
||||
@@ -70,8 +70,8 @@ QJsonObject RadioCircuitHF::toJson() const
|
||||
RadioCircuitHF* RadioCircuitHF::fromJson(const QJsonObject &obj)
|
||||
{
|
||||
RadioCircuitHF *spec = new RadioCircuitHF();
|
||||
spec->modulationType = static_cast<ModulationType::inner_enum>(obj.value(QStringLiteral("ModulationType")).toInt(-1));
|
||||
spec->channelSpacing = static_cast<ChannelSpacingHF::inner_enum>(obj.value(QStringLiteral("ChannelSpacing")).toInt());
|
||||
spec->modulationType = static_cast<ModulationType>(obj.value(QStringLiteral("ModulationType")).toInt(-1));
|
||||
spec->channelSpacing = static_cast<ChannelSpacingHF>(obj.value(QStringLiteral("ChannelSpacing")).toInt());
|
||||
spec->frequency = obj.value(QStringLiteral("Frequency")).toInt();
|
||||
spec->squelch = obj.value(QStringLiteral("Squelch")).toInt(-1);
|
||||
if (spec->isValid())
|
||||
@@ -94,8 +94,8 @@ bool RadioCircuitUHF::isValid() const
|
||||
QJsonObject RadioCircuitUHF::toJson() const
|
||||
{
|
||||
QJsonObject obj;
|
||||
obj.insert(QStringLiteral("ModulationType"), modulationType.underlying());
|
||||
obj.insert(QStringLiteral("ChannelSpacing"), channelSpacing.underlying());
|
||||
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);
|
||||
@@ -107,8 +107,8 @@ QJsonObject RadioCircuitUHF::toJson() const
|
||||
RadioCircuitUHF* RadioCircuitUHF::fromJson(const QJsonObject &obj)
|
||||
{
|
||||
RadioCircuitUHF *spec = new RadioCircuitUHF();
|
||||
spec->modulationType = static_cast<ModulationType::inner_enum>(obj.value(QStringLiteral("ModulationType")).toInt(-1));
|
||||
spec->channelSpacing = static_cast<ChannelSpacing::inner_enum>(obj.value(QStringLiteral("ChannelSpacing")).toInt());
|
||||
spec->modulationType = static_cast<ModulationType>(obj.value(QStringLiteral("ModulationType")).toInt(-1));
|
||||
spec->channelSpacing = static_cast<ChannelSpacing>(obj.value(QStringLiteral("ChannelSpacing")).toInt());
|
||||
spec->frequency = obj.value(QStringLiteral("Frequency")).toInt();
|
||||
spec->squelchDB = obj.value(QStringLiteral("Squelch")).toInt(-1);
|
||||
auto clipper = obj.value(QStringLiteral("Clipper"));
|
||||
@@ -128,7 +128,7 @@ RadioCircuitUHF* RadioCircuitUHF::fromJson(const QJsonObject &obj)
|
||||
QJsonObject RadioCircuitVHF::toJson() const
|
||||
{
|
||||
QJsonObject obj;
|
||||
obj.insert(QStringLiteral("OperatingMode"), operatingMode.underlying());
|
||||
obj.insert(QStringLiteral("OperatingMode"), static_cast<int>(operatingMode));
|
||||
obj.insert(QStringLiteral("FrequencySetDataId"), freqSetDataId);
|
||||
obj.insert(QStringLiteral("PilotTone"), pilotTone);
|
||||
|
||||
@@ -138,7 +138,7 @@ QJsonObject RadioCircuitVHF::toJson() const
|
||||
RadioCircuitVHF* RadioCircuitVHF::fromJson(const QJsonObject &obj)
|
||||
{
|
||||
RadioCircuitVHF *spec = new RadioCircuitVHF();
|
||||
spec->operatingMode = static_cast<RcOperatingMode::inner_enum>(obj.value(QStringLiteral("OperatingMode")).toInt(-1));
|
||||
spec->operatingMode = static_cast<RcOperatingMode>(obj.value(QStringLiteral("OperatingMode")).toInt(-1));
|
||||
spec->freqSetDataId = obj.value(QStringLiteral("FrequencySetDataId")).toInt();
|
||||
auto pilotTone = obj.value(QStringLiteral("PilotTone"));
|
||||
if (pilotTone.isUndefined() || !pilotTone.isBool())
|
||||
@@ -195,19 +195,19 @@ QVector<RadioCircuit*> fromJson(const std::string &json)
|
||||
{
|
||||
RadioCircuit *rc = nullptr;
|
||||
const QJsonObject obj = val.toObject();
|
||||
FrequencyBand ft = static_cast<FrequencyBand::inner_enum>(obj[QStringLiteral("FrequencyBand")].toInt());
|
||||
switch (ft.underlying())
|
||||
FrequencyBand ft = static_cast<FrequencyBand>(obj[QStringLiteral("FrequencyBand")].toInt());
|
||||
switch (ft)
|
||||
{
|
||||
case FrequencyBand_def::HF:
|
||||
case FrequencyBand::HF:
|
||||
rc = RadioCircuitHF::fromJson(obj);
|
||||
break;
|
||||
case FrequencyBand_def::UHF:
|
||||
case FrequencyBand::UHF:
|
||||
rc = RadioCircuitUHF::fromJson(obj);
|
||||
break;
|
||||
case FrequencyBand_def::VHF:
|
||||
case FrequencyBand::VHF:
|
||||
rc = RadioCircuitVHF::fromJson(obj);
|
||||
break;
|
||||
case FrequencyBand_def::REL:
|
||||
case FrequencyBand::REL:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -237,10 +237,10 @@ QSet<int> frequencySetDataIds(const std::string &frequencyPlanDataProperties)
|
||||
for(const QJsonValue &val : std::as_const(arr))
|
||||
{
|
||||
const QJsonObject obj = val.toObject();
|
||||
FrequencyBand ft = static_cast<FrequencyBand::inner_enum>(obj[QStringLiteral("FrequencyBand")].toInt());
|
||||
switch (ft.underlying())
|
||||
FrequencyBand ft = static_cast<FrequencyBand>(obj[QStringLiteral("FrequencyBand")].toInt());
|
||||
switch (ft)
|
||||
{
|
||||
case FrequencyBand_def::VHF:
|
||||
case FrequencyBand::VHF:
|
||||
{
|
||||
RadioCircuitVHF *rcVhf = RadioCircuitVHF::fromJson(obj);
|
||||
if(!rcVhf)
|
||||
@@ -249,8 +249,8 @@ QSet<int> frequencySetDataIds(const std::string &frequencyPlanDataProperties)
|
||||
delete rcVhf;
|
||||
break;
|
||||
}
|
||||
case FrequencyBand_def::UHF:
|
||||
case FrequencyBand_def::HF:
|
||||
case FrequencyBand::UHF:
|
||||
case FrequencyBand::HF:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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};
|
||||
|
||||
|
||||
-1
@@ -40,7 +40,6 @@ private Q_SLOTS:
|
||||
void onSocketDisconnect();
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendMessages();
|
||||
|
||||
private:
|
||||
|
||||
@@ -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 ¤tData : plan->data())
|
||||
for (const auto ¤tData : 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);
|
||||
};
|
||||
|
||||
@@ -61,6 +61,11 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(SV WS svcCmoClient SHARED ${SRCS_client})
|
||||
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
|
||||
# MAKE_<SYMBOL>_LIB compile guard, but the generated cmo_[d|f]tc_impl.h
|
||||
# headers that this target compiles carry such a guard — same situation as
|
||||
# ddscore, which defines MAKE_DDSCORE_LIB explicitly for the same reason.
|
||||
TARGET_COMPILE_DEFINITIONS(svcCmoClient PRIVATE MAKE_SVCCMOCLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcCmoClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -90,6 +95,9 @@ SET(SRCS_server
|
||||
CODEGEN_SERVER_TOPICS(SRCS_server ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(SV svcCmoServer SHARED ${SRCS_server})
|
||||
# Same guard rationale as svcCmoClient above: the generated
|
||||
# cmo_[d|f]ts_impl.h headers require MAKE_SVCCMOSERVER_LIB.
|
||||
TARGET_COMPILE_DEFINITIONS(svcCmoServer PRIVATE MAKE_SVCCMOSERVER_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcCmoServer
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
@@ -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,
|
||||
|
||||
+4
-2
@@ -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());
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
namespace DDS { class Topic; }
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
+31
-30
@@ -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);
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace ComponentMonitor
|
||||
{
|
||||
using LOGGER_T = NGL::INGLLogger &;
|
||||
|
||||
CMO_COMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
SVCCMOCOMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
|
||||
@@ -66,6 +66,11 @@ SET(SRCS_client
|
||||
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS svcGnaClient SHARED ${SRCS_client})
|
||||
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
|
||||
# MAKE_<SYMBOL>_LIB compile guard, but the generated gna_[d|f]tc_impl.h
|
||||
# headers that this target compiles carry such a guard — same situation as
|
||||
# ddscore, which defines MAKE_DDSCORE_LIB explicitly for the same reason.
|
||||
TARGET_COMPILE_DEFINITIONS(svcGnaClient PRIVATE MAKE_SVCGNACLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcGnaClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
|
||||
@@ -30,7 +30,6 @@ Q_SIGNALS:
|
||||
void simulationStatusReceived(const NasatSimulationStatus &data);
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void textMessageReceived(const QByteArray &msg);
|
||||
bool sendTelegram(const NasatBase *tele);
|
||||
virtual bool sendTelegramInternal(const QByteArray &tele) = 0;
|
||||
|
||||
@@ -107,9 +107,9 @@ int Participant2Dds::partyId(int participantId) const
|
||||
auto ret = -1;
|
||||
std::function<bool(const ParticipantManagement::Participant&)> cb = [participantId, &ret](const ParticipantManagement::Participant &p)
|
||||
{
|
||||
if (p.id() != participantId)
|
||||
if (p.id != participantId)
|
||||
return false;
|
||||
ret = p.partyId();
|
||||
ret = p.partyId;
|
||||
return true;
|
||||
};
|
||||
m_ppmDtc->participants(cb);
|
||||
@@ -120,15 +120,15 @@ void Participant2Dds::onParticipantChanged(const ParticipantManagement::Particip
|
||||
{
|
||||
if (modType == DataModification::eRemoved)
|
||||
return;
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged: " << data.id()
|
||||
<< ", " << m_participantsToWatch.contains(data.id())
|
||||
DEBUG_LOG(m_logger) << "onParticipantChanged: " << data.id
|
||||
<< ", " << m_participantsToWatch.contains(data.id)
|
||||
<< ", " << m_participantsToWatch.size()
|
||||
<< ", " << m_participantsToWatch.contains(data.id())
|
||||
<< ", " << data.isDeleted();
|
||||
if (!m_participantsToWatch.contains(data.id()))
|
||||
<< ", " << m_participantsToWatch.contains(data.id)
|
||||
<< ", " << data.isDeleted;
|
||||
if (!m_participantsToWatch.contains(data.id))
|
||||
return;
|
||||
if (data.isDeleted())
|
||||
emit participantRemoved(m_ddsConnector->getPartitionId(), data.id());
|
||||
if (data.isDeleted)
|
||||
emit participantRemoved(m_ddsConnector->getPartitionId(), data.id);
|
||||
}
|
||||
|
||||
|
||||
@@ -137,6 +137,7 @@ void Participant2Dds::onParticipantChanged(const ParticipantManagement::Particip
|
||||
|
||||
DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
|
||||
: m_ddsConnector(std::make_shared<DDSConnector::DdsConnector>(ddsConnector->getDomainParticipant(), IDL::PartitionType::AllExercises))
|
||||
, m_logger(getLogger("DdsHandler"))
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition();
|
||||
}
|
||||
|
||||
@@ -70,6 +70,12 @@ private:
|
||||
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc;
|
||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> m_pdmDtc;
|
||||
QHash<int, std::weak_ptr<Participant2Dds>> m_nasatParticipant2Dds;
|
||||
|
||||
// Qt5 declared m_logger in *both* classes of this header (Participant2Dds at line 54
|
||||
// and DdsHandler at line 79). A dedup pass kept only one of them, which left
|
||||
// DdsHandler's DEBUG_LOG(m_logger) uses in dds_handler.cpp without a member. Restored
|
||||
// to match the Qt5 declaration; this is fidelity, not a new member.
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
namespace DDS { class Topic; }
|
||||
@@ -1,3 +0,0 @@
|
||||
#pragma once
|
||||
// Stub file for BUILD_GRANTLEE=OFF
|
||||
// Auto-generated during Qt6 migration
|
||||
@@ -13,20 +13,20 @@ namespace GuezNasat
|
||||
Database::NasatAircraft toDb(const NasatAircraft &dds)
|
||||
{
|
||||
Database::NasatAircraft ret;
|
||||
ret.id = dds.id();
|
||||
ret.nasatId = dds.nasatId();
|
||||
ret.simulationActive = dds.simulationActive();
|
||||
ret.name = QString::fromStdString(dds.name());
|
||||
ret.id = dds.id;
|
||||
ret.nasatId = dds.nasatId;
|
||||
ret.simulationActive = dds.simulationActive;
|
||||
ret.name = QString::fromStdString(dds.name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
NasatAircraft fromDb(const Database::NasatAircraft &db)
|
||||
{
|
||||
NasatAircraft ret;
|
||||
ret.id(db.id);
|
||||
ret.nasatId(db.nasatId);
|
||||
ret.simulationActive(db.simulationActive);
|
||||
ret.name(db.name.toStdString());
|
||||
ret.id = db.id;
|
||||
ret.nasatId = db.nasatId;
|
||||
ret.simulationActive = db.simulationActive;
|
||||
ret.name = db.name.toStdString();
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ HandlerNasatAircraft::HandlerNasatAircraft(Initialization *mainHandler)
|
||||
HandlerNasatAircraft::~HandlerNasatAircraft()
|
||||
{
|
||||
for (const auto &data : std::as_const(m_nasatAircrafts))
|
||||
m_dts->removeNasatAircraftByKey(data.id());
|
||||
m_dts->removeNasatAircraftByKey(data.id);
|
||||
}
|
||||
|
||||
bool HandlerNasatAircraft::init()
|
||||
@@ -50,9 +50,9 @@ bool HandlerNasatAircraft::init()
|
||||
auto cb = [this](const Database::NasatAircraft & data)
|
||||
{
|
||||
auto dds(fromDb(data));
|
||||
dds.simulationActive(false);
|
||||
dds.simulationActive = false;
|
||||
emit activateNasatAircraftSimulation(data.nasatId, false);
|
||||
m_nasatAircrafts[dds.id()] = dds;
|
||||
m_nasatAircrafts[dds.id] = dds;
|
||||
m_dts->publish(dds);
|
||||
};
|
||||
m_db->select(cb);
|
||||
@@ -64,7 +64,7 @@ int HandlerNasatAircraft::nasatIdFromNasatAircraftId(int nasatAircraftId) const
|
||||
auto it = m_nasatAircrafts.find(nasatAircraftId);
|
||||
if (it == m_nasatAircrafts.end())
|
||||
return -1;
|
||||
return it.value().nasatId();
|
||||
return it.value().nasatId;
|
||||
}
|
||||
|
||||
void HandlerNasatAircraft::simulationStatusChanged(const NasatSimulationStatus &data)
|
||||
@@ -76,11 +76,11 @@ void HandlerNasatAircraft::flaFluSimulationChanged(int nasatId, bool bSimulation
|
||||
{
|
||||
for (NasatAircraft &na : m_nasatAircrafts)
|
||||
{
|
||||
if (na.nasatId() != nasatId)
|
||||
if (na.nasatId != nasatId)
|
||||
continue;
|
||||
if (na.simulationActive() == bSimulationActive)
|
||||
if (na.simulationActive == bSimulationActive)
|
||||
return;
|
||||
na.simulationActive(bSimulationActive);
|
||||
na.simulationActive = bSimulationActive;
|
||||
m_dts->publish(na);
|
||||
return;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ void HandlerNasatAircraft::onModifyNasatAircraftRequest(const rti::core::SampleI
|
||||
const NasatAircraft &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onModifyNasatAircraftRequest: " << request;
|
||||
auto ret = request.id() > 0 ? modifyNasatAircraftRequest(request) : createNasatAircraftRequest(request);
|
||||
auto ret = request.id > 0 ? modifyNasatAircraftRequest(request) : createNasatAircraftRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyNasatAircraftReply(cookie, ret);
|
||||
@@ -104,7 +104,7 @@ Core::FunctionReplyObject HandlerNasatAircraft::createNasatAircraftRequest(const
|
||||
naDb.id = 0;
|
||||
|
||||
if (!m_db->insert(naDb))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not create Aircraft information - error inserting values in database"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not create Aircraft information - error inserting values in database"));
|
||||
|
||||
emit activateNasatAircraftSimulation(naDb.nasatId, naDb.simulationActive);
|
||||
|
||||
@@ -113,48 +113,48 @@ Core::FunctionReplyObject HandlerNasatAircraft::createNasatAircraftRequest(const
|
||||
m_dts->publish(nasatAircraftData);
|
||||
m_nasatAircrafts[naDb.id] = nasatAircraftData;
|
||||
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject HandlerNasatAircraft::modifyNasatAircraftRequest(const NasatAircraft &request)
|
||||
{
|
||||
auto it = m_nasatAircrafts.find(request.id());
|
||||
auto it = m_nasatAircrafts.find(request.id);
|
||||
if (it == m_nasatAircrafts.end())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not modify Aircraft information - id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not modify Aircraft information - id %1 not found")).arg(request.id);
|
||||
|
||||
if (request.nasatId() == 0 && request.name().size() == 0)
|
||||
if (request.nasatId == 0 && request.name.size() == 0)
|
||||
{
|
||||
|
||||
if (!m_db->removeNasatAircraft(request.id()))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not remove Aircraft information - error removing values from database"));
|
||||
if (!m_db->removeNasatAircraft(request.id))
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not remove Aircraft information - error removing values from database"));
|
||||
m_nasatAircrafts.erase(it);
|
||||
m_mainHandler->nasatAircraftParticipant()->aircraftRemoved(request.id());
|
||||
m_dts->removeNasatAircraftByKey(request.id());
|
||||
if (it.value().simulationActive())
|
||||
emit activateNasatAircraftSimulation(request.nasatId(), false);
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
m_mainHandler->nasatAircraftParticipant()->aircraftRemoved(request.id);
|
||||
m_dts->removeNasatAircraftByKey(request.id);
|
||||
if (it.value().simulationActive)
|
||||
emit activateNasatAircraftSimulation(request.nasatId, false);
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
const int oldNasatId = it.value().nasatId();
|
||||
const int oldNasatId = it.value().nasatId;
|
||||
|
||||
|
||||
Database::NasatAircraft naDb(toDb(request));
|
||||
if (!m_db->update(naDb))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not modify Aircraft information - error updating values in database"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not modify Aircraft information - error updating values in database"));
|
||||
|
||||
const bool simulationChanged = it.value().simulationActive() != request.simulationActive();
|
||||
const bool simulationChanged = it.value().simulationActive != request.simulationActive;
|
||||
|
||||
|
||||
const auto nasatAircraftData(fromDb(naDb));
|
||||
m_dts->publish(nasatAircraftData);
|
||||
it.value() = nasatAircraftData;
|
||||
|
||||
if (request.nasatId() != oldNasatId)
|
||||
if (request.nasatId != oldNasatId)
|
||||
emit nasatIdChanged(oldNasatId, naDb.nasatId);
|
||||
if (simulationChanged)
|
||||
emit activateNasatAircraftSimulation(naDb.nasatId, request.simulationActive());
|
||||
emit activateNasatAircraftSimulation(naDb.nasatId, request.simulationActive);
|
||||
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+48
-48
@@ -15,20 +15,20 @@ namespace GuezNasat
|
||||
Database::NasatAircraftParticipant toDb(const NasatAircraftParticipant &dds)
|
||||
{
|
||||
Database::NasatAircraftParticipant ret;
|
||||
ret.id = dds.id();
|
||||
ret.nasatAircraftId = dds.nasatAircraftId();
|
||||
ret.exerciseId = dds.exerciseId();
|
||||
ret.participantId = dds.participantId();
|
||||
ret.id = dds.id;
|
||||
ret.nasatAircraftId = dds.nasatAircraftId;
|
||||
ret.exerciseId = dds.exerciseId;
|
||||
ret.participantId = dds.participantId;
|
||||
return ret;
|
||||
}
|
||||
|
||||
NasatAircraftParticipant fromDb(const Database::NasatAircraftParticipant &db)
|
||||
{
|
||||
NasatAircraftParticipant ret;
|
||||
ret.id(db.id);
|
||||
ret.nasatAircraftId(db.nasatAircraftId);
|
||||
ret.exerciseId(db.exerciseId);
|
||||
ret.participantId(db.participantId);
|
||||
ret.id = db.id;
|
||||
ret.nasatAircraftId = db.nasatAircraftId;
|
||||
ret.exerciseId = db.exerciseId;
|
||||
ret.participantId = db.participantId;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ HandlerNasatAircraftParticipant::~HandlerNasatAircraftParticipant()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
for (const auto &data : std::as_const(m_nasatAircraftParticipants))
|
||||
m_dts->removeNasatAircraftByKey(data.id());
|
||||
m_dts->removeNasatAircraftByKey(data.id);
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@ bool HandlerNasatAircraftParticipant::init()
|
||||
auto cb = [this](const Database::NasatAircraftParticipant & data)
|
||||
{
|
||||
const auto dds(fromDb(data));
|
||||
DEBUG_LOG(m_logger) << "m_nasatAircraftParticipants.insert(" << dds.id() << ")";
|
||||
m_nasatAircraftParticipants.insert(dds.id(), dds);
|
||||
DEBUG_LOG(m_logger) << "m_nasatAircraftParticipants.insert(" << dds.id << ")";
|
||||
m_nasatAircraftParticipants.insert(dds.id, dds);
|
||||
m_dts->publish(dds);
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantCreated(dds);
|
||||
};
|
||||
@@ -133,7 +133,7 @@ void HandlerNasatAircraftParticipant::aircraftRemoved(int nasatAircraftId)
|
||||
while (it != m_nasatAircraftParticipants.end())
|
||||
{
|
||||
const auto &val = it.value();
|
||||
if (val.nasatAircraftId() == nasatAircraftId)
|
||||
if (val.nasatAircraftId == nasatAircraftId)
|
||||
{
|
||||
removeNasatAircraftParticipant(val);
|
||||
it = m_nasatAircraftParticipants.erase(it);
|
||||
@@ -150,8 +150,8 @@ void HandlerNasatAircraftParticipant::participantRemoved(int exerciseId, int par
|
||||
while (it != m_nasatAircraftParticipants.end())
|
||||
{
|
||||
const auto &val = it.value();
|
||||
if (val.participantId() == participantId &&
|
||||
val.exerciseId() == exerciseId)
|
||||
if (val.participantId == participantId &&
|
||||
val.exerciseId == exerciseId)
|
||||
{
|
||||
removeNasatAircraftParticipant(val);
|
||||
it = m_nasatAircraftParticipants.erase(it);
|
||||
@@ -161,17 +161,17 @@ void HandlerNasatAircraftParticipant::participantRemoved(int exerciseId, int par
|
||||
}
|
||||
}
|
||||
|
||||
bool isExerciseStateValid(ExerciseManagement::ExerciseState_def::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;
|
||||
@@ -181,17 +181,17 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " START" << " , exercise" << exercise << " , modType" << modType;
|
||||
|
||||
const int exId = exercise.id();
|
||||
const int exId = exercise.id;
|
||||
switch (modType)
|
||||
{
|
||||
case DataModification::eAdded:
|
||||
{
|
||||
m_exercises[exId] = exercise;
|
||||
const bool valid = isExerciseStateValid(exercise.state().underlying());
|
||||
const bool valid = isExerciseStateValid(exercise.state);
|
||||
if (!valid)
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId
|
||||
<< " , state=" << exercise.state();
|
||||
<< " , state=" << exercise.state;
|
||||
int cnt = removeNapsOfExercise(exId);
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId << " not valid : counter of removed naps=" << cnt;
|
||||
}
|
||||
@@ -200,14 +200,14 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement
|
||||
case DataModification::eModified:
|
||||
{
|
||||
const ExerciseManagement::Exercise &exerciseRef = m_exercises[exId];
|
||||
if (exerciseRef.state() != exercise.state())
|
||||
if (exerciseRef.state != exercise.state)
|
||||
{
|
||||
const bool valid = isExerciseStateValid(exercise.state().underlying());
|
||||
const bool valid = isExerciseStateValid(exercise.state);
|
||||
if (!valid)
|
||||
{
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId
|
||||
<< " , old state=" << exerciseRef.state()
|
||||
<< " , new state=" << exercise.state();
|
||||
<< " , old state=" << exerciseRef.state
|
||||
<< " , new state=" << exercise.state;
|
||||
int cnt = removeNapsOfExercise(exId);
|
||||
INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId << " : counter of removed naps=" << cnt;
|
||||
}
|
||||
@@ -231,15 +231,15 @@ void HandlerNasatAircraftParticipant::removeNasatAircraftParticipant(const Nasat
|
||||
{
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantRemoved(val);
|
||||
|
||||
m_db->removeNasatAircraftParticipant(val.id());
|
||||
m_dts->removeNasatAircraftParticipantByKey(val.id());
|
||||
m_db->removeNasatAircraftParticipant(val.id);
|
||||
m_dts->removeNasatAircraftParticipantByKey(val.id);
|
||||
}
|
||||
|
||||
void HandlerNasatAircraftParticipant::onModifyNasatAircraftParticipantRequest(const rti::core::SampleIdentity &cookie,
|
||||
const NasatAircraftParticipant &request)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << "onModifyNasatAircraftParticipantRequest: " << request;
|
||||
auto ret = request.id() <= 0 ? createNasatAircraftParticipantRequest(request) : modifyNasatAircraftParticipantRequest(request);
|
||||
auto ret = request.id <= 0 ? createNasatAircraftParticipantRequest(request) : modifyNasatAircraftParticipantRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_fts->modifyNasatAircraftParticipantReply(cookie, ret);
|
||||
@@ -251,50 +251,50 @@ Core::FunctionReplyObject HandlerNasatAircraftParticipant::createNasatAircraftPa
|
||||
Database::NasatAircraftParticipant napDb(toDb(request));
|
||||
napDb.id = 0;
|
||||
if (!m_db->insert(napDb))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not create Aircraft Participant connection - error inserting values in database"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not create Aircraft Participant connection - error inserting values in database"));
|
||||
|
||||
|
||||
const auto dds(fromDb(napDb));
|
||||
m_dts->publish(dds);
|
||||
m_nasatAircraftParticipants.insert(dds.id(), dds);
|
||||
m_nasatAircraftParticipants.insert(dds.id, dds);
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantCreated(request);
|
||||
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
Core::FunctionReplyObject HandlerNasatAircraftParticipant::modifyNasatAircraftParticipantRequest(const NasatAircraftParticipant &request)
|
||||
{
|
||||
auto it = m_nasatAircraftParticipants.find(request.id());
|
||||
auto it = m_nasatAircraftParticipants.find(request.id);
|
||||
if (it == m_nasatAircraftParticipants.end())
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not modify Aircraft Participant connection - id %1 not found")).arg(request.id());
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not modify Aircraft Participant connection - id %1 not found")).arg(request.id);
|
||||
|
||||
if (request == *it)
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
|
||||
if ((request.exerciseId() == 0 && request.participantId() == 0) ||
|
||||
request.nasatAircraftId() == 0)
|
||||
if ((request.exerciseId == 0 && request.participantId == 0) ||
|
||||
request.nasatAircraftId == 0)
|
||||
{
|
||||
removeNasatAircraftParticipant(it.value());
|
||||
m_nasatAircraftParticipants.erase(it);
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
Database::NasatAircraftParticipant napDb(toDb(request));
|
||||
if (!m_db->update(napDb))
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Can not modify Aircraft Participant connection - error updating values in database"));
|
||||
return Core::FunctionReplyObject(request.id, tr_lts("dds", "Can not modify Aircraft Participant connection - error updating values in database"));
|
||||
|
||||
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantRemoved(*it);
|
||||
const auto dds(fromDb(napDb));
|
||||
m_dts->publish(dds);
|
||||
m_nasatAircraftParticipants.insert(dds.id(), dds);
|
||||
m_nasatAircraftParticipants.insert(dds.id, dds);
|
||||
|
||||
|
||||
m_dts->publish(fromDb(napDb));
|
||||
|
||||
|
||||
m_mainHandler->handlerParticipant()->onNasatAircraftParticipantCreated(request);
|
||||
return Core::FunctionReplyObject(request.id());
|
||||
return Core::FunctionReplyObject(request.id);
|
||||
}
|
||||
|
||||
int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId)
|
||||
@@ -306,15 +306,15 @@ int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId)
|
||||
|
||||
for (const NasatAircraftParticipant &nap : std::as_const(napsCopy))
|
||||
{
|
||||
if (nap.exerciseId() == exerciseId)
|
||||
if (nap.exerciseId == exerciseId)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " nap has to be removed: nap=" << nap;
|
||||
|
||||
NasatAircraftParticipant napToTriggerRemoving;
|
||||
napToTriggerRemoving.id(nap.id());
|
||||
napToTriggerRemoving.exerciseId(0);
|
||||
napToTriggerRemoving.participantId(0);
|
||||
napToTriggerRemoving.nasatAircraftId(0);
|
||||
napToTriggerRemoving.id = nap.id;
|
||||
napToTriggerRemoving.exerciseId = 0;
|
||||
napToTriggerRemoving.participantId = 0;
|
||||
napToTriggerRemoving.nasatAircraftId = 0;
|
||||
modifyNasatAircraftParticipantRequest(napToTriggerRemoving);
|
||||
++count;
|
||||
}
|
||||
|
||||
@@ -133,12 +133,12 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
|
||||
const qint64 tNow = dtNow.toMSecsSinceEpoch() + 5000;
|
||||
|
||||
AreaEffectSimulation::ExplosionClusterSingleEffectOnlyRequest ecReq;
|
||||
ecReq.id(0);
|
||||
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.chargeTypeId(chargeTypeIdVal);
|
||||
ecReq.id = 0;
|
||||
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.chargeTypeId = chargeTypeIdVal;
|
||||
|
||||
|
||||
|
||||
@@ -153,31 +153,31 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
|
||||
|
||||
|
||||
AreaEffectSimulation::ExplosionClusterModifyRequest ecCommonModifyRequest;
|
||||
ecCommonModifyRequest.id(0);
|
||||
ecCommonModifyRequest.id = 0;
|
||||
|
||||
ecCommonModifyRequest.effectStart(impactTimeMsec > tNow ? impactTimeMsec : tNow);
|
||||
ecCommonModifyRequest.effectDuration(1000);
|
||||
ecCommonModifyRequest.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
|
||||
ecCommonModifyRequest.effectStart = impactTimeMsec > tNow ? impactTimeMsec : tNow;
|
||||
ecCommonModifyRequest.effectDuration = 1000;
|
||||
ecCommonModifyRequest.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal;
|
||||
|
||||
|
||||
ecCommonModifyRequest.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
|
||||
ecCommonModifyRequest.explosionGeometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint;
|
||||
|
||||
|
||||
ecCommonModifyRequest.chargeStruct().chargeTypeId(chargeTypeIdVal);
|
||||
ecCommonModifyRequest.chargeStruct().igniterTypeId(fuseTypeToPdmIgniterType(fuseType));
|
||||
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());
|
||||
ecCommonModifyRequest.name = QStringLiteral("NASAT_%1_%2_%3").arg(nasatId).arg(munitionCode).arg(dtNow.toString(QStringLiteral("dd hh:mm:ss"))).toStdString();
|
||||
ecCommonModifyRequest.element = ecReq.name;
|
||||
|
||||
ecCommonModifyRequest.mhpCount(1);
|
||||
ecCommonModifyRequest.impactCount(1);
|
||||
ecCommonModifyRequest.mhpCount = 1;
|
||||
ecCommonModifyRequest.impactCount = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
ecCommonModifyRequest.flightDuration(flightTimeMsec);
|
||||
ecCommonModifyRequest.flightDuration = flightTimeMsec;
|
||||
|
||||
|
||||
|
||||
@@ -197,10 +197,10 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
|
||||
|
||||
|
||||
|
||||
ecReq.partyId(nap->partyId());
|
||||
ecReq.partyId = nap->partyId();
|
||||
|
||||
ecCommonModifyRequest.partyId(nap->partyId());
|
||||
ecCommonModifyRequest.participantId(nap->participantId());
|
||||
ecCommonModifyRequest.partyId = nap->partyId();
|
||||
ecCommonModifyRequest.participantId = nap->participantId();
|
||||
|
||||
|
||||
int success = nap->publisher()->publish(ecCommonModifyRequest, this);
|
||||
@@ -247,17 +247,17 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos,
|
||||
|
||||
void HandlerNasatImpact::onChargeTypeChanged(const ProjectDataManagement::ChargeType &ct)
|
||||
{
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(QByteArray::fromRawData(ct.properties().c_str(), ct.properties().size())));
|
||||
const QJsonDocument doc(QJsonDocument::fromJson(QByteArray::fromRawData(ct.properties.c_str(), ct.properties.size())));
|
||||
const QJsonObject obj(doc.object());
|
||||
if (!obj.contains(QLatin1String("nasatId")))
|
||||
return;
|
||||
int nasatId = obj.value(QLatin1String("nasatId")).toInt();
|
||||
if (nasatId == 0)
|
||||
{
|
||||
WARNING_LOG(m_logger) << "Found charge with an invalid property 'nasatId', id: " << ct.id();
|
||||
WARNING_LOG(m_logger) << "Found charge with an invalid property 'nasatId', id: " << ct.id;
|
||||
return;
|
||||
}
|
||||
m_chargeMapping.insert(nasatId, ct.id());
|
||||
m_chargeMapping.insert(nasatId, ct.id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ public Q_SLOTS:
|
||||
void nasatImpact(int nasatId, const Core::GeoPosition &pos, qint64 flightTimeMsec, qint64 impactTimeMsec, int munitionCode, FuseType fuseType = FuseType::Instant);
|
||||
void onChargeTypeChanged(const ProjectDataManagement::ChargeType &ct);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int chargeTypeFromMunitionCode(int nasatChargeCode) const;
|
||||
int fuseTypeToPdmIgniterType(FuseType fusetype) const;
|
||||
private:
|
||||
|
||||
@@ -35,7 +35,7 @@ static Nasat9Liner createDds9Liner(const NasatNineLiner &nasatNineLiner)
|
||||
{
|
||||
Nasat9Liner nl;
|
||||
const qint64 tsMSec = nasatNineLiner.timestamp <= 0 ? QDateTime::currentMSecsSinceEpoch() : qRound64(nasatNineLiner.timestamp * 1000);
|
||||
nl.sampleTime(tsMSec);
|
||||
nl.sampleTime = tsMSec;
|
||||
|
||||
if (nasatNineLiner.initialPointMode != 0)
|
||||
nl.initialPoint(Core::GeoPosition2D(LtsCoordTrans::deg2rad() * nasatNineLiner.initialPoint.lon,
|
||||
@@ -43,19 +43,19 @@ static Nasat9Liner createDds9Liner(const NasatNineLiner &nasatNineLiner)
|
||||
|
||||
if (nasatNineLiner.heading2InitialPointMode != Heading2InitialPointMode::Undefined)
|
||||
{
|
||||
nl.hdg2InitialPointMode(static_cast<Hdg2InitialPointMode::inner_enum>(nasatNineLiner.heading2InitialPointMode));
|
||||
nl.hdgInitialPoint2Target(nasatNineLiner.headingInitialPoint2Target);
|
||||
nl.hdg2InitialPointMode = static_cast<Hdg2InitialPointMode>(nasatNineLiner.heading2InitialPointMode);
|
||||
nl.hdgInitialPoint2Target = nasatNineLiner.headingInitialPoint2Target;
|
||||
}
|
||||
else
|
||||
{
|
||||
nl.hdg2InitialPointMode(Hdg2InitialPointMode_def::Undefined);
|
||||
nl.hdgInitialPoint2Target(-1);
|
||||
nl.hdg2InitialPointMode = Hdg2InitialPointMode::Undefined;
|
||||
nl.hdgInitialPoint2Target = -1;
|
||||
}
|
||||
|
||||
if (nasatNineLiner.distance2InitialPointMode != 0)
|
||||
nl.distanceInitialPoint2Target(nasatNineLiner.distanceInitialPoint2Target);
|
||||
nl.distanceInitialPoint2Target = nasatNineLiner.distanceInitialPoint2Target;
|
||||
else
|
||||
nl.distanceInitialPoint2Target(-1);
|
||||
nl.distanceInitialPoint2Target = -1;
|
||||
|
||||
if (nasatNineLiner.targetPositionMode != 0)
|
||||
{
|
||||
@@ -66,41 +66,41 @@ static Nasat9Liner createDds9Liner(const NasatNineLiner &nasatNineLiner)
|
||||
}
|
||||
else
|
||||
{
|
||||
nl.targetPosition(Core::GeoPosition(std::nan(""), std::nan(""), std::nan("")));
|
||||
nl.targetPosition = Core::GeoPosition(std::nan(""), std::nan(""), std::nan(""));
|
||||
}
|
||||
|
||||
if (nasatNineLiner.modeFriendlies != 0)
|
||||
{
|
||||
nl.friendliesBearing(nasatNineLiner.friendlies.bearing);
|
||||
nl.friendliesDistance(nasatNineLiner.friendlies.distance);
|
||||
nl.friendliesBearing = nasatNineLiner.friendlies.bearing;
|
||||
nl.friendliesDistance = nasatNineLiner.friendlies.distance;
|
||||
}
|
||||
else
|
||||
{
|
||||
nl.friendliesBearing(-1);
|
||||
nl.friendliesDistance(-1);
|
||||
nl.friendliesBearing = -1;
|
||||
nl.friendliesDistance = -1;
|
||||
}
|
||||
|
||||
if (nasatNineLiner.finalAttackHeadingMode != FinalAttackHeadingMode::None)
|
||||
{
|
||||
nl.finalAttackHeading(nasatNineLiner.finalAttackHeading.heading);
|
||||
nl.finalAttackHeading = nasatNineLiner.finalAttackHeading.heading;
|
||||
if (nasatNineLiner.finalAttackHeadingMode == FinalAttackHeadingMode::HeadingWithSector)
|
||||
{
|
||||
nl.finalAttackHeadingLow(nasatNineLiner.finalAttackHeading.headingLow);
|
||||
nl.finalAttackHeadingHigh(nasatNineLiner.finalAttackHeading.headingHigh);
|
||||
nl.finalAttackHeadingLow = nasatNineLiner.finalAttackHeading.headingLow;
|
||||
nl.finalAttackHeadingHigh = nasatNineLiner.finalAttackHeading.headingHigh;
|
||||
}
|
||||
else
|
||||
{
|
||||
nl.finalAttackHeadingLow(-1);
|
||||
nl.finalAttackHeadingHigh(-1);
|
||||
nl.finalAttackHeadingLow = -1;
|
||||
nl.finalAttackHeadingHigh = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
nl.finalAttackHeading(-1);
|
||||
nl.finalAttackHeading = -1;
|
||||
|
||||
if (nasatNineLiner.timeForTargetMode != TimeForTargetMode::None)
|
||||
nl.timeForTarget(nasatNineLiner.timeForTargetMode == TimeForTargetMode::TimeToTarget ? -nl.timeForTarget() : nl.timeForTarget());
|
||||
nl.timeForTarget = nasatNineLiner.timeForTargetMode == TimeForTargetMode::TimeToTarget ? -nl.timeForTarget : nl.timeForTarget;
|
||||
else
|
||||
nl.timeForTarget(0);
|
||||
nl.timeForTarget = 0;
|
||||
|
||||
return nl;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ void HandlerNasatNineLiner::nineLinerReceived(const NasatNineLiner &nasatNineLin
|
||||
Nasat9Liner nl = createDds9Liner(nasatNineLiner);
|
||||
for (auto it = participants.begin(); it != participants.end(); ++it)
|
||||
{
|
||||
nl.id(s_id++);
|
||||
nl.id = s_id++;
|
||||
const auto &exerciseParticipantId = it.key();
|
||||
auto nape = it.value();
|
||||
|
||||
@@ -134,8 +134,8 @@ void HandlerNasatNineLiner::nineLinerReceived(const NasatNineLiner &nasatNineLin
|
||||
<< ", exerciseParticipantId.participantId=" << exerciseParticipantId.participantId;
|
||||
|
||||
auto &nineLinerParticipant = m_nineLiner[exerciseParticipantId];
|
||||
nl.isCurrent(true);
|
||||
nl.participantId(exerciseParticipantId.participantId);
|
||||
nl.isCurrent = true;
|
||||
nl.participantId = exerciseParticipantId.participantId;
|
||||
|
||||
nineLinerParticipant.push_back(nl);
|
||||
|
||||
@@ -170,7 +170,7 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf
|
||||
|
||||
|
||||
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId());
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId);
|
||||
INFO_LOG(m_logger) << " onNasatAircraftParticipantRemoved, nap = " << nap << ", nasatId = " << nasatId;
|
||||
if (nasatId < 0)
|
||||
{
|
||||
@@ -182,7 +182,7 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf
|
||||
if (participants.isEmpty())
|
||||
{
|
||||
INFO_LOG(m_logger) << "No exercise participants found to publish 9-liner for nasat aircraft with id "
|
||||
<< nap.nasatAircraftId();
|
||||
<< nap.nasatAircraftId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -200,13 +200,13 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf
|
||||
if (!nineLinerParticipant.isEmpty())
|
||||
{
|
||||
auto &oldLast = nineLinerParticipant.last();
|
||||
if (oldLast.isCurrent())
|
||||
if (oldLast.isCurrent)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updating for removing "
|
||||
<< ", exerciseParticipantId.exerciseId=" << exerciseParticipantId.exerciseId
|
||||
<< ", exerciseParticipantId.participantId=" << exerciseParticipantId.participantId;
|
||||
oldLast.sampleTime(QDateTime::currentMSecsSinceEpoch());
|
||||
oldLast.isCurrent(false);
|
||||
oldLast.sampleTime = QDateTime::currentMSecsSinceEpoch();
|
||||
oldLast.isCurrent = false;
|
||||
nape->publisher()->publish(oldLast);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ NasatAircraftParticipantEx::NasatAircraftParticipantEx(const NasatAircraftPartic
|
||||
, m_publisher(publisher)
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_publisher->addParticipantToWatch(m_nap.participantId());
|
||||
m_publisher->addParticipantToWatch(m_nap.participantId);
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
NasatAircraftParticipantEx::~NasatAircraftParticipantEx()
|
||||
{
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||
m_publisher->removeParticipantToWatch(m_nap.participantId());
|
||||
m_publisher->removeParticipantToWatch(m_nap.participantId);
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||
}
|
||||
|
||||
@@ -51,6 +51,7 @@ int NasatAircraftParticipantEx::partyId() const
|
||||
|
||||
HandlerParticipant::HandlerParticipant(Initialization *mainHandler)
|
||||
: m_mainHandler(mainHandler)
|
||||
, m_logger(getLogger("ParticipantPositionPublisher"))
|
||||
{}
|
||||
|
||||
HandlerParticipant::~HandlerParticipant()
|
||||
@@ -66,30 +67,30 @@ QHash<ExerciseParticipantKey, NasatAircraftParticipantEx *> HandlerParticipant::
|
||||
|
||||
void HandlerParticipant::onNasatAircraftParticipantCreated(const NasatAircraftParticipant &nap)
|
||||
{
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId());
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId);
|
||||
auto it = m_activePublisher.find(nasatId);
|
||||
if (it == m_activePublisher.end())
|
||||
return createNasatAircraftParticipant(nap, nasatId);
|
||||
|
||||
auto itParticipants = it.value().find(ExerciseParticipantKey(nap.exerciseId(), nap.participantId()));
|
||||
auto itParticipants = it.value().find(ExerciseParticipantKey(nap.exerciseId, nap.participantId));
|
||||
if (itParticipants == it.value().end())
|
||||
return createNasatAircraftParticipant(nap, nasatId);
|
||||
}
|
||||
|
||||
void HandlerParticipant::onNasatAircraftParticipantRemoved(const NasatAircraftParticipant &nap)
|
||||
{
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId());
|
||||
const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId);
|
||||
auto it = m_activePublisher.find(nasatId);
|
||||
if (it == m_activePublisher.end())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "No publisher for NasatAircraftParticipant " << nasatId << "(" << nap.nasatAircraftId() << ") found !?";
|
||||
WARNING_LOG(m_logger) << "No publisher for NasatAircraftParticipant " << nasatId << "(" << nap.nasatAircraftId << ") found !?";
|
||||
return;
|
||||
}
|
||||
auto itParticipants = it.value().find(ExerciseParticipantKey(nap.exerciseId(), nap.participantId()));
|
||||
auto itParticipants = it.value().find(ExerciseParticipantKey(nap.exerciseId, nap.participantId));
|
||||
if (itParticipants == it.value().end())
|
||||
{
|
||||
WARNING_LOG(m_logger) << "No participant entry for NasatAircraftParticipant " << nasatId << "("
|
||||
<< nap.exerciseId() << "," << nap.participantId() << ") found !?";
|
||||
<< nap.exerciseId << "," << nap.participantId << ") found !?";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -154,11 +155,11 @@ void HandlerParticipant::onNasatAircraftPosition(int nasatId, const Core::GeoPos
|
||||
|
||||
const auto &h = it.value();
|
||||
TrainingAreaBase::EquipmentPosition tabPos;
|
||||
tabPos.position().position(pos);
|
||||
tabPos.sampleTime(ts);
|
||||
tabPos.position.position = pos;
|
||||
tabPos.sampleTime = ts;
|
||||
for (const NasatAircraftParticipantEx *napEx : h)
|
||||
{
|
||||
tabPos.equipmentNumber(-napEx->participantId());
|
||||
tabPos.equipmentNumber = -napEx->participantId();
|
||||
int success = napEx->publisher()->publish(tabPos);
|
||||
if (success)
|
||||
DEBUG_LOG(m_logger) << "Publishing positon: " << tabPos << " to exercise " << napEx->exerciseId()
|
||||
@@ -183,8 +184,8 @@ void HandlerParticipant::createNasatAircraftParticipant(const NasatAircraftParti
|
||||
DEBUG_LOG(m_logger) << "Creating position publisher for " << nap
|
||||
<< ", nasatId=" << nasatId;
|
||||
auto *napEx = new NasatAircraftParticipantEx(nap,
|
||||
m_mainHandler->dds()->ddsParticipant(nap.exerciseId()));
|
||||
m_activePublisher[nasatId][ExerciseParticipantKey(nap.exerciseId(), nap.participantId())] = napEx;
|
||||
m_mainHandler->dds()->ddsParticipant(nap.exerciseId));
|
||||
m_activePublisher[nasatId][ExerciseParticipantKey(nap.exerciseId, nap.participantId)] = napEx;
|
||||
connect(napEx->publisher().get(), &Participant2Dds::participantRemoved,
|
||||
m_mainHandler->nasatAircraftParticipant().get(), &HandlerNasatAircraftParticipant::participantRemoved,
|
||||
Qt::QueuedConnection);
|
||||
|
||||
@@ -24,9 +24,9 @@ struct NasatAircraftParticipantEx final
|
||||
|
||||
std::shared_ptr<Participant2Dds> publisher() const { return m_publisher; }
|
||||
|
||||
int exerciseId() const { return m_nap.exerciseId(); }
|
||||
int exerciseId() const { return m_nap.exerciseId; }
|
||||
int partyId() const;
|
||||
int participantId() const { return m_nap.participantId(); }
|
||||
int participantId() const { return m_nap.participantId; }
|
||||
const NasatAircraftParticipant &participant() const { return m_nap; }
|
||||
|
||||
Q_DISABLE_COPY(NasatAircraftParticipantEx)
|
||||
@@ -84,6 +84,10 @@ private:
|
||||
|
||||
QHash<int, QHash<ExerciseParticipantKey, NasatAircraftParticipantEx*>> m_activePublisher;
|
||||
|
||||
// Qt5 declares m_logger in both classes of this header (Participant2Dds above and
|
||||
// HandlerParticipant here); the dedup pass kept only the first, so the uses in
|
||||
// handler_participant.cpp had no member. Restored to match the Qt5 declaration.
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
QHash<int, Core::GeoPosition> m_lastNasatPositionsAsCoreGeoposition;
|
||||
Initialization *m_mainHandler;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace GuezNasat
|
||||
{
|
||||
using LOGGER_T = NGL::INGLLogger &;
|
||||
|
||||
GNA_COMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
SVCGNACOMMON_EXPORT LOGGER_T getLogger(const char *name);
|
||||
inline LOGGER_T getLogger(const QString &loggerName)
|
||||
{
|
||||
return getLogger(loggerName.toUtf8().constData());
|
||||
|
||||
+29
-29
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -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; }
|
||||
|
||||
+25
-25
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
+63
-63
@@ -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);
|
||||
|
||||
@@ -90,7 +90,6 @@ public slots:
|
||||
void participantCesHitInformationRequest(const TrainingAreaBase::TetraIcd::CesHitInformation &request);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void createParticipant(const ParticipantManagement::Participant &participant);
|
||||
bool createHuman(const ParticipantManagement::Participant &participant);
|
||||
bool createGroundVehicle(const ParticipantManagement::Participant &participant);
|
||||
|
||||
-1
@@ -54,7 +54,6 @@ public Q_SLOTS:
|
||||
void onExternalEquipmentNumberRemoved(int equipNo);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendDataCommunicationState(int equipNo, bool bIsAvailable);
|
||||
bool sendTelegramInternal(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data,
|
||||
const QString &type, int exerciseId);
|
||||
|
||||
+198
-198
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,6 @@ private Q_SLOTS:
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
template <typename T>
|
||||
void onSendRequest(const T &item);
|
||||
template <typename T>
|
||||
|
||||
+14
-14
@@ -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
|
||||
|
||||
+114
-114
@@ -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;
|
||||
}
|
||||
|
||||
+2
-2
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
+53
-53
@@ -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;
|
||||
}
|
||||
|
||||
@@ -89,7 +89,6 @@ public slots:
|
||||
void participantBiteRequest(const TrainingAreaBase::TetraIcd::DemandBite &request);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void createParticipant(const ParticipantManagement::Participant &participant);
|
||||
bool createHuman(const ParticipantManagement::Participant &participant);
|
||||
bool createGroundVehicle(const ParticipantManagement::Participant &participant);
|
||||
|
||||
-1
@@ -53,7 +53,6 @@ public Q_SLOTS:
|
||||
void onExternalEquipmentNumberRemoved(int equipNo);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sendDataCommunicationState(int equipNo, bool bIsAvailable);
|
||||
bool sendTelegramInternal(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data,
|
||||
const QString &type, int exerciseId);
|
||||
|
||||
+14
-14
@@ -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
|
||||
|
||||
+47
-47
@@ -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()));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
@@ -144,6 +144,11 @@ IF(BUILD_RTI)
|
||||
ENDIF()
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabClient SHARED ${SRCS_client})
|
||||
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
|
||||
# MAKE_<SYMBOL>_LIB compile guard, but the generated tab_[d|f]tc_impl.h
|
||||
# headers require MAKE_SVCTABCLIENT_LIB — same situation as
|
||||
# svcCoreClient/ddscore, which define their guards explicitly.
|
||||
TARGET_COMPILE_DEFINITIONS(svcTabClient PRIVATE MAKE_SVCTABCLIENT_LIB)
|
||||
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabClient
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||
@@ -176,6 +181,8 @@ IF(BUILD_RTI)
|
||||
ENDIF()
|
||||
|
||||
NGL_ADD_LIBRARY2(AAR HLA SV svcTabServer SHARED ${SRCS_server}) # NGL_ADD_LIBRARY2 won't work here - no time for investigations
|
||||
# Generated tab_[d|f]ts_impl.h require MAKE_SVCTABSERVER_LIB (see svcTabClient above).
|
||||
TARGET_COMPILE_DEFINITIONS(svcTabServer PRIVATE MAKE_SVCTABSERVER_LIB)
|
||||
if(BUILD_SV OR BUILD_HLA)
|
||||
GENERATE_EXPORT_HEADER(svcTabServer) # FIXME: quick workaround
|
||||
endif()
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(saaTelegrams
|
||||
${CMAKE_BINARY_DIR}/Lts/Services
|
||||
)
|
||||
NGL_TARGET_LINK_LIBRARIES(saaTelegrams
|
||||
# svcPdmClient # Externe Dependency - nicht verfügbar
|
||||
svcPdmClient # qt5 parity: brings the RTI platform defines (RTI_LINUX etc.)
|
||||
Qt6::Core
|
||||
${Qt6_WebSockets}
|
||||
)
|
||||
|
||||
+9
-9
@@ -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;
|
||||
|
||||
-1
@@ -34,7 +34,6 @@ public:
|
||||
std::shared_ptr<AssetManagement::Interface::Ftc> getFtc() { return m_ftcAsm; }
|
||||
void modifyAssetAdlerProperties(int assetId, bool isSaaConnected = false);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onAssetModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
|
||||
private:
|
||||
|
||||
+3
-3
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -41,7 +41,6 @@ class FlmHandler
|
||||
void initHQFolders(int partyId);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void onFileContentModifyReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onPathCreateReply(const Core::FunctionReplyObject &reply) override;
|
||||
void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override final;
|
||||
|
||||
+6
-6
@@ -489,7 +489,7 @@ void GenerateTelegrams::generateStellungsmeldungFS(AdlerJson::ExFeuerstellungFS
|
||||
req.feuerstellungsdaten.status = ProjectDataManagement::L28_Status::Einsatzbereit;
|
||||
req.feuerstellungsdaten.feuereinheit.verein = QStringLiteral("verein ExFeuerstellungFS");
|
||||
req.feuerstellungsdaten.feuereinheit.r = 5;
|
||||
req.feuerstellungsdaten.feuereinheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3;
|
||||
req.feuerstellungsdaten.feuereinheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_F3;
|
||||
req.feuerstellungsdaten.mittelpunkt.koordinate.latitude = 53.37791;
|
||||
req.feuerstellungsdaten.mittelpunkt.koordinate.longitude = 8.759;
|
||||
req.feuerstellungsdaten.mittelpunkt.hoehe = 20;
|
||||
@@ -526,7 +526,7 @@ void GenerateTelegrams::generateStellungsmeldungWS(AdlerJson::ExFeuerstellungWS
|
||||
req.waffensystemdaten.status = ProjectDataManagement::L28_Status::Einsatzbereit;
|
||||
req.waffensystemdaten.einheit.verein = QStringLiteral("AB7X");
|
||||
req.waffensystemdaten.einheit.r = 6;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F6;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_F6;
|
||||
|
||||
AdlerJson::Geschoss geschoss1;
|
||||
AdlerJson::Geschoss geschoss2;
|
||||
@@ -558,7 +558,7 @@ void GenerateTelegrams::generateStellungsmeldungWS_Gmlrs(AdlerJson::ExFeuerstell
|
||||
req.waffensystemdaten.status = ProjectDataManagement::L28_Status::NichtEinsatzbereit;
|
||||
req.waffensystemdaten.einheit.verein = QStringLiteral("AB13X");
|
||||
req.waffensystemdaten.einheit.r = 6;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F6;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_F6;
|
||||
|
||||
AdlerJson::Geschoss geschoss1;
|
||||
AdlerJson::Geschoss geschoss2;
|
||||
@@ -591,7 +591,7 @@ void GenerateTelegrams::generateStellungsmeldungWS_Dm72(AdlerJson::ExFeuerstellu
|
||||
req.waffensystemdaten.status = ProjectDataManagement::L28_Status::NichtEinsatzbereit;
|
||||
req.waffensystemdaten.einheit.verein = QStringLiteral("AB72X");
|
||||
req.waffensystemdaten.einheit.r = 1;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F1;
|
||||
req.waffensystemdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_F1;
|
||||
|
||||
AdlerJson::Geschoss geschoss1;
|
||||
AdlerJson::Geschoss geschoss2;
|
||||
@@ -622,7 +622,7 @@ void GenerateTelegrams::generateStellungsmeldungLP(AdlerJson::ExFeuerstellungLP
|
||||
{
|
||||
req.ladeplatzdaten.einheit.r = 5;
|
||||
req.ladeplatzdaten.einheit.verein = QStringLiteral("verein StellungsmeldungLP");
|
||||
req.ladeplatzdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3;
|
||||
req.ladeplatzdaten.einheit.oi = ProjectDataManagement::L19_Oi::L19_Oi_F3;
|
||||
|
||||
req.ladeplatzdaten.koordinate.koordinate.latitude = 53.37791;
|
||||
req.ladeplatzdaten.koordinate.koordinate.longitude = 8.759;
|
||||
@@ -644,7 +644,7 @@ void GenerateTelegrams::generateStellungsmeldungLP(AdlerJson::ExFeuerstellungLP
|
||||
|
||||
void GenerateTelegrams::generateStellungswechsel(AdlerJson::ExStellungswechsel &req)
|
||||
{
|
||||
req.stellungswechseldaten.oi = ProjectDataManagement::L19_Oi::L19_Oi_L19_Oi_F3;
|
||||
req.stellungswechseldaten.oi = ProjectDataManagement::L19_Oi::L19_Oi_F3;
|
||||
req.stellungswechseldaten.r = 5;
|
||||
req.stellungswechseldaten.verein = QStringLiteral("verein ExStellungswechsel");
|
||||
}
|
||||
|
||||
+12
-12
@@ -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);
|
||||
|
||||
-1
@@ -65,7 +65,6 @@ private slots:
|
||||
void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType);
|
||||
void onSendParticipantDataTimeout();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position);
|
||||
void handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position);
|
||||
|
||||
|
||||
+19
-19
@@ -750,15 +750,15 @@ struct SAATELEGRAMS_EXPORT Treffpunkt
|
||||
// EX-L49 Wirkmittel Feuerkommando Rakete
|
||||
struct SAATELEGRAMS_EXPORT WirkmittelFeuerkommandoRakete
|
||||
{
|
||||
ProjectDataManagement::L27_EffectorId kenner {ProjectDataManagement::L27_EffectorId_def::get_default()}; // EX-L27
|
||||
ProjectDataManagement::L27_EffectorId kenner {ProjectDataManagement::L27_EffectorId::A}; // EX-L27
|
||||
QVector<Treffpunkt> treffpunkte;
|
||||
double flugzeit {0.0};
|
||||
int gipfelhoehe {0};
|
||||
double schussrichtung {0.0};
|
||||
int fallwinkel {0};
|
||||
ProjectDataManagement::L48_TrajectoryRocket anflug {ProjectDataManagement::L48_TrajectoryRocket_def::get_default()};
|
||||
ProjectDataManagement::L48_TrajectoryRocket anflug {ProjectDataManagement::L48_TrajectoryRocket::Nominal};
|
||||
FeuerkommandoGeschosse geschoss;
|
||||
ProjectDataManagement::L46_GpsFrequency gps {ProjectDataManagement::L46_GpsFrequency_def::get_default()};
|
||||
ProjectDataManagement::L46_GpsFrequency gps {ProjectDataManagement::L46_GpsFrequency::L1};
|
||||
int wirkzeit {-1};
|
||||
};
|
||||
|
||||
@@ -1442,17 +1442,17 @@ const QMap<QString, ProjectDataManagement::L7_Request> ForderungMap = {
|
||||
|
||||
// EX-L19 Orts ID
|
||||
const QMap<QString, ProjectDataManagement::L19_Oi> ortsIdMap = {
|
||||
{QStringLiteral("Empty"), ProjectDataManagement::L19_Oi::Empty}, // Orts ID nicht gesetzt
|
||||
{QStringLiteral("F1"), ProjectDataManagement::L19_Oi::F1}, // 1. Feuerstellung
|
||||
{QStringLiteral("F2"), ProjectDataManagement::L19_Oi::F2}, // 2. Feuerstellung
|
||||
{QStringLiteral("F3"), ProjectDataManagement::L19_Oi::F3}, // 3. Feuerstellung
|
||||
{QStringLiteral("F4"), ProjectDataManagement::L19_Oi::F4}, // 4. Feuerstellung
|
||||
{QStringLiteral("F5"), ProjectDataManagement::L19_Oi::F5}, // 5. Feuerstellung
|
||||
{QStringLiteral("F6"), ProjectDataManagement::L19_Oi::F6}, // 6. Feuerstellung
|
||||
{QStringLiteral("F7"), ProjectDataManagement::L19_Oi::F7}, // 7. Feuerstellung
|
||||
{QStringLiteral("F8"), ProjectDataManagement::L19_Oi::F8}, // 8. Feuerstellung
|
||||
{QStringLiteral("F9"), ProjectDataManagement::L19_Oi::F9}, // 9. Feuerstellung
|
||||
{QStringLiteral("L"), ProjectDataManagement::L19_Oi::L} // Ladeplatz
|
||||
{QStringLiteral("Empty"), ProjectDataManagement::L19_Oi::L19_Oi_Empty}, // Orts ID nicht gesetzt
|
||||
{QStringLiteral("F1"), ProjectDataManagement::L19_Oi::L19_Oi_F1}, // 1. Feuerstellung
|
||||
{QStringLiteral("F2"), ProjectDataManagement::L19_Oi::L19_Oi_F2}, // 2. Feuerstellung
|
||||
{QStringLiteral("F3"), ProjectDataManagement::L19_Oi::L19_Oi_F3}, // 3. Feuerstellung
|
||||
{QStringLiteral("F4"), ProjectDataManagement::L19_Oi::L19_Oi_F4}, // 4. Feuerstellung
|
||||
{QStringLiteral("F5"), ProjectDataManagement::L19_Oi::L19_Oi_F5}, // 5. Feuerstellung
|
||||
{QStringLiteral("F6"), ProjectDataManagement::L19_Oi::L19_Oi_F6}, // 6. Feuerstellung
|
||||
{QStringLiteral("F7"), ProjectDataManagement::L19_Oi::L19_Oi_F7}, // 7. Feuerstellung
|
||||
{QStringLiteral("F8"), ProjectDataManagement::L19_Oi::L19_Oi_F8}, // 8. Feuerstellung
|
||||
{QStringLiteral("F9"), ProjectDataManagement::L19_Oi::L19_Oi_F9}, // 9. Feuerstellung
|
||||
{QStringLiteral("L"), ProjectDataManagement::L19_Oi::L19_Oi_L} // Ladeplatz
|
||||
};
|
||||
|
||||
// EX-20 TargetType -> pdm_target_type
|
||||
@@ -1460,11 +1460,11 @@ const QMap<QString, ProjectDataManagement::L19_Oi> ortsIdMap = {
|
||||
|
||||
// EX-L22 Feuer HALT Kategorie
|
||||
const QMap<QString, ProjectDataManagement::L22_FireHaltCategory> feuerHaltKategorieMap = {
|
||||
{QStringLiteral("A"), ProjectDataManagement::L22_FireHaltCategory::A}, // Feuer HALT Allgemein
|
||||
{QStringLiteral("R"), ProjectDataManagement::L22_FireHaltCategory::R}, // Feuer HALT Referenziert
|
||||
{QStringLiteral("E"), ProjectDataManagement::L22_FireHaltCategory::E}, // Feuer Einstellen
|
||||
{QStringLiteral("C"), ProjectDataManagement::L22_FireHaltCategory::C}, // Aufheben Feuer HALT Allgemein
|
||||
{QStringLiteral("F"), ProjectDataManagement::L22_FireHaltCategory::F}, // Aufheben Feuer HALT Referenziert
|
||||
{QStringLiteral("A"), ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_A}, // Feuer HALT Allgemein
|
||||
{QStringLiteral("R"), ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_R}, // Feuer HALT Referenziert
|
||||
{QStringLiteral("E"), ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_E}, // Feuer Einstellen
|
||||
{QStringLiteral("C"), ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_C}, // Aufheben Feuer HALT Allgemein
|
||||
{QStringLiteral("F"), ProjectDataManagement::L22_FireHaltCategory::L22_FireHaltCategory_F}, // Aufheben Feuer HALT Referenziert
|
||||
};
|
||||
|
||||
// EX-L24 HQ(G) Art
|
||||
|
||||
-1
@@ -31,7 +31,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
template<typename T>
|
||||
void rxData(const T &data);
|
||||
|
||||
|
||||
-1
@@ -74,7 +74,6 @@ public slots:
|
||||
void onGenericTelegram(const QJsonObject &telegram);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, bool bForce = false);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ public:
|
||||
public Q_SLOTS:
|
||||
void onTimeout();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void doCleanup();
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
-1
@@ -24,7 +24,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
template<typename T>
|
||||
void rxData(const T &data);
|
||||
private:
|
||||
|
||||
-1
@@ -73,7 +73,6 @@ public:
|
||||
public Q_SLOTS:
|
||||
void onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, bool bForce = false);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
|
||||
-1
@@ -16,7 +16,6 @@ public:
|
||||
virtual ~ConvertFromJson() = default;
|
||||
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
bool handleTelegram(const QByteArray &baJson, int &recvCounter);
|
||||
virtual void handleAcknowledge(qint64 timeStamp, int counter) = 0;
|
||||
virtual void handleTetraConnectionChanged(bool bConnected) = 0;
|
||||
|
||||
-1
@@ -72,7 +72,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void outgoingMessage(const QByteArray &msg);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_sendCounter;
|
||||
|
||||
+3
-3
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
-1
@@ -64,7 +64,6 @@ public:
|
||||
bool txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data) override;
|
||||
bool txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) override;
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
template <typename T>
|
||||
bool sendToTxMixin(const T *data);
|
||||
private:
|
||||
|
||||
-1
@@ -67,7 +67,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void outgoingMessage(const QByteArray &msg);
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
protected:
|
||||
NGL::INGLLogger &m_logger;
|
||||
int m_sendCounter = 1;
|
||||
|
||||
-1
@@ -27,7 +27,6 @@ public:
|
||||
Q_SIGNALS:
|
||||
void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void sfmData(const TrainingAreaBase::TetraIcd::WlsBinarySfmData &data);
|
||||
|
||||
template<typename T>
|
||||
|
||||
-1
@@ -68,7 +68,6 @@ public:
|
||||
public Q_SLOTS:
|
||||
void onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible);
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
template <typename T>
|
||||
bool sendToTxBinary(const T *data);
|
||||
bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data,
|
||||
|
||||
+6
-2
@@ -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()
|
||||
{
|
||||
|
||||
+3
-3
@@ -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}
|
||||
}));
|
||||
}
|
||||
|
||||
+3
-3
@@ -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);
|
||||
|
||||
+2
@@ -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;
|
||||
|
||||
@@ -54,7 +54,6 @@ private Q_SLOTS:
|
||||
void onMainFootprintChanged(const InfrastructureManagement::MainFootprint &data, DataModification modType);
|
||||
|
||||
private:
|
||||
NGL::INGLLogger &m_logger;
|
||||
void rotateBuildingFootprint(int mseId);
|
||||
void removeOpsDataByStructureElementId(int structureElementId);
|
||||
void removeOpsAsset(int assetId);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Loaded 100 of 1200 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user