Compare commits

...
Author SHA1 Message Date
berrux-dev 881d44f4dd Migrates residual Lts sources to generated rtiddsgen API
Adds NmeaManagement tests, fixes codegen includes and Qt6 SerialPort CMake target.
2026-09-23 12:05:37 +02:00
berrux-dev 5485a90385 Lts/Services: finalize Qt6/C++17 migration cleanup
Remove deprecated Qt5 patterns remaining in Services:

- Replace remaining SIGNAL/SLOT string syntax with function pointer syntax
  (NmeaManagement/socket_handler.cpp, AudioVideoManagement/ModuleTests/mvs_tests.cpp)

- Remove Qt::UniqueConnection (deprecated in Qt6, default behavior) from
  19 files across AES, CES plugins, and cross-services (47 occurrences)

- Remove umbrella #include <QtCore> from fire_automaton.h and
  aes_test_fire_automaton.h (specific includes suffice)

25 files changed, 74 insertions(+), 81 deletions(-)
2026-09-21 06:43:28 +00:00
berrux-dev 29002f2a48 Migrates remaining include, viewer and DDS headers to rtiddsgen API
Converts accessor calls to plain member access and fixes SituationMap CMake.
2026-09-21 02:47:50 +02:00
berrux-dev c3eda18234 Migrates remaining services and plugins to generated rtiddsgen API
Converts accessor calls to plain member access across the residual service set.
2026-09-21 02:47:48 +02:00
berrux-dev 6a8c31b735 Migrates remaining proxies to generated rtiddsgen API
Converts accessor calls to plain member access in bld, cmo, gna, hla, whg and wls.
2026-09-21 02:47:26 +02:00
berrux-dev 3ec4208139 Migrates OcSituation and ServiceManagement to generated rtiddsgen API
Converts accessor calls to plain member access in osc, oss and obd services.
2026-09-21 02:46:47 +02:00
berrux-dev 95071993f5 Migrates Participant and OperatorManagement to generated rtiddsgen API
Converts accessor calls to plain member access in ppm and opm services and plugins.
2026-09-21 02:46:44 +02:00
berrux-dev bdb2461737 Migrates EffectShow and AssetManagement to generated rtiddsgen API
Converts accessor calls to plain member access across esc and asm services.
2026-09-21 02:46:24 +02:00
berrux-dev a09979afdd Migrates TrainingAreaBase proxies to generated rtiddsgen API
Converts accessor calls to plain member access in tab and taboc proxies.
2026-09-21 02:46:21 +02:00
berrux-dev 2df80f90a7 Migrates CentralEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across ces service.
2026-09-21 02:45:54 +02:00
berrux-dev 40f767fc4d Migrates AudioVideoManagement to generated rtiddsgen API
Converts accessor calls to plain member access across avm service and plugin.
2026-09-21 02:45:51 +02:00
berrux-dev 82356f23e5 Migrates InfrastructureManagement to generated rtiddsgen API
Converts accessor calls to plain member access across ism service.
2026-09-21 02:45:09 +02:00
berrux-dev 472f537313 Migrates AreaEffectSimulation to generated rtiddsgen API
Converts accessor calls to plain member access across aes service and plugin.
2026-09-21 02:45:07 +02:00
berrux-dev e8d07af320 Adapts shared tests and common code to generated rtiddsgen API
Updates test suites and Lts/Common consumers to plain member access.
2026-09-21 02:44:07 +02:00
berrux-dev cf62b17d58 Reworks CMake wiring for Qt6 codegen include order
Adds missing toolchain packages and include dirs so generated headers resolve.
2026-09-21 02:42:27 +02:00
berrux-dev 220ca64679 Removes migration stub headers superseded by codegen outputs
Drops 184 stub headers and obsolete stub tests now generated in the build tree.
2026-09-21 02:38:33 +02:00
berrux-dev 4e29022c06 Adds new flm and flt migration test suites 2026-09-18 17:49:15 +02:00
berrux-dev 501bd2b4b8 Extends migration tests for flm and flt services 2026-09-18 17:49:15 +02:00
berrux-dev ce47b9236f Fixes include paths after flm stub header removal 2026-09-18 17:49:15 +02:00
berrux-dev b8e2ed5344 Installs qt6-websockets-dev and fails on piped make errors 2026-09-18 17:49:15 +02:00
berrux-dev 58a383d212 Adds manual Qt6 WebSockets import and availability macro 2026-09-18 17:49:15 +02:00
berrux-dev 9e553e5d7a Links Qt6 WebSockets in LtsWebSocketCommon when real 2026-09-18 17:49:15 +02:00
berrux-dev 9a9a023b70 Links Qt6 WebSockets in httq when module is real 2026-09-18 17:49:15 +02:00
berrux-dev 7d1074588c Migrates flt handlers to CorePortType and plain members 2026-09-18 17:49:15 +02:00
berrux-dev a3e44a5bd8 Reworks FilterManagement CMake for Qt6 codegen 2026-09-18 17:49:15 +02:00
berrux-dev bd3cccbc15 Updates flm module tests for generated rtiddsgen API 2026-09-18 17:47:34 +02:00
berrux-dev b96dec41e4 Fixes enum casts and CorePortType in flm service glue 2026-09-18 17:47:34 +02:00
berrux-dev 3c058facd7 Migrates flm handlers and objects to plain member access 2026-09-18 17:47:34 +02:00
berrux-dev e156fbb5e4 Adds Q_OBJECT and generated includes to flm custom impls 2026-09-18 17:47:34 +02:00
berrux-dev d79d89c352 Reworks FileManagement codegen wiring and WebSockets link 2026-09-18 17:47:34 +02:00
berrux-dev 4ee52e2f52 Includes generated flm.hpp for exm Folder DDS type 2026-09-18 17:47:33 +02:00
berrux-dev c32c9031e7 Removes leftover service stub headers in flm and flt services 2026-09-18 17:47:33 +02:00
berrux-dev 9d1419a5b1 Removes FilterManagement stub headers superseded by codegen 2026-09-18 17:47:33 +02:00
berrux-dev 5d6807f256 Removes FileManagement stub headers superseded by codegen 2026-09-18 17:47:33 +02:00
berrux-dev 619c7683d4 Guards pdm_translation stub copy against codegen race 2026-09-18 17:45:16 +02:00
berrux-dev a318dbb64a Restores logger and db interface members in DataManagerBaseDl 2026-09-18 17:45:16 +02:00
berrux-dev 7f9a59004a Adapts GenericFtcImpl to rtiddsgen 7.7 generated types 2026-09-18 17:45:16 +02:00
berrux-dev 4cab91a948 Restores generic_fts include and fixes FTS connext header 2026-09-18 17:45:16 +02:00
berrux-dev 6794412c29 Migrates GenericFtsImpl to plain members and FtReplyState 2026-09-18 17:45:16 +02:00
berrux-dev f974625b0f Fixes TopicLockMaster Dtc include, namespace and member access 2026-09-18 17:45:16 +02:00
berrux-dev 15a961182a Migrates Pacemaker to CorePortType and plain generated members 2026-09-18 17:45:16 +02:00
berrux-dev 35bfe2be39 Defines MAKE_SVCCORECLIENT_LIB guard for svcCoreClient 2026-09-18 17:45:16 +02:00
berrux-dev 851cbd5cec Adapts codegen templates to rtiddsgen 7.7 plain data members 2026-09-18 17:45:15 +02:00
berrux-dev c066c74d7f Drops BUILD_GRANTLEE fallback paths from codegen macros 2026-09-18 17:45:15 +02:00
1203 changed files with 20298 additions and 28312 deletions

No files matched your search

