Compare commits
18
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d327c66c46 | ||
|
|
8e9594d25c | ||
|
|
3924b1e72b | ||
|
|
fb3e91ea4b | ||
|
|
e067c21b0d | ||
|
|
131a6714cf | ||
|
|
598fc2560e | ||
|
|
2b957d1edb | ||
|
|
78253c60f4 | ||
|
|
1e07bf76ba | ||
|
|
985aa9787b | ||
|
|
ed81fccb1d | ||
|
|
43300efaa7 | ||
|
|
7b090a26ca | ||
|
|
1bcc7e4855 | ||
|
|
ab1cf60643 | ||
|
|
3f8a7eccfd | ||
|
|
d8ec9e8d74 |
No files matched your search
+18
@@ -9,3 +9,21 @@ fix_qt6_gui_deps.py
|
|||||||
fix_rti_conditionals.py
|
fix_rti_conditionals.py
|
||||||
fix_target_checks.py
|
fix_target_checks.py
|
||||||
build
|
build
|
||||||
|
__pycache__/
|
||||||
|
add_logger_bootstrap_include.py
|
||||||
|
aqtinstall.log
|
||||||
|
ces_fix.py
|
||||||
|
ces_pass2.py
|
||||||
|
fix_additem_enum.py
|
||||||
|
fix_broken_includes.py
|
||||||
|
fix_enum_as_int.py
|
||||||
|
fix_enums.py
|
||||||
|
fix_logger_init.py
|
||||||
|
fix_logger_remnant.py
|
||||||
|
fix_members.py
|
||||||
|
fix_mlogger.py
|
||||||
|
fix_pdm_combo.py
|
||||||
|
fix_sco.py
|
||||||
|
restore_underlying.py
|
||||||
|
../../restore_ppm_dtc.py
|
||||||
|
*.py
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
# export MIGRATE_PIPELINE_ROOT="/home/torsten/sandbox/qt6-migration-pipeline"
|
# export MIGRATE_PIPELINE_ROOT="/home/torsten/sandbox/qt6-migration-pipeline"
|
||||||
export MIGRATE_PIPELINE_ROOT="/home/nkana/repo/qt6-migration-pipeline"
|
export MIGRATE_PIPELINE_ROOT="/home/nkana/repo/qt6-migration-pipeline"
|
||||||
|
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=16000
|
||||||
export LANG=C.UTF-8
|
export LANG=C.UTF-8
|
||||||
export LC_ALL=C.UTF-8
|
export LC_ALL=C.UTF-8
|
||||||
@@ -82,6 +82,9 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|||||||
# (The qt5 legacy has no include/ tree; Lts/ is the real include root.)
|
# (The qt5 legacy has no include/ tree; Lts/ is the real include root.)
|
||||||
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
|
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include)
|
include_directories(${CMAKE_SOURCE_DIR}/include)
|
||||||
|
# Legacy also used source-root-relative includes (<Lts/Services/<Svc>/logger.h>, ...);
|
||||||
|
# the source root must be an include root so those resolve.
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR})
|
||||||
# Include directory for generated export headers
|
# Include directory for generated export headers
|
||||||
include_directories(${CMAKE_BINARY_DIR})
|
include_directories(${CMAKE_BINARY_DIR})
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Z/src)
|
include_directories(${CMAKE_SOURCE_DIR}/Z/src)
|
||||||
@@ -89,10 +92,28 @@ include_directories(${CMAKE_SOURCE_DIR}/Z/src)
|
|||||||
include_directories(${CMAKE_SOURCE_DIR}/Z/src)
|
include_directories(${CMAKE_SOURCE_DIR}/Z/src)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Z/src/ngltools)
|
include_directories(${CMAKE_SOURCE_DIR}/Z/src/ngltools)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/SituationMap/Symbology)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/SituationMap/Symbology)
|
||||||
|
# <Symbology/...> headers (symbol_dictionary.h, sidc_codec.h, ...) are consumed tree-wide
|
||||||
|
# (e.g. AdvancedSymbology/asb_data_plugin_interface.h is pulled into PpmCommon), so the
|
||||||
|
# parent dir must be a global root too, not only on the AdvancedSymbology target.
|
||||||
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/SituationMap)
|
||||||
|
# Generated SymbologyGui/advancedsymbologygui_export.h lives in the build dir; the source
|
||||||
|
# SituationMap root above only covers the source Symbology headers.
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Viewer/SituationMap)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/LtsDataView)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/LtsDataView)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/TrainingAreaBase)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/TrainingAreaBase)
|
||||||
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ProjectDataManagement)
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ProjectDataManagement)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/Services)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Services)
|
||||||
|
# Consumers include generated DDS service headers by service-prefixed name
|
||||||
|
# (<ParticipantManagement/ppm.hpp>, <GuezNasat/gna_dtc.h>, ...). Those headers
|
||||||
|
# live in the per-service BUILD dirs, so the binary Lts/Services ROOT must be
|
||||||
|
# visible tree-wide (the per-service build dirs below only satisfy the bare
|
||||||
|
# <ppm.hpp> form). Placed right after the source Lts/Services so a header
|
||||||
|
# present in both still resolves to the source (binary only supplies the
|
||||||
|
# generated headers). This mirrors the legacy <Services/...> form.
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Services)
|
||||||
|
# Generated DDS headers for Proxies (GuezNasat/gna_dtc.h, ...) live under the binary
|
||||||
|
# Lts/Proxies dir; consumers include them by proxy-prefixed name (<GuezNasat/gna_dtc.h>).
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Proxies)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include/ProjectDataManagement)
|
include_directories(${CMAKE_SOURCE_DIR}/include/ProjectDataManagement)
|
||||||
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/InfrastructureManagement)
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/InfrastructureManagement)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/include/InfrastructureManagement)
|
include_directories(${CMAKE_SOURCE_DIR}/include/InfrastructureManagement)
|
||||||
@@ -120,6 +141,9 @@ include_directories(${CMAKE_SOURCE_DIR}/include/SituationReplay)
|
|||||||
# is added (same shape as FileManagement above, which has no stub tree either).
|
# is added (same shape as FileManagement above, which has no stub tree either).
|
||||||
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Evaluations)
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Evaluations)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/GuezNasat)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/GuezNasat)
|
||||||
|
# GuezNasat's generated export header (svcgnacommon_export.h) lives in the build dir;
|
||||||
|
# logger.h includes it by bare name, so the build dir must be visible tree-wide.
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Proxies/GuezNasat)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS)
|
||||||
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS/QosProfile)
|
include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS/QosProfile)
|
||||||
# Generated DDS headers (BUILD_RTI=ON)
|
# Generated DDS headers (BUILD_RTI=ON)
|
||||||
@@ -137,6 +161,9 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
|
|||||||
# directory holding the generated header has to be visible tree-wide. The directory contains
|
# 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.
|
# only that generated header, so appending it cannot shadow an existing include.
|
||||||
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings)
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings)
|
||||||
|
# LtsUtilsGui ConnectDialog's generated ltsutilsguiconnectdialog_export.h is included by bare
|
||||||
|
# name from connect_dialog.h / connect_dialog_nt.h; same tree-wide visibility as the dirs above.
|
||||||
|
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsGui/ConnectDialog)
|
||||||
# DDSConnector's generated ddsconnector_export.h is included by bare name from
|
# 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
|
# 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
|
# DDSConnector headers without linking ddsconnector. Same shape as LtsUtilsSettings above: the
|
||||||
@@ -183,8 +210,12 @@ OPTION(BUILD_PLUGINS_PLANEDITOR "Build PlanEditor plugin (requires Qt6 WebEngine
|
|||||||
OPTION(BUILD_PLUGINS_ONLINEHELP "Build OnlineHelp plugin (requires Qt6 WebEngine)" OFF)
|
OPTION(BUILD_PLUGINS_ONLINEHELP "Build OnlineHelp plugin (requires Qt6 WebEngine)" OFF)
|
||||||
OPTION(BUILD_PLUGINS_SERVICEMONITOR "Build ServiceMonitor plugin (requires Qt6 WebEngine)" OFF)
|
OPTION(BUILD_PLUGINS_SERVICEMONITOR "Build ServiceMonitor plugin (requires Qt6 WebEngine)" OFF)
|
||||||
OPTION(BUILD_PLUGINS_PARTICIPANT_ORG_CHART "Build ParticipantOrgChart (requires Qt6 WebEngine)" OFF)
|
OPTION(BUILD_PLUGINS_PARTICIPANT_ORG_CHART "Build ParticipantOrgChart (requires Qt6 WebEngine)" OFF)
|
||||||
OPTION(BUILD_PLUGINS_MSDL "Build MSDL module (requires Qt6 XmlPatterns)" OFF)
|
# MSDL/Saab no longer require Qt XmlPatterns (removed in Qt 6.0): their import
|
||||||
OPTION(BUILD_PLUGINS_SAAB "Build Saab module (requires Qt6 XmlPatterns)" OFF)
|
# code was re-implemented with Qt6::Xml (QDomDocument) for the schema check plus
|
||||||
|
# the external xmllint step for real XSD validation; MSDL additionally links
|
||||||
|
# XercesC + uses xsdc++-generated tree classes (needs libxerces-c-dev + xsdcxx).
|
||||||
|
OPTION(BUILD_PLUGINS_MSDL "Build MSDL module (needs XercesC + xsdc++)" OFF)
|
||||||
|
OPTION(BUILD_PLUGINS_SAAB "Build Saab module (Qt6::Xml only)" OFF)
|
||||||
OPTION(BUILD_RTI "Build RTI Connext DDS dependent modules" OFF)
|
OPTION(BUILD_RTI "Build RTI Connext DDS dependent modules" OFF)
|
||||||
OPTION(BUILD_VIEWER_ONLY "Build only Viewer module (no RTI required)" OFF)
|
OPTION(BUILD_VIEWER_ONLY "Build only Viewer module (no RTI required)" OFF)
|
||||||
# Add Lts/ include path globally for QosProfile and other Lts headers
|
# Add Lts/ include path globally for QosProfile and other Lts headers
|
||||||
@@ -192,6 +223,12 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Lts)
|
|||||||
IF(BUILD_RTI)
|
IF(BUILD_RTI)
|
||||||
# Define BUILD_RTI as preprocessor macro for all targets
|
# Define BUILD_RTI as preprocessor macro for all targets
|
||||||
ADD_COMPILE_DEFINITIONS(BUILD_RTI)
|
ADD_COMPILE_DEFINITIONS(BUILD_RTI)
|
||||||
|
# External (RTI) DDS is available: compile the BUILD_WITH_EXTERNAL_DDS code paths
|
||||||
|
# (used by 73 guards across plugins, e.g. MrkCommon's MarkerManagementDialogModel /
|
||||||
|
# CustomViewMarker). Legacy always compiled this DDS code; the flag is a migration
|
||||||
|
# option that was never wired into CMake, so its absence silently dropped the
|
||||||
|
# definitions while the unguarded class declarations still referenced them (link error).
|
||||||
|
ADD_COMPILE_DEFINITIONS(BUILD_WITH_EXTERNAL_DDS)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
OPTION(BUILD_ARCGIS "Build ArcGIS SDK dependent modules" ON)
|
OPTION(BUILD_ARCGIS "Build ArcGIS SDK dependent modules" ON)
|
||||||
OPTION(BUILD_FILTERMANAGEMENT "Build FilterManagement plugins (temporarily disabled for migration)" OFF)
|
OPTION(BUILD_FILTERMANAGEMENT "Build FilterManagement plugins (temporarily disabled for migration)" OFF)
|
||||||
@@ -232,6 +269,11 @@ ELSE()
|
|||||||
IF(EXISTS "${ARCGIS_SDK_DIR}")
|
IF(EXISTS "${ARCGIS_SDK_DIR}")
|
||||||
LIST(APPEND CMAKE_PREFIX_PATH "${ARCGIS_SDK_DIR}")
|
LIST(APPEND CMAKE_PREFIX_PATH "${ARCGIS_SDK_DIR}")
|
||||||
MESSAGE(STATUS "ArcGIS SDK found at: ${ARCGIS_SDK_DIR}")
|
MESSAGE(STATUS "ArcGIS SDK found at: ${ARCGIS_SDK_DIR}")
|
||||||
|
# arcgisversion.h (a custom RME file in the SDK include dir) is pulled in via
|
||||||
|
# <SituationMap/Map/layer_factory.h> by many non-ArcGIS plugin targets (e.g.
|
||||||
|
# IsmResGuiPlugin); the ArcGIS::ArcGIS target include dir does not reach them, so
|
||||||
|
# expose the SDK include dir tree-wide when the SDK is present.
|
||||||
|
include_directories(${ARCGIS_SDK_DIR}/include)
|
||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(WARNING "ArcGIS SDK not found at: ${ARCGIS_SDK_DIR}")
|
MESSAGE(WARNING "ArcGIS SDK not found at: ${ARCGIS_SDK_DIR}")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
@@ -322,11 +364,40 @@ if(NOT Qt6_FOUND)
|
|||||||
message(STATUS "Found Qt6 (minimal): ${Qt6Core_VERSION}")
|
message(STATUS "Found Qt6 (minimal): ${Qt6Core_VERSION}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# MSDL/Saab import libs (gated by BUILD_PLUGINS_MSDL / BUILD_PLUGINS_SAAB) no
|
||||||
|
# longer use Qt XmlPatterns (QXmlSchema/QXmlSchemaValidator), which was removed
|
||||||
|
# in Qt 6.0. They were re-implemented with Qt6::Xml (QDomDocument) for the
|
||||||
|
# schema well-formedness check plus the external xmllint step for real XSD
|
||||||
|
# validation; MSDL additionally links XercesC and uses xsdc++-generated tree
|
||||||
|
# classes. No Qt6::XmlPatterns lookup is needed any more.
|
||||||
|
|
||||||
|
# Qt6::WebChannel (consumed by PpmOrgChartGuiPlugin's QWebChannel page setup):
|
||||||
|
# in Qt5 Qt5::WebEngineWidgets transitively linked Qt5::WebChannel (Qt5's
|
||||||
|
# webengine depended on webchannel), but Qt6 dropped that dependency, so the
|
||||||
|
# module must be found and linked explicitly. Separate QUIET find - never let
|
||||||
|
# a missing optional component flip Qt6_FOUND off.
|
||||||
|
if(NOT TARGET Qt6::WebChannel)
|
||||||
|
find_package(Qt6 6.2 COMPONENTS WebChannel QUIET)
|
||||||
|
if(Qt6WebChannel_FOUND)
|
||||||
|
message(STATUS "Found Qt6WebChannel")
|
||||||
|
else()
|
||||||
|
message(STATUS "Qt6WebChannel not found (PpmOrgChartGuiPlugin requires it; keep BUILD_PLUGINS_PARTICIPANT_ORG_CHART OFF)")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# Manual Qt6 configuration - create imported targets for available libraries
|
# Manual Qt6 configuration - create imported targets for available libraries
|
||||||
if(NOT TARGET Qt6::Core)
|
if(NOT TARGET Qt6::Core)
|
||||||
find_package(Qt6 6.2 COMPONENTS Core REQUIRED)
|
find_package(Qt6 6.2 COMPONENTS Core REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Qt State Machine (QState/QStateMachine) was moved out of QtGui in Qt6 into the
|
||||||
|
# separate "Qt State Machine" add-on (the qtscxml package). In Qt5 the state
|
||||||
|
# machine classes lived inside QtGui/QtCore, so the ExerciseManagement state
|
||||||
|
# machines (exercise_state_base/exercise_state_machine) compiled without an
|
||||||
|
# explicit StateMachine dependency. Probe for the module now; if present the
|
||||||
|
# affected targets link Qt6::StateMachine (guarded per-target below).
|
||||||
|
find_package(Qt6 6.2 COMPONENTS StateMachine QUIET)
|
||||||
|
|
||||||
# Create imported targets for all available Qt6 libraries
|
# Create imported targets for all available Qt6 libraries
|
||||||
# Use Qt6 installation path from find_package or fall back to system paths
|
# Use Qt6 installation path from find_package or fall back to system paths
|
||||||
if(Qt6Core_DIR)
|
if(Qt6Core_DIR)
|
||||||
@@ -397,6 +468,30 @@ if(EXISTS "${QT6_LIB_DIR}/libQt6Widgets.so.6")
|
|||||||
message(STATUS "Manually configured Qt6 Widgets target")
|
message(STATUS "Manually configured Qt6 Widgets target")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Qt6::OpenGL - create manual target if not found (QOpenGLPaintDevice, used by ArcGIS SDK)
|
||||||
|
if(NOT TARGET Qt6::OpenGL AND EXISTS "${QT6_LIB_DIR}/libQt6OpenGL.so.6")
|
||||||
|
add_library(Qt6::OpenGL SHARED IMPORTED)
|
||||||
|
set_target_properties(Qt6::OpenGL PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6OpenGL.so.6"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtGui;${QT6_INC_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "Qt6::Core"
|
||||||
|
)
|
||||||
|
message(STATUS "Manually configured Qt6 OpenGL target")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Qt6::OpenGLWidgets - create manual target if not found
|
||||||
|
# (QOpenGLWidget, used by the ArcGIS SDK MapGraphicsView/SceneGraphicsView objects;
|
||||||
|
# Qt6 splits QOpenGLWidget into its own libQt6OpenGLWidgets.so)
|
||||||
|
if(NOT TARGET Qt6::OpenGLWidgets AND EXISTS "${QT6_LIB_DIR}/libQt6OpenGLWidgets.so.6")
|
||||||
|
add_library(Qt6::OpenGLWidgets SHARED IMPORTED)
|
||||||
|
set_target_properties(Qt6::OpenGLWidgets PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6OpenGLWidgets.so.6"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtWidgets;${QT6_INC_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "Qt6::Core;Qt6::Gui;Qt6::Widgets"
|
||||||
|
)
|
||||||
|
message(STATUS "Manually configured Qt6 OpenGLWidgets target")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Qt6::Sql - create manual target if not found
|
# Qt6::Sql - create manual target if not found
|
||||||
if(NOT TARGET Qt6::Sql AND EXISTS "${QT6_LIB_DIR}/libQt6Sql.so.6")
|
if(NOT TARGET Qt6::Sql AND EXISTS "${QT6_LIB_DIR}/libQt6Sql.so.6")
|
||||||
add_library(Qt6::Sql SHARED IMPORTED)
|
add_library(Qt6::Sql SHARED IMPORTED)
|
||||||
@@ -502,6 +597,30 @@ if(NOT TARGET Qt6::SerialPort)
|
|||||||
message(STATUS "Created stub target for Qt6::SerialPort (library not available)")
|
message(STATUS "Created stub target for Qt6::SerialPort (library not available)")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Qt6::WebEngineCore - real imported target if the library exists (stub below otherwise).
|
||||||
|
# The stub carries no library, so targets linking it (e.g. SmoSystemMonitorGuiPlugin)
|
||||||
|
# fail --no-undefined on QWebEngine* symbols.
|
||||||
|
if(NOT TARGET Qt6::WebEngineCore AND EXISTS "${QT6_LIB_DIR}/libQt6WebEngineCore.so.6")
|
||||||
|
add_library(Qt6::WebEngineCore SHARED IMPORTED)
|
||||||
|
set_target_properties(Qt6::WebEngineCore PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6WebEngineCore.so.6"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtWebEngineCore;${QT6_INC_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "Qt6::Core;Qt6::Gui"
|
||||||
|
)
|
||||||
|
message(STATUS "Manually configured Qt6 WebEngineCore target")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Qt6::WebEngineWidgets - real imported target if the library exists.
|
||||||
|
if(NOT TARGET Qt6::WebEngineWidgets AND EXISTS "${QT6_LIB_DIR}/libQt6WebEngineWidgets.so.6")
|
||||||
|
add_library(Qt6::WebEngineWidgets SHARED IMPORTED)
|
||||||
|
set_target_properties(Qt6::WebEngineWidgets PROPERTIES
|
||||||
|
IMPORTED_LOCATION "${QT6_LIB_DIR}/libQt6WebEngineWidgets.so.6"
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES "${QT6_INC_DIR}/QtWebEngineWidgets;${QT6_INC_DIR}"
|
||||||
|
INTERFACE_LINK_LIBRARIES "Qt6::Core;Qt6::Gui;Qt6::Widgets;Qt6::WebEngineCore"
|
||||||
|
)
|
||||||
|
message(STATUS "Manually configured Qt6 WebEngineWidgets target")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Stub Qt6::WebEngineCore target if not available (needed by thp_viewer)
|
# Stub Qt6::WebEngineCore target if not available (needed by thp_viewer)
|
||||||
if(NOT TARGET Qt6::WebEngineCore)
|
if(NOT TARGET Qt6::WebEngineCore)
|
||||||
add_library(Qt6::WebEngineCore INTERFACE IMPORTED)
|
add_library(Qt6::WebEngineCore INTERFACE IMPORTED)
|
||||||
@@ -686,6 +805,26 @@ IF(BUILD_RTI)
|
|||||||
# reach the AutogenInfo MOC_INCLUDES.
|
# reach the AutogenInfo MOC_INCLUDES.
|
||||||
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts/Common)
|
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts/Common)
|
||||||
|
|
||||||
|
# The TrainingAreaBase tab plugins (tabPluginHla / tabPluginWlsTetra /
|
||||||
|
# tabPluginDebugJsonDir / ...) declare Q_INTERFACES(TrainingAreaBase::Plugin::Plugin)
|
||||||
|
# and include <TrainingAreaBase/tab_plugin_interface.h>. That include dir
|
||||||
|
# (Lts/Proxies) is only a target-level INTERFACE include of tabPluginInterface and
|
||||||
|
# is NOT part of the global include_directories that reach the AutogenInfo
|
||||||
|
# MOC_INCLUDES, so moc fails with "Undefined interface". Add the Lts/Proxies root
|
||||||
|
# explicitly so moc can resolve the interface. Must be set at root scope - subdir
|
||||||
|
# appends do not reach the AutogenInfo MOC_INCLUDES.
|
||||||
|
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${CMAKE_SOURCE_DIR}/Lts/Proxies)
|
||||||
|
|
||||||
|
# Designer plugins (ltswidgetsplugin) declare Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||||
|
# and include <QtUiPlugin/QDesignerCustomWidgetInterface>. That interface's
|
||||||
|
# Q_DECLARE_INTERFACE lives in the Qt6 QtUiPlugin module, which moc cannot resolve
|
||||||
|
# without the Qt6 parent include dir (it is only a target-level INTERFACE include of
|
||||||
|
# Qt6::UiTools and does not reach the global AutogenInfo MOC_INCLUDES). Add Qt6::Core's
|
||||||
|
# interface include dirs (which expose the <QtModule>/header root) so moc finds the
|
||||||
|
# interface. Must be set at root scope.
|
||||||
|
get_target_property(_qt6_autmoc_incs Qt6::Core INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${_qt6_autmoc_incs})
|
||||||
|
|
||||||
# IMPORTED Targets für RTI Libraries erstellen
|
# IMPORTED Targets für RTI Libraries erstellen
|
||||||
# Debug und Release Varianten korrekt konfigurieren
|
# Debug und Release Varianten korrekt konfigurieren
|
||||||
FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers)
|
FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers)
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QNetworkProxy>
|
#include <QNetworkProxy>
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QRandomGenerator>
|
|
||||||
#include <QInputDevice>
|
#include <QInputDevice>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@@ -175,7 +174,10 @@ public:
|
|||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
int main(int argc, char **argv) // TODO: json strings to lower
|
int main(int argc, char **argv) // TODO: json strings to lower
|
||||||
{
|
{
|
||||||
QRandomGenerator::global()->seed(time(nullptr));
|
// (legacy: qsrand(time(nullptr));) — the Qt5 global RNG (qrand/qsrand) does not exist in Qt6.
|
||||||
|
// QRandomGenerator::global() is auto-seeded (non-deterministically) by Qt, and calling ->seed()
|
||||||
|
// on the global/system generator aborts in Qt 6.10 ("Attempted to overwrite a QRandomGenerator to
|
||||||
|
// system() or global()"), so no explicit seed is needed here.
|
||||||
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
|
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
#include "thp_building_settings.h"
|
#include "thp_building_settings.h"
|
||||||
#include "ui_thp_building_settings.h"
|
#include "ui_thp_building_settings.h"
|
||||||
#include <Common/bdv_controller.h>
|
#include <BuildingViewer/Common/bdv_controller.h>
|
||||||
|
|
||||||
#include <LtsUtilsSettings/settings.h>
|
#include <LtsUtilsSettings/settings.h>
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ QString MemberInformationWrapper::ddsToJsonElement() const
|
|||||||
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||||
QStringLiteral("element.") + memberAccess + cppToJsonPost();
|
QStringLiteral("element.") + memberAccess + cppToJsonPost();
|
||||||
|
|
||||||
const QString optionalAccess = cppMemberName() + QStringLiteral(".is_set()");
|
const QString optionalAccess = cppMemberName() + QStringLiteral(".has_value()");
|
||||||
const QString getValue = cppMemberName();
|
const QString getValue = cppMemberName();
|
||||||
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
|
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
|
||||||
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
|
||||||
|
|||||||
@@ -17,7 +17,13 @@ SET(SRCS
|
|||||||
printing.h
|
printing.h
|
||||||
)
|
)
|
||||||
|
|
||||||
if (KDReports_FOUND AND QT6_GUI_AVAILABLE AND BUILD_CODIFICATION)
|
# Legacy always built the real LtsPrinting when KDReports was available
|
||||||
|
# (FIND_PACKAGE(KDReports REQUIRED)); it is a common lib consumed by many
|
||||||
|
# targets (e.g. SitmapGuiPlugin::doPrint -> LtsPrinting::printImage), so it must
|
||||||
|
# NOT be gated on the BUILD_CODIFICATION product flag (which only bundles the
|
||||||
|
# CodificationManagement/ReportViewer plugins). Build the real lib whenever
|
||||||
|
# KDReports is found; keep the stub only as a KDReports-absent fallback.
|
||||||
|
if (KDReports_FOUND AND QT6_GUI_AVAILABLE)
|
||||||
NGL_ADD_LIBRARY2(WS LtsPrinting SHARED ${SRCS})
|
NGL_ADD_LIBRARY2(WS LtsPrinting SHARED ${SRCS})
|
||||||
NGL_TARGET_INCLUDE_DIRECTORIES(LtsPrinting
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsPrinting
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@@ -38,5 +44,7 @@ if(QT6_GUI_AVAILABLE)
|
|||||||
endif()
|
endif()
|
||||||
NGL_INSTALL_TARGET(LtsPrinting)
|
NGL_INSTALL_TARGET(LtsPrinting)
|
||||||
else()
|
else()
|
||||||
message(STATUS "KDReports not found or BUILD_RTI disabled; skipping LtsPrinting target")
|
message(STATUS "KDReports not found or Qt6 GUI unavailable; building LtsPrinting stub (link-only, no printing symbols)")
|
||||||
|
add_library(LtsPrinting SHARED lts_printing_stub.cpp)
|
||||||
|
NGL_INSTALL_TARGET(LtsPrinting)
|
||||||
endif()
|
endif()
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// LtsPrinting link stub for the Qt6 migration.
|
||||||
|
//
|
||||||
|
// The real LtsPrinting library requires KDReports (a Qt5/KDE print-reporting
|
||||||
|
// library that is not available in the Qt6 toolchain). When KDReports is not
|
||||||
|
// found the real library is skipped (see CMakeLists.txt); this stub provides a
|
||||||
|
// linkable `LtsPrinting` target so that consumers referencing the target name
|
||||||
|
// (e.g. SmoCheckButtonHandler) still link. It exports no printing symbols.
|
||||||
|
namespace lts_printing_stub
|
||||||
|
{
|
||||||
|
int lts_printing_stub_marker()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -84,7 +84,7 @@ void printView(LtsSession::LtsSession* session, QWidget* dialogParent, const QAb
|
|||||||
|
|
||||||
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
||||||
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
|
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
|
||||||
dialogParent->windowTitle(), QPrinter::A4, QPrinter::Landscape);
|
dialogParent->windowTitle(), QPageSize(QPageSize::A4), QPageLayout::Landscape);
|
||||||
if (!nglPrinter.printer())
|
if (!nglPrinter.printer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -118,8 +118,8 @@ void printView(LtsSession::LtsSession* session, QWidget* dialogParent, QAbstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QImage& image, const QString& imageTitle,
|
void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QImage& image, const QString& imageTitle,
|
||||||
const QString& description, const QPrinter::PageSize& pageSize,
|
const QString& description, const QPageSize& pageSize,
|
||||||
const QPrinter::Orientation& pageOrientation)
|
const QPageLayout::Orientation& pageOrientation)
|
||||||
{
|
{
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
QTextCursor cursor(&doc);
|
QTextCursor cursor(&doc);
|
||||||
@@ -141,7 +141,7 @@ void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QI
|
|||||||
|
|
||||||
void printImages(LtsSession::LtsSession* session, QWidget* dialogParent, const QString& docName,
|
void printImages(LtsSession::LtsSession* session, QWidget* dialogParent, const QString& docName,
|
||||||
QVector<QImage>& images, QVector<QString>& imageTitles, QVector<QString>& descriptions,
|
QVector<QImage>& images, QVector<QString>& imageTitles, QVector<QString>& descriptions,
|
||||||
const QPrinter::PageSize& pageSize, const QPrinter::Orientation& pageOrientation)
|
const QPageSize& pageSize, const QPageLayout::Orientation& pageOrientation)
|
||||||
|
|
||||||
{
|
{
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
@@ -181,8 +181,8 @@ void printPDFImages(QWidget* dialogParent, const QString& docName, const QString
|
|||||||
QPrinter printer;
|
QPrinter printer;
|
||||||
|
|
||||||
printer.setColorMode(QPrinter::ColorMode::Color);
|
printer.setColorMode(QPrinter::ColorMode::Color);
|
||||||
printer.setOrientation(QPrinter::Orientation::Portrait);
|
printer.setPageOrientation(QPageLayout::Portrait);
|
||||||
printer.setPageSize(QPrinter::PageSize::A4);
|
printer.setPageSize(QPageSize(QPageSize::A4));
|
||||||
QString fn = docName;
|
QString fn = docName;
|
||||||
fn = fn.remove(QLatin1Char(' '));
|
fn = fn.remove(QLatin1Char(' '));
|
||||||
fn = fn.remove(QLatin1String(".."));
|
fn = fn.remove(QLatin1String(".."));
|
||||||
@@ -224,7 +224,7 @@ void printReport(LtsSession::LtsSession* session, QWidget* dialogParent, KDRepor
|
|||||||
|
|
||||||
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
||||||
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
|
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
|
||||||
dialogParent->windowTitle(), QPrinter::A3, QPrinter::Landscape);
|
dialogParent->windowTitle(), QPageSize(QPageSize::A3), QPageLayout::Landscape);
|
||||||
if (!nglPrinter.printer())
|
if (!nglPrinter.printer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -233,8 +233,8 @@ void printReport(LtsSession::LtsSession* session, QWidget* dialogParent, KDRepor
|
|||||||
cursor.movePosition(QTextCursor::End);
|
cursor.movePosition(QTextCursor::End);
|
||||||
|
|
||||||
report.setWidthForEndlessPrinter(0);
|
report.setWidthForEndlessPrinter(0);
|
||||||
report.setPageSize(QPrinter::A3);
|
report.setPageSize(QPageSize::A3);
|
||||||
report.setOrientation(QPrinter::Landscape);
|
report.setPageOrientation(QPageLayout::Landscape);
|
||||||
|
|
||||||
LtsPrinting::Base::printReportData(doc, report);
|
LtsPrinting::Base::printReportData(doc, report);
|
||||||
nglPrinter.print(&doc);
|
nglPrinter.print(&doc);
|
||||||
@@ -249,8 +249,8 @@ void printWidget(LtsSession::LtsSession* session, QWidget* dialogParent, QWidget
|
|||||||
|
|
||||||
QString windowTitle = dialogParent->windowTitle();
|
QString windowTitle = dialogParent->windowTitle();
|
||||||
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
||||||
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A3,
|
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
|
||||||
QPrinter::Landscape);
|
QPageSize(QPageSize::A3), QPageLayout::Landscape);
|
||||||
if (!nglPrinter.printer())
|
if (!nglPrinter.printer())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -271,8 +271,8 @@ void printMessage(LtsSession::LtsSession* session, QWidget* dialogParent, const
|
|||||||
QString windowTitle = subject;
|
QString windowTitle = subject;
|
||||||
|
|
||||||
doc.setMetaInformation(QTextDocument::DocumentTitle, subject);
|
doc.setMetaInformation(QTextDocument::DocumentTitle, subject);
|
||||||
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A4,
|
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
|
||||||
QPrinter::Portrait);
|
QPageSize(QPageSize::A4), QPageLayout::Portrait);
|
||||||
|
|
||||||
QString str = QString(QStringLiteral("<H2><strong>%1</strong> %2 </H2>")).arg(subject).arg(subjectContent);
|
QString str = QString(QStringLiteral("<H2><strong>%1</strong> %2 </H2>")).arg(subject).arg(subjectContent);
|
||||||
str.append(QString(QStringLiteral("<strong>%1</strong> %2<br>")).arg(time).arg(timeContent));
|
str.append(QString(QStringLiteral("<strong>%1</strong> %2<br>")).arg(time).arg(timeContent));
|
||||||
@@ -302,8 +302,8 @@ void printStoryboard(LtsSession::LtsSession* session, QWidget* dialogParent, QAb
|
|||||||
QString windowTitle = dialogParent->windowTitle();
|
QString windowTitle = dialogParent->windowTitle();
|
||||||
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
|
||||||
|
|
||||||
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A4,
|
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
|
||||||
QPrinter::Portrait);
|
QPageSize(QPageSize::A4), QPageLayout::Portrait);
|
||||||
|
|
||||||
if (!nglPrinter.printer())
|
if (!nglPrinter.printer())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3,6 +3,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtPrintSupport/QPrinter>
|
#include <QtPrintSupport/QPrinter>
|
||||||
|
#include <QtGui/QPageSize>
|
||||||
|
#include <QtGui/QPageLayout>
|
||||||
|
|
||||||
#ifndef LTSPRINTING_EXPORT
|
#ifndef LTSPRINTING_EXPORT
|
||||||
#ifdef BUILD_STATIC_LIBRARIES
|
#ifdef BUILD_STATIC_LIBRARIES
|
||||||
@@ -42,13 +44,13 @@ LTSPRINTING_EXPORT void printStoryboard(LtsSession::LtsSession* session, QWidget
|
|||||||
|
|
||||||
LTSPRINTING_EXPORT void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QImage& image,
|
LTSPRINTING_EXPORT void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QImage& image,
|
||||||
const QString& imageTitle, const QString& description,
|
const QString& imageTitle, const QString& description,
|
||||||
const QPrinter::PageSize& pageSize = QPrinter::A3,
|
const QPageSize& pageSize = QPageSize(QPageSize::A3),
|
||||||
const QPrinter::Orientation& pageOrientation = QPrinter::Landscape);
|
const QPageLayout::Orientation& pageOrientation = QPageLayout::Landscape);
|
||||||
|
|
||||||
LTSPRINTING_EXPORT void printImages(LtsSession::LtsSession* session, QWidget* dialogParent, const QString& docName,
|
LTSPRINTING_EXPORT void printImages(LtsSession::LtsSession* session, QWidget* dialogParent, const QString& docName,
|
||||||
QVector<QImage>& images, QVector<QString>& imageTitles,
|
QVector<QImage>& images, QVector<QString>& imageTitles,
|
||||||
QVector<QString>& descriptions, const QPrinter::PageSize& pageSize = QPrinter::A3,
|
QVector<QString>& descriptions, const QPageSize& pageSize = QPageSize(QPageSize::A3),
|
||||||
const QPrinter::Orientation& pageOrientation = QPrinter::Landscape);
|
const QPageLayout::Orientation& pageOrientation = QPageLayout::Landscape);
|
||||||
|
|
||||||
LTSPRINTING_EXPORT void printPDFImages(QWidget* dialogParent, const QString& docName, const QString& printPath,
|
LTSPRINTING_EXPORT void printPDFImages(QWidget* dialogParent, const QString& docName, const QString& printPath,
|
||||||
QVector<QImage>& images);
|
QVector<QImage>& images);
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ Base::Base(QTextDocument &doc,
|
|||||||
QWidget *dialogParent,
|
QWidget *dialogParent,
|
||||||
const QString &dialogTitle,
|
const QString &dialogTitle,
|
||||||
const QString &_fn,
|
const QString &_fn,
|
||||||
QPrinter::PaperSize _ps,
|
QPageSize _ps,
|
||||||
QPrinter::Orientation _or,
|
QPageLayout::Orientation _or,
|
||||||
QPrinter::ColorMode _cm) : m_printer(new QPrinter),
|
QPrinter::ColorMode _cm) : m_printer(new QPrinter),
|
||||||
m_painter(new QPainter),
|
m_painter(new QPainter),
|
||||||
m_iconFilenameNr(0),
|
m_iconFilenameNr(0),
|
||||||
@@ -61,9 +61,9 @@ Base::Base(QTextDocument &doc,
|
|||||||
headersize_(10), headerrule_(0.5), headertext_(HeaderText),
|
headersize_(10), headerrule_(0.5), headertext_(HeaderText),
|
||||||
footersize_(10), footerrule_(0.5), footertext_(FooterText),
|
footersize_(10), footerrule_(0.5), footertext_(FooterText),
|
||||||
itemFontSize_(2),
|
itemFontSize_(2),
|
||||||
m_settings(new NGL::Settings(NGL::findProjectConfigFile())).getNGLLogger("NGLPrinting")),
|
m_settings(new NGL::Settings(NGL::findProjectConfigFile())),
|
||||||
m_currentPage(1),
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("NGLPrinting")),
|
||||||
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
m_currentPage(1)
|
||||||
{
|
{
|
||||||
QString fn = _fn;
|
QString fn = _fn;
|
||||||
fn = fn.remove(QLatin1Char(' '));
|
fn = fn.remove(QLatin1Char(' '));
|
||||||
@@ -77,8 +77,8 @@ Base::Base(QTextDocument &doc,
|
|||||||
#endif
|
#endif
|
||||||
m_printer->setOutputFormat(QPrinter::NativeFormat);
|
m_printer->setOutputFormat(QPrinter::NativeFormat);
|
||||||
|
|
||||||
m_printer->setPaperSize(_ps);
|
m_printer->setPageSize(_ps);
|
||||||
m_printer->setOrientation(_or);
|
m_printer->setPageOrientation(_or);
|
||||||
m_printer->setColorMode(_cm);
|
m_printer->setColorMode(_cm);
|
||||||
|
|
||||||
m_printer->setFullPage(true);
|
m_printer->setFullPage(true);
|
||||||
@@ -101,13 +101,13 @@ Base::Base(QTextDocument &doc,
|
|||||||
QAbstractPrintDialog::PrintCollateCopies;
|
QAbstractPrintDialog::PrintCollateCopies;
|
||||||
dialog->setOptions(op);
|
dialog->setOptions(op);
|
||||||
QString title = dialogTitle;
|
QString title = dialogTitle;
|
||||||
if (_ps == QPrinter::A2)
|
if (_ps.id() == QPageSize::A2)
|
||||||
title += QLatin1String(" (A2)");
|
title += QLatin1String(" (A2)");
|
||||||
if (_ps == QPrinter::A3)
|
if (_ps.id() == QPageSize::A3)
|
||||||
title += QLatin1String(" (A3)");
|
title += QLatin1String(" (A3)");
|
||||||
if (_ps == QPrinter::A4)
|
if (_ps.id() == QPageSize::A4)
|
||||||
title += QLatin1String(" (A4)");
|
title += QLatin1String(" (A4)");
|
||||||
if (_ps == QPrinter::A5)
|
if (_ps.id() == QPageSize::A5)
|
||||||
title += QLatin1String(" (A5)");
|
title += QLatin1String(" (A5)");
|
||||||
dialog->setWindowTitle(title);
|
dialog->setWindowTitle(title);
|
||||||
if (dialog->exec() != QDialog::Accepted)
|
if (dialog->exec() != QDialog::Accepted)
|
||||||
@@ -153,7 +153,7 @@ QString Base::styleSheet()
|
|||||||
|
|
||||||
QSize Base::printerPageSize() const
|
QSize Base::printerPageSize() const
|
||||||
{
|
{
|
||||||
return QSize(m_printer->pageRect().width() - 2 * DOC_MARGIN, m_printer->pageRect().height() - 2 * DOC_MARGIN);
|
return QSize(m_printer->pageRect(QPrinter::Point).width() - 2 * DOC_MARGIN, m_printer->pageRect(QPrinter::Point).height() - 2 * DOC_MARGIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Base::newPage()
|
bool Base::newPage()
|
||||||
@@ -543,7 +543,7 @@ bool Base::printItemData(QString& str, const QAbstractItemModel* model, const QM
|
|||||||
displayString += vdata.toString();
|
displayString += vdata.toString();
|
||||||
|
|
||||||
QString fgColorString;
|
QString fgColorString;
|
||||||
vdata = model->data(mi, Qt::TextColorRole);
|
vdata = model->data(mi, Qt::ForegroundRole);
|
||||||
if (vdata.isValid())
|
if (vdata.isValid())
|
||||||
fgColorString = vdata.value<QColor>().name();
|
fgColorString = vdata.value<QColor>().name();
|
||||||
|
|
||||||
@@ -684,24 +684,24 @@ bool Base::printReportData(QTextDocument& doc, KDReports::Report& report)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPrinter::PageSize Base::pageSize() const
|
QPageSize Base::pageSize() const
|
||||||
{
|
{
|
||||||
return m_printer->pageSize();
|
return m_printer->pageLayout().pageSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Base::setPageSize(QPrinter::PageSize size)
|
void Base::setPageSize(QPageSize size)
|
||||||
{
|
{
|
||||||
m_printer->setPageSize(size);
|
m_printer->setPageSize(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPrinter::Orientation Base::orientation() const
|
QPageLayout::Orientation Base::orientation() const
|
||||||
{
|
{
|
||||||
return m_printer->orientation();
|
return m_printer->pageLayout().orientation();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Base::setOrientation(QPrinter::Orientation orientation)
|
void Base::setOrientation(QPageLayout::Orientation orientation)
|
||||||
{
|
{
|
||||||
m_printer->setOrientation(orientation);
|
m_printer->setPageOrientation(orientation);
|
||||||
}
|
}
|
||||||
|
|
||||||
double Base::leftMargin() const
|
double Base::leftMargin() const
|
||||||
@@ -711,7 +711,7 @@ double Base::leftMargin() const
|
|||||||
|
|
||||||
void Base::setLeftMargin(double margin)
|
void Base::setLeftMargin(double margin)
|
||||||
{
|
{
|
||||||
if ((margin > 0) && (margin < m_printer->paperRect().width() / 2))
|
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
|
||||||
leftmargin_ = margin;
|
leftmargin_ = margin;
|
||||||
else
|
else
|
||||||
leftmargin_ = 0;
|
leftmargin_ = 0;
|
||||||
@@ -724,7 +724,7 @@ double Base::rightMargin() const
|
|||||||
|
|
||||||
void Base::setRightMargin(double margin)
|
void Base::setRightMargin(double margin)
|
||||||
{
|
{
|
||||||
if ((margin > 0) && (margin < m_printer->paperRect().width() / 2))
|
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
|
||||||
rightmargin_ = margin;
|
rightmargin_ = margin;
|
||||||
else
|
else
|
||||||
rightmargin_ = 0;
|
rightmargin_ = 0;
|
||||||
@@ -737,7 +737,7 @@ double Base::topMargin() const
|
|||||||
|
|
||||||
void Base::setTopMargin(double margin)
|
void Base::setTopMargin(double margin)
|
||||||
{
|
{
|
||||||
if ((margin > 0) && (margin < m_printer->paperRect().height() / 4))
|
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 4))
|
||||||
topmargin_ = margin;
|
topmargin_ = margin;
|
||||||
else
|
else
|
||||||
topmargin_ = 0;
|
topmargin_ = 0;
|
||||||
@@ -750,7 +750,7 @@ double Base::bottomMargin() const
|
|||||||
|
|
||||||
void Base::setBottomMargin(double margin)
|
void Base::setBottomMargin(double margin)
|
||||||
{
|
{
|
||||||
if ((margin > 0) && (margin < m_printer->paperRect().height() / 4))
|
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 4))
|
||||||
bottommargin_ = margin;
|
bottommargin_ = margin;
|
||||||
else
|
else
|
||||||
bottommargin_ = 0;
|
bottommargin_ = 0;
|
||||||
@@ -758,7 +758,7 @@ void Base::setBottomMargin(double margin)
|
|||||||
|
|
||||||
void Base::setMargins(double margin)
|
void Base::setMargins(double margin)
|
||||||
{
|
{
|
||||||
if ((margin > 0) && (margin < m_printer->paperRect().height() / 2) && (margin < m_printer->paperRect().width() / 2))
|
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 2) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
|
||||||
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = margin;
|
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = margin;
|
||||||
else
|
else
|
||||||
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = 0;
|
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = 0;
|
||||||
@@ -771,7 +771,7 @@ double Base::spacing() const
|
|||||||
|
|
||||||
void Base::setSpacing(double spacing)
|
void Base::setSpacing(double spacing)
|
||||||
{
|
{
|
||||||
if ((spacing > 0) && (spacing <= m_printer->paperRect().height() / 8))
|
if ((spacing > 0) && (spacing <= m_printer->paperRect(QPrinter::Point).height() / 8))
|
||||||
spacing_ = spacing;
|
spacing_ = spacing;
|
||||||
else
|
else
|
||||||
spacing_ = 0;
|
spacing_ = 0;
|
||||||
@@ -784,7 +784,7 @@ double Base::headerSize() const
|
|||||||
|
|
||||||
void Base::setHeaderSize(double size)
|
void Base::setHeaderSize(double size)
|
||||||
{
|
{
|
||||||
if ((size > 0) && (size <= m_printer->paperRect().height() / 8))
|
if ((size > 0) && (size <= m_printer->paperRect(QPrinter::Point).height() / 8))
|
||||||
headersize_ = size;
|
headersize_ = size;
|
||||||
else
|
else
|
||||||
headersize_ = 0;
|
headersize_ = 0;
|
||||||
@@ -817,7 +817,7 @@ double Base::footerSize() const
|
|||||||
|
|
||||||
void Base::setFooterSize(double size)
|
void Base::setFooterSize(double size)
|
||||||
{
|
{
|
||||||
if ((size > 0) && (size <= m_printer->paperRect().height() / 8))
|
if ((size > 0) && (size <= m_printer->paperRect(QPrinter::Point).height() / 8))
|
||||||
footersize_ = size;
|
footersize_ = size;
|
||||||
else
|
else
|
||||||
footersize_ = 0;
|
footersize_ = 0;
|
||||||
@@ -851,7 +851,7 @@ void Base::setItemFontSize(int itemFontSize)
|
|||||||
QRectF Base::paperRect(QPaintDevice* device)
|
QRectF Base::paperRect(QPaintDevice* device)
|
||||||
{
|
{
|
||||||
|
|
||||||
QRectF rect = m_printer->paperRect();
|
QRectF rect = m_printer->paperRect(QPrinter::Point);
|
||||||
|
|
||||||
rect.setWidth(rect.width() * device->logicalDpiX() / m_printer->logicalDpiX());
|
rect.setWidth(rect.width() * device->logicalDpiX() / m_printer->logicalDpiX());
|
||||||
rect.setHeight(rect.height() * device->logicalDpiY() / m_printer->logicalDpiY());
|
rect.setHeight(rect.height() * device->logicalDpiY() / m_printer->logicalDpiY());
|
||||||
@@ -930,7 +930,7 @@ void Base::printSinglePage()
|
|||||||
m_tempdoc->setPageSize(contentRect(m_printer).size());
|
m_tempdoc->setPageSize(contentRect(m_printer).size());
|
||||||
|
|
||||||
QTextFrameFormat fmt = m_tempdoc->rootFrame()->frameFormat();
|
QTextFrameFormat fmt = m_tempdoc->rootFrame()->frameFormat();
|
||||||
fmt.setContentsMargins(0, 0, 0, 0);
|
fmt.setMargin(0);
|
||||||
m_tempdoc->rootFrame()->setFrameFormat(fmt);
|
m_tempdoc->rootFrame()->setFrameFormat(fmt);
|
||||||
|
|
||||||
int doccopies;
|
int doccopies;
|
||||||
@@ -938,11 +938,11 @@ void Base::printSinglePage()
|
|||||||
if (m_printer->collateCopies())
|
if (m_printer->collateCopies())
|
||||||
{
|
{
|
||||||
doccopies = 1;
|
doccopies = 1;
|
||||||
pagecopies = m_printer->numCopies();
|
pagecopies = m_printer->copyCount();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
doccopies = m_printer->numCopies();
|
doccopies = m_printer->copyCount();
|
||||||
pagecopies = 1;
|
pagecopies = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include <QtCore/QSet>
|
#include <QtCore/QSet>
|
||||||
#include <QtPrintSupport/QPrinter>
|
#include <QtPrintSupport/QPrinter>
|
||||||
|
#include <QtGui/QPageSize>
|
||||||
|
#include <QtGui/QPageLayout>
|
||||||
|
|
||||||
namespace NGL
|
namespace NGL
|
||||||
{
|
{
|
||||||
@@ -50,7 +52,7 @@ class Base
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Base(QTextDocument& doc, QWidget* dialogParent, const QString& dialogTitle, const QString& _fn,
|
Base(QTextDocument& doc, QWidget* dialogParent, const QString& dialogTitle, const QString& _fn,
|
||||||
QPrinter::PaperSize _ps = QPrinter::A4, QPrinter::Orientation _or = QPrinter::Portrait,
|
QPageSize _ps = QPageSize(QPageSize::A4), QPageLayout::Orientation _or = QPageLayout::Portrait,
|
||||||
QPrinter::ColorMode _cm = QPrinter::Color);
|
QPrinter::ColorMode _cm = QPrinter::Color);
|
||||||
|
|
||||||
virtual ~Base();
|
virtual ~Base();
|
||||||
@@ -61,13 +63,13 @@ class Base
|
|||||||
|
|
||||||
static QString styleSheet();
|
static QString styleSheet();
|
||||||
|
|
||||||
QPrinter::PageSize pageSize() const;
|
QPageSize pageSize() const;
|
||||||
|
|
||||||
void setPageSize(QPrinter::PageSize size);
|
void setPageSize(QPageSize size);
|
||||||
|
|
||||||
QPrinter::Orientation orientation() const;
|
QPageLayout::Orientation orientation() const;
|
||||||
|
|
||||||
void setOrientation(QPrinter::Orientation orientation);
|
void setOrientation(QPageLayout::Orientation orientation);
|
||||||
|
|
||||||
bool newPage();
|
bool newPage();
|
||||||
|
|
||||||
|
|||||||
+9
-3
@@ -175,7 +175,13 @@ bool CTS::DisconnectRequest::hasValidData() const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
LtsProjectionWorkstation::ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
|
// Unqualified: we are already inside namespace LtsProjectionWorkstation, and the unity
|
||||||
|
// build concatenates lts_projection_workstation.cpp (which declares
|
||||||
|
// class LtsProjectionWorkstation in this same namespace) into this TU, so
|
||||||
|
// "LtsProjectionWorkstation::ErrorMessage" would resolve to the class (which has no
|
||||||
|
// such member) instead of the namespace. In a separate TU (legacy structure) the
|
||||||
|
// class is not visible here and the qualified name resolved to the namespace.
|
||||||
|
ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
|
||||||
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue()), m_reason(reason)
|
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue()), m_reason(reason)
|
||||||
{
|
{
|
||||||
QJsonObject result;
|
QJsonObject result;
|
||||||
@@ -183,7 +189,7 @@ LtsProjectionWorkstation::ErrorMessage::ErrorMessage(const QString& uuid, const
|
|||||||
m_replyData = result;
|
m_replyData = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LtsProjectionWorkstation::ErrorMessage::process()
|
void ErrorMessage::process()
|
||||||
{
|
{
|
||||||
if (!m_handler || !m_client)
|
if (!m_handler || !m_client)
|
||||||
return;
|
return;
|
||||||
@@ -192,7 +198,7 @@ void LtsProjectionWorkstation::ErrorMessage::process()
|
|||||||
m_handler->handleMessage(this);
|
m_handler->handleMessage(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LtsProjectionWorkstation::ErrorMessage::hasValidData() const
|
bool ErrorMessage::hasValidData() const
|
||||||
{
|
{
|
||||||
if (!m_handler || !m_client)
|
if (!m_handler || !m_client)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -916,6 +916,11 @@ void LtsSession::setExerciseData(const LtsWidgets::ExerciseData& exerciseData)
|
|||||||
emit signalExerciseDataChanged();
|
emit signalExerciseDataChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LtsWidgets::ExerciseData* LtsSession::exerciseData() const
|
||||||
|
{
|
||||||
|
return m_exerciseData;
|
||||||
|
}
|
||||||
|
|
||||||
void LtsSession::setProfilePicture(const QPixmap& pixmap)
|
void LtsSession::setProfilePicture(const QPixmap& pixmap)
|
||||||
{
|
{
|
||||||
// partitionType(); ?!?
|
// partitionType(); ?!?
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "lts_session_lock_handler.h"
|
#include "lts_session_lock_handler.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include <QtCore/QDebug>
|
#include <QtCore/QDebug>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
#include <QtGui/QPainter>
|
#include <QtGui/QPainter>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "TimelineHeaderView.h"
|
#include "TimelineHeaderView.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include "TimelineWidget.h"
|
#include "TimelineWidget.h"
|
||||||
|
|
||||||
|
|||||||
+14
@@ -53,6 +53,20 @@ NGL_TARGET_COMPILE_DEFINITIONS(LtsUtilsGuiDds
|
|||||||
REQUEST_HELPER_WITH_GUI
|
REQUEST_HELPER_WITH_GUI
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# The dds_vector_to_pixmap free functions (iconFromSvg / pixmapFromIcon / ...) are
|
||||||
|
# declared with LTSUTILSCORE_EXPORT, but this TU's include
|
||||||
|
# <LtsUtils/LtsUtilsCore/ltsutilscore_export.h> resolves to the SOURCE-tree header,
|
||||||
|
# where the macro expands to Q_DECL_IMPORT (empty on Linux) because
|
||||||
|
# MAKE_LTSUTILSCORE_LIB is only defined when building LtsUtilsCore itself. Under the
|
||||||
|
# project-wide -fvisibility=hidden they therefore compile as hidden symbols and, with
|
||||||
|
# USE_IPO=ON, LTO drops them from the DSO entirely (they are unreferenced inside this
|
||||||
|
# lib), breaking every consumer that links them (LtsMultiMonitor, LtsSession, ...).
|
||||||
|
# Legacy exported them because its include <LtsUtilsCore/ltsutilscore_export.h>
|
||||||
|
# resolved to the GENERATED export header (visibility("default")). Restore that
|
||||||
|
# default visibility for this target only (same fix shape as the PluginInterfaces
|
||||||
|
# visibility preset); behavior-neutral.
|
||||||
|
set_target_properties(LtsUtilsGuiDds PROPERTIES CXX_VISIBILITY_PRESET default)
|
||||||
|
|
||||||
|
|
||||||
NGL_ADD_LIBRARY2(AAR HLA SV LtsUtilsDds SHARED request_helper.cpp request_helper.h)
|
NGL_ADD_LIBRARY2(AAR HLA SV LtsUtilsDds SHARED request_helper.cpp request_helper.h)
|
||||||
NGL_TARGET_INCLUDE_DIRECTORIES(LtsUtilsDds
|
NGL_TARGET_INCLUDE_DIRECTORIES(LtsUtilsDds
|
||||||
|
|||||||
@@ -183,6 +183,13 @@ NGL_INSTALL_TARGET(LtsWidgets)
|
|||||||
SET(ltswidgetsplugin_SRCS ltswidgetsplugin.cpp ltswidgetsplugin.json)
|
SET(ltswidgetsplugin_SRCS ltswidgetsplugin.cpp ltswidgetsplugin.json)
|
||||||
NGL_ADD_LIBRARY(WS ltswidgetsplugin MODULE ${ltswidgetsplugin_SRCS})
|
NGL_ADD_LIBRARY(WS ltswidgetsplugin MODULE ${ltswidgetsplugin_SRCS})
|
||||||
NGL_TARGET_LINK_LIBRARIES(ltswidgetsplugin LtsWidgets ltsCoordWidget LtsDataView LtsFileDialog LtsReportDisplay svcFlmCommon)
|
NGL_TARGET_LINK_LIBRARIES(ltswidgetsplugin LtsWidgets ltsCoordWidget LtsDataView LtsFileDialog LtsReportDisplay svcFlmCommon)
|
||||||
|
# ltswidgetsplugin.cpp unconditionally includes <LtsReportDisplay/lts_report_display_widget.h>,
|
||||||
|
# which pulls KDReports -> #include <QPrinter>. In Qt6 that forwarding header lives in
|
||||||
|
# <QtInc>/QtPrintSupport. With BUILD_CODIFICATION=OFF the LtsReportDisplay->KDReports
|
||||||
|
# include chain is not built, so expose the QtPrintSupport module dir directly.
|
||||||
|
if(DEFINED QT6_INC_DIR AND EXISTS "${QT6_INC_DIR}/QtPrintSupport")
|
||||||
|
NGL_TARGET_INCLUDE_DIRECTORIES(ltswidgetsplugin PRIVATE "${QT6_INC_DIR}/QtPrintSupport")
|
||||||
|
endif()
|
||||||
NGL_SET_TARGET_PROPERTIES(ltswidgetsplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/designer)
|
NGL_SET_TARGET_PROPERTIES(ltswidgetsplugin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/designer)
|
||||||
NGL_INSTALL_TARGET(ltswidgetsplugin DESTINATION lib/designer COMPONENT Devel)
|
NGL_INSTALL_TARGET(ltswidgetsplugin DESTINATION lib/designer COMPONENT Devel)
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ public:
|
|||||||
{
|
{
|
||||||
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
|
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
|
||||||
if (entry.first)
|
if (entry.first)
|
||||||
ids << entry.second.id();
|
ids << entry.second.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids;
|
||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
{
|
{
|
||||||
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
|
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
|
||||||
if (!entry.first)
|
if (!entry.first)
|
||||||
ids << entry.second.id();
|
ids << entry.second.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids;
|
||||||
@@ -84,7 +84,7 @@ public:
|
|||||||
for (int row = 0; row < LtsAbstractTableModel<T>::rowCount(); ++row)
|
for (int row = 0; row < LtsAbstractTableModel<T>::rowCount(); ++row)
|
||||||
{
|
{
|
||||||
T &entry = LtsAbstractTableModel<T>::m_vecData[row];
|
T &entry = LtsAbstractTableModel<T>::m_vecData[row];
|
||||||
bool bContains = vecCheckedIds.contains(entry.second.id());
|
bool bContains = vecCheckedIds.contains(entry.second.id);
|
||||||
if (entry.first != bContains)
|
if (entry.first != bContains)
|
||||||
{
|
{
|
||||||
entry.first = bContains;
|
entry.first = bContains;
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "lts_dialog.h"
|
#include "lts_dialog.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "lts_progress_dialog_helper.h"
|
#include "lts_progress_dialog_helper.h"
|
||||||
#include "lts_message_dialog.h"
|
#include "lts_message_dialog.h"
|
||||||
#include "lts_dialog_helper.h"
|
#include "lts_dialog_helper.h"
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void translate(T *ui, const S &data, const QString &custom, const QString &title) // same as 'void translate(T *ui, const S &data, const QString &title)', but for topics without the 'name' entry
|
void translate(T *ui, const S &data, const QString &custom, const QString &title) // same as 'void translate(T *ui, const S &data, const QString &title)', but for topics without the 'name' entry
|
||||||
{
|
{
|
||||||
translate(ui, QString::fromUtf8(typeid(data).name()), data.id(), custom /* can be empty */, title);
|
translate(ui, QString::fromUtf8(typeid(data).name()), data.id, custom /* can be empty */, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -341,7 +341,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
void translate(T *ui, const S &data, const QString &title)
|
void translate(T *ui, const S &data, const QString &title)
|
||||||
{
|
{
|
||||||
translate(ui, data, QString::fromStdString(data.name()), title); // -> translate #5
|
translate(ui, data, QString::fromStdString(data.name), title); // -> translate #5
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,142 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "requirement_widget.h"
|
|
||||||
|
|
||||||
#include <LtsWidgets/lts_message_dialog.h>
|
|
||||||
#include <QtWidgets/QApplication>
|
|
||||||
#include <QtWidgets/QLabel>
|
|
||||||
|
|
||||||
namespace LtsWidgets
|
|
||||||
{
|
|
||||||
UiRequirement::UiRequirement(QLabel* descriptionLabel, const std::function<bool()>& requirementCheck,
|
|
||||||
const QString& userWarningMessage)
|
|
||||||
: m_descriptionLabel(descriptionLabel), m_requirementCheck(requirementCheck), m_lastResult(true),
|
|
||||||
m_userWarningMessage(userWarningMessage)
|
|
||||||
{
|
|
||||||
retranslate();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirement::reset()
|
|
||||||
{
|
|
||||||
if (!isValid())
|
|
||||||
return;
|
|
||||||
m_descriptionLabel->setText(m_originalText);
|
|
||||||
m_descriptionLabel->setToolTip(m_originalTooltip);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirement::setTexts()
|
|
||||||
{
|
|
||||||
if (!isValid())
|
|
||||||
return;
|
|
||||||
if (!m_lastResult)
|
|
||||||
{
|
|
||||||
m_descriptionLabel->setText(
|
|
||||||
QStringLiteral("<span style=\"color:#aa0000;\">\u2022 %1</span>").arg(m_originalText));
|
|
||||||
|
|
||||||
if (!m_userWarningMessage.isEmpty())
|
|
||||||
{
|
|
||||||
m_descriptionLabel->setCursor(Qt::WhatsThisCursor);
|
|
||||||
m_descriptionLabel->setToolTip(m_userWarningMessage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_originalText.startsWith(QStringLiteral("\u2022 ")))
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_descriptionLabel->setText(QStringLiteral("\u2022 %1").arg(m_originalText));
|
|
||||||
m_descriptionLabel->setCursor(Qt::ArrowCursor);
|
|
||||||
m_descriptionLabel->setToolTip(m_originalTooltip);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirement::retranslate()
|
|
||||||
{
|
|
||||||
if (!isValid())
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (m_originalText.startsWith(QStringLiteral("\u2022 ")))
|
|
||||||
return;
|
|
||||||
|
|
||||||
auto x = m_descriptionLabel->text();
|
|
||||||
if (x.startsWith(QStringLiteral("\u2022 ")))
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_originalText = x;
|
|
||||||
|
|
||||||
m_originalTooltip = m_descriptionLabel->toolTip();
|
|
||||||
setTexts();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UiRequirement::checkRequirement()
|
|
||||||
{
|
|
||||||
if (!isValid())
|
|
||||||
return m_lastResult;
|
|
||||||
|
|
||||||
m_lastResult = m_requirementCheck();
|
|
||||||
|
|
||||||
if (!m_descriptionLabel->isVisible() && !m_descriptionLabel->property("checkMe").toBool())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
setTexts();
|
|
||||||
|
|
||||||
return m_lastResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool UiRequirementList::checkRequirements(QWidget* messageOnThisParent)
|
|
||||||
{
|
|
||||||
bool result = true;
|
|
||||||
for (auto i = m_requirementList.begin(); i != m_requirementList.end(); ++i)
|
|
||||||
{
|
|
||||||
UiRequirement& r = (*i);
|
|
||||||
|
|
||||||
if (!r.isValid())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (!r.checkRequirement())
|
|
||||||
{
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!result && messageOnThisParent)
|
|
||||||
{
|
|
||||||
LtsWidgets::LtsMessageDialog::showMessage(
|
|
||||||
messageOnThisParent,
|
|
||||||
QApplication::translate("LtsWidgets::LtsDialog",
|
|
||||||
"There are elements that have invalid or no value.<br>"
|
|
||||||
"Please change values in the elements which are marked with red text."),
|
|
||||||
QApplication::translate("LtsWidgets::LtsDialog", "Operation not complete"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirementList::addRequirement(const UiRequirement& uiRequirement)
|
|
||||||
{
|
|
||||||
m_requirementList.append(uiRequirement);
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirementList::clear()
|
|
||||||
{
|
|
||||||
for (auto i = m_requirementList.begin(); i != m_requirementList.end(); ++i)
|
|
||||||
{
|
|
||||||
UiRequirement& uir = *i;
|
|
||||||
uir.reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
m_requirementList.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void UiRequirementList::retranslate()
|
|
||||||
{
|
|
||||||
for (auto i = m_requirementList.begin(); i != m_requirementList.end(); ++i)
|
|
||||||
{
|
|
||||||
UiRequirement& r = (*i);
|
|
||||||
|
|
||||||
r.retranslate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} // namespace LtsWidgets
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "lts_widgets_export.h"
|
|
||||||
|
|
||||||
#include <QtCore/QVector>
|
|
||||||
#include <QtWidgets/QWidget>
|
|
||||||
#include <functional>
|
|
||||||
|
|
||||||
class QLabel;
|
|
||||||
|
|
||||||
namespace LtsWidgets
|
|
||||||
{
|
|
||||||
|
|
||||||
class LTSWIDGETS_EXPORT UiRequirement
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit UiRequirement() = default;
|
|
||||||
|
|
||||||
UiRequirement(QLabel* descriptionLabel, const std::function<bool()>& requirementCheck,
|
|
||||||
const QString& userWarningMessage = QString());
|
|
||||||
|
|
||||||
void reset();
|
|
||||||
|
|
||||||
bool checkRequirement();
|
|
||||||
|
|
||||||
bool isValid() const
|
|
||||||
{
|
|
||||||
return m_descriptionLabel != nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
void retranslate();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void setTexts();
|
|
||||||
|
|
||||||
QLabel* m_descriptionLabel;
|
|
||||||
std::function<bool()> m_requirementCheck;
|
|
||||||
QString m_originalText;
|
|
||||||
QString m_originalTooltip;
|
|
||||||
bool m_lastResult;
|
|
||||||
QString m_userWarningMessage;
|
|
||||||
};
|
|
||||||
|
|
||||||
class LTSWIDGETS_EXPORT UiRequirementList
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
UiRequirementList() = default;
|
|
||||||
|
|
||||||
bool checkRequirements(QWidget* messageOnThisParent = nullptr);
|
|
||||||
|
|
||||||
void addRequirement(const UiRequirement& uiRequirement);
|
|
||||||
|
|
||||||
void clear();
|
|
||||||
|
|
||||||
void retranslate();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QVector<UiRequirement> m_requirementList;
|
|
||||||
};
|
|
||||||
} // namespace LtsWidgets
|
|
||||||
@@ -56,3 +56,22 @@ TARGET_INCLUDE_DIRECTORIES(TopicReplayInterface PUBLIC
|
|||||||
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
|
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
|
||||||
)
|
)
|
||||||
TARGET_LINK_LIBRARIES(TopicReplayInterface PUBLIC Qt6::Core TopicEditorBase)
|
TARGET_LINK_LIBRARIES(TopicReplayInterface PUBLIC Qt6::Core TopicEditorBase)
|
||||||
|
|
||||||
|
# These interface base classes (e.g. DataPluginBase::Plugin) are Q_OBJECT classes. The top-level
|
||||||
|
# CMAKE_CXX_VISIBILITY_PRESET hidden compiles their Q_OBJECT meta symbols (staticMetaObject/vtable/
|
||||||
|
# qt_metacall/typeinfo) as GLOBAL HIDDEN, so they are not exported from the .so. A cross-DSO
|
||||||
|
# subclass (e.g. AsbDataPlugin) then fails with "undefined reference to ...::staticMetaObject".
|
||||||
|
# Compile these interface libs with default visibility so the meta symbols are exported to consumers
|
||||||
|
# (the legacy build, without LTO, exported them). This only widens the export surface of these tiny
|
||||||
|
# interface libs; it changes no runtime behaviour.
|
||||||
|
set_target_properties(
|
||||||
|
DataPluginInterface
|
||||||
|
GuiPluginInterface
|
||||||
|
ProjectPluginInterface
|
||||||
|
StylePluginInterface
|
||||||
|
RecordReplayPlugin
|
||||||
|
TopicReplayInterface
|
||||||
|
PROPERTIES
|
||||||
|
CXX_VISIBILITY_PRESET default
|
||||||
|
CXX_VISIBILITY_INLINES_HIDDEN OFF
|
||||||
|
)
|
||||||
@@ -132,12 +132,12 @@ class Interface
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
LtsSession::LtsSession* m_session;
|
LtsSession::LtsSession* m_session;
|
||||||
|
NGL::INGLLogger& m_logger;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QFlags<LtsAppDescriptor::PluginInfo::Flag> m_flags;
|
QFlags<LtsAppDescriptor::PluginInfo::Flag> m_flags;
|
||||||
QStringList m_options;
|
QStringList m_options;
|
||||||
LtsAppDescriptor::App m_appId;
|
LtsAppDescriptor::App m_appId;
|
||||||
NGL::INGLLogger& m_logger;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace GuiPluginBase
|
} // namespace GuiPluginBase
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ NGL_ADD_LIBRARY2(WS TopicEditorBase SHARED ${topic_editor_base_SRCS})
|
|||||||
NGL_TARGET_INCLUDE_DIRECTORIES(TopicEditorBase
|
NGL_TARGET_INCLUDE_DIRECTORIES(TopicEditorBase
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../
|
${CMAKE_CURRENT_SOURCE_DIR}/../
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR} # topiceditorbase_export.h (generated here)
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/../ # auto-export file
|
${CMAKE_CURRENT_BINARY_DIR}/../ # auto-export file
|
||||||
${CMAKE_BINARY_DIR}/Z/src/NGLLogger # ngllogger_export.h
|
${CMAKE_BINARY_DIR}/Z/src/NGLLogger # ngllogger_export.h
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "topic_editor_utils.h"
|
#include "topic_editor_utils.h"
|
||||||
#include "topiceditorbase_export.h"
|
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
|
||||||
|
|
||||||
#include <LtsUtils/LtsUtilsCore/promise.h>
|
#include <LtsUtils/LtsUtilsCore/promise.h>
|
||||||
#include <LtsWidgets/lts_dialog.h>
|
#include <LtsWidgets/lts_dialog.h>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "topiceditorbase_export.h"
|
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
|
||||||
|
|
||||||
#include <LtsScriptTimeline/track_entry.h>
|
#include <LtsScriptTimeline/track_entry.h>
|
||||||
#include <QtCore/QVector>
|
#include <QtCore/QVector>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "topic_editor_utils.h"
|
#include "topic_editor_utils.h"
|
||||||
#include "topiceditorbase_export.h"
|
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "topic_editor_utils.h"
|
#include "topic_editor_utils.h"
|
||||||
#include "topiceditorbase_export.h"
|
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
|
||||||
|
|
||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtWidgets/QWidget>
|
#include <QtWidgets/QWidget>
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void Pacemaker::addPort(unsigned short number, Core::CorePortType portType, cons
|
|||||||
|
|
||||||
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
|
void Pacemaker::addPortInternal(unsigned short number, Core::CorePortType portType, const QString& properties)
|
||||||
{
|
{
|
||||||
if (!m_state.ports.is_set())
|
if (!m_state.ports.has_value())
|
||||||
m_state.ports = std::vector<Core::PortInformation>();
|
m_state.ports = std::vector<Core::PortInformation>();
|
||||||
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "function_topic_tests.h"
|
#include "function_topic_tests.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include <DDS/DDSConnector/publisher.h>
|
#include <DDS/DDSConnector/publisher.h>
|
||||||
#include <DDS/DDSConnector/subscriber.h>
|
#include <DDS/DDSConnector/subscriber.h>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ template <typename TOPICTYPE> class GenericDataWriter final
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (si.is_set())
|
if (si.has_value())
|
||||||
{
|
{
|
||||||
rti::pub::WriteParams writeParams;
|
rti::pub::WriteParams writeParams;
|
||||||
rti::core::SampleIdentity sampleIdentity(si.get()->source_guid(), si.get()->publication_sequence_number());
|
rti::core::SampleIdentity sampleIdentity(si.get()->source_guid(), si.get()->publication_sequence_number());
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ namespace AdvancedSymbology
|
|||||||
AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantManagement::Role role)
|
AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantManagement::Role role)
|
||||||
{
|
{
|
||||||
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
||||||
switch (role.underlying()) {
|
switch (role) {
|
||||||
case ParticipantManagement::Role::Unknown:
|
case ParticipantManagement::Role::Unknown:
|
||||||
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
|
||||||
break;
|
break;
|
||||||
|
|||||||
+44
-43
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#ifdef BUILD_WITH_EXTERNAL_DDS
|
#ifdef BUILD_WITH_EXTERNAL_DDS
|
||||||
#include "AreaEffectSimulation/aes_dtc.h"
|
#include "AreaEffectSimulation/aes_dtc.h"
|
||||||
#include "ParticipantManagement/ppm.hpp"
|
#include "ParticipantManagement/ppm_dtc.h"
|
||||||
#endif
|
#endif
|
||||||
#include "Symbology/symbol_data_to_render_role.h"
|
#include "Symbology/symbol_data_to_render_role.h"
|
||||||
#include "SymbologyImpl/advanced_symbology_logging.h"
|
#include "SymbologyImpl/advanced_symbology_logging.h"
|
||||||
@@ -18,6 +18,7 @@ ForeignInterfaceImpl::ForeignInterfaceImpl(const std::shared_ptr<ParticipantMana
|
|||||||
const std::shared_ptr<AreaEffectSimulation::Interface::Dtc>& aesDtc,
|
const std::shared_ptr<AreaEffectSimulation::Interface::Dtc>& aesDtc,
|
||||||
const std::shared_ptr<GuezIedManagement::Interface::Dtc>& guezIedDtc)
|
const std::shared_ptr<GuezIedManagement::Interface::Dtc>& guezIedDtc)
|
||||||
: m_ppmDtc(ppmDtc), m_aesDtc(aesDtc), m_guezIedDtc(guezIedDtc)
|
: m_ppmDtc(ppmDtc), m_aesDtc(aesDtc), m_guezIedDtc(guezIedDtc)
|
||||||
|
, m_logger(getLogger("AdvancedSymbologyPlugin"))
|
||||||
{
|
{
|
||||||
if (!m_ppmDtc)
|
if (!m_ppmDtc)
|
||||||
{
|
{
|
||||||
@@ -53,100 +54,100 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const SymbolDataToR
|
|||||||
QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantManagement::Participant& participant,
|
QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantManagement::Participant& participant,
|
||||||
int sizeL, const QColor& desiredColor) const
|
int sizeL, const QColor& desiredColor) const
|
||||||
{
|
{
|
||||||
AdvancedSymbology::SymbolDataToRender symDataToRender(QString::fromStdString(participant.symbol()), sizeL);
|
AdvancedSymbology::SymbolDataToRender symDataToRender(QString::fromStdString(participant.symbol), sizeL);
|
||||||
|
|
||||||
if (!m_ppmDtc)
|
if (!m_ppmDtc)
|
||||||
return findImage(symDataToRender);
|
return findImage(symDataToRender);
|
||||||
|
|
||||||
const ParticipantManagement::Party& party = m_ppmDtc->party(participant.partyId());
|
const ParticipantManagement::Party& party = m_ppmDtc->party(participant.partyId);
|
||||||
symDataToRender.role = AdvancedSymbology::roleToRole<>(party.role());
|
symDataToRender.role = AdvancedSymbology::roleToRole<>(party.role);
|
||||||
|
|
||||||
symDataToRender.fillColor = desiredColor.isValid() ? desiredColor : QColor::fromRgb(QRgb(party.color()));
|
symDataToRender.fillColor = desiredColor.isValid() ? desiredColor : QColor::fromRgb(QRgb(party.color));
|
||||||
symDataToRender.fillColorReplace = true;
|
symDataToRender.fillColorReplace = true;
|
||||||
|
|
||||||
QColor injuryColor = QColor(100, 100, 0);
|
QColor injuryColor = QColor(100, 100, 0);
|
||||||
ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
|
ProjectDataManagement::VulnerabilityState currentState = ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady;
|
||||||
|
|
||||||
const ParticipantManagement::DynamicParticipantData dData = m_ppmDtc->dynamicParticipantData(participant.id());
|
const ParticipantManagement::DynamicParticipantData dData = m_ppmDtc->dynamicParticipantData(participant.id);
|
||||||
|
|
||||||
if (dData.stateHistory().size())
|
if (dData.stateHistory.size())
|
||||||
{
|
{
|
||||||
const ParticipantManagement::StateInformation& lastState =
|
const ParticipantManagement::StateInformation& lastState =
|
||||||
m_ppmDtc->youngestStateInformation(dData.stateHistory());
|
m_ppmDtc->youngestStateInformation(dData.stateHistory);
|
||||||
currentState = lastState.vulnerabilityState();
|
currentState = lastState.vulnerabilityState;
|
||||||
|
|
||||||
switch (lastState.originatorType().underlying())
|
switch (lastState.originatorType)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice: {
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice: {
|
||||||
if (m_guezIedDtc)
|
if (m_guezIedDtc)
|
||||||
{
|
{
|
||||||
const GuezIedManagement::Ied& gIed = m_guezIedDtc->iedForEquipmentNumber(lastState.originatorId());
|
const GuezIedManagement::Ied& gIed = m_guezIedDtc->iedForEquipmentNumber(lastState.originatorId);
|
||||||
if (gIed.id() > 0)
|
if (gIed.id > 0)
|
||||||
{
|
{
|
||||||
int injuryPartyId = gIed.partyId();
|
int injuryPartyId = gIed.partyId;
|
||||||
if (injuryPartyId >= 0)
|
if (injuryPartyId >= 0)
|
||||||
injuryColor = m_ppmDtc->party(injuryPartyId).color();
|
injuryColor = m_ppmDtc->party(injuryPartyId).color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::StateChangeOriginator::DusMine: {
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_DusMine: {
|
||||||
if (!m_aesDtc)
|
if (!m_aesDtc)
|
||||||
{
|
{
|
||||||
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
|
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
|
||||||
"included in symbol created for participant.id() "
|
"included in symbol created for participant.id() "
|
||||||
<< participant.id();
|
<< participant.id;
|
||||||
return findImage(symDataToRender);
|
return findImage(symDataToRender);
|
||||||
}
|
}
|
||||||
const int partyId = m_aesDtc->partyForDusMine(lastState.originatorId());
|
const int partyId = m_aesDtc->partyForDusMine(lastState.originatorId);
|
||||||
if (partyId >= 0)
|
if (partyId >= 0)
|
||||||
injuryColor = m_ppmDtc->party(partyId).color();
|
injuryColor = m_ppmDtc->party(partyId).color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation:
|
||||||
case ProjectDataManagement::StateChangeOriginator::FunctionalArea: {
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_FunctionalArea: {
|
||||||
if (!m_aesDtc)
|
if (!m_aesDtc)
|
||||||
{
|
{
|
||||||
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
|
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
|
||||||
"included in symbol created for participant.id() "
|
"included in symbol created for participant.id() "
|
||||||
<< participant.id();
|
<< participant.id;
|
||||||
return findImage(symDataToRender);
|
return findImage(symDataToRender);
|
||||||
}
|
}
|
||||||
|
|
||||||
AreaEffectSimulation::AesItem aesItem;
|
AreaEffectSimulation::AesItem aesItem;
|
||||||
m_aesDtc->aesItemFromId(lastState.originatorId(), aesItem);
|
m_aesDtc->aesItemFromId(lastState.originatorId, aesItem);
|
||||||
|
|
||||||
if (aesItem.partyId().is_set())
|
if (aesItem.partyId.has_value())
|
||||||
injuryColor = m_ppmDtc->party(aesItem.partyId().get()).color();
|
injuryColor = m_ppmDtc->party(aesItem.partyId.get()).color;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case ProjectDataManagement::StateChangeOriginator::Participant: {
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Participant: {
|
||||||
const ParticipantManagement::Participant& participantOrigin =
|
const ParticipantManagement::Participant& participantOrigin =
|
||||||
m_ppmDtc->participant(lastState.originatorId());
|
m_ppmDtc->participant(lastState.originatorId);
|
||||||
|
|
||||||
if (participantOrigin.id())
|
if (participantOrigin.id)
|
||||||
injuryColor = m_ppmDtc->party(participantOrigin.partyId()).color();
|
injuryColor = m_ppmDtc->party(participantOrigin.partyId).color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::StateChangeOriginator::Party: {
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Party: {
|
||||||
const ParticipantManagement::Party& partyOrigin = m_ppmDtc->party(lastState.originatorId());
|
const ParticipantManagement::Party& partyOrigin = m_ppmDtc->party(lastState.originatorId);
|
||||||
|
|
||||||
if (partyOrigin.id())
|
if (partyOrigin.id)
|
||||||
injuryColor = partyOrigin.color();
|
injuryColor = partyOrigin.color;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::StateChangeOriginator::ObserverController:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ObserverController:
|
||||||
case ProjectDataManagement::StateChangeOriginator::ExerciseControl:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ExerciseControl:
|
||||||
case ProjectDataManagement::StateChangeOriginator::Initialization:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Initialization:
|
||||||
injuryColor = m_ppmDtc->party(1).color();
|
injuryColor = m_ppmDtc->party(1).color;
|
||||||
break;
|
break;
|
||||||
case ProjectDataManagement::StateChangeOriginator::WoundTreatmentDevice:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_WoundTreatmentDevice:
|
||||||
case ProjectDataManagement::StateChangeOriginator::MedicalTimeout:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
|
||||||
case ProjectDataManagement::StateChangeOriginator::Sanitation:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation:
|
||||||
case ProjectDataManagement::StateChangeOriginator::MaintainanceDevice:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MaintainanceDevice:
|
||||||
case ProjectDataManagement::StateChangeOriginator::Unknown:
|
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Unknown:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,7 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantMa
|
|||||||
|
|
||||||
AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataManagement::VulnerabilityState& state)
|
AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataManagement::VulnerabilityState& state)
|
||||||
{
|
{
|
||||||
switch (state.underlying())
|
switch (state)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
|
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
|
||||||
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
|
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
|
||||||
|
|||||||
+2
-2
@@ -70,10 +70,10 @@ void SaveAsSymbol::onInputChanged(const QString &input)
|
|||||||
|
|
||||||
void SaveAsSymbol::onFileContentChanged(const FileManagement::FileContent &data, DataModification modType)
|
void SaveAsSymbol::onFileContentChanged(const FileManagement::FileContent &data, DataModification modType)
|
||||||
{
|
{
|
||||||
if (data.fileType() != FileManagement::FileType::OperatorDefinedSymbol)
|
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QString name = QString::fromStdString(data.name());
|
QString name = QString::fromStdString(data.name);
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
m_takenNames.removeAll(name);
|
m_takenNames.removeAll(name);
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@ class SelectTextDialog final : public LtsWidgets::LtsFramelessDialog
|
|||||||
~SelectTextDialog();
|
~SelectTextDialog();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NGL::INGLLogger& m_logger;
|
//NGL::INGLLogger& m_logger; // unused (legacy: commented out)
|
||||||
Ui_SelectTextDialog* ui;
|
Ui_SelectTextDialog* ui;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
+13
-17
@@ -125,7 +125,7 @@ SymbolEditor::SymbolEditor(LtsSession::LtsSession *session, QWidget *parent)
|
|||||||
: LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
: LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
|
||||||
, m_ui(new Ui::SymbolEditor)
|
, m_ui(new Ui::SymbolEditor)
|
||||||
, m_session(session)
|
, m_session(session)
|
||||||
.getNGLLogger("SymbolEditor"))
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("SymbolEditor"))
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "SymbolEditor(" << "parent=" << parent << ")";
|
DEBUG_LOG(m_logger) << "SymbolEditor(" << "parent=" << parent << ")";
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@@ -227,9 +227,9 @@ bool SymbolEditor::init(const std::shared_ptr<FileManagement::Interface::Ftc>& f
|
|||||||
m_internal->m_symbolColorsPreview.clear();
|
m_internal->m_symbolColorsPreview.clear();
|
||||||
m_internal->m_ppmDtc->partys([this](const ParticipantManagement::Party& data) {
|
m_internal->m_ppmDtc->partys([this](const ParticipantManagement::Party& data) {
|
||||||
m_internal->m_symbolColorsPreview.append(
|
m_internal->m_symbolColorsPreview.append(
|
||||||
{ParticipantManagement::trPartyName(data.name()), QColor::fromRgb(data.color())});
|
{ParticipantManagement::trPartyName(data.name), QColor::fromRgb(data.color)});
|
||||||
m_internal->m_symbolColorsPreview.append({tr("%1 (faded)").arg(ParticipantManagement::trPartyName(data.name())),
|
m_internal->m_symbolColorsPreview.append({tr("%1 (faded)").arg(ParticipantManagement::trPartyName(data.name)),
|
||||||
QColor::fromRgb(data.fadingColor())});
|
QColor::fromRgb(data.fadingColor)});
|
||||||
});
|
});
|
||||||
|
|
||||||
m_internal->m_toolButtonGroup.addButton(m_ui->ToolButtonRect);
|
m_internal->m_toolButtonGroup.addButton(m_ui->ToolButtonRect);
|
||||||
@@ -812,11 +812,9 @@ void SymbolEditor::updateSymbolAttributesWidgets()
|
|||||||
m_ui->ListViewMisc->clearSelection();
|
m_ui->ListViewMisc->clearSelection();
|
||||||
m_ui->ListViewTruppengattung->clearSelection();
|
m_ui->ListViewTruppengattung->clearSelection();
|
||||||
|
|
||||||
QLinkedList<SymbologyXML::Primitive*> primitives = m_internal->m_symbol.getPrimitives();
|
auto primitives = m_internal->m_symbol.getPrimitives();
|
||||||
QLinkedListIterator<SymbologyXML::Primitive*> pi(primitives);
|
for (auto* prim : primitives)
|
||||||
while (pi.hasNext())
|
|
||||||
{
|
{
|
||||||
SymbologyXML::Primitive* prim = pi.next();
|
|
||||||
int iconId = prim->icon();
|
int iconId = prim->icon();
|
||||||
SymbologyXML::SymbolTypes::t_icon_type iconType = prim->iconType();
|
SymbologyXML::SymbolTypes::t_icon_type iconType = prim->iconType();
|
||||||
SymbologyXML::SymbolTypes::t_sector_position sectorPosition = prim->position();
|
SymbologyXML::SymbolTypes::t_sector_position sectorPosition = prim->position();
|
||||||
@@ -1445,7 +1443,7 @@ void SymbolEditor::slotImportTemplate()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
|
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
|
||||||
QString symbolName = QString::fromStdString(fc.name());
|
QString symbolName = QString::fromStdString(fc.name);
|
||||||
SymbologyXML::SymbolReader sr;
|
SymbologyXML::SymbolReader sr;
|
||||||
pushUndo();
|
pushUndo();
|
||||||
sr.read(content, m_internal->m_symbol);
|
sr.read(content, m_internal->m_symbol);
|
||||||
@@ -1453,7 +1451,7 @@ void SymbolEditor::slotImportTemplate()
|
|||||||
|
|
||||||
m_internal->m_lastFileId = fileId;
|
m_internal->m_lastFileId = fileId;
|
||||||
m_internal->m_lastFileName = symbolName;
|
m_internal->m_lastFileName = symbolName;
|
||||||
m_internal->m_lastFolderId = fc.folderId();
|
m_internal->m_lastFolderId = fc.folderId;
|
||||||
|
|
||||||
updateGUI();
|
updateGUI();
|
||||||
__unchange__();
|
__unchange__();
|
||||||
@@ -1850,7 +1848,7 @@ void SymbolEditor::onToolButtonTextClicked()
|
|||||||
|
|
||||||
void SymbolEditor::resetToolButtonGroupState()
|
void SymbolEditor::resetToolButtonGroupState()
|
||||||
{
|
{
|
||||||
m_ui->ToolButtonSelect->animateClick(1);
|
m_ui->ToolButtonSelect->animateClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SymbolEditor::onPushButtonFillColorClicked()
|
void SymbolEditor::onPushButtonFillColorClicked()
|
||||||
@@ -1934,11 +1932,9 @@ void SymbolEditor::copyElementsFromSymbol(const SymbologyXML::Symbol& tmpSymbol)
|
|||||||
m_internal->m_symbol.addBranch((SymbologyXML::SymbolTypes::t_branch)idx);
|
m_internal->m_symbol.addBranch((SymbologyXML::SymbolTypes::t_branch)idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
QLinkedList<SymbologyXML::Primitive*> prims = tmpSymbol.getPrimitives();
|
auto prims = tmpSymbol.getPrimitives();
|
||||||
QLinkedListIterator<SymbologyXML::Primitive*> pi(prims);
|
for (auto* prim : prims)
|
||||||
while (pi.hasNext())
|
|
||||||
{
|
{
|
||||||
SymbologyXML::Primitive* prim = pi.next();
|
|
||||||
if ((prim->type() == SymbologyXML::Primitive::ICON) &&
|
if ((prim->type() == SymbologyXML::Primitive::ICON) &&
|
||||||
m_internal->m_symbol.containsPrimitive(prim->iconType(), prim->position(), prim->icon()))
|
m_internal->m_symbol.containsPrimitive(prim->iconType(), prim->position(), prim->icon()))
|
||||||
continue;
|
continue;
|
||||||
@@ -3016,8 +3012,8 @@ bool SymbolEditor::writeFile(bool saveAsNew)
|
|||||||
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
|
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
|
||||||
m_internal->m_lastFileId = fileId;
|
m_internal->m_lastFileId = fileId;
|
||||||
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
|
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
|
||||||
m_internal->m_lastFolderId = fc.folderId();
|
m_internal->m_lastFolderId = fc.folderId;
|
||||||
const QString fileName = QString::fromStdString(fc.name());
|
const QString fileName = QString::fromStdString(fc.name);
|
||||||
m_internal->m_lastFileName = fileName;
|
m_internal->m_lastFileName = fileName;
|
||||||
m_internal->m_symbol.setName(fileName);
|
m_internal->m_symbol.setName(fileName);
|
||||||
bRet = true;
|
bRet = true;
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
#include <LtsWidgets/lts_dialog.h>
|
#include <LtsWidgets/lts_dialog.h>
|
||||||
#include <NGLLogger/INGLLogger.h>
|
#include <NGLLogger/INGLLogger.h>
|
||||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||||
#include <flm_data_plugin_interface.h>
|
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||||
#include <SymbologyXML/symbol_types.h>
|
#include <SymbologyXML/symbol_types.h>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <AdvancedSymbology/asb_gui_plugin_interface.h>
|
#include <AdvancedSymbology/asb_gui_plugin_interface.h>
|
||||||
#include <flm_data_plugin_interface.h>
|
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||||
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
#include <ParticipantManagement/ppm_data_plugin_interface.h>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -27,8 +27,8 @@ void FileManagementReplyHandler::requestReply(const Core::FunctionReplyObject &r
|
|||||||
|
|
||||||
void FileManagementReplyHandler::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &replyObject)
|
void FileManagementReplyHandler::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &replyObject)
|
||||||
{
|
{
|
||||||
m_content = replyObject.content();
|
m_content = replyObject.content;
|
||||||
m_id = replyObject.id();
|
m_id = replyObject.id;
|
||||||
m_requestHelper->requestReply(replyObject);
|
m_requestHelper->requestReply(replyObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -318,7 +318,7 @@
|
|||||||
<enum>Qt::ScrollBarAsNeeded</enum>
|
<enum>Qt::ScrollBarAsNeeded</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="renderHints">
|
<property name="renderHints">
|
||||||
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
|
<set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -576,7 +576,7 @@
|
|||||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="renderHints">
|
<property name="renderHints">
|
||||||
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
|
<set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
+34
-34
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
|
||||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include <flm_data_plugin_interface.h>
|
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||||
#include <QtXml/QDomDocument>
|
#include <QtXml/QDomDocument>
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
@@ -152,7 +152,7 @@ bool FlmSubscriber::createFlmSymbolProxy(int type_placeholder)
|
|||||||
|
|
||||||
#ifdef SKIP_SOME_TO_TEST_REFETCHING
|
#ifdef SKIP_SOME_TO_TEST_REFETCHING
|
||||||
if (fileContentId >= 98)
|
if (fileContentId >= 98)
|
||||||
request.fileContentId(-1);
|
request.fileContentId = -1;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ bool FlmSubscriber::createFlmSymbolProxy(int type_placeholder)
|
|||||||
|
|
||||||
void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply& reply)
|
void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply& reply)
|
||||||
{
|
{
|
||||||
const int32_t fileContentId = reply.id();
|
const int32_t fileContentId = reply.id;
|
||||||
|
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, " << fileContentId;
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, " << fileContentId;
|
||||||
|
|
||||||
@@ -197,16 +197,16 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte
|
|||||||
|
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " fileContentId=" << fileContentId << " name=" << name
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " fileContentId=" << fileContentId << " name=" << name
|
||||||
<< " operatorName=" << operatorName << " lastModified=" << lastModified
|
<< " operatorName=" << operatorName << " lastModified=" << lastModified
|
||||||
<< " #bytes =" << reply.content().size();
|
<< " #bytes =" << reply.content.size();
|
||||||
|
|
||||||
fcData.monitoring.replyContentSize = reply.content().size();
|
fcData.monitoring.replyContentSize = reply.content.size();
|
||||||
|
|
||||||
switch (fcData.type)
|
switch (fcData.type)
|
||||||
{
|
{
|
||||||
case FileContentStruct::SymbolType::EtsSymbol: {
|
case FileContentStruct::SymbolType::EtsSymbol: {
|
||||||
QImage image;
|
QImage image;
|
||||||
if (!svgToImage(QByteArray::fromRawData(reinterpret_cast<const char*>(&reply.content().at(0)),
|
if (!svgToImage(QByteArray::fromRawData(reinterpret_cast<const char*>(&reply.content.at(0)),
|
||||||
reply.content().size()),
|
reply.content.size()),
|
||||||
image))
|
image))
|
||||||
{
|
{
|
||||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " svgToImage failed, fileContentId=" << fileContentId;
|
ERROR_LOG(m_logger) << Q_FUNC_INFO << " svgToImage failed, fileContentId=" << fileContentId;
|
||||||
@@ -225,7 +225,7 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte
|
|||||||
|
|
||||||
case FileContentStruct::SymbolType::XmlSymbol: {
|
case FileContentStruct::SymbolType::XmlSymbol: {
|
||||||
FlmSymbolProxy::SymbolData symbolData(name, operatorName, lastModified,
|
FlmSymbolProxy::SymbolData symbolData(name, operatorName, lastModified,
|
||||||
LtsUtils::toQByteArray(reply.content()));
|
LtsUtils::toQByteArray(reply.content));
|
||||||
|
|
||||||
if (symbolData.isXmlSymbol())
|
if (symbolData.isXmlSymbol())
|
||||||
{
|
{
|
||||||
@@ -277,7 +277,7 @@ bool FlmSubscriber::svgToImage(const QByteArray& svgByteArray, QImage& imageOut)
|
|||||||
QString FlmSubscriber::operatorName(int operatorId)
|
QString FlmSubscriber::operatorName(int operatorId)
|
||||||
{
|
{
|
||||||
if (d->m_opmDtc)
|
if (d->m_opmDtc)
|
||||||
return QString::fromStdString(d->m_opmDtc->user(operatorId).name());
|
return QString::fromStdString(d->m_opmDtc->user(operatorId).name);
|
||||||
return QStringLiteral("unknown user<%1>").arg(operatorId);
|
return QStringLiteral("unknown user<%1>").arg(operatorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,20 +339,20 @@ void FlmSubscriber::checkForReFetching()
|
|||||||
|
|
||||||
void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data, DataModification modType)
|
void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data, DataModification modType)
|
||||||
{
|
{
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " data.id=" << data.id()
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " data.id=" << data.id
|
||||||
<< " data.fileStatus=" << data.fileStatus().underlying() << " modType=" << modType
|
<< " data.fileStatus=" << data.fileStatus << " modType=" << modType
|
||||||
<< " data.name='" << data.name().c_str() << "'";
|
<< " data.name='" << data.name.c_str() << "'";
|
||||||
|
|
||||||
if (!d->m_flmFtc)
|
if (!d->m_flmFtc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.isDeleted())
|
if (data.isDeleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.fileType().underlying() != FileManagement::FileType::OperatorDefinedSymbol)
|
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.fileStatus().underlying() == FileManagement::FileStatus::Deleted)
|
if (data.fileStatus == FileManagement::FileStatus::Deleted)
|
||||||
{
|
{
|
||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
@@ -367,7 +367,7 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int32_t fileContentId = data.id();
|
const int32_t fileContentId = data.id;
|
||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
case DataModification::eAdded:
|
case DataModification::eAdded:
|
||||||
@@ -383,13 +383,13 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data
|
|||||||
|
|
||||||
case DataModification::eRemoved: {
|
case DataModification::eRemoved: {
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " modType=" << modType << " fileContentId=" << fileContentId
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " modType=" << modType << " fileContentId=" << fileContentId
|
||||||
<< " fileContentName=" << data.name();
|
<< " fileContentName=" << data.name;
|
||||||
|
|
||||||
d->m_fileContentMap.remove(fileContentId);
|
d->m_fileContentMap.remove(fileContentId);
|
||||||
|
|
||||||
if (!d->m_symbolProxy.removeSymbol(fileContentId))
|
if (!d->m_symbolProxy.removeSymbol(fileContentId))
|
||||||
ERROR_LOG(m_logger) << Q_FUNC_INFO << " removeSymbol failed"
|
ERROR_LOG(m_logger) << Q_FUNC_INFO << " removeSymbol failed"
|
||||||
<< " fileContentId=" << fileContentId << " fileContentName='" << data.name() << "'"
|
<< " fileContentId=" << fileContentId << " fileContentName='" << data.name << "'"
|
||||||
<< " contains=" << d->m_fileContentMap.contains(fileContentId);
|
<< " contains=" << d->m_fileContentMap.contains(fileContentId);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -400,35 +400,35 @@ void FlmSubscriber::updateFileContentMap(const FileManagement::FileContent& data
|
|||||||
{
|
{
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"
|
||||||
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
|
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
|
||||||
<< " fileContentId=" << data.id() << " data.isDeleted()=" << data.isDeleted()
|
<< " fileContentId=" << data.id << " data.isDeleted=" << data.isDeleted
|
||||||
<< " data.fileStatus().underlying()=" << data.fileStatus().underlying() << " data.name='"
|
<< " data.fileStatus=" << data.fileStatus << " data.name='"
|
||||||
<< QString::fromStdString(data.name()) << "'";
|
<< QString::fromStdString(data.name) << "'";
|
||||||
|
|
||||||
if (data.isDeleted())
|
if (data.isDeleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.fileStatus().underlying() == FileManagement::FileStatus::Deleted)
|
if (data.fileStatus == FileManagement::FileStatus::Deleted)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.fileType() != FileManagement::FileType::OperatorDefinedSymbol)
|
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int32_t fileContentId = data.id();
|
const int32_t fileContentId = data.id;
|
||||||
|
|
||||||
FileContentStruct fcData;
|
FileContentStruct fcData;
|
||||||
|
|
||||||
fcData.name = QString::fromStdString(data.name());
|
fcData.name = QString::fromStdString(data.name);
|
||||||
fcData.type = FileContentStruct::SymbolType::UnsupportedSymbol;
|
fcData.type = FileContentStruct::SymbolType::UnsupportedSymbol;
|
||||||
fcData.operatorName = operatorName(data.operatorId());
|
fcData.operatorName = operatorName(data.operatorId);
|
||||||
fcData.lastModified = data.lastModified();
|
fcData.lastModified = data.lastModified;
|
||||||
|
|
||||||
fcData.usrTags << QStringLiteral("file-id=%1").arg(fileContentId);
|
fcData.usrTags << QStringLiteral("file-id=%1").arg(fileContentId);
|
||||||
fcData.usrTags << QStringLiteral("exercise-id=%1").arg(data.exerciseId().is_set() ? data.exerciseId().get() : -1);
|
fcData.usrTags << QStringLiteral("exercise-id=%1").arg(data.exerciseId.has_value() ? data.exerciseId.get() : -1);
|
||||||
fcData.usrTags << fcData.operatorName;
|
fcData.usrTags << fcData.operatorName;
|
||||||
|
|
||||||
if (data.properties().size() != 0)
|
if (data.properties.size() != 0)
|
||||||
{
|
{
|
||||||
const QByteArray attributesJson(QByteArray::fromRawData(data.properties().c_str(), data.properties().size()));
|
const QByteArray attributesJson(QByteArray::fromRawData(data.properties.c_str(), data.properties.size()));
|
||||||
QJsonParseError parseError;
|
QJsonParseError parseError;
|
||||||
QJsonDocument jDoc(QJsonDocument::fromJson(attributesJson, &parseError));
|
QJsonDocument jDoc(QJsonDocument::fromJson(attributesJson, &parseError));
|
||||||
|
|
||||||
@@ -476,9 +476,9 @@ void FlmSubscriber::updateFileContentMap(const FileManagement::FileContent& data
|
|||||||
|
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"
|
||||||
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
|
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
|
||||||
<< " fileContentId=" << data.id() << " data.isDeleted()=" << data.isDeleted()
|
<< " fileContentId=" << data.id << " data.isDeleted=" << data.isDeleted
|
||||||
<< " data.fileStatus().underlying()=" << data.fileStatus().underlying() << " data.name='"
|
<< " data.fileStatus=" << data.fileStatus << " data.name='"
|
||||||
<< QString::fromStdString(data.name()) << "'";
|
<< QString::fromStdString(data.name) << "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
void FlmSubscriber::onLocalSymbolProxyEtsSymbolAdded(qint32 fileContentId, const QString& name, const QImage& image,
|
void FlmSubscriber::onLocalSymbolProxyEtsSymbolAdded(qint32 fileContentId, const QString& name, const QImage& image,
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@
|
|||||||
#include <Lts/Services/FileManagement/flm.hpp>
|
#include <Lts/Services/FileManagement/flm.hpp>
|
||||||
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <flm_data_plugin_interface.h>
|
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@
|
|||||||
#include <Symbology/sidc_codec.h>
|
#include <Symbology/sidc_codec.h>
|
||||||
#include "flm_symbol_proxy.h"
|
#include "flm_symbol_proxy.h"
|
||||||
|
|
||||||
#include <flm_data_plugin_interface.h>
|
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
|
||||||
#include <OperatorManagement/opm_data_plugin_interface.h>
|
#include <OperatorManagement/opm_data_plugin_interface.h>
|
||||||
|
|
||||||
namespace AdvancedSymbology
|
namespace AdvancedSymbology
|
||||||
|
|||||||
+1
@@ -9,6 +9,7 @@
|
|||||||
#include <QtCore/QHash>
|
#include <QtCore/QHash>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtGui/QImage>
|
#include <QtGui/QImage>
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+22
-33
@@ -63,58 +63,47 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
const AlarmManagement::AlarmConfig& alarmConfig = m_vecData.at(index.row());
|
const AlarmManagement::AlarmConfig& alarmConfig = m_vecData.at(index.row());
|
||||||
if (alarmConfig.global() != m_global)
|
if (alarmConfig.global != m_global)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
switch (index.column())
|
switch (index.column())
|
||||||
{
|
{
|
||||||
case Id:
|
case Id:
|
||||||
return alarmConfig.id();
|
return alarmConfig.id;
|
||||||
case EquipmentNumber: {
|
case EquipmentNumber: {
|
||||||
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId());
|
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId);
|
||||||
if (equipmentNumber == 0)
|
if (equipmentNumber == 0)
|
||||||
return tr("All");
|
return tr("All");
|
||||||
return equipmentNumber;
|
return equipmentNumber;
|
||||||
}
|
}
|
||||||
case Designator:
|
case Designator:
|
||||||
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId());
|
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId);
|
||||||
case TactIdentifier:
|
case TactIdentifier:
|
||||||
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId());
|
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId);
|
||||||
case VulnerabilityState: {
|
case VulnerabilityState: {
|
||||||
QString vulnerabilityState = tr("All Types");
|
QString vulnerabilityState = tr("All Types");
|
||||||
if (alarmConfig.vulnerabilityState() >= 0)
|
if (alarmConfig.vulnerabilityState >= 0)
|
||||||
{
|
{
|
||||||
// participant() existiert nicht mehr, suche in participantsList()
|
ParticipantManagement::TypeClass typeClass =
|
||||||
auto participantIt = std::find_if(
|
m_ppmDtc->type(m_ppmDtc->participant(alarmConfig.participantId).typeId).typeClass;
|
||||||
m_ppmDtc->participantsList().begin(), m_ppmDtc->participantsList().end(),
|
|
||||||
[id = alarmConfig.participantId()](const ParticipantManagement::Participant& p) {
|
|
||||||
return p.id() == id;
|
|
||||||
});
|
|
||||||
|
|
||||||
ParticipantManagement::TypeClass typeClass = ParticipantManagement::TypeClass::Other;
|
|
||||||
// STUB: type()-Methode nicht verfügbar - verwende Default-Wert
|
|
||||||
// if (participantIt != m_ppmDtc->participantsList().end())
|
|
||||||
// {
|
|
||||||
// typeClass = m_ppmDtc->type(participantIt->typeId()).typeClass();
|
|
||||||
// }
|
|
||||||
|
|
||||||
const ProjectDataManagement::VulnerabilityClass vc =
|
const ProjectDataManagement::VulnerabilityClass vc =
|
||||||
typeClass == ParticipantManagement::TypeClass::Human
|
typeClass == ParticipantManagement::TypeClass::Human
|
||||||
? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
|
? ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_SoldierInjuries
|
||||||
: ProjectDataManagement::VulnerabilityClass::VehicleDamages;
|
: ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_VehicleDamages;
|
||||||
ProjectDataManagement::VulnerabilityState vs =
|
ProjectDataManagement::VulnerabilityState vs =
|
||||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
|
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState);
|
||||||
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
|
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
|
||||||
}
|
}
|
||||||
return vulnerabilityState;
|
return vulnerabilityState;
|
||||||
}
|
}
|
||||||
|
|
||||||
case EventType:
|
case EventType:
|
||||||
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId()));
|
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId));
|
||||||
case MessageWindow:
|
case MessageWindow:
|
||||||
return alarmConfig.messageWindow() ? tr("Yes") : tr("No");
|
return alarmConfig.messageWindow ? tr("Yes") : tr("No");
|
||||||
case SetMarker:
|
case SetMarker:
|
||||||
return alarmConfig.setMarker() ? tr("Yes") : tr("No");
|
return alarmConfig.setMarker ? tr("Yes") : tr("No");
|
||||||
}
|
}
|
||||||
|
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@@ -122,15 +111,15 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
|
|||||||
|
|
||||||
void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, const DataModification modType)
|
void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, const DataModification modType)
|
||||||
{
|
{
|
||||||
const int id = data.id();
|
const int id = data.id;
|
||||||
if (data.global() != m_global)
|
if (data.global != m_global)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int row = findRowForId(id);
|
int row = findRowForId(id);
|
||||||
|
|
||||||
const int eventTypeId = data.eventTypeId();
|
const int eventTypeId = static_cast<int>(data.eventTypeId);
|
||||||
const bool messageWindow = data.messageWindow();
|
const bool messageWindow = data.messageWindow;
|
||||||
const bool setMarker = data.setMarker();
|
const bool setMarker = data.setMarker;
|
||||||
DEBUG_LOG(getLogger()) << "onAlarmConfigChanged: " << eventTypeId << " messageWindow=" << messageWindow << "setMarker"
|
DEBUG_LOG(getLogger()) << "onAlarmConfigChanged: " << eventTypeId << " messageWindow=" << messageWindow << "setMarker"
|
||||||
<< setMarker;
|
<< setMarker;
|
||||||
|
|
||||||
@@ -140,8 +129,8 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
|
|||||||
|
|
||||||
DEBUG_LOG(getLogger()) << "AlarmConfig was removed: " << id;
|
DEBUG_LOG(getLogger()) << "AlarmConfig was removed: " << id;
|
||||||
AlarmManagement::AlarmConfig data1 = data;
|
AlarmManagement::AlarmConfig data1 = data;
|
||||||
data1.setMessageWindow(false);
|
data1.messageWindow = false;
|
||||||
data1.setSetMarker(false);
|
data1.setMarker = false;
|
||||||
setRowData(row, data1);
|
setRowData(row, data1);
|
||||||
removeRow(row);
|
removeRow(row);
|
||||||
return;
|
return;
|
||||||
@@ -153,7 +142,7 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId()) > 0)
|
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId) > 0)
|
||||||
setRowData(row, data);
|
setRowData(row, data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -6,7 +6,6 @@
|
|||||||
#include "almcommon_export.h"
|
#include "almcommon_export.h"
|
||||||
|
|
||||||
#include <AlarmManagement/alm_dtc.h>
|
#include <AlarmManagement/alm_dtc.h>
|
||||||
#include <AlarmManagement/alm_types.h>
|
|
||||||
#include <GuezNasat/logger.h>
|
#include <GuezNasat/logger.h>
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||||
|
|||||||
+33
-33
@@ -49,7 +49,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
|
|||||||
|
|
||||||
// Register callbacks instead of enableParticipant()
|
// Register callbacks instead of enableParticipant()
|
||||||
const auto cbParticipants = [this](const ParticipantManagement::Participant& participant) {
|
const auto cbParticipants = [this](const ParticipantManagement::Participant& participant) {
|
||||||
onParticipantChanged(participant, ParticipantManagement::DataModification::eAdded);
|
onParticipantChanged(participant, DataModification::eAdded);
|
||||||
};
|
};
|
||||||
m_ppmDtc->participants(cbParticipants);
|
m_ppmDtc->participants(cbParticipants);
|
||||||
|
|
||||||
@@ -66,7 +66,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
|
|||||||
auto cbAesItem = [this](const AreaEffectSimulation::AesItem& item) {
|
auto cbAesItem = [this](const AreaEffectSimulation::AesItem& item) {
|
||||||
onAesItemChanged(item, DataModification::eAdded);
|
onAesItemChanged(item, DataModification::eAdded);
|
||||||
};
|
};
|
||||||
m_aesDtc->bcContaminations(cbAesItem);
|
m_aesDtc->bCContaminations(cbAesItem);
|
||||||
m_aesDtc->boobyTraps(cbAesItem);
|
m_aesDtc->boobyTraps(cbAesItem);
|
||||||
m_aesDtc->offRouteMines(cbAesItem);
|
m_aesDtc->offRouteMines(cbAesItem);
|
||||||
|
|
||||||
@@ -84,7 +84,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
|||||||
|
|
||||||
if (role == Qt::BackgroundRole)
|
if (role == Qt::BackgroundRole)
|
||||||
{
|
{
|
||||||
if (notificationEx.eventType() == ProjectDataManagement::PdmEventType::Alarm)
|
if (notificationEx.eventType == ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||||
return QColor(Qt::red);
|
return QColor(Qt::red);
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@@ -94,7 +94,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
|||||||
case Id:
|
case Id:
|
||||||
return notificationEx.id;
|
return notificationEx.id;
|
||||||
case Date:
|
case Date:
|
||||||
return QDateTime::fromMSecsSinceEpoch(notificationEx.time());
|
return QDateTime::fromMSecsSinceEpoch(notificationEx.time);
|
||||||
case EquipmentNumber:
|
case EquipmentNumber:
|
||||||
if (notificationEx.equipmentNumber)
|
if (notificationEx.equipmentNumber)
|
||||||
return notificationEx.equipmentNumber;
|
return notificationEx.equipmentNumber;
|
||||||
@@ -107,10 +107,10 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
|||||||
return notificationEx.participantId;
|
return notificationEx.participantId;
|
||||||
case Position:
|
case Position:
|
||||||
if (role == Qt::DisplayRole)
|
if (role == Qt::DisplayRole)
|
||||||
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position().lon(),
|
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position.lon,
|
||||||
notificationEx.position().lat());
|
notificationEx.position.lat);
|
||||||
else if (role == Qt::UserRole)
|
else if (role == Qt::UserRole)
|
||||||
return QPointF(notificationEx.position().lon(), notificationEx.position().lat());
|
return QPointF(notificationEx.position.lon, notificationEx.position.lat);
|
||||||
break;
|
break;
|
||||||
case AesId:
|
case AesId:
|
||||||
return notificationEx.aesId;
|
return notificationEx.aesId;
|
||||||
@@ -124,9 +124,9 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
|
|||||||
bool AlarmHistoryModel::isFiltered(const NotificationEx& data, DataModification modType) const
|
bool AlarmHistoryModel::isFiltered(const NotificationEx& data, DataModification modType) const
|
||||||
{
|
{
|
||||||
Q_UNUSED(modType);
|
Q_UNUSED(modType);
|
||||||
if (data.operatorId() == 0)
|
if (data.operatorId == 0)
|
||||||
return false;
|
return false;
|
||||||
return data.operatorId() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
return data.operatorId != LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType)
|
void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType)
|
||||||
@@ -135,16 +135,16 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
NotificationEx notification(data);
|
NotificationEx notification(data);
|
||||||
const QByteArray properties = QByteArray::fromRawData(data.properties().c_str(), data.properties().size());
|
const QByteArray properties = QByteArray::fromRawData(data.properties.c_str(), data.properties.size());
|
||||||
const QJsonDocument propertieJsonDoc = QJsonDocument::fromJson(properties);
|
const QJsonDocument propertieJsonDoc = QJsonDocument::fromJson(properties);
|
||||||
const QJsonObject propertieJsonObj = propertieJsonDoc.object();
|
const QJsonObject propertieJsonObj = propertieJsonDoc.object();
|
||||||
|
|
||||||
notification.equipmentNumber = data.equipmentNumber();
|
notification.equipmentNumber = data.equipmentNumber;
|
||||||
if (data.participantId().has_value())
|
if (data.participantId.has_value())
|
||||||
notification.participantId = data.participantId().value();
|
notification.participantId = data.participantId.value();
|
||||||
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType());
|
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType);
|
||||||
if (data.aesId().has_value())
|
if (data.aesId.has_value())
|
||||||
notification.aesId = data.aesId().value();
|
notification.aesId = data.aesId.value();
|
||||||
const int global = propertieJsonObj[QStringLiteral("Global")].toInt();
|
const int global = propertieJsonObj[QStringLiteral("Global")].toInt();
|
||||||
const int friendlyFire = propertieJsonObj[QStringLiteral("FriendlyFire")].toInt();
|
const int friendlyFire = propertieJsonObj[QStringLiteral("FriendlyFire")].toInt();
|
||||||
|
|
||||||
@@ -155,19 +155,19 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AlarmHistoryModel::onParticipantChanged(const ParticipantManagement::Participant& participant,
|
void AlarmHistoryModel::onParticipantChanged(const ParticipantManagement::Participant& participant,
|
||||||
const ParticipantManagement::DataModification modType)
|
const DataModification modType)
|
||||||
{
|
{
|
||||||
if (modType == ParticipantManagement::DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
QString designator = participant.designator();
|
QString designator = QString::fromStdString(participant.designator);
|
||||||
m_idDesignatorMap.insert(participant.id(), designator);
|
m_idDesignatorMap.insert(participant.id, designator);
|
||||||
|
|
||||||
const int equipNo = participant.equipmentNumber.has_value() ? participant.equipmentNumber.value() : 0;
|
const int equipNo = participant.equipmentNumber.has_value() ? participant.equipmentNumber.value() : 0;
|
||||||
m_partId2EquipNoMap.insert(participant.id(), equipNo);
|
m_partId2EquipNoMap.insert(participant.id, equipNo);
|
||||||
|
|
||||||
QString tacticalIdentifier = participant.tacticalIdentifier();
|
QString tacticalIdentifier = QString::fromStdString(participant.tacticalIdentifier);
|
||||||
m_idTactIdentifierMap.insert(participant.id(), tacticalIdentifier);
|
m_idTactIdentifierMap.insert(participant.id, tacticalIdentifier);
|
||||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id() << " designator=" << designator
|
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id << " designator=" << designator
|
||||||
<< " tacticalIdentifier=" << tacticalIdentifier;
|
<< " tacticalIdentifier=" << tacticalIdentifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,8 +199,8 @@ void AlarmHistoryModel::onBCContaminationChanged(const AreaEffectSimulation::BCC
|
|||||||
{
|
{
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
int id = data.id();
|
int id = data.id;
|
||||||
QString name = QString::fromStdString(data.name());
|
QString name = QString::fromStdString(data.name);
|
||||||
m_aesNameMap[id] = name;
|
m_aesNameMap[id] = name;
|
||||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "onBCContaminationChanged: id=" << id << " Name=" << name;
|
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "onBCContaminationChanged: id=" << id << " Name=" << name;
|
||||||
}
|
}
|
||||||
@@ -209,8 +209,8 @@ void AlarmHistoryModel::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap
|
|||||||
{
|
{
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
int id = data.id();
|
int id = data.id;
|
||||||
QString name = QString::fromStdString(data.name());
|
QString name = QString::fromStdString(data.name);
|
||||||
m_aesNameMap[id] = name;
|
m_aesNameMap[id] = name;
|
||||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "BoobyTrap: id=" << id << " Name=" << name;
|
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "BoobyTrap: id=" << id << " Name=" << name;
|
||||||
}
|
}
|
||||||
@@ -220,8 +220,8 @@ void AlarmHistoryModel::onOffRouteMineChanged(const AreaEffectSimulation::OffRou
|
|||||||
{
|
{
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
int id = data.id();
|
int id = data.id;
|
||||||
QString name = QString::fromStdString(data.name());
|
QString name = QString::fromStdString(data.name);
|
||||||
m_aesNameMap[id] = name;
|
m_aesNameMap[id] = name;
|
||||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "OffRouteMine: id=" << id << " Name=" << name;
|
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "OffRouteMine: id=" << id << " Name=" << name;
|
||||||
}
|
}
|
||||||
@@ -230,8 +230,8 @@ void AlarmHistoryModel::onAesItemChanged(const AreaEffectSimulation::AesItem& it
|
|||||||
{
|
{
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
QString name = QString::fromStdString(item.name());
|
QString name = QString::fromStdString(item.name);
|
||||||
int id = item.id();
|
int id = item.id;
|
||||||
m_aesNameMap[id] = name;
|
m_aesNameMap[id] = name;
|
||||||
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "AreaEffectSimulation::AesItem onAesItemChanged: id=" << id
|
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "AreaEffectSimulation::AesItem onAesItemChanged: id=" << id
|
||||||
<< " Name=" << name;
|
<< " Name=" << name;
|
||||||
@@ -253,7 +253,7 @@ bool AlarmHistoryProxyModel::lessThan(const QModelIndex& source_left, const QMod
|
|||||||
switch (source_left.column())
|
switch (source_left.column())
|
||||||
{
|
{
|
||||||
case AlarmHistoryModel::Date:
|
case AlarmHistoryModel::Date:
|
||||||
return dataLeft.time() < dataRight.time();
|
return dataLeft.time < dataRight.time;
|
||||||
|
|
||||||
case AlarmHistoryModel::Id:
|
case AlarmHistoryModel::Id:
|
||||||
case AlarmHistoryModel::Incident:
|
case AlarmHistoryModel::Incident:
|
||||||
|
|||||||
+3
-2
@@ -11,7 +11,8 @@
|
|||||||
#include <LtsWidgets/lts_abstract_table_model.h>
|
#include <LtsWidgets/lts_abstract_table_model.h>
|
||||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||||
#include <ParticipantManagement/ppm.hpp>
|
#include <ParticipantManagement/ppm.hpp>
|
||||||
#include <ProjectDataManagement/project_data_management.hpp>
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
|
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||||
|
|
||||||
namespace AlarmManagement
|
namespace AlarmManagement
|
||||||
{
|
{
|
||||||
@@ -50,7 +51,7 @@ class ALMCOMMON_EXPORT AlarmHistoryModel final : public LtsWidgets::LtsAbstractT
|
|||||||
bool isFiltered(const NotificationEx& data, DataModification modType) const override;
|
bool isFiltered(const NotificationEx& data, DataModification modType) const override;
|
||||||
public slots:
|
public slots:
|
||||||
void onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType);
|
void onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType);
|
||||||
void onParticipantChanged(const ParticipantManagement::Participant& participant, const ParticipantManagement::DataModification modType);
|
void onParticipantChanged(const ParticipantManagement::Participant& participant, const DataModification modType);
|
||||||
void onAesItemChanged(const AreaEffectSimulation::AesItem& item, const DataModification modType);
|
void onAesItemChanged(const AreaEffectSimulation::AesItem& item, const DataModification modType);
|
||||||
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data, const DataModification modType);
|
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data, const DataModification modType);
|
||||||
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, const DataModification modType);
|
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, const DataModification modType);
|
||||||
|
|||||||
+7
-7
@@ -57,24 +57,24 @@ void InterfaceImpl::clearInterfaces()
|
|||||||
|
|
||||||
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
|
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
|
||||||
{
|
{
|
||||||
if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
if (data.eventType != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int issi = data.equipmentNumber();
|
const int issi = data.equipmentNumber;
|
||||||
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
|
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position.lon, data.position.lat);
|
||||||
|
|
||||||
|
|
||||||
new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(),
|
new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(),
|
||||||
tr("ISSI: %1 --- Position: %2\n").arg(issi).arg(positionStr),
|
tr("ISSI: %1 --- Position: %2\n").arg(issi).arg(positionStr),
|
||||||
tr("!!!!!! Emergency Call --- %1 !!!!!").arg(DTG::toStringMSec(data.time())));
|
tr("!!!!!! Emergency Call --- %1 !!!!!").arg(DTG::toStringMSec(data.time)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterfaceImpl::showAlarm(const AlarmManagement::Notification &data)
|
void InterfaceImpl::showAlarm(const AlarmManagement::Notification &data)
|
||||||
{
|
{
|
||||||
showEmergencyMessage(data);
|
showEmergencyMessage(data);
|
||||||
|
|
||||||
if (data.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
|
if (data.operatorId == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
|
||||||
data.operatorId() == 0)
|
data.operatorId == 0)
|
||||||
{
|
{
|
||||||
bool bWidgetExists = m_session->widgetExists(menuGroup(), m_alarmHistoryDialogIdentifier, m_alarmHistoryDialogLayoutArea);
|
bool bWidgetExists = m_session->widgetExists(menuGroup(), m_alarmHistoryDialogIdentifier, m_alarmHistoryDialogLayoutArea);
|
||||||
if (!bWidgetExists)
|
if (!bWidgetExists)
|
||||||
@@ -87,7 +87,7 @@ void InterfaceImpl::onNotificationChanged(const AlarmManagement::Notification &d
|
|||||||
if (mod != DataModification::eAdded)
|
if (mod != DataModification::eAdded)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId()
|
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId
|
||||||
<< "currentOperatorId: " << LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
<< "currentOperatorId: " << LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+3
-2
@@ -7,11 +7,12 @@
|
|||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <AlarmManagement/alm_gui_plugin_interface.h>
|
#include <AlarmManagement/alm_gui_plugin_interface.h>
|
||||||
#include <AlarmManagement/alm_data_plugin_interface.h>
|
#include <AlarmManagement/alm_data_plugin_interface.h>
|
||||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||||
|
|
||||||
#include <AreaEffectSimulation/aes_dtc.h>
|
#include <AreaEffectSimulation/aes_dtc.h>
|
||||||
#include <ParticipantManagement/ppm.hpp>
|
#include <ParticipantManagement/ppm.hpp>
|
||||||
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
|
|
||||||
namespace AlarmManagement
|
namespace AlarmManagement
|
||||||
{
|
{
|
||||||
|
|||||||
+18
-17
@@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
#include "alm_dialog.h"
|
#include "alm_dialog.h"
|
||||||
|
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "alm_history.h"
|
#include "alm_history.h"
|
||||||
#include "ui_alm_dialog.h"
|
#include "ui_alm_dialog.h"
|
||||||
|
|
||||||
#include <LtsSession/lts_session_data.h>
|
#include <LtsSession/lts_session_data.h>
|
||||||
#include <LtsUtilsSettings/settings.h>
|
#include <LtsUtilsSettings/settings.h>
|
||||||
#include <LtsWidgets/lts_dialog.h>
|
#include <LtsWidgets/lts_dialog.h>
|
||||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ namespace AlarmManagement
|
|||||||
AlarmDialog::AlarmDialog(QWidget* parent)
|
AlarmDialog::AlarmDialog(QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_configAlarmModel(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel), m_configAlarmModel(nullptr),
|
||||||
m_dtc(nullptr), m_ftc(nullptr), m_ui(new Ui::AlarmDialog), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
m_dtc(nullptr), m_ftc(nullptr), m_ui(new Ui::AlarmDialog), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||||
m_operatorId(-1)
|
m_operatorId(-1), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
AlarmCheckBox alarmCheckBox;
|
AlarmCheckBox alarmCheckBox;
|
||||||
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
|
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
|
||||||
@@ -158,23 +159,23 @@ void AlarmDialog::retranslate()
|
|||||||
|
|
||||||
void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, DataModification modType)
|
void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, DataModification modType)
|
||||||
{
|
{
|
||||||
bool setMarker = data.setMarker();
|
bool setMarker = data.setMarker;
|
||||||
bool messageWindow = data.messageWindow();
|
bool messageWindow = data.messageWindow;
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "************** onAlarmConfigChanged "
|
DEBUG_LOG(m_logger) << "************** onAlarmConfigChanged "
|
||||||
<< " id=" << data.id() << " operatorId=" << data.operatorId()
|
<< " id=" << data.id << " operatorId=" << data.operatorId
|
||||||
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId()
|
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId
|
||||||
<< " eventTypeId=" << data.eventTypeId() << " messageWindow=" << messageWindow
|
<< " eventTypeId=" << data.eventTypeId << " messageWindow=" << messageWindow
|
||||||
<< " setMarker=" << setMarker;
|
<< " setMarker=" << setMarker;
|
||||||
if (data.global() == false)
|
if (data.global == false)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.operatorId() == m_operatorId)
|
if (data.operatorId == m_operatorId)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
|
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
|
||||||
switch (data.eventTypeId().underlying())
|
switch (data.eventTypeId)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
|
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
|
||||||
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
|
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
|
||||||
@@ -247,28 +248,28 @@ std::vector<AlarmManagement::AlarmAction> AlarmDialog::getCheckedValues() const
|
|||||||
ret.reserve(m_checkBoxes.size());
|
ret.reserve(m_checkBoxes.size());
|
||||||
for (const AlarmCheckBox& item : std::as_const(m_checkBoxes))
|
for (const AlarmCheckBox& item : std::as_const(m_checkBoxes))
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(item.eventTypeId);
|
alarmActionDds.eventTypeId = item.eventTypeId;
|
||||||
if (item.checkboxMarker->isChecked())
|
if (item.checkboxMarker->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.setMarker(true);
|
alarmActionDds.setMarker = true;
|
||||||
DEBUG_LOG(m_logger) << item.name << " setMarker = true";
|
DEBUG_LOG(m_logger) << item.name << " setMarker = true";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
alarmActionDds.setMarker(false);
|
alarmActionDds.setMarker = false;
|
||||||
DEBUG_LOG(m_logger) << item.name << " setMarker = false";
|
DEBUG_LOG(m_logger) << item.name << " setMarker = false";
|
||||||
}
|
}
|
||||||
if (item.checkboxWindow->isChecked())
|
if (item.checkboxWindow->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.messageWindow(true);
|
alarmActionDds.messageWindow = true;
|
||||||
DEBUG_LOG(m_logger) << item.name << " messageWindow = true";
|
DEBUG_LOG(m_logger) << item.name << " messageWindow = true";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
alarmActionDds.messageWindow(false);
|
alarmActionDds.messageWindow = false;
|
||||||
DEBUG_LOG(m_logger) << item.name << " messageWindow = false";
|
DEBUG_LOG(m_logger) << item.name << " messageWindow = false";
|
||||||
}
|
}
|
||||||
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
|
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
|
||||||
ret.push_back(alarmActionDds);
|
ret.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
+1
@@ -7,6 +7,7 @@
|
|||||||
#include <AlarmManagement/alm_ftc.h>
|
#include <AlarmManagement/alm_ftc.h>
|
||||||
#include <AlarmManagement/alm_dtc.h>
|
#include <AlarmManagement/alm_dtc.h>
|
||||||
#include <ParticipantManagement/ppm.hpp>
|
#include <ParticipantManagement/ppm.hpp>
|
||||||
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||||
#include <AlarmManagement/logger.h>
|
#include <AlarmManagement/logger.h>
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
#include "alm_history.h"
|
#include "alm_history.h"
|
||||||
|
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "ui_alm_history.h"
|
#include "ui_alm_history.h"
|
||||||
|
|
||||||
#include <LtsPrinting/printing.h>
|
#include <LtsPrinting/printing.h>
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <AlarmManagement/Common/alm_history_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
|
||||||
#include <QtWidgets/QTreeView>
|
#include <QtWidgets/QTreeView>
|
||||||
|
|
||||||
namespace AlarmManagement
|
namespace AlarmManagement
|
||||||
@@ -14,7 +15,8 @@ namespace AlarmManagement
|
|||||||
|
|
||||||
AlarmView::AlarmView(LtsSession::LtsSession* session, QWidget* parent)
|
AlarmView::AlarmView(LtsSession::LtsSession* session, QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_alarmHistoryModel(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_alarmHistoryModel(nullptr),
|
||||||
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView)
|
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --- AlarmView Konstruktor() ";
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --- AlarmView Konstruktor() ";
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|||||||
+60
-60
@@ -50,13 +50,13 @@ ConfigParticipantsDialog::~ConfigParticipantsDialog()
|
|||||||
|
|
||||||
void ConfigParticipantsDialog::retranslate()
|
void ConfigParticipantsDialog::retranslate()
|
||||||
{
|
{
|
||||||
if (!m_participantData.equipmentNumber().is_set())
|
if (!m_participantData.equipmentNumber.has_value())
|
||||||
{
|
{
|
||||||
QString hierarchy = m_ppmDtc->hierarchyFromParticipant(m_participantData.id());
|
QString hierarchy = m_ppmDtc->hierarchyFromParticipant(m_participantData.id);
|
||||||
translate(m_ui, m_participantData, hierarchy, tr("Participant Alarm"));
|
translate(m_ui, m_participantData, hierarchy, tr("Participant Alarm"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
translate(m_ui, m_participantData, QString::number(m_participantData.equipmentNumber().get()),
|
translate(m_ui, m_participantData, QString::number(m_participantData.equipmentNumber.get()),
|
||||||
tr("Participant Alarm"));
|
tr("Participant Alarm"));
|
||||||
|
|
||||||
m_uiRequirements->clear();
|
m_uiRequirements->clear();
|
||||||
@@ -82,12 +82,12 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
|||||||
|
|
||||||
m_operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
m_operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||||
|
|
||||||
m_ui->lbHierarchy->setText(m_ppmDtc->hierarchyFromParticipant(m_participantData.id()));
|
m_ui->lbHierarchy->setText(m_ppmDtc->hierarchyFromParticipant(m_participantData.id));
|
||||||
|
|
||||||
QString equipmentNumbersStr;
|
QString equipmentNumbersStr;
|
||||||
if (participantData.equipmentNumber().is_set())
|
if (participantData.equipmentNumber.has_value())
|
||||||
{
|
{
|
||||||
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber().get()));
|
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber.get()));
|
||||||
equipmentNumbersStr.append(QStringLiteral(": "));
|
equipmentNumbersStr.append(QStringLiteral(": "));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,10 +97,10 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
|||||||
|
|
||||||
m_ui->equipmentNoContent->setText(equipmentNumbersStr);
|
m_ui->equipmentNoContent->setText(equipmentNumbersStr);
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "current participantId = " << participantData.id();
|
DEBUG_LOG(m_logger) << "current participantId = " << participantData.id;
|
||||||
|
|
||||||
m_typeClass = ppmDtc->type(participantData.typeId()).typeClass();
|
m_typeClass = ppmDtc->type(participantData.typeId).typeClass;
|
||||||
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId();
|
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId;
|
||||||
fillCbx();
|
fillCbx();
|
||||||
|
|
||||||
m_almDtc->alarmConfigs([this](const AlarmManagement::AlarmConfig& alarm) { setAlaramData(alarm); });
|
m_almDtc->alarmConfigs([this](const AlarmManagement::AlarmConfig& alarm) { setAlaramData(alarm); });
|
||||||
@@ -110,21 +110,21 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
|
|||||||
void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig& alarm)
|
void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig& alarm)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "setAlaramData:" << alarm;
|
DEBUG_LOG(m_logger) << "setAlaramData:" << alarm;
|
||||||
if (alarm.operatorId() != m_operatorId || alarm.participantId() != m_participantData.id() || alarm.global())
|
if (alarm.operatorId != m_operatorId || alarm.participantId != m_participantData.id || alarm.global)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch (alarm.eventTypeId().underlying())
|
switch (alarm.eventTypeId)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::PdmEventType::EventType_Hit: {
|
case ProjectDataManagement::PdmEventType::EventType_Hit: {
|
||||||
DEBUG_LOG(m_logger) << "Hit zuweisen ";
|
DEBUG_LOG(m_logger) << "Hit zuweisen ";
|
||||||
m_ui->cbxDirectFire->setChecked(true);
|
m_ui->cbxDirectFire->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
if (alarm.vulnerabilityState() >= 0)
|
if (alarm.vulnerabilityState >= 0)
|
||||||
{
|
{
|
||||||
ProjectDataManagement::VulnerabilityState vulState =
|
ProjectDataManagement::VulnerabilityState vulState =
|
||||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
|
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
|
||||||
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
|
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
|
||||||
m_ui->cbStatusDirect->setCurrentIndex(index);
|
m_ui->cbStatusDirect->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -132,22 +132,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
|||||||
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
|
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
|
||||||
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
|
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
|
||||||
m_ui->cbxIndirectFire->setChecked(true);
|
m_ui->cbxIndirectFire->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
|
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
|
||||||
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
|
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
|
||||||
m_ui->cbxAirSupport->setChecked(true);
|
m_ui->cbxAirSupport->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
|
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
|
||||||
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
|
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
|
||||||
m_ui->cbxMines->setChecked(true);
|
m_ui->cbxMines->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_HitB:
|
case ProjectDataManagement::PdmEventType::EventType_HitB:
|
||||||
@@ -155,20 +155,20 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
|||||||
case ProjectDataManagement::PdmEventType::EventType_HitC: {
|
case ProjectDataManagement::PdmEventType::EventType_HitC: {
|
||||||
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
|
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
|
||||||
m_ui->cbxNbcAgent->setChecked(true);
|
m_ui->cbxNbcAgent->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
|
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
|
||||||
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
|
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
|
||||||
m_ui->cbxFriendlyFire->setChecked(true);
|
m_ui->cbxFriendlyFire->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
if (alarm.vulnerabilityState() >= 0)
|
if (alarm.vulnerabilityState >= 0)
|
||||||
{
|
{
|
||||||
ProjectDataManagement::VulnerabilityState vulState =
|
ProjectDataManagement::VulnerabilityState vulState =
|
||||||
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
|
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
|
||||||
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
|
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
|
||||||
m_ui->cbStatusFriendly->setCurrentIndex(index);
|
m_ui->cbStatusFriendly->setCurrentIndex(index);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -176,22 +176,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
|
|||||||
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
|
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
|
||||||
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
|
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
|
||||||
m_ui->cbxManipulation->setChecked(true);
|
m_ui->cbxManipulation->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
|
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
|
||||||
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
|
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
|
||||||
m_ui->cbxGlobalBorderLine->setChecked(true);
|
m_ui->cbxGlobalBorderLine->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
|
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
|
||||||
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
|
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
|
||||||
m_ui->cbxLocalBorderLine->setChecked(true);
|
m_ui->cbxLocalBorderLine->setChecked(true);
|
||||||
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
|
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
|
||||||
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
|
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
@@ -207,68 +207,68 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
|
|||||||
|
|
||||||
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
||||||
|
|
||||||
alarmActionDds.setMarker(m_ui->cbxSetMarker->isChecked());
|
alarmActionDds.setMarker = m_ui->cbxSetMarker->isChecked();
|
||||||
alarmActionDds.messageWindow(m_ui->cbxMessageWindow->isChecked());
|
alarmActionDds.messageWindow = m_ui->cbxMessageWindow->isChecked();
|
||||||
alarmActionDds.vulnerabilityState(-1);
|
alarmActionDds.vulnerabilityState = -1;
|
||||||
|
|
||||||
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
|
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
|
||||||
{
|
{
|
||||||
if (m_ui->cbxDirectFire->isChecked())
|
if (m_ui->cbxDirectFire->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
|
||||||
int statusDirect = -1;
|
int statusDirect = -1;
|
||||||
if (m_ui->cbStatusDirect->currentIndex() > 0)
|
if (m_ui->cbStatusDirect->currentIndex() > 0)
|
||||||
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
|
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
|
||||||
alarmActionDds.vulnerabilityState(statusDirect);
|
alarmActionDds.vulnerabilityState = statusDirect;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxFriendlyFire->isChecked())
|
if (m_ui->cbxFriendlyFire->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_FriendlyFire;
|
||||||
int statusFriendly = -1;
|
int statusFriendly = -1;
|
||||||
if (m_ui->cbStatusFriendly->currentIndex() > 0)
|
if (m_ui->cbStatusFriendly->currentIndex() > 0)
|
||||||
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
|
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
|
||||||
alarmActionDds.vulnerabilityState(statusFriendly);
|
alarmActionDds.vulnerabilityState = statusFriendly;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
alarmActionDds.vulnerabilityState(-1);
|
alarmActionDds.vulnerabilityState = -1;
|
||||||
if (m_ui->cbxIndirectFire->isChecked())
|
if (m_ui->cbxIndirectFire->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxAirSupport->isChecked())
|
if (m_ui->cbxAirSupport->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxMines->isChecked())
|
if (m_ui->cbxMines->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxNbcAgent->isChecked())
|
if (m_ui->cbxNbcAgent->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitN;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitB;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitC;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxManipulation->isChecked())
|
if (m_ui->cbxManipulation->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Manipulation;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxGlobalBorderLine->isChecked())
|
if (m_ui->cbxGlobalBorderLine->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
if (m_ui->cbxLocalBorderLine->isChecked())
|
if (m_ui->cbxLocalBorderLine->isChecked())
|
||||||
{
|
{
|
||||||
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
|
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
|
||||||
alarmsDds.push_back(alarmActionDds);
|
alarmsDds.push_back(alarmActionDds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,11 +279,11 @@ bool ConfigParticipantsDialog::apply()
|
|||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "apply";
|
DEBUG_LOG(m_logger) << "apply";
|
||||||
AlarmManagement::ConfigureAlarmsRequest req;
|
AlarmManagement::ConfigureAlarmsRequest req;
|
||||||
req.participantIds(m_participantVector);
|
req.participantIds = m_participantVector;
|
||||||
req.alarms(getCheckedValues());
|
req.alarms = getCheckedValues();
|
||||||
req.operatorId(m_operatorId);
|
req.operatorId = m_operatorId;
|
||||||
req.global(false);
|
req.global = false;
|
||||||
req.remove(false);
|
req.remove = false;
|
||||||
|
|
||||||
return m_requestHelper->startSingleRequest([req, this]() { return m_almFtc->configureAlarmsRequest(req, this); });
|
return m_requestHelper->startSingleRequest([req, this]() { return m_almFtc->configureAlarmsRequest(req, this); });
|
||||||
}
|
}
|
||||||
@@ -298,9 +298,9 @@ void ConfigParticipantsDialog::fillCbx()
|
|||||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
|
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusDirect, m_typeClass);
|
||||||
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
|
ParticipantManagement::insertVulnerabilityStates(m_ui->cbStatusFriendly, m_typeClass);
|
||||||
m_ui->cbStatusDirect->removeItem(
|
m_ui->cbStatusDirect->removeItem(
|
||||||
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
|
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
|
||||||
m_ui->cbStatusFriendly->removeItem(
|
m_ui->cbStatusFriendly->removeItem(
|
||||||
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
|
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace ParticipantAlarms
|
} // namespace ParticipantAlarms
|
||||||
+10
-10
@@ -99,8 +99,8 @@ void ParticipantsDialog::onSelectionChanged()
|
|||||||
for (const QModelIndex& index : currentlySelectedParticipants)
|
for (const QModelIndex& index : currentlySelectedParticipants)
|
||||||
{
|
{
|
||||||
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
|
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
|
||||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
|
||||||
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
|
m_ppmDtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
|
||||||
configureAlarms = true;
|
configureAlarms = true;
|
||||||
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
|
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
|
||||||
}
|
}
|
||||||
@@ -138,13 +138,13 @@ void ParticipantsDialog::onAddButtonClicked()
|
|||||||
|
|
||||||
QModelIndex participantIndex = m_ui->dvParticipants->currentIndex();
|
QModelIndex participantIndex = m_ui->dvParticipants->currentIndex();
|
||||||
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(participantIndex);
|
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(participantIndex);
|
||||||
DEBUG_LOG(m_logger) << "current participantId = " << data.id();
|
DEBUG_LOG(m_logger) << "current participantId = " << data.id;
|
||||||
m_participantVector.push_back(data.id());
|
m_participantVector.push_back(data.id);
|
||||||
|
|
||||||
const auto partData = m_participantModel->getParticipantData(participantIndex);
|
const auto partData = m_participantModel->getParticipantData(participantIndex);
|
||||||
addDialog(LtsWidgets::initDialog(new ConfigParticipantsDialog(this), m_ppmDtc, m_almDtc, m_almFtc, partData,
|
addDialog(LtsWidgets::initDialog(new ConfigParticipantsDialog(this), m_ppmDtc, m_almDtc, m_almFtc, partData,
|
||||||
m_participantVector, m_equipmentVector),
|
m_participantVector, m_equipmentVector),
|
||||||
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id()));
|
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticipantsDialog::onPrint()
|
void ParticipantsDialog::onPrint()
|
||||||
@@ -168,12 +168,12 @@ void ParticipantsDialog::setChildrenSelected(const QModelIndex& parent)
|
|||||||
DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected";
|
DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected";
|
||||||
|
|
||||||
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(childIndex);
|
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(childIndex);
|
||||||
DEBUG_LOG(m_logger) << "append participantId = " << data.id();
|
DEBUG_LOG(m_logger) << "append participantId = " << data.id;
|
||||||
m_participantVector.push_back(data.id());
|
m_participantVector.push_back(data.id);
|
||||||
if (data.equipmentNumber().is_set())
|
if (data.equipmentNumber.has_value())
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber().get();
|
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber.get();
|
||||||
m_equipmentVector.push_back(data.equipmentNumber().get());
|
m_equipmentVector.push_back(data.equipmentNumber.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->dvParticipants->selectionModel()->select(m_participantProxyModel->mapFromSource(childIndex),
|
m_ui->dvParticipants->selectionModel()->select(m_participantProxyModel->mapFromSource(childIndex),
|
||||||
|
|||||||
+1
@@ -8,6 +8,7 @@
|
|||||||
|
|
||||||
#include <AreaEffectSimulation/aes_dtc.h>
|
#include <AreaEffectSimulation/aes_dtc.h>
|
||||||
#include <ParticipantManagement/ppm.hpp>
|
#include <ParticipantManagement/ppm.hpp>
|
||||||
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
#include <AlarmManagement/alm_ftc.h>
|
#include <AlarmManagement/alm_ftc.h>
|
||||||
#include <AlarmManagement/alm_dtc.h>
|
#include <AlarmManagement/alm_dtc.h>
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -37,10 +37,10 @@ void ParticipantAlarmModel::onParticipantChanged(const ParticipantManagement::Pa
|
|||||||
DataModification modType)
|
DataModification modType)
|
||||||
{
|
{
|
||||||
Q_UNUSED(modType);
|
Q_UNUSED(modType);
|
||||||
if (data.partyId() != partyId())
|
if (data.partyId != partyId())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
|
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated;
|
||||||
onReinitModel(partyId());
|
onReinitModel(partyId());
|
||||||
emit newData();
|
emit newData();
|
||||||
}
|
}
|
||||||
@@ -50,17 +50,17 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
|
|||||||
bool isSimulatable = false;
|
bool isSimulatable = false;
|
||||||
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
const ParticipantManagement::ParticipantData data(getParticipantData(index));
|
||||||
|
|
||||||
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
|
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
|
||||||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
|
m_dtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
|
||||||
isSimulatable = true;
|
isSimulatable = true;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
|
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id << " isSimulated:" << data.isSimulated
|
||||||
<< " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId()
|
<< " equipmentNo:" << data.equipmentNumber << " typeId=" << data.typeId
|
||||||
<< " modId=" << data.modId() << " typeClass=" << m_dtc->type(data.typeId()).typeClass()
|
<< " modId=" << data.modId << " typeClass=" << m_dtc->type(data.typeId).typeClass
|
||||||
<< " isSimulatable=" << isSimulatable;
|
<< " isSimulatable=" << isSimulatable;
|
||||||
|
|
||||||
if (bIsSimulated)
|
if (bIsSimulated)
|
||||||
*bIsSimulated = data.isSimulated();
|
*bIsSimulated = data.isSimulated;
|
||||||
|
|
||||||
return isSimulatable;
|
return isSimulatable;
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-9
@@ -96,28 +96,28 @@ void ParticipantShowConfigView::onShowAlarm()
|
|||||||
void ParticipantShowConfigView::onRemoveAlarm()
|
void ParticipantShowConfigView::onRemoveAlarm()
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "onRemoveAlarm"
|
DEBUG_LOG(m_logger) << "onRemoveAlarm"
|
||||||
<< " id = " << m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).id()
|
<< " id = " << m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).id
|
||||||
<< " eventTypeId = "
|
<< " eventTypeId = "
|
||||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId()
|
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId
|
||||||
<< " operatorId = "
|
<< " operatorId = "
|
||||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId()
|
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId
|
||||||
<< " participantId = "
|
<< " participantId = "
|
||||||
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).participantId();
|
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).participantId;
|
||||||
|
|
||||||
const QModelIndex curIdx = m_ui->widget->currentIndex();
|
const QModelIndex curIdx = m_ui->widget->currentIndex();
|
||||||
if (!curIdx.isValid())
|
if (!curIdx.isValid())
|
||||||
return;
|
return;
|
||||||
const AlarmManagement::AlarmConfig& rowdata = m_configAlarmModel->getRowData(curIdx.row());
|
const AlarmManagement::AlarmConfig& rowdata = m_configAlarmModel->getRowData(curIdx.row());
|
||||||
int operatorId = rowdata.operatorId();
|
int operatorId = rowdata.operatorId;
|
||||||
std::vector<int32_t> ddsParticipantIds;
|
std::vector<int32_t> ddsParticipantIds;
|
||||||
ddsParticipantIds.push_back(rowdata.participantId());
|
ddsParticipantIds.push_back(rowdata.participantId);
|
||||||
bool globalEvent = true;
|
bool globalEvent = true;
|
||||||
bool remove = true;
|
bool remove = true;
|
||||||
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
std::vector<AlarmManagement::AlarmAction> alarmsDds;
|
||||||
alarmsDds.resize(1);
|
alarmsDds.resize(1);
|
||||||
alarmsDds[0].setMarker(false);
|
alarmsDds[0].setMarker = false;
|
||||||
alarmsDds[0].messageWindow(false);
|
alarmsDds[0].messageWindow = false;
|
||||||
alarmsDds[0].eventTypeId(rowdata.eventTypeId());
|
alarmsDds[0].eventTypeId = rowdata.eventTypeId;
|
||||||
AlarmManagement::ConfigureAlarmsRequest request(alarmsDds, operatorId, ddsParticipantIds, globalEvent, remove);
|
AlarmManagement::ConfigureAlarmsRequest request(alarmsDds, operatorId, ddsParticipantIds, globalEvent, remove);
|
||||||
|
|
||||||
m_requestHelper->startSingleRequest([request, this]() {
|
m_requestHelper->startSingleRequest([request, this]() {
|
||||||
|
|||||||
+3
-3
@@ -6,7 +6,7 @@
|
|||||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||||
#include <LtsWidgets/lts_dialog.h>
|
#include <LtsWidgets/lts_dialog.h>
|
||||||
#include <ParticipantManagement/ppm_dtc.h>
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
#include <AlarmManagement/Common/alm_config_alarm_model.h>
|
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
|
||||||
#include <AlarmManagement/alm_dtc.h>
|
#include <AlarmManagement/alm_dtc.h>
|
||||||
#include <AlarmManagement/alm_ftc.h>
|
#include <AlarmManagement/alm_ftc.h>
|
||||||
|
|
||||||
@@ -41,7 +41,6 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
|
|||||||
void onPrint();
|
void onPrint();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
NGL::INGLLogger& m_logger;
|
|
||||||
void onConfigureAlarmsReply(const Core::FunctionReplyObject& replyObject) override final;
|
void onConfigureAlarmsReply(const Core::FunctionReplyObject& replyObject) override final;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -57,7 +56,8 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
|
|||||||
Ui::ParticipantShowConfigView* m_ui;
|
Ui::ParticipantShowConfigView* m_ui;
|
||||||
LtsUtils::RequestHelper* m_requestHelper;
|
LtsUtils::RequestHelper* m_requestHelper;
|
||||||
|
|
||||||
AlarmManagement::
|
AlarmManagement::LOGGER_T m_logger;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ParticipantAlarms
|
} // namespace ParticipantAlarms
|
||||||
+18
-16
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "alm_emergency_call_dialog.h"
|
#include "alm_emergency_call_dialog.h"
|
||||||
|
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h"
|
#include "AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h"
|
||||||
#include "ui_alm_emergency_call_dialog.h"
|
#include "ui_alm_emergency_call_dialog.h"
|
||||||
|
|
||||||
@@ -18,7 +19,8 @@ namespace AlarmManagement
|
|||||||
|
|
||||||
EmergencyCallDialog::EmergencyCallDialog(QWidget* parent)
|
EmergencyCallDialog::EmergencyCallDialog(QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
||||||
m_session(nullptr), m_ui(new Ui::EmergencyCallDialog), m_requestHelper(new LtsUtils::RequestHelper(this))
|
m_session(nullptr), m_ui(new Ui::EmergencyCallDialog), m_requestHelper(new LtsUtils::RequestHelper(this)),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
}
|
}
|
||||||
@@ -104,10 +106,10 @@ void EmergencyCallDialog::enaDisa()
|
|||||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
|
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
|
||||||
|
|
||||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||||
if (sos.id() <= 0)
|
if (sos.id <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!sos.expired())
|
if (!sos.expired)
|
||||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, true);
|
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, true);
|
||||||
|
|
||||||
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, true);
|
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, true);
|
||||||
@@ -158,7 +160,7 @@ void EmergencyCallDialog::onEditBtCliked()
|
|||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||||
|
|
||||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||||
if (sos.id() <= 0)
|
if (sos.id <= 0)
|
||||||
return;
|
return;
|
||||||
setAcknowledgeUi();
|
setAcknowledgeUi();
|
||||||
|
|
||||||
@@ -181,16 +183,16 @@ void EmergencyCallDialog::onFindEmergencyOnMap()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||||
if (sos.id() <= 0)
|
if (sos.id <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_sitMapGuiIfc->setCenterPoint(QPointF(sos.position().lon(), sos.position().lat()));
|
m_sitMapGuiIfc->setCenterPoint(QPointF(sos.position.lon, sos.position.lat));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmergencyCallDialog::onEmergencyIndexDoubleClicked(const QModelIndex& index)
|
void EmergencyCallDialog::onEmergencyIndexDoubleClicked(const QModelIndex& index)
|
||||||
{
|
{
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
emit openInfoDlg(getSelectedSOS().id());
|
emit openInfoDlg(getSelectedSOS().id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
|
void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
|
||||||
@@ -198,18 +200,18 @@ void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
|
|||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||||
|
|
||||||
const AlmEmergencyCall& sos = getSelectedSOS();
|
const AlmEmergencyCall& sos = getSelectedSOS();
|
||||||
if (sos.id() <= 0 || sos.expired())
|
if (sos.id <= 0 || sos.expired)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EmergencyCallAcknowledgeRequest request;
|
EmergencyCallAcknowledgeRequest request;
|
||||||
request.id(sos.id());
|
request.id = sos.id;
|
||||||
request.issi(sos.issi());
|
request.issi = sos.issi;
|
||||||
request.name(sos.name());
|
request.name = sos.name;
|
||||||
request.timestamp(QDateTime::currentMSecsSinceEpoch());
|
request.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||||
request.incomingTime(sos.incomingTime());
|
request.incomingTime = sos.incomingTime;
|
||||||
request.expired(true);
|
request.expired = true;
|
||||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||||
request.comment(comment.toStdString());
|
request.comment = comment.toStdString();
|
||||||
m_requestHelper->startSingleRequest(
|
m_requestHelper->startSingleRequest(
|
||||||
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -82,9 +82,9 @@ QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
|
|||||||
|
|
||||||
auto cb = [this](const AlmEmergencyCall &data)
|
auto cb = [this](const AlmEmergencyCall &data)
|
||||||
{
|
{
|
||||||
if (data.id() <= 0 || data.expired())
|
if (data.id <= 0 || data.expired)
|
||||||
return;
|
return;
|
||||||
this->showEmergencyCallInfoWindow(data.id());
|
this->showEmergencyCallInfoWindow(data.id);
|
||||||
};
|
};
|
||||||
m_dtc->almEmergencyCalls(cb);
|
m_dtc->almEmergencyCalls(cb);
|
||||||
|
|
||||||
@@ -111,10 +111,10 @@ void InterfaceImpl::onEmergencyCallChanged(const AlmEmergencyCall &data, DataMod
|
|||||||
{
|
{
|
||||||
if (modType != DataModification::eAdded)
|
if (modType != DataModification::eAdded)
|
||||||
return;
|
return;
|
||||||
if (data.id() <= 0 || data.expired())
|
if (data.id <= 0 || data.expired)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->showEmergencyCallInfoWindow(data.id());
|
this->showEmergencyCallInfoWindow(data.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InterfaceImpl::onOpenInfoDlg(const int &id)
|
void InterfaceImpl::onOpenInfoDlg(const int &id)
|
||||||
|
|||||||
+29
-27
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "alm_emergency_call_info_dialog.h"
|
#include "alm_emergency_call_info_dialog.h"
|
||||||
|
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include "ui_alm_emergency_call_info_dialog.h"
|
#include "ui_alm_emergency_call_info_dialog.h"
|
||||||
|
|
||||||
#include <AlarmManagement/alm_operator_rights.h>
|
#include <AlarmManagement/alm_operator_rights.h>
|
||||||
@@ -46,10 +47,11 @@ QImage renderEmergencySymbol(bool expired = false)
|
|||||||
|
|
||||||
EmergencyCallInfoDialog::EmergencyCallInfoDialog(int entryId, QWidget* parent)
|
EmergencyCallInfoDialog::EmergencyCallInfoDialog(int entryId, QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
|
||||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog)
|
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog),
|
||||||
|
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_emergency.id(entryId);
|
m_emergency.id = entryId;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmergencyCallInfoDialog::~EmergencyCallInfoDialog()
|
EmergencyCallInfoDialog::~EmergencyCallInfoDialog()
|
||||||
@@ -77,7 +79,7 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
|
|||||||
m_dtc->enableAlmEmergencyCall();
|
m_dtc->enableAlmEmergencyCall();
|
||||||
m_ftc->enableEmergencyCallAcknowledge();
|
m_ftc->enableEmergencyCallAcknowledge();
|
||||||
|
|
||||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
|
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
|
||||||
setUiValues();
|
setUiValues();
|
||||||
|
|
||||||
connect(m_dtc.get(), &AlarmManagement::Interface::Dtc::almEmergencyCallChanged, this,
|
connect(m_dtc.get(), &AlarmManagement::Interface::Dtc::almEmergencyCallChanged, this,
|
||||||
@@ -92,34 +94,34 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
|
|||||||
|
|
||||||
QString EmergencyCallInfoDialog::emergencyIdentifier() const
|
QString EmergencyCallInfoDialog::emergencyIdentifier() const
|
||||||
{
|
{
|
||||||
return QStringLiteral("emergency_") + QString::number(m_emergency.id());
|
return QStringLiteral("emergency_") + QString::number(m_emergency.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool EmergencyCallInfoDialog::setUiValues()
|
bool EmergencyCallInfoDialog::setUiValues()
|
||||||
{
|
{
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||||
if (!m_dtc || !m_ftc || m_emergency.id() < 0)
|
if (!m_dtc || !m_ftc || m_emergency.id < 0)
|
||||||
{
|
{
|
||||||
ERROR_LOG(m_logger) << " >> unabled to init EmergencyCallInfoDialog";
|
ERROR_LOG(m_logger) << " >> unabled to init EmergencyCallInfoDialog";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi()));
|
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi));
|
||||||
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime())));
|
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime)));
|
||||||
m_ui->lblStatus->setText(m_emergency.expired()
|
m_ui->lblStatus->setText(m_emergency.expired
|
||||||
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted()))
|
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted))
|
||||||
: QStringLiteral("--"));
|
: QStringLiteral("--"));
|
||||||
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment()));
|
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment));
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position().lon(), m_emergency.position().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position.lon, m_emergency.position.lat);
|
||||||
m_ui->lblPosition->setText(mgrs);
|
m_ui->lblPosition->setText(mgrs);
|
||||||
|
|
||||||
const bool& hasOperatorRightEmergencyCall =
|
const bool& hasOperatorRightEmergencyCall =
|
||||||
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::EmergencyCall);
|
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::EmergencyCall);
|
||||||
m_ui->pbAckEmergency->setIcon(QIcon(QStringLiteral("icon:edit.svg")));
|
m_ui->pbAckEmergency->setIcon(QIcon(QStringLiteral("icon:edit.svg")));
|
||||||
m_ui->pbAckEmergency->setEnabled(m_emergency.expired() ? false : true);
|
m_ui->pbAckEmergency->setEnabled(m_emergency.expired ? false : true);
|
||||||
m_ui->pbAckEmergency->setVisible(hasOperatorRightEmergencyCall);
|
m_ui->pbAckEmergency->setVisible(hasOperatorRightEmergencyCall);
|
||||||
|
|
||||||
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired()));
|
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired));
|
||||||
m_ui->lblIcon->setPixmap(iconPixmap);
|
m_ui->lblIcon->setPixmap(iconPixmap);
|
||||||
|
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
|
||||||
@@ -129,7 +131,7 @@ bool EmergencyCallInfoDialog::setUiValues()
|
|||||||
void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergencyCall data, DataModification modType)
|
void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergencyCall data, DataModification modType)
|
||||||
{
|
{
|
||||||
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
|
||||||
if (data.id() != m_emergency.id() || data.id() == 0)
|
if (data.id != m_emergency.id || data.id == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
@@ -149,9 +151,9 @@ void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergen
|
|||||||
|
|
||||||
void EmergencyCallInfoDialog::onFindEmergencyOnMap()
|
void EmergencyCallInfoDialog::onFindEmergencyOnMap()
|
||||||
{
|
{
|
||||||
if (!m_sitMapGuiIfc || m_emergency.id() <= 0)
|
if (!m_sitMapGuiIfc || m_emergency.id <= 0)
|
||||||
return;
|
return;
|
||||||
m_sitMapGuiIfc->setCenterPoint(QPointF(m_emergency.position().lon(), m_emergency.position().lat()));
|
m_sitMapGuiIfc->setCenterPoint(QPointF(m_emergency.position.lon, m_emergency.position.lat));
|
||||||
}
|
}
|
||||||
|
|
||||||
void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
|
void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
|
||||||
@@ -191,18 +193,18 @@ void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
|
|||||||
|
|
||||||
void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString& comment)
|
void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString& comment)
|
||||||
{
|
{
|
||||||
if (m_emergency.id() <= 0)
|
if (m_emergency.id <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
EmergencyCallAcknowledgeRequest request;
|
EmergencyCallAcknowledgeRequest request;
|
||||||
request.id(m_emergency.id());
|
request.id = m_emergency.id;
|
||||||
request.name(m_emergency.name());
|
request.name = m_emergency.name;
|
||||||
request.issi(m_emergency.issi());
|
request.issi = m_emergency.issi;
|
||||||
request.timestamp(QDateTime::currentMSecsSinceEpoch());
|
request.timestamp = QDateTime::currentMSecsSinceEpoch();
|
||||||
request.incomingTime(m_emergency.incomingTime());
|
request.incomingTime = m_emergency.incomingTime;
|
||||||
request.expired(true);
|
request.expired = true;
|
||||||
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
|
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
|
||||||
request.comment(comment.toStdString());
|
request.comment = comment.toStdString();
|
||||||
bool ret = m_requestHelper->startSingleRequest(
|
bool ret = m_requestHelper->startSingleRequest(
|
||||||
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
|
||||||
|
|
||||||
@@ -212,8 +214,8 @@ void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString&
|
|||||||
|
|
||||||
void EmergencyCallInfoDialog::retranslate()
|
void EmergencyCallInfoDialog::retranslate()
|
||||||
{
|
{
|
||||||
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
|
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
|
||||||
const QString lbName = tr("SOS_%1").arg(m_emergency.issi());
|
const QString lbName = tr("SOS_%1").arg(m_emergency.issi);
|
||||||
translate(m_ui, lbName);
|
translate(m_ui, lbName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+16
-14
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "alm_emergency_call_model.h"
|
#include "alm_emergency_call_model.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||||
|
|
||||||
#include <QtCore/QDateTime>
|
#include <QtCore/QDateTime>
|
||||||
@@ -24,6 +25,7 @@ EmergencyCallModel::EmergencyCallModel(QObject *parent)
|
|||||||
tr("Comment"),
|
tr("Comment"),
|
||||||
}, parent)
|
}, parent)
|
||||||
, m_dtc(nullptr)
|
, m_dtc(nullptr)
|
||||||
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{}
|
{}
|
||||||
|
|
||||||
QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
|
QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
|
||||||
@@ -35,35 +37,35 @@ QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
|
|||||||
switch (index.column())
|
switch (index.column())
|
||||||
{
|
{
|
||||||
case Columns::ID:
|
case Columns::ID:
|
||||||
return almEmergency.id();
|
return almEmergency.id;
|
||||||
case SAMPLE_TIME:
|
case SAMPLE_TIME:
|
||||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime());
|
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime);
|
||||||
case INCOMING_TIME:
|
case INCOMING_TIME:
|
||||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime());
|
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime);
|
||||||
case NAME:
|
case NAME:
|
||||||
return QString::fromStdString(almEmergency.name());
|
return QString::fromStdString(almEmergency.name);
|
||||||
case ISSI:
|
case ISSI:
|
||||||
return almEmergency.issi();
|
return almEmergency.issi;
|
||||||
case POSITION:
|
case POSITION:
|
||||||
{
|
{
|
||||||
if (std::isnan(almEmergency.position().lat()))
|
if (std::isnan(almEmergency.position.lat))
|
||||||
return tr("---");
|
return tr("---");
|
||||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(almEmergency.position().lon(), almEmergency.position().lat());
|
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(almEmergency.position.lon, almEmergency.position.lat);
|
||||||
return mgrs;
|
return mgrs;
|
||||||
}
|
}
|
||||||
case EXPIRED:
|
case EXPIRED:
|
||||||
return almEmergency.expired();
|
return almEmergency.expired;
|
||||||
case OPERATION_ID:
|
case OPERATION_ID:
|
||||||
{
|
{
|
||||||
if (almEmergency.operatorId() == 0)
|
if (almEmergency.operatorId == 0)
|
||||||
return QStringLiteral("-");
|
return QStringLiteral("-");
|
||||||
|
|
||||||
return QString::fromStdString(m_opmDtc.get()->user(almEmergency.operatorId()).name());
|
return QString::fromStdString(m_opmDtc.get()->user(almEmergency.operatorId).name);
|
||||||
}
|
}
|
||||||
case DELETED_TIMESTAMP:
|
case DELETED_TIMESTAMP:
|
||||||
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted());
|
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted);
|
||||||
case COMMENT:
|
case COMMENT:
|
||||||
return QString::fromStdString(almEmergency.comment());
|
return QString::fromStdString(almEmergency.comment);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -89,7 +91,7 @@ bool EmergencyCallModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc,
|
|||||||
|
|
||||||
void EmergencyCallModel::onAlarmEmergencyCallChanged(const AlarmManagement::AlmEmergencyCall &data, const DataModification modType)
|
void EmergencyCallModel::onAlarmEmergencyCallChanged(const AlarmManagement::AlmEmergencyCall &data, const DataModification modType)
|
||||||
{
|
{
|
||||||
const int id = data.id();
|
const int id = data.id;
|
||||||
int row = findRowForId(id);
|
int row = findRowForId(id);
|
||||||
switch (modType)
|
switch (modType)
|
||||||
{
|
{
|
||||||
@@ -148,7 +150,7 @@ bool EmergencyCallProxyModel::filterAcceptsRow(int source_row, const QModelIndex
|
|||||||
bool EmergencyCallProxyModel::checkFilter(int source_row) const
|
bool EmergencyCallProxyModel::checkFilter(int source_row) const
|
||||||
{
|
{
|
||||||
const auto sos = m_sourceModel->getRowData(source_row);
|
const auto sos = m_sourceModel->getRowData(source_row);
|
||||||
if ((sos.expired() && !showExpired()) || (exerciseStopped() && !sos.expired()))
|
if ((sos.expired && !showExpired()) || (exerciseStopped() && !sos.expired))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
+44
-44
@@ -8,16 +8,16 @@
|
|||||||
#include <ChargeEffect/aes_charge_effect_gui_plugin_interface.h>
|
#include <ChargeEffect/aes_charge_effect_gui_plugin_interface.h>
|
||||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/Borderline/aes_borderline_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/Explosion/aes_explosion_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineArea/aes_mine_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
||||||
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||||
#include <ngltools/ngltools_dtg.h>
|
#include <ngltools/ngltools_dtg.h>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ namespace AreaEffectSimulation
|
|||||||
|
|
||||||
AesChargeEffectItemInfo::AesChargeEffectItemInfo(int chargeEffectId, QWidget* parent)
|
AesChargeEffectItemInfo::AesChargeEffectItemInfo(int chargeEffectId, QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_session(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_session(nullptr),
|
||||||
m_ChargeEffectId(chargeEffectId), m_ui(new Ui::AesChargeEffectItemInfo)
|
m_ChargeEffectId(chargeEffectId), m_ui(new Ui::AesChargeEffectItemInfo), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
@@ -77,8 +77,8 @@ bool AesChargeEffectItemInfo::init(LtsSession::LtsSession* session)
|
|||||||
m_ui->lblOriginatorType->hide();
|
m_ui->lblOriginatorType->hide();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_ui->lblOriginatorId->setText(QString::number(data.originatorId()));
|
m_ui->lblOriginatorId->setText(QString::number(data.originatorId));
|
||||||
m_ui->lblOriginatorType->setText(QString::number(data.originatorTypeId().underlying()));
|
m_ui->lblOriginatorType->setText(QString::number(static_cast<int>(data.originatorTypeId)));
|
||||||
|
|
||||||
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Charge_Effect"));
|
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Charge_Effect"));
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ bool AesChargeEffectItemInfo::init(LtsSession::LtsSession* session)
|
|||||||
void AesChargeEffectItemInfo::retranslate()
|
void AesChargeEffectItemInfo::retranslate()
|
||||||
{
|
{
|
||||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||||
translate(m_ui, tr("ChargeEffect: \"%1\"").arg(QString::fromStdString(item.name()), 1, QLatin1Char('?')));
|
translate(m_ui, tr("ChargeEffect: \"%1\"").arg(QString::fromStdString(item.name), 1, QLatin1Char('?')));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesChargeEffectItemInfo::onFindOnMap() const
|
void AesChargeEffectItemInfo::onFindOnMap() const
|
||||||
@@ -111,7 +111,7 @@ template <typename InterfaceType> bool AesChargeEffectItemInfo::tryShowStandardE
|
|||||||
std::shared_ptr<InterfaceType> ifc;
|
std::shared_ptr<InterfaceType> ifc;
|
||||||
if (m_session->getForeignGuiInterface<InterfaceType>(ifc))
|
if (m_session->getForeignGuiInterface<InterfaceType>(ifc))
|
||||||
{
|
{
|
||||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(aiv.aesItemId(), this);
|
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(aiv.aesItemId, this);
|
||||||
if (dialog)
|
if (dialog)
|
||||||
{
|
{
|
||||||
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
|
||||||
@@ -129,11 +129,11 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
|
|
||||||
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
|
||||||
|
|
||||||
if (item.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
|
if (item.originatorTypeId == ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation)
|
||||||
{
|
{
|
||||||
AesItemView aiv;
|
AesItemView aiv;
|
||||||
m_aesDtc->aesItemViewFromEntityId(item.originatorId(), AreaEffectSimulation::AesType::AtUnknown, aiv);
|
m_aesDtc->aesItemViewFromEntityId(item.originatorId, AreaEffectSimulation::AesType::AtUnknown, aiv);
|
||||||
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId();
|
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id << ", aesType: " << aiv.aesTypeId;
|
||||||
|
|
||||||
auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) {
|
auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) {
|
||||||
if (dialog)
|
if (dialog)
|
||||||
@@ -142,7 +142,7 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
switch (aiv.aesTypeId().underlying())
|
switch (aiv.aesTypeId)
|
||||||
{
|
{
|
||||||
case AreaEffectSimulation::AesType::AtNContamination: {
|
case AreaEffectSimulation::AesType::AtNContamination: {
|
||||||
tryShowStandardEditDialog<AesNContamination::ForeignGuiInterface>(aiv);
|
tryShowStandardEditDialog<AesNContamination::ForeignGuiInterface>(aiv);
|
||||||
@@ -179,11 +179,11 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
std::shared_ptr<AesBCContamination::ForeignGuiInterface> ifc;
|
std::shared_ptr<AesBCContamination::ForeignGuiInterface> ifc;
|
||||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||||
{
|
{
|
||||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct.chargeTypeId);
|
||||||
if (gearClass == ProjectDataManagement::GearClass::Biological)
|
if (gearClass == ProjectDataManagement::GearClass::GearClass_Biological)
|
||||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
|
registerDialog(ifc->showEditWindow(aiv.aesItemId, false, this));
|
||||||
else if (gearClass == ProjectDataManagement::GearClass::Chemical)
|
else if (gearClass == ProjectDataManagement::GearClass::GearClass_Chemical)
|
||||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
|
registerDialog(ifc->showEditWindow(aiv.aesItemId, true, this));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger)
|
WARNING_LOG(m_logger)
|
||||||
@@ -194,7 +194,7 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary: {
|
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary: {
|
||||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||||
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId(), this));
|
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId, this));
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger)
|
WARNING_LOG(m_logger)
|
||||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||||
@@ -204,7 +204,7 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
|
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
|
||||||
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
|
||||||
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
|
||||||
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId(), this));
|
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId, this));
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger)
|
WARNING_LOG(m_logger)
|
||||||
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
|
||||||
@@ -216,8 +216,8 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
|
||||||
{
|
{
|
||||||
const bool isExplosionSingle =
|
const bool isExplosionSingle =
|
||||||
(aiv.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionSingle);
|
(aiv.aesTypeId == AreaEffectSimulation::AesType::AtExplosionSingle);
|
||||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
|
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct.chargeTypeId);
|
||||||
|
|
||||||
for (auto gc :
|
for (auto gc :
|
||||||
{ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar,
|
{ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar,
|
||||||
@@ -228,7 +228,7 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
|
|
||||||
if (gearClass == gc)
|
if (gearClass == gc)
|
||||||
{
|
{
|
||||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), isExplosionSingle, false, gc, this));
|
registerDialog(ifc->showEditWindow(aiv.aesItemId, isExplosionSingle, false, gc, this));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -246,8 +246,8 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
{
|
{
|
||||||
|
|
||||||
AesItem ai;
|
AesItem ai;
|
||||||
m_aesDtc->aesItemFromId(aiv.aesItemId(), ai);
|
m_aesDtc->aesItemFromId(aiv.aesItemId, ai);
|
||||||
registerDialog(ifc->showEditWindow(aiv.aesItemId(), ai.effectSourceId(), this));
|
registerDialog(ifc->showEditWindow(aiv.aesItemId, ai.effectSourceId, this));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
WARNING_LOG(m_logger)
|
WARNING_LOG(m_logger)
|
||||||
@@ -274,7 +274,7 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
break;
|
break;
|
||||||
case AreaEffectSimulation::AesType::AtUnknown:
|
case AreaEffectSimulation::AesType::AtUnknown:
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId();
|
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
DEBUG_LOG(m_logger) << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button";
|
DEBUG_LOG(m_logger) << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button";
|
||||||
@@ -298,33 +298,33 @@ void AesChargeEffectItemInfo::onShowDetails()
|
|||||||
|
|
||||||
void AesChargeEffectItemInfo::onChargeEffectChanged(const ChargeEffect& data, DataModification modType)
|
void AesChargeEffectItemInfo::onChargeEffectChanged(const ChargeEffect& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id();
|
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id;
|
||||||
if (data.id() == m_ChargeEffectId && modType != DataModification::eRemoved)
|
if (data.id == m_ChargeEffectId && modType != DataModification::eRemoved)
|
||||||
handleChargeEffect(data);
|
handleChargeEffect(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesChargeEffectItemInfo::handleChargeEffect(const ChargeEffect& data)
|
void AesChargeEffectItemInfo::handleChargeEffect(const ChargeEffect& data)
|
||||||
{
|
{
|
||||||
|
|
||||||
m_ui->lblChargeEffectName->setText(QString::fromStdString(data.name()));
|
m_ui->lblChargeEffectName->setText(QString::fromStdString(data.name));
|
||||||
|
|
||||||
m_ui->lblEffectStart->setText(DTG::toStringMSec(data.effectStart()));
|
m_ui->lblEffectStart->setText(DTG::toStringMSec(data.effectStart));
|
||||||
|
|
||||||
m_ui->lblEffectDuration->setVisible(data.effectDuration() > 0);
|
m_ui->lblEffectDuration->setVisible(data.effectDuration > 0);
|
||||||
m_ui->lbxEffectDuration->setVisible(data.effectDuration() > 0);
|
m_ui->lbxEffectDuration->setVisible(data.effectDuration > 0);
|
||||||
|
|
||||||
m_ui->lblEffectDuration->setText(LtsWidgets::readableDuration(data.effectDuration()));
|
m_ui->lblEffectDuration->setText(LtsWidgets::readableDuration(data.effectDuration));
|
||||||
|
|
||||||
AreaEffectSimulation::AesEffectState st = data.state();
|
AreaEffectSimulation::AesEffectState st = data.state;
|
||||||
m_ui->lblStatus->setText(AreaEffectSimulation::toString(st));
|
m_ui->lblStatus->setText(AreaEffectSimulation::toString(st));
|
||||||
|
|
||||||
m_ui->lblChargeTypeId->setText(QString::number(data.chargeTypeId()));
|
m_ui->lblChargeTypeId->setText(QString::number(data.chargeTypeId));
|
||||||
|
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(data.chargeTypeId()));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(data.chargeTypeId));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId()));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId));
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.position.lon, data.position.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -18,7 +18,7 @@ namespace AreaEffectSimulation
|
|||||||
|
|
||||||
DangerAreaAesItemInfo::DangerAreaAesItemInfo(QWidget* parent)
|
DangerAreaAesItemInfo::DangerAreaAesItemInfo(QWidget* parent)
|
||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_session(nullptr),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_session(nullptr),
|
||||||
m_ui(new Ui::DangerAreaAesItemInfo), m_aesItemId(-1)
|
m_ui(new Ui::DangerAreaAesItemInfo), m_aesItemId(-1), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
}
|
}
|
||||||
@@ -34,35 +34,35 @@ void DangerAreaAesItemInfo::retranslate()
|
|||||||
{
|
{
|
||||||
|
|
||||||
std::unique_ptr<AesItem> item(new BCContamination(m_dtc->bCContamination(m_aesItemId)));
|
std::unique_ptr<AesItem> item(new BCContamination(m_dtc->bCContamination(m_aesItemId)));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
translate(m_ui, m_dtc->bCContamination(m_aesItemId), tr("B/C-Contamination"));
|
translate(m_ui, m_dtc->bCContamination(m_aesItemId), tr("B/C-Contamination"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.reset(new NContamination(m_dtc->nContamination(m_aesItemId)));
|
item.reset(new NContamination(m_dtc->nContamination(m_aesItemId)));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
translate(m_ui, m_dtc->nContamination(m_aesItemId), tr("N-Contamination"));
|
translate(m_ui, m_dtc->nContamination(m_aesItemId), tr("N-Contamination"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.reset(new ExplosionArea(m_dtc->explosionArea(m_aesItemId)));
|
item.reset(new ExplosionArea(m_dtc->explosionArea(m_aesItemId)));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
translate(m_ui, m_dtc->explosionArea(m_aesItemId), tr("Explosion Area"));
|
translate(m_ui, m_dtc->explosionArea(m_aesItemId), tr("Explosion Area"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.reset(new ExplosionSingle(m_dtc->explosionSingle(m_aesItemId)));
|
item.reset(new ExplosionSingle(m_dtc->explosionSingle(m_aesItemId)));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
translate(m_ui, m_dtc->explosionSingle(m_aesItemId), tr("Single Explosion"));
|
translate(m_ui, m_dtc->explosionSingle(m_aesItemId), tr("Single Explosion"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.reset(new MineArea(m_dtc->mineArea(m_aesItemId)));
|
item.reset(new MineArea(m_dtc->mineArea(m_aesItemId)));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
translate(m_ui, m_dtc->mineArea(m_aesItemId), tr("Mine Area"));
|
translate(m_ui, m_dtc->mineArea(m_aesItemId), tr("Mine Area"));
|
||||||
return;
|
return;
|
||||||
@@ -114,7 +114,7 @@ void DangerAreaAesItemInfo::insertAesItem(int aesItemId)
|
|||||||
{
|
{
|
||||||
AesItem* item;
|
AesItem* item;
|
||||||
item = new BCContamination(m_dtc->bCContamination(aesItemId));
|
item = new BCContamination(m_dtc->bCContamination(aesItemId));
|
||||||
if (item->id() > 0)
|
if (item->id > 0)
|
||||||
{
|
{
|
||||||
m_aesItems.insert(aesItemId, AesStruct(AesType::AtBCContamination, item));
|
m_aesItems.insert(aesItemId, AesStruct(AesType::AtBCContamination, item));
|
||||||
return;
|
return;
|
||||||
@@ -131,7 +131,7 @@ void DangerAreaAesItemInfo::setText()
|
|||||||
|
|
||||||
for (const AesStruct& aesStruct : std::as_const(m_aesItems))
|
for (const AesStruct& aesStruct : std::as_const(m_aesItems))
|
||||||
{
|
{
|
||||||
if (aesStruct.item->effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated)
|
if (aesStruct.item->effectStateId == AreaEffectSimulation::AesEffectState::EsActivated)
|
||||||
aesItemInfo(aesStruct.item);
|
aesItemInfo(aesStruct.item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+154
-154
@@ -11,18 +11,18 @@
|
|||||||
#include <LtsSession/lts_session_data.h>
|
#include <LtsSession/lts_session_data.h>
|
||||||
#include <LtsUtilsSettings/settings.h>
|
#include <LtsUtilsSettings/settings.h>
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
#include <AreaEffectSimulation/Borderline/aes_borderline_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/Explosion/aes_explosion_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineArea/aes_mine_area_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
|
||||||
#include <AreaEffectSimulation/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
|
||||||
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
|
||||||
#include <ProjectDataManagement/pdm.hpp>
|
#include <ProjectDataManagement/pdm.hpp>
|
||||||
#include <ProjectDataManagement/pdm_translation.h>
|
#include <ProjectDataManagement/pdm_translation.h>
|
||||||
@@ -34,7 +34,7 @@ AesInfoDialog::AesInfoDialog(int aesEntityId, AesType aesType, QWidget* parent)
|
|||||||
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_aesEntityId(aesEntityId),
|
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_aesEntityId(aesEntityId),
|
||||||
m_aesType(aesType), m_bcChargeTypeId(-1), m_singleExpChargeTypeId(-1), m_areaExpChargeTypeId(-1),
|
m_aesType(aesType), m_bcChargeTypeId(-1), m_singleExpChargeTypeId(-1), m_areaExpChargeTypeId(-1),
|
||||||
m_session(nullptr), m_dtc(nullptr), m_ftc(nullptr), m_pdmDtc(nullptr), m_ui(new Ui::AesInfoDialog),
|
m_session(nullptr), m_dtc(nullptr), m_ftc(nullptr), m_pdmDtc(nullptr), m_ui(new Ui::AesInfoDialog),
|
||||||
m_requestHelper(new LtsUtils::RequestHelper(this))
|
m_requestHelper(new LtsUtils::RequestHelper(this)), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << "ctor AesInfoDialog() ";
|
DEBUG_LOG(m_logger) << "ctor AesInfoDialog() ";
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
@@ -64,18 +64,18 @@ void AesInfoDialog::retranslate()
|
|||||||
|
|
||||||
bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
|
bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
if (aesItemView.aesItemId() != m_aesEntityId)
|
if (aesItemView.aesItemId != m_aesEntityId)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
DEBUG_LOG(m_logger) << "AesItemView found for aesEntityId: " << m_aesEntityId
|
DEBUG_LOG(m_logger) << "AesItemView found for aesEntityId: " << m_aesEntityId
|
||||||
<< " AesItemView.aesTypeId(): " << aesItemView.aesTypeId();
|
<< " AesItemView.aesTypeId(): " << aesItemView.aesTypeId;
|
||||||
|
|
||||||
if (aesItemView.aesTypeId() != m_aesType)
|
if (aesItemView.aesTypeId != m_aesType)
|
||||||
{
|
{
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
switch (aesItemView.aesTypeId().underlying())
|
switch (aesItemView.aesTypeId)
|
||||||
{
|
{
|
||||||
case AreaEffectSimulation::AesType::AtNContamination: {
|
case AreaEffectSimulation::AesType::AtNContamination: {
|
||||||
handleNContamination(aesItemView);
|
handleNContamination(aesItemView);
|
||||||
@@ -245,7 +245,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
|
|||||||
break;
|
break;
|
||||||
case AreaEffectSimulation::AesType::AtUnknown:
|
case AreaEffectSimulation::AesType::AtUnknown:
|
||||||
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId " << m_aesEntityId << ": "
|
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId " << m_aesEntityId << ": "
|
||||||
<< aesItemView.aesTypeId();
|
<< aesItemView.aesTypeId;
|
||||||
Q_ASSERT(false);
|
Q_ASSERT(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -311,7 +311,7 @@ bool AesInfoDialog::init(LtsSession::LtsSession* session, const std::shared_ptr<
|
|||||||
void AesInfoDialog::handleNContamination(const AesItemView& aesItemView)
|
void AesInfoDialog::handleNContamination(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
|
|
||||||
handleNContamination(m_dtc->nContamination(m_aesEntityId));
|
handleNContamination(m_dtc->nContamination(m_aesEntityId));
|
||||||
}
|
}
|
||||||
@@ -319,19 +319,19 @@ void AesInfoDialog::handleNContamination(const AesItemView& aesItemView)
|
|||||||
void AesInfoDialog::handleNContamination(const AreaEffectSimulation::NContamination& data)
|
void AesInfoDialog::handleNContamination(const AreaEffectSimulation::NContamination& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::NContamination)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::NContamination)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtNContamination);
|
handleAesItem(data, AesType::AtNContamination);
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition().lon(), data.impactPosition().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition.lon, data.impactPosition.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleBCContamination(const AesItemView& aesItemView)
|
void AesInfoDialog::handleBCContamination(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
|
|
||||||
handleBCContamination(m_dtc->bCContamination(m_aesEntityId));
|
handleBCContamination(m_dtc->bCContamination(m_aesEntityId));
|
||||||
}
|
}
|
||||||
@@ -339,21 +339,21 @@ void AesInfoDialog::handleBCContamination(const AesItemView& aesItemView)
|
|||||||
void AesInfoDialog::handleBCContamination(const AreaEffectSimulation::BCContamination& data)
|
void AesInfoDialog::handleBCContamination(const AreaEffectSimulation::BCContamination& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BCContamination)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BCContamination)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtBCContamination);
|
handleAesItem(data, AesType::AtBCContamination);
|
||||||
|
|
||||||
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
|
m_bcChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition().lon(), data.impactPosition().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition.lon, data.impactPosition.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleBoobyTrap(const AesItemView& aesItemView)
|
void AesInfoDialog::handleBoobyTrap(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
|
|
||||||
handleBoobyTrap(m_dtc->boobyTrap(m_aesEntityId));
|
handleBoobyTrap(m_dtc->boobyTrap(m_aesEntityId));
|
||||||
}
|
}
|
||||||
@@ -361,11 +361,11 @@ void AesInfoDialog::handleBoobyTrap(const AesItemView& aesItemView)
|
|||||||
void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
|
void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtBoobyTrap);
|
handleAesItem(data, AesType::AtBoobyTrap);
|
||||||
|
|
||||||
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
|
m_bcChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
|
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_bcChargeTypeId, true));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_bcChargeTypeId, true));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_bcChargeTypeId, true));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_bcChargeTypeId, true));
|
||||||
@@ -373,14 +373,14 @@ void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
|
|||||||
m_ui->lblChargeTypeId->setText(QString::number(m_bcChargeTypeId));
|
m_ui->lblChargeTypeId->setText(QString::number(m_bcChargeTypeId));
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition().lon(), data.impactPosition().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition.lon, data.impactPosition.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleOffRouteMine(const AesItemView& aesItemView)
|
void AesInfoDialog::handleOffRouteMine(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
|
|
||||||
handleOffRouteMine(m_dtc->offRouteMine(m_aesEntityId));
|
handleOffRouteMine(m_dtc->offRouteMine(m_aesEntityId));
|
||||||
}
|
}
|
||||||
@@ -388,11 +388,11 @@ void AesInfoDialog::handleOffRouteMine(const AesItemView& aesItemView)
|
|||||||
void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine& data)
|
void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtOffRouteMine);
|
handleAesItem(data, AesType::AtOffRouteMine);
|
||||||
|
|
||||||
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
|
m_bcChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
|
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_bcChargeTypeId, true));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_bcChargeTypeId, true));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_bcChargeTypeId, true));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_bcChargeTypeId, true));
|
||||||
@@ -401,14 +401,14 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine&
|
|||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs =
|
QString mgrs =
|
||||||
LtsCoordTrans::mgrsFromGeographic(data.area().cornerBottomLeft().lon(), data.area().cornerBottomLeft().lat());
|
LtsCoordTrans::mgrsFromGeographic(data.area.cornerBottomLeft.lon, data.area.cornerBottomLeft.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleExplosionArea(const AesItemView& aesItemView)
|
void AesInfoDialog::handleExplosionArea(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
|
|
||||||
handleExplosionArea(m_dtc->explosionArea(m_aesEntityId));
|
handleExplosionArea(m_dtc->explosionArea(m_aesEntityId));
|
||||||
}
|
}
|
||||||
@@ -416,19 +416,19 @@ void AesInfoDialog::handleExplosionArea(const AesItemView& aesItemView)
|
|||||||
void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionArea& data)
|
void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionArea& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtExplosionArea);
|
handleAesItem(data, AesType::AtExplosionArea);
|
||||||
|
|
||||||
m_areaExpChargeTypeId = data.chargeStruct().chargeTypeId();
|
m_areaExpChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
|
|
||||||
const Area& area = data.area();
|
const Area& area = data.area;
|
||||||
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) || !qFuzzyCompare(area.cornerBottomLeft().lat(), 0))
|
if (!qFuzzyCompare(area.cornerBottomLeft.lon, 0) || !qFuzzyCompare(area.cornerBottomLeft.lat, 0))
|
||||||
{
|
{
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QPointF bottomLeft(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
|
QPointF bottomLeft(area.cornerBottomLeft.lon, area.cornerBottomLeft.lat);
|
||||||
const QPointF& center =
|
const QPointF& center =
|
||||||
Polygons::bottomLeft2CenterPoint(bottomLeft, area.width(), area.height(), area.rotation());
|
Polygons::bottomLeft2CenterPoint(bottomLeft, area.width, area.height, area.rotation);
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(center.x(), center.y());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(center.x(), center.y());
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
@@ -437,66 +437,66 @@ void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionAre
|
|||||||
void AesInfoDialog::handleExplosionSingle(const AesItemView& aesItemView)
|
void AesInfoDialog::handleExplosionSingle(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleExplosionSingle(m_dtc->explosionSingle(m_aesEntityId));
|
handleExplosionSingle(m_dtc->explosionSingle(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle& data)
|
void AesInfoDialog::handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionSingle)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionSingle)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtExplosionSingle);
|
handleAesItem(data, AesType::AtExplosionSingle);
|
||||||
|
|
||||||
m_singleExpChargeTypeId = data.chargeStruct().chargeTypeId();
|
m_singleExpChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition().lon(), data.impactPosition().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition.lon, data.impactPosition.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleMineArea(const AesItemView& aesItemView)
|
void AesInfoDialog::handleMineArea(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleMineArea(m_dtc->mineArea(m_aesEntityId));
|
handleMineArea(m_dtc->mineArea(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleMineArea(const AreaEffectSimulation::MineArea& data)
|
void AesInfoDialog::handleMineArea(const AreaEffectSimulation::MineArea& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtMineArea);
|
handleAesItem(data, AesType::AtMineArea);
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.boundingRectCorner().lon(), data.boundingRectCorner().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.boundingRectCorner.lon, data.boundingRectCorner.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
|
|
||||||
bool bResetVisbile =
|
bool bResetVisbile =
|
||||||
(data.isDus() || data.isConcrete()) &&
|
(data.isDus || data.isConcrete) &&
|
||||||
|
|
||||||
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::MineAreasResetDusMines) &&
|
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::MineAreasResetDusMines) &&
|
||||||
((m_session->app() == LtsAppDescriptor::App::Situation ||
|
((m_session->app() == LtsAppDescriptor::App::Situation ||
|
||||||
m_session->app() == LtsAppDescriptor::App::SituationTablet) &&
|
m_session->app() == LtsAppDescriptor::App::SituationTablet) &&
|
||||||
(!m_session->isReplayPartition()));
|
(!m_session->isReplayPartition()));
|
||||||
m_ui->pbResetDusMines->setVisible(bResetVisbile);
|
m_ui->pbResetDusMines->setVisible(bResetVisbile);
|
||||||
m_mineIsReactivatable = data.isReactivatable();
|
m_mineIsReactivatable = data.isReactivatable;
|
||||||
m_ui->pbResetDusMines->setToolTip(data.isDus() ? tr("Reset DUS Mines matched to this Minearea")
|
m_ui->pbResetDusMines->setToolTip(data.isDus ? tr("Reset DUS Mines matched to this Minearea")
|
||||||
: tr("Reset Concrete Mines matched to this Minearea"));
|
: tr("Reset Concrete Mines matched to this Minearea"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleMineCorridor(const AesItemView& aesItemView)
|
void AesInfoDialog::handleMineCorridor(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleMineCorridor(m_dtc->mineCorridor(m_aesEntityId));
|
handleMineCorridor(m_dtc->mineCorridor(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor& data)
|
void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtMineCorridor);
|
handleAesItem(data, AesType::AtMineCorridor);
|
||||||
|
|
||||||
@@ -510,14 +510,14 @@ void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor&
|
|||||||
void AesInfoDialog::handleGasPipe(const AesItemView& aesItemView)
|
void AesInfoDialog::handleGasPipe(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " handleGasPipe: aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " handleGasPipe: aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleGasPipe(m_dtc->gasPipe(m_aesEntityId));
|
handleGasPipe(m_dtc->gasPipe(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe& data)
|
void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::GasPipe)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::GasPipe)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtGasPipe);
|
handleAesItem(data, AesType::AtGasPipe);
|
||||||
|
|
||||||
@@ -531,23 +531,23 @@ void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe& data)
|
|||||||
void AesInfoDialog::handleDangerArea(const AesItemView& aesItemView)
|
void AesInfoDialog::handleDangerArea(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleDangerArea(m_dtc->dangerArea(m_aesEntityId));
|
handleDangerArea(m_dtc->dangerArea(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea& data)
|
void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::DangerArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::DangerArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtDangerArea);
|
handleAesItem(data, AesType::AtDangerArea);
|
||||||
|
|
||||||
const auto& qv = data.segments();
|
const auto& qv = data.segments;
|
||||||
if (qv.size() > 0)
|
if (qv.size() > 0)
|
||||||
{
|
{
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
const Core::GeoPosition2D& pos = qv.at(0);
|
const Core::GeoPosition2D& pos = qv.at(0);
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(pos.lon(), pos.lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(pos.lon, pos.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -558,23 +558,23 @@ void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea& dat
|
|||||||
void AesInfoDialog::handleBorderline(const AesItemView& aesItemView)
|
void AesInfoDialog::handleBorderline(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleBorderline(m_dtc->borderline(m_aesEntityId));
|
handleBorderline(m_dtc->borderline(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline& data)
|
void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::Borderline)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::Borderline)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtBorderline);
|
handleAesItem(data, AesType::AtBorderline);
|
||||||
|
|
||||||
const auto& qv = data.segments();
|
const auto& qv = data.segments;
|
||||||
if (qv.size() > 0)
|
if (qv.size() > 0)
|
||||||
{
|
{
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
const Core::GeoPosition2D& pos = qv.at(0);
|
const Core::GeoPosition2D& pos = qv.at(0);
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(pos.lon(), pos.lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(pos.lon, pos.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -582,30 +582,30 @@ void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline& dat
|
|||||||
void AesInfoDialog::handleFunctionalArea(const AesItemView& aesItemView)
|
void AesInfoDialog::handleFunctionalArea(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleFunctionalArea(m_dtc->functionalArea(m_aesEntityId));
|
handleFunctionalArea(m_dtc->functionalArea(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
|
void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtFunctionalArea);
|
handleAesItem(data, AesType::AtFunctionalArea);
|
||||||
|
|
||||||
QStringList chargeTypesNames;
|
QStringList chargeTypesNames;
|
||||||
QStringList chargeTypesShortNames;
|
QStringList chargeTypesShortNames;
|
||||||
if (data.medicMode() != AesOperatingMode::OmNotUsed)
|
if (data.medicMode != AesOperatingMode::OmNotUsed)
|
||||||
{
|
{
|
||||||
chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true);
|
chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true);
|
||||||
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true);
|
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true);
|
||||||
}
|
}
|
||||||
if (data.maintMode() != AesOperatingMode::OmNotUsed)
|
if (data.maintMode != AesOperatingMode::OmNotUsed)
|
||||||
{
|
{
|
||||||
chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true);
|
chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true);
|
||||||
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
|
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
|
||||||
}
|
}
|
||||||
if (data.deconMode() != AesOperatingMode::OmNotUsed)
|
if (data.deconMode != AesOperatingMode::OmNotUsed)
|
||||||
{
|
{
|
||||||
chargeTypesNames << m_pdmDtc->trChargeTypeName(413, true);
|
chargeTypesNames << m_pdmDtc->trChargeTypeName(413, true);
|
||||||
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(413, true);
|
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(413, true);
|
||||||
@@ -614,9 +614,9 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
|
|||||||
m_ui->lblChargeType->setToolTip(chargeTypesShortNames.join(QLatin1String(", ")));
|
m_ui->lblChargeType->setToolTip(chargeTypesShortNames.join(QLatin1String(", ")));
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
const QPointF bottomLeft(data.area().cornerBottomLeft().lon(), data.area().cornerBottomLeft().lat());
|
const QPointF bottomLeft(data.area.cornerBottomLeft.lon, data.area.cornerBottomLeft.lat);
|
||||||
const QPointF centerpoint =
|
const QPointF centerpoint =
|
||||||
Polygons::bottomLeft2CenterPoint(bottomLeft, data.area().width(), data.area().height(), 0.0);
|
Polygons::bottomLeft2CenterPoint(bottomLeft, data.area.width, data.area.height, 0.0);
|
||||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(centerpoint.x(), centerpoint.y());
|
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(centerpoint.x(), centerpoint.y());
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
}
|
}
|
||||||
@@ -624,25 +624,25 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
|
|||||||
void AesInfoDialog::handleAirSupportImpact(const AesItemView& aesItemView)
|
void AesInfoDialog::handleAirSupportImpact(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleAirSupportImpact(m_dtc->airSupportImpact(m_aesEntityId));
|
handleAirSupportImpact(m_dtc->airSupportImpact(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleAirSupportImpact(const AirSupportImpact& data)
|
void AesInfoDialog::handleAirSupportImpact(const AirSupportImpact& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtAirSupportImpact);
|
handleAesItem(data, AesType::AtAirSupportImpact);
|
||||||
|
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition().lon(), data.impactPosition().lat());
|
QString mgrs = LtsCoordTrans::mgrsFromGeographic(data.impactPosition.lon, data.impactPosition.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
|
|
||||||
m_ui->lbFlightTime->show();
|
m_ui->lbFlightTime->show();
|
||||||
m_ui->lblFlightTime->show();
|
m_ui->lblFlightTime->show();
|
||||||
|
|
||||||
m_ui->lblFlightTime->setText(LtsWidgets::readableDuration(data.flightTime()));
|
m_ui->lblFlightTime->setText(LtsWidgets::readableDuration(data.flightTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleMineAraeSingleMine()
|
void AesInfoDialog::handleMineAraeSingleMine()
|
||||||
@@ -651,14 +651,14 @@ void AesInfoDialog::handleMineAraeSingleMine()
|
|||||||
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
|
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
|
||||||
return;
|
return;
|
||||||
const DusMineState dms = m_dtc->dusMineState(0);
|
const DusMineState dms = m_dtc->dusMineState(0);
|
||||||
for (size_t i = 0; i < dms.mines().size(); ++i)
|
for (size_t i = 0; i < dms.mines.size(); ++i)
|
||||||
{
|
{
|
||||||
const DusMine& mine = dms.mines().at(i);
|
const DusMine& mine = dms.mines.at(i);
|
||||||
if (mine.eqId() == m_aesEntityId)
|
if (mine.eqId == m_aesEntityId)
|
||||||
{
|
{
|
||||||
if (itemView.form().size() <= i)
|
if (itemView.form.size() <= i)
|
||||||
return;
|
return;
|
||||||
handleMineAraeSingleMine(itemView.form().at(i), mine);
|
handleMineAraeSingleMine(itemView.form.at(i), mine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -679,12 +679,12 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
|
|||||||
m_ui->lblAesDuration->hide();
|
m_ui->lblAesDuration->hide();
|
||||||
m_ui->pbDetails->hide();
|
m_ui->pbDetails->hide();
|
||||||
|
|
||||||
m_aesEntityName = QString::number(mine.eqId());
|
m_aesEntityName = QString::number(mine.eqId);
|
||||||
|
|
||||||
m_ui->lblAesTypeId->setText(QString::number(m_aesType.underlying()));
|
m_ui->lblAesTypeId->setText(QString::number(static_cast<int>(m_aesType)));
|
||||||
m_ui->lblAesType->setText(toString(m_aesType));
|
m_ui->lblAesType->setText(toString(m_aesType));
|
||||||
|
|
||||||
const int ctId = mine.chargeTypeId();
|
const int ctId = mine.chargeTypeId;
|
||||||
if (ctId != 0)
|
if (ctId != 0)
|
||||||
{
|
{
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(ctId, true));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(ctId, true));
|
||||||
@@ -699,11 +699,11 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
|
|||||||
else
|
else
|
||||||
m_ui->lbAesId->setText(tr("Mine Id:"));
|
m_ui->lbAesId->setText(tr("Mine Id:"));
|
||||||
|
|
||||||
m_ui->lblAesId->setText(QString::number(mine.eqId()));
|
m_ui->lblAesId->setText(QString::number(mine.eqId));
|
||||||
|
|
||||||
bool bResetVisible = false;
|
bool bResetVisible = false;
|
||||||
|
|
||||||
if (mine.triggered() && isDus)
|
if (mine.triggered && isDus)
|
||||||
{
|
{
|
||||||
m_ui->lblStatus->setText(tr("Inactive"));
|
m_ui->lblStatus->setText(tr("Inactive"));
|
||||||
if (LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::MineAreasResetDusMines)
|
if (LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::MineAreasResetDusMines)
|
||||||
@@ -723,7 +723,7 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
|
|||||||
m_ui->pbResetDusMines->setToolTip(isDus ? tr("Reset DUS Mines matched to this Minearea")
|
m_ui->pbResetDusMines->setToolTip(isDus ? tr("Reset DUS Mines matched to this Minearea")
|
||||||
: tr("Reset Concrete Mines matched to this Minearea"));
|
: tr("Reset Concrete Mines matched to this Minearea"));
|
||||||
|
|
||||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(position.lon(), position.lat());
|
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(position.lon, position.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
|
|
||||||
@@ -747,21 +747,21 @@ void AesInfoDialog::handleSingleDusMine()
|
|||||||
m_ui->lblAesDuration->hide();
|
m_ui->lblAesDuration->hide();
|
||||||
m_ui->pbDetails->hide();
|
m_ui->pbDetails->hide();
|
||||||
|
|
||||||
m_aesEntityName = QString::number(dsm.id());
|
m_aesEntityName = QString::number(dsm.id);
|
||||||
|
|
||||||
m_ui->lblAesTypeId->setText(QString::number(m_aesType.underlying()));
|
m_ui->lblAesTypeId->setText(QString::number(static_cast<int>(m_aesType)));
|
||||||
m_ui->lblAesType->setText(toString(m_aesType));
|
m_ui->lblAesType->setText(toString(m_aesType));
|
||||||
|
|
||||||
const int ctId = dsm.chargeStruct().chargeTypeId();
|
const int ctId = dsm.chargeStruct.chargeTypeId;
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(ctId));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(ctId));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(ctId));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(ctId));
|
||||||
m_ui->lblChargeType->show();
|
m_ui->lblChargeType->show();
|
||||||
m_ui->lblChargeTypeId->setText(QString::number(ctId));
|
m_ui->lblChargeTypeId->setText(QString::number(ctId));
|
||||||
|
|
||||||
m_ui->lbAesId->setText(tr("DUS Mine Id:"));
|
m_ui->lbAesId->setText(tr("DUS Mine Id:"));
|
||||||
m_ui->lblAesId->setText(QString::number(dsm.id()));
|
m_ui->lblAesId->setText(QString::number(dsm.id));
|
||||||
|
|
||||||
switch (dsm.effectStateId().underlying())
|
switch (dsm.effectStateId)
|
||||||
{
|
{
|
||||||
case AesEffectState::EsExpired:
|
case AesEffectState::EsExpired:
|
||||||
m_ui->lblStatus->setText(tr("Inactive"));
|
m_ui->lblStatus->setText(tr("Inactive"));
|
||||||
@@ -792,7 +792,7 @@ void AesInfoDialog::handleSingleDusMine()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(dsm.position().lon(), dsm.position().lat());
|
const QString mgrs = LtsCoordTrans::mgrsFromGeographic(dsm.position.lon, dsm.position.lat);
|
||||||
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
m_ui->lblPosition->setText(tr("Position: %1").arg(mgrs));
|
||||||
m_ui->lblPosition->show();
|
m_ui->lblPosition->show();
|
||||||
|
|
||||||
@@ -802,18 +802,18 @@ void AesInfoDialog::handleSingleDusMine()
|
|||||||
void AesInfoDialog::handleExplosionCluster(const AesItemView& aesItemView)
|
void AesInfoDialog::handleExplosionCluster(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleExplosionCluster(m_dtc->explosionCluster(m_aesEntityId));
|
handleExplosionCluster(m_dtc->explosionCluster(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleExplosionCluster(const ExplosionCluster& data)
|
void AesInfoDialog::handleExplosionCluster(const ExplosionCluster& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionCluster)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionCluster)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtExplosionCluster);
|
handleAesItem(data, AesType::AtExplosionCluster);
|
||||||
|
|
||||||
const int m_explosionClusterChargeTypeId = data.chargeStruct().chargeTypeId();
|
const int m_explosionClusterChargeTypeId = data.chargeStruct.chargeTypeId;
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_explosionClusterChargeTypeId, true));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(m_explosionClusterChargeTypeId, true));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_explosionClusterChargeTypeId, true));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(m_explosionClusterChargeTypeId, true));
|
||||||
m_ui->lblChargeType->show();
|
m_ui->lblChargeType->show();
|
||||||
@@ -823,32 +823,32 @@ void AesInfoDialog::handleExplosionCluster(const ExplosionCluster& data)
|
|||||||
void AesInfoDialog::handleEffectCluster(const AesItemView& aesItemView)
|
void AesInfoDialog::handleEffectCluster(const AesItemView& aesItemView)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
|
||||||
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
|
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
|
||||||
handleEffectCluster(m_dtc->effectCluster(m_aesEntityId));
|
handleEffectCluster(m_dtc->effectCluster(m_aesEntityId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleEffectCluster(const EffectCluster& data)
|
void AesInfoDialog::handleEffectCluster(const EffectCluster& data)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::EffectCluster)"
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::EffectCluster)"
|
||||||
<< " data.id(): " << data.id();
|
<< " data.id(): " << data.id;
|
||||||
|
|
||||||
handleAesItem(data, AesType::AtEffectCluster);
|
handleAesItem(data, AesType::AtEffectCluster);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
|
void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
|
||||||
{
|
{
|
||||||
m_aesEntityName = QString::fromStdString(aesData.name());
|
m_aesEntityName = QString::fromStdString(aesData.name);
|
||||||
m_aesEffectSource = aesData.effectSourceId();
|
m_aesEffectSource = aesData.effectSourceId;
|
||||||
|
|
||||||
m_ui->lblAesItemId->setText(QString::number(aesData.id()));
|
m_ui->lblAesItemId->setText(QString::number(aesData.id));
|
||||||
|
|
||||||
m_ui->lblAesTypeId->setText(QString::number(aesTypeId.underlying()));
|
m_ui->lblAesTypeId->setText(QString::number(static_cast<int>(aesTypeId)));
|
||||||
const ProjectDataManagement::GearClass gearClass =
|
const ProjectDataManagement::GearClass gearClass =
|
||||||
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId());
|
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct.chargeTypeId);
|
||||||
switch (gearClass.underlying())
|
switch (gearClass)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::GearClass::Biological:
|
case ProjectDataManagement::GearClass::GearClass_Biological:
|
||||||
case ProjectDataManagement::GearClass::Chemical:
|
case ProjectDataManagement::GearClass::GearClass_Chemical:
|
||||||
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
|
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -857,28 +857,28 @@ void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
|
|||||||
|
|
||||||
m_ui->lblAesName->setText(m_aesEntityName);
|
m_ui->lblAesName->setText(m_aesEntityName);
|
||||||
|
|
||||||
if (aesData.effectStart().is_set())
|
if (aesData.effectStart.has_value())
|
||||||
m_ui->lblAesStart->setText(DTG::toStringMSec(aesData.effectStart().get()));
|
m_ui->lblAesStart->setText(DTG::toStringMSec(aesData.effectStart.get()));
|
||||||
else
|
else
|
||||||
m_ui->lblAesStart->setText(tr("None"));
|
m_ui->lblAesStart->setText(tr("None"));
|
||||||
|
|
||||||
if (aesData.effectDuration() == 0)
|
if (aesData.effectDuration == 0)
|
||||||
{
|
{
|
||||||
m_ui->lbAesDuration->hide();
|
m_ui->lbAesDuration->hide();
|
||||||
m_ui->lblAesDuration->hide();
|
m_ui->lblAesDuration->hide();
|
||||||
}
|
}
|
||||||
if (aesTypeId == AesType::AtEffectCluster && aesData.effectDuration() == DEFAULT_EFFECT_DURATION)
|
if (aesTypeId == AesType::AtEffectCluster && aesData.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||||
m_ui->lblAesDuration->setText(QStringLiteral("---"));
|
m_ui->lblAesDuration->setText(QStringLiteral("---"));
|
||||||
else
|
else
|
||||||
m_ui->lblAesDuration->setText(LtsWidgets::readableDuration(aesData.effectDuration()));
|
m_ui->lblAesDuration->setText(LtsWidgets::readableDuration(aesData.effectDuration));
|
||||||
|
|
||||||
AreaEffectSimulation::AesEffectState st = aesData.effectStateId();
|
AreaEffectSimulation::AesEffectState st = aesData.effectStateId;
|
||||||
m_ui->lblStatus->setText(toString(st));
|
m_ui->lblStatus->setText(toString(st));
|
||||||
|
|
||||||
m_ui->lblChargeTypeId->setText(QString::number(aesData.chargeStruct().chargeTypeId()));
|
m_ui->lblChargeTypeId->setText(QString::number(aesData.chargeStruct.chargeTypeId));
|
||||||
|
|
||||||
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(aesData.chargeStruct().chargeTypeId()));
|
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(aesData.chargeStruct.chargeTypeId));
|
||||||
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(aesData.chargeStruct().chargeTypeId()));
|
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(aesData.chargeStruct.chargeTypeId));
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onFindOnMap()
|
void AesInfoDialog::onFindOnMap()
|
||||||
@@ -895,7 +895,7 @@ void AesInfoDialog::onShowDetails()
|
|||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
|
||||||
|
|
||||||
switch (m_aesType.underlying())
|
switch (m_aesType)
|
||||||
{
|
{
|
||||||
case AreaEffectSimulation::AesType::AtNContamination: {
|
case AreaEffectSimulation::AesType::AtNContamination: {
|
||||||
std::shared_ptr<AesNContamination::ForeignGuiInterface> ifc;
|
std::shared_ptr<AesNContamination::ForeignGuiInterface> ifc;
|
||||||
@@ -916,7 +916,7 @@ void AesInfoDialog::onShowDetails()
|
|||||||
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
|
||||||
{
|
{
|
||||||
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId);
|
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId);
|
||||||
if (gearClass == ProjectDataManagement::GearClass::Biological)
|
if (gearClass == ProjectDataManagement::GearClass::GearClass_Biological)
|
||||||
{
|
{
|
||||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this);
|
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this);
|
||||||
if (dialog)
|
if (dialog)
|
||||||
@@ -925,7 +925,7 @@ void AesInfoDialog::onShowDetails()
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gearClass == ProjectDataManagement::GearClass::Chemical)
|
if (gearClass == ProjectDataManagement::GearClass::GearClass_Chemical)
|
||||||
{
|
{
|
||||||
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
|
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
|
||||||
if (dialog)
|
if (dialog)
|
||||||
@@ -1162,118 +1162,118 @@ bool AesInfoDialog::onResetDusMines()
|
|||||||
|
|
||||||
void AesInfoDialog::onNContaminationChanged(const AreaEffectSimulation::NContamination& data, DataModification modType)
|
void AesInfoDialog::onNContaminationChanged(const AreaEffectSimulation::NContamination& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleNContamination(data);
|
handleNContamination(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data,
|
void AesInfoDialog::onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data,
|
||||||
DataModification modType)
|
DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleBCContamination(data);
|
handleBCContamination(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, DataModification modType)
|
void AesInfoDialog::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleBoobyTrap(data);
|
handleBoobyTrap(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine& data, DataModification modType)
|
void AesInfoDialog::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleOffRouteMine(data);
|
handleOffRouteMine(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea& data, DataModification modType)
|
void AesInfoDialog::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleExplosionArea(data);
|
handleExplosionArea(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle& data,
|
void AesInfoDialog::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle& data,
|
||||||
DataModification modType)
|
DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleExplosionSingle(data);
|
handleExplosionSingle(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onMineAreaChanged(const AreaEffectSimulation::MineArea& data, DataModification modType)
|
void AesInfoDialog::onMineAreaChanged(const AreaEffectSimulation::MineArea& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleMineArea(data);
|
handleMineArea(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onMineCorridorChanged(const MineCorridor& data, DataModification modType)
|
void AesInfoDialog::onMineCorridorChanged(const MineCorridor& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleMineCorridor(data);
|
handleMineCorridor(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onGasPipeChanged(const GasPipe& data, DataModification modType)
|
void AesInfoDialog::onGasPipeChanged(const GasPipe& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleGasPipe(data);
|
handleGasPipe(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onDangerAreaChanged(const AreaEffectSimulation::DangerArea& data, DataModification modType)
|
void AesInfoDialog::onDangerAreaChanged(const AreaEffectSimulation::DangerArea& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleDangerArea(data);
|
handleDangerArea(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onBorderlineChanged(const AreaEffectSimulation::Borderline& data, DataModification modType)
|
void AesInfoDialog::onBorderlineChanged(const AreaEffectSimulation::Borderline& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleBorderline(data);
|
handleBorderline(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onFunctionalAreaChanged(const FunctionalArea& data, DataModification modType)
|
void AesInfoDialog::onFunctionalAreaChanged(const FunctionalArea& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleFunctionalArea(data);
|
handleFunctionalArea(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onAirSupportImpactChanged(const AirSupportImpact& data, DataModification modType)
|
void AesInfoDialog::onAirSupportImpactChanged(const AirSupportImpact& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleAirSupportImpact(data);
|
handleAirSupportImpact(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onDusMineStateChanged(const DusMineState& data, DataModification modType)
|
void AesInfoDialog::onDusMineStateChanged(const DusMineState& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
return;
|
return;
|
||||||
if (data.id() != 0)
|
if (data.id != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
AesItemView itemView;
|
AesItemView itemView;
|
||||||
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
|
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (size_t i = 0; i < data.mines().size(); ++i)
|
for (size_t i = 0; i < data.mines.size(); ++i)
|
||||||
{
|
{
|
||||||
const DusMine& mine = data.mines().at(i);
|
const DusMine& mine = data.mines.at(i);
|
||||||
if (mine.eqId() == m_aesEntityId)
|
if (mine.eqId == m_aesEntityId)
|
||||||
{
|
{
|
||||||
if (itemView.form().size() <= i)
|
if (itemView.form.size() <= i)
|
||||||
return;
|
return;
|
||||||
handleMineAraeSingleMine(itemView.form().at(i), mine);
|
handleMineAraeSingleMine(itemView.form.at(i), mine);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1281,22 +1281,22 @@ void AesInfoDialog::onDusMineStateChanged(const DusMineState& data, DataModifica
|
|||||||
|
|
||||||
void AesInfoDialog::onDusSingleMineChanged(const DusSingleMine& data, DataModification modType)
|
void AesInfoDialog::onDusSingleMineChanged(const DusSingleMine& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleSingleDusMine();
|
handleSingleDusMine();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onExplosionClusterChanged(const ExplosionCluster& data, DataModification modType)
|
void AesInfoDialog::onExplosionClusterChanged(const ExplosionCluster& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleExplosionCluster(data);
|
handleExplosionCluster(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AesInfoDialog::onEffectClusterChanged(const EffectCluster& data, DataModification modType)
|
void AesInfoDialog::onEffectClusterChanged(const EffectCluster& data, DataModification modType)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
|
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
|
||||||
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
|
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
|
||||||
handleEffectCluster(data);
|
handleEffectCluster(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -61,17 +61,17 @@ bool CustomViewAirSupportImpact::init(const QModelIndex &idx)
|
|||||||
bool CustomViewAirSupportImpact::calculateIcon(const AirSupportImpact &asi, const QColor &color)
|
bool CustomViewAirSupportImpact::calculateIcon(const AirSupportImpact &asi, const QColor &color)
|
||||||
{
|
{
|
||||||
Database::AesAirSupportImpact dbAsi;
|
Database::AesAirSupportImpact dbAsi;
|
||||||
dbAsi.impactPosition = QPointF(asi.impactPosition().lon(), asi.impactPosition().lat());
|
dbAsi.impactPosition = QPointF(asi.impactPosition.lon, asi.impactPosition.lat);
|
||||||
|
|
||||||
std::shared_ptr<ProjectDataManagement::Interface::Dtc> pdmDtc;
|
std::shared_ptr<ProjectDataManagement::Interface::Dtc> pdmDtc;
|
||||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc))
|
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
double radius = pdmDtc->impactRadius(asi.chargeStruct().chargeTypeId(),
|
double radius = pdmDtc->impactRadius(asi.chargeStruct.chargeTypeId,
|
||||||
asi.chargeStruct().igniterTypeId(),
|
asi.chargeStruct.igniterTypeId,
|
||||||
asi.chargeStruct().igniterFunctionId());
|
asi.chargeStruct.igniterFunctionId);
|
||||||
QPolygonF poly = AreaEffectSimulation::Polygons::airSupportImpact(dbAsi, radius);
|
QPolygonF poly = AreaEffectSimulation::Polygons::airSupportImpact(dbAsi, radius);
|
||||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(asi.effectStateId());
|
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(asi.effectStateId);
|
||||||
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
||||||
m_ui->lblIcon->setPixmap(pix);
|
m_ui->lblIcon->setPixmap(pix);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_itemlist.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
#include "aes_air_support_9liner_model.h"
|
#include "aes_air_support_9liner_model.h"
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
|
|||||||
+27
-27
@@ -48,36 +48,36 @@ QVariant AirSupport9LinerModel::data(const QModelIndex &index, int role) const
|
|||||||
switch (index.column())
|
switch (index.column())
|
||||||
{
|
{
|
||||||
case ParticipantId:
|
case ParticipantId:
|
||||||
return item.participantId();
|
return item.participantId;
|
||||||
case Participant:
|
case Participant:
|
||||||
{
|
{
|
||||||
if (!m_ppmDtc)
|
if (!m_ppmDtc)
|
||||||
return QString();
|
return QString();
|
||||||
return m_ppmDtc->hierarchyFromParticipant(item.participantId());
|
return m_ppmDtc->hierarchyFromParticipant(item.participantId);
|
||||||
}
|
}
|
||||||
case Timestamp:
|
case Timestamp:
|
||||||
return QDateTime::fromMSecsSinceEpoch(item.sampleTime());
|
return QDateTime::fromMSecsSinceEpoch(item.sampleTime);
|
||||||
case AttackHeading:
|
case AttackHeading:
|
||||||
{
|
{
|
||||||
if (item.finalAttackHeading() < 0)
|
if (item.finalAttackHeading < 0)
|
||||||
return QVariant();
|
return QVariant();
|
||||||
if (item.finalAttackHeadingHigh() < 0)
|
if (item.finalAttackHeadingHigh < 0)
|
||||||
return tr("%1 degree")
|
return tr("%1 degree")
|
||||||
.arg(item.finalAttackHeading());
|
.arg(item.finalAttackHeading);
|
||||||
return tr("%1 degree (low: %2 degree, high: %3 degreee)", "degree as symbol!")
|
return tr("%1 degree (low: %2 degree, high: %3 degreee)", "degree as symbol!")
|
||||||
.arg(item.finalAttackHeading())
|
.arg(item.finalAttackHeading)
|
||||||
.arg(item.finalAttackHeadingLow())
|
.arg(item.finalAttackHeadingLow)
|
||||||
.arg(item.finalAttackHeadingHigh());
|
.arg(item.finalAttackHeadingHigh);
|
||||||
}
|
}
|
||||||
case TargetPosition:
|
case TargetPosition:
|
||||||
{
|
{
|
||||||
if (std::isnan(item.targetPosition().lat()))
|
if (std::isnan(item.targetPosition.lat))
|
||||||
return tr("---");
|
return tr("---");
|
||||||
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(item.targetPosition().lon(),
|
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(item.targetPosition.lon,
|
||||||
item.targetPosition().lat()));
|
item.targetPosition.lat));
|
||||||
QString ret = coord.mgrs();
|
QString ret = coord.mgrs();
|
||||||
if (item.targetPosition().z() > 0)
|
if (item.targetPosition.z > 0)
|
||||||
ret += QLatin1Char(' ') + QString::number(qRound(item.targetPosition().z()));
|
ret += QLatin1Char(' ') + QString::number(qRound(item.targetPosition.z));
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -131,7 +131,7 @@ bool AirSupport9LinerProxyModel::filterAcceptsRow(int source_row, const QModelIn
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
const qint64 m_offset = 5 * 60 * 1000;
|
const qint64 m_offset = 5 * 60 * 1000;
|
||||||
if ((data.sampleTime() + m_offset) > m_session->partitionTime())
|
if ((data.sampleTime + m_offset) > m_session->partitionTime())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -150,27 +150,27 @@ bool AirSupport9LinerProxyModel::lessThan(const QModelIndex &source_left, const
|
|||||||
switch (source_left.column())
|
switch (source_left.column())
|
||||||
{
|
{
|
||||||
case AirSupport9LinerModel::ParticipantId:
|
case AirSupport9LinerModel::ParticipantId:
|
||||||
if (left.participantId() != right.participantId())
|
if (left.participantId != right.participantId)
|
||||||
return left.participantId() < right.participantId();
|
return left.participantId < right.participantId;
|
||||||
return left.sampleTime() < right.sampleTime();
|
return left.sampleTime < right.sampleTime;
|
||||||
case AirSupport9LinerModel::Participant:
|
case AirSupport9LinerModel::Participant:
|
||||||
{
|
{
|
||||||
const auto l = source_left.data();
|
const auto l = source_left.data();
|
||||||
const auto r = source_right.data();
|
const auto r = source_right.data();
|
||||||
if (l != r)
|
if (l != r)
|
||||||
return LtsUtils::lessThan(l, r);
|
return LtsUtils::lessThan(l, r);
|
||||||
return left.sampleTime() < right.sampleTime();
|
return left.sampleTime < right.sampleTime;
|
||||||
}
|
}
|
||||||
case AirSupport9LinerModel::Timestamp:
|
case AirSupport9LinerModel::Timestamp:
|
||||||
return left.sampleTime() < right.sampleTime();
|
return left.sampleTime < right.sampleTime;
|
||||||
case AirSupport9LinerModel::AttackHeading:
|
case AirSupport9LinerModel::AttackHeading:
|
||||||
if (left.finalAttackHeading() != right.finalAttackHeading())
|
if (left.finalAttackHeading != right.finalAttackHeading)
|
||||||
return left.finalAttackHeading() < right.finalAttackHeading();
|
return left.finalAttackHeading < right.finalAttackHeading;
|
||||||
if (left.finalAttackHeadingLow() != right.finalAttackHeadingLow())
|
if (left.finalAttackHeadingLow != right.finalAttackHeadingLow)
|
||||||
return left.finalAttackHeadingLow() < right.finalAttackHeadingLow();
|
return left.finalAttackHeadingLow < right.finalAttackHeadingLow;
|
||||||
if (left.finalAttackHeadingHigh() != right.finalAttackHeadingHigh())
|
if (left.finalAttackHeadingHigh != right.finalAttackHeadingHigh)
|
||||||
return left.finalAttackHeadingHigh() < right.finalAttackHeadingHigh();
|
return left.finalAttackHeadingHigh < right.finalAttackHeadingHigh;
|
||||||
return left.sampleTime() < right.sampleTime();
|
return left.sampleTime < right.sampleTime;
|
||||||
}
|
}
|
||||||
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
@@ -7,6 +7,7 @@
|
|||||||
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
#include <LtsWidgets/lts_column_filter_proxy_model.h>
|
||||||
#include <GuezNasat/gna_dtc.h>
|
#include <GuezNasat/gna_dtc.h>
|
||||||
#include <ParticipantManagement/ppm.hpp>
|
#include <ParticipantManagement/ppm.hpp>
|
||||||
|
#include <ParticipantManagement/ppm_dtc.h>
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
#include <QtCore/QSortFilterProxyModel>
|
#include <QtCore/QSortFilterProxyModel>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_gui_plugin.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
|
||||||
#include <GuezNasat/gna_data_plugin_interface.h>
|
#include <GuezNasat/gna_data_plugin_interface.h>
|
||||||
#include "aes_air_support_gui_plugin_interface.h"
|
#include "aes_air_support_gui_plugin_interface.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -107,7 +107,7 @@ void AirSupportExplosionClusterImpactList::createModel()
|
|||||||
{
|
{
|
||||||
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
|
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
|
||||||
|
|
||||||
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::AirSupport}, this);
|
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::GearClass_AirSupport}, this);
|
||||||
m_effectClusterModel->initModel(m_session);
|
m_effectClusterModel->initModel(m_session);
|
||||||
m_model->setSourceModel(m_effectClusterModel);
|
m_model->setSourceModel(m_effectClusterModel);
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_itemlist.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
#include <AreaEffectSimulation/Explosion/aes_effect_cluster_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_effect_cluster_model.h>
|
||||||
#include "aes_air_support_impact_model.h"
|
#include "aes_air_support_impact_model.h"
|
||||||
|
|
||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
|
|
||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
{
|
{
|
||||||
|
|||||||
+9
-9
@@ -66,19 +66,19 @@ bool CustomViewBCContamination::init(const QModelIndex &idx)
|
|||||||
bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamination, const QColor &color)
|
bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamination, const QColor &color)
|
||||||
{
|
{
|
||||||
Database::AesBCContamination bcContaOut;
|
Database::AesBCContamination bcContaOut;
|
||||||
bcContaOut.id = bcContamination.id();
|
bcContaOut.id = bcContamination.id;
|
||||||
bcContaOut.chargeTypeId = bcContamination.chargeStruct().chargeTypeId();
|
bcContaOut.chargeTypeId = bcContamination.chargeStruct.chargeTypeId;
|
||||||
bcContaOut.effectStart = QDateTime::fromMSecsSinceEpoch(bcContamination.effectStart().is_set() ? bcContamination.effectStart().get() : 0);
|
bcContaOut.effectStart = QDateTime::fromMSecsSinceEpoch(bcContamination.effectStart.has_value() ? bcContamination.effectStart.get() : 0);
|
||||||
bcContaOut.impactPosition = QPointF(bcContamination.impactPosition().lon(), bcContamination.impactPosition().lat());
|
bcContaOut.impactPosition = QPointF(bcContamination.impactPosition.lon, bcContamination.impactPosition.lat);
|
||||||
bcContaOut.impactRadius = bcContamination.impactRadius();
|
bcContaOut.impactRadius = bcContamination.impactRadius;
|
||||||
bcContaOut.propagationDirection = bcContamination.propagationDirection();
|
bcContaOut.propagationDirection = bcContamination.propagationDirection;
|
||||||
|
|
||||||
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
|
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
|
||||||
ProjectDataManagement::VolatilityType::get_default(),
|
ProjectDataManagement::VolatilityType::Unknown,
|
||||||
bcContamination.impactRadius(),
|
bcContamination.impactRadius,
|
||||||
QDateTime::currentDateTime());
|
QDateTime::currentDateTime());
|
||||||
|
|
||||||
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(bcContamination.effectStateId());
|
Qt::BrushStyle bStyle = PixmapLabel::checkForBrushStyle(bcContamination.effectStateId);
|
||||||
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
const auto pix = Polygons::pixmapFromPolygon(PixmapLabel::geographic2Utm(poly), color, ICON_RESOLUTION, bStyle);
|
||||||
m_ui->lblIcon->setPixmap(pix);
|
m_ui->lblIcon->setPixmap(pix);
|
||||||
|
|
||||||
|
|||||||
+8
-8
@@ -4,7 +4,7 @@
|
|||||||
#include "aes_bccontamination_info.h"
|
#include "aes_bccontamination_info.h"
|
||||||
#include "ui_aes_bccontamination_info.h"
|
#include "ui_aes_bccontamination_info.h"
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/InfoView/aes_base_info.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/InfoView/aes_base_info.h>
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
#include <LtsCoordTrans/lts_coord_trans.h>
|
#include <LtsCoordTrans/lts_coord_trans.h>
|
||||||
#include <QtCore/QDateTime>
|
#include <QtCore/QDateTime>
|
||||||
@@ -33,13 +33,13 @@ bool BCContaminationInfo::setData(const BCContamination *item)
|
|||||||
{
|
{
|
||||||
m_ui->wBaseData->setData(item);
|
m_ui->wBaseData->setData(item);
|
||||||
|
|
||||||
m_ui->lblImpactRadius->setText(QString::number(item->impactRadius()));
|
m_ui->lblImpactRadius->setText(QString::number(item->impactRadius));
|
||||||
m_ui->lblImpactPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->impactPosition().lon(), item->impactPosition().lat()));
|
m_ui->lblImpactPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->impactPosition.lon, item->impactPosition.lat));
|
||||||
m_ui->lblPropagationDirection->setText(tr("%1° = %2 mil").arg(item->propagationDirection(), 0, 'f', 2)
|
m_ui->lblPropagationDirection->setText(tr("%1° = %2 mil").arg(item->propagationDirection, 0, 'f', 2)
|
||||||
.arg(item->propagationDirection() * 6400 / 360.0, 0, 'f', 0));
|
.arg(item->propagationDirection * 6400 / 360.0, 0, 'f', 0));
|
||||||
m_ui->lblWindSpeed->setText(QString::number(item->windSpeed(), 'f', 2));
|
m_ui->lblWindSpeed->setText(QString::number(item->windSpeed, 'f', 2));
|
||||||
m_ui->lblWeatherTimestamp->setText(QDateTime::fromMSecsSinceEpoch(item->weatherTimestamp()).toString());
|
m_ui->lblWeatherTimestamp->setText(QDateTime::fromMSecsSinceEpoch(item->weatherTimestamp).toString());
|
||||||
m_ui->lblWeatherPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->weatherPosition().lon(), item->weatherPosition().lat()));
|
m_ui->lblWeatherPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->weatherPosition.lon, item->weatherPosition.lat));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+33
-33
@@ -69,8 +69,8 @@ BCContaminationEdit::BCContaminationEdit(const QString &menuGroup, bool isChemic
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
m_ui->cbWeather->addItem(toString(AesWeatherSource::AwsDynamic), AesWeatherSource::AwsDynamic);
|
m_ui->cbWeather->addItem(toString(AesWeatherSource::AwsDynamic), static_cast<int>(AesWeatherSource::AwsDynamic));
|
||||||
m_ui->cbWeather->addItem(toString(AesWeatherSource::AwsStatic), AesWeatherSource::AwsStatic);
|
m_ui->cbWeather->addItem(toString(AesWeatherSource::AwsStatic), static_cast<int>(AesWeatherSource::AwsStatic));
|
||||||
|
|
||||||
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance();
|
||||||
const bool enableShowMeteoDataStations = ps->value(QStringLiteral("mdm"),
|
const bool enableShowMeteoDataStations = ps->value(QStringLiteral("mdm"),
|
||||||
@@ -132,15 +132,15 @@ void BCContaminationEdit::enableUiElements(bool enable)
|
|||||||
|
|
||||||
m_ui->cbWeather->setEnabled(enable);
|
m_ui->cbWeather->setEnabled(enable);
|
||||||
m_ui->pbClear->setEnabled(enable);
|
m_ui->pbClear->setEnabled(enable);
|
||||||
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
if (m_aesItem.effectStateId == AesEffectState::EsExpired)
|
||||||
{
|
{
|
||||||
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
|
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name));
|
||||||
__unchange__();
|
__unchange__();
|
||||||
}
|
}
|
||||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
if (m_aesItem.effectStateId == AesEffectState::EsActivated)
|
||||||
{
|
{
|
||||||
QString name = m_ui->leIdentifier->text();
|
QString name = m_ui->leIdentifier->text();
|
||||||
auto baseData = m_dtc->bCContamination(m_aesItem.id());
|
auto baseData = m_dtc->bCContamination(m_aesItem.id);
|
||||||
setData(baseData, false);
|
setData(baseData, false);
|
||||||
__unchange__();
|
__unchange__();
|
||||||
if (name != m_ui->leIdentifier->text())
|
if (name != m_ui->leIdentifier->text())
|
||||||
@@ -193,8 +193,8 @@ bool BCContaminationEdit::init(int aesItemId, bool copy,
|
|||||||
|
|
||||||
auto cb = [this](const DangerAreaCorrelatedAesItem &item)
|
auto cb = [this](const DangerAreaCorrelatedAesItem &item)
|
||||||
{
|
{
|
||||||
if (item.aesItemId() == m_aesItem.id())
|
if (item.aesItemId == m_aesItem.id)
|
||||||
m_dangerAreaIds << item.dangerAreaId();
|
m_dangerAreaIds << item.dangerAreaId;
|
||||||
};
|
};
|
||||||
m_dtc->dangerAreaCorrelatedAesItems(cb);
|
m_dtc->dangerAreaCorrelatedAesItems(cb);
|
||||||
setPbDangerAreaText();
|
setPbDangerAreaText();
|
||||||
@@ -211,8 +211,8 @@ bool BCContaminationEdit::init(int aesItemId, bool copy,
|
|||||||
|
|
||||||
auto cbDangerArea = [this](const DangerArea &data)
|
auto cbDangerArea = [this](const DangerArea &data)
|
||||||
{
|
{
|
||||||
if (data.effectStateId() != AesEffectState::EsRemoved && data.associatedAesId() == m_aesItem.id())
|
if (data.effectStateId != AesEffectState::EsRemoved && data.associatedAesId == m_aesItem.id)
|
||||||
m_associatedDangerId = data.id();
|
m_associatedDangerId = data.id;
|
||||||
};
|
};
|
||||||
m_dtc->dangerAreas(cbDangerArea);
|
m_dtc->dangerAreas(cbDangerArea);
|
||||||
if (m_associatedDangerId)
|
if (m_associatedDangerId)
|
||||||
@@ -229,7 +229,7 @@ void BCContaminationEdit::setPbDangerAreaText()
|
|||||||
sl.reserve(m_dangerAreaIds.size());
|
sl.reserve(m_dangerAreaIds.size());
|
||||||
for (int idx : std::as_const(m_dangerAreaIds))
|
for (int idx : std::as_const(m_dangerAreaIds))
|
||||||
{
|
{
|
||||||
sl << QString::fromStdString(m_dtc->dangerArea(idx).name());
|
sl << QString::fromStdString(m_dtc->dangerArea(idx).name);
|
||||||
}
|
}
|
||||||
m_ui->pbDangerArea->setEnabled(sl.size());
|
m_ui->pbDangerArea->setEnabled(sl.size());
|
||||||
m_ui->pbDangerArea->setText(sl.join(QStringLiteral(", ")));
|
m_ui->pbDangerArea->setText(sl.join(QStringLiteral(", ")));
|
||||||
@@ -237,14 +237,14 @@ void BCContaminationEdit::setPbDangerAreaText()
|
|||||||
|
|
||||||
void BCContaminationEdit::onDangerAreaChanged(const DangerAreaCorrelatedAesItem &data, DataModification modType)
|
void BCContaminationEdit::onDangerAreaChanged(const DangerAreaCorrelatedAesItem &data, DataModification modType)
|
||||||
{
|
{
|
||||||
if (data.aesItemId() != m_aesItem.id())
|
if (data.aesItemId != m_aesItem.id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (modType == DataModification::eAdded)
|
if (modType == DataModification::eAdded)
|
||||||
m_dangerAreaIds += data.dangerAreaId();
|
m_dangerAreaIds += data.dangerAreaId;
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved)
|
if (modType == DataModification::eRemoved)
|
||||||
m_dangerAreaIds -= data.dangerAreaId();
|
m_dangerAreaIds -= data.dangerAreaId;
|
||||||
|
|
||||||
|
|
||||||
setPbDangerAreaText();
|
setPbDangerAreaText();
|
||||||
@@ -259,7 +259,7 @@ void BCContaminationEdit::onPbDangerAreaClicked()
|
|||||||
if (!m_session->getForeignGuiInterface<ForeignInfoGuiInterface>(infoGuiInterface))
|
if (!m_session->getForeignGuiInterface<ForeignInfoGuiInterface>(infoGuiInterface))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
LtsWidgets::LtsDialog *dialog = infoGuiInterface->showDangerAreaAesItemInfo(m_dangerAreaIds, {m_aesItem.id()});
|
LtsWidgets::LtsDialog *dialog = infoGuiInterface->showDangerAreaAesItemInfo(m_dangerAreaIds, {m_aesItem.id});
|
||||||
|
|
||||||
addDialog(dialog, m_menuGroup, tr("Danger Areas for %1 %2").arg(m_isChemical ? tr("C-Contamination") : tr("B-Contamination"), m_ui->leIdentifier->text()), LtsWidgets::LayoutArea::eInfoTab);
|
addDialog(dialog, m_menuGroup, tr("Danger Areas for %1 %2").arg(m_isChemical ? tr("C-Contamination") : tr("B-Contamination"), m_ui->leIdentifier->text()), LtsWidgets::LayoutArea::eInfoTab);
|
||||||
}
|
}
|
||||||
@@ -269,23 +269,23 @@ void BCContaminationEdit::setData(const BCContamination &contamination, bool cop
|
|||||||
m_aesItem = contamination;
|
m_aesItem = contamination;
|
||||||
if (copy)
|
if (copy)
|
||||||
{
|
{
|
||||||
m_aesItem.id(0);
|
m_aesItem.id = 0;
|
||||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
|
m_aesItem.effectStateId = AreaEffectSimulation::AesEffectState::EsUnknown;
|
||||||
}
|
}
|
||||||
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name()));
|
m_ui->leIdentifier->setText(QString::fromStdString(contamination.name));
|
||||||
m_ui->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart().is_set() ? contamination.effectStart().get() : 0);
|
m_ui->dteEffectStart->setMsecsSinceEpoch(contamination.effectStart.has_value() ? contamination.effectStart.get() : 0);
|
||||||
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(contamination.chargeStruct().chargeTypeId()));
|
m_ui->cbChargeType->setCurrentIndex(m_ui->cbChargeType->findData(contamination.chargeStruct.chargeTypeId));
|
||||||
m_ui->sbDurationHours->setValue(contamination.effectDuration() / 1000 / 60/ 60);
|
m_ui->sbDurationHours->setValue(contamination.effectDuration / 1000 / 60/ 60);
|
||||||
m_ui->sbRadius->setValue(contamination.impactRadius());
|
m_ui->sbRadius->setValue(contamination.impactRadius);
|
||||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(contamination.partyId().is_set() ? contamination.partyId().get() : 0));
|
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(contamination.partyId.has_value() ? contamination.partyId.get() : 0));
|
||||||
m_ui->cbWeather->setCurrentIndex(contamination.weatherSource().underlying());
|
m_ui->cbWeather->setCurrentIndex(static_cast<int>(contamination.weatherSource));
|
||||||
|
|
||||||
QPointF impactPosition(contamination.impactPosition().lon(), contamination.impactPosition().lat());
|
QPointF impactPosition(contamination.impactPosition.lon, contamination.impactPosition.lat);
|
||||||
if (!impactPosition.isNull())
|
if (!impactPosition.isNull())
|
||||||
m_ui->positionEdit->setCoordinate(impactPosition);
|
m_ui->positionEdit->setCoordinate(impactPosition);
|
||||||
|
|
||||||
m_ui->sbAltitude->setValue(contamination.upperOffset());
|
m_ui->sbAltitude->setValue(contamination.upperOffset);
|
||||||
m_ui->cbLowerLimit->setChecked(qFuzzyIsNull(contamination.lowerOffset()));
|
m_ui->cbLowerLimit->setChecked(qFuzzyIsNull(contamination.lowerOffset));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -341,9 +341,9 @@ bool BCContaminationEdit::apply()
|
|||||||
const Core::GeoPosition2D pos(p.x(), p.y());
|
const Core::GeoPosition2D pos(p.x(), p.y());
|
||||||
|
|
||||||
|
|
||||||
const BCContaminationModifyRequest req(m_aesItem.id(),
|
const BCContaminationModifyRequest req(m_aesItem.id,
|
||||||
name,
|
name,
|
||||||
LtsUtils::toOptional(effectStart),
|
LtsUtils::toOptional(static_cast<int64_t>(effectStart)),
|
||||||
duration,
|
duration,
|
||||||
chargeType,
|
chargeType,
|
||||||
pos,
|
pos,
|
||||||
@@ -354,18 +354,18 @@ bool BCContaminationEdit::apply()
|
|||||||
dds::core::optional<double>(),
|
dds::core::optional<double>(),
|
||||||
dds::core::optional<double>(),
|
dds::core::optional<double>(),
|
||||||
dds::core::optional<Core::GeoPosition2D>(),
|
dds::core::optional<Core::GeoPosition2D>(),
|
||||||
dds::core::optional<rti::core::int64>(),
|
dds::core::optional<int64_t>(),
|
||||||
dds::core::optional<rti::core::int64>(),
|
dds::core::optional<int64_t>(),
|
||||||
extrusionHeight,
|
extrusionHeight,
|
||||||
lowerOffset,
|
lowerOffset,
|
||||||
m_ui->chbDangerArea->isChecked());
|
m_ui->chbDangerArea->isChecked());
|
||||||
|
|
||||||
INFO_LOG(m_logger) << "apply "
|
INFO_LOG(m_logger) << "apply "
|
||||||
<< " extrusionHeight=" << extrusionHeight
|
<< " extrusionHeight=" << extrusionHeight
|
||||||
<< " req.upperOffset=" << req.upperOffset()
|
<< " req.upperOffset=" << req.upperOffset
|
||||||
<< " lowerOf"
|
<< " lowerOf"
|
||||||
"fset=" << lowerOffset
|
"fset=" << lowerOffset
|
||||||
<< " req.lowerOffset=" << req.lowerOffset();
|
<< " req.lowerOffset=" << req.lowerOffset;
|
||||||
|
|
||||||
m_requestHelper->addRequest([this,req]()
|
m_requestHelper->addRequest([this,req]()
|
||||||
{
|
{
|
||||||
|
|||||||
+3
-3
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||||
#include <ProjectDataManagement/pdm_gui_plugin_interface.h>
|
#include <ProjectDataManagement/pdm_gui_plugin_interface.h>
|
||||||
|
|
||||||
|
|
||||||
@@ -29,8 +29,8 @@ public:
|
|||||||
QString dialogIdentifier() const override
|
QString dialogIdentifier() const override
|
||||||
{
|
{
|
||||||
if (m_isChemical)
|
if (m_isChemical)
|
||||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddCContamination") : QStringLiteral("EditCContamination%1").arg(m_aesItem.id());
|
return m_aesItem.id <= 0 ? QStringLiteral("AddCContamination") : QStringLiteral("EditCContamination%1").arg(m_aesItem.id);
|
||||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddBContamination") : QStringLiteral("EditBContamination%1").arg(m_aesItem.id());
|
return m_aesItem.id <= 0 ? QStringLiteral("AddBContamination") : QStringLiteral("EditBContamination%1").arg(m_aesItem.id);
|
||||||
}
|
}
|
||||||
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_gui_plugin.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
|
||||||
#include "aes_bccontamination_gui_plugin_interface.h"
|
#include "aes_bccontamination_gui_plugin_interface.h"
|
||||||
|
|
||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_itemlist.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
|
|
||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QtCore/QSet>
|
#include <QtCore/QSet>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||||
|
|
||||||
namespace LtsSession
|
namespace LtsSession
|
||||||
|
|||||||
+5
@@ -36,6 +36,11 @@ NGL_WRAP_UI(aes_base_gui_SRCS
|
|||||||
)
|
)
|
||||||
|
|
||||||
NGL_ADD_LIBRARY2(WS AesBaseGui SHARED ${aes_base_gui_SRCS})
|
NGL_ADD_LIBRARY2(WS AesBaseGui SHARED ${aes_base_gui_SRCS})
|
||||||
|
# aes_base_edit.h includes LtsWidgets/ui_requirement.h (a handwritten header, not a
|
||||||
|
# UI file). Qt6's strict AUTOUIC auto-scan then demands a requirement.ui that does not
|
||||||
|
# exist and fails the autogen step. The real .ui files are wrapped explicitly above via
|
||||||
|
# NGL_WRAP_UI (qt6_wrap_ui), so disable the auto-scan (same approach as LtsWidgets).
|
||||||
|
set_target_properties(AesBaseGui PROPERTIES AUTOUIC OFF)
|
||||||
NGL_TARGET_INCLUDE_DIRECTORIES(AesBaseGui
|
NGL_TARGET_INCLUDE_DIRECTORIES(AesBaseGui
|
||||||
PUBLIC
|
PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/../../../Services/
|
${CMAKE_CURRENT_SOURCE_DIR}/../../../Services/
|
||||||
|
|||||||
+14
-14
@@ -71,23 +71,23 @@ bool BaseInfo::setData(const AesItem *item)
|
|||||||
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc) || !pdmDtc )
|
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc) || !pdmDtc )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
setEffectDuration(item->effectDuration());
|
setEffectDuration(item->effectDuration);
|
||||||
m_ui->lblIdentifier->setText(QString::fromStdString(item->name().c_str()));
|
m_ui->lblIdentifier->setText(QString::fromStdString(item->name.c_str()));
|
||||||
m_ui->lblChargeType->setText(pdmDtc->trChargeTypeShortName(item->chargeStruct().chargeTypeId(), true));
|
m_ui->lblChargeType->setText(pdmDtc->trChargeTypeShortName(item->chargeStruct.chargeTypeId, true));
|
||||||
m_ui->lblChargeType->setToolTip(pdmDtc->trChargeTypeName(item->chargeStruct().chargeTypeId(), true));
|
m_ui->lblChargeType->setToolTip(pdmDtc->trChargeTypeName(item->chargeStruct.chargeTypeId, true));
|
||||||
m_ui->lblEffectState->setText(AreaEffectSimulation::toString(item->effectStateId()));
|
m_ui->lblEffectState->setText(AreaEffectSimulation::toString(item->effectStateId));
|
||||||
|
|
||||||
|
|
||||||
setEffectStart(item->effectStart().is_set() ? item->effectStart().get() : 0);
|
setEffectStart(item->effectStart.has_value() ? item->effectStart.get() : 0);
|
||||||
|
|
||||||
if (item->participantId().is_set())
|
if (item->participantId.has_value())
|
||||||
{
|
{
|
||||||
if (!ppmDtc)
|
if (!ppmDtc)
|
||||||
m_ui->lblParticipant->setText(tr("ID: %1").arg(item->participantId().get()));
|
m_ui->lblParticipant->setText(tr("ID: %1").arg(item->participantId.get()));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ParticipantManagement::Participant participant = ppmDtc->participant(item->partyId().get());
|
ParticipantManagement::Participant participant = ppmDtc->participant(item->partyId.get());
|
||||||
m_ui->lblParticipant->setText(QString::fromStdString(participant.name()));
|
m_ui->lblParticipant->setText(QString::fromStdString(participant.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -96,14 +96,14 @@ bool BaseInfo::setData(const AesItem *item)
|
|||||||
m_ui->lbxParticipant->hide();
|
m_ui->lbxParticipant->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item->partyId().is_set())
|
if (item->partyId.has_value())
|
||||||
{
|
{
|
||||||
if (!ppmDtc)
|
if (!ppmDtc)
|
||||||
m_ui->lblParty->setText(tr("ID: %1").arg(item->partyId().get()));
|
m_ui->lblParty->setText(tr("ID: %1").arg(item->partyId.get()));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ParticipantManagement::Party party = ppmDtc->party(item->partyId().get());
|
ParticipantManagement::Party party = ppmDtc->party(item->partyId.get());
|
||||||
m_ui->lblParty->setText(ParticipantManagement::trPartyName(party.name()));
|
m_ui->lblParty->setText(ParticipantManagement::trPartyName(party.name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+13
-13
@@ -22,7 +22,7 @@ BaseEdit::BaseEdit(const QString& menuGroup, const QString& loggerName, QWidget*
|
|||||||
m_sitMapGuiIfc(nullptr), m_ppmGuiCbxIfc(nullptr), m_session(nullptr), m_menuGroup(menuGroup),
|
m_sitMapGuiIfc(nullptr), m_ppmGuiCbxIfc(nullptr), m_session(nullptr), m_menuGroup(menuGroup),
|
||||||
m_requestHelper(new LtsUtils::RequestHelper(this)), m_logger(getLogger(loggerName))
|
m_requestHelper(new LtsUtils::RequestHelper(this)), m_logger(getLogger(loggerName))
|
||||||
{
|
{
|
||||||
m_aesItem.id(0);
|
m_aesItem.id = 0;
|
||||||
connect(this, &BaseEdit::visibilityChanged, this, &BaseEdit::onVisibilityChanged);
|
connect(this, &BaseEdit::visibilityChanged, this, &BaseEdit::onVisibilityChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ void BaseEdit::onAesItemModifyReply(const Core::FunctionReplyObject& replyObject
|
|||||||
|
|
||||||
bool BaseEdit::isModifiable() const
|
bool BaseEdit::isModifiable() const
|
||||||
{
|
{
|
||||||
AesEffectState effectState = m_aesItem.effectStateId();
|
AesEffectState effectState = m_aesItem.effectStateId;
|
||||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
|
effectState == AreaEffectSimulation::AesEffectState::EsActivated ||
|
||||||
effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
effectState == AreaEffectSimulation::AesEffectState::EsPrepared ||
|
||||||
@@ -62,7 +62,7 @@ bool BaseEdit::isModifiable() const
|
|||||||
|
|
||||||
bool BaseEdit::isOnlyNameModifiable() const
|
bool BaseEdit::isOnlyNameModifiable() const
|
||||||
{
|
{
|
||||||
AesEffectState effectState = m_aesItem.effectStateId();
|
AesEffectState effectState = m_aesItem.effectStateId;
|
||||||
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
return (effectState == AreaEffectSimulation::AesEffectState::EsPaused ||
|
||||||
effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
|
effectState == AreaEffectSimulation::AesEffectState::EsActivated) &&
|
||||||
(!m_session->isReplayPartition()) && (m_session->app() != LtsAppDescriptor::App::OC);
|
(!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);
|
m_session->getDtc<ExerciseManagement::DataInterface>(exmDtc);
|
||||||
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
|
ExerciseManagement::Exercise exercise = exmDtc->exercise(exerciseId);
|
||||||
|
|
||||||
enable = (exercise.state() == ExerciseManagement::ExerciseState::Started ||
|
enable = (exercise.state == ExerciseManagement::ExerciseState::Started ||
|
||||||
exercise.state() == ExerciseManagement::ExerciseState::Paused);
|
exercise.state == ExerciseManagement::ExerciseState::Paused);
|
||||||
|
|
||||||
if (exercise.state() == ExerciseManagement::ExerciseState::Created)
|
if (exercise.state == ExerciseManagement::ExerciseState::Created)
|
||||||
dte->setChecked(false);
|
dte->setChecked(false);
|
||||||
else
|
else
|
||||||
dte->setChecked(dte->msecsSinceEpoch() > 0);
|
dte->setChecked(dte->msecsSinceEpoch() > 0);
|
||||||
@@ -217,7 +217,7 @@ void BaseEdit::setCoordinates(const std::vector<Core::GeoPosition2D>& coords)
|
|||||||
clearCoordinates();
|
clearCoordinates();
|
||||||
const auto cWidgets(coordWidgets());
|
const auto cWidgets(coordWidgets());
|
||||||
for (size_t i = 0; i < cWidgets.size() && i < static_cast<size_t>(coords.size()); ++i)
|
for (size_t i = 0; i < cWidgets.size() && i < static_cast<size_t>(coords.size()); ++i)
|
||||||
cWidgets.at(i)->setCoordinate(coords.at(i).lon(), coords.at(i).lat());
|
cWidgets.at(i)->setCoordinate(coords.at(i).lon, coords.at(i).lat);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Core::GeoPosition2D> BaseEdit::getCoordinates() const
|
std::vector<Core::GeoPosition2D> BaseEdit::getCoordinates() const
|
||||||
@@ -265,10 +265,10 @@ void BaseEdit::enabledCoordinates(bool enable)
|
|||||||
void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
|
void BaseEdit::onAreaChanged(const AesItem& data, DataModification modType)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (data.id() != m_aesItem.id())
|
if (data.id != m_aesItem.id)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (modType == DataModification::eRemoved || data.effectStateId() == AesEffectState::EsRemoved)
|
if (modType == DataModification::eRemoved || data.effectStateId == AesEffectState::EsRemoved)
|
||||||
{
|
{
|
||||||
|
|
||||||
__unchange__();
|
__unchange__();
|
||||||
@@ -287,7 +287,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_session = session;
|
m_session = session;
|
||||||
m_aesItem.id(aesItemId);
|
m_aesItem.id = aesItemId;
|
||||||
|
|
||||||
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_dtc))
|
if (!m_session->getDtc<AreaEffectSimulation::DataInterface>(m_dtc))
|
||||||
return false;
|
return false;
|
||||||
@@ -302,7 +302,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
|||||||
|
|
||||||
if (aesItemId == 0)
|
if (aesItemId == 0)
|
||||||
{
|
{
|
||||||
m_aesItem.effectSourceId(ProjectDataManagement::EffectSource::ES_Internal);
|
m_aesItem.effectSourceId = ProjectDataManagement::EffectSource::ES_Internal;
|
||||||
m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add"));
|
m_buttonBox->setText(LtsWidgets::DialogButton::Ok, tr("Add"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,8 +311,8 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession* session)
|
|||||||
|
|
||||||
double BaseEdit::distance(const Core::GeoPosition2D& p1, const Core::GeoPosition2D& p2)
|
double BaseEdit::distance(const Core::GeoPosition2D& p1, const Core::GeoPosition2D& p2)
|
||||||
{
|
{
|
||||||
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon(), p1.lat());
|
LtsCoordTrans::UtmCoordinate start = LtsCoordTrans::UtmCoordinate::fromGeographic(p1.lon, p1.lat);
|
||||||
LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon(), p2.lat(), start.zone);
|
LtsCoordTrans::UtmCoordinate end = LtsCoordTrans::UtmCoordinate::fromGeographic(p2.lon, p2.lat, start.zone);
|
||||||
double dx = start.x - end.x;
|
double dx = start.x - end.x;
|
||||||
double dy = start.y - end.y;
|
double dy = start.y - end.y;
|
||||||
return std::sqrt(dx * dx + dy * dy);
|
return std::sqrt(dx * dx + dy * dy);
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
#include <AreaEffectSimulation/logger.h>
|
#include <AreaEffectSimulation/logger.h>
|
||||||
#include <AreaEffectSimulation/aes.hpp>
|
#include <AreaEffectSimulation/aes.hpp>
|
||||||
#include <LtsWidgets/lts_dialog.h>
|
#include <LtsWidgets/lts_dialog.h>
|
||||||
#include <LtsWidgets/requirement_widget.h>
|
#include <LtsWidgets/ui_requirement.h>
|
||||||
|
|
||||||
|
|
||||||
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
|
||||||
|
|||||||
+20
-16
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "aes_base_model.h"
|
#include "aes_base_model.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include <LtsSession/lts_session.h>
|
#include <LtsSession/lts_session.h>
|
||||||
#include <LtsSession/lts_session_data.h>
|
#include <LtsSession/lts_session_data.h>
|
||||||
@@ -15,7 +16,8 @@
|
|||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
{
|
{
|
||||||
|
|
||||||
AesGuiBasHelpers::AesGuiBasHelpers() : m_aesDtc(nullptr), m_pdmDtc(nullptr), m_ppmDtc(nullptr) {}
|
AesGuiBasHelpers::AesGuiBasHelpers() : m_aesDtc(nullptr), m_pdmDtc(nullptr), m_ppmDtc(nullptr) , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
|
{}
|
||||||
|
|
||||||
bool AesGuiBasHelpers::initModel(LtsSession::LtsSession* session)
|
bool AesGuiBasHelpers::initModel(LtsSession::LtsSession* session)
|
||||||
{
|
{
|
||||||
@@ -38,24 +40,24 @@ bool AesGuiBasHelpers::initModel(LtsSession::LtsSession* session)
|
|||||||
|
|
||||||
QVariant AesGuiBasHelpers::stringFromPartyId(const dds::core::optional<int>& id) const
|
QVariant AesGuiBasHelpers::stringFromPartyId(const dds::core::optional<int>& id) const
|
||||||
{
|
{
|
||||||
if (!id.is_set())
|
if (!id.has_value())
|
||||||
return QObject::tr("---");
|
return QObject::tr("---");
|
||||||
auto it = m_partyNames.find(id.get());
|
auto it = m_partyNames.find(id.get());
|
||||||
if (it != m_partyNames.end())
|
if (it != m_partyNames.end())
|
||||||
return it.value();
|
return it.value();
|
||||||
const QString name = ParticipantManagement::trPartyName(m_ppmDtc->party(id.get()).name());
|
const QString name = ParticipantManagement::trPartyName(m_ppmDtc->party(id.get()).name);
|
||||||
m_partyNames.insert(id.get(), name);
|
m_partyNames.insert(id.get(), name);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
QIcon AesGuiBasHelpers::iconFromPartyId(const dds::core::optional<int>& id) const
|
QIcon AesGuiBasHelpers::iconFromPartyId(const dds::core::optional<int>& id) const
|
||||||
{
|
{
|
||||||
if (!id.is_set() || !m_ppmGuiCbxIfc)
|
if (!id.has_value() || !m_ppmGuiCbxIfc)
|
||||||
return QIcon();
|
return QIcon();
|
||||||
auto it = m_partyIcons.find(id.get());
|
auto it = m_partyIcons.find(id.get());
|
||||||
if (it != m_partyIcons.end())
|
if (it != m_partyIcons.end())
|
||||||
return it.value();
|
return it.value();
|
||||||
const QRgb col = QRgb(m_ppmDtc->party(id.get()).color());
|
const QRgb col = QRgb(m_ppmDtc->party(id.get()).color);
|
||||||
const QIcon icon = m_ppmGuiCbxIfc->pixmapFromParty(col);
|
const QIcon icon = m_ppmGuiCbxIfc->pixmapFromParty(col);
|
||||||
m_partyIcons.insert(id.get(), icon);
|
m_partyIcons.insert(id.get(), icon);
|
||||||
return icon;
|
return icon;
|
||||||
@@ -63,7 +65,7 @@ QIcon AesGuiBasHelpers::iconFromPartyId(const dds::core::optional<int>& id) cons
|
|||||||
|
|
||||||
QVariant AesGuiBasHelpers::hierarchyFromParticipantId(const dds::core::optional<int>& id) const
|
QVariant AesGuiBasHelpers::hierarchyFromParticipantId(const dds::core::optional<int>& id) const
|
||||||
{
|
{
|
||||||
if (!id.is_set())
|
if (!id.has_value())
|
||||||
return QObject::tr("---");
|
return QObject::tr("---");
|
||||||
auto it = m_participantHierarchy.find(id.get());
|
auto it = m_participantHierarchy.find(id.get());
|
||||||
if (it != m_participantHierarchy.end())
|
if (it != m_participantHierarchy.end())
|
||||||
@@ -109,7 +111,9 @@ void AesGuiBasHelpers::updateEffectStateComboboxFilterData(bool bWithPause)
|
|||||||
{
|
{
|
||||||
if (!bWithPause && es == AesEffectState::EsPaused)
|
if (!bWithPause && es == AesEffectState::EsPaused)
|
||||||
continue;
|
continue;
|
||||||
cfd.data = es;
|
// Qt6 removed Qt5's QVariant template operator=, so store the enum via setValue
|
||||||
|
// (requires the Q_DECLARE_METATYPE added to aes_base_model.h).
|
||||||
|
cfd.data.setValue(es);
|
||||||
cfd.text = AreaEffectSimulation::toString(es);
|
cfd.text = AreaEffectSimulation::toString(es);
|
||||||
cfc.data.push_back(cfd);
|
cfc.data.push_back(cfd);
|
||||||
}
|
}
|
||||||
@@ -134,7 +138,7 @@ void AesGuiBasHelpers::updateComboboxFilterData(const QSet<int>& availablePartyI
|
|||||||
for (const int i : std::as_const(availablePartyIds))
|
for (const int i : std::as_const(availablePartyIds))
|
||||||
{
|
{
|
||||||
cfd.data = i;
|
cfd.data = i;
|
||||||
cfd.text = ParticipantManagement::trPartyName(m_ppmDtc->party(i).name());
|
cfd.text = ParticipantManagement::trPartyName(m_ppmDtc->party(i).name);
|
||||||
cfd.icon = iconFromPartyId(i);
|
cfd.icon = iconFromPartyId(i);
|
||||||
cfc.data.push_back(cfd);
|
cfc.data.push_back(cfd);
|
||||||
}
|
}
|
||||||
@@ -164,7 +168,7 @@ void AesGuiBasHelpers::fillAvailableChargeIds(ProjectDataManagement::GearClass g
|
|||||||
m_availableChargeIds.clear();
|
m_availableChargeIds.clear();
|
||||||
const QVector<ProjectDataManagement::ChargeType> availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
const QVector<ProjectDataManagement::ChargeType> availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
||||||
for (const auto& charge : availableCharges)
|
for (const auto& charge : availableCharges)
|
||||||
m_availableChargeIds += charge.id();
|
m_availableChargeIds += charge.id;
|
||||||
|
|
||||||
if (m_availableChargeIds.isEmpty())
|
if (m_availableChargeIds.isEmpty())
|
||||||
m_availableChargeIds += 0;
|
m_availableChargeIds += 0;
|
||||||
@@ -178,7 +182,7 @@ void AesGuiBasHelpers::fillAvailableChargeIds(const QVector<ProjectDataManagemen
|
|||||||
{
|
{
|
||||||
const QVector<ProjectDataManagement::ChargeType>& availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
const QVector<ProjectDataManagement::ChargeType>& availableCharges = m_pdmDtc->chargesForGearClass(gc);
|
||||||
for (const auto& charge : std::as_const(availableCharges))
|
for (const auto& charge : std::as_const(availableCharges))
|
||||||
m_availableChargeIds += charge.id();
|
m_availableChargeIds += charge.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_availableChargeIds.isEmpty())
|
if (m_availableChargeIds.isEmpty())
|
||||||
@@ -192,7 +196,7 @@ AesItemSortFilterProxyModel::AesItemSortFilterProxyModel(LtsSession::LtsSession*
|
|||||||
if (m_session->getDtc<ParticipantManagement::DataInterface>(ppmDtc))
|
if (m_session->getDtc<ParticipantManagement::DataInterface>(ppmDtc))
|
||||||
{
|
{
|
||||||
auto cb = [this](const ParticipantManagement::Party& party) {
|
auto cb = [this](const ParticipantManagement::Party& party) {
|
||||||
m_partyColors[party.id()] = QColor::fromRgb(QRgb(party.color()));
|
m_partyColors[party.id] = QColor::fromRgb(QRgb(party.color));
|
||||||
};
|
};
|
||||||
ppmDtc->partys(cb);
|
ppmDtc->partys(cb);
|
||||||
}
|
}
|
||||||
@@ -236,11 +240,11 @@ bool AesItemSortFilterProxyModel::lessThan(const QModelIndex& source_left, const
|
|||||||
case AesGuiBasHelpers::BcEffectStart: {
|
case AesGuiBasHelpers::BcEffectStart: {
|
||||||
const auto effectStartLeft = aesEffectStart(source_left.row());
|
const auto effectStartLeft = aesEffectStart(source_left.row());
|
||||||
const auto effectStartRight = aesEffectStart(source_right.row());
|
const auto effectStartRight = aesEffectStart(source_right.row());
|
||||||
if (effectStartLeft.is_set() && effectStartRight.is_set())
|
if (effectStartLeft.has_value() && effectStartRight.has_value())
|
||||||
return effectStartLeft.get() < effectStartRight.get();
|
return effectStartLeft.get() < effectStartRight.get();
|
||||||
if (effectStartRight.is_set())
|
if (effectStartRight.has_value())
|
||||||
return true;
|
return true;
|
||||||
if (effectStartLeft.is_set())
|
if (effectStartLeft.has_value())
|
||||||
return false;
|
return false;
|
||||||
return aesId(source_left.row()) < aesId(source_right.row());
|
return aesId(source_left.row()) < aesId(source_right.row());
|
||||||
}
|
}
|
||||||
@@ -307,10 +311,10 @@ bool AesItemSortFilterProxyModel::checkFilter(int source_row) const
|
|||||||
|
|
||||||
const auto effectStart = aesEffectStart(source_row);
|
const auto effectStart = aesEffectStart(source_row);
|
||||||
qint64 effectEnd = 0;
|
qint64 effectEnd = 0;
|
||||||
if (effectStart.is_set())
|
if (effectStart.has_value())
|
||||||
effectEnd = effectStart.get() + aesEffectDuration(source_row);
|
effectEnd = effectStart.get() + aesEffectDuration(source_row);
|
||||||
|
|
||||||
if (effectStart.is_set() && effectEnd + m_offset > m_session->partitionTime())
|
if (effectStart.has_value() && effectEnd + m_offset > m_session->partitionTime())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
+45
-35
@@ -22,6 +22,12 @@
|
|||||||
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
|
||||||
#include <ProjectDataManagement/pdm_enums.hpp>
|
#include <ProjectDataManagement/pdm_enums.hpp>
|
||||||
|
|
||||||
|
// Qt6's QVariant no longer has Qt5's permissive template operator, so a scoped
|
||||||
|
// enum must be registered to be stored in / retrieved from a QVariant. The effect-state
|
||||||
|
// combobox filter (ComboboxFilterData::data) and the model's ComboboxFilterRole both
|
||||||
|
// hold AesEffectState in a QVariant for filtering, so register the meta-type here.
|
||||||
|
Q_DECLARE_METATYPE(AreaEffectSimulation::AesEffectState)
|
||||||
|
|
||||||
const static int DEFAULT_EFFECT_DURATION = 777777;
|
const static int DEFAULT_EFFECT_DURATION = 777777;
|
||||||
|
|
||||||
namespace LtsSession
|
namespace LtsSession
|
||||||
@@ -141,9 +147,9 @@ protected:
|
|||||||
QSet<int> availablePartyIds;
|
QSet<int> availablePartyIds;
|
||||||
for (const T &data : std::as_const(AesGuiBaseModel::m_vecData))
|
for (const T &data : std::as_const(AesGuiBaseModel::m_vecData))
|
||||||
{
|
{
|
||||||
availabelChargeIds.insert(data.chargeStruct().chargeTypeId());
|
availabelChargeIds.insert(data.chargeStruct.chargeTypeId);
|
||||||
if (data.partyId().is_set())
|
if (data.partyId.has_value())
|
||||||
availablePartyIds.insert(data.partyId().get());
|
availablePartyIds.insert(data.partyId.get());
|
||||||
}
|
}
|
||||||
updateComboboxFilterData(availablePartyIds, availabelChargeIds);
|
updateComboboxFilterData(availablePartyIds, availabelChargeIds);
|
||||||
}
|
}
|
||||||
@@ -195,22 +201,22 @@ protected:
|
|||||||
case BcIsCentral:
|
case BcIsCentral:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
case BcChargeType:
|
case BcChargeType:
|
||||||
return QObject::tr("Id: %1").arg(item.chargeStruct().chargeTypeId());
|
return QObject::tr("Id: %1").arg(item.chargeStruct.chargeTypeId);
|
||||||
case BcEffectDuration:
|
case BcEffectDuration:
|
||||||
{
|
{
|
||||||
if (item.effectDuration() == DEFAULT_EFFECT_DURATION)
|
if (item.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||||
return QStringLiteral("---");
|
return QStringLiteral("---");
|
||||||
else
|
else
|
||||||
return QObject::tr("%1 secs").arg(QString::number(item.effectDuration() / 1000.0, 'f', 3));
|
return QObject::tr("%1 secs").arg(QString::number(item.effectDuration / 1000.0, 'f', 3));
|
||||||
}
|
}
|
||||||
case BcEffectState:
|
case BcEffectState:
|
||||||
return QObject::tr("Id: %1").arg(item.effectStateId().underlying());
|
return QObject::tr("Id: %1").arg(static_cast<int>(item.effectStateId));
|
||||||
case BcEffectSource:
|
case BcEffectSource:
|
||||||
return QObject::tr("Id: %1").arg(item.effectSourceId().underlying());
|
return QObject::tr("Id: %1").arg(static_cast<int>(item.effectSourceId));
|
||||||
case BcParty:
|
case BcParty:
|
||||||
return QObject::tr("Id: %1").arg(item.partyId().is_set() ? item.partyId().get() : -1);
|
return QObject::tr("Id: %1").arg(item.partyId.has_value() ? item.partyId.get() : -1);
|
||||||
case BcParticipant:
|
case BcParticipant:
|
||||||
return QObject::tr("Id: %1").arg(item.participantId().is_set() ? item.participantId().get() : -1);
|
return QObject::tr("Id: %1").arg(item.participantId.has_value() ? item.participantId.get() : -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,28 +225,28 @@ protected:
|
|||||||
switch (column)
|
switch (column)
|
||||||
{
|
{
|
||||||
case BcId:
|
case BcId:
|
||||||
return item.id();
|
return item.id;
|
||||||
case BcName:
|
case BcName:
|
||||||
return QString::fromUtf8(item.name().c_str());
|
return QString::fromUtf8(item.name.c_str());
|
||||||
case BcChargeType:
|
case BcChargeType:
|
||||||
return chargeTypeName(item.chargeStruct().chargeTypeId());
|
return chargeTypeName(item.chargeStruct.chargeTypeId);
|
||||||
case BcEffectDuration:
|
case BcEffectDuration:
|
||||||
if (item.effectDuration() == DEFAULT_EFFECT_DURATION)
|
if (item.effectDuration == DEFAULT_EFFECT_DURATION)
|
||||||
return QStringLiteral("---");
|
return QStringLiteral("---");
|
||||||
else
|
else
|
||||||
return LtsWidgets::readableDuration(item.effectDuration());
|
return LtsWidgets::readableDuration(item.effectDuration);
|
||||||
case BcEffectStart:
|
case BcEffectStart:
|
||||||
return item.effectStart().is_set() ? DTG::toStringMSec(item.effectStart().get()) : QObject::tr("---");
|
return item.effectStart.has_value() ? DTG::toStringMSec(item.effectStart.get()) : QObject::tr("---");
|
||||||
case BcEffectState:
|
case BcEffectState:
|
||||||
return AreaEffectSimulation::toString(item.effectStateId());
|
return AreaEffectSimulation::toString(item.effectStateId);
|
||||||
case BcEffectSource:
|
case BcEffectSource:
|
||||||
return ProjectDataManagement::toString(item.effectSourceId());
|
return ProjectDataManagement::toString(item.effectSourceId);
|
||||||
case BcParty:
|
case BcParty:
|
||||||
return stringFromPartyId(item.partyId());
|
return stringFromPartyId(item.partyId);
|
||||||
case BcParticipant:
|
case BcParticipant:
|
||||||
return hierarchyFromParticipantId(item.participantId());
|
return hierarchyFromParticipantId(item.participantId);
|
||||||
case BcIsCentral:
|
case BcIsCentral:
|
||||||
return simulationTypeText(item.isCentral());
|
return simulationTypeText(item.isCentral);
|
||||||
}
|
}
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@@ -250,7 +256,7 @@ protected:
|
|||||||
switch (column)
|
switch (column)
|
||||||
{
|
{
|
||||||
case BcParty:
|
case BcParty:
|
||||||
return iconFromPartyId(item.partyId());
|
return iconFromPartyId(item.partyId);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -262,13 +268,17 @@ protected:
|
|||||||
switch (column)
|
switch (column)
|
||||||
{
|
{
|
||||||
case BcChargeType:
|
case BcChargeType:
|
||||||
return item.chargeStruct().chargeTypeId();
|
return item.chargeStruct.chargeTypeId;
|
||||||
case BcEffectState:
|
case BcEffectState:
|
||||||
return item.effectStateId().underlying();
|
// Qt6 cannot implicitly construct a QVariant from a scoped enum; use the
|
||||||
|
// meta-type-aware helper (needs the Q_DECLARE_METATYPE above). A free
|
||||||
|
// qVariantFromValue is not visible at this template's definition point, so
|
||||||
|
// use the QVariant::fromValue member instead.
|
||||||
|
return QVariant::fromValue(item.effectStateId);
|
||||||
case BcParty:
|
case BcParty:
|
||||||
return item.partyId().is_set() ? item.partyId().get() : -1;
|
return item.partyId.has_value() ? item.partyId.get() : -1;
|
||||||
case BcIsCentral:
|
case BcIsCentral:
|
||||||
return simulationTypeText(item.isCentral());
|
return simulationTypeText(item.isCentral);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -284,7 +294,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
bool isFiltered(const T &data, DataModification modType) const override
|
bool isFiltered(const T &data, DataModification modType) const override
|
||||||
{
|
{
|
||||||
if (!m_availableChargeIds.isEmpty() && !m_availableChargeIds.contains(data.chargeStruct().chargeTypeId()))
|
if (!m_availableChargeIds.isEmpty() && !m_availableChargeIds.contains(data.chargeStruct.chargeTypeId))
|
||||||
return true;
|
return true;
|
||||||
return LtsWidgets::LtsAbstractTableModel<T>::isFiltered(data, modType);
|
return LtsWidgets::LtsAbstractTableModel<T>::isFiltered(data, modType);
|
||||||
}
|
}
|
||||||
@@ -342,10 +352,10 @@ public:
|
|||||||
}
|
}
|
||||||
T aesItem(int row) const { return m_sourceModel->aesItem(row); }
|
T aesItem(int row) const { return m_sourceModel->aesItem(row); }
|
||||||
|
|
||||||
int aesId(int row) const override { return aesItem(row).id(); }
|
int aesId(int row) const override { return aesItem(row).id; }
|
||||||
bool isExpired(int row) const override
|
bool isExpired(int row) const override
|
||||||
{
|
{
|
||||||
const auto es = aesItem(row).effectStateId();
|
const auto es = aesItem(row).effectStateId;
|
||||||
|
|
||||||
return es != AreaEffectSimulation::AesEffectState::EsCreated &&
|
return es != AreaEffectSimulation::AesEffectState::EsCreated &&
|
||||||
es != AreaEffectSimulation::AesEffectState::EsPrepared &&
|
es != AreaEffectSimulation::AesEffectState::EsPrepared &&
|
||||||
@@ -355,14 +365,14 @@ public:
|
|||||||
}
|
}
|
||||||
bool isExternal(int row) const override
|
bool isExternal(int row) const override
|
||||||
{
|
{
|
||||||
return aesItem(row).externalId() > 0;
|
return aesItem(row).externalId > 0;
|
||||||
}
|
}
|
||||||
protected:
|
protected:
|
||||||
AesEffectState aesEffectStateId(int row) const override { return aesItem(row).effectStateId(); }
|
AesEffectState aesEffectStateId(int row) const override { return aesItem(row).effectStateId; }
|
||||||
ProjectDataManagement::EffectSource aesEffectSourceId(int row) const override { return aesItem(row).effectSourceId(); }
|
ProjectDataManagement::EffectSource aesEffectSourceId(int row) const override { return aesItem(row).effectSourceId; }
|
||||||
dds::core::optional<rti::core::int64> aesEffectStart(int row) const override { return aesItem(row).effectStart(); }
|
dds::core::optional<rti::core::int64> aesEffectStart(int row) const override { return aesItem(row).effectStart; }
|
||||||
int32_t aesEffectDuration(int row) const override { return aesItem(row).effectDuration(); }
|
int32_t aesEffectDuration(int row) const override { return aesItem(row).effectDuration; }
|
||||||
virtual int32_t partyId(int row) const override { return aesItem(row).partyId().is_set()?aesItem(row).partyId().get():-1; }
|
virtual int32_t partyId(int row) const override { return aesItem(row).partyId.has_value()?aesItem(row).partyId.get():-1; }
|
||||||
|
|
||||||
AesGuiBaseModel<T> *m_sourceModel = nullptr;
|
AesGuiBaseModel<T> *m_sourceModel = nullptr;
|
||||||
};
|
};
|
||||||
|
|||||||
+14
-12
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "aes_itemlist.h"
|
#include "aes_itemlist.h"
|
||||||
|
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||||
|
|
||||||
#include "aes_base_model.h"
|
#include "aes_base_model.h"
|
||||||
#include "ui_aes_itemlist.h"
|
#include "ui_aes_itemlist.h"
|
||||||
@@ -27,6 +28,7 @@ AesItemList::AesItemList(const QString& menuGroup, QWidget* parent)
|
|||||||
m_menuGroup(menuGroup), m_requestHelper(new LtsUtils::RequestHelper(this)), m_showExpired(false),
|
m_menuGroup(menuGroup), m_requestHelper(new LtsUtils::RequestHelper(this)), m_showExpired(false),
|
||||||
m_bHasAddEditOperatorRights(true), m_bHasAddAdlerOperatorRights(false), m_session(nullptr),
|
m_bHasAddEditOperatorRights(true), m_bHasAddAdlerOperatorRights(false), m_session(nullptr),
|
||||||
m_ui(new Ui::AesItemList)
|
m_ui(new Ui::AesItemList)
|
||||||
|
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
|
||||||
{
|
{
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
@@ -174,15 +176,15 @@ void AesItemList::onAdlerBtn()
|
|||||||
|
|
||||||
DEBUG_LOG(m_logger) << "onAdlerBtn aesEffectState=" << aesEffectState;
|
DEBUG_LOG(m_logger) << "onAdlerBtn aesEffectState=" << aesEffectState;
|
||||||
|
|
||||||
switch (aesEffectState.underlying())
|
switch (aesEffectState)
|
||||||
{
|
{
|
||||||
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
||||||
switch (effectSource.underlying())
|
switch (effectSource)
|
||||||
{
|
{
|
||||||
case ProjectDataManagement::EffectSource::ES_ADLER: {
|
case ProjectDataManagement::EffectSource::ES_ADLER: {
|
||||||
AcknowledgeExternalAesItemRequest req;
|
AcknowledgeExternalAesItemRequest req;
|
||||||
int aesId = model()->aesId(currentRow());
|
int aesId = model()->aesId(currentRow());
|
||||||
req.aesId(aesId);
|
req.aesId = aesId;
|
||||||
m_requestHelper->startSingleRequest(
|
m_requestHelper->startSingleRequest(
|
||||||
[req, this]() { return m_ftc->acknowledgeExternalAesItemRequest(req, this); });
|
[req, this]() { return m_ftc->acknowledgeExternalAesItemRequest(req, this); });
|
||||||
|
|
||||||
@@ -191,7 +193,7 @@ void AesItemList::onAdlerBtn()
|
|||||||
default: {
|
default: {
|
||||||
ExplosionClusterReleaseReceivedRequest req;
|
ExplosionClusterReleaseReceivedRequest req;
|
||||||
int aesId = model()->aesId(currentRow());
|
int aesId = model()->aesId(currentRow());
|
||||||
req.id(aesId);
|
req.id = aesId;
|
||||||
m_requestHelper->startSingleRequest(
|
m_requestHelper->startSingleRequest(
|
||||||
[req, this]() { return m_ftc->explosionClusterReleaseReceivedRequest(req, this); });
|
[req, this]() { return m_ftc->explosionClusterReleaseReceivedRequest(req, this); });
|
||||||
break;
|
break;
|
||||||
@@ -206,10 +208,10 @@ void AesItemList::onAdlerBtn()
|
|||||||
effectSource == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
effectSource == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
||||||
{
|
{
|
||||||
AreaEffectSimulation::SetAesItemEffectorStateRequest req;
|
AreaEffectSimulation::SetAesItemEffectorStateRequest req;
|
||||||
req.aesId(model()->aesId(currentRow()));
|
req.aesId = model()->aesId(currentRow());
|
||||||
req.newEffectorState(AesEffectorState::EsReadyToFire);
|
req.newEffectorState = AesEffectorState::EsReadyToFire;
|
||||||
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId()
|
DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId
|
||||||
<< ", AesEffectorState: " << req.newEffectorState();
|
<< ", AesEffectorState: " << req.newEffectorState;
|
||||||
|
|
||||||
m_requestHelper->startSingleRequest(
|
m_requestHelper->startSingleRequest(
|
||||||
[req, this]() { return m_ftc->setAesItemEffectorStateRequest(req, this); });
|
[req, this]() { return m_ftc->setAesItemEffectorStateRequest(req, this); });
|
||||||
@@ -227,7 +229,7 @@ void AesItemList::onHandleAdler()
|
|||||||
DEBUG_LOG(m_logger) << "onHandleAdler aesEffectState=" << aesEffectState;
|
DEBUG_LOG(m_logger) << "onHandleAdler aesEffectState=" << aesEffectState;
|
||||||
auto* adlerBtn = m_buttonBox->getButton(ADLER_BTN);
|
auto* adlerBtn = m_buttonBox->getButton(ADLER_BTN);
|
||||||
|
|
||||||
switch (aesEffectState.underlying())
|
switch (aesEffectState)
|
||||||
{
|
{
|
||||||
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
case AreaEffectSimulation::AesEffectState::EsReceived: {
|
||||||
adlerBtn->setText(tr("Mark received"));
|
adlerBtn->setText(tr("Mark received"));
|
||||||
@@ -238,11 +240,11 @@ void AesItemList::onHandleAdler()
|
|||||||
case AreaEffectSimulation::AesEffectState::EsCreated:
|
case AreaEffectSimulation::AesEffectState::EsCreated:
|
||||||
case AreaEffectSimulation::AesEffectState::EsPrepared: {
|
case AreaEffectSimulation::AesEffectState::EsPrepared: {
|
||||||
ProjectDataManagement::EffectSource effectSource = model()->aesEffectSourceId(currentRow());
|
ProjectDataManagement::EffectSource effectSource = model()->aesEffectSourceId(currentRow());
|
||||||
if (effectSource.underlying() == ProjectDataManagement::EffectSource::ES_ADLER ||
|
if (effectSource == ProjectDataManagement::EffectSource::ES_ADLER ||
|
||||||
effectSource.underlying() == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
effectSource == ProjectDataManagement::EffectSource::ES_ADLER_STANDALONE)
|
||||||
{
|
{
|
||||||
const EffectCluster& ecData = m_dtc->effectCluster(model()->aesId(currentRow()));
|
const EffectCluster& ecData = m_dtc->effectCluster(model()->aesId(currentRow()));
|
||||||
if (ecData.effectorState() == AreaEffectSimulation::AesEffectorState::EsNotReadyToFire)
|
if (ecData.effectorState == AreaEffectSimulation::AesEffectorState::EsNotReadyToFire)
|
||||||
{
|
{
|
||||||
adlerBtn->setText(tr("Ready To Fire"));
|
adlerBtn->setText(tr("Ready To Fire"));
|
||||||
adlerBtn->show();
|
adlerBtn->show();
|
||||||
|
|||||||
+1
-1
@@ -33,7 +33,7 @@ QPixmap PixmapLabel::scaledPixmap(const QSize &size, const Qt::AspectRatioMode &
|
|||||||
|
|
||||||
Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
|
Qt::BrushStyle PixmapLabel::checkForBrushStyle(const AesEffectState &state)
|
||||||
{
|
{
|
||||||
switch(state.underlying())
|
switch(state)
|
||||||
{
|
{
|
||||||
case AesEffectState::EsUnknown:
|
case AesEffectState::EsUnknown:
|
||||||
return Qt::BrushStyle::NoBrush;
|
return Qt::BrushStyle::NoBrush;
|
||||||
|
|||||||
+4
-4
@@ -45,15 +45,15 @@ bool CustomViewBorderline::init(const QModelIndex &idx)
|
|||||||
|
|
||||||
bool CustomViewBorderline::calculateIcon(const AreaEffectSimulation::Borderline &line, const QColor &color)
|
bool CustomViewBorderline::calculateIcon(const AreaEffectSimulation::Borderline &line, const QColor &color)
|
||||||
{
|
{
|
||||||
if (line.segments().size() == 0)
|
if (line.segments.size() == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QVector<QPointF> segments;
|
QVector<QPointF> segments;
|
||||||
segments.reserve(line.segments().size());
|
segments.reserve(line.segments.size());
|
||||||
int setZone = -1;
|
int setZone = -1;
|
||||||
for (const Core::GeoPosition2D &s : line.segments())
|
for (const Core::GeoPosition2D &s : line.segments)
|
||||||
{
|
{
|
||||||
const LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(s.lon(), s.lat(), setZone));
|
const LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(s.lon, s.lat, setZone));
|
||||||
if (setZone < 0)
|
if (setZone < 0)
|
||||||
setZone = coord.zone;
|
setZone = coord.zone;
|
||||||
segments.append(QPointF(coord.x, coord.y));
|
segments.append(QPointF(coord.x, coord.y));
|
||||||
|
|||||||
+34
-34
@@ -83,15 +83,15 @@ void BorderlineEdit::enableUiElements(bool enable)
|
|||||||
|
|
||||||
|
|
||||||
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
m_ui->leIdentifier->setEnabled(enable || isOnlyNameModifiable());
|
||||||
if (m_aesItem.effectStateId() == AesEffectState::EsExpired)
|
if (m_aesItem.effectStateId == AesEffectState::EsExpired)
|
||||||
{
|
{
|
||||||
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name()));
|
m_ui->leIdentifier->setText(QString::fromStdString(m_aesItem.name));
|
||||||
__unchange__();
|
__unchange__();
|
||||||
}
|
}
|
||||||
if (m_aesItem.effectStateId() == AesEffectState::EsActivated)
|
if (m_aesItem.effectStateId == AesEffectState::EsActivated)
|
||||||
{
|
{
|
||||||
QString name = m_ui->leIdentifier->text();
|
QString name = m_ui->leIdentifier->text();
|
||||||
auto baseData = m_dtc->borderline(m_aesItem.id());
|
auto baseData = m_dtc->borderline(m_aesItem.id);
|
||||||
setData(baseData, false);
|
setData(baseData, false);
|
||||||
__unchange__();
|
__unchange__();
|
||||||
if (name != m_ui->leIdentifier->text())
|
if (name != m_ui->leIdentifier->text())
|
||||||
@@ -148,26 +148,26 @@ bool BorderlineEdit::init(int aesItemId, bool copy, LtsSession::LtsSession *sess
|
|||||||
|
|
||||||
void BorderlineEdit::setData(const Borderline &borderline, bool copy)
|
void BorderlineEdit::setData(const Borderline &borderline, bool copy)
|
||||||
{
|
{
|
||||||
DEBUG_LOG(m_logger) << LOGFUNCTION << "borderlineId: " << borderline.id()
|
DEBUG_LOG(m_logger) << LOGFUNCTION << "borderlineId: " << borderline.id
|
||||||
<< " operatorId: " << borderline.operatorId();
|
<< " operatorId: " << borderline.operatorId;
|
||||||
|
|
||||||
m_aesItem = borderline;
|
m_aesItem = borderline;
|
||||||
if (copy)
|
if (copy)
|
||||||
{
|
{
|
||||||
m_aesItem.id(0);
|
m_aesItem.id = 0;
|
||||||
m_aesItem.effectStateId(AreaEffectSimulation::AesEffectState::get_default());
|
m_aesItem.effectStateId = AreaEffectSimulation::AesEffectState::EsUnknown;
|
||||||
}
|
}
|
||||||
m_ui->leIdentifier->setText(QString::fromStdString(borderline.name()));
|
m_ui->leIdentifier->setText(QString::fromStdString(borderline.name));
|
||||||
if ( borderline.partyId().is_set())
|
if ( borderline.partyId.has_value())
|
||||||
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(borderline.partyId().get()));
|
m_ui->cbParty->setCurrentIndex(m_ui->cbParty->findData(borderline.partyId.get()));
|
||||||
m_ui->lbBorderlineId->setText(QString::number(borderline.id()));
|
m_ui->lbBorderlineId->setText(QString::number(borderline.id));
|
||||||
|
|
||||||
if (borderline.operatorId() > 0)
|
if (borderline.operatorId > 0)
|
||||||
m_ui->cbLocalBorderline->setChecked(true);
|
m_ui->cbLocalBorderline->setChecked(true);
|
||||||
else
|
else
|
||||||
m_ui->cbLocalBorderline->setChecked(false);
|
m_ui->cbLocalBorderline->setChecked(false);
|
||||||
|
|
||||||
setCoordinates(borderline.segments());
|
setCoordinates(borderline.segments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -226,7 +226,7 @@ bool BorderlineEdit::apply()
|
|||||||
LtsSessionData::LtsSessionData::getInstance()->getOperatorId() :
|
LtsSessionData::LtsSessionData::getInstance()->getOperatorId() :
|
||||||
0);
|
0);
|
||||||
|
|
||||||
const BorderlineModifyRequest req(m_aesItem.id(),
|
const BorderlineModifyRequest req(m_aesItem.id,
|
||||||
operatorId,
|
operatorId,
|
||||||
m_ui->cbParty->currentData().toInt(),
|
m_ui->cbParty->currentData().toInt(),
|
||||||
m_ui->leIdentifier->text().toStdString(),
|
m_ui->leIdentifier->text().toStdString(),
|
||||||
@@ -252,7 +252,7 @@ QByteArray BorderlineEdit::borderlineToJson()
|
|||||||
|
|
||||||
QJsonObject obj;
|
QJsonObject obj;
|
||||||
obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::AESBorderlineEdit);
|
obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::AESBorderlineEdit);
|
||||||
obj[QStringLiteral("id")] = m_aesItem.id();
|
obj[QStringLiteral("id")] = m_aesItem.id;
|
||||||
obj[QStringLiteral("operatorId")] = operatorId;
|
obj[QStringLiteral("operatorId")] = operatorId;
|
||||||
obj[QStringLiteral("cbParty")] = m_ui->cbParty->currentData().toInt();
|
obj[QStringLiteral("cbParty")] = m_ui->cbParty->currentData().toInt();
|
||||||
obj[QStringLiteral("leIdentifier")] = m_ui->leIdentifier->text();
|
obj[QStringLiteral("leIdentifier")] = m_ui->leIdentifier->text();
|
||||||
@@ -262,8 +262,8 @@ QByteArray BorderlineEdit::borderlineToJson()
|
|||||||
for (const Core::GeoPosition2D &segment : segments)
|
for (const Core::GeoPosition2D &segment : segments)
|
||||||
{
|
{
|
||||||
QJsonObject innerSeg;
|
QJsonObject innerSeg;
|
||||||
innerSeg[QStringLiteral("lat")] = segment.lat();
|
innerSeg[QStringLiteral("lat")] = segment.lat;
|
||||||
innerSeg[QStringLiteral("lon")] = segment.lon();
|
innerSeg[QStringLiteral("lon")] = segment.lon;
|
||||||
|
|
||||||
arrSeg += innerSeg;
|
arrSeg += innerSeg;
|
||||||
}
|
}
|
||||||
@@ -280,31 +280,31 @@ Borderline BorderlineEdit::jsonToBorderline(const QByteArray &content)
|
|||||||
const QJsonDocument doc(QJsonDocument::fromJson(content));
|
const QJsonDocument doc(QJsonDocument::fromJson(content));
|
||||||
const QJsonObject obj(doc.object());
|
const QJsonObject obj(doc.object());
|
||||||
|
|
||||||
borderline.chargeStruct().chargeTypeId(obj[QStringLiteral("chargeTypeId")].toInt());
|
borderline.chargeStruct.chargeTypeId = obj[QStringLiteral("chargeTypeId")].toInt();
|
||||||
borderline.effectDuration(obj[QStringLiteral("effectDuration")].toDouble());
|
borderline.effectDuration = obj[QStringLiteral("effectDuration")].toDouble();
|
||||||
borderline.effectMarkingInTa(obj[QStringLiteral("effectMarkingInTa")].toInt());
|
borderline.effectMarkingInTa = obj[QStringLiteral("effectMarkingInTa")].toInt();
|
||||||
borderline.effectStart(obj[QStringLiteral("effectStart")].toDouble());
|
borderline.effectStart = obj[QStringLiteral("effectStart")].toDouble();
|
||||||
int effectStateId = obj[QStringLiteral("effectStateId")].toInt();
|
int effectStateId = obj[QStringLiteral("effectStateId")].toInt();
|
||||||
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
|
borderline.effectStateId = static_cast<AreaEffectSimulation::AesEffectState>(effectStateId);
|
||||||
borderline.operatorId(obj[QStringLiteral("operatorId")].toInt());
|
borderline.operatorId = obj[QStringLiteral("operatorId")].toInt();
|
||||||
borderline.id(0);
|
borderline.id = 0;
|
||||||
borderline.name(obj[QStringLiteral("leIdentifier")].toString().toStdString());
|
borderline.name = obj[QStringLiteral("leIdentifier")].toString().toStdString();
|
||||||
if (obj.contains(QStringLiteral("participantId")) )
|
if (obj.contains(QStringLiteral("participantId")) )
|
||||||
borderline.participantId(obj[QStringLiteral("participantId")].toDouble());
|
borderline.participantId = obj[QStringLiteral("participantId")].toDouble();
|
||||||
if (obj.contains(QStringLiteral("partyId")) )
|
if (obj.contains(QStringLiteral("partyId")) )
|
||||||
borderline.partyId(obj[QStringLiteral("partyId")].toDouble());
|
borderline.partyId = obj[QStringLiteral("partyId")].toDouble();
|
||||||
borderline.sampleTime(obj[QStringLiteral("sampleTime")].toDouble());
|
borderline.sampleTime = obj[QStringLiteral("sampleTime")].toDouble();
|
||||||
|
|
||||||
|
|
||||||
const QJsonArray arrSeg = (obj.value(QStringLiteral("segments")).toArray());
|
const QJsonArray arrSeg = (obj.value(QStringLiteral("segments")).toArray());
|
||||||
borderline.segments().reserve(arrSeg.size());
|
borderline.segments.reserve(arrSeg.size());
|
||||||
for (const auto &ele : arrSeg)
|
for (const auto &ele : arrSeg)
|
||||||
{
|
{
|
||||||
const QJsonObject objSeg(ele.toObject());
|
const QJsonObject objSeg(ele.toObject());
|
||||||
Core::GeoPosition2D segment;
|
Core::GeoPosition2D segment;
|
||||||
segment.lat(objSeg[QStringLiteral("lat")].toDouble());
|
segment.lat = objSeg[QStringLiteral("lat")].toDouble();
|
||||||
segment.lon(objSeg[QStringLiteral("lon")].toDouble());
|
segment.lon = objSeg[QStringLiteral("lon")].toDouble();
|
||||||
borderline.segments().push_back(std::move(segment));
|
borderline.segments.push_back(std::move(segment));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -343,7 +343,7 @@ void BorderlineEdit::onImportButtonClicked()
|
|||||||
{
|
{
|
||||||
Borderline borderline = jsonToBorderline(content);
|
Borderline borderline = jsonToBorderline(content);
|
||||||
setData( borderline, true);
|
setData( borderline, true);
|
||||||
setCoordinates(borderline.segments());
|
setCoordinates(borderline.segments);
|
||||||
QPolygonF coordinates = getCoordinatesQPointF();
|
QPolygonF coordinates = getCoordinatesQPointF();
|
||||||
|
|
||||||
onPolylineData(coordinates);
|
onPolylineData(coordinates);
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_edit.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
|
||||||
#include <AreaEffectSimulation/aes_ftc.h>
|
#include <AreaEffectSimulation/aes_ftc.h>
|
||||||
#include <PluginInterfaces/gui_plugin_interface.h>
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
||||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
|
|
||||||
QString dialogIdentifier() const override
|
QString dialogIdentifier() const override
|
||||||
{
|
{
|
||||||
return m_aesItem.id() <= 0 ? QStringLiteral("AddBorderline") : QStringLiteral("EditBorderline%1").arg(m_aesItem.id());
|
return m_aesItem.id <= 0 ? QStringLiteral("AddBorderline") : QStringLiteral("EditBorderline%1").arg(m_aesItem.id);
|
||||||
}
|
}
|
||||||
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
bool init(int aesItemId, bool copy, LtsSession::LtsSession *session);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_gui_plugin.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
|
||||||
#include "aes_borderline_gui_plugin_interface.h"
|
#include "aes_borderline_gui_plugin_interface.h"
|
||||||
|
|
||||||
namespace AreaEffectSimulation
|
namespace AreaEffectSimulation
|
||||||
|
|||||||
+7
-7
@@ -156,13 +156,13 @@ void BorderlineList::onImportButtonClicked()
|
|||||||
for(const auto &borderline : requests)
|
for(const auto &borderline : requests)
|
||||||
{
|
{
|
||||||
BorderlineModifyRequest request;
|
BorderlineModifyRequest request;
|
||||||
request.id(0);
|
request.id = 0;
|
||||||
request.name(borderline.name());
|
request.name = borderline.name;
|
||||||
request.operatorId(borderline.operatorId());
|
request.operatorId = borderline.operatorId;
|
||||||
if (borderline.partyId().is_set())
|
if (borderline.partyId.has_value())
|
||||||
request.partyId(borderline.partyId().get());
|
request.partyId = borderline.partyId.get();
|
||||||
request.name(borderline.name());
|
request.name = borderline.name;
|
||||||
request.segments(borderline.segments());
|
request.segments = borderline.segments;
|
||||||
m_requestHelper->startSingleRequest([this, request]()
|
m_requestHelper->startSingleRequest([this, request]()
|
||||||
{
|
{
|
||||||
return m_ftc->borderlineModifyRequest(request, this);
|
return m_ftc->borderlineModifyRequest(request, this);
|
||||||
|
|||||||
+2
-2
@@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_itemlist.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
|
||||||
#include "aes_borderlines_model.h"
|
#include "aes_borderlines_model.h"
|
||||||
|
|
||||||
|
|||||||
+35
-35
@@ -59,7 +59,7 @@ QVariant BorderlinesModel::data(const QModelIndex &index, int role) const
|
|||||||
switch (index.column())
|
switch (index.column())
|
||||||
{
|
{
|
||||||
case ColOperatorId:
|
case ColOperatorId:
|
||||||
if (item.operatorId() == 0)
|
if (item.operatorId == 0)
|
||||||
return tr("Global");
|
return tr("Global");
|
||||||
return tr("Local");
|
return tr("Local");
|
||||||
default:
|
default:
|
||||||
@@ -72,8 +72,8 @@ QVariant BorderlinesModel::data(const QModelIndex &index, int role) const
|
|||||||
bool BorderlinesModel::isFiltered(const Borderline &data, DataModification modType) const
|
bool BorderlinesModel::isFiltered(const Borderline &data, DataModification modType) const
|
||||||
{
|
{
|
||||||
|
|
||||||
if ((data.operatorId() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) &&
|
if ((data.operatorId != LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) &&
|
||||||
(data.operatorId() != 0))
|
(data.operatorId != 0))
|
||||||
return true;
|
return true;
|
||||||
return AesGuiBaseModel::isFiltered(data, modType);
|
return AesGuiBaseModel::isFiltered(data, modType);
|
||||||
|
|
||||||
@@ -92,29 +92,29 @@ QByteArray BorderlinesModel::borderlinesToJson()
|
|||||||
QJsonObject inner;
|
QJsonObject inner;
|
||||||
const Borderline &borderline = m_vecData.at(row);
|
const Borderline &borderline = m_vecData.at(row);
|
||||||
|
|
||||||
inner[QStringLiteral("chargeTypeId")] = borderline.chargeStruct().chargeTypeId();
|
inner[QStringLiteral("chargeTypeId")] = borderline.chargeStruct.chargeTypeId;
|
||||||
inner[QStringLiteral("effectDuration")] = borderline.effectDuration();
|
inner[QStringLiteral("effectDuration")] = borderline.effectDuration;
|
||||||
inner[QStringLiteral("effectMarkingInTa")] = borderline.effectMarkingInTa();
|
inner[QStringLiteral("effectMarkingInTa")] = borderline.effectMarkingInTa;
|
||||||
|
|
||||||
inner[QStringLiteral("effectStateId")] = borderline.effectStateId().underlying();
|
inner[QStringLiteral("effectStateId")] = static_cast<int>(borderline.effectStateId);
|
||||||
inner[QStringLiteral("id")] = borderline.id();
|
inner[QStringLiteral("id")] = borderline.id;
|
||||||
inner[QStringLiteral("isDeleted")] = borderline.isDeleted();
|
inner[QStringLiteral("isDeleted")] = borderline.isDeleted;
|
||||||
inner[QStringLiteral("isUsed")] = borderline.isUsed();
|
inner[QStringLiteral("isUsed")] = borderline.isUsed;
|
||||||
inner[QStringLiteral("name")] = QString::fromStdString(borderline.name());
|
inner[QStringLiteral("name")] = QString::fromStdString(borderline.name);
|
||||||
inner[QStringLiteral("operatorId")] = borderline.operatorId();
|
inner[QStringLiteral("operatorId")] = borderline.operatorId;
|
||||||
if ( borderline.participantId().is_set())
|
if ( borderline.participantId.has_value())
|
||||||
inner[QStringLiteral("participantId")] = borderline.participantId().get();
|
inner[QStringLiteral("participantId")] = borderline.participantId.get();
|
||||||
if ( borderline.partyId().is_set())
|
if ( borderline.partyId.has_value())
|
||||||
inner[QStringLiteral("partyId")] = borderline.partyId().get();
|
inner[QStringLiteral("partyId")] = borderline.partyId.get();
|
||||||
inner[QStringLiteral("sampleTime")] = borderline.sampleTime();
|
inner[QStringLiteral("sampleTime")] = static_cast<double>(borderline.sampleTime);
|
||||||
|
|
||||||
arrSeg = {};
|
arrSeg = {};
|
||||||
for (const Core::GeoPosition2D &segment : borderline.segments())
|
for (const Core::GeoPosition2D &segment : borderline.segments)
|
||||||
{
|
{
|
||||||
QJsonObject innerSeg;
|
QJsonObject innerSeg;
|
||||||
|
|
||||||
innerSeg[QStringLiteral("lat")] = segment.lat();
|
innerSeg[QStringLiteral("lat")] = segment.lat;
|
||||||
innerSeg[QStringLiteral("lon")] = segment.lon();
|
innerSeg[QStringLiteral("lon")] = segment.lon;
|
||||||
|
|
||||||
arrSeg += innerSeg;
|
arrSeg += innerSeg;
|
||||||
}
|
}
|
||||||
@@ -139,31 +139,31 @@ QVector<Borderline> BorderlinesModel::jsonToBorderlineVector(const QByteArray &c
|
|||||||
{
|
{
|
||||||
const QJsonObject objArr(ele.toObject());
|
const QJsonObject objArr(ele.toObject());
|
||||||
Borderline borderline;
|
Borderline borderline;
|
||||||
borderline.chargeStruct().chargeTypeId(objArr[QStringLiteral("chargeTypeId")].toInt());
|
borderline.chargeStruct.chargeTypeId = objArr[QStringLiteral("chargeTypeId")].toInt();
|
||||||
borderline.effectDuration(objArr[QStringLiteral("effectDuration")].toDouble());
|
borderline.effectDuration = objArr[QStringLiteral("effectDuration")].toDouble();
|
||||||
borderline.effectMarkingInTa(objArr[QStringLiteral("effectMarkingInTa")].toInt());
|
borderline.effectMarkingInTa = objArr[QStringLiteral("effectMarkingInTa")].toInt();
|
||||||
borderline.effectStart(objArr[QStringLiteral("effectStart")].toDouble());
|
borderline.effectStart = objArr[QStringLiteral("effectStart")].toDouble();
|
||||||
int effectStateId = objArr[QStringLiteral("effectStateId")].toInt();
|
int effectStateId = objArr[QStringLiteral("effectStateId")].toInt();
|
||||||
borderline.effectStateId(static_cast<AreaEffectSimulation::AesEffectState>(effectStateId));
|
borderline.effectStateId = static_cast<AreaEffectSimulation::AesEffectState>(effectStateId);
|
||||||
borderline.operatorId(objArr[QStringLiteral("operatorId")].toInt());
|
borderline.operatorId = objArr[QStringLiteral("operatorId")].toInt();
|
||||||
borderline.id(0);
|
borderline.id = 0;
|
||||||
borderline.name(objArr[QStringLiteral("name")].toString().toStdString());
|
borderline.name = objArr[QStringLiteral("name")].toString().toStdString();
|
||||||
if (objArr.contains(QStringLiteral("participantId")) )
|
if (objArr.contains(QStringLiteral("participantId")) )
|
||||||
borderline.participantId(objArr[QStringLiteral("participantId")].toDouble());
|
borderline.participantId = objArr[QStringLiteral("participantId")].toDouble();
|
||||||
if (objArr.contains(QStringLiteral("partyId")) )
|
if (objArr.contains(QStringLiteral("partyId")) )
|
||||||
borderline.partyId(objArr[QStringLiteral("partyId")].toDouble());
|
borderline.partyId = objArr[QStringLiteral("partyId")].toDouble();
|
||||||
borderline.sampleTime(objArr[QStringLiteral("sampleTime")].toDouble());
|
borderline.sampleTime = objArr[QStringLiteral("sampleTime")].toDouble();
|
||||||
|
|
||||||
|
|
||||||
const QJsonArray arrSeg = (objArr.value(QStringLiteral("segments")).toArray());
|
const QJsonArray arrSeg = (objArr.value(QStringLiteral("segments")).toArray());
|
||||||
borderline.segments().reserve(arrSeg.size());
|
borderline.segments.reserve(arrSeg.size());
|
||||||
for (const auto &seg : arrSeg)
|
for (const auto &seg : arrSeg)
|
||||||
{
|
{
|
||||||
const QJsonObject objSeg(seg.toObject());
|
const QJsonObject objSeg(seg.toObject());
|
||||||
Core::GeoPosition2D segment;
|
Core::GeoPosition2D segment;
|
||||||
segment.lat(objSeg[QStringLiteral("lat")].toDouble());
|
segment.lat = objSeg[QStringLiteral("lat")].toDouble();
|
||||||
segment.lon(objSeg[QStringLiteral("lon")].toDouble());
|
segment.lon = objSeg[QStringLiteral("lon")].toDouble();
|
||||||
borderline.segments().push_back(std::move(segment));
|
borderline.segments.push_back(std::move(segment));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AreaEffectSimulation/Base/aes_base_model.h>
|
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
|
||||||
|
|
||||||
namespace LtsSession
|
namespace LtsSession
|
||||||
{
|
{
|
||||||
|
|||||||
Loaded 100 of 1786 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user