Compare commits

..
Author SHA1 Message Date
torsten 1a38b88229 Adds first successful release run (tbc) 2026-10-12 15:02:02 +00:00
torstenandCopilot 444ac417bf Fix NGL::getLogger() -> N_LogView::getLogger() namespace error
- LogViewTelegramDialog.hpp: Fixed default parameter to use N_LogView::getLogger()
- LogViewTelegram.cpp: Added logger.h include, fixed both constructor initializations
- getLogger() is defined in N_LogView namespace, not NGL namespace

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 20:51:36 +00:00
torstenandCopilot 72a30c1e30 Fix LogView call sites to pass logger parameter
- LogViewTelegramDialog.cpp: Pass m_logger to LogViewTableWidget constructor
- LogViewTelegramDialog.cpp: Pass m_logger to LogViewTabWidget constructor
- LogViewTelegramDialog has default logger parameter, so existing call sites work

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 20:43:06 +00:00
torstenandCopilot 0e22c5b029 Fix LogViewTelegramEdit m_logger and Qt::TextDate for Qt6
- Add m_logger member variable to LogViewTelegramEdit.hpp
- Initialize m_logger in LogViewTelegramEdit constructor
- Replace Qt::SystemLocaleLongDate with Qt::TextDate for Qt6 compatibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 20:32:59 +00:00
torstenandCopilot 167a826cbc Fix Logger type to NGL::INGLLogger& in LogView headers
- LogViewField.hpp: Changed Logger& to NGL::INGLLogger& for m_logger member
- LogViewInjectionThread.hpp: Changed Logger& to NGL::INGLLogger& for m_logger member
- Both headers already include logger.h which defines LOGGER_T as NGL::INGLLogger&

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 20:26:18 +00:00
torstenandCopilot c9411c04e1 Fix Qt6 compatibility issues and exclude tests from release build
- tests/CMakeLists.txt: Wrap migration_tests in RELEASE_BUILD conditional
- LogViewModels.cpp: Change BackgroundColorRole to BackgroundRole for Qt6
- LogViewField.hpp/cpp: Add m_logger member variable
- LogViewInjectionThread.hpp/cpp: Add m_logger member variable
- LogViewGui.hpp/cpp: Add m_logger member variable, fix QString::split() usage
- LogViewTetraTelegramsParser.hpp: Add m_logger, change QStringRef to QStringView
- LogViewTelegramEdit.hpp: Fix QModelIndex include path (QtGui→QtCore)
- LogViewModels.hpp: Fix QAbstractTableModel include path (QtGui→QtCore)
- PrtCnv/CMakeLists.txt: Add CMAKE_CURRENT_BINARY_DIR for export header, exclude LastTest from release
- CoPrtCnv/CMakeLists.txt: Add PrtCnv include paths for prtcnvlib_export.h
- Lts/Common/CodeGen/CMakeLists.txt: Add CMAKE_CURRENT_BINARY_DIR for export header
- Lts/Proxies/TrainingAreaBase/Plugins/CMakeLists.txt: Exclude WlsTetra from release scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 20:19:27 +00:00
torstenandCopilot 1b29039a28 Fix LogView Qt6 compatibility: QStringRef to QStringView migration
- Migrated QStringRef to QStringView in LogViewTetraTelegramsParser
  - Updated tokenize() function signature and implementation
  - Updated bracketCount() helper function
  - Updated validStructTokens() function
  - Updated parseStruct(), parseEnum(), parseConstraint() functions
- Migrated QStringRef to QStringView in LogViewGui.cpp
  - Updated splitRef() to splitView() calls
  - Updated QVector<QStringRef> to QVector<QStringView>
- Migrated QStringRef to QStringView in LogViewXdrParser.cpp
  - Updated midRef() to mid() calls
  - Updated leftRef() to left() calls
- Updated Qt6 include paths: QAbstractTableModel and QModelIndex moved to QtCore

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 19:46:41 +00:00
torstenandCopilot b54fd0caa5 Exclude DebugJsonDir plugin from release scope
- DebugJsonDir includes DDS/Core/function_reply_object.h
- Excluded when RELEASE_BUILD=ON

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 19:13:39 +00:00
torstenandCopilot 3e15fb9281 Exclude DDS-dependent plugins from release scope
- GuiPluginInterface depends on LtsWidgets (DDS dependencies)
- HlaJson plugin includes DDS/Core headers
- UAS plugin has CycloneDDS dependencies
- All excluded from release scope builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 19:08:17 +00:00
torstenandCopilot 5d2b5761a4 Exclude LtsTimeline from release scope (depends on LtsWidgets)
- LtsTimeline depends on LtsWidgets library which has DDS dependencies
- LtsTimeline is not required for TetraIF/Z release scope modules
- Wrap LtsTimeline in release scope exclusion

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 19:02:44 +00:00
torstenandCopilot ac4f2e1aaa Add ProjectDataManagement stub include path for release builds
- TrainingAreaBase's tab_plugin_interface.h includes <ProjectDataManagement/pdm.hpp>
- For release builds (RELEASE_BUILD=ON), add stubs directory to include path
- Stub headers provide type definitions without DDS dependencies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 18:56:39 +00:00
torstenandCopilot e7a062e531 Exclude AdlerJson plugin from release scope build
- AdlerJson depends on svcPdmClient (ProjectDataManagement) which is not in release scope
- Wrap ADD_SUBDIRECTORY(AdlerJson) in IF(NOT RELEASE_BUILD) conditional
- Prevents build failure from missing pdm_enums.hpp header

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 18:45:23 +00:00
torstenandCopilot 3785f2c036 fix: Add missing ENDIF for svcTabServer RELEASE_BUILD block
- svcTabServer library is DDS-dependent and should be excluded in release builds
- Missing ENDIF() caused CMake configuration error at line 177

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 18:38:42 +00:00
torstenandCopilot 1589d8f17d fix: Include Lts/Proxies/TrainingAreaBase in release build for tabTelegrams library
- TrainingAreaBase provides tabTelegrams library needed by TetraIF/CoPrtCnv
- Only TrainingAreaBase subdirectory is included, not other Proxies
- DDS-dependent components (svcTabCommon, svcTabClient, svcTabServer, executable) remain excluded via RELEASE_BUILD conditionals

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 18:37:06 +00:00
torstenandCopilot a7a5782fc8 fix: Add TrainingAreaBase to release scope and fix QScroller for Qt6
- Add Lts/Proxies/TrainingAreaBase to release scope for training_area_telegrams.h
- Update make_rpm_ubuntu26.py to include Lts/Proxies/TrainingAreaBase in release scope
- Add directory filtering for Lts/Proxies in copy_src_dir_to_dest_dir
- Fix lts_base.h: conditionally compile QScroller code (Qt5 only)
- QScroller removed in Qt6, touch scrolling enabled by default

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 18:16:39 +00:00
torstenandCopilot bb58062c6f Wrap TrainingAreaBase DDS components in RELEASE_BUILD conditional
- Wrap svcTabClient library in IF(NOT RELEASE_BUILD)
- Wrap svcTabServer library in IF(NOT RELEASE_BUILD)
- Wrap Topic Type Plugin in IF(NOT RELEASE_BUILD)
- Wrap RecordReplayPlugin in IF(NOT RELEASE_BUILD)
- Wrap svcTrainingAreaBase executable in IF(NOT RELEASE_BUILD)
- Keep tabTelegrams library and tabPluginInterface for release scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 17:53:39 +00:00
torstenandCopilot 6d3a06f90a fix: Exclude LtsUtilsGui from release scope build (depends on LtsWidgets)
- LtsUtilsGui/ConnectDialog links against LtsWidgets which is not in release scope
- Wrap LtsUtilsGui subdirectory in IF(NOT RELEASE_BUILD) conditional
- Only LtsUtilsCore and LtsUtilsSettings are included in release builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 17:41:44 +00:00
torstenandCopilot 62a017cf27 Remove ngl_codegen from RELEASE_GROUP3_TARGETS
- ngl_codegen is a code generation tool only needed during development
- Not required for release scope builds (TetraIF, Z, Lts/Common subset)
- Fixes persistent 'No rule to make target ngl_codegen' error

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 17:36:43 +00:00
torstenandCopilot 78ff6f7df9 Fix: Wrap excluded include directories in RELEASE_BUILD conditional
- Wrap include_directories for Services, DDS, Plugins, and Proxies/GuezNasat
  in IF(NOT RELEASE_BUILD) block to prevent CMake errors when these
  directories don't exist in release scope builds
- Keep include paths for release-scope modules (Lts/Common, LtsUtils,
  LtsUtilsCore, LtsUtilsSettings, NGLLogger, Viewer/SituationMap) outside
  the conditional so they're always available
- This prevents CMake from trying to add non-existent directories when
  building with RELEASE_BUILD=ON

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 16:46:50 +00:00
torstenandCopilot 4ea6ed119c Fix: Remove duplicate RELEASE_BUILD default assignment (was overwriting ON to OFF)
- Line 1327 had RELEASE_BUILD="${RELEASE_BUILD:-OFF}" which overwrote
  the correct default at line 745 (RELEASE_BUILD="${RELEASE_BUILD:-ON}")
- This caused release scope builds to incorrectly build all modules
  instead of just TetraIF, Z, and Lts/Common
- Removed the duplicate assignment to preserve the ON default

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 16:20:21 +00:00
torstenandCopilot 4a3fb0bfe3 Fix: Wrap MacroCodeGenIdl include in RELEASE_BUILD conditional
- Main CMakeLists.txt line 783 includes MacroCodeGenIdl.cmake unconditionally
- This causes ngl_codegen target reference even when CodeGen module is excluded
- Wrap INCLUDE(MacroCodeGenIdl) in IF(NOT RELEASE_BUILD) to skip for release builds
- Prevents 'make: *** No rule to make target ngl_codegen' error in release scope builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 16:08:48 +00:00
torstenandCopilot 0d67b3a8c9 Fix: Conditionally create ngl_codegen imported target only when not RELEASE_BUILD
- Added RELEASE_BUILD check to imported ngl_codegen target creation
- Prevents make errors when CodeGen is excluded from release builds
- Release scope modules don't use CODEGEN macros, so target is not needed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:58:20 +00:00
torstenandCopilot 04899a7160 Fix: Exclude MacroCodeGenIdl.cmake and CODEGEN_WRITE_SERVICEFILE_INFO from release scope build
- CodeGen module is excluded from release scope (S set)
- Release scope modules (TetraIF, Z, Lts/Common subset) do not use CODEGEN macros
- Wrapping include and macro call in RELEASE_BUILD conditional prevents ngl_codegen target reference
- Resolves: make: *** No rule to make target 'ngl_codegen'. Stop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:49:59 +00:00
torstenandCopilot b877bc4af5 Exclude DDS-dependent modules from Lts/Common in release scope
- Wrap all Lts/Common subdirectories in RELEASE_BUILD conditional
- Release build includes only: CommonUnitTestsPlaceholder, httq,
  LtsAppDescriptor, LtsCommandLineParser, LtsCoordTrans, LtsLicence,
  LtsNotification, LtsRestClient, LtsSerialPortQuerry, LtsTimeline,
  LtsUtils, LtsWebSocket, PluginInterfaces, ProjectConfig
- Excluded DDS-dependent modules: CodeGen, LtsAppManager, LtsBotan,
  LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor,
  LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
  LtsScriptTimeline, LtsSession, LtsTimelineClassic,
  LtsVirtualKeyboard, LtsWidgets, TopicEditorBase
- PluginInterfaces already excludes TopicReplayInterface and
  RecordReplayPlugin via BUILD_RTI conditional

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:45:02 +00:00
torstenandCopilot 0e15524181 fix: exclude TopicReplayInterface and RecordReplayPlugin from release scope
- Wrap TopicReplayInterface and RecordReplayPlugin in BUILD_RTI conditional
- These modules require RTI DDS which is not in release scope
- Fixes missing topiceditorbase_export.h error during release builds

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:36:54 +00:00
torstenandCopilot 6177fd00fb Conditionally exclude LtsUtilsGuiDds from release scope build
- LtsUtilsGuiDds requires DDS headers not available in release scope
- Only needed by LtsMultiMonitor which is outside release scope
- Wrap ADD_SUBDIRECTORY in RELEASE_BUILD check

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:20:42 +00:00
torstenandCopilot 6cc19e138d Fix include path for Lts/Common/ProjectConfig headers
- Changed include_directories from ${CMAKE_SOURCE_DIR}/Lts to ${CMAKE_SOURCE_DIR}
- This allows #include <Lts/Common/ProjectConfig/project_defines.h> to resolve correctly
- Required for LtsSession and other modules using ProjectConfig headers

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 15:09:50 +00:00
torstenandCopilot 75f7f52230 Fix GeographicLib find_package by adding CMAKE_MODULE_PATH
- Add /usr/share/cmake/geographiclib to CMAKE_MODULE_PATH
- This allows CMake to find FindGeographicLib.cmake from system package
- Required for DEB build in Docker container

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 14:47:19 +00:00
torstenandCopilot b915bacc62 fix: add LINK_DIRECTORIES for GeographicLib in LtsCoordTrans
- Add LINK_DIRECTORIES() to properly link GeographicLib
- Apply to library, tools, and test targets
- Fixes undefined reference errors during DEB package build

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 14:34:58 +00:00
torstenandCopilot 9992af628a Fix GeographicLib linking - remove invalid TARGET_LINK_DIRECTORIES calls
- TARGET_LINK_DIRECTORIES is not a standard CMake command
- Rely on  full path for linking
- Applied to LtsCoordTrans library, tools, and test executable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 14:28:09 +00:00
torstenandCopilot 1c77f995e2 Fix GeographicLib linking: use TARGET_LINK_LIBRARIES directly and add LINK_DIRECTORIES
- Changed from NGL_TARGET_LINK_LIBRARIES to TARGET_LINK_LIBRARIES for GeographicLib
- Added TARGET_LINK_DIRECTORIES to ensure linker finds the library
- Applied to LtsCoordTrans library, tools, and test executable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 14:21:36 +00:00
TorstenandCopilot 9caa2573ca Fix GeographicLib linking to use variables instead of imported target
- FindGeographicLib.cmake sets GeographicLib_LIBRARIES variable, not imported target
- Changed GeographicLib::GeographicLib_SHARED to ${GeographicLib_LIBRARIES}
- Added TARGET_INCLUDE_DIRECTORIES for GeographicLib_INCLUDE_DIRS

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 14:09:05 +00:00
torstenandCopilot e771c1252f Fix GeographicLib package name
- Use libgeographiclib-dev instead of libgeographic-dev

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 13:41:34 +00:00
torstenandCopilot 980dd26106 Add missing DEB build dependencies
- ninja-build: required by dpkg-buildpackage
- libboost-all-dev: required by dpkg-checkbuilddeps
- libjson-glib-dev: required by dpkg-checkbuilddeps
- libgeographic-dev: required by dpkg-checkbuilddeps

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 13:40:56 +00:00
torstenandCopilot 143b594a59 Add devscripts package for debuild command
- Required for DEB package generation in release pipeline
- debuild command was not found in previous run

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 13:29:07 +00:00
torstenandCopilot 6c8e5d663a Fix MIGRATE_PIPELINE_ROOT path inside container
- Set MIGRATE_PIPELINE_ROOT=/workspace in container script heredoc
- Host path /home/torsten/sandbox/qt6-migration-pipeline maps to /workspace in container
- Fixes jenkins_builder_ubuntu26.sh not found error

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 13:24:38 +00:00
torstenandCopilot 34b9cd10f3 fix: Add missing default variables in container script
- Add RUN_JENKINS_BUILDER and packaging variables to container script defaults
- Prevents unbound variable errors when running Jenkins builder inside container
- Includes all GROUP*_TARGETS variables for build group execution

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-09 13:05:53 +00:00
torsten cf358fe527 Adds new path for release only 2026-10-08 11:30:46 +00:00
torsten 88902aa572 Adds rpm/deb package building option 2026-10-08 10:29:24 +00:00
torstenandCopilot d7f58c558d Fix test_nglpdfwidget build: Poppler-Qt6 packages and QT6_GUI_AVAILABLE detection
- Add libpoppler-dev and libpoppler-qt6-dev to APT_PACKAGES in new_docker_build.sh
- Fix QT6_GUI_AVAILABLE detection logic: check OpenGL_FOUND before setting TRUE
- Add test_nglpdfwidget to RELEASE_GROUP3_TARGETS for explicit build
- Use unique Docker image name: legatus-qt6-prebuilt:latest

Test result: test_nglpdfwidget now builds and passes CTest (0.07 sec)
Release build: 4/7 tests pass (57%), 3 tests excluded as expected

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-08 08:30:45 +00:00
torsten 87fe045bbe Fix CTest error handling in new_docker_build.sh
- Capture CTest exit code in CTEST_RESULT variable
- Allow script to continue after CTest failures
- Log CTest failure information without stopping build
- Enables package verification to run after test execution
2026-10-07 12:17:21 +00:00
torsten 220529c74a Add --verify-rpm option for package verification in release builds
- Added VERIFY_RPM variable with default OFF
- Added --verify-rpm command line option
- Added package verification logic that checks for DEB/RPM packages
- Updated help text and documentation
- Verification runs after CTest in Docker container
- Checks /workspace/rpms for DEB packages and /workspace/build/rpm for RPM
- Reports success if packages found, skipped if no package build step
2026-10-07 12:07:34 +00:00
torsten 6b8f2efabb Constraints scripts to first release packages 2026-10-07 11:52:09 +00:00
torstenandCopilot 95f7d78569 Release build: skip CTest (tests not in release scope)
- Set RUN_CTEST=OFF when RELEASE_BUILD=ON
- Tests require executables from groups not in release scope
- Update documentation to reflect automatic CTest disable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 09:49:01 +00:00
torstenandCopilot c7d1c250dd Fix GROUP11 for release build: disable Lts/Application (not in release scope)
- Changed BUILD_GROUP11 default from ON to OFF for release builds
- GROUP11 builds Lts/Application (OperatorApplication, aarApp) which is outside release scope M = {TetraIF, Z, Lts/Common}
- Lts/Common is built automatically as dependency of GROUP3 targets
- Updated documentation comments to reflect correct group assignments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 09:41:06 +00:00
torstenandCopilot 8436f113e3 Fix GROUP5 for release build: Viewer not in release scope
- Change BUILD_GROUP5 default from ON to OFF for release builds
- GROUP5 contains Viewer modules (situationMapCommon, etc.) which are
  NOT in the release scope M = {TetraIF, Z, Lts/Common}
- Z components are in GROUP3, which uses RELEASE_GROUP3_TARGETS
- Update documentation to reflect correct group assignments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 09:34:28 +00:00
torstenandCopilot f345ebc16f Fix: Use release-specific GROUP3 targets for RELEASE_BUILD
- Add RELEASE_GROUP3_TARGETS array with Z components only (no svc* targets)
- Use RELEASE_GROUP3_TARGETS when RELEASE_BUILD=ON to exclude Lts/Services
- This fixes build failure on svcPdmCommon which is outside release scope

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 09:27:15 +00:00
torstenandCopilot ce154f6a1d Configure release build for first Qt6 release (TetraIF, Z, Lts/Common)
- Add RELEASE_BUILD CMake option to control release scope
- Modify main CMakeLists.txt to conditionally build only release modules
- Modify Lts/CMakeLists.txt to only include Lts/Common when RELEASE_BUILD=ON
- Modify Lts/Common/CMakeLists.txt to exclude LtsElevation (depends on Lts/Viewer/SituationMap)
- Update new_docker_build.sh defaults for release:
  - RELEASE_BUILD=ON (default)
  - BUILD_RTI=OFF (avoids Lts/Services/GROUP1 dependency)
  - BUILD_GROUP3=ON (TetraIF), BUILD_GROUP5=ON (Z), BUILD_GROUP11=ON (Lts/Common)
  - All other BUILD_GROUP* variables OFF
- Add RELEASE_BUILD to Docker environment exports and CMake invocation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-07 09:02:30 +00:00
1930 changed files with 19996 additions and 154057 deletions

No files matched your search

-18
View File
@@ -9,21 +9,3 @@ fix_qt6_gui_deps.py
fix_rti_conditionals.py
fix_target_checks.py
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
+4 -26
View File
@@ -27,11 +27,9 @@ RUN apt-get update && \
libpq-dev \
libbz2-dev \
libboost-all-dev \
libglib2.0-dev \
libxml2-dev \
libssl-dev \
libcurl4-openssl-dev \
libkf6texttemplate-dev && \
libcurl4-openssl-dev && \
rm -rf /var/lib/apt/lists/*
# Install Qt 6.10.2 via aqtinstall
@@ -54,7 +52,6 @@ RUN git clone --depth 1 https://github.com/MEONMedical/Log4Qt.git /tmp/log4qt &&
-DBUILD_SHARED_LIBS=ON .. && \
cmake --build . -- -j$(nproc) && \
cmake --install . && \
sed -i 's/return (mThreshold <= level);/return (mThreshold.load() <= level);/' /usr/local/include/log4qt/appenderskeleton.h && \
rm -rf /tmp/log4qt
# Create minimal CMake config for Log4Qt
@@ -84,27 +81,8 @@ ENV QT_QPA_PLATFORM=offscreen
# Configure git for containerized environments
RUN git config --global --add safe.directory "*"
# Configure internal SCM repository for external dependencies
RUN echo "deb [trusted=yes] http://remote-repo.sl.defence-elec.de:8081/repository/external-rpms/general/ ./" > /etc/apt/sources.list.d/scm-external.list
# Install external dependencies from DEB packages
RUN apt-get update && apt-get install -y --no-install-recommends \
libavs-dev \
libarcgis-dev \
libbuildingmodels-dev \
libgeographiclib-dev \
libschusstafel-dev \
libdtentity-dev \
librti-connext-dds-7.7.0-dev \
libtmsif-dev \
&& rm -rf /var/lib/apt/lists/*
# Setup RTI Connext license (included in DEB package)
ENV RTI_LICENSE_FILE=/opt/rti_connext_dds-7.7.0/rti_license.dat
ENV RTI_CONNEXT_HOME=/opt/rti_connext_dds-7.7.0
ENV NDDSHOME=/opt/rti_connext_dds-7.7.0
ENV PATH=/opt/rti_connext_dds-7.7.0/bin:$PATH
ENV LD_LIBRARY_PATH=/opt/rti_connext_dds-7.7.0/lib/x64Linux4gcc7.3.0:$LD_LIBRARY_PATH
ENV CMAKE_PREFIX_PATH=/opt/rti_connext_dds-7.7.0/lib/cmake:$CMAKE_PREFIX_PATH
# Setup RTI Connext license (developer license file)
COPY rti_license.dat /root/rti_license.dat
ENV RTI_LICENSE_FILE=/root/rti_license.dat
WORKDIR /workspace
+1 -2
View File
@@ -1,4 +1,3 @@
# 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/torsten/sandbox/qt6-migration-pipeline"
export LANG=C.UTF-8
export LC_ALL=C.UTF-8
+62 -178
View File
@@ -18,10 +18,6 @@ ENDIF()
IF(POLICY CMP0072)
CMAKE_POLICY(SET CMP0072 NEW) # cmake >= 3.11.0 - prefer libOpenGL.so over legacy libGL.so
ENDIF()
# Set policy CMP0111 unconditionally - imported targets require location property
IF(POLICY CMP0111)
CMAKE_POLICY(SET CMP0111 NEW)
ENDIF()
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
@@ -44,11 +40,6 @@ MESSAGE(STATUS "LTS Version: ${LTS_VERSION_MAJOR}.${LTS_VERSION_MINOR}.${LTS_VER
# Enable CTest integration for unit tests
include(CTest)
# Set RPATH to find libraries in build directory
SET(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/lib")
SET(CMAKE_INSTALL_RPATH "${CMAKE_BINARY_DIR}/lib")
SET(CMAKE_BUILD_RPATH_USE_ORIGIN ON)
function(NGL_ADD_SUBDIR_GUARDED subdir)
if(MIGRATE_MODULE STREQUAL "")
add_subdirectory(${subdir})
@@ -89,11 +80,8 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON)
# otherwise and opens namespace DDSGeneric around framework includes, which
# pulls Qt/std definitions into that namespace and breaks every consumer.
# (The qt5 legacy has no include/ tree; Lts/ is the real include root.)
include_directories(BEFORE ${CMAKE_SOURCE_DIR}/Lts)
include_directories(BEFORE ${CMAKE_SOURCE_DIR})
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_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/Z/src)
@@ -101,28 +89,12 @@ 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}/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/Proxies/TrainingAreaBase)
# Release scope: exclude Services, DDS, and Plugins include paths
IF(NOT RELEASE_BUILD)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/ProjectDataManagement)
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_BINARY_DIR}/Lts/Services/InfrastructureManagement)
include_directories(${CMAKE_SOURCE_DIR}/include/InfrastructureManagement)
@@ -150,9 +122,6 @@ include_directories(${CMAKE_SOURCE_DIR}/include/SituationReplay)
# is added (same shape as FileManagement above, which has no stub tree either).
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Evaluations)
include_directories(${CMAKE_SOURCE_DIR}/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/QosProfile)
# Generated DDS headers (BUILD_RTI=ON)
@@ -161,6 +130,16 @@ include_directories(${CMAKE_BINARY_DIR}/Lts)
# rtiddsgen-generated core.hpp from the DDS build dir (the qt5 include order);
# the OFF-era stub copies in include/Core/ have been removed.
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS)
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS/DDSConnector)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Messaging)
include_directories(${CMAKE_SOURCE_DIR}/include/OperatorManagement)
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/OperatorManagement)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Plugins)
ENDIF()
# Release scope: include path for ProjectDataManagement stub headers
IF(RELEASE_BUILD)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Services/ProjectDataManagement/stubs)
ENDIF()
include_directories(${CMAKE_SOURCE_DIR}/Lts/Common)
include_directories(${CMAKE_SOURCE_DIR}/Lts/Common/LtsUtils)
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
@@ -170,33 +149,8 @@ include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore)
# directory holding the generated header has to be visible tree-wide. The directory contains
# only that generated header, so appending it cannot shadow an existing include.
include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsSettings)
# 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
# dds_connector.h and pub_sub_base.h, and reaches targets (the AES ModuleTests) that include
# DDSConnector headers without linking ddsconnector. Same shape as LtsUtilsSettings above: the
# directory holds only the generated header.
include_directories(${CMAKE_BINARY_DIR}/Lts/DDS/DDSConnector)
# The generated msg_db_structs.h includes <msg_enums.hpp> by bare name, and Messaging is
# reached transitively from OcBaseDownload and the proxy handlers, so its build dir must be
# visible tree-wide like the services above. Unlike them there is no include/Messaging stub
# tree, so only the build dir is added.
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/Messaging)
include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger)
include_directories(${CMAKE_SOURCE_DIR}/include/Viewer/SituationMap)
include_directories(${CMAKE_SOURCE_DIR}/include/OperatorManagement)
# The generated opm_db_structs.h includes <opm_enums.hpp> by bare name and is reached
# transitively from OcBaseDownload, so the OperatorManagement build dir has to be visible
# tree-wide next to its include/ stub tree above.
include_directories(${CMAKE_BINARY_DIR}/Lts/Services/OperatorManagement)
# The plugin interface headers live under Lts/Plugins/<Svc>/ and are included both as
# <Plugins/<Svc>/x.h> (the qt5 spelling, resolved through the Lts/ root) and, since the
# migration dropped the leading segment, as <Svc>/x.h>. Lts/Plugins is therefore needed on
# the path. It is appended last so it can only ever resolve includes that were unresolvable
# before: every include that resolves today is found in an earlier directory, so no existing
# resolution can change.
include_directories(${CMAKE_SOURCE_DIR}/Lts/Plugins)
SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
SET(CMAKE_VISIBILITY_INLINES_HIDDEN ON)
@@ -228,12 +182,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Lts)
IF(BUILD_RTI)
# Define BUILD_RTI as preprocessor macro for all targets
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()
OPTION(BUILD_ARCGIS "Build ArcGIS SDK dependent modules" ON)
OPTION(BUILD_FILTERMANAGEMENT "Build FilterManagement plugins (temporarily disabled for migration)" OFF)
@@ -242,7 +190,8 @@ OPTION(BUILD_GRANTLEE "Build CodeGen SQL files using KTextTemplate parser (KF6::
# If BUILD_GRANTLEE is OFF but ngl_codegen is needed (for IDL codegen),
# provide it as an imported executable target from pre-built location
IF(NOT BUILD_GRANTLEE)
# Skip this for RELEASE_BUILD since CodeGen is excluded and ngl_codegen is not needed
IF(NOT BUILD_GRANTLEE AND NOT RELEASE_BUILD)
# ngl_codegen is copied to build/bin/ by run_final_migration.sh
# Create an imported target so MacroCodeGenIdl.cmake can find it
IF(NOT TARGET ngl_codegen)
@@ -263,28 +212,17 @@ IF(WIN32)
ELSE()
# Linux: ArcGIS SDK Pfad konfigurieren (nur wenn BUILD_ARCGIS=ON)
IF(BUILD_ARCGIS)
# Use environment variable ARCGIS_ROOT if set, otherwise check relative to source dir, then Docker/host paths
# Use environment variable ARCGIS_ROOT if set, otherwise default to /workspace/external/... (Docker) or host path
IF(DEFINED ENV{ARCGIS_ROOT})
SET(ARCGIS_SDK_DIR "$ENV{ARCGIS_ROOT}" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk")
SET(ARCGIS_SDK_DIR "${CMAKE_SOURCE_DIR}/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSEIF(DEFINED ENV{DOCKER_MOUNT_ROOT})
SET(ARCGIS_SDK_DIR "$ENV{DOCKER_MOUNT_ROOT}/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSEIF(EXISTS "/repo/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk")
SET(ARCGIS_SDK_DIR "/repo/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSEIF(EXISTS "/workspace/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk")
SET(ARCGIS_SDK_DIR "/workspace/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ELSE()
SET(ARCGIS_SDK_DIR "" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
SET(ARCGIS_SDK_DIR "/repo/external/ArcGIS/MapsSDK_Qt_300.0.0/ArcGIS_Maps_SDK_Qt_300.0.0/qt300.0.0/sdk" CACHE STRING "ArcGIS Runtime SDK for Qt directory")
ENDIF()
IF(EXISTS "${ARCGIS_SDK_DIR}")
LIST(APPEND CMAKE_PREFIX_PATH "${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()
MESSAGE(WARNING "ArcGIS SDK not found at: ${ARCGIS_SDK_DIR}")
ENDIF()
@@ -295,6 +233,12 @@ ENDIF()
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
INCLUDE(FindLibraryWithDebug)
# Find ArcGIS SDK globally if BUILD_ARCGIS is enabled
# This creates ArcGIS::ArcGIS target for all modules to use
IF(BUILD_ARCGIS)
FIND_PACKAGE(ArcGIS REQUIRED)
ENDIF()
ENABLE_TESTING()
INCLUDE(CTest)
CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY)
@@ -344,17 +288,23 @@ endif()
# server uses QWebSocketServer; LtsWebSocket/httq enable their real websocket
# paths via QT6_WEBSOCKETS_AVAILABLE when the module is found).
find_package(Qt6 6.2 COMPONENTS Concurrent Core LinguistTools Network
Multimedia Sql SerialPort Test Xml Positioning Svg WebSockets PrintSupport OpenGL OpenGLWidgets QUIET)
Multimedia Sql SerialPort Test Xml Positioning Svg WebSockets PrintSupport OpenGL QUIET)
if(Qt6_FOUND)
# Skip GUI find_package - it fails without OpenGL. We'll create manual targets below.
set(QT6_GUI_AVAILABLE FALSE)
message(STATUS "Found Qt6 (GUI will be manually configured): ${Qt6Core_VERSION}")
# Check if OpenGL was found (GUI support available)
if(OpenGL_FOUND)
set(QT6_GUI_AVAILABLE TRUE)
message(STATUS "Found Qt6 with GUI support (OpenGL): ${Qt6Core_VERSION}")
else()
# Skip GUI find_package - it fails without OpenGL. We'll create manual targets below.
set(QT6_GUI_AVAILABLE FALSE)
message(STATUS "Found Qt6 (GUI will be manually configured): ${Qt6Core_VERSION}")
endif()
endif()
# If Qt6 not found yet, try with full component list including OpenGL
if(NOT Qt6_FOUND)
find_package(Qt6 6.2 COMPONENTS Concurrent Core LinguistTools Network OpenGL OpenGLWidgets PrintSupport
find_package(Qt6 6.2 COMPONENTS Concurrent Core LinguistTools Network OpenGL PrintSupport
Multimedia Sql Svg SerialPort Test UiTools WebSockets WebEngineCore WebEngineWidgets
Widgets Xml Positioning QUIET)
if(Qt6_FOUND AND OpenGL_FOUND)
@@ -374,14 +324,6 @@ if(NOT TARGET Qt6::Core)
find_package(Qt6 6.2 COMPONENTS Core REQUIRED)
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
# Use Qt6 installation path from find_package or fall back to system paths
if(Qt6Core_DIR)
@@ -452,30 +394,6 @@ if(EXISTS "${QT6_LIB_DIR}/libQt6Widgets.so.6")
message(STATUS "Manually configured Qt6 Widgets target")
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
if(NOT TARGET Qt6::Sql AND EXISTS "${QT6_LIB_DIR}/libQt6Sql.so.6")
add_library(Qt6::Sql SHARED IMPORTED)
@@ -581,30 +499,6 @@ if(NOT TARGET Qt6::SerialPort)
message(STATUS "Created stub target for Qt6::SerialPort (library not available)")
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)
if(NOT TARGET Qt6::WebEngineCore)
add_library(Qt6::WebEngineCore INTERFACE IMPORTED)
@@ -724,12 +618,6 @@ endif()
MESSAGE(STATUS "Qt version is ${Qt6Core_VERSION}, GUI available: ${QT6_GUI_AVAILABLE}")
# Find ArcGIS SDK after Qt6 is configured
# This creates ArcGIS::ArcGIS target for all modules to use
IF(BUILD_ARCGIS)
FIND_PACKAGE(ArcGIS REQUIRED)
ENDIF()
#
# RTI Connext DDS - manuelle Konfiguration da keine CMake Config Files vorhanden
#
@@ -737,15 +625,10 @@ IF(BUILD_RTI)
# Support environment variable override, otherwise use relative path from repo root
IF(DEFINED ENV{DDS_PATH})
SET(RTI_INSTALL_DIR "$ENV{DDS_PATH}" CACHE PATH "RTI Connext DDS installation directory")
ELSEIF(DEFINED ENV{DOCKER_MOUNT_ROOT})
# Use DOCKER_MOUNT_ROOT environment variable if set (supports both /repo and /workspace)
SET(RTI_INSTALL_DIR "$ENV{DOCKER_MOUNT_ROOT}/external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
ELSE()
# In Docker container: /repo/external/rti_connext_dds-7.7.0 (current) or /workspace/external/rti_connext_dds-7.7.0 (old)
# In Docker container: /workspace/external/rti_connext_dds-7.7.0
# On host: ${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0
IF(EXISTS "/repo/external/rti_connext_dds-7.7.0")
SET(RTI_INSTALL_DIR "/repo/external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
ELSEIF(EXISTS "/workspace/external/rti_connext_dds-7.7.0")
IF(EXISTS "/workspace/external/rti_connext_dds-7.7.0")
SET(RTI_INSTALL_DIR "/workspace/external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
ELSEIF(EXISTS "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0")
SET(RTI_INSTALL_DIR "${CMAKE_SOURCE_DIR}/../../../external/rti_connext_dds-7.7.0" CACHE PATH "RTI Connext DDS installation directory")
@@ -800,26 +683,6 @@ IF(BUILD_RTI)
# reach the AutogenInfo MOC_INCLUDES.
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
# Debug und Release Varianten korrekt konfigurieren
FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers)
@@ -907,7 +770,10 @@ ENDIF()
# Ein paar NGL-spezifische Macros
#
INCLUDE(NGLMacros)
INCLUDE(MacroCodeGenIdl)
# Skip MacroCodeGenIdl for release builds as CodeGen module is excluded
IF(NOT RELEASE_BUILD)
INCLUDE(MacroCodeGenIdl)
ENDIF()
#
# Projektspezifische Einstellungen?
@@ -1100,11 +966,29 @@ if(NOT DEFINED MIGRATE_MODULE)
set(MIGRATE_MODULE "" CACHE STRING "If set, only add subdirectories covering this module (path relative to repo root)")
endif()
# RELEASE_BUILD: when ON, only build the first release modules (TetraIF, Z, Lts/Common)
# This excludes Lts/Services, Lts/DDS, Lts/Tools, Lts/Application, Lts/Proxies, Lts/Plugins, Lts/Viewer, Lts/Projects
if(NOT DEFINED RELEASE_BUILD)
set(RELEASE_BUILD OFF CACHE BOOL "Build only the first release modules (TetraIF, Z, Lts/Common)")
endif()
# For release builds, disable ArcGIS (not in release scope, requires Qt6Location which is not available)
if(RELEASE_BUILD)
set(BUILD_ARCGIS OFF CACHE BOOL "Build ArcGIS SDK dependent modules" FORCE)
endif()
# Add only guarded subdirectories
NGL_ADD_SUBDIR_GUARDED(TetraIF)
NGL_ADD_SUBDIR_GUARDED(Z/src)
# Services are included before plugins via Lts/CMakeLists.txt (LTS_SUBDIRS order)
NGL_ADD_SUBDIR_GUARDED(Lts)
if(RELEASE_BUILD)
message(STATUS "RELEASE_BUILD=ON: Building only TetraIF, Z/src, and Lts/Common")
NGL_ADD_SUBDIR_GUARDED(TetraIF)
NGL_ADD_SUBDIR_GUARDED(Z/src)
NGL_ADD_SUBDIR_GUARDED(Lts)
else()
NGL_ADD_SUBDIR_GUARDED(TetraIF)
NGL_ADD_SUBDIR_GUARDED(Z/src)
# Services are included before plugins via Lts/CMakeLists.txt (LTS_SUBDIRS order)
NGL_ADD_SUBDIR_GUARDED(Lts)
endif()
# Add migration tests - skip when MIGRATE_MODULE targets specific Lts modules (tests need full codebase)
# MUST be after Lts configuration so tests can access Lts targets (LtsTimelineClassic, codegen_base, etc.)
@@ -256,8 +256,7 @@ cd build4 && ctest --output-on-failure
### Path Configuration
- **Working Directory:** `/home/torsten/sandbox/qt6-migration-pipeline`
- **Docker Mount Root:** `/repo` (configurable via `--docker-mount-root` or `DOCKER_MOUNT_ROOT` env var)
- **Docker Container Path:** `${DOCKER_MOUNT_ROOT}/qt-migration-legatus/qt6-after/qt6-migrated-legatus`
- **Docker Container Path:** `/workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus`
- **Test Executables:** `build4/bin/<Configuration>/`
---
@@ -36,6 +36,7 @@
#include <QInputDialog>
#include <QNetworkProxy>
#include <QtCore/QTimer>
#include <QRandomGenerator>
#include <QInputDevice>
#include <algorithm>
@@ -174,10 +175,7 @@ public:
// ------------------------------------------------------------------
int main(int argc, char **argv) // TODO: json strings to lower
{
// (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.
QRandomGenerator::global()->seed(time(nullptr));
QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
@@ -192,7 +190,7 @@ int main(int argc, char **argv) // TODO: json strings to lower
NGLApplication app(argc, argv);
app.createLogger("opApp");
QApplication::setQuitOnLastWindowClosed(false); // we are cool enough to handle it ourselves 8)
// Qt::AA_UseHighDpiPixmaps: no-op since Qt6 (high-DPI pixmaps are always enabled)
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
QNetworkProxy::setApplicationProxy(QNetworkProxy()); // do NOT use proxies anywhere!
NGL::LoggerHandler *lh = NGL::LoggerHandler::getLoggerHandler();
@@ -23,7 +23,7 @@ int main(int argc, char **argv)
QNetworkProxy::setApplicationProxy(QNetworkProxy());
NGLApplication app(argc, argv);
app.createLogger("SRP");
// Qt::AA_UseHighDpiPixmaps: no-op since Qt6 (high-DPI pixmaps are always enabled)
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
SituationReplay::ConnectionParams connParams;
connParams.domainId = 1;
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
app.createLogger("THP", "log4cxx_thp_viewer.props");
app.setOrganizationName(QStringLiteral("RME"));
app.setApplicationName(QStringLiteral("thp_viewer"));
// Qt::AA_UseHighDpiPixmaps: no-op since Qt6 (high-DPI pixmaps are always enabled)
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
QDir::setSearchPaths(QLatin1String("icon"), QStringList(QLatin1String(":/style/")));
Q_INIT_RESOURCE(rme_light_style);
@@ -258,7 +258,7 @@ void ThpViewer::onLinkClicked(const QUrl &url)
const QString path = url.path();
const QString lpath = path.toLower();
// Use QStringView for efficient string operations
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split provides zero-copy access
const QStringView ext = QStringView{lpath}.split(QLatin1Char('.')).last();
const QStringView ext2Chars = ext.left(2);
@@ -9,7 +9,7 @@
#include "thp_building_settings.h"
#include "ui_thp_building_settings.h"
#include <BuildingViewer/Common/bdv_controller.h>
#include <Common/bdv_controller.h>
#include <LtsUtilsSettings/settings.h>
@@ -32,6 +32,7 @@ public:
bool needsToBeOpenedExternally(const QUrl &url)
{
const QString lpath = url.toString();
// Qt6: QStringRef/QString::splitRef and QString::midRef were removed; use QStringView
const QStringView ext = QStringView{lpath}.split(QLatin1Char('.')).last();
const QStringView ext2Chars = ext.left(2);
if (ext == QLatin1String("html") &&
@@ -16,18 +16,33 @@ else()
endif()
# Add only existing subdirectories to allow partial checkouts / incremental migration
# Release 2 scope: Tools, DDS, Common, Services (minimal), Proxies (TrainingAreaBase only), Plugins (Styles only for LtsWidgets dependency)
# Excluded: Application, Viewer, Projects, most Plugins (not in Release 2)
set(LTS_SUBDIRS Tools DDS Common Services Proxies Plugins)
foreach(dir IN LISTS LTS_SUBDIRS)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}")
# Use guarded add so top-level MIGRATE_MODULE can restrict which Lts subdirs are included
NGL_ADD_SUBDIR_GUARDED(${dir})
if(RELEASE_BUILD)
# For first release: only build Lts/Common and Lts/Proxies/TrainingAreaBase (tabTelegrams library)
# Excludes: Tools, Application, DDS, Services, most of Proxies, Plugins, Viewer, Projects
message(STATUS "RELEASE_BUILD=ON: Building Lts/Common and Lts/Proxies/TrainingAreaBase")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Common")
NGL_ADD_SUBDIR_GUARDED(Common)
else()
message(STATUS "Skipping missing Lts subdirectory: Common")
endif()
# TrainingAreaBase provides tabTelegrams library needed by TetraIF/CoPrtCnv
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Proxies/TrainingAreaBase")
NGL_ADD_SUBDIR_GUARDED(Proxies/TrainingAreaBase)
else()
message(STATUS "Skipping missing Lts subdirectory: Proxies/TrainingAreaBase")
endif()
else()
message(STATUS "Skipping missing Lts subdirectory: ${dir}")
endif()
set(LTS_SUBDIRS Tools Application DDS Common Services Proxies Plugins Viewer Projects)
foreach(dir IN LISTS LTS_SUBDIRS)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${dir}")
# Use guarded add so top-level MIGRATE_MODULE can restrict which Lts subdirs are included
NGL_ADD_SUBDIR_GUARDED(${dir})
else()
message(STATUS "Skipping missing Lts subdirectory: ${dir}")
endif()
endforeach()
endforeach()
endif()
IF (BUILD_TESTING)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Tests")
@@ -43,7 +58,10 @@ IF (BUILD_DOCS)
ENDIF()
# Ensure codegen macros are available before calling CODEGEN_* helpers
INCLUDE(MacroCodeGenIdl)
# Skip for release builds as CodeGen module is excluded and not needed
IF(NOT RELEASE_BUILD)
INCLUDE(MacroCodeGenIdl)
ENDIF()
# Add stub headers for non-RTI/non-FilterManagement builds
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/AudioVideoManagement/)
@@ -55,4 +73,6 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsScriptTimeline/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/LtsUtilsGuiDds/)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../include/Services/PresentationManagement/)
CODEGEN_WRITE_SERVICEFILE_INFO()
IF(NOT RELEASE_BUILD)
CODEGEN_WRITE_SERVICEFILE_INFO()
ENDIF()
@@ -4,20 +4,59 @@
# $Author$
#
# Release 2 Common modules (S set: 15 modules)
ADD_SUBDIRECTORY(CodeGen)
ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsPluginManager)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(LtsWidgets)
ADD_SUBDIRECTORY(ProjectConfig)
ADD_SUBDIRECTORY(TopicEditorBase)
# Excluded from Release 2: LtsAppManager, LtsCoordinate, LtsElevation, LtsLogin, LtsMultiMonitor, LtsPrinting, LtsProjectionWorkstation, LtsScriptTimeline, LtsTimeline, LtsVirtualKeyboard, PluginInterfaces
# RELEASE_BUILD: exclude modules with DDS/RTI dependencies not needed for TetraIF/Z
# DDS-dependent modules: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation,
# LtsLogin, LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
# LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets,
# PluginInterfaces (TopicReplayInterface, RecordReplayPlugin), TopicEditorBase
if(RELEASE_BUILD)
# Core modules needed for TetraIF and Z
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
# Excluded: LtsTimeline (depends on LtsWidgets which has DDS dependencies)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(PluginInterfaces)
ADD_SUBDIRECTORY(ProjectConfig)
# Excluded: CodeGen, LtsAppManager, LtsBotan, LtsCoordinate, LtsElevation, LtsLogin,
# LtsMultiMonitor, LtsPluginManager, LtsPrinting, LtsProjectionWorkstation,
# LtsScriptTimeline, LtsSession, LtsTimelineClassic, LtsVirtualKeyboard, LtsWidgets,
# TopicEditorBase
else()
ADD_SUBDIRECTORY(CodeGen)
ADD_SUBDIRECTORY(CommonUnitTestsPlaceholder)
ADD_SUBDIRECTORY(httq)
ADD_SUBDIRECTORY(LtsAppDescriptor)
ADD_SUBDIRECTORY(LtsAppManager)
ADD_SUBDIRECTORY(LtsCommandLineParser)
ADD_SUBDIRECTORY(LtsCoordinate)
ADD_SUBDIRECTORY(LtsCoordTrans)
ADD_SUBDIRECTORY(LtsElevation)
ADD_SUBDIRECTORY(LtsLicence)
ADD_SUBDIRECTORY(LtsLogin)
ADD_SUBDIRECTORY(LtsMultiMonitor)
ADD_SUBDIRECTORY(LtsNotification)
ADD_SUBDIRECTORY(LtsPluginManager)
ADD_SUBDIRECTORY(LtsPrinting)
ADD_SUBDIRECTORY(LtsProjectionWorkstation)
ADD_SUBDIRECTORY(LtsRestClient)
ADD_SUBDIRECTORY(LtsScriptTimeline)
ADD_SUBDIRECTORY(LtsSerialPortQuerry)
ADD_SUBDIRECTORY(LtsSession)
ADD_SUBDIRECTORY(LtsTimeline)
ADD_SUBDIRECTORY(LtsUtils)
ADD_SUBDIRECTORY(LtsVirtualKeyboard)
ADD_SUBDIRECTORY(LtsWebSocket)
ADD_SUBDIRECTORY(LtsWidgets)
ADD_SUBDIRECTORY(PluginInterfaces)
ADD_SUBDIRECTORY(ProjectConfig)
ADD_SUBDIRECTORY(TopicEditorBase)
endif()
@@ -39,6 +39,7 @@ NGL_TARGET_LINK_LIBRARIES(codegen_base
NGL_TARGET_INCLUDE_DIRECTORIES(codegen_base
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}
)
# If RTI target is available, propagate its include dirs/compile defs
if (TARGET RTI::nddscpp2)
@@ -69,7 +69,7 @@ QString MemberInformationWrapper::ddsToJsonElement() const
return QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
QStringLiteral("element.") + memberAccess + cppToJsonPost();
const QString optionalAccess = cppMemberName() + QStringLiteral(".has_value()");
const QString optionalAccess = cppMemberName() + QStringLiteral(".is_set()");
const QString getValue = cppMemberName();
return QStringLiteral("if (element.") + optionalAccess + QStringLiteral(") ") +
QStringLiteral("obj[QStringLiteral(\"") + cppMemberName() + QStringLiteral("\")] = ") + cppToJsonPre() +
@@ -13,6 +13,8 @@ else()
endif()
# Add system GeographicLib Find module path
list(APPEND CMAKE_MODULE_PATH /usr/share/cmake/geographiclib)
FIND_PACKAGE(GeographicLib)
NGL_ADD_LIBRARY2(LtsCoordTrans WS AAR SV HLA SHARED
lts_coord_trans.h
@@ -23,9 +25,11 @@ NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans
Qt6::Core
)
if (GeographicLib_FOUND)
NGL_TARGET_LINK_LIBRARIES(LtsCoordTrans
PRIVATE GeographicLib::GeographicLib_SHARED
TARGET_LINK_LIBRARIES(LtsCoordTrans
PRIVATE ${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(LtsCoordTrans PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
else()
message(STATUS "GeographicLib not found; building LtsCoordTrans without it")
endif()
@@ -66,10 +70,12 @@ IF(TARGET LtsCoordTrans)
SET(_tools lonlat2mgrs mgrs2lonlat)
FOREACH(_tool ${_tools})
NGL_ADD_EXECUTABLE(ALL ${_tool} ${_tool}.cpp)
NGL_TARGET_LINK_LIBRARIES(${_tool}
TARGET_LINK_LIBRARIES(${_tool}
Qt6::Core
GeographicLib::GeographicLib_SHARED
${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(${_tool} PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
NGL_INSTALL_TARGET(${_tool})
ENDFOREACH()
ENDIF()
@@ -90,7 +96,9 @@ IF(BUILD_TESTING AND TARGET LtsCoordTrans)
TARGET_LINK_LIBRARIES(lts_coord_trans_unit_test
LtsCoordTrans
Qt6::Test
GeographicLib::GeographicLib_SHARED
${GeographicLib_LIBRARIES}
)
TARGET_INCLUDE_DIRECTORIES(lts_coord_trans_unit_test PRIVATE ${GeographicLib_INCLUDE_DIRS})
LINK_DIRECTORIES(${GeographicLib_LIBRARY_DIRS})
ADD_TEST(NAME lts_coord_trans_unit_test COMMAND $<TARGET_FILE:lts_coord_trans_unit_test>)
ENDIF()
@@ -295,7 +295,8 @@ bool LtsPluginLoader::loadPlugins(PluginType requestedPluginType,
}
const QString jsonIid = iid.value().toString().toLower(); // LOWERCASE ! (pun intended)
// Use QStringView for efficient string operations
// Qt6: QStringRef/QString::splitRef were removed; QStringView::split
// provides the same zero-copy tokenization.
const QList<QStringView> iidParameters = QStringView{jsonIid}.split(QLatin1Char(':'));
DEBUG_LOG(logger) << "Plugin " << absoluteFilePath << " provides iid '" << jsonIid;
@@ -17,13 +17,7 @@ SET(SRCS
printing.h
)
# 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)
if (KDReports_FOUND AND QT6_GUI_AVAILABLE AND BUILD_CODIFICATION)
NGL_ADD_LIBRARY2(WS LtsPrinting SHARED ${SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(LtsPrinting
PUBLIC
@@ -44,7 +38,5 @@ if(QT6_GUI_AVAILABLE)
endif()
NGL_INSTALL_TARGET(LtsPrinting)
else()
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)
message(STATUS "KDReports not found or BUILD_RTI disabled; skipping LtsPrinting target")
endif()
@@ -1,14 +0,0 @@
// 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());
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
dialogParent->windowTitle(), QPageSize(QPageSize::A4), QPageLayout::Landscape);
dialogParent->windowTitle(), QPrinter::A4, QPrinter::Landscape);
if (!nglPrinter.printer())
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,
const QString& description, const QPageSize& pageSize,
const QPageLayout::Orientation& pageOrientation)
const QString& description, const QPrinter::PageSize& pageSize,
const QPrinter::Orientation& pageOrientation)
{
QTextDocument 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,
QVector<QImage>& images, QVector<QString>& imageTitles, QVector<QString>& descriptions,
const QPageSize& pageSize, const QPageLayout::Orientation& pageOrientation)
const QPrinter::PageSize& pageSize, const QPrinter::Orientation& pageOrientation)
{
QTextDocument doc;
@@ -181,8 +181,8 @@ void printPDFImages(QWidget* dialogParent, const QString& docName, const QString
QPrinter printer;
printer.setColorMode(QPrinter::ColorMode::Color);
printer.setPageOrientation(QPageLayout::Portrait);
printer.setPageSize(QPageSize(QPageSize::A4));
printer.setOrientation(QPrinter::Orientation::Portrait);
printer.setPageSize(QPrinter::PageSize::A4);
QString fn = docName;
fn = fn.remove(QLatin1Char(' '));
fn = fn.remove(QLatin1String(".."));
@@ -224,7 +224,7 @@ void printReport(LtsSession::LtsSession* session, QWidget* dialogParent, KDRepor
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(dialogParent->windowTitle()),
dialogParent->windowTitle(), QPageSize(QPageSize::A3), QPageLayout::Landscape);
dialogParent->windowTitle(), QPrinter::A3, QPrinter::Landscape);
if (!nglPrinter.printer())
return;
@@ -233,8 +233,8 @@ void printReport(LtsSession::LtsSession* session, QWidget* dialogParent, KDRepor
cursor.movePosition(QTextCursor::End);
report.setWidthForEndlessPrinter(0);
report.setPageSize(QPageSize::A3);
report.setPageOrientation(QPageLayout::Landscape);
report.setPageSize(QPrinter::A3);
report.setOrientation(QPrinter::Landscape);
LtsPrinting::Base::printReportData(doc, report);
nglPrinter.print(&doc);
@@ -249,8 +249,8 @@ void printWidget(LtsSession::LtsSession* session, QWidget* dialogParent, QWidget
QString windowTitle = dialogParent->windowTitle();
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
QPageSize(QPageSize::A3), QPageLayout::Landscape);
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A3,
QPrinter::Landscape);
if (!nglPrinter.printer())
return;
@@ -271,8 +271,8 @@ void printMessage(LtsSession::LtsSession* session, QWidget* dialogParent, const
QString windowTitle = subject;
doc.setMetaInformation(QTextDocument::DocumentTitle, subject);
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
QPageSize(QPageSize::A4), QPageLayout::Portrait);
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A4,
QPrinter::Portrait);
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));
@@ -302,8 +302,8 @@ void printStoryboard(LtsSession::LtsSession* session, QWidget* dialogParent, QAb
QString windowTitle = dialogParent->windowTitle();
doc.setMetaInformation(QTextDocument::DocumentTitle, dialogParent->windowTitle());
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle,
QPageSize(QPageSize::A4), QPageLayout::Portrait);
LtsPrinting::Base nglPrinter(doc, dialogParent, QObject::tr("Print %1").arg(windowTitle), windowTitle, QPrinter::A4,
QPrinter::Portrait);
if (!nglPrinter.printer())
return;
@@ -3,8 +3,6 @@
#pragma once
#include <QtPrintSupport/QPrinter>
#include <QtGui/QPageSize>
#include <QtGui/QPageLayout>
#ifndef LTSPRINTING_EXPORT
#ifdef BUILD_STATIC_LIBRARIES
@@ -44,13 +42,13 @@ LTSPRINTING_EXPORT void printStoryboard(LtsSession::LtsSession* session, QWidget
LTSPRINTING_EXPORT void printImage(LtsSession::LtsSession* session, QWidget* dialogParent, const QImage& image,
const QString& imageTitle, const QString& description,
const QPageSize& pageSize = QPageSize(QPageSize::A3),
const QPageLayout::Orientation& pageOrientation = QPageLayout::Landscape);
const QPrinter::PageSize& pageSize = QPrinter::A3,
const QPrinter::Orientation& pageOrientation = QPrinter::Landscape);
LTSPRINTING_EXPORT void printImages(LtsSession::LtsSession* session, QWidget* dialogParent, const QString& docName,
QVector<QImage>& images, QVector<QString>& imageTitles,
QVector<QString>& descriptions, const QPageSize& pageSize = QPageSize(QPageSize::A3),
const QPageLayout::Orientation& pageOrientation = QPageLayout::Landscape);
QVector<QString>& descriptions, const QPrinter::PageSize& pageSize = QPrinter::A3,
const QPrinter::Orientation& pageOrientation = QPrinter::Landscape);
LTSPRINTING_EXPORT void printPDFImages(QWidget* dialogParent, const QString& docName, const QString& printPath,
QVector<QImage>& images);
@@ -50,8 +50,8 @@ Base::Base(QTextDocument &doc,
QWidget *dialogParent,
const QString &dialogTitle,
const QString &_fn,
QPageSize _ps,
QPageLayout::Orientation _or,
QPrinter::PaperSize _ps,
QPrinter::Orientation _or,
QPrinter::ColorMode _cm) : m_printer(new QPrinter),
m_painter(new QPainter),
m_iconFilenameNr(0),
@@ -61,9 +61,9 @@ Base::Base(QTextDocument &doc,
headersize_(10), headerrule_(0.5), headertext_(HeaderText),
footersize_(10), footerrule_(0.5), footertext_(FooterText),
itemFontSize_(2),
m_settings(new NGL::Settings(NGL::findProjectConfigFile())),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("NGLPrinting")),
m_currentPage(1)
m_settings(new NGL::Settings(NGL::findProjectConfigFile())).getNGLLogger("NGLPrinting")),
m_currentPage(1),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{
QString fn = _fn;
fn = fn.remove(QLatin1Char(' '));
@@ -77,8 +77,8 @@ Base::Base(QTextDocument &doc,
#endif
m_printer->setOutputFormat(QPrinter::NativeFormat);
m_printer->setPageSize(_ps);
m_printer->setPageOrientation(_or);
m_printer->setPaperSize(_ps);
m_printer->setOrientation(_or);
m_printer->setColorMode(_cm);
m_printer->setFullPage(true);
@@ -101,13 +101,13 @@ Base::Base(QTextDocument &doc,
QAbstractPrintDialog::PrintCollateCopies;
dialog->setOptions(op);
QString title = dialogTitle;
if (_ps.id() == QPageSize::A2)
if (_ps == QPrinter::A2)
title += QLatin1String(" (A2)");
if (_ps.id() == QPageSize::A3)
if (_ps == QPrinter::A3)
title += QLatin1String(" (A3)");
if (_ps.id() == QPageSize::A4)
if (_ps == QPrinter::A4)
title += QLatin1String(" (A4)");
if (_ps.id() == QPageSize::A5)
if (_ps == QPrinter::A5)
title += QLatin1String(" (A5)");
dialog->setWindowTitle(title);
if (dialog->exec() != QDialog::Accepted)
@@ -153,7 +153,7 @@ QString Base::styleSheet()
QSize Base::printerPageSize() const
{
return QSize(m_printer->pageRect(QPrinter::Point).width() - 2 * DOC_MARGIN, m_printer->pageRect(QPrinter::Point).height() - 2 * DOC_MARGIN);
return QSize(m_printer->pageRect().width() - 2 * DOC_MARGIN, m_printer->pageRect().height() - 2 * DOC_MARGIN);
}
bool Base::newPage()
@@ -543,7 +543,7 @@ bool Base::printItemData(QString& str, const QAbstractItemModel* model, const QM
displayString += vdata.toString();
QString fgColorString;
vdata = model->data(mi, Qt::ForegroundRole);
vdata = model->data(mi, Qt::TextColorRole);
if (vdata.isValid())
fgColorString = vdata.value<QColor>().name();
@@ -684,24 +684,24 @@ bool Base::printReportData(QTextDocument& doc, KDReports::Report& report)
return true;
}
QPageSize Base::pageSize() const
QPrinter::PageSize Base::pageSize() const
{
return m_printer->pageLayout().pageSize();
return m_printer->pageSize();
}
void Base::setPageSize(QPageSize size)
void Base::setPageSize(QPrinter::PageSize size)
{
m_printer->setPageSize(size);
}
QPageLayout::Orientation Base::orientation() const
QPrinter::Orientation Base::orientation() const
{
return m_printer->pageLayout().orientation();
return m_printer->orientation();
}
void Base::setOrientation(QPageLayout::Orientation orientation)
void Base::setOrientation(QPrinter::Orientation orientation)
{
m_printer->setPageOrientation(orientation);
m_printer->setOrientation(orientation);
}
double Base::leftMargin() const
@@ -711,7 +711,7 @@ double Base::leftMargin() const
void Base::setLeftMargin(double margin)
{
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
if ((margin > 0) && (margin < m_printer->paperRect().width() / 2))
leftmargin_ = margin;
else
leftmargin_ = 0;
@@ -724,7 +724,7 @@ double Base::rightMargin() const
void Base::setRightMargin(double margin)
{
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
if ((margin > 0) && (margin < m_printer->paperRect().width() / 2))
rightmargin_ = margin;
else
rightmargin_ = 0;
@@ -737,7 +737,7 @@ double Base::topMargin() const
void Base::setTopMargin(double margin)
{
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 4))
if ((margin > 0) && (margin < m_printer->paperRect().height() / 4))
topmargin_ = margin;
else
topmargin_ = 0;
@@ -750,7 +750,7 @@ double Base::bottomMargin() const
void Base::setBottomMargin(double margin)
{
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 4))
if ((margin > 0) && (margin < m_printer->paperRect().height() / 4))
bottommargin_ = margin;
else
bottommargin_ = 0;
@@ -758,7 +758,7 @@ void Base::setBottomMargin(double margin)
void Base::setMargins(double margin)
{
if ((margin > 0) && (margin < m_printer->paperRect(QPrinter::Point).height() / 2) && (margin < m_printer->paperRect(QPrinter::Point).width() / 2))
if ((margin > 0) && (margin < m_printer->paperRect().height() / 2) && (margin < m_printer->paperRect().width() / 2))
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = margin;
else
leftmargin_ = rightmargin_ = topmargin_ = bottommargin_ = 0;
@@ -771,7 +771,7 @@ double Base::spacing() const
void Base::setSpacing(double spacing)
{
if ((spacing > 0) && (spacing <= m_printer->paperRect(QPrinter::Point).height() / 8))
if ((spacing > 0) && (spacing <= m_printer->paperRect().height() / 8))
spacing_ = spacing;
else
spacing_ = 0;
@@ -784,7 +784,7 @@ double Base::headerSize() const
void Base::setHeaderSize(double size)
{
if ((size > 0) && (size <= m_printer->paperRect(QPrinter::Point).height() / 8))
if ((size > 0) && (size <= m_printer->paperRect().height() / 8))
headersize_ = size;
else
headersize_ = 0;
@@ -817,7 +817,7 @@ double Base::footerSize() const
void Base::setFooterSize(double size)
{
if ((size > 0) && (size <= m_printer->paperRect(QPrinter::Point).height() / 8))
if ((size > 0) && (size <= m_printer->paperRect().height() / 8))
footersize_ = size;
else
footersize_ = 0;
@@ -851,7 +851,7 @@ void Base::setItemFontSize(int itemFontSize)
QRectF Base::paperRect(QPaintDevice* device)
{
QRectF rect = m_printer->paperRect(QPrinter::Point);
QRectF rect = m_printer->paperRect();
rect.setWidth(rect.width() * device->logicalDpiX() / m_printer->logicalDpiX());
rect.setHeight(rect.height() * device->logicalDpiY() / m_printer->logicalDpiY());
@@ -930,7 +930,7 @@ void Base::printSinglePage()
m_tempdoc->setPageSize(contentRect(m_printer).size());
QTextFrameFormat fmt = m_tempdoc->rootFrame()->frameFormat();
fmt.setMargin(0);
fmt.setContentsMargins(0, 0, 0, 0);
m_tempdoc->rootFrame()->setFrameFormat(fmt);
int doccopies;
@@ -938,11 +938,11 @@ void Base::printSinglePage()
if (m_printer->collateCopies())
{
doccopies = 1;
pagecopies = m_printer->copyCount();
pagecopies = m_printer->numCopies();
}
else
{
doccopies = m_printer->copyCount();
doccopies = m_printer->numCopies();
pagecopies = 1;
}
@@ -4,8 +4,6 @@
#include <QtCore/QSet>
#include <QtPrintSupport/QPrinter>
#include <QtGui/QPageSize>
#include <QtGui/QPageLayout>
namespace NGL
{
@@ -52,7 +50,7 @@ class Base
{
public:
Base(QTextDocument& doc, QWidget* dialogParent, const QString& dialogTitle, const QString& _fn,
QPageSize _ps = QPageSize(QPageSize::A4), QPageLayout::Orientation _or = QPageLayout::Portrait,
QPrinter::PaperSize _ps = QPrinter::A4, QPrinter::Orientation _or = QPrinter::Portrait,
QPrinter::ColorMode _cm = QPrinter::Color);
virtual ~Base();
@@ -63,13 +61,13 @@ class Base
static QString styleSheet();
QPageSize pageSize() const;
QPrinter::PageSize pageSize() const;
void setPageSize(QPageSize size);
void setPageSize(QPrinter::PageSize size);
QPageLayout::Orientation orientation() const;
QPrinter::Orientation orientation() const;
void setOrientation(QPageLayout::Orientation orientation);
void setOrientation(QPrinter::Orientation orientation);
bool newPage();
@@ -175,13 +175,7 @@ bool CTS::DisconnectRequest::hasValidData() const
return true;
}
// 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)
LtsProjectionWorkstation::ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
: Message(nullptr, nullptr, JsonKeys::ERROR_MESSAGE(), uuid, QJsonValue()), m_reason(reason)
{
QJsonObject result;
@@ -189,7 +183,7 @@ ErrorMessage::ErrorMessage(const QString& uuid, const QString& reason)
m_replyData = result;
}
void ErrorMessage::process()
void LtsProjectionWorkstation::ErrorMessage::process()
{
if (!m_handler || !m_client)
return;
@@ -198,7 +192,7 @@ void ErrorMessage::process()
m_handler->handleMessage(this);
}
bool ErrorMessage::hasValidData() const
bool LtsProjectionWorkstation::ErrorMessage::hasValidData() const
{
if (!m_handler || !m_client)
return false;
@@ -48,9 +48,7 @@ IF(BUILD_RTI)
${CMAKE_BINARY_DIR}/Lts/DDS
)
# ddscore target generates core_dtc_types.h
IF(TARGET ddscore)
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
ENDIF()
ADD_DEPENDENCIES(LtsSessionDataDds ddscore)
NGL_TARGET_LINK_DIRECTORIES(LtsSessionDataDds
PRIVATE
${RTI_LIB_DIR}
@@ -916,11 +916,6 @@ void LtsSession::setExerciseData(const LtsWidgets::ExerciseData& exerciseData)
emit signalExerciseDataChanged();
}
const LtsWidgets::ExerciseData* LtsSession::exerciseData() const
{
return m_exerciseData;
}
void LtsSession::setProfilePicture(const QPixmap& pixmap)
{
// partitionType(); ?!?
@@ -1,5 +1,4 @@
#include "lts_session_lock_handler.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <QtCore/QDebug>
@@ -1,7 +1,6 @@
#include "Event.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <LtsSession/lts_session.h>
#include <QtGui/QPainter>
@@ -1,7 +1,6 @@
#include "TimelineHeaderView.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "TimelineWidget.h"
@@ -8,5 +8,7 @@
ADD_SUBDIRECTORY(LtsUtilsCore)
ADD_SUBDIRECTORY(LtsUtilsGui)
IF(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(LtsUtilsGui)
ENDIF()
ADD_SUBDIRECTORY(LtsUtilsSettings)
@@ -7,6 +7,9 @@
#
# LtsUtilsGuiDds is needed by LtsMultiMonitor regardless of BUILD_RTI
ADD_SUBDIRECTORY(LtsUtilsGuiDds)
# Exclude from release scope - requires DDS headers, only used by LtsMultiMonitor
if(NOT RELEASE_BUILD)
ADD_SUBDIRECTORY(LtsUtilsGuiDds)
endif()
ADD_SUBDIRECTORY(ConnectDialog)
ADD_SUBDIRECTORY(StyleManager)
@@ -53,20 +53,6 @@ NGL_TARGET_COMPILE_DEFINITIONS(LtsUtilsGuiDds
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_TARGET_INCLUDE_DIRECTORIES(LtsUtilsDds
@@ -161,7 +161,7 @@ NGL_TARGET_INCLUDE_DIRECTORIES(LtsWidgets
NGL_TARGET_LINK_LIBRARIES(LtsWidgets
PRIVATE
Qt6::Network # for QHostInfo - for portability
$<IF:$<TARGET_EXISTS:Qt6::Svg>,Qt6::Svg,>
Qt6::Svg
ngltools
ngltranslator
NGLLogger
@@ -183,13 +183,6 @@ NGL_INSTALL_TARGET(LtsWidgets)
SET(ltswidgetsplugin_SRCS ltswidgetsplugin.cpp ltswidgetsplugin.json)
NGL_ADD_LIBRARY(WS ltswidgetsplugin MODULE ${ltswidgetsplugin_SRCS})
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_INSTALL_TARGET(ltswidgetsplugin DESTINATION lib/designer COMPONENT Devel)
@@ -16,8 +16,10 @@
#include <QtCore/QString>
#include <QtGui/QIcon>
#include <QtWidgets/QScrollArea>
#include <QScroller>
#include <QtWidgets/QAbstractItemView>
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QScroller>
#endif
#include <functional>
@@ -80,6 +82,7 @@ inline void addTouchScroll(QWidget *widget)
{
if (!widget)
return;
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
widget->setAttribute(Qt::WA_AcceptTouchEvents);
{
@@ -101,6 +104,10 @@ inline void addTouchScroll(QWidget *widget)
return;
}
}
#else
// Qt6: Touch scrolling is enabled by default for scrollable widgets
Q_UNUSED(widget)
#endif
}
enum class ButtonSize
@@ -39,9 +39,7 @@
#include <QtWidgets/QPushButton>
#include <QtWidgets/QScrollArea>
#include <QScroller>
#ifdef QT_SVG_LIB
#include <QtSvg/QSvgRenderer>
#endif
#include <QSvgRenderer>
#include <QtCore/QTimer>
#include <QtWidgets/QToolButton>
#include <QtCore/QPropertyAnimation>
@@ -401,7 +399,6 @@ void LtsBaseLayoutWidget::showEvent(QShowEvent *event)
{
const QSize s(QSize(rendererSizeHint.height(), rendererSizeHint.height()) * dpr);
// RDE SPLITTER LEFT
#ifdef QT_SVG_LIB
QSvgRenderer svgRenderer;
QPixmap pixmap(s);
pixmap.fill(Qt::transparent);
@@ -413,9 +410,6 @@ void LtsBaseLayoutWidget::showEvent(QShowEvent *event)
pixmap.setDevicePixelRatio(dpr);
m_ui->lbRdeSplitterLeft->setPixmap(pixmap);
#else
qWarning() << "QSvgRenderer not available - skipping SVG rendering for splitter";
#endif
}
{
@@ -59,7 +59,7 @@ public:
{
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
if (entry.first)
ids << entry.second.id;
ids << entry.second.id();
}
return ids;
@@ -73,7 +73,7 @@ public:
{
const T &entry = LtsAbstractTableModel<T>::m_vecData.at(row);
if (!entry.first)
ids << entry.second.id;
ids << entry.second.id();
}
return ids;
@@ -84,7 +84,7 @@ public:
for (int row = 0; row < LtsAbstractTableModel<T>::rowCount(); ++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)
{
entry.first = bContains;
@@ -64,7 +64,7 @@ void LtsColumnFilterProxyModel::setColumnStringFilter(const QString &newFilterSt
}
}
beginFilterChange();
endFilterChange();
endFilterChange();
}
void LtsColumnFilterProxyModel::setColumnDataFilter(const QVariant &newFilterData, int column)
@@ -92,7 +92,7 @@ void LtsColumnFilterProxyModel::setColumnDataFilter(const QVariant &newFilterDat
}
}
beginFilterChange();
endFilterChange();
endFilterChange();
}
@@ -141,7 +141,7 @@ void LtsColumnFilterProxyModel::setRecursiveFilteringEnabled(bool recursive)
return;
m_bRecursiveFiltering = recursive;
beginFilterChange();
endFilterChange();
endFilterChange();
}
bool LtsColumnFilterProxyModel::recursiveFilteringEnabled() const
@@ -7,7 +7,6 @@
*/
#include "lts_dialog.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "lts_progress_dialog_helper.h"
#include "lts_message_dialog.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
{
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)
{
translate(ui, data, QString::fromStdString(data.name), title); // -> translate #5
translate(ui, data, QString::fromStdString(data.name()), title); // -> translate #5
}
@@ -1,5 +1,4 @@
#include "lts_msec_date_time_edit.h"
#include <QTimeZone>
namespace LtsWidgets
@@ -0,0 +1,142 @@
#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
@@ -0,0 +1,62 @@
#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
@@ -15,12 +15,14 @@ TARGET_INCLUDE_DIRECTORIES(DataPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR
TARGET_LINK_LIBRARIES(DataPluginInterface PUBLIC Qt6::Core)
# GuiPluginInterface
IF(NOT RELEASE_BUILD)
ADD_LIBRARY(GuiPluginInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/gui_plugin_interface.cpp
)
TARGET_INCLUDE_DIRECTORIES(GuiPluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(GuiPluginInterface PUBLIC Qt6::Core LtsWidgets ProjectConfig LtsAppDescriptor LtsUtilsCore)
ENDIF()
# projectPluginInterface
ADD_LIBRARY(ProjectPluginInterface SHARED
@@ -38,40 +40,23 @@ ADD_LIBRARY(StylePluginInterface SHARED
TARGET_INCLUDE_DIRECTORIES(StylePluginInterface PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(StylePluginInterface PUBLIC Qt6::Core)
# record_replay_plugin
ADD_LIBRARY(RecordReplayPlugin SHARED
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.h
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.cpp
)
TARGET_INCLUDE_DIRECTORIES(RecordReplayPlugin PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(RecordReplayPlugin PUBLIC Qt6::Core)
# record_replay_plugin (requires RTI DDS)
if(BUILD_RTI)
ADD_LIBRARY(RecordReplayPlugin SHARED
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.h
${CMAKE_CURRENT_SOURCE_DIR}/record_replay_plugin.cpp
)
TARGET_INCLUDE_DIRECTORIES(RecordReplayPlugin PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/..)
TARGET_LINK_LIBRARIES(RecordReplayPlugin PUBLIC Qt6::Core)
# Topic Replay Interface
ADD_LIBRARY(TopicReplayInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.cpp
)
TARGET_INCLUDE_DIRECTORIES(TopicReplayInterface PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
)
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
)
# Topic Replay Interface (requires RTI DDS and TopicEditorBase)
ADD_LIBRARY(TopicReplayInterface SHARED
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/topic_replay_interface.cpp
)
TARGET_INCLUDE_DIRECTORIES(TopicReplayInterface PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/..
${CMAKE_BINARY_DIR}/Lts/Common/TopicEditorBase # topiceditorbase_export.h
)
TARGET_LINK_LIBRARIES(TopicReplayInterface PUBLIC Qt6::Core TopicEditorBase)
endif()
@@ -132,12 +132,12 @@ class Interface
protected:
LtsSession::LtsSession* m_session;
NGL::INGLLogger& m_logger;
private:
QFlags<LtsAppDescriptor::PluginInfo::Flag> m_flags;
QStringList m_options;
LtsAppDescriptor::App m_appId;
NGL::INGLLogger& m_logger;
};
} // namespace GuiPluginBase
@@ -45,7 +45,6 @@ NGL_ADD_LIBRARY2(WS TopicEditorBase SHARED ${topic_editor_base_SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES(TopicEditorBase
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR} # topiceditorbase_export.h (generated here)
${CMAKE_CURRENT_BINARY_DIR}/../ # auto-export file
${CMAKE_BINARY_DIR}/Z/src/NGLLogger # ngllogger_export.h
)
@@ -2,7 +2,7 @@
#pragma once
#include "topic_editor_utils.h"
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
#include "topiceditorbase_export.h"
#include <LtsUtils/LtsUtilsCore/promise.h>
#include <LtsWidgets/lts_dialog.h>
@@ -1,6 +1,6 @@
#pragma once
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
#include "topiceditorbase_export.h"
#include <LtsScriptTimeline/track_entry.h>
#include <QtCore/QVector>
@@ -1,6 +1,6 @@
#pragma once
#include "topic_editor_utils.h"
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
#include "topiceditorbase_export.h"
#include <QtCore/QObject>
#include <QtWidgets/QWidget>
@@ -1,6 +1,6 @@
#pragma once
#include "topic_editor_utils.h"
#include <Lts/Common/TopicEditorBase/topiceditorbase_export.h>
#include "topiceditorbase_export.h"
#include <QtCore/QObject>
#include <QtWidgets/QWidget>
@@ -24,12 +24,11 @@ ADD_SUBDIRECTORY(Routing)
ADD_SUBDIRECTORY(Core)
# During stepwise migration, add placeholder CTest entries after the
# real DdsUnitTests subdir so the test-suite can use real targets when
# internal codegen/RTI targets are available, and fall back to placeholders
# only when they are not.
# During stepwise migration, add placeholder CTest entries before the
# real DdsUnitTests subdir so the test-suite shows migration status even
# when internal codegen targets are not yet available.
ADD_SUBDIRECTORY(DdsUnitTestsPlaceholder)
IF(BUILD_RTI)
ADD_SUBDIRECTORY(DdsUnitTests)
ENDIF()
ADD_SUBDIRECTORY(DdsUnitTestsPlaceholder)
@@ -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)
{
if (!m_state.ports.has_value())
if (!m_state.ports.is_set())
m_state.ports = std::vector<Core::PortInformation>();
m_state.ports.get().push_back(Core::PortInformation(number, portType, properties.toStdString()));
@@ -1,7 +1,6 @@
#include "function_topic_tests.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <DDS/DDSConnector/publisher.h>
#include <DDS/DDSConnector/subscriber.h>
@@ -5,22 +5,14 @@
#
# ddsftc - Changed from INTERFACE to STATIC library to fix source path issues
# When INTERFACE libraries provide sources, CMake compiles them in the consuming
# target's directory context, causing path resolution issues with relative paths
ADD_LIBRARY(ddsftc STATIC
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_impl.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_threading.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_threading.cpp
)
# ddsftc
ADD_LIBRARY(ddsftc INTERFACE)
TARGET_INCLUDE_DIRECTORIES(ddsftc
PUBLIC
INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}/../../
)
TARGET_LINK_LIBRARIES(ddsftc
PUBLIC
INTERFACE
Qt6::Core
$<IF:$<TARGET_EXISTS:ddscore>,ddscore,>
ddsgen
@@ -30,12 +22,21 @@ TARGET_LINK_LIBRARIES(ddsftc
)
IF(BUILD_RTI)
TARGET_LINK_LIBRARIES(ddsftc
PUBLIC
INTERFACE
ddsfts_connext
RTI::nddsc
RTI::nddscpp2
)
ENDIF()
SET(SRCS
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc.cpp
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_impl.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_threading.h
${CMAKE_CURRENT_SOURCE_DIR}/generic_ftc_threading.cpp
)
TARGET_SOURCES(ddsftc INTERFACE ${SRCS})
# ddsftccore
@@ -430,9 +430,12 @@ private:
INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName();
// QueuedConnection to make sure the data is handled in the correct Qt (main) thread
request.replySlot.invoke(m_objToInform, Qt::QueuedConnection,
// Qt6: QMetaMethod::invoke takes QMetaMethodArgument; pass the
// registered topic type name like Q_ARG does, but with the
// runtime name (ReplyTopic is a template parameter).
QtPrivate::Invoke::argument<ReplyTopic>(TopicNameHelper::replyTopicTypeName(), reply.data()),
Q_ARG(int, request.uniqueId),
Q_ARG(bool, !inProgress));
Q_ARG(bool, !inProgress)); // finished yes/no
}
else
{
@@ -86,7 +86,7 @@ template <typename TOPICTYPE> class GenericDataWriter final
return false;
}
if (si.has_value())
if (si.is_set())
{
rti::pub::WriteParams writeParams;
rti::core::SampleIdentity sampleIdentity(si.get()->source_guid(), si.get()->publication_sequence_number());
@@ -17,7 +17,7 @@ namespace AdvancedSymbology
AdvancedSymbology::SidcDefinitions::Identity roleToIdentity(const ParticipantManagement::Role role)
{
AdvancedSymbology::SidcDefinitions::Identity identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
switch (role) {
switch (role.underlying()) {
case ParticipantManagement::Role::Unknown:
identity = AdvancedSymbology::SidcDefinitions::Identity::Unknown;
break;
@@ -6,7 +6,7 @@
#ifdef BUILD_WITH_EXTERNAL_DDS
#include "AreaEffectSimulation/aes_dtc.h"
#include "ParticipantManagement/ppm_dtc.h"
#include "ParticipantManagement/ppm.hpp"
#endif
#include "Symbology/symbol_data_to_render_role.h"
#include "SymbologyImpl/advanced_symbology_logging.h"
@@ -18,7 +18,6 @@ ForeignInterfaceImpl::ForeignInterfaceImpl(const std::shared_ptr<ParticipantMana
const std::shared_ptr<AreaEffectSimulation::Interface::Dtc>& aesDtc,
const std::shared_ptr<GuezIedManagement::Interface::Dtc>& guezIedDtc)
: m_ppmDtc(ppmDtc), m_aesDtc(aesDtc), m_guezIedDtc(guezIedDtc)
, m_logger(getLogger("AdvancedSymbologyPlugin"))
{
if (!m_ppmDtc)
{
@@ -54,100 +53,100 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const SymbolDataToR
QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantManagement::Participant& participant,
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)
return findImage(symDataToRender);
const ParticipantManagement::Party& party = m_ppmDtc->party(participant.partyId);
symDataToRender.role = AdvancedSymbology::roleToRole<>(party.role);
const ParticipantManagement::Party& party = m_ppmDtc->party(participant.partyId());
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;
QColor injuryColor = QColor(100, 100, 0);
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 =
m_ppmDtc->youngestStateInformation(dData.stateHistory);
currentState = lastState.vulnerabilityState;
m_ppmDtc->youngestStateInformation(dData.stateHistory());
currentState = lastState.vulnerabilityState();
switch (lastState.originatorType)
switch (lastState.originatorType().underlying())
{
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ImprovisedExplosiveDevice: {
case ProjectDataManagement::StateChangeOriginator::ImprovisedExplosiveDevice: {
if (m_guezIedDtc)
{
const GuezIedManagement::Ied& gIed = m_guezIedDtc->iedForEquipmentNumber(lastState.originatorId);
if (gIed.id > 0)
const GuezIedManagement::Ied& gIed = m_guezIedDtc->iedForEquipmentNumber(lastState.originatorId());
if (gIed.id() > 0)
{
int injuryPartyId = gIed.partyId;
int injuryPartyId = gIed.partyId();
if (injuryPartyId >= 0)
injuryColor = m_ppmDtc->party(injuryPartyId).color;
injuryColor = m_ppmDtc->party(injuryPartyId).color();
}
}
break;
}
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_DusMine: {
case ProjectDataManagement::StateChangeOriginator::DusMine: {
if (!m_aesDtc)
{
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
"included in symbol created for participant.id() "
<< participant.id;
<< participant.id();
return findImage(symDataToRender);
}
const int partyId = m_aesDtc->partyForDusMine(lastState.originatorId);
const int partyId = m_aesDtc->partyForDusMine(lastState.originatorId());
if (partyId >= 0)
injuryColor = m_ppmDtc->party(partyId).color;
injuryColor = m_ppmDtc->party(partyId).color();
break;
}
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_FunctionalArea: {
case ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation:
case ProjectDataManagement::StateChangeOriginator::FunctionalArea: {
if (!m_aesDtc)
{
WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be "
"included in symbol created for participant.id() "
<< participant.id;
<< participant.id();
return findImage(symDataToRender);
}
AreaEffectSimulation::AesItem aesItem;
m_aesDtc->aesItemFromId(lastState.originatorId, aesItem);
m_aesDtc->aesItemFromId(lastState.originatorId(), aesItem);
if (aesItem.partyId.has_value())
injuryColor = m_ppmDtc->party(aesItem.partyId.get()).color;
if (aesItem.partyId().is_set())
injuryColor = m_ppmDtc->party(aesItem.partyId().get()).color();
break;
}
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Participant: {
case ProjectDataManagement::StateChangeOriginator::Participant: {
const ParticipantManagement::Participant& participantOrigin =
m_ppmDtc->participant(lastState.originatorId);
m_ppmDtc->participant(lastState.originatorId());
if (participantOrigin.id)
injuryColor = m_ppmDtc->party(participantOrigin.partyId).color;
if (participantOrigin.id())
injuryColor = m_ppmDtc->party(participantOrigin.partyId()).color();
break;
}
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Party: {
const ParticipantManagement::Party& partyOrigin = m_ppmDtc->party(lastState.originatorId);
case ProjectDataManagement::StateChangeOriginator::Party: {
const ParticipantManagement::Party& partyOrigin = m_ppmDtc->party(lastState.originatorId());
if (partyOrigin.id)
injuryColor = partyOrigin.color;
if (partyOrigin.id())
injuryColor = partyOrigin.color();
break;
}
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ObserverController:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_ExerciseControl:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Initialization:
injuryColor = m_ppmDtc->party(1).color;
case ProjectDataManagement::StateChangeOriginator::ObserverController:
case ProjectDataManagement::StateChangeOriginator::ExerciseControl:
case ProjectDataManagement::StateChangeOriginator::Initialization:
injuryColor = m_ppmDtc->party(1).color();
break;
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MedicalTimeout:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Sanitation:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_Unknown:
case ProjectDataManagement::StateChangeOriginator::WoundTreatmentDevice:
case ProjectDataManagement::StateChangeOriginator::MedicalTimeout:
case ProjectDataManagement::StateChangeOriginator::Sanitation:
case ProjectDataManagement::StateChangeOriginator::MaintainanceDevice:
case ProjectDataManagement::StateChangeOriginator::Unknown:
break;
}
}
@@ -160,7 +159,7 @@ QSharedPointer<SymbolResult> ForeignInterfaceImpl::findImage(const ParticipantMa
AdvancedSymbology::Injury ForeignInterfaceImpl::stateToInjury(const ProjectDataManagement::VulnerabilityState& state)
{
switch (state)
switch (state.underlying())
{
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_CombatReady:
case ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance:
@@ -70,10 +70,10 @@ void SaveAsSymbol::onInputChanged(const QString &input)
void SaveAsSymbol::onFileContentChanged(const FileManagement::FileContent &data, DataModification modType)
{
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
if (data.fileType() != FileManagement::FileType::OperatorDefinedSymbol)
return;
QString name = QString::fromStdString(data.name);
QString name = QString::fromStdString(data.name());
if (modType == DataModification::eRemoved)
m_takenNames.removeAll(name);
@@ -19,7 +19,7 @@ class SelectTextDialog final : public LtsWidgets::LtsFramelessDialog
~SelectTextDialog();
protected:
//NGL::INGLLogger& m_logger; // unused (legacy: commented out)
NGL::INGLLogger& m_logger;
Ui_SelectTextDialog* ui;
private:
@@ -125,7 +125,7 @@ SymbolEditor::SymbolEditor(LtsSession::LtsSession *session, QWidget *parent)
: LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel)
, m_ui(new Ui::SymbolEditor)
, m_session(session)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("SymbolEditor"))
.getNGLLogger("SymbolEditor"))
{
DEBUG_LOG(m_logger) << "SymbolEditor(" << "parent=" << parent << ")";
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_ppmDtc->partys([this](const ParticipantManagement::Party& data) {
m_internal->m_symbolColorsPreview.append(
{ParticipantManagement::trPartyName(data.name), QColor::fromRgb(data.color)});
m_internal->m_symbolColorsPreview.append({tr("%1 (faded)").arg(ParticipantManagement::trPartyName(data.name)),
QColor::fromRgb(data.fadingColor)});
{ParticipantManagement::trPartyName(data.name()), QColor::fromRgb(data.color())});
m_internal->m_symbolColorsPreview.append({tr("%1 (faded)").arg(ParticipantManagement::trPartyName(data.name())),
QColor::fromRgb(data.fadingColor())});
});
m_internal->m_toolButtonGroup.addButton(m_ui->ToolButtonRect);
@@ -812,9 +812,11 @@ void SymbolEditor::updateSymbolAttributesWidgets()
m_ui->ListViewMisc->clearSelection();
m_ui->ListViewTruppengattung->clearSelection();
auto primitives = m_internal->m_symbol.getPrimitives();
for (auto* prim : primitives)
QLinkedList<SymbologyXML::Primitive*> primitives = m_internal->m_symbol.getPrimitives();
QLinkedListIterator<SymbologyXML::Primitive*> pi(primitives);
while (pi.hasNext())
{
SymbologyXML::Primitive* prim = pi.next();
int iconId = prim->icon();
SymbologyXML::SymbolTypes::t_icon_type iconType = prim->iconType();
SymbologyXML::SymbolTypes::t_sector_position sectorPosition = prim->position();
@@ -1443,7 +1445,7 @@ void SymbolEditor::slotImportTemplate()
else
{
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
QString symbolName = QString::fromStdString(fc.name);
QString symbolName = QString::fromStdString(fc.name());
SymbologyXML::SymbolReader sr;
pushUndo();
sr.read(content, m_internal->m_symbol);
@@ -1451,7 +1453,7 @@ void SymbolEditor::slotImportTemplate()
m_internal->m_lastFileId = fileId;
m_internal->m_lastFileName = symbolName;
m_internal->m_lastFolderId = fc.folderId;
m_internal->m_lastFolderId = fc.folderId();
updateGUI();
__unchange__();
@@ -1848,7 +1850,7 @@ void SymbolEditor::onToolButtonTextClicked()
void SymbolEditor::resetToolButtonGroupState()
{
m_ui->ToolButtonSelect->animateClick();
m_ui->ToolButtonSelect->animateClick(1);
}
void SymbolEditor::onPushButtonFillColorClicked()
@@ -1932,9 +1934,11 @@ void SymbolEditor::copyElementsFromSymbol(const SymbologyXML::Symbol& tmpSymbol)
m_internal->m_symbol.addBranch((SymbologyXML::SymbolTypes::t_branch)idx);
}
auto prims = tmpSymbol.getPrimitives();
for (auto* prim : prims)
QLinkedList<SymbologyXML::Primitive*> prims = tmpSymbol.getPrimitives();
QLinkedListIterator<SymbologyXML::Primitive*> pi(prims);
while (pi.hasNext())
{
SymbologyXML::Primitive* prim = pi.next();
if ((prim->type() == SymbologyXML::Primitive::ICON) &&
m_internal->m_symbol.containsPrimitive(prim->iconType(), prim->position(), prim->icon()))
continue;
@@ -3012,8 +3016,8 @@ bool SymbolEditor::writeFile(bool saveAsNew)
DEBUG_LOG(m_logger) << "Saved file with id = " << fileId;
m_internal->m_lastFileId = fileId;
FileManagement::FileContent fc = m_internal->m_flmDtc->fileContent(fileId);
m_internal->m_lastFolderId = fc.folderId;
const QString fileName = QString::fromStdString(fc.name);
m_internal->m_lastFolderId = fc.folderId();
const QString fileName = QString::fromStdString(fc.name());
m_internal->m_lastFileName = fileName;
m_internal->m_symbol.setName(fileName);
bRet = true;
@@ -6,7 +6,7 @@
#include <LtsWidgets/lts_dialog.h>
#include <NGLLogger/INGLLogger.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <flm_data_plugin_interface.h>
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
#include <SymbologyXML/symbol_types.h>
@@ -5,7 +5,7 @@
#include <PluginInterfaces/gui_plugin_interface.h>
#include <AdvancedSymbology/asb_gui_plugin_interface.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <flm_data_plugin_interface.h>
#include <FileManagement/flm_explorer_gui_plugin_interface.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
@@ -27,8 +27,8 @@ void FileManagementReplyHandler::requestReply(const Core::FunctionReplyObject &r
void FileManagementReplyHandler::onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &replyObject)
{
m_content = replyObject.content;
m_id = replyObject.id;
m_content = replyObject.content();
m_id = replyObject.id();
m_requestHelper->requestReply(replyObject);
}
@@ -318,7 +318,7 @@
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property>
</widget>
</item>
@@ -576,7 +576,7 @@
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="renderHints">
<set>QPainter::Antialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
<set>QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property>
</widget>
</item>
@@ -6,7 +6,7 @@
#include <LtsUtils/LtsUtilsCore/dds_vector.h>
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <flm_data_plugin_interface.h>
#include <OperatorManagement/opm_data_plugin_interface.h>
#include <QtXml/QDomDocument>
#include <QtGui/QImage>
@@ -152,7 +152,7 @@ bool FlmSubscriber::createFlmSymbolProxy(int type_placeholder)
#ifdef SKIP_SOME_TO_TEST_REFETCHING
if (fileContentId >= 98)
request.fileContentId = -1;
request.fileContentId(-1);
#endif
#endif
@@ -179,7 +179,7 @@ bool FlmSubscriber::createFlmSymbolProxy(int type_placeholder)
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;
@@ -197,16 +197,16 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " fileContentId=" << fileContentId << " name=" << name
<< " 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)
{
case FileContentStruct::SymbolType::EtsSymbol: {
QImage image;
if (!svgToImage(QByteArray::fromRawData(reinterpret_cast<const char*>(&reply.content.at(0)),
reply.content.size()),
if (!svgToImage(QByteArray::fromRawData(reinterpret_cast<const char*>(&reply.content().at(0)),
reply.content().size()),
image))
{
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: {
FlmSymbolProxy::SymbolData symbolData(name, operatorName, lastModified,
LtsUtils::toQByteArray(reply.content));
LtsUtils::toQByteArray(reply.content()));
if (symbolData.isXmlSymbol())
{
@@ -277,7 +277,7 @@ bool FlmSubscriber::svgToImage(const QByteArray& svgByteArray, QImage& imageOut)
QString FlmSubscriber::operatorName(int operatorId)
{
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);
}
@@ -339,20 +339,20 @@ void FlmSubscriber::checkForReFetching()
void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data, DataModification modType)
{
TRACE_LOG(m_logger) << Q_FUNC_INFO << " data.id=" << data.id
<< " data.fileStatus=" << data.fileStatus << " modType=" << modType
<< " data.name='" << data.name.c_str() << "'";
TRACE_LOG(m_logger) << Q_FUNC_INFO << " data.id=" << data.id()
<< " data.fileStatus=" << data.fileStatus().underlying() << " modType=" << modType
<< " data.name='" << data.name().c_str() << "'";
if (!d->m_flmFtc)
return;
if (data.isDeleted)
if (data.isDeleted())
return;
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
if (data.fileType().underlying() != FileManagement::FileType::OperatorDefinedSymbol)
return;
if (data.fileStatus == FileManagement::FileStatus::Deleted)
if (data.fileStatus().underlying() == FileManagement::FileStatus::Deleted)
{
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)
{
case DataModification::eAdded:
@@ -383,13 +383,13 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent& data
case DataModification::eRemoved: {
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " modType=" << modType << " fileContentId=" << fileContentId
<< " fileContentName=" << data.name;
<< " fileContentName=" << data.name();
d->m_fileContentMap.remove(fileContentId);
if (!d->m_symbolProxy.removeSymbol(fileContentId))
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);
break;
}
@@ -400,35 +400,35 @@ void FlmSubscriber::updateFileContentMap(const FileManagement::FileContent& data
{
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
<< " fileContentId=" << data.id << " data.isDeleted=" << data.isDeleted
<< " data.fileStatus=" << data.fileStatus << " data.name='"
<< QString::fromStdString(data.name) << "'";
<< " fileContentId=" << data.id() << " data.isDeleted()=" << data.isDeleted()
<< " data.fileStatus().underlying()=" << data.fileStatus().underlying() << " data.name='"
<< QString::fromStdString(data.name()) << "'";
if (data.isDeleted)
if (data.isDeleted())
return;
if (data.fileStatus == FileManagement::FileStatus::Deleted)
if (data.fileStatus().underlying() == FileManagement::FileStatus::Deleted)
return;
if (data.fileType != FileManagement::FileType::OperatorDefinedSymbol)
if (data.fileType() != FileManagement::FileType::OperatorDefinedSymbol)
return;
const int32_t fileContentId = data.id;
const int32_t fileContentId = data.id();
FileContentStruct fcData;
fcData.name = QString::fromStdString(data.name);
fcData.name = QString::fromStdString(data.name());
fcData.type = FileContentStruct::SymbolType::UnsupportedSymbol;
fcData.operatorName = operatorName(data.operatorId);
fcData.lastModified = data.lastModified;
fcData.operatorName = operatorName(data.operatorId());
fcData.lastModified = data.lastModified();
fcData.usrTags << QStringLiteral("file-id=%1").arg(fileContentId);
fcData.usrTags << QStringLiteral("exercise-id=%1").arg(data.exerciseId.has_value() ? data.exerciseId.get() : -1);
fcData.usrTags << QStringLiteral("exercise-id=%1").arg(data.exerciseId().is_set() ? data.exerciseId().get() : -1);
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;
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"
<< " d->m_fileContentMap.size()=" << d->m_fileContentMap.size()
<< " fileContentId=" << data.id << " data.isDeleted=" << data.isDeleted
<< " data.fileStatus=" << data.fileStatus << " data.name='"
<< QString::fromStdString(data.name) << "'";
<< " fileContentId=" << data.id() << " data.isDeleted()=" << data.isDeleted()
<< " data.fileStatus().underlying()=" << data.fileStatus().underlying() << " data.name='"
<< QString::fromStdString(data.name()) << "'";
}
void FlmSubscriber::onLocalSymbolProxyEtsSymbolAdded(qint32 fileContentId, const QString& name, const QImage& image,
@@ -6,7 +6,7 @@
#include <Lts/Services/FileManagement/flm.hpp>
#include <LtsUtils/LtsUtilsCore/data_modification_enum.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <flm_data_plugin_interface.h>
#include <OperatorManagement/opm_data_plugin_interface.h>
#include <memory>
@@ -10,7 +10,7 @@
#include <Symbology/sidc_codec.h>
#include "flm_symbol_proxy.h"
#include <Plugins/FileManagement/flm_data_plugin_interface.h>
#include <flm_data_plugin_interface.h>
#include <OperatorManagement/opm_data_plugin_interface.h>
namespace AdvancedSymbology
@@ -9,7 +9,6 @@
#include <QtCore/QHash>
#include <QtCore/QString>
#include <QtGui/QImage>
#include <QtCore/QObject>
@@ -63,47 +63,58 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
return QVariant();
const AlarmManagement::AlarmConfig& alarmConfig = m_vecData.at(index.row());
if (alarmConfig.global != m_global)
if (alarmConfig.global() != m_global)
return QVariant();
switch (index.column())
{
case Id:
return alarmConfig.id;
return alarmConfig.id();
case EquipmentNumber: {
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId);
const int equipmentNumber = m_alarmHistoryModel->participantId2EquipNo(alarmConfig.participantId());
if (equipmentNumber == 0)
return tr("All");
return equipmentNumber;
}
case Designator:
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId);
return m_alarmHistoryModel->getDesignator(alarmConfig.participantId());
case TactIdentifier:
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId);
return m_alarmHistoryModel->getTactIdentifier(alarmConfig.participantId());
case VulnerabilityState: {
QString vulnerabilityState = tr("All Types");
if (alarmConfig.vulnerabilityState >= 0)
if (alarmConfig.vulnerabilityState() >= 0)
{
ParticipantManagement::TypeClass typeClass =
m_ppmDtc->type(m_ppmDtc->participant(alarmConfig.participantId).typeId).typeClass;
// participant() existiert nicht mehr, suche in participantsList()
auto participantIt = std::find_if(
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 =
typeClass == ParticipantManagement::TypeClass::Human
? ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_SoldierInjuries
: ProjectDataManagement::VulnerabilityClass::VulnerabilityClass_VehicleDamages;
? ProjectDataManagement::VulnerabilityClass::SoldierInjuries
: ProjectDataManagement::VulnerabilityClass::VehicleDamages;
ProjectDataManagement::VulnerabilityState vs =
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState);
static_cast<ProjectDataManagement::VulnerabilityState>(alarmConfig.vulnerabilityState());
vulnerabilityState = ProjectDataManagement::toString(vs, vc);
}
return vulnerabilityState;
}
case EventType:
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId));
return ProjectDataManagement::toString(static_cast<ProjectDataManagement::PdmEventType>(alarmConfig.eventTypeId()));
case MessageWindow:
return alarmConfig.messageWindow ? tr("Yes") : tr("No");
return alarmConfig.messageWindow() ? tr("Yes") : tr("No");
case SetMarker:
return alarmConfig.setMarker ? tr("Yes") : tr("No");
return alarmConfig.setMarker() ? tr("Yes") : tr("No");
}
return QVariant();
@@ -111,15 +122,15 @@ QVariant ConfigAlarmModel::data(const QModelIndex& index, int role) const
void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, const DataModification modType)
{
const int id = data.id;
if (data.global != m_global)
const int id = data.id();
if (data.global() != m_global)
return;
int row = findRowForId(id);
const int eventTypeId = static_cast<int>(data.eventTypeId);
const bool messageWindow = data.messageWindow;
const bool setMarker = data.setMarker;
const int eventTypeId = data.eventTypeId();
const bool messageWindow = data.messageWindow();
const bool setMarker = data.setMarker();
DEBUG_LOG(getLogger()) << "onAlarmConfigChanged: " << eventTypeId << " messageWindow=" << messageWindow << "setMarker"
<< setMarker;
@@ -129,8 +140,8 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
DEBUG_LOG(getLogger()) << "AlarmConfig was removed: " << id;
AlarmManagement::AlarmConfig data1 = data;
data1.messageWindow = false;
data1.setMarker = false;
data1.setMessageWindow(false);
data1.setSetMarker(false);
setRowData(row, data1);
removeRow(row);
return;
@@ -142,7 +153,7 @@ void ConfigAlarmModel::onAlarmConfigChanged(const AlarmManagement::AlarmConfig&
return;
}
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId) > 0)
if (m_alarmHistoryModel->participantId2EquipNo(data.participantId()) > 0)
setRowData(row, data);
break;
}
@@ -6,6 +6,7 @@
#include "almcommon_export.h"
#include <AlarmManagement/alm_dtc.h>
#include <AlarmManagement/alm_types.h>
#include <GuezNasat/logger.h>
#include <LtsSession/lts_session.h>
#include <LtsWidgets/lts_abstract_table_model.h>
@@ -49,7 +49,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
// Register callbacks instead of enableParticipant()
const auto cbParticipants = [this](const ParticipantManagement::Participant& participant) {
onParticipantChanged(participant, DataModification::eAdded);
onParticipantChanged(participant, ParticipantManagement::DataModification::eAdded);
};
m_ppmDtc->participants(cbParticipants);
@@ -66,7 +66,7 @@ bool AlarmHistoryModel::initModel(const std::shared_ptr<AlarmManagement::Interfa
auto cbAesItem = [this](const AreaEffectSimulation::AesItem& item) {
onAesItemChanged(item, DataModification::eAdded);
};
m_aesDtc->bCContaminations(cbAesItem);
m_aesDtc->bcContaminations(cbAesItem);
m_aesDtc->boobyTraps(cbAesItem);
m_aesDtc->offRouteMines(cbAesItem);
@@ -84,7 +84,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
if (role == Qt::BackgroundRole)
{
if (notificationEx.eventType == ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
if (notificationEx.eventType() == ProjectDataManagement::PdmEventType::Alarm)
return QColor(Qt::red);
return QVariant();
}
@@ -94,7 +94,7 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
case Id:
return notificationEx.id;
case Date:
return QDateTime::fromMSecsSinceEpoch(notificationEx.time);
return QDateTime::fromMSecsSinceEpoch(notificationEx.time());
case EquipmentNumber:
if (notificationEx.equipmentNumber)
return notificationEx.equipmentNumber;
@@ -107,10 +107,10 @@ QVariant AlarmHistoryModel::data(const QModelIndex& index, int role) const
return notificationEx.participantId;
case Position:
if (role == Qt::DisplayRole)
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position.lon,
notificationEx.position.lat);
return LtsCoordTrans::mgrsFromGeographic(notificationEx.position().lon(),
notificationEx.position().lat());
else if (role == Qt::UserRole)
return QPointF(notificationEx.position.lon, notificationEx.position.lat);
return QPointF(notificationEx.position().lon(), notificationEx.position().lat());
break;
case 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
{
Q_UNUSED(modType);
if (data.operatorId == 0)
if (data.operatorId() == 0)
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)
@@ -135,16 +135,16 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio
return;
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 QJsonObject propertieJsonObj = propertieJsonDoc.object();
notification.equipmentNumber = data.equipmentNumber;
if (data.participantId.has_value())
notification.participantId = data.participantId.value();
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType);
if (data.aesId.has_value())
notification.aesId = data.aesId.value();
notification.equipmentNumber = data.equipmentNumber();
if (data.participantId().has_value())
notification.participantId = data.participantId().value();
notification.eventTypeId = static_cast<ProjectDataManagement::PdmEventType>(data.eventType());
if (data.aesId().has_value())
notification.aesId = data.aesId().value();
const int global = propertieJsonObj[QStringLiteral("Global")].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,
const DataModification modType)
const ParticipantManagement::DataModification modType)
{
if (modType == DataModification::eRemoved)
if (modType == ParticipantManagement::DataModification::eRemoved)
return;
QString designator = QString::fromStdString(participant.designator);
m_idDesignatorMap.insert(participant.id, designator);
QString designator = participant.designator();
m_idDesignatorMap.insert(participant.id(), designator);
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 = QString::fromStdString(participant.tacticalIdentifier);
m_idTactIdentifierMap.insert(participant.id, tacticalIdentifier);
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id << " designator=" << designator
QString tacticalIdentifier = participant.tacticalIdentifier();
m_idTactIdentifierMap.insert(participant.id(), tacticalIdentifier);
DEBUG_LOG(getLogger("AlarmHistoryModel")) << Q_FUNC_INFO << " id=" << participant.id() << " designator=" << designator
<< " tacticalIdentifier=" << tacticalIdentifier;
}
@@ -199,8 +199,8 @@ void AlarmHistoryModel::onBCContaminationChanged(const AreaEffectSimulation::BCC
{
if (modType == DataModification::eRemoved)
return;
int id = data.id;
QString name = QString::fromStdString(data.name);
int id = data.id();
QString name = QString::fromStdString(data.name());
m_aesNameMap[id] = name;
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "onBCContaminationChanged: id=" << id << " Name=" << name;
}
@@ -209,8 +209,8 @@ void AlarmHistoryModel::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap
{
if (modType == DataModification::eRemoved)
return;
int id = data.id;
QString name = QString::fromStdString(data.name);
int id = data.id();
QString name = QString::fromStdString(data.name());
m_aesNameMap[id] = name;
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "BoobyTrap: id=" << id << " Name=" << name;
}
@@ -220,8 +220,8 @@ void AlarmHistoryModel::onOffRouteMineChanged(const AreaEffectSimulation::OffRou
{
if (modType == DataModification::eRemoved)
return;
int id = data.id;
QString name = QString::fromStdString(data.name);
int id = data.id();
QString name = QString::fromStdString(data.name());
m_aesNameMap[id] = 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)
return;
QString name = QString::fromStdString(item.name);
int id = item.id;
QString name = QString::fromStdString(item.name());
int id = item.id();
m_aesNameMap[id] = name;
DEBUG_LOG(getLogger("AlarmHistoryModel")) << "AreaEffectSimulation::AesItem onAesItemChanged: id=" << id
<< " Name=" << name;
@@ -253,7 +253,7 @@ bool AlarmHistoryProxyModel::lessThan(const QModelIndex& source_left, const QMod
switch (source_left.column())
{
case AlarmHistoryModel::Date:
return dataLeft.time < dataRight.time;
return dataLeft.time() < dataRight.time();
case AlarmHistoryModel::Id:
case AlarmHistoryModel::Incident:
@@ -11,8 +11,7 @@
#include <LtsWidgets/lts_abstract_table_model.h>
#include <LtsWidgets/lts_column_filter_proxy_model.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ProjectDataManagement/pdm_enums.hpp>
#include <ProjectDataManagement/project_data_management.hpp>
namespace AlarmManagement
{
@@ -51,7 +50,7 @@ class ALMCOMMON_EXPORT AlarmHistoryModel final : public LtsWidgets::LtsAbstractT
bool isFiltered(const NotificationEx& data, DataModification modType) const override;
public slots:
void onNotificationChanged(const AlarmManagement::Notification& data, const DataModification modType);
void onParticipantChanged(const ParticipantManagement::Participant& participant, const DataModification modType);
void onParticipantChanged(const ParticipantManagement::Participant& participant, const ParticipantManagement::DataModification modType);
void onAesItemChanged(const AreaEffectSimulation::AesItem& item, const DataModification modType);
void onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data, const DataModification modType);
void onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, const DataModification modType);
@@ -57,24 +57,24 @@ void InterfaceImpl::clearInterfaces()
void InterfaceImpl::showEmergencyMessage(const AlarmManagement::Notification &data)
{
if (data.eventType != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
if (data.eventType() != ProjectDataManagement::PdmEventType::EventType_EmergencyCall)
return;
const int issi = data.equipmentNumber;
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position.lon, data.position.lat);
const int issi = data.equipmentNumber();
const QString &positionStr = LtsCoordTrans::mgrsFromGeographic(data.position().lon(), data.position().lat());
new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(),
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)
{
showEmergencyMessage(data);
if (data.operatorId == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
data.operatorId == 0)
if (data.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId() ||
data.operatorId() == 0)
{
bool bWidgetExists = m_session->widgetExists(menuGroup(), m_alarmHistoryDialogIdentifier, m_alarmHistoryDialogLayoutArea);
if (!bWidgetExists)
@@ -87,7 +87,7 @@ void InterfaceImpl::onNotificationChanged(const AlarmManagement::Notification &d
if (mod != DataModification::eAdded)
return;
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId
INFO_LOG(m_logger) << "ALARM! data.operatorId(): " << data.operatorId()
<< "currentOperatorId: " << LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
@@ -7,12 +7,11 @@
#include <PluginInterfaces/gui_plugin_interface.h>
#include <AlarmManagement/alm_gui_plugin_interface.h>
#include <AlarmManagement/alm_data_plugin_interface.h>
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
#include <AlarmManagement/Common/alm_config_alarm_model.h>
#include <AlarmManagement/Common/alm_history_alarm_model.h>
#include <AreaEffectSimulation/aes_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
namespace AlarmManagement
{
@@ -2,15 +2,14 @@
#include "alm_dialog.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "alm_history.h"
#include "ui_alm_dialog.h"
#include <LtsSession/lts_session_data.h>
#include <LtsUtilsSettings/settings.h>
#include <LtsWidgets/lts_dialog.h>
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
#include <AlarmManagement/Common/alm_config_alarm_model.h>
#include <AlarmManagement/Common/alm_history_alarm_model.h>
#include <ProjectDataManagement/pdm_enums.hpp>
#include <utility>
@@ -20,7 +19,7 @@ namespace AlarmManagement
AlarmDialog::AlarmDialog(QWidget* parent)
: 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_operatorId(-1), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_operatorId(-1)
{
AlarmCheckBox alarmCheckBox;
LtsUtils::ProjectSettings* ps = LtsUtils::ProjectSettings::getInstance();
@@ -159,23 +158,23 @@ void AlarmDialog::retranslate()
void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig& data, DataModification modType)
{
bool setMarker = data.setMarker;
bool messageWindow = data.messageWindow;
bool setMarker = data.setMarker();
bool messageWindow = data.messageWindow();
if (modType == DataModification::eRemoved)
return;
DEBUG_LOG(m_logger) << "************** onAlarmConfigChanged "
<< " id=" << data.id << " operatorId=" << data.operatorId
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId
<< " eventTypeId=" << data.eventTypeId << " messageWindow=" << messageWindow
<< " id=" << data.id() << " operatorId=" << data.operatorId()
<< " m_operatorId=" << m_operatorId << " participantId=" << data.participantId()
<< " eventTypeId=" << data.eventTypeId() << " messageWindow=" << messageWindow
<< " setMarker=" << setMarker;
if (data.global == false)
if (data.global() == false)
return;
if (data.operatorId == m_operatorId)
if (data.operatorId() == m_operatorId)
{
DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen ";
switch (data.eventTypeId)
switch (data.eventTypeId().underlying())
{
case ProjectDataManagement::PdmEventType::EventType_EnterNuclear: {
DEBUG_LOG(m_logger) << "EnterNuclear zuweisen ";
@@ -248,28 +247,28 @@ std::vector<AlarmManagement::AlarmAction> AlarmDialog::getCheckedValues() const
ret.reserve(m_checkBoxes.size());
for (const AlarmCheckBox& item : std::as_const(m_checkBoxes))
{
alarmActionDds.eventTypeId = item.eventTypeId;
alarmActionDds.eventTypeId(item.eventTypeId);
if (item.checkboxMarker->isChecked())
{
alarmActionDds.setMarker = true;
alarmActionDds.setMarker(true);
DEBUG_LOG(m_logger) << item.name << " setMarker = true";
}
else
{
alarmActionDds.setMarker = false;
alarmActionDds.setMarker(false);
DEBUG_LOG(m_logger) << item.name << " setMarker = false";
}
if (item.checkboxWindow->isChecked())
{
alarmActionDds.messageWindow = true;
alarmActionDds.messageWindow(true);
DEBUG_LOG(m_logger) << item.name << " messageWindow = true";
}
else
{
alarmActionDds.messageWindow = false;
alarmActionDds.messageWindow(false);
DEBUG_LOG(m_logger) << item.name << " messageWindow = false";
}
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
ret.push_back(alarmActionDds);
}
return ret;
@@ -7,7 +7,6 @@
#include <AlarmManagement/alm_ftc.h>
#include <AlarmManagement/alm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <AlarmManagement/logger.h>
@@ -2,12 +2,11 @@
#include "alm_history.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "ui_alm_history.h"
#include <LtsPrinting/printing.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <AlarmManagement/Gui/Common/alm_history_alarm_model.h>
#include <AlarmManagement/Common/alm_history_alarm_model.h>
#include <QtWidgets/QTreeView>
namespace AlarmManagement
@@ -15,8 +14,7 @@ namespace AlarmManagement
AlarmView::AlarmView(LtsSession::LtsSession* session, QWidget* parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_alarmHistoryModel(nullptr),
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_dtc(nullptr), m_sitMapGuiIfc(nullptr), m_session(session), m_ui(new Ui::AlarmView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --- AlarmView Konstruktor() ";
m_ui->setupUi(this);
@@ -50,13 +50,13 @@ ConfigParticipantsDialog::~ConfigParticipantsDialog()
void ConfigParticipantsDialog::retranslate()
{
if (!m_participantData.equipmentNumber.has_value())
if (!m_participantData.equipmentNumber().is_set())
{
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"));
}
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"));
m_uiRequirements->clear();
@@ -82,12 +82,12 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
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;
if (participantData.equipmentNumber.has_value())
if (participantData.equipmentNumber().is_set())
{
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber.get()));
equipmentNumbersStr.append(QString::number(participantData.equipmentNumber().get()));
equipmentNumbersStr.append(QStringLiteral(": "));
}
@@ -97,10 +97,10 @@ bool ConfigParticipantsDialog::init(const std::shared_ptr<ParticipantManagement:
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;
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId;
m_typeClass = ppmDtc->type(participantData.typeId()).typeClass();
DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId();
fillCbx();
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)
{
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;
switch (alarm.eventTypeId)
switch (alarm.eventTypeId().underlying())
{
case ProjectDataManagement::PdmEventType::EventType_Hit: {
DEBUG_LOG(m_logger) << "Hit zuweisen ";
m_ui->cbxDirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
if (alarm.vulnerabilityState >= 0)
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
if (alarm.vulnerabilityState() >= 0)
{
ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusDirect->setCurrentIndex(index);
}
break;
@@ -132,22 +132,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
case ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation: {
DEBUG_LOG(m_logger) << "HitIndirect zuweisen ";
m_ui->cbxIndirectFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_AirSupport: {
DEBUG_LOG(m_logger) << "AirSupport zuweisen ";
m_ui->cbxAirSupport->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_HitMine: {
DEBUG_LOG(m_logger) << "HitMine zuweisen ";
m_ui->cbxMines->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_HitB:
@@ -155,20 +155,20 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
case ProjectDataManagement::PdmEventType::EventType_HitC: {
DEBUG_LOG(m_logger) << "Hit N/B/C zuweisen ";
m_ui->cbxNbcAgent->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_FriendlyFire: {
DEBUG_LOG(m_logger) << "FriendlyFire zuweisen ";
m_ui->cbxFriendlyFire->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
if (alarm.vulnerabilityState >= 0)
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
if (alarm.vulnerabilityState() >= 0)
{
ProjectDataManagement::VulnerabilityState vulState =
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState);
int index = m_ui->cbStatusDirect->findData(QVariant(static_cast<int>(vulState)));
static_cast<ProjectDataManagement::VulnerabilityState>(alarm.vulnerabilityState());
int index = m_ui->cbStatusDirect->findData(QVariant(vulState.underlying()));
m_ui->cbStatusFriendly->setCurrentIndex(index);
}
break;
@@ -176,22 +176,22 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig&
case ProjectDataManagement::PdmEventType::EventType_Manipulation: {
DEBUG_LOG(m_logger) << "Manipulation zuweisen ";
m_ui->cbxManipulation->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline: {
DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen ";
m_ui->cbxGlobalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
case ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline: {
DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen ";
m_ui->cbxLocalBorderLine->setChecked(true);
m_ui->cbxSetMarker->setChecked(alarm.setMarker);
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow);
m_ui->cbxSetMarker->setChecked(alarm.setMarker());
m_ui->cbxMessageWindow->setChecked(alarm.messageWindow());
break;
}
default: {
@@ -207,68 +207,68 @@ std::vector<AlarmManagement::AlarmAction> ConfigParticipantsDialog::getCheckedVa
std::vector<AlarmManagement::AlarmAction> alarmsDds;
alarmActionDds.setMarker = m_ui->cbxSetMarker->isChecked();
alarmActionDds.messageWindow = m_ui->cbxMessageWindow->isChecked();
alarmActionDds.vulnerabilityState = -1;
alarmActionDds.setMarker(m_ui->cbxSetMarker->isChecked());
alarmActionDds.messageWindow(m_ui->cbxMessageWindow->isChecked());
alarmActionDds.vulnerabilityState(-1);
if (alarmActionDds.setMarker || alarmActionDds.messageWindow)
if (alarmActionDds.setMarker() || alarmActionDds.messageWindow())
{
if (m_ui->cbxDirectFire->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Hit;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Hit);
int statusDirect = -1;
if (m_ui->cbStatusDirect->currentIndex() > 0)
statusDirect = m_ui->cbStatusDirect->currentData().toInt();
alarmActionDds.vulnerabilityState = statusDirect;
alarmActionDds.vulnerabilityState(statusDirect);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxFriendlyFire->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_FriendlyFire;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_FriendlyFire);
int statusFriendly = -1;
if (m_ui->cbStatusFriendly->currentIndex() > 0)
statusFriendly = m_ui->cbStatusFriendly->currentData().toInt();
alarmActionDds.vulnerabilityState = statusFriendly;
alarmActionDds.vulnerabilityState(statusFriendly);
alarmsDds.push_back(alarmActionDds);
}
alarmActionDds.vulnerabilityState = -1;
alarmActionDds.vulnerabilityState(-1);
if (m_ui->cbxIndirectFire->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitEffectSimulation);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxAirSupport->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_AirSupport;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_AirSupport);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxMines->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitMine;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitMine);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxNbcAgent->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitN;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitN);
alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitB;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitB);
alarmsDds.push_back(alarmActionDds);
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_HitC;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_HitC);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxManipulation->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_Manipulation;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_Manipulation);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxGlobalBorderLine->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossGlobalBorderline);
alarmsDds.push_back(alarmActionDds);
}
if (m_ui->cbxLocalBorderLine->isChecked())
{
alarmActionDds.eventTypeId = ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline;
alarmActionDds.eventTypeId(ProjectDataManagement::PdmEventType::EventType_CrossLocalBorderline);
alarmsDds.push_back(alarmActionDds);
}
}
@@ -279,11 +279,11 @@ bool ConfigParticipantsDialog::apply()
{
DEBUG_LOG(m_logger) << "apply";
AlarmManagement::ConfigureAlarmsRequest req;
req.participantIds = m_participantVector;
req.alarms = getCheckedValues();
req.operatorId = m_operatorId;
req.global = false;
req.remove = false;
req.participantIds(m_participantVector);
req.alarms(getCheckedValues());
req.operatorId(m_operatorId);
req.global(false);
req.remove(false);
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->cbStatusFriendly, m_typeClass);
m_ui->cbStatusDirect->removeItem(
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
m_ui->cbStatusFriendly->removeItem(
m_ui->cbStatusDirect->findData(static_cast<int>(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance)));
m_ui->cbStatusDirect->findData(ProjectDataManagement::VulnerabilityState::VulnerabilityState_TemporarySeverance));
}
} // namespace ParticipantAlarms
@@ -99,8 +99,8 @@ void ParticipantsDialog::onSelectionChanged()
for (const QModelIndex& index : currentlySelectedParticipants)
{
const ParticipantManagement::ParticipantData data(m_participantModel->getParticipantData(index));
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
m_ppmDtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
configureAlarms = true;
DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column();
}
@@ -138,13 +138,13 @@ void ParticipantsDialog::onAddButtonClicked()
QModelIndex participantIndex = m_ui->dvParticipants->currentIndex();
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(participantIndex);
DEBUG_LOG(m_logger) << "current participantId = " << data.id;
m_participantVector.push_back(data.id);
DEBUG_LOG(m_logger) << "current participantId = " << data.id();
m_participantVector.push_back(data.id());
const auto partData = m_participantModel->getParticipantData(participantIndex);
addDialog(LtsWidgets::initDialog(new ConfigParticipantsDialog(this), m_ppmDtc, m_almDtc, m_almFtc, partData,
m_participantVector, m_equipmentVector),
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id));
m_menuGroup, QStringLiteral("ConfigAlarms%1").arg(partData.id()));
}
void ParticipantsDialog::onPrint()
@@ -168,12 +168,12 @@ void ParticipantsDialog::setChildrenSelected(const QModelIndex& parent)
DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected";
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(childIndex);
DEBUG_LOG(m_logger) << "append participantId = " << data.id;
m_participantVector.push_back(data.id);
if (data.equipmentNumber.has_value())
DEBUG_LOG(m_logger) << "append participantId = " << data.id();
m_participantVector.push_back(data.id());
if (data.equipmentNumber().is_set())
{
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber.get();
m_equipmentVector.push_back(data.equipmentNumber.get());
DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber().get();
m_equipmentVector.push_back(data.equipmentNumber().get());
}
m_ui->dvParticipants->selectionModel()->select(m_participantProxyModel->mapFromSource(childIndex),
@@ -8,7 +8,6 @@
#include <AreaEffectSimulation/aes_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <AlarmManagement/alm_ftc.h>
#include <AlarmManagement/alm_dtc.h>
@@ -37,10 +37,10 @@ void ParticipantAlarmModel::onParticipantChanged(const ParticipantManagement::Pa
DataModification modType)
{
Q_UNUSED(modType);
if (data.partyId != partyId())
if (data.partyId() != partyId())
return;
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated;
INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated();
onReinitModel(partyId());
emit newData();
}
@@ -50,17 +50,17 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex& index, bool*
bool isSimulatable = false;
const ParticipantManagement::ParticipantData data(getParticipantData(index));
if ((data.equipmentNumber.has_value() && data.equipmentNumber.get() > 0) ||
m_dtc->type(data.typeId).typeClass == ParticipantManagement::TypeClass::Unit)
if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) ||
m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass::Unit)
isSimulatable = true;
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id << " isSimulated:" << data.isSimulated
<< " equipmentNo:" << data.equipmentNumber << " typeId=" << data.typeId
<< " modId=" << data.modId << " typeClass=" << m_dtc->type(data.typeId).typeClass
DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated()
<< " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId()
<< " modId=" << data.modId() << " typeClass=" << m_dtc->type(data.typeId()).typeClass()
<< " isSimulatable=" << isSimulatable;
if (bIsSimulated)
*bIsSimulated = data.isSimulated;
*bIsSimulated = data.isSimulated();
return isSimulatable;
}
@@ -96,28 +96,28 @@ void ParticipantShowConfigView::onShowAlarm()
void ParticipantShowConfigView::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 = "
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId()
<< " operatorId = "
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId
<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId()
<< " 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();
if (!curIdx.isValid())
return;
const AlarmManagement::AlarmConfig& rowdata = m_configAlarmModel->getRowData(curIdx.row());
int operatorId = rowdata.operatorId;
int operatorId = rowdata.operatorId();
std::vector<int32_t> ddsParticipantIds;
ddsParticipantIds.push_back(rowdata.participantId);
ddsParticipantIds.push_back(rowdata.participantId());
bool globalEvent = true;
bool remove = true;
std::vector<AlarmManagement::AlarmAction> alarmsDds;
alarmsDds.resize(1);
alarmsDds[0].setMarker = false;
alarmsDds[0].messageWindow = false;
alarmsDds[0].eventTypeId = rowdata.eventTypeId;
alarmsDds[0].setMarker(false);
alarmsDds[0].messageWindow(false);
alarmsDds[0].eventTypeId(rowdata.eventTypeId());
AlarmManagement::ConfigureAlarmsRequest request(alarmsDds, operatorId, ddsParticipantIds, globalEvent, remove);
m_requestHelper->startSingleRequest([request, this]() {
@@ -6,7 +6,7 @@
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <LtsWidgets/lts_dialog.h>
#include <ParticipantManagement/ppm_dtc.h>
#include <AlarmManagement/Gui/Common/alm_config_alarm_model.h>
#include <AlarmManagement/Common/alm_config_alarm_model.h>
#include <AlarmManagement/alm_dtc.h>
#include <AlarmManagement/alm_ftc.h>
@@ -41,6 +41,7 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
void onPrint();
protected:
NGL::INGLLogger& m_logger;
void onConfigureAlarmsReply(const Core::FunctionReplyObject& replyObject) override final;
private:
@@ -56,8 +57,7 @@ class ParticipantShowConfigView : public LtsWidgets::LtsDialog,
Ui::ParticipantShowConfigView* m_ui;
LtsUtils::RequestHelper* m_requestHelper;
AlarmManagement::LOGGER_T m_logger;
AlarmManagement::
};
} // namespace ParticipantAlarms
@@ -2,7 +2,6 @@
#include "alm_emergency_call_dialog.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h"
#include "ui_alm_emergency_call_dialog.h"
@@ -19,8 +18,7 @@ namespace AlarmManagement
EmergencyCallDialog::EmergencyCallDialog(QWidget* parent)
: 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_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_session(nullptr), m_ui(new Ui::EmergencyCallDialog), m_requestHelper(new LtsUtils::RequestHelper(this))
{
m_ui->setupUi(this);
}
@@ -106,10 +104,10 @@ void EmergencyCallDialog::enaDisa()
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, false);
const AlmEmergencyCall& sos = getSelectedSOS();
if (sos.id <= 0)
if (sos.id() <= 0)
return;
if (!sos.expired)
if (!sos.expired())
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, true);
m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, true);
@@ -160,7 +158,7 @@ void EmergencyCallDialog::onEditBtCliked()
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
const AlmEmergencyCall& sos = getSelectedSOS();
if (sos.id <= 0)
if (sos.id() <= 0)
return;
setAcknowledgeUi();
@@ -183,16 +181,16 @@ void EmergencyCallDialog::onFindEmergencyOnMap()
return;
const AlmEmergencyCall& sos = getSelectedSOS();
if (sos.id <= 0)
if (sos.id() <= 0)
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)
{
Q_UNUSED(index)
emit openInfoDlg(getSelectedSOS().id);
emit openInfoDlg(getSelectedSOS().id());
}
void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
@@ -200,18 +198,18 @@ void EmergencyCallDialog::sendAcknowledgeEmergency(const QString& comment)
TRACE_LOG(m_logger) << Q_FUNC_INFO << " START";
const AlmEmergencyCall& sos = getSelectedSOS();
if (sos.id <= 0 || sos.expired)
if (sos.id() <= 0 || sos.expired())
return;
EmergencyCallAcknowledgeRequest request;
request.id = sos.id;
request.issi = sos.issi;
request.name = sos.name;
request.timestamp = QDateTime::currentMSecsSinceEpoch();
request.incomingTime = sos.incomingTime;
request.expired = true;
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
request.comment = comment.toStdString();
request.id(sos.id());
request.issi(sos.issi());
request.name(sos.name());
request.timestamp(QDateTime::currentMSecsSinceEpoch());
request.incomingTime(sos.incomingTime());
request.expired(true);
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
request.comment(comment.toStdString());
m_requestHelper->startSingleRequest(
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
@@ -82,9 +82,9 @@ QVector<LtsWidgets::PluginData> InterfaceImpl::getActions()
auto cb = [this](const AlmEmergencyCall &data)
{
if (data.id <= 0 || data.expired)
if (data.id() <= 0 || data.expired())
return;
this->showEmergencyCallInfoWindow(data.id);
this->showEmergencyCallInfoWindow(data.id());
};
m_dtc->almEmergencyCalls(cb);
@@ -111,10 +111,10 @@ void InterfaceImpl::onEmergencyCallChanged(const AlmEmergencyCall &data, DataMod
{
if (modType != DataModification::eAdded)
return;
if (data.id <= 0 || data.expired)
if (data.id() <= 0 || data.expired())
return;
this->showEmergencyCallInfoWindow(data.id);
this->showEmergencyCallInfoWindow(data.id());
}
void InterfaceImpl::onOpenInfoDlg(const int &id)
@@ -2,7 +2,6 @@
#include "alm_emergency_call_info_dialog.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include "ui_alm_emergency_call_info_dialog.h"
#include <AlarmManagement/alm_operator_rights.h>
@@ -47,11 +46,10 @@ QImage renderEmergencySymbol(bool expired = false)
EmergencyCallInfoDialog::EmergencyCallInfoDialog(int entryId, QWidget* parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_ftc(nullptr),
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog),
m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_requestHelper(new LtsUtils::RequestHelper(this)), m_ui(new Ui::EmergencyCallInfoDialog)
{
m_ui->setupUi(this);
m_emergency.id = entryId;
m_emergency.id(entryId);
}
EmergencyCallInfoDialog::~EmergencyCallInfoDialog()
@@ -79,7 +77,7 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
m_dtc->enableAlmEmergencyCall();
m_ftc->enableEmergencyCallAcknowledge();
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
setUiValues();
connect(m_dtc.get(), &AlarmManagement::Interface::Dtc::almEmergencyCallChanged, this,
@@ -94,34 +92,34 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr<Interface::Ftc>& ftc,
QString EmergencyCallInfoDialog::emergencyIdentifier() const
{
return QStringLiteral("emergency_") + QString::number(m_emergency.id);
return QStringLiteral("emergency_") + QString::number(m_emergency.id());
}
bool EmergencyCallInfoDialog::setUiValues()
{
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";
return false;
}
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi));
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime)));
m_ui->lblStatus->setText(m_emergency.expired
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted))
m_ui->lblEquipNr->setText(QString::number(m_emergency.issi()));
m_ui->lblIncomingTime->setText(DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.incomingTime())));
m_ui->lblStatus->setText(m_emergency.expired()
? DTG::toString(QDateTime::fromMSecsSinceEpoch(m_emergency.deleted()))
: QStringLiteral("--"));
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment));
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position.lon, m_emergency.position.lat);
m_ui->lblComment->setText(QString::fromStdString(m_emergency.comment()));
QString mgrs = LtsCoordTrans::mgrsFromGeographic(m_emergency.position().lon(), m_emergency.position().lat());
m_ui->lblPosition->setText(mgrs);
const bool& hasOperatorRightEmergencyCall =
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::EmergencyCall);
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);
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired));
QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired()));
m_ui->lblIcon->setPixmap(iconPixmap);
TRACE_LOG(m_logger) << Q_FUNC_INFO << " END";
@@ -131,7 +129,7 @@ bool EmergencyCallInfoDialog::setUiValues()
void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergencyCall data, DataModification modType)
{
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;
if (modType == DataModification::eRemoved)
@@ -151,9 +149,9 @@ void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergen
void EmergencyCallInfoDialog::onFindEmergencyOnMap()
{
if (!m_sitMapGuiIfc || m_emergency.id <= 0)
if (!m_sitMapGuiIfc || m_emergency.id() <= 0)
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()
@@ -193,18 +191,18 @@ void EmergencyCallInfoDialog::onPbAckEmergencyClicked()
void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString& comment)
{
if (m_emergency.id <= 0)
if (m_emergency.id() <= 0)
return;
EmergencyCallAcknowledgeRequest request;
request.id = m_emergency.id;
request.name = m_emergency.name;
request.issi = m_emergency.issi;
request.timestamp = QDateTime::currentMSecsSinceEpoch();
request.incomingTime = m_emergency.incomingTime;
request.expired = true;
request.operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
request.comment = comment.toStdString();
request.id(m_emergency.id());
request.name(m_emergency.name());
request.issi(m_emergency.issi());
request.timestamp(QDateTime::currentMSecsSinceEpoch());
request.incomingTime(m_emergency.incomingTime());
request.expired(true);
request.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId());
request.comment(comment.toStdString());
bool ret = m_requestHelper->startSingleRequest(
[this, request]() { return m_ftc->emergencyCallAcknowledgeRequest(request, this); });
@@ -214,8 +212,8 @@ void EmergencyCallInfoDialog::sendAcknowledgeEmergencyCallRequest(const QString&
void EmergencyCallInfoDialog::retranslate()
{
m_emergency = m_dtc->almEmergencyCall(m_emergency.id);
const QString lbName = tr("SOS_%1").arg(m_emergency.issi);
m_emergency = m_dtc->almEmergencyCall(m_emergency.id());
const QString lbName = tr("SOS_%1").arg(m_emergency.issi());
translate(m_ui, lbName);
}
@@ -2,7 +2,6 @@
#include "alm_emergency_call_model.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QDateTime>
@@ -25,7 +24,6 @@ EmergencyCallModel::EmergencyCallModel(QObject *parent)
tr("Comment"),
}, parent)
, m_dtc(nullptr)
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
{}
QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
@@ -37,35 +35,35 @@ QVariant EmergencyCallModel::data(const QModelIndex &index, int role) const
switch (index.column())
{
case Columns::ID:
return almEmergency.id;
return almEmergency.id();
case SAMPLE_TIME:
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime);
return QDateTime::fromMSecsSinceEpoch(almEmergency.sampleTime());
case INCOMING_TIME:
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime);
return QDateTime::fromMSecsSinceEpoch(almEmergency.incomingTime());
case NAME:
return QString::fromStdString(almEmergency.name);
return QString::fromStdString(almEmergency.name());
case ISSI:
return almEmergency.issi;
return almEmergency.issi();
case POSITION:
{
if (std::isnan(almEmergency.position.lat))
if (std::isnan(almEmergency.position().lat()))
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;
}
case EXPIRED:
return almEmergency.expired;
return almEmergency.expired();
case OPERATION_ID:
{
if (almEmergency.operatorId == 0)
if (almEmergency.operatorId() == 0)
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:
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted);
return QDateTime::fromMSecsSinceEpoch(almEmergency.deleted());
case COMMENT:
return QString::fromStdString(almEmergency.comment);
return QString::fromStdString(almEmergency.comment());
default:
break;
}
@@ -91,7 +89,7 @@ bool EmergencyCallModel::initModel(const std::shared_ptr<Interface::Dtc> &dtc,
void EmergencyCallModel::onAlarmEmergencyCallChanged(const AlarmManagement::AlmEmergencyCall &data, const DataModification modType)
{
const int id = data.id;
const int id = data.id();
int row = findRowForId(id);
switch (modType)
{
@@ -150,7 +148,7 @@ bool EmergencyCallProxyModel::filterAcceptsRow(int source_row, const QModelIndex
bool EmergencyCallProxyModel::checkFilter(int source_row) const
{
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 true;
@@ -8,16 +8,16 @@
#include <ChargeEffect/aes_charge_effect_gui_plugin_interface.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
#include <AreaEffectSimulation/BCContamination/aes_bccontamination_gui_plugin_interface.h>
#include <AreaEffectSimulation/Borderline/aes_borderline_gui_plugin_interface.h>
#include <AreaEffectSimulation/DangerArea/aes_danger_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/Explosion/aes_explosion_gui_plugin_interface.h>
#include <AreaEffectSimulation/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineArea/aes_mine_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
#include <AreaEffectSimulation/NContamination/aes_ncontamination_gui_plugin_interface.h>
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
#include <ngltools/ngltools_dtg.h>
@@ -26,7 +26,7 @@ namespace AreaEffectSimulation
AesChargeEffectItemInfo::AesChargeEffectItemInfo(int chargeEffectId, QWidget* parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_session(nullptr),
m_ChargeEffectId(chargeEffectId), m_ui(new Ui::AesChargeEffectItemInfo), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_ChargeEffectId(chargeEffectId), m_ui(new Ui::AesChargeEffectItemInfo)
{
m_ui->setupUi(this);
@@ -77,8 +77,8 @@ bool AesChargeEffectItemInfo::init(LtsSession::LtsSession* session)
m_ui->lblOriginatorType->hide();
#endif
m_ui->lblOriginatorId->setText(QString::number(data.originatorId));
m_ui->lblOriginatorType->setText(QString::number(static_cast<int>(data.originatorTypeId)));
m_ui->lblOriginatorId->setText(QString::number(data.originatorId()));
m_ui->lblOriginatorType->setText(QString::number(data.originatorTypeId().underlying()));
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Charge_Effect"));
@@ -93,7 +93,7 @@ bool AesChargeEffectItemInfo::init(LtsSession::LtsSession* session)
void AesChargeEffectItemInfo::retranslate()
{
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
@@ -111,7 +111,7 @@ template <typename InterfaceType> bool AesChargeEffectItemInfo::tryShowStandardE
std::shared_ptr<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)
{
addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab);
@@ -129,11 +129,11 @@ void AesChargeEffectItemInfo::onShowDetails()
const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId);
if (item.originatorTypeId == ProjectDataManagement::StateChangeOriginator::StateChangeOriginator_AreaEffectSimulation)
if (item.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation)
{
AesItemView aiv;
m_aesDtc->aesItemViewFromEntityId(item.originatorId, AreaEffectSimulation::AesType::AtUnknown, aiv);
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id << ", aesType: " << aiv.aesTypeId;
m_aesDtc->aesItemViewFromEntityId(item.originatorId(), AreaEffectSimulation::AesType::AtUnknown, aiv);
DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId();
auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) {
if (dialog)
@@ -142,7 +142,7 @@ void AesChargeEffectItemInfo::onShowDetails()
}
};
switch (aiv.aesTypeId)
switch (aiv.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType::AtNContamination: {
tryShowStandardEditDialog<AesNContamination::ForeignGuiInterface>(aiv);
@@ -179,11 +179,11 @@ void AesChargeEffectItemInfo::onShowDetails()
std::shared_ptr<AesBCContamination::ForeignGuiInterface> ifc;
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct.chargeTypeId);
if (gearClass == ProjectDataManagement::GearClass::GearClass_Biological)
registerDialog(ifc->showEditWindow(aiv.aesItemId, false, this));
else if (gearClass == ProjectDataManagement::GearClass::GearClass_Chemical)
registerDialog(ifc->showEditWindow(aiv.aesItemId, true, this));
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
if (gearClass == ProjectDataManagement::GearClass::Biological)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), false, this));
else if (gearClass == ProjectDataManagement::GearClass::Chemical)
registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this));
}
else
WARNING_LOG(m_logger)
@@ -194,7 +194,7 @@ void AesChargeEffectItemInfo::onShowDetails()
case AreaEffectSimulation::AesType::AtBoobyTrapSecondary: {
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId, this));
registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId(), this));
else
WARNING_LOG(m_logger)
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
@@ -204,7 +204,7 @@ void AesChargeEffectItemInfo::onShowDetails()
case AreaEffectSimulation::AesType::AtOffRouteMineSecondary: {
std::shared_ptr<AesMineSingleVirtual::ForeignGuiInterface> ifc;
if (m_session->getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface>(ifc))
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId, this));
registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId(), this));
else
WARNING_LOG(m_logger)
<< Q_FUNC_INFO << " getForeignGuiInterface<AesMineSingleVirtual::ForeignGuiInterface> failed!";
@@ -216,8 +216,8 @@ void AesChargeEffectItemInfo::onShowDetails()
if (m_session->getForeignGuiInterface<AesExplosion::ForeignGuiInterface>(ifc))
{
const bool isExplosionSingle =
(aiv.aesTypeId == AreaEffectSimulation::AesType::AtExplosionSingle);
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct.chargeTypeId);
(aiv.aesTypeId().underlying() == AreaEffectSimulation::AesType::AtExplosionSingle);
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(aiv.chargeStruct().chargeTypeId());
for (auto gc :
{ProjectDataManagement::GearClass::GearClass_Artillery, ProjectDataManagement::GearClass::GearClass_Mortar,
@@ -228,7 +228,7 @@ void AesChargeEffectItemInfo::onShowDetails()
if (gearClass == gc)
{
registerDialog(ifc->showEditWindow(aiv.aesItemId, isExplosionSingle, false, gc, this));
registerDialog(ifc->showEditWindow(aiv.aesItemId(), isExplosionSingle, false, gc, this));
break;
}
}
@@ -246,8 +246,8 @@ void AesChargeEffectItemInfo::onShowDetails()
{
AesItem ai;
m_aesDtc->aesItemFromId(aiv.aesItemId, ai);
registerDialog(ifc->showEditWindow(aiv.aesItemId, ai.effectSourceId, this));
m_aesDtc->aesItemFromId(aiv.aesItemId(), ai);
registerDialog(ifc->showEditWindow(aiv.aesItemId(), ai.effectSourceId(), this));
}
else
WARNING_LOG(m_logger)
@@ -274,7 +274,7 @@ void AesChargeEffectItemInfo::onShowDetails()
break;
case AreaEffectSimulation::AesType::AtUnknown:
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;
default:
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)
{
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id;
if (data.id == m_ChargeEffectId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id();
if (data.id() == m_ChargeEffectId && modType != DataModification::eRemoved)
handleChargeEffect(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->lbxEffectDuration->setVisible(data.effectDuration > 0);
m_ui->lblEffectDuration->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->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->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId));
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(data.chargeTypeId()));
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(data.chargeTypeId()));
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));
}
@@ -18,7 +18,7 @@ namespace AreaEffectSimulation
DangerAreaAesItemInfo::DangerAreaAesItemInfo(QWidget* parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly), m_dtc(nullptr), m_session(nullptr),
m_ui(new Ui::DangerAreaAesItemInfo), m_aesItemId(-1), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_ui(new Ui::DangerAreaAesItemInfo), m_aesItemId(-1)
{
m_ui->setupUi(this);
}
@@ -34,35 +34,35 @@ void DangerAreaAesItemInfo::retranslate()
{
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"));
return;
}
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"));
return;
}
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"));
return;
}
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"));
return;
}
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"));
return;
@@ -114,7 +114,7 @@ void DangerAreaAesItemInfo::insertAesItem(int aesItemId)
{
AesItem* item;
item = new BCContamination(m_dtc->bCContamination(aesItemId));
if (item->id > 0)
if (item->id() > 0)
{
m_aesItems.insert(aesItemId, AesStruct(AesType::AtBCContamination, item));
return;
@@ -131,7 +131,7 @@ void DangerAreaAesItemInfo::setText()
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);
}
}
@@ -11,18 +11,18 @@
#include <LtsSession/lts_session_data.h>
#include <LtsUtilsSettings/settings.h>
#include <PluginInterfaces/gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/BCContamination/aes_bccontamination_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.h>
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
#include <Plugins/AreaEffectSimulation/Gui/Borderline/aes_borderline_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/DangerArea/aes_danger_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_explosion_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineArea/aes_mine_area_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
#include <Plugins/AreaEffectSimulation/Gui/NContamination/aes_ncontamination_gui_plugin_interface.h>
#include <AreaEffectSimulation/BCContamination/aes_bccontamination_gui_plugin_interface.h>
#include <AreaEffectSimulation/Base/aes_base_edit.h>
#include <AreaEffectSimulation/Base/aes_base_model.h>
#include <AreaEffectSimulation/Borderline/aes_borderline_gui_plugin_interface.h>
#include <AreaEffectSimulation/DangerArea/aes_danger_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/Explosion/aes_explosion_gui_plugin_interface.h>
#include <AreaEffectSimulation/FunctionalArea/aes_functional_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/GasPipe/aes_gas_pipe_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineArea/aes_mine_area_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineCorridor/aes_mine_corridor_gui_plugin_interface.h>
#include <AreaEffectSimulation/MineSingleVirtual/aes_mine_single_virtual_gui_plugin_interface.h>
#include <AreaEffectSimulation/NContamination/aes_ncontamination_gui_plugin_interface.h>
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
#include <ProjectDataManagement/pdm.hpp>
#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),
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_requestHelper(new LtsUtils::RequestHelper(this)), m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger())
m_requestHelper(new LtsUtils::RequestHelper(this))
{
DEBUG_LOG(m_logger) << "ctor AesInfoDialog() ";
m_ui->setupUi(this);
@@ -64,18 +64,18 @@ void AesInfoDialog::retranslate()
bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
{
if (aesItemView.aesItemId != m_aesEntityId)
if (aesItemView.aesItemId() != m_aesEntityId)
return false;
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;
}
switch (aesItemView.aesTypeId)
switch (aesItemView.aesTypeId().underlying())
{
case AreaEffectSimulation::AesType::AtNContamination: {
handleNContamination(aesItemView);
@@ -245,7 +245,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView& aesItemView)
break;
case AreaEffectSimulation::AesType::AtUnknown:
WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId " << m_aesEntityId << ": "
<< aesItemView.aesTypeId;
<< aesItemView.aesTypeId();
Q_ASSERT(false);
break;
}
@@ -311,7 +311,7 @@ bool AesInfoDialog::init(LtsSession::LtsSession* session, const std::shared_ptr<
void AesInfoDialog::handleNContamination(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleNContamination(m_dtc->nContamination(m_aesEntityId));
}
@@ -319,19 +319,19 @@ void AesInfoDialog::handleNContamination(const AesItemView& aesItemView)
void AesInfoDialog::handleNContamination(const AreaEffectSimulation::NContamination& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::NContamination)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtNContamination);
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));
}
void AesInfoDialog::handleBCContamination(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleBCContamination(m_dtc->bCContamination(m_aesEntityId));
}
@@ -339,21 +339,21 @@ void AesInfoDialog::handleBCContamination(const AesItemView& aesItemView)
void AesInfoDialog::handleBCContamination(const AreaEffectSimulation::BCContamination& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BCContamination)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtBCContamination);
m_bcChargeTypeId = data.chargeStruct.chargeTypeId;
m_bcChargeTypeId = data.chargeStruct().chargeTypeId();
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));
}
void AesInfoDialog::handleBoobyTrap(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleBoobyTrap(m_dtc->boobyTrap(m_aesEntityId));
}
@@ -361,11 +361,11 @@ void AesInfoDialog::handleBoobyTrap(const AesItemView& aesItemView)
void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
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->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->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));
}
void AesInfoDialog::handleOffRouteMine(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleOffRouteMine(m_dtc->offRouteMine(m_aesEntityId));
}
@@ -388,11 +388,11 @@ void AesInfoDialog::handleOffRouteMine(const AesItemView& aesItemView)
void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
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->setToolTip(m_pdmDtc->trChargeTypeName(m_bcChargeTypeId, true));
@@ -401,14 +401,14 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine&
m_ui->lblPosition->show();
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));
}
void AesInfoDialog::handleExplosionArea(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleExplosionArea(m_dtc->explosionArea(m_aesEntityId));
}
@@ -416,19 +416,19 @@ void AesInfoDialog::handleExplosionArea(const AesItemView& aesItemView)
void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionArea& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtExplosionArea);
m_areaExpChargeTypeId = data.chargeStruct.chargeTypeId;
m_areaExpChargeTypeId = data.chargeStruct().chargeTypeId();
const Area& area = data.area;
if (!qFuzzyCompare(area.cornerBottomLeft.lon, 0) || !qFuzzyCompare(area.cornerBottomLeft.lat, 0))
const Area& area = data.area();
if (!qFuzzyCompare(area.cornerBottomLeft().lon(), 0) || !qFuzzyCompare(area.cornerBottomLeft().lat(), 0))
{
m_ui->lblPosition->show();
QPointF bottomLeft(area.cornerBottomLeft.lon, area.cornerBottomLeft.lat);
QPointF bottomLeft(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat());
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());
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)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleExplosionSingle(m_dtc->explosionSingle(m_aesEntityId));
}
void AesInfoDialog::handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionSingle)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtExplosionSingle);
m_singleExpChargeTypeId = data.chargeStruct.chargeTypeId;
m_singleExpChargeTypeId = data.chargeStruct().chargeTypeId();
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));
}
void AesInfoDialog::handleMineArea(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleMineArea(m_dtc->mineArea(m_aesEntityId));
}
void AesInfoDialog::handleMineArea(const AreaEffectSimulation::MineArea& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtMineArea);
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));
bool bResetVisbile =
(data.isDus || data.isConcrete) &&
(data.isDus() || data.isConcrete()) &&
LtsSessionData::LtsSessionData::getInstance()->hasOperatorRight(OperatorRights::MineAreasResetDusMines) &&
((m_session->app() == LtsAppDescriptor::App::Situation ||
m_session->app() == LtsAppDescriptor::App::SituationTablet) &&
(!m_session->isReplayPartition()));
m_ui->pbResetDusMines->setVisible(bResetVisbile);
m_mineIsReactivatable = data.isReactivatable;
m_ui->pbResetDusMines->setToolTip(data.isDus ? tr("Reset DUS Mines matched to this Minearea")
m_mineIsReactivatable = data.isReactivatable();
m_ui->pbResetDusMines->setToolTip(data.isDus() ? tr("Reset DUS Mines matched to this Minearea")
: tr("Reset Concrete Mines matched to this Minearea"));
}
void AesInfoDialog::handleMineCorridor(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleMineCorridor(m_dtc->mineCorridor(m_aesEntityId));
}
void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtMineCorridor);
@@ -510,14 +510,14 @@ void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor&
void AesInfoDialog::handleGasPipe(const AesItemView& 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));
}
void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::GasPipe)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtGasPipe);
@@ -531,23 +531,23 @@ void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe& data)
void AesInfoDialog::handleDangerArea(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleDangerArea(m_dtc->dangerArea(m_aesEntityId));
}
void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::DangerArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtDangerArea);
const auto& qv = data.segments;
const auto& qv = data.segments();
if (qv.size() > 0)
{
m_ui->lblPosition->show();
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));
}
@@ -558,23 +558,23 @@ void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea& dat
void AesInfoDialog::handleBorderline(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleBorderline(m_dtc->borderline(m_aesEntityId));
}
void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::Borderline)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtBorderline);
const auto& qv = data.segments;
const auto& qv = data.segments();
if (qv.size() > 0)
{
m_ui->lblPosition->show();
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));
}
}
@@ -582,30 +582,30 @@ void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline& dat
void AesInfoDialog::handleFunctionalArea(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleFunctionalArea(m_dtc->functionalArea(m_aesEntityId));
}
void AesInfoDialog::handleFunctionalArea(const FunctionalArea& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtFunctionalArea);
QStringList chargeTypesNames;
QStringList chargeTypesShortNames;
if (data.medicMode != AesOperatingMode::OmNotUsed)
if (data.medicMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(411, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(411, true);
}
if (data.maintMode != AesOperatingMode::OmNotUsed)
if (data.maintMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(412, true);
chargeTypesShortNames << m_pdmDtc->trChargeTypeShortName(412, true);
}
if (data.deconMode != AesOperatingMode::OmNotUsed)
if (data.deconMode() != AesOperatingMode::OmNotUsed)
{
chargeTypesNames << m_pdmDtc->trChargeTypeName(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->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 =
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());
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)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleAirSupportImpact(m_dtc->airSupportImpact(m_aesEntityId));
}
void AesInfoDialog::handleAirSupportImpact(const AirSupportImpact& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtAirSupportImpact);
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->lbFlightTime->show();
m_ui->lblFlightTime->show();
m_ui->lblFlightTime->setText(LtsWidgets::readableDuration(data.flightTime));
m_ui->lblFlightTime->setText(LtsWidgets::readableDuration(data.flightTime()));
}
void AesInfoDialog::handleMineAraeSingleMine()
@@ -651,14 +651,14 @@ void AesInfoDialog::handleMineAraeSingleMine()
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
return;
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);
if (mine.eqId == m_aesEntityId)
const DusMine& mine = dms.mines().at(i);
if (mine.eqId() == m_aesEntityId)
{
if (itemView.form.size() <= i)
if (itemView.form().size() <= i)
return;
handleMineAraeSingleMine(itemView.form.at(i), mine);
handleMineAraeSingleMine(itemView.form().at(i), mine);
return;
}
}
@@ -679,12 +679,12 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
m_ui->lblAesDuration->hide();
m_ui->pbDetails->hide();
m_aesEntityName = QString::number(mine.eqId);
m_aesEntityName = QString::number(mine.eqId());
m_ui->lblAesTypeId->setText(QString::number(static_cast<int>(m_aesType)));
m_ui->lblAesTypeId->setText(QString::number(m_aesType.underlying()));
m_ui->lblAesType->setText(toString(m_aesType));
const int ctId = mine.chargeTypeId;
const int ctId = mine.chargeTypeId();
if (ctId != 0)
{
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(ctId, true));
@@ -699,11 +699,11 @@ void AesInfoDialog::handleMineAraeSingleMine(const Core::GeoPosition2D& position
else
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;
if (mine.triggered && isDus)
if (mine.triggered() && isDus)
{
m_ui->lblStatus->setText(tr("Inactive"));
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")
: 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->show();
@@ -747,21 +747,21 @@ void AesInfoDialog::handleSingleDusMine()
m_ui->lblAesDuration->hide();
m_ui->pbDetails->hide();
m_aesEntityName = QString::number(dsm.id);
m_aesEntityName = QString::number(dsm.id());
m_ui->lblAesTypeId->setText(QString::number(static_cast<int>(m_aesType)));
m_ui->lblAesTypeId->setText(QString::number(m_aesType.underlying()));
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->setToolTip(m_pdmDtc->trChargeTypeName(ctId));
m_ui->lblChargeType->show();
m_ui->lblChargeTypeId->setText(QString::number(ctId));
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)
switch (dsm.effectStateId().underlying())
{
case AesEffectState::EsExpired:
m_ui->lblStatus->setText(tr("Inactive"));
@@ -792,7 +792,7 @@ void AesInfoDialog::handleSingleDusMine()
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->show();
@@ -802,18 +802,18 @@ void AesInfoDialog::handleSingleDusMine()
void AesInfoDialog::handleExplosionCluster(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleExplosionCluster(m_dtc->explosionCluster(m_aesEntityId));
}
void AesInfoDialog::handleExplosionCluster(const ExplosionCluster& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionCluster)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
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->setToolTip(m_pdmDtc->trChargeTypeName(m_explosionClusterChargeTypeId, true));
m_ui->lblChargeType->show();
@@ -823,32 +823,32 @@ void AesInfoDialog::handleExplosionCluster(const ExplosionCluster& data)
void AesInfoDialog::handleEffectCluster(const AesItemView& aesItemView)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)"
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId;
<< " aesItemView.aesItemId(): " << aesItemView.aesItemId();
handleEffectCluster(m_dtc->effectCluster(m_aesEntityId));
}
void AesInfoDialog::handleEffectCluster(const EffectCluster& data)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::EffectCluster)"
<< " data.id(): " << data.id;
<< " data.id(): " << data.id();
handleAesItem(data, AesType::AtEffectCluster);
}
void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
{
m_aesEntityName = QString::fromStdString(aesData.name);
m_aesEffectSource = aesData.effectSourceId;
m_aesEntityName = QString::fromStdString(aesData.name());
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(static_cast<int>(aesTypeId)));
m_ui->lblAesTypeId->setText(QString::number(aesTypeId.underlying()));
const ProjectDataManagement::GearClass gearClass =
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct.chargeTypeId);
switch (gearClass)
m_pdmDtc->gearClassFromChargeTypeId(aesData.chargeStruct().chargeTypeId());
switch (gearClass.underlying())
{
case ProjectDataManagement::GearClass::GearClass_Biological:
case ProjectDataManagement::GearClass::GearClass_Chemical:
case ProjectDataManagement::GearClass::Biological:
case ProjectDataManagement::GearClass::Chemical:
m_ui->lblAesType->setText(ProjectDataManagement::toString(gearClass));
break;
default:
@@ -857,28 +857,28 @@ void AesInfoDialog::handleAesItem(const AesItem& aesData, AesType aesTypeId)
m_ui->lblAesName->setText(m_aesEntityName);
if (aesData.effectStart.has_value())
m_ui->lblAesStart->setText(DTG::toStringMSec(aesData.effectStart.get()));
if (aesData.effectStart().is_set())
m_ui->lblAesStart->setText(DTG::toStringMSec(aesData.effectStart().get()));
else
m_ui->lblAesStart->setText(tr("None"));
if (aesData.effectDuration == 0)
if (aesData.effectDuration() == 0)
{
m_ui->lbAesDuration->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("---"));
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->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->setToolTip(m_pdmDtc->trChargeTypeName(aesData.chargeStruct.chargeTypeId));
m_ui->lblChargeType->setText(m_pdmDtc->trChargeTypeShortName(aesData.chargeStruct().chargeTypeId()));
m_ui->lblChargeType->setToolTip(m_pdmDtc->trChargeTypeName(aesData.chargeStruct().chargeTypeId()));
}
void AesInfoDialog::onFindOnMap()
@@ -895,7 +895,7 @@ void AesInfoDialog::onShowDetails()
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
switch (m_aesType)
switch (m_aesType.underlying())
{
case AreaEffectSimulation::AesType::AtNContamination: {
std::shared_ptr<AesNContamination::ForeignGuiInterface> ifc;
@@ -916,7 +916,7 @@ void AesInfoDialog::onShowDetails()
if (m_session->getForeignGuiInterface<AesBCContamination::ForeignGuiInterface>(ifc))
{
const auto gearClass = m_pdmDtc->gearClassFromChargeTypeId(m_bcChargeTypeId);
if (gearClass == ProjectDataManagement::GearClass::GearClass_Biological)
if (gearClass == ProjectDataManagement::GearClass::Biological)
{
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, false, this);
if (dialog)
@@ -925,7 +925,7 @@ void AesInfoDialog::onShowDetails()
break;
}
if (gearClass == ProjectDataManagement::GearClass::GearClass_Chemical)
if (gearClass == ProjectDataManagement::GearClass::Chemical)
{
AreaEffectSimulation::BaseEdit* dialog = ifc->showEditWindow(m_aesEntityId, true, this);
if (dialog)
@@ -1162,118 +1162,118 @@ bool AesInfoDialog::onResetDusMines()
void AesInfoDialog::onNContaminationChanged(const AreaEffectSimulation::NContamination& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleNContamination(data);
}
void AesInfoDialog::onBCContaminationChanged(const AreaEffectSimulation::BCContamination& data,
DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleBCContamination(data);
}
void AesInfoDialog::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleBoobyTrap(data);
}
void AesInfoDialog::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleOffRouteMine(data);
}
void AesInfoDialog::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleExplosionArea(data);
}
void AesInfoDialog::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle& data,
DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleExplosionSingle(data);
}
void AesInfoDialog::onMineAreaChanged(const AreaEffectSimulation::MineArea& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleMineArea(data);
}
void AesInfoDialog::onMineCorridorChanged(const MineCorridor& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleMineCorridor(data);
}
void AesInfoDialog::onGasPipeChanged(const GasPipe& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleGasPipe(data);
}
void AesInfoDialog::onDangerAreaChanged(const AreaEffectSimulation::DangerArea& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleDangerArea(data);
}
void AesInfoDialog::onBorderlineChanged(const AreaEffectSimulation::Borderline& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleBorderline(data);
}
void AesInfoDialog::onFunctionalAreaChanged(const FunctionalArea& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleFunctionalArea(data);
}
void AesInfoDialog::onAirSupportImpactChanged(const AirSupportImpact& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleAirSupportImpact(data);
}
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)
return;
if (data.id != 0)
if (data.id() != 0)
return;
AesItemView itemView;
if (!m_dtc->aesItemViewFromEntityId(0, m_aesType, itemView))
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);
if (mine.eqId == m_aesEntityId)
const DusMine& mine = data.mines().at(i);
if (mine.eqId() == m_aesEntityId)
{
if (itemView.form.size() <= i)
if (itemView.form().size() <= i)
return;
handleMineAraeSingleMine(itemView.form.at(i), mine);
handleMineAraeSingleMine(itemView.form().at(i), mine);
return;
}
}
@@ -1281,22 +1281,22 @@ void AesInfoDialog::onDusMineStateChanged(const DusMineState& data, DataModifica
void AesInfoDialog::onDusSingleMineChanged(const DusSingleMine& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleSingleDusMine();
}
void AesInfoDialog::onExplosionClusterChanged(const ExplosionCluster& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleExplosionCluster(data);
}
void AesInfoDialog::onEffectClusterChanged(const EffectCluster& data, DataModification modType)
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id;
if (data.id == m_aesEntityId && modType != DataModification::eRemoved)
DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id();
if (data.id() == m_aesEntityId && modType != DataModification::eRemoved)
handleEffectCluster(data);
}
@@ -61,17 +61,17 @@ bool CustomViewAirSupportImpact::init(const QModelIndex &idx)
bool CustomViewAirSupportImpact::calculateIcon(const AirSupportImpact &asi, const QColor &color)
{
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;
if (!m_session->getDtc<ProjectDataManagement::DataInterface>(pdmDtc))
return false;
double radius = pdmDtc->impactRadius(asi.chargeStruct.chargeTypeId,
asi.chargeStruct.igniterTypeId,
asi.chargeStruct.igniterFunctionId);
double radius = pdmDtc->impactRadius(asi.chargeStruct().chargeTypeId(),
asi.chargeStruct().igniterTypeId(),
asi.chargeStruct().igniterFunctionId());
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);
m_ui->lblIcon->setPixmap(pix);
@@ -3,8 +3,8 @@
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
#include <AreaEffectSimulation/Base/aes_itemlist.h>
#include <AreaEffectSimulation/Base/aes_base_model.h>
#include "aes_air_support_9liner_model.h"
namespace Ui
@@ -48,36 +48,36 @@ QVariant AirSupport9LinerModel::data(const QModelIndex &index, int role) const
switch (index.column())
{
case ParticipantId:
return item.participantId;
return item.participantId();
case Participant:
{
if (!m_ppmDtc)
return QString();
return m_ppmDtc->hierarchyFromParticipant(item.participantId);
return m_ppmDtc->hierarchyFromParticipant(item.participantId());
}
case Timestamp:
return QDateTime::fromMSecsSinceEpoch(item.sampleTime);
return QDateTime::fromMSecsSinceEpoch(item.sampleTime());
case AttackHeading:
{
if (item.finalAttackHeading < 0)
if (item.finalAttackHeading() < 0)
return QVariant();
if (item.finalAttackHeadingHigh < 0)
if (item.finalAttackHeadingHigh() < 0)
return tr("%1 degree")
.arg(item.finalAttackHeading);
.arg(item.finalAttackHeading());
return tr("%1 degree (low: %2 degree, high: %3 degreee)", "degree as symbol!")
.arg(item.finalAttackHeading)
.arg(item.finalAttackHeadingLow)
.arg(item.finalAttackHeadingHigh);
.arg(item.finalAttackHeading())
.arg(item.finalAttackHeadingLow())
.arg(item.finalAttackHeadingHigh());
}
case TargetPosition:
{
if (std::isnan(item.targetPosition.lat))
if (std::isnan(item.targetPosition().lat()))
return tr("---");
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(item.targetPosition.lon,
item.targetPosition.lat));
LtsCoordTrans::UtmCoordinate coord(LtsCoordTrans::UtmCoordinate::fromGeographic(item.targetPosition().lon(),
item.targetPosition().lat()));
QString ret = coord.mgrs();
if (item.targetPosition.z > 0)
ret += QLatin1Char(' ') + QString::number(qRound(item.targetPosition.z));
if (item.targetPosition().z() > 0)
ret += QLatin1Char(' ') + QString::number(qRound(item.targetPosition().z()));
return ret;
}
}
@@ -131,7 +131,7 @@ bool AirSupport9LinerProxyModel::filterAcceptsRow(int source_row, const QModelIn
return true;
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 false;
}
@@ -150,27 +150,27 @@ bool AirSupport9LinerProxyModel::lessThan(const QModelIndex &source_left, const
switch (source_left.column())
{
case AirSupport9LinerModel::ParticipantId:
if (left.participantId != right.participantId)
return left.participantId < right.participantId;
return left.sampleTime < right.sampleTime;
if (left.participantId() != right.participantId())
return left.participantId() < right.participantId();
return left.sampleTime() < right.sampleTime();
case AirSupport9LinerModel::Participant:
{
const auto l = source_left.data();
const auto r = source_right.data();
if (l != r)
return LtsUtils::lessThan(l, r);
return left.sampleTime < right.sampleTime;
return left.sampleTime() < right.sampleTime();
}
case AirSupport9LinerModel::Timestamp:
return left.sampleTime < right.sampleTime;
return left.sampleTime() < right.sampleTime();
case AirSupport9LinerModel::AttackHeading:
if (left.finalAttackHeading != right.finalAttackHeading)
return left.finalAttackHeading < right.finalAttackHeading;
if (left.finalAttackHeadingLow != right.finalAttackHeadingLow)
return left.finalAttackHeadingLow < right.finalAttackHeadingLow;
if (left.finalAttackHeadingHigh != right.finalAttackHeadingHigh)
return left.finalAttackHeadingHigh < right.finalAttackHeadingHigh;
return left.sampleTime < right.sampleTime;
if (left.finalAttackHeading() != right.finalAttackHeading())
return left.finalAttackHeading() < right.finalAttackHeading();
if (left.finalAttackHeadingLow() != right.finalAttackHeadingLow())
return left.finalAttackHeadingLow() < right.finalAttackHeadingLow();
if (left.finalAttackHeadingHigh() != right.finalAttackHeadingHigh())
return left.finalAttackHeadingHigh() < right.finalAttackHeadingHigh();
return left.sampleTime() < right.sampleTime();
}
return LtsWidgets::LtsColumnFilterProxyModel::lessThan(source_left, source_right);
}
@@ -7,7 +7,6 @@
#include <LtsWidgets/lts_column_filter_proxy_model.h>
#include <GuezNasat/gna_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <LtsSession/lts_session.h>
#include <QtCore/QSortFilterProxyModel>
@@ -3,7 +3,7 @@
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_gui_plugin.h>
#include <AreaEffectSimulation/Base/aes_base_gui_plugin.h>
#include <GuezNasat/gna_data_plugin_interface.h>
#include "aes_air_support_gui_plugin_interface.h"
@@ -107,7 +107,7 @@ void AirSupportExplosionClusterImpactList::createModel()
{
m_model = new AesItemSortFilterProxyModelTmpl<EffectCluster>(m_session, this);
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::GearClass_AirSupport}, this);
m_effectClusterModel = new EffectClusterModel({ProjectDataManagement::GearClass::AirSupport}, this);
m_effectClusterModel->initModel(m_session);
m_model->setSourceModel(m_effectClusterModel);
}
@@ -3,9 +3,9 @@
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.h>
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
#include <Plugins/AreaEffectSimulation/Gui/Explosion/aes_effect_cluster_model.h>
#include <AreaEffectSimulation/Base/aes_itemlist.h>
#include <AreaEffectSimulation/Base/aes_base_model.h>
#include <AreaEffectSimulation/Explosion/aes_effect_cluster_model.h>
#include "aes_air_support_impact_model.h"
namespace AreaEffectSimulation
@@ -3,7 +3,7 @@
#pragma once
#include <Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.h>
#include <AreaEffectSimulation/Base/aes_base_model.h>
namespace AreaEffectSimulation
{
@@ -66,19 +66,19 @@ bool CustomViewBCContamination::init(const QModelIndex &idx)
bool CustomViewBCContamination::calculateIcon(const BCContamination &bcContamination, const QColor &color)
{
Database::AesBCContamination bcContaOut;
bcContaOut.id = bcContamination.id;
bcContaOut.chargeTypeId = bcContamination.chargeStruct.chargeTypeId;
bcContaOut.effectStart = QDateTime::fromMSecsSinceEpoch(bcContamination.effectStart.has_value() ? bcContamination.effectStart.get() : 0);
bcContaOut.impactPosition = QPointF(bcContamination.impactPosition.lon, bcContamination.impactPosition.lat);
bcContaOut.impactRadius = bcContamination.impactRadius;
bcContaOut.propagationDirection = bcContamination.propagationDirection;
bcContaOut.id = bcContamination.id();
bcContaOut.chargeTypeId = bcContamination.chargeStruct().chargeTypeId();
bcContaOut.effectStart = QDateTime::fromMSecsSinceEpoch(bcContamination.effectStart().is_set() ? bcContamination.effectStart().get() : 0);
bcContaOut.impactPosition = QPointF(bcContamination.impactPosition().lon(), bcContamination.impactPosition().lat());
bcContaOut.impactRadius = bcContamination.impactRadius();
bcContaOut.propagationDirection = bcContamination.propagationDirection();
const QPolygonF poly = AreaEffectSimulation::Polygons::bcContamination(bcContaOut,
ProjectDataManagement::VolatilityType::Unknown,
bcContamination.impactRadius,
ProjectDataManagement::VolatilityType::get_default(),
bcContamination.impactRadius(),
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);
m_ui->lblIcon->setPixmap(pix);
@@ -4,7 +4,7 @@
#include "aes_bccontamination_info.h"
#include "ui_aes_bccontamination_info.h"
#include <Plugins/AreaEffectSimulation/Gui/Base/InfoView/aes_base_info.h>
#include <AreaEffectSimulation/Base/InfoView/aes_base_info.h>
#include <LtsSession/lts_session.h>
#include <LtsCoordTrans/lts_coord_trans.h>
#include <QtCore/QDateTime>
@@ -33,13 +33,13 @@ bool BCContaminationInfo::setData(const BCContamination *item)
{
m_ui->wBaseData->setData(item);
m_ui->lblImpactRadius->setText(QString::number(item->impactRadius));
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)
.arg(item->propagationDirection * 6400 / 360.0, 0, 'f', 0));
m_ui->lblWindSpeed->setText(QString::number(item->windSpeed, 'f', 2));
m_ui->lblWeatherTimestamp->setText(QDateTime::fromMSecsSinceEpoch(item->weatherTimestamp).toString());
m_ui->lblWeatherPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->weatherPosition.lon, item->weatherPosition.lat));
m_ui->lblImpactRadius->setText(QString::number(item->impactRadius()));
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)
.arg(item->propagationDirection() * 6400 / 360.0, 0, 'f', 0));
m_ui->lblWindSpeed->setText(QString::number(item->windSpeed(), 'f', 2));
m_ui->lblWeatherTimestamp->setText(QDateTime::fromMSecsSinceEpoch(item->weatherTimestamp()).toString());
m_ui->lblWeatherPosition->setText(LtsCoordTrans::mgrsFromGeographic(item->weatherPosition().lon(), item->weatherPosition().lat()));
return true;
}
Loaded 100 of 1930 files, more files were not shown because too many files have changed in this diff. Show more