+1 -1
View File
@@ -1 +1 @@
torsten.wierschin@life-maps.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMV8yH39fMOQE5BeCsxI8RMUXbDBJvRuS5phTTfrXF0H
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ6kKREEjPzWMq8zjhIUCeiPI1MtwVHiZHaKxkePmW4t berrux.kana@axilinx.com
+1 -1
View File
@@ -1,4 +1,4 @@
# export MIGRATE_PIPELINE_ROOT="/home/torsten/sandbox/qt6-migration-pipeline"
export MIGRATE_PIPELINE_ROOT="Passe Deinen Pfad an."
export MIGRATE_PIPELINE_ROOT="/home/nkana/repo/qt6-migration-pipeline"
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
+108 -4
View File
@@ -75,6 +75,12 @@ ENDIF()
ADD_DEFINITIONS(-DAPP6C)
SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# Resolve <DDS/...> and other framework includes to the real headers under
# Lts/ BEFORE the migration stub tree in include/. The stub tree shadows them
# otherwise and opens namespace DDSGeneric around framework includes, which
# pulls Qt/std definitions into that namespace and breaks every consumer.
# (The qt5 legacy has no include/ tree; Lts/ is the real include root.)
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
include_directories(${CMAKE_SOURCE_DIR}/include)
# Include directory for generated export headers
include_directories(${CMAKE_BINARY_DIR})
@@ -100,7 +106,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include/ExerciseEventManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ExerciseManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ExerciseManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/FileManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/FileManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/NotificationManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/NotificationManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ParticipantManagement)
@@ -109,6 +114,11 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ReportManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/ReportManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/SituationReplay)
include_directories(${CMAKE_SOURCE_DIR}/include/SituationReplay)
# Evaluations' generated evl_db_structs.h includes <evl_enums.hpp> by bare name, and that
# header is consumed from OcBaseDownload as well, so its build dir must be visible tree-wide
# like the services above. There is no include/Evaluations stub tree, so only the build dir
# is added (same shape as FileManagement above, which has no stub tree either).
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Evaluations)
include_directories(${CMAKE_SOURCE_DIR}/include/Buildings)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/GuezNasat)
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS)
@@ -118,13 +128,43 @@ include_directories(${CMAKE_SOURCE_DIR}/include/DDS/Generic)
include_directories(${CMAKE_SOURCE_DIR}/include/TrainingAreaBaseOC)
# Generated DDS headers (BUILD_RTI=ON)
include_directories(${CMAKE_BINARY_DIR}/Lts)
# <Core/core.hpp> consumers (LtsCoordinate, AES/CES, HLA proxies) resolve the
# rtiddsgen-generated core.hpp from the DDS build dir (the qt5 include order);
# the OFF-era stub copies in include/Core/ have been removed.
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Common)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Common/LtsUtils)
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
# LtsUtilsSettings's generated ltsutilssettings_export.h is included by bare name from
# settings.h. Consumer targets that reach settings.h transitively (without linking
# LtsUtilsSettings themselves) cannot see it through the target's PUBLIC interface, so the
# directory holding the generated header has to be visible tree-wide. The directory contains
# only that generated header, so appending it cannot shadow an existing include.
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings)
# DDSConnector's generated ddsconnector_export.h is included by bare name from
# dds_connector.h and pub_sub_base.h, and reaches targets (the AES ModuleTests) that include
# DDSConnector headers without linking ddsconnector. Same shape as LtsUtilsSettings above: the
# directory holds only the generated header.
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS/DDSConnector)
# The generated msg_db_structs.h includes <msg_enums.hpp> by bare name, and Messaging is
# reached transitively from OcBaseDownload and the proxy handlers, so its build dir must be
# visible tree-wide like the services above. Unlike them there is no include/Messaging stub
# tree, so only the build dir is added.
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Messaging)
include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger)
include_directories(${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap)
include_directories(${CMAKE_SOURCE_DIR}/include/OperatorManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/FileManagement)
# The generated opm_db_structs.h includes <opm_enums.hpp> by bare name and is reached
# transitively from OcBaseDownload, so the OperatorManagement build dir has to be visible
# tree-wide next to its include/ stub tree above.
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/OperatorManagement)
# The plugin interface headers live under Lts/Plugins/<Svc>/ and are included both as
# <Plugins/<Svc>/x.h> (the qt5 spelling, resolved through the Lts/ root) and, since the
# migration dropped the leading segment, as <Svc>/x.h>. Lts/Plugins is therefore needed on
# the path. It is appended last so it can only ever resolve includes that were unresolvable
# before: every include that resolves today is found in an earlier directory, so no existing
# resolution can change.
include_directories(${CMAKE_SOURCE_DIR}/Lts/Plugins)
include_directories(${CMAKE_SOURCE_DIR}/forward-declarations)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -255,8 +295,11 @@ if(Qt6Core5Compat_FOUND)
endif()
# Find Qt6 core components first (without OpenGL which may not be available)
# WebSockets is required by the migrated services (FileManagement's THP script
# server uses QWebSocketServer; LtsWebSocket/httq enable their real websocket
# paths via QT6_WEBSOCKETS_AVAILABLE when the module is found).
find_package(Qt6 6.2 COMPONENTS Concurrent Core LinguistTools Network
Multimedia Sql SerialPort Test Xml Positioning Svg QUIET)
Multimedia Sql SerialPort Test Xml Positioning Svg WebSockets QUIET)
if(Qt6_FOUND)
# Skip GUI find_package - it fails without OpenGL. We'll create manual targets below.
@@ -310,6 +353,13 @@ if(NOT TARGET Qt6::Gui AND EXISTS "${QT6_LIB_DIR}/libQt6Gui.so.6")
)
endif()
# Set variable for legacy code that uses ${Qt6_Gui} — like Qt6_Widgets below,
# subdirectory CMakeLists contain `set(Qt6_Gui ${Qt6_Gui})` optional-guard
# no-ops that keep this root-scope value.
if(TARGET Qt6::Gui)
set(Qt6_Gui Qt6::Gui)
endif()
# Qt6::Widgets - create manual target (find_package fails without OpenGL)
if(EXISTS "${QT6_LIB_DIR}/libQt6Widgets.so.6")
if(NOT TARGET Qt6::Widgets)
@@ -387,6 +437,17 @@ if(NOT TARGET Qt6::Svg)
message(STATUS "Created stub target for Qt6::Svg (library not available)")
endif()
# Qt6::SerialPort - create manual target if not found
if(NOT TARGET Qt6::SerialPort AND EXISTS "${QT6_LIB_DIR}/libQt6SerialPort.so.6")
add_library(Qt6::SerialPort SHARED IMPORTED)
set_target_properties(Qt6::SerialPort PROPERTIES
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6SerialPort.so.6"
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtSerialPort;${QT6_INC_DIR}"
INTERFACE_LINK_LIBRARIES "Qt6::Core"
)
message(STATUS "Manually configured Qt6 SerialPort target")
endif()
# Stub Qt6::SerialPort target if not available (needed by TrainingAreaBaseOC)
if(NOT TARGET Qt6::SerialPort)
add_library(Qt6::SerialPort INTERFACE IMPORTED)
@@ -450,6 +511,21 @@ if(NOT TARGET Qt6::OpenGL)
message(STATUS "Created stub target for Qt6::OpenGL (library not available)")
endif()
# Qt6::WebSockets - create manual target if not found (the container's Qt6
# discovery takes the minimal path, so find_package never creates the
# component targets). The migrated FileManagement service (THP script
# server) needs the real module.
if(NOT TARGET Qt6::WebSockets AND EXISTS "${QT6_LIB_DIR}/libQt6WebSockets.so.6")
add_library(Qt6::WebSockets SHARED IMPORTED)
set_target_properties(Qt6::WebSockets PROPERTIES
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6WebSockets.so.6"
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtWebSockets;${QT6_INC_DIR}"
INTERFACE_LINK_LIBRARIES "Qt6::Core;Qt6::Network"
)
set(QT6_WEBSOCKETS_REAL_FOUND TRUE)
message(STATUS "Manually configured Qt6 WebSockets target")
endif()
# Stub Qt6::WebSockets target if not available (needed by LtsWebSocket, httq, etc.)
if(NOT TARGET Qt6::WebSockets)
add_library(Qt6::WebSockets INTERFACE IMPORTED)
@@ -459,6 +535,21 @@ if(NOT TARGET Qt6::WebSockets)
message(STATUS "Created stub target for Qt6::WebSockets (library not available)")
endif()
# Set variable for legacy code that uses ${Qt6_WebSockets} — subdirectory
# CMakeLists contain `set(Qt6_WebSockets ${Qt6_WebSockets})` optional-guard
# no-ops that keep this root-scope value.
if(TARGET Qt6::WebSockets)
set(Qt6_WebSockets Qt6::WebSockets)
endif()
# The real Qt6 WebSockets module is available (either via find_package or the
# manual import above): enable the real websocket code paths in httq,
# LtsWebSocket and the migrated services (they check this macro; without it
# they fall back to websocket-less operation).
if(Qt6WebSockets_FOUND OR QT6_WEBSOCKETS_REAL_FOUND)
add_compile_definitions(QT6_WEBSOCKETS_AVAILABLE)
endif()
MESSAGE(STATUS "Qt version is ${Qt6Core_VERSION}, GUI available: ${QT6_GUI_AVAILABLE}")
#
@@ -502,7 +593,20 @@ IF(BUILD_RTI)
# RTI Include-Pfade auch an MOC weitergeben (für Q_OBJECT Header mit RTI Types)
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${RTI_INCLUDE_DIRS})
# The generated <svc>_topic_type_plugin.h / <svc>_record_replay_plugin.h
# headers use Q_INTERFACES(DDSGeneric::TopicTypePlugin), so moc must see
# the Q_DECLARE_INTERFACE in Lts/DDS/... (resolved through the Lts include
# root). Without this path every <svc>TopicTypePlugin fails with
# "Undefined interface" even though the compiler sees the header.
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts)
# The ElevationMapManager stub header (include/Viewer/SituationMap/ElevationMap/)
# lives apart from its source (src/...), so moc needs its directory explicitly.
# NOTE: this must be set at root scope - subdir-scope appends do not reach
# the AutogenInfo MOC_INCLUDES.
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap/ElevationMap)
# IMPORTED Targets für RTI Libraries erstellen
# Debug und Release Varianten korrekt konfigurieren
FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers)
@@ -43,7 +43,8 @@ QString DataTopicWrapper::typeFq() const
QString MemberInformationWrapper::ddsToQVariant() const
{
return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral("())");
// rtiddsgen 7.7 generates plain public members - access them directly.
return QStringLiteral("toQVariant(data.") + cppMemberName() + QStringLiteral(")");
}
QString MemberInformationWrapper::qVariantToDds() const
@@ -51,7 +52,7 @@ QString MemberInformationWrapper::qVariantToDds() const
const QString ddsType =
isOptional() ? (QStringLiteral("dds::core::optional<") + cppDdsType() + QLatin1Char('>')) : (cppDdsType());
return QStringLiteral("data.") + cppMemberName() + QStringLiteral("() = fromQVariant<") + ddsType +
return QStringLiteral("data.") + cppMemberName() + QStringLiteral(" = fromQVariant<") + ddsType +
QStringLiteral(">(q.value(i++))");
}
@@ -61,14 +62,15 @@ QString MemberInformationWrapper::ddsToJsonElement() const
if (cppMemberName().isEmpty())
return QStringLiteral("obj[QStringLiteral(\"") + cppType() + QStringLiteral("\")] = element;");
const QString memberAccess = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
// rtiddsgen 7.7 generates plain public members for every kind of
// member (struct or not), so no getter call is emitted.
const QString memberAccess = cppMemberName();
if (!isOptional())
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
QStringLiteral("element.") + memberAccess + cppToJsonPost();
const QString optionalAccess =
isCppStruct() ? cppMemberName() + QStringLiteral(".is_set()") : cppMemberName() + QStringLiteral("().is_set()");
const QString getValue = isCppStruct() ? cppMemberName() : cppMemberName() + QStringLiteral("()");
const QString optionalAccess = cppMemberName() + QStringLiteral(".is_set()");
const QString getValue = cppMemberName();
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
QStringLiteral("*element.") + getValue + cppToJsonPost();
@@ -86,12 +88,10 @@ QString MemberInformationWrapper::jsonElementToDds() const
if (isOptional())
ret += QStringLiteral("if (!val.isNull()) ");
if (isCppStruct())
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() +
QStringLiteral("val") + cppFromJsonPost();
else
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral("(") + cppFromJsonPre2() +
QStringLiteral("val") + cppFromJsonPost() + QStringLiteral(")");
// rtiddsgen 7.7 generates plain public members - assign instead of
// calling a setter.
ret += QStringLiteral("element.") + cppMemberName() + QStringLiteral(" = ") + cppFromJsonPre2() +
QStringLiteral("val") + cppFromJsonPost();
return ret;
}
@@ -484,7 +484,9 @@ class IdlDataWrapper final : public NameWrapper
QString nameGetter() const
{
return m_data.name + (m_data.isOptional ? QStringLiteral("().get") : QString());
// rtiddsgen 7.7 generates public data members (no getters); optional
// members are omg::types::optional<T> and are unwrapped via .get().
return m_data.name + (m_data.isOptional ? QStringLiteral(".get()") : QString());
}
private:
@@ -874,6 +874,13 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation& mi) const
datatype == QLatin1String("long long"))
{
mi.cpp.type = QStringLiteral("qint64");
// IDL `long long` is int64_t (long) in the rtiddsgen 4.7 output, while the Qt side is
// qint64 (long long). Those are distinct types, so assignments such as
// `optional<int64_t> = optional<qint64>` do not compile. Carry the generated type
// separately, as the sequence<octet> branch below already does, so the DDS-facing code
// emitted from cppDdsType() names the type the struct member really has. The spelling
// is the one rtiddsgen itself writes, matching what the `long` branch does with int32_t.
mi.cpp.ddsType = QStringLiteral("int64_t");
mi.cpp.fromVariantPost = QStringLiteral(".toLongLong()");
mi.cpp.fromJsonPost = QStringLiteral(".toDouble()");
mi.cpp.toJsonPre = QStringLiteral("static_cast<qint64>(");
@@ -1039,7 +1046,7 @@ QVector<MemberInformation> StructBuilder::buildDbTableInformationFromIdlData(con
pre += columnNamePrefix;
pre += member.name + QLatin1Char('_');
ret += buildDbTableInformationFromIdlData(cttiChild, tableName, StructBuilder::camelCaseToUnderline(pre),
cppStructure + member.name + QStringLiteral("()."));
cppStructure + member.name + QStringLiteral("."));
continue;
}
@@ -26,7 +26,7 @@
{% endif %}
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
#include <{{ namespace_abbr }}_enums.hpp>
#include <{{ include_prefix }}/{{ namespace_abbr }}_enums.hpp>
{% for ext_service in ext_services.member %}
#include <{{ ext_service.baseFilePath }}.hpp>
@@ -215,7 +215,7 @@ bool DtcImpl::waitForHistoricalData{{ dt.name }}(int timeoutMSec)
template <>
{{ dt.key.cppType }} getKey(const {{ dt.type }} &val)
{
return val.{{ dt.key.name }}();
return val.{{ dt.key.name }};
}
QMap<{{ dt.key.cppType }},::{{ namespace }}::{{ dt.type }}> DtcImpl::{{ dt.nameFlc }}s()
@@ -89,7 +89,9 @@ bool DtsImpl::remove{{ dt.name }}ByKey({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc
return false;
}
{{ namespace }}::{{ dt.name }} data;
data.{{ dt.key.name }}({{ dt.key.name }});
// rtiddsgen -stl generates plain public data members, so the key is
// assigned directly instead of the old setter call data.{{ dt.key.name }}(...).
data.{{ dt.key.name }} = {{ dt.key.name }};
return m_dts{{ dt.name }}->remove(data, errorMsgIfSampleDoesNotExists);
}
{% endif %}
@@ -116,9 +116,9 @@ static T buildErrorReason(int reason, int requestId)
}
T reply;
reply.id(requestId);
reply.errorString(errString);
reply.errorParams(errArgs);
reply.id = requestId;
reply.errorString = errString;
reply.errorParams = errArgs;
return reply;
}
@@ -196,7 +196,7 @@ int64_t FtcImpl::{{ ft.requestFlc }}(const {{ ft.requestType }} &request, const
const auto _reply = future.get(); // throws if exception set
Core::FunctionReplyObject fro(
{% for rp in ft.replyParams %} _reply.{{ rp.nameGetter }}(){% if not forloop.last %},{% endif %} {% endfor %}
{% for rp in ft.replyParams %} _reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
);
fro.setUniqueId(m_last{{ ft.request }}UniqueId);
@@ -234,7 +234,7 @@ void FtcImpl::{{ ft.onReply }}(const {{ namespace }}::{{ ft.reply }} &reply, int
{% if ft.isCoreFt %}
Core::FunctionReplyObject fro(
{% for rp in ft.replyParams %}
reply.{{ rp.nameGetter }}(){% if not forloop.last %},{% endif %} {% endfor %}
reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
);
fro.setUniqueId(m_last{{ ft.request }}UniqueId);
cb(fro);
@@ -48,6 +48,18 @@ QJsonValue toJson(qint64 vec)
{
return QJsonValue(QString::number(vec));
}
// IDL 64-bit integers map to int64_t, which is 'long' on LP64 and therefore
// distinct from qint64 ('long long'); without this overload the generic
// toJson(std::vector<T>) is ambiguous for sequence<int64_t> members.
QJsonValue toJson(long vec)
{
return QJsonValue(QString::number(vec));
}
template<>
long fromJson(const QJsonValue &val, type<long>)
{
return val.toString().toLong();
}
// std::string
QJsonValue toJson(const std::string &element)
@@ -198,6 +198,17 @@ long long fromQVariant(const QVariant &val, type<long long>)
return val.toLongLong();
}
// rtiddsgen 4.7 spells the 64 bit integer members int64_t, which is `long` on LP64 and thus
// a different type from the Qt side's qint64 (`long long`). The tag dispatch above is keyed on
// the exact type, so the generated type needs its own conversion even though the two are the
// same width. GrantleeWrappers::cppDdsType() names the generated member type, so this is the
// overload the record replay code instantiates for those members.
template<>
int64_t fromQVariant(const QVariant &val, type<int64_t>)
{
return static_cast<int64_t>(val.toLongLong());
}
template<>
double fromQVariant(const QVariant &val, type<double>)
{
@@ -555,7 +566,7 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
for (const auto &sample : samples)
{
const DATA &data = sample.data();
INFO_LOG(m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }}();
INFO_LOG(m_logger) << "m_dtc{{ dt.name }} {{ dt.recTable.ddsKey.cppMemberName }}: " << data.{{ dt.recTable.ddsKey.cppMemberName }};
{% for row in dt.recTable.cppMember %}
q.bindValue(QStringLiteral(":{{ row.dbColumnName }}"), {{ row.ddsToQVariant }});
@@ -565,7 +576,10 @@ bool RecordReplayPlugin::write{{ dt.name }}(NSqlQuery &q, QHash<QString, qint64>
if (!q.exec())
return false;
minRecordSampleTime = std::min(minRecordSampleTime, data.sampleTime());
// rtiddsgen 4.7 declares sample_time as int64_t (long), while the record
// boundary is qint64 (long long); std::min requires both arguments to be
// the same type, so narrow the generated member explicitly.
minRecordSampleTime = std::min(minRecordSampleTime, static_cast<qint64>(data.sampleTime));
}
}
@@ -645,10 +659,10 @@ bool RecordReplayPlugin::readLastSnapshotFor{{ dt.name }}(NSqlQuery &q, qint64 s
{% endfor %}
if (bIsAlive)
m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data);
m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data);
else
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data);
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}());
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data);
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }});
}
m_snapshot{{ dt.name }}MapTime = timeSnapshot;
@@ -677,10 +691,10 @@ bool RecordReplayPlugin::read{{ dt.name }}(NSqlQuery &q, qint64 fromTime, qint64
{% endfor %}
if (bIsAlive)
m_{{ dt.nameFlc }}Map.insert(data.sampleTime(), data);
m_{{ dt.nameFlc }}Map.insert(data.sampleTime, data);
else
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime(), data);
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }}());
m_{{ dt.nameFlc }}DisposedMap.insert(data.sampleTime, data);
m_{{ dt.nameFlc }}Keys.insert(data.{{ dt.key.name }});
}
return true;
}
@@ -795,7 +809,7 @@ void RecordReplayPlugin::clearData{{ dt.name }}()
{{ dt.name }} tmpData;
for (auto key : m_{{ dt.nameFlc }}Keys)
{
tmpData.{{ dt.key.name }}(key);
tmpData.{{ dt.key.name }} = key;
m_dts{{ dt.name }}->remove(tmpData);
}
}
@@ -18,8 +18,10 @@
#include <{{ include_prefix }}/{{ namespace_abbr }}_dts_types.h>
#include <{{ include_prefix }}/logger.h>
// TODO: Problem with QT5_WRAP_CPP ...
#include <../../Common/PluginInterfaces/record_replay_plugin.h>
// Resolved from the Lts include root (see include_directories(BEFORE .../Lts)
// in the root CMakeLists); the old <../../Common/...> spelling only worked
// for in-source builds.
#include <Common/PluginInterfaces/record_replay_plugin.h>
#include <LtsUtilsCore/pgarray.h>
@@ -15,8 +15,10 @@
#include <Common/ProjectConfig/project_defines.h>
#include <QtCore/QObject>
// TODO: Problem with QT5_WRAP_CPP ...
#include <../../DDS/Generic/topic_type_plugin.h>
// Resolved from the Lts include root (see include_directories(BEFORE .../Lts)
// in the root CMakeLists); the old <../../DDS/...> spelling only worked for
// in-source builds because moc/gcc do not resolve it relative to this file.
#include <DDS/Generic/topic_type_plugin.h>
namespace {{ namespace }}
{
@@ -12,7 +12,7 @@
// filename: {{ namespace_abbr }}_translation.h
#include <string>
#include <{{ namespace_abbr }}_enums.hpp>
#include <{{ include_prefix }}/{{ namespace_abbr }}_enums.hpp>
#include <{{ include_prefix }}/{{ namespace_abbr }}_export.h>
class QString;
@@ -2,7 +2,7 @@
#pragma once
#include "ltscoordinate_export.h"
#include <LtsCoordinate/ltscoordinate_export.h>
#include <Core/core.hpp>
#include <LtsCoordTrans/lts_coord_trans.h>
@@ -48,7 +48,7 @@ class LTSCOORDINATE_EXPORT LtsCoordVector
utmVectorRef.reserve(m_geo_coordinates.size());
for (const auto& geoCoord : std::as_const(m_geo_coordinates))
utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat(), zone));
utmVectorRef.push_back(LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon, geoCoord.lat, zone));
}
protected:
@@ -29,13 +29,13 @@ double LtsCoordinate::elevationAt(double defaultElevation, bool* bIsCovered) con
if (!std::isnan(m_elevation))
return m_elevation;
if (m_getElevationCB)
m_elevation = m_getElevationCB(m_geo.lon(), m_geo.lat(), defaultElevation, bIsCovered);
m_elevation = m_getElevationCB(m_geo.lon, m_geo.lat, defaultElevation, bIsCovered);
return m_elevation;
}
void LtsCoordinate::setZValueAccordingElevation(double defaultElevation)
{
m_geo.z(elevationAt(defaultElevation));
m_geo.z = elevationAt(defaultElevation);
}
double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaultElevation, bool* bIsCovered)
@@ -46,7 +46,7 @@ double LtsCoordinate::elevationAt(const LtsCoordinate& coordinate, double defaul
void LtsCoordinate::replaceZValueByElevationIfValue(double zValueToBeReplaced, double defaultElevation)
{
if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z())) || qFuzzyCompare(m_geo.z(), zValueToBeReplaced))
if ((std::isnan(zValueToBeReplaced) && std::isnan(m_geo.z)) || qFuzzyCompare(m_geo.z, zValueToBeReplaced))
setZValueAccordingElevation(defaultElevation);
}
@@ -79,7 +79,7 @@ void LtsCoordinate::convertGeoToUtm() const
int zone = -1;
if (std::isnan(m_geo.lon()) || std::isnan(m_geo.lat()))
if (std::isnan(m_geo.lon) || std::isnan(m_geo.lat))
{
fprintf(stderr, "Error while fromGeographic, value is NaN\n");
m_utm2D = LtsCoordTrans::UtmCoordinate();
@@ -90,7 +90,7 @@ void LtsCoordinate::convertGeoToUtm() const
++s_conversion_counter;
#endif
m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone);
m_utm2D = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone);
Q_ASSERT_X(m_utm2D.zone > 0, "LtsCoordinate", "zone has to be set");
}
@@ -2,7 +2,7 @@
#pragma once
#include "ltscoordinate_export.h"
#include <LtsCoordinate/ltscoordinate_export.h>
#include <Core/core.hpp>
#include <LtsCoordTrans/lts_coord_trans.h>
@@ -35,7 +35,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
explicit LtsCoordinate(const Core::GeoPosition& geoPos) : m_geo(geoPos) {}
explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon(), geoPos2D.lat(), std::nan("")) {}
explicit LtsCoordinate(const Core::GeoPosition2D& geoPos2D) : m_geo(geoPos2D.lon, geoPos2D.lat, std::nan("")) {}
LtsCoordinate(const LtsCoordTrans::UtmCoordinate& utm2D, double zValue) = delete;
@@ -67,7 +67,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
bool hasGeo() const
{
return !(valueIsNullOrNan(m_geo.lon()) || valueIsNullOrNan(m_geo.lat()));
return !(valueIsNullOrNan(m_geo.lon) || valueIsNullOrNan(m_geo.lat));
}
bool hasUtm() const
@@ -95,7 +95,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
Core::GeoPosition2D geoPosition2D() const
{
return Core::GeoPosition2D(m_geo.longitude, m_geo.latitude);
return Core::GeoPosition2D(m_geo.lon, m_geo.lat);
}
const LtsCoordTrans::UtmCoordinate& utmCoordinate() const
@@ -107,23 +107,23 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
double& rz()
{
return m_geo.altitude;
return m_geo.z;
}
double z() const
{
return m_geo.z();
return m_geo.z;
}
void setZ(double value)
{
m_geo.z(value);
m_geo.z = value;
}
LtsCoordTrans::UtmCoordinate utmCoordinateDiffZone(int zone) const
{
m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon(), m_geo.lat(), zone);
m_utm2D_differentZone = LtsCoordTrans::UtmCoordinate::fromGeographic(m_geo.lon, m_geo.lat, zone);
return m_utm2D_differentZone;
}
@@ -146,17 +146,17 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
QPointF toGeoPointF() const
{
return QPointF(m_geo.lon(), m_geo.lat());
return QPointF(m_geo.lon, m_geo.lat);
}
QPoint3D toGeoPoint3D() const
{
return QPoint3D(m_geo.lon(), m_geo.lat(), m_geo.z());
return QPoint3D(m_geo.lon, m_geo.lat, m_geo.z);
}
UtmCoordinate3D toUtmCoordinate3D() const
{
return UtmCoordinate3D(utmCoordinate(), m_geo.z());
return UtmCoordinate3D(utmCoordinate(), m_geo.z);
}
using elevationCbFunc = std::function<double(double, double, double, bool*)>;
@@ -174,7 +174,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
double heightOverElevation() const
{
return m_geo.z() - elevationAt();
return m_geo.z - elevationAt();
}
double distanceUtm2D(const LtsCoordinate& other) const
@@ -203,13 +203,13 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
void clearGeo() const
{
clearGeoLonLat();
m_geo.z(std::nan(""));
m_geo.z = std::nan("");
}
void clearGeoLonLat() const
{
m_geo.lon(0);
m_geo.lat(0);
m_geo.lon = 0;
m_geo.lat = 0;
}
void clearUtm() const
@@ -245,7 +245,7 @@ class LTSCOORDINATE_EXPORT LtsCoordinate
const auto& utmTemp = utmCoordinateInternal(zone);
pntRef.rx() = utmTemp.x;
pntRef.ry() = utmTemp.y;
pntRef.rz() = m_geo.z();
pntRef.rz() = m_geo.z;
}
protected:
@@ -31,9 +31,6 @@ if(QT6_GUI_AVAILABLE)
PRIVATE
NGLLogger
## LtsSessionDataDds
## ExmDataPluginInterface # External dependency - missing
## situationMapCommon # External dependency - missing
## situationMapElevationMap # External dependency - missing
PUBLIC
LtsUtilsCoreHeaderOnly
Qt6::Core
@@ -42,7 +39,14 @@ if(QT6_GUI_AVAILABLE)
endif()
if(BUILD_RTI)
target_link_libraries(LtsElevation PRIVATE AsmDataPluginInterface)
# All ElevationMapManager / resource_path / exm-dtc usages live inside
# #ifdef BUILD_RTI in lts_elevation_manager.cpp (Qt5 dependencies restored).
target_link_libraries(LtsElevation PRIVATE
AsmDataPluginInterface
ExmDataPluginInterface
situationMapCommon
situationMapElevationMap
)
endif()
ADD_SUBDIRECTORY(UnitTest_Elevation)
@@ -6,6 +6,12 @@
#include <AssetManagement/asm_data_plugin_interface.h>
#include <ExerciseManagement/exm_data_plugin_interface.h>
#include <Viewer/SituationMap/ElevationMap/elevation_map_manager.h>
#include <Viewer/SituationMap/Common/resource_path.h>
#include <QDir>
#include <QHash>
#include <QSharedPointer>
#include <QUrl>
static_assert((int)SituationMap::ElevationMapManager::LineOfSight::LOS_UNDEFINED ==
(int)LtsElevation::LineOfSight::LOS_UNDEFINED,
@@ -106,15 +112,71 @@ LtsElevationManager::createInstance(int exerciseId, const std::shared_ptr<Exerci
return nullptr;
}
QStringList filePaths_rough_to_fine;
// Qt5 logic restored (the qt6 port had dropped the exerciseId->trainingAreaId
// caching and always returned nullptr here).
#ifdef BUILD_RTI
filePaths_rough_to_fine = getFilenamesForExercise(exerciseId);
int trainingAreaId = -1;
// remember for future calls
// (so createInstance should work WITHOUT dtcs)
// Idea: MainHandler: createInstance with exerciseId and valid dtcs
// Plugin or simular: createInstance with exerciseId and no dtcs
static QHash<int, int> s_exIdToTaIdStore;
const auto exTaIt = s_exIdToTaIdStore.find(exerciseId);
if (exTaIt != s_exIdToTaIdStore.end())
{
// CASE 1:
// already created:
trainingAreaId = *exTaIt;
}
else
{
// CASE 2:
// ... or create on demand:
if (!exmDtc || !asmDtc)
{
ERROR_LOG(logger) << Q_FUNC_INFO << " no dtcs for exerciseId=" << exerciseId
<< ", asmDtc=" << asmDtc
<< ", exmDtc=" << exmDtc;
return nullptr;
}
// exId to taId
trainingAreaId = exerciseIdToTrainingAreaId(exerciseId, exmDtc);
if (trainingAreaId <= 0)
{
ERROR_LOG(logger) << Q_FUNC_INFO << " Error getting trainingAreaId"
<< ", exerciseId=" << exerciseId
<< ", trainingAreaId=" << trainingAreaId;
return nullptr;
}
// store and remember:
s_exIdToTaIdStore[exerciseId] = trainingAreaId;
}
// CASE 1: Following should work even with invalid asmDtc:
LTS_ELEVATION_MANAGER_TYPE temp = createInstanceForTrainingAreaId(trainingAreaId, asmDtc);
if (!temp)
{
ERROR_LOG(logger) << Q_FUNC_INFO << " Error on createInstanceForTrainingAreaId"
<< ", exerciseId=" << exerciseId
<< ", trainingAreaId=" << trainingAreaId;
return nullptr;
}
// add exmDtc
temp->initDDS(exmDtc, asmDtc);
TRACE_LOG(logger) << Q_FUNC_INFO << " END, exerciseId=" << exerciseId;
return temp;
#else
Q_UNUSED(exerciseId);
ERROR_LOG(logger) << Q_FUNC_INFO << " BUILD_RTI=OFF, cannot get filenames for exercise";
#endif
Q_UNUSED(filePaths_rough_to_fine);
Q_UNUSED(exmDtc);
Q_UNUSED(asmDtc);
ERROR_LOG(logger) << Q_FUNC_INFO << " BUILD_RTI=OFF, cannot create instance";
return nullptr;
#endif
}
LTS_ELEVATION_MANAGER_TYPE LtsElevationManager::getInstance(int exerciseId)
@@ -291,19 +353,19 @@ QStringList LtsElevationManager::getFilenamesForTrainingArea(int trainingAreaId)
{
d->m_asmDtc->waitForHistoricalDataTrainingArea(1000);
const AssetManagement::TrainingArea& ta = d->m_asmDtc->trainingArea(trainingAreaId);
if (ta.id() != trainingAreaId)
if (ta.id != trainingAreaId)
{
ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error on s_asmDtc->trainingArea"
<< ", trainingAreaId=" << trainingAreaId;
return {};
}
const std::vector<AssetManagement::MapDescription>& mdVec = ta.elevation();
const std::vector<AssetManagement::MapDescription>& mdVec = ta.elevation;
filePaths_rough_to_fine.reserve(mdVec.size());
for (const AssetManagement::MapDescription& md : std::as_const(mdVec))
{
QUrl url(QString::fromStdString(md.url()));
QUrl url(QString::fromStdString(md.url));
QString filePathAbs = url.toLocalFile();
if (QDir::isRelativePath(filePathAbs))
filePathAbs = SituationMap::getResourcePath() + QStringLiteral("/elevation/") + filePathAbs;
@@ -372,13 +434,13 @@ int LtsElevationManager::exerciseIdToTrainingAreaId(int exerciseId,
exmDtc->waitForHistoricalDataExercise(1000);
const ExerciseManagement::Exercise& exm = exmDtc->exercise(exerciseId);
if (exm.id() != exerciseId)
if (exm.id != exerciseId)
{
ERROR_LOG(logger) << Q_FUNC_INFO << " Error on m_exmDtc->exercise"
<< ", exerciseId=" << exerciseId;
return -1;
}
trainingAreaId = exm.trainingAreaId();
trainingAreaId = exm.trainingAreaId;
if (trainingAreaId <= 0)
{
@@ -252,22 +252,22 @@ void LtsLogin::logoff()
QString cmd;
switch (m_shutdownAction.underlying())
{
case AssetManagement::ShutdownAction_def::Shutdown:
case AssetManagement::ShutdownAction::Shutdown:
#ifdef LTS_DEBUG
cmd = QStringLiteral("xeyes");
#else
cmd = QStringLiteral("systemctl poweroff");
#endif
break;
case AssetManagement::ShutdownAction_def::Reboot:
case AssetManagement::ShutdownAction::Reboot:
#ifdef LTS_DEBUG
cmd = QStringLiteral("kcalc");
#else
cmd = QStringLiteral("systemctl reboot");
#endif
break;
case AssetManagement::ShutdownAction_def::Logout:
case AssetManagement::ShutdownAction_def::NoAction:
case AssetManagement::ShutdownAction::Logout:
case AssetManagement::ShutdownAction::NoAction:
emit signalLogoffDone();
break;
}
@@ -293,7 +293,9 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
}
const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended)
const QVector<QStringRef> iidParameters = jsonIid.splitRef(QLatin1Char(':'));
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split
// provides the same zero-copy tokenization.
const QList<QStringView> iidParameters = QStringView{jsonIid}.split(QLatin1Char(':'));
DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid;
@@ -20,7 +20,7 @@ void add(qint64 time_offset)
time += time_offset;
ttm->addTestEvent(new LtsTimelineClassic::Event(
0, (int)ProjectDataManagement::PdmEventType_def::Hit, time, 0, 0, 0, 0, QStringList() << QStringLiteral("Test"),
0, (int)ProjectDataManagement::PdmEventType::EventType_Hit, time, 0, 0, 0, 0, QStringList() << QStringLiteral("Test"),
LtsTimelineClassic::Event::drawCustomEventGraphicEllipse, QColor("green"), QString()));
}
@@ -211,7 +211,7 @@ template <typename T> bool inline get2Byte(const QByteArray& data, T& out)
template <typename T> void inline set1Byte(const T in, QByteArray& out)
{
static_assert(std::is_integral_v<T> || std::is_enum_v<T>, "Only integrals allowed for raw byte accessd");
unsigned char c = in;
unsigned char c = static_cast<unsigned char>(in);
out += c;
}
@@ -30,6 +30,13 @@ double QPoint3D::distanceToPoint(const QPoint3D& point) const
return (*this - point).length();
}
// The header declares these operators inside namespace LtsUtils; they must
// be defined there too (a `using` directive does not place definitions
// into a namespace). Qt6's QDataStreamOperatorForType metatype machinery
// references the LtsUtils-scoped symbols explicitly.
namespace LtsUtils
{
QDataStream& operator<<(QDataStream& s, const QPoint3D& p)
{
s << p.x() << p.y() << p.z();
@@ -47,3 +54,5 @@ QDataStream& operator>>(QDataStream& s, QPoint3D& p)
p.rz() = z;
return s;
}
} // namespace LtsUtils
@@ -46,21 +46,15 @@ RequestHelper::RequestHelper(QObject* parent, bool quiet,
}
void RequestHelper::addRequest(const std::function<int64_t()>& requestFunction,
const std::function<void(const FunctionReplyType& baseReply)>& baseReplyHandler)
const std::function<void(const Core::FunctionReply& baseReply)>& baseReplyHandler)
{
m_requestFunctions.append(RequestFunctionContainer(requestFunction, baseReplyHandler));
}
bool RequestHelper::requestReply(const FunctionReplyType& baseReply)
bool RequestHelper::requestReply(const Core::FunctionReply& baseReply)
{
#ifdef BUILD_RTI
// Bei BUILD_RTI=ON: baseReply ist Core::FunctionReply, cast von dds::core::Reference
// Die Implementation erwartet Core::FunctionReplyObject
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.errorString(), baseReply.errorParams());
#else
// Stub-Version: nur id und error string
const Core::FunctionReplyObject fro(baseReply.id(), baseReply.str().c_str());
#endif
// rtiddsgen 7.7 generates plain public members (no getters/setters)
const Core::FunctionReplyObject fro(baseReply.id, baseReply.errorString, baseReply.errorParams);
return _requestReply(fro, &baseReply);
}
@@ -69,7 +63,7 @@ bool RequestHelper::requestReply(const Core::FunctionReplyObject& replyObject)
return _requestReply(replyObject, nullptr);
}
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const FunctionReplyType* baseReply)
bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Core::FunctionReply* baseReply)
{
m_errorString = fro.translated();
@@ -100,14 +94,8 @@ bool RequestHelper::_requestReply(const Core::FunctionReplyObject& fro, const Fu
if (baseReply)
m_singleRequestCustomFunctionReply(*baseReply);
else
#ifdef BUILD_RTI
m_singleRequestCustomFunctionReply(
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
#else
// Stub-Version: FunctionReply mit passendem Konstruktor
m_singleRequestCustomFunctionReply(
Core::FunctionReply(fro.id(), fro.str(), fro.args(), fro.additionalInfo()));
#endif
}
if (fro.error())
@@ -195,7 +183,7 @@ void RequestHelper::slotNextRequest()
void RequestHelper::startSingleBackgroundRequest(
const std::function<int64_t()>& requestFunction,
const std::function<void(const FunctionReplyType&)>& baseReplyHandler)
const std::function<void(const Core::FunctionReply&)>& baseReplyHandler)
{
m_blockingCall = false;
startSingleRequest(requestFunction, baseReplyHandler);
@@ -8,8 +8,15 @@
# --- Library LtsWebSocketCommon --------------------------------------------------------------------------------
#
# Make ${Qt6_WebSockets} optional
if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets)
set(Qt6_WebSockets ${Qt6_WebSockets})
# Link the real WebSockets module whenever the websocket code path is
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
# Qt6::WebSockets import are set when the real module was found. The old
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
# discovery takes the minimal path) and the Qt6_WebSockets variable was
# never defined, so the websocket code compiled without the module on
# the link line.
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
set(Qt6_WebSockets Qt6::WebSockets)
else()
set(Qt6_WebSockets "")
endif()
@@ -35,6 +35,7 @@ template <typename T> class DataManagerBaseDl
}
protected:
NGL::INGLLogger &m_logger;
std::shared_ptr<T> m_dbInterface;
};
} // namespace LtsWebSocket
@@ -1,8 +1,16 @@
# Modified CMakeLists.txt from github.com/wille-io/httq
# Make ${Qt6_WebSockets} optional
if(QT6_GUI_AVAILABLE AND TARGET Qt6::WebSockets)
set(Qt6_WebSockets ${Qt6_WebSockets})
# Link the real WebSockets module whenever the websocket code path is
# compiled: QT6_WEBSOCKETS_AVAILABLE (root CMakeLists) and the manual
# Qt6::WebSockets import are set when the real module was found. The old
# QT6_GUI_AVAILABLE condition never held in this environment (Qt6
# discovery takes the minimal path) and the Qt6_WebSockets variable was
# never defined, so AbstractServer.cpp compiled the websocket code
# without the module on the link line (undefined reference to
# QWebSocketServer::handleConnection).
if(QT6_WEBSOCKETS_REAL_FOUND OR Qt6WebSockets_FOUND)
set(Qt6_WebSockets Qt6::WebSockets)
else()
set(Qt6_WebSockets "")
endif()
@@ -9,6 +9,14 @@ IF(BUILD_RTI)
INCLUDE(MacroRTIDDSGen)
INCLUDE(MacroCodeGenIdl)
# Resolve <DDS/...> includes (generic_data_reader.h, generic_dtc.h, ...) to the
# real headers under Lts/DDS/ instead of the migration stub tree in include/.
# The generated core_dtc_impl.h relies on GenericDtc::TopicType, which only the
# real DDSGeneric::GenericDataReader base provides — the stub variant lacks it.
# Same fix the migrated service CMakeLists (FileManagement/FilterManagement)
# already enforce; svcFileManagement links svcCoreClient, so Core must build.
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
SET(xml_FILE core.xml)
#
@@ -111,6 +119,11 @@ SET(SRCS_client
CODEGEN_CLIENT_TOPICS_IMPL(SRCS_client ${xml_FILE})
NGL_ADD_LIBRARY2(AAR SV WS HLA svcCoreClient SHARED ${SRCS_client})
# NGL_ADD_LIBRARY2 (unlike NGL_ADD_LIBRARY) does not define the
# MAKE_<SYMBOL>_LIB compile guard, but the generated core_[d|f]tc_impl.h
# headers require MAKE_SVCCORECLIENT_LIB — same situation as ddscore above,
# which defines MAKE_DDSCORE_LIB explicitly for the same reason.
TARGET_COMPILE_DEFINITIONS(svcCoreClient PRIVATE MAKE_SVCCORECLIENT_LIB)
NGL_TARGET_INCLUDE_DIRECTORIES(svcCoreClient
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../
@@ -15,7 +15,7 @@ namespace Core
{
Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector)
: QObject(nullptr)
, m_logger(NGL::INGLLoggerBootstrap::getNGLLogger("Core.Pacemaker"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Core.Pacemaker"))
{
init(ddsConnector);
}
@@ -40,11 +40,11 @@ void Pacemaker::setNewState(Core::RunningState newState, const QString& errorStr
void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString)
{
m_state.runningState(newState);
m_state.runningState = newState;
if (errorString.isEmpty())
m_state.errorString().reset();
m_state.errorString.reset();
else
m_state.errorString(errorString.toStdString());
m_state.errorString = errorString.toStdString();
publishState();
}
@@ -59,9 +59,9 @@ void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, cons
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
{
if (!m_state.ports().is_set())
m_state.ports() = std::vector<Core::PortInformation>();
m_state.ports().get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
if (!m_state.ports.is_set())
m_state.ports = std::vector<Core::PortInformation>();
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
publishState();
}
@@ -81,8 +81,8 @@ void Pacemaker::init(DDSConnector::DdsConnector* ddsConnector)
WARNING_LOG(m_logger) << "Can not initialize DTS::CurrentRunningState!";
return;
}
m_state.pid(QCoreApplication::applicationPid());
m_state.runningState(Core::RunningState::Starting);
m_state.pid = QCoreApplication::applicationPid();
m_state.runningState = Core::RunningState::Starting;
m_paceThread = new QThread;
this->moveToThread(m_paceThread);
@@ -40,7 +40,7 @@ public:
public Q_SLOTS:
void setNewState(Core::RunningState newState, const QString &errorString = QString());
void addPort(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
void addPort(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
// only public for special purposes, not needed to call explicitly by default
void publishState();
@@ -48,7 +48,7 @@ public Q_SLOTS:
private:
void init(DDSConnector::DdsConnector *ddsConnector);
void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString());
void addPortInternal(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral(""));
void addPortInternal(unsigned short number, Core::CorePortType portType, const QString &properties = QStringLiteral(""));
private:
static constexpr const int m_publishTimerDelay = 3000;
@@ -28,13 +28,13 @@ bool TopicLockMaster::init(const std::shared_ptr<DDSConnector::DdsConnector> &dd
m_coreDtc->enableAll();
m_coreDtc->lockedEntitys([this] (const LockedEntity &data) {
m_lockedEntitys << key(data.entityId(), data.exerciseId(), QString::fromStdString(data.entityTypeName()));
m_lockedEntitys << key(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
});
connect(m_coreDtc.get(), &Interface::Dtc::lockedEntityChanged, this,
[this] (const LockedEntity &data, DataModification modType)
{
key k(data.entityId(), data.exerciseId(), QString::fromStdString(data.entityTypeName()));
key k(data.entityId, data.exerciseId, QString::fromStdString(data.entityTypeName));
if (modType == DataModification::eAdded)
m_lockedEntitys << k;
else if (modType == DataModification::eRemoved)
@@ -7,10 +7,14 @@
#include <Core/core_export.h>
#if BUILD_RTI
#include <Core/core_dtc.h>
// Resolves to the codegen-generated core_dtc.h via the build-dir include
// root (build4/Lts). The old <Core/core_dtc.h> spelling hit the migration
// stub tree (include/Core/core_dtc.h), whose DDS::Core::Interface forward
// declarations don't match the generated Core::Interface::Dtc.
#include <DDS/Core/core_dtc.h>
#else
// Forward declarations for moc compatibility when BUILD_RTI=OFF
namespace DDS { namespace Core { namespace Interface { class Dtc; } } }
namespace Core { namespace Interface { class Dtc; } }
#endif
namespace DDSConnector
@@ -66,14 +70,16 @@ public:
template<typename E>
bool isLocked(const E &data, int exerciseId)
{
auto it = m_lockedEntitys.constFind(key(data.id(), exerciseId, QString::fromStdString(typeid(E).name())));
// rtiddsgen -stl generates plain public data members, so the id is
// accessed directly instead of the old getter call data.id().
auto it = m_lockedEntitys.constFind(key(data.id, exerciseId, QString::fromStdString(typeid(E).name())));
return !(it == m_lockedEntitys.cend());
}
private:
QSet<key> m_lockedEntitys;
#if BUILD_RTI
std::shared_ptr<DDS::Core::Interface::Dtc> m_coreDtc;
std::shared_ptr<Core::Interface::Dtc> m_coreDtc;
#endif
};
@@ -22,6 +22,10 @@ NGL_ADD_LIBRARY2(AAR SV WS HLA ddsconnector SHARED ${SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(ddsconnector
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../
# dds_connector.h includes the generated ddsconnector_export.h with a
# quoted include; consumers (svcFilterManagement etc.) resolve it only
# if the binary dir with the GENERATE_EXPORT_HEADER output is exported.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}
)
NGL_TARGET_LINK_LIBRARIES(ddsconnector
@@ -47,7 +47,6 @@ class FunctionTopicTests : public QObject
const DdsUnitTests::FunctionRequestWithState& request);
private:
NGL::INGLLogger& m_logger;
void requestWithState();
private:
@@ -430,7 +430,10 @@ private:
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
// QueuedConnection to make sure the data is handled in the correct Qt (main) thread
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
QArgument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()), // need to explicitly specify the registered typename
// Qt6: QMetaMethod::invoke takes QMetaMethodArgument; pass the
// registered topic type name like Q_ARG does, but with the
// runtime name (ReplyTopic is a template parameter).
QtPrivate::Invoke::argument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()),
Q_ARG(int, request.uniqueId),
Q_ARG(bool, !inProgress)); // finished yes/no
}
@@ -31,6 +31,10 @@ NGL_ADD_LIBRARY2(WS AAR SV HLA ddsfts SHARED ${SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(ddsfts
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../
# generic_fts_internal.h includes the generated ddsfts_export.h with a
# quoted include; consumers (the generated *_topic_type_plugin.cpp)
# resolve it only if the binary dir with the export header is exported.
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../../Proxies/TrainingAreaBase
)
NGL_TARGET_LINK_LIBRARIES(ddsfts
@@ -282,7 +282,7 @@ template <typename REQUEST, typename REPLY> class Requester final : public Reply
, m_dataReader(nullptr)
, m_contentFilteredTopic(nullptr)
, m_curInstanceHandle(dds::core::InstanceHandle::nil())
, m_logger(NGL::getNGLLogger("connext.requester"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.requester"))
{
}
@@ -417,6 +417,7 @@ private:
dds::sub::DataReader<REPLY> m_dataReader;
dds::topic::ContentFilteredTopic<REPLY> m_contentFilteredTopic;
dds::core::InstanceHandle m_curInstanceHandle;
NGL::INGLLogger &m_logger;
};
template <typename REQUEST, typename REPLY> class Replier final : public ReplyRequestBase<REQUEST, REPLY>
@@ -431,7 +432,7 @@ template <typename REQUEST, typename REPLY> class Replier final : public ReplyRe
, m_dataReader(dds::sub::DataReader<REQUEST>(replierParams.subscriber(),
ReplyRequestBase<REQUEST, REPLY>::m_requestTopic,
replierParams.datareader_qos()))
, m_logger(NGL::getNGLLogger("connext.replier"))
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("connext.replier"))
{
}
@@ -500,6 +501,7 @@ private:
connext::ReplierParams<REQUEST, REPLY> m_replierParams;
dds::pub::DataWriter<REPLY> m_dataWriter;
dds::sub::DataReader<REQUEST> m_dataReader;
NGL::INGLLogger &m_logger;
};
} // namespace connext
@@ -61,10 +61,14 @@ private:
void sendReplyState(Core::FtReplyState replyState, const rti::core::SampleIdentity &requestSampleIdentity)
{
connext::WriteSample<ReplyTopic> reply;
reply.data().replyState(replyState);
// rtiddsgen -stl generates plain public data members, so the reply
// state is assigned directly instead of the old setter call.
reply.data().replyState = replyState;
bool bLastTelegram = ((replyState != Core::FtReplyState_def::InProgress) &&
(replyState != Core::FtReplyState_def::NotStarted));
// FtReplyState doesn't exist anymore with rtiddsgen 7.7 - the
// enum values are directly available in Core::FtReplyState.
bool bLastTelegram = ((replyState != Core::FtReplyState::InProgress) &&
(replyState != Core::FtReplyState::NotStarted));
m_replier->send_reply(reply, requestSampleIdentity, bLastTelegram);
}
@@ -77,7 +81,7 @@ private:
template <typename T, typename std::enable_if<HasStatusFunction<T>::value, int>::type = 0>
void setReply(T &data, Core::FtReplyState status)
{
data.replyState(status);
data.replyState = status;
}
template <typename T, typename std::enable_if<!HasStatusFunction<T>::value, int>::type = 0>
@@ -233,8 +237,11 @@ protected:
<< "[s], -> age: " << age
<< "[s], data: " << s;
ReplyTopic rt;
rt.errorString(tr_lts("dds", "Topic %1 was outdated and therefore ignored. Does the client time match the server time?"));
rt.errorParams({TopicNameHelper::requestTopicName()});
// Generated topic types have plain public data members, so the
// error information is assigned directly instead of the old
// setter calls.
rt.errorString = tr_lts("dds", "Topic %1 was outdated and therefore ignored. Does the client time match the server time?");
rt.errorParams = {TopicNameHelper::requestTopicName()};
sendReply(request.identity(), rt);
return;
}
@@ -2,6 +2,10 @@
#pragma once
// Declares the FTS::GenericFts template that generic_fts_impl.h's
// GenericFtsImpl derives from. Present in the qt5 original; without it
// GenericFts is no known template at the point of derivation.
#include "generic_fts.h"
#include <ddsfts_export.h>
#include "logger.h"
@@ -18,25 +18,25 @@ AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantMan
{
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
switch (role.underlying()) {
case ParticipantManagement::Role_def::Unknown:
case ParticipantManagement::Role::Unknown:
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
break;
case ParticipantManagement::Role_def::Friend:
case ParticipantManagement::Role::Friend:
identity = AdvancedSymbology::SidcDefinitions::Identity::Friend;
break;
case ParticipantManagement::Role_def::Neutral:
case ParticipantManagement::Role::Neutral:
identity = AdvancedSymbology::SidcDefinitions::Identity::Neutral;
break;
case ParticipantManagement::Role_def::Enemy:
case ParticipantManagement::Role::Enemy:
identity = AdvancedSymbology::SidcDefinitions::Identity::HostileFaker;
break;
case ParticipantManagement::Role_def::Pending:
case ParticipantManagement::Role::Pending:
identity = AdvancedSymbology::SidcDefinitions::Identity::Pending;
break;
case ParticipantManagement::Role_def::AssumedFriend:
case ParticipantManagement::Role::AssumedFriend:
identity = AdvancedSymbology::SidcDefinitions::Identity::AssumedFriend;
break;
case ParticipantManagement::Role_def::Suspect:
case ParticipantManagement::Role::Suspect:
identity = AdvancedSymbology::SidcDefinitions::Identity::SuspectJoker;
break;
}
@@ -65,7 +65,7 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantMa
symDataToRender.fillColorReplace = true;
QColor injuryColor = QColor(100, 100, 0);
ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::CombatReady;
ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
const ParticipantManagement::DynamicParticipantData dData = m_ppmDtc->dynamicParticipantData(participant.id());
@@ -161,30 +161,30 @@ AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataM
{
switch (state.underlying())
{
case ProjectDataManagement::VulnerabilityState::CombatReady:
case ProjectDataManagement::VulnerabilityState::TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::NearMiss:
case ProjectDataManagement::VulnerabilityState::HitWithNoEffect:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NearMiss:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HitWithNoEffect:
return AdvancedSymbology::Injury::NoInjury;
case ProjectDataManagement::VulnerabilityState::LightDamage:
case ProjectDataManagement::VulnerabilityState::MediumDamage:
case ProjectDataManagement::VulnerabilityState::HeavyDamage:
case ProjectDataManagement::VulnerabilityState::NotReady:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_LightDamage:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MediumDamage:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_HeavyDamage:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NotReady:
return AdvancedSymbology::Injury::Hit;
case ProjectDataManagement::VulnerabilityState::MobilityKill:
case ProjectDataManagement::VulnerabilityState::VisibleMobilityKill:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_MobilityKill:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleMobilityKill:
return AdvancedSymbology::Injury::MobilityKill;
case ProjectDataManagement::VulnerabilityState::WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VisibleWeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_WeaponSystemDamage:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VisibleWeaponSystemDamage:
return AdvancedSymbology::Injury::WeaponKill;
case ProjectDataManagement::VulnerabilityState::CatastrophicKill:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill:
return AdvancedSymbology::Injury::TotalKill;
case ProjectDataManagement::VulnerabilityState::NContamination:
case ProjectDataManagement::VulnerabilityState::BContamination:
case ProjectDataManagement::VulnerabilityState::CContamination:
case ProjectDataManagement::VulnerabilityState::VulnerabilityBitsChanged:
case ProjectDataManagement::VulnerabilityState::Reserved:
case ProjectDataManagement::VulnerabilityState::NoChange:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NContamination:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_BContamination:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CContamination:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_VulnerabilityBitsChanged:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_Reserved:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_NoChange:
break;
}
return AdvancedSymbology::Injury::NoInjury;
@@ -100,10 +100,10 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
const ProjectDataManagement::VulnerabilityClass vc =
typeClass == ParticipantManagement::TypeClass::Human
? ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries
: ProjectDataManagement::VulnerabilityClass_def::VehicleDamages;
? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
: ProjectDataManagement::VulnerabilityClass::VehicleDamages;
ProjectDataManagement::VulnerabilityState vs =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarmConfig.vulnerabilityState());
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
}
return vulnerabilityState;
@@ -21,7 +21,7 @@ struct NotificationEx : public AlarmManagement::Notification
int equipmentNumber = 0;
int participantId = 0;
int aesId = 0;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
NotificationEx() = default;
@@ -57,7 +57,7 @@ void InterfaceImpl::clearInterfaces()
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
{
if (data.eventType() != ProjectDataManagement::PdmEventType_def::EmergencyCall)
if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
return;
const int issi = data.equipmentNumber();
@@ -57,55 +57,55 @@ AlarmDialog::AlarmDialog(QWidget* parent)
alarmCheckBox.name = QLatin1String("NuclearAgentEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxNMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxNMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterNuclear;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterNuclear;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("DangerAreasEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxDanerAreaMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxDangerAreaMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterDangerArea;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterDangerArea;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("MineAreaEntry");
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaEntryMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaEntryMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EnterMineArea;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_EnterMineArea;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("MineAreaHit");
alarmCheckBox.checkboxMarker = m_ui->cbxMineAreaHitMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxMineAreaHitMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitMine;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("DirectFire");
alarmCheckBox.checkboxMarker = m_ui->cbxDirectFireMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxDirectFireMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::Hit;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("IndirectFire");
alarmCheckBox.checkboxMarker = m_ui->cbxIndirectFireMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxIndirectFireMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::HitEffectSimulation;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("CrossLocalBorderlines");
alarmCheckBox.checkboxMarker = m_ui->cbxLocalBorderMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxLocalBorderMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossLocalBorderline;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("CrossGlobalBorderlines");
alarmCheckBox.checkboxMarker = m_ui->cbxGlobalBorderMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxGlobalBorderMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::CrossGlobalBorderline;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
m_checkBoxes.append(alarmCheckBox);
alarmCheckBox.name = QLatin1String("AirSupport");
alarmCheckBox.checkboxMarker = m_ui->cbxAirSupportMarker;
alarmCheckBox.checkboxWindow = m_ui->cbxAirSupportMessage;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::AirSupport;
alarmCheckBox.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
m_checkBoxes.append(alarmCheckBox);
setOnlineHelpFilename(QLatin1String("Situation-Configure_Global_Alarms"));
@@ -176,57 +176,57 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data,
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
switch (data.eventTypeId().underlying())
{
case ProjectDataManagement::PdmEventType_def::EnterNuclear: {
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
m_ui->cbxNMarker->setChecked(setMarker);
m_ui->cbxNMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::EnterDangerArea: {
case ProjectDataManagement::PdmEventType::EventType_EnterDangerArea: {
DEBUG_LOG(m_logger) << "EnterDangerArea zuweisen ";
m_ui->cbxDanerAreaMarker->setChecked(setMarker);
m_ui->cbxDangerAreaMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::EnterMineArea: {
case ProjectDataManagement::PdmEventType::EventType_EnterMineArea: {
DEBUG_LOG(m_logger) << "EnterMineArea zuweisen ";
m_ui->cbxMineAreaEntryMarker->setChecked(setMarker);
m_ui->cbxMineAreaEntryMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::HitMine: {
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
m_ui->cbxMineAreaHitMarker->setChecked(setMarker);
m_ui->cbxMineAreaHitMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::Hit: {
case ProjectDataManagement::PdmEventType::EventType_Hit: {
DEBUG_LOG(m_logger) << "Hit zuweisen ";
m_ui->cbxDirectFireMarker->setChecked(setMarker);
m_ui->cbxDirectFireMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: {
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
DEBUG_LOG(m_logger) << "HitEffectSimulation zuweisen ";
m_ui->cbxIndirectFireMarker->setChecked(setMarker);
m_ui->cbxIndirectFireMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: {
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
m_ui->cbxLocalBorderMarker->setChecked(setMarker);
m_ui->cbxLocalBorderMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: {
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
m_ui->cbxGlobalBorderMarker->setChecked(setMarker);
m_ui->cbxGlobalBorderMessage->setChecked(messageWindow);
break;
}
case ProjectDataManagement::PdmEventType_def::AirSupport: {
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
m_ui->cbxAirSupportMarker->setChecked(setMarker);
m_ui->cbxAirSupportMessage->setChecked(messageWindow);
@@ -41,7 +41,7 @@ public:
QCheckBox *checkboxMarker = nullptr;
QCheckBox *checkboxWindow = nullptr;
QString name;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::Unknown;
ProjectDataManagement::PdmEventType eventTypeId = ProjectDataManagement::PdmEventType::EventType_Unknown;
};
explicit AlarmDialog(QWidget *parent = nullptr);
@@ -115,7 +115,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
switch (alarm.eventTypeId().underlying())
{
case ProjectDataManagement::PdmEventType_def::Hit: {
case ProjectDataManagement::PdmEventType::EventType_Hit: {
DEBUG_LOG(m_logger) << "Hit zuweisen ";
m_ui->cbxDirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -123,43 +123,43 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
if (alarm.vulnerabilityState() >= 0)
{
ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarm.vulnerabilityState());
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusDirect->setCurrentIndex(index);
}
break;
}
case ProjectDataManagement::PdmEventType_def::HitEffectSimulation: {
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
m_ui->cbxIndirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::AirSupport: {
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
m_ui->cbxAirSupport->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::HitMine: {
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
m_ui->cbxMines->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::HitB:
case ProjectDataManagement::PdmEventType_def::HitN:
case ProjectDataManagement::PdmEventType_def::HitC: {
case ProjectDataManagement::PdmEventType::EventType_HitB:
case ProjectDataManagement::PdmEventType::EventType_HitN:
case ProjectDataManagement::PdmEventType::EventType_HitC: {
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
m_ui->cbxNbcAgent->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::FriendlyFire: {
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
m_ui->cbxFriendlyFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -167,27 +167,27 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
if (alarm.vulnerabilityState() >= 0)
{
ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState_def::type>(alarm.vulnerabilityState());
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusFriendly->setCurrentIndex(index);
}
break;
}
case ProjectDataManagement::PdmEventType_def::Manipulation: {
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
m_ui->cbxManipulation->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline: {
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
m_ui->cbxGlobalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType_def::CrossLocalBorderline: {
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
m_ui->cbxLocalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
@@ -215,7 +215,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
{
if (m_ui->cbxDirectFire->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Hit);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
int statusDirect = -1;
if (m_ui->cbStatusDirect->currentIndex() > 0)
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
@@ -224,7 +224,7 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
}
if (m_ui->cbxFriendlyFire->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::FriendlyFire);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
int statusFriendly = -1;
if (m_ui->cbStatusFriendly->currentIndex() > 0)
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
@@ -234,41 +234,41 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
alarmActionDds.vulnerabilityState(-1);
if (m_ui->cbxIndirectFire->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitEffectSimulation);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxAirSupport->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::AirSupport);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxMines->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitMine);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxNbcAgent->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitN);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitB);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::HitC);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxManipulation->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::Manipulation);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxGlobalBorderLine->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossGlobalBorderline);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxLocalBorderLine->isChecked())
{
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType_def::CrossLocalBorderline);
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
alarmsDds.push_back(alarmActionDds);
}
}
@@ -298,9 +298,9 @@ void ConfigParticipantsDialog::fillCbx()
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
m_ui->cbStatusDirect->removeItem(
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::TemporarySeverance));
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
m_ui->cbStatusFriendly->removeItem(
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::TemporarySeverance));
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
}
} // namespace ParticipantAlarms
@@ -100,7 +100,7 @@ void ParticipantsDialog::onSelectionChanged()
{
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit)
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
configureAlarms = true;
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
}
@@ -51,7 +51,7 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
const ParticipantManagement::ParticipantData data(getParticipantData(index));
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit)
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
isSimulatable = true;
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
@@ -180,9 +180,9 @@ void AesChargeEffectItemInfo::onShowDetails()
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
if (gearClass == ProjectDataManagement::GearClass_def::Biological)
if (gearClass == ProjectDataManagement::GearClass::Biological)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
else if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
else if (gearClass == ProjectDataManagement::GearClass::Chemical)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
}
else
@@ -107,8 +107,8 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
setOnlineHelpFilename(QStringLiteral("Info_Dialog-BoobyTrap"));
break;
}
case AreaEffectSimulation::AesType_def::AtOffRouteMine:
case AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary: {
case AreaEffectSimulation::AesType::AtOffRouteMine:
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
handleOffRouteMine(aesItemView);
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged, this,
&AesInfoDialog::onOffRouteMineChanged);
@@ -284,14 +284,14 @@ bool AesInfoDialog::init(LtsSession::LtsSession* session, const std::shared_ptr<
m_ui->lbAesId->setText(tr("AES Id:"));
if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
if (m_aesType == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{
handleMineAraeSingleMine();
connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dusMineStateChanged, this,
&AesInfoDialog::onDusMineStateChanged);
}
else if (m_aesType == AreaEffectSimulation::AesType_def::AtDusSingleMine)
else if (m_aesType == AreaEffectSimulation::AesType::AtDusSingleMine)
{
handleSingleDusMine();
@@ -363,7 +363,7 @@ void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
<< " data.id(): " << data.id();
handleAesItem(data, AesType_def::AtBoobyTrap);
handleAesItem(data, AesType::AtBoobyTrap);
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
@@ -390,7 +390,7 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine&
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
<< " data.id(): " << data.id();
handleAesItem(data, AesType_def::AtOffRouteMine);
handleAesItem(data, AesType::AtOffRouteMine);
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
@@ -595,17 +595,17 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
QStringList chargeTypesNames;
QStringList chargeTypesShortNames;
if (data.medicMode() != AesOperatingMode_def::OmNotUsed)
if (data.medicMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true);
}
if (data.maintMode() != AesOperatingMode_def::OmNotUsed)
if (data.maintMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
}
if (data.deconMode() != AesOperatingMode_def::OmNotUsed)
if (data.deconMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(413, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(413, true);
@@ -693,7 +693,7 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
m_ui->lblChargeTypeId->setText(QString::number(ctId));
}
const bool isDus = static_cast<MineClass::type>(m_pdmDtc->mineClass(ctId, 0, 0)) == MineClass::DUS;
const bool isDus = static_cast<MineClass>(m_pdmDtc->mineClass(ctId, 0, 0)) == MineClass::DUS;
if (isDus)
m_ui->lbAesId->setText(tr("DUS Mine Id:"));
else
@@ -763,28 +763,28 @@ void AesInfoDialog::handleSingleDusMine()
switch (dsm.effectStateId().underlying())
{
case AesEffectState_def::EsExpired:
case AesEffectState::EsExpired:
m_ui->lblStatus->setText(tr("Inactive"));
break;
case AesEffectState_def::EsRemoved:
case AesEffectState::EsRemoved:
m_ui->lblStatus->setText(tr("Removed"));
break;
case AesEffectState_def::EsCreated:
case AesEffectState::EsCreated:
m_ui->lblStatus->setText(tr("Created"));
break;
case AesEffectState_def::EsPrepared:
case AesEffectState::EsPrepared:
m_ui->lblStatus->setText(tr("Prepared"));
break;
case AesEffectState_def::EsActivated:
case AesEffectState::EsActivated:
m_ui->lblStatus->setText(tr("Active"));
break;
case AesEffectState_def::EsPaused:
case AesEffectState::EsPaused:
m_ui->lblStatus->setText(tr("Paused"));
break;
case AesEffectState_def::EsError:
case AesEffectState::EsError:
m_ui->lblStatus->setText(tr("Error"));
break;
case AesEffectState_def::EsReceived:
case AesEffectState::EsReceived:
m_ui->lblStatus->setText(tr("Received"));
break;
default:
@@ -847,8 +847,8 @@ void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId());
switch (gearClass.underlying())
{
case ProjectDataManagement::GearClass_def::Biological:
case ProjectDataManagement::GearClass_def::Chemical:
case ProjectDataManagement::GearClass::Biological:
case ProjectDataManagement::GearClass::Chemical:
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
break;
default:
@@ -916,7 +916,7 @@ void AesInfoDialog::onShowDetails()
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId);
if (gearClass == ProjectDataManagement::GearClass_def::Biological)
if (gearClass == ProjectDataManagement::GearClass::Biological)
{
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this);
if (dialog)
@@ -925,7 +925,7 @@ void AesInfoDialog::onShowDetails()
break;
}
if (gearClass == ProjectDataManagement::GearClass_def::Chemical)
if (gearClass == ProjectDataManagement::GearClass::Chemical)
{
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
if (dialog)
@@ -1146,7 +1146,7 @@ void AesInfoDialog::onShowDetails()
bool AesInfoDialog::onResetDusMines()
{
if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines)
if (m_aesType == AreaEffectSimulation::AesType::AtMineAreaSingleMines)
{
DEBUG_LOG(m_logger) << "onResetDusMines() AtMineAreaSingleMines mineId: " << m_aesEntityId;
MineResetRequest req(0, {m_aesEntityId});
@@ -36,7 +36,6 @@ class AesInfoDialog : public LtsWidgets::LtsDialog,
}
private:
NGL::INGLLogger& m_logger;
void retranslate() override;
void handleNContamination(const AesItemView& aesItemView);
@@ -107,7 +107,7 @@ void AirSupportExplosionClusterImpactList::createModel()
{
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass_def::AirSupport}, this);
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::AirSupport}, this);
m_effectClusterModel->initModel(m_session);
m_model->setSourceModel(m_effectClusterModel);
}
@@ -74,7 +74,7 @@ bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamina
bcContaOut.propagationDirection = bcContamination.propagationDirection();
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
ProjectDataManagement::VolatilityType_def::get_default(),
ProjectDataManagement::VolatilityType::get_default(),
bcContamination.impactRadius(),
QDateTime::currentDateTime());
@@ -132,12 +132,12 @@ void BCContaminationEdit::enableUiElements(bool enable)
m_ui->cbWeather->setEnabled(enable);
m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->bCContamination(m_aesItem.id());
@@ -270,7 +270,7 @@ void BCContaminationEdit::setData(const BCContamination &contamination, bool cop
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart().is_set() ? contamination.effectStart().get() : 0);
@@ -348,7 +348,7 @@ bool BCContaminationEdit::apply()
chargeType,
pos,
radius,
static_cast<AesWeatherSource::inner_enum>(weathersource),
static_cast<AesWeatherSource>(weathersource),
LtsUtils::toOptional(partyId),
LtsUtils::toOptional(participantId),
dds::core::optional<double>(),
@@ -51,20 +51,20 @@ void BaseEdit::onAesItemModifyReply(const Core::FunctionReplyObject& replyObject
bool BaseEdit::isModifiable() const
{
AesEffectState effectState = m_aesItem.effectStateId();
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated ||
effectState == AreaEffectSimulation::AesEffectState_def::EsPrepared ||
effectState == AreaEffectSimulation::AesEffectState_def::EsCreated ||
effectState == AreaEffectSimulation::AesEffectState_def::EsUnknown ||
effectState == AreaEffectSimulation::AesEffectState_def::EsReceived) &&
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
effectState == AreaEffectSimulation::AesEffectState::EsCreated ||
effectState == AreaEffectSimulation::AesEffectState::EsUnknown ||
effectState == AreaEffectSimulation::AesEffectState::EsReceived) &&
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
}
bool BaseEdit::isOnlyNameModifiable() const
{
AesEffectState effectState = m_aesItem.effectStateId();
return (effectState == AreaEffectSimulation::AesEffectState_def::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState_def::EsActivated) &&
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
}
@@ -166,10 +166,10 @@ void BaseEdit::setEffectStartEnabled(LtsWidgets::LtsDateTimeEdit* dte, bool enab
m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
enable = (exercise.state() == ExerciseManagement::ExerciseState_def::Started ||
exercise.state() == ExerciseManagement::ExerciseState_def::Paused);
enable = (exercise.state() == ExerciseManagement::ExerciseState::Started ||
exercise.state() == ExerciseManagement::ExerciseState::Paused);
if (exercise.state() == ExerciseManagement::ExerciseState_def::Created)
if (exercise.state() == ExerciseManagement::ExerciseState::Created)
dte->setChecked(false);
else
dte->setChecked(dte->msecsSinceEpoch() > 0);
@@ -268,7 +268,7 @@ void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
if (data.id() != m_aesItem.id())
return;
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState_def::EsRemoved)
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState::EsRemoved)
{
__unchange__();
@@ -302,7 +302,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
if (aesItemId == 0)
{
m_aesItem.effectSourceId(ProjectDataManagement::EffectSource_def::ES_Internal);
m_aesItem.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add"));
}
@@ -285,7 +285,7 @@ bool AesItemSortFilterProxyModel::checkFilter(int source_row) const
return false;
const auto effectStateId = aesEffectStateId(source_row);
if (effectStateId == AesEffectState_def::EsRemoved)
if (effectStateId == AesEffectState::EsRemoved)
return false;
if (showExpired())
@@ -347,11 +347,11 @@ public:
{
const auto es = aesItem(row).effectStateId();
return es != AreaEffectSimulation::AesEffectState_def::EsCreated &&
es != AreaEffectSimulation::AesEffectState_def::EsPrepared &&
es != AreaEffectSimulation::AesEffectState_def::EsActivated &&
es != AreaEffectSimulation::AesEffectState_def::EsPaused &&
es != AreaEffectSimulation::AesEffectState_def::EsReceived;
return es != AreaEffectSimulation::AesEffectState::EsCreated &&
es != AreaEffectSimulation::AesEffectState::EsPrepared &&
es != AreaEffectSimulation::AesEffectState::EsActivated &&
es != AreaEffectSimulation::AesEffectState::EsPaused &&
es != AreaEffectSimulation::AesEffectState::EsReceived;
}
bool isExternal(int row) const override
{
@@ -35,21 +35,21 @@ Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
{
switch(state.underlying())
{
case AesEffectState_def::EsUnknown:
case AesEffectState::EsUnknown:
return Qt::BrushStyle::NoBrush;
case AesEffectState_def::EsPrepared:
case AesEffectState_def::EsFired:
case AesEffectState::EsPrepared:
case AesEffectState::EsFired:
return Qt::BrushStyle::BDiagPattern;
case AesEffectState_def::EsCreated:
case AesEffectState_def::EsReceived:
case AesEffectState::EsCreated:
case AesEffectState::EsReceived:
return Qt::BrushStyle::VerPattern;
case AesEffectState_def::EsActivated:
case AesEffectState::EsActivated:
return Qt::BrushStyle::CrossPattern;
case AesEffectState_def::EsRemoved:
case AesEffectState::EsRemoved:
return Qt::BrushStyle::NoBrush;
case AesEffectState_def::EsPaused:
case AesEffectState_def::EsExpired:
case AesEffectState_def::EsError:
case AesEffectState::EsPaused:
case AesEffectState::EsExpired:
case AesEffectState::EsError:
return Qt::BrushStyle::SolidPattern;
}
return Qt::BrushStyle::NoBrush;
@@ -83,12 +83,12 @@ void BorderlineEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->borderline(m_aesItem.id());
@@ -155,7 +155,7 @@ void BorderlineEdit::setData(const Borderline &borderline, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(borderline.name()));
if ( borderline.partyId().is_set())
@@ -285,7 +285,7 @@ Borderline BorderlineEdit::jsonToBorderline(const QByteArray &content)
borderline.effectMarkingInTa(obj[QStringLiteral("effectMarkingInTa")].toInt());
borderline.effectStart(obj[QStringLiteral("effectStart")].toDouble());
int effectStateId = obj[QStringLiteral("effectStateId")].toInt();
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState::inner_enum>(effectStateId));
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
borderline.operatorId(obj[QStringLiteral("operatorId")].toInt());
borderline.id(0);
borderline.name(obj[QStringLiteral("leIdentifier")].toString().toStdString());
@@ -144,7 +144,7 @@ QVector<Borderline> BorderlinesModel::jsonToBorderlineVector(const QByteArray &c
borderline.effectMarkingInTa(objArr[QStringLiteral("effectMarkingInTa")].toInt());
borderline.effectStart(objArr[QStringLiteral("effectStart")].toDouble());
int effectStateId = objArr[QStringLiteral("effectStateId")].toInt();
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState::inner_enum>(effectStateId));
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
borderline.operatorId(objArr[QStringLiteral("operatorId")].toInt());
borderline.id(0);
borderline.name(objArr[QStringLiteral("name")].toString().toStdString());
@@ -98,13 +98,13 @@ bool ChargeAdministrationModel::initModel(LtsSession::LtsSession* session,
}
QVector<ProjectDataManagement::ChargeType> chargesForGearClass =
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Artillery) +
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Mortar);
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Artillery) +
m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Mortar);
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
const bool enableRocket = ps->value(QStringLiteral("aes"), QStringLiteral("enableRocket"), false).toBool();
if (enableRocket)
chargesForGearClass += m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass_def::Rocket);
chargesForGearClass += m_pdmDtc->chargesForGearClass(ProjectDataManagement::GearClass::Rocket);
for (const ParticipantManagement::Party& p : std::as_const(parties))
{
for (const ProjectDataManagement::ChargeType& ct : std::as_const(chargesForGearClass))
@@ -165,7 +165,7 @@ void ChargeEffectEdit::onSelectionChanged()
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(m_ui->dvParticipants->selectedRows().first()));
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id();
if (m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit)
if (m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
return;
DEBUG_LOG(m_logger) << "typeClass: " << m_ppmDtc->type(data.typeId()).typeClass()
@@ -66,12 +66,12 @@ void DangerAreaEdit::enableUiElements(bool enable)
m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
setEffectStartEnabled(m_ui->dteEffectStart, enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->dangerArea(m_aesItem.id());
@@ -139,7 +139,7 @@ void DangerAreaEdit::setPbAesItemsText()
if (item.id() <= 0)
continue;
if (item.effectStateId() != AesEffectState_def::EsActivated)
if (item.effectStateId() != AesEffectState::EsActivated)
continue;
sl << QString::fromStdString(item.name().c_str());
}
@@ -153,7 +153,7 @@ void DangerAreaEdit::setData(const DangerArea &aesItem, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(aesItem.effectStart().is_set() ? aesItem.effectStart().get() : 0);
@@ -176,9 +176,9 @@ QVariant EffectClusterModel::data(const QModelIndex &idx, int role) const
const QString &hdr = this->headerData(BcName, Qt::Horizontal, Qt::DisplayRole).toString();
tooltip.append(QStringLiteral("<p>%1: %2</p>").arg(hdr, QString::fromStdString(ec.name())));
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass_def::Artillery)
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Mortar)
|| m_gearClasses.contains(ProjectDataManagement::GearClass_def::Rocket);
bool bIsArtilleryOrMortar = m_gearClasses.contains(ProjectDataManagement::GearClass::Artillery)
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Mortar)
|| m_gearClasses.contains(ProjectDataManagement::GearClass::Rocket);
toolTipHelper(this, idx, ColGearType, tooltip);
if (bIsArtilleryOrMortar)
@@ -280,12 +280,12 @@ void ExplosionEdit::enableUiElements(bool enable)
}
setFireButton(m_aesItem.effectStateId());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
AesItem baseData;
@@ -307,7 +307,7 @@ void ExplosionEdit::enableUiElements(bool enable)
if (name != m_ui->leIdentifier->text())
m_ui->leIdentifier->setText(name);
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsPaused)
if (m_aesItem.effectStateId() == AesEffectState::EsPaused)
__unchange__();
}
@@ -323,7 +323,7 @@ void ExplosionEdit::setBaseData(const AesItem &baseData, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromUtf8(baseData.name().c_str()));
int idx = m_ui->cbChargeType->findData(baseData.chargeStruct().chargeTypeId());
@@ -810,16 +810,16 @@ bool ExplosionEdit::apply()
void ExplosionEdit::onFireClicked()
{
m_ui->pbFire->setEnabled(false);
if ((m_aesItem.effectStateId() != AesEffectState_def::EsActivated &&
m_aesItem.effectStateId() != AesEffectState_def::EsPaused &&
m_aesItem.effectStateId() != AesEffectState_def::EsCreated &&
m_aesItem.effectStateId() != AesEffectState_def::EsPrepared)
if ((m_aesItem.effectStateId() != AesEffectState::EsActivated &&
m_aesItem.effectStateId() != AesEffectState::EsPaused &&
m_aesItem.effectStateId() != AesEffectState::EsCreated &&
m_aesItem.effectStateId() != AesEffectState::EsPrepared)
|| m_aesItem.id() <= 0)
return;
if (m_aesItem.effectStateId() == AesEffectState_def::EsCreated ||
m_aesItem.effectStateId() == AesEffectState_def::EsPrepared)
if (m_aesItem.effectStateId() == AesEffectState::EsCreated ||
m_aesItem.effectStateId() == AesEffectState::EsPrepared)
{
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + 3000);
m_ui->dteEffectStart->setChecked(true);
@@ -836,7 +836,7 @@ void ExplosionEdit::onFireClicked()
m_requestHelper->addRequest([ = ]()
{
return m_ftc->explosionAreaPauseResumeRequest(ExplosionAreaPauseResumeRequest(m_aesItem.id(),
m_aesItem.effectStateId() != AesEffectState_def::EsActivated,
m_aesItem.effectStateId() != AesEffectState::EsActivated,
dds::core::optional<rti::core::int64>(),
dds::core::optional<int32_t>(),
dds::core::optional<int32_t>())
@@ -326,9 +326,9 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowExplosionClusterListDialog(QWidget *
ExplosionList *listWidget;
listWidget = new ExplosionClusterList(menuGroup(),
{ProjectDataManagement::GearClass_def::Artillery,
ProjectDataManagement::GearClass_def::Mortar,
ProjectDataManagement::GearClass_def::Rocket},
{ProjectDataManagement::GearClass::Artillery,
ProjectDataManagement::GearClass::Mortar,
ProjectDataManagement::GearClass::Rocket},
parent);
if (listWidget->init(m_session))
@@ -288,7 +288,7 @@ void ExplosionAreaList::createModel()
ExplosionClusterList::ExplosionClusterList(const QString &menuGroup, const QVector<ProjectDataManagement::GearClass> &gcs, QWidget *parent)
: ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass_def::Artillery, parent), m_model(nullptr), m_gearClasses(gcs)
: ExplosionList(menuGroup, etExplosionCluster, ProjectDataManagement::GearClass::Artillery, parent), m_model(nullptr), m_gearClasses(gcs)
{
}
@@ -63,7 +63,7 @@ static int s_timeUntilMinimumSec = 10;
static const char *const VALUE_VALID_PROPERTY_NAME = "VALUE_VALID";
static const char *const LAST_VALUE = "LAST_VALUE";
static const int s_laserPrecisionChargeTypeId = 376;
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId)
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
@@ -81,8 +81,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
static QHash<int, QPair<int, int>> contraintsDistance;
if (contraintsDistance.isEmpty())
{
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000});
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800});
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000});
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800});
}
@@ -90,8 +90,8 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
if (contraintsDistanceVulcano.isEmpty())
{
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000});
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000});
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000});
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000});
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -107,10 +107,10 @@ QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gea
return {0, 100000};
return *it;
}
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; }
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).second; }
int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).first; }
int getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxDistance(gearClass, chargeTypeId).second; }
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
@@ -121,15 +121,15 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inn
static QHash<int, QPair<int, int>> contraintsFlightDuration;
if (contraintsFlightDuration.isEmpty())
{
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150});
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60});
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150});
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60});
}
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
if (contraintsFlightDurationVulcano.isEmpty())
{
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999});
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999});
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999});
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999});
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -145,16 +145,16 @@ QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inn
return {10, 100};
return *it;
}
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first;
}
int getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second;
}
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
@@ -165,15 +165,15 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum
static QHash<int, QPair<int, int>> contraintsPeak;
if (contraintsPeak.isEmpty())
{
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000});
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000});
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000});
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000});
}
static QHash<int, QPair<int, int>> contraintsPeakVulcano;
if (contraintsPeakVulcano.isEmpty())
{
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500});
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500});
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500});
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500});
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -190,8 +190,8 @@ QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum
return {100, 10000};
return *it;
}
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; }
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).second; }
int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).first; }
int getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId) { return getMinMaxPeakHeight(gearClass, chargeTypeId).second; }
@@ -241,11 +241,11 @@ ExplosionsEdit::ExplosionsEdit(const QString &menuGroup, QWidget *parent)
s_dropAngleUp = 70;
m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar};
@@ -416,8 +416,8 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
}
m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
m_explosionClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
@@ -469,7 +469,7 @@ bool ExplosionsEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
m_explosionClusterData.id(m_aesItem.id());
m_explosionClusterData.effectStateId(m_aesItem.effectStateId());
}
@@ -530,22 +530,22 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
m_ui->dteEffectStart->setMsecsSinceEpoch(ecData.effectStart().is_set() ? ecData.effectStart().get() : 0);
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType)
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true);
break;
default:
@@ -614,7 +614,7 @@ void ExplosionsEdit::setExplosionClusterData(const ExplosionCluster &ecData)
setCoord(centerpoint);
}
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2);
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
@@ -696,11 +696,11 @@ void ExplosionsEdit::onChargeTypeChanged()
phfd = FlighDurationOrPeakHeight::FDPH_flightDuration;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
{
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
const double impactRadius = m_pdmDtc->impactRadius(chargeTypeId, igniterTypeId, 0);
@@ -792,7 +792,7 @@ void ExplosionsEdit::getPosition()
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{
const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0);
const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -815,17 +815,17 @@ void ExplosionsEdit::getPosition()
return;
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
return;
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_sitMapGuiIfc->getCircle(this,
SLOT(onCircleData(QPointF, double)),
nullptr,
@@ -1024,7 +1024,7 @@ void ExplosionsEdit::onDropAngleChanged() { doCalculations(true); }
void ExplosionsEdit::onWidthChanged(int width)
{
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{
m_ui->sbDimensionY_Tiefe->setValue(width);
@@ -1123,7 +1123,7 @@ void ExplosionsEdit::onFlightDurationChanged(int data)
void ExplosionsEdit::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QDateTime::fromSecsSinceEpoch(value).toString(QStringLiteral("mm:ss"))); }
void ExplosionsEdit::setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId)
void ExplosionsEdit::setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
DEBUG_LOG(m_logger) << " setMinMaxConstraints START";
@@ -1176,7 +1176,7 @@ bool ExplosionsEdit::setValueAccordingContraints(int newValue, ExplosionsEdit::F
bool bRet = false;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
const ProjectDataManagement::GearClass::type gearClass = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
const ProjectDataManagement::GearClass gearClass = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
switch (phfd)
@@ -1242,7 +1242,7 @@ void ExplosionsEdit::switchTo(FlighDurationOrPeakHeight phfd)
}
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
}
@@ -1273,7 +1273,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
return;
if ((m_explosionClusterData.effectStateId() == AesEffectState_def::EsPaused) || (m_explosionClusterData.effectStateId() == AesEffectState_def::EsExpired))
if ((m_explosionClusterData.effectStateId() == AesEffectState::EsPaused) || (m_explosionClusterData.effectStateId() == AesEffectState::EsExpired))
return;
DoCalculationsExitGuard exitGuard(this, executeEnableUiElements);
@@ -1519,7 +1519,7 @@ void ExplosionsEdit::doCalculations(bool executeEnableUiElements)
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
@@ -1670,10 +1670,10 @@ void ExplosionsEdit::handleLaserPrecisionChargeType(const int chargeTypeId)
const auto geoButtons = m_geometrieButtonGroup->buttons();
if (chargeTypeId == s_laserPrecisionChargeTypeId)
{
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
for (QAbstractButton *btn : geoButtons)
{
if (m_geometrieButtonGroup->id(btn) != static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint))
if (m_geometrieButtonGroup->id(btn) != static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint))
btn->setCheckable(false);
}
}
@@ -1767,15 +1767,15 @@ void ExplosionsEdit::enableUiElements(bool enable)
m_ui->pbPosition->setEnabled(m_sitMapGuiIfc && enable);
m_ui->positionEdit->setEnabled(enable);
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
m_ui->sbHeight1SBox->setEnabled(enable);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine);
m_ui->sbAimingAxis->setEnabled(
enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->cbFirePurpose->setEnabled(enable);
m_ui->cbGearClass->setEnabled(enable);
m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked());
@@ -1792,8 +1792,8 @@ void ExplosionsEdit::enableUiElements(bool enable)
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated);
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->pbClear->setEnabled(enable);
@@ -1879,7 +1879,7 @@ void ExplosionsEdit::enableUiFireButton()
if (!enableBasics)
return;
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired)
if (m_explosionClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired)
return;
int numberTrajectoriesRef = 0;
@@ -1927,7 +1927,7 @@ void ExplosionsEdit::enableUiFireButton()
else
{
if (m_explosionClusterData.effectStateId() == AesEffectState_def::EsPaused)
if (m_explosionClusterData.effectStateId() == AesEffectState::EsPaused)
bPause = false;
}
}
@@ -1966,26 +1966,26 @@ void ExplosionsEdit::showPreviewObject()
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
if (m_previewPolygon.isEmpty())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull())
return;
@@ -2013,7 +2013,7 @@ bool ExplosionsEdit::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
break;
@@ -2054,7 +2054,7 @@ bool ExplosionsEdit::apply()
switch (m_currentGeometry.underlying())
{
case AesExplosionGeometry_def::EgRadial:
case AesExplosionGeometry::EgRadial:
{
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0));
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
@@ -2065,7 +2065,7 @@ bool ExplosionsEdit::apply()
break;
}
case AesExplosionGeometry_def::EgLine:
case AesExplosionGeometry::EgLine:
{
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
@@ -2081,9 +2081,9 @@ bool ExplosionsEdit::apply()
break;
}
case AesExplosionGeometry_def::EgAimPoint:
case AesExplosionGeometry_def::EgArea:
case AesExplosionGeometry_def::EgPoint:
case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::EgArea:
case AesExplosionGeometry::EgPoint:
default:
{
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -2118,7 +2118,7 @@ bool ExplosionsEdit::apply()
request.esmParticipantIds().push_back(esmParticipantId2);
}
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
request.area().rotation(0);
else
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
@@ -2223,7 +2223,7 @@ bool ExplosionsEdit::apply()
void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
{
const AreaEffectSimulation::AesExplosionGeometry::inner_enum newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry::inner_enum>(explosionGeometryInt);
const AreaEffectSimulation::AesExplosionGeometry newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry>(explosionGeometryInt);
if (m_currentGeometry == newGeometry)
return;
@@ -2249,8 +2249,8 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2275,7 +2275,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
onChargeTypeChanged();
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2296,7 +2296,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setSingleStep(60);
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(true);
@@ -2315,7 +2315,7 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setValue(60);
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
{
m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2351,10 +2351,10 @@ void ExplosionsEdit::onGeometrySelected(int explosionGeometryInt)
void ExplosionsEdit::onFireClicked()
{
TRACE_LOG(m_logger) << LOGFUNCTION << " START";
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) ||
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsFired)
if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) ||
(m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
|| (m_aesItem.effectStateId() == AesEffectState::EsFired)
)
|| m_aesItem.id() <= 0)
@@ -2375,7 +2375,7 @@ void ExplosionsEdit::onFireClicked()
const bool bIsObjectModifiable = m_explosionClusterData.isObjectModifiable();
if ((m_aesItem.effectStateId() == AesEffectState_def::EsCreated || m_aesItem.effectStateId() == AesEffectState_def::EsPrepared) && bIsObjectModifiable)
if ((m_aesItem.effectStateId() == AesEffectState::EsCreated || m_aesItem.effectStateId() == AesEffectState::EsPrepared) && bIsObjectModifiable)
{
m_ui->dteEffectStart->setMsecsSinceEpoch(m_session->partitionTime() + m_temporaryData.m_estimatedFlightDurationMsec + 5000);
m_ui->dteEffectStart->setChecked(true);
@@ -2433,7 +2433,7 @@ void ExplosionsEdit::onFireClicked()
void ExplosionsEdit::onGearClassChanged()
{
const ProjectDataManagement::GearClass_def::type newGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
const ProjectDataManagement::GearClass newGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
{
QSignalBlocker sb(m_ui->cbChargeType);
fillCharges();
@@ -2441,10 +2441,10 @@ void ExplosionsEdit::onGearClassChanged()
fillParties();
onPartyChanged();
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar;
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
if (!lastVal.isNull())
lastGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(lastVal.toInt());
lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
{
@@ -2584,7 +2584,7 @@ void ExplosionsEdit::fillCharges()
return;
}
const ProjectDataManagement::GearClass_def::type curGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
const ProjectDataManagement::GearClass curGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType);
const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
@@ -2609,7 +2609,7 @@ void ExplosionsEdit::fillCharges()
DEBUG_LOG(m_logger) << " fillCharges"
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano
<< ", impactRadius4Debug = " << impactRadius4Debug << ", isAdlerChargeType = " << isAdlerChargeType;
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass_def::Artillery))
if (isAdlerChargeType || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery))
continue;
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
}
@@ -111,7 +111,7 @@ private Q_SLOTS:
void onEffectDurationChanged(int value);
void switchTo(FlighDurationOrPeakHeight phfd);
void setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId);
void setMinMaxConstraints(ExplosionsEdit::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool setValueAccordingContraints(int newValue, ExplosionsEdit::FlighDurationOrPeakHeight phfd);
bool isGuiVulcano();
@@ -88,11 +88,11 @@ ExplosionsEditAdler::ExplosionsEditAdler(const QString &menuGroup, QWidget *pare
m_ui->setupUi(this);
m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
@@ -220,20 +220,20 @@ void ExplosionsEditAdler::showPreviewObject()
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull())
return;
@@ -260,7 +260,7 @@ bool ExplosionsEditAdler::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->lblDimensionYDepth->text().toInt() > 0;
bHasTargetArea &= m_ui->lblWidthRadius->text().toInt() > 0;
break;
@@ -290,7 +290,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
if (ecData.effectStart().is_set())
{
const QJsonObject propsObj(QJsonDocument::fromJson(QByteArray::fromStdString(ecData.properties())).object());
const FiringType firingType = static_cast<FiringType::inner_enum>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
const FiringType firingType = static_cast<FiringType>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
effectStart = ecData.effectStart().get();
@@ -301,22 +301,22 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
m_ui->dteEffectStart->setMsecsSinceEpoch(effectStart);
// Geometry/Area
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType)
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true);
break;
default:
@@ -380,7 +380,7 @@ void ExplosionsEditAdler::setEffectClusterData(const EffectCluster &ecData)
m_esmActorCbx->fillActorComboBox(m_ui->cbActors_2, coordGeo, isSmoke, 0);
}
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{
m_ui->lblDimensionYDepth->setText(QString::number(static_cast<int>(std::round(areaRef.height() / 2))));
m_ui->lblWidthRadius->setText(QString::number(static_cast<int>(std::round(areaRef.width() / 2))));
@@ -556,7 +556,7 @@ void ExplosionsEditAdler::enableUiElements(bool enable)
m_ui->rbAngleGroupLower->setEnabled(enable);
m_ui->rbAngleGroupUpper->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
m_ui->pbStateChange->setEnabled(true);
else
m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire);
@@ -600,7 +600,7 @@ void ExplosionsEditAdler::setPbStateChangeName()
m_ui->pbStateChange->show();
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
m_ui->pbStateChange->setText(tr("Acknowledge"));
else
{
@@ -624,7 +624,7 @@ void ExplosionsEditAdler::onPbStateChangeClicked()
// Re-Enable PB, so we can call it another time, if it does not react...
QTimer::singleShot(2000, [this]() { m_ui->pbStateChange->setEnabled(m_effectClusterData.effectorState() != AreaEffectSimulation::AesEffectorState::EsReadyToFire); });
if (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
if (m_aesItem.effectStateId() == AesEffectState::EsReceived)
{
AreaEffectSimulation::AcknowledgeExternalAesItemRequest request;
request.aesId(m_aesItem.id());
@@ -758,7 +758,7 @@ void ExplosionsEditAdler::setEffectClusterDataFromJson(const std::string &proper
else
m_ui->rbAngleGroupUpper->setChecked(true);
const FiringType &firingType = static_cast<FiringType::inner_enum>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
const FiringType &firingType = static_cast<FiringType>(propsObj[AdlerJson::JsonKeys::ABFEUERUNGSART()].toInt());
m_ui->lblFiringType->setText(AreaEffectSimulation::toString(firingType));
}
@@ -67,7 +67,7 @@ static const char *const LAST_VALUE = "LAST_VALUE";
static QLatin1String emptyEntryComboBox = QLatin1String("--");
static const int ROLE_GEARTYPE_ID = Qt::UserRole + 1;
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId)
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
// [GUEZE-2458] Minimaler und maximaler Abstand Feuereinheit Wirkeld Steilfeuer
// Es soll zwischen dem Mittelpunkt der Feuereinheit und dem Mittelpunkt des zu bewirkenden Wirkfeldes folgender Abstand als Mindestabstand:
@@ -85,17 +85,17 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataMana
static QHash<int, QPair<int, int>> contraintsDistance;
if (contraintsDistance.isEmpty())
{
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {3500, 40000}); // Haubitze
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {800, 7800}); // Mörser
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {15000, 90000}); // Rakete
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {10000, 38400}); // Minenrakete
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {3500, 40000}); // Haubitze
contraintsDistance.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {800, 7800}); // Mörser
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {15000, 90000}); // Rakete
// contraints.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {10000, 38400}); // Minenrakete
}
static QHash<int, QPair<int, int>> contraintsDistanceVulcano;
if (contraintsDistanceVulcano.isEmpty())
{
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {10000, 70000}); // Haubitze
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {10000, 70000}); // Rakete
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {10000, 70000}); // Haubitze
contraintsDistanceVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {10000, 70000}); // Rakete
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -111,16 +111,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxDistance(ProjectDataMana
return {0, 100000};
return *it;
}
int ExplosionsEditAdlerStandAlone::getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxDistance(gearClass, chargeTypeId).first;
}
int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxDistance(gearClass, chargeTypeId).second;
}
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
// [GUEZE-2460] Grenzwert Flugdauer Steilfeuer
// Haubitze: von 6 bis 150 Sekunden
@@ -131,15 +131,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
static QHash<int, QPair<int, int>> contraintsFlightDuration;
if (contraintsFlightDuration.isEmpty())
{
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {6, 150}); // Haubitze
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {20, 60}); // Mörser
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {6, 150}); // Haubitze
contraintsFlightDuration.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {20, 60}); // Mörser
}
static QHash<int, QPair<int, int>> contraintsFlightDurationVulcano;
if (contraintsFlightDurationVulcano.isEmpty())
{
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {0, 999}); // Haubitze
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {0, 999}); // Rakete
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {0, 999}); // Haubitze
contraintsFlightDurationVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {0, 999}); // Rakete
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -155,16 +155,16 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxFlightDurationSec(Projec
return {10, 100};
return *it;
}
int ExplosionsEditAdlerStandAlone::getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).first;
}
int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxFlightDurationSec(gearClass, chargeTypeId).second;
}
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
// [GUEZE-2460] Grenzwert Flugdauer Steilfeuer
// Haubitze: von 250 bis 15000m
@@ -175,15 +175,15 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
static QHash<int, QPair<int, int>> contraintsPeak;
if (contraintsPeak.isEmpty())
{
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {250, 15000}); // Haubitze
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Mortar), {500, 3000}); // Mörser
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {250, 15000}); // Haubitze
contraintsPeak.insert(static_cast<int>(ProjectDataManagement::GearClass::Mortar), {500, 3000}); // Mörser
}
static QHash<int, QPair<int, int>> contraintsPeakVulcano;
if (contraintsPeakVulcano.isEmpty())
{
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Artillery), {1000, 37500}); // Haubitze
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass_def::Rocket), {1000, 37500}); // Rakete
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Artillery), {1000, 37500}); // Haubitze
contraintsPeakVulcano.insert(static_cast<int>(ProjectDataManagement::GearClass::Rocket), {1000, 37500}); // Rakete
}
if (chargeTypeIdIsVulcano(chargeTypeId))
{
@@ -200,19 +200,19 @@ QPair<int, int> ExplosionsEditAdlerStandAlone::getMinMaxPeakHeight(ProjectDataMa
return {100, 10000};
return *it;
}
int ExplosionsEditAdlerStandAlone::getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxPeakHeight(gearClass, chargeTypeId).first;
}
int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId)
int ExplosionsEditAdlerStandAlone::getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId)
{
return getMinMaxPeakHeight(gearClass, chargeTypeId).second;
}
bool ExplosionsEditAdlerStandAlone::isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry)
{
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint)
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint);
return (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgAimPoint)
|| (geometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint);
}
/*!
@@ -270,11 +270,11 @@ ExplosionsEditAdlerStandAlone::ExplosionsEditAdlerStandAlone(const QString &menu
headline->setAlignment(Qt::AlignCenter);
m_geometrieButtonGroup = new QButtonGroup(this);
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgRadial));
m_geometrieButtonGroup->addButton(m_ui->geometrieAimPointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgAimPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieAreaBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
m_geometrieButtonGroup->addButton(m_ui->geometrieLineBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_geometrieButtonGroup->addButton(m_ui->geometriePointBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgPoint));
m_geometrieButtonGroup->addButton(m_ui->geometrieRadialBtn, static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgRadial));
m_geometrieButtonGroup->setExclusive(true);
m_gearClassFilter = {ProjectDataManagement::GearClass::Artillery, ProjectDataManagement::GearClass::Mortar};
@@ -506,8 +506,8 @@ bool ExplosionsEditAdlerStandAlone::init(int aesItemId, bool copy, LtsSession::L
m_ui->startBtn->setEnabled(false);
// initial adjustment:
m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry_def::EgArea));
m_effectClusterData.explosionGeometry(AreaEffectSimulation::AesExplosionGeometry::EgArea);
onGeometrySelected(static_cast<int>(AreaEffectSimulation::AesExplosionGeometry::EgArea));
// pay attention!!! firePurposeId vs purpose !!!
m_pdmCbx->fillFirePurposeComboBox(m_ui->cbFirePurpose);
@@ -569,7 +569,7 @@ bool ExplosionsEditAdlerStandAlone::init(int aesItemId, bool copy, LtsSession::L
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
m_effectClusterData.id(m_aesItem.id());
m_effectClusterData.effectStateId(m_aesItem.effectStateId());
}
@@ -624,22 +624,22 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
m_ui->leElement->setText(QString::fromStdString(ecData.element()));
// Geometry/Area
const AreaEffectSimulation::AesExplosionGeometry_def::type geometryType = ecData.explosionGeometry().underlying();
const AreaEffectSimulation::AesExplosionGeometry geometryType = static_cast<AreaEffectSimulation::AesExplosionGeometry>(ecData.explosionGeometry());
switch (geometryType)
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
m_ui->geometrieAimPointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_ui->geometriePointBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
m_ui->geometrieAreaBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_ui->geometrieLineBtn->setChecked(true);
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_ui->geometrieRadialBtn->setChecked(true);
break;
default:
@@ -709,7 +709,7 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
// with firingType
setEffectClusterDataFromJson(ecData.properties());
const FiringType::type firingType = static_cast<FiringType::type>(m_ui->cbFiringType->currentData().toInt());
const FiringType firingType = static_cast<FiringType>(m_ui->cbFiringType->currentData().toInt());
if (firingType == FiringType::FireWithIndicationTTF)
{
// in case of TTF the dte will be set via the setEffectClusterDataFromJson function
@@ -732,7 +732,7 @@ void ExplosionsEditAdlerStandAlone::setEffectClusterData(const EffectCluster &ec
setCoord(centerpoint);
}
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (ecData.explosionGeometry().underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{
m_ui->sbDimensionY_Tiefe->setValue(areaRef.height() / 2);
m_ui->sbDimensionX_BreiteRadius->setValue(areaRef.width() / 2);
@@ -793,11 +793,11 @@ void ExplosionsEditAdlerStandAlone::onChargeTypeChanged()
FlighDurationOrPeakHeight phfd = FlighDurationOrPeakHeight::FDPH_peakHeight;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
// only for geometryType::Point:
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgPoint)
if (m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgPoint)
{
int igniterTypeId = m_ui->cbIgniterType->currentData().toInt();
int igniterFunctionId = m_ui->cbIgniterFunction->currentData().toInt();
@@ -915,7 +915,7 @@ void ExplosionsEditAdlerStandAlone::getPosition()
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{
const bool isNull = qFuzzyCompare(m_coord.x(), 0) && qFuzzyCompare(m_coord.y(), 0);
const QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -938,16 +938,16 @@ void ExplosionsEditAdlerStandAlone::getPosition()
return;
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
m_sitMapGuiIfc->getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{
m_sitMapGuiIfc->getPolyline(this, SLOT(onPolylineData(QPolygonF)), nullptr, 2, 2, -1, -1, getCoordinatesQPointF());
return;
}
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
m_sitMapGuiIfc->getCircle(this,
SLOT(onCircleData(QPointF, double)),
nullptr,
@@ -1184,7 +1184,7 @@ void ExplosionsEditAdlerStandAlone::onFlightDurationChanged(int data)
void ExplosionsEditAdlerStandAlone::onEffectDurationChanged(int value) { m_ui->sbDurationSec->setToolTip(QTime(0, 0).addSecs(value).toString(QStringLiteral("mm:ss"))); }
void ExplosionsEditAdlerStandAlone::setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd,
ProjectDataManagement::GearClass_def::type gearClass,
ProjectDataManagement::GearClass gearClass,
int chargeTypeId)
{
DEBUG_LOG(m_logger) << " setMinMaxConstraints START";
@@ -1218,7 +1218,7 @@ bool ExplosionsEditAdlerStandAlone::setValueAccordingContraints(int newValue, Ex
bool bRet = false;
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
const ProjectDataManagement::GearClass::type gearClass = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
const ProjectDataManagement::GearClass gearClass = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
switch (phfd)
@@ -1269,7 +1269,7 @@ void ExplosionsEditAdlerStandAlone::switchTo(FlighDurationOrPeakHeight phfd)
}
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
setMinMaxConstraints(phfd, gearClassType, chargeTypeId);
}
@@ -1304,7 +1304,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
return;
// do not update while EsPause or similar:
if ((m_effectClusterData.effectStateId() == AesEffectState_def::EsPaused) || (m_effectClusterData.effectStateId() == AesEffectState_def::EsExpired))
if ((m_effectClusterData.effectStateId() == AesEffectState::EsPaused) || (m_effectClusterData.effectStateId() == AesEffectState::EsExpired))
return;
doCalculationsAdlerStandAloneExitGuard exitGuard(this, executeEnableUiElements);
@@ -1506,7 +1506,7 @@ void ExplosionsEditAdlerStandAlone::doCalculationsAdlerStandAlone(bool executeEn
//
const qint32 gearClassId = m_ui->cbGearClass->currentData().toInt();
ProjectDataManagement::GearClass::type gearClassType = static_cast<ProjectDataManagement::GearClass::type>(gearClassId);
ProjectDataManagement::GearClass gearClassType = static_cast<ProjectDataManagement::GearClass>(gearClassId);
const qint32 chargeTypeId = m_ui->cbChargeType->currentData().toInt();
@@ -1784,7 +1784,7 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->cbParticipantUnits->setEnabled(enable);
setEffectStartEnabled(m_ui->dteEffectStart, enable);
const AreaEffectSimulation::FiringType::type firingType = static_cast<AreaEffectSimulation::FiringType::type>(m_ui->cbFiringType->currentData().toInt());
const AreaEffectSimulation::FiringType firingType = static_cast<AreaEffectSimulation::FiringType>(m_ui->cbFiringType->currentData().toInt());
const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT);
m_ui->dteEffectStart->setChecked(true);
m_ui->dteEffectStart->setEnabled(showEffectStart);
@@ -1795,15 +1795,15 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->positionEdit->setEnabled(enable);
// m_ui->sbAltitude->setEnabled(enable);
m_ui->sbDimensionX_BreiteRadius->setEnabled(enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea);
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial
|| m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->sbDimensionY_Tiefe->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea);
m_ui->sbHeight1SBox->setEnabled(enable);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine);
m_ui->sbHeight2SBox->setEnabled(enable && m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine);
m_ui->sbAimingAxis->setEnabled(
enable
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgLine));
&& (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgArea || m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgLine));
m_ui->cbFirePurpose->setEnabled(enable);
m_ui->cbGearClass->setEnabled(enable);
m_ui->cbActors->setEnabled(enable & m_ui->gbEffectMarkingInTa->isChecked());
@@ -1837,7 +1837,7 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
m_ui->cbTargetSubType->setEnabled(enable);
m_ui->cbFiringType->setEnabled(enable);
const bool isRocket = (m_ui->cbGearClass->currentData().toInt() == ProjectDataManagement::GearClass_def::Rocket);
const bool isRocket = (m_ui->cbGearClass->currentData().toInt() == ProjectDataManagement::GearClass::Rocket);
m_ui->lblLoadType->setEnabled(!isRocket && enable);
m_ui->lblLoadNumber->setEnabled(!isRocket && enable);
m_ui->cbLoadType->setEnabled(!isRocket && enable);
@@ -1856,8 +1856,8 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
// [GUEZE-2960] Explizite Kunden-Forderung:
// ZpNumber nicht_ mehr modifizierbar, wenn Wirkfeld aktiv
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState_def::EsActivated);
m_ui->leZpNumber->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->leElement->setEnabled((enable || isOnlyNameModifiable()) && m_aesItem.effectStateId() != AesEffectState::EsActivated);
m_ui->pbClear->setEnabled(enable);
@@ -1901,14 +1901,14 @@ void ExplosionsEditAdlerStandAlone::enableUiElements(bool enable)
// // Munitionstyp "Mörser" muss die obere Winkelgruppe ausgewählt && die Eingabemaske "Flugkurve" soll ausgrauen.
// // Beim Wechsel auf einen anderen Munitionstyp soll wieder als Default die untere Winkelgruppe ausgewählt werden &&
// // die Eingabemaske muss wieder auswählbar sein.
// const ProjectDataManagement::GearClass_def::type gearClassType =
// static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
// const ProjectDataManagement::GearClass gearClassType =
// static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
// // const bool usePeakHeight = m_ui->sBox_peakHeight->styleSheet().isEmpty();
// const bool useFlightDuration = m_ui->sBox_flightDuration->styleSheet().isEmpty();
// m_ui->cbFlightCurve->setEnabled(enable &&
// (gearClassType != ProjectDataManagement::GearClass_def::Mortar) &&
// (gearClassType != ProjectDataManagement::GearClass::Mortar) &&
// useFlightDuration
// );
// }
@@ -1943,7 +1943,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
if (!enableBasics)
return; // stay disabled
if (m_effectClusterData.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired || m_effectClusterData.remainExplosionNumber() == 0)
if (m_effectClusterData.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired || m_effectClusterData.remainExplosionNumber() == 0)
return; // stay disabled
int numberTrajectoriesRef = 0;
@@ -2000,7 +2000,7 @@ void ExplosionsEditAdlerStandAlone::enableUiFireButton()
else
{
// re-openening dialog:
if (m_effectClusterData.effectStateId() == AesEffectState_def::EsPaused)
if (m_effectClusterData.effectStateId() == AesEffectState::EsPaused)
bPause = false;
}
}
@@ -2040,24 +2040,24 @@ void ExplosionsEditAdlerStandAlone::showPreviewObject()
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
if (m_previewPolygon.isEmpty())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
if (m_previewCircleCenter.isNull())
return;
m_sitMapGuiIfc->displayPreviewObject(this, m_previewCircleCenter, m_previewCircleRadius);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, false);
return;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
if (m_previewCircleCenter.isNull())
return;
@@ -2085,7 +2085,7 @@ bool ExplosionsEditAdlerStandAlone::isDataSufficiant()
bool bHasTargetArea = !m_coord.isNull();
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
bHasTargetArea &= m_ui->sbDimensionX_BreiteRadius->value() > 0;
bHasTargetArea &= m_ui->sbDimensionY_Tiefe->value() > 0;
break;
@@ -2136,7 +2136,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
switch (m_currentGeometry.underlying())
{
case AesExplosionGeometry_def::EgRadial:
case AesExplosionGeometry::EgRadial:
{
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord, m_ui->sbDimensionX_BreiteRadius->value() * 2, m_ui->sbDimensionY_Tiefe->value() * 2, 0.0));
bottomLeftGeo = Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y());
@@ -2147,7 +2147,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
break;
}
case AesExplosionGeometry_def::EgLine:
case AesExplosionGeometry::EgLine:
{
const QLineF line(m_ui->positionEdit->coordinate(), m_ui->positionEdit_2->coordinate());
@@ -2163,9 +2163,9 @@ bool ExplosionsEditAdlerStandAlone::apply()
break;
}
case AesExplosionGeometry_def::EgAimPoint:
case AesExplosionGeometry_def::EgArea:
case AesExplosionGeometry_def::EgPoint:
case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::EgArea:
case AesExplosionGeometry::EgPoint:
default:
{
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_coord,
@@ -2180,7 +2180,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
}
}
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (bIsPoint || m_currentGeometry.underlying() == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
request.area().rotation(0);
else
request.area().rotation((m_ui->sbAimingAxis->value() - 1600) * 360.0 / 6400);
@@ -2308,7 +2308,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
// Rocket-Spezifika:
const QVariant currentData = m_ui->cbGearClass->currentData();
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt());
const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{
RocketUtility::addRocketPropertiesToRequest(request, m_ppmDtc);
@@ -2327,7 +2327,7 @@ bool ExplosionsEditAdlerStandAlone::apply()
*/
void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
{
const AreaEffectSimulation::AesExplosionGeometry::inner_enum newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry::inner_enum>(explosionGeometryInt);
const AreaEffectSimulation::AesExplosionGeometry newGeometry = static_cast<AreaEffectSimulation::AesExplosionGeometry>(explosionGeometryInt);
if (m_currentGeometry == newGeometry)
return;
@@ -2353,8 +2353,8 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
switch (m_currentGeometry.underlying())
{
case AreaEffectSimulation::AesExplosionGeometry_def::EgAimPoint: // What is AimPoint?
case AreaEffectSimulation::AesExplosionGeometry_def::EgPoint:
case AreaEffectSimulation::AesExplosionGeometry::EgAimPoint: // What is AimPoint?
case AreaEffectSimulation::AesExplosionGeometry::EgPoint:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2386,7 +2386,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
onChargeTypeChanged();
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgArea:
case AreaEffectSimulation::AesExplosionGeometry::EgArea:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2412,7 +2412,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setSingleStep(60);
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgLine:
case AreaEffectSimulation::AesExplosionGeometry::EgLine:
{
m_ui->lblRadiusBreite->setText(tr("Breite [m]"));
m_ui->sbHeight2SBox->setEnabled(true);
@@ -2437,7 +2437,7 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
m_ui->sbDurationSec->setValue(60); // 1 min
}
break;
case AreaEffectSimulation::AesExplosionGeometry_def::EgRadial:
case AreaEffectSimulation::AesExplosionGeometry::EgRadial:
{
m_ui->lblRadiusBreite->setText(tr("Radius [m]"));
m_ui->sbHeight2SBox->setEnabled(false);
@@ -2473,10 +2473,10 @@ void ExplosionsEditAdlerStandAlone::onGeometrySelected(int explosionGeometryInt)
void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
{
DEBUG_LOG(m_logger) << " onFireClicked";
if (((m_aesItem.effectStateId() == AesEffectState_def::EsUnknown) || // initially the effectStateId is Unknown...
(m_aesItem.effectStateId() == AesEffectState_def::EsError) || (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState_def::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState_def::EsReceived)
// || (m_aesItem.effectStateId() == AesEffectState_def::EsPaused) // Maybe EsPaused will be supported in future
if (((m_aesItem.effectStateId() == AesEffectState::EsUnknown) || // initially the effectStateId is Unknown...
(m_aesItem.effectStateId() == AesEffectState::EsError) || (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|| (m_aesItem.effectStateId() == AesEffectState::EsRemoved) || (m_aesItem.effectStateId() == AesEffectState::EsReceived)
// || (m_aesItem.effectStateId() == AesEffectState::EsPaused) // Maybe EsPaused will be supported in future
)
|| m_aesItem.id() <= 0)
return;
@@ -2498,7 +2498,7 @@ void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
//
if ((m_aesItem.effectStateId() == AesEffectState_def::EsCreated || m_aesItem.effectStateId() == AesEffectState_def::EsPrepared) && bIsObjectModifiable)
if ((m_aesItem.effectStateId() == AesEffectState::EsCreated || m_aesItem.effectStateId() == AesEffectState::EsPrepared) && bIsObjectModifiable)
{
ERROR_LOG(m_logger) << LOGFUNCTION << " onFireClicked 2 " << m_data;
@@ -2564,7 +2564,7 @@ void ExplosionsEditAdlerStandAlone::onStartBtnClicked()
*/
void ExplosionsEditAdlerStandAlone::onGearClassChanged()
{
const ProjectDataManagement::GearClass_def::type newGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
const ProjectDataManagement::GearClass newGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
{
QSignalBlocker sb(m_ui->cbChargeType);
fillCharges();
@@ -2572,10 +2572,10 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
fillParties();
onPartyChanged();
ProjectDataManagement::GearClass_def::type lastGearClassType = ProjectDataManagement::GearClass_def::Mortar;
ProjectDataManagement::GearClass lastGearClassType = ProjectDataManagement::GearClass::Mortar;
QVariant lastVal = m_ui->cbGearClass->property(LAST_VALUE);
if (!lastVal.isNull())
lastGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(lastVal.toInt());
lastGearClassType = static_cast<ProjectDataManagement::GearClass>(lastVal.toInt());
{
// GUEZE-2459
@@ -2586,7 +2586,7 @@ void ExplosionsEditAdlerStandAlone::onGearClassChanged()
// Default is Upper
m_ui->rbAngleGroupUpper->setChecked(true);
// GUEZE-3520: Aufraeumen -> getm rid of AesFlightCurve
if (newGearClassType == ProjectDataManagement::GearClass_def::Mortar)
if (newGearClassType == ProjectDataManagement::GearClass::Mortar)
{
DEBUG_LOG(m_logger) << " onGearClassChanged switch to Mortar";
m_ui->rbAngleGroupLower->setCheckable(false);
@@ -2711,7 +2711,7 @@ bool ExplosionsEditAdlerStandAlone::isValidParty(qint32 partyId)
void ExplosionsEditAdlerStandAlone::setFireBtnState()
{
const AreaEffectSimulation::FiringType::type firingType = static_cast<AreaEffectSimulation::FiringType::type>(m_ui->cbFiringType->currentData().toInt());
const AreaEffectSimulation::FiringType firingType = static_cast<AreaEffectSimulation::FiringType>(m_ui->cbFiringType->currentData().toInt());
const bool showEffectStart = (firingType == FiringType::FireWithIndicationTTF || firingType == FiringType::FireWithIndicationTOT);
m_ui->dteEffectStart->setEnabled(showEffectStart);
m_ui->dteEffectStart->setVisible(showEffectStart);
@@ -2793,7 +2793,7 @@ double ExplosionsEditAdlerStandAlone::getElevation(const double lon, const doubl
void ExplosionsEditAdlerStandAlone::onWidthChanged(int width)
{
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry_def::EgRadial)
if (m_currentGeometry == AreaEffectSimulation::AesExplosionGeometry::EgRadial)
{
m_ui->sbDimensionY_Tiefe->setValue(width);
@@ -2891,7 +2891,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
return;
}
const ProjectDataManagement::GearClass_def::type curGearClassType = static_cast<ProjectDataManagement::GearClass_def::type>(m_ui->cbGearClass->currentData().toInt());
const ProjectDataManagement::GearClass curGearClassType = static_cast<ProjectDataManagement::GearClass>(m_ui->cbGearClass->currentData().toInt());
const auto chargesForGearClass = m_pdmDtc->chargesForGearClass(curGearClassType);
const int curCtDataToRestore = m_ui->cbChargeType->currentData().toInt();
@@ -2916,7 +2916,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
DEBUG_LOG(m_logger) << " fillCharges"
<< ", id=" << chargeType.id() << ", name= " << chargeType.name() << ", bIsPoint " << bIsPoint << ", bIsVulcano " << bIsVulcano;
if (adlerChargeTypeName.isEmpty() || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass_def::Artillery)) // [Jira E01562-21]
if (adlerChargeTypeName.isEmpty() || (bIsVulcano && !bIsPoint && curGearClassType != ProjectDataManagement::GearClass::Artillery)) // [Jira E01562-21]
continue;
m_ui->cbChargeType->addItem(QString::fromStdString(chargeType.name()), chargeType.id());
}
@@ -2934,7 +2934,7 @@ void ExplosionsEditAdlerStandAlone::fillCharges()
void ExplosionsEditAdlerStandAlone::fillFiringTypCbox()
{
QVector<AreaEffectSimulation::FiringType::type> firetypes{FiringType::ReportReadyToFire,
QVector<AreaEffectSimulation::FiringType> firetypes{FiringType::ReportReadyToFire,
FiringType::FireWithIndicationTOT,
FiringType::FireWithIndicationTTF,
FiringType::FireOnCommand,
@@ -3047,7 +3047,7 @@ void ExplosionsEditAdlerStandAlone::mmiToJsonproperties(QJsonObject &data)
data[AdlerJson::JsonKeys::TYP()] = m_ui->cbTargetType->currentData().toInt();
data[AdlerJson::JsonKeys::SUB_TYP()] = m_ui->cbTargetSubType->currentData().toInt();
data[AdlerJson::JsonKeys::ABFEUERUNGSART()] = m_ui->cbFiringType->currentData().toInt();
const FiringType::type firingType = static_cast<FiringType::type>(m_ui->cbFiringType->currentData().toInt());
const FiringType firingType = static_cast<FiringType>(m_ui->cbFiringType->currentData().toInt());
if (firingType == FiringType::FireWithIndicationTTF && m_ui->dteEffectStart->isChecked())
data[AdlerJson::JsonKeys::ABFEUERUNGSZEIT()] = m_ui->dteEffectStart->msecsSinceEpoch() / 1000.0;
else
@@ -102,7 +102,7 @@ class ExplosionsEditAdlerStandAlone final
void onEffectDurationChanged(int value);
void switchTo(FlighDurationOrPeakHeight phfd);
void setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId);
void setMinMaxConstraints(ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd, ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool setValueAccordingContraints(int newValue, ExplosionsEditAdlerStandAlone::FlighDurationOrPeakHeight phfd);
bool isGuiVulcano();
@@ -148,15 +148,15 @@ class ExplosionsEditAdlerStandAlone final
bool isSmoke();
void updateActorComboBox(const Core::GeoPosition &coordGeo);
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass_def::type gearClass, int chargeTypeId);
int getMinDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
int getMaxDistance(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
int getMinFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
int getMaxFlightDurationSec(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
int getMinPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
int getMaxPeakHeight(ProjectDataManagement::GearClass::inner_enum gearClass, int chargeTypeId);
QPair<int, int> getMinMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxDistance(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
QPair<int, int> getMinMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxFlightDurationSec(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
QPair<int, int> getMinMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMinPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
int getMaxPeakHeight(ProjectDataManagement::GearClass gearClass, int chargeTypeId);
bool isPointSimilar(AreaEffectSimulation::AesExplosionGeometry geometry);
struct Charges
@@ -27,7 +27,7 @@ namespace AreaEffectSimulation
namespace RocketUtility
{
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type geometry)
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geometry)
{
if (wirkmittelCombobox == nullptr)
return;
@@ -39,13 +39,13 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
switch (geometry)
{
case AesExplosionGeometry::type::EgAimPoint:
case AesExplosionGeometry::type::EgPoint:
case AesExplosionGeometry::type::EgLine:
case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::EgPoint:
case AesExplosionGeometry::EgLine:
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter)
{
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt());
const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{
@@ -60,15 +60,15 @@ void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type
}
}
return;
case AesExplosionGeometry::type::EgRadial:
case AesExplosionGeometry::type::EgArea:
case AesExplosionGeometry::EgRadial:
case AesExplosionGeometry::EgArea:
{
const int currentIndex = wirkmittelCombobox->currentIndex();
for (int indexCounter = 0; indexCounter < wirkmittelCombobox->count(); ++indexCounter)
{
const QVariant currentData = wirkmittelCombobox->itemData(indexCounter);
const ProjectDataManagement::GearClass::type currentGearClass = static_cast<ProjectDataManagement::GearClass::type>(currentData.toInt());
const ProjectDataManagement::GearClass currentGearClass = static_cast<ProjectDataManagement::GearClass>(currentData.toInt());
if (currentGearClass == ProjectDataManagement::GearClass::Rocket)
{
@@ -100,15 +100,15 @@ void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std
{
switch (request.explosionGeometry().underlying())
{
case AesExplosionGeometry::type::EgAimPoint:
case AesExplosionGeometry::type::EgPoint:
case AesExplosionGeometry::EgAimPoint:
case AesExplosionGeometry::EgPoint:
addRocketPropertiesForPointGeometry(request, ppmDtc);
return;
case AesExplosionGeometry::type::EgLine:
case AesExplosionGeometry::EgLine:
addRocketPropertiesForLinearGeometry(request, ppmDtc);
return;
case AesExplosionGeometry::type::EgRadial:
case AesExplosionGeometry::type::EgArea:
case AesExplosionGeometry::EgRadial:
case AesExplosionGeometry::EgArea:
default:
return;
}
@@ -23,7 +23,7 @@ class EffectClusterModifyRequest;
namespace RocketUtility
{
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry::type geometry);
void enaDisaWirkmittel(QComboBox *wirkmittelCombobox, AesExplosionGeometry geometry);
void addRocketPropertiesToRequest(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
void addRocketPropertiesForPointGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
void addRocketPropertiesForLinearGeometry(EffectClusterModifyRequest &request, const std::shared_ptr<ParticipantManagement::Interface::Dtc> &ppmDtc);
@@ -163,7 +163,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
const FunctionalAreaType type = m_functionalAreaTypes.value(m_ui->cbFunctionalAreaType->currentData().toInt());
if (type.supplyMode() == AesOperatingMode_def::OmWaitingTime)
if (type.supplyMode() == AesOperatingMode::OmWaitingTime)
{
DEBUG_LOG(m_logger) << "SUPPLY-MODE";
m_ui->sbDecontaminationMinutes->setEnabled(false);
@@ -209,17 +209,17 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
m_ui->sbWidth->setEnabled(enable);
const bool deconAvailable = type.deconMode() != AesOperatingMode_def::OmNotAvailable;
const bool maintAvailable = type.maintMode() != AesOperatingMode_def::OmNotAvailable;
const bool medicAvailable = type.medicMode() != AesOperatingMode_def::OmNotAvailable;
const bool deconAvailable = type.deconMode() != AesOperatingMode::OmNotAvailable;
const bool maintAvailable = type.maintMode() != AesOperatingMode::OmNotAvailable;
const bool medicAvailable = type.medicMode() != AesOperatingMode::OmNotAvailable;
m_ui->cbDecontamination->setEnabled(enable && deconAvailable);
m_ui->cbMaintenance->setEnabled(enable && maintAvailable);
m_ui->cbMedical->setEnabled(enable && medicAvailable);
m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && deconAvailable);
m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && maintAvailable);
m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode_def::OmWaitingTime) && enable && medicAvailable);
m_ui->sbDecontaminationMinutes->setEnabled((m_ui->cbDecontamination->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && deconAvailable);
m_ui->sbMaintanenceMinutes->setEnabled((m_ui->cbMaintenance->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && maintAvailable);
m_ui->sbMedicalMinutes->setEnabled((m_ui->cbMedical->currentIndex() == AesOperatingMode::OmWaitingTime) && enable && medicAvailable);
m_ui->sbSupplyMinutes->setEnabled(false);
m_ui->sbSupplyMinutes->setValue(0);
m_ui->cbSupply->setCurrentIndex(0);
@@ -244,7 +244,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
m_ui->pbClearPointSymbol->setEnabled(isGenericFunctionalArea);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
@@ -252,7 +252,7 @@ void FunctionalAreaEdit::enableUiElements(bool enable)
setUnchangeable();
disableButtons(true);
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->functionalArea(m_aesItem.id());
@@ -327,7 +327,7 @@ void FunctionalAreaEdit::setData(const FunctionalArea &area, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(area.name()));
@@ -394,19 +394,19 @@ void FunctionalAreaEdit::fillCbx()
QString byOperator = tr("by operator");
QString bytimeout = tr("by wait time");
m_ui->cbDecontamination->addItem(unused, AesOperatingMode_def::OmNotUsed);
m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode_def::OmObserver);
m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
m_ui->cbDecontamination->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbDecontamination->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbDecontamination->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbMaintenance->addItem(unused, AesOperatingMode_def::OmNotUsed);
m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode_def::OmObserver);
m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
m_ui->cbMaintenance->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbMaintenance->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbMaintenance->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbMedical->addItem(unused, AesOperatingMode_def::OmNotUsed);
m_ui->cbMedical->addItem(byOperator, AesOperatingMode_def::OmObserver);
m_ui->cbMedical->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
m_ui->cbMedical->addItem(unused, AesOperatingMode::OmNotUsed);
m_ui->cbMedical->addItem(byOperator, AesOperatingMode::OmObserver);
m_ui->cbMedical->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
m_ui->cbSupply->addItem(bytimeout, AesOperatingMode_def::OmWaitingTime);
m_ui->cbSupply->addItem(bytimeout, AesOperatingMode::OmWaitingTime);
if (curIdxDeconCbx >= 0)
@@ -450,22 +450,22 @@ void FunctionalAreaEdit::onRectData(const QPointF &centerPoint, double width, do
void FunctionalAreaEdit::onCbxIdxDeconChanged()
{
m_ui->sbDecontaminationMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt());
m_ui->sbDecontaminationMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt());
}
void FunctionalAreaEdit::onCbxIdxMaintChanged()
{
m_ui->sbMaintanenceMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt());
m_ui->sbMaintanenceMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt());
}
void FunctionalAreaEdit::onCbxIdxMedicChanged()
{
m_ui->sbMedicalMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt());
m_ui->sbMedicalMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt());
}
void FunctionalAreaEdit::onCbxIdxSupplyChanged()
{
m_ui->sbSupplyMinutes->setEnabled(AesOperatingMode_def::OmWaitingTime == m_ui->cbSupply->currentData().toInt());
m_ui->sbSupplyMinutes->setEnabled(AesOperatingMode::OmWaitingTime == m_ui->cbSupply->currentData().toInt());
}
void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged()
@@ -488,9 +488,9 @@ void FunctionalAreaEdit::onCbxIdxFunctionalAreaTypeChanged()
m_ui->sbDecontaminationMinutes->setValue(type.deconTime());
m_ui->sbMaintanenceMinutes->setValue(type.maintTime());
m_ui->sbMedicalMinutes->setValue(type.medicTime());
m_ui->cbDecontamination->setCurrentIndex(m_ui->cbDecontamination->findData(type.deconMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.deconMode().underlying()));
m_ui->cbMaintenance->setCurrentIndex(m_ui->cbMaintenance->findData(type.maintMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.maintMode().underlying()));
m_ui->cbMedical->setCurrentIndex(m_ui->cbMedical->findData(type.medicMode() == AesOperatingMode_def::OmNotAvailable ? AesOperatingMode_def::OmNotUsed : type.medicMode().underlying()));
m_ui->cbDecontamination->setCurrentIndex(m_ui->cbDecontamination->findData(type.deconMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.deconMode().underlying()));
m_ui->cbMaintenance->setCurrentIndex(m_ui->cbMaintenance->findData(type.maintMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.maintMode().underlying()));
m_ui->cbMedical->setCurrentIndex(m_ui->cbMedical->findData(type.medicMode() == AesOperatingMode::OmNotAvailable ? AesOperatingMode::OmNotUsed : type.medicMode().underlying()));
}
}
enableUiElements(true);
@@ -613,32 +613,32 @@ bool FunctionalAreaEdit::apply()
int functionalAreaType = m_ui->cbFunctionalAreaType->currentData().toInt();
int playerId = 0;
const auto pointSymbol = m_sidc.toStdString();
AesOperatingMode deconMode = static_cast<AesOperatingMode_def::type>(m_ui->cbDecontamination->currentData().toInt());
int deconTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()) ? 1000 * 60 * m_ui->sbDecontaminationMinutes->value() : 0;
AesOperatingMode maintMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMaintenance->currentData().toInt());
int maintTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()) ? 1000 * 60 * m_ui->sbMaintanenceMinutes->value() : 0;
AesOperatingMode medicMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMedical->currentData().toInt());
int medicTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
AesOperatingMode supplyMode = static_cast<AesOperatingMode_def::type>(m_ui->cbSupply->currentData().toInt());
AesOperatingMode deconMode = static_cast<AesOperatingMode>(m_ui->cbDecontamination->currentData().toInt());
int deconTime = (AesOperatingMode::OmWaitingTime == m_ui->cbDecontamination->currentData().toInt()) ? 1000 * 60 * m_ui->sbDecontaminationMinutes->value() : 0;
AesOperatingMode maintMode = static_cast<AesOperatingMode>(m_ui->cbMaintenance->currentData().toInt());
int maintTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMaintenance->currentData().toInt()) ? 1000 * 60 * m_ui->sbMaintanenceMinutes->value() : 0;
AesOperatingMode medicMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
int medicTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
AesOperatingMode supplyMode = static_cast<AesOperatingMode>(m_ui->cbSupply->currentData().toInt());
if ( functionalAreaType != 7 )
supplyMode = AesOperatingMode_def::OmNotUsed;
int supplyTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbSupply->currentData().toInt()) ? 1000 * 60 * m_ui->sbSupplyMinutes->value() : 0;
AesOperatingMode notfightMode = static_cast<AesOperatingMode_def::type>(m_ui->cbMedical->currentData().toInt());
int notfightTime = (AesOperatingMode_def::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
supplyMode = AesOperatingMode::OmNotUsed;
int supplyTime = (AesOperatingMode::OmWaitingTime == m_ui->cbSupply->currentData().toInt()) ? 1000 * 60 * m_ui->sbSupplyMinutes->value() : 0;
AesOperatingMode notfightMode = static_cast<AesOperatingMode>(m_ui->cbMedical->currentData().toInt());
int notfightTime = (AesOperatingMode::OmWaitingTime == m_ui->cbMedical->currentData().toInt()) ? 1000 * 60 * m_ui->sbMedicalMinutes->value() : 0;
if ( functionalAreaType == 7 )
{
deconMode = AesOperatingMode_def::OmNotUsed;
maintMode = AesOperatingMode_def::OmNotUsed;
medicMode = AesOperatingMode_def::OmNotUsed;
notfightMode = AesOperatingMode_def::OmNotUsed;
deconMode = AesOperatingMode::OmNotUsed;
maintMode = AesOperatingMode::OmNotUsed;
medicMode = AesOperatingMode::OmNotUsed;
notfightMode = AesOperatingMode::OmNotUsed;
}
if ( functionalAreaType == 8 )
{
deconMode = AesOperatingMode_def::OmNotUsed;
maintMode = AesOperatingMode_def::OmNotUsed;
medicMode = AesOperatingMode_def::OmNotUsed;
supplyMode = AesOperatingMode_def::OmNotUsed;
notfightMode = AesOperatingMode_def::OmObserver;
deconMode = AesOperatingMode::OmNotUsed;
maintMode = AesOperatingMode::OmNotUsed;
medicMode = AesOperatingMode::OmNotUsed;
supplyMode = AesOperatingMode::OmNotUsed;
notfightMode = AesOperatingMode::OmObserver;
}
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(),
@@ -649,7 +649,7 @@ bool FunctionalAreaEdit::apply()
const Area area(bottomLeftGeo, m_ui->sbWidth->value(), m_ui->sbHeight->value(), 0.0);
const ::dds::core::optional< int32_t > participantIdOpt = LtsUtils::toOptional(playerId);
if (supplyMode == AesOperatingMode_def::OmWaitingTime)
if (supplyMode == AesOperatingMode::OmWaitingTime)
{
partyId = 0;
playerId = m_participant.id();
@@ -76,12 +76,12 @@ void GasPipeEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->cbParty->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->gasPipe(m_aesItem.id());
@@ -136,7 +136,7 @@ void GasPipeEdit::setData(const GasPipe &aesItem, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->sbWidth->setValue(aesItem.width());
@@ -114,12 +114,12 @@ void MineAreaEdit::enableUiElements(bool enable)
else
m_ui->pbResetDusMines->hide();
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->mineArea(m_aesItem.id());
@@ -193,10 +193,10 @@ bool MineAreaEdit::init(int aesItemId, bool copy,
m_ui->cbDurationHours->setCurrentIndex(m_ui->cbDurationHours->findData(96));
if (strcmp(PROJECTBUILD, "guez") == 0)
m_ui->cbLayingProcedure->addItem(tr("Artillery"), AesMaLayingProcedureType_def::LptArtillery);
m_ui->cbLayingProcedure->addItem(tr("Artillery"), AesMaLayingProcedureType::LptArtillery);
m_ui->cbLayingProcedure->addItem(tr("Pioneer"), AesMaLayingProcedureType_def::LptPioneer);
m_ui->cbLayingProcedure->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType_def::LptPioneer));
m_ui->cbLayingProcedure->addItem(tr("Pioneer"), AesMaLayingProcedureType::LptPioneer);
m_ui->cbLayingProcedure->setCurrentIndex(m_ui->cbLayingProcedure->findData(AesMaLayingProcedureType::LptPioneer));
m_ui->cbLayingMethod->addItem(tr("Open"), 0);
m_ui->cbLayingMethod->addItem(tr("Covered"), 1);
@@ -246,7 +246,7 @@ void MineAreaEdit::setData(const MineArea &data, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromUtf8(data.name().c_str()));
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(data.chargeStruct().chargeTypeId()));
@@ -323,7 +323,7 @@ void MineAreaEdit::getPosition()
double width = m_ui->sbWidth->value();
int maxSegments = m_segments;
if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType_def::LptArtillery)
if (m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType::LptArtillery)
maxSegments = 1;
@@ -380,7 +380,7 @@ bool MineAreaEdit::apply()
std::string name = m_ui->leIdentifier->text().toStdString();
int chargeTypeId = m_ui->cbChargeType->currentData().toInt();
s_lastChargeType = chargeTypeId;
AesMaLayingProcedureType layingProcedureType = static_cast<AesMaLayingProcedureType_def::type>(m_ui->cbLayingProcedure->currentData().toInt());
AesMaLayingProcedureType layingProcedureType = static_cast<AesMaLayingProcedureType>(m_ui->cbLayingProcedure->currentData().toInt());
bool isLaidHidden = m_ui->cbLayingMethod->currentData().toInt() != 0;
int partyId = m_ui->cbParty->currentData().toInt();
int playerId = 0;
@@ -429,7 +429,7 @@ bool MineAreaEdit::apply()
void MineAreaEdit::onLayingProcedureChanged()
{
const bool islptArtillery = m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType_def::LptArtillery;
const bool islptArtillery = m_ui->cbLayingProcedure->currentData().toInt() == AesMaLayingProcedureType::LptArtillery;
if (islptArtillery)
m_pdmGuiIfc->setChargeTypePropertyFilter(m_ui->cbChargeType, QStringLiteral("canBeThrown"), true);
else
@@ -76,12 +76,12 @@ void MineCorridorEdit::enableUiElements(bool enable)
m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->mineCorridor(m_aesItem.id());
@@ -134,7 +134,7 @@ void MineCorridorEdit::setData(const MineCorridor &aesItem, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(aesItem.name()));
m_ui->sbWidth->setValue(aesItem.width());
@@ -126,12 +126,12 @@ void BoobyTrapEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->boobyTrap(m_aesItem.id());
@@ -225,7 +225,7 @@ void BoobyTrapEdit::setData(const BoobyTrap &bt, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(bt.name()));
m_ui->dteEffectStart->setMsecsSinceEpoch(bt.effectStart().is_set() ? bt.effectStart().get() : 0);
@@ -176,12 +176,12 @@ void OffRouteMineEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->pbClear->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->offRouteMine(m_aesItem.id());
@@ -249,7 +249,7 @@ void OffRouteMineEdit::setData(const OffRouteMine &orm, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
const Area &area = orm.area();
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) ||
@@ -157,9 +157,9 @@ void NContaminationEdit::onWeatherChanged(int index )
{
Q_UNUSED(index);
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic)
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
{
m_ui->rotationAngleEdit->showSpinbox(1, false);
m_ui->stackedWidget->setCurrentWidget(m_ui->lbAngle);
@@ -182,9 +182,9 @@ void NContaminationEdit::setRadials(double direction, double spanAngle)
double radial1 = direction - (fabs(spanAngle) / 2.0);
double radial2 = direction + (fabs(spanAngle) / 2.0);
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource_def::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource_def::AwsStatic)
AreaEffectSimulation::AesWeatherSource weather = static_cast<AreaEffectSimulation::AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
if (weather == AreaEffectSimulation::AesWeatherSource::AwsDynamic ||
weather == AreaEffectSimulation::AesWeatherSource::AwsStatic)
{
radial1 = spanAngle;
}
@@ -202,7 +202,7 @@ double NContaminationEdit::spanAngle() const
double radial2 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(1), LtsAngleEditBase::AngleUnitType::Deg,
m_ui->rotationAngleEdit->getAngleCurrentUnit());
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource_def::AwsNone)
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource::AwsNone)
return radial1;
double spanAngle = radial2 - radial1;
@@ -213,7 +213,7 @@ double NContaminationEdit::spanAngle() const
double NContaminationEdit::rotatianAngle() const
{
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource_def::AwsNone)
if (m_ui->cbWeather->currentData().toInt() != AreaEffectSimulation::AesWeatherSource::AwsNone)
return 0.0;
double radial1 = m_ui->rotationAngleEdit->getAngleConverted(m_ui->rotationAngleEdit->getAngle(0), LtsAngleEditBase::AngleUnitType::Deg,
@@ -244,12 +244,12 @@ void NContaminationEdit::enableUiElements(bool enable)
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
m_ui->cbWeather->setEnabled(enable);
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->nContamination(m_aesItem.id());
@@ -322,7 +322,7 @@ void NContaminationEdit::setData(const NContamination &contamination, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name()));
@@ -385,7 +385,7 @@ bool NContaminationEdit::apply()
int partyId = 0;
int playerId = 0;
AesWeatherSource weatherSourceId = static_cast<AesWeatherSource::inner_enum>(m_ui->cbWeather->currentData().toInt());
AesWeatherSource weatherSourceId = static_cast<AesWeatherSource>(m_ui->cbWeather->currentData().toInt());
const QPointF p(m_ui->positionEdit->coordinate());
const Core::GeoPosition2D pos(p.x(), p.y());
const NContaminationModifyRequest req(m_aesItem.id(),
@@ -81,12 +81,12 @@ void TechnicalAreaEdit::enableUiElements(bool enable)
m_ui->sbWidth->setEnabled(enable);
m_ui->pbClear->setEnabled(enable);
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
if (m_aesItem.effectStateId() == AesEffectState_def::EsExpired)
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
{
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
__unchange__();
}
if (m_aesItem.effectStateId() == AesEffectState_def::EsActivated)
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
{
QString name = m_ui->leIdentifier->text();
auto baseData = m_dtc->technicalArea(m_aesItem.id());
@@ -137,7 +137,7 @@ void TechnicalAreaEdit::setData(const TechnicalArea &area, bool copy)
if (copy)
{
m_aesItem.id(0);
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState_def::get_default());
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
}
m_ui->leIdentifier->setText(QString::fromStdString(area.name()));
m_ui->sbWidth->setValue(area.area().width());
@@ -161,9 +161,9 @@ inline void TechnicalAreaEdit::fillCbx()
m_ui->cbType->clear();
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType_def::TatMout), AesTechnicalAreaType_def::TatMout);
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType::TatMout), AesTechnicalAreaType::TatMout);
if ( enableSoundZones )
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType_def::TatSoundZone), AesTechnicalAreaType_def::TatSoundZone);
m_ui->cbType->addItem(AreaEffectSimulation::toString(AesTechnicalAreaType::TatSoundZone), AesTechnicalAreaType::TatSoundZone);
@@ -204,7 +204,7 @@ void TechnicalAreaEdit::onRectData(const QPointF &centerPoint, double width, dou
bool TechnicalAreaEdit::apply()
{
std::string name = m_ui->leIdentifier->text().toStdString();
AesTechnicalAreaType type = static_cast<AesTechnicalAreaType::inner_enum>(m_ui->cbType->currentData().toInt());
AesTechnicalAreaType type = static_cast<AesTechnicalAreaType>(m_ui->cbType->currentData().toInt());
QPointF bottomLeft(Polygons::centerPoint2BottomLeft(m_ui->positionEdit->coordinate(),
m_ui->sbWidth->value(),
m_ui->sbHeight->value(),
@@ -29,7 +29,6 @@ class TopicEditor : public TopicEditorBase::TopicEditor
~TopicEditor();
private:
NGL::INGLLogger& m_logger;
void updateInternalData() override final;
void retranslate() override final;
@@ -111,7 +111,7 @@ void EditCombatNetRadioDialog::setUiValues(const CnrConfig& cnrConfig)
m_ui->chkGlobal->setChecked(m_isGlobal);
initCbChannels(cnrConfig.cnrChannelId());
bool disableParty =
(m_avmDtc->cnrChannel(cnrConfig.cnrChannelId()).frequencyBand() == FrequencyBand_def::REL) || m_isGlobal;
(m_avmDtc->cnrChannel(cnrConfig.cnrChannelId()).frequencyBand() == FrequencyBand::REL) || m_isGlobal;
if (!disableParty)
{
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(cnrConfig.partyId()));
@@ -492,7 +492,7 @@ void EditCombatNetRadioDialog::onChannelChanged(int index)
{
int channelId = m_ui->cbChannel->itemData(index).toInt();
bool disableParty = (m_avmDtc->cnrChannel(channelId).frequencyBand() == FrequencyBand_def::REL) || m_isGlobal;
bool disableParty = (m_avmDtc->cnrChannel(channelId).frequencyBand() == FrequencyBand::REL) || m_isGlobal;
m_ui->cbUnit->setDisabled(disableParty);
m_ui->lbUnit->setDisabled(disableParty);
m_ui->cbParty->setDisabled(disableParty);
@@ -73,10 +73,10 @@ bool EditFrequencyPlanningResourceDataModel::isFiltered(const AudioVideoManageme
DataModification modType) const
{
if (m_frequencyBand != FrequencyBand_def::REL && data.frequencyBand() != m_frequencyBand)
if (m_frequencyBand != FrequencyBand::REL && data.frequencyBand() != m_frequencyBand)
return true;
if (m_frequencyBand == FrequencyBand_def::REL && data.frequencyBand() != FrequencyBand_def::VHF)
if (m_frequencyBand == FrequencyBand::REL && data.frequencyBand() != FrequencyBand::VHF)
return true;
Q_UNUSED(modType);
@@ -45,12 +45,12 @@ EditFrequencyPlanningSetResourceDialog::EditFrequencyPlanningSetResourceDialog(
for (const auto &it : dataVec)
{
if((operatingMode == RcOperatingMode_def::AkwEncEccm ||
operatingMode == RcOperatingMode_def::AkwEncNone)
if((operatingMode == RcOperatingMode::AkwEncEccm ||
operatingMode == RcOperatingMode::AkwEncNone)
&& it.akwRadioCircuit() == 0)
continue;
if((operatingMode != RcOperatingMode_def::AkwEncEccm &&
operatingMode != RcOperatingMode_def::AkwEncNone)
if((operatingMode != RcOperatingMode::AkwEncEccm &&
operatingMode != RcOperatingMode::AkwEncNone)
&& it.akwRadioCircuit() != 0)
continue;
m_frequencyResourceDataModel->insertRow(it);
@@ -103,7 +103,7 @@ class FrequencyPlanningDialog : public LtsWidgets::LtsDialog,
void setButtonSetActivePlanningEnabled();
static void setBackgroundColor(QWidget* w, Qt::GlobalColor color, bool bSetColor);
void setStatus(const QString& statusText, const QString& requester, qint64 timeStampMsecs,
TransmissionReason reason = TransmissionReason_def::TR_Unknown, Qt::GlobalColor color = Qt::black);
TransmissionReason reason = TransmissionReason::TR_Unknown, Qt::GlobalColor color = Qt::black);
void tableColumnOrganiserSetting() override;
private:
@@ -23,9 +23,9 @@ FrequencyPlanningWidget::FrequencyPlanningWidget(const std::shared_ptr<Interface
{
m_ui->setupUi(this);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::VHF), FrequencyBand_def::VHF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::HF), FrequencyBand_def::HF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::UHF), FrequencyBand_def::UHF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::VHF), FrequencyBand::VHF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::HF), FrequencyBand::HF);
m_ui->cbFrequencyBand->addItem(toString(FrequencyBand::UHF), FrequencyBand::UHF);
connect(m_ui->leName, &QLineEdit::textChanged, this, &FrequencyPlanningWidget::onNameChanged);
connect(m_ui->cbFrequencyBand, qOverload<int>(&QComboBox::currentIndexChanged), this,
@@ -51,15 +51,15 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
switch (ft.underlying())
{
case FrequencyBand_def::HF: {
case FrequencyBand::HF: {
createHFWidget(data);
break;
}
case FrequencyBand_def::UHF: {
case FrequencyBand::UHF: {
createUHFWidget(data);
break;
}
case FrequencyBand_def::VHF: {
case FrequencyBand::VHF: {
createVHFWidget(data);
break;
}
@@ -72,13 +72,13 @@ bool FrequencyPlanningWidget::init(LtsSession::LtsSession* session, RadioCircuit
m_ui->lbxFrequencyBand->setVisible(true);
switch (ft.underlying())
{
case FrequencyBand_def::HF:
case FrequencyBand::HF:
createHFWidget(data);
break;
case FrequencyBand_def::UHF:
case FrequencyBand::UHF:
createUHFWidget(data);
break;
case FrequencyBand_def::VHF:
case FrequencyBand::VHF:
createVHFWidget(data);
break;
default:
@@ -117,7 +117,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool restrict)
{
if (restrict)
{
m_ui->cbFrequencyBand->setCurrentIndex(m_ui->cbFrequencyBand->findData(FrequencyBand_def::VHF));
m_ui->cbFrequencyBand->setCurrentIndex(m_ui->cbFrequencyBand->findData(FrequencyBand::VHF));
m_ui->cbFrequencyBand->setEnabled(false);
}
else
@@ -129,7 +129,7 @@ void FrequencyPlanningWidget::setRelaisRestrictions(bool restrict)
QJsonObject FrequencyPlanningWidget::toJson() const
{
return frequencyPlanningJson(m_radioSpecificaWidget->toJson(), m_ui->leName->text(),
static_cast<FrequencyBand::inner_enum>(m_ui->cbFrequencyBand->currentData().toInt()),
static_cast<FrequencyBand>(m_ui->cbFrequencyBand->currentData().toInt()),
m_ui->cbRadioStation->currentData().toInt());
}
@@ -152,13 +152,13 @@ void FrequencyPlanningWidget::onFrequencyBandChanged()
{
switch (m_ui->cbFrequencyBand->currentData().toInt())
{
case FrequencyBand_def::HF:
case FrequencyBand::HF:
createHFWidget();
break;
case FrequencyBand_def::UHF:
case FrequencyBand::UHF:
createUHFWidget();
break;
case FrequencyBand_def::VHF:
case FrequencyBand::VHF:
createVHFWidget();
break;
}
@@ -44,7 +44,7 @@ public:
FrequencyPlanningWidget(const std::shared_ptr<Interface::Dtc> &avmDtc, QSet<int> &allocatedDataSets, QWidget *parent = nullptr);
~FrequencyPlanningWidget();
bool init(LtsSession::LtsSession *session, RadioCircuit *data, const CnrConfig &cnrConfigId, int frequencySetId = -1, FrequencyBand ft = FrequencyBand_def::VHF);
bool init(LtsSession::LtsSession *session, RadioCircuit *data, const CnrConfig &cnrConfigId, int frequencySetId = -1, FrequencyBand ft = FrequencyBand::VHF);
void setNameDisabled(bool disable);
void setName(const QString& name);
void setRelaisRestrictions(bool restrict);
@@ -25,7 +25,7 @@ RadioSpecificaHfWidget::RadioSpecificaHfWidget(QWidget *parent)
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacingHF_def::CS_100_Hz), ChannelSpacingHF_def::CS_100_Hz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacingHF::CS_100_Hz), ChannelSpacingHF::CS_100_Hz);
@@ -94,7 +94,7 @@ RadioCircuitHF RadioSpecificaHfWidget::values() const
{
RadioCircuitHF spec;
spec.modulationType = ModulationType::AM;
spec.channelSpacing = static_cast<ChannelSpacingHF::inner_enum>(m_ui->cobChannelSpacing->currentData().toInt());
spec.channelSpacing = static_cast<ChannelSpacingHF>(m_ui->cobChannelSpacing->currentData().toInt());
spec.frequency = m_ui->sbFrequency->value();
spec.squelch = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0;
return spec;
@@ -36,9 +36,9 @@ RadioSpecificaUhfWidget::RadioSpecificaUhfWidget(QWidget *parent)
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_25_00_kHz), ChannelSpacing_def::CS_25_00_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_12_50_kHz), ChannelSpacing_def::CS_12_50_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing_def::CS_8_33_kHz), ChannelSpacing_def::CS_8_33_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_25_00_kHz), ChannelSpacing::CS_25_00_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_12_50_kHz), ChannelSpacing::CS_12_50_kHz);
m_ui->cobChannelSpacing->addItem(toString(ChannelSpacing::CS_8_33_kHz), ChannelSpacing::CS_8_33_kHz);
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
@@ -149,8 +149,8 @@ RadioCircuitUHF RadioSpecificaUhfWidget::values() const
{
RadioCircuitUHF spec;
spec.modulationType = static_cast<ModulationType::inner_enum>(m_ui->bgModulationType->checkedButton()->property("enum").toInt());
spec.channelSpacing = static_cast<ChannelSpacing::inner_enum>(m_ui->cobChannelSpacing->currentData().toInt());
spec.modulationType = static_cast<ModulationType>(m_ui->bgModulationType->checkedButton()->property("enum").toInt());
spec.channelSpacing = static_cast<ChannelSpacing>(m_ui->cobChannelSpacing->currentData().toInt());
spec.frequency = m_ui->sbFrequency->value() * 1000;
spec.squelchDB = m_ui->chbSquelch->isChecked() ? m_ui->sbSquelch->value() : 0;
spec.clipper = m_ui->rbClipperOn->isChecked();
@@ -22,11 +22,11 @@ RadioSpecificaVhfWidget::RadioSpecificaVhfWidget(QSet<int> &assignedFrequencySet
m_ui->setupUi(this);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncNone), RcOperatingMode_def::FixedFreqEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncHwKr), RcOperatingMode_def::FixedFreqEncHwKr);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::FixedFreqEncHwKrKl), RcOperatingMode_def::FixedFreqEncHwKrKl);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::AkwEncNone), RcOperatingMode_def::AkwEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode_def::AkwEncEccm), RcOperatingMode_def::AkwEncEccm);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncNone), RcOperatingMode::FixedFreqEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncHwKr), RcOperatingMode::FixedFreqEncHwKr);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::FixedFreqEncHwKrKl), RcOperatingMode::FixedFreqEncHwKrKl);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::AkwEncNone), RcOperatingMode::AkwEncNone);
m_ui->cobOperatingMode->addItem(toString(RcOperatingMode::AkwEncEccm), RcOperatingMode::AkwEncEccm);
m_ui->leFrequencySet->setEnabled(false);
@@ -116,7 +116,7 @@ bool RadioSpecificaVhfWidget::setValues(const QJsonObject &json)
RadioCircuitVHF RadioSpecificaVhfWidget::values() const
{
RadioCircuitVHF spec;
spec.operatingMode = static_cast<RcOperatingMode::inner_enum>(m_ui->cobOperatingMode->currentData().toInt());
spec.operatingMode = static_cast<RcOperatingMode>(m_ui->cobOperatingMode->currentData().toInt());
spec.freqSetDataId = m_frequencySetDataId;
spec.pilotTone = isAkwMode(spec.operatingMode) ? false : m_ui->rbPilotToneOn->isChecked();
return spec;
@@ -163,7 +163,7 @@ void RadioSpecificaVhfWidget::onSelectFrequencySetData()
void RadioSpecificaVhfWidget::onOperatingModeChanged()
{
RcOperatingMode rcMode = static_cast<RcOperatingMode::inner_enum>(m_ui->cobOperatingMode->currentData().toInt());
RcOperatingMode rcMode = static_cast<RcOperatingMode>(m_ui->cobOperatingMode->currentData().toInt());
const bool enablePilotTone = !isAkwMode(rcMode);
m_ui->lbxPilotTone->setEnabled(enablePilotTone);
m_ui->rbPilotToneOn->setEnabled(enablePilotTone);
@@ -176,7 +176,7 @@ void ElokaDialog::onQueryElokaResponse(const QVector<AvaEloka>&& eloka)
{
for (const auto& cnrTvcProfileData : cnrTvcProfile.data())
{
if (cnrTvcProfileData.radioSystemId() == RadioSystem::inner_enum::Cnr)
if (cnrTvcProfileData.radioSystemId() == RadioSystem::Cnr)
userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr);
else
userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc);
@@ -250,7 +250,7 @@ bool ElokaDialog::isAnnouncement(ElokaData& data)
QMap<qint32, Stream> streams = m_avmDtc->streams();
for (const Stream& stream : std::as_const(streams))
{
if ((stream.type() == StreamType_def::AudioOut) || (stream.type() == StreamType_def::AudioInOut))
if ((stream.type() == StreamType::AudioOut) || (stream.type() == StreamType::AudioInOut))
announcements.insert(stream.id(), stream);
}
@@ -160,7 +160,7 @@ bool ElokaEditDialog::init(const std::vector<qint32>& usedCnr, const std::vector
const QMap<qint32, Stream> streams = m_avmDtc->streams();
for (const Stream& stream : streams)
{
if ((stream.type() == StreamType_def::AudioOut) || (stream.type() == StreamType_def::AudioInOut))
if ((stream.type() == StreamType::AudioOut) || (stream.type() == StreamType::AudioInOut))
m_announcementMap.insert(stream.id(), stream);
}
@@ -360,7 +360,7 @@ void ElokaEditDialog::onStreamChanged(const Stream& data, DataModification modTy
{
DEBUG_LOG(m_logger) << "onStreamChanged";
if ((data.type() != StreamType_def::AudioOut) && (data.type() != StreamType_def::AudioInOut))
if ((data.type() != StreamType::AudioOut) && (data.type() != StreamType::AudioInOut))
return;
switch (modType)
@@ -410,7 +410,7 @@ void ElokaEditDialog::getUserProfile()
if (cnrTvcProfile.exerciseId() == exerciseId && cnrTvcProfile.operatorId() == operatorId)
{
for (const auto& cnrTvcProfileData : cnrTvcProfile.data())
if (cnrTvcProfileData.radioSystemId() == RadioSystem::inner_enum::Cnr)
if (cnrTvcProfileData.radioSystemId() == RadioSystem::Cnr)
m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Cnr);
else
m_userProfile.insert(cnrTvcProfileData.radioCircuitId(), ElokaCircuitType::Tvc);
@@ -602,15 +602,15 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage
QString strAssetType;
switch (mp.type().underlying())
{
case InfrastructureManagement::MountingPointType_def::AnnouncementUnit:
case InfrastructureManagement::MountingPointType::AnnouncementUnit:
assetType = BuildingViewer::AssetTypes::AnnouncementUnit;
strAssetType = QStringLiteral("AnnouncementUnit");
break;
case InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit:
case InfrastructureManagement::MountingPointType::EffectGenerationControlUnit:
assetType = BuildingViewer::AssetTypes::EffectGenerationUnit;
strAssetType = QStringLiteral("EffectGenerationControlUnit");
break;
case InfrastructureManagement::MountingPointType_def::IndoorCamera: {
case InfrastructureManagement::MountingPointType::IndoorCamera: {
bool hasSpeaker = false;
QJsonParseError jError;
const QJsonDocument doc(QJsonDocument::fromJson(mp.properties(), &jError));
@@ -741,7 +741,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement
return false;
ParticipantManagement::TypeClass tc = m_ppmDtc->type(participant.typeId()).typeClass();
if (tc == ParticipantManagement::TypeClass_def::SupportUnit || tc == ParticipantManagement::TypeClass_def::Unit)
if (tc == ParticipantManagement::TypeClass::SupportUnit || tc == ParticipantManagement::TypeClass::Unit)
{
DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id "
<< participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'";
@@ -1337,9 +1337,9 @@ void BuildingViewerDdsController::updateBuildingRoomNames(
QString featureID = BuildingViewer::databaseId2FeatureId(buildingDatabaseId);
for (const auto& se : vecElements)
{
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Building)
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building)
m_connection->excSetBuildingDisplayName(featureID, QString::fromStdString(se.displayName()));
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room)
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
m_connection->excSetRoomDisplayName(featureID, QString::number(se.mountingPointId()),
QString::fromStdString(se.displayName()));
}
@@ -288,7 +288,7 @@ void BuildingEdit::onDestroyElement()
std::vector<int32_t> structureElementIds;
getStructureElementIds(m_model->privateData(selIndex), structureElementIds);
sendBuildingStateRequest(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill, structureElementIds);
sendBuildingStateRequest(ProjectDataManagement::VulnerabilityState::CatastrophicKill, structureElementIds);
}
void BuildingEdit::getStructureElementIds(NGLTreeItem* item, std::vector<int32_t>& structureElementIds)
@@ -141,7 +141,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto& se : vecElements)
{
DEBUG_LOG(m_logger) << "se: =" << se;
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Floor)
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Floor)
{
BuildingViewer::TreeItem itemRoom(se);
itemRoom.setSuperior(rootId);
@@ -162,7 +162,7 @@ bool BuildingEditModel::init(int32_t mseId)
for (const auto& se : vecElements)
{
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Room)
if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Room)
{
double fortifyFactor = 1.0;
Loaded 100 of 1203 files, more files were not shown because too many files have changed in this diff. Show more