diff --git a/.github/prompts/migration-plan.md b/.github/prompts/migration-plan.md new file mode 100644 index 000000000..ad16dc939 --- /dev/null +++ b/.github/prompts/migration-plan.md @@ -0,0 +1,335 @@ +# Qt5/C++11 to Qt6/C++23 Migrationsplan + +## 📋 Ausgangslage + +### Projektstruktur +``` +$PROJDIR_MIGRATE_QT5_TO_QT6 = /home/torsten/swy/sandbox/qt-migration-legatus +├── qt5-before/qt5-legatus-legacy/ (Qt5/C++11 Legacy-Code) +└── qt6-after/qt6-migrated-legatus/ (Qt6/C++23 migrierter Code) +``` + +### Submodule Konfiguration +- **Submodule**: `qt-migration-legatus` zeigt auf `feature/qt6-migration-basis-modules` (commit d176b5e) +- **Quellverzeichnis**: `qt5-before/qt5-legatus-legacy/` enthält vollständigen Qt5-Code mit CMakeLists.txt +- **Zielverzeichnis**: `qt6-after/qt6-migrated-legatus/` enthält bereits migrierte Module + +### Bereits migrierte Module (Stand: Session a41bb15a) +✅ **Lts/Common** - Vollständig migriert, Tests erfolgreich (1/1 bestanden) +✅ **Lts/DDS** - Struktur vorhanden +✅ **Lts/Plugins** - Struktur vorhanden +✅ **Lts/Projects** - Struktur vorhanden +✅ **Lts/Proxies** - Struktur vorhanden +✅ **Lts/Services** - Struktur vorhanden +✅ **TetraIF** - Teilweise migriert +✅ **Z** - Teilweise migriert (nglwidgets, QtSingleApplication, qsql_informix, WMS_Interface) + +### Infrastruktur +- ✅ Docker-Image: `migration-pipeline:ubuntu26.04` (Ubuntu 26.04, Qt 6.8.3) +- ✅ CMake 3.16+, C++23 +- ✅ CI-Workflow mit `submodules: recursive` +- ✅ Migrationsskripte aktualisiert fĂźr Submodule-Pfade + +--- + +## 🎯 Migrationsziele (aus combined-migration-compact.prompt.md) + +### Hauptziele +1. **Qt5 → Qt6** Upgrade aller Module +2. **C++11/14/17 → C++23** Modernisierung +3. **Qt Core, Gui, Widgets** explizit verlinken +4. **QRegExp → QRegularExpression** ersetzen +5. **QDesktopWidget → QScreen**-basierte APIs +6. **QTextCodec** entfernen, Qt6-safe text handling +7. **SIGNAL/SLOT** alte Syntax → function-pointer connect syntax +8. **0/NULL** → `nullptr` ersetzen + +### C++23 Modernisierung +- `auto` wo offensichtlich +- Strukturierte Bindings wo klarer +- Raw Pointer → `std::unique_ptr` / `std::shared_ptr` +- `std::make_unique` / `std::make_shared` +- `std::string_view` (lifetime safety beachten) +- `std::span` fĂźr non-owning contiguous data +- `.contains()` statt `find(...) != end()` +- Algorithms/Ranges statt manueller Loops +- `[[nodiscard]]` wo sinnvoll +- Early Returns statt nested control flow +- `std::optional` monadic operations +- `constexpr`, `if constexpr`, concepts, `requires` +- `noexcept`, `override`, `final`, `= default`, `= delete` +- `enum class` statt unscoped enums +- `std::print` / `std::println` (wenn unterstĂźtzt) +- Typed `std::chrono`, `std::jthread` + +### Safety Rules +- ✅ Semantics first, modernize second +- ❌ KEINE Behavior Changes (außer Qt6 compatibility) +- ❌ KEINE Code Cleanup +- ❌ KEINE Umbenennungen +- ❌ KEINE Function/Class Extractions +- ❌ KEINE Logic Restructuring +- ❌ KEINE stylistic rewrites +- ❌ KEINE opportunistic improvements + +--- + +## 📝 Migrationsphasen + +### Phase 1: Vorbereitung und Analyse +**Todo-ID: prepare** +- [x] Submodule initialisieren: `git submodule update --init` +- [x] Docker-Image bauen: `docker build -t migration-pipeline:ubuntu26.04 ./app` +- [x] Bereits migrierte Module identifizieren +- [ ] Vollständige Inventur aller noch zu migrierenden Dateien +- [ ] Migrationsskripte fĂźr verbleibende Module vorbereiten + +### Phase 2: Lts-Module komplett migrieren +**Todo-ID: lts-modules** +**Dependencies: prepare** + +Bereits migriert: +- [x] Lts/Common +- [ ] Lts/DDS (prĂźfen, ob vollständig) +- [ ] Lts/Plugins (alle Untermodule prĂźfen) +- [ ] Lts/Projects (alle Untermodule prĂźfen) +- [ ] Lts/Proxies (alle Untermodule prĂźfen) +- [ ] Lts/Services (alle Untermodule prĂźfen) + +**Vorgehen pro Modul (mit Test- und Docker-Validierung):** +1. `./migration/migrate_module.sh Lts/ --jobs 4` +2. **Tests erstellen**: FĂźr jede Code-Änderung mindestens 3 Tests hinzufĂźgen + - Tests in `qt6-after/qt6-migrated-legatus/tests/` ablegen + - Dateinamen: `test_.cpp`, `_test.cpp`, `test.cpp`, oder `gtest.cpp` + - Tests in CMake registrieren (CTest) +3. **Docker-Validierung** (obligatorisch vor Commit): + ```bash + # Configure im Docker-Container + docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + cmake -S /repo/qt-migration-legatus/qt6-after/qt6-migrated-legatus \ + -B /repo/build -G Ninja -DCMAKE_BUILD_TYPE=Debug + + # Build im Docker-Container + docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + cmake --build /repo/build --parallel + + # Tests im Docker-Container + docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + ctest --test-dir /repo/build --output-on-failure + + # Policy-Check im Docker-Container + docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + python3 /repo/ci/check_pr_policies.py + ``` +4. **Fehlerklassifikation**: + - **Environment-Failures** (command not found, missing package): `ci/Dockerfile.ci` aktualisieren, Image neu bauen + - **Project-Failures** (compile/link errors, test failures): Code fixen +5. Bei Erfolg: clang-tidy laufen lassen, Changes commiten + +### Phase 3: TetraIF komplett migrieren +**Todo-ID: tetraif** +**Dependencies: lts-modules** + +- [ ] TetraIF Hauptcode migrieren +- [ ] Alle Includes und Abhängigkeiten prĂźfen +- [ ] Tests erstellen (mind. 3 Tests pro Code-Änderung) +- [ ] **Docker-Validierung** (Configure → Build → Test → Policy) +- [ ] clang-tidy Integration testen + +### Phase 4: Z-Module komplett migrieren +**Todo-ID: z-modules** +**Dependencies: tetraif** + +Bereits teilweise migriert: +- [x] Z/src/nglwidgets +- [x] Z/src/QtSingleApplication +- [x] Z/src/qsql_informix +- [x] Z/src/WMS_Interface +- [ ] Fehlende Z-Module identifizieren und migrieren + +**Vorgehen pro Modul** (wie Phase 2 mit Test- und Docker-Validierung) + +### Phase 5: Vollständige Build-Validierung +**Todo-ID: full-build** +**Dependencies: lts-modules, tetraif, z-modules** + +- [ ] `./final-migration/run_final_migration.sh --jobs 6` ausfĂźhren +- [ ] **Docker-Validierung komplett**: + - [ ] Configure: `cmake -S qt6-after/qt6-migrated-legatus -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug` + - [ ] Build: `cmake --build build --parallel` + - [ ] Test: `ctest --test-dir build --output-on-failure` + - [ ] Policy: `python3 ci/check_pr_policies.py` +- [ ] Alle Tests bestehen (CTest) +- [ ] Policy-Check erfolgreich + +### Phase 6: CI/CD Validierung +**Todo-ID: ci-validation** +**Dependencies: full-build** + +- [ ] CI-Workflow lokal simulieren +- [ ] Submodule checkout testen +- [ ] Alle Migrationsschritte im CI-Kontext verifizieren +- [ ] Build-Artefakte prĂźfen +- [ ] Test-Logs analysieren +- [ ] **Docker-Image als Source of Truth**: `lifemaps/ci-cpp:latest` (oder `migration-pipeline:ubuntu26.04`) + - Bei fehlenden Tools: `ci/Dockerfile.ci` minimal aktualisieren + - Image neu bauen und Validierung wiederholen + +--- + +## 🧪 Validierungskriterien + +### Pre-Migration (lokal) +- [x] `git submodule update --init` erfolgreich +- [x] Docker-Image Build erfolgreich +- [x] Lts/Common Migration erfolgreich getestet +- [ ] Vollständige Inventur aller Module + +### Post-Migration (lokal) +- [ ] Configure im Docker-Container erfolgreich +- [ ] Build im Docker-Container erfolgreich +- [ ] Alle Tests bestehen (`ctest --test-dir build --output-on-failure`) +- [ ] Policy-Check erfolgreich (`python3 ci/check_pr_policies.py`) + +### CI-Validierung +- [ ] Checkout mit Submodules erfolgreich +- [ ] Lts/Common Migration Step erfolgreich +- [ ] Lts/DDS Migration Step erfolgreich +- [ ] Final Migration Build ohne Fehler +- [ ] CTest läuft und besteht +- [ ] Workflow-Zeit < 120 Minuten + +--- + +## 📊 FortschrittsĂźbersicht + +### Migrierte Module (✅) +| Modul | Status | Tests | Build | Notes | +|-------|--------|-------|-------|-------| +| Lts/Common | ✅ Vollständig | 1/1 ✅ | ✅ | Basis erfolgreich | +| Lts/DDS | 🟡 Struktur vorhanden | ? | ? | PrĂźfung ausstehend | +| Lts/Plugins | 🟡 Struktur vorhanden | ? | ? | 60 Untermodule | +| Lts/Projects | 🟡 Struktur vorhanden | ? | ? | 5 Untermodule | +| Lts/Proxies | 🟡 Struktur vorhanden | ? | ? | 13 Untermodule | +| Lts/Services | 🟡 Struktur vorhanden | ? | ? | 47 Untermodule | +| TetraIF | 🟡 Teilweise | ? | ? | Migration läuft | +| Z | 🟡 Teilweise | ? | ? | Einige Submodule fertig | + +### Noch zu migrieren (❌) +- Alle Untermodule in Lts/Plugins (60) +- Alle Untermodule in Lts/Projects (5) +- Alle Untermodule in Lts/Proxies (13) +- Alle Untermodule in Lts/Services (47) +- Restliche Z-Module + +--- + +## ⚠️ Risiken und Gegenmaßnahmen + +### Risiko 1: Submodule Permissions +**Problem**: CI benĂśtigt SSH-Zugriff auf `git@devel:lifemaps/qt-migration-legatus.git` +**Mitigation**: SSH-Key in CI secrets konfigurieren oder HTTPS mit Token verwenden + +### Risiko 2: Git Operations in Submodules +**Problem**: `run_clang_tidy_common.sh` committet in Submodule-Pfad +**Mitigation**: Lokal testen, Submodule-Commits separat von Main-Repo-Commits betrachten + +### Risiko 3: Externe Dependencies +**Problem**: Skripte erwarten `/repo/external` mit RTI Connext und ArcGIS SDK +**Mitigation**: CI stellt Dependencies bereit oder behandelt fehlende Dependencies gracefully + +### Risiko 4: Nested Git Repo +**Problem**: `qt5-legatus-legacy` hat eigenes .git-Verzeichnis +**Mitigation**: `git submodule update --init` OHNE `--recursive` verwenden + +--- + +## 🔄 Rollback-Plan + +Bei kritischen Problemen: + +1. **CI-Workflow revertieren**: `submodules: recursive` entfernen +2. **Migration-Skripte revertieren**: Original `-S /repo` Pfade wiederherstellen +3. **Fallback**: Alte Ordernstruktur temporär am Repo-Root wiederherstellen + +--- + +## 📈 Nächste Schritte (sofort) + +1. **Logging-Fixes validieren**: Build im Docker-Container nach Logger-Fixes testen +2. **Inventur vervollständigen**: Alle noch zu migrierenden Dateien identifizieren +3. **Lts/DDS prĂźfen**: Ist das Modul vollständig migriert? Build testen +4. **Lts/Plugins**: Erste Untermodule migrieren (priorisiere Kernfunktionalität) +5. **TetraIF**: Migration abschließen und validieren +6. **Vollständigen Build testen**: `./final-migration/run_final_migration.sh --jobs 6` + +--- + +## 🛠️ Wichtige Commands + +### Submodule Management +```bash +# Submodule initialisieren +git submodule update --init + +# Submodule auf Branch aktualisieren +git submodule update --remote + +# Submodule Status prĂźfen +git submodule status +``` + +### Migration +```bash +# Einzelnes Modul migrieren +./migration/migrate_module.sh Lts/ --jobs 4 + +# Vollständige Migration +./final-migration/run_final_migration.sh --jobs 6 + +# Clang-tidy fĂźr Modul +./migration/run_clang_tidy_common.sh Lts/ +``` + +### Docker-Validierung (OBLIGATORISCH) +```bash +# Configure im Container +docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + cmake -S /repo/qt-migration-legatus/qt6-after/qt6-migrated-legatus \ + -B /repo/build -G Ninja -DCMAKE_BUILD_TYPE=Debug + +# Build im Container +docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + cmake --build /repo/build --parallel + +# Tests im Container +docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + ctest --test-dir /repo/build --output-on-failure + +# Policy-Check +docker run --rm -v $(pwd):/repo migration-pipeline:ubuntu26.04 \ + python3 /repo/ci/check_pr_policies.py +``` + +### Docker-Image bei fehlenden Tools +```bash +# ci/Dockerfile.ci bearbeiten (fehlendes Package hinzufĂźgen) +# Dann Image neu bauen: +docker build -t migration-pipeline:ubuntu26.04 ./app + +# Validierung wiederholen +``` + +--- + +## 📝 Session-Referenzen + +- **Session a41bb15a-b5cc-4955-8d71-0169516fcef3**: Vorherige Migration-Sessions +- **Checkpoint 008-qt6-migration-infrastructure**: Letzte Infrastruktur-Updates +- **Submodule Branch**: `feature/qt6-migration-basis-modules` @ d176b5e + +--- + +**Erstellt**: 2026-08-18 +**Aktualisiert**: 2026-08-18 (Test- und Docker-Validierungsanforderungen integriert) +**Status**: Bereit fĂźr User-Feedback und Implementierung \ No newline at end of file diff --git a/add_logger_init.py b/add_logger_init.py new file mode 100755 index 000000000..1289526a9 --- /dev/null +++ b/add_logger_init.py @@ -0,0 +1,246 @@ +#!/usr/bin/env python3 +""" +Add logger initialization to constructors in Qt6 .cpp files. +Pattern: m_logger(NGL::NGLLoggerBootstrap::getLogger()) +""" + +import os +import re +import sys +from pathlib import Path + +# Paths +SCRIPT_DIR = Path(__file__).parent +QT6_BASE = SCRIPT_DIR / "qt6-after/qt6-migrated-legatus" + +# Qt classes that shouldn't have logger initialization +QT_CLASSES = { + 'QObject', 'QWidget', 'QMainWindow', 'QDialog', 'QMessageBox', + 'QAbstractTableModel', 'QAbstractListModel', 'QAbstractItemModel', + 'QTreeView', 'QTableView', 'QListView', 'QComboBox', + 'QTcpSocket', 'QTcpServer', 'QUdpSocket', 'QTimer', 'QThread', + 'QSettings', 'QFileInfo', 'QDir', 'QFile', 'QTextStream', + 'QDomElement', 'QDomDocument', 'QXmlStreamReader', 'QXmlStreamWriter', + 'QPainter', 'QPixmap', 'QImage', 'QIcon', 'QBrush', 'QPen', + 'QMenu', 'QMenuBar', 'QToolBar', 'QStatusBar', 'QAction', + 'QVBoxLayout', 'QHBoxLayout', 'QGridLayout', 'QFormLayout', + 'QPushButton', 'QLabel', 'QLineEdit', 'QTextEdit', 'QPlainTextEdit', + 'QCheckBox', 'QRadioButton', 'QSpinBox', 'QDoubleSpinBox', + 'QSlider', 'QScrollBar', 'QProgressBar', 'QTabWidget', + 'QStackedWidget', 'QSplitter', 'QScrollArea', 'QFrame', + 'QGroupBox', 'QToolBox', 'QWizard', 'QFontDialog', 'QColorDialog', + 'QFileDialog', 'QInputDialog', 'QProgressDialog', 'QErrorMessage', + 'QSystemTrayIcon', 'QClipboard', 'QDrag', 'QMimeData', + 'QKeyEvent', 'QMouseEvent', 'QPaintEvent', 'QResizeEvent', + 'QShowEvent', 'QHideEvent', 'QCloseEvent', 'QFocusEvent', + 'QMoveEvent', 'QContextMenuEvent', 'QInputEvent', 'QWheelEvent', + 'QHoverEvent', 'QTabletEvent', 'QGestureEvent', 'QShortcut', + 'QKeySequence', 'QValidator', 'QIntValidator', 'QDoubleValidator', + 'QRegExpValidator', 'QCompleter', 'QAbstractSpinBox', 'QDateTimeEdit', + 'QDateEdit', 'QTimeEdit', 'QCalendarWidget', 'QDial', 'QLCDNumber', + 'QSpinBox', 'QDoubleSpinBox', 'QTimeEdit', 'QDateTimeEdit', + 'QDateEdit', 'QFontComboBox', 'QToolButton', 'QCommandLinkButton', + 'QDialogButtonBox', 'QPlainTextEdit', 'QTextEdit', 'QTextBrowser', + 'QListWidget', 'QTreeWidget', 'QTableWidget', 'QListWidgetItem', + 'QTreeWidgetItem', 'QTableWidgetItem', 'QHeaderView', 'QColumnView', + 'QDataWidgetMapper', 'QFileSystemModel', 'QStandardItemModel', + 'QStandardItem', 'QSortFilterProxyModel', 'QStringListModel', + 'QAbstractProxyModel', 'QIdentityProxyModel', 'QItemSelectionModel', + 'QItemSelection', 'QItemSelectionRange', 'QStyledItemDelegate', + 'QItemDelegate', 'QAbstractItemDelegate', 'QAbstractItemView', + 'QGraphicsView', 'QGraphicsScene', 'QGraphicsItem', 'QGraphicsWidget', + 'QGraphicsObject', 'QGraphicsLayout', 'QGraphicsLinearLayout', + 'QGraphicsGridLayout', 'QGraphicsProxyWidget', 'QGraphicsTextItem', + 'QGraphicsRectItem', 'QGraphicsEllipseItem', 'QGraphicsLineItem', + 'QGraphicsPathItem', 'QGraphicsPolygonItem', 'QGraphicsPixmapItem', + 'QGraphicsSimpleTextItem', 'QGraphicsItemGroup', 'QGraphicsLayoutItem', + 'QGraphicsAnchorLayout', 'QGraphicsGridLayout', 'QStackedLayout', + 'QBoxLayout', 'QFormLayout', 'QGridLayout', 'QHBoxLayout', + 'QVBoxLayout', 'QLayout', 'QLayoutItem', 'QSpacerItem', + 'QSizeGrip', 'QSizePolicy', 'QStyle', 'QStyleFactory', + 'QStyleOption', 'QStylePainter', 'QProxyStyle', 'QCommonStyle', + 'QWindowsVistaStyle', 'QMacStyle', 'QFusionStyle', 'QCleanlooksStyle', + 'QPlastiqueStyle', 'QMotifStyle', 'QApplication', 'QDesktopWidget', + 'QSessionManager', 'QStyleHintReturn', 'QStyleHintReturnMask', + 'QStyleHintReturnVariant', 'QStyleOptionFocusRect', + 'QStyleOptionFrame', 'QStyleOptionFrameV2', 'QStyleOptionFrameV3', + 'QStyleOptionButton', 'QStyleOptionComboBox', 'QStyleOptionHeader', + 'QStyleOptionHeaderV2', 'QStyleOptionComplex', 'QStyleOptionSlider', + 'QStyleOptionSpinBox', 'QStyleOptionToolButton', 'QStyleOptionToolBar', + 'QStyleOptionDockWidget', 'QStyleOptionDockWidgetV2', + 'QStyleOptionViewItem', 'QStyleOptionViewItemV2', 'QStyleOptionViewItemV3', + 'QStyleOptionViewItemV4', 'QStyleOptionTab', 'QStyleOptionTabV2', + 'QStyleOptionTabV3', 'QStyleOptionTabBarBase', 'QStyleOptionTabBarBaseV2', + 'QStyleOptionRubberBand', 'QStyleOptionGraphicsItem', + 'QStyleOptionTitleBar', 'QStyleOptionToolBox', 'QStyleOptionToolBoxV2', + 'QStyleOptionViewItem', 'QStyleOptionProgressBar', + 'QStyleOptionProgressBarV2', 'QStyleOptionMenuItem', 'QStyleOptionSlider', + 'QStyleOptionSpinBox', 'QStyleOptionToolButton', 'QStyleOptionToolBar', + 'QStyleOptionDockWidget', 'QStyleOptionDockWidgetV2', + 'QStyleOptionFocusRect', 'QStyleOptionFrame', 'QStyleOptionFrameV2', + 'QStyleOptionFrameV3', 'QStyleOptionButton', 'QStyleOptionComboBox', + 'QStyleOptionHeader', 'QStyleOptionHeaderV2', 'QStyleOptionComplex', + 'QStyleOptionTab', 'QStyleOptionTabV2', 'QStyleOptionTabV3', + 'QStyleOptionTabBarBase', 'QStyleOptionTabBarBaseV2', + 'QStyleOptionRubberBand', 'QStyleOptionGraphicsItem', + 'QStyleOptionTitleBar', 'QStyleOptionToolBox', 'QStyleOptionToolBoxV2', + 'QStyleOptionProgressBar', 'QStyleOptionProgressBarV2', + 'QStyleOptionMenuItem', 'QStyleOptionSizeMode', 'QStyleOptionVersion', +} + +def find_cpp_files_with_logger_member(): + """Find all Qt6 .cpp files that have m_logger member in corresponding header""" + cpp_files = [] + + for cpp_file in QT6_BASE.rglob("*.cpp"): + # Find corresponding header + header = cpp_file.with_suffix('.h') + if not header.exists(): + header = cpp_file.with_suffix('.hpp') + + if header.exists(): + try: + header_content = header.read_text(encoding='utf-8', errors='ignore') + if 'm_logger' in header_content: + cpp_files.append(cpp_file) + except: + pass + + print(f"Found {len(cpp_files)} .cpp files with m_logger in header") + return cpp_files + +def add_logger_init_to_constructor(content, class_name): + """Add logger initialization to constructor""" + + # Pattern to match constructor initialization list + # Matches: ClassName::ClassName(...) : existing_init1(val1), existing_init2(val2) + # Also matches: ClassName::ClassName(...) { + # And: ClassName::ClassName(...) + + # First check if already has logger init + if 'm_logger(' in content or 'm_logger(NGL' in content: + return content, False, "Already initialized" + + # Pattern for constructor with initialization list + # Group 1: constructor signature up to : + # Group 2: existing initializers + # Group 3: opening brace or colon continuing init list + + # Try to find constructor with init list + pattern_with_init = rf'({re.escape(class_name)}::\s*{re.escape(class_name)}\s*\([^)]*\))\s*:\s*([^{{]+?)\s*({{)' + match = re.search(pattern_with_init, content, re.MULTILINE | re.DOTALL) + + if match: + # Add m_logger to existing init list + before = match.group(1) + inits = match.group(2).rstrip() + brace = match.group(3) + + # Add m_logger initialization (comma if needed) + new_init = f"{before} : {inits},\n m_logger(NGL::NGLLoggerBootstrap::getLogger()) {brace}" + new_content = content[:match.start()] + new_init + content[match.end():] + return new_content, True, "Added to init list" + + # Try constructor without init list (direct brace) + pattern_direct_brace = rf'({re.escape(class_name)}::\s*{re.escape(class_name)}\s*\([^)]*\))\s*({{)' + match = re.search(pattern_direct_brace, content, re.MULTILINE) + + if match: + sig = match.group(1) + brace = match.group(2) + new_constructor = f"{sig} : m_logger(NGL::NGLLoggerBootstrap::getLogger()) {brace}" + new_content = content[:match.start()] + new_constructor + content[match.end():] + return new_content, True, "Added init list" + + # Try constructor that continues on next line + pattern_multiline = rf'({re.escape(class_name)}::\s*{re.escape(class_name)}\s*\([^)]*\))\s*\n\s*:\s*([^{{]+?)\s*({{)' + match = re.search(pattern_multiline, content, re.MULTILINE) + + if match: + before = match.group(1) + inits = match.group(2).rstrip() + brace = match.group(3) + new_init = f"{before}\n : {inits},\n m_logger(NGL::NGLLoggerBootstrap::getLogger()) {brace}" + new_content = content[:match.start()] + new_init + content[match.end():] + return new_content, True, "Added to multiline init" + + return content, False, "No constructor found" + +def extract_class_name_from_header(header_path): + """Extract class name from header file""" + try: + content = header_path.read_text(encoding='utf-8', errors='ignore') + # Find first class definition (not forward declaration) + pattern = r'^class\s+(\w+)\s*(?::\s*public\s+\w+)?\s*\{' + match = re.search(pattern, content, re.MULTILINE) + if match: + return match.group(1) + except: + pass + return None + +def main(): + print("=" * 80) + print("Adding logger initialization to constructors") + print("=" * 80) + + # Find cpp files with m_logger in header + cpp_files = find_cpp_files_with_logger_member() + + # Track results + added = 0 + skipped = 0 + skip_reasons = {} + examples = [] + + for cpp_file in cpp_files: + try: + content = cpp_file.read_text(encoding='utf-8') + + # Get class name from header + header = cpp_file.with_suffix('.h') + if not header.exists(): + header = cpp_file.with_suffix('.hpp') + + class_name = None + if header.exists(): + class_name = extract_class_name_from_header(header) + + if not class_name: + # Try to guess from filename + class_name = cpp_file.stem + + # Try to add logger init + new_content, success, message = add_logger_init_to_constructor(content, class_name) + + if success: + cpp_file.write_text(new_content, encoding='utf-8') + added += 1 + if added <= 10: + print(f"ADDED: {cpp_file.relative_to(QT6_BASE)} - {message}") + else: + skipped += 1 + reason = message + skip_reasons[reason] = skip_reasons.get(reason, 0) + 1 + if len(examples) < 5: + examples.append(f"{cpp_file.relative_to(QT6_BASE)} ({class_name})") + + except Exception as e: + skipped += 1 + reason = f"Error: {str(e)}" + skip_reasons[reason] = skip_reasons.get(reason, 0) + 1 + + print("\n" + "=" * 80) + print(f"Results: {added} files updated, {skipped} skipped") + print("\nSkip reasons:") + for reason, count in sorted(skip_reasons.items(), key=lambda x: -x[1])[:10]: + print(f" {reason}: {count}") + + if examples: + print("\nSkipped examples (first 5):") + for example in examples: + print(f" - {example}") + print("=" * 80) + +if __name__ == "__main__": + main() diff --git a/add_logger_members.py b/add_logger_members.py new file mode 100755 index 000000000..4a1616a4c --- /dev/null +++ b/add_logger_members.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +""" +Add m_logger member variables to Qt6 class definitions. +Matches Qt5 and Qt6 headers by file path, then checks for m_logger. +""" + +import os +import re +import sys +from pathlib import Path + +# Paths +SCRIPT_DIR = Path(__file__).parent +QT5_BASE = SCRIPT_DIR / "qt5-before/qt5-legatus-legacy" +QT6_BASE = SCRIPT_DIR / "qt6-after/qt6-migrated-legatus" + +def find_qt5_headers_with_logger(): + """Find all Qt5 headers with m_logger members""" + qt5_headers = [] + + for header in QT5_BASE.rglob("*.h"): + try: + content = header.read_text(encoding='utf-8', errors='ignore') + if 'm_logger' in content: + rel_path = header.relative_to(QT5_BASE) + qt5_headers.append(rel_path) + except Exception as e: + pass + + print(f"Found {len(qt5_headers)} Qt5 headers with m_logger") + return qt5_headers + +def find_qt6_header(rel_path): + """Find corresponding Qt6 header by relative path""" + qt6_header = QT6_BASE / rel_path + + if qt6_header.exists(): + return qt6_header + + # Try .hpp extension + qt6_header_hpp = QT6_BASE / rel_path.with_suffix('.hpp') + if qt6_header_hpp.exists(): + return qt6_header_hpp + + # Try lowercase path + qt6_header_lower = QT6_BASE / str(rel_path).lower() + if qt6_header_lower.exists(): + return qt6_header_lower + + # Try snake_case conversion for filename + filename = rel_path.name + snake_name = ''.join(['_' + c.lower() if c.isupper() else c for c in filename.split('.')[0]]).lstrip('_') + snake_path = rel_path.parent / f"{snake_name}{rel_path.suffix}" + qt6_header_snake = QT6_BASE / snake_path + if qt6_header_snake.exists(): + return qt6_header_snake + + return None + +def add_logger_to_header(header_path): + """Add m_logger member to class definition""" + try: + content = header_path.read_text(encoding='utf-8') + + # Check if already has m_logger + if 'm_logger' in content: + return False, "Already has m_logger" + + # Find private: or protected: section (handle comments after colon) + pattern = r'^(\s*)(private|protected):\s*(?:\/\/.*)?\s*\n' + match = re.search(pattern, content, re.MULTILINE) + + if not match: + # Try finding end of class with just closing brace + lines = content.split('\n') + for i in range(len(lines) - 1, 0, -1): + if re.match(r'^\s*};\s*$', lines[i]): + indent = re.match(r'^(\s*)', lines[i]).group(1) + lines.insert(i, f"{indent}NGL::INGLLogger &m_logger;") + new_content = '\n'.join(lines) + header_path.write_text(new_content, encoding='utf-8') + return True, "Added (fallback)" + return False, "No private/protected section found" + + # Insert m_logger after the access specifier line + indent = match.group(1) + insert_pos = match.end() + new_content = content[:insert_pos] + indent + "NGL::INGLLogger &m_logger;\n" + content[insert_pos:] + + header_path.write_text(new_content, encoding='utf-8') + return True, "Added" + + except Exception as e: + return False, f"Error: {str(e)}" + +def main(): + print("=" * 80) + print("Adding m_logger members to Qt6 headers") + print("=" * 80) + + # Find Qt5 headers with m_logger + qt5_headers = find_qt5_headers_with_logger() + + # Track results + added = 0 + skipped = 0 + skip_reasons = {} + not_found_examples = [] + + for rel_path in qt5_headers: + # Find corresponding Qt6 header + qt6_header = find_qt6_header(rel_path) + + if not qt6_header: + skipped += 1 + reason = "Header not found" + skip_reasons[reason] = skip_reasons.get(reason, 0) + 1 + if len(not_found_examples) < 10: + not_found_examples.append(str(rel_path)) + continue + + # Try to add logger + success, message = add_logger_to_header(qt6_header) + + if success: + added += 1 + if added <= 10: + print(f"ADDED: {rel_path} -> {message}") + else: + skipped += 1 + reason = message if not message.startswith("Already") else "Already has m_logger" + skip_reasons[reason] = skip_reasons.get(reason, 0) + 1 + + print("\n" + "=" * 80) + print(f"Results: {added} headers updated, {skipped} skipped") + print("\nSkip reasons:") + for reason, count in sorted(skip_reasons.items(), key=lambda x: -x[1]): + print(f" {reason}: {count}") + + if not_found_examples: + print("\nHeader not found examples (first 10):") + for example in not_found_examples: + print(f" - {example}") + print("=" * 80) + +if __name__ == "__main__": + main() diff --git a/fix_logging_macros.py b/fix_logging_macros.py new file mode 100644 index 000000000..5b200a56d --- /dev/null +++ b/fix_logging_macros.py @@ -0,0 +1,72 @@ +#!/usr/bin/env python3 +""" +Fix logging macro calls in Qt6 migrated code. +Adds m_logger parameter to DEBUG_LOG(), WARNING_LOG(), ERROR_LOG(), FATAL_LOG(), INFO_LOG(), TRACE_LOG() +""" + +import re +import os +import sys + +# Logging macros that need logger parameter +LOGGING_MACROS = [ + 'DEBUG_LOG', + 'WARNING_LOG', + 'ERROR_LOG', + 'FATAL_LOG', + 'INFO_LOG', + 'TRACE_LOG' +] + +def fix_logging_in_file(filepath): + """Fix logging macro calls in a single file.""" + with open(filepath, 'r', encoding='utf-8', errors='ignore') as f: + content = f.read() + + original = content + fixes = 0 + + for macro in LOGGING_MACROS: + # Match macro calls without parameter: MACRO() + # But not already with parameter: MACRO(m_logger) or MACRO(logger) + pattern = rf'\b{macro}\s*\(\s*\)' + replacement = f'{macro}(m_logger)' + + matches = re.findall(pattern, content) + if matches: + content = re.sub(pattern, replacement, content) + fixes += len(matches) + + if fixes > 0: + with open(filepath, 'w', encoding='utf-8') as f: + f.write(content) + + return fixes + +def main(): + if len(sys.argv) < 2: + print("Usage: fix_logging_macros.py ") + sys.exit(1) + + base_dir = sys.argv[1] + total_fixes = 0 + files_fixed = 0 + + for root, dirs, files in os.walk(base_dir): + # Skip build directories and Qt5 sources + if 'build' in root or 'qt5-before' in root: + continue + + for file in files: + if file.endswith(('.cpp', '.h', '.hpp', '.cc', '.cxx')): + filepath = os.path.join(root, file) + fixes = fix_logging_in_file(filepath) + if fixes > 0: + files_fixed += 1 + total_fixes += fixes + print(f"Fixed {fixes} logging calls in {filepath}") + + print(f"\nTotal: {total_fixes} logging macro calls fixed in {files_fixed} files") + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.cpp index 34a1eafae..d825f5b23 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.cpp @@ -11,12 +11,11 @@ #include using namespace CodeGen; -GeneratorGrantleeBase::GeneratorGrantleeBase(const char *loggerName) - : m_engine(new Grantlee::Engine) +GeneratorGrantleeBase::GeneratorGrantleeBase(const char *loggerName) : m_engine(new Grantlee::Engine) , m_ctx(new Grantlee::Context) , m_structBuilder(nullptr) - .getNGLLogger(loggerName)) -{ + .getNGLLogger(loggerName)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } GeneratorGrantleeBase::~GeneratorGrantleeBase() @@ -48,7 +47,7 @@ bool GeneratorGrantleeBase::setTemplate(const QString &templateName, const QStri m_template = m_engine->newTemplate(tmpl, QStringLiteral("myTemplate")); if (m_template->error()) { - WARNING_LOG() << "Error parsing template '" << templateName + WARNING_LOG(m_logger) << "Error parsing template '" << templateName << "': " << m_template->errorString(); return false; } @@ -88,7 +87,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName, QFile f(outDirectory + QLatin1Char('/') + outFilename); if (!f.open(QIODevice::WriteOnly)) { - ERROR_LOG() << "Error opening file '" << f.fileName() << "' for writing: " + ERROR_LOG(m_logger) << "Error opening file '" << f.fileName() << "' for writing: " << f.errorString() << "(" << f.error() << ")"; return false; } @@ -96,7 +95,7 @@ bool GeneratorGrantleeBase::generateData(const QString &templateName, f.write(outData); f.close(); - DEBUG_LOG() << "Written data to " << f.fileName(); + DEBUG_LOG(m_logger) << "Written data to " << f.fileName(); return true; } @@ -105,7 +104,7 @@ bool GeneratorGrantleeBase::readFile(const QString &filename, QString &data) con QFile f(filename); if (!f.open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Error opening file " << filename + ERROR_LOG(m_logger) << "Error opening file " << filename << " - error: " << f.errorString(); return false; } @@ -121,7 +120,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr int idx = dataToParse.indexOf(filenameMarker); if (idx < 0) { - ERROR_LOG() << "Could not find marker '" << filenameMarker + ERROR_LOG(m_logger) << "Could not find marker '" << filenameMarker << "' in data!"; return false; } @@ -129,7 +128,7 @@ bool GeneratorGrantleeBase::getFilenameFromData(const QString &dataToParse, QStr int endIdx = dataToParse.indexOf(QLatin1Char('\n'), idx); if (endIdx < 0) { - ERROR_LOG() << "Could not find end marker '\\n' in data!"; + ERROR_LOG(m_logger) << "Could not find end marker '\\n' in data!"; return false; } filename = dataToParse.mid(idx, endIdx - idx).trimmed(); @@ -160,12 +159,12 @@ void GeneratorGrantleeBase::addCustomFunctions(const QVectorinsert(QStringLiteral("custom_dtc_procs"), vlCustomDtcFunctions); m_ctx->insert(QStringLiteral("custom_db_procs"), vlCustomDbFunctions); @@ -185,17 +184,17 @@ void GeneratorGrantleeBase::exportUsedServices(const XmlReader *reader) const int idx = fullPath.lastIndexOf(QLatin1Char('.')); if (idx < 0) { - ERROR_LOG() << "Could not parse file path: " << fullPath; + ERROR_LOG(m_logger) << "Could not parse file path: " << fullPath; continue; } const QString idlFile = fullPath.left(idx); if (idlFile.isEmpty()) { - WARNING_LOG() << "Could not find idl file for service " << svc; + WARNING_LOG(m_logger) << "Could not find idl file for service " << svc; continue; } idlServicesWrapper->addService(svc, idlFile); - DEBUG_LOG() << "Added service " << svc; + DEBUG_LOG(m_logger) << "Added service " << svc; } m_ctx->insert(QStringLiteral("ext_services"), idlServicesWrapper); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.h b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.h index 54b5d19fa..8b84b52f0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/GeneratorGrantleeBase.h @@ -35,6 +35,7 @@ public: const QString &outDirectory); protected: + NGL::INGLLogger &m_logger; explicit GeneratorGrantleeBase(const char *loggerName); bool initInternal(const XmlReader *reader, StructBuilder *structBuilder); @@ -43,6 +44,7 @@ protected: void addCustomFunctions(const QVector &customFunctions); void exportUsedServices(const XmlReader *reader); protected: + NGL::INGLLogger &m_logger; Grantlee::Engine *m_engine; Grantlee::Context *m_ctx; Grantlee::Template m_template; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.cpp index bf50b87d6..08aa8d696 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.cpp @@ -19,13 +19,12 @@ static QString getExerciseSchemaName(int exerciseId) return QStringLiteral("ex_") + QString::number(exerciseId); } -SqlGenerator::SqlGenerator(XmlReader *xmlReader, StructBuilder *structBuilder) - : m_xmlReader(xmlReader) +SqlGenerator::SqlGenerator(XmlReader *xmlReader, StructBuilder *structBuilder) : m_xmlReader(xmlReader) , m_structBuilder(structBuilder) , m_createdByXmlFile(false) , m_isValid(true) - , m_exerciseId(0) -{} + , m_exerciseId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} SqlGenerator::SqlGenerator(const QString &xmlFile) : m_xmlReader(new XmlReader) @@ -49,7 +48,7 @@ SqlGenerator::~SqlGenerator() bool SqlGenerator::generateData(int exerciseId) { - DEBUG_LOG() << "Generating SQL data for service " << getServiceAbbr() << " in exercise " << exerciseId << ", this: " << this; + DEBUG_LOG(m_logger) << "Generating SQL data for service " << getServiceAbbr() << " in exercise " << exerciseId << ", this: " << this; m_exerciseId = exerciseId; m_sqlGlobal = SqlStatements(); @@ -134,11 +133,11 @@ bool SqlGenerator::handleViews() bool SqlGenerator::handleView(const ViewInformation &vi) { - DEBUG_LOG() << "Handle view " << vi.name; + DEBUG_LOG(m_logger) << "Handle view " << vi.name; const QString parent = vi.baseTable; - DEBUG_LOG() << "Parent = " << parent; + DEBUG_LOG(m_logger) << "Parent = " << parent; if (!parent.isEmpty()) { @@ -146,7 +145,7 @@ bool SqlGenerator::handleView(const ViewInformation &vi) const QString createViewStmt(QStringLiteral("CREATE OR REPLACE VIEW %1 AS SELECT %2\nFROM %3\nWHERE %4;\n")); const QString dropViewStmt(QStringLiteral("DROP VIEW IF EXISTS %1;")); - DEBUG_LOG() << "csi.primaryTable = " << csi.primaryTable.data()->name; + DEBUG_LOG(m_logger) << "csi.primaryTable = " << csi.primaryTable.data()->name; if (!csi.primaryTable.isNull()) { @@ -166,7 +165,7 @@ bool SqlGenerator::handleView(const ViewInformation &vi) fqColumnNames += mi.db.table + QLatin1Char('.') + mi.db.columnName + QLatin1String(" AS ") + mi.db.getColumnNameView(); } - DEBUG_LOG() << "fqColumnNames = " << fqColumnNames.join(QStringLiteral(", ")); + DEBUG_LOG(m_logger) << "fqColumnNames = " << fqColumnNames.join(QStringLiteral(", ")); if (!whereConditions.isEmpty()) @@ -185,11 +184,11 @@ bool SqlGenerator::handleView(const ViewInformation &vi) bool SqlGenerator::handleTable(const CompleteTableInformation &cti) { - DEBUG_LOG() << "Handle table " << cti.name; + DEBUG_LOG(m_logger) << "Handle table " << cti.name; if (cti.columns.isEmpty()) { - WARNING_LOG() << "Table " << cti.name + WARNING_LOG(m_logger) << "Table " << cti.name << " has no DatabaseServiceStruct - not generating anything for this!"; return true; } @@ -532,11 +531,11 @@ bool SqlGenerator::handleEnumeration(const EnumInformation &ei) QStringList SqlGenerator::handleEnumeration(const EnumInformation &ei, const QString &dbSchema) const { - DEBUG_LOG() << "Handle enumeration " << ei.enumName; + DEBUG_LOG(m_logger) << "Handle enumeration " << ei.enumName; if (ei.tableName.isEmpty()) { - INFO_LOG() << "No table for enumeration " << ei.enumName << " - not creating inserts for this enum"; + INFO_LOG(m_logger) << "No table for enumeration " << ei.enumName << " - not creating inserts for this enum"; return QStringList(); } @@ -565,7 +564,7 @@ bool SqlGenerator::generateDbNotifications(const QString &tableName, if (notification.paramNames.isEmpty() || notification.paramNames.size() > 1) { - ERROR_LOG() << "Can not handle more than one parameter"; + ERROR_LOG(m_logger) << "Can not handle more than one parameter"; continue; } generateDbNotification(notification, ed); @@ -705,7 +704,7 @@ QStringList SqlGenerator::getDbSettings(const QString &dbSchema) const QStringList SqlGenerator::getAllSqlStmts(const QString &dbSchema, ExerciseDependency ed) const { - DEBUG_LOG() << "Creating statements for service " << getServiceAbbr() << " in exercise " << m_exerciseId << ", this: " << this; + DEBUG_LOG(m_logger) << "Creating statements for service " << getServiceAbbr() << " in exercise " << m_exerciseId << ", this: " << this; QStringList data; @@ -796,7 +795,7 @@ bool SqlGenerator::writeSql(const QString &filePath, ExerciseDependency ed) const SqlStatements &sql = getStatements(ed); if (sql.isEmpty()) { - DEBUG_LOG() << "Sql file is emtpy: " << sqlFile; + DEBUG_LOG(m_logger) << "Sql file is emtpy: " << sqlFile; return writeFile(sqlFile, QString()); } @@ -806,7 +805,7 @@ bool SqlGenerator::writeSql(const QString &filePath, ExerciseDependency ed) getExerciseSchemaName(m_exerciseId) : getServiceAbbr()); - INFO_LOG() << "Creating sql-stmt for schema (" << dbSchema << ")"; + INFO_LOG(m_logger) << "Creating sql-stmt for schema (" << dbSchema << ")"; return writeSqlToFile(dbSchema, sqlFile, ed); } @@ -929,7 +928,7 @@ bool SqlGenerator::writeFile(const QString &fn, const QString &content) const QFile f(fn); if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - ERROR_LOG() << "Error opening file '" << f.fileName() << "' for writing: " + ERROR_LOG(m_logger) << "Error opening file '" << f.fileName() << "' for writing: " << f.errorString(); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.h b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.h index 0d467f203..46a441206 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/SqlGenerator.h @@ -106,6 +106,7 @@ public: protected: + NGL::INGLLogger &m_logger; private: bool handleTables(); bool handleViews(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp index a7f6f755b..d41c638e1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.cpp @@ -200,6 +200,8 @@ StructBuilder::StructBuilder(XmlReader *xmlReader) : m_needPoint3d(false) , m_needPgArrayInclude(false) , m_xmlReader(xmlReader) + , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("CodeGen.StructBuilder")) + , m_loggerCSV(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("fileCSV")) {} bool StructBuilder::buildStructures() @@ -266,7 +268,7 @@ bool StructBuilder::buildStructures() const ServiceTypeStruct sts = extractServiceAndTypeFromTypename(tti.name); if (!sts.isExternalType()) { - ERROR_LOG() << "Invalid external topic type name: '" << tti.name << "'"; + ERROR_LOG(m_logger) << "Invalid external topic type name: '" << tti.name << "'"; return false; } if (!handleIdlStructInfo(tti, m_externalTopicTypes, sts.service)) @@ -287,7 +289,7 @@ bool StructBuilder::handleEnum(const EnumInformation &ei) QSharedPointer ti = m_xmlReader->getTable(ei.tableName); if (ti.isNull()) { - WARNING_LOG() << "Could not find table information for enum: " + WARNING_LOG(m_logger) << "Could not find table information for enum: " << ei.enumName << ", table: " << ei.tableName; return false; } @@ -323,12 +325,12 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c { if (!checkExternals) { - ERROR_LOG() << "Could not find enumeration '" << type << "'"; + ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'"; return EnumInformation(); } if (extInfo.type.isEmpty()) { - WARNING_LOG() << "Could not parse external enumeration '" << type << "'"; + WARNING_LOG(m_logger) << "Could not parse external enumeration '" << type << "'"; return EnumInformation(); } return m_xmlReader->getExternalEnumeration(extInfo.service, extInfo.type, verbose); @@ -340,13 +342,13 @@ EnumInformation StructBuilder::enumInformationByType(const QString &type, bool c return ei; } if (verbose) - ERROR_LOG() << "Could not find enumeration '" << type << "'"; + ERROR_LOG(m_logger) << "Could not find enumeration '" << type << "'"; return EnumInformation(); } CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(const QString &type, bool checkExternals) { - DEBUG_LOG() << "topicTypeInformationByStructType(" << type << ")"; + DEBUG_LOG(m_logger) << "topicTypeInformationByStructType(" << type << ")"; if (type.isEmpty()) return CompleteTopicTypeInformation(); @@ -364,26 +366,26 @@ CompleteTopicTypeInformation StructBuilder::topicTypeInformationByStructType(con return csi; } - DEBUG_LOG() << "Type '" << type << "' not found in idlStructs - maybe not yet exported or an enum"; + DEBUG_LOG(m_logger) << "Type '" << type << "' not found in idlStructs - maybe not yet exported or an enum"; const QVector idlStructsToGenerate = m_xmlReader->getIdlStructToGenerate(); for (const TopicTypeInformation &tti : idlStructsToGenerate) { if (tti.name == type) { - DEBUG_LOG() << "Found not yet exported type " << type; + DEBUG_LOG(m_logger) << "Found not yet exported type " << type; if (!handleIdlStructInfo(tti, m_topicTypeInfos)) return CompleteTopicTypeInformation(); return topicTypeInformationByStructType(type); } } - ERROR_LOG() << "Could not find type '" << type << "' in idlStructs"; + ERROR_LOG(m_logger) << "Could not find type '" << type << "' in idlStructs"; return CompleteTopicTypeInformation(); } CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const ServiceTypeStruct &sts) { const QString typeToSearch = sts.fqType(); - DEBUG_LOG() << "externalTopicTypeByStructType " << typeToSearch; + DEBUG_LOG(m_logger) << "externalTopicTypeByStructType " << typeToSearch; for (const CompleteTopicTypeInformation &ctti : std::as_const(m_externalTopicTypes)) { if (ctti.name == typeToSearch) @@ -396,13 +398,13 @@ CompleteTopicTypeInformation StructBuilder::externalTopicTypeByStructType(const bool StructBuilder::loadExternalTopicType(const ServiceTypeStruct &sts) { - DEBUG_LOG() << "loadExternalTopicType(" << sts.fqType() << ")"; + DEBUG_LOG(m_logger) << "loadExternalTopicType(" << sts.fqType() << ")"; const TopicTypeInformation tti = m_xmlReader->loadExternalTopicType(sts.service, sts.type); if (!tti.isValid()) { - DEBUG_LOG() << "Could not find external topic '" << sts.fqType() << "'"; + DEBUG_LOG(m_logger) << "Could not find external topic '" << sts.fqType() << "'"; return false; } @@ -473,11 +475,11 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi) QVector tableNames; if (!getColumnsFromTable(ssi.primaryTable, columns, tableNames)) { - WARNING_LOG() << "Could not retrieve columns from table " + WARNING_LOG(m_logger) << "Could not retrieve columns from table " << ssi.primaryTable; return false; } - DEBUG_LOG() << "Got " << columns.size() << " columns for table " + DEBUG_LOG(m_logger) << "Got " << columns.size() << " columns for table " << ssi.primaryTable; QSet sqlTables; @@ -487,12 +489,12 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi) MemberInformation miPkFirstTable, miPkLastTable; for (const ColumnInformationEx &ci : std::as_const(columns)) { - DEBUG_LOG() << "handling column " << ci.columnName; + DEBUG_LOG(m_logger) << "handling column " << ci.columnName; const QSharedPointer ti = ci.table; if (ti.isNull()) { - WARNING_LOG() << "Could not find table for column " << ci.columnName + WARNING_LOG(m_logger) << "Could not find table for column " << ci.columnName << " primary table is " << ssi.primaryTable.data(); return false; } @@ -560,14 +562,14 @@ bool StructBuilder::handleTable(const ServiceStructInformation &ssi) camelCaseString(fki->destination.tableName, true); EnumInformation ei = enumInformationByType(enumType, true, false); - DEBUG_LOG() << "Checking if " << enumType << " is an enum: " << ei.isValid(); + DEBUG_LOG(m_logger) << "Checking if " << enumType << " is an enum: " << ei.isValid(); if (!ei.isValid() && fki->destination.tableName.contains(QLatin1Char('_'))) { enumType = fki->destination.service + QStringLiteral("::") + camelCaseString(fki->destination.tableName.section(QLatin1Char('_'), 1), true); ei = enumInformationByType(enumType, true, false); - DEBUG_LOG() << "Checking if " << enumType << " is an enum: " << ei.isValid(); + DEBUG_LOG(m_logger) << "Checking if " << enumType << " is an enum: " << ei.isValid(); } if (ei.isValid() && ei.tableName == fki->destination.tableName) @@ -676,8 +678,8 @@ bool StructBuilder::handleIdlStructInfo(const TopicTypeInformation &tti, if (idlData.isKey && idlData.isOptional) { - ERROR_LOG() << "Column option isKey & isOptional are mutually exclusive!"; - ERROR_LOG() << "Change column '" << tti.name << "." + ERROR_LOG(m_logger) << "Column option isKey & isOptional are mutually exclusive!"; + ERROR_LOG(m_logger) << "Change column '" << tti.name << "." << idlData.name << "'' to have either key or optional parameter "; return false; } @@ -1045,7 +1047,7 @@ bool StructBuilder::fixupQVariantConversions(MemberInformation &mi) const } else { - ERROR_LOG() << "Unknown cpp datatype: " << mi.cpp.type; + ERROR_LOG(m_logger) << "Unknown cpp datatype: " << mi.cpp.type; return false; } return true; @@ -1080,7 +1082,7 @@ QVector StructBuilder::buildDbTableInformationFromIdlData(con const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type); if (!cttiChild.isValid()) { - ERROR_LOG() << "Can not find structure '" << member.type << "'"; + ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'"; continue; } QString pre; @@ -1100,7 +1102,7 @@ QVector StructBuilder::buildDbTableInformationFromIdlData(con const CompleteTopicTypeInformation &cttiChild = topicTypeInformationByStructType(member.dataTypeInfo->innerDataType()->idlType()); if (!cttiChild.isValid()) { - ERROR_LOG() << "Can not find structure '" << member.type << "'"; + ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'"; continue; } buildDbTableInformationFromIdlData(cttiChild, @@ -1194,7 +1196,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic const CompleteTopicTypeInformation cttiChild = topicTypeInformationByStructType(member.type); if (!cttiChild.isValid()) { - ERROR_LOG() << "Can not find structure '" << member.type << "'"; + ERROR_LOG(m_logger) << "Can not find structure '" << member.type << "'"; continue; } if (!buildJSonStructureInformationFromIdlData(cttiChild)) @@ -1221,7 +1223,7 @@ bool StructBuilder::buildJSonStructureInformationFromIdlData(const CompleteTopic return false; } else - WARNING_LOG() << "Can not find structure '" << member.type << "'"; + WARNING_LOG(m_logger) << "Can not find structure '" << member.type << "'"; } @@ -1316,11 +1318,11 @@ QMap StructBuilder::getRecordingTopicTables() continue; if (!ctti.isDataObject) { - WARNING_LOG() << "Trying to record topic '" << ctti.name + WARNING_LOG(m_logger) << "Trying to record topic '" << ctti.name << "' which is not directly published - ignoring!"; continue; } - DEBUG_LOG() << "Rec table: " << ctti.name; + DEBUG_LOG(m_logger) << "Rec table: " << ctti.name; miPrimaryKey.db.table = ctti.name; ret.insert(ctti.name, getRecordingTopicTable(ctti, miPrimaryKey)); } @@ -1402,7 +1404,7 @@ StructBuilder::ServiceTypeStruct StructBuilder::extractServiceAndTypeFromTypenam extTypeRef = sl.at(1); } else - WARNING_LOG() << "Error parsing type: " << type; + WARNING_LOG(m_logger) << "Error parsing type: " << type; StructBuilder::ServiceTypeStruct ret; if (!extServiceRef.isEmpty()) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.h b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.h index bd36f0fe2..a615e5939 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/StructBuilder.h @@ -335,5 +335,7 @@ private: bool m_needPgArrayInclude; XmlReader *m_xmlReader; + NGL::INGLLogger &m_logger; + NGL::INGLLogger &m_loggerCSV; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.cpp index e46339942..44a8a6af8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.cpp @@ -31,8 +31,7 @@ private: const QByteArray m_msg; }; -XmlReader::XmlReader() -{} +XmlReader::XmlReader() : m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool XmlReader::readServiceFile(const QString &svcFile, const QString &idlServiceInfoFile, @@ -79,18 +78,18 @@ bool XmlReader::readServiceFile(const QString &svcFile, QFile f(svcFile); if (!f.exists()) { - ERROR_LOG() << "Service file '" << svcFile << "' not found!"; + ERROR_LOG(m_logger) << "Service file '" << svcFile << "' not found!"; return false; } if (!f.open(QIODevice::ReadOnly)) { m_errorString = QLatin1String("Can not open service file '") + svcFile + QLatin1String("' for reading: ") + f.errorString(); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } - INFO_LOG() << "SvcFile: " << svcFile; + INFO_LOG(m_logger) << "SvcFile: " << svcFile; QString errMsg; @@ -102,7 +101,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, m_errorString = QLatin1String("Error parsing service file '") + svcFile + QLatin1String("': ") + errMsg + QLatin1String(" at ") + QString::number(errLine) + QLatin1Char(':') + QString::number(errColumn); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -118,7 +117,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, { m_errorString = QLatin1String("Xml file '") + svcFile + QLatin1String("' is not a valid service file: service name/namespace is missing"); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } m_svcNamespace = getAttribute(domRoot, QStringLiteral("namespace")); @@ -129,13 +128,13 @@ bool XmlReader::readServiceFile(const QString &svcFile, QString devModeStr = getAttribute(domRoot, QStringLiteral("devMode"), true); m_svcDevMode = devModeStr == QStringLiteral("1") || devModeStr == QStringLiteral("true"); - INFO_LOG() << "devMode: " << m_svcDevMode; + INFO_LOG(m_logger) << "devMode: " << m_svcDevMode; const QString groupNamesString = getAttribute(domRoot, QStringLiteral("groups"), true); if (!groupNamesString.isEmpty()) { m_groupNames = groupNamesString.split(QLatin1Char(','), Qt::SkipEmptyParts); - INFO_LOG() << "groups: " << groupNamesString; + INFO_LOG(m_logger) << "groups: " << groupNamesString; } else m_groupNames.clear(); @@ -150,12 +149,12 @@ bool XmlReader::readServiceFile(const QString &svcFile, if (m_exerciseDependency != ExerciseDependency::Global && m_exerciseDependency != ExerciseDependency::GlobalAndExercise) { - WARNING_LOG() << "Service " << getServiceNamespace() + WARNING_LOG(m_logger) << "Service " << getServiceNamespace() << " is not marked as exercise independent but should be started in group Core/Master"; } } - INFO_LOG() << "exerciseDependency: " << (int)m_exerciseDependency; + INFO_LOG(m_logger) << "exerciseDependency: " << (int)m_exerciseDependency; if ( domRoot.hasAttribute(QStringLiteral("prio"))) { m_prio = getAttribute(domRoot, QStringLiteral("prio"), 0).toInt(); @@ -167,7 +166,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing dbServiceStructs: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -178,7 +177,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing dbtables: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -189,7 +188,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing dbviews: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -200,7 +199,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing enumerations: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -211,7 +210,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing custom dtc functions: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -222,7 +221,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing idl strucs: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -233,7 +232,7 @@ bool XmlReader::readServiceFile(const QString &svcFile, catch (const XmlReaderException &ex) { m_errorString = QLatin1String("Error parsing function topics: ") + QLatin1String(ex.what()); - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return false; } @@ -331,7 +330,7 @@ void XmlReader::parseDBSserviceStructs(const QDomElement &rootElement) domDbStruct = domDbStruct.nextSiblingElement(domDbStruct.tagName()); } - INFO_LOG() << "Read " << m_structsToGenerate.size() << " database service struct(s)"; + INFO_LOG(m_logger) << "Read " << m_structsToGenerate.size() << " database service struct(s)"; } void XmlReader::parseDBTables(const QDomElement &rootElement) @@ -373,7 +372,7 @@ void XmlReader::parseDBTables(const QDomElement &rootElement) domDbTable = domDbTable.nextSiblingElement(domDbTable.tagName()); } - INFO_LOG() << "Read " << m_tables.size() << " database table(s)"; + INFO_LOG(m_logger) << "Read " << m_tables.size() << " database table(s)"; } void XmlReader::parseDBViews(const QDomElement &rootElement) @@ -393,7 +392,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement) vi->filter = getAttribute(domDbView, QStringLiteral("filter")); vi->exerciseDependency = string2ExerciseDependency(getAttribute(domDbView, QStringLiteral("exerciseDependency"), true)); - DEBUG_LOG() << "Base table = " << vi->baseTable; + DEBUG_LOG(m_logger) << "Base table = " << vi->baseTable; m_views.insert(vi->name, vi); @@ -401,7 +400,7 @@ void XmlReader::parseDBViews(const QDomElement &rootElement) domDbView = domDbView.nextSiblingElement(domDbView.tagName()); } - INFO_LOG() << "Read " << m_views.size() << " database view(s)"; + INFO_LOG(m_logger) << "Read " << m_views.size() << " database view(s)"; } void XmlReader::parseEnumerations(const QDomElement &rootElement) @@ -432,7 +431,7 @@ void XmlReader::parseEnumerations(const QDomElement &rootElement) domEnum = domEnum.nextSiblingElement(domEnum.tagName()); } - INFO_LOG() << "Read " << m_enumerations.size() << " enumeration(s)"; + INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " enumeration(s)"; } void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement) @@ -452,7 +451,7 @@ void XmlReader::parseCustomDtcFunctions(const QDomElement &rootElement) } domElement = domElement.nextSiblingElement(domElement.tagName()); } - INFO_LOG() << "Read " << m_enumerations.size() << " customDtcFunction(s)"; + INFO_LOG(m_logger) << "Read " << m_enumerations.size() << " customDtcFunction(s)"; } @@ -510,7 +509,7 @@ void XmlReader::parseTopicTypes(const QDomElement &rootElement) } - INFO_LOG() << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)"; + INFO_LOG(m_logger) << "Read " << m_idlStructsToGenerate.size() << " idl struct(s)"; } void XmlReader::parseFunctionTopics(const QDomElement &rootElement) @@ -566,7 +565,7 @@ ColumnInformation XmlReader::parseTableColumn(const QDomElement &column, const Q } if (ci.columnName.toLower() != ci.columnName) - WARNING_LOG() << "Column " << ci.columnName << " in Table " + WARNING_LOG(m_logger) << "Column " << ci.columnName << " in Table " << tableName << " has has upper-case chars which is not allowed!"; return ci; @@ -726,18 +725,18 @@ DbNotifcationInformation XmlReader::parseDbNotification(const QDomElement &custo TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalServiceName, const QString &topicTypeName) { - DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName; + DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << topicTypeName; if (!loadExternalService(externalServiceName)) { - WARNING_LOG() << "Could not find service " << externalServiceName + WARNING_LOG(m_logger) << "Could not find service " << externalServiceName << " referenced by external topic " << topicTypeName; return TopicTypeInformation(); } auto extXmlReader = m_externalXmlInformations.value(externalServiceName); if (!extXmlReader) { - ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'"; + ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'"; return TopicTypeInformation(); } @@ -749,7 +748,7 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer m_usedServices[externalServiceName] = true; return tti; } - WARNING_LOG() << "Could not find topic " << topicTypeName + WARNING_LOG(m_logger) << "Could not find topic " << topicTypeName << " in external service definition for service " << externalServiceName; return TopicTypeInformation(); @@ -757,18 +756,18 @@ TopicTypeInformation XmlReader::loadExternalTopicType(const QString &externalSer EnumInformation XmlReader::getExternalEnumeration(const QString &externalServiceName, const QString &enumName, bool verbose) { - DEBUG_LOG() << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName; + DEBUG_LOG(m_logger) << "externalServiceName: " << externalServiceName << ", topicTypeName: " << enumName; if (!loadExternalService(externalServiceName)) { - WARNING_LOG() << "Could not find service '" << externalServiceName << "'" + WARNING_LOG(m_logger) << "Could not find service '" << externalServiceName << "'" << " referenced by external enumeration " << enumName; return EnumInformation(); } auto extXmlReader = m_externalXmlInformations.value(externalServiceName); if (!extXmlReader) { - ERROR_LOG() << "Could not find service xml file for service '" << externalServiceName << "'"; + ERROR_LOG(m_logger) << "Could not find service xml file for service '" << externalServiceName << "'"; return EnumInformation(); } @@ -783,7 +782,7 @@ EnumInformation XmlReader::getExternalEnumeration(const QString &externalService } if (verbose) { - WARNING_LOG() << "Could not find enumeration " << enumName + WARNING_LOG(m_logger) << "Could not find enumeration " << enumName << " in external service definition for '" << externalServiceName << "'"; } @@ -821,11 +820,11 @@ bool XmlReader::loadExternalService(const QString &serviceName) if (fileName.isEmpty()) return false; - DEBUG_LOG() << "xml file for " << serviceName << ": " << fileName; + DEBUG_LOG(m_logger) << "xml file for " << serviceName << ": " << fileName; auto extXmlReader = QSharedPointer(new XmlReader); if (!extXmlReader->readServiceFile(fileName, QString(), this)) { - WARNING_LOG() << "Error reading service file " << fileName + WARNING_LOG(m_logger) << "Error reading service file " << fileName << " for service " << serviceName; return false; } @@ -842,7 +841,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile) QFile f(idlServiceInfoFile); if (!f.open(QIODevice::ReadOnly)) { - WARNING_LOG() << "Could not read idl service info file " << idlServiceInfoFile; + WARNING_LOG(m_logger) << "Could not read idl service info file " << idlServiceInfoFile; return; } const QList files = f.readAll().split('\n'); @@ -859,7 +858,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile) { const auto svcAbbreveation = fn.split(QLatin1Char('.')).at(0).split(QLatin1Char('_')).at(0); m_xmlFiles[svcAbbreveation] = fileName; - DEBUG_LOG() << "xml: " << svcAbbreveation << " = " << fileName; + DEBUG_LOG(m_logger) << "xml: " << svcAbbreveation << " = " << fileName; } else { @@ -867,7 +866,7 @@ void XmlReader::loadIdlInfofile(const QString &idlServiceInfoFile) if (svcAbbreveation.endsWith(QLatin1String("_enums"))) continue; m_idlFiles[svcAbbreveation] = fileName; - DEBUG_LOG() << "idl: " << svcAbbreveation << " = " << fileName; + DEBUG_LOG(m_logger) << "idl: " << svcAbbreveation << " = " << fileName; } } } @@ -893,7 +892,7 @@ void XmlReader::getServiceNameInfoFromFilePath(const QStringList &parts) const QString abbreviation = parts.last().split(QLatin1Char('.')).first().split(QLatin1Char('_')).first(); const QString serviceName = parts.at(parts.size() - 2); - DEBUG_LOG() << "serviceName: " << serviceName << " = " << abbreviation; + DEBUG_LOG(m_logger) << "serviceName: " << serviceName << " = " << abbreviation; m_fullServiceName2Abbreviation[serviceName] = abbreviation; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.h b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.h index a39f4c596..7b54ed9ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/XmlReader.h @@ -359,6 +359,7 @@ public: XmlReader &operator=(const XmlReader &) = delete; private: + NGL::INGLLogger &m_logger; void parseDBSserviceStructs(const QDomElement &rootElement); void parseDBTables(const QDomElement &rootElement); void parseDBViews(const QDomElement &rootElement); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/main_grantlee.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/main_grantlee.cpp index 293a61b24..3ee571270 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/main_grantlee.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/main_grantlee.cpp @@ -77,20 +77,20 @@ int main(int argc, char **argv) QScopedPointer reader(new CodeGen::XmlReader); - DEBUG_LOG() << "ServiceFile: " << options.serviceFile(); - DEBUG_LOG() << "IdlInfoFile: " << options.idlInfoFile(); + DEBUG_LOG(m_logger) << "ServiceFile: " << options.serviceFile(); + DEBUG_LOG(m_logger) << "IdlInfoFile: " << options.idlInfoFile(); if (!reader->readServiceFile(options.serviceFile(), options.idlInfoFile())) { - ERROR_LOG() << "Error parsing service file '" << options.serviceFile() + ERROR_LOG(m_logger) << "Error parsing service file '" << options.serviceFile() << ": " << reader->errorString(); return 2; } QDir dir(options.outDir()); - DEBUG_LOG() << "Directory: " << options.outDir(); + DEBUG_LOG(m_logger) << "Directory: " << options.outDir(); if (!dir.exists() && !dir.mkpath(options.outDir())) { - ERROR_LOG() << "Directory '" << options.outDir() + ERROR_LOG(m_logger) << "Directory '" << options.outDir() << "' does not exist and can not be created!"; return 3; } @@ -98,7 +98,7 @@ int main(int argc, char **argv) QScopedPointer structBuilder(new CodeGen::StructBuilder(reader.data())); if (!structBuilder->buildStructures()) { - ERROR_LOG() << "Error building up structures"; + ERROR_LOG(m_logger) << "Error building up structures"; return 4; } @@ -123,7 +123,7 @@ int main(int argc, char **argv) if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Exercise)) { - ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr(); + ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr(); return 10; } @@ -133,7 +133,7 @@ int main(int argc, char **argv) if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Exercise)) { - ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr(); + ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr(); return 10; } @@ -141,20 +141,20 @@ int main(int argc, char **argv) sql.generateData(0); if (!sql.writeSql(dir.absolutePath() + QLatin1Char('/'), CodeGen::ExerciseDependency::Global)) { - ERROR_LOG() << "Error while writing sql information for service " << sql.getServiceAbbr(); + ERROR_LOG(m_logger) << "Error while writing sql information for service " << sql.getServiceAbbr(); return 10; } return 0; } else { - ERROR_LOG() << "Invalid action '" << options.action() << "' given!"; + ERROR_LOG(m_logger) << "Invalid action '" << options.action() << "' given!"; return 5; } if (!generator->init(reader.data(), structBuilder.data())) { - ERROR_LOG() << "Error initializing generator!"; + ERROR_LOG(m_logger) << "Error initializing generator!"; return 6; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/UnitTest_Coordinate/lts_coordinate_unit_test.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/UnitTest_Coordinate/lts_coordinate_unit_test.h index a0cf5ade7..e4d28536d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/UnitTest_Coordinate/lts_coordinate_unit_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsCoordinate/UnitTest_Coordinate/lts_coordinate_unit_test.h @@ -77,4 +77,9 @@ private Q_SLOTS: private: + + + + +NGL::INGLLogger &m_logger; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/UnitTest_Elevation/elevation_unit_test.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/UnitTest_Elevation/elevation_unit_test.h index 5bf447da1..5da231892 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/UnitTest_Elevation/elevation_unit_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/UnitTest_Elevation/elevation_unit_test.h @@ -53,4 +53,9 @@ private Q_SLOTS: private: + + + + +NGL::INGLLogger &m_logger; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/lts_elevation_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/lts_elevation_manager.cpp index 8f8c0585c..fad1573d5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/lts_elevation_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsElevation/lts_elevation_manager.cpp @@ -80,16 +80,16 @@ LtsElevationManager::LtsElevationManager() , d(new Private) { ++s_counter; - TRACE_LOG() << Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; - TRACE_LOG() << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; } LtsElevationManager::~LtsElevationManager() { --s_counter; - TRACE_LOG() << Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; delete d; - TRACE_LOG() << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; } LTS_ELEVATION_MANAGER_TYPE LtsElevationManager::createInstance(int exerciseId, @@ -283,7 +283,7 @@ void LtsElevationManager::cleanupAll() void LtsElevationManager::initDDS(const std::shared_ptr &exmDtc, const std::shared_ptr &asmDtc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; d->m_exmDtc = exmDtc; if (d->m_exmDtc) @@ -293,16 +293,16 @@ void LtsElevationManager::initDDS(const std::shared_ptrm_asmDtc) d->m_asmDtc->waitForHistoricalDataTrainingArea(1000); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } QStringList LtsElevationManager::getFilenamesForExercise(int exerciseId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!d->m_exmDtc || !d->m_asmDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no dtcs" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no dtcs" << ", exerciseId=" << exerciseId; return {}; } @@ -311,7 +311,7 @@ QStringList LtsElevationManager::getFilenamesForExercise(int exerciseId) int trainingAreaId = exerciseIdToTrainingAreaId(exerciseId, d->m_exmDtc); if (trainingAreaId <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " Error getting trainingAreaId" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error getting trainingAreaId" << ", exerciseId=" << exerciseId << ", trainingAreaId=" << trainingAreaId; return {}; @@ -319,17 +319,17 @@ QStringList LtsElevationManager::getFilenamesForExercise(int exerciseId) QStringList filePaths_rough_to_fine = getFilenamesForTrainingArea(trainingAreaId); - TRACE_LOG() << Q_FUNC_INFO << " END, filePaths_rough_to_fine=" << filePaths_rough_to_fine.join(QStringLiteral(";")); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, filePaths_rough_to_fine=" << filePaths_rough_to_fine.join(QStringLiteral(";")); return filePaths_rough_to_fine; } QStringList LtsElevationManager::getFilenamesForTrainingArea(int trainingAreaId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!d->m_asmDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no dtcs" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no dtcs" << ", trainingAreaId=" << trainingAreaId; return {}; } @@ -341,7 +341,7 @@ QStringList LtsElevationManager::getFilenamesForTrainingArea(int trainingAreaId) const AssetManagement::TrainingArea &ta = d->m_asmDtc->trainingArea(trainingAreaId); if (ta.id() != trainingAreaId) { - ERROR_LOG() << Q_FUNC_INFO << " Error on s_asmDtc->trainingArea" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error on s_asmDtc->trainingArea" << ", trainingAreaId=" << trainingAreaId; return {}; } @@ -359,7 +359,7 @@ QStringList LtsElevationManager::getFilenamesForTrainingArea(int trainingAreaId) filePaths_rough_to_fine.append(filePathAbs); } } - TRACE_LOG() << Q_FUNC_INFO << " END, filePaths_rough_to_fine=" << filePaths_rough_to_fine.join(QStringLiteral(";")); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, filePaths_rough_to_fine=" << filePaths_rough_to_fine.join(QStringLiteral(";")); return filePaths_rough_to_fine; } @@ -444,11 +444,11 @@ double LtsElevationManager::elevation(double lon_rad, double lat_rad, double def LineOfSight LtsElevationManager::lineOfSightCalculation(const LtsUtils::QPoint3D &startPointGeo_absZ, const LtsUtils::QPoint3D &endPointGeo_absZ) { - TRACE_LOG() << Q_FUNC_INFO << " START" << ", startPointGeo_absZ = " << startPointGeo_absZ << ", endPointGeo_absZ = " << endPointGeo_absZ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << ", startPointGeo_absZ = " << startPointGeo_absZ << ", endPointGeo_absZ = " << endPointGeo_absZ; if (!isValid()) { - ERROR_LOG() << Q_FUNC_INFO << " Error, LtsElevationManager not valid"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error, LtsElevationManager not valid"; return LineOfSight::LOS_ERROR; } @@ -458,14 +458,14 @@ LineOfSight LtsElevationManager::lineOfSightCalculation(const LtsUtils::QPoint3D LtsElevation::LineOfSight result = static_cast(eleMapMgrResult); - TRACE_LOG() << Q_FUNC_INFO << " END" << ", startPointGeo = " << startPointGeo_absZ << ", endPointGeo = " << endPointGeo_absZ + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << ", startPointGeo = " << startPointGeo_absZ << ", endPointGeo = " << endPointGeo_absZ << " -> LineOfSight " << result; return result; } LineOfSight LtsElevationManager::lineOfSightCalculation(const QPointF &startPointGeo, double startHat, const QPointF &endPointGeo, double endHat) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << ", startPointGeo = " << startPointGeo << ", startHat = " << startHat << ", endPointGeo = " << endPointGeo << ", endHat = " << endHat; @@ -476,7 +476,7 @@ LineOfSight LtsElevationManager::lineOfSightCalculation(const QPointF &startPoin LtsElevation::LineOfSight result = static_cast(eleMapMgrResult); - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << ", startPointGeo = " << startPointGeo << ", startHat = " << startHat << ", endPointGeo = " << endPointGeo << ", endHat = " << endHat << " -> LineOfSight " << static_cast(eleMapMgrResult); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.cpp index 125f5e00c..ba364cdf9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.cpp @@ -122,7 +122,7 @@ bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription &app, boo if (!pluginLoader->loadPlugins(PluginType::DATA, cb)) { - WARNING_LOG() << "PluginLoader failed to load data plugins - abort!"; + WARNING_LOG(m_logger) << "PluginLoader failed to load data plugins - abort!"; return false; } @@ -137,7 +137,7 @@ bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription &app, boo if (!pluginLoader->loadPlugins(PluginType::GUI, cbLoadPlugins)) { - WARNING_LOG() << "PluginLoader failed to load gui plugins - abort!"; + WARNING_LOG(m_logger) << "PluginLoader failed to load gui plugins - abort!"; return false; } @@ -255,7 +255,7 @@ bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription &app, boo LtsSession::DdsConnectionParams connParamsNew(connParams); if (!connParamsNew.isValid()) { - INFO_LOG() << "Invalid connection params given - using default parameter"; + INFO_LOG(m_logger) << "Invalid connection params given - using default parameter"; connParamsNew.domainId = LtsSessionData::LtsSessionData::getInstance()->getDomainIdPreset(); connParamsNew.partitionId = 0; @@ -277,7 +277,7 @@ bool LtsPluginManager::startApp(const LtsAppDescriptor::AppDescription &app, boo headless, hidden)) { - ERROR_LOG() << "Could not create Global Session - abort."; + ERROR_LOG(m_logger) << "Could not create Global Session - abort."; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.h index f4284ebf5..d831b9e3a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPluginManager/lts_plugin_manager.h @@ -3,7 +3,7 @@ #pragma once -#include "ltspluginmanager_export.h" +#include "lts_plugin_manager_export.h" #include #include @@ -85,6 +85,7 @@ public: LtsSession::LtsSessionManager *m_sessionManager; private: + NGL::INGLLogger &m_logger; friend class DeveloperTools::DevDialog; LtsAppDescriptor::AppDescription m_app; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.cpp index fae552731..1a3ef1a4f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.cpp @@ -61,8 +61,7 @@ Base::Base(QTextDocument &doc, const QString &_fn, QPrinter::PaperSize _ps, QPrinter::Orientation _or, - QPrinter::ColorMode _cm) - : m_printer(new QPrinter), + QPrinter::ColorMode _cm) : m_printer(new QPrinter), m_painter(new QPainter), m_iconFilenameNr(0), m_tempdoc(nullptr), @@ -72,8 +71,8 @@ Base::Base(QTextDocument &doc, footersize_(10), footerrule_(0.5), footertext_(FooterText), itemFontSize_(2), m_settings(new NGL::Settings(NGL::findProjectConfigFile())).getNGLLogger("NGLPrinting")), - m_currentPage(1) -{ + m_currentPage(1), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { QString fn = _fn; fn = fn.remove(QLatin1Char(' ')); fn = fn.remove(QLatin1String("..")); @@ -158,7 +157,7 @@ void Base::setPrintToFile(bool printToFile) QPrinter *Base::printer() { - DEBUG_LOG() << "Base::printer" ; + DEBUG_LOG(m_logger) << "Base::printer" ; return m_printer; } @@ -391,7 +390,7 @@ bool Base::printTableData(QString &str, } str += QLatin1String(""); - DEBUG_LOG() << qPrintable(str) ; + DEBUG_LOG(m_logger) << qPrintable(str) ; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.h index 2753c8234..b7e05ccbf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsPrinting/printing_base.h @@ -226,6 +226,8 @@ public: QSize pageSizeInMM(); protected: + +NGL::INGLLogger &m_logger; bool printTableItemData(QString &str, const QAbstractItemModel *model, const QModelIndex &mi, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/lts_projection_workstation.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/lts_projection_workstation.cpp index 5bc878fbc..72e6a8dfc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/lts_projection_workstation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/lts_projection_workstation.cpp @@ -77,7 +77,7 @@ LoginInformation LtsProjectionWorkstation::pendingLoginRequest() LoginInformation result = *m_pendingLoginRequest; - INFO_LOG() << " reset pendingLoginRequest.."; + INFO_LOG(m_logger) << " reset pendingLoginRequest.."; delete m_pendingLoginRequest; m_pendingLoginRequest = nullptr; @@ -90,7 +90,7 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage CTS::LoginRequest *login = dynamic_cast(message); if (login) { - INFO_LOG() << "Login request received!" + INFO_LOG(m_logger) << "Login request received!" << ", login->userId()=" << login->userId() << " with login->priority()=" << login->priority() << " ;;; m_lastLoginRequest.m_userId=" << m_lastLoginRequest.m_userId @@ -108,16 +108,16 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage - DEBUG_LOG() << "Login request received and DedicatedDisconnect distributed, wait some seconds..."; + DEBUG_LOG(m_logger) << "Login request received and DedicatedDisconnect distributed, wait some seconds..."; int i=0; while(i<20) { - DEBUG_LOG() << "Login request received and DedicatedDisconnect distributed, wait some seconds...i=" << i; + DEBUG_LOG(m_logger) << "Login request received and DedicatedDisconnect distributed, wait some seconds...i=" << i; qApp->processEvents(QEventLoop::AllEvents, 50); QThread::msleep(50); ++i; } - INFO_LOG() << "Login request received and DedicatedDisconnect distributed, wait some seconds... done"; + INFO_LOG(m_logger) << "Login request received and DedicatedDisconnect distributed, wait some seconds... done"; login->addReply((new STC::LoginRequestReply(QUuid::createUuid().toString(), @@ -133,10 +133,10 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage slotLoginRequestReceived(login->userId(), login->exerciseId()); - INFO_LOG() << "Valid login request received -> userId: " << login->userId() + INFO_LOG(m_logger) << "Valid login request received -> userId: " << login->userId() << " priority: " << login->priority() << " exerciseId: " << login->exerciseId(); - DEBUG_LOG() << "Logging in now!"; + DEBUG_LOG(m_logger) << "Logging in now!"; } else @@ -147,17 +147,17 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage QVector()) )->toReplyMessage()); - DEBUG_LOG() << "Higher prioritized login received -> userId: " << login->userId() + DEBUG_LOG(m_logger) << "Higher prioritized login received -> userId: " << login->userId() << " priority: " << login->priority() << " exerciseId: " << login->exerciseId(); - DEBUG_LOG() << "Last login data was -> userId: " << m_lastLoginRequest.m_userId + DEBUG_LOG(m_logger) << "Last login data was -> userId: " << m_lastLoginRequest.m_userId << " priority: " << m_lastLoginRequest.m_priority << " exerciseId: " << m_lastLoginRequest.m_exerciseId; } } else - ERROR_LOG() << "invalid login request received -> userId: " << login->userId() + ERROR_LOG(m_logger) << "invalid login request received -> userId: " << login->userId() << " priority: " << login->priority() << " exerciseId: " << login->exerciseId(); @@ -167,7 +167,7 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage CTS::LogoutRequest *logout = dynamic_cast(message); if (logout) { - DEBUG_LOG() << "Logging out now!"; + DEBUG_LOG(m_logger) << "Logging out now!"; slotLogoutRequestReceived(); return; } @@ -184,7 +184,7 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage int disconnectingUserId = discon->userId(); - INFO_LOG() << "Disconnecting now! " + INFO_LOG(m_logger) << "Disconnecting now! " << ", disconnectingUserId=" << disconnectingUserId << ", m_pendingLoginRequest=" << m_pendingLoginRequest; m_lastLoginRequest = LoginInformation(); @@ -194,7 +194,7 @@ void LtsProjectionWorkstation::handleMessage(LtsWebSocket::AbstractClientMessage void LtsProjectionWorkstation::slotLoginRequestReceived(int userId, int exerciseId) { - INFO_LOG() << "slotLoginRequestReceived.." + INFO_LOG(m_logger) << "slotLoginRequestReceived.." << ", userId=" << userId << ", exerciseId=" << exerciseId; delete m_pendingLoginRequest; @@ -219,17 +219,17 @@ void LtsProjectionWorkstation::slotLogoffDone() void LtsProjectionWorkstation::clientDisconnected(LtsWebSocket::ClientConnection *client) { - INFO_LOG() << Q_FUNC_INFO << " START" + INFO_LOG(m_logger) << Q_FUNC_INFO << " START" << ", m_connections.size = " << m_connections.size(); m_connections.removeOne(client); if ( m_connections.size() == 0 && (m_lastLoginRequest.m_userId != 0 || m_lastLoginRequest.m_priority != 0)) { - INFO_LOG() << Q_FUNC_INFO << " reset m_lastLoginRequest"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " reset m_lastLoginRequest"; m_lastLoginRequest = LoginInformation(); } - INFO_LOG() << Q_FUNC_INFO << " END" + INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << ", m_connections.size = " << m_connections.size(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/vnc_server_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/vnc_server_manager.cpp index 5d3cf22f5..50dfa8724 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/vnc_server_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsProjectionWorkstation/vnc_server_manager.cpp @@ -48,7 +48,7 @@ bool VncServerManager::init(const QList &screens) const auto sortedScreens = sortScreen(screens); - DEBUG_LOG() << "Setup VNCScreens with " << screens.size() << " screens"; + DEBUG_LOG(m_logger) << "Setup VNCScreens with " << screens.size() << " screens"; int count = 1; @@ -77,13 +77,13 @@ bool VncServerManager::init(const QList &screens) count++; } - DEBUG_LOG() << m_vncScreens.size() << " VNCScreen(s) created - Setup completed."; + DEBUG_LOG(m_logger) << m_vncScreens.size() << " VNCScreen(s) created - Setup completed."; return true; } void VncServerManager::startScreens() { - DEBUG_LOG() << "Starting " << m_vncScreens.size() << " VNCScreen(s) ... "; + DEBUG_LOG(m_logger) << "Starting " << m_vncScreens.size() << " VNCScreen(s) ... "; for (const VncScreen &s : std::as_const(m_vncScreens)) { connect(s.proc, &QProcess::readyReadStandardOutput, @@ -95,16 +95,16 @@ void VncServerManager::startScreens() for (const VncScreen &s : std::as_const(m_vncScreens)) { if (!s.proc->waitForStarted(2000)) - ERROR_LOG() << "Can not start process '" << s.proc->program() << "': " + ERROR_LOG(m_logger) << "Can not start process '" << s.proc->program() << "': " << s.proc->errorString(); } - DEBUG_LOG() << "Done"; + DEBUG_LOG(m_logger) << "Done"; } void VncServerManager::stopScreens() { - DEBUG_LOG() << "Stopping " << m_vncScreens.size() << " VNCScreen(s) ..."; + DEBUG_LOG(m_logger) << "Stopping " << m_vncScreens.size() << " VNCScreen(s) ..."; for (const VncScreen &s : std::as_const(m_vncScreens)) { @@ -116,28 +116,28 @@ void VncServerManager::stopScreens() if (!s.proc->waitForFinished(2000)) s.proc->kill(); } - DEBUG_LOG() << "Done"; + DEBUG_LOG(m_logger) << "Done"; } void VncServerManager::killScreens() { - DEBUG_LOG() << "Killing all exisiting x11vnc processes ..."; + DEBUG_LOG(m_logger) << "Killing all exisiting x11vnc processes ..."; SingleShotProcess ssp(QStringLiteral("killall x11vnc")); ssp.execute(); - DEBUG_LOG() << "Done"; + DEBUG_LOG(m_logger) << "Done"; } void VncServerManager::createPwdFile() { - DEBUG_LOG() << "(Re)creating x11vnc password-file ..."; + DEBUG_LOG(m_logger) << "(Re)creating x11vnc password-file ..."; SingleShotProcess ssp(QStringLiteral("x11vnc -storepasswd ctc11de %1/.vnc/passwd") .arg(QDir::home().absolutePath())); ssp.execute(); - DEBUG_LOG() << "Done"; + DEBUG_LOG(m_logger) << "Done"; } @@ -151,7 +151,7 @@ void VncServerManager::slotReadStandardOutput() QRegularExpressionMatch match = QRegularExpression(QStringLiteral("PORT=(.*?)\\s")).match(stdOut); if (!match.hasMatch()) { - WARNING_LOG() << "Could not retrieve port information from stdout of " << p->program(); + WARNING_LOG(m_logger) << "Could not retrieve port information from stdout of " << p->program(); return; } const quint16 port = match.capturedRef(1).toInt(); @@ -172,7 +172,7 @@ void VncServerManager::slotErrorOccured() { QProcess *p = qobject_cast(QObject::sender()); if (p) - ERROR_LOG() << p->errorString(); + ERROR_LOG(m_logger) << p->errorString(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.cpp index 01f367208..52cc57d6f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.cpp @@ -49,7 +49,7 @@ void LtsSerialPortQuerry::continueQuerry() void LtsSerialPortQuerry::restartQuerry() { - DEBUG_LOG() << "restart querry "; + DEBUG_LOG(m_logger) << "restart querry "; m_serialPortInfos = QSerialPortInfo::availablePorts(); m_currentQuerry = 0; if (m_serialPortInfos.size()) @@ -73,20 +73,20 @@ void LtsSerialPortQuerry::querrySerialPort(const QSerialPortInfo &info) m_currentSerialPort->setStopBits(m_stopBits); m_currentSerialPort->setFlowControl(m_flowControll); - DEBUG_LOG() << "Try opening Comport:" << m_currentSerialPort->portName() << " index is: " << m_currentQuerry; + DEBUG_LOG(m_logger) << "Try opening Comport:" << m_currentSerialPort->portName() << " index is: " << m_currentQuerry; if (!m_currentSerialPort->open(QSerialPort::ReadWrite)) { - DEBUG_LOG() << "Oppening failed query next"; + DEBUG_LOG(m_logger) << "Oppening failed query next"; continueQuerry(); }else { connect(m_currentSerialPort, &QSerialPort::errorOccurred, this, &LtsSerialPortQuerry::onSerialPortError, Qt::UniqueConnection); - DEBUG_LOG() << "Oppened comport" << m_currentSerialPort->portName(); + DEBUG_LOG(m_logger) << "Oppened comport" << m_currentSerialPort->portName(); emit connectionEstablished(); } } @@ -110,7 +110,7 @@ void LtsSerialPortQuerry::onSerialPortError(QSerialPort::SerialPortError serialP if (!m_currentSerialPort) return; - DEBUG_LOG() << "Spontaneous error " << serialPortError << " doesn't have to be an error ..."; + DEBUG_LOG(m_logger) << "Spontaneous error " << serialPortError << " doesn't have to be an error ..."; const QString errStr(QStringLiteral("QSerialPort::SerialPortError ") + QString::number(serialPortError) + QStringLiteral(" from serial port ") + m_currentSerialPort->portName() + @@ -129,19 +129,19 @@ void LtsSerialPortQuerry::onSerialPortError(QSerialPort::SerialPortError serialP case QSerialPort::SerialPortError::NotOpenError: case QSerialPort::SerialPortError::UnknownError: { - ERROR_LOG() << "Closing port and try to reopen it. " << m_currentSerialPort->portName(); + ERROR_LOG(m_logger) << "Closing port and try to reopen it. " << m_currentSerialPort->portName(); continueQuerry(); Q_FALLTHROUGH(); } case QSerialPort::SerialPortError::UnsupportedOperationError: { - ERROR_LOG() << errStr; + ERROR_LOG(m_logger) << errStr; break; } default: { - ERROR_LOG() << "Got an Error> " << errStr << "restarting"; + ERROR_LOG(m_logger) << "Got an Error> " << errStr << "restarting"; continueQuerry(); break; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.h index 4cd81291e..9ed48076d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSerialPortQuerry/lts_serial_port_querry.h @@ -33,13 +33,16 @@ signals: void connectionEstablished(); private: + NGL::INGLLogger &m_logger; void querrySerialPort(const QSerialPortInfo &info); void closeAndDeleteCurrentPort(); private: + NGL::INGLLogger &m_logger; void onSerialPortError(QSerialPort::SerialPortError serialPortError); private: + NGL::INGLLogger &m_logger; QList m_serialPortInfos; int m_currentQuerry; QSerialPort::BaudRate m_baudRate; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/CMakeLists.txt index b481d9fe6..53da7fd9f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/CMakeLists.txt @@ -51,7 +51,6 @@ NGL_TARGET_LINK_LIBRARIES(LtsSession Qt6::Network LtsMultiMonitor LtsSessionData - ddsconnector LtsUtilsGuiDds # ReqHelpr & for Debug Menu ! TODO: rm on release! LtsNotification svcCoreClient # Core Ftc - for TLH @@ -67,6 +66,8 @@ NGL_TARGET_LINK_LIBRARIES(LtsSession ) IF(BUILD_RTI) NGL_TARGET_LINK_LIBRARIES(LtsSession + PRIVATE + ddsconnector PUBLIC LtsSessionDataDds ) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session.cpp index 447f4348b..e6bd1eac8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session.cpp @@ -699,6 +699,7 @@ void LtsSession::slotStapleTopicLockHandler(LtsWidgets::LtsDialog *widget) } widget->setProperty("topicLockStapled", true); +#ifdef BUILD_RTI connectOnlineHelpButton(widget); if (m_coreFtc == nullptr) { @@ -736,6 +737,10 @@ void LtsSession::slotStapleTopicLockHandler(LtsWidgets::LtsDialog *widget) connectOnlineHelpButton(widget); +#else + Q_UNUSED(widget) + DEBUG_LOG(m_logger) << "BUILD_RTI=OFF, skipping TopicLockHandler setup"; +#endif } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler.h index 85bfd5650..835400548 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler.h @@ -1,5 +1,7 @@ #pragma once +#ifdef BUILD_RTI + #include #include #include @@ -104,3 +106,9 @@ private: } // namespace LtsSession + +#else // BUILD_RTI + +#include "lts_session_lock_handler_stub.h" + +#endif // BUILD_RTI diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler_stub.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler_stub.h new file mode 100644 index 000000000..647c51759 --- /dev/null +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_lock_handler_stub.h @@ -0,0 +1,81 @@ +/** + * @RDE_HEADER@ + * Stub header for lts_session_lock_handler.h when BUILD_RTI=OFF + * Provides minimal declarations to allow compilation without RTI Connext DDS + */ + +#pragma once + +#include +#include + +#include +#include +#include + +#include + +namespace LtsSession +{ + +// Stub TopicLockHandler class - minimal version without DDS functionality +class LTSSESSION_EXPORT TopicLockHandler : public QObject +{ + Q_OBJECT +public: + explicit TopicLockHandler(QObject *parent = nullptr) : QObject(parent) + , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("LtsSession.TopicLockHandler")) + {} + ~TopicLockHandler() override = default; + + bool init(const void * /*coreFtc*/, int /*exerciseId*/) { return false; } + + bool isLocked() const { return false; } + LtsWidgets::TopicInfo getTopicInfo() const { return LtsWidgets::TopicInfo(); } + +public slots: + void slotTryLock(const LtsWidgets::TopicInfo & /*topicInfo*/) {} + bool slotUnlock() { return false; } + void slotFinalize() { deleteLater(); } + +signals: + void signalLockDialog(const QString & /*lockedBy*/) {} + void signalUnlockDialog() {} + +private: + NGL::INGLLogger &m_logger; +}; + + +class LTSSESSION_EXPORT TopicLockHanderData : public QObject +{ + Q_OBJECT + +public: + explicit TopicLockHanderData(QObject *parent = nullptr) : QObject(parent) {} + ~TopicLockHanderData() override = default; + + void init(const void * /*coreFtc*/, int /*exerciseId*/) {} + + void unlock() {} + void slotTryLock(const LtsWidgets::TopicInfo & /*topicInfo*/) {} + bool isLocked() const { return false; } + LtsWidgets::TopicInfo getTopicInfo() const { return LtsWidgets::TopicInfo(); } + const QString &getLockedBy() const { return m_lockedBy; } + +Q_SIGNALS: + void lockDataChanged(); + +private Q_SLOTS: + void slotLock(const QString & /*lockedBy*/) {} + void slotUnlock() {} + +public: + QString m_debugName; +private: + QPointer m_topicLockHandler; + QString m_lockedBy; +}; + + +} // namespace LtsSession \ No newline at end of file diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_manager.cpp index f07283f2a..2c42f3eda 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsSession/lts_session_manager.cpp @@ -19,7 +19,9 @@ #include #include #include +#ifdef BUILD_RTI #include +#endif #include diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.cpp index 81cc1ae10..b7812d44b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.cpp @@ -339,12 +339,12 @@ QModelIndex TimelineModel::index(int row, int column, const QModelIndex &parent) } catch (const QString &msg) { - DEBUG_LOG() << Q_FUNC_INFO << "cannot get parent track " << msg; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "cannot get parent track " << msg; return {}; } catch (const std::out_of_range &oor) { - DEBUG_LOG() << Q_FUNC_INFO << "cannot get child track " << QString::fromUtf8(oor.what()); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "cannot get child track " << QString::fromUtf8(oor.what()); return {}; } @@ -455,7 +455,7 @@ QModelIndex TimelineModel::parent(const QModelIndex &index) const } catch (const QString &msg) { - DEBUG_LOG() << Q_FUNC_INFO << "cannot get parent of track with id" << trackId << msg; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "cannot get parent of track with id" << trackId << msg; return {}; } @@ -473,13 +473,13 @@ QModelIndex TimelineModel::parent(const QModelIndex &index) const } catch (const QString &msg) { - DEBUG_LOG() << Q_FUNC_INFO << "row of track for parent not found for parent id" << parentId << "-" << msg; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "row of track for parent not found for parent id" << parentId << "-" << msg; return {}; } } catch (const QString &msg) { - DEBUG_LOG() << Q_FUNC_INFO << "super parent not found for super parent id" << superParentId << "-" << msg; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "super parent not found for super parent id" << superParentId << "-" << msg; return {}; } @@ -722,11 +722,11 @@ void TimelineModel::setMinimumDuration(int duration) { if (duration < 0) { - WARNING_LOG() << "negative duration is not possible -> setting minimum duration to 0"; + WARNING_LOG(m_logger) << "negative duration is not possible -> setting minimum duration to 0"; duration = 0; } if (duration % 1000 && m_isSnapEnabled) - WARNING_LOG() << "Snapping to 1000ms enabled, yet minimum duration is not a multiple of 1000ms: " << duration; + WARNING_LOG(m_logger) << "Snapping to 1000ms enabled, yet minimum duration is not a multiple of 1000ms: " << duration; m_minItemDuration = duration; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.h index 3dc8c9bec..8ae84e87d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_model.h @@ -141,6 +141,7 @@ public: int columnCount(const QModelIndex &) const override { return 2; } protected: + NGL::INGLLogger &m_logger; ItemPtrNCVRef _itemNCV(Track &track, int id) noexcept(false) { return track._itemNCV(id); @@ -223,6 +224,7 @@ public slots: virtual void onRemoveTrack(const QModelIndex &index) { Q_UNUSED(index); } protected: + NGL::INGLLogger &m_logger; TimelineView *m_view{nullptr}; Track m_rootTrack; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.cpp index 100923333..97426e356 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.cpp @@ -76,7 +76,7 @@ void TimelineView::setHeader(QHeaderView *header) } catch (...) { - ERROR_LOG() << "header view should be of type TimelineHeaderView"; + ERROR_LOG(m_logger) << "header view should be of type TimelineHeaderView"; } } @@ -125,7 +125,7 @@ void TimelineView::setItemDelegate(QAbstractItemDelegate *delegate) } catch (...) { - ERROR_LOG() << "item delegate for TimelineView must be derived from ItemDelegate"; + ERROR_LOG(m_logger) << "item delegate for TimelineView must be derived from ItemDelegate"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.h index ef97962b2..4f51b2469 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_view.h @@ -122,6 +122,7 @@ public: bool isCursorWithinRangeY(int y) const; protected: + NGL::INGLLogger &m_logger; void dragEnterEvent(QDragEnterEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override; void dragLeaveEvent(QDragLeaveEvent *event) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_widget.h index 5bed5d4b1..514c87d55 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimeline/timeline_widget.h @@ -89,6 +89,8 @@ public: void hideDebugWidget(); private: + +NGL::INGLLogger &m_logger; void populateZoomFactorComboBox(); public: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.cpp index 46754c1b5..dc9a99473 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.cpp @@ -10,15 +10,14 @@ namespace LtsTimelineClassic { -AbstractTimelineModel::AbstractTimelineModel(QObject *parent) - : QAbstractItemModel(parent) +AbstractTimelineModel::AbstractTimelineModel(QObject *parent) : QAbstractItemModel(parent) .getNGLLogger("Timeline.AbstractTimelineModel")) , m_highestPositionedItem(0) , m_lowestPositionedItem(0) , m_getEventListsRecursive(true) , m_rootItem(new Item(QLatin1String("#mwille/r00t/"))) - , m_markersItem(new Item(tr("Markers"), QStringLiteral("Markers"))) -{ + , m_markersItem(new Item(tr("Markers"), QStringLiteral("Markers"))), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.h index 5d09ebfc2..bcdcc3aa8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/AbstractTimelineModel.h @@ -45,6 +45,9 @@ public: protected: + + +NGL::INGLLogger &m_logger; protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.cpp index d2305c973..174dd8ca2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.cpp @@ -16,8 +16,7 @@ namespace LtsTimelineClassic Event::Event(int uniqueId, int typeId, qint64 startTime, qint64 endTime, int playerId, int partyId, int equipmentId, const QStringList &path, const EventPaintFunc &paintFunc, const QColor &paintColor, const QJsonObject &detailData, int subEventId, - const LtsUtils::QPoint3D &pos, LtsSession::LtsSession *session) - : m_path(path) + const LtsUtils::QPoint3D &pos, LtsSession::LtsSession *session) : m_path(path) , m_detailData(detailData) , m_position(pos) , m_paintFunc(paintFunc) @@ -32,9 +31,8 @@ Event::Event(int uniqueId, int typeId, qint64 startTime, , m_partyId(partyId) , m_equipmentId(equipmentId) , m_deleted(false) - , m_visible(true) - -{ + , m_visible(true), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { checkDuration(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.h index 0b8e5ea4d..78cf1b39b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/Event.h @@ -125,6 +125,9 @@ public: protected: + + +NGL::INGLLogger &m_logger; QStringList m_path; QJsonObject m_detailData; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineIndicator.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineIndicator.cpp index ee96583ba..1bafe2cce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineIndicator.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineIndicator.cpp @@ -39,8 +39,7 @@ namespace LtsTimelineClassic { -TimelineIndicator::TimelineIndicator(QWidget *parent) - : QWidget(parent) +TimelineIndicator::TimelineIndicator(QWidget *parent) : QWidget(parent) , m_zoomFactorPoints(0) , m_pbZoom(new QPushButton(this)) , m_pbUnzoom(new QPushButton(this)) @@ -49,8 +48,8 @@ TimelineIndicator::TimelineIndicator(QWidget *parent) , m_currentTextWidth(0) , m_sectionPos(0) , m_sectionSize(0) - .getNGLLogger("Timeline.Indicator")) -{ + .getNGLLogger("Timeline.Indicator")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_timeArray.reserve(11 + 11 + 7 + 10); m_timeArray << @@ -380,7 +379,7 @@ void TimelineIndicator::refreshData() if (steps > 60000 || steps < 1) { - ERROR_LOG() << "More than 60000 ("<setupUi(this); m_timelineUi->view->setHeader(m_headerView); m_headerView->setMinimumSectionSize(150); @@ -99,7 +98,7 @@ void TimelineWidget::knownRangesChanged(const QVector &newRanges) EventDelegate *ed = qobject_cast(m_timelineUi->view->itemDelegate()); if (ed == nullptr) { - WARNING_LOG() << "ed == nullptr"; + WARNING_LOG(m_logger) << "ed == nullptr"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineWidget.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineWidget.h index c749bdf5a..c6cdc302a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineWidget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsTimelineClassic/TimelineWidget.h @@ -57,6 +57,7 @@ public: private: + NGL::INGLLogger &m_logger; void setTimelineRange(qint64 min, qint64 max); void refreshData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.cpp index eb83053e6..1ddecedf0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.cpp @@ -15,7 +15,7 @@ ClientConnection::ClientConnection(QWebSocket *socket, QObject *parent) ClientConnection::~ClientConnection() { - DEBUG_LOG() << "Thread closed" << this; + DEBUG_LOG(m_logger) << "Thread closed" << this; delete m_socket; qDeleteAll(m_messageQueue); } @@ -24,11 +24,11 @@ bool ClientConnection::init() { if (m_socket == nullptr) { - ERROR_LOG() << "Initialisation failed due to an invalid socket"; + ERROR_LOG(m_logger) << "Initialisation failed due to an invalid socket"; return false; } - DEBUG_LOG() << "Started new thread" << this; + DEBUG_LOG(m_logger) << "Started new thread" << this; connect(m_socket, &QWebSocket::textMessageReceived, this, &ClientConnection::onNewTextMessageFromSocket, Qt::DirectConnection); connect(m_socket, &QWebSocket::connected, this, &ClientConnection::sendMessagesFromQueue); connect(m_socket, &QWebSocket::disconnected, this, &ClientConnection::onSocketDisconnect); @@ -41,24 +41,24 @@ void ClientConnection::addReply(ReplyMessage *message) if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState) { m_messageQueue.enqueue(message); - DEBUG_LOG() << "Adding message to queue, size: " << m_messageQueue.size(); + DEBUG_LOG(m_logger) << "Adding message to queue, size: " << m_messageQueue.size(); return; } const QString msg(message->toJsonString()); - DEBUG_LOG() << "Sending message: " << msg ; + DEBUG_LOG(m_logger) << "Sending message: " << msg ; m_socket->sendTextMessage(msg); delete message; } void ClientConnection::onNewTextMessageFromSocket(const QString &message) { - DEBUG_LOG() << "Recv msg: " << message << this; + DEBUG_LOG(m_logger) << "Recv msg: " << message << this; emit newTextMessage(this, message); } void ClientConnection::sendMessagesFromQueue() { - INFO_LOG() << "Client connected ip: " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); + INFO_LOG(m_logger) << "Client connected ip: " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); if (m_socket->state() != QAbstractSocket::ConnectedState) return; @@ -66,16 +66,16 @@ void ClientConnection::sendMessagesFromQueue() { ReplyMessage *message = m_messageQueue.dequeue(); const QString msg(message->toJsonString()); - TRACE_LOG() << "Send msg: " << msg; + TRACE_LOG(m_logger) << "Send msg: " << msg; m_socket->sendTextMessage(msg); delete message; - DEBUG_LOG() << "Sent message from queue, new size: " << m_messageQueue.size(); + DEBUG_LOG(m_logger) << "Sent message from queue, new size: " << m_messageQueue.size(); } } void ClientConnection::onSocketDisconnect() { - DEBUG_LOG() << "Client disconnected ip: " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); + DEBUG_LOG(m_logger) << "Client disconnected ip: " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); exit(0); emit disconnected(this); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.h index c136aa8b6..e700812d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/client_connection.h @@ -58,9 +58,11 @@ private slots: private: + NGL::INGLLogger &m_logger; void sendMessages(); private: + NGL::INGLLogger &m_logger; QWebSocket *m_socket; QQueue m_messageQueue; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.cpp index 253b38409..614d17768 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.cpp @@ -9,10 +9,9 @@ using namespace LtsWebSocket; -ConnectionHandler::ConnectionHandler(QObject *parent) - : QObject(parent) - , m_server(nullptr) -{} +ConnectionHandler::ConnectionHandler(QObject *parent) : QObject(parent) + , m_server(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} ConnectionHandler::~ConnectionHandler() { @@ -33,13 +32,13 @@ bool ConnectionHandler::init(const QString &serviceName, unsigned short port) connect(m_server, &QWebSocketServer::newConnection, this, &ConnectionHandler::onNewConnection); connect(m_server, &QWebSocketServer::serverError, this, &ConnectionHandler::onServerError); - DEBUG_LOG() << "Trying to listen "; + DEBUG_LOG(m_logger) << "Trying to listen "; if (!m_server->listen(QHostAddress::Any, port)) { - ERROR_LOG() << "Not possible to listen to port " << port; + ERROR_LOG(m_logger) << "Not possible to listen to port " << port; return false; } - DEBUG_LOG() << "... ok, port " << m_server->serverPort(); + DEBUG_LOG(m_logger) << "... ok, port " << m_server->serverPort(); return true; } @@ -54,7 +53,7 @@ void ConnectionHandler::sendToAllClients(ReplyMessage *message) void ConnectionHandler::onServerError(QWebSocketProtocol::CloseCode closeCode) { - ERROR_LOG() << "Got server error with close code " << closeCode; + ERROR_LOG(m_logger) << "Got server error with close code " << closeCode; } void ConnectionHandler::onNewConnection() @@ -71,7 +70,7 @@ void ConnectionHandler::onNewConnection() if (!newConnection->init()) { - ERROR_LOG() << "Failed to initialise new client"; + ERROR_LOG(m_logger) << "Failed to initialise new client"; delete newConnection; newConnection = nullptr; continue; @@ -84,6 +83,6 @@ void ConnectionHandler::onNewConnection() m_connections.insert(newConnection); emit clientConnected(newConnection); - INFO_LOG() << "New client connected ip: " << socket->localAddress().toString() << ":" << socket->localPort(); + INFO_LOG(m_logger) << "New client connected ip: " << socket->localAddress().toString() << ":" << socket->localPort(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.h index 7ef182bb0..e3d241f6a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/connection_handler.h @@ -57,6 +57,7 @@ private slots: void onNewConnection(); private: + NGL::INGLLogger &m_logger; QWebSocketServer *m_server; QSet m_connections; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/data_manager_base_dl.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/data_manager_base_dl.h index 49e11775b..489171ce9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/data_manager_base_dl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/data_manager_base_dl.h @@ -31,7 +31,7 @@ protected: if (!m_dbInterface->select(dataVec)) { const QString errorMessage = QStringLiteral("Error reading data from database!"); - ERROR_LOG() << errorMessage; + ERROR_LOG(m_logger) << errorMessage; ErrorMessage::ErrorData errData; errData.errorMessage = errorMessage; errData.uuid = uuid; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.cpp index 4547c7898..86eaec1c7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.cpp @@ -71,18 +71,18 @@ void WebSocketHelper::doOpen(const QString &hostname, const unsigned short port) doClose(); else { - INFO_LOG() << "Web socket to url: " << url.toDisplayString() << " is already open."; + INFO_LOG(m_logger) << "Web socket to url: " << url.toDisplayString() << " is already open."; return; } } - INFO_LOG() << "Opening web socket to url: " << url.toDisplayString(); + INFO_LOG(m_logger) << "Opening web socket to url: " << url.toDisplayString(); m_socket->open(url); } void WebSocketHelper::doClose() { - INFO_LOG() << "Closing web socket to url:" << m_socket->requestUrl().toDisplayString(); + INFO_LOG(m_logger) << "Closing web socket to url:" << m_socket->requestUrl().toDisplayString(); m_socket->close(); } @@ -90,29 +90,29 @@ void WebSocketHelper::doSendTextMessage(const QString &msg) { if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState) { - ERROR_LOG() << "Message could not be send, socket is not connected."; + ERROR_LOG(m_logger) << "Message could not be send, socket is not connected."; return; } - DEBUG_LOG() << "Sending message: " << msg; + DEBUG_LOG(m_logger) << "Sending message: " << msg; m_socket->sendTextMessage(msg); } void WebSocketHelper::onConnected() { - INFO_LOG() << "Connected to server url: " << m_socket->requestUrl().toDisplayString() + INFO_LOG(m_logger) << "Connected to server url: " << m_socket->requestUrl().toDisplayString() << " using local port: " << m_socket->localPort(); emit connected(); } void WebSocketHelper::onDisconnected() { - INFO_LOG() << "Disconnected from server url: " << m_socket->requestUrl().toDisplayString(); + INFO_LOG(m_logger) << "Disconnected from server url: " << m_socket->requestUrl().toDisplayString(); emit disconnected(); } void WebSocketHelper::onError(QAbstractSocket::SocketError error) { - ERROR_LOG() << "Error occured: " << error << " closing socket."; + ERROR_LOG(m_logger) << "Error occured: " << error << " closing socket."; m_socket->close(); } @@ -131,7 +131,7 @@ void WebSocketHelper::parseMessage(const QString &message) clientMessage = m_messageFactory->createMessage(m_webSocketClient, message); else { - WARNING_LOG() << "Could not parse incoming message: '" << message + WARNING_LOG(m_logger) << "Could not parse incoming message: '" << message << "', error: " << result.errorString(); clientMessage = new InvalidMessage(m_webSocketClient, QString(), QStringLiteral("Got message which is not JSON conform (%1)").arg(result.errorString())); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.h index 96862619e..00fa9e8a1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_client.h @@ -56,6 +56,8 @@ signals: void onSendTextMessage(const QString &msg); private: + +NGL::INGLLogger &m_logger; AbstractClientMessageFactory *m_messageFactory; QThread *m_webSocketHelperThread; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_server.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_server.cpp index 08c03ea41..9d3351f00 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_server.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWebSocket/lts_web_socket_server.cpp @@ -29,7 +29,7 @@ bool LtsWebSocketServer::init(const QString &serviceName, const unsigned short p if (!m_connectionHandler->init(serviceName, port)) { - ERROR_LOG() << "Could not init m_connectionHandler with servicename: " << serviceName << ((port == 0) ? QStringLiteral(" random port") : QStringLiteral(" port: ") + QString::number(port)); + ERROR_LOG(m_logger) << "Could not init m_connectionHandler with servicename: " << serviceName << ((port == 0) ? QStringLiteral(" random port") : QStringLiteral(" port: ") + QString::number(port)); m_connectionHandler.reset(); return false; } @@ -59,7 +59,7 @@ bool LtsWebSocketServer::init(const QString &serviceName, const QPairtoJsonString(); + DEBUG_LOG(m_logger) << "Sending message to all clients: " << message->toJsonString(); m_connectionHandler->sendToAllClients(message); } @@ -81,7 +81,7 @@ void LtsWebSocketServer::onNewTextMessage(ReplyHandler *client, const QString &m client->addReply(new PongMessage(message.mid(pingMsg.size()))); return; } - DEBUG_LOG() << "Got new message: " << message; + DEBUG_LOG(m_logger) << "Got new message: " << message; m_messageQueue.append({client, message}); @@ -102,7 +102,7 @@ void LtsWebSocketServer::onQueueTimerTimeout() clientMessage = m_messageFactory->createMessage(credentials.client, credentials.message); else { - WARNING_LOG() << "Could not parse incoming message: '" << credentials.message << "', error: " << result.errorString(); + WARNING_LOG(m_logger) << "Could not parse incoming message: '" << credentials.message << "', error: " << result.errorString(); clientMessage = new InvalidMessage(credentials.client, QString(), QStringLiteral("Got message which is not JSON conform")); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/CMakeLists.txt index cc01887dd..80f4cdf3f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/CMakeLists.txt @@ -153,40 +153,38 @@ MESSAGE(STATUS "DEBUG: After NGL_ADD_BIG_RESOURCES") NGL_ADD_BIG_RESOURCES(ltswidgets_SRCS resources/lts_resources.qrc) -MESSAGE(STATUS "DEBUG BEFORE IF: BUILD_RTI=${BUILD_RTI}, BUILD_WS=${BUILD_WS}") +MESSAGE(STATUS "DEBUG: BUILD_RTI=${BUILD_RTI}, BUILD_WS=${BUILD_WS}, building LtsWidgets") +NGL_ADD_LIBRARY2(WS TOOLSWS TOOLSSV LtsWidgets SHARED ${ltswidgets_SRCS}) +NGL_TARGET_INCLUDE_DIRECTORIES(LtsWidgets + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/../ + ${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore + ${CMAKE_CURRENT_BINARY_DIR} +) + +NGL_TARGET_LINK_LIBRARIES(LtsWidgets + PRIVATE + Qt6::Network # for QHostInfo - for portability + Qt6::Svg + ngltools + ngltranslator + TabBarTabStyle + LtsSessionData + LtsUtilsSettings + PUBLIC + LtsUtilsCore + Qt6::Core + Qt6::Widgets + Qt6::Gui +) + +NGL_INSTALL_TARGET(LtsWidgets) + +# +# Designer-Plugin (RTI-dependent) +# IF(BUILD_RTI) - MESSAGE(STATUS "DEBUG: BUILD_RTI=${BUILD_RTI}, BUILD_WS=${BUILD_WS}, building LtsWidgets") - NGL_ADD_LIBRARY2(WS TOOLSWS TOOLSSV LtsWidgets SHARED ${ltswidgets_SRCS}) - - NGL_TARGET_INCLUDE_DIRECTORIES(LtsWidgets - PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR}/../ - ${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore - ${CMAKE_CURRENT_BINARY_DIR} - ) - - NGL_TARGET_LINK_LIBRARIES(LtsWidgets - PRIVATE - Qt6::Network # for QHostInfo - for portability - Qt6::Svg - ngltools - ngltranslator - TabBarTabStyle - LtsSessionData - LtsUtilsSettings - PUBLIC - LtsUtilsCore - Qt6::Core - Qt6::Widgets - Qt6::Gui - ) - - NGL_INSTALL_TARGET(LtsWidgets) - - # - # Designer-Plugin - # 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) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.cpp index 8ec9b8b37..dea43d262 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.cpp @@ -486,13 +486,13 @@ void LtsDialog::showEvent(QShowEvent *event) void LtsDialog::tryLockTopic() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_topicInfo.isValid()) return; if (m_topicInfo.isLocked()) { - WARNING_LOG() << Q_FUNC_INFO << " tried to lock with an already locked topic info, return"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " tried to lock with an already locked topic info, return"; return; } @@ -508,7 +508,7 @@ void LtsDialog::tryLockTopic() bool bIsConnected = isSignalConnected(QMetaMethod::fromSignal(&LtsDialog::signalLockTopic)); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " signalLockTopic(): " << ", TopicName =" << m_topicInfo.topicName() << ", entity =" << m_topicInfo.entityId() @@ -520,7 +520,7 @@ void LtsDialog::tryLockTopic() m_topicInfo.setLocked(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void LtsDialog::initTopicLockHandler(const QString &topicName, int entityId) @@ -535,14 +535,14 @@ void LtsDialog::initTopicLockHandler(const QString &topicName, int entityId) void LtsDialog::tryLockTopicNew() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; tryLockTopic(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void LtsDialog::tryLockTopicNew(const QString &topicName, int entityId) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << ", topicName='" << topicName << "'" << ", entityId=" << entityId; @@ -550,7 +550,7 @@ void LtsDialog::tryLockTopicNew(const QString &topicName, int entityId) if (m_topicInfo.entityId() != entityId) { - DEBUG_LOG() << Q_FUNC_INFO << " topicName='" << topicName << "'" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " topicName='" << topicName << "'" << " change from " << m_topicInfo.entityId() << " to " << entityId; m_topicInfo.setLocked(false); } @@ -561,16 +561,16 @@ void LtsDialog::tryLockTopicNew(const QString &topicName, int entityId) m_topicInfo.setValid(); tryLockTopic(); - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << ", topicName='" << topicName << "'" << ", entityId=" << entityId; } void LtsDialog::triggerTopicLock() { - TRACE_LOG() << Q_FUNC_INFO << " START" << " !!trigger!!"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " !!trigger!!"; tryLockTopic(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.h index aedb37ba2..13f0534df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/LtsWidgets/lts_dialog.h @@ -43,6 +43,8 @@ public: void setValid() { m_valid = true; } private: + +NGL::INGLLogger &m_logger; QString m_topicName; int m_entityId{0}; bool m_locked{false}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp index dcc96ecfc..1e3cad565 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp @@ -78,7 +78,7 @@ void Pacemaker::init(DDSConnector::DdsConnector *ddsConnector) m_dtsCurrentRunningState = ddsConnector->createDTS(); if (!m_dtsCurrentRunningState) { - WARNING_LOG() << "Can not initialize DTS::CurrentRunningState!"; + WARNING_LOG(m_logger) << "Can not initialize DTS::CurrentRunningState!"; return; } m_state.pid(QCoreApplication::applicationPid()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h index 17834ae9d..62441675a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h @@ -41,10 +41,12 @@ public Q_SLOTS: void publishState(); private: + NGL::INGLLogger &m_logger; void init(DDSConnector::DdsConnector *ddsConnector); void setNewStateInternal(Core::RunningState newState, const QString &errorString = QString()); void addPortInternal(unsigned short number, Core::PortType portType, const QString &properties = QStringLiteral("")); private: + NGL::INGLLogger &m_logger; static constexpr const int m_publishTimerDelay = 3000; CurrentRunningState m_state; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp index e839c418a..0f87098c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp @@ -33,7 +33,7 @@ DdsConnector::DdsConnector(int domainId, .getNGLLogger("Common.DDSConnector")) { initInternal(); - DEBUG_LOG() << "DdsConnector ctor: " << m_domainId << "," << m_partitionId << ","<< m_exerciseId << "," << static_cast(m_defaultPartitionType); + DEBUG_LOG(m_logger) << "DdsConnector ctor: " << m_domainId << "," << m_partitionId << ","<< m_exerciseId << "," << static_cast(m_defaultPartitionType); } DdsConnector::DdsConnector(int domainId, @@ -108,7 +108,7 @@ bool DdsConnector::init(const QStringList &qosFileList) QUrl DdsConnector::getTcpConnectionUrl() const { - DEBUG_LOG() << this << " gettcpConnectionUrl: " << m_tcpConnectionUrl.toString(); + DEBUG_LOG(m_logger) << this << " gettcpConnectionUrl: " << m_tcpConnectionUrl.toString(); return m_tcpConnectionUrl; } @@ -180,7 +180,7 @@ std::string DdsConnector::getPartitionString(IDL::PartitionType pt, int partitio } NGL::INGLLogger &m_logger = NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Common.DDSConnector"); - ERROR_LOG() << "Invalid partition type: " << static_cast(pt); + ERROR_LOG(m_logger) << "Invalid partition type: " << static_cast(pt); return std::string(); } @@ -204,7 +204,7 @@ void DdsConnector::setDomainParticipant(const dds::domain::DomainParticipant &pa } catch (const dds::core::Exception &ex) { - WARNING_LOG() << "Could not enable DomainParticipant: " << ex.what(); + WARNING_LOG(m_logger) << "Could not enable DomainParticipant: " << ex.what(); exit(1); } } @@ -213,7 +213,7 @@ void DdsConnector::setPublisher(Publisher *publisher) { if (m_publisher && publisher != m_publisher) { - WARNING_LOG() << "Trying to set publisher but there is already a publisher set - overwriting!"; + WARNING_LOG(m_logger) << "Trying to set publisher but there is already a publisher set - overwriting!"; delete m_publisher; } m_publisher = publisher; @@ -232,7 +232,7 @@ void DdsConnector::setSubscriber(Subscriber *subscriber) { if (m_subscriber && subscriber != m_subscriber) { - WARNING_LOG() << "Trying to set subscriber but there is already a subscriber set - overwriting!"; + WARNING_LOG(m_logger) << "Trying to set subscriber but there is already a subscriber set - overwriting!"; delete m_subscriber; } m_subscriber = subscriber; @@ -257,13 +257,13 @@ void DdsConnector::initInternal() m_defaultPartitionType == IDL::PartitionType::AllExercises) m_partitionId = -1; if (m_defaultPartitionType == IDL::PartitionType::Exercise && m_partitionId < 0) - WARNING_LOG() << "Want to subscribe to an exercise, but no exercise Id is given!"; + WARNING_LOG(m_logger) << "Want to subscribe to an exercise, but no exercise Id is given!"; if (m_defaultPartitionType == IDL::PartitionType::Global) { m_partitionId = 0; m_exerciseId = 0; } - INFO_LOG() << "DDSConnector(" << m_domainId << ") for partition: " << m_partitionId + INFO_LOG(m_logger) << "DDSConnector(" << m_domainId << ") for partition: " << m_partitionId << " with partition type " << static_cast(m_defaultPartitionType); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h index cbe3028c4..2fcbd7199 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h @@ -182,9 +182,11 @@ public: } private: + NGL::INGLLogger &m_logger; void initInternal(); void createWaitSetHandler(); private: + NGL::INGLLogger &m_logger; int m_domainId; IDL::PartitionType m_defaultPartitionType; int m_partitionId; @@ -207,6 +209,7 @@ public: : m_coherentSet(connector->getDdsPublisher()) {} private: + NGL::INGLLogger &m_logger; dds::pub::CoherentSet m_coherentSet; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/pub_sub_base.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/pub_sub_base.h index 981326e93..2816ce0e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/pub_sub_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/pub_sub_base.h @@ -18,6 +18,7 @@ namespace DDSConnector class DDSCONNECTOR_EXPORT PubSubBase { protected: +NGL::INGLLogger &m_logger; PubSubBase(const dds::domain::DomainParticipant &domainParticipant, const std::string &partition, const char *loggerName); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DTC/generic_dtc_impl.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DTC/generic_dtc_impl.h index 0a7af6968..47a793190 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DTC/generic_dtc_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DTC/generic_dtc_impl.h @@ -81,12 +81,12 @@ public: { if (m_subscriberCallback) { - WARNING_LOG() << "Can not set subscriber callback - already set ..."; + WARNING_LOG(m_logger) << "Can not set subscriber callback - already set ..."; return false; } if (!m_subscriberListener) { - WARNING_LOG() << "Can not set subscriber callback - no subscriber listener ..."; + WARNING_LOG(m_logger) << "Can not set subscriber callback - no subscriber listener ..."; return false; } @@ -94,7 +94,7 @@ public: if (!m_dataReaderObject) { - WARNING_LOG() << "Can not set subscriber callback - no data reader object ..."; + WARNING_LOG(m_logger) << "Can not set subscriber callback - no data reader object ..."; return false; } @@ -193,7 +193,7 @@ protected: Q_UNUSED(topicType); if (m_writerState.testAndSetRelaxed(1, 0)) { - DEBUG_LOG() << "Recreate Reader for topic " << topicName + DEBUG_LOG(m_logger) << "Recreate Reader for topic " << topicName << ", type name " << DDS::topic_type_name::value(); if (m_subscriberListener) m_subscriberListener->removeCallback(m_dataReaderObject->getDataReader(), this); @@ -202,7 +202,7 @@ protected: m_subscriberListener->addCallback(m_dataReaderObject->getDataReader(), this); } - DEBUG_LOG() << "IN droDataAvailable(), topic name: " << topicName + DEBUG_LOG(m_logger) << "IN droDataAvailable(), topic name: " << topicName << ", type name " << DDS::topic_type_name::value() << ", this: " << this << ", m_dataReaderObject: " << m_dataReaderObject @@ -235,7 +235,7 @@ protected: { if (!droInitOk) { - ERROR_LOG() << "Error initializing DRO for type " << DDS::topic_type_name::value(); + ERROR_LOG(m_logger) << "Error initializing DRO for type " << DDS::topic_type_name::value(); delete m_dataReaderObject; m_dataReaderObject = nullptr; return false; @@ -243,13 +243,13 @@ protected: if (m_subscriberListener) { - DEBUG_LOG() << "subscriberListener exists, adding type " + DEBUG_LOG(m_logger) << "subscriberListener exists, adding type " << DDS::topic_type_name::value(); m_subscriberListener->addCallback(m_dataReaderObject->getDataReader(), this); } else { - DEBUG_LOG() << "Cannot add DTC to subscriberListener callback - type: " + DEBUG_LOG(m_logger) << "Cannot add DTC to subscriberListener callback - type: " << DDS::topic_type_name::value(); } m_dataReaderObject->setHaveSubscriberCallback(m_subscriberListener != nullptr); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DTS/generic_dts_impl.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DTS/generic_dts_impl.h index c554e1e4d..f6d6b156d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DTS/generic_dts_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DTS/generic_dts_impl.h @@ -36,7 +36,7 @@ namespace DTS bool write(const TopicType &data, const dds::core::optional &si = dds::core::optional()) override final { - DEBUG_LOG() << "IN write (" + DEBUG_LOG(m_logger) << "IN write (" << DDS::topic_type_name::value() << ")"; @@ -45,11 +45,11 @@ namespace DTS if (!m_dataWriterObject->write(data, si)) { - ERROR_LOG() << "Error writing for " + ERROR_LOG(m_logger) << "Error writing for " << DDS::topic_type_name::value(); return false; } - DEBUG_LOG() << "TopicData (" + DEBUG_LOG(m_logger) << "TopicData (" << DDS::topic_type_name::value() << ") written"; @@ -58,7 +58,7 @@ namespace DTS bool remove(const TopicType &data, bool errorMsgIfNotExists = true) override final { - DEBUG_LOG() << "IN remove (" + DEBUG_LOG(m_logger) << "IN remove (" << DDS::topic_type_name::value() << ")"; @@ -68,11 +68,11 @@ namespace DTS if (!m_dataWriterObject->remove(data, errorMsgIfNotExists)) { if (errorMsgIfNotExists) - ERROR_LOG() << "Error removing for " + ERROR_LOG(m_logger) << "Error removing for " << DDS::topic_type_name::value(); return false; } - DEBUG_LOG() << "TopicData (" + DEBUG_LOG(m_logger) << "TopicData (" << DDS::topic_type_name::value() << ") removed"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.cpp index 26d4d4bd9..174766ff6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.cpp @@ -15,8 +15,7 @@ #include -DataTopicTests::DataTopicTests() - : m_domainParticipantPub(nullptr) +DataTopicTests::DataTopicTests() : m_domainParticipantPub(nullptr) , m_domainParticipantSub(nullptr) , m_domainId(0) , m_partitionId(1) @@ -26,12 +25,12 @@ DataTopicTests::DataTopicTests() , m_subscriberListener(nullptr) , m_dtcTestPart(nullptr) , m_mainThreadId(QThread::currentThreadId()) - .getNGLLogger("UnitTests.DataTopicTests")) -{ + .getNGLLogger("UnitTests.DataTopicTests")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!DDS::QosProfile::setDefault()) - ERROR_LOG() << "Error setting default QoS from xml-file "; + ERROR_LOG(m_logger) << "Error setting default QoS from xml-file "; - DEBUG_LOG() << "Main thread ID is " << m_mainThreadId; + DEBUG_LOG(m_logger) << "Main thread ID is " << m_mainThreadId; } DataTopicTests::~DataTopicTests() @@ -65,7 +64,7 @@ bool DataTopicTests::initPublisher() partitionQos.name( { partition.toStdString() } ); publisherQos << partitionQos; - DEBUG_LOG() << "Publish on partition " << partition; + DEBUG_LOG(m_logger) << "Publish on partition " << partition; m_ddsPublisher = dds::pub::Publisher(m_domainParticipantPub, publisherQos); m_testPart = new DTS::TestParticipantImpl(m_domainParticipantPub, m_ddsPublisher); @@ -75,8 +74,8 @@ bool DataTopicTests::initPublisher() bool DataTopicTests::write(const DdsUnitTests::TestParticipant &data) { - INFO_LOG() << "Publish topic TestParticipant "; - DEBUG_LOG() << "ParticipantId: " << data.location().participantId() + INFO_LOG(m_logger) << "Publish topic TestParticipant "; + DEBUG_LOG(m_logger) << "ParticipantId: " << data.location().participantId() << ", equipNo = " << data.location().equipNo(); return m_testPart->write(data); @@ -88,7 +87,7 @@ bool DataTopicTests::write(const DdsUnitTests::TestParticipant &data) bool DataTopicTests::initSubscriber() { - DEBUG_LOG() << "Initialisation DDS (Subscriber/Reader)"; + DEBUG_LOG(m_logger) << "Initialisation DDS (Subscriber/Reader)"; m_domainParticipantSub = dds::domain::DomainParticipant(m_domainId, @@ -108,7 +107,7 @@ bool DataTopicTests::initSubscriber() partitionQos.name( partitions ); subscriberQos << partitionQos; - DEBUG_LOG() << "Initialise DTC::SubscriberListener"; + DEBUG_LOG(m_logger) << "Initialise DTC::SubscriberListener"; m_subscriberListener = new DDSGeneric::SubscriberListener(); m_ddsSubscriber = dds::sub::Subscriber(m_domainParticipantSub, subscriberQos, @@ -142,10 +141,10 @@ void DataTopicTests::deleteSubscriber() void DataTopicTests::processData(const DdsUnitTests::TestParticipant &instance, const dds::sub::SampleInfo &si) { - INFO_LOG() << "process data in topic TestParticipant, Sampleinfo: " << si.source_timestamp().sec(); + INFO_LOG(m_logger) << "process data in topic TestParticipant, Sampleinfo: " << si.source_timestamp().sec(); - DEBUG_LOG() << "participantId: " << instance.location().participantId(); - DEBUG_LOG() << "equipNo: " << instance.location().equipNo(); + DEBUG_LOG(m_logger) << "participantId: " << instance.location().participantId(); + DEBUG_LOG(m_logger) << "equipNo: " << instance.location().equipNo(); m_receivedParticipantData = instance; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.h index 0449855c9..1f1dbbacf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests.h @@ -34,6 +34,7 @@ public: protected: + NGL::INGLLogger &m_logger; void processData(const DdsUnitTests::TestParticipant &instance, const dds::sub::SampleInfo &si); Q_SIGNALS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.cpp index 678e84399..364035cf1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.cpp @@ -33,7 +33,7 @@ DataTopicTestsMain::DataTopicTestsMain() void DataTopicTestsMain::initTestCase() { - DEBUG_LOG() <<"DataTopicTestsMain: initTestCase"; + DEBUG_LOG(m_logger) <<"DataTopicTestsMain: initTestCase"; m_dtTest = new DataTopicTests(); QVERIFY2(m_dtTest, "Initialisation of DataTopicTest failed"); @@ -46,20 +46,20 @@ void DataTopicTestsMain::initTestCase() void DataTopicTestsMain::publishTestCase() { - DEBUG_LOG() <<"DataTopicTestsMain: publish TestParticipant"; + DEBUG_LOG(m_logger) <<"DataTopicTestsMain: publish TestParticipant"; m_sentParticipantData.location().participantId(100); m_sentParticipantData.location().equipNo(1010); m_sentParticipantData.testId(100); QVERIFY2(m_dtTest->write(m_sentParticipantData), "Publishing Topic TestParticipant failed"); - DEBUG_LOG() <<"DataTopicTestsMain: publish ready"; + DEBUG_LOG(m_logger) <<"DataTopicTestsMain: publish ready"; } void DataTopicTestsMain::subscribeTestCase() { - DEBUG_LOG() << "IN subscribeTestCase"; + DEBUG_LOG(m_logger) << "IN subscribeTestCase"; QTRY_COMPARE(m_participantDataArrivedSpy->count(), 1); @@ -95,7 +95,7 @@ void DataTopicTestsMain::deleteDataReaderTestCase() void DataTopicTestsMain::cleanupTestCase() { - DEBUG_LOG() <<"DataTopicTestsMain: cleanupTestCase"; + DEBUG_LOG(m_logger) <<"DataTopicTestsMain: cleanupTestCase"; delete m_dtTest; m_dtTest = nullptr; delete m_participantDataArrivedSpy; m_participantDataArrivedSpy = nullptr; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.h index 242958b1e..0a2d2dd16 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/data_topic_tests_main.h @@ -30,6 +30,7 @@ private Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: DdsUnitTests::TestParticipant m_sentParticipantData; QSignalSpy *m_participantDataArrivedSpy = nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.cpp index 2f0520be8..4ccce30e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.cpp @@ -27,10 +27,9 @@ int main(int argc, char *argv[]) } -FunctionTopicTests::FunctionTopicTests() - : m_mainThreadId(QThread::currentThreadId()) - .getNGLLogger("UnitTests.FunctionTopicTests")) -{ +FunctionTopicTests::FunctionTopicTests() : m_mainThreadId(QThread::currentThreadId()) + .getNGLLogger("UnitTests.FunctionTopicTests")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { qRegisterMetaType("DdsUnitTests::FunctionReply"); qRegisterMetaType("DdsUnitTests::FunctionReplyWithState"); } @@ -38,7 +37,7 @@ FunctionTopicTests::FunctionTopicTests() void FunctionTopicTests::initTestCase() { - DEBUG_LOG() <<"FunctionTopicTests: initTestCase"; + DEBUG_LOG(m_logger) <<"FunctionTopicTests: initTestCase"; const int domainId = 0; @@ -97,7 +96,7 @@ void FunctionTopicTests::requestWithState() QSignalSpy spyRequest(this, &FunctionTopicTests::functionTopicRequestFinished); QSignalSpy spyReply(this, &FunctionTopicTests::functionTopicReply); - DEBUG_LOG() <<"FunctionTopicTests: request"; + DEBUG_LOG(m_logger) <<"FunctionTopicTests: request"; DdsUnitTests::FunctionRequestWithState data; @@ -125,7 +124,7 @@ void FunctionTopicTests::requestTestCase2() QSignalSpy spyRequest(this, &FunctionTopicTests::functionTopicRequestFinished); QSignalSpy spyReply(this, &FunctionTopicTests::functionTopicReply); - DEBUG_LOG() <<"FunctionTopicTests: request"; + DEBUG_LOG(m_logger) <<"FunctionTopicTests: request"; DdsUnitTests::FunctionRequest data; @@ -149,7 +148,7 @@ void FunctionTopicTests::requestTestCase2() void FunctionTopicTests::cleanupTestCase() { - DEBUG_LOG() <<"FunctionTopicTests: cleanupTestCase"; + DEBUG_LOG(m_logger) <<"FunctionTopicTests: cleanupTestCase"; m_fts = nullptr; m_ftc = nullptr; @@ -165,7 +164,7 @@ void FunctionTopicTests::onFunctionTopicRequest(const rti::core::SampleIdentity { QCOMPARE(m_mainThreadId, QThread::currentThreadId()); - INFO_LOG() << "Got function topic request (with status member)"; + INFO_LOG(m_logger) << "Got function topic request (with status member)"; m_requestTopicWithState = request; QCOMPARE(m_requestTopicWithState.id(), 1); QCOMPARE(m_requestTopicWithState.info().get(), std::string("Test request")); @@ -173,7 +172,7 @@ void FunctionTopicTests::onFunctionTopicRequest(const rti::core::SampleIdentity DdsUnitTests::FunctionReplyWithState reply; - DEBUG_LOG() << "Send sample with status REPLY_COMPLETED"; + DEBUG_LOG(m_logger) << "Send sample with status REPLY_COMPLETED"; reply.id(1); reply.errorString("Hello"); reply.replyState(Core::FtReplyState::Completed); @@ -191,7 +190,7 @@ void FunctionTopicTests::onFunctionTopicRequest(const rti::core::SampleIdentity { QCOMPARE(m_mainThreadId, QThread::currentThreadId()); - INFO_LOG() << "Got function topic request (without status member)"; + INFO_LOG(m_logger) << "Got function topic request (without status member)"; m_requestTopic = request; @@ -214,7 +213,7 @@ void FunctionTopicTests::slotRequestedData(const DdsUnitTests::FunctionTopicTest Q_UNUSED(seqNo); QCOMPARE(m_mainThreadId, QThread::currentThreadId()); - INFO_LOG() << "Got reply from FTS: " << reply.replyState(); + INFO_LOG(m_logger) << "Got reply from FTS: " << reply.replyState(); m_replyTopicWithState = reply; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.h index 41014a3bd..214c9fe25 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/function_topic_tests.h @@ -48,9 +48,11 @@ protected Q_SLOTS: const DdsUnitTests::FunctionRequestWithState &request); private: + NGL::INGLLogger &m_logger; void requestWithState(); private: + NGL::INGLLogger &m_logger; std::unique_ptr m_fts; std::unique_ptr m_ftsWS; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.cpp index 45ba551bf..c471f69b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.cpp @@ -38,7 +38,7 @@ GenericDataTests::GenericDataTests() void GenericDataTests::initTestCase() { - DEBUG_LOG() <<"GenericDataTests: initTestCase"; + DEBUG_LOG(m_logger) <<"GenericDataTests: initTestCase"; m_init = new Initialisation(); @@ -81,7 +81,7 @@ void GenericDataTests::initDWTestCase() void GenericDataTests::dataWriterTestCase() { - DEBUG_LOG() <<"GenericDataTests: dataWriter"; + DEBUG_LOG(m_logger) <<"GenericDataTests: dataWriter"; DdsUnitTests::SpatialData data; @@ -125,7 +125,7 @@ void GenericDataTests::dataWriterTestCase() void GenericDataTests::dataReaderTestCase() { - DEBUG_LOG() << "GenericDataTests: dataReader"; + DEBUG_LOG(m_logger) << "GenericDataTests: dataReader"; QTRY_COMPARE(m_spatialData.equipNo(), 999); @@ -136,7 +136,7 @@ void GenericDataTests::dataReaderTestCase() bool bSeenUnreadSamples = false; dds::sub::LoanedSamples vecTp = m_dataReader->readAlive(bSeenUnreadSamples); - INFO_LOG() <<"vecTp size: " << vecTp.length(); + INFO_LOG(m_logger) <<"vecTp size: " << vecTp.length(); QCOMPARE(vecTp.length(), static_cast(5)); QCOMPARE(vecTp[0].data().id(), 10000); QCOMPARE(vecTp[1].data().id(), 11000); @@ -145,7 +145,7 @@ void GenericDataTests::dataReaderTestCase() QCOMPARE(vecTp[4].data().id(), 11111); dds::sub::LoanedSamples vecTpLoaned = m_dataReader->takeAlive(bSeenUnreadSamples); - INFO_LOG() <<"vecTpLoaned size: " << vecTp.length(); + INFO_LOG(m_logger) <<"vecTpLoaned size: " << vecTp.length(); QCOMPARE(vecTpLoaned.length(), static_cast(5)); QCOMPARE(vecTpLoaned[0].data().id(), 10000); QCOMPARE(vecTpLoaned[1].data().id(), 11000); @@ -177,7 +177,7 @@ void GenericDataTests::deleteDataReaderTestCase() void GenericDataTests::cleanupTestCase() { - DEBUG_LOG() <<"GenericDataTests: cleanupTestCase"; + DEBUG_LOG(m_logger) <<"GenericDataTests: cleanupTestCase"; if (m_dataReader) { m_init->getSubscriberListener()->removeCallback(m_dataReader->getDataReader(), this); @@ -198,21 +198,21 @@ void GenericDataTests::cleanupTestCase() void GenericDataTests::processData(const DdsUnitTests::SpatialData &data, DataModification modType) { - DEBUG_LOG() << "SpatialData: equipNo = " << data.equipNo() << " modType: " << modType; + DEBUG_LOG(m_logger) << "SpatialData: equipNo = " << data.equipNo() << " modType: " << modType; m_spatialData = data; } void GenericDataTests::processData(const DdsUnitTests::TestParticipant &data, const dds::sub::SampleInfo &si) { Q_UNUSED(si); - DEBUG_LOG() << "TestParticipant: equipNo = " << data.location().equipNo(); + DEBUG_LOG(m_logger) << "TestParticipant: equipNo = " << data.location().equipNo(); m_testPart = data; } void GenericDataTests::droDataAvailable(const std::string &topicType, const std::string &topicName) { Q_UNUSED(topicName) - DEBUG_LOG() << "IN droDataAvailable: type = " << topicType; + DEBUG_LOG(m_logger) << "IN droDataAvailable: type = " << topicType; if (topicType == "DdsUnitTests::TestParticipant") { m_init->getSubscriberListener()->enableCallback(m_dataReader->getDataReader(), this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.h index 1f45f88e3..f774e9312 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/generic_data_tests.h @@ -34,6 +34,7 @@ private Q_SLOTS: void cleanupTestCase(); protected: + NGL::INGLLogger &m_logger; void droDataAvailable(const std::string &topicType, const std::string &topicName) override; void noWriterAnymore(const std::string &topicType, const std::string &topicName) override { diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.cpp index 7f341cdfd..547b5c79c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.cpp @@ -8,18 +8,17 @@ #include -Initialisation::Initialisation() - : m_domainParticipant(nullptr) +Initialisation::Initialisation() : m_domainParticipant(nullptr) , m_domainParticipantSub(nullptr) , m_domainId(0) , m_exerciseId(-1) , m_ddsPublisher(nullptr) , m_ddsSubscriber(nullptr) , m_subListener(new DDSGeneric::SubscriberListener) - .getNGLLogger("UnitTests.Initialisation")) -{ + .getNGLLogger("UnitTests.Initialisation")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!DDS::QosProfile::setDefault()) - ERROR_LOG() << "Error setting default QoS from xml-file "; + ERROR_LOG(m_logger) << "Error setting default QoS from xml-file "; } @@ -52,7 +51,7 @@ bool Initialisation::initDDS(int domainId, int exerciseId, PubSub pubsub) { dds::pub::qos::PublisherQos publisherQos = m_domainParticipant.default_publisher_qos(); - DEBUG_LOG() << "Publish on partition " << IDL::exercisePartition(exerciseId); + DEBUG_LOG(m_logger) << "Publish on partition " << IDL::exercisePartition(exerciseId); dds::core::policy::Partition partitionQos; @@ -74,7 +73,7 @@ bool Initialisation::initDDS(int domainId, int exerciseId, PubSub pubsub) dds::sub::qos::SubscriberQos subscriberQos = domainPart.default_subscriber_qos(); - DEBUG_LOG() << "Subsribing on partition " << IDL::exercisePartition(exerciseId); + DEBUG_LOG(m_logger) << "Subsribing on partition " << IDL::exercisePartition(exerciseId); dds::core::policy::Partition partitionQos; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.h index 44165ef7f..11c4d4220 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DdsUnitTests/initialisation.h @@ -33,6 +33,7 @@ public: DDSGeneric::SubscriberListener *getSubscriberListener() { return m_subListener; } private: + NGL::INGLLogger &m_logger; dds::domain::DomainParticipant m_domainParticipant; dds::domain::DomainParticipant m_domainParticipantSub; int m_domainId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTC/generic_ftc_impl.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTC/generic_ftc_impl.h index b72f46f7a..bdaf164e1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTC/generic_ftc_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTC/generic_ftc_impl.h @@ -100,7 +100,7 @@ public: DDS::QosProfile::print(m_requesterParams.datareader_qos(), m_logger); DDS::QosProfile::print(m_requesterParams.datawriter_qos(), m_logger); - DEBUG_LOG() << "=> Static request using request/reply topic names: " + DEBUG_LOG(m_logger) << "=> Static request using request/reply topic names: " << TopicNameHelper::requestTopicName() << ", reply: " << TopicNameHelper::replyTopicName(); @@ -395,13 +395,13 @@ private: bool inProgress = true; while (inProgress && isRun()) { - DEBUG_LOG() << "Waiting for reply "; + DEBUG_LOG(m_logger) << "Waiting for reply "; connext::Sample reply; if (!requester.receive_reply(reply, MAX_WAIT)) { - WARNING_LOG() << "Timed out waiting for reply"; + WARNING_LOG(m_logger) << "Timed out waiting for reply"; sendError(request, 3); return; } @@ -412,14 +412,14 @@ private: if (request.sample.info().identity() != reply.info()->related_original_publication_virtual_sample_identity()) { - INFO_LOG() << "#receiveReply - outdated. sample id: " << connext::DebugInfo::toReadable(request.sample.info().identity()) + INFO_LOG(m_logger) << "#receiveReply - outdated. sample id: " << connext::DebugInfo::toReadable(request.sample.info().identity()) << ", virutal sample id: " << connext::DebugInfo::toReadable(reply.info()->related_original_publication_virtual_sample_identity()); continue; } inProgress = isInProgress(reply); if (request.replySlot.isValid()) { - INFO_LOG() << "#receiveReply for " << TopicNameHelper::replyTopicTypeName(); + INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName(); request.replySlot.invoke(m_objToInform, Qt::QueuedConnection, QArgument(TopicNameHelper::replyTopicTypeName(), reply.data()), @@ -428,13 +428,13 @@ private: } else { - WARNING_LOG() << "reply slot doesn't exist for " << dds::topic::topic_type_name::value(); + WARNING_LOG(m_logger) << "reply slot doesn't exist for " << dds::topic::topic_type_name::value(); } if (!inProgress) return; } else - WARNING_LOG() << "No valid data available "; + WARNING_LOG(m_logger) << "No valid data available "; @@ -457,7 +457,7 @@ private: if (!requester.receive_reply(reply, MAX_WAIT)) { - WARNING_LOG() << "Timeout while waiting for reply!"; + WARNING_LOG(m_logger) << "Timeout while waiting for reply!"; throw std::runtime_error("Timeout while waiting for reply!"); } @@ -465,7 +465,7 @@ private: if (!reply.info().valid()) { - WARNING_LOG() << "No valid data available!"; + WARNING_LOG(m_logger) << "No valid data available!"; throw std::runtime_error("No valid data available!"); } @@ -473,7 +473,7 @@ private: if (request.sample.info().identity() != reply.info()->related_original_publication_virtual_sample_identity()) { - INFO_LOG() << "#receiveReply - outdated. sample id: " << connext::DebugInfo::toReadable(request.sample.info().identity()) + INFO_LOG(m_logger) << "#receiveReply - outdated. sample id: " << connext::DebugInfo::toReadable(request.sample.info().identity()) << ", virutal sample id: " << connext::DebugInfo::toReadable(reply.info()->related_original_publication_virtual_sample_identity()); continue; } @@ -481,10 +481,10 @@ private: Q_ASSERT(!isInProgress(reply)); if (isInProgress(reply)) { - ERROR_LOG() << "Used ModernRequest for a request with FtReplyState! Your data will most likely be imcomplete!"; + ERROR_LOG(m_logger) << "Used ModernRequest for a request with FtReplyState! Your data will most likely be imcomplete!"; } - INFO_LOG() << "#receiveReply for " << TopicNameHelper::replyTopicTypeName(); + INFO_LOG(m_logger) << "#receiveReply for " << TopicNameHelper::replyTopicTypeName(); request.promise.set_value(reply.data()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/connext.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/connext.h index a5a0115b7..f2eec26a4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/connext.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/connext.h @@ -312,7 +312,7 @@ public: m_contentFilteredTopic->filter(dds::topic::Filter(filterContent.data())); } - DEBUG_LOG() << "content filter for topic " + DEBUG_LOG(m_logger) << "content filter for topic " << ReplyRequestBase::m_requestTopic.name() << " - related_sample_identity should be: " << writerGuid; @@ -349,7 +349,7 @@ public: m_dataWriter->write(request.data(), request.info()); const rti::core::SampleIdentity currentSampleIdentity = request.info().identity(); - DEBUG_LOG() << "send_request for topic " + DEBUG_LOG(m_logger) << "send_request for topic " << ReplyRequestBase::m_requestTopic.name() << ", m_currentSampleIdentity: " << DebugInfo::toReadable(currentSampleIdentity); @@ -369,12 +369,12 @@ public: if (m_dataReader->take(reply.data(), reply.info()) && reply.info().valid()) { - DEBUG_LOG() << "receive_reply for topic " + DEBUG_LOG(m_logger) << "receive_reply for topic " << ReplyRequestBase::m_requestTopic.name() << ", SampleIdentity - original publication virtual: " << DebugInfo::toReadable(reply.info()->original_publication_virtual_sample_identity()); - DEBUG_LOG() << "receive_reply for topic " + DEBUG_LOG(m_logger) << "receive_reply for topic " << ReplyRequestBase::m_requestTopic.name() << ", SampleIdentity - related original: " << DebugInfo::toReadable(reply.info()->related_original_publication_virtual_sample_identity()); @@ -387,7 +387,7 @@ public: dds::core::cond::WaitSet::ConditionSeq activeConditionsSeq = waitset.wait(duration); if (activeConditionsSeq.empty()) { - ERROR_LOG() << "Bailing out!"; + ERROR_LOG(m_logger) << "Bailing out!"; break; } } @@ -398,7 +398,7 @@ public: if (!m_curInstanceHandle.is_nil()) { - DEBUG_LOG() << "Keyed topic - disposing instance: " + DEBUG_LOG(m_logger) << "Keyed topic - disposing instance: " << ReplyRequestBase::m_requestTopic.name(); m_dataWriter.dispose_instance(m_curInstanceHandle); } @@ -448,7 +448,7 @@ public: const rti::core::SampleIdentity &identity, bool bLastSample = true) { - DEBUG_LOG() << "send_reply for topic " + DEBUG_LOG(m_logger) << "send_reply for topic " << ReplyRequestBase::m_requestTopic.name() << ", sampleIdentity: " << DebugInfo::toReadable(identity); @@ -459,7 +459,7 @@ public: sf |= rti::core::SampleFlag::intermediate_reply_sequence(); reply.info().flag(sf); reply.info().related_sample_identity(identity); - DEBUG_LOG() << "send_reply for topic " + DEBUG_LOG(m_logger) << "send_reply for topic " << ReplyRequestBase::m_requestTopic.name() << ", related sampleIdentity: " << DebugInfo::toReadable(reply.info().related_sample_identity()); @@ -473,7 +473,7 @@ public: if (request.info().valid()) { - DEBUG_LOG() << "receive_request for topic " + DEBUG_LOG(m_logger) << "receive_request for topic " << ReplyRequestBase::m_requestTopic.name() << ", sampleIdentity publication_virtual_sample_identity: " << DebugInfo::toReadable(request.info()->publication_virtual_sample_identity()) diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/generic_fts_impl.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/generic_fts_impl.h index a34b52ac1..655d263ef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/generic_fts_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/FTS/generic_fts_impl.h @@ -131,7 +131,7 @@ public: { if (m_subscriberCallback) { - WARNING_LOG() << "Can not set subscriber callback - already set ..."; + WARNING_LOG(m_logger) << "Can not set subscriber callback - already set ..."; return false; } @@ -157,7 +157,7 @@ public: bool sendReply(const rti::core::SampleIdentity &requestIdentity, const QVector &replyData) override final { - DEBUG_LOG() << TopicNameHelper::requestTopicName() << " - IN sendReply"; + DEBUG_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - IN sendReply"; for(int i = 0; i < replyData.size(); ++i) { @@ -184,7 +184,7 @@ protected: void processRequest(const connext::Sample &request) { - DEBUG_LOG() << TopicNameHelper::requestTopicName() << " - processRequest: " + DEBUG_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - processRequest: " << connext::DebugInfo::toReadable(request.identity()); qint64 age = qAbs(qint64(request.info().source_timestamp().to_secs()) - time(nullptr)); @@ -203,7 +203,7 @@ protected: s.append("..."); } - DEBUG_LOG() << "received a request for topic " + DEBUG_LOG(m_logger) << "received a request for topic " << TopicNameHelper::requestTopicName() << " but it was outdated - ignoring. " << " local time: " << (time(nullptr) - 10) << "[s], source timestamp: " @@ -226,7 +226,7 @@ protected: void processRequests() override { - DEBUG_LOG() << TopicNameHelper::requestTopicName() << " - processRequests"; + DEBUG_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - processRequests"; while (true) { @@ -235,21 +235,21 @@ protected: std::lock_guard l(m_requestMutex); if (m_requests.empty()) { - DEBUG_LOG() << "No more requests"; + DEBUG_LOG(m_logger) << "No more requests"; return; } - DEBUG_LOG() << TopicNameHelper::requestTopicName() << " - read one request for "; + DEBUG_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - read one request for "; request = m_requests.front(); m_requests.pop(); } if (!request.info().valid()) { - WARNING_LOG() << TopicNameHelper::requestTopicName() << " - No valid data"; + WARNING_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - No valid data"; continue; } processRequest(request); } - DEBUG_LOG() << TopicNameHelper::requestTopicName() << " - processRequests finished"; + DEBUG_LOG(m_logger) << TopicNameHelper::requestTopicName() << " - processRequests finished"; } bool enqueueRequests() override diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/dynamic_data_reader.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/dynamic_data_reader.h index e3fb1d03b..b4a08228d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/dynamic_data_reader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/dynamic_data_reader.h @@ -53,19 +53,19 @@ public: const std::string &specialTopicName, const StructType &structType) { - DEBUG_LOG() << "IN DynamicDataReader::create (" + DEBUG_LOG(m_logger) << "IN DynamicDataReader::create (" << m_structType->name() << ")"; if (domainParticipant == nullptr) { - ERROR_LOG() << "DomainParticipant does not exist "; + ERROR_LOG(m_logger) << "DomainParticipant does not exist "; return false; } if (m_ddsTopic != nullptr) { - ERROR_LOG() << "Type '" + ERROR_LOG(m_logger) << "Type '" << m_structType->name() << "' already created"; return false; @@ -84,7 +84,7 @@ public: DDS::Helper::getShortTopicName(m_structType->name()) : specialTopicName; - DEBUG_LOG() << "Creating topic " << topicName << " with type: " + DEBUG_LOG(m_logger) << "Creating topic " << topicName << " with type: " << m_structType->name(); m_ddsTopic = dds::topic::find>(domainParticipant, topicName); @@ -97,16 +97,16 @@ public: m_ddsTopic = dds::topic::Topic(domainParticipant, topicName, structType); } - DEBUG_LOG() << "m_ddsTopic created: " << m_ddsTopic.name(); + DEBUG_LOG(m_logger) << "m_ddsTopic created: " << m_ddsTopic.name(); if (m_logger.isDebugEnabled()) { dds::sub::qos::SubscriberQos subscriberQoS = ddsSubscriber.qos(); dds::core::policy::Partition partition = subscriberQoS.policy(); dds::core::StringSeq parititionNames = partition.name(); - DEBUG_LOG() << "Subscribing partitions: " << parititionNames.size(); + DEBUG_LOG(m_logger) << "Subscribing partitions: " << parititionNames.size(); for (const std::string &name : parititionNames) - DEBUG_LOG() << "SubscriberQoS: partition name = " << name; + DEBUG_LOG(m_logger) << "SubscriberQoS: partition name = " << name; } dds::sub::qos::DataReaderQos dataReaderQos = ddsSubscriber.default_datareader_qos(); @@ -129,7 +129,7 @@ public: if (m_dataReader == nullptr) { - ERROR_LOG() << "Creating dataReader for '" << topicName << "' with type: '" + ERROR_LOG(m_logger) << "Creating dataReader for '" << topicName << "' with type: '" << m_structType->name() << "' failed"; return false; @@ -138,11 +138,11 @@ public: } catch (const dds::core::Exception &ex) { - ERROR_LOG() << ex.what(); + ERROR_LOG(m_logger) << ex.what(); return false; } - DEBUG_LOG() << "dataReader created (" + DEBUG_LOG(m_logger) << "dataReader created (" << m_structType->name() << ")"; @@ -153,7 +153,7 @@ public: bool hasSamples() const { qint64 sampleSize = m_dataReader->datareader_cache_status().sample_count(); - DEBUG_LOG() << "sampleSize = " << sampleSize; + DEBUG_LOG(m_logger) << "sampleSize = " << sampleSize; return sampleSize > 0; } @@ -162,7 +162,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::alive()).read(); - TRACE_LOG() << "readAlive for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "readAlive for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); @@ -175,7 +175,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::alive()).take(); - TRACE_LOG() << "takeAlive for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "takeAlive for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); @@ -187,7 +187,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::not_alive_disposed()).take(); - TRACE_LOG() << "takeDisposed for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "takeDisposed for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); return samples; @@ -196,18 +196,18 @@ public: template bool read(C callbackFunc) { - DEBUG_LOG() << "IN read (" + DEBUG_LOG(m_logger) << "IN read (" << DDS::topic_type_name::value() << "), this: " << this << ", instance handle " << m_dataReader.instance_handle(); if (m_dataReader == nullptr || m_ddsTopic == nullptr) { - ERROR_LOG() << "No dataReader initialised "; + ERROR_LOG(m_logger) << "No dataReader initialised "; return false; } if (!isValid(callbackFunc)) { - ERROR_LOG() << "No subscriber set for " + ERROR_LOG(m_logger) << "No subscriber set for " << DDS::topic_type_name::value(); return false; } @@ -216,7 +216,7 @@ public: dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::DataState::new_data()).read(); - DEBUG_LOG() << "got " << samples.length() + m_newSamplesDuringRead.size() << " samples from reader for " + DEBUG_LOG(m_logger) << "got " << samples.length() + m_newSamplesDuringRead.size() << " samples from reader for " << DDS::topic_type_name::value(); for (const auto &sample : samples) @@ -297,7 +297,7 @@ private: if (samples.length() == 0) return false; - DEBUG_LOG() << "got " << samples.length() << " disposed instances from reader for " + DEBUG_LOG(m_logger) << "got " << samples.length() << " disposed instances from reader for " << m_ddsTopic.name(); for (const auto &sample : samples) diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_reader.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_reader.h index ba11436ea..36c643799 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_reader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_reader.h @@ -47,19 +47,19 @@ public: const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name::value()), bool bCreateDataReader = true) { - DEBUG_LOG() << "IN GenericDataReader::create (" + DEBUG_LOG(m_logger) << "IN GenericDataReader::create (" << DDS::topic_type_name::value() << "), this: " << this; if (domainParticipant == nullptr) { - ERROR_LOG() << "DomainParticipant does not exist "; + ERROR_LOG(m_logger) << "DomainParticipant does not exist "; return false; } if (m_ddsTopic != nullptr) { - ERROR_LOG() << "Type '" + ERROR_LOG(m_logger) << "Type '" << DDS::topic_type_name::value() << "' already created"; return false; @@ -67,7 +67,7 @@ public: try { - DEBUG_LOG() << "Creating read topic " << topicName << " with type: " + DEBUG_LOG(m_logger) << "Creating read topic " << topicName << " with type: " << DDS::topic_type_name::value(); m_ddsTopic = dds::topic::find(domainParticipant, topicName); @@ -79,9 +79,9 @@ public: dds::sub::qos::SubscriberQos subscriberQoS = ddsSubscriber.qos(); dds::core::policy::Partition partition = subscriberQoS.policy(); dds::core::StringSeq parititionNames = partition.name(); - DEBUG_LOG() << "Subscribing partitions: " << parititionNames.size(); + DEBUG_LOG(m_logger) << "Subscribing partitions: " << parititionNames.size(); for (const std::string &name : parititionNames) - DEBUG_LOG() << " partition name = " << name; + DEBUG_LOG(m_logger) << " partition name = " << name; } if (bCreateDataReader) @@ -90,7 +90,7 @@ public: m_dataReader = DataReader(ddsSubscriber, m_ddsTopic, drQos); if (m_dataReader == nullptr) { - ERROR_LOG() << "Creating dataReader for '" << topicName << "' with type: '" + ERROR_LOG(m_logger) << "Creating dataReader for '" << topicName << "' with type: '" << DDS::topic_type_name::value() << "' failed"; return false; @@ -99,11 +99,11 @@ public: } catch (const dds::core::Exception &ex) { - ERROR_LOG() << ex.what(); + ERROR_LOG(m_logger) << ex.what(); return false; } - DEBUG_LOG() << "dataReader created (" + DEBUG_LOG(m_logger) << "dataReader created (" << DDS::topic_type_name::value() << ")"; @@ -114,7 +114,7 @@ public: bool hasSamples() const { qint64 sampleSize = m_dataReader->datareader_cache_status().sample_count(); - DEBUG_LOG() << "sampleSize = " << sampleSize; + DEBUG_LOG(m_logger) << "sampleSize = " << sampleSize; return sampleSize > 0; } @@ -124,7 +124,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::alive()).read(); - TRACE_LOG() << "readAlive for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "readAlive for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); @@ -138,7 +138,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::alive()).take(); - TRACE_LOG() << "takeAlive for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "takeAlive for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); @@ -150,7 +150,7 @@ public: { dds::sub::LoanedSamples samples = m_dataReader.select().state(dds::sub::status::InstanceState::not_alive_disposed()).take(); - TRACE_LOG() << "takeDisposed for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "takeDisposed for " << DDS::topic_type_name::value() << ", count: " << samples.length() << ", this: " << this << ", instance handle " << m_dataReader.instance_handle(); return samples; @@ -159,18 +159,18 @@ public: template bool read(C callbackFunc) { - DEBUG_LOG() << "IN read (" + DEBUG_LOG(m_logger) << "IN read (" << DDS::topic_type_name::value() << "), this: " << this << ", instance handle " << m_dataReader.instance_handle(); if (m_dataReader == nullptr) { - ERROR_LOG() << "No dataReader initialised "; + ERROR_LOG(m_logger) << "No dataReader initialised "; return false; } if (!isValid(callbackFunc)) { - ERROR_LOG() << "No subscriber set for " + ERROR_LOG(m_logger) << "No subscriber set for " << DDS::topic_type_name::value(); return false; } @@ -189,7 +189,7 @@ public: } } - DEBUG_LOG() << "got " << samples.size() + m_newSamplesDuringRead.size() << " samples from reader for " + DEBUG_LOG(m_logger) << "got " << samples.size() + m_newSamplesDuringRead.size() << " samples from reader for " << DDS::topic_type_name::value(); for (const SampleStruct &ss : samples) @@ -265,7 +265,7 @@ private: if (samples.length() == 0) return false; - DEBUG_LOG() << "got " << samples.length() << " disposed instances from reader for " + DEBUG_LOG(m_logger) << "got " << samples.length() << " disposed instances from reader for " << DDS::topic_type_name::value(); for (const auto &sample : samples) diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_writer.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_writer.h index 178aae114..73c48692f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_writer.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/generic_data_writer.h @@ -32,19 +32,19 @@ public: const dds::pub::Publisher &ddsPublisher, const std::string &topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name::value())) { - DEBUG_LOG() << "IN GenericDataWriter::create (" + DEBUG_LOG(m_logger) << "IN GenericDataWriter::create (" << DDS::topic_type_name::value() << ")"; if (participant == nullptr) { - ERROR_LOG() << "Participant not available, aborting. "; + ERROR_LOG(m_logger) << "Participant not available, aborting. "; return false; } if (m_ddsTopic != nullptr) { - ERROR_LOG() << "Type '" + ERROR_LOG(m_logger) << "Type '" << DDS::topic_type_name::value() << "' already created"; return false; @@ -52,7 +52,7 @@ public: try { - DEBUG_LOG() << "Creating write topic " << topicName << " with type: " + DEBUG_LOG(m_logger) << "Creating write topic " << topicName << " with type: " << DDS::topic_type_name::value(); m_ddsTopic = dds::topic::find(participant, topicName); @@ -65,7 +65,7 @@ public: if (m_dataWriter == nullptr) { - ERROR_LOG() << "Initialisation of " + ERROR_LOG(m_logger) << "Initialisation of " << DDS::topic_type_name::value() << " failed "; return false; @@ -74,11 +74,11 @@ public: } catch ( const dds::core::Exception &ex ) { - ERROR_LOG() << ex.what(); + ERROR_LOG(m_logger) << ex.what(); return false; } - DEBUG_LOG() << "dataWriter created (" + DEBUG_LOG(m_logger) << "dataWriter created (" << DDS::topic_type_name::value() << ")"; @@ -88,12 +88,12 @@ public: bool write(const TopicType &data, const dds::core::optional &si = dds::core::optional()) { - DEBUG_LOG() << "IN write (" + DEBUG_LOG(m_logger) << "IN write (" << DDS::topic_type_name::value() << ") "; if (m_dataWriter == nullptr) { - ERROR_LOG() << "No dataWriter initialised "; + ERROR_LOG(m_logger) << "No dataWriter initialised "; return false; } @@ -112,18 +112,18 @@ public: bool remove(const TopicType &data, bool errorMsgIfNotExists = true) { - DEBUG_LOG() << "IN remove (" + DEBUG_LOG(m_logger) << "IN remove (" << DDS::topic_type_name::value() << ") "; if (m_dataWriter == nullptr) { - ERROR_LOG() << "No dataWriter initialised "; + ERROR_LOG(m_logger) << "No dataWriter initialised "; return false; } const dds::core::InstanceHandle ih = m_dataWriter.lookup_instance(data); if (ih.is_nil()) { if (errorMsgIfNotExists) - ERROR_LOG() << "Could not find instance for topic " + ERROR_LOG(m_logger) << "Could not find instance for topic " << DDS::topic_type_name::value() << " for unregistering!"; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.cpp index c641c0291..6cc2140b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.cpp @@ -13,7 +13,7 @@ SubscriberListener::SubscriberListener() , m_logger(DDS::getLogger("SubscriberListener", DDS::DataType::DATA_TOPIC_CLIENT)) { qRegisterMetaType("std::string"); - DEBUG_LOG() << "SubscriberListener initialized, this " << this; + DEBUG_LOG(m_logger) << "SubscriberListener initialized, this " << this; } void SubscriberListener::addCallback(const std::string &topicName, @@ -21,7 +21,7 @@ void SubscriberListener::addCallback(const std::string &topicName, const dds::sub::AnyDataReader &dataReader, SubscriberListenerCallback *cb) { - DEBUG_LOG() << "addSubscriberCallback for " << topicName << ", type " << topicTypeName + DEBUG_LOG(m_logger) << "addSubscriberCallback for " << topicName << ", type " << topicTypeName << ", cb " << cb << ", this " << this; QWriteLocker l(&m_accessLock); if (m_bPrepareForShutdown) @@ -34,7 +34,7 @@ void SubscriberListener::removeCallback(const std::string &topicName, const dds::sub::AnyDataReader &dataReader, SubscriberListenerCallback *cb) { - DEBUG_LOG() << "IN removeSubscriberCallback for " << topicName << ", type " << topicTypeName + DEBUG_LOG(m_logger) << "IN removeSubscriberCallback for " << topicName << ", type " << topicTypeName << ", cb " << cb << ", this " << this; QWriteLocker l(&m_accessLock); m_droCallbacks.remove(std::make_pair(topicName, topicTypeName), fillData(dataReader, cb)); @@ -68,7 +68,7 @@ void SubscriberListener::enaDisaCallback(const std::string &topicName, } if (!bFound) - WARNING_LOG() << "Can not " << (bEnable ? "enable" : "disable") + WARNING_LOG(m_logger) << "Can not " << (bEnable ? "enable" : "disable") << " callback for " << topicName << ", type " << topicTypeName << ", cb " << cb << ", this " << this << " - not found!"; } @@ -91,7 +91,7 @@ void SubscriberListener::on_data_available(dds::sub::AnyDataReader &reader) QReadLocker l(&m_accessLock); if (m_droCallbacks.isEmpty() || m_bPrepareForShutdown) return; - DEBUG_LOG() << "Data available for " << topicName << ", type " << topicTypeName << ", this " << this; + DEBUG_LOG(m_logger) << "Data available for " << topicName << ", type " << topicTypeName << ", this " << this; QMultiMap, cbData>::iterator cbIt = m_droCallbacks.find(key); const QMultiMap, cbData>::iterator cbEnd = m_droCallbacks.end(); for( ; cbIt != cbEnd && cbIt.key() == key; ++cbIt) @@ -122,7 +122,7 @@ void SubscriberListener::on_liveliness_changed(dds::sub::AnyDataReader &reader, const std::string &topicName = reader.topic_name(); const std::string &topicTypeName = reader.type_name(); - DEBUG_LOG() << "on_liveliness_changed: " << livelinessStatus.alive_count() + DEBUG_LOG(m_logger) << "on_liveliness_changed: " << livelinessStatus.alive_count() << ", " << livelinessStatus.not_alive_count() << ", " << livelinessStatus.alive_count_change() << ", " << livelinessStatus.not_alive_count_change() @@ -154,7 +154,7 @@ void SubscriberListener::on_liveliness_changed(dds::sub::AnyDataReader &reader, if (bNoWritersAnymore) { - DEBUG_LOG() << "bNoWritersAnymore for " << topicName << ", type " << topicTypeName; + DEBUG_LOG(m_logger) << "bNoWritersAnymore for " << topicName << ", type " << topicTypeName; data.cb->noWriterAnymore(topicTypeName, topicName); } else if (bNewWriters) @@ -164,7 +164,7 @@ void SubscriberListener::on_liveliness_changed(dds::sub::AnyDataReader &reader, continue; if (data.methodToCall.isValid()) { - DEBUG_LOG() << "methodcall is valid for " << topicName << ", type " << topicTypeName; + DEBUG_LOG(m_logger) << "methodcall is valid for " << topicName << ", type " << topicTypeName; data.methodToCall.invoke(data.cb, Qt::QueuedConnection, Q_ARG(std::string, topicTypeName), Q_ARG(std::string, topicName)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.h index d477af773..770a9bba2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/subscriber_listener.h @@ -71,6 +71,7 @@ public: void prepareShutdown(); protected: + NGL::INGLLogger &m_logger; void addCallback(const std::string &topicName, const std::string &topicTypeName, const dds::sub::AnyDataReader &dataReader, diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.cpp index e69159b15..61811ae97 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.cpp @@ -24,7 +24,7 @@ WaitSetHandler::~WaitSetHandler() bool WaitSetHandler::attachWaitSet(const dds::core::cond::Condition &cond, CallbackInterface *cb) { - DEBUG_LOG() << "AttachWaitSet with callback " << cb; + DEBUG_LOG(m_logger) << "AttachWaitSet with callback " << cb; WaitSetData wsd(cond, cb); @@ -33,7 +33,7 @@ bool WaitSetHandler::attachWaitSet(const dds::core::cond::Condition &cond, Callb auto it = m_waitSetData.find(wsd.condition->native_condition()); if (it != m_waitSetData.end()) { - WARNING_LOG() << "Waitset " << cb << " already registered"; + WARNING_LOG(m_logger) << "Waitset " << cb << " already registered"; return false; } @@ -47,7 +47,7 @@ bool WaitSetHandler::attachWaitSet(const dds::core::cond::Condition &cond, Callb bool WaitSetHandler::detachWaitSet(const dds::core::cond::Condition &cond, CallbackInterface *cb) { - DEBUG_LOG() << "DetachWaitSet with callback " << cb; + DEBUG_LOG(m_logger) << "DetachWaitSet with callback " << cb; WaitSetData wsd(cond, cb); @@ -56,7 +56,7 @@ bool WaitSetHandler::detachWaitSet(const dds::core::cond::Condition &cond, Callb auto it = m_waitSetData.find(wsd.condition->native_condition()); if (it == m_waitSetData.end()) { - WARNING_LOG() << "Waitset for " << cb << " not registered"; + WARNING_LOG(m_logger) << "Waitset for " << cb << " not registered"; return false; } @@ -67,7 +67,7 @@ bool WaitSetHandler::detachWaitSet(const dds::core::cond::Condition &cond, Callb bool WaitSetHandler::enableWaitSet(const dds::core::cond::Condition &cond, CallbackInterface *cb) { - DEBUG_LOG() << "EnableWaitSet with callback " << cb; + DEBUG_LOG(m_logger) << "EnableWaitSet with callback " << cb; WaitSetData wsd(cond, cb); @@ -75,7 +75,7 @@ bool WaitSetHandler::enableWaitSet(const dds::core::cond::Condition &cond, Callb auto it = m_waitSetData.find(wsd.condition->native_condition()); if (it == m_waitSetData.end()) { - ERROR_LOG() << "Could not find WaitSetData - cannot enable waitSet for " << cb; + ERROR_LOG(m_logger) << "Could not find WaitSetData - cannot enable waitSet for " << cb; return false; } @@ -88,7 +88,7 @@ bool WaitSetHandler::enableWaitSet(const dds::core::cond::Condition &cond, Callb bool WaitSetHandler::disableWaitSet(const dds::core::cond::Condition &cond, CallbackInterface *cb) { - DEBUG_LOG() << "DisableWaitSet with callback " << cb; + DEBUG_LOG(m_logger) << "DisableWaitSet with callback " << cb; WaitSetData wsd(cond, cb); @@ -96,7 +96,7 @@ bool WaitSetHandler::disableWaitSet(const dds::core::cond::Condition &cond, Call auto it = m_waitSetData.find(wsd.condition->native_condition()); if (it == m_waitSetData.end()) { - ERROR_LOG() << "Could not find WaitSetData - cannot disable waitSet for " << cb; + ERROR_LOG(m_logger) << "Could not find WaitSetData - cannot disable waitSet for " << cb; return false; } @@ -133,7 +133,7 @@ void WaitSetHandler::waitSetTask() WaitSetData &wsd = it->second; if (wsd.enabled) { - DEBUG_LOG() << "Condition triggered for " << wsd.callback; + DEBUG_LOG(m_logger) << "Condition triggered for " << wsd.callback; wsd.callback->dataAvailable(); } ++it; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.h index 0a7335e87..57fe05afb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Generic/wait_set_handler.h @@ -39,6 +39,7 @@ public: int attachedConditionCount() const; private: + NGL::INGLLogger &m_logger; struct WaitSetData final { dds::core::cond::Condition condition; @@ -52,9 +53,11 @@ private: {} }; private: + NGL::INGLLogger &m_logger; void waitSetTask(); private: + NGL::INGLLogger &m_logger; dds::core::cond::WaitSet m_waitSet; dds::core::cond::GuardCondition m_abortCondition; std::future m_task; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Routing/routing_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Routing/routing_plugin.h index 9e4d622e6..e4dcc771a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Routing/routing_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Routing/routing_plugin.h @@ -132,7 +132,7 @@ public: void writeSamples() override { - TRACE_LOG() << "Writing samples for " << DDS::topic_type_name::value() + TRACE_LOG(m_logger) << "Writing samples for " << DDS::topic_type_name::value() << ", sample count: " << m_loanedSamples.length(); rti::pub::WriteParams writeParams; for (const auto &sample : m_loanedSamples) @@ -148,7 +148,7 @@ public: - TRACE_LOG() << "identity: " << DebugInfo::toReadable(writeParams.identity()) + TRACE_LOG(m_logger) << "identity: " << DebugInfo::toReadable(writeParams.identity()) << ", related_sample_identity: " << DebugInfo::toReadable(writeParams.related_sample_identity()); const auto &state = sample.info().state(); @@ -159,20 +159,20 @@ public: } else if (instanceState == dds::sub::status::InstanceState::not_alive_disposed()) { - TRACE_LOG() << " - is disposed"; + TRACE_LOG(m_logger) << " - is disposed"; m_dataWriter->dispose_instance(writeParams); } else if (instanceState == dds::sub::status::InstanceState::not_alive_no_writers()) { - TRACE_LOG() << " - is unregistered"; + TRACE_LOG(m_logger) << " - is unregistered"; m_dataWriter->unregister_instance(writeParams); } else - WARNING_LOG() << "Unknown instance state: " << instanceState; + WARNING_LOG(m_logger) << "Unknown instance state: " << instanceState; } catch (const dds::core::Exception &ex) { - ERROR_LOG() << "writeSamples exception: " << ex.what(); + ERROR_LOG(m_logger) << "writeSamples exception: " << ex.what(); } } m_dataWriter->flush(); @@ -207,7 +207,7 @@ public: { if (!m_dwt) return false; - DEBUG_LOG() << "Creating DataWriter for domain " << dpOut.domain_id(); + DEBUG_LOG(m_logger) << "Creating DataWriter for domain " << dpOut.domain_id(); m_dataWriter = dds::pub::DataWriter(pubOut, getTopic(dpOut, m_topicName), DDS::QosProfile::dataWriterDefault(m_topicType)); @@ -222,7 +222,7 @@ public: { - TRACE_LOG() << "Data available for " << DDS::topic_type_name::value(); + TRACE_LOG(m_logger) << "Data available for " << DDS::topic_type_name::value(); auto ws = new SampleWriter(reader.take(), m_dataWriter, m_topicType == DDS::QosProfile::TopicType::FunctionTopic, m_logger); m_dwt->enqueue(ws); } @@ -275,14 +275,14 @@ protected: const dds::domain::DomainParticipant &dpOut, const dds::pub::Publisher &pubOut) override { - DEBUG_LOG() << "Initializing TopicDispatcher " << "(" << this << ")"; + DEBUG_LOG(m_logger) << "Initializing TopicDispatcher " << "(" << this << ")"; if (m_dataReader != nullptr) return false; m_dataReader = dds::sub::DataReader(subIn, getTopic(dpIn, m_topicName), DDS::QosProfile::dataReaderDefault(m_topicType)); - DEBUG_LOG() << "Creating DataReader for domain " << dpIn.domain_id() << ", ptr: " << m_dataReader.delegate().get(); + DEBUG_LOG(m_logger) << "Creating DataReader for domain " << dpIn.domain_id() << ", ptr: " << m_dataReader.delegate().get(); m_dtl.reset(new DataTopicListener(dwt, m_topicName, m_topicType, m_logger)); @@ -294,10 +294,10 @@ protected: void shutdown() override { - DEBUG_LOG() << "Cleaning up TopicDispatcher " << "(" << this << ")"; + DEBUG_LOG(m_logger) << "Cleaning up TopicDispatcher " << "(" << this << ")"; if (m_dataReader != nullptr) { - DEBUG_LOG() << "shutting down DataReader: " << m_dataReader.delegate().get(); + DEBUG_LOG(m_logger) << "shutting down DataReader: " << m_dataReader.delegate().get(); m_dataReader.listener(nullptr, dds::core::status::StatusMask::none()); try { @@ -305,7 +305,7 @@ protected: } catch (const dds::core::Exception &ex) { - ERROR_LOG() << "topic close ex: " << ex.what(); + ERROR_LOG(m_logger) << "topic close ex: " << ex.what(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.cpp index e801f4176..2b53c760d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.cpp @@ -19,7 +19,7 @@ ForeignInterfaceImpl::ForeignInterfaceImpl(const std::shared_ptr ForeignInterfaceImpl::findImage(const ParticipantMa { if (!m_aesDtc) { - WARNING_LOG() << "Fetching 'm_aesDtc' failed, No color and injury information will be included in symbol created for participant.id() " << participant.id(); + WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be included in symbol created for participant.id() " << participant.id(); return findImage(symDataToRender); } const int partyId = m_aesDtc->partyForDusMine(lastState.originatorId()); @@ -110,7 +110,7 @@ QSharedPointer ForeignInterfaceImpl::findImage(const ParticipantMa { if (!m_aesDtc) { - WARNING_LOG() << "Fetching 'm_aesDtc' failed, No color and injury information will be included in symbol created for participant.id() " << participant.id(); + WARNING_LOG(m_logger) << "Fetching 'm_aesDtc' failed, No color and injury information will be included in symbol created for participant.id() " << participant.id(); return findImage(symDataToRender); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.h index 3ddea6ed9..4e07a85f8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Data/asb_foreign_interface_impl.h @@ -52,6 +52,8 @@ public: AdvancedSymbology::SymbologyType defaultSymbologyType() const override; private: + +NGL::INGLLogger &m_logger; static AdvancedSymbology::Injury stateToInjury(const ProjectDataManagement::VulnerabilityState &state); std::shared_ptr m_ppmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_select_text_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_select_text_dialog.h index c3da76232..1cc6ad0dd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_select_text_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_select_text_dialog.h @@ -20,6 +20,8 @@ public: ~SelectTextDialog(); protected: + +NGL::INGLLogger &m_logger; Ui_SelectTextDialog *ui; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.cpp index 43537d8bc..81f2efd70 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.cpp @@ -152,9 +152,9 @@ SymbolEditor::SymbolEditor(LtsSession::LtsSession *session, QWidget *parent) , m_session(session) .getNGLLogger("SymbolEditor")) { - DEBUG_LOG() << "SymbolEditor(" << "parent=" << parent << ")"; + DEBUG_LOG(m_logger) << "SymbolEditor(" << "parent=" << parent << ")"; m_ui->setupUi(this); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } bool SymbolEditor::init(const std::shared_ptr &flmFtc, @@ -163,7 +163,7 @@ bool SymbolEditor::init(const std::shared_ptr const std::shared_ptr &ppmDtc, bool asApp) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; setOnlineHelpFilename(QStringLiteral("Symbol_Editor-Application")); if (asApp) @@ -214,25 +214,25 @@ bool SymbolEditor::init(const std::shared_ptr if (!m_internal->m_symbolFrames.setDirectory(QLatin1String(":/Symbole/Attributes/symbolframes"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading SymbolFrame-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading SymbolFrame-XML-Files!"; if (!m_internal->m_branchSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/branch"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading Branch/Truppengattung-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading Branch/Truppengattung-XML-Files!"; if (!m_internal->m_mobilitySymbols.setDirectory(QLatin1String(":/Symbole/Attributes/mobility"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading Mobility-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading Mobility-XML-Files!"; if (!m_internal->m_bcdabSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/bcdab"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading BCDAB-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading BCDAB-XML-Files!"; if (!m_internal->m_commandLevelSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/commandlevel"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading CommandLevel-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading CommandLevel-XML-Files!"; if (!m_internal->m_vehicleSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/vehicle"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading vehicle-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading vehicle-XML-Files!"; if (!m_internal->m_intrinsicMobilitySymbols.setDirectory(QLatin1String(":/Symbole/Attributes/intrinsicmobility"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading Intrinsic-Mobility-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading Intrinsic-Mobility-XML-Files!"; if (!m_internal->m_armingSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/arming"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading arming-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading arming-XML-Files!"; if (!m_internal->m_miscSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/misc"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading arming-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading arming-XML-Files!"; if (!m_internal->m_sectorSymbols.setDirectory(QLatin1String(":/Symbole/Attributes/sectoricon"), QStringList(QLatin1String("*.xml")))) - ERROR_LOG() << "Error while reading sectoricon-XML-Files!"; + ERROR_LOG(m_logger) << "Error while reading sectoricon-XML-Files!"; m_internal->m_symbolColorsEditView.clear(); m_internal->m_symbolColorsEditView.insert(SymbologyXML::SymbolTypes::UNKNOWN, QColor(255, 255, 128)); @@ -438,22 +438,22 @@ bool SymbolEditor::init(const std::shared_ptr connect(m_ui->SliderTransparency, &QSlider::valueChanged, this, &SymbolEditor::onSliderTransparencyValueChanged); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return true; } SymbolEditor::~SymbolEditor() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; delete m_internal; delete m_ui; - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::movePrimitive(QPointF diff) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_currentGraphicsItem != nullptr) { QGraphicsItem *sepi = m_internal->m_currentGraphicsItem; @@ -467,12 +467,12 @@ void SymbolEditor::movePrimitive(QPointF diff) setChanged(true); } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } bool SymbolEditor::createNewSymbol(const QString &symbolname) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_symbol.reset(); m_internal->m_symbol.setName(symbolname); @@ -485,13 +485,13 @@ bool SymbolEditor::createNewSymbol(const QString &symbolname) setChanged(false); clearUndo(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return true; } void SymbolEditor::resetGUI() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; bool bOldUpdateInProgress = m_internal->m_updateInProgress; m_internal->m_updateInProgress = true; @@ -615,14 +615,14 @@ void SymbolEditor::resetGUI() m_internal->m_updateInProgress = bOldUpdateInProgress; - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::fillListWidget(const QMap &container, QWidget *widget, e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType, bool withIcons, bool sort) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!widget) return; @@ -668,14 +668,14 @@ void SymbolEditor::fillListWidget(const QMap &container, QWidget * cwidget->setMaxVisibleItems(25); } - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::widgetInsertItem(QWidget *widget, int index, const QString &text, int key, e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType, bool withIcons) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QListWidget *lwidget = qobject_cast(widget); QComboBox *cwidget = qobject_cast(widget); @@ -704,12 +704,12 @@ void SymbolEditor::widgetInsertItem(QWidget *widget, int index, const QString &t cwidget->insertItem(index, text, key); } - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } QIcon SymbolEditor::getIcon(e_category category, SymbologyXML::SymbolTypes::t_icon_type iconType, int iconId, QSize iconSize) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::Symbol *newSymbol = nullptr; bool isAttrib = true; @@ -817,14 +817,14 @@ QIcon SymbolEditor::getIcon(e_category category, SymbologyXML::SymbolTypes::t_ic QTransform transformView; transformView.scale(1.0, -1.0); - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; return QIcon(pm.transformed(transformView)); } int SymbolEditor::getFrameSymbolID(SymbologyXML::SymbolTypes::t_dimen dimen, SymbologyXML::SymbolTypes::t_affil affil) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_affil tmp_affil = affil; if (tmp_affil == SymbologyXML::SymbolTypes::PENDING) @@ -834,14 +834,14 @@ int SymbolEditor::getFrameSymbolID(SymbologyXML::SymbolTypes::t_dimen dimen, Sym if (tmp_affil == SymbologyXML::SymbolTypes::ASSUMED_FRIEND) tmp_affil = SymbologyXML::SymbolTypes::FRIEND; - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; return SymbologyXML::SymbolTable::getFrameSymbolID(dimen, tmp_affil); } void SymbolEditor::updateGUI() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_updateInProgress = true; @@ -857,12 +857,12 @@ void SymbolEditor::updateGUI() updateGraphicViews(true, true); m_internal->m_updateInProgress = false; - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::updateSymbolAttributesWidgets() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; bool bOldUpdateInProgress = m_internal->m_updateInProgress; m_internal->m_updateInProgress = true; @@ -930,7 +930,7 @@ void SymbolEditor::updateSymbolAttributesWidgets() int idx = m_ui->ComboBoxSectorMain->findData(iconId); if (idx < 0) - ERROR_LOG() << "SECTORMAIN: iconid (" << iconId << ") not found"; + ERROR_LOG(m_logger) << "SECTORMAIN: iconid (" << iconId << ") not found"; else m_ui->ComboBoxSectorMain->setCurrentIndex(m_ui->ComboBoxSectorMain->findData(iconId)); } @@ -994,12 +994,12 @@ void SymbolEditor::updateSymbolAttributesWidgets() m_internal->m_updateInProgress = bOldUpdateInProgress; - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::updateTextProperties() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QLineEdit *arLE[3] = {m_ui->LineEdit1, m_ui->LineEdit2, m_ui->LineEdit3}; @@ -1051,12 +1051,12 @@ void SymbolEditor::updateTextProperties() break; } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::updateGraphicViews(bool editview, bool preview) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!m_internal->m_initFinished) return; @@ -1452,7 +1452,7 @@ void SymbolEditor::updateGraphicViews(bool editview, bool preview) delete bcdabSymbol; delete commandLevelSymbol; - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::reset() @@ -1474,7 +1474,7 @@ void SymbolEditor::drawSymbol(const SymbologyXML::Symbol *symbol, QGraphicsScene const QColor &color, const QColor &fillColor, double z, bool isAttrib, bool updateMap, bool drawBoundRect) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QMap *mapItemPrimitives_p = nullptr; if (updateMap) @@ -1502,14 +1502,14 @@ void SymbolEditor::drawSymbol(const SymbologyXML::Symbol *symbol, QGraphicsScene mapItemPrimitives_p, drawBoundRect ); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::drawSymbolPrimitive(SymbologyXML::Primitive *primitive, QGraphicsScene *scene, const QColor &color, const QColor &fillColor, double z, bool isAttrib, bool drawBoundRect) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_symbolTableCont symTableCont; symTableCont.resize(SymbologyXML::SymbolTypes::ICON_TYPE_END); @@ -1522,12 +1522,12 @@ void SymbolEditor::drawSymbolPrimitive(SymbologyXML::Primitive *primitive, QGrap SymbologyXML::SymbolExporter::drawSymbolPrimitive(primitive, symTableCont, scene, color, fillColor, z, isAttrib, &m_internal->m_mapItemPrimitives, drawBoundRect); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::enableSelectMove(bool enable) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QMapIterator it(m_internal->m_mapItemPrimitives); while (it.hasNext()) @@ -1538,24 +1538,24 @@ void SymbolEditor::enableSelectMove(bool enable) pi->setFlag(QGraphicsItem::ItemIsMovable, enable); } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::setZoom(double zoom) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_ui->GraphicView->resetTransform(); QTransform transformView = m_ui->GraphicView->transform(); transformView.scale(VIEW_SCALE * zoom, -VIEW_SCALE * zoom); m_ui->GraphicView->setTransform(transformView); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::addItem(SymbologyXML::Primitive *prim) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; pushUndo(); prim->setFill(m_internal->m_fillPrimitive); @@ -1579,16 +1579,16 @@ void SymbolEditor::addItem(SymbologyXML::Primitive *prim) } enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::slotImportTemplate() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!m_internal->m_flmGui) { - ERROR_LOG() << Q_FUNC_INFO << "Error FileManagementGuiPlugin isn't loaded."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error FileManagementGuiPlugin isn't loaded."; return; } @@ -1598,7 +1598,7 @@ void SymbolEditor::slotImportTemplate() { if (content.size() == 0) { - ERROR_LOG() << Q_FUNC_INFO << "Empty SymbolContent read from library"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Empty SymbolContent read from library"; } else { @@ -1620,13 +1620,13 @@ void SymbolEditor::slotImportTemplate() resetToolButtonGroupState(); - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::onToolButtonSelectClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::ELEMENT_MOVE); m_internal->m_editMode = EDIT_MOVE; @@ -1638,12 +1638,12 @@ void SymbolEditor::onToolButtonSelectClicked() m_internal->m_currentGraphicsItem->setFlags(QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemIsSelectable); } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonRotateClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbolEditScene::DrawMode dm = m_internal->m_graphicsScene.getDrawMode(); m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::ELEMENT_ROTATE); @@ -1685,16 +1685,16 @@ void SymbolEditor::onToolButtonRotateClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonScaleClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_currentGraphicsItem == nullptr) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -1750,12 +1750,12 @@ void SymbolEditor::onToolButtonScaleClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonClearClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; DeleteElementsDialog *selElemsDial = new DeleteElementsDialog(this); if (selElemsDial->exec() != QDialog::Accepted) @@ -1846,13 +1846,13 @@ void SymbolEditor::onToolButtonClearClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonUndoClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; int scrollx = m_ui->GraphicView->horizontalScrollBar()->sliderPosition(); int scrolly = m_ui->GraphicView->verticalScrollBar()->sliderPosition(); @@ -1864,13 +1864,13 @@ void SymbolEditor::onToolButtonUndoClicked() m_ui->GraphicView->horizontalScrollBar()->setSliderPosition(scrollx); m_ui->GraphicView->verticalScrollBar()->setSliderPosition(scrolly); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonDeleteClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_mapItemPrimitives.find(m_internal->m_currentGraphicsItem) != m_internal->m_mapItemPrimitives.end()) { @@ -1895,13 +1895,13 @@ void SymbolEditor::onToolButtonDeleteClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonCopyClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_editMode = EDIT_COPY; @@ -1913,13 +1913,13 @@ void SymbolEditor::onToolButtonCopyClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonPasteClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_editMode = EDIT_PASTE; @@ -1939,57 +1939,57 @@ void SymbolEditor::onToolButtonPasteClicked() resetToolButtonGroupState(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonEllipseClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::ELLIPSE_START); enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonLineClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::LINE_START); enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonPolylineClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::POLYLINE_START); enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonPolygonClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::POLYGON_START); enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onToolButtonTextClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; resetToolButtonGroupState(); @@ -2028,7 +2028,7 @@ void SymbolEditor::onToolButtonTextClicked() - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } @@ -2040,7 +2040,7 @@ void SymbolEditor::resetToolButtonGroupState() void SymbolEditor::onPushButtonFillColorClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_fillColor = QColorDialog::getColor(Qt::white, this, tr("Select fill color"), QColorDialog::DontUseNativeDialog); setPushButtonFillColorBackground(m_internal->m_fillColor); @@ -2072,33 +2072,33 @@ void SymbolEditor::onPushButtonFillColorClicked() } } } - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::setPushButtonFillColorBackground(QColor color) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_fillColor = color; m_ui->PushButtonFillColor->setStyleSheet(QStringLiteral("background-color:rgb(%1,%2,%3)").arg(color.red()).arg(color.green()).arg(color.blue())); - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::onToolButtonRectClicked() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_graphicsScene.setDrawMode(SymbolEditScene::RECT_START); enableSelectMove(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::copyElementsFromSymbol(const SymbologyXML::Symbol &tmpSymbol) const { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_symbol.getDimen() == SymbologyXML::SymbolTypes::DIMEN_UNDEFINED) m_internal->m_symbol.setDimen(tmpSymbol.getDimen()); @@ -2158,16 +2158,16 @@ void SymbolEditor::copyElementsFromSymbol(const SymbologyXML::Symbol &tmpSymbol) } m_internal->m_symbol.setText(text1, align1, text2, align2, text3, align3); - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::onComboBoxDimenCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2187,16 +2187,16 @@ void SymbolEditor::onComboBoxDimenCurrentIndexChanged(int index) } updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxAffilCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2219,16 +2219,16 @@ void SymbolEditor::onComboBoxAffilCurrentIndexChanged(int index) updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxBCDABCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2239,16 +2239,16 @@ void SymbolEditor::onComboBoxBCDABCurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxHeadquarterCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2257,16 +2257,16 @@ void SymbolEditor::onComboBoxHeadquarterCurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxCommandLevelCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2276,16 +2276,16 @@ void SymbolEditor::onComboBoxCommandLevelCurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxMobCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2295,13 +2295,13 @@ void SymbolEditor::onComboBoxMobCurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxVehicleCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_sector_rectpos rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_DEFAULT; if (m_ui->CheckBoxVehicle->isChecked()) @@ -2311,13 +2311,13 @@ void SymbolEditor::onComboBoxVehicleCurrentIndexChanged(int index) SymbologyXML::SymbolTypes::ICON_TYPE_VEHICLE, SymbologyXML::SymbolTypes::SECTORMAIN, rectpos); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxVehicleStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_sector_rectpos rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_DEFAULT; if (state) rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_LARGE; @@ -2326,13 +2326,13 @@ void SymbolEditor::onCheckBoxVehicleStateChanged(int state) SymbologyXML::SymbolTypes::instance()->getVehicle()->getContainerAsInt(), SymbologyXML::SymbolTypes::ICON_TYPE_VEHICLE, SymbologyXML::SymbolTypes::SECTORMAIN, rectpos); - DEBUG_LOG() << "END" << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END" << Q_FUNC_INFO; } void SymbolEditor::onComboBoxIntrinsicMobCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; help_on_ComboBoxIndexChanged(m_ui->ComboBoxIntrinsicMob, @@ -2341,13 +2341,13 @@ void SymbolEditor::onComboBoxIntrinsicMobCurrentIndexChanged(int index) SymbologyXML::SymbolTypes::SECTOR2); m_ui->ComboBoxIntrinsicMob_2->setCurrentIndex(index); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxIntrinsicMob2CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; help_on_ComboBoxIndexChanged(m_ui->ComboBoxIntrinsicMob_2, @@ -2356,13 +2356,13 @@ void SymbolEditor::onComboBoxIntrinsicMob2CurrentIndexChanged(int index) SymbologyXML::SymbolTypes::SECTOR2); m_ui->ComboBoxIntrinsicMob->setCurrentIndex(index); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxArmingCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_sector_rectpos rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_DEFAULT; if (m_ui->CheckBoxArming->isChecked()) @@ -2372,7 +2372,7 @@ void SymbolEditor::onComboBoxArmingCurrentIndexChanged(int index) SymbologyXML::SymbolTypes::ICON_TYPE_ARMING, SymbologyXML::SymbolTypes::SECTORMAIN, rectpos); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } @@ -2391,11 +2391,11 @@ void SymbolEditor::onCheckBoxArmingStateChanged(int state) void SymbolEditor::onListViewMiscItemSelectionChanged() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2428,13 +2428,13 @@ void SymbolEditor::onListViewMiscItemSelectionChanged() setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxSector1CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; help_on_ComboBoxIndexChanged(m_ui->ComboBoxSector1, index, @@ -2442,13 +2442,13 @@ void SymbolEditor::onComboBoxSector1CurrentIndexChanged(int index) SymbologyXML::SymbolTypes::ICON_TYPE_SECTOR_ICON, SymbologyXML::SymbolTypes::SECTOR1); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxSectorMainCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbologyXML::SymbolTypes::t_sector_rectpos rectpos = SymbologyXML::SymbolTypes::SECTOR_RECTPOS_DEFAULT; if (m_ui->CheckBoxMain && m_ui->CheckBoxMain->isChecked()) @@ -2460,7 +2460,7 @@ void SymbolEditor::onComboBoxSectorMainCurrentIndexChanged(int index) SymbologyXML::SymbolTypes::ICON_TYPE_SECTOR_ICON, SymbologyXML::SymbolTypes::SECTORMAIN, rectpos); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } @@ -2481,11 +2481,11 @@ void SymbolEditor::onCheckBoxMainStateChanged(int state) void SymbolEditor::onListViewSectorMainItemSelectionChanged() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2518,20 +2518,20 @@ void SymbolEditor::onListViewSectorMainItemSelectionChanged() setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxSector2CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; help_on_ComboBoxIndexChanged(m_ui->ComboBoxSector2, index, SymbologyXML::SymbolTypes::instance()->getSectorIcon()->getContainerAsInt(SymbologyXML::SymbolTypes::SECTOR2), SymbologyXML::SymbolTypes::ICON_TYPE_SECTOR_ICON, SymbologyXML::SymbolTypes::SECTOR2); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } @@ -2541,11 +2541,11 @@ void SymbolEditor::help_on_ComboBoxIndexChanged(QComboBox *comboBox, SymbologyXML::SymbolTypes::t_sector_position pos, SymbologyXML::SymbolTypes::t_sector_rectpos rectpos) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || index < 0) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2566,16 +2566,16 @@ void SymbolEditor::help_on_ComboBoxIndexChanged(QComboBox *comboBox, setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxAlign1CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2586,16 +2586,16 @@ void SymbolEditor::onComboBoxAlign1CurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxAlign2CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2606,16 +2606,16 @@ void SymbolEditor::onComboBoxAlign2CurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxAlign3CurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress || (index < 0)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2626,25 +2626,25 @@ void SymbolEditor::onComboBoxAlign3CurrentIndexChanged(int index) setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxColorCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (index != -1) { m_internal->m_previewColor = m_internal->m_symbolColorsPreview.at(index).second; updateGraphicViews(true, true); } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onComboBoxLineStyleCurrentIndexChanged(int index) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; switch (index) { @@ -2693,16 +2693,16 @@ void SymbolEditor::onComboBoxLineStyleCurrentIndexChanged(int index) } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onLineEdit1TextChanged(const QString &text) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2714,16 +2714,16 @@ void SymbolEditor::onLineEdit1TextChanged(const QString &text) updateGraphicViews(true, true); setChanged(true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onLineEdit2TextChanged(const QString &text) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2735,16 +2735,16 @@ void SymbolEditor::onLineEdit2TextChanged(const QString &text) updateGraphicViews(true, true); setChanged(true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onLineEdit3TextChanged(const QString &text) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2754,17 +2754,17 @@ void SymbolEditor::onLineEdit3TextChanged(const QString &text) updateGraphicViews(true, true); setChanged(true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onListViewTruppengattungItemSelectionChanged() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -2784,43 +2784,43 @@ void SymbolEditor::onListViewTruppengattungItemSelectionChanged() } setChanged(true); updateGraphicViews(true, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxBackgroundStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_displayPreviewBackground = (bool)state; updateGraphicViews(false, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxPlannedStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if ((bool)state) m_internal->m_additionalDataPreview.m_state = SymbologyXML::SymbolTypes::STATE_ANTICIPATED; else m_internal->m_additionalDataPreview.m_state = SymbologyXML::SymbolTypes::STATE_PRESENT; updateGraphicViews(false, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxCopyValuesStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_copyFromSelectedPrimitive = (bool)state; copyFromSelectedPrimitive(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxFillStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_fillPrimitive = state; if (m_internal->m_copyFromSelectedPrimitive && (m_internal->m_currentGraphicsItem != nullptr)) @@ -2852,37 +2852,37 @@ void SymbolEditor::onCheckBoxFillStateChanged(int state) } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onCheckBoxDrawAreaStateChanged(int state) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_showDrawArea = (bool)state; m_internal->m_graphicsScene.setShowDrawingArea(m_internal->m_showDrawArea); m_internal->m_graphicsScene.invalidate(m_internal->m_graphicsScene.sceneRect(), QGraphicsScene::ForegroundLayer); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onSpinBoxRasterValueChanged(double d) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_gridWidth = d; m_internal->m_graphicsScene.setGridWidth(d); m_internal->m_graphicsScene.invalidate(m_internal->m_graphicsScene.sceneRect(), QGraphicsScene::BackgroundLayer); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onSpinBoxScaleValueChanged(double d) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_symbol.setScale(d); setChanged(true); @@ -2890,13 +2890,13 @@ void SymbolEditor::onSpinBoxScaleValueChanged(double d) m_internal->m_previewZoom = d; updateGraphicViews(false, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onSpinBoxLineWidthValueChanged(double d) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_pen.setWidthF(d); m_internal->m_graphicsScene.setPen(m_internal->m_pen); @@ -2930,34 +2930,34 @@ void SymbolEditor::onSpinBoxLineWidthValueChanged(double d) } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::onSliderTransparencyValueChanged(int value) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_transparency = 1.0 - (double)value / 100.0; m_ui->LabelTransparency->setText(QLocale().toString((double)value / 100.0, 'f', 2)); updateGraphicViews(false, true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::setChanged(bool changed) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (changed) slotChangesMade(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::selectionChanged() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; bool enableEdit = false; bool selPrimIsICON = false; @@ -3002,18 +3002,18 @@ void SymbolEditor::selectionChanged() m_ui->CheckBoxFill->blockSignals(false); copyFromSelectedPrimitive(); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::copyFromSelectedPrimitive() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!m_internal->m_copyFromSelectedPrimitive || (m_internal->m_currentGraphicsItem == nullptr)) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -3043,16 +3043,16 @@ void SymbolEditor::copyFromSelectedPrimitive() } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::pushUndo() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_internal->m_updateInProgress) { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -3060,13 +3060,13 @@ void SymbolEditor::pushUndo() m_ui->ToolButtonUndo->setEnabled(true); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::popUndo() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; SymbolEditScene::DrawMode dm = m_internal->m_graphicsScene.getDrawMode(); @@ -3088,25 +3088,25 @@ void SymbolEditor::popUndo() m_internal->m_graphicsScene.setDrawMode(dm); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::clearUndo() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_internal->m_symbolUndoStack.clear(); m_ui->ToolButtonUndo->setEnabled(false); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::keyPressEvent(QKeyEvent *keyEvent) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; @@ -3150,13 +3150,13 @@ void SymbolEditor::keyPressEvent(QKeyEvent *keyEvent) else LtsWidgets::LtsDialog::keyPressEvent(keyEvent); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::transformSelection(int key, Qt::KeyboardModifiers modifiers) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; u_int modAlt = Qt::AltModifier; @@ -3197,7 +3197,7 @@ void SymbolEditor::transformSelection(int key, Qt::KeyboardModifiers modifiers) } else { - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; return; } @@ -3233,13 +3233,13 @@ void SymbolEditor::transformSelection(int key, Qt::KeyboardModifiers modifiers) else movePrimitive(QPointF(stepWidth * factor * dx, stepWidth * factor * dy)); - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::restoreSelection(SymbologyXML::Primitive *prim) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QMapIterator it(m_internal->m_mapItemPrimitives); while (it.hasNext()) { @@ -3251,7 +3251,7 @@ void SymbolEditor::restoreSelection(SymbologyXML::Primitive *prim) pi->setSelected(true); } } - DEBUG_LOG() << "END " << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "END " << Q_FUNC_INFO; } void SymbolEditor::retranslate() @@ -3264,7 +3264,7 @@ bool SymbolEditor::writeFile(bool saveAsNew) bool bRet = false; if (!m_internal->m_flmGui) { - ERROR_LOG() << Q_FUNC_INFO << "Error FileManagementGuiPlugin isn't loaded."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error FileManagementGuiPlugin isn't loaded."; return false; } @@ -3277,7 +3277,7 @@ bool SymbolEditor::writeFile(bool saveAsNew) int fileId = m_internal->m_flmGui->saveFileContent(this, FileManagement::FileType::OperatorDefinedSymbol, m_session->exerciseId(), byteArray, SYMBOL_FOLDER_ID, properties); if (fileId > 0) { - DEBUG_LOG() << "Saved file with id = " << fileId; + 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(); @@ -3287,7 +3287,7 @@ bool SymbolEditor::writeFile(bool saveAsNew) bRet = true; } else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; return bRet; } @@ -3322,9 +3322,9 @@ void SymbolEditor::slotSave() const QString properties = QString::fromUtf8(m_internal->m_attributes.toJson(QJsonDocument::Compact)); if (m_internal->m_flmGui->saveContent(m_internal->m_lastFileId, byteArray, properties)) - DEBUG_LOG() << "Saved file with id = " << m_internal->m_lastFileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << m_internal->m_lastFileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } emit saveFinished(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.h index 5090c4279..60cb937bf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolEditor/asb_symbol_editor.h @@ -180,6 +180,8 @@ private slots: private: + +NGL::INGLLogger &m_logger; void resetGUI(); void updateGUI(); void updateSymbolAttributesWidgets(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.cpp index 13311db11..5a17727f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.cpp @@ -105,7 +105,7 @@ FlmSubscriber::FlmSubscriber(const std::shared_ptrm_reFetchTimer->start(); }); @@ -204,11 +204,11 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte { const int32_t fileContentId = reply.id(); - TRACE_LOG() << Q_FUNC_INFO << " START, " << fileContentId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, " << fileContentId; if (!d->m_fileContentMap.contains(fileContentId)) { - ERROR_LOG() << Q_FUNC_INFO << " fileContentId unknown, fileContentId=" << fileContentId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " fileContentId unknown, fileContentId=" << fileContentId; return; } @@ -218,7 +218,7 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte const QString &operatorName = fcData.operatorName; const qint64 lastModified = fcData.lastModified; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " fileContentId=" << fileContentId << " name=" << name << " operatorName=" << operatorName @@ -234,7 +234,7 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte QImage image; if (!svgToImage(QByteArray::fromRawData(reinterpret_cast(&reply.content().at(0)), reply.content().size()), image)) { - ERROR_LOG() << Q_FUNC_INFO << " svgToImage failed, fileContentId=" << fileContentId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " svgToImage failed, fileContentId=" << fileContentId; fcData.monitoring.replyState = FileContentStruct::ReplyFailure; return; } @@ -265,7 +265,7 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte } else { - ERROR_LOG() << Q_FUNC_INFO << " xmlSymbolContent is empty, fileContentId=" << fileContentId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " xmlSymbolContent is empty, fileContentId=" << fileContentId; fcData.monitoring.replyState = FileContentStruct::ReplyFailure; } break; @@ -273,24 +273,24 @@ void FlmSubscriber::onGetFileContentDataReply(const FileManagement::GetFileConte case FileContentStruct::SymbolType::UnsupportedSymbol: { - ERROR_LOG() << Q_FUNC_INFO << " unsupported symbol found, fileContentId=" << fileContentId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " unsupported symbol found, fileContentId=" << fileContentId; fcData.monitoring.replyState = FileContentStruct::ReplyFailure; break; } } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool FlmSubscriber::svgToImage(const QByteArray &svgByteArray, QImage &imageOut) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QSvgRenderer svgRenderer; if (!svgRenderer.load(svgByteArray)) { - ERROR_LOG() << Q_FUNC_INFO << " svgRenderer.load failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " svgRenderer.load failed"; return false; } @@ -304,7 +304,7 @@ bool FlmSubscriber::svgToImage(const QByteArray &svgByteArray, QImage &imageOut) svgRenderer.render(&painter); painter.end(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -383,7 +383,7 @@ void FlmSubscriber::checkForReFetching() void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent &data, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO + TRACE_LOG(m_logger) << Q_FUNC_INFO << " data.id=" << data.id() << " data.fileStatus=" << data.fileStatus().underlying() << " modType=" << modType @@ -432,13 +432,13 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent &data FileManagement::GetFileContentDataRequest request(fileContentId); if (!d->m_flmFtc->getFileContentDataRequest(request, this)) - ERROR_LOG() << Q_FUNC_INFO << "Error reading FileContentData, fileContentId=" << fileContentId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading FileContentData, fileContentId=" << fileContentId; break; } case DataModification::eRemoved: { - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " modType=" << modType << " fileContentId=" << fileContentId << " fileContentName=" << data.name(); @@ -448,7 +448,7 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent &data if (!d->m_symbolProxy.removeSymbol(fileContentId)) - ERROR_LOG() << Q_FUNC_INFO << " removeSymbol failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " removeSymbol failed" << " fileContentId=" << fileContentId << " fileContentName='" << data.name() << "'" << " contains=" << d->m_fileContentMap.contains(fileContentId); @@ -460,7 +460,7 @@ void FlmSubscriber::onFileContentChanged(const FileManagement::FileContent &data void FlmSubscriber::updateFileContentMap(const FileManagement::FileContent &data) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " d->m_fileContentMap.size()=" << d->m_fileContentMap.size() << " fileContentId=" << data.id() << " data.isDeleted()=" <errorString: '" << parseError.errorString() << "'" << ", offset: " << parseError.offset; } @@ -542,7 +542,7 @@ void FlmSubscriber::updateFileContentMap(const FileManagement::FileContent &data d->m_fileContentMap[fileContentId] = fcData; - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << " d->m_fileContentMap.size()=" << d->m_fileContentMap.size() << " fileContentId=" << data.id() << " data.isDeleted()=" <setXmlSymbolToDict(dict, fileContentId, operatorName, lastModified, name, xmlContent, usrTags)) - ERROR_LOG() << Q_FUNC_INFO << " dict.setXmlSymbolToDict failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " dict.setXmlSymbolToDict failed" << ", symbologyType='" << (int)symbologyType << "'" << ", name='" << name << "'"; } } - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << " fileContentId=" << fileContentId << " name='" << name << "'"; } void FlmSubscriber::onLocalSymbolProxyXmlSymbolRemoved(qint32 fileContentId) { - TRACE_LOG() << Q_FUNC_INFO << " START" << " fileContentId=" << fileContentId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " fileContentId=" << fileContentId; for (const SymbologyType &symbologyType : std::as_const(d->m_symbolDictionaryToUpdate)) { AdvancedSymbology::SymbolDictionary &dict = AdvancedSymbology::SymbolDictionary::dictionary(symbologyType); - DEBUG_LOG() << Q_FUNC_INFO << " dict.removeXmlSymbol:" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dict.removeXmlSymbol:" << " symbologyType='" << symbologyType << "'" << ", fileContentId=" << fileContentId; @@ -627,7 +627,7 @@ void FlmSubscriber::onLocalSymbolProxyXmlSymbolRemoved(qint32 fileContentId) dict.removeXmlSymbol(sidc); dict.removeXmlSymbol(fileContentId); } - TRACE_LOG() << Q_FUNC_INFO << " END" << " fileContentId=" << fileContentId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << " fileContentId=" << fileContentId; } @@ -638,7 +638,7 @@ void FlmSubscriber::onLocalSymbolProxyXmlSymbolRemoved(qint32 fileContentId) bool FlmSubscriber::connectFlmSymbolProxy(int type_placeholder, SymbologyType symbologyType) { Q_UNUSED(type_placeholder); - TRACE_LOG() << Q_FUNC_INFO << " m_fileContentMap.size()=" << d->m_fileContentMap.size() ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " m_fileContentMap.size()=" << d->m_fileContentMap.size() ; d->m_symbolDictionaryToUpdate.insert(symbologyType); @@ -701,12 +701,12 @@ bool FlmSubscriber::setEtsSymbolToDict(SymbolDictionary &dict, if (!dict.setEtsSymbol(fileContentId, symProps.sidc(), symProps, image)) { - ERROR_LOG() << Q_FUNC_INFO << " dict.insertExtraSymbol failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " dict.insertExtraSymbol failed" << ", fileContentId=" << fileContentId << ", name='" << name << "'"; return false; } else - INFO_LOG() << Q_FUNC_INFO << " dict.insertExtraSymbol done" + INFO_LOG(m_logger) << Q_FUNC_INFO << " dict.insertExtraSymbol done" << ", fileContentId=" << fileContentId << ", name='" << name << "'"; return true; @@ -731,7 +731,7 @@ bool FlmSubscriber::setXmlSymbolToDict(SymbolDictionary &dict, bool success = dict.setXmlSymbol(fileContentId, name, operatorName, lastModified, xmlContent, symProps); if (!success) - ERROR_LOG() << Q_FUNC_INFO << " setXmlSymbol failed:" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " setXmlSymbol failed:" << ", file-id=" << fileContentId << ", filenameid='" << name << "'"; return success; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.h index 3518d1da1..58feaaee5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AdvancedSymbology/Gui/SymbolProxy/asb_flm_subscriber.h @@ -40,6 +40,8 @@ public: bool connectFlmSymbolProxy(int type_placeholder, SymbologyType symbologyType) override; private: + +NGL::INGLLogger &m_logger; bool setEtsSymbolToDict(SymbolDictionary &dict, qint32 fileContentId, const QString &name, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_config_alarm_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_config_alarm_model.cpp index c53c40e57..d9716d709 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_config_alarm_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_config_alarm_model.cpp @@ -43,7 +43,7 @@ bool ConfigAlarmModel::initModel(const std::shared_ptr alarmConfigs = m_dtc->alarmConfigs(); - INFO_LOG() << "initModel - #AlarmConfig: " << alarmConfigs.size(); + INFO_LOG(m_logger) << "initModel - #AlarmConfig: " << alarmConfigs.size(); connect(m_dtc.get(), &Interface::Dtc::alarmConfigChanged, this, &ConfigAlarmModel::onAlarmConfigChanged); @@ -59,7 +59,7 @@ bool ConfigAlarmModel::initModel(const std::shared_ptr m_dtc; std::shared_ptr m_ppmDtc; AlarmHistoryModel *m_alarmHistoryModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.cpp index edfd42251..a2f9d4b78 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.cpp @@ -176,7 +176,7 @@ void AlarmHistoryModel::onNotificationChanged(const AlarmManagement::Notificatio const int global = propertieJsonObj[QStringLiteral("Global")].toInt(); const int friendlyFire = propertieJsonObj[QStringLiteral("FriendlyFire")].toInt(); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " notification:" << data << ", Global: " << global << ", FriendlyFire: " << friendlyFire; @@ -197,7 +197,7 @@ void AlarmHistoryModel::onParticipantChanged(const ParticipantManagement::Partic QString tacticalIdentifier = QString::fromStdString(participant.tacticalIdentifier()); m_idTactIdentifierMap.insert(participant.id(), tacticalIdentifier); - DEBUG_LOG() << Q_FUNC_INFO << " id=" << participant.id() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id=" << participant.id() << " designator=" << designator << " tacticalIdentifier=" << tacticalIdentifier; } @@ -205,7 +205,7 @@ void AlarmHistoryModel::onParticipantChanged(const ParticipantManagement::Partic int AlarmHistoryModel::participantId2EquipNo(const int participantId) const { int ret = m_partId2EquipNoMap.value(participantId, 0); - INFO_LOG() << "participantId2EquipNo participantId=" << participantId + INFO_LOG(m_logger) << "participantId2EquipNo participantId=" << participantId << " EquipmentNumber=" << ret; return ret; } @@ -213,7 +213,7 @@ int AlarmHistoryModel::participantId2EquipNo(const int participantId) const QString AlarmHistoryModel::getDesignator(const int participantId) const { QString designator = m_idDesignatorMap.value(participantId); - DEBUG_LOG() << "m_idDesignatorMap.value(participantId)=" << designator; + DEBUG_LOG(m_logger) << "m_idDesignatorMap.value(participantId)=" << designator; return designator; } @@ -221,7 +221,7 @@ QString AlarmHistoryModel::getDesignator(const int participantId) const QString AlarmHistoryModel::getTactIdentifier(const int participantId) const { QString tactIdentifier = m_idTactIdentifierMap.value(participantId); - DEBUG_LOG() << "m_idTactIdentifierMap.value(participantId)=" << tactIdentifier; + DEBUG_LOG(m_logger) << "m_idTactIdentifierMap.value(participantId)=" << tactIdentifier; return tactIdentifier; } @@ -234,7 +234,7 @@ void AlarmHistoryModel::onBCContaminationChanged(const AreaEffectSimulation::BCC int id = data.id(); QString name = QString::fromStdString(data.name()); m_aesNameMap[id] = name; - DEBUG_LOG() << "onBCContaminationChanged: " << data + DEBUG_LOG(m_logger) << "onBCContaminationChanged: " << data << " Name=" << name << " id=" << id; } @@ -247,7 +247,7 @@ void AlarmHistoryModel::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap int id = data.id(); QString name = QString::fromStdString(data.name()); m_aesNameMap[id] = name; - DEBUG_LOG() << "BoobyTrap: " << data + DEBUG_LOG(m_logger) << "BoobyTrap: " << data << " Name=" << name << " id=" << id; } @@ -260,7 +260,7 @@ void AlarmHistoryModel::onOffRouteMineChanged(const AreaEffectSimulation::OffRou int id = data.id(); QString name = QString::fromStdString(data.name()); m_aesNameMap[id] = name; - DEBUG_LOG() << "OffRouteMine: " << data + DEBUG_LOG(m_logger) << "OffRouteMine: " << data << " Name=" << name << " id=" << id; } @@ -273,7 +273,7 @@ void AlarmHistoryModel::onAesItemChanged(const AreaEffectSimulation::AesItem &it QString name = QString::fromStdString(item.name()); int id = item.id(); m_aesNameMap[id] = name; - DEBUG_LOG() << "AreaEffectSimulation::AesItem onAesItemChanged: " << item + DEBUG_LOG(m_logger) << "AreaEffectSimulation::AesItem onAesItemChanged: " << item << " Name=" << name << " id=" << item.id(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.h index 4af3875cb..22948d44a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/Common/alm_history_alarm_model.h @@ -63,6 +63,8 @@ public: QString getTactIdentifier(const int participantId) const; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const NotificationEx &data, DataModification modType) const override; private slots: void onNotificationChanged(const AlarmManagement::Notification &data, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_dialog.cpp index 5f5eab276..10dc5e716 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_dialog.cpp @@ -154,7 +154,7 @@ bool AlarmDialog::init(const std::shared_ptr &f bool global = true; m_configAlarmModel->initModel(m_dtc, ppmDtc, alarmHistoryModel, global); - INFO_LOG() << "AlarmDialog::init"; + INFO_LOG(m_logger) << "AlarmDialog::init"; return true; } @@ -170,7 +170,7 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig &data, if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "************** onAlarmConfigChanged " + DEBUG_LOG(m_logger) << "************** onAlarmConfigChanged " << " id=" << data.id() << " operatorId=" << data.operatorId() << " m_operatorId=" << m_operatorId @@ -183,33 +183,33 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig &data, if (data.operatorId() == m_operatorId) { - DEBUG_LOG() << "************** onAlarmConfig zuweisen "; + DEBUG_LOG(m_logger) << "************** onAlarmConfig zuweisen "; switch (data.eventTypeId().underlying()) { case ProjectDataManagement::EventType_def::EnterNuclear: { - DEBUG_LOG() << "EnterNuclear zuweisen "; + DEBUG_LOG(m_logger) << "EnterNuclear zuweisen "; m_ui->cbxNMarker->setChecked(setMarker); m_ui->cbxNMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::EnterDangerArea: { - DEBUG_LOG() << "EnterDangerArea zuweisen "; + DEBUG_LOG(m_logger) << "EnterDangerArea zuweisen "; m_ui->cbxDanerAreaMarker->setChecked(setMarker); m_ui->cbxDangerAreaMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::EnterMineArea: { - DEBUG_LOG() << "EnterMineArea zuweisen "; + DEBUG_LOG(m_logger) << "EnterMineArea zuweisen "; m_ui->cbxMineAreaEntryMarker->setChecked(setMarker); m_ui->cbxMineAreaEntryMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::HitMine: { - DEBUG_LOG() << "HitMine zuweisen "; + DEBUG_LOG(m_logger) << "HitMine zuweisen "; m_ui->cbxMineAreaHitMarker->setChecked(setMarker); m_ui->cbxMineAreaHitMessage->setChecked(messageWindow); break; @@ -217,14 +217,14 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig &data, case ProjectDataManagement::EventType_def::Hit: { - DEBUG_LOG() << "Hit zuweisen "; + DEBUG_LOG(m_logger) << "Hit zuweisen "; m_ui->cbxDirectFireMarker->setChecked(setMarker); m_ui->cbxDirectFireMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::HitEffectSimulation: { - DEBUG_LOG() << "HitEffectSimulation zuweisen "; + DEBUG_LOG(m_logger) << "HitEffectSimulation zuweisen "; m_ui->cbxIndirectFireMarker->setChecked(setMarker); m_ui->cbxIndirectFireMessage->setChecked(messageWindow); break; @@ -232,27 +232,27 @@ void AlarmDialog::onAlarmConfigChanged(const AlarmManagement::AlarmConfig &data, case ProjectDataManagement::EventType_def::CrossLocalBorderline: { - DEBUG_LOG() << "CrossLocalBorderline zuweisen "; + DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen "; m_ui->cbxLocalBorderMarker->setChecked(setMarker); m_ui->cbxLocalBorderMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::CrossGlobalBorderline: { - DEBUG_LOG() << "CrossGlobalBorderline zuweisen "; + DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen "; m_ui->cbxGlobalBorderMarker->setChecked(setMarker); m_ui->cbxGlobalBorderMessage->setChecked(messageWindow); break; } case ProjectDataManagement::EventType_def::AirSupport: { - DEBUG_LOG() << "AirSupport zuweisen "; + DEBUG_LOG(m_logger) << "AirSupport zuweisen "; m_ui->cbxAirSupportMarker->setChecked(setMarker); m_ui->cbxAirSupportMessage->setChecked(messageWindow); break; } default: - ERROR_LOG() << "Not possible to set with Operator App!!!"; + ERROR_LOG(m_logger) << "Not possible to set with Operator App!!!"; break; } } @@ -272,22 +272,22 @@ std::vector AlarmDialog::getCheckedValues() const if (item.checkboxMarker->isChecked()) { alarmActionDds.setMarker(true); - DEBUG_LOG() << item.name << " setMarker = true"; + DEBUG_LOG(m_logger) << item.name << " setMarker = true"; } else { alarmActionDds.setMarker(false); - DEBUG_LOG() << item.name << " setMarker = false"; + DEBUG_LOG(m_logger) << item.name << " setMarker = false"; } if (item.checkboxWindow->isChecked()) { alarmActionDds.messageWindow(true); - DEBUG_LOG() << item.name << " messageWindow = true"; + DEBUG_LOG(m_logger) << item.name << " messageWindow = true"; } else { alarmActionDds.messageWindow(false); - DEBUG_LOG() << item.name << " messageWindow = false"; + DEBUG_LOG(m_logger) << item.name << " messageWindow = false"; } if (alarmActionDds.setMarker() || alarmActionDds.messageWindow()) ret.push_back(alarmActionDds); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.cpp index 4b164936f..6b22abadc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.cpp @@ -21,7 +21,7 @@ AlarmView::AlarmView(LtsSession::LtsSession *session, QWidget *parent) , m_session(session) , m_ui(new Ui::AlarmView) { - DEBUG_LOG() << Q_FUNC_INFO << " --- AlarmView Konstruktor() "; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --- AlarmView Konstruktor() "; m_ui->setupUi(this); m_ui->widget->setSelectionMode(QAbstractItemView::MultiSelection); @@ -50,7 +50,7 @@ AlarmView::AlarmView(LtsSession::LtsSession *session, QWidget *parent) AlarmView::~AlarmView() { - INFO_LOG() << "--- AlarmView Destruktor() "; + INFO_LOG(m_logger) << "--- AlarmView Destruktor() "; m_sitMapGuiIfc = nullptr; delete m_ui; } @@ -65,14 +65,14 @@ void AlarmView::retranslate() bool AlarmView::init(const std::shared_ptr &dtc, AlarmHistoryModel *alarmHistoryModel) { - INFO_LOG() << "--- init() "; + INFO_LOG(m_logger) << "--- init() "; if (!dtc) return false; m_dtc = dtc; m_alarmHistoryModel = alarmHistoryModel; - DEBUG_LOG() << "--- AlarmView::init "; + DEBUG_LOG(m_logger) << "--- AlarmView::init "; m_proxyModel = new AlarmHistoryProxyModel(this); m_proxyModel->setSourceModel(m_alarmHistoryModel); m_ui->widget->setModel(m_proxyModel); @@ -101,14 +101,14 @@ void AlarmView::onSelectionChanged() void AlarmView::onShowAlarm() { - INFO_LOG() << "--- onShowMAlarm() "; + INFO_LOG(m_logger) << "--- onShowMAlarm() "; } void AlarmView::onRemoveAlarm() { - DEBUG_LOG() << "onRemoveAlarm selectedRows.size" + DEBUG_LOG(m_logger) << "onRemoveAlarm selectedRows.size" << m_ui->widget->selectedRows().size(); const QModelIndexList idxList = m_ui->widget->selectedRows(); @@ -124,7 +124,7 @@ void AlarmView::onRemoveAlarm() void AlarmView::onCenterAlarm() { - DEBUG_LOG() << "onCenterAlarm"; + DEBUG_LOG(m_logger) << "onCenterAlarm"; if (!m_sitMapGuiIfc) return; const QModelIndexList indexList = m_ui->widget->selectedRows(); @@ -137,14 +137,14 @@ void AlarmView::onCenterAlarm() if (!position.isNull()) { - DEBUG_LOG() << Q_FUNC_INFO << " position=" << position.x() << " - " << position.y(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " position=" << position.x() << " - " << position.y(); m_sitMapGuiIfc->setCenterPoint(position); } else { const QModelIndex &indexParticipantId = m_alarmHistoryModel->index(index.row(), AlarmHistoryModel::ParticipantId, index.parent()); const int participantId = indexParticipantId.data().toInt(); - DEBUG_LOG() << Q_FUNC_INFO << " participantId=" << participantId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " participantId=" << participantId; m_sitMapGuiIfc->centerMapToParticipant(participantId); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.h index 40b3ec54d..ec30d4cc4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigAlarm/alm_history.h @@ -29,6 +29,8 @@ public: AlarmHistoryModel *alarmHistoryModel); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onShowAlarm(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.cpp index 4817b76f8..d7bdaba65 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.cpp @@ -99,10 +99,10 @@ bool ConfigParticipantsDialog::init(const std::shared_ptrequipmentNoContent->setText(equipmentNumbersStr); - DEBUG_LOG() << "current participantId = " << participantData.id(); + DEBUG_LOG(m_logger) << "current participantId = " << participantData.id(); m_typeClass = ppmDtc->type(participantData.typeId()).typeClass(); - DEBUG_LOG() << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId(); + DEBUG_LOG(m_logger) << "m_typeClass=" << m_typeClass << " TypeId=" << participantData.typeId(); fillCbx(); m_almDtc->alarmConfigs([this](const AlarmManagement::AlarmConfig &alarm) { setAlaramData(alarm); }); @@ -111,7 +111,7 @@ bool ConfigParticipantsDialog::init(const std::shared_ptrcbxDirectFire->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -135,7 +135,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::HitEffectSimulation: { - DEBUG_LOG() << "HitIndirect zuweisen "; + DEBUG_LOG(m_logger) << "HitIndirect zuweisen "; m_ui->cbxIndirectFire->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -143,7 +143,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::AirSupport: { - DEBUG_LOG() << "AirSupport zuweisen "; + DEBUG_LOG(m_logger) << "AirSupport zuweisen "; m_ui->cbxAirSupport->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -151,7 +151,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::HitMine: { - DEBUG_LOG() << "HitMine zuweisen "; + DEBUG_LOG(m_logger) << "HitMine zuweisen "; m_ui->cbxMines->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -161,7 +161,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig case ProjectDataManagement::EventType_def::HitN: case ProjectDataManagement::EventType_def::HitC: { - DEBUG_LOG() << "Hit N/B/C zuweisen "; + 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()); @@ -169,7 +169,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::FriendlyFire: { - DEBUG_LOG() << "FriendlyFire zuweisen "; + DEBUG_LOG(m_logger) << "FriendlyFire zuweisen "; m_ui->cbxFriendlyFire->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -183,7 +183,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::Manipulation: { - DEBUG_LOG() << "Manipulation zuweisen "; + DEBUG_LOG(m_logger) << "Manipulation zuweisen "; m_ui->cbxManipulation->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -191,7 +191,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::CrossGlobalBorderline: { - DEBUG_LOG() << "CrossGlobalBorderline zuweisen "; + DEBUG_LOG(m_logger) << "CrossGlobalBorderline zuweisen "; m_ui->cbxGlobalBorderLine->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -199,7 +199,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } case ProjectDataManagement::EventType_def::CrossLocalBorderline: { - DEBUG_LOG() << "CrossLocalBorderline zuweisen "; + DEBUG_LOG(m_logger) << "CrossLocalBorderline zuweisen "; m_ui->cbxLocalBorderLine->setChecked(true); m_ui->cbxSetMarker->setChecked(alarm.setMarker()); m_ui->cbxMessageWindow->setChecked(alarm.messageWindow()); @@ -207,7 +207,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig } default: { - ERROR_LOG() << "Not possible to set with Operator App!!!"; + ERROR_LOG(m_logger) << "Not possible to set with Operator App!!!"; } } } @@ -215,7 +215,7 @@ void ConfigParticipantsDialog::setAlaramData(const AlarmManagement::AlarmConfig std::vector ConfigParticipantsDialog::getCheckedValues() const { AlarmManagement::AlarmAction alarmActionDds; - DEBUG_LOG() << "getCheckedValues"; + DEBUG_LOG(m_logger) << "getCheckedValues"; std::vector alarmsDds; @@ -289,7 +289,7 @@ std::vector ConfigParticipantsDialog::getCheckedVa bool ConfigParticipantsDialog::apply() { - DEBUG_LOG() << "apply"; + DEBUG_LOG(m_logger) << "apply"; AlarmManagement::ConfigureAlarmsRequest req; req.participantIds(m_participantVector); req.alarms(getCheckedValues()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.h index c7c5e10ff..12b79bee9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_config_participant_dialog.h @@ -35,6 +35,8 @@ public: const std::vector &equipmentVector); protected: + +NGL::INGLLogger &m_logger; void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.cpp index 9ccfea779..0e1c28581 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.cpp @@ -112,7 +112,7 @@ bool ParticipantsDialog::init(LtsSession::LtsSession *session, void ParticipantsDialog::onSelectionChanged() { bool configureAlarms = false; - DEBUG_LOG() << "onSelectionChanged"; + DEBUG_LOG(m_logger) << "onSelectionChanged"; const QModelIndexList currentlySelectedParticipants = m_ui->dvParticipants->selectedRows(); for (const QModelIndex &index : currentlySelectedParticipants) @@ -121,7 +121,7 @@ void ParticipantsDialog::onSelectionChanged() if ((data.equipmentNumber().is_set() && data.equipmentNumber().get() > 0) || m_ppmDtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) configureAlarms = true; - DEBUG_LOG() << "setChildrenSelected row =" << index.row() << " column=" << index.column(); + DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column(); } m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, configureAlarms); @@ -141,7 +141,7 @@ void ParticipantsDialog::onCbPartyChanged() void ParticipantsDialog::onAddButtonClicked() { - DEBUG_LOG() << "onAddButtonClicked"; + DEBUG_LOG(m_logger) << "onAddButtonClicked"; m_participantVector.clear(); m_equipmentVector.clear(); @@ -151,14 +151,14 @@ void ParticipantsDialog::onAddButtonClicked() for (const QModelIndex &index : currentlySelectedParticipants) { - DEBUG_LOG() << "setChildrenSelected: " << index.row() << " column=" << index.column(); + DEBUG_LOG(m_logger) << "setChildrenSelected: " << index.row() << " column=" << index.column(); setChildrenSelected(index); } } QModelIndex participantIndex = m_ui->dvParticipants->currentIndex(); ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(participantIndex); - DEBUG_LOG() << "current participantId = " << data.id(); + DEBUG_LOG(m_logger) << "current participantId = " << data.id(); m_participantVector.push_back(data.id()); const auto partData = m_participantModel->getParticipantData(participantIndex); @@ -186,16 +186,16 @@ void ParticipantsDialog::setChildrenSelected(const QModelIndex &parent) if (m_participantModel->hasChildren(childIndex)) setChildrenSelected(childIndex); - DEBUG_LOG() << "Setting row " + DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected"; ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(childIndex); - DEBUG_LOG() << "append participantId = " << data.id(); + DEBUG_LOG(m_logger) << "append participantId = " << data.id(); m_participantVector.push_back(data.id()); if (data.equipmentNumber().is_set()) { - DEBUG_LOG() << "append equipmentNumber = " << data.equipmentNumber().get(); + DEBUG_LOG(m_logger) << "append equipmentNumber = " << data.equipmentNumber().get(); m_equipmentVector.push_back(data.equipmentNumber().get()); } @@ -211,7 +211,7 @@ void ParticipantsDialog::tableColumnOrganiserSetting() void ParticipantsDialog::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onConfigureAlarmsReply" << replyObject.str(); + DEBUG_LOG(m_logger) << "onConfigureAlarmsReply" << replyObject.str(); m_requestHelper->requestReply(replyObject); } @@ -220,7 +220,7 @@ void ParticipantsDialog::onDoubleClicked() if (!m_buttonBox->isButtonEnabled(LtsWidgets::DialogButton::Edit)) return; - DEBUG_LOG() << "onDoubleClicked"; + DEBUG_LOG(m_logger) << "onDoubleClicked"; onAddButtonClicked(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.h index 881ad367d..0e8bbaae2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_dialog.h @@ -45,6 +45,8 @@ public: const std::shared_ptr &ppmGuiCbxIfc); protected: + +NGL::INGLLogger &m_logger; void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.cpp index ad53b3eea..16a15d10a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.cpp @@ -19,7 +19,7 @@ ParticipantAlarmModel::ParticipantAlarmModel(QObject *parent, { m_titles += tr("Alarm Assignable"); - DEBUG_LOG() << "ParticipantAlarmModel::ParticipantAlarmModel"; + DEBUG_LOG(m_logger) << "ParticipantAlarmModel::ParticipantAlarmModel"; } QVariant ParticipantAlarmModel::data(const QModelIndex &index, int role) const @@ -42,7 +42,7 @@ void ParticipantAlarmModel::onParticipantChanged(const ParticipantManagement::Pa if (data.partyId() != partyId()) return; - INFO_LOG() << "onParticipantChanged isSimulated=" << data.isSimulated(); + INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated(); onReinitModel(partyId()); emit newData(); } @@ -56,7 +56,7 @@ bool ParticipantAlarmModel::isSelectableByAlarm(const QModelIndex &index, bool * m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) isSimulatable = true; - DEBUG_LOG() << "ParticipantId: " << data.id() + DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated() << " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.h index 1a11d4539..4a9941c88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_model.h @@ -21,6 +21,8 @@ signals: void newData(); private: + +NGL::INGLLogger &m_logger; void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType); bool isSelectableByAlarm(const QModelIndex &index, bool *bIsSimulated = nullptr) const; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.cpp index 27b1f3037..cacbf61d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.cpp @@ -23,7 +23,7 @@ ParticipantShowConfigView::ParticipantShowConfigView(LtsSession::LtsSession *ses , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_logger(AlarmManagement::getLogger("ParticipantShowConfigView")) { - DEBUG_LOG() << "--- ParticipantShowConfigView Konstruktor() "; + DEBUG_LOG(m_logger) << "--- ParticipantShowConfigView Konstruktor() "; m_ui->setupUi(this); m_ui->widget->setSelectionMode(QAbstractItemView::SingleSelection); @@ -47,7 +47,7 @@ ParticipantShowConfigView::ParticipantShowConfigView(LtsSession::LtsSession *ses ParticipantShowConfigView::~ParticipantShowConfigView() { - INFO_LOG() << "--- ParticipantShowConfigView Destruktor() "; + INFO_LOG(m_logger) << "--- ParticipantShowConfigView Destruktor() "; delete m_ui; } @@ -62,7 +62,7 @@ bool ParticipantShowConfigView::init(const std::shared_ptr &ppmDtc, const std::shared_ptr &aesDtc) { - INFO_LOG() << "--- init() "; + INFO_LOG(m_logger) << "--- init() "; if (!dtc || !ftc) return false; @@ -71,7 +71,7 @@ bool ParticipantShowConfigView::init(const std::shared_ptrinitModel(dtc, ppmDtc, aesDtc); - DEBUG_LOG() << "--- ParticipantShowConfigView::init "; + DEBUG_LOG(m_logger) << "--- ParticipantShowConfigView::init "; m_configAlarmModel = new AlarmManagement::ConfigAlarmModel(this); m_configAlarmModel->initModel(m_dtc, ppmDtc, m_alarmHistoryModel, false); m_ui->widget->setModel(m_configAlarmModel); @@ -92,7 +92,7 @@ void ParticipantShowConfigView::onSelectionChanged() void ParticipantShowConfigView::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG()<<"onConfigureAlarmsReply"<requestReply(replyObject); } @@ -104,14 +104,14 @@ void ParticipantShowConfigView::tableColumnOrganiserSetting() void ParticipantShowConfigView::onShowAlarm() { - INFO_LOG() << "--- onShowAlarm() "; + INFO_LOG(m_logger) << "--- onShowAlarm() "; } void ParticipantShowConfigView::onRemoveAlarm() { - DEBUG_LOG() << "onRemoveAlarm" + DEBUG_LOG(m_logger) << "onRemoveAlarm" << " id = "<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).id() << " eventTypeId = "<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).eventTypeId() << " operatorId = "<< m_configAlarmModel->getRowData(m_ui->widget->currentIndex().row()).operatorId() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.h index b73411bbf..4c63ad58d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/ConfigParticipantAlarm/alm_participant_show_config.h @@ -42,6 +42,8 @@ private Q_SLOTS: void onPrint(); protected: + +NGL::INGLLogger &m_logger; void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_dialog.cpp index 70627d395..e83efcf58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_dialog.cpp @@ -41,9 +41,9 @@ bool EmergencyCallDialog::init(const std::shared_ptr &opmDtc, LtsSession::LtsSession *session) { - TRACE_LOG() << Q_FUNC_INFO << " START "; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START "; if (!ftc || !dtc || !session){ - ERROR_LOG()<<" init Emergency call dialog failed !!"; + ERROR_LOG(m_logger)<<" init Emergency call dialog failed !!"; return false; } @@ -99,8 +99,8 @@ bool EmergencyCallDialog::init(const std::shared_ptremergencyCallView->hideColumn(EmergencyCallModel::EXPIRED); #endif - INFO_LOG() << "EmergencyCallDialog::init done"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << "EmergencyCallDialog::init done"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -172,14 +172,14 @@ void EmergencyCallDialog::setAcknowledgeUi() void EmergencyCallDialog::onEditBtCliked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const AlmEmergencyCall &sos = getSelectedSOS(); if (sos.id() <= 0) return; setAcknowledgeUi(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -222,7 +222,7 @@ void EmergencyCallDialog::onEmergencyIndexDoubleClicked(const QModelIndex &index void EmergencyCallDialog::sendAcknowledgeEmergency(const QString &comment) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const AlmEmergencyCall &sos = getSelectedSOS(); if (sos.id() <= 0 || sos.expired()) @@ -243,7 +243,7 @@ void EmergencyCallDialog::sendAcknowledgeEmergency(const QString &comment) }); enaDisa(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void EmergencyCallDialog::tableColumnOrganiserSetting() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_info_dialog.cpp index 08436a065..f22ab1894 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_info_dialog.cpp @@ -71,10 +71,10 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr &ftc, const std::shared_ptr &sitMapGuiIfc, const std::shared_ptr&opmDtc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!ftc || !dtc) { - ERROR_LOG()<<" init Emergency call Info dialog failed !!"; + ERROR_LOG(m_logger)<<" init Emergency call Info dialog failed !!"; return false; } @@ -94,7 +94,7 @@ bool EmergencyCallInfoDialog::init(const std::shared_ptr &ftc, connect(m_ui->pbAckEmergency, &QPushButton::clicked, this, &EmergencyCallInfoDialog::onPbAckEmergencyClicked ); connect(m_ui->pbEmergencyCallFindOnMap, &QPushButton::clicked, this, &EmergencyCallInfoDialog::onFindEmergencyOnMap); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -109,10 +109,10 @@ QString EmergencyCallInfoDialog::emergencyIdentifier() const bool EmergencyCallInfoDialog::setUiValues() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_dtc || !m_ftc || m_emergency.id() < 0) { - ERROR_LOG()<<" >> unabled to init EmergencyCallInfoDialog"; + ERROR_LOG(m_logger)<<" >> unabled to init EmergencyCallInfoDialog"; return false; } @@ -133,7 +133,7 @@ bool EmergencyCallInfoDialog::setUiValues() QPixmap iconPixmap = QPixmap::fromImage(renderEmergencySymbol(m_emergency.expired())); m_ui->lblIcon->setPixmap(iconPixmap); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -141,7 +141,7 @@ bool EmergencyCallInfoDialog::setUiValues() void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergencyCall data, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (data.id() != m_emergency.id() || data.id() == 0) return; @@ -157,7 +157,7 @@ void EmergencyCallInfoDialog::onEmergencyCallChanged(AlarmManagement::AlmEmergen setUiValues(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -171,7 +171,7 @@ void EmergencyCallInfoDialog::onFindEmergencyOnMap() void EmergencyCallInfoDialog::onPbAckEmergencyClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; LtsWidgets::LtsFramelessDialog *popup = new LtsWidgets::LtsFramelessDialog(this, LtsWidgets::Behaviour::Popup); LtsWidgets::LtsDialogButtonBox *btnBox = new LtsWidgets::LtsDialogButtonBox(popup); @@ -203,7 +203,7 @@ void EmergencyCallInfoDialog::onPbAckEmergencyClicked() popup->setMinimumWidth(350); popup->show(); le->setFocus(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h index ff7fe601c..2acf75fc1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AlarmManagement/Gui/EmergencyCalls/alm_emergency_call_model.h @@ -40,6 +40,7 @@ public: private slots: void onAlarmEmergencyCallChanged(const AlarmManagement::AlmEmergencyCall &data, const DataModification modType); private: +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; std::shared_ptr m_opmDtc; friend class EmergencyCallProxyModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_charge_effect_item_info.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_charge_effect_item_info.cpp index af5530711..e1e77881e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_charge_effect_item_info.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_charge_effect_item_info.cpp @@ -51,13 +51,13 @@ bool AesChargeEffectItemInfo::init(LtsSession::LtsSession *session) if (!session->getDtc(m_pdmDtc)) { - ERROR_LOG() << " failed to get pdmDtc"; + ERROR_LOG(m_logger) << " failed to get pdmDtc"; return false; } if (!session->getDtc(m_aesDtc)) { - ERROR_LOG() << " failed to get aesDtc"; + ERROR_LOG(m_logger) << " failed to get aesDtc"; return false; } if (!m_aesDtc->isAesItemViewEnabled()) @@ -103,12 +103,12 @@ void AesChargeEffectItemInfo::retranslate() void AesChargeEffectItemInfo::onFindOnMap() const { - DEBUG_LOG() << "onFindOnMap() aesId: "< ifc; if (m_session->getForeignGuiInterface(ifc)) ifc->centerMapToChargeEffectObject(m_ChargeEffectId); else - WARNING_LOG() << Q_FUNC_INFO << "getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface failed!"; } template @@ -125,13 +125,13 @@ bool AesChargeEffectItemInfo::tryShowStandardEditDialog(const AesItemView& aiv) return true; } - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed for specific AES interface!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed for specific AES interface!"; return false; } void AesChargeEffectItemInfo::onShowDetails() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; const ChargeEffect item = m_aesDtc->chargeEffect(m_ChargeEffectId); @@ -139,7 +139,7 @@ void AesChargeEffectItemInfo::onShowDetails() { AesItemView aiv; m_aesDtc->aesItemViewFromEntityId(item.originatorId(), AreaEffectSimulation::AesType::AtUnknown, aiv); - DEBUG_LOG() << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId(); + DEBUG_LOG(m_logger) << "aiv.id():" << aiv.id() << ", aesType: " << aiv.aesTypeId(); auto registerDialog = [this](AreaEffectSimulation::BaseEdit* dialog) { @@ -200,7 +200,7 @@ void AesChargeEffectItemInfo::onShowDetails() registerDialog(ifc->showEditWindow(aiv.aesItemId(), true, this)); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtBoobyTrap: @@ -210,7 +210,7 @@ void AesChargeEffectItemInfo::onShowDetails() if (m_session->getForeignGuiInterface(ifc)) registerDialog(ifc->showBoobyTrapEditWindow(aiv.aesItemId(), this)); else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtOffRouteMine: @@ -220,7 +220,7 @@ void AesChargeEffectItemInfo::onShowDetails() if (m_session->getForeignGuiInterface(ifc)) registerDialog(ifc->showOffRouteMineEditWindow(aiv.aesItemId(), this)); else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtExplosionSingle: @@ -244,7 +244,7 @@ void AesChargeEffectItemInfo::onShowDetails() } } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } @@ -260,7 +260,7 @@ void AesChargeEffectItemInfo::onShowDetails() registerDialog(ifc->showEditWindow(aiv.aesItemId(), ai.effectSourceId(), this)); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } @@ -283,10 +283,10 @@ void AesChargeEffectItemInfo::onShowDetails() break; case AreaEffectSimulation::AesType::AtUnknown: Q_ASSERT(false); - WARNING_LOG() << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId(); + WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << aiv.aesTypeId(); break; default: - DEBUG_LOG() << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button"; + DEBUG_LOG(m_logger) << "Couldn't find AesItem to ChargeEffect (any more). Hiding the button"; m_ui->pbDetails->hide(); break; } @@ -302,13 +302,13 @@ void AesChargeEffectItemInfo::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface ChargeEffect failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface ChargeEffect failed!"; } } void AesChargeEffectItemInfo::onChargeEffectChanged(const ChargeEffect &data, DataModification modType) { - DEBUG_LOG() << " [onChargeEffectChanged] id: " << data.id(); + DEBUG_LOG(m_logger) << " [onChargeEffectChanged] id: " << data.id(); if (data.id() == m_ChargeEffectId && modType != DataModification::eRemoved) handleChargeEffect(data); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_danger_area_aes_item_info.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_danger_area_aes_item_info.cpp index 5a94b9f55..2780a269f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_danger_area_aes_item_info.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_danger_area_aes_item_info.cpp @@ -99,12 +99,12 @@ bool DangerAreaAesItemInfo::init(LtsSession::LtsSession *session) { if (m_session && session) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } if (!m_session && !session) { - ERROR_LOG() << "No Session available!"; + ERROR_LOG(m_logger) << "No Session available!"; return false; } if (!m_session) @@ -129,7 +129,7 @@ void DangerAreaAesItemInfo::insertAesItem(int aesItemId) } delete item; - WARNING_LOG() << "AesItem with id " << aesItemId << " is not of any known type!"; + WARNING_LOG(m_logger) << "AesItem with id " << aesItemId << " is not of any known type!"; } void DangerAreaAesItemInfo::setText() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.cpp index e73eabf04..2fc5ceb87 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.cpp @@ -47,7 +47,7 @@ AesInfoDialog::AesInfoDialog(int aesEntityId, AesType aesType, QWidget *parent) , m_ui(new Ui::AesInfoDialog) , m_requestHelper(new LtsUtils::RequestHelper(this)) { - DEBUG_LOG() << "ctor AesInfoDialog() "; + DEBUG_LOG(m_logger) << "ctor AesInfoDialog() "; m_ui->setupUi(this); m_ui->lblAesId->setText(QString::number(aesEntityId)); @@ -80,7 +80,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) if (aesItemView.aesItemId() != m_aesEntityId) return false; - DEBUG_LOG() << "AesItemView found for aesEntityId: " << m_aesEntityId + DEBUG_LOG(m_logger) << "AesItemView found for aesEntityId: " << m_aesEntityId << " AesItemView.aesTypeId(): " << aesItemView.aesTypeId(); if (aesItemView.aesTypeId() != m_aesType) @@ -94,7 +94,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleNContamination(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::nContaminationChanged, this, &AesInfoDialog::onNContaminationChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::NContaminationChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::NContaminationChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-N-Contamination")); break; } @@ -102,7 +102,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleBCContamination(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::bCContaminationChanged, this, &AesInfoDialog::onBCContaminationChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::bCContaminationChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::bCContaminationChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-C-Contamination")); break; } @@ -111,7 +111,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleBoobyTrap(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::boobyTrapChanged, this, &AesInfoDialog::onBoobyTrapChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::boobyTrapChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::boobyTrapChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-BoobyTrap")); break; } @@ -120,7 +120,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleOffRouteMine(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::offRouteMineChanged, this, &AesInfoDialog::onOffRouteMineChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::offRouteMineChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::offRouteMineChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-OffRouteMine")); break; } @@ -128,7 +128,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleExplosionArea(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionAreaChanged, this, &AesInfoDialog::onExplosionAreaChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::explosionAreaChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::explosionAreaChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Area_Artillery")); break; } @@ -136,7 +136,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleExplosionSingle(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionSingleChanged, this, &AesInfoDialog::onExplosionSingleChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::explosionSingleChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::explosionSingleChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Single_Artillery")); break; } @@ -144,7 +144,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleMineArea(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::mineAreaChanged, this, &AesInfoDialog::onMineAreaChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::mineAreaChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::mineAreaChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Mine_Area")); break; } @@ -152,7 +152,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleMineCorridor(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::mineCorridorChanged, this, &AesInfoDialog::onMineCorridorChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::mineCorridorChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::mineCorridorChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Mine_Corridor")); break; } @@ -160,7 +160,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleGasPipe(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::gasPipeChanged, this, &AesInfoDialog::onGasPipeChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::gasPipeChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::gasPipeChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Gas_Pipeline")); break; } @@ -168,7 +168,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleDangerArea(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::dangerAreaChanged, this, &AesInfoDialog::onDangerAreaChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::dangerAreaChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::dangerAreaChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Danger_Area")); break; } @@ -176,7 +176,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleBorderline(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::borderlineChanged, this, &AesInfoDialog::onBorderlineChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::borderlineChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::borderlineChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Borderline")); @@ -196,7 +196,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleFunctionalArea(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::functionalAreaChanged, this, &AesInfoDialog::onFunctionalAreaChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::functionalAreaChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::functionalAreaChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Functional_Area")); break; } @@ -204,7 +204,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleAirSupportImpact(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::airSupportImpactChanged, this, &AesInfoDialog::onAirSupportImpactChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::airSupportImpactChanged for aesEntityId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "connect AreaEffectSimulation::Interface::Dtc::airSupportImpactChanged for aesEntityId: " << m_aesEntityId; setOnlineHelpFilename(QStringLiteral("Info_Dialog-Aerial_Ordnance")); break; } @@ -212,7 +212,7 @@ bool AesInfoDialog::cbFunc(const AreaEffectSimulation::AesItemView &aesItemView) { handleExplosionCluster(aesItemView); connect(m_dtc.get(), &AreaEffectSimulation::Interface::Dtc::explosionClusterChanged, this, &AesInfoDialog::onExplosionClusterChanged); - DEBUG_LOG() << "connect AreaEffectSimulation::Interface::Dtc::ExplosionCluster for aesEntityId: "<nContamination(m_aesEntityId)); @@ -317,7 +317,7 @@ void AesInfoDialog::handleNContamination(const AesItemView &aesItemView) void AesInfoDialog::handleNContamination(const AreaEffectSimulation::NContamination &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::NContamination)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::NContamination)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtNContamination); @@ -331,7 +331,7 @@ void AesInfoDialog::handleNContamination(const AreaEffectSimulation::NContaminat void AesInfoDialog::handleBCContamination(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleBCContamination(m_dtc->bCContamination(m_aesEntityId)); @@ -340,7 +340,7 @@ void AesInfoDialog::handleBCContamination(const AesItemView &aesItemView) void AesInfoDialog::handleBCContamination(const AreaEffectSimulation::BCContamination &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::BCContamination)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BCContamination)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtBCContamination); @@ -356,7 +356,7 @@ void AesInfoDialog::handleBCContamination(const AreaEffectSimulation::BCContamin void AesInfoDialog::handleBoobyTrap(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleBoobyTrap(m_dtc->boobyTrap(m_aesEntityId)); @@ -365,7 +365,7 @@ void AesInfoDialog::handleBoobyTrap(const AesItemView &aesItemView) void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::BoobyTrap)" << " data.id(): " << data.id(); handleAesItem(data, AesType_def::AtBoobyTrap); @@ -386,7 +386,7 @@ void AesInfoDialog::handleBoobyTrap(const AreaEffectSimulation::BoobyTrap &data) void AesInfoDialog::handleOffRouteMine(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleOffRouteMine(m_dtc->offRouteMine(m_aesEntityId)); @@ -395,7 +395,7 @@ void AesInfoDialog::handleOffRouteMine(const AesItemView &aesItemView) void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::OffRouteMine)" << " data.id(): " << data.id(); handleAesItem(data, AesType_def::AtOffRouteMine); @@ -416,7 +416,7 @@ void AesInfoDialog::handleOffRouteMine(const AreaEffectSimulation::OffRouteMine void AesInfoDialog::handleExplosionArea(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleExplosionArea(m_dtc->explosionArea(m_aesEntityId)); @@ -425,7 +425,7 @@ void AesInfoDialog::handleExplosionArea(const AesItemView &aesItemView) void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionArea &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtExplosionArea); @@ -448,7 +448,7 @@ void AesInfoDialog::handleExplosionArea(const AreaEffectSimulation::ExplosionAre void AesInfoDialog::handleExplosionSingle(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleExplosionSingle(m_dtc->explosionSingle(m_aesEntityId)); } @@ -456,7 +456,7 @@ void AesInfoDialog::handleExplosionSingle(const AesItemView &aesItemView) void AesInfoDialog::handleExplosionSingle(const AreaEffectSimulation::ExplosionSingle &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionSingle)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionSingle)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtExplosionSingle); @@ -472,7 +472,7 @@ void AesInfoDialog::handleExplosionSingle(const AreaEffectSimulation::ExplosionS void AesInfoDialog::handleMineArea(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleMineArea(m_dtc->mineArea(m_aesEntityId)); } @@ -480,7 +480,7 @@ void AesInfoDialog::handleMineArea(const AesItemView &aesItemView) void AesInfoDialog::handleMineArea(const AreaEffectSimulation::MineArea &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtMineArea); @@ -504,7 +504,7 @@ void AesInfoDialog::handleMineArea(const AreaEffectSimulation::MineArea &data) void AesInfoDialog::handleMineCorridor(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleMineCorridor(m_dtc->mineCorridor(m_aesEntityId)); } @@ -512,7 +512,7 @@ void AesInfoDialog::handleMineCorridor(const AesItemView &aesItemView) void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::MineArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtMineCorridor); @@ -530,7 +530,7 @@ void AesInfoDialog::handleMineCorridor(const AreaEffectSimulation::MineCorridor void AesInfoDialog::handleGasPipe(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " handleGasPipe: aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleGasPipe(m_dtc->gasPipe(m_aesEntityId)); } @@ -538,7 +538,7 @@ void AesInfoDialog::handleGasPipe(const AesItemView &aesItemView) void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::GasPipe)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::GasPipe)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtGasPipe); @@ -555,7 +555,7 @@ void AesInfoDialog::handleGasPipe(const AreaEffectSimulation::GasPipe &data) void AesInfoDialog::handleDangerArea(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleDangerArea(m_dtc->dangerArea(m_aesEntityId)); } @@ -563,7 +563,7 @@ void AesInfoDialog::handleDangerArea(const AesItemView &aesItemView) void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::DangerArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::DangerArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtDangerArea); @@ -586,7 +586,7 @@ void AesInfoDialog::handleDangerArea(const AreaEffectSimulation::DangerArea &dat void AesInfoDialog::handleBorderline(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleBorderline(m_dtc->borderline(m_aesEntityId)); } @@ -594,7 +594,7 @@ void AesInfoDialog::handleBorderline(const AesItemView &aesItemView) void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::Borderline)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::Borderline)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtBorderline); @@ -614,7 +614,7 @@ void AesInfoDialog::handleBorderline(const AreaEffectSimulation::Borderline &dat void AesInfoDialog::handleFunctionalArea(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleFunctionalArea(m_dtc->functionalArea(m_aesEntityId)); } @@ -623,7 +623,7 @@ void AesInfoDialog::handleFunctionalArea(const AesItemView &aesItemView) void AesInfoDialog::handleFunctionalArea(const FunctionalArea &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtFunctionalArea); @@ -661,7 +661,7 @@ void AesInfoDialog::handleFunctionalArea(const FunctionalArea &data) void AesInfoDialog::handleAirSupportImpact(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleAirSupportImpact(m_dtc->airSupportImpact(m_aesEntityId)); } @@ -670,7 +670,7 @@ void AesInfoDialog::handleAirSupportImpact(const AesItemView &aesItemView) void AesInfoDialog::handleAirSupportImpact(const AirSupportImpact &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::FunctionalArea)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtAirSupportImpact); @@ -861,14 +861,14 @@ void AesInfoDialog::handleSingleDusMine() void AesInfoDialog::handleExplosionCluster(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleExplosionCluster(m_dtc->explosionCluster(m_aesEntityId)); } void AesInfoDialog::handleExplosionCluster(const ExplosionCluster &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionCluster)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::ExplosionCluster)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtExplosionCluster); @@ -882,14 +882,14 @@ void AesInfoDialog::handleExplosionCluster(const ExplosionCluster &data) void AesInfoDialog::handleEffectCluster(const AesItemView &aesItemView) { - DEBUG_LOG() << Q_FUNC_INFO << "(AesItemView)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AesItemView)" << " aesItemView.aesItemId(): " << aesItemView.aesItemId(); handleEffectCluster(m_dtc->effectCluster(m_aesEntityId)); } void AesInfoDialog::handleEffectCluster(const EffectCluster &data) { - DEBUG_LOG() << Q_FUNC_INFO << "(AreaEffectSimulation::EffectCluster)" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "(AreaEffectSimulation::EffectCluster)" << " data.id(): " << data.id(); handleAesItem(data, AesType::AtEffectCluster); @@ -954,18 +954,18 @@ void AesInfoDialog::handleAesItem(const AesItem &aesData, AesType aesTypeId) void AesInfoDialog::onFindOnMap() { - DEBUG_LOG() << "onFindOnMap()"; + DEBUG_LOG(m_logger) << "onFindOnMap()"; std::shared_ptr ifc; if (m_session->getForeignGuiInterface(ifc)) ifc->centerMapToAesObject(m_aesEntityId); else - WARNING_LOG() << Q_FUNC_INFO << "getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface failed!"; } void AesInfoDialog::onShowDetails() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; switch (m_aesType.underlying()) { @@ -979,7 +979,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtBCContamination: @@ -1005,7 +1005,7 @@ void AesInfoDialog::onShowDetails() } } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtBoobyTrap: @@ -1020,7 +1020,7 @@ void AesInfoDialog::onShowDetails() break; } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtOffRouteMine: @@ -1035,7 +1035,7 @@ void AesInfoDialog::onShowDetails() break; } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtExplosionSingle: @@ -1058,7 +1058,7 @@ void AesInfoDialog::onShowDetails() break; } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtExplosionArea: @@ -1080,7 +1080,7 @@ void AesInfoDialog::onShowDetails() } } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtExplosionCluster: @@ -1095,7 +1095,7 @@ void AesInfoDialog::onShowDetails() break; } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtMineArea: @@ -1108,7 +1108,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtMineCorridor: @@ -1121,7 +1121,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtGasPipe: @@ -1134,7 +1134,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtDangerArea: @@ -1147,7 +1147,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtBorderline: @@ -1160,7 +1160,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtFunctionalArea: @@ -1173,7 +1173,7 @@ void AesInfoDialog::onShowDetails() addDialog(dialog, dialog->menuGroup(), dialog->dialogIdentifier(), LtsWidgets::LayoutArea::eDialogTab); } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface failed!"; break; } case AreaEffectSimulation::AesType::AtAirSupportImpact: @@ -1191,7 +1191,7 @@ void AesInfoDialog::onShowDetails() break; case AreaEffectSimulation::AesType::AtUnknown: Q_ASSERT(false); - WARNING_LOG() << "Unknown AesType found for aesEntityId: " << m_aesEntityId; + WARNING_LOG(m_logger) << "Unknown AesType found for aesEntityId: " << m_aesEntityId; break; default: break; @@ -1204,7 +1204,7 @@ bool AesInfoDialog::onResetDusMines() { if (m_aesType == AreaEffectSimulation::AesType_def::AtMineAreaSingleMines) { - DEBUG_LOG() << "onResetDusMines() AtMineAreaSingleMines mineId: " << m_aesEntityId; + DEBUG_LOG(m_logger) << "onResetDusMines() AtMineAreaSingleMines mineId: " << m_aesEntityId; MineResetRequest req(0, {m_aesEntityId}); return m_requestHelper->startSingleRequest([req, this]() @@ -1225,7 +1225,7 @@ bool AesInfoDialog::onResetDusMines() void AesInfoDialog::onNContaminationChanged(const AreaEffectSimulation::NContamination &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleNContamination(data); } @@ -1233,7 +1233,7 @@ void AesInfoDialog::onNContaminationChanged(const AreaEffectSimulation::NContami void AesInfoDialog::onBCContaminationChanged(const AreaEffectSimulation::BCContamination &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleBCContamination(data); } @@ -1241,7 +1241,7 @@ void AesInfoDialog::onBCContaminationChanged(const AreaEffectSimulation::BCConta void AesInfoDialog::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleBoobyTrap(data); } @@ -1249,7 +1249,7 @@ void AesInfoDialog::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &da void AesInfoDialog::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMine &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleOffRouteMine(data); } @@ -1257,7 +1257,7 @@ void AesInfoDialog::onOffRouteMineChanged(const AreaEffectSimulation::OffRouteMi void AesInfoDialog::onExplosionAreaChanged(const AreaEffectSimulation::ExplosionArea &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleExplosionArea(data); } @@ -1265,7 +1265,7 @@ void AesInfoDialog::onExplosionAreaChanged(const AreaEffectSimulation::Explosion void AesInfoDialog::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleExplosionSingle(data); } @@ -1273,7 +1273,7 @@ void AesInfoDialog::onExplosionSingleChanged(const AreaEffectSimulation::Explosi void AesInfoDialog::onMineAreaChanged(const AreaEffectSimulation::MineArea &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleMineArea(data); } @@ -1281,7 +1281,7 @@ void AesInfoDialog::onMineAreaChanged(const AreaEffectSimulation::MineArea &data void AesInfoDialog::onMineCorridorChanged(const MineCorridor &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleMineCorridor(data); } @@ -1289,7 +1289,7 @@ void AesInfoDialog::onMineCorridorChanged(const MineCorridor &data, DataModifica void AesInfoDialog::onGasPipeChanged(const GasPipe &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleGasPipe(data); } @@ -1297,7 +1297,7 @@ void AesInfoDialog::onGasPipeChanged(const GasPipe &data, DataModification modTy void AesInfoDialog::onDangerAreaChanged(const AreaEffectSimulation::DangerArea &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleDangerArea(data); } @@ -1305,7 +1305,7 @@ void AesInfoDialog::onDangerAreaChanged(const AreaEffectSimulation::DangerArea & void AesInfoDialog::onBorderlineChanged(const AreaEffectSimulation::Borderline &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleBorderline(data); } @@ -1313,7 +1313,7 @@ void AesInfoDialog::onBorderlineChanged(const AreaEffectSimulation::Borderline & void AesInfoDialog::onFunctionalAreaChanged(const FunctionalArea &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleFunctionalArea(data); } @@ -1321,7 +1321,7 @@ void AesInfoDialog::onFunctionalAreaChanged(const FunctionalArea &data, DataModi void AesInfoDialog::onAirSupportImpactChanged(const AirSupportImpact &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleAirSupportImpact(data); } @@ -1329,7 +1329,7 @@ void AesInfoDialog::onAirSupportImpactChanged(const AirSupportImpact &data, Data void AesInfoDialog::onDusMineStateChanged(const DusMineState &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (modType == DataModification::eRemoved) return; @@ -1356,7 +1356,7 @@ void AesInfoDialog::onDusMineStateChanged(const DusMineState &data, DataModifica void AesInfoDialog::onDusSingleMineChanged(const DusSingleMine &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleSingleDusMine(); } @@ -1364,14 +1364,14 @@ void AesInfoDialog::onDusSingleMineChanged(const DusSingleMine &data, DataModifi void AesInfoDialog::onExplosionClusterChanged(const ExplosionCluster &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " id: " << data.id(); + 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() << Q_FUNC_INFO << " id: " << data.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: " << data.id(); if (data.id() == m_aesEntityId && modType != DataModification::eRemoved) handleEffectCluster(data); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h index 4ee4c0a34..679aeae28 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/AesInfo/aes_info_dialog.h @@ -44,6 +44,7 @@ public: void onMineResetReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + NGL::INGLLogger &m_logger; void retranslate() override; void handleNContamination(const AesItemView &aesItemView); @@ -108,6 +109,7 @@ private Q_SLOTS: void onEffectClusterChanged(const EffectCluster &data, DataModification modType); private: + NGL::INGLLogger &m_logger; int m_aesEntityId; QString m_aesEntityName; AreaEffectSimulation::AesType m_aesType; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.cpp index d4edabd75..a54bd2a40 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_edit.cpp @@ -297,7 +297,7 @@ bool BaseEdit::init(int aesItemId, LtsSession::LtsSession *session) { if (m_session) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } m_session = session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.cpp index d5462561b..adc4960c1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_base_model.cpp @@ -31,7 +31,7 @@ bool AesGuiBasHelpers::initModel(LtsSession::LtsSession *session) { if (m_aesDtc) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.cpp index f1be1bce0..e1ca19483 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/Base/aes_itemlist.cpp @@ -50,7 +50,7 @@ bool AesItemList::init(LtsSession::LtsSession *session) { if (m_session) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } m_session = session; @@ -170,7 +170,7 @@ void AesItemList::onAdlerBtn() AesEffectState aesEffectState = model()->aesEffectStateId(currentRow()); ProjectDataManagement::EffectSource effectSource = model()->aesEffectSourceId(currentRow()); - DEBUG_LOG() << "onAdlerBtn aesEffectState=" << aesEffectState; + DEBUG_LOG(m_logger) << "onAdlerBtn aesEffectState=" << aesEffectState; switch (aesEffectState.underlying()) { @@ -208,7 +208,7 @@ void AesItemList::onAdlerBtn() AreaEffectSimulation::SetAesItemEffectorStateRequest req; req.aesId(model()->aesId(currentRow())); req.newEffectorState(AesEffectorState::EsReadyToFire); - DEBUG_LOG() << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId() << ", AesEffectorState: " << req.newEffectorState(); + DEBUG_LOG(m_logger) << "Send setAesItemEffectorStateRequest with aesId: " << req.aesId() << ", AesEffectorState: " << req.newEffectorState(); m_requestHelper->startSingleRequest([req, this]() { return m_ftc->setAesItemEffectorStateRequest(req, this); }); } @@ -223,7 +223,7 @@ void AesItemList::onAdlerBtn() void AesItemList::onHandleAdler() { AesEffectState aesEffectState = model()->aesEffectStateId(currentRow()); - DEBUG_LOG() << "onHandleAdler aesEffectState=" << aesEffectState; + DEBUG_LOG(m_logger) << "onHandleAdler aesEffectState=" << aesEffectState; auto *adlerBtn = m_buttonBox->getButton(ADLER_BTN); switch (aesEffectState.underlying()) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_list.cpp index 110b33e6d..6daae0906 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_list.cpp @@ -61,7 +61,7 @@ bool ChargeAdministrationAdlerList::init(LtsSession::LtsSession *session) { if (m_session) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } m_session = session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_model.cpp index 70d7cdef7..2d8a1d093 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_adler_model.cpp @@ -79,7 +79,7 @@ bool ChargeAdministrationAdlerModel::initModel(LtsSession::LtsSession *session) QMap parties; if (!m_ppmDtc->visibleParties(parties, LtsSessionData::LtsSessionData::getInstance()->getVisibleParties(session->exerciseId()))) { - DEBUG_LOG() << "Could not retrieve visible Parties!"; + DEBUG_LOG(m_logger) << "Could not retrieve visible Parties!"; return false; } @@ -104,7 +104,7 @@ void ChargeAdministrationAdlerModel::onStateChanged(const ParticipantManagement: case DataModification::eAdded: case DataModification::eModified: { - DEBUG_LOG() << "+++++++++ DataModification --> " << modType; + DEBUG_LOG(m_logger) << "+++++++++ DataModification --> " << modType; updateParticipantChargeTypeMap(data); updateItem(m_ppmDtc->participant(data.participantId()).partyId()); @@ -188,10 +188,10 @@ void ChargeAdministrationAdlerModel::updateItem(int partyId) { if (participantCharges.partyId != partyId) continue; - DEBUG_LOG() << "+++++++++ ParticipantId -> " << participantCharges.participantId << ", sampleTime ->" << sampleTime; + DEBUG_LOG(m_logger) << "+++++++++ ParticipantId -> " << participantCharges.participantId << ", sampleTime ->" << sampleTime; for (auto it = participantCharges.chargeTypeTotalStockMap.cbegin(), end = participantCharges.chargeTypeTotalStockMap.cend(); it != end; ++it) { - DEBUG_LOG() << "+++++++++ chargeRemain ->" << it.key() << ": " << it.value().remain + DEBUG_LOG(m_logger) << "+++++++++ chargeRemain ->" << it.key() << ": " << it.value().remain << it.value().lastUpdate; GearData data; data.lastUpdate = it.value().lastUpdate; @@ -211,7 +211,7 @@ void ChargeAdministrationAdlerModel::updateItem(int partyId) item.partyId = partyId; for (auto gearData = chargeTypeGearData.cbegin(), end = chargeTypeGearData.cend(); gearData != end; ++gearData) { - DEBUG_LOG() << "### PartyId " << item.partyId << " insert item -> chargeTypeId: " << gearData.key() << ", amount: " << gearData.value().remain + DEBUG_LOG(m_logger) << "### PartyId " << item.partyId << " insert item -> chargeTypeId: " << gearData.key() << ", amount: " << gearData.value().remain << ", lastUpdate:" << gearData.value().lastUpdate; item.chargeTypeId = gearData.key(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_list.cpp index 0673c8a9e..07f81e77b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_list.cpp @@ -69,7 +69,7 @@ bool ChargeAdministrationList::init(LtsSession::LtsSession *session) { if (m_session) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } m_session = session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_model.cpp index ab5f0bb03..d818059ab 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AreaEffectSimulation/Gui/ChargeAdministration/aes_charge_administration_model.cpp @@ -66,7 +66,7 @@ bool ChargeAdministrationModel::initModel(LtsSession::LtsSession *session, QVect { if (m_aesDtc) { - ERROR_LOG() << "double init()!"; + ERROR_LOG(m_logger) << "double init()!"; return false; } @@ -101,7 +101,7 @@ bool ChargeAdministrationModel::initModel(LtsSession::LtsSession *session, QVect QMap parties; if (!ppmDtc->visibleParties(parties, LtsSessionData::LtsSessionData::getInstance()->getVisibleParties(session->exerciseId()))) { - ERROR_LOG() << "Could not retrieve visible Parties!"; + ERROR_LOG(m_logger) << "Could not retrieve visible Parties!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.cpp index b503b2518..c868fedb4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.cpp @@ -70,12 +70,12 @@ bool AsmEditTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, m_session = session; if (!m_session->getDtc(m_asmDtc)) { - ERROR_LOG() << "AsmEditTrainingAreaDialog::init() Could not enable DTC from ASM"; + ERROR_LOG(m_logger) << "AsmEditTrainingAreaDialog::init() Could not enable DTC from ASM"; return false; } if(!m_session->getFtc(m_asmFtc)) { - ERROR_LOG() << "AsmEditTrainingAreaDialog::init() Could not enable FTC from ASM"; + ERROR_LOG(m_logger) << "AsmEditTrainingAreaDialog::init() Could not enable FTC from ASM"; return false; } m_asmFtc->enableTrainingAreaRemove(true); @@ -85,7 +85,7 @@ bool AsmEditTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, if (!sitMapGuiIfc) { - ERROR_LOG() << Q_FUNC_INFO << " Invalid shared_ptr sitMapGuiIfc!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Invalid shared_ptr sitMapGuiIfc!"; return false; } @@ -93,7 +93,7 @@ bool AsmEditTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, AssetManagement::TrainingArea ta = AssetManagement::TrainingArea(); if(trainingAreaId == 0) { - DEBUG_LOG() << Q_FUNC_INFO << " New training area "; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " New training area "; ta.id() = 0; ta.name() = QStringLiteral("newArea").toStdString(); ta.width() = 12800; @@ -105,12 +105,12 @@ bool AsmEditTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, ta = m_asmDtc->trainingArea(trainingAreaId); if(ta.id()<= 0) { - ERROR_LOG() << Q_FUNC_INFO << " training area not valid id: "<< trainingAreaId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " training area not valid id: "<< trainingAreaId; return false; } m_dialogTitle = tr("Edit Training Area: %1").arg(QString::fromStdString(ta.name())); - DEBUG_LOG() << Q_FUNC_INFO << " edit training area " <getCoordinate(this, SLOT(onCoordinate(QPointF)), nullptr); break; case SituationMap::MapMode::Undefined: - ERROR_LOG() << Q_FUNC_INFO << " ModeMode == Undefined "; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " ModeMode == Undefined "; break; } @@ -202,7 +202,7 @@ void AsmEditTrainingAreaDialog::onRectData(const QPointF ¢erPoint, double wi m_trainingArea.width() = width; m_trainingArea.bottomLeft() = convert(btmLeft); - DEBUG_LOG() << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; + DEBUG_LOG(m_logger) << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; showPreviewObject(); } @@ -235,7 +235,7 @@ void AsmEditTrainingAreaDialog::onCoordinate(const QPointF ¢erPoint) m_trainingArea.width() = width; m_trainingArea.bottomLeft() = convert(btmLeft); - DEBUG_LOG() << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; + DEBUG_LOG(m_logger) << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; showPreviewObject(); @@ -245,10 +245,10 @@ void AsmEditTrainingAreaDialog::onCoordinate(const QPointF ¢erPoint) void AsmEditTrainingAreaDialog::onEditClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START Editing.."; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START Editing.."; if (!m_sitMapGuiIfc || m_trainingArea.id() < 0) { - ERROR_LOG() << "onEditClicked: sitMapGuiIfc or trainingArea_id: "<sbWidth->value(), m_ui->sbHeight->value()); - TRACE_LOG() << Q_FUNC_INFO << " END Edit"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END Edit"; onSelectionChanged(); @@ -279,7 +279,7 @@ void AsmEditTrainingAreaDialog::showPreviewObject() { if (!m_sitMapGuiIfc || m_previewPolygon.size() == 0) { - TRACE_LOG() << " AsmEditTrainingAreaDialog::showPreviewObject(): m_sitMapGuiIfc invalid or polygon empty "; + TRACE_LOG(m_logger) << " AsmEditTrainingAreaDialog::showPreviewObject(): m_sitMapGuiIfc invalid or polygon empty "; return; } m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); @@ -292,7 +292,7 @@ QPointF AsmEditTrainingAreaDialog::getCentPos(TrainingArea ta) ta.bottomLeft().lat()); QPointF centerPoint = utmCoordinate.geographic((ta.width() / 2.0), ta.height() / 2.0); - TRACE_LOG() << Q_FUNC_INFO << " coord: x: "<< centerPoint.x() <<" y: "<< centerPoint.y(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " coord: x: "<< centerPoint.x() <<" y: "<< centerPoint.y(); return centerPoint; } @@ -306,7 +306,7 @@ bool AsmEditTrainingAreaDialog::apply() if(!m_asmFtc) { - ERROR_LOG() << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; return false; } double height = m_ui->sbHeight->value(); @@ -325,7 +325,7 @@ bool AsmEditTrainingAreaDialog::apply() return m_asmFtc->trainingAreaModifyRequest(req, this); }); - TRACE_LOG() << Q_FUNC_INFO << " scucess=" << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " scucess=" << success; return success; } @@ -346,7 +346,7 @@ QPolygonF AsmEditTrainingAreaDialog::getTrainingArea(const TrainingArea &ta) QPolygonF polygonF; if(!m_asmDtc) { - ERROR_LOG() << " m_asmDtc is not valid!"; + ERROR_LOG(m_logger) << " m_asmDtc is not valid!"; return{}; } AssetManagement::TrainingArea ddsTrainingArea = ta; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.h index 376668eb3..9903c7554 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_edit_training_area_dialog.h @@ -48,6 +48,7 @@ private slots: void onEditClicked(); void onSelectionChanged(); private: + NGL::INGLLogger &m_logger; void retranslate() override; void onTrainingAreaModifyReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } void onTrainingAreaRemoveReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.cpp index 5d5610f96..cacc4a78c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.cpp @@ -63,19 +63,19 @@ bool AsmTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, const s if (!m_session->getDtc(m_asmDtc)) { - ERROR_LOG() << "Could not enable DTC from ASM"; + ERROR_LOG(m_logger) << "Could not enable DTC from ASM"; return false; } if(!m_session->getFtc(m_asmFtc)) { - ERROR_LOG() << "Could not enable FTC from ASM"; + ERROR_LOG(m_logger) << "Could not enable FTC from ASM"; return false; } m_sitMapGuiIfc = sitMapGuiIfc; if(!m_sitMapGuiIfc) { - ERROR_LOG() << "m_sitMapGuiIfc is invalid "; + ERROR_LOG(m_logger) << "m_sitMapGuiIfc is invalid "; return false; } bool bRet = true; @@ -86,11 +86,11 @@ bool AsmTrainingAreaDialog::init(LtsSession::LtsSessionDataDds *session, const s if(!bRet) { - ERROR_LOG() << "Could not enable dtc or ftc from ASM"; + ERROR_LOG(m_logger) << "Could not enable dtc or ftc from ASM"; return false; } - INFO_LOG() << "Ftc && Dtc enabled from ASM"; + INFO_LOG(m_logger) << "Ftc && Dtc enabled from ASM"; delete m_model; m_model = new AsmTrainingAreaDialogModel(this); @@ -134,12 +134,12 @@ void AsmTrainingAreaDialog::onAddTrainingArea() addDialog(dialog, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab); } - TRACE_LOG() << Q_FUNC_INFO << " adding temp training Area "; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " adding temp training Area "; } void AsmTrainingAreaDialog::onRemoveTrainingArea() { - TRACE_LOG() << Q_FUNC_INFO << " START" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" ; QModelIndexList indexList = m_ui->trainingAreaView->selectedRows(); if (indexList.size() == 0) return; @@ -147,7 +147,7 @@ void AsmTrainingAreaDialog::onRemoveTrainingArea() TrainingArea req = m_model->getRowData(indexList.front().row()); if (req.id() < 0) { - ERROR_LOG() << Q_FUNC_INFO << " invalid id:bt"<< req.id(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " invalid id:bt"<< req.id(); return; } if (!m_viewedTaIds.contains(req.id())) @@ -157,7 +157,7 @@ void AsmTrainingAreaDialog::onRemoveTrainingArea() return m_asmFtc->trainingAreaRemoveRequest(TrainingAreaRemoveRequest(req.id()), this); }); - TRACE_LOG() << Q_FUNC_INFO << " success = " << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " success = " << success; } else { @@ -165,7 +165,7 @@ void AsmTrainingAreaDialog::onRemoveTrainingArea() tr("Cannot remove currently edited Training Area")); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void AsmTrainingAreaDialog::onEditTrainingArea() @@ -176,7 +176,7 @@ void AsmTrainingAreaDialog::onEditTrainingArea() TrainingArea taItem = m_model->getRowData(indexList.front().row()); if (taItem.id() < 0) { - ERROR_LOG() << "onEditTrainingArea invalid id = "<< taItem.id(); + ERROR_LOG(m_logger) << "onEditTrainingArea invalid id = "<< taItem.id(); return; } @@ -205,16 +205,16 @@ void AsmTrainingAreaDialog::onEditTrainingArea() void AsmTrainingAreaDialog::onSelectionChanged() { enaDisa(); - DEBUG_LOG() << "onSelectionChanged() called !"; + DEBUG_LOG(m_logger) << "onSelectionChanged() called !"; const QModelIndex curIdx = m_ui->trainingAreaView->currentIndex(); if (!curIdx.isValid()) return; AssetManagement::TrainingArea taItem = m_model->getRowData(curIdx.row()); - DEBUG_LOG() << "onSelectionChanged() selected training area id: "<trainingArea(trainingAreaId); if (ddsTrainingArea.id() != trainingAreaId) { - ERROR_LOG() << Q_FUNC_INFO << " TrainingArea not found, trainingAreaId = " << trainingAreaId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " TrainingArea not found, trainingAreaId = " << trainingAreaId; return {}; } @@ -280,7 +280,7 @@ void AsmTrainingAreaDialog::showAllTrainingAreas() for (int row = 0; row < rowCount; ++row) { const TrainingArea ¤tArea = m_model->getRowData(row); - INFO_LOG() << " row = " << row << " ; currentArea = " << currentArea; + INFO_LOG(m_logger) << " row = " << row << " ; currentArea = " << currentArea; const QPolygonF &poly = getTrainingArea(currentArea); polyVec.append(poly); } @@ -292,7 +292,7 @@ void AsmTrainingAreaDialog::showPreviewObject() { if (!this->m_sitMapGuiIfc || m_previewPolygon.size() == 0) { - TRACE_LOG() << " showPreviewObject(): m_sitMapGuiIfc invalid or polygon empty "; + TRACE_LOG(m_logger) << " showPreviewObject(): m_sitMapGuiIfc invalid or polygon empty "; return; } this->m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.h index dc639f263..5d09aac7d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_dialog.h @@ -53,6 +53,7 @@ private slots: void onSelectionChanged(); private: + NGL::INGLLogger &m_logger; void retranslate() override; void onTrainingAreaModifyReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } void onTrainingAreaRemoveReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.cpp index 6adfde568..b6e21b677 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.cpp @@ -34,7 +34,7 @@ bool AsmTrainingAreaDialogModel::initModel(const std::shared_ptr }); } else { - WARNING_LOG() << Q_FUNC_INFO << " no m_asmDtc"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " no m_asmDtc"; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.h index e32e9dbda..14c6411b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AssetManagement/Gui/AsmTrainingAreaEdit/asm_training_area_model.h @@ -34,6 +34,9 @@ public: private: + + +NGL::INGLLogger &m_logger; bool m_hideRemoved; std::shared_ptr m_asmDtc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.cpp index 502d66942..451f9c253 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.cpp @@ -109,7 +109,7 @@ QVariant AvailStreamsModel::data(const QModelIndex &index, int role) const { NGLTreeItem *item = privateData(index); StreamData data = item->data().value(); - DEBUG_LOG() << data.name; + DEBUG_LOG(m_logger) << data.name; return data.name; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.h index 4bedd4065..affbdea36 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_avail_streams_model.h @@ -45,6 +45,8 @@ private slots: void onTvcConfigChanged(const AudioVideoManagement::TvcConfig &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; template void insertUpdateData(const T &data, DataModification modType, NGLTreeItem *parent); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_dialog.cpp index d88728d3b..a667ddb58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_dialog.cpp @@ -122,7 +122,7 @@ void AudioSettingsDialog::retranslate() void AudioSettingsDialog::onOperatorChanged(const OperatorManagement::User &data, DataModification modType) { - DEBUG_LOG() << "************** onOperatorChanged "; + DEBUG_LOG(m_logger) << "************** onOperatorChanged "; switch (modType) { case DataModification::eRemoved: @@ -245,7 +245,7 @@ void AudioSettingsDialog::onDownButtonClicked() void AudioSettingsDialog::onSelectionChangedAllocation(const QItemSelection &selected, const QItemSelection &deselected) { - DEBUG_LOG() << "onSelectionChangedAllocation selected.isEmpty()=" << selected.isEmpty(); + DEBUG_LOG(m_logger) << "onSelectionChangedAllocation selected.isEmpty()=" << selected.isEmpty(); Q_UNUSED(deselected); QModelIndex first = m_ui->treeViewAllocated->model()->index(0, 0); int rowCnt = m_ui->treeViewAllocated->model()->rowCount(); @@ -281,7 +281,7 @@ bool AudioSettingsDialog::apply() bool AudioSettingsDialog::applyRemove() { RemoveCnrTvcProfileRequest removeRequest; - DEBUG_LOG() << "AudioSettingsDialog::applyRemove"; + DEBUG_LOG(m_logger) << "AudioSettingsDialog::applyRemove"; for (const auto &profile : std::as_const(m_cnrTvcProfileMap)) { @@ -304,7 +304,7 @@ bool AudioSettingsDialog::applyRemove() bool AudioSettingsDialog::applyModify() { ModifyCnrTvcProfileRequest modifyRequest; - DEBUG_LOG() << "AudioSettingsDialog::applyModify"; + DEBUG_LOG(m_logger) << "AudioSettingsDialog::applyModify"; for (const auto &profile : std::as_const(m_cnrTvcProfileMap)) { @@ -382,7 +382,7 @@ void AudioSettingsDialog::onSelectionOperatorChanged(const int index) m_ui->pushButtonUp->setEnabled(false); m_ui->pushButtonDown->setEnabled(false); m_operatorId = m_ui->operatorComboBox->currentData().toInt(); - DEBUG_LOG() << "onSelectionOperatorChanged" << " operatorStr=" << m_ui->operatorComboBox->currentText() << " m_operatorId= " << m_operatorId; + DEBUG_LOG(m_logger) << "onSelectionOperatorChanged" << " operatorStr=" << m_ui->operatorComboBox->currentText() << " m_operatorId= " << m_operatorId; fillOperatorList(); m_modelAllocated->resetChangeState(); m_modelAvailable->resetChangeState(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.cpp index 174284c9a..f469c7c97 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.cpp @@ -31,7 +31,7 @@ QVariant AllocatedStreamsModel::data(const QModelIndex &index, int role) const { NGLTreeItem *item = privateData(index); StreamData data = item->data().value(); - DEBUG_LOG() << data.name; + DEBUG_LOG(m_logger) << data.name; return data.name; } @@ -92,14 +92,14 @@ bool AllocatedStreamsModel::dropMimeData(const QMimeData *data, Qt::DropAction a qDeleteAll(droppedItems); emit droppedStreamNames(streams); m_changes = true; - DEBUG_LOG() << data->data(QStringLiteral("NGLTreeModel/dragDrop")); + DEBUG_LOG(m_logger) << data->data(QStringLiteral("NGLTreeModel/dragDrop")); return NGLTreeModel::dropMimeData(data, action, row, 0, QModelIndex()); } void AllocatedStreamsModel::setNewStreamData(const QVector &newData) { - DEBUG_LOG() << "set new stream data, count: " << newData.size(); + DEBUG_LOG(m_logger) << "set new stream data, count: " << newData.size(); resetModel(); for (const StreamData &sd : newData) m_rootItem->appendChild(new NGLTreeItem(QVariant::fromValue(sd))); @@ -116,15 +116,15 @@ QVector AllocatedStreamsModel::getStreamDataVector() const const NGLTreeItem *item = m_rootItem->child(i); const StreamData sd = item->data().value(); result.append(sd); - DEBUG_LOG() << "result.append(sd.name):" << sd.name; + DEBUG_LOG(m_logger) << "result.append(sd.name):" << sd.name; } - DEBUG_LOG() << "getStreamDataVector() size: " << result.size(); + DEBUG_LOG(m_logger) << "getStreamDataVector() size: " << result.size(); return result; } void AllocatedStreamsModel::changeOrder(const QModelIndex &idx, bool up) { - DEBUG_LOG() << "changeOrder " + DEBUG_LOG(m_logger) << "changeOrder " << " index = " << idx.row() << " up = " << up << " m_rootItem->childCount()= " << m_rootItem->childCount(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.h index 9befaf236..17cd0798f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/AudioSettings/audio_settings_used_streams_model.h @@ -40,6 +40,8 @@ signals: void droppedStreamNames(const QVector &streamNamesDropped); private: + +NGL::INGLLogger &m_logger; bool m_changes{false}; QVector > m_changedStreams; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/avm_sequence_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/avm_sequence_model.h index 8853020b5..90e390f3d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/avm_sequence_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/avm_sequence_model.h @@ -58,6 +58,8 @@ public slots: void setTimezoneHoursOffset(int timezoneHoursOffset); private: + +NGL::INGLLogger &m_logger; QString dateTimeToStringx(const QDateTime &dt) const; QString msecsSinceEpochToStringx(qint64 msecs) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.cpp index 2f902a2ff..ff9aca229 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.cpp @@ -379,7 +379,7 @@ void TopicEditor::onEditSequence() if (!m_playbackMenu) return; - DEBUG_LOG() << "slotEditSequence "; + DEBUG_LOG(m_logger) << "slotEditSequence "; const auto selRows = m_ui->tvSequences->selectionModel()->selectedRows(); if (selRows.size() != 1) @@ -392,7 +392,7 @@ void TopicEditor::onEditSequence() m_model->setHighlightedRow(row); const AvsSequence selectedSeq = m_model->getRowData(row); - DEBUG_LOG() << "selectedSeq.internalStreamName=" << selectedSeq.internalStreamName; + DEBUG_LOG(m_logger) << "selectedSeq.internalStreamName=" << selectedSeq.internalStreamName; m_playbackMenu->setStreamName(selectedSeq.internalStreamName); m_ui->dtStart->setMsecsSinceEpoch(std::chrono::milliseconds(selectedSeq.start.time_since_epoch()).count()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.h index b75162feb..52b6d0003 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/TopicEditor/topic_editor.h @@ -28,6 +28,7 @@ public: ~TopicEditor(); private: + NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; @@ -53,6 +54,7 @@ private slots: void onMarkerSelected(const QString &description); private: + NGL::INGLLogger &m_logger; const int s_durationLimit{86400000}; LtsSession::LtsSession *m_session{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.cpp index fbbaba8af..0d20abd55 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.cpp @@ -57,8 +57,8 @@ AvailableStreamsModel::AvailableStreamsModel(const std::shared_ptrremoveAllChildren(); @@ -250,7 +250,7 @@ void AvailableStreamsModel::initModel() { if (videoTeam.exerciseId() != m_session->exerciseId()) continue; - DEBUG_LOG() << "add new videoteam" << videoTeam; + DEBUG_LOG(m_logger) << "add new videoteam" << videoTeam; StreamModelData item; item.name = QString::fromStdString(videoTeam.streamName().c_str()); item.mountingPointId = -1 * videoTeam.id(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.h index a76c6be62..5686c3be6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_available_streams_model.h @@ -89,6 +89,8 @@ public: Qt::DropActions supportedDragActions() const override { return Qt::CopyAction; } private: + +NGL::INGLLogger &m_logger; void initModel(); const bool m_isAudio; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.cpp index a29300f9c..41bb26cfa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.cpp @@ -85,11 +85,11 @@ void ChooseMenu::onMenuStructChanged(const MenuStruct &data, DataModification mo bool ChooseMenu::apply() { int menuId = m_ui->cbAudio->currentData().toInt(); - INFO_LOG() << "MenuId Audio: " << menuId; + INFO_LOG(m_logger) << "MenuId Audio: " << menuId; m_avsMenus->setAnnouncementMenu(menuId); menuId = m_ui->cbVideo->currentData().toInt(); - INFO_LOG() << "MenuId Video: " << menuId; + INFO_LOG(m_logger) << "MenuId Video: " << menuId; m_avsMenus->setVideoMenu(menuId); return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.h index 76bfbe513..a6ef676d1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_choose_menu.h @@ -42,6 +42,8 @@ private slots: void onMenuStructChanged(const MenuStruct &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; void selectCurrent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.cpp index f6fcf0ee5..db39cdff2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.cpp @@ -46,11 +46,11 @@ bool MenuEdit::init(LtsSession::LtsSession *session, StreamNameMapping *streamNameMapping, const MenuStruct &ms) { - DEBUG_LOG() << "MenuEdit::init()"; + DEBUG_LOG(m_logger) << "MenuEdit::init()"; if (!ftc || !dtc) { - ERROR_LOG() << "MenuEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "MenuEdit::init() Invalid shared_ptr!"; return false; } @@ -119,7 +119,7 @@ void MenuEdit::onRemove() return; slotChangesMade(); - DEBUG_LOG() << "index row: " << index.row(); + DEBUG_LOG(m_logger) << "index row: " << index.row(); m_usedStreamsModel->removeRow(index.row(), index.parent()); } else @@ -131,7 +131,7 @@ void MenuEdit::onRemove() return; slotChangesMade(); - DEBUG_LOG() << "index row: " << index.row(); + DEBUG_LOG(m_logger) << "index row: " << index.row(); m_usedStreamsModel->removeRow(index.row(), index.parent()); } @@ -140,7 +140,7 @@ void MenuEdit::onRemove() void MenuEdit::onModelDataChanged() { - INFO_LOG() << "onModelDataChanged"; + INFO_LOG(m_logger) << "onModelDataChanged"; m_ui->menuTreeView->expandAll(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.h index 0eb216318..e9b2a86fa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit.h @@ -59,6 +59,8 @@ public slots: void onStreamSelected(const QModelIndex &idx); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.cpp index fcebe89b2..f6cb3b841 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.cpp @@ -149,7 +149,7 @@ void MenuEditView::onEditMenuStruct() AudioVideoManagement::MenuStruct ms = m_model->getRowData(row); ms.isAudio(m_isAudio); - DEBUG_LOG() << "---onEditMenuStruct () " + DEBUG_LOG(m_logger) << "---onEditMenuStruct () " << " id: " << ms.id() << " name: " << ms.name(); @@ -204,15 +204,15 @@ void MenuEditView::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void MenuEditView::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::AVMMenuEditView)); @@ -239,7 +239,7 @@ void MenuEditView::onImportButtonClicked() }); } } - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.h index b0a2675af..e2cd0c69b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_edit_view.h @@ -48,6 +48,8 @@ public: bool isAudio); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onAddMenuStruct(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.cpp index 934a1af2f..bd08bc14b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.cpp @@ -77,7 +77,7 @@ QByteArray MenuViewModel::modelToJson(int row) const QJsonObject obj; obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::AVMMenuEditView); - DEBUG_LOG() << "row =" << ": " << row; + DEBUG_LOG(m_logger) << "row =" << ": " << row; const AudioVideoManagement::MenuStruct &menuStruct = m_vecData.at(row); obj[QStringLiteral("id")] = 0; @@ -122,7 +122,7 @@ QVector MenuViewModel::jsonToMenuStructs(const const QJsonArray arrEntry(obj.value(QStringLiteral("menuEntries")).toArray()); menuStruct.menuEntries().resize(arrEntry.size()); - INFO_LOG() << "arrEntry.size()=" << arrEntry.size(); + INFO_LOG(m_logger) << "arrEntry.size()=" << arrEntry.size(); for (int j = 0; j < arrEntry.size(); ++j) { const QJsonObject objEntry(arrEntry.at(j).toObject()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.h index d299467ab..4cb03b46a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_menu_view_model.h @@ -25,6 +25,7 @@ public: QByteArray modelToJson(int row) const; QVector jsonToMenuStructs(const QByteArray &content) const; protected: +NGL::INGLLogger &m_logger; bool isFiltered(const MenuStruct &data, DataModification modType) const override final; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_new_menu_struct.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_new_menu_struct.h index b7456fb39..4cf964595 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_new_menu_struct.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_new_menu_struct.h @@ -29,6 +29,8 @@ Q_SIGNALS: void newName(const QString &); private: + +NGL::INGLLogger &m_logger; Ui::NewMenuStruct *m_ui; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.cpp index ac3bd02e9..a1db2e0c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.cpp @@ -279,9 +279,8 @@ private: -QueryTimeline::QueryTimeline(const AvaStream &stream, const AvaTimePoint &start, const AvaTimePoint &end, AvaControl *control) - : QObject() -{ +QueryTimeline::QueryTimeline(const AvaStream &stream, const AvaTimePoint &start, const AvaTimePoint &end, AvaControl *control) : QObject(), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(control, &AvaControl::queryTimelineResponse, this, &QueryTimeline::signalTimelineComplete); connect(control, &AvaControl::queryTimelineResponse, @@ -387,12 +386,12 @@ bool AvmPlaybackMenu::init(LtsSession::LtsSession *session, AvaSession *avaSessi m_presetStreamName = streamName; if (m_presetStreamName) - DEBUG_LOG() << "init stream preset: " << m_presetStreamName.get(); + DEBUG_LOG(m_logger) << "init stream preset: " << m_presetStreamName.get(); m_presetStartTime = startTime; if (m_presetStartTime) - DEBUG_LOG() << "init time preset: " << std::chrono::milliseconds(m_presetStartTime.get().time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "init time preset: " << std::chrono::milliseconds(m_presetStartTime.get().time_since_epoch()).count(); m_session = session; m_playbackApp = std::move(appHandle); @@ -1006,37 +1005,37 @@ void AvmPlaybackMenu::preselectStream(const QString &fallbackInternalStreamName) const QString currentStreamName(m_presetStreamName.is_initialized() ? *m_presetStreamName : QString()); const QString currentInternalName(currentStreamName.isEmpty() ? fallbackInternalStreamName : QString()); - DEBUG_LOG() << "currentStreamName: " << currentStreamName; - DEBUG_LOG() << "currentInternalName: " << currentInternalName; + DEBUG_LOG(m_logger) << "currentStreamName: " << currentStreamName; + DEBUG_LOG(m_logger) << "currentInternalName: " << currentInternalName; m_presetStreamName.reset(); if (!currentInternalName.isEmpty() || !currentStreamName.isEmpty()) { - DEBUG_LOG() << "stream preset set - searching for '" << currentStreamName << "'.."; + DEBUG_LOG(m_logger) << "stream preset set - searching for '" << currentStreamName << "'.."; bool found = false; for (int i = 0; i < m_ui->cbStreams->count(); i++) { const AvaStream &curStream = m_ui->cbStreams->itemData(i).value(); - DEBUG_LOG() << "stream " << i << ": " << curStream.displayName << " (" << curStream.internalName << ")"; + DEBUG_LOG(m_logger) << "stream " << i << ": " << curStream.displayName << " (" << curStream.internalName << ")"; if ((!currentInternalName.isEmpty() && curStream.displayName == currentInternalName) || (!currentStreamName.isEmpty() && curStream.internalName == currentStreamName)) { found = true; - DEBUG_LOG() << "stream preset set, found & selected"; + DEBUG_LOG(m_logger) << "stream preset set, found & selected"; m_ui->cbStreams->setCurrentIndex(i); break; } } if (!found) - WARNING_LOG() << "new stream list does not contain old selected stream (" << currentInternalName << ") !"; + WARNING_LOG(m_logger) << "new stream list does not contain old selected stream (" << currentInternalName << ") !"; } else - DEBUG_LOG() << "no stream preset set"; + DEBUG_LOG(m_logger) << "no stream preset set"; } @@ -1097,7 +1096,7 @@ void AvmPlaybackMenu::setSavedPos(qint64 msecs) void AvmPlaybackMenu::onTimelineComplete(const AvaTimeline &timeline) { - DEBUG_LOG() << "onTimelineComplete"; + DEBUG_LOG(m_logger) << "onTimelineComplete"; m_intervalModel.setData(timeline.parts()); m_ui->tavIntervals->resizeColumnsToContents(); @@ -1115,7 +1114,7 @@ void AvmPlaybackMenu::onTimelineComplete(const AvaTimeline &timeline) m_savedPos.reset(); } - DEBUG_LOG() << "onTimelineComplete " << std::chrono::milliseconds(newPos.time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "onTimelineComplete " << std::chrono::milliseconds(newPos.time_since_epoch()).count(); m_avaCtrl->setAbsPosition(m_playbackApp.dialogId(), ALL_STREAMS(), newPos); m_timelineIsComplete = true; @@ -1142,7 +1141,7 @@ void AvmPlaybackMenu::onStreamPositionReceived(const QString &dialogId, const QS return; m_lastAvsPos = pos; - DEBUG_LOG() << "onStreamPositionReceived: last avs pos now: " << std::chrono::milliseconds((*m_lastAvsPos).time_since_epoch()).count() << " - direct apply? " << m_avaCtrl->isEmpty(); + DEBUG_LOG(m_logger) << "onStreamPositionReceived: last avs pos now: " << std::chrono::milliseconds((*m_lastAvsPos).time_since_epoch()).count() << " - direct apply? " << m_avaCtrl->isEmpty(); if (m_avaCtrl->isEmpty()) applyAvsPos(); @@ -1198,13 +1197,13 @@ void AvmPlaybackMenu::onUiTimeChanged(AvaTimePoint t) m_currentButtonState != ButtonStates::Stopped) return; - DEBUG_LOG() << "onUiTimeChanged " << std::chrono::milliseconds(t.time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "onUiTimeChanged " << std::chrono::milliseconds(t.time_since_epoch()).count(); m_avaCtrl->setAbsPosition(m_playbackApp.dialogId(), ALL_STREAMS(), t); } void AvmPlaybackMenu::onStreamSelectionChanged(const QVector &selectedStreams) { - DEBUG_LOG() << "onStreamSelectionChanged count = " << selectedStreams.count(); + DEBUG_LOG(m_logger) << "onStreamSelectionChanged count = " << selectedStreams.count(); Q_ASSERT(!selectedStreams.isEmpty()); @@ -1231,7 +1230,7 @@ void AvmPlaybackMenu::onStreamSelectionChanged(const QVector &selecte void AvmPlaybackMenu::onIntervalActivated(const QModelIndex &index) { AvaTimelinePart interval = m_intervalModel.getRowData(index.row()); - DEBUG_LOG() << "start = " << std::chrono::milliseconds(interval.first.time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "start = " << std::chrono::milliseconds(interval.first.time_since_epoch()).count(); m_avaCtrl->setAbsPosition(m_playbackApp.dialogId(), ALL_STREAMS(), interval.first); @@ -1302,7 +1301,7 @@ void AvmPlaybackMenu::selectMarker(const MarkerManagement::Marker &marker) (void)blocker; const auto &rowData = marker; - DEBUG_LOG() << "AvmPlaybackMenu::onMarkerClicked name = " << QString::fromStdString(rowData.name()) + DEBUG_LOG(m_logger) << "AvmPlaybackMenu::onMarkerClicked name = " << QString::fromStdString(rowData.name()) << " note = " << QString::fromStdString(rowData.note()); bool selectMarkerStream = false; @@ -1319,7 +1318,7 @@ void AvmPlaybackMenu::selectMarker(const MarkerManagement::Marker &marker) for (const MarkerManagement::MarkerDescription &desc : rowData.descriptions()) { - DEBUG_LOG() << " description = " << QString::fromStdString(desc.content()) + DEBUG_LOG(m_logger) << " description = " << QString::fromStdString(desc.content()) << " desc.markerType()=" << desc.markerType(); if ((desc.markerType() == MarkerManagement::MarkerType::Video && m_isAudio == false) || (desc.markerType() == MarkerManagement::MarkerType::Audio && m_isAudio == true)) @@ -1345,7 +1344,7 @@ void AvmPlaybackMenu::selectMarker(const MarkerManagement::Marker &marker) avaStream.displayName = m_streamNameMapping->displayName(avaStream.internalName); m_ui->cbMarkerStreams->addItem(avaStream.displayName, QVariant::fromValue(avaStream)); - DEBUG_LOG() << "streams[" << avaStream.internalName << "]" + DEBUG_LOG(m_logger) << "streams[" << avaStream.internalName << "]" << " internaName=" << avaStream.internalName << " displayName=" << avaStream.displayName; if (bIsSelected && selectedStream.internalName.isEmpty()) @@ -1363,7 +1362,7 @@ void AvmPlaybackMenu::selectMarker(const MarkerManagement::Marker &marker) qint64 time = rowData.timeStamp() - rowData.timeStampOffset(); - DEBUG_LOG() << "marker time: " << time << " (" << QDateTime::fromMSecsSinceEpoch(time).toString(QStringLiteral("dd.MM.yy HH:mm:ss.zzz")) << ")"; + DEBUG_LOG(m_logger) << "marker time: " << time << " (" << QDateTime::fromMSecsSinceEpoch(time).toString(QStringLiteral("dd.MM.yy HH:mm:ss.zzz")) << ")"; std::chrono::milliseconds t(time); AvaTimePoint p(std::chrono::duration_cast(t)); @@ -1403,7 +1402,7 @@ void AvmPlaybackMenu::onSetMarkerClicked() if (!m_selectedStreams || m_selectedStreams.get().isEmpty()) { new LtsWidgets::LtsMessageDialogNew(this, tr("No stream selected to create a marker from.")); - WARNING_LOG() << "onSetMarkerClicked called, but no selected streams available"; + WARNING_LOG(m_logger) << "onSetMarkerClicked called, but no selected streams available"; return; } @@ -1444,7 +1443,7 @@ void AvmPlaybackMenu::onStartClicked() { - DEBUG_LOG() << "onStartClicked" + DEBUG_LOG(m_logger) << "onStartClicked" << " dialogId=" << m_playbackApp.dialogId() << " currentSpeed=" << currentSpeed() @@ -1459,7 +1458,7 @@ void AvmPlaybackMenu::onStartClicked() return; } - WARNING_LOG() << "onStartClicked called, but no selected streams available"; + WARNING_LOG(m_logger) << "onStartClicked called, but no selected streams available"; return; } @@ -1501,14 +1500,14 @@ void AvmPlaybackMenu::onAllStreams() void AvmPlaybackMenu::onIntervalBackwardClicked() { const AvaTimelinePart &targetInterval = m_intervalModel.previousInterval(); - DEBUG_LOG() << "onIntervalBackwardClicked " << std::chrono::milliseconds(targetInterval.first.time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "onIntervalBackwardClicked " << std::chrono::milliseconds(targetInterval.first.time_since_epoch()).count(); m_avaCtrl->setAbsPosition(m_playbackApp.dialogId(), ALL_STREAMS(), targetInterval.first); } void AvmPlaybackMenu::onIntervalForwardClicked() { const AvaTimelinePart &targetInterval = m_intervalModel.nextInterval(); - DEBUG_LOG() << "onIntervalForwardClicked " << std::chrono::milliseconds(targetInterval.first.time_since_epoch()).count(); + DEBUG_LOG(m_logger) << "onIntervalForwardClicked " << std::chrono::milliseconds(targetInterval.first.time_since_epoch()).count(); m_avaCtrl->setAbsPosition(m_playbackApp.dialogId(), ALL_STREAMS(), targetInterval.first); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.h index 73366d22d..700ab0d9a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu.h @@ -42,6 +42,7 @@ class QueryTimeline : public QObject { Q_OBJECT private: +NGL::INGLLogger &m_logger; friend class AvmPlaybackMenu; QueryTimeline(const AvaStream &stream, const AvaTimePoint &start, const AvaTimePoint &end, AvaControl *control); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu_dialog.h index bbbb8fc12..b89b3944e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_playback_menu_dialog.h @@ -29,6 +29,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; bool m_isAudio; Ui::AvmPlaybackMenuDialog *m_ui; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.cpp index 21d150291..a2800ebcf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.cpp @@ -129,7 +129,7 @@ bool UsedStreamsModel::dropMimeData(const QMimeData *data, Qt::DropAction action if (!checkDrop(data, index(row, column), parent, action)) return false; - INFO_LOG() << "dropMimeData: action = " << action + INFO_LOG(m_logger) << "dropMimeData: action = " << action << ", row = " << row << ", parent: valid = " << parent.isValid(); @@ -200,7 +200,7 @@ bool UsedStreamsModel::canDropMimeData(const QMimeData *data, Qt::DropAction act stream >> idParent >> idItem >> group >> itemData >> mountId; ms = itemData.value(); - INFO_LOG() << "Insert:" + INFO_LOG(m_logger) << "Insert:" << "\n ms.name=" << ms.name << "\n ms.isGroup=" << ms.isGroup << "\n ms.parentId=" << ms.parentId @@ -301,7 +301,7 @@ void UsedStreamsModel::insertChildren(NGLTreeItem *parent, int parentId, const s if (me.isGroup()) { - DEBUG_LOG() << "insertChildren" + DEBUG_LOG(m_logger) << "insertChildren" << me.mountingPointId() << me.name(); insertChildren(treeItem, me.id(), entries); @@ -335,7 +335,7 @@ bool UsedStreamsModel::checkSingleItem(NGLTreeItem *target, StreamModelData &toC bool retValue = true; if (!target) { - ERROR_LOG() << "Nullptr exception"; + ERROR_LOG(m_logger) << "Nullptr exception"; return false; } else @@ -343,10 +343,10 @@ bool UsedStreamsModel::checkSingleItem(NGLTreeItem *target, StreamModelData &toC StreamModelData msTarget = target->data().value(); if (msTarget.id == toCheck.parentId) - DEBUG_LOG() << "Drag&drag in same folder."; + DEBUG_LOG(m_logger) << "Drag&drag in same folder."; else if (msTarget.isGroup && toCheck.isGroup) { - DEBUG_LOG() << "Trying to drop folder into folder"; + DEBUG_LOG(m_logger) << "Trying to drop folder into folder"; retValue = false; } else @@ -428,18 +428,18 @@ bool UsedStreamsModel::checkDrop(const QMimeData *data, const QModelIndex &index else if ((movedFolders.at(0) != item.parentId) && (movedFolders.contains(item.parentId)) && (action == Qt::MoveAction)) { - DEBUG_LOG() << "Ignoring items in sub folder while moving."; + DEBUG_LOG(m_logger) << "Ignoring items in sub folder while moving."; continue; } else if (!movedFolders.contains(item.parentId) && (action == Qt::MoveAction)) { - DEBUG_LOG() << "Only allow items from same folder to be moved."; + DEBUG_LOG(m_logger) << "Only allow items from same folder to be moved."; return false; } if (!checkSingleItem(itemToCheck, item)) { - DEBUG_LOG() << "Not able to add item with name: " << item.name; + DEBUG_LOG(m_logger) << "Not able to add item with name: " << item.name; return false; } @@ -452,7 +452,7 @@ bool UsedStreamsModel::checkDrop(const QMimeData *data, const QModelIndex &index } else { - DEBUG_LOG() << "More than one folder selected."; + DEBUG_LOG(m_logger) << "More than one folder selected."; return false; } } @@ -463,7 +463,7 @@ bool UsedStreamsModel::checkDrop(const QMimeData *data, const QModelIndex &index if (countDropped + countAgainst > 12) { - DEBUG_LOG() << "Trying to add to many items to folder"; + DEBUG_LOG(m_logger) << "Trying to add to many items to folder"; return false; } return true; @@ -551,7 +551,7 @@ void UsedStreamsModel::onDataChanged(const InfrastructureManagement::MainStructu const DataModification modType) { beginResetModel(); - INFO_LOG() << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount() + INFO_LOG(m_logger) << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount() << " data.elements().size()=" << data.elements().size(); switch (modType) @@ -562,7 +562,7 @@ void UsedStreamsModel::onDataChanged(const InfrastructureManagement::MainStructu case DataModification::eAdded: for (const InfrastructureManagement::StructureElement &se : data.elements()) { - INFO_LOG() << "se.id()" << se.id() + INFO_LOG(m_logger) << "se.id()" << se.id() << " se.displayName()" << se.displayName() << " m_rootItem->childCount()" << m_rootItem->childCount(); const QString newName = QString::fromStdString(se.displayName()); @@ -577,7 +577,7 @@ void UsedStreamsModel::onDataChangedMvs(const VideoTeam &data, const DataModific { beginResetModel(); - INFO_LOG() << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount(); + INFO_LOG(m_logger) << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount(); switch (modType) { @@ -586,7 +586,7 @@ void UsedStreamsModel::onDataChangedMvs(const VideoTeam &data, const DataModific case DataModification::eModified: case DataModification::eAdded: - INFO_LOG() << "se.id()" << data.id() + INFO_LOG(m_logger) << "se.id()" << data.id() << " se.displayName()" << data.streamName() << " m_rootItem->childCount()" << m_rootItem->childCount(); const QString newName = QString::fromStdString(data.streamName()); @@ -602,8 +602,8 @@ void UsedStreamsModel::onStreamNameDataChanged(int32_t mountingPointId, const QS Q_UNUSED(internalName) beginResetModel(); - INFO_LOG() << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount(); - INFO_LOG() << "se.id()" << mountingPointId + INFO_LOG(m_logger) << "onDataChanged m_rootItem->childCount()" << m_rootItem->childCount(); + INFO_LOG(m_logger) << "se.id()" << mountingPointId << " se.displayName()" << displayName << " m_rootItem->childCount()" << m_rootItem->childCount(); updateStreamNames(mountingPointId, displayName, m_rootItem); @@ -614,7 +614,7 @@ void UsedStreamsModel::onStreamNameDataChanged(int32_t mountingPointId, const QS void UsedStreamsModel::updateStreamNames(const int mountingPointId, const QString &newName, NGLTreeItem *item) { - INFO_LOG() << "updateStreamNames mountingPointId=" << mountingPointId + INFO_LOG(m_logger) << "updateStreamNames mountingPointId=" << mountingPointId << " newName=" << newName; int childCount = item->childCount(); @@ -623,17 +623,17 @@ void UsedStreamsModel::updateStreamNames(const int mountingPointId, const QStrin NGLTreeItem *child = item->child(i); if (!child->data().canConvert()) - ERROR_LOG() << "Error convert item"; + ERROR_LOG(m_logger) << "Error convert item"; StreamModelData usedStream = child->data().value(); - INFO_LOG() << "i=" << i + INFO_LOG(m_logger) << "i=" << i << " usedStream.mountingPointId=" << usedStream.mountingPointId << " usedStream.name=" << usedStream.name << " mountingPointId=" << mountingPointId << " newName=" << newName; if (mountingPointId == usedStream.mountingPointId) { - INFO_LOG() << "Set new DisplayName id=" << usedStream.id + INFO_LOG(m_logger) << "Set new DisplayName id=" << usedStream.id << " mountingPointId=" << usedStream.mountingPointId << " name=" << usedStream.name << " new Name =" << newName; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.h index 8d8f747de..6eb45f42f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/avm_used_streams_model.h @@ -44,6 +44,8 @@ public: bool initModel(); protected: + +NGL::INGLLogger &m_logger; NGLTreeItem *createItem(const QVariant &data, const QIcon &icon) const override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/topic_replay.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/topic_replay.cpp index 84224aabe..8fd3f393c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/topic_replay.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/AVMenuEdit/topic_replay.cpp @@ -51,13 +51,13 @@ TopicReplay::TopicReplay(DataInterface *dataIfc, bool isAudio) : m_isAudio(isAudio) , m_dataIfc(dataIfc) { - DEBUG_LOG() << "TopicReplay::TopicReplay()"; + DEBUG_LOG(m_logger) << "TopicReplay::TopicReplay()"; Q_ASSERT(dataIfc); } TopicReplay::~TopicReplay() { - DEBUG_LOG() << "TopicReplay::~TopicReplay()"; + DEBUG_LOG(m_logger) << "TopicReplay::~TopicReplay()"; if (m_isPlaying) playbackStop(); @@ -65,7 +65,7 @@ TopicReplay::~TopicReplay() QWidget *TopicReplay::createWidget() { - DEBUG_LOG() << "TopicReplay::createWidget()"; + DEBUG_LOG(m_logger) << "TopicReplay::createWidget()"; Q_ASSERT(!m_screenPlacementHelper); if (m_isAudio) @@ -80,19 +80,19 @@ QWidget *TopicReplay::createWidget() void TopicReplay::slotSetScriptResponse(const AudioVideoManagement::AvaStreamInfo &streamInfo, AudioVideoManagement::AvaStreamState streamState) { if (streamState == AudioVideoManagement::AvaStreamState::NotPossible) - ERROR_LOG() << "Script could not be set"; + ERROR_LOG(m_logger) << "Script could not be set"; else - ERROR_LOG() << "Script set!"; + ERROR_LOG(m_logger) << "Script set!"; - ERROR_LOG() << "streamInfo: start" << streamInfo.duration.count(); - ERROR_LOG() << "streamState: " << static_cast(streamState); + ERROR_LOG(m_logger) << "streamInfo: start" << streamInfo.duration.count(); + ERROR_LOG(m_logger) << "streamState: " << static_cast(streamState); } bool TopicReplay::playbackInit(const QJsonObject &attributes) { - DEBUG_LOG() << "TopicReplay::playbackInit()"; - DEBUG_LOG() << QJsonDocument(attributes).toJson(); + DEBUG_LOG(m_logger) << "TopicReplay::playbackInit()"; + DEBUG_LOG(m_logger) << QJsonDocument(attributes).toJson(); if (m_screenPlacementHelper && !m_isAudio) m_screenPlacementHelper->show(); @@ -103,7 +103,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) AvaControl *ctrl = getAvaControl(); if (ctrl == nullptr) { - ERROR_LOG() << "no ava control!"; + ERROR_LOG(m_logger) << "no ava control!"; return false; } @@ -111,7 +111,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) if (!topicData.isValid) { - ERROR_LOG() << "topicData is invalid"; + ERROR_LOG(m_logger) << "topicData is invalid"; return false; } @@ -122,7 +122,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) PlaybackApp *app = m_isAudio ? m_dataIfc->audioPresentationApp() : m_dataIfc->videoPresentationApp(); if (app == nullptr || app->inUse()) { - ERROR_LOG() << "app invalid or in use!"; + ERROR_LOG(m_logger) << "app invalid or in use!"; return false; } @@ -142,7 +142,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) if (!m_appHandle) { - ERROR_LOG() << "appHandle: missing app after creating appHandle!"; + ERROR_LOG(m_logger) << "appHandle: missing app after creating appHandle!"; return false; } @@ -150,7 +150,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) NGL::Settings s({}); bool isLocal = s.isDatabaseConnectionLocal(); - DEBUG_LOG() << "isLocal? " << isLocal; + DEBUG_LOG(m_logger) << "isLocal? " << isLocal; AvaScriptSource source; if (isLocal) @@ -168,7 +168,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) source = AvaScriptSource::ServerVideo; } - DEBUG_LOG() << "source: " << static_cast(source); + DEBUG_LOG(m_logger) << "source: " << static_cast(source); ctrl->setScript(m_appHandle.dialogId(), m_scriptName, source, topicData.streamList(), @@ -180,7 +180,7 @@ bool TopicReplay::playbackInit(const QJsonObject &attributes) bool TopicReplay::playbackStart(int secondsOffset) { - DEBUG_LOG() << "TopicReplay::playbackStart()"; + DEBUG_LOG(m_logger) << "TopicReplay::playbackStart()"; if (m_screenPlacementHelper && !m_isAudio) m_screenPlacementHelper->show(); @@ -188,7 +188,7 @@ bool TopicReplay::playbackStart(int secondsOffset) AvaControl *ctrl = getAvaControl(); if (ctrl == nullptr) { - ERROR_LOG() << "ctrl == nullptr"; + ERROR_LOG(m_logger) << "ctrl == nullptr"; return false; } @@ -196,7 +196,7 @@ bool TopicReplay::playbackStart(int secondsOffset) if (!m_appHandle) { - ERROR_LOG() << "appHandle: missing app!"; + ERROR_LOG(m_logger) << "appHandle: missing app!"; return false; } @@ -204,13 +204,13 @@ bool TopicReplay::playbackStart(int secondsOffset) ctrl->startScript(m_appHandle.dialogId(), m_scriptName); m_isPlaying = true; - DEBUG_LOG() << "m_isPlaying = true"; + DEBUG_LOG(m_logger) << "m_isPlaying = true"; return true; } bool TopicReplay::playbackPause() { - DEBUG_LOG() << "TopicReplay::playbackPause()"; + DEBUG_LOG(m_logger) << "TopicReplay::playbackPause()"; if (m_screenPlacementHelper) m_screenPlacementHelper->hide(); @@ -221,13 +221,13 @@ bool TopicReplay::playbackPause() AvaControl *ctrl = getAvaControl(); if (ctrl == nullptr) { - ERROR_LOG() << "no ctrl!"; + ERROR_LOG(m_logger) << "no ctrl!"; return false; } if (!m_appHandle) { - ERROR_LOG() << "appHandle: missing app!"; + ERROR_LOG(m_logger) << "appHandle: missing app!"; return false; } @@ -237,7 +237,7 @@ bool TopicReplay::playbackPause() bool TopicReplay::playbackStop() { - DEBUG_LOG() << "TopicReplay::playbackStop()"; + DEBUG_LOG(m_logger) << "TopicReplay::playbackStop()"; if (m_screenPlacementHelper) m_screenPlacementHelper->hide(); @@ -248,13 +248,13 @@ bool TopicReplay::playbackStop() AvaControl *ctrl = getAvaControl(); if (ctrl == nullptr) { - ERROR_LOG() << "no ctrl!"; + ERROR_LOG(m_logger) << "no ctrl!"; return false; } if (!m_appHandle) { - ERROR_LOG() << "appHandle: missing app!"; + ERROR_LOG(m_logger) << "appHandle: missing app!"; return false; } @@ -274,7 +274,7 @@ bool TopicReplay::exportTopic(const QJsonObject &attributes, VdControl *ctrl = getVdControl(); if (ctrl == nullptr) { - ERROR_LOG() << "ctrl missing!"; + ERROR_LOG(m_logger) << "ctrl missing!"; exportNotifier->setExportFailed(); return false; } @@ -286,7 +286,7 @@ bool TopicReplay::exportTopic(const QJsonObject &attributes, if (!topicData.isValid) { - ERROR_LOG() << "topicData is invalid"; + ERROR_LOG(m_logger) << "topicData is invalid"; exportNotifier->setExportFailed(); return false; } @@ -304,7 +304,7 @@ bool TopicReplay::exportTopic(const QJsonObject &attributes, void TopicReplay::onWidgetPlaced(const QRect &geometry) { - WARNING_LOG() << "TopicReplay::onWidgetPlaced() - geo: " << geometry.x() << "/" << geometry.y() + WARNING_LOG(m_logger) << "TopicReplay::onWidgetPlaced() - geo: " << geometry.x() << "/" << geometry.y() << " m_isAudio=" << m_isAudio; m_dialogGeometry = geometry; @@ -315,17 +315,17 @@ void TopicReplay::onWidgetPlaced(const QRect &geometry) PlaybackApp *app = m_isAudio ? m_dataIfc->audioPresentationApp() : m_dataIfc->videoPresentationApp(); if (app == nullptr) { - ERROR_LOG() << "app missing!"; + ERROR_LOG(m_logger) << "app missing!"; return; } if (!app->inUse()) { - ERROR_LOG() << "app not in use - waiting for playbackInit to aquire it"; + ERROR_LOG(m_logger) << "app not in use - waiting for playbackInit to aquire it"; return; } - DEBUG_LOG() << "setGeometry"; + DEBUG_LOG(m_logger) << "setGeometry"; app->setGeometry(*m_dialogGeometry); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.cpp index 58feb977b..4356e066a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.cpp @@ -59,7 +59,7 @@ bool CombatNetRadioDialog::init(const std::shared_ptr &avmDtc, avmFtc->enableModifyCnrConfig() && avmFtc->enableRemoveCnrConfig())) { - ERROR_LOG() << "Could not enable topics"; + ERROR_LOG(m_logger) << "Could not enable topics"; return false; } @@ -78,7 +78,7 @@ bool CombatNetRadioDialog::init(const std::shared_ptr &avmDtc, { m_filter.reset(); m_model.reset(); - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; return false; } @@ -191,14 +191,14 @@ void CombatNetRadioDialog::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void CombatNetRadioDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::AVMCombatNetRadio)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.h index eb206dc32..2cc2322e1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog.h @@ -79,6 +79,8 @@ private Q_SLOTS: void onImportButtonClicked(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.cpp index 9955af8a4..dcfe486a7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.cpp @@ -40,7 +40,7 @@ QVariant CombatNetRadioDialogModel::data(const QModelIndex &index, int role) con switch (index.column()) { case CHANNEL: - INFO_LOG()<<"CombatNetRadioDialogModel::data role =" << role + INFO_LOG(m_logger)<<"CombatNetRadioDialogModel::data role =" << role << " row = " << index.row(); return QString::fromStdString(m_cnrChannels.value(config.cnrChannelId()).name()); case RADIO_CIRCUIT: @@ -61,14 +61,14 @@ QVariant CombatNetRadioDialogModel::data(const QModelIndex &index, int role) con if (unit.id() != unitId) return {}; - INFO_LOG() << " config.unitId()=" << unitId + INFO_LOG(m_logger) << " config.unitId()=" << unitId << " Str=" << unit.name(); QString unitStr; if (unit.designator().size() > 0) unitStr = QString::fromStdString(unit.designator()) + QLatin1Char('/'); unitStr.append(QString::fromStdString(unit.tacticalIdentifier())); - INFO_LOG() << "unitStr = " << unitStr; + INFO_LOG(m_logger) << "unitStr = " << unitStr; return unitStr; } @@ -98,7 +98,7 @@ bool CombatNetRadioDialogModel::init(const std::shared_ptr &avmD if (!ppmDtc->visibleParties(m_parties, LtsSessionData::LtsSessionData::getInstance()->getVisibleParties(m_exerciseId))) { - ERROR_LOG() << "Could not retrieve visible Parties!"; + ERROR_LOG(m_logger) << "Could not retrieve visible Parties!"; return false; } m_units = ppmDtc->units(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.h index 93764d390..ab240a8b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_combat_net_radio_dialog_model.h @@ -41,6 +41,8 @@ public: bool onlyGlobals(); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_avmDtc; int32_t m_exerciseId; QMap m_cnrChannels; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.cpp index de52724a4..13c7f6426 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.cpp @@ -173,7 +173,7 @@ bool EditCombatNetRadioDialog::apply() if (m_ui->cbUnit->currentIndex() > 0) { request.unitId().set(m_ui->cbUnit->currentData().toInt()); - INFO_LOG()<< "currentIndex="<cbUnit->currentIndex() + INFO_LOG(m_logger)<< "currentIndex="<cbUnit->currentIndex() << " unitId ="< parties; if (!m_ppmDtc->visibleParties(parties, LtsSessionData::LtsSessionData::getInstance()->getVisibleParties(m_exerciseId))) - ERROR_LOG() << "Could not retrieve visible Parties!"; + ERROR_LOG(m_logger) << "Could not retrieve visible Parties!"; for (const ParticipantManagement::Party &party : std::as_const(parties)) m_ui->cbParty->addItem(ParticipantManagement::trPartyName(party.name()), party.id()); @@ -489,10 +489,10 @@ void EditCombatNetRadioDialog::onPartyIndexChanged(int index) if (unit.designator().size() > 0) { unitStr = QString::fromStdString(unit.designator()) + QLatin1Char('/'); - INFO_LOG()<<"Designator != leer: unitStr = " << unitStr; + INFO_LOG(m_logger)<<"Designator != leer: unitStr = " << unitStr; } unitStr += QString::fromStdString(unit.tacticalIdentifier()); - INFO_LOG() << "unitStr =" << unitStr + INFO_LOG(m_logger) << "unitStr =" << unitStr << " id =" << unit.id(); m_ui->cbUnit->addItem(unitStr, unit.id()); @@ -561,14 +561,14 @@ void EditCombatNetRadioDialog::onExportButtonClicked() QByteArray byteArray = cnrConfigRequestToJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_exerciseId, byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void EditCombatNetRadioDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_exerciseId, FileManagement::toString(FileManagement::XmlType::AVMEditCombatNetRadio)); @@ -588,7 +588,7 @@ void EditCombatNetRadioDialog::onImportButtonClicked() { ModifyCnrConfigRequest req = jsonToModifyCnrConfig(content); setUiValues(toConfig(req)); - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.h index 2aa00bf36..e9023209c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_edit_combat_net_radio_dialog.h @@ -69,6 +69,8 @@ public: void onModifyCnrConfigReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } protected: + +NGL::INGLLogger &m_logger; bool apply() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog.h index 502c9a702..5aafb6983 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog.h @@ -57,6 +57,8 @@ private Q_SLOTS: void onOk(); private: + +NGL::INGLLogger &m_logger; std::unique_ptr m_ui; LoadCombatNetRadioDialogModel *m_model; bool m_isApplied = false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.cpp index 5d599d268..0626551a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.cpp @@ -35,7 +35,7 @@ LoadCombatNetRadioDialogModel::LoadCombatNetRadioDialogModel(const QByteArray &d }, parent) , m_exerciseId(session == nullptr ? 0 : session->exerciseId()) { - DEBUG_LOG() << "Own exercise id: " << m_exerciseId; + DEBUG_LOG(m_logger) << "Own exercise id: " << m_exerciseId; if (session != nullptr) { @@ -44,28 +44,28 @@ LoadCombatNetRadioDialogModel::LoadCombatNetRadioDialogModel(const QByteArray &d if (!session->getDtc(avmDtc) || !avmDtc->enableCnrChannel() || !avmDtc->enableCnrConfig()) - ERROR_LOG() << "Could not get AVM data"; + ERROR_LOG(m_logger) << "Could not get AVM data"; else { m_cnrChannels = avmDtc->cnrChannels(); m_cnrConfigs = avmDtc->cnrConfigs(); } - DEBUG_LOG() << "cnrconfigs: " << m_cnrConfigs.size(); - DEBUG_LOG() << "ownExerciseId: " << m_exerciseId; + DEBUG_LOG(m_logger) << "cnrconfigs: " << m_cnrConfigs.size(); + DEBUG_LOG(m_logger) << "ownExerciseId: " << m_exerciseId; std::shared_ptr exmDtc; if (!session->getDtc(exmDtc) || !exmDtc->enableExercise()) - ERROR_LOG() << "Could not get EXM data"; + ERROR_LOG(m_logger) << "Could not get EXM data"; else m_exercises = exmDtc->exercises(); - DEBUG_LOG() << "exercises: " << m_exercises.size(); + DEBUG_LOG(m_logger) << "exercises: " << m_exercises.size(); } else - ERROR_LOG() << "Got invalid session."; + ERROR_LOG(m_logger) << "Got invalid session."; m_vecData = jsonToCnrConfigVector(data); @@ -377,7 +377,7 @@ QVector LoadCombatNetRadioDialogModel::removeRequest { if (!m_conflictedCnrIds.contains(idxCounter)) { - WARNING_LOG() << "Tried to get remove request for row " << idxCounter << " but it is not present."; + WARNING_LOG(m_logger) << "Tried to get remove request for row " << idxCounter << " but it is not present."; continue; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.h index 324b15538..de77997f8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/CombatNetRadioConfiguration/avm_load_combat_net_radio_dialog_model.h @@ -81,6 +81,8 @@ public Q_SLOTS: private: + +NGL::INGLLogger &m_logger; LoadCombatNetRadioDialogModel::Conflicts getConflicts(int32_t row, const CnrConfig &config); QString conflictsText(Conflicts conflicts) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_dialog.cpp index 49b9dfdae..2cb74ee22 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_dialog.cpp @@ -138,7 +138,7 @@ void EditFrequencyPlanningDialog::retranslate() void EditFrequencyPlanningDialog::onRemoveFrequencyPlanningReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << reply.str(); + ERROR_LOG(m_logger) << reply.str(); m_requestHelper->requestReply(reply); } @@ -185,7 +185,7 @@ void EditFrequencyPlanningDialog::onAddClicked() if (cnrConfigId <= 0) return; - DEBUG_LOG() << "---RessourceDialog aufrufen...." + DEBUG_LOG(m_logger) << "---RessourceDialog aufrufen...." << " cnrConfigId: " << cnrConfigId << " radioCircuit: " << cnrConfigRow.radioCircuit() << " FrequencySetId: " << m_frequencyDataModel->getFrequencySetId(); @@ -270,7 +270,7 @@ void EditFrequencyPlanningDialog::enableSelectedUnassignButton() m_buttonBox->setText(LtsWidgets::DialogButton::Add, tr("Assign")); } - DEBUG_LOG() << "---enableAssignUnassignButtons()...." + DEBUG_LOG(m_logger) << "---enableAssignUnassignButtons()...." << " cnrConfigId: " << cnrConfigId << " radioCircuitId: " << cnrConfigRow.radioCircuit(); @@ -282,7 +282,7 @@ void EditFrequencyPlanningDialog::enableSelectedUnassignButton() void EditFrequencyPlanningDialog::onAssignRadioCircuit(const FrequencyPlanningData &fpd) { - DEBUG_LOG() << "---onAssignRadioCircuit()...." + DEBUG_LOG(m_logger) << "---onAssignRadioCircuit()...." << "CnrConfigId: " << fpd.cnrConfigId(); m_frequencyDataModel->setFrequencyPlanningData(fpd); @@ -370,14 +370,14 @@ void EditFrequencyPlanningDialog::onExportButtonClicked() QByteArray byteArray = m_frequencyDataModel->uiToJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void EditFrequencyPlanningDialog::onImportButtonClicked() { - DEBUG_LOG() << "--- onImportButtonClicked() "; + DEBUG_LOG(m_logger) << "--- onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::AVMEditFrequencyPlanning)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_frequency_data_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_frequency_data_model.cpp index 52226ea58..f98277614 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_frequency_data_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_frequency_data_model.cpp @@ -153,7 +153,7 @@ EditFrequencyPlanningFrequencyDataModel::EditFrequencyPlanningFrequencyDataModel { Q_ASSERT(avmDtc); Q_ASSERT(ppmDtc); - DEBUG_LOG() << "---EditFrequencyPlanningDataMod m_frequencyPlanningData[c.id()];el() "; + DEBUG_LOG(m_logger) << "---EditFrequencyPlanningDataMod m_frequencyPlanningData[c.id()];el() "; int frequencySetId = initPlanning.frequencySetId(); std::vector fsdVec = m_avmDtc->frequencySet(frequencySetId).data(); @@ -384,14 +384,14 @@ QVariant EditFrequencyPlanningFrequencyDataModel::data(const QModelIndex &index, return QStringLiteral("-"); const auto unit = m_units[unitId]; - INFO_LOG() << " config.unitId()=" << unitId + INFO_LOG(m_logger) << " config.unitId()=" << unitId << " Str=" << unit.name(); QString unitStr; if (unit.designator().size() > 0) unitStr = QString::fromStdString(unit.designator()) + QLatin1Char('/'); unitStr.append(QString::fromStdString(unit.tacticalIdentifier())); - INFO_LOG() << "unitStr = " << unitStr; + INFO_LOG(m_logger) << "unitStr = " << unitStr; return unitStr; } @@ -606,7 +606,7 @@ void EditFrequencyPlanningFrequencyDataModel::setFrequencePlanningId(int id) m_initPlan.id(id); return; } - WARNING_LOG() << "Trying to set a new frequency planning id but there is alreay an id set (" + WARNING_LOG(m_logger) << "Trying to set a new frequency planning id but there is alreay an id set (" << m_initPlan.id() << " - " << id << ")"; } @@ -783,12 +783,12 @@ bool EditFrequencyPlanningFrequencyDataModel::checkResourceAssignments() { if (inner != outer) { - DEBUG_LOG() << "---ist ungleich cnrConfigId(A): " << p.cnrConfigId() + DEBUG_LOG(m_logger) << "---ist ungleich cnrConfigId(A): " << p.cnrConfigId() << " (B): " << pI.cnrConfigId(); } else { - DEBUG_LOG() << "---ist gleich cnrConfigId(A): " << p.cnrConfigId() + DEBUG_LOG(m_logger) << "---ist gleich cnrConfigId(A): " << p.cnrConfigId() << " (B): " << pI.cnrConfigId(); if (!m_multipleAssignedCnrIds.contains(p.cnrConfigId()) ) m_multipleAssignedCnrIds.append(p.cnrConfigId()); @@ -808,7 +808,7 @@ bool EditFrequencyPlanningFrequencyDataModel::checkResourceAssignments() qs.append(QString::number(id)); qs.append(QStringLiteral(", ")); } - DEBUG_LOG() << "---Number of multiple assigned frequency set data: " << m_multipleAssignedCnrIds.size() + DEBUG_LOG(m_logger) << "---Number of multiple assigned frequency set data: " << m_multipleAssignedCnrIds.size() << " cnrConfigIds: " << qs; #endif return bOk; @@ -906,9 +906,8 @@ QSet EditFrequencyPlanningFrequencyDataModel::getAllocatedFrequencyPlanning -FPFDelegate::FPFDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ +FPFDelegate::FPFDelegate(QObject *parent) : QStyledItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } void FPFDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_resource_data_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_resource_data_model.cpp index d763f603a..2958ca468 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_resource_data_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_edit_frequency_planning_resource_data_model.cpp @@ -88,7 +88,7 @@ bool EditFrequencyPlanningResourceDataModel::isFiltered(const AudioVideoManageme if (m_assignedFrequencySetDataIds.contains(data.id())) { - DEBUG_LOG() << "---m_assignments.size(): " << m_assignedFrequencySetDataIds.size() + DEBUG_LOG(m_logger) << "---m_assignments.size(): " << m_assignedFrequencySetDataIds.size() << " frequencySetDataId: " << data.id() << " ist bereits enthalten"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.cpp index 22d0ee2b2..689120cd8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.cpp @@ -41,7 +41,7 @@ FrequencyPlanningDialog::FrequencyPlanningDialog(LtsSession::LtsSession *session { m_ui->setupUi(this); - DEBUG_LOG() << "---FrequencyPlanningDialog() "; + DEBUG_LOG(m_logger) << "---FrequencyPlanningDialog() "; m_ui->dataView->setSelectionMode(QAbstractItemView::SingleSelection); m_ui->dataView->treeView()->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -91,7 +91,7 @@ bool FrequencyPlanningDialog::init(const std::shared_ptr &avmDtc avmDtc->enableActiveFrequencyPlanning() && ismDtc->enableMainStructureElement())) { - ERROR_LOG() << "Could not enable topics"; + ERROR_LOG(m_logger) << "Could not enable topics"; return false; } @@ -108,7 +108,7 @@ bool FrequencyPlanningDialog::init(const std::shared_ptr &avmDtc { delete m_model; m_model = nullptr; - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; return false; } @@ -300,7 +300,7 @@ void FrequencyPlanningDialog::onEditClicked() return; const FrequencyPlanning &fp = m_model->data(currentIndex, Qt::UserRole).value(); - DEBUG_LOG() << "---onEditClicked() FrequencyPlanningId: " << fp.id() << " FrequencySetDataId: " << fp.frequencySetId(); + DEBUG_LOG(m_logger) << "---onEditClicked() FrequencyPlanningId: " << fp.id() << " FrequencySetDataId: " << fp.frequencySetId(); m_copy = false; showEditDialog(m_model->data(currentIndex, Qt::UserRole).value()); @@ -440,14 +440,14 @@ void FrequencyPlanningDialog::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void FrequencyPlanningDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; if (m_model->rowCount() > 0) { QHash texts({{LtsWidgets::Button::Yes, tr("Ok")}}); @@ -484,7 +484,7 @@ void FrequencyPlanningDialog::onImportButtonClicked() return m_avmFtc->modifyFrequencyPlanningRequest(request, this); }); } - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.h index 6db7da523..bd5ccd1b9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog.h @@ -99,6 +99,8 @@ signals: void aboutToCloseMe(int); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void unsetActiveFrequencyPlanning(); void setActiveFrequencyPlanning(const ActiveFrequencyPlanning &activePlanning); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.cpp index 6d00a6281..4f5ff2502 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.cpp @@ -22,7 +22,7 @@ FrequencyPlanningDialogModel::FrequencyPlanningDialogModel(int32_t exerciseId, Q }, parent) , m_exerciseId(exerciseId) { - DEBUG_LOG() << "---FrequencyPlanningDialogModel() "; + DEBUG_LOG(m_logger) << "---FrequencyPlanningDialogModel() "; } QVariant FrequencyPlanningDialogModel::data(const QModelIndex &index, int role) const @@ -82,7 +82,7 @@ FrequencySet FrequencyPlanningDialogModel::frequencySetByIndex(const QModelIndex void FrequencyPlanningDialogModel::onFrequencyPlanningChanged(const FrequencyPlanning &data, DataModification modType) { - INFO_LOG() << "onFrequencyPlanningChanged " + INFO_LOG(m_logger) << "onFrequencyPlanningChanged " << " data.exerciseId()" << data.exerciseId() << " m_exerciseId=" << m_exerciseId; if ((data.exerciseId().is_set() && data.exerciseId().get() != m_exerciseId) @@ -100,7 +100,7 @@ QByteArray FrequencyPlanningDialogModel::modelToJson() for (int row = 0; row < rowCount(); row++) { - DEBUG_LOG() << "row =" << ": " << row; + DEBUG_LOG(m_logger) << "row =" << ": " << row; QJsonObject inner; const FrequencyPlanning &planning = m_vecData.at(row); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.h index cc4362b5e..86a4e832d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_dialog_model.h @@ -46,6 +46,8 @@ private Q_SLOTS: void onFrequencyPlanningChanged(const FrequencyPlanning &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; int32_t m_exerciseId; boost::optional m_activePlanningId; std::shared_ptr m_avmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_widget.cpp index c90ad883d..0c881c624 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_frequency_planning_widget.cpp @@ -17,12 +17,11 @@ namespace AudioVideoManagement { -FrequencyPlanningWidget::FrequencyPlanningWidget(const std::shared_ptr &avmDtc, QSet &allocatedDataSets, QWidget *parent) - : QWidget(parent) +FrequencyPlanningWidget::FrequencyPlanningWidget(const std::shared_ptr &avmDtc, QSet &allocatedDataSets, QWidget *parent) : QWidget(parent) , m_ui(new Ui::FrequencyPlanningWidget) , m_assignedFrequencySetDataIds(allocatedDataSets) - , m_avmDtc(avmDtc) -{ + , m_avmDtc(avmDtc), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); m_ui->cbFrequencyBand->addItem(toString(FrequencyBand_def::VHF), FrequencyBand_def::VHF); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.cpp index 1b9187f77..19ba4beda 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.cpp @@ -16,7 +16,7 @@ InitFrequencyPlanningDialog::InitFrequencyPlanningDialog(LtsSession::LtsSession , m_dateOfCreation(session->partitionTime()) , m_session(session) { - DEBUG_LOG() << "---InitFrequencyPlanningDialog() "; + DEBUG_LOG(m_logger) << "---InitFrequencyPlanningDialog() "; m_ui->setupUi(this); QMap frequencySets = avmDtc->frequencySets(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.h index 4146fcf2b..05db57880 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_init_frequency_planning_dialog.h @@ -34,6 +34,8 @@ signals: void newInitFrequencyPlanning(const FrequencyPlanning &); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog.h index 4259ad304..97864bf33 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog.h @@ -59,6 +59,8 @@ private Q_SLOTS: void onOk(); private: + +NGL::INGLLogger &m_logger; std::unique_ptr m_ui; LoadFrequencyPlanningDialogModel *m_model; bool m_isApplied = false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog_model.cpp index a12a67848..d2163af5f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/CombatNetRadio/FrequencyPlanning/avm_load_frequency_planning_dialog_model.cpp @@ -142,7 +142,7 @@ LoadFrequencyPlanningDialogModel::LoadFrequencyPlanningDialogModel(const Frequen , m_exerciseId(initPlan.exerciseId().is_set() ? initPlan.exerciseId().get() : 0) { Q_ASSERT(avmDtc); - DEBUG_LOG() << "---EditFrequencyPlanningDataMod m_frequencyPlanningData[c.id()];el() "; + DEBUG_LOG(m_logger) << "---EditFrequencyPlanningDataMod m_frequencyPlanningData[c.id()];el() "; m_initPlan.data().clear(); @@ -167,7 +167,7 @@ void LoadFrequencyPlanningDialogModel::setData(const QByteArray &data) if (m_initPlan.frequencySetId() != obj.value("frequencySetId")) { - ERROR_LOG() << "false frequency set!"; + ERROR_LOG(m_logger) << "false frequency set!"; return; } @@ -619,7 +619,7 @@ void LoadFrequencyPlanningDialogModel::checkConflicts() if (!item || !item->data().canConvert()) { - DEBUG_LOG() << "Could not get item for row " << row; + DEBUG_LOG(m_logger) << "Could not get item for row " << row; continue; } @@ -873,7 +873,7 @@ QVector LoadFrequencyPlanningDialogModel::planningData() if (!item || !item->data().canConvert()) { - DEBUG_LOG() << "Could not get item for row " << row; + DEBUG_LOG(m_logger) << "Could not get item for row " << row; continue; } @@ -918,9 +918,8 @@ LoadFrequencyPlanningDialogModel::ConfigTreeItem* LoadFrequencyPlanningDialogMod -DrawDelegate::DrawDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ +DrawDelegate::DrawDelegate(QObject *parent) : QStyledItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } void DrawDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_dialog.cpp index 1cd09e62b..f76bb0cb6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_dialog.cpp @@ -109,7 +109,7 @@ void ElokaDialog::setAvaSessionStatus(bool established) void ElokaDialog::onAddClicked() { - DEBUG_LOG() << "**** onAddClicked() "; + DEBUG_LOG(m_logger) << "**** onAddClicked() "; ElokaEditDialog *dialog = new ElokaEditDialog(m_session, m_avaSession, m_avmDtc, m_streamNameMapping, ElokaData(), this); @@ -128,7 +128,7 @@ void ElokaDialog::onAddClicked() void ElokaDialog::onEditClicked() { - DEBUG_LOG() << "**** onEditClicked() "; + DEBUG_LOG(m_logger) << "**** onEditClicked() "; const QModelIndex idx = m_ui->tvEloka->currentIndex(); @@ -154,7 +154,7 @@ void ElokaDialog::onEditClicked() void ElokaDialog::onRemoveClicked() { - DEBUG_LOG() << "**** onRemoveClicked() "; + DEBUG_LOG(m_logger) << "**** onRemoveClicked() "; const QModelIndex idx = m_ui->tvEloka->currentIndex(); @@ -184,7 +184,7 @@ void ElokaDialog::onPrint() void ElokaDialog::onQueryElokaResponse(const QVector &&eloka) { - DEBUG_LOG() << "onQueryElokaResponse"; + DEBUG_LOG(m_logger) << "onQueryElokaResponse"; m_elokaListCollector.start(); m_elokaModel->clear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_edit_dialog.cpp index 80769508e..41454723f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/Eloka/avm_eloka_edit_dialog.cpp @@ -351,7 +351,7 @@ void ElokaEditDialog::getActiveCnrs() void ElokaEditDialog::onCnrConfigChanged(const CnrConfig &data, DataModification modType) { - DEBUG_LOG() << "onCnrConfigChanged"; + DEBUG_LOG(m_logger) << "onCnrConfigChanged"; switch (modType) { case DataModification::eAdded: @@ -374,7 +374,7 @@ void ElokaEditDialog::onCnrConfigChanged(const CnrConfig &data, void ElokaEditDialog::onTvcConfigChanged(const TvcConfig &data, DataModification modType) { - DEBUG_LOG() << "onTvcConfigChanged"; + DEBUG_LOG(m_logger) << "onTvcConfigChanged"; switch (modType) { @@ -398,7 +398,7 @@ void ElokaEditDialog::onTvcConfigChanged(const TvcConfig &data, void ElokaEditDialog::onStreamChanged(const Stream &data, DataModification modType) { - DEBUG_LOG() << "onStreamChanged"; + DEBUG_LOG(m_logger) << "onStreamChanged"; if ((data.type() != StreamType_def::AudioOut) && (data.type() != StreamType_def::AudioInOut)) @@ -427,7 +427,7 @@ void ElokaEditDialog::onCnrTvcProfileChanged(const CnrTvcProfile &data, DataModification modType) { Q_UNUSED(modType); - DEBUG_LOG() << "onCnrTvcProfileChanged"; + DEBUG_LOG(m_logger) << "onCnrTvcProfileChanged"; if (data.exerciseId() != m_session->exerciseId() || data.operatorId() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) @@ -535,7 +535,7 @@ void ElokaEditDialog::setCurrentCircuit(const ElokaData &data) void ElokaEditDialog::onGetElokaListResponse(const QVector &actions) { - DEBUG_LOG() << "onGetElokaListResponse"; + DEBUG_LOG(m_logger) << "onGetElokaListResponse"; if (!m_elokaData.internalName.isEmpty()) setUnchangeable(true); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.cpp index df7d63333..2d4509c48 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.cpp @@ -58,7 +58,7 @@ bool MvsDialog::init(const std::shared_ptr { delete m_model; m_model = nullptr; - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; return false; } @@ -178,14 +178,14 @@ void MvsDialog::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void MvsDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::AVMMvsDialog)); @@ -211,7 +211,7 @@ void MvsDialog::onImportButtonClicked() return m_avmFtc->videoTeamModifyRequest(request, this); }); } - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.h index a3044cf9c..7f4765d35 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_dialog.h @@ -70,6 +70,8 @@ private Q_SLOTS: void onImportButtonClicked(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_edit_dialog.h index 6cb6be89a..55da771d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_edit_dialog.h @@ -41,6 +41,8 @@ Q_SIGNALS: void modifyRequest(const AudioVideoManagement::VideoTeamModifyRequest &request); protected: + +NGL::INGLLogger &m_logger; bool apply() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.cpp index aff6e95ff..008ac1543 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.cpp @@ -77,7 +77,7 @@ QByteArray MvsModel::modelToJson() for (int row = 0; row < rowCount(); row++) { - DEBUG_LOG() << "row =" << ": " << row; + DEBUG_LOG(m_logger) << "row =" << ": " << row; QJsonObject inner; const VideoTeam &config = m_vecData.at(row); inner[QStringLiteral("id")] = config.id(); @@ -118,7 +118,7 @@ QVector MvsModel::jsonToVideoTeamVector(const QByteArray config.exerciseId(m_exerciseId); config.streamName(obj[QStringLiteral("streamName")].toString().toStdString()); - INFO_LOG() << "insertRow: " << config.name() + INFO_LOG(m_logger) << "insertRow: " << config.name() << " VideoTeamId=" << config.id(); result.append(std::move(config)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.h index 788c0015e..ed6a9f416 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_model.h @@ -35,6 +35,7 @@ public: QVector jsonToVideoTeamVector(const QByteArray &content); bool isFiltered(const VideoTeam &data, DataModification modType) const override; private: +NGL::INGLLogger &m_logger; std::shared_ptr m_avmDtc; int32_t m_exerciseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.cpp index 36477afe4..f54c53947 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.cpp @@ -169,7 +169,7 @@ void MvsVideoTeamDialog::setData() bool MvsVideoTeamDialog::apply() { VideoReceiverModifyActiveRequest req; - DEBUG_LOG() << "apply m_videoTeamButtonGroup.size=" << m_videoTeamButtonGroup.size(); + DEBUG_LOG(m_logger) << "apply m_videoTeamButtonGroup.size=" << m_videoTeamButtonGroup.size(); QMap ::const_iterator itBg; for (itBg = m_videoTeamButtonGroup.constBegin(); itBg != m_videoTeamButtonGroup.constEnd(); ++itBg) { @@ -177,9 +177,9 @@ bool MvsVideoTeamDialog::apply() int mainStructureElementId = itBg.value()->checkedId(); int oldActiveId = m_dtc->getActiveVideoReceiver(teamId); - DEBUG_LOG() << "Team id = " << teamId; - DEBUG_LOG() << "Main structure element id = " << mainStructureElementId; - DEBUG_LOG() << "Old active video receiver = " << oldActiveId; + DEBUG_LOG(m_logger) << "Team id = " << teamId; + DEBUG_LOG(m_logger) << "Main structure element id = " << mainStructureElementId; + DEBUG_LOG(m_logger) << "Old active video receiver = " << oldActiveId; if (itBg.value()->checkedId() == 0) { @@ -199,7 +199,7 @@ bool MvsVideoTeamDialog::apply() req.isActive(true); req.id(m_receiverIds.value(QPair(mainStructureElementId, teamId))); } - DEBUG_LOG() << "itBg.key=" << itBg.key() + DEBUG_LOG(m_logger) << "itBg.key=" << itBg.key() << " mainStructureElementId=" << mainStructureElementId << " teamId=" << teamId << " id=" << req.id() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.h index fa99ce075..c7c92ccd7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/MobileVideoSystem/avm_mvs_video_team_dialog.h @@ -47,6 +47,8 @@ public: void onVideoReceiverModifyActiveReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } private: + +NGL::INGLLogger &m_logger; ReceiverElement *createReceiverElement(const VideoReceiver &rec); private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_edit_training_voice_communication_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_edit_training_voice_communication_dialog.h index 4e87c63e7..5865e2b51 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_edit_training_voice_communication_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_edit_training_voice_communication_dialog.h @@ -70,6 +70,8 @@ public: void retranslate() override; protected: + +NGL::INGLLogger &m_logger; bool apply() override; void onModifyTvcConfigReply(const Core::FunctionReplyObject &reply) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.cpp index 182770732..5bdd6c464 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.cpp @@ -52,7 +52,7 @@ bool TrainingVoiceCommunicationDialog::init(const std::shared_ptrenableModifyTvcConfig() && avmFtc->enableRemoveTvcConfig())) { - ERROR_LOG() << "Could not enable topics"; + ERROR_LOG(m_logger) << "Could not enable topics"; return false; } @@ -68,7 +68,7 @@ bool TrainingVoiceCommunicationDialog::init(const std::shared_ptrsaveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void TrainingVoiceCommunicationDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::AVMTrainingVoiceCommunication)); @@ -201,7 +201,7 @@ void TrainingVoiceCommunicationDialog::onImportButtonClicked() }); } (void) m_requestHelper->startRequests(); - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.h index 7c0dab3c2..37fd80622 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog.h @@ -72,6 +72,8 @@ private Q_SLOTS: void onImportButtonClicked(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.cpp index b6103cf4f..f2e195c1a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.cpp @@ -113,7 +113,7 @@ QVector TrainingVoiceCommunicationDialogModel::jsonToTvc config.recording(obj[QLatin1String("recording")].toBool()); config.tetraChannelId(obj[QLatin1String("tetraChannelId")].toInt()); - INFO_LOG() << "insertRow: " << config.radioCircuit() + INFO_LOG(m_logger) << "insertRow: " << config.radioCircuit() << " tvcChannelId=" << config.tetraChannelId(); result.push_back(std::move(config)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.h index 9a1c7fad6..00639ae9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/AudioVideoManagement/Gui/TrainingVoiceCommunication/avm_training_voice_communication_dialog_model.h @@ -35,6 +35,8 @@ public: QVector jsonToTvcConfigVector(const QByteArray &content) const; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_avmDtc; int32_t m_exerciseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.cpp index eb0d14bfd..b69706d4f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.cpp @@ -230,16 +230,16 @@ void BuildingManager::Tick(const dtEntity::Message &message) dtEntityOSG::LayerAttachPointComponent *lac; if (!mEntityManager->GetComponent(dspl.mAttachPointId, lac)) { - WARNING_LOG() << "NO sLayerAttachPointComponent"; + WARNING_LOG(m_logger) << "NO sLayerAttachPointComponent"; return; } if( shotdspl.mGeode.valid()) { - DEBUG_LOG() << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables(); + DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT drawables: !" << shotdspl.mGeode->getNumDrawables(); while (shotdspl.mGeode->getNumDrawables() > 0) shotdspl.mGeode->removeDrawables(0, shotdspl.mGeode->getNumDrawables()); bool ret = lac->GetNode()->asGroup()->removeChild(shotdspl.mGeode); - DEBUG_LOG() << "displayTimeOver OVER KILL IT! result: " << ret; + DEBUG_LOG(m_logger) << "displayTimeOver OVER KILL IT! result: " << ret; dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId); @@ -248,7 +248,7 @@ void BuildingManager::Tick(const dtEntity::Message &message) if (lifeTimeOver) { - DEBUG_LOG() << "lifeTimeOver OVER ERASE IT!"; + DEBUG_LOG(m_logger) << "lifeTimeOver OVER ERASE IT!"; itShotDisplay = dspl.mShotDisplays.erase(itShotDisplay); } else @@ -280,7 +280,7 @@ bool BuildingManager::getFloorOfRoom(const std::string &bdlgFeatureId, int roomN void BuildingManager::updateShotDuration(unsigned int newDuration_s) { - DEBUG_LOG() << Q_FUNC_INFO << " newDuration_s= " << newDuration_s; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " newDuration_s= " << newDuration_s; QMutexLocker locker(&m_mutexShots); @@ -294,7 +294,7 @@ void BuildingManager::updateShotDuration(unsigned int newDuration_s) if (!building->mDisplays.empty()) { BuildingDisplay buildingDisplay = building->mDisplays.front(); - DEBUG_LOG() << Q_FUNC_INFO << " buildingDisplay.mContextId " << buildingDisplay.mContextId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " buildingDisplay.mContextId " << buildingDisplay.mContextId; updateShots(*building, buildingDisplay); dtEntity::GetWindowInterface()->RequestRedraw(buildingDisplay.mContextId); } @@ -426,7 +426,7 @@ bool BuildingManager::displayBuilding(const std::string& featureId, unsigned int bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId buildingid, const osg::Vec4& bgcolor, ViewMode viewmode, bool exactPos) { - DEBUG_LOG() << "BuildingManager::displayBuilding"; + DEBUG_LOG(m_logger) << "BuildingManager::displayBuilding"; mExactPos = exactPos; dtEntity::EntityManager &em = *mEntityManager; @@ -629,7 +629,7 @@ bool BuildingManager::displayBuilding(unsigned int contextid, dtEntity::EntityId { - DEBUG_LOG() << "mDevices.size = " << building->mDevices.size(); + DEBUG_LOG(m_logger) << "mDevices.size = " << building->mDevices.size(); if (!building->mDevices.empty()) { for (Device *d : building->mDevices) @@ -1333,7 +1333,7 @@ void BuildingManager::updatePlayerPosition(const std::string &navmeshgrpname, dt osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisplay &dspl, const osg::Vec3d &world, int roomNumber) { - DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str() << ", roomNumber= " << roomNumber; if (roomNumber > 0) @@ -1349,7 +1349,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp if (level.mFloorId == floorOut) { const osg::Vec3d &l = world * bd.mWorldToLocal; - DEBUG_LOG() << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " mFeatureId = " << bd.mFeatureId.c_str() << ", roomNumber= " << roomNumber << ", floorOut= " << floorOut << ", world.z()= " << world.z() @@ -1369,7 +1369,7 @@ osg::Vec3d BuildingManager::remapPosition(const Building &bd, const BuildingDisp if (i == (numlevels - 1) || (dspl.mLevels[i + 1].mHeightAboveGround - 0.1f) > l[2]) { const BuildingLevel &level = dspl.mLevels[i]; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " remapXPosition" << ", l.z=" << l.z() << ", i=" << i @@ -1603,11 +1603,11 @@ dtEntity::EntityId BuildingManager::getWorldPlayerIdFromLocalPlayer(dtEntity::En void BuildingManager::removeShoot(int32_t id) { - DEBUG_LOG() << "removeShoot id=" << id; + DEBUG_LOG(m_logger) << "removeShoot id=" << id; QMutexLocker locker(&m_mutexShots); for (Building *bldg : mBuildings) { - DEBUG_LOG() << "Vorher: bldg->mShots.size()=" << bldg->mShots.size(); + DEBUG_LOG(m_logger) << "Vorher: bldg->mShots.size()=" << bldg->mShots.size(); auto it = std::remove_if(bldg->mShots.begin(), bldg->mShots.end(), [id]( Shot *shot) { @@ -1625,12 +1625,12 @@ void BuildingManager::removeShoot(int32_t id) bool wasRemoved = (it != bldg->mShots.end()); bldg->mShots.erase(it, bldg->mShots.end()); - DEBUG_LOG() << "Nachher: bldg->mShots.size()=" << bldg->mShots.size(); + DEBUG_LOG(m_logger) << "Nachher: bldg->mShots.size()=" << bldg->mShots.size(); if (wasRemoved) for (BuildingDisplay &dspl : bldg->mDisplays) { - DEBUG_LOG() << "wasRemoved id=" << id; + DEBUG_LOG(m_logger) << "wasRemoved id=" << id; updateShots(*bldg, dspl); dtEntity::GetWindowInterface()->RequestRedraw(dspl.mContextId); } @@ -1694,13 +1694,13 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity } } bldg->mShots.push_back(shot); - DEBUG_LOG() << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <GetSimulationTime(), 'f', 5); + DEBUG_LOG(m_logger) << "XXXX SIM TIME CREATED = " << QString::number(_simTimeCreated, 'f', 5) << " and SIM TIME IS " <GetSimulationTime(), 'f', 5); for (BuildingDisplay &bldgDispl : bldg->mDisplays) { ShotDisplay shotDispl; shotDispl.mShot = shot; - DEBUG_LOG() << "mShotDisplays.push_back id=" << shot->getId(); + DEBUG_LOG(m_logger) << "mShotDisplays.push_back id=" << shot->getId(); bldgDispl.mShotDisplays.push_back(std::move(shotDispl)); updateShots(*bldg, bldgDispl); @@ -1715,7 +1715,7 @@ void BuildingManager::showShoot(int32_t id, dtEntity::EntityId shooter, dtEntity void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) { - DEBUG_LOG() << Q_FUNC_INFO << " Building= " << bd.mWorldBuildingId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Building= " << bd.mWorldBuildingId; dtEntityOSG::CameraComponent *camcomp; if (!mEntityManager->GetComponent(dspl.mCameraId, camcomp)) @@ -1728,7 +1728,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) const double simTime = dtEntity::GetSystemInterface()->GetSimulationTime(); - DEBUG_LOG() << Q_FUNC_INFO << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dspl.mShotDisplays.size()= " << dspl.mShotDisplays.size() << ", simTime=" << (int)simTime; for (ShotDisplay &shotdspl : dspl.mShotDisplays) @@ -1754,7 +1754,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) if (shotdspl.mGeode) numParents = shotdspl.mGeode->getNumParents(); - DEBUG_LOG() << Q_FUNC_INFO << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " BB shotdspl.mShot->getId()= " << shotdspl.mShot->getId() << ", shotdspl.mGeode=" << shotdspl.mGeode << ", shotdspl.mGeode->getNumParents=" << numParents << ", bDisplay=" << bDisplay; @@ -1762,7 +1762,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) if ((!shotdspl.mGeode || shotdspl.mGeode->getNumParents() == 0) && bDisplay) { - DEBUG_LOG() << "NEW mGeode! id " << shotdspl.mShot->getId(); + DEBUG_LOG(m_logger) << "NEW mGeode! id " << shotdspl.mShot->getId(); if (!shotdspl.mGeode) shotdspl.mGeode = new osg::Geode(); @@ -1770,7 +1770,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) ss->setMode(GL_DEPTH_TEST, osg::StateAttribute::OFF); ss->setRenderBinDetails(240001, "RenderBin"); osg::ref_ptr lw = new osg::LineWidth(); - DEBUG_LOG() << "NEW LINE " << shotdspl.mShot->getLineType(); + DEBUG_LOG(m_logger) << "NEW LINE " << shotdspl.mShot->getLineType(); if (shotdspl.mShot->getLineType() < 2 ) { @@ -1806,7 +1806,7 @@ void BuildingManager::updateShots(const Building &bd, BuildingDisplay &dspl) shooterpos[2] += 1; targetpos[2] += 1; - DEBUG_LOG() << Q_FUNC_INFO << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " shotdspl.mShot->getId()= " << shotdspl.mShot->getId() << ", getShooterPos.z()=" << shotdspl.mShot->getShooterPos().z() << ", BuildingIdSrc=" << shotdspl.mShot->getBuildingIdSrc() << ", RoomNumberSrc=" << shotdspl.mShot->getRoomNumberSrc() << ", shooterpos=" << shooterpos @@ -1906,16 +1906,16 @@ void BuildingManager::updateDevices(const Building &bd, BuildingDisplay &dspl) void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntity::EntityId buildingid, const osg::Vec3d &pos, const std::string &iconpath) { - DEBUG_LOG() << "addDeviceToBuilding"; + DEBUG_LOG(m_logger) << "addDeviceToBuilding"; for (Building *building : mBuildings) { - DEBUG_LOG() << "mWorldBuildingId=" << building->mWorldBuildingId + DEBUG_LOG(m_logger) << "mWorldBuildingId=" << building->mWorldBuildingId << " buildingid=" << buildingid; if (building->mWorldBuildingId != buildingid) continue; - DEBUG_LOG() << "addDeviceToBuilding 1"; + DEBUG_LOG(m_logger) << "addDeviceToBuilding 1"; Device *device = new Device(); device->mWorldPlayerId = iconmainid; @@ -1923,10 +1923,10 @@ void BuildingManager::addDeviceToBuilding(dtEntity::EntityId iconmainid, dtEntit device->mPosition = pos; building->mDevices.push_back(device); - DEBUG_LOG() << "building->mDisplays.size=" << building->mDisplays.size(); + DEBUG_LOG(m_logger) << "building->mDisplays.size=" << building->mDisplays.size(); for (BuildingDisplay &dspl : building->mDisplays) { - DEBUG_LOG() << "addDeviceToBuilding 2"; + DEBUG_LOG(m_logger) << "addDeviceToBuilding 2"; DeviceDisplay dd; dd.mDevice = device; dd.mWorldPlayerId = iconmainid; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.h index 1d24adbfd..66ea51a4a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/buildingmanager.h @@ -196,6 +196,7 @@ public: int32_t getId() const { return mId; } private: + NGL::INGLLogger &m_logger; int32_t mId; osg::Vec3d mShooterPos; osg::Vec3d mTargetPos; @@ -424,6 +425,7 @@ public: void setCallbackCamPosChanged(const CallbackCamPosChanged &cb); private: + NGL::INGLLogger &m_logger; void updateShots(const Building &bd, BuildingDisplay &dspl); void updateDevices(const Building &bd, BuildingDisplay &dspl); void createRoomNames(dtEntity::EntityId buildingid, Building& building); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/viewerinterfaceimpl.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/viewerinterfaceimpl.h index 18c7fa338..54d413045 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/viewerinterfaceimpl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/BgViewer/viewerCtrl/viewerinterfaceimpl.h @@ -308,6 +308,8 @@ public: } private: + +NGL::INGLLogger &m_logger; bool open(const std::string& strFeatureID, bool exactPos); bool open(const std::vector &vecFeatureIDs, bool exactPos); bool openAll(bool exactPos); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.cpp index 68b264232..80962c68b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.cpp @@ -70,7 +70,7 @@ void CommunicationInterfaceInternal::playerPlace(int playerID, const LtsUtils::Q auto it = m_playerId2String.find(playerID); if (it == m_playerId2String.end()) { - WARNING_LOG() << "Trying to set player position for unknown (=not created) player with id " << playerID; + WARNING_LOG(m_logger) << "Trying to set player position for unknown (=not created) player with id " << playerID; return; } @@ -148,7 +148,7 @@ void CommunicationInterfaceInternal::playerHit(const int32_t id, int playerIdSrc int buildingIdSrc, int roomNumberSrc, int buildingIdDst, int roomNumberDst, int lineType, int64_t time) { - DEBUG_LOG() << "playerHit id= " << id; + DEBUG_LOG(m_logger) << "playerHit id= " << id; const std::string playerIdStrDst = m_playerId2String.value(playerIdDst); const std::string playerIdStrSrc = m_playerId2String.value(playerIdSrc); const VCtrl::Vec3d src(posSrc.x(), posSrc.y(), posSrc.z()); @@ -162,7 +162,7 @@ void CommunicationInterfaceInternal::playerHit(const int32_t id, int playerIdSrc void CommunicationInterfaceInternal::buildingHit(const int32_t id, int buildingId, int damagePercent, const QMap& mapRoomDestructions) { - DEBUG_LOG() << "buildingHit for building " << buildingId + DEBUG_LOG(m_logger) << "buildingHit for building " << buildingId << " id=" << id << " damagePercent " << damagePercent << " roomlist size: " << mapRoomDestructions.size(); @@ -181,12 +181,12 @@ void CommunicationInterfaceInternal::buildingHit(const int32_t id, int buildingI for (auto it = mapRoomDestructions.begin(); it != mapRoomDestructions.end(); ++it) { const int roomNumber = it.key(); - DEBUG_LOG() << "BuildingId " << buildingId + DEBUG_LOG(m_logger) << "BuildingId " << buildingId << ", room: "<< roomNumber << ", destruction: " << it.value(); std::string roomNumberStr = createRoomNumberString(roomNumber); if (!m_pviewerInterface->SetRoomDestructionValue(buildingIdStr, roomNumberStr,it.value() / 100.f)) - ERROR_LOG() << "SetRoomDestructionValue failed for room "<< roomNumber; + ERROR_LOG(m_logger) << "SetRoomDestructionValue failed for room "<< roomNumber; } } } @@ -201,7 +201,7 @@ void CommunicationInterfaceInternal::roomHit(const int32_t id, int playerIdSrc, const std::string roomNumberStrDst = createRoomNumberString(roomNumber); const VCtrl::Vec3d src(posSrc.x(), posSrc.y(), posSrc.z()); - DEBUG_LOG() << "roomHit for building palyer " << playerIdStrSrc + DEBUG_LOG(m_logger) << "roomHit for building palyer " << playerIdStrSrc << " building " << buildingIdStrDst << " room " << roomNumberStrDst << " id=" << id; @@ -212,7 +212,7 @@ void CommunicationInterfaceInternal::roomHit(const int32_t id, int playerIdSrc, void CommunicationInterfaceInternal::removeRoomHit(const int32_t id) { - DEBUG_LOG() << "removeRoomHit id=" << id; + DEBUG_LOG(m_logger) << "removeRoomHit id=" << id; m_pviewerInterface->removeShoot(id); } @@ -285,21 +285,21 @@ void CommunicationInterfaceInternal::systemSetMountingPoint(const Infrastructure if(!show) { - DEBUG_LOG() << "Hiding mounting point \"" << mountingPointName<< "\""; + DEBUG_LOG(m_logger) << "Hiding mounting point \"" << mountingPointName<< "\""; m_pviewerInterface->HideDeviceIcon(mountingPointName.toStdString()); return; } if(m_deviceMap.contains(mountingPointName)) { - WARNING_LOG() << "Trying to add a mounting point which was already added - trying to re-add"; + WARNING_LOG(m_logger) << "Trying to add a mounting point which was already added - trying to re-add"; m_pviewerInterface->HideDeviceIcon(mountingPointName.toStdString()); } const VCtrl::Vec3d position(x,y,z); if(m_pviewerInterface->ShowDeviceIcon(mountingPointName.toStdString(), buildingIdStr, position, filename.toStdString())) { - DEBUG_LOG() << "Added mounting point to scene: " << mountingPointName; + DEBUG_LOG(m_logger) << "Added mounting point to scene: " << mountingPointName; m_deviceMap[mountingPointName] = DeviceInfo(buildingId, mountingPointName); } } @@ -333,7 +333,7 @@ void CommunicationInterfaceInternal::excDeleteBuildingList() void CommunicationInterfaceInternal::excSetHitlineDuration(uint32_t duration_s) { - DEBUG_LOG() << "excSetHitlineDuration=" << duration_s; + DEBUG_LOG(m_logger) << "excSetHitlineDuration=" << duration_s; m_pviewerInterface->setHitLineDuration(duration_s); } @@ -451,7 +451,7 @@ void CommunicationInterfaceInternal::clearCameras() if (!di.deviceName.startsWith(QLatin1String("Camera"))) continue; if (!m_pviewerInterface->HideDeviceIcon(di.deviceName.toStdString())) - ERROR_LOG() << "Could not remove camera with id " << di.deviceName; + ERROR_LOG(m_logger) << "Could not remove camera with id " << di.deviceName; } m_deviceMap.clear(); } @@ -497,10 +497,10 @@ void CommunicationInterfaceInternal::PlayerPicked(const std::string &strId) QString str = QString::fromStdString(strId); int structureElementId = str.remove(0, str.lastIndexOf(QStringLiteral("_")) + 1).toInt(); - INFO_LOG() << "Picked mounting point with id " << strId + INFO_LOG(m_logger) << "Picked mounting point with id " << strId << " mountingPointId=" << structureElementId; if(structureElementId < 0) { - WARNING_LOG() << "Picked mounting point with id " << strId; + WARNING_LOG(m_logger) << "Picked mounting point with id " << strId; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.h index b9b6b9a29..a4af78bf7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_communication_interface_internal.h @@ -137,6 +137,8 @@ Q_SIGNALS: private: + +NGL::INGLLogger &m_logger; void clearCameras(); QHash m_deviceMap; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.cpp index d7992c5c5..bbe2d53bf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.cpp @@ -182,7 +182,7 @@ QString BgViewerController::buildingModelPath() void BgViewerController::clearInterfaces(const LtsSession::DdsConnectionParams &conParams) { - DEBUG_LOG() << "BgViewerControllerSingleton::clearInterfaces()"; + DEBUG_LOG(m_logger) << "BgViewerControllerSingleton::clearInterfaces()"; if (m_pBgViewerDDSController && m_currentDdsConnParams == conParams) { m_pBgViewerDDSController->uninitialize(); @@ -219,13 +219,13 @@ PluginProvider *BgViewerController::activeSession() const bool BgViewerController::init(PluginProvider *pSession, bool bStartRendering, const QString &modelPath) { - DEBUG_LOG() << "getDdsController init: " << pSession->toString(); + DEBUG_LOG(m_logger) << "getDdsController init: " << pSession->toString(); if (m_currentDdsConnParams == pSession->connParams()) { if (m_initExerciseWasSuccessful) { - DEBUG_LOG() << "BgViewerControllerSingleton::init Already initialized"; + DEBUG_LOG(m_logger) << "BgViewerControllerSingleton::init Already initialized"; slotLoadBuilding(); @@ -251,7 +251,7 @@ bool BgViewerController::forceInit(PluginProvider *pSession) delete m_pBgViewerDDSController; m_pBgViewerDDSController = new BuildingViewerDdsController(m_comIfc, m_viewerInterface); - DEBUG_LOG() << "FORCE INIT! with " << pSession; + DEBUG_LOG(m_logger) << "FORCE INIT! with " << pSession; return (m_pBgViewerDDSController->init(m_bgViewerBaseLayoutWidget, buildingModelPath(), pSession)); } @@ -281,11 +281,11 @@ void BgViewerController::showBgViewerInfoMessageBox() bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSession) { - DEBUG_LOG() << std::hex << this << " startBgViewerAppInSession " << (m_currentDdsConnParams == pStartingSession->connParams()); + DEBUG_LOG(m_logger) << std::hex << this << " startBgViewerAppInSession " << (m_currentDdsConnParams == pStartingSession->connParams()); if (m_bgvApp && (m_currentDdsConnParams == pStartingSession->connParams())) { - INFO_LOG() << std::hex << this << " BuildingViewer already opened. Doing nothing..."; + INFO_LOG(m_logger) << std::hex << this << " BuildingViewer already opened. Doing nothing..."; return true; } @@ -298,7 +298,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess if (m_bgvApp) { - DEBUG_LOG() << std::hex << this << " Releasing m_bgvApp"; + DEBUG_LOG(m_logger) << std::hex << this << " Releasing m_bgvApp"; delete m_bgvApp; m_bgvApp = nullptr; @@ -310,7 +310,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess m_bgvApp = LtsAppManager::LtsAppManager::getInstance()->createApp(LtsAppDescriptor::App::BuildingViewer, pStartingSession->connParams()); if (!m_bgvApp || !m_bgvApp->sessions().size()) { - ERROR_LOG() << std::hex << this << " m_bgvApp is nullptr or has no associated session!"; + ERROR_LOG(m_logger) << std::hex << this << " m_bgvApp is nullptr or has no associated session!"; return false; } @@ -335,7 +335,7 @@ bool BgViewerController::startBgViewerAppInSession(PluginProvider* pStartingSess connect(m_bgvApp, &LtsPluginManager::LtsPluginManager::destroyed, this, [this]() { - DEBUG_LOG() << std::hex << this << " LtsPluginManager destroyed m_bgvApp"; + DEBUG_LOG(m_logger) << std::hex << this << " LtsPluginManager destroyed m_bgvApp"; m_tickTimer->stop(); clearInterfaces(m_currentDdsConnParams); m_comIfc->excCloseAllViews(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.h index 592a5302c..6b210c18a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_controller.h @@ -102,6 +102,8 @@ private slots: void slotWidgetReleased(); private: + +NGL::INGLLogger &m_logger; void showBgViewerInfoMessageBox(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.cpp index 7850a4e5e..1bebf5e9f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.cpp @@ -35,10 +35,9 @@ static inline QString gStrSymbolFolderPath() return QDir::tempPath() + QStringLiteral("/excon_bgviewer_symbols/"); } -BuildingViewerDdsController::BuildingViewerDdsController(CommunicationInterfaceInternal *connection, VCtrl::ViewerInterface* viewerInterface) - : m_connection(connection) - , m_viewerInterface(viewerInterface) -{} +BuildingViewerDdsController::BuildingViewerDdsController(CommunicationInterfaceInternal *connection, VCtrl::ViewerInterface* viewerInterface) : m_connection(connection) + , m_viewerInterface(viewerInterface), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} BuildingViewerDdsController::~BuildingViewerDdsController() @@ -52,7 +51,7 @@ BuildingViewerDdsController::~BuildingViewerDdsController() bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QString &modelPath, PluginProvider *session) { - DEBUG_LOG() << "BDV:: init"; + DEBUG_LOG(m_logger) << "BDV:: init"; m_session = session; m_irreplacableWidget = irreplacableWidget; @@ -61,7 +60,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin if (!m_session) { - ERROR_LOG() << "No m_session for BuildingViewerController!"; + ERROR_LOG(m_logger) << "No m_session for BuildingViewerController!"; return false; } @@ -71,7 +70,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin { m_session = nullptr; - DEBUG_LOG() << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!"; + DEBUG_LOG(m_logger) << getSessionInfo() << "BDV:: BuildingViewerDdsController: m_session has been destroyed!"; stopAndClearTimer(); uninitialize(); } @@ -80,35 +79,35 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin m_asbIfc = session->asbIfc(); if (!m_asbIfc) { - ERROR_LOG() << "Fetching 'm_asbIfc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_asbIfc' failed!"; return false; } m_bldDtc = session->bldDtc(); if (!m_bldDtc) { - ERROR_LOG() << "Fetching 'm_bldDtc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!"; return false; } m_ismDtc = session->ismDtc(); if (!m_ismDtc) { - ERROR_LOG() << "Fetching 'm_ismDtc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_ismDtc' failed!"; return false; } m_pdmDtc = session->pdmDtc(); if (!m_pdmDtc) { - ERROR_LOG() << "Fetching 'm_pdmDtc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_pdmDtc' failed!"; return false; } m_ismIfc = session->ismDataIfc(); if (!m_ismIfc) { - WARNING_LOG() << "Fetching 'm_ismIfc' failed!"; + WARNING_LOG(m_logger) << "Fetching 'm_ismIfc' failed!"; return false; } connect(m_ismIfc.get(), &InfrastructureManagement::ForeignDataInterface::mountingPointChanged, @@ -132,7 +131,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin if (!dir.mkpath(QStringLiteral("."))) { - ERROR_LOG() << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!"; + ERROR_LOG(m_logger) << getSessionInfo() << "Could not create path \"" << gStrSymbolFolderPath() << "\" which is required to store BgViewer symbol files!"; return false; } @@ -140,7 +139,7 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin connect(m_connection, &CommunicationInterfaceInternal::signalAssetPicked, this, &BuildingViewerDdsController::onAssetPicked, Qt::UniqueConnection); connect(m_connection, &CommunicationInterfaceInternal::signalBgViewerInitFinished, this, &BuildingViewerDdsController::onBgViewerInitFinished, Qt::UniqueConnection); - INFO_LOG() << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]"; + INFO_LOG(m_logger) << getSessionInfo() << "BuildingViewerDdsController::init: The order of the following output must be [1],[2],[3],[4],[5],[6]"; @@ -169,10 +168,10 @@ bool BuildingViewerDdsController::init(QWidget *irreplacableWidget, const QStrin void BuildingViewerDdsController::onBgViewerInitFinished() { - DEBUG_LOG() << "onBgViewerInitFinished"; + DEBUG_LOG(m_logger) << "onBgViewerInitFinished"; - INFO_LOG() << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer"; - INFO_LOG() << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer"; + INFO_LOG(m_logger) << getSessionInfo() << "[2] Training area initialization acknowledged by BgViewer"; + INFO_LOG(m_logger) << getSessionInfo() << "[3] Sending mounting points, teams, ..., to BgViewer"; if (!m_pSimTimeSyncTimer) { @@ -192,7 +191,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished() const bool useExactPositioning = ps->value(QStringLiteral("bld"), QStringLiteral("useExactPositioning")).toBool(); m_connection->excUseExactPositioning(useExactPositioning); - INFO_LOG() << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')"; + INFO_LOG(m_logger) << getSessionInfo() << "[4] Getting building DDS data ('mainStructureElements')"; connect(m_ismDtc.get(), &InfrastructureManagement::Interface::Dtc::mainStructureElementChanged, this, &BuildingViewerDdsController::onMainStructureElementChanged); @@ -200,17 +199,17 @@ void BuildingViewerDdsController::onBgViewerInitFinished() { onMainStructureElementChanged(data, DataModification::eAdded); }); - INFO_LOG() << getSessionInfo() << "\t[4.1] Done"; + INFO_LOG(m_logger) << getSessionInfo() << "\t[4.1] Done"; - INFO_LOG() << getSessionInfo() << "[5] Creating participants"; + INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating participants"; createParticipants(); - INFO_LOG() << getSessionInfo() << "\t[5.1] Done"; - INFO_LOG() << getSessionInfo() << "[5] Creating Booby Trap"; + INFO_LOG(m_logger) << getSessionInfo() << "\t[5.1] Done"; + INFO_LOG(m_logger) << getSessionInfo() << "[5] Creating Booby Trap"; createBoobyTraps(); - INFO_LOG() << getSessionInfo() << "\t[5.2] Done"; + INFO_LOG(m_logger) << getSessionInfo() << "\t[5.2] Done"; - INFO_LOG() << getSessionInfo() << "[6] Getting building DDS data ('buildingStates')"; + INFO_LOG(m_logger) << getSessionInfo() << "[6] Getting building DDS data ('buildingStates')"; connect(m_bldDtc.get(), &Buildings::Interface::Dtc::buildingStateChanged, this, &BuildingViewerDdsController::onBuildingStateChanged, Qt::UniqueConnection); m_bldDtc->buildingStates([this](const Buildings::BuildingState & data) @@ -219,7 +218,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished() }); connect(m_bldDtc.get(), &Buildings::Interface::Dtc::buildingHitLineInfoChanged, this, &BuildingViewerDdsController::onBuildingHitLineInfoChanged, Qt::UniqueConnection); - INFO_LOG() << getSessionInfo() << "\t[6.1] Done"; + INFO_LOG(m_logger) << getSessionInfo() << "\t[6.1] Done"; m_connection->excSetGlobalTransparency(LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("GlobalTransparency"), 75).toInt() ); @@ -259,7 +258,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished() } m_pBuildingHitlineCleanupTimer->start(); - INFO_LOG() << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'"; + INFO_LOG(m_logger) << getSessionInfo() << "[7] Emitting 'signalDdsInitFinished'"; m_ddsInitFinished = true; emit signalDdsInitFinished(); onSynchronizeSimulationTime(); @@ -269,7 +268,7 @@ void BuildingViewerDdsController::onBgViewerInitFinished() void BuildingViewerDdsController::stopAndClearTimer() { - DEBUG_LOG() << "stopAndClearTimer"; + DEBUG_LOG(m_logger) << "stopAndClearTimer"; if (m_pFireEventFlashTimer) m_pFireEventFlashTimer->stop(); @@ -284,15 +283,15 @@ void BuildingViewerDdsController::stopAndClearTimer() void BuildingViewerDdsController::uninitialize() { - DEBUG_LOG() << "uninitialize"; + DEBUG_LOG(m_logger) << "uninitialize"; if (!m_bldDtc) return; if (m_ddsInitFinished) - DEBUG_LOG() << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely"; + DEBUG_LOG(m_logger) << "Flag 'm_ddsInitFinished' set which means that initialization had been finished completely"; else - WARNING_LOG() << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!"; + WARNING_LOG(m_logger) << "Flag 'm_ddsInitFinished' has not been set within timeout value, forcing quit!"; stopAndClearTimer(); @@ -321,7 +320,7 @@ void BuildingViewerDdsController::uninitialize() m_ddsInitFinished = false; m_buildingHeight.clear(); - DEBUG_LOG() << "BuildingViewerDdsController::uninitialize() finished"; + DEBUG_LOG(m_logger) << "BuildingViewerDdsController::uninitialize() finished"; } QPointF BuildingViewerDdsController::toRelativePosition(const Core::GeoPosition &geoPos) const @@ -344,7 +343,7 @@ LtsUtils::QPoint3D BuildingViewerDdsController::toRelative3D(const Core::GeoPosi bool BuildingViewerDdsController::clear() { - DEBUG_LOG() << "clear m_connection->playerClear();"; + DEBUG_LOG(m_logger) << "clear m_connection->playerClear();"; m_connection->playerClear(); return true; } @@ -354,7 +353,7 @@ bool BuildingViewerDdsController::syncTeams() { if (!m_ppmDtc) return false; - INFO_LOG() << "BuildingViewerDdsController::syncTeams"; + INFO_LOG(m_logger) << "BuildingViewerDdsController::syncTeams"; m_connection->setTeamConfiguration(m_ppmDtc->partys()); return true; @@ -386,7 +385,7 @@ bool BuildingViewerDdsController::calcBaseCoordinate(const QMapdisconnect(this); @@ -444,17 +443,17 @@ bool BuildingViewerDdsController::writeBuildingDataToXML(const QString &modelPat continue; if (!m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId)) { - DEBUG_LOG() << "Not writing mse with id " << mse.id() << " to building xml file since it is not assigned to the current exercise which has id " << m_exerciseId; + DEBUG_LOG(m_logger) << "Not writing mse with id " << mse.id() << " to building xml file since it is not assigned to the current exercise which has id " << m_exerciseId; continue; } mseMap.insert(mse.id(), mse); } } - INFO_LOG() << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size(); + INFO_LOG(m_logger) << getSessionInfo() << "writeBuildingDataToXML(): Identified Main Structure Elements: " << mseMap.size(); if (!calcBaseCoordinate(mseMap)) { - WARNING_LOG() << "failed to calc base coordinate"; + WARNING_LOG(m_logger) << "failed to calc base coordinate"; return false; } @@ -530,7 +529,7 @@ QString BuildingViewerDdsController::getBuildingConfigurationXml() const void BuildingViewerDdsController::clearAssets() { - INFO_LOG() << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets"; + INFO_LOG(m_logger) << "clearAssets: Removing " << m_knownAssetsInBgViewer.size() << " assets"; for (const auto &strUniqueAsset : std::as_const(m_knownAssetsInBgViewer)) m_connection->extHideMountingPointAsset(strUniqueAsset); @@ -635,13 +634,13 @@ void BuildingViewerDdsController::handleMountingPoint(const InfrastructureManage QString strfeatureID = BuildingViewer::databaseId2FeatureId(mp.buildingId()); QString strMountingPointID = strfeatureID + QStringLiteral("_MountingPoint_") + QString::number(mountingPointId); - DEBUG_LOG() << "Sending asset for building id " << mp.buildingId() << " ("<excDeleteBuildingList(); - INFO_LOG() << getSessionInfo() << "[1] Initializing BgViewer with training area..."; + INFO_LOG(m_logger) << getSessionInfo() << "[1] Initializing BgViewer with training area..."; if (modelPath.isEmpty()) { QString strErr = tr("Error initializing Building Viewer - can not find map directory."); - DEBUG_LOG() << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr; + DEBUG_LOG(m_logger) << getSessionInfo() << "setCurrentTrainingAreaMap: " << strErr; QWidget *parentWidgetx = (m_viewerInterface ? m_viewerInterface->getMainWindow() : nullptr); LtsWidgets::LtsMessageDialog::showMessage(parentWidgetx, strErr, tr("Error")); return; } - INFO_LOG() << "Map path for building viewer: " << modelPath; + INFO_LOG(m_logger) << "Map path for building viewer: " << modelPath; writeBuildingDataToXML(modelPath); @@ -715,14 +714,14 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement if (participant.id() == 0) { if (m_logger.isDebugEnabled()) - DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)"; + DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling invalid participant with invalid id (0)"; return false; } if (participant.isDeleted()) { - DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id " + DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id " << participant.id() << " since it is marked as 'deleted'"; return false; } @@ -733,7 +732,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement if (!m_session->isVisibleParty(participant.partyId())) { - DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id " + DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id " << participant.id() << " since it is not visible for party with id " << participant.partyId(); return false; } @@ -746,7 +745,7 @@ bool BuildingViewerDdsController::isValidParticipant(const ParticipantManagement if(tc == ParticipantManagement::TypeClass_def::SupportUnit || tc == ParticipantManagement::TypeClass_def::Unit) { - DEBUG_LOG() << getSessionInfo() << "isValidParticipant: Not handling participant with id " + DEBUG_LOG(m_logger) << getSessionInfo() << "isValidParticipant: Not handling participant with id " << participant.id() << " since its type is 'SupportUnit', 'Unit' or 'Structure'"; return false; } @@ -758,7 +757,7 @@ void BuildingViewerDdsController::createBoobyTraps() { if (!m_aesDtc) return; - DEBUG_LOG() << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition(); + DEBUG_LOG(m_logger) << "BDV:: create Booby Traps: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition(); m_aesDtc->enableBoobyTrap(); @@ -787,7 +786,7 @@ void BuildingViewerDdsController::createParticipants() { if (!m_ppmDtc) return; - DEBUG_LOG() << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition(); + DEBUG_LOG(m_logger) << "BDV:: create participants: "<< m_session->exerciseId() << " is replay: " << m_session->isReplayPartition(); const int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt(); @@ -906,11 +905,11 @@ void BuildingViewerDdsController::onDynParticipantChanged(const ParticipantManag void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManagement::HitLineInfo &hli, DataModification modType) { - DEBUG_LOG() << "X 0000 onHitLineInfoChanged id=" << hli.id(); + DEBUG_LOG(m_logger) << "X 0000 onHitLineInfoChanged id=" << hli.id(); if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "onHitLineInfoChanged removeHit id=" << hli.id(); + DEBUG_LOG(m_logger) << "onHitLineInfoChanged removeHit id=" << hli.id(); m_connection->removeRoomHit(hli.id()); return; } @@ -923,14 +922,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme const ParticipantManagement::Participant &partDst = m_ppmDtc->participant(hli.injuryParticipantId()); if (partSrc.id() == 0 || partDst.id() == 0) { - ERROR_LOG() << "no knownn part: " << partSrc.id() << " dst: " << partDst.id(); + ERROR_LOG(m_logger) << "no knownn part: " << partSrc.id() << " dst: " << partDst.id(); return; } const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.injuryBuildingId()); if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString())) { - DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli; + DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli; return; } @@ -946,14 +945,14 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme { const QVector &bHits = itBuildingHit.value(); - DEBUG_LOG() << "Got Hit lines to add? " << bHits.size(); + DEBUG_LOG(m_logger) << "Got Hit lines to add? " << bHits.size(); for (const BuildingHit &bh : bHits) { const bool testFlag = (bh.chargeTypeId == hli.chargeTypeId() && bh.originatorParticipantId == hli.originatorParticipantId() && hli.sampleTime() - m_hitlineDuration_ms < bh.sampleTime); - DEBUG_LOG() << "testFlag " << testFlag; + DEBUG_LOG(m_logger) << "testFlag " << testFlag; if (bh.chargeTypeId == hli.chargeTypeId() && @@ -964,10 +963,10 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme } } - DEBUG_LOG() << "onHitLineInfoChanged: " << hli; + DEBUG_LOG(m_logger) << "onHitLineInfoChanged: " << hli; int sizeL = LtsUtils::OperatorSettings::getInstance()->value(QStringLiteral("BgViewer"), QStringLiteral("PlayerSymbolSize"), 20).toInt(); - DEBUG_LOG() << "onHitLineInfoChanged createPlayerSymbols"; + DEBUG_LOG(m_logger) << "onHitLineInfoChanged createPlayerSymbols"; createPlayerSymbols(partDst, sizeL); @@ -975,7 +974,7 @@ void BuildingViewerDdsController::onHitLineInfoChanged(const ParticipantManageme LtsUtils::QPoint3D originatorSrc = toRelative3D(hli.originatorPos()); LtsUtils::QPoint3D injuryDest = toRelative3D(hli.injuryPos()); - DEBUG_LOG() << "onHitLineInfoChanged playerHit" + DEBUG_LOG(m_logger) << "onHitLineInfoChanged playerHit" << " hli.originatorPos() z=" << hli.originatorPos().z() << " hli.injuryPos() z=" < " << buildingIdSrc << " hli.originatorRoomId=" << hli.originatorRoomId() << " -> " << roomNumberSrc << " hli.injuryBuildingId=" << hli.injuryBuildingId() << " -> " << buildingIdDst @@ -1097,7 +1096,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement: return; } - DEBUG_LOG() << "onPositionChanged: " << position; + DEBUG_LOG(m_logger) << "onPositionChanged: " << position; @@ -1117,7 +1116,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement: } else { - WARNING_LOG() << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId(); + WARNING_LOG(m_logger) << "onPositionChanged: Room id can not be mapped! Building id: " << position.buildingId()<<", room id: "<< position.roomId(); } } @@ -1156,7 +1155,7 @@ void BuildingViewerDdsController::onPositionChanged(const ParticipantManagement: if (!m_baseCoordinate.isValid()) { - WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?"; + WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?"; return; } @@ -1195,7 +1194,7 @@ void BuildingViewerDdsController::createParticipant(const ParticipantManagement: { if (!m_baseCoordinate.isValid()) { - WARNING_LOG() << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?"; + WARNING_LOG(m_logger) << "not calling playerPlace as there is no base coordinate set - are there no buildings in this exercise?"; return; } @@ -1240,8 +1239,8 @@ void BuildingViewerDdsController::createBoobyTrap(const AreaEffectSimulation::Bo pos.lat() = trap.impactPosition().lat(); pos.lon() = trap.impactPosition().lon(); - DEBUG_LOG() << "Try create Booby trap with id " << trap.id() << " internal id " << participant.id(); - DEBUG_LOG() << "Try create Booby trap with pos " << pos.lat() << " " << pos.lon(); + DEBUG_LOG(m_logger) << "Try create Booby trap with id " << trap.id() << " internal id " << participant.id(); + DEBUG_LOG(m_logger) << "Try create Booby trap with pos " << pos.lat() << " " << pos.lon(); m_connection->playerCreate(participant.id(), participant.partyId(), buildPlayerSymbolFilePath(participant.id()), toRelative3D(pos), @@ -1321,7 +1320,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan std::shared_ptr symbolWatcherDeleter(nullptr, [this, pSymbolWatcher, symbolWatcherBenchmark](int *) { if (symbolWatcherBenchmark && pSymbolWatcher->m_et != nullptr) - DEBUG_LOG() << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms"; + DEBUG_LOG(m_logger) << "Symbol creation took " << pSymbolWatcher->m_et->elapsed() << " ms"; pSymbolWatcher->deleteLater(); }); @@ -1329,7 +1328,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan if (!pSymbolWatcher->symbolResult()->symbolImage().isValid()) { - WARNING_LOG() << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!"; + WARNING_LOG(m_logger) << getSessionInfo() << "'slot_SymbolWatcherResultReady': Symbol creation failed -> '!symbolImage.isValid()', BgViewer might not display symbol(s)!"; return; } @@ -1338,7 +1337,7 @@ void BuildingViewerDdsController::createSymbolResultWatcher(const ParticipantMan if (writeParticipantSymbols) if (!pSymbolWatcher->symbolResult()->symbolImage().image().save(symbolInfo.strPathToSymbolFile)) { - WARNING_LOG() << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!"; + WARNING_LOG(m_logger) << getSessionInfo() << "Could not write symbol file for BgViewer: \"" << symbolInfo.strPathToSymbolFile << "\", BgViewer might not display symbol(s)!"; return; } @@ -1388,7 +1387,7 @@ void BuildingViewerDdsController::onSynchronizeSimulationTime() m_connection->systemSetSimulationTime(m_session->partitionTime()); } else - WARNING_LOG() << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!"; + WARNING_LOG(m_logger) << getSessionInfo() << "'slotSynchronizeSimulationTime': m_session is nullptr, could not query partitionTime!"; } void BuildingViewerDdsController::updateBuildingRoomNames(const InfrastructureManagement::MainStructureElement& building) @@ -1421,7 +1420,7 @@ void BuildingViewerDdsController::onPlayerPicked(int playerId) if (m_ppmGuiIfc) m_ppmGuiIfc->showParticipantInfoWindow(playerId, true); else - INFO_LOG() << "No m_ppmGuiIfc"; + INFO_LOG(m_logger) << "No m_ppmGuiIfc"; } @@ -1430,13 +1429,13 @@ void BuildingViewerDdsController::effectGenerationUnitPicked(int structureElemen if (m_blgGuiIfc) m_blgGuiIfc->showEffectGenerationUnitWindow(structureElementId); else - INFO_LOG() << "No m_blgGuiIfc"; + INFO_LOG(m_logger) << "No m_blgGuiIfc"; } void BuildingViewerDdsController::onAssetPicked(int structureElementId) { - DEBUG_LOG() << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16); + DEBUG_LOG(m_logger) << "User clicked on asset with structureElementId " << structureElementId << " from " << QString::number((quintptr)m_session->adr(), 16); if (m_session->isReplayPartition()) return; @@ -1446,7 +1445,7 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId) auto it = m_mountingPointId2AssetType.find(structureElementId); if (it == m_mountingPointId2AssetType.end()) { - WARNING_LOG() << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring..."; + WARNING_LOG(m_logger) << "onAssetPicked: User clicked on asset mounted to structureElementId " << structureElementId << " which was not added beforehand?! Ignoring..."; return; } @@ -1454,18 +1453,18 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId) switch (assetType) { case BuildingViewer::AssetTypes::AnnouncementUnit: - DEBUG_LOG() << "Clicked asset is of type is AnnouncementUnit"; + DEBUG_LOG(m_logger) << "Clicked asset is of type is AnnouncementUnit"; if (m_avmIfc) m_avmIfc->showAnnouncementUnit(structureElementId); return; case BuildingViewer::AssetTypes::EffectGenerationUnit: - DEBUG_LOG() << "Clicked asset is of type is EffectGenerationUnit"; + DEBUG_LOG(m_logger) << "Clicked asset is of type is EffectGenerationUnit"; effectGenerationUnitPicked(structureElementId); return; case BuildingViewer::AssetTypes::IndoorCameraWithSpeaker: - DEBUG_LOG() << "Clicked asset is of type is IndoorCameraWithSpeaker"; + DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCameraWithSpeaker"; if (m_avmIfc) { m_avmIfc->showCamera(m_irreplacableWidget, structureElementId); @@ -1474,12 +1473,12 @@ void BuildingViewerDdsController::onAssetPicked(int structureElementId) return; case BuildingViewer::AssetTypes::IndoorCamera: - DEBUG_LOG() << "Clicked asset is of type is IndoorCamera"; + DEBUG_LOG(m_logger) << "Clicked asset is of type is IndoorCamera"; if (m_avmIfc) m_avmIfc->showCamera(m_irreplacableWidget, structureElementId); return; } - WARNING_LOG() << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType; + WARNING_LOG(m_logger) << "onAssetPicked: BuildingViewer::AssetTypes is unknown: " << assetType; } @@ -1514,12 +1513,12 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings:: { int topidId = static_cast (hli.id()); - DEBUG_LOG() << "onBuildingHitLineInfoChanged: " << hli; + DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: " << hli; const QString &strFeatureID = BuildingViewer::databaseId2FeatureId(hli.buildingId()); if (!m_viewerInterface->isViewOpen(strFeatureID.toStdString())) { - DEBUG_LOG() << "building not opened: hli.buildingId()=" << hli.buildingId() ; + DEBUG_LOG(m_logger) << "building not opened: hli.buildingId()=" << hli.buildingId() ; return; } @@ -1529,11 +1528,11 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings:: const bool isRemove = (modType == DataModification::eRemoved); - DEBUG_LOG() << "isRemove=" << isRemove; + DEBUG_LOG(m_logger) << "isRemove=" << isRemove; if (isRemove) { - DEBUG_LOG() << "onBuildingHitLineInfoChanged: remove "; + DEBUG_LOG(m_logger) << "onBuildingHitLineInfoChanged: remove "; QVector &bhl = m_buildingHits[hli.buildingId()]; auto it = std::find_if(bhl.begin(), bhl.end(), [hli](const BuildingHit &bh) @@ -1543,7 +1542,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings:: if (it != bhl.end()) { - DEBUG_LOG() << "bhl.erase(it)"; + DEBUG_LOG(m_logger) << "bhl.erase(it)"; bhl.erase(it); } m_connection->removeRoomHit(hli.id()); @@ -1578,7 +1577,7 @@ void BuildingViewerDdsController::onBuildingHitLineInfoChanged(const Buildings:: void BuildingViewerDdsController::onCleanupBuildingHitlines() { - DEBUG_LOG() << "onCleanupBuildingHitlines: "; + DEBUG_LOG(m_logger) << "onCleanupBuildingHitlines: "; const qint64 tNow = QDateTime::currentMSecsSinceEpoch(); const auto isOutdated = [tNow](const BuildingHit &bh) { @@ -1600,7 +1599,7 @@ void BuildingViewerDdsController::onMainStructureElementChanged(const Infrastruc { if (mse.modelId() != 0 && m_ismDtc->isElementAssignedToExercise(mse, m_exerciseId)) { - DEBUG_LOG() << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z(); + DEBUG_LOG(m_logger) << "m_buildingHeight.insert id=" << mse.id() << " z=" << mse.geoPosition().z(); m_buildingHeight.insert(mse.id(), mse.geoPosition().z()); QHash roomId2RoomNumber; for (const InfrastructureManagement::StructureElement &se : mse.elements()) @@ -1638,7 +1637,7 @@ void BuildingViewerDdsController::onFireEventFlashTimer() if (m_session == nullptr) { - DEBUG_LOG() << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!"; + DEBUG_LOG(m_logger) << getSessionInfo() << "onFireEventFlashTimer: Session is not available, flashing not possible!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.h index 6058a4982..d1060cebe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Common/bdv_dds_controller.h @@ -54,6 +54,7 @@ public: signals: void signalDdsInitFinished(); private: +NGL::INGLLogger &m_logger; void setCurrentTrainingAreaMap(const QString &modelPath); private slots: void onPartyChanged(const ParticipantManagement::Party &party, DataModification modType); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.cpp index c879df2cf..1dd1acc9a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.cpp @@ -175,7 +175,7 @@ bool BuildingEdit::apply() - DEBUG_LOG() << "fortifyFactors.size()=" << fortifyFactors.size(); + DEBUG_LOG(m_logger) << "fortifyFactors.size()=" << fortifyFactors.size(); if (fortifyFactors.size()) { m_requestHelper->addRequest([this, fortifyFactors]() @@ -187,7 +187,7 @@ bool BuildingEdit::apply() fortifyRequest.fortifyFactors().reserve(fortifyFactors.size()); for (const auto &e : fortifyFactors) { - DEBUG_LOG() << "push_back= databaseId=" << e.structureElementId() + DEBUG_LOG(m_logger) << "push_back= databaseId=" << e.structureElementId() << " fortifyFactor=" << e.fortifyFactor(); fortifyRequest.fortifyFactors().push_back(Buildings::FortifyFactor(e.structureElementId(), e.fortifyFactor())); } @@ -305,7 +305,7 @@ bool BuildingEdit::sendBuildingStateRequest(ProjectDataManagement::Vulnerability requestData.buildings(buildings); requestData.vulnerabilityState(state); - DEBUG_LOG() << Q_FUNC_INFO << "currentData: " << state; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state; return m_bldFtc->setBuildingStatesRequest(requestData, this); }); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.h index c9c5bdf84..a51765506 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_building_edit.h @@ -58,6 +58,8 @@ private slots: void onDestroyElement(); protected: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.cpp index fa8349939..34341cdfb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.cpp @@ -16,8 +16,8 @@ namespace BuildingViewer { BuildingEditModel::BuildingEditModel(QObject *parent, const std::shared_ptr &ismDtc, - const std::shared_ptr &bldDtc) - : NGLTreeModel(parent, new NGLTreeItem(QVariant()), { + const std::shared_ptr &bldDtc) : NGLTreeModel(parent, new NGLTreeItem(QVariant()),, + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { tr("Selected Building"), QStringLiteral("Name (DEBUG)"), QStringLiteral("MountingPointId (DEBUG)"), @@ -76,7 +76,7 @@ QVariant BuildingEditModel::data(const QModelIndex &index, int role) const bool BuildingEditModel::slotUpdateRow(const BuildingViewer::TreeItem &room, const bool fortifyChanged) { - DEBUG_LOG() << "slotUpdateRow isBuilding=" << room.isBuilding() + DEBUG_LOG(m_logger) << "slotUpdateRow isBuilding=" << room.isBuilding() << " isFloor" << room.isFloor() << " isRoom" << room.isRoom(); @@ -122,7 +122,7 @@ bool BuildingEditModel::onInsertRow(int &row, const QModelIndex &parent, const B bool BuildingEditModel::init(int32_t mseId) { - INFO_LOG() << "init mseId=" << mseId; + INFO_LOG(m_logger) << "init mseId=" << mseId; NGLTreeModel::resetModel(); m_mapRoomsWithChangedFortifyFactor.clear(); @@ -141,7 +141,7 @@ bool BuildingEditModel::init(int32_t mseId) const std::vector &vecElements = building.elements(); for (const auto &se : vecElements) { - DEBUG_LOG() << "se: " << se; + DEBUG_LOG(m_logger) << "se: " << se; if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building) { BuildingViewer::TreeItem rootItemBuilding(se); @@ -163,7 +163,7 @@ bool BuildingEditModel::init(int32_t mseId) for (const auto &se : vecElements) { - DEBUG_LOG() << "se: =" << se; + DEBUG_LOG(m_logger) << "se: =" << se; if (se.structureElementTypeId() == InfrastructureManagement::StructureElementType_def::Floor) { BuildingViewer::TreeItem itemRoom(se); @@ -208,7 +208,7 @@ bool BuildingEditModel::init(int32_t mseId) } catch (const std::out_of_range &e) { - WARNING_LOG() << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what(); + WARNING_LOG(m_logger) << "Caught exception while trying to get superior id for building " << rootName << " with room with mounting point id: " << se.mountingPointId() << ": " << e.what(); return false; } @@ -231,7 +231,7 @@ bool BuildingEditModel::init(int32_t mseId) int parentId = item.hasSuperior() ? item.getSuperior() : rootId; if (!parentItemIndexCache.contains(parentId)) { - ERROR_LOG() << "Invalid building structure! Tree can not be built!"; + ERROR_LOG(m_logger) << "Invalid building structure! Tree can not be built!"; return false; } @@ -255,7 +255,7 @@ QModelIndex BuildingEditModel::modelIndexByMountingPointId(int mountingPointId) if (privateData(mi)->data().value().mountingPointId() == mountingPointId) return mi; } - WARNING_LOG()<<"Could not find modelindex for given room mountig point id: " << mountingPointId; + WARNING_LOG(m_logger)<<"Could not find modelindex for given room mountig point id: " << mountingPointId; return {}; } @@ -265,7 +265,7 @@ QModelIndex BuildingEditModel::modelIndexByStructureElementId(int structureEleme auto it = m_mapModelIndices.find(structureElementId); if (it == m_mapModelIndices.end()) { - WARNING_LOG()<<"Could not find modelindex for given room structreElementId: " << structureElementId; + WARNING_LOG(m_logger)<<"Could not find modelindex for given room structreElementId: " << structureElementId; return {}; } return it.value(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.h index 98878b26e..e27df4005 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/BuildingEdit/bdv_edit_model.h @@ -50,6 +50,8 @@ signals: void signalModelDataChanged(); private: + +NGL::INGLLogger &m_logger; QVariant data(const QModelIndex &index, int role) const override final; bool onInsertRow(int &row, const QModelIndex &parent, const BuildingViewer::TreeItem &folderData); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.cpp index 5a744438e..2665c7f21 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.cpp @@ -6,15 +6,14 @@ namespace BuildingViewer { -ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, const TopicReplay::Interface::SituationReplayTime &replay, QObject *parent) - : QObject(parent) +ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, const TopicReplay::Interface::SituationReplayTime &replay, QObject *parent) : QObject(parent) , m_actualReplayStart_ms(0) , m_actualReplayEnd_ms(0) , m_replayDuration_ms(0) , m_startOffset_ms(0) - , m_replayInfo(replay) -{ - DEBUG_LOG() << "buildingTopicStart_s = " << buildingTopicStart_s + , m_replayInfo(replay), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "buildingTopicStart_s = " << buildingTopicStart_s << ", buildingTopicEnd_s = " << buildingTopicEnd_s << ", replay.topicStart_s = " << replay.topicStart_s << ", replay.topicEnd_s = " << replay.topicEnd_s @@ -30,7 +29,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c m_actualReplayStart_ms = replay.replayStart_ms + start_diff_ms; m_startOffset_ms = 0; - DEBUG_LOG() << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms; + DEBUG_LOG(m_logger) << "Replay starts before Building-Topic: Shift replay starting point to m_actualReplayStart_ms = " << m_actualReplayStart_ms; } else { @@ -38,7 +37,7 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c m_actualReplayStart_ms = replay.replayStart_ms; m_startOffset_ms = std::abs(start_diff_ms); - DEBUG_LOG() << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec"; + DEBUG_LOG(m_logger) << "Building-Topic starts before Replay: Starting Replay after " << m_startOffset_ms << "msec"; } @@ -47,12 +46,12 @@ ReplayHandler::ReplayHandler(int buildingTopicStart_s, int buildingTopicEnd_s, c if (replay.topicEnd_s > buildingTopicEnd_s) { m_actualReplayEnd_ms -= (replay.topicEnd_s - buildingTopicEnd_s) * 1000; - DEBUG_LOG() << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms; + DEBUG_LOG(m_logger) << "Replay longer than Building-Topic, cutting replay end to m_actualReplayEnd_ms = " << m_actualReplayEnd_ms; } m_replayDuration_ms = m_actualReplayEnd_ms - m_actualReplayStart_ms; - DEBUG_LOG() << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")"; + DEBUG_LOG(m_logger) << "Replay from " << m_actualReplayStart_ms << " to " << m_actualReplayEnd_ms << " (duration = " << m_replayDuration_ms << ")"; if (m_startOffset_ms == 0) m_startOffset_ms = -1; @@ -71,7 +70,7 @@ void ReplayHandler::tick(qint64 diffSinceLastTick) return; } - DEBUG_LOG() << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec"; + DEBUG_LOG(m_logger) << "ReplayHandler::tick(): Remaining: " << m_replayDuration_ms << "msec"; if (m_startOffset_ms == -1) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.h index 15b3bc08b..43d5a38be 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_replay_handler.h @@ -25,6 +25,8 @@ signals: void signalStopReplay(); private: + +NGL::INGLLogger &m_logger; qint64 m_actualReplayStart_ms; qint64 m_actualReplayEnd_ms; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.cpp index ef2f39ee0..fb63119f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.cpp @@ -15,7 +15,7 @@ namespace BuildingViewer VideoExporter::VideoExporter(QObject *parent) : QObject(parent) { - DEBUG_LOG() << "ThreadVideoExporter has been created"; + DEBUG_LOG(m_logger) << "ThreadVideoExporter has been created"; } void VideoExporter::init(const VideoInformation &videoInfo) @@ -26,12 +26,12 @@ void VideoExporter::init(const VideoInformation &videoInfo) void VideoExporter::sendAliveSignals() { - DEBUG_LOG() << "sendAliveSignals() called"; + DEBUG_LOG(m_logger) << "sendAliveSignals() called"; for (auto &e : std::as_const(m_vecVideosToExport)) emit e.m_pExportNotifier->stillAlive(); - DEBUG_LOG() << "\tSignals emitted, mutex unlocked"; + DEBUG_LOG(m_logger) << "\tSignals emitted, mutex unlocked"; } @@ -42,17 +42,17 @@ void VideoExporter::doExport() if (QThread::currentThread()->isInterruptionRequested()) break; VideoInformation toExport = m_vecVideosToExport.takeFirst(); - DEBUG_LOG() << "Starting export of " << toExport.m_strFolderPath; + DEBUG_LOG(m_logger) << "Starting export of " << toExport.m_strFolderPath; const auto state = toExport.m_bgViewerState.value(QStringLiteral("arrBuildingStates")); if (!state.isArray()) { - WARNING_LOG() << "No opened buildings, nothing to export, skipping video!"; + WARNING_LOG(m_logger) << "No opened buildings, nothing to export, skipping video!"; continue; } - DEBUG_LOG() << "Emitting 'signalStartRecording'"; + DEBUG_LOG(m_logger) << "Emitting 'signalStartRecording'"; emit signalStartRecording(toExport.m_strFolderPath, state); QSharedPointer pHandler; @@ -83,7 +83,7 @@ void VideoExporter::doExport() if (diff_ms >= 1000) { last_tick_elapsed = elapsed_sum_ms; - DEBUG_LOG() << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed"; + DEBUG_LOG(m_logger) << "Export: " << elapsed_sum_ms / 1000 << "/" << record_duration_ms / 1000 << "[s] passed"; } if (pHandler) @@ -97,12 +97,12 @@ void VideoExporter::doExport() if (QThread::currentThread()->isInterruptionRequested()) break; } - DEBUG_LOG() << "Done. Emitting 'signalStopRecording'"; + DEBUG_LOG(m_logger) << "Done. Emitting 'signalStopRecording'"; emit signalStopRecording(); - DEBUG_LOG() <<"Export done, emitting 'signalExportSuccessful'"; + DEBUG_LOG(m_logger) <<"Export done, emitting 'signalExportSuccessful'"; toExport.m_pExportNotifier->setExportSuccessful(toExport.m_strFolderPath); - DEBUG_LOG() <<"\tsignal emitted"; + DEBUG_LOG(m_logger) <<"\tsignal emitted"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.h index 49f7b8ef9..6bd8f970d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_thread_video_exporter.h @@ -53,6 +53,8 @@ signals: void signalStopRecording(); private: + +NGL::INGLLogger &m_logger; void sendAliveSignals(); QVector m_vecVideosToExport; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.cpp index c0df42053..35d9ea6ee 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.cpp @@ -104,7 +104,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, const QJsonArray states = attributes[QStringLiteral("arrBuildingStates")].toArray(); if (states.isEmpty()) { - INFO_LOG() << "Nothing to export"; + INFO_LOG(m_logger) << "Nothing to export"; emit pExportNotifier->exportSuccessful(QString()); return true; } @@ -113,7 +113,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, QFile f(folderPath + QLatin1Char('/') + filename); if (!f.open(QIODevice::WriteOnly)) { - WARNING_LOG() << "Can not open file '" << f.fileName() << "' for writing!"; + WARNING_LOG(m_logger) << "Can not open file '" << f.fileName() << "' for writing!"; pExportNotifier->setExportFailed(); return false; } @@ -136,7 +136,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, obj[QStringLiteral("replays")] = arr; f.write(QJsonDocument(obj).toJson(QJsonDocument::Indented)); f.close(); - DEBUG_LOG() << "BDV filename: " << f.fileName(); + DEBUG_LOG(m_logger) << "BDV filename: " << f.fileName(); QVector buildingIds; buildingIds.reserve(states.size()); @@ -146,7 +146,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, int buildingId = featureId2DatabaseId(QString::fromStdString(vws.m_featureID)); if (buildingId <= 0) { - WARNING_LOG() << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping"; + WARNING_LOG(m_logger) << "Could not retrieve building id from '" << vws.m_featureID << "' - skipping"; continue; } buildingIds += buildingId; @@ -172,7 +172,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, if (!m_replayIfc || !m_bgvController) { - ERROR_LOG() << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export"; + ERROR_LOG(m_logger) << "BuildingViewer exportTopic: m_replayIfc==nullptr, can not start replay, aborting export"; emit pExportNotifier->exportFailed(); Q_ASSERT(false); return false; @@ -224,7 +224,7 @@ bool TopicReplayInterface::exportBuildings(const QVector &buildingIds) cons const QString modelPath = BgViewerController::buildingModelPath(); if (modelPath.isEmpty()) { - WARNING_LOG() << "Could not find path with building models - can not copy models"; + WARNING_LOG(m_logger) << "Could not find path with building models - can not copy models"; return false; } @@ -232,13 +232,13 @@ bool TopicReplayInterface::exportBuildings(const QVector &buildingIds) cons QDir dir(outputPath); if (!dir.exists() && !dir.mkpath(outputPath)) { - WARNING_LOG() << "Could not create path " << outputPath; + WARNING_LOG(m_logger) << "Could not create path " << outputPath; return false; } QFile f(outputPath + QStringLiteral("/buildings.json")); if (!f.open(QIODevice::ReadWrite)) { - WARNING_LOG() << "Could not open file " << f.fileName() << " for read/write: " << f.errorString(); + WARNING_LOG(m_logger) << "Could not open file " << f.fileName() << " for read/write: " << f.errorString(); return false; } const QJsonArray arr(QJsonDocument::fromJson(f.readAll()).array()); @@ -257,7 +257,7 @@ bool TopicReplayInterface::exportBuildings(const QVector &buildingIds) cons const auto mse = ismDtc->mainStructureElement(buildingId); if (mse.id() != buildingId) { - WARNING_LOG() << "Could not find MainStructureElement for building with id " << buildingId << " - skipping"; + WARNING_LOG(m_logger) << "Could not find MainStructureElement for building with id " << buildingId << " - skipping"; continue; } const QString fnIve = QString::fromStdString(mse.name()) + QStringLiteral(".flt.ive"); @@ -294,7 +294,7 @@ bool TopicReplayInterface::exportShaders() const { const QString shaderPath(NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("shaders"))); const QString outputPath(m_basePath + QStringLiteral("BuildingModels/shaders/")); - DEBUG_LOG() << "shaderPath: " << shaderPath << ", outputPath: " << outputPath; + DEBUG_LOG(m_logger) << "shaderPath: " << shaderPath << ", outputPath: " << outputPath; return NGL::copyDirContentsToDir(shaderPath, outputPath); } @@ -306,10 +306,10 @@ bool TopicReplayInterface::copyFile(const QString &srcFn, const QString &srcDir, QFile f(src); if (!f.exists() || (!QFile::exists(dst) && !f.copy(dst))) { - WARNING_LOG() << "Could not copy " << src << " to " << dst << ": " << f.errorString(); + WARNING_LOG(m_logger) << "Could not copy " << src << " to " << dst << ": " << f.errorString(); return false; } - DEBUG_LOG() << "Copied from " << src << " to " << dst; + DEBUG_LOG(m_logger) << "Copied from " << src << " to " << dst; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.h index af19865de..bd0427f1d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_topic_replay_interface.h @@ -47,6 +47,7 @@ private slots: void slotStartReplay(qint64 start, qint64 end, double speed); void slotStopReplay(); private: +NGL::INGLLogger &m_logger; bool exportBuildings(const QVector &buildingIds) const; bool exportShaders() const; bool copyFile(const QString &srcFn, const QString &srcDir, const QString &dstDir) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_dialog.h index 664d0c293..34f2cf1c4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_dialog.h @@ -32,6 +32,7 @@ public: public Q_SLOTS: void fetchBuildingList(); protected: +NGL::INGLLogger &m_logger; void retranslate() override; signals: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_view.h index 523d23e3c..a95805c20 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_data_view.h @@ -50,6 +50,8 @@ public slots: void onViewerEventWidgetFocused(const QString &featureID); private: + +NGL::INGLLogger &m_logger; Ui::BgViewerDataView *m_ui = nullptr; BgViewerDataViewModel *m_pModel = nullptr; BgViewerController *m_pBgvController = nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.cpp index 534e59d32..a8c98a64e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.cpp @@ -19,10 +19,9 @@ namespace BuildingViewer { -BdvPluginProvider::BdvPluginProvider(LtsSession::LtsSession *session, QObject *parent) - : PluginProvider(parent) - , m_session(session) -{} +BdvPluginProvider::BdvPluginProvider(LtsSession::LtsSession *session, QObject *parent) : PluginProvider(parent) + , m_session(session), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool BdvPluginProvider::init() { @@ -36,7 +35,7 @@ bool BdvPluginProvider::init() if (!m_session->getDtc(m_bldDtc)) { - ERROR_LOG() << "Fetching 'm_bldDtc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_bldDtc' failed!"; return false; } m_session->getForeignGuiInterface(m_bldInfoIfc); @@ -52,7 +51,7 @@ bool BdvPluginProvider::init() if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Fetching 'm_ppmDtc' failed!"; + ERROR_LOG(m_logger) << "Fetching 'm_ppmDtc' failed!"; return false; } m_session->getForeignGuiInterface(m_ppmParticipantInfoIfc); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.h index 131f06776..5fbc2daec 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/BuildingViewer/Gui/BuildingViewer/bdv_viewer_gui_plugin_provider.h @@ -51,6 +51,8 @@ public: LtsSession::LtsSession *m_session; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_asbIfc; std::shared_ptr m_avmDataIfc; std::shared_ptr m_bldDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.cpp index 4b8f9b581..d5d513eb3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.cpp @@ -98,7 +98,7 @@ void BldConfigDialog::fillCbx() bool BldConfigDialog::apply() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_ui->chbOwnership->isChecked()) { @@ -134,8 +134,8 @@ bool BldConfigDialog::apply() requestData.resetContamination(m_ui->chbResetContamination->isChecked()); - DEBUG_LOG() << Q_FUNC_INFO << "currentIndex: " << m_ui->cmbStatus->currentIndex(); - DEBUG_LOG() << Q_FUNC_INFO << "currentData: " << state; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentIndex: " << m_ui->cmbStatus->currentIndex(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "currentData: " << state; return m_ftc->setBuildingStatesRequest(requestData, this); }); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.h index fb000951e..13681668a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_config_dialog.h @@ -45,9 +45,11 @@ private slots: void slotCmbStatusCurrentIndexChanged(int index); private: + NGL::INGLLogger &m_logger; void fillCbx(); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_history_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_history_dialog_model.cpp index 64fa9940b..05a527cf5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_history_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_history_dialog_model.cpp @@ -48,7 +48,7 @@ bool BuildingHistoryDialogModel::initModel(int mseId, connect(dtc.get(), &Interface::Dtc::historyStateChanged, this, &BuildingHistoryDialogModel::onHistoryStateChanged); - DEBUG_LOG() << "m_mseId=" << m_mseId; + DEBUG_LOG(m_logger) << "m_mseId=" << m_mseId; reinitModel(dtc->historyState(m_mseId).stateHistory()); return true; } @@ -80,7 +80,7 @@ QVariant BuildingHistoryDialogModel::data(const QModelIndex &index, int role) co void BuildingHistoryDialogModel::onHistoryStateChanged(const Buildings::HistoryState &data, DataModification modType) { - DEBUG_LOG() << "onHistoryStateChanged"; + DEBUG_LOG(m_logger) << "onHistoryStateChanged"; if (m_mseId != data.mseId()) return; @@ -154,14 +154,14 @@ QString BuildingHistoryDialogModel::getOriginatorName(const HistoryStateItemEx & QString BuildingHistoryDialogModel::getContaminations(const std::vector< Buildings::ContaminationState > &contaminationStates) const { - DEBUG_LOG() << "BuildingHistoryDialogModel::getContaminations"; + DEBUG_LOG(m_logger) << "BuildingHistoryDialogModel::getContaminations"; QStringList contaminationList; for (const auto &cs : contaminationStates) { AreaEffectSimulation::AesItem item; m_aesDtc->aesItemFromId(cs.aesId(), item); const ProjectDataManagement::GearClass &gc = m_pdmDtc->gearClassFromChargeTypeId(item.chargeStruct().chargeTypeId()); - DEBUG_LOG() << "gc=" << gc; + DEBUG_LOG(m_logger) << "gc=" << gc; if (gc == ProjectDataManagement::GearClass::Unknown) continue; QString gearClassName = ProjectDataManagement::toString(gc).trimmed(); @@ -169,14 +169,14 @@ QString BuildingHistoryDialogModel::getContaminations(const std::vector< Buildin if (!contaminationList.contains(gearClassName)) contaminationList.append(gearClassName); else - DEBUG_LOG() << "contaminationList.contains(gearClassName)" << gearClassName; + DEBUG_LOG(m_logger) << "contaminationList.contains(gearClassName)" << gearClassName; } return contaminationList.join(QStringLiteral("+")); } void BuildingHistoryDialogModel::reinitModel(const std::vector &newData) { - DEBUG_LOG() << "BuildingHistoryDialogModel::reinitModel size=" << newData.size(); + DEBUG_LOG(m_logger) << "BuildingHistoryDialogModel::reinitModel size=" << newData.size(); int indexModel = 0; int contaminationOffest = 0; @@ -189,16 +189,16 @@ void BuildingHistoryDialogModel::reinitModel(const std::vectorparticipant(data.originatorParticipantId()); showHitLineInfos(); @@ -92,14 +92,14 @@ bool HitLineInfoDialog::init(LtsSession::LtsSession *session) }); if (!m_isInitialized) - WARNING_LOG() << "Non Building HitLineInfo data found for id: " << m_hitLineId; + WARNING_LOG(m_logger) << "Non Building HitLineInfo data found for id: " << m_hitLineId; return m_isInitialized; } void HitLineInfoDialog::showHitLineInfos() { - DEBUG_LOG() << Q_FUNC_INFO << " id:" << m_hitLineId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id:" << m_hitLineId; if (m_hitLineInfo.buildingId() <= 0 || m_hitLineInfo.originatorParticipantId() <= 0) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_hitline_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_hitline_info_dialog.h index a8b8ba759..c80e68ebb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_hitline_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_hitline_info_dialog.h @@ -75,6 +75,8 @@ public: bool init(LtsSession::LtsSession *session); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void showHitLineInfos(); QString getContaminations(const std::vector &contaminationStates) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.cpp index 524bc5a7f..e16a21b98 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.cpp @@ -82,10 +82,9 @@ public: namespace Buildings { -BldInfoDialog::BldInfoDialog(int bldEntityId, const QString &menuGroup, QWidget *parent) - : InfoDialogBase(bldEntityId, menuGroup, QStringLiteral("BldInfoDialog"), LtsWidgets::ButtonCombination::CloseOnly, parent) - , m_ui(new Ui::BldInfoDialog) -{ +BldInfoDialog::BldInfoDialog(int bldEntityId, const QString &menuGroup, QWidget *parent) : InfoDialogBase(bldEntityId, menuGroup, QStringLiteral("BldInfoDialog"), LtsWidgets::ButtonCombination::CloseOnly, parent) + , m_ui(new Ui::BldInfoDialog), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { DEBUG_LOG(m_logger) << LOGFUNCTION << " START" << ", bldEntityId=" << bldEntityId; m_ui->setupUi(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.h index 9e68aba2b..00973d0f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bld_info_dialog.h @@ -69,6 +69,8 @@ public: bool init(LtsSession::LtsSession *session) override; private: + +NGL::INGLLogger &m_logger; template static ReturnType constFinder(const Container &container, const Key &key) noexcept(false) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bridge_history_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bridge_history_dialog_model.h index 354531da5..ed68f3a27 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bridge_history_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/bridge_history_dialog_model.h @@ -67,6 +67,8 @@ private Q_SLOTS: void onHistoryStateChanged(const BridgeStatus &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; void reinitModel(const QMap &newData); int m_ddsId; std::shared_ptr m_dtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.cpp index 6a000e69a..d8b979fcc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.cpp @@ -76,13 +76,13 @@ void InfoDialogBase::onFindOnMap() if (m_session->getForeignGuiInterface(ifc)) ifc->centerMapToBuildingObject(m_mseId); else - WARNING_LOG() << Q_FUNC_INFO << "getForeignGuiInterface failed!"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface failed!"; } void InfoDialogBase::onShowDetails() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; BldConfigDialog *dialog = new BldConfigDialog(m_mseId, buildingDisplayName(), this); if (dialog->init(m_session)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.h index 276191e6a..ba8569f35 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/info_dialog_base.h @@ -57,10 +57,12 @@ protected slots: void onShowEgcuMonitor(); protected: + NGL::INGLLogger &m_logger; virtual void showBuildingInfos() = 0; virtual QString buildingDisplayName() const = 0; protected: + NGL::INGLLogger &m_logger; int m_mseId = -1; QString m_menuGroup; int m_exerciseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.cpp index 85935fbac..c58aba72f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.cpp @@ -9,13 +9,12 @@ namespace Buildings { -RelayInfoWidget::RelayInfoWidget(int id, QWidget *parent) - : QWidget(parent) +RelayInfoWidget::RelayInfoWidget(int id, QWidget *parent) : QWidget(parent) , m_id(id) , m_state(false) - , m_ui(new Ui::RelayInfoWidget) -{ - DEBUG_LOG() << "RelayInfoWidget"; + , m_ui(new Ui::RelayInfoWidget), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "RelayInfoWidget"; m_ui->setupUi(this); m_ui->ledStatus->setAspectHint(LtsWidgets::LtsLedWidget::AspectHint::WidthIsHeight); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.h index 3bd0e20cc..dea6fe4d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Buildings/Gui/BuildingInfo/relay_info.h @@ -44,6 +44,8 @@ private slots: void onButtonClicked(); private: + +NGL::INGLLogger &m_logger; int m_id; bool m_state; Ui::RelayInfoWidget *m_ui; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participant_move_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participant_move_dialog.cpp index 00c96fc0c..3b67a5d07 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participant_move_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participant_move_dialog.cpp @@ -134,7 +134,7 @@ void ParticipantMoveDialog::onSimulatedMovementChanged(const CentralEffectSimula { if (modType == DataModification::eRemoved || m_participantData.id() != data.participantId()) return; - INFO_LOG() << "onSimulatedMovementChanged"; + INFO_LOG(m_logger) << "onSimulatedMovementChanged"; clearContent(); @@ -189,7 +189,7 @@ void ParticipantMoveDialog::onSimulatedMovementModifyReply(const Core::FunctionR void ParticipantMoveDialog::retranslate() { translate(m_ui, QString::fromStdString(m_participantData.tacticalIdentifier()), false, tr("Waypoints")); - DEBUG_LOG() << "retranslate"; + DEBUG_LOG(m_logger) << "retranslate"; } void ParticipantMoveDialog::initTableHeader() @@ -261,7 +261,7 @@ void ParticipantMoveDialog::onFocus() void ParticipantMoveDialog::onGetPolyline() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!m_sitMapGuiIfc) return; @@ -298,7 +298,7 @@ void ParticipantMoveDialog::onGetPolyline() void ParticipantMoveDialog::onPolylineData(const QPolygonF &polyline) { - DEBUG_LOG() << Q_FUNC_INFO << " numberOfPoints: " << polyline.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " numberOfPoints: " << polyline.size(); if (polyline.size() < 2) return; @@ -381,7 +381,7 @@ bool ParticipantMoveDialog::apply() { const SimulatedMovement req = requestContent(); - INFO_LOG() << "--- onApplyMessage() "; + INFO_LOG(m_logger) << "--- onApplyMessage() "; m_requestHelper->addRequest([this, req]() { @@ -395,7 +395,7 @@ bool ParticipantMoveDialog::apply() Core::RemoveElementRequest req(m_id); m_id = 0; - INFO_LOG() << "--- onApplyMessage() "; + INFO_LOG(m_logger) << "--- onApplyMessage() "; m_requestHelper->addRequest([req, this]() { @@ -484,14 +484,14 @@ void ParticipantMoveDialog::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void ParticipantMoveDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::CESParticipantMove)); @@ -511,7 +511,7 @@ void ParticipantMoveDialog::onImportButtonClicked() { SimulatedMovement req = jsonToSimulatedMovement(content); - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; m_requestHelper->addRequest([this, req]() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_dialog.cpp index 232025f6a..52e001e20 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_dialog.cpp @@ -112,14 +112,14 @@ bool ParticipantsMoveDialog::init(LtsSession::LtsSession *session, std::shared_ptr exmDtc; if (!m_session->getDtc(exmDtc)) { - ERROR_LOG() << "failed to get exmDtc "; + ERROR_LOG(m_logger) << "failed to get exmDtc "; return false; } std::shared_ptr asmDtc; if (!m_session->getDtc(asmDtc)) { - ERROR_LOG() << "failed to get asmDtc "; + ERROR_LOG(m_logger) << "failed to get asmDtc "; return false; } @@ -130,13 +130,13 @@ bool ParticipantsMoveDialog::init(LtsSession::LtsSession *session, AssetManagement::TrainingArea ta = asmDtc->trainingArea(exc.trainingAreaId()); if (ta.id() != exc.trainingAreaId()) { - ERROR_LOG()<<" couldn't get Training Area with id: "<getDtc(m_aesDtc)) { - ERROR_LOG()<<"failed to get aesDtc"; + ERROR_LOG(m_logger)<<"failed to get aesDtc"; return false; } @@ -211,7 +211,7 @@ void ParticipantsMoveDialog::onSelectionChanged() return; const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first())); - DEBUG_LOG() << "ParticipantId: " << data.id(); + DEBUG_LOG(m_logger) << "ParticipantId: " << data.id(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Remove, data.isSimulated()); if (data.isSimulated() && m_participantDialogMap.contains(data.id())) @@ -257,7 +257,7 @@ void ParticipantsMoveDialog::onSelectionChanged() void ParticipantsMoveDialog::onModelChanged() { m_ui->dvParticipants->expandAll(); - DEBUG_LOG() << "onModelChanged"; + DEBUG_LOG(m_logger) << "onModelChanged"; } void ParticipantsMoveDialog::onDoubleClicked() @@ -282,7 +282,7 @@ void ParticipantsMoveDialog::onDoubleClicked() return; const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first())); - DEBUG_LOG() << "ParticipantId: " << data.id(); + DEBUG_LOG(m_logger) << "ParticipantId: " << data.id(); if (!m_participantDialogMap.contains(data.id())) { @@ -335,7 +335,7 @@ void ParticipantsMoveDialog::onRemove() return; const ParticipantManagement::ParticipantData data(participantFromIndex(indexList.first())); - INFO_LOG() << "onRemove ParticipantId: " << data.id(); + INFO_LOG(m_logger) << "onRemove ParticipantId: " << data.id(); delete m_participantDialogMap.value(data.id()); @@ -430,7 +430,7 @@ void ParticipantsMoveDialog::onGetCoordinate(QPointF coordinate) const ParticipantManagement::ParticipantData participantData(participantFromIndex(indexList.first())); - INFO_LOG() << Q_FUNC_INFO << "ParticipantId=" << participantData.id() + INFO_LOG(m_logger) << Q_FUNC_INFO << "ParticipantId=" << participantData.id() << " EquipmentNr=" << participantData.equipmentNumber() << " onGetCoordinate x=" << coordinate.x() << " y=" << coordinate.y(); if (participantData.id() <= 0) @@ -500,7 +500,7 @@ bool ParticipantsMoveDialog::isParticipantInUseForExplosionCluster(int id) { if (!m_aesDtc) { - ERROR_LOG()<<" m_aesDTC is not setted"; + ERROR_LOG(m_logger)<<" m_aesDTC is not setted"; return true; } @@ -658,7 +658,7 @@ void ParticipantsMoveDialog::setFormationAndPositioningUi(const ParticipantManag m_formationProps.angle = std::fmod((mil2Deg(angleMil) + 90), 360); - DEBUG_LOG()<<" angle in deg mil: "< degree: "<< mil2Deg(angleMil)<<" final position(°): "<coordinate(); if (mgrsCoordinate.isNull()) { - WARNING_LOG()<<"MGRS Coordinates invalid!"; + WARNING_LOG(m_logger)<<"MGRS Coordinates invalid!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Coordinates invalid!\nPlease check them and try again.")); return; } @@ -732,7 +732,7 @@ bool ParticipantsMoveDialog::getUnitPosition(int32_t participantId, Core::GeoPos ParticipantManagement::UnitPosition up = m_ppmDtc->unitPosition(participantId); if (up.participantId() != participantId) { - ERROR_LOG() << Q_FUNC_INFO << ", unitPosition failed for participantId=" << participantId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", unitPosition failed for participantId=" << participantId; return false; } @@ -767,7 +767,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRequest(const ParticipantMana { const ParticipantManagement::TypeClass tc = m_ppmDtc->type(participantData.typeId()).typeClass(); - DEBUG_LOG() << "ParticipantId=" << participantData.id() + DEBUG_LOG(m_logger) << "ParticipantId=" << participantData.id() << " EquipmentNr=" << participantData.equipmentNumber() << " onGetCoordinate x=" << coordinate.x() << " y=" << coordinate.y() << ", tc=" << tc; @@ -816,11 +816,11 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(const Partici Core::GeoPosition unitPositionOut; if (!getUnitPosition(participantId, unitPositionOut)) { - ERROR_LOG() << Q_FUNC_INFO << ", getUnitPosition failed for participantId=" << participantId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition failed for participantId=" << participantId; return; } - INFO_LOG() << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId + INFO_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId << ", unitPositionOut: lon=" << unitPositionOut.lon() << " - lat=" << unitPositionOut.lat(); LtsCoordTrans::UtmCoordinate curUnitPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon(), unitPositionOut.lat()); @@ -829,7 +829,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(const Partici if (offset.isNull()) { - ERROR_LOG() << Q_FUNC_INFO << ", required offset is zero. not expected... return"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", required offset is zero. not expected... return"; return; } @@ -838,7 +838,7 @@ void ParticipantsMoveDialog::doSetSimulatedPositionRelativeRequest(const Partici req.positionOffsetX(offset.x()); req.positionOffsetY(offset.y()); - DEBUG_LOG() << "SetSimulatedPositionRelative = " << req; + DEBUG_LOG(m_logger) << "SetSimulatedPositionRelative = " << req; m_requestHelper->startSingleRequest([req, this]() { @@ -856,11 +856,11 @@ void ParticipantsMoveDialog::doSetSimulatedParticipantFormationRequest(const Par Core::GeoPosition unitPositionOut; if (!getUnitPosition(participantId, unitPositionOut)) { - ERROR_LOG() << Q_FUNC_INFO << ", getUnitPosition failed for participantId=" << participantId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition failed for participantId=" << participantId; return; } - INFO_LOG() << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId + INFO_LOG(m_logger) << Q_FUNC_INFO << ", getUnitPosition for participantId=" << participantId << ", unitPositionOut: lon=" << unitPositionOut.lon() << " - lat=" << unitPositionOut.lat(); LtsCoordTrans::UtmCoordinate curUnitPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(unitPositionOut.lon(), unitPositionOut.lat()); @@ -869,7 +869,7 @@ void ParticipantsMoveDialog::doSetSimulatedParticipantFormationRequest(const Par if (offset.isNull()) { - ERROR_LOG() << Q_FUNC_INFO << ", required offset is zero. not expected... return"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", required offset is zero. not expected... return"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.cpp index adb66bcb2..afad18139 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.cpp @@ -19,7 +19,7 @@ ParticipantMoveModel::ParticipantMoveModel(QObject *parent, connect(m_dtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged, this, &ParticipantMoveModel::onParticipantChanged); - DEBUG_LOG() << "ParticipantMoveModel::ParticipantMoveModel"; + DEBUG_LOG(m_logger) << "ParticipantMoveModel::ParticipantMoveModel"; } @@ -42,7 +42,7 @@ void ParticipantMoveModel::onParticipantChanged(const ParticipantManagement::Par Q_UNUSED(modType) if (data.partyId() != m_partyId) return; - INFO_LOG() << "onParticipantChanged isSimulated=" << data.isSimulated(); + INFO_LOG(m_logger) << "onParticipantChanged isSimulated=" << data.isSimulated(); onReinitModel(partyId()); emit newData(); } @@ -56,7 +56,7 @@ bool ParticipantMoveModel::isSelectableBySimulation(const QModelIndex &index, bo m_dtc->type(data.typeId()).typeClass() == ParticipantManagement::TypeClass_def::Unit) isSimulatable = false; - DEBUG_LOG() << "ParticipantId: " << data.id() + DEBUG_LOG(m_logger) << "ParticipantId: " << data.id() << " isSimulated:" << data.isSimulated() << " equipmentNo:" << data.equipmentNumber() << " typeId=" << data.typeId() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.h index 0dca6f6bb..eee0d476a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantMove/participants_move_model.h @@ -28,6 +28,8 @@ signals: void newData(); private: + +NGL::INGLLogger &m_logger; void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType); bool isSelectableBySimulation(const QModelIndex &index, bool *bIsSimulated = nullptr) const; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_dialog.cpp index 29106776a..51882f070 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_dialog.cpp @@ -41,12 +41,12 @@ bool MissionPlanDialog::init(LtsSession::LtsSession *session) if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << " failed to get ppmDtc"; + ERROR_LOG(m_logger) << " failed to get ppmDtc"; return false; } if (!m_session->getFtc(m_ppmFtc)) { - ERROR_LOG() << " failed to get ppmFtc"; + ERROR_LOG(m_logger) << " failed to get ppmFtc"; return false; } @@ -143,7 +143,7 @@ MissionPlanDialog::WayPointsStatus MissionPlanDialog::wayPointCurrentStatus(cons return WayPointsStatus::Expired; - WARNING_LOG()<<" -- Status Wegpunktkette Abgebrochen muss definiert werden"; + WARNING_LOG(m_logger)<<" -- Status Wegpunktkette Abgebrochen muss definiert werden"; return state; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_edit.cpp index ba6bcf3be..9a6e02f1d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_edit.cpp @@ -74,22 +74,22 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << " failed to get pdmDtc"; + ERROR_LOG(m_logger) << " failed to get pdmDtc"; return false; } if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << " failed to get ppmDtc"; + ERROR_LOG(m_logger) << " failed to get ppmDtc"; return false; } if (!m_session->getFtc(m_ppmFtc)) { - ERROR_LOG() << " failed to get ppmFtc"; + ERROR_LOG(m_logger) << " failed to get ppmFtc"; return false; } if (!m_session->getForeignGuiInterface(m_ppmCbxGui)) { - ERROR_LOG() << " failed to get ppmCbxGui"; + ERROR_LOG(m_logger) << " failed to get ppmCbxGui"; return false; } @@ -130,16 +130,16 @@ bool MissionPlanEdit::init(const int missionPlanId, LtsSession::LtsSessionDataDd const auto pId = m_ui->participantCBox->currentData().toInt(); m_participant = m_ppmDtc->participant(pId); const auto dpd = m_ppmDtc->dynamicParticipantData(m_participant.id()); - DEBUG_LOG() << "idx changed! pId: " << pId << ", m_participant.id(): " << m_participant.id() << ", dpd.participantId(): " << dpd.participantId(); + DEBUG_LOG(m_logger) << "idx changed! pId: " << pId << ", m_participant.id(): " << m_participant.id() << ", dpd.participantId(): " << dpd.participantId(); if (dpd.participantId() < 1) { - ERROR_LOG() << "no dynamic pdata yet for pId " << pId; + ERROR_LOG(m_logger) << "no dynamic pdata yet for pId " << pId; setReady(false); return; } - DEBUG_LOG() << "calling onDynamicParticipantDataChanged !"; + DEBUG_LOG(m_logger) << "calling onDynamicParticipantDataChanged !"; onDynamicParticipantDataChanged(dpd, DataModification::eAdded); }); connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::dynamicParticipantDataChanged, @@ -217,11 +217,11 @@ void MissionPlanEdit::onDynamicParticipantDataChanged(const ParticipantManagemen { if (data.participantId() != m_participant.id() && data.participantId() != 0) { - ERROR_LOG() << "### " << data.participantId() << " != " << m_participant.id() << " (" << (int)modType << ")"; + ERROR_LOG(m_logger) << "### " << data.participantId() << " != " << m_participant.id() << " (" << (int)modType << ")"; return; } - DEBUG_LOG() << "### " << data.participantId() << " == " << m_participant.id() << " (" << (int)modType << ") !!!"; + DEBUG_LOG(m_logger) << "### " << data.participantId() << " == " << m_participant.id() << " (" << (int)modType << ") !!!"; @@ -246,7 +246,7 @@ void MissionPlanEdit::onDynamicParticipantDataChanged(const ParticipantManagemen youngestState.stateTime(0); for (const auto &si : history) { - DEBUG_LOG() << "StateInformation " + DEBUG_LOG(m_logger) << "StateInformation " << " time=" << si.stateTime() << " vulnerabilityBits=" << si.vulnerabilityBits() << " vulnerabilityKindId=" << si.vulnerabilityKindId(); @@ -299,7 +299,7 @@ void MissionPlanEdit::onModifyMissionPlanReply(const Core::FunctionReplyObject & void MissionPlanEdit::onSetMissionActionFulfilledReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG()<<" -- MissionPlanEdit - onSetMissionActionFulfilledReply: "<isUasDroppable(chargeType.id(),0,0)) continue; - DEBUG_LOG() << " fillCharges" + DEBUG_LOG(m_logger) << " fillCharges" << ", id=" << chargeType.id() << ", name= " << chargeType.name(); @@ -754,7 +754,7 @@ void MissionPlanEdit::onGetPolyline() void MissionPlanEdit::onPolylineData(const QPolygonF &polyline) { - DEBUG_LOG() << Q_FUNC_INFO << " numberOfPoints: " << polyline.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " numberOfPoints: " << polyline.size(); if (polyline.size() < 2) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_model.cpp index 7ecda25ea..f1a552a5f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CentralEffectSimulation/Gui/ParticipantUAS/mission_plan_model.cpp @@ -141,7 +141,7 @@ void MissionPlanModel::onMissionPlanChanged(const ParticipantManagement::Mission { const int id = data.id(); int row = findRowForId(id); - DEBUG_LOG()<<"MISSION PLAN CHANGED id ( "< &ppmDtc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "AssignCodificationDataTable::init()"; + DEBUG_LOG(m_logger) << "AssignCodificationDataTable::init()"; if (!dtc || !ftc || !session || !ppmDtc) { - ERROR_LOG() << "AssignCodificationDataTable::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "AssignCodificationDataTable::init() Invalid shared_ptr!"; return false; } @@ -64,7 +64,7 @@ bool AssignCodificationDataTable::init(const std::shared_ptr userVisibleParties; m_ppmDtc->visibleParties(userVisibleParties, LtsSessionData::LtsSessionData::getInstance()->getVisibleParties(m_session->exerciseId())); - DEBUG_LOG() << "Number of parties visible to the user in the exercise: " << userVisibleParties.size(); + DEBUG_LOG(m_logger) << "Number of parties visible to the user in the exercise: " << userVisibleParties.size(); for (const ParticipantManagement::Party &party : std::as_const(userVisibleParties)) { @@ -92,7 +92,7 @@ bool AssignCodificationDataTable::init(const std::shared_ptraddItem(m_model->data(m_model->index(row, CodificationDataOverviewModel::Identifier), Qt::DisplayRole).toString(), m_model->data(m_model->index(row, CodificationDataOverviewModel::Id), Qt::DisplayRole)); - DEBUG_LOG() << "Init Combobox[" << row << "]: PartyId: " << party.id() + DEBUG_LOG(m_logger) << "Init Combobox[" << row << "]: PartyId: " << party.id() << " Identifier: " << m_model->data(m_model->index(row, CodificationDataOverviewModel::Identifier), Qt::DisplayRole).toString() << " CodTabId: " << m_model->data(m_model->index(row, CodificationDataOverviewModel::Id), Qt::DisplayRole).toInt(); } @@ -104,17 +104,17 @@ bool AssignCodificationDataTable::init(const std::shared_ptrdata(m_model->index(row, CodificationDataOverviewModel::PartyIdHiddenColumn), Qt::DisplayRole).toInt(); - DEBUG_LOG() << "Assignment[" << row << "]: assignedPartyId: " << assignedPartyId; + DEBUG_LOG(m_logger) << "Assignment[" << row << "]: assignedPartyId: " << assignedPartyId; if (party.id() == assignedPartyId) { tableId = m_model->data(m_model->index(row, CodificationDataOverviewModel::Id), Qt::DisplayRole).toInt(); - DEBUG_LOG() << "Assignment[" << row << "]: assignedPartyId: " << assignedPartyId + DEBUG_LOG(m_logger) << "Assignment[" << row << "]: assignedPartyId: " << assignedPartyId << " tableId: " << tableId; break; } } - DEBUG_LOG() << "Assignment currentIndex: " << cb->findData(tableId); + DEBUG_LOG(m_logger) << "Assignment currentIndex: " << cb->findData(tableId); cb->setCurrentIndex(cb->findData(tableId)); m_ui->partyLayout->addWidget(cb, i, 1, 1, 1); @@ -128,7 +128,7 @@ bool AssignCodificationDataTable::init(const std::shared_ptrproperty("partyId").toInt(); int tableId = cb->currentData().toInt(); - DEBUG_LOG() << "Assignments: partyId: " << partyId + DEBUG_LOG(m_logger) << "Assignments: partyId: " << partyId << " codTableId: " << tableId; if (tableId < 1) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_assign_codification_data_table.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_assign_codification_data_table.h index df7a29f13..3705711cd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_assign_codification_data_table.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_assign_codification_data_table.h @@ -49,6 +49,8 @@ private Q_SLOTS: bool apply() override; private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool removeAllAssignments(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.cpp index 29fecfaf1..44b3809fd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.cpp @@ -15,7 +15,7 @@ AuthenticationCodeModel::AuthenticationCodeModel(QObject *parent) , m_isEditMode(false) { memset(m_matrix, 0, sizeof m_matrix); - DEBUG_LOG() << "ctor AuthenticationCodeModel"; + DEBUG_LOG(m_logger) << "ctor AuthenticationCodeModel"; } @@ -24,11 +24,11 @@ bool AuthenticationCodeModel::init(const std::shared_ptr slRows = csvData.splitRef(QLatin1Char('\n')); if (slRows.size() != rowCount()) { - ERROR_LOG() << "Invalid row data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid row data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << rowCount() - 1 << "/" << slRows.size(); return false; } @@ -88,7 +88,7 @@ bool AuthenticationCodeModel::setMatrixValuesCSV(const QString &csvData) const QVector slColumns = slRows[row].split(QLatin1Char(';')); if (slColumns.size() != columnCount()) { - ERROR_LOG() << "Invalid column data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid column data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << columnCount() - 1 << "/" << slColumns.size(); return false; } @@ -194,7 +194,7 @@ QVariant AuthenticationCodeModel::data(const QModelIndex &index, int role) const bool AuthenticationCodeModel::setData(const QModelIndex &index, const QVariant &value, int role) { - DEBUG_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + DEBUG_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " char:" << value.toString() << " int:" << value.toInt(); bool bOk; @@ -202,7 +202,7 @@ bool AuthenticationCodeModel::setData(const QModelIndex &index, const QVariant & if ((!bOk) || (val < 0) || (val > 99)) { - ERROR_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + ERROR_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " Invalid Input! " << value.toString() << " Required input value in the range 0-99."; return false; } @@ -236,7 +236,7 @@ void AuthenticationCodeModel::onCodificationDataChanged(const CodificationManage { const int id = data.id(); - DEBUG_LOG() << "onCodificationDataChanged for CodificationData id: " << id + DEBUG_LOG(m_logger) << "onCodificationDataChanged for CodificationData id: " << id << " - AuthenticationCodeMatrix data: " << data.authenticationTableMatirx().c_str() << " - modType: " << (int)modType; @@ -245,7 +245,7 @@ void AuthenticationCodeModel::onCodificationDataChanged(const CodificationManage if (modType == DataModification::eRemoved) { - WARNING_LOG() << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; + WARNING_LOG(m_logger) << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; resetMatrix(); return; @@ -253,7 +253,7 @@ void AuthenticationCodeModel::onCodificationDataChanged(const CodificationManage if (modType == DataModification::eModified) { - DEBUG_LOG() << "CodificationData was modifed. id: " << id << " - " << data.note(); + DEBUG_LOG(m_logger) << "CodificationData was modifed. id: " << id << " - " << data.note(); QString qs = QString::fromStdString(data.authenticationTableMatirx()); setMatrixValuesCSV(qs); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.h index c423fdfa1..607bc8e96 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_authentication_code_model.h @@ -81,6 +81,8 @@ private: + +NGL::INGLLogger &m_logger; void setMatrix(const QVector &data); int m_matrix[13][5]; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.cpp index b5fd7cf20..b84aef337 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.cpp @@ -6,18 +6,17 @@ using namespace CodificationManagement; -CodeTableEditDelegate::CodeTableEditDelegate(QWidget *parent, TableType tableType) - : QItemDelegate(parent) - , m_tableType(tableType) -{ - DEBUG_LOG() << "CodeTableEditDelegate::ctor()"; +CodeTableEditDelegate::CodeTableEditDelegate(QWidget *parent, TableType tableType) : QItemDelegate(parent) + , m_tableType(tableType), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "CodeTableEditDelegate::ctor()"; } QWidget *CodeTableEditDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const { - DEBUG_LOG() << "CodeTableEditDelegate::createEditor() TableType: " << m_tableType + DEBUG_LOG(m_logger) << "CodeTableEditDelegate::createEditor() TableType: " << m_tableType << " rox/column: " << index.row() << "/" << index.column() ; Q_UNUSED(option) @@ -76,7 +75,7 @@ void CodeTableEditDelegate::setEditorData(QWidget *editor, const QModelIndex &in QVariant v = index.data(Qt::EditRole); le->setText(v.toString()); - DEBUG_LOG() << "CodeTableEditDelegate::setEditorData() TableType: " << m_tableType + DEBUG_LOG(m_logger) << "CodeTableEditDelegate::setEditorData() TableType: " << m_tableType << " rox/column: " << index.row() << "/" << index.column() << " Input: " << v.toString(); @@ -90,7 +89,7 @@ void CodeTableEditDelegate::setModelData(QWidget *editor, QAbstractItemModel *mo if (!le) return; - DEBUG_LOG() << "CodeTableEditDelegate::setModelData() TableType: " << m_tableType + DEBUG_LOG(m_logger) << "CodeTableEditDelegate::setModelData() TableType: " << m_tableType << " rox/column: " << index.row() << "/" << index.column() << " Input: " << le->text(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.h index bf6c8ead5..6d7b2a407 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_code_table_edit_delegate.h @@ -43,6 +43,8 @@ public: const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; TableType m_tableType; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.cpp index fa9d4241b..1e1456eca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.cpp @@ -37,7 +37,7 @@ CodificationDataOverviewModel::CodificationDataOverviewModel(QObject *parent) bool CodificationDataOverviewModel::initModel(const std::shared_ptr &codDtc, const std::shared_ptr &ppmDtc) { - DEBUG_LOG() << "CodificationDataModel::initModel()"; + DEBUG_LOG(m_logger) << "CodificationDataModel::initModel()"; if (!codDtc || !ppmDtc) return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.h index b83f00703..3bcf414b6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_model.h @@ -51,6 +51,8 @@ public: friend class CodificationDataOverviewProxyModel; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_codDtc; std::shared_ptr m_ppmDtc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.cpp index 63bea9d51..6898628c4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.cpp @@ -131,7 +131,7 @@ void CodificationDataOverviewView::onShowCodificationData() CodificationManagement::CodificationData codificationData = m_model->getRowData(row); - DEBUG_LOG() << "--- onShowCodificationData() " + DEBUG_LOG(m_logger) << "--- onShowCodificationData() " << " id: " << codificationData.id(); CodificationDataTableView *dialog = new CodificationDataTableView; @@ -145,7 +145,7 @@ void CodificationDataOverviewView::onShowCodificationData() void CodificationDataOverviewView::onAddCodificationData() { - DEBUG_LOG() << "--- onAddCodificationData() "; + DEBUG_LOG(m_logger) << "--- onAddCodificationData() "; CodificationDataTableEditView *dialog = new CodificationDataTableEditView(this); dialog->init(m_dtc, m_ftc, m_session, 0); @@ -165,7 +165,7 @@ void CodificationDataOverviewView::onEditCodificationData() CodificationManagement::CodificationData codificationData = m_model->getRowData(row); - DEBUG_LOG() << "--- onEditCodificationData() " + DEBUG_LOG(m_logger) << "--- onEditCodificationData() " << " id: " << codificationData.id(); CodificationDataTableEditView *dialog = new CodificationDataTableEditView(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.h index 90b4304a0..72d7cf413 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_overview_view.h @@ -40,6 +40,9 @@ public: private: + + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onShowCodificationData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.cpp index 3d24adf8b..7ad1df115 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.cpp @@ -53,11 +53,11 @@ bool CodificationDataTableEditView::init(const std::shared_ptrpteNote->setPlainText(note); @@ -153,14 +153,14 @@ void CodificationDataTableEditView::onLoadCodificationData() m_phraseTableModel->resetMatrix(); m_ui->pteNote->clear(); - ERROR_LOG() << "Load CSV data failed!"; + ERROR_LOG(m_logger) << "Load CSV data failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load CSV data failed!"), tr("CSV Import Info")); return; } if (result == CSVImport::UserAbort) { - DEBUG_LOG() << "Load CSV data abort by user"; + DEBUG_LOG(m_logger) << "Load CSV data abort by user"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load CSV data abort by user"), tr("CSV Import Info")); } } @@ -168,34 +168,34 @@ void CodificationDataTableEditView::onLoadCodificationData() void CodificationDataTableEditView::onSaveCodificationData() { - DEBUG_LOG() << "CodificationDataTableEditView::onSaveCodificationData()"; + DEBUG_LOG(m_logger) << "CodificationDataTableEditView::onSaveCodificationData()"; CSVExport csvExport(m_numCodeModel, m_authenticationCodeModel, m_logisticalTermsModel, m_phraseTableModel, m_ui->pteNote->toPlainText(), this); if (!csvExport.writeCSVData()) - ERROR_LOG() << "Write CSV data to file failed! id:" << m_codificationDataId; + ERROR_LOG(m_logger) << "Write CSV data to file failed! id:" << m_codificationDataId; else - DEBUG_LOG() << "Write CSV data to file ok! id:" << m_codificationDataId; + DEBUG_LOG(m_logger) << "Write CSV data to file ok! id:" << m_codificationDataId; } void CodificationDataTableEditView::loadCodificationDataFromDatabase() { m_lastDdsCodificationData = m_dtc->codificationData(m_codificationDataId); - DEBUG_LOG() << "Load from database: ---"; - DEBUG_LOG() << "NumCodeHorizontalHeader: " << m_lastDdsCodificationData.numeralCodeTableColumnIndex(); - DEBUG_LOG() << "NumCodeVerticalHeader: " << m_lastDdsCodificationData.numeralCodeTableRowIndex(); + DEBUG_LOG(m_logger) << "Load from database: ---"; + DEBUG_LOG(m_logger) << "NumCodeHorizontalHeader: " << m_lastDdsCodificationData.numeralCodeTableColumnIndex(); + DEBUG_LOG(m_logger) << "NumCodeVerticalHeader: " << m_lastDdsCodificationData.numeralCodeTableRowIndex(); - DEBUG_LOG() << "AuthenticationMatrix: " << m_lastDdsCodificationData.authenticationTableMatirx(); + DEBUG_LOG(m_logger) << "AuthenticationMatrix: " << m_lastDdsCodificationData.authenticationTableMatirx(); - DEBUG_LOG() << "LogisticalTermsHorizontalHeader: " << m_lastDdsCodificationData.logisticalTermTableColumnIndex(); - DEBUG_LOG() << "LogisticalTermsVerticalHeader: " << m_lastDdsCodificationData.logisticalTermTableRowIndex(); - DEBUG_LOG() << "LogisticalTermsMatrix :" << m_lastDdsCodificationData.logisticalTermTableMatrix(); + DEBUG_LOG(m_logger) << "LogisticalTermsHorizontalHeader: " << m_lastDdsCodificationData.logisticalTermTableColumnIndex(); + DEBUG_LOG(m_logger) << "LogisticalTermsVerticalHeader: " << m_lastDdsCodificationData.logisticalTermTableRowIndex(); + DEBUG_LOG(m_logger) << "LogisticalTermsMatrix :" << m_lastDdsCodificationData.logisticalTermTableMatrix(); - DEBUG_LOG() << "PhraseTable :" << m_lastDdsCodificationData.phraseTable(); + DEBUG_LOG(m_logger) << "PhraseTable :" << m_lastDdsCodificationData.phraseTable(); - DEBUG_LOG() << "Note: " << m_lastDdsCodificationData.note(); + DEBUG_LOG(m_logger) << "Note: " << m_lastDdsCodificationData.note(); return; } @@ -400,7 +400,7 @@ void CodificationDataTableEditView::onPrint() bool CodificationDataTableEditView::apply() { - DEBUG_LOG() << "CodificationDataTableEditView::onOkayCodificationData()"; + DEBUG_LOG(m_logger) << "CodificationDataTableEditView::onOkayCodificationData()"; @@ -416,28 +416,28 @@ bool CodificationDataTableEditView::apply() modifiedCodificationData.numeralCodeTableColumnIndex(m_numCodeModel->getHorizontalHeaderCSVString().toStdString()); modifiedCodificationData.numeralCodeTableRowIndex(m_numCodeModel->getVerticalHeaderCSVString().toStdString()) ; - DEBUG_LOG() << "onOkayCodificationData() HH: " << m_numCodeModel->getHorizontalHeaderCSVString(); - DEBUG_LOG() << "onOkayCodificationData() VH: " << m_numCodeModel->getVerticalHeaderCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() HH: " << m_numCodeModel->getHorizontalHeaderCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() VH: " << m_numCodeModel->getVerticalHeaderCSVString(); modifiedCodificationData.authenticationTableMatirx(m_authenticationCodeModel->getMatrixDataCSVString().toStdString()); - DEBUG_LOG() << "onOkayCodificationData() authMatrix: " << m_authenticationCodeModel->getMatrixDataCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() authMatrix: " << m_authenticationCodeModel->getMatrixDataCSVString(); modifiedCodificationData.logisticalTermTableColumnIndex(m_logisticalTermsModel->getHorizontalHeaderCSVString().toStdString()); modifiedCodificationData.logisticalTermTableRowIndex(m_logisticalTermsModel->getVerticalHeaderCSVString().toStdString()); modifiedCodificationData.logisticalTermTableMatrix(m_logisticalTermsModel->getMatrixDataCSVString().toStdString()); - DEBUG_LOG() << "onOkayCodificationData() HH: " << m_logisticalTermsModel->getHorizontalHeaderCSVString(); - DEBUG_LOG() << "onOkayCodificationData() VH: " << m_logisticalTermsModel->getVerticalHeaderCSVString(); - DEBUG_LOG() << "onOkayCodificationData() logTermsMatrix: " << m_logisticalTermsModel->getMatrixDataCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() HH: " << m_logisticalTermsModel->getHorizontalHeaderCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() VH: " << m_logisticalTermsModel->getVerticalHeaderCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() logTermsMatrix: " << m_logisticalTermsModel->getMatrixDataCSVString(); modifiedCodificationData.phraseTable(m_phraseTableModel->getMatrixDataCSVString().toStdString()); - DEBUG_LOG() << "onOkayCodificationData() phraseTable: " << m_phraseTableModel->getMatrixDataCSVString(); + DEBUG_LOG(m_logger) << "onOkayCodificationData() phraseTable: " << m_phraseTableModel->getMatrixDataCSVString(); modifiedCodificationData.note(m_ui->pteNote->toPlainText().toStdString()); - DEBUG_LOG() << "CodificationDataTableEditView::onOkayCodificationData()"; + DEBUG_LOG(m_logger) << "CodificationDataTableEditView::onOkayCodificationData()"; modifiedCodificationData.identifier(m_ui->leIdentifier->text().toStdString()); modifiedCodificationData.validityTime(m_ui->dteValidityTime->msecsSinceEpoch()); @@ -463,16 +463,16 @@ void CodificationDataTableEditView::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Text, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void CodificationDataTableEditView::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QString note; CSVImport csvImport(m_numCodeModel, m_authenticationCodeModel, m_logisticalTermsModel, m_phraseTableModel, ¬e, this); @@ -485,7 +485,7 @@ void CodificationDataTableEditView::onImportButtonClicked() { - INFO_LOG() << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << "--- onImportButtonClicked() "; csvImport.loadCSVDataByteArray(content); m_ui->pteNote->setPlainText(note); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.h index dd83392f0..c5ab0eae5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_edit_view.h @@ -64,6 +64,9 @@ private slots: private: + + +NGL::INGLLogger &m_logger; void retranslate() override; void loadCodificationDataFromDatabase(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.cpp index 33269a8f8..db2805f3b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.cpp @@ -56,7 +56,7 @@ bool CodificationDataTableView::init(const std::shared_ptrcodificationData(m_codificationDataId); - DEBUG_LOG() << "Load from database: "; - DEBUG_LOG() << "NumCodeHorizontalHeader: " << m_lastDdsCodificationData.numeralCodeTableColumnIndex(); - DEBUG_LOG() << "NumCodeVerticalHeader: " << m_lastDdsCodificationData.numeralCodeTableRowIndex(); + DEBUG_LOG(m_logger) << "Load from database: "; + DEBUG_LOG(m_logger) << "NumCodeHorizontalHeader: " << m_lastDdsCodificationData.numeralCodeTableColumnIndex(); + DEBUG_LOG(m_logger) << "NumCodeVerticalHeader: " << m_lastDdsCodificationData.numeralCodeTableRowIndex(); - DEBUG_LOG() << "LogisticalTermsHorizontalHeader: " << m_lastDdsCodificationData.logisticalTermTableColumnIndex(); - DEBUG_LOG() << "LogisticalTermsVerticalHeader: " << m_lastDdsCodificationData.logisticalTermTableRowIndex(); - DEBUG_LOG() << "LogisticalTermsMatrix: " << m_lastDdsCodificationData.logisticalTermTableMatrix(); + DEBUG_LOG(m_logger) << "LogisticalTermsHorizontalHeader: " << m_lastDdsCodificationData.logisticalTermTableColumnIndex(); + DEBUG_LOG(m_logger) << "LogisticalTermsVerticalHeader: " << m_lastDdsCodificationData.logisticalTermTableRowIndex(); + DEBUG_LOG(m_logger) << "LogisticalTermsMatrix: " << m_lastDdsCodificationData.logisticalTermTableMatrix(); - DEBUG_LOG() << "AuthenticationMatrix: " << m_lastDdsCodificationData.authenticationTableMatirx(); + DEBUG_LOG(m_logger) << "AuthenticationMatrix: " << m_lastDdsCodificationData.authenticationTableMatirx(); - DEBUG_LOG() << "PhraseTable: " << m_lastDdsCodificationData.phraseTable(); + DEBUG_LOG(m_logger) << "PhraseTable: " << m_lastDdsCodificationData.phraseTable(); - DEBUG_LOG() << "Note: " << m_lastDdsCodificationData.note(); + DEBUG_LOG(m_logger) << "Note: " << m_lastDdsCodificationData.note(); return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.h index 524a99d98..c994dd012 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_codification_data_table_view.h @@ -47,6 +47,8 @@ private Q_SLOTS: DataModification modType); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void loadCodificationDataFromDatabase(); void onPrint(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.cpp index ef2e2e6ae..9292f563d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.cpp @@ -20,14 +20,13 @@ CSVExport::CSVExport(const NumeralCodeModel *numCodeModel, const LogisticalTermsModel *logisticalTermsModel, const PhraseTableModel *phraseTableModel, const QString ¬e, - QWidget *parent) - : QWidget(parent) + QWidget *parent) : QWidget(parent) , m_numCodeModel(numCodeModel) , m_authenticationCodeModel(authenticationCodeModel) , m_logisticalTermsModel(logisticalTermsModel) , m_phraseTableModel(phraseTableModel) - , m_note(note) -{ + , m_note(note), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } @@ -74,7 +73,7 @@ QByteArray CSVExport::exportToByteArray() const bool CSVExport::writeCSVData() { - DEBUG_LOG() << "writeCSVData()"; + DEBUG_LOG(m_logger) << "writeCSVData()"; QFileDialog dialog; dialog.setNameFilter(tr("CSV File (*.csv)")); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.h index 1049b4cec..b50493660 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_export.h @@ -35,6 +35,9 @@ private Q_SLOTS: private: + + +NGL::INGLLogger &m_logger; const NumeralCodeModel *m_numCodeModel; const AuthenticationCodeModel *m_authenticationCodeModel; const LogisticalTermsModel *m_logisticalTermsModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.cpp index c1bbbb98e..38e79ba51 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.cpp @@ -22,14 +22,13 @@ CSVImport::CSVImport(NumeralCodeModel *numCodeModel, LogisticalTermsModel *logisticalTermsModel, PhraseTableModel *phraseTableModel, QString *note, - QWidget *parent) - : QWidget(parent) + QWidget *parent) : QWidget(parent) , m_numCodeModel(numCodeModel) , m_authenticationCodeModel(authenticationCodeModel) , m_logisticalTermsModel(logisticalTermsModel) , m_phraseTableModel(phraseTableModel) - , m_note(note) -{ + , m_note(note), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } @@ -78,7 +77,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaNumCodeHorizontalHeader; desiredCvsSeperatorsPerLine = 12; ++csvKeywordCount; @@ -87,7 +86,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaNumCodeVerticalHeader; desiredCvsSeperatorsPerLine = 0; ++csvKeywordCount; @@ -96,7 +95,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaAuthenticationCodeMatrix; desiredCvsSeperatorsPerLine = 4; ++csvKeywordCount; @@ -105,7 +104,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaLogTermsTableHorizontalHeader; desiredCvsSeperatorsPerLine = 4; ++csvKeywordCount; @@ -114,7 +113,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaLogTermsTableVerticalHeader; desiredCvsSeperatorsPerLine = 0; ++csvKeywordCount; @@ -123,7 +122,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaLogTermsTableMatrix; desiredCvsSeperatorsPerLine = 4; ++csvKeywordCount; @@ -132,7 +131,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaPhraseTableMatrix; desiredCvsSeperatorsPerLine = 1; ++csvKeywordCount; @@ -141,7 +140,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (qbaLine == "\n") { - DEBUG_LOG() << "found " << qbaLine; + DEBUG_LOG(m_logger) << "found " << qbaLine; qba = &qbaNote; desiredCvsSeperatorsPerLine = 0; ++csvKeywordCount; @@ -230,23 +229,23 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) if (csvKeywordCount != 8) { - ERROR_LOG() << "Load csv data failed! Invalid csvKeywordCount. Soll/Ist: 8/" << csvKeywordCount; + ERROR_LOG(m_logger) << "Load csv data failed! Invalid csvKeywordCount. Soll/Ist: 8/" << csvKeywordCount; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data failed! Invalid number of cvs keywords."), tr("CSV Load Error")); return CSVImportResult::LoadFailed; } - DEBUG_LOG() << "Load csv ready... "; - DEBUG_LOG() << "\n-----------start show load csv data blocks -------------------------\n"; - DEBUG_LOG() << "\n: \"" << qbaNumCodeHorizontalHeader << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaNumCodeVerticalHeader << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaAuthenticationCodeMatrix << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaLogTermsTableHorizontalHeader << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaLogTermsTableVerticalHeader << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaLogTermsTableMatrix << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaPhraseTableMatrix << "\"\n"; - DEBUG_LOG() << "\n: \"" << qbaNote << "\"\n"; - DEBUG_LOG() << "\n-----------end of show load csv data blocks -------------------------\n"; + DEBUG_LOG(m_logger) << "Load csv ready... "; + DEBUG_LOG(m_logger) << "\n-----------start show load csv data blocks -------------------------\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaNumCodeHorizontalHeader << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaNumCodeVerticalHeader << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaAuthenticationCodeMatrix << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaLogTermsTableHorizontalHeader << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaLogTermsTableVerticalHeader << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaLogTermsTableMatrix << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaPhraseTableMatrix << "\"\n"; + DEBUG_LOG(m_logger) << "\n: \"" << qbaNote << "\"\n"; + DEBUG_LOG(m_logger) << "\n-----------end of show load csv data blocks -------------------------\n"; qbaNumCodeHorizontalHeader = qbaNumCodeHorizontalHeader.trimmed(); @@ -305,7 +304,7 @@ CSVImport::CSVImportResult CSVImport::loadCSVDataByteArray(QByteArray content) CSVImport::CSVImportResult CSVImport::loadCSVData() { - DEBUG_LOG() << "loadCSVData()"; + DEBUG_LOG(m_logger) << "loadCSVData()"; QFileDialog dialog; dialog.setNameFilter(tr("CSV File (*.csv)")); @@ -340,12 +339,12 @@ CSVImport::CSVImportResult CSVImport::loadCSVData() bool CSVImport::checkNumCodeHorizontalHeader(const QByteArray &qbaNumCodeHorizontalHeader) { - DEBUG_LOG() << "Data: \"" << qbaNumCodeHorizontalHeader << "\""; - DEBUG_LOG() << "Data.size: Soll/Ist: 13 + 12 = 25/" << qbaNumCodeHorizontalHeader.size(); + DEBUG_LOG(m_logger) << "Data: \"" << qbaNumCodeHorizontalHeader << "\""; + DEBUG_LOG(m_logger) << "Data.size: Soll/Ist: 13 + 12 = 25/" << qbaNumCodeHorizontalHeader.size(); if (qbaNumCodeHorizontalHeader.size() == 25) return true; - ERROR_LOG() << "Load csv data 'Numeral Code Horizontal Header' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Numeral Code Horizontal Header' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Numeral Code Horizontal Header' failed!"), tr("CSV Load Error")); return false; } @@ -354,12 +353,12 @@ bool CSVImport::checkNumCodeHorizontalHeader(const QByteArray &qbaNumCodeHorizon bool CSVImport::checkNumCodeVerticalHeader(const QByteArray &qbaNumCodeVerticalHeader) { - DEBUG_LOG() << "Data: \"" << qbaNumCodeVerticalHeader << "\""; - DEBUG_LOG() << "Data.size: Soll/Ist: 13 + 12 = 25/" << qbaNumCodeVerticalHeader.size(); + DEBUG_LOG(m_logger) << "Data: \"" << qbaNumCodeVerticalHeader << "\""; + DEBUG_LOG(m_logger) << "Data.size: Soll/Ist: 13 + 12 = 25/" << qbaNumCodeVerticalHeader.size(); if (qbaNumCodeVerticalHeader.size() == 25) return true; - ERROR_LOG() << "Load csv data 'Numeral Code Vertical Header' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Numeral Code Vertical Header' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Numeral Code Vertical Header' failed!"), tr("CSV Load Error")); return false; } @@ -368,7 +367,7 @@ bool CSVImport::checkNumCodeVerticalHeader(const QByteArray &qbaNumCodeVerticalH bool CSVImport::checkAuthenticationCodeMatrix(QByteArray &qbaAuthenticationCodeMatrix) { - DEBUG_LOG() << "Data: \"" << qbaAuthenticationCodeMatrix << "\""; + DEBUG_LOG(m_logger) << "Data: \"" << qbaAuthenticationCodeMatrix << "\""; QByteArray qbaOutMatrix; @@ -389,13 +388,13 @@ bool CSVImport::checkAuthenticationCodeMatrix(QByteArray &qbaAuthenticationCodeM qbaAuthenticationCodeMatrix = qbaOutMatrix; - DEBUG_LOG() << "Data.size: Soll/Ist: 13 * (5*2 + 4 + 1) -1 = 194 /" << qbaAuthenticationCodeMatrix.size(); + DEBUG_LOG(m_logger) << "Data.size: Soll/Ist: 13 * (5*2 + 4 + 1) -1 = 194 /" << qbaAuthenticationCodeMatrix.size(); if (qbaAuthenticationCodeMatrix.size() == 194) return true; else { - ERROR_LOG() << "Load csv data 'Authentication Code Matrix' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Authentication Code Matrix' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Authentication Code Matrix' failed!"), tr("CSV Load Error")); return false; } @@ -405,14 +404,14 @@ bool CSVImport::checkAuthenticationCodeMatrix(QByteArray &qbaAuthenticationCodeM bool CSVImport::checkLogTermsTableHorizontalHeader(const QByteArray &qbaLogTermsTableHorizontalHeader) { - DEBUG_LOG() << "Data: \"" << qbaLogTermsTableHorizontalHeader << "\""; - DEBUG_LOG() << "Data.size: Soll/Ist: 5 + 4 = 9/" << qbaLogTermsTableHorizontalHeader.size(); + DEBUG_LOG(m_logger) << "Data: \"" << qbaLogTermsTableHorizontalHeader << "\""; + DEBUG_LOG(m_logger) << "Data.size: Soll/Ist: 5 + 4 = 9/" << qbaLogTermsTableHorizontalHeader.size(); if (qbaLogTermsTableHorizontalHeader.size() == 9) return true; else { - ERROR_LOG() << "Load csv data 'Logistical Terms Table Horizontal Header' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Logistical Terms Table Horizontal Header' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Logistical Terms Table Horizontal Header' failed!"), tr("CSV Load Error")); return false; } @@ -422,14 +421,14 @@ bool CSVImport::checkLogTermsTableHorizontalHeader(const QByteArray &qbaLogTerms bool CSVImport::checkLogTermsTableVerticalHeader(const QByteArray &qbaLogTermsTableVerticalHeader) { - DEBUG_LOG() << "Data: \"" << qbaLogTermsTableVerticalHeader << "\""; - DEBUG_LOG() << "Data.size: Soll/Ist: 5 + 4 = 9/" << qbaLogTermsTableVerticalHeader.size(); + DEBUG_LOG(m_logger) << "Data: \"" << qbaLogTermsTableVerticalHeader << "\""; + DEBUG_LOG(m_logger) << "Data.size: Soll/Ist: 5 + 4 = 9/" << qbaLogTermsTableVerticalHeader.size(); if (qbaLogTermsTableVerticalHeader.size() == 9) return true; else { - ERROR_LOG() << "Load csv data 'Logistical Terms Table Vertical Header' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Logistical Terms Table Vertical Header' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Logistical Terms Table Vertical Header' failed!"), tr("CSV Load Error")); return false; } @@ -439,12 +438,12 @@ bool CSVImport::checkLogTermsTableVerticalHeader(const QByteArray &qbaLogTermsTa bool CSVImport::checkLogTermsTableMatrix(const QByteArray &qbaLogTermsTableMatrix) { - DEBUG_LOG() << "Data: \"" << qbaLogTermsTableMatrix << "\""; + DEBUG_LOG(m_logger) << "Data: \"" << qbaLogTermsTableMatrix << "\""; QStringList qsl = m_logisticalTermsModel->splitQuotedStringToRows(QString::fromLatin1(qbaLogTermsTableMatrix)); - DEBUG_LOG() << "Line entry size: Soll/Ist: 5/" << qsl.size(); + DEBUG_LOG(m_logger) << "Line entry size: Soll/Ist: 5/" << qsl.size(); if (qsl.size() == 5) @@ -464,7 +463,7 @@ bool CSVImport::checkLogTermsTableMatrix(const QByteArray &qbaLogTermsTableMatri if (qsEntry.size() > 10) { - ERROR_LOG() << "Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded in cell " << i + 1; + ERROR_LOG(m_logger) << "Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded in cell " << i + 1; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded."), tr("CSV Load Error")); return false; } @@ -476,7 +475,7 @@ bool CSVImport::checkLogTermsTableMatrix(const QByteArray &qbaLogTermsTableMatri if ((qsEntry.size() > 21) || (qsEntry.indexOf(QLatin1Char('\n')) > 10)) { - ERROR_LOG() << "Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded in cell " << i + 1; + ERROR_LOG(m_logger) << "Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded in cell " << i + 1; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Logistical Terms Table Matrix' failed! Maximum number of 10 characters per entry line exceeded."), tr("CSV Load Error")); return false; } @@ -486,7 +485,7 @@ bool CSVImport::checkLogTermsTableMatrix(const QByteArray &qbaLogTermsTableMatri } else { - ERROR_LOG() << "Load csv data 'Logistical Terms Table Matrix' failed!"; + ERROR_LOG(m_logger) << "Load csv data 'Logistical Terms Table Matrix' failed!"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Logistical Terms Table Matrix' failed!"), tr("CSV Load Error")); return false; } @@ -496,14 +495,14 @@ bool CSVImport::checkLogTermsTableMatrix(const QByteArray &qbaLogTermsTableMatri bool CSVImport::checkPhraseTableMatrix(const QByteArray &qbaPhraseTableMatrix) { - DEBUG_LOG() << "Data: \"" << qbaPhraseTableMatrix << "\""; + DEBUG_LOG(m_logger) << "Data: \"" << qbaPhraseTableMatrix << "\""; const QList qbaLinesList = qbaPhraseTableMatrix.split('\n'); if (qbaLinesList.size() != 13) { - ERROR_LOG() << "Load csv data 'Phrase Table Matrix' failed! Invalid Line entry size: Soll/Ist: 13/" << qbaLinesList.size(); + ERROR_LOG(m_logger) << "Load csv data 'Phrase Table Matrix' failed! Invalid Line entry size: Soll/Ist: 13/" << qbaLinesList.size(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Phrase Table Matrix' failed! Invalid Line entry size."), tr("CSV Load Error")); return false; } @@ -516,7 +515,7 @@ bool CSVImport::checkPhraseTableMatrix(const QByteArray &qbaPhraseTableMatrix) { if (qbaLine.at(0).isEmpty() || qbaLine.at(1).isEmpty() || qbaLine.at(0).size() > 15 || qbaLine.at(1).size() > 15) { - ERROR_LOG() << "Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or entry size is < 1 or >> 15. "; + ERROR_LOG(m_logger) << "Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or entry size is < 1 or >> 15. "; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or entry size is less than 1 or greater 15."), tr("CSV Load Error")); return false; } @@ -525,7 +524,7 @@ bool CSVImport::checkPhraseTableMatrix(const QByteArray &qbaPhraseTableMatrix) } else { - ERROR_LOG() << "Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or empty entry per line. "; + ERROR_LOG(m_logger) << "Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or empty entry per line. "; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Load csv data 'Phrase Table Matrix' failed! Invalid number of entrys or empty entry per line."), tr("CSV Load Error")); return false; } @@ -558,7 +557,7 @@ bool CSVImport::removeRedundantCvsSeperators(QByteArray &qbaLine, int desiredVal if (seperatorCnt < desiredValue) { - ERROR_LOG() << "Seperator values less than desired values."; + ERROR_LOG(m_logger) << "Seperator values less than desired values."; return false; } @@ -567,7 +566,7 @@ bool CSVImport::removeRedundantCvsSeperators(QByteArray &qbaLine, int desiredVal qbaLine.remove(qbaLine.lastIndexOf(';'), 1); --seperatorCnt; } - DEBUG_LOG() << "+++Data: \"" << qbaLine << "\"" << " Soll/Ist:: " << desiredValue << "/" << seperatorCnt; + DEBUG_LOG(m_logger) << "+++Data: \"" << qbaLine << "\"" << " Soll/Ist:: " << desiredValue << "/" << seperatorCnt; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.h index 55f749638..918dfccc7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_csv_import.h @@ -42,6 +42,8 @@ public: CSVImportResult loadCSVDataByteArray(QByteArray content); private: + +NGL::INGLLogger &m_logger; bool checkNumCodeHorizontalHeader(const QByteArray &qbaNumCodeHorizontalHeader); bool checkNumCodeVerticalHeader(const QByteArray &qbaNumCodeVerticalHeader); bool checkAuthenticationCodeMatrix(QByteArray &qbaAuthenticationCodeMatrix); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.cpp index cd72f4d7d..c35ab0e5e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.cpp @@ -18,7 +18,7 @@ LogisticalTermsModel::LogisticalTermsModel(QWidget *parent) , m_codificationDataId(0) , m_isEditMode(false) { - DEBUG_LOG() << "ctor LogisticalTermsModel"; + DEBUG_LOG(m_logger) << "ctor LogisticalTermsModel"; m_matrix.resize(s_matrixCount); for (int i = 0; i < s_matrixCount; ++i) m_matrix[i].resize(s_matrixCount); @@ -30,11 +30,11 @@ bool LogisticalTermsModel::init(const std::shared_ptr slColumns = slRows[row].splitRef(QLatin1Char(';')); if (slColumns.size() != m_matrix.size()) { - ERROR_LOG() << "Invalid column data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid column data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << m_matrix.size() << "/" << slColumns.size(); return false; } @@ -217,7 +217,7 @@ QString LogisticalTermsModel::getMatrixDataCSVString() const } const QString qs(slRows.join(QLatin1Char('\n'))); - DEBUG_LOG() << "getMatrixDataCSVString() : " << qs; + DEBUG_LOG(m_logger) << "getMatrixDataCSVString() : " << qs; return qs; } @@ -336,7 +336,7 @@ QVariant LogisticalTermsModel::data(const QModelIndex &index, int role) const bool LogisticalTermsModel::setData(const QModelIndex &index, const QVariant &value, int role) { - DEBUG_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + DEBUG_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " value:" << value.toString(); const QString qs = value.toString(); @@ -393,7 +393,7 @@ void LogisticalTermsModel::onCodificationDataChanged(const CodificationManagemen { const int id = data.id(); - DEBUG_LOG() << "onCodificationDataChanged for CodificationData id: " << id + DEBUG_LOG(m_logger) << "onCodificationDataChanged for CodificationData id: " << id << " - NumCodeColumnIdx data: " << data.numeralCodeTableColumnIndex().c_str() << " - NumCodeRowIdx data: " << data.numeralCodeTableRowIndex().c_str() << " - modType: " << modType; @@ -403,7 +403,7 @@ void LogisticalTermsModel::onCodificationDataChanged(const CodificationManagemen if (modType == DataModification::eRemoved) { - WARNING_LOG() << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; + WARNING_LOG(m_logger) << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; resetMatrix(); setColumnSelectionValuesCSV(QString()); @@ -413,7 +413,7 @@ void LogisticalTermsModel::onCodificationDataChanged(const CodificationManagemen if (modType == DataModification::eModified) { - DEBUG_LOG() << "CodificationData was modifed. id: " << id << " - " << data.note(); + DEBUG_LOG(m_logger) << "CodificationData was modifed. id: " << id << " - " << data.note(); QString qs = QString::fromStdString(data.logisticalTermTableColumnIndex()); setColumnSelectionValuesCSV(qs); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.h index 662c4b78f..605e2ea39 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_logistical_terms_model.h @@ -110,6 +110,17 @@ private Q_SLOTS: private: + + + + + + + + + + +NGL::INGLLogger &m_logger; QVector> m_matrix; QVector m_RowSelectionValues; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.cpp index 9ae1465a8..3e52d267f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.cpp @@ -69,7 +69,7 @@ bool NumeralCodeModel::setColumnSelectionValuesCSV(const QString &csvData) if (slColumns.size() != columnCount() - 1) { - ERROR_LOG() << "Invalid column data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid column data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << columnCount() - 1 << "/" << slColumns.size(); return false; } @@ -79,7 +79,7 @@ bool NumeralCodeModel::setColumnSelectionValuesCSV(const QString &csvData) const QStringRef &qs = slColumns.at(i); if (qs.size() != 1) { - ERROR_LOG() << "Invalid column data value at id: " << i + ERROR_LOG(m_logger) << "Invalid column data value at id: " << i << " codificationDataId: " << m_codificationDataId; return false; } @@ -97,7 +97,7 @@ bool NumeralCodeModel::setRowSelectionValuesCSV(const QString &csvData) if (slRows.size() != rowCount() - 1) { - ERROR_LOG() << "Invalid row data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid row data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << rowCount() - 1 << "/" << slRows.size() << " Default values will be used. "; return false; @@ -108,7 +108,7 @@ bool NumeralCodeModel::setRowSelectionValuesCSV(const QString &csvData) const QStringRef &qs = slRows.at(i); if (qs.size() != 1) { - ERROR_LOG() << "Invalid row data value at id: " << i + ERROR_LOG(m_logger) << "Invalid row data value at id: " << i << " codificationDataId: " << m_codificationDataId; return false; } @@ -278,7 +278,7 @@ QVariant NumeralCodeModel::data(const QModelIndex &index, int role) const bool NumeralCodeModel::setData(const QModelIndex &index, const QVariant &value, int role) { - DEBUG_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + DEBUG_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " char:" << value.toString(); if (value.toString().contains(QLatin1Char('\"')) || value.toString().contains(QLatin1Char(';'))) @@ -400,7 +400,7 @@ void NumeralCodeModel::onCodificationDataChanged(const CodificationManagement::C { const int id = data.id(); - DEBUG_LOG() << "onCodificationDataChanged for CodificationData id: " << id + DEBUG_LOG(m_logger) << "onCodificationDataChanged for CodificationData id: " << id << " - NumCodeColumnIdx data: " << data.numeralCodeTableColumnIndex().c_str() << " - NumCodeRowIdx data: " << data.numeralCodeTableRowIndex().c_str() << " - modType: " << (int)modType; @@ -410,7 +410,7 @@ void NumeralCodeModel::onCodificationDataChanged(const CodificationManagement::C if (modType == DataModification::eRemoved) { - WARNING_LOG() << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; + WARNING_LOG(m_logger) << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; setColumnSelectionValuesCSV(QString()); setRowSelectionValuesCSV(QString()); return; @@ -418,7 +418,7 @@ void NumeralCodeModel::onCodificationDataChanged(const CodificationManagement::C if (modType == DataModification::eModified) { - DEBUG_LOG() << "CodificationData was modifed. id: " << id << " - " << data.note(); + DEBUG_LOG(m_logger) << "CodificationData was modifed. id: " << id << " - " << data.note(); QString qs = QString::fromStdString(data.numeralCodeTableColumnIndex()); setColumnSelectionValuesCSV(qs); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.h index a1bcae09a..07f349685 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_numeral_code_model.h @@ -89,6 +89,8 @@ private: + +NGL::INGLLogger &m_logger; void initMatrix(); QVector m_MatrixNumeralSet; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.cpp index 513277cda..5096b262f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.cpp @@ -15,7 +15,7 @@ PhraseTableModel::PhraseTableModel(QWidget *parent) , m_codificationDataId(0) , m_isEditMode(false) { - DEBUG_LOG() << "ctor PhraseTableModel"; + DEBUG_LOG(m_logger) << "ctor PhraseTableModel"; } @@ -24,7 +24,7 @@ bool PhraseTableModel::init(const std::shared_ptr slRows = csvData.splitRef(QLatin1Char('\n')); if (slRows.count() != rowCount()) { - ERROR_LOG() << "Invalid row data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid row data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << rowCount() << "/" << slRows.size(); return false; } @@ -89,7 +89,7 @@ bool PhraseTableModel::setMatrixValuesCSV(const QString &csvData) const QStringList slColumns = splitQuotedString(QLatin1Char(';'), slRows[row].toString()); if (slColumns.count() != columnCount()) { - ERROR_LOG() << "Invalid column data count." << " codificationDataId: " << m_codificationDataId + ERROR_LOG(m_logger) << "Invalid column data count." << " codificationDataId: " << m_codificationDataId << " Soll/Ist: " << columnCount() << "/" << slColumns.size(); return false; } @@ -196,7 +196,7 @@ QVariant PhraseTableModel::data(const QModelIndex &index, int role) const bool PhraseTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { - DEBUG_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + DEBUG_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " value:" << value.toString(); @@ -249,7 +249,7 @@ void PhraseTableModel::onCodificationDataChanged(const CodificationManagement::C { const int id = data.id(); - DEBUG_LOG() << "onCodificationDataChanged for CodificationData id: " << id + DEBUG_LOG(m_logger) << "onCodificationDataChanged for CodificationData id: " << id << " - PhraseTableModel data: " << data.phraseTable().c_str() << " - modType: " << (int)modType; @@ -258,7 +258,7 @@ void PhraseTableModel::onCodificationDataChanged(const CodificationManagement::C if (modType == DataModification::eRemoved) { - WARNING_LOG() << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; + WARNING_LOG(m_logger) << "CodificationData was removed. id: " << id << " ToDo: 'ShowCodificationData' Tab loeschen !?"; resetMatrix(); return; @@ -266,7 +266,7 @@ void PhraseTableModel::onCodificationDataChanged(const CodificationManagement::C if (modType == DataModification::eModified) { - DEBUG_LOG() << "CodificationData was modifed. id: " << id << " - " << data.note(); + DEBUG_LOG(m_logger) << "CodificationData was modifed. id: " << id << " - " << data.note(); QString qs = QString::fromStdString(data.phraseTable()); setMatrixValuesCSV(qs); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.h index f3b703576..0ef6069f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Gui/CodificationData/cod_phrase_table_model.h @@ -80,6 +80,8 @@ private Q_SLOTS: private: + +NGL::INGLLogger &m_logger; QStringList splitQuotedString(const QChar &sep, const QString &inString); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.cpp index e279560d1..977e6f3c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.cpp @@ -270,7 +270,7 @@ QVariant NumeralCodeModel::data(const QModelIndex &index, int role) const bool NumeralCodeModel::setData(const QModelIndex &index, const QVariant &value, int role) { - DEBUG_LOG() << "setData() row/col: " << index.row() << "/" << index.column() + DEBUG_LOG(m_logger) << "setData() row/col: " << index.row() << "/" << index.column() << " char:" << value.toString(); QString tmp = value.toString(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.h index 41189c1c2..9e178443e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/cod_numeral_code_model.h @@ -74,6 +74,8 @@ private: + +NGL::INGLLogger &m_logger; bool initMatrix(); QVector m_MatrixNumeralSet; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.cpp index eb05f58c1..018711807 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.cpp @@ -10,12 +10,11 @@ #include -MainDialog::MainDialog(QWidget *parent) - : QDialog(parent) +MainDialog::MainDialog(QWidget *parent) : QDialog(parent) , m_ui(new Ui::MainDialog) , m_numCodeModel(new NumeralCodeModel(parent)) - .getNGLLogger("COD_Test_NumeralCodeTableMainDialog")) -{ + .getNGLLogger("COD_Test_NumeralCodeTableMainDialog")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); } @@ -139,7 +138,7 @@ void MainDialog::onPbSetHorizontalHeaderCSV() csvVec.remove(columnSelectionValues.size() * 2 - 1); - DEBUG_LOG() << "onPbSetHorizontalHeaderCSV() " + DEBUG_LOG(m_logger) << "onPbSetHorizontalHeaderCSV() " << " csvVec.size(): " << csvVec.size(); m_numCodeModel->setColumnSelectionValuesCSV(csvVec); @@ -178,7 +177,7 @@ void MainDialog::onPbSetVerticalHeaderCSV() csvVec.remove(rowSelectionValues.size() * 2 - 1); - DEBUG_LOG() << "onPbSetVerticalHeaderCSV() " + DEBUG_LOG(m_logger) << "onPbSetVerticalHeaderCSV() " << " csvVec.size(): " << csvVec.size(); m_numCodeModel->setRowSelectionValuesCSV(csvVec); @@ -199,7 +198,7 @@ void MainDialog::getNumeralCodeHeader() for (int i = 0; i < qVecVH.size(); ++i) qbaVH.append(qVecVH.at(i)); - DEBUG_LOG() << "getNumeralCodeHeader()" + DEBUG_LOG(m_logger) << "getNumeralCodeHeader()" << " HH: " << qbaHH << " size: " << qbaHH.size() << " VH: " << qbaVH << " size: " << qbaVH.size(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.h index 864b03e64..374b2703b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/CodificationManagement/Test/maindialog.h @@ -41,6 +41,7 @@ private Q_SLOTS: void getNumeralCodeHeader(); private: + NGL::INGLLogger &m_logger; Ui::MainDialog *m_ui; NumeralCodeModel *m_numCodeModel; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.cpp index 0d6c9a149..f8f00accc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.cpp @@ -96,7 +96,7 @@ void SoundAreaEditDialog::onPlaySound(SoundManagement::SoundCategory category, i void SoundAreaEditDialog::onStopAllSounds() { - DEBUG_LOG() << "onStopAllSounds"; + DEBUG_LOG(m_logger) << "onStopAllSounds"; QList egcuIds; @@ -105,13 +105,13 @@ void SoundAreaEditDialog::onStopAllSounds() { if (!m_egcuCheckBoxes.value(egcu)->isChecked()) continue; - DEBUG_LOG() << "onStopAllSounds add egcu=" << egcu; + DEBUG_LOG(m_logger) << "onStopAllSounds add egcu=" << egcu; egcuIds.append(egcu); } for (const auto &egcu : std::as_const(egcuIds)) { - DEBUG_LOG() << "onStopAllSounds egcu=" << egcu; + DEBUG_LOG(m_logger) << "onStopAllSounds egcu=" << egcu; SoundManagement::StopAllSoundsRequest req(egcu); m_somFtc->stopAllSoundsRequest(req, nullptr); @@ -125,7 +125,7 @@ m_somFtc->stopAllSoundsRequest(req, nullptr); bool SoundAreaEditDialog::init(LtsSession::LtsSessionDataDds *session) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; m_session = session; @@ -133,19 +133,19 @@ bool SoundAreaEditDialog::init(LtsSession::LtsSessionDataDds *session) std::shared_ptr ismDtc; if (!m_session->getDtc(ismDtc)) { - ERROR_LOG() << "connection to ISM-DTC failed"; + ERROR_LOG(m_logger) << "connection to ISM-DTC failed"; return false; } if (!m_session->getDtc(m_somDtc)) { - ERROR_LOG() << "connection to SOM-DTC failed"; + ERROR_LOG(m_logger) << "connection to SOM-DTC failed"; return false; } if (!m_session->getFtc(m_somFtc)) { - ERROR_LOG() << "connection to SOM-FTC failed"; + ERROR_LOG(m_logger) << "connection to SOM-FTC failed"; return false; } @@ -244,7 +244,7 @@ bool SoundAreaEditDialog::init(LtsSession::LtsSessionDataDds *session) m_buttonBox->connectButton(LtsWidgets::DialogButton::Hide, this, &SoundAreaEditDialog::onStopAllSounds); - DEBUG_LOG() << "init successful"; + DEBUG_LOG(m_logger) << "init successful"; return true; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.h index 1e7e734f9..56c0c0b39 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_dialog.h @@ -96,6 +96,8 @@ signals: void finished(const QString &msg); private: + +NGL::INGLLogger &m_logger; Core::FunctionReplyObject m_reply; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.cpp index a974c7efe..e02a6aab9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.cpp @@ -24,9 +24,8 @@ namespace EffectManagement QIcon SoundAreaEditPlaylistDelegate::s_iconInf = QIcon(QStringLiteral("icon:infinity.svg")); -SoundAreaEditPlaylistDelegate::SoundAreaEditPlaylistDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ +SoundAreaEditPlaylistDelegate::SoundAreaEditPlaylistDelegate(QObject *parent) : QStyledItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } @@ -97,7 +96,7 @@ void SoundAreaPlaylistModel::onTimeout() bool SoundAreaPlaylistModel::init(std::shared_ptr &somDtc) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; const QMap soundStates = somDtc->soundStates(); for (const auto &data : std::as_const(soundStates)) @@ -120,7 +119,7 @@ bool SoundAreaPlaylistModel::init(std::shared_ptrstart(1000); - DEBUG_LOG() << "init successful"; + DEBUG_LOG(m_logger) << "init successful"; return true; } @@ -147,14 +146,14 @@ bool SoundAreaPlaylistModel::addActiveSound(SoundState data) if (row != -1) { - ERROR_LOG() << "'" << name << "' is already active"; + ERROR_LOG(m_logger) << "'" << name << "' is already active"; return false; } data.status(SoundState::Status::Active); insertRow(data); - DEBUG_LOG() << "adding '" << name << "' to active Sounds"; + DEBUG_LOG(m_logger) << "adding '" << name << "' to active Sounds"; return true; } @@ -230,7 +229,7 @@ bool SoundAreaPlaylistModel::onDataChanged(const SoundState &data, DataModificat return addActiveSound(data); case DataModification::eModified: - WARNING_LOG() << "handling eModified for sound states not implemented yet"; + WARNING_LOG(m_logger) << "handling eModified for sound states not implemented yet"; return false; case DataModification::eRemoved: @@ -238,7 +237,7 @@ bool SoundAreaPlaylistModel::onDataChanged(const SoundState &data, DataModificat idx = SoundAreaPlaylistModel::index(m_vecData.indexOf(data), 0); if (row == -1) { - ERROR_LOG() << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is neither scheduled nor active"; + ERROR_LOG(m_logger) << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is neither scheduled nor active"; return false; } return removeActiveSound(idx); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.h index 0fd2147ca..0843b8bb3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_playlist.h @@ -40,6 +40,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; static QIcon s_iconInf; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.cpp index 95c5cd895..9a9ec17df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.cpp @@ -92,11 +92,10 @@ void SpinBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionVi -SoundTreeItem::SoundTreeItem(const QVector &data, const SoundKey &key, SoundTreeItem *parent) - : m_parent(parent) +SoundTreeItem::SoundTreeItem(const QVector &data, const SoundKey &key, SoundTreeItem *parent) : m_parent(parent) , m_data(data) - , m_soundKey(key) -{ + , m_soundKey(key), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } SoundTreeItem::~SoundTreeItem() @@ -208,7 +207,7 @@ bool SoundAreaTreeModel::onToggleLoop(const QModelIndex &index) bool SoundAreaTreeModel::init(const std::shared_ptr &somDtc) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; SoundKey key; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.h index 545ddad9e..5d5c40e91 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_edit_model_tree.h @@ -66,6 +66,8 @@ public: QString toString() const; private: + +NGL::INGLLogger &m_logger; QVector m_children; SoundTreeItem *m_parent{nullptr}; QVector m_data; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.cpp index 1c39b9e86..afc7bb1fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.cpp @@ -16,10 +16,9 @@ namespace EffectManagement -SoundAreaHelper::SoundAreaHelper(SoundAreaHelper *helper) - : m_ismDtc(helper->ismDtc()) - , m_somDtc(helper->somDtc()) -{ +SoundAreaHelper::SoundAreaHelper(SoundAreaHelper *helper) : m_ismDtc(helper->ismDtc()) + , m_somDtc(helper->somDtc()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { QMap assets = m_ismDtc->instrumentationAssets(); for (const auto &asset : std::as_const(assets)) if (asset.mountingPointTypeId() == InfrastructureManagement::MountingPointType_def::EffectGenerationControlUnit) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.h index 277d75c14..94d395a75 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_helper.h @@ -79,6 +79,8 @@ public: static SoundManagement::SoundCategory soundCategory(const int &i); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_ismDtc; std::shared_ptr m_somDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.cpp index 48db7cf9d..cdcd1d28b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.cpp @@ -100,7 +100,7 @@ void SoundAreaSelectDialog::onStopAllSounds() bool SoundAreaSelectDialog::init(LtsSession::LtsSessionDataDds *session, const QString &menuGroup) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; m_session = session; setMenuGroup(menuGroup); @@ -110,25 +110,25 @@ bool SoundAreaSelectDialog::init(LtsSession::LtsSessionDataDds *session, const Q if (!m_session->getDtc(ismDtc)) { - ERROR_LOG() << "connection to ISM-DTC failed"; + ERROR_LOG(m_logger) << "connection to ISM-DTC failed"; return false; } if (!m_session->getDtc(somDtc)) { - ERROR_LOG() << "connection to SOM-DTC failed"; + ERROR_LOG(m_logger) << "connection to SOM-DTC failed"; return false; } if (!m_session->getFtc(m_somFtc)) { - ERROR_LOG() << "connection to SOM-FTC failed"; + ERROR_LOG(m_logger) << "connection to SOM-FTC failed"; return false; } if (!m_model->init(ismDtc, somDtc)) { - ERROR_LOG() << "sound area select model initialization failed"; + ERROR_LOG(m_logger) << "sound area select model initialization failed"; return false; } @@ -149,7 +149,7 @@ bool SoundAreaSelectDialog::init(LtsSession::LtsSessionDataDds *session, const Q connect(m_ui->tvSoundlist, &QTableView::clicked, this, &SoundAreaSelectDialog::onSelectSoundArea); m_buttonBox->connectButton(LtsWidgets::DialogButton::Edit, this, &SoundAreaSelectDialog::onStopAllSounds); - DEBUG_LOG() << "init successful"; + DEBUG_LOG(m_logger) << "init successful"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.h index 207a62092..b58c295de 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_dialog.h @@ -62,6 +62,8 @@ public: bool init(LtsSession::LtsSessionDataDds *session, const QString &menuGroup); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onStopAllSoundsReply(const Core::FunctionReplyObject &replyObject) override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_model.cpp index 6524121cb..8a2c4add9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectManagement/Gui/SoundArea/efm_sound_area_select_model.cpp @@ -18,9 +18,8 @@ namespace EffectManagement -SoundAreaSelectDelegate::SoundAreaSelectDelegate(QObject *parent) - : QItemDelegate(parent) -{ +SoundAreaSelectDelegate::SoundAreaSelectDelegate(QObject *parent) : QItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } @@ -77,7 +76,7 @@ bool SoundAreaSelectModel::onSoundStateChanged(const SoundManagement::SoundState case DataModification::eAdded: if (it != soundArea.activeSounds.end()) { - DEBUG_LOG() << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is already active"; + DEBUG_LOG(m_logger) << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is already active"; return false; } else @@ -93,7 +92,7 @@ bool SoundAreaSelectModel::onSoundStateChanged(const SoundManagement::SoundState case DataModification::eRemoved: if (it == soundArea.activeSounds.end()) { - DEBUG_LOG() << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is not active"; + DEBUG_LOG(m_logger) << "'" << m_helper->soundName(data.category(), data.soundId()) << "' is not active"; return false; } else @@ -123,7 +122,7 @@ bool SoundAreaSelectModel::onSoundStateChanged(const SoundManagement::SoundState bool SoundAreaSelectModel::init(const std::shared_ptr &ismDtc, const std::shared_ptr &somDtc) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; m_ismDtc = ismDtc; m_somDtc = somDtc; @@ -154,7 +153,7 @@ bool SoundAreaSelectModel::init(const std::shared_ptr &ftc, LtsSession::LtsSession *session, bool freeForm) { - DEBUG_LOG() << "FiringExplosion::init()"; + DEBUG_LOG(m_logger) << "FiringExplosion::init()"; if (!dtc || !ftc) { - ERROR_LOG() << "FiringExplosion::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "FiringExplosion::init() Invalid shared_ptr!"; return false; } @@ -72,7 +72,7 @@ bool FiringExplosion::init(const std::shared_ptrinit(m_ftc)) { - ERROR_LOG() << "Can't create SafetiConfirmationWidget"; + ERROR_LOG(m_logger) << "Can't create SafetiConfirmationWidget"; return false; } m_ui->mainVertLayout->insertWidget(3, m_safetyConfirmationWidget); @@ -180,7 +180,7 @@ void FiringExplosion::onOperatingConditionEntityChanged(const OperatingCondition void FiringExplosion::onApply() { if (!statusChangedForManuallyEffectShow(EffectShowStatus_e::Apply)) - ERROR_LOG() << "Apply failed"; + ERROR_LOG(m_logger) << "Apply failed"; } void FiringExplosion::onFire() @@ -192,7 +192,7 @@ void FiringExplosion::onFire() rc = statusChangedForManuallyEffectShow(EffectShowStatus_e::Fire); if (!rc) - ERROR_LOG() << "Firing Explosion Order Execution failed"; + ERROR_LOG(m_logger) << "Firing Explosion Order Execution failed"; } void FiringExplosion::onInterrupt() { @@ -203,7 +203,7 @@ void FiringExplosion::onInterrupt() rc = statusChangedForManuallyEffectShow(EffectShowStatus_e::Interrupt); if (!rc) - ERROR_LOG() << "Firing Explosion Order Execution failed"; + ERROR_LOG(m_logger) << "Firing Explosion Order Execution failed"; } void FiringExplosion::onAbort() @@ -328,7 +328,7 @@ bool FiringExplosion::statusChangedForOrderedEffectShow(EffectShowStatus_e statu oc = EffectShowManagement::OrderConfirmation_e_def::InterruptExecution; break; default: - DEBUG_LOG() << "FiringExplosion::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess..."; + DEBUG_LOG(m_logger) << "FiringExplosion::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess..."; break; } orderModifyRequest.orderConfirmation(oc); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_explosion.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_explosion.h index 61f3489bb..e25453a50 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_explosion.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_explosion.h @@ -46,6 +46,8 @@ public: bool freeForm = false); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onOrderModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void onManuallyExplosionReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.cpp index 78fe2e49d..25ea646fa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.cpp @@ -27,7 +27,7 @@ FiringSmoke::FiringSmoke(QWidget *parent) , m_firingClearanceCountDown(0) , m_endOfFiringClearanceCountDown(0) { - DEBUG_LOG() << "FiringSmoke::FiringSmoke()"; + DEBUG_LOG(m_logger) << "FiringSmoke::FiringSmoke()"; m_ui->setupUi(this); m_smokeState = new SmokeState(this); @@ -49,11 +49,11 @@ bool FiringSmoke::init(const std::shared_ptr & const std::shared_ptr &ftc, LtsSession::LtsSession *session, bool freeForm) { - DEBUG_LOG() << "FiringSmoke::init()"; + DEBUG_LOG(m_logger) << "FiringSmoke::init()"; if (!dtc || !ftc) { - ERROR_LOG() << "FiringSmoke::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "FiringSmoke::init() Invalid shared_ptr!"; return false; } @@ -183,7 +183,7 @@ void FiringSmoke::onMeteoTimerTimeout() void FiringSmoke::onApply() { if (!statusChangedForManuallyEffectShow(EffectShowStatus_e::Apply)) - ERROR_LOG() << "Firing Smoke Apply failed"; + ERROR_LOG(m_logger) << "Firing Smoke Apply failed"; } @@ -281,7 +281,7 @@ bool FiringSmoke::statusChangedForOrderedEffectShow(EffectShowStatus_e status) oc = EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut; break; default: - DEBUG_LOG() << "FiringSmoke::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess..."; + DEBUG_LOG(m_logger) << "FiringSmoke::statusChangedForOrderedEffectShow switch is defaulting, should not happen I guess..."; break; } orderModifyRequest.orderConfirmation(oc); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.h index 639408e91..adae18556 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_firing_smoke.h @@ -46,6 +46,8 @@ public: bool freeForm = false); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onOrderModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void onManuallySmokeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.cpp index 2288e1a15..bbdea16ed 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.cpp @@ -58,11 +58,11 @@ OperatingCondition::~OperatingCondition() bool OperatingCondition::init(const std::shared_ptr &dtc, const std::shared_ptr &ftc) { - DEBUG_LOG() << "OperatingCondition::init()"; + DEBUG_LOG(m_logger) << "OperatingCondition::init()"; if (!dtc || !ftc) { - ERROR_LOG() << "OperatingCondition::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "OperatingCondition::init() Invalid shared_ptr!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.h index 095c44a92..c6bef8845 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_operating_condition.h @@ -41,6 +41,7 @@ public: bool init(const std::shared_ptr &dtc, const std::shared_ptr &ftc); private: +NGL::INGLLogger &m_logger; void retranslate() override; void onSendAmmunitionReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void onSendReadinessReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.cpp index 899b10b2e..1a66c9dc1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.cpp @@ -28,11 +28,11 @@ OrderEdit::~OrderEdit() bool OrderEdit::init(const std::shared_ptr &ftc, EffectShowManagement::OrderConfirmation_e order) { - DEBUG_LOG() << "OrderEdit::init()"; + DEBUG_LOG(m_logger) << "OrderEdit::init()"; if (!ftc) { - ERROR_LOG() << "OrderEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "OrderEdit::init() Invalid shared_ptr!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.h index 2e01e141b..f77ff8ac8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_edit.h @@ -33,6 +33,8 @@ public: bool apply() override; private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool checkForAnswerUiRequirement() const; void showOrder(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.cpp index 01e145c5c..59b3d7c14 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.cpp @@ -124,7 +124,7 @@ bool OrderList::init(bool isEffectShow, m_ui->widget->hideColumn(EffectShowClient::OrderModel::Volley); m_ui->widget->hideColumn(EffectShowClient::OrderModel::ShotsInTotal); } - DEBUG_LOG() << "esc Order is visible:" << m_sitMapGuiIfc->isEscOrderPositionVisible(); + DEBUG_LOG(m_logger) << "esc Order is visible:" << m_sitMapGuiIfc->isEscOrderPositionVisible(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, m_sitMapGuiIfc->isEscOrderPositionVisible()); m_buttonBox->setButtonVisible(LtsWidgets::DialogButton::Show, m_isEffectShow); @@ -174,7 +174,7 @@ void OrderList::onEditOrder() const EffectShowClient::Order order = m_model->getRowData(row); - DEBUG_LOG() << "--- onEditOrder() "; + DEBUG_LOG(m_logger) << "--- onEditOrder() "; if (order.orderConfirmation() == EffectShowManagement::OrderConfirmation_e_def::OrderCarriedOut) return; bool fireReadinessEnable = true; @@ -265,7 +265,7 @@ void OrderList::onRemoveEscOrderPosition() m_sitMapGuiIfc->escOrderPosition_remove(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load, false); - DEBUG_LOG() << "esc Order row selected:" << m_ui->widget->selectionModel()->selectedRows().size(); + DEBUG_LOG(m_logger) << "esc Order row selected:" << m_ui->widget->selectionModel()->selectedRows().size(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, m_ui->widget->selectionModel()->selectedRows().size() > 0); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.h index da7244899..df316b810 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_list.h @@ -41,6 +41,8 @@ public: const std::shared_ptr &dtcTabOC); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onEditOrder(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_model.h index 3fbfe2f6d..5c26731f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowClient/Gui/esc_order_model.h @@ -51,6 +51,8 @@ private slots: void onOwnPositionChanged(const TrainingAreaBaseOC::OwnPosition &data); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; std::shared_ptr m_dtcTabOC; TrainingAreaBaseOC::OwnPosition m_ownPosition; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_list.h index c486b8b11..39c3882d6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_list.h @@ -30,6 +30,8 @@ public: bool init(LtsSession::LtsSession *session); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onShowEffectShowActor(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_model.h index 56007e68d..7236e287c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_model.h @@ -24,6 +24,8 @@ public: EffectShowActorProxyModel(EffectShowActorModel *sourceModel, EffectShowModel *effectShowModel, QObject *parent); protected: + +NGL::INGLLogger &m_logger; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; EffectShowModel *m_effectShowModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.cpp index 94be021d6..75beda4b6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.cpp @@ -95,11 +95,11 @@ bool EffectShowActorRelocationEdit::init(LtsSession::LtsSession *session, EffectShowModel *model, int rowToCopy) { - DEBUG_LOG() << "EffectShowActorRelocationEdit::init()"; + DEBUG_LOG(m_logger) << "EffectShowActorRelocationEdit::init()"; if (!session) { - ERROR_LOG() << "EffectShowActorRelocationEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "EffectShowActorRelocationEdit::init() Invalid shared_ptr!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.h index 69718c344..83e8b157a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_edit.h @@ -47,6 +47,8 @@ private slots: void onEffectShowVehicleStatusChanged(const EffectShowVehicleStatus &data, const DataModification &modType); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onEffectShowActorRelocationModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.cpp index e394bf893..9d70ff1cd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.cpp @@ -92,7 +92,7 @@ void EffectShowActorRelocationList::onSelectionChanged() void EffectShowActorRelocationList::onAddEffectShowActorRelocation() { - DEBUG_LOG() << "--- onAddEffectShowActorRelocation() "; + DEBUG_LOG(m_logger) << "--- onAddEffectShowActorRelocation() "; EffectShowActorRelocationEdit *dialog = new EffectShowActorRelocationEdit(this); if (m_ui->widget->currentIndex().row() >= 0) dialog->init(m_session, m_effectShowModel, m_ui->widget->currentIndex().row()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.h index 517942c5a..1b5adc500 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_list.h @@ -33,6 +33,8 @@ public: bool init(LtsSession::LtsSession *session); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onAddEffectShowActorRelocation(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_model.h index 481f8989b..67ece18ef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_actor_relocation_model.h @@ -39,6 +39,8 @@ public: QVector::const_iterator getItEnd() const { return m_vecData.end(); } private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; EffectShowModel *m_effectShowModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.cpp index 6722ceaf9..b548d9e58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.cpp @@ -54,12 +54,12 @@ bool EffectShowEdit::init(LtsSession::LtsSession *session, if (!session->getForeignGuiInterface(m_esmActorCbx)) return false; - DEBUG_LOG() << "EffectShowEdit::init()"; + DEBUG_LOG(m_logger) << "EffectShowEdit::init()"; m_model = model; AreaEffectSimulation::AesItem aesItem; bool foundItem = m_aesDtc->aesItemFromId(m_effectShow.idAreaEffectSimulation(), aesItem); - DEBUG_LOG() << ", found :" << foundItem + DEBUG_LOG(m_logger) << ", found :" << foundItem << ", idAreaEffectSimulation :" << m_effectShow.idAreaEffectSimulation() << ", aesItem.id() :" << aesItem.id() << ", esmParticipantId: " << m_effectShow.esmParticipantId(); @@ -174,7 +174,7 @@ void EffectShowEdit::updateActorComboBox(const Core::GeoPosition &coordGeo) bool ok; int esmParticipantId = m_ui->cbEffectShowActor->currentData().toInt(&ok); - DEBUG_LOG() << "currentIndex: " << m_ui->cbEffectShowActor->currentIndex() + DEBUG_LOG(m_logger) << "currentIndex: " << m_ui->cbEffectShowActor->currentIndex() << ", currentText: " << m_ui->cbEffectShowActor->currentText() << ", esmParticipantId: " << esmParticipantId << ", ok: " << ok; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.h index c6b7bbbb2..40947a2ce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_edit.h @@ -43,6 +43,8 @@ public: bool apply() override; private: + +NGL::INGLLogger &m_logger; void retranslate() override; void showEffectShow(); void onEffectShowModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.cpp index 8c0c009d9..e645f0d65 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.cpp @@ -117,7 +117,7 @@ void EffectShowList::onEditEffectShow() EffectShowManagement::EffectShow effectShow = m_model->getRowData(row); - DEBUG_LOG() << "--- onEffectShow() " + DEBUG_LOG(m_logger) << "--- onEffectShow() " << " id: " << effectShow.id() << " position: " << effectShow.position(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.h index 947c19686..4f2771c15 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_list.h @@ -41,6 +41,8 @@ private slots: void setShowExpired(bool show); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onEditEffectShow(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.cpp index b22e69350..5f5cb3c5d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.cpp @@ -297,7 +297,7 @@ bool EffectShowModel::hasVehicleReportedOperationalToday(int equipmentNum) const if (vehicleStatus.operational()) { - DEBUG_LOG() << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " + DEBUG_LOG(m_logger) << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " << vehicleStatus.esmParticipantId() << " is operational."; return true; } @@ -305,7 +305,7 @@ bool EffectShowModel::hasVehicleReportedOperationalToday(int equipmentNum) const if (!m_effectShowVehicleLastTimeOperational.contains(equipmentNum)) { - DEBUG_LOG() << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " + DEBUG_LOG(m_logger) << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " << vehicleStatus.esmParticipantId() << " has not reported operational at any time."; return false; } @@ -313,10 +313,10 @@ bool EffectShowModel::hasVehicleReportedOperationalToday(int equipmentNum) const bool bRet = QDateTime().addMSecs(m_effectShowVehicleLastTimeOperational[equipmentNum]).date() == QDate::currentDate(); if (bRet) - DEBUG_LOG() << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " + DEBUG_LOG(m_logger) << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " << vehicleStatus.esmParticipantId() << " is not operational, but has reported operational today."; else - DEBUG_LOG() << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " + DEBUG_LOG(m_logger) << "Effect show actor " << vehicleStatus.nameEffectShowActor() << " with participantId " << vehicleStatus.esmParticipantId() << " is not operational and has not reported operational today."; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.h index 9aef18314..97dde4e0b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/EffectShowManagement/Gui/esm_effect_show_model.h @@ -98,6 +98,8 @@ public: void updateAll(); private: + +NGL::INGLLogger &m_logger; bool onEffectShowVehicleStatusChanged(const EffectShowManagement::EffectShowVehicleStatus &data, DataModification modType); signals: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.cpp index 5281d15b3..3c188ccc3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.cpp @@ -15,8 +15,8 @@ namespace Evaluations -TopicEditorEvaluationModel::TopicEditorEvaluationModel(QObject *parent) - : NGLTreeModel(parent, new NGLTreeItem(QVariant()), { tr("Id"), tr("Name"), tr("Weight"), tr("Start Time"), tr("Situation"), tr("Video"), tr("Audio") }) +TopicEditorEvaluationModel::TopicEditorEvaluationModel(QObject *parent) : NGLTreeModel(parent, new NGLTreeItem(QVariant()),, + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { tr("Id"), tr("Name"), tr("Weight"), tr("Start Time"), tr("Situation"), tr("Video"), tr("Audio") }) {} @@ -120,7 +120,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr { if (!dtc) return false; - DEBUG_LOG() << "initModel Folder"; + DEBUG_LOG(m_logger) << "initModel Folder"; NGLTreeModel::resetModel(); @@ -144,7 +144,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr if (!parentItemIndexCache.contains(parentId)) { - ERROR_LOG() << "Invalid folder structure"; + ERROR_LOG(m_logger) << "Invalid folder structure"; return false; } else @@ -156,7 +156,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr data.setValue(crit); onInsertRow(rowPos, pIndex, data); parentItemIndexCache.insert(criteriumId+10000, index(rowPos, 0, pIndex)); - DEBUG_LOG() << "Added to tree (criterium id, parent id) : (" << criteriumId << ", " << parentId << ")"; + DEBUG_LOG(m_logger) << "Added to tree (criterium id, parent id) : (" << criteriumId << ", " << parentId << ")"; } for (QMap::const_iterator iter2 = elemMap.constBegin(); @@ -170,7 +170,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr if (!parentItemIndexCache.contains(parentId)) { - ERROR_LOG() << "Invalid folder structure"; + ERROR_LOG(m_logger) << "Invalid folder structure"; return false; } else @@ -183,7 +183,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr onInsertRow(rowPos, pIndex, data); int elementId = elem.id(); parentItemIndexCache.insert(elementId,index(rowPos, 0, pIndex)); - DEBUG_LOG() << "Added to tree (element id, parent id) : (" << elementId << ", " << parentId << ")"; + DEBUG_LOG(m_logger) << "Added to tree (element id, parent id) : (" << elementId << ", " << parentId << ")"; } } } @@ -194,7 +194,7 @@ bool TopicEditorEvaluationModel::initModel(const std::shared_ptr bool TopicEditorEvaluationModel::onInsertRow(int &row, const QModelIndex &parent, const QVariant &data) { - DEBUG_LOG() << "onInsertRow"; + DEBUG_LOG(m_logger) << "onInsertRow"; row = rowCount(parent); NGLTreeItem *item = new NGLTreeItem(data, QIcon()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.h index 0a65f88fe..2a12b6b8b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/evl_topic_editor_model.h @@ -47,6 +47,8 @@ public slots: bool onInsertRow(int &row, const QModelIndex &parent, const QVariant &data); private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.cpp index e814b4908..1dd45e99a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.cpp @@ -59,13 +59,13 @@ bool EvaluationTopicEditor::fetchInterfaces() { if (!m_session->getDtc(m_evlDtc)) { - ERROR_LOG() << "Failed to retrieve Evl Dtc"; + ERROR_LOG(m_logger) << "Failed to retrieve Evl Dtc"; return false; } if (!m_session->getForeignGuiInterface(m_opmCbxIfc)) { - ERROR_LOG() << "Failed to retrieve Evl ForeignGuiInterface"; + ERROR_LOG(m_logger) << "Failed to retrieve Evl ForeignGuiInterface"; return false; } @@ -74,7 +74,7 @@ bool EvaluationTopicEditor::fetchInterfaces() initOperatorComboBox(); - DEBUG_LOG() << "fillOperatorComboBox m_operatorId = " << m_operatorId; + DEBUG_LOG(m_logger) << "fillOperatorComboBox m_operatorId = " << m_operatorId; return true; } @@ -83,19 +83,19 @@ bool EvaluationTopicEditor::fetchInterfaces() void EvaluationTopicEditor::updateInternalData() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!hasTopicDataProperties()) return; m_operatorId = getTopicDataValue(QStringLiteral("operatorId")).toInt(); - DEBUG_LOG() << "operator id = " << m_operatorId; + DEBUG_LOG(m_logger) << "operator id = " << m_operatorId; m_ui->cbxOperator->setCurrentIndex(m_ui->cbxOperator->findData(m_operatorId)); m_model->initModel(m_evlDtc, m_operatorId); m_evlElement.id(getTopicDataValue(QStringLiteral("elementId")).toDouble()); - DEBUG_LOG() << "element id = " << m_evlElement.id(); + DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id(); m_evlElement.timestamp(getTopicDataValue(QStringLiteral("start")).toDouble()); m_evlElement.situation(getTopicDataValue(QStringLiteral("situation")).toBool()); m_evlElement.audio(getTopicDataValue(QStringLiteral("audio")).toBool()); @@ -156,8 +156,8 @@ bool EvaluationTopicEditor::apply2() setTopicDataProperty(QStringLiteral("audio"), m_evlElement.audio()); setTopicDataProperty(QStringLiteral("video"), m_evlElement.video()); - DEBUG_LOG() << "operator id = " << m_operatorId << ", element id = " << m_evlElement.id(); - DEBUG_LOG() << "timestamp: " << m_evlElement.timestamp(); + DEBUG_LOG(m_logger) << "operator id = " << m_operatorId << ", element id = " << m_evlElement.id(); + DEBUG_LOG(m_logger) << "timestamp: " << m_evlElement.timestamp(); if (m_evlElement.situation()) { @@ -184,7 +184,7 @@ bool EvaluationTopicEditor::apply2() data.duration = m_evlElement.duration(); data.properties = m_topicData.properties; - DEBUG_LOG() << "topicData - properties: " << QJsonDocument(m_topicData.properties).toJson(QJsonDocument::Compact); + DEBUG_LOG(m_logger) << "topicData - properties: " << QJsonDocument(m_topicData.properties).toJson(QJsonDocument::Compact); emit topicEditorRequested(data); } @@ -221,7 +221,7 @@ bool EvaluationTopicEditor::apply2() void EvaluationTopicEditor::onOperatorChanged() { m_operatorId = m_ui->cbxOperator->currentData().toInt(); - DEBUG_LOG() << "operator id = " << m_operatorId; + DEBUG_LOG(m_logger) << "operator id = " << m_operatorId; m_model->initModel(m_evlDtc, m_operatorId); m_ui->trvEvaluations->expandAll(); @@ -232,11 +232,11 @@ void EvaluationTopicEditor::onSelectionChanged(const QItemSelection &selected, c Q_UNUSED(selected); Q_UNUSED(deselected); - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QModelIndex index = m_ui->trvEvaluations->currentIndex(); m_evlElement = m_model->getEvaluationElement(index); - DEBUG_LOG() << "element id = " << m_evlElement.id(); + DEBUG_LOG(m_logger) << "element id = " << m_evlElement.id(); m_topicData.description = QString::number(m_evlElement.id()); slotChangesMade(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.h index 35e433573..775dfa9bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/TopicEditor/topic_editor.h @@ -32,6 +32,8 @@ public: bool fetchInterfaces(); private: + +NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.cpp index 2816c0afb..9823dc2f3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.cpp @@ -25,7 +25,7 @@ CriteriumDialog::CriteriumDialog(const QString &menuGroup, LtsSession::LtsSessio , m_ownEvaluationElements(ownEvlElements) , m_requestHelper(new LtsUtils::RequestHelper(this)) { - DEBUG_LOG() << "CriteriumDialog ctor"; + DEBUG_LOG(m_logger) << "CriteriumDialog ctor"; m_ui->setupUi(this); m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &CriteriumDialog::onPrint); @@ -89,13 +89,13 @@ void CriteriumDialog::tableColumnOrganiserSetting() void CriteriumDialog::slotAdd() { - DEBUG_LOG() << "CriteriumDialog::slotAdd"; + DEBUG_LOG(m_logger) << "CriteriumDialog::slotAdd"; editCriterium(0 ); } void CriteriumDialog::slotEdit() { - DEBUG_LOG() << "CriteriumDialog::slotEdit"; + DEBUG_LOG(m_logger) << "CriteriumDialog::slotEdit"; const QModelIndex srcIdx = m_ui->widget->currentIndex(); editCriterium(m_model->getRowData(srcIdx.row()).id() ); @@ -103,20 +103,20 @@ void CriteriumDialog::slotEdit() void CriteriumDialog::slotRemove() { - DEBUG_LOG() << "CriteriumDialog::slotRemove"; + DEBUG_LOG(m_logger) << "CriteriumDialog::slotRemove"; const QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; Core::RemoveElementRequest req(m_model->getRowData(selIndex.row()).id()); - DEBUG_LOG() << "Removing criterium id = " << req.id(); + DEBUG_LOG(m_logger) << "Removing criterium id = " << req.id(); m_requestHelper->startSingleRequest([req, this]() { return m_ftc->evlCriteriumRemoveRequest(req, this); }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove criterium"; + ERROR_LOG(m_logger) << "Failed to remove criterium"; } @@ -145,7 +145,7 @@ bool CriteriumDialog::init(const std::shared_ptr &dtc, int exerciseId, int currentOperatorId) { - DEBUG_LOG() << "CriteriumDialog::init"; + DEBUG_LOG(m_logger) << "CriteriumDialog::init"; m_dtc = dtc; m_ftc = ftc; m_opmCbxDtc = opmCbxDtc; @@ -175,7 +175,7 @@ bool CriteriumDialog::init(const std::shared_ptr &dtc, for (auto i = criteria.constBegin(); i != criteria.constEnd(); ++i) { const EvaluationCriterium &p = (*i); - DEBUG_LOG() << "Criterium: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); + DEBUG_LOG(m_logger) << "Criterium: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); } connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &CriteriumDialog::enaDisa, Qt::UniqueConnection); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.h index f763c18f5..58170e2aa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_dialog.h @@ -56,6 +56,8 @@ public: int currentOperatorId); protected: + +NGL::INGLLogger &m_logger; void onEvlCriteriumModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onEvlCriteriumRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onPrint(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.cpp index 6cb8baa0b..cf7b23640 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.cpp @@ -20,7 +20,7 @@ CriteriumEditDialog::CriteriumEditDialog(QWidget *parent) , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_ui(new Ui::CriteriumEditDialog) { - DEBUG_LOG() << "CriteriumEditDialog ctor"; + DEBUG_LOG(m_logger) << "CriteriumEditDialog ctor"; m_ui->setupUi(this); @@ -43,7 +43,7 @@ bool CriteriumEditDialog::init(int criteriumId, const std::shared_ptr &ftc, const std::shared_ptr &opmCbxDtc) { - DEBUG_LOG() << "CriteriumEditDialog::init"; + DEBUG_LOG(m_logger) << "CriteriumEditDialog::init"; m_criteriumId = criteriumId; m_dtc = dtc; m_ftc = ftc; @@ -123,9 +123,9 @@ void CriteriumEditDialog::onExportButtonClicked() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void CriteriumEditDialog::onImportButtonClicked() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.h index b7001e9bc..aec14a418 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_dialog.h @@ -44,6 +44,8 @@ public: const std::shared_ptr &opmCbxDtc); protected: + +NGL::INGLLogger &m_logger; void onEvlCriteriumModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onEvlCriteriumRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.cpp index b57c9251b..c2bd0df9f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.cpp @@ -31,7 +31,7 @@ ElementEditDialog::ElementEditDialog(QWidget *) , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_ui(new Ui::ElementEditDialog) { - DEBUG_LOG() << "ElementEditDialog ctor"; + DEBUG_LOG(m_logger) << "ElementEditDialog ctor"; m_ui->setupUi(this); @@ -73,7 +73,7 @@ bool ElementEditDialog::init(int elementId, const std::shared_ptr &fltBuildingComponentIfc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "ElementEditDialog::init"; + DEBUG_LOG(m_logger) << "ElementEditDialog::init"; m_elementId = elementId; m_criteriumId = criteriumId; m_exerciseId = exerciseId; @@ -97,7 +97,7 @@ bool ElementEditDialog::init(int elementId, m_ui->cbxRating->setCurrentIndex(m_ui->cbxRating->findData(eval.rating())); m_ui->teDesc->setText(QString::fromStdString(eval.note())); m_ui->lblStartTime->setText(DTG::toStringMSec(eval.timestamp())); - ERROR_LOG() << "set start time label to " << m_ui->lblStartTime->text(); + ERROR_LOG(m_logger) << "set start time label to " << m_ui->lblStartTime->text(); m_startTime = eval.timestamp(); m_ui->cbSituation->setChecked(eval.situation()); @@ -169,7 +169,7 @@ bool ElementEditDialog::apply() if (m_session->getForeignGuiInterface(sitMapIfc)) root[QStringLiteral("settings")] = sitMapIfc->operatorMapSettings(); else - ERROR_LOG() << "sit map ifc not available, can't save map settings :("; + ERROR_LOG(m_logger) << "sit map ifc not available, can't save map settings :("; root[QStringLiteral("filters")] = getFilterSettings(); @@ -199,7 +199,7 @@ bool ElementEditDialog::apply() void ElementEditDialog::fillPhasesComboBox() { - DEBUG_LOG() << "fillPhasesComboBox"; + DEBUG_LOG(m_logger) << "fillPhasesComboBox"; QSignalBlocker blocker(m_ui->cbxPhase); m_ui->cbxPhase->clear(); m_ui->cbxPhase->addItem(tr(""), 0); @@ -218,7 +218,7 @@ void ElementEditDialog::fillPhasesComboBox() void ElementEditDialog::onCheckBoxClicked() { - INFO_LOG() << "onCheckBoxClicked"; + INFO_LOG(m_logger) << "onCheckBoxClicked"; if (m_startTime > 0) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.h index 47f1c45bd..5f213072a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_edit_element_dialog.h @@ -57,6 +57,8 @@ public: LtsSession::LtsSession *session); protected: + +NGL::INGLLogger &m_logger; void onEvlElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onEvlElementRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.cpp index 4f9827b55..f5982c77c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.cpp @@ -18,7 +18,7 @@ ElementDialog::ElementDialog(QWidget *parent) , m_ui(new Ui::ElementDialog) , m_requestHelper(new LtsUtils::RequestHelper(this)) { - DEBUG_LOG() << "ElementDialog ctor"; + DEBUG_LOG(m_logger) << "ElementDialog ctor"; m_ui->setupUi(this); setOnlineHelpFilename(QStringLiteral("Situation-Own_Evaluation_Criteria")); @@ -46,14 +46,14 @@ void ElementDialog::enaDisa() void ElementDialog::slotAdd() { - DEBUG_LOG() << "ElementDialog::slotAdd"; + DEBUG_LOG(m_logger) << "ElementDialog::slotAdd"; addElementEditDialog(); } void ElementDialog::slotEdit() { - DEBUG_LOG() << "ElementDialog::slotEdit"; + DEBUG_LOG(m_logger) << "ElementDialog::slotEdit"; addElementEditDialog(m_model->getRowData(m_ui->widget->currentIndex().row()).id() ); } @@ -75,19 +75,19 @@ void ElementDialog::tableColumnOrganiserSetting() void ElementDialog::slotRemove() { - DEBUG_LOG() << "ElementDialog::slotRemove"; + DEBUG_LOG(m_logger) << "ElementDialog::slotRemove"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; m_requestHelper->startSingleRequest([this]() { - DEBUG_LOG() << "Removing element id = " << m_model->getRowData(m_ui->widget->currentIndex().row()).id(); + DEBUG_LOG(m_logger) << "Removing element id = " << m_model->getRowData(m_ui->widget->currentIndex().row()).id(); return m_ftc->evlElementRemoveRequest(EvlElementRemoveRequest(m_model->getRowData(m_ui->widget->currentIndex().row()).id(), m_criteriumId), this); }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove criterium"; + ERROR_LOG(m_logger) << "Failed to remove criterium"; } QString ElementDialog::dialogIdentifier() @@ -107,7 +107,7 @@ bool ElementDialog::init(int criteriumId, const std::shared_ptr &fltBuildingComponentIfc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "ElementDialog::init"; + DEBUG_LOG(m_logger) << "ElementDialog::init"; m_criteriumId = criteriumId; m_exerciseId = exerciseId; m_dtc = dtc; @@ -135,7 +135,7 @@ bool ElementDialog::init(int criteriumId, auto cb = [this](const Evaluations::EvaluationElement &e) { - DEBUG_LOG() << "Element: id = " << e.id() << ", medium = " << e.rating(); + DEBUG_LOG(m_logger) << "Element: id = " << e.id() << ", medium = " << e.rating(); }; m_dtc->evaluationElements(cb); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.h index 66776c36e..ad1c3866d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_dialog.h @@ -54,6 +54,8 @@ public: static QString dialogIdentifier(); protected: + +NGL::INGLLogger &m_logger; void onEvlElementModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onEvlElementRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.cpp index 6c46de958..f5048daef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.cpp @@ -47,7 +47,7 @@ bool ElementDialogModel::initModel(const std::shared_ptr &dtc, }; dtc->evaluationElements(cb); - INFO_LOG() << "initModel - #EvalElements: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #EvalElements: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.h index 822c36a75..5e3c1a5d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_element_model.h @@ -45,6 +45,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_avmDataIfc; std::shared_ptr m_exmDtc; friend class ElementDialogProxyModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.cpp index 5a9ebe38f..215205e98 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.cpp @@ -29,7 +29,7 @@ bool CriteriumDialogModel::initModel(const std::shared_ptr &dtc, this, &CriteriumDialogModel::onDataChanged); dtc->evaluationCriteriums([this](const EvaluationCriterium & e) { insertRow(e); }); - INFO_LOG() << "initModel - #EvalCriteria: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #EvalCriteria: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.h index 1667291de..0d9a94f72 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/CriteriumEdit/evl_model.h @@ -36,6 +36,8 @@ public: protected: + +NGL::INGLLogger &m_logger; private: std::shared_ptr m_opmDtc; friend class CriteriumFilterModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.cpp index f72e98aff..5ca5a39ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.cpp @@ -116,7 +116,7 @@ void SanNineLinerDialog::onEditSanNineLiner() if (san.id() <= 0) return; - DEBUG_LOG() << "current SanNineLinerId: " << san.id(); + DEBUG_LOG(m_logger) << "current SanNineLinerId: " << san.id(); SanNineLinerEditDialog *dialog = new SanNineLinerEditDialog(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.h index 1cd11236b..d034dd54e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog.h @@ -38,6 +38,7 @@ private slots: void onRemoveSanNineLiner(); private: + NGL::INGLLogger &m_logger; void retranslate() override; void onSanNineLinerRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog_model.cpp index 6da8288d9..59adfb68f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_dialog_model.cpp @@ -37,7 +37,7 @@ bool SanNineLinerDialogModel::initModel(const std::shared_ptr m_evlDtc; friend class SanNineLinerProxyModel; }; @@ -45,6 +46,7 @@ public: void setSourceModel(QAbstractItemModel *sourceModel) override; private: + NGL::INGLLogger &m_logger; SanNineLinerDialogModel *m_sourceModel{nullptr}; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.cpp index 4329e7223..7ec7a0f57 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.cpp @@ -108,7 +108,7 @@ bool SanNineLinerEditDialog::init(LtsSession::LtsSessionDataDds *session, QVector linesCategory = SanCategoryLine::fromJson(data.lines(), data.id()); - INFO_LOG() << "linesCategory size: " << linesCategory.size(); + INFO_LOG(m_logger) << "linesCategory size: " << linesCategory.size(); for (const Database::SanCategoryLine &cl : std::as_const(linesCategory)) { @@ -117,7 +117,7 @@ bool SanNineLinerEditDialog::init(LtsSession::LtsSessionDataDds *session, QLineEdit *leLineAmount = findChild(leName); if (leLineAmount) { - INFO_LOG() << "leName: " << leName << ", amount: " << cl.amount; + INFO_LOG(m_logger) << "leName: " << leName << ", amount: " << cl.amount; leLineAmount->setText(QString::number(cl.amount)); continue; @@ -128,7 +128,7 @@ bool SanNineLinerEditDialog::init(LtsSession::LtsSessionDataDds *session, QRadioButton *rbCategory = findChild(rbName); if (rbCategory) { - INFO_LOG() << "rbName: " << rbName; + INFO_LOG(m_logger) << "rbName: " << rbName; rbCategory->setChecked(true); continue; } @@ -139,7 +139,7 @@ bool SanNineLinerEditDialog::init(LtsSession::LtsSessionDataDds *session, QCheckBox *cbxCategory = findChild(cbxName); if (cbxCategory) { - INFO_LOG() << "cbxName: " << cbxName; + INFO_LOG(m_logger) << "cbxName: " << cbxName; cbxCategory->setChecked(true); } } @@ -250,7 +250,7 @@ bool SanNineLinerEditDialog::apply() if (request.id() <= 0) { m_sanNineLinerId = m_requestHelper->getRepliedId(); - ERROR_LOG() << "Created new san nine liner with id " << m_sanNineLinerId; + ERROR_LOG(m_logger) << "Created new san nine liner with id " << m_sanNineLinerId; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.h index 119ce8959..a7c0cae9d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SanNineLinerEdit/san_nine_liner_edit_dialog.h @@ -46,6 +46,7 @@ public: protected: + NGL::INGLLogger &m_logger; void onSanNineLinerModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_comments.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_comments.h index 51c2151fb..c1f2d9a0d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_comments.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_comments.h @@ -34,6 +34,8 @@ private slots: void onCommentChanged(const Evaluations::EvaluationComment &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; bool insertComment(const Evaluations::EvaluationComment &c); void retranslate() override; bool eventFilter(QObject *object, QEvent *event) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.cpp index 2c9ed3a4c..c1b192250 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.cpp @@ -301,7 +301,7 @@ void EditSchemaDialog::onNotifyAboutSchema(const Evaluations::EvaluationSchema & if (jError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Could not parse schema with database id " << data.id(); + WARNING_LOG(m_logger) << "Could not parse schema with database id " << data.id(); return; } @@ -348,7 +348,7 @@ void EditSchemaDialog::loadSchema(qint32 schemaId) if (jError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Could not load schema with database id " << m_mapSchemata.last().id(); + WARNING_LOG(m_logger) << "Could not load schema with database id " << m_mapSchemata.last().id(); return; } @@ -903,12 +903,12 @@ void EditSchemaDialog::onLoadFromLibrary() const QJsonDocument doc(QJsonDocument::fromJson(content, &jError)); if (jError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Could not parse schema !"; + WARNING_LOG(m_logger) << "Could not parse schema !"; return; } if (!m_pModel->fromQJsonDocument(doc)) { - WARNING_LOG() << "Could not load schema !"; + WARNING_LOG(m_logger) << "Could not load schema !"; return; } @@ -929,11 +929,11 @@ bool EditSchemaDialog::onSaveToLibrary() int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::EvaluationSchema, m_session->exerciseId(), byteArray); if (fileId > 0) { - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; return true; } else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.h index 9604cb13a..1402be97b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_schema.h @@ -49,6 +49,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; void onSendEvaluationReply(const Core::FunctionReplyObject &replyObject) override final; void onEvlCommentModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_general.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_general.h index 73de6d54d..15136cf1f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_general.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_general.h @@ -27,5 +27,7 @@ public: void removeRow(const QModelIndex &idx, bool deleteRootAllowed = false); protected: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_schema.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_schema.cpp index 984642b2b..34d13f2fe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_schema.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_edit_treemodel_schema.cpp @@ -128,7 +128,7 @@ QJsonDocument TreeModelSchema::toJsonDocument() const { Q_UNUSED(idx); Evaluations::ElementData e = v.value(); - INFO_LOG() << "toJsonDocument: Name: " << e.getText() << ", elementId: " << e.m_id << ", parent id: " << e.m_parentId; + INFO_LOG(m_logger) << "toJsonDocument: Name: " << e.getText() << ", elementId: " << e.m_id << ", parent id: " << e.m_parentId; QJsonObject obj; obj[QStringLiteral("id")] = e.m_id; @@ -172,7 +172,7 @@ bool TreeModelSchema::fromQJsonDocument(const QJsonDocument &doc) m_elementId = std::max(m_elementId, d.m_id); - INFO_LOG() << "fromQJsonDocument: " << d.getText() << ", own id = " << d.m_id << ", parent id = " << d.m_parentId; + INFO_LOG(m_logger) << "fromQJsonDocument: " << d.getText() << ", own id = " << d.m_id << ", parent id = " << d.m_parentId; } ++m_elementId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.cpp index 9b26a42b3..233e071ba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.cpp @@ -9,10 +9,9 @@ namespace Evaluations { EvlNewCommentDialog::EvlNewCommentDialog(const std::shared_ptr &opmDtc, - QWidget *parent) - : QDialog(parent), - m_ui(new Ui::EvlNewCommentDialog) -{ + QWidget *parent) : QDialog(parent), + m_ui(new Ui::EvlNewCommentDialog), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); setWindowFlags(Qt::Tool); m_ui->m_ltsComboBox_ReceiverOperator->addItem(tr("All (Default)"), 0); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.h index dc63e184f..a0bca7769 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Evaluations/Gui/SchemaEdit/evl_new_comment_dialog.h @@ -32,6 +32,8 @@ private slots: void onTextChanged(); private: + +NGL::INGLLogger &m_logger; Ui::EvlNewCommentDialog *m_ui{nullptr}; const int m_maxChars{255}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.cpp index 828720de4..932aa8a94 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.cpp @@ -165,7 +165,7 @@ void ExerciseManagementDialog::onEditExercise() if (ex.id() <= 0) return; - DEBUG_LOG() << "current EXId: " << ex.id(); + DEBUG_LOG(m_logger) << "current EXId: " << ex.id(); ExerciseManagementEditDialog *dialog = new ExerciseManagementEditDialog(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.h index 4b1927766..0374c3d7f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog.h @@ -42,6 +42,8 @@ private slots: void onRemoveExercise(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onExerciseRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onFolderRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog_model.cpp index 269df3c1f..dde63d7e5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_dialog_model.cpp @@ -83,7 +83,7 @@ bool ExerciseManagementDialogModel::initModel(const std::shared_ptrsaveFileContent(this, FileManagement::FileType::Xml, 0, byteArray); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void ExerciseManagementEditDialog::onImport() { - DEBUG_LOG() << "onImport"; + DEBUG_LOG(m_logger) << "onImport"; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, 0, JsonKeys::XMLTYPEVALUE()); @@ -504,7 +504,7 @@ void ExerciseManagementEditDialog::onImport() else { ExerciseModifyRequest req = jsonToExercise(content); - DEBUG_LOG() << "Importing: " << req; + DEBUG_LOG(m_logger) << "Importing: " << req; m_ui->pteForces->setPlainText(QString::fromStdString(req.forces())); m_ui->pteDescription->setPlainText(QString::fromStdString(req.description())); @@ -893,7 +893,7 @@ bool ExerciseManagementEditDialog::apply() int newExId = m_requestHelper->getRepliedId(); - DEBUG_LOG() << "Created new exercise with id " << newExId; + DEBUG_LOG(m_logger) << "Created new exercise with id " << newExId; if (newExId > 0) { @@ -905,7 +905,7 @@ bool ExerciseManagementEditDialog::apply() return m_ftc->exerciseImageModifyRequest(exImgRequest, this); })) { - WARNING_LOG() << "Unable to set default exercise picture"; + WARNING_LOG(m_logger) << "Unable to set default exercise picture"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Unable to set default exercise picture")); } @@ -915,7 +915,7 @@ bool ExerciseManagementEditDialog::apply() if (!createFolders(newExId)) { - WARNING_LOG() << "Unable to create exercise folders in document library."; + WARNING_LOG(m_logger) << "Unable to create exercise folders in document library."; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Unable to create exercise folders in document library.")); } @@ -944,7 +944,7 @@ void ExerciseManagementEditDialog::sendModifiedOperators(int thisExerciseId) std::shared_ptr opmFtc; if (!m_session->getFtc(opmFtc)) { - ERROR_LOG() << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ; + ERROR_LOG(m_logger) << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ; return; } @@ -970,10 +970,10 @@ void ExerciseManagementEditDialog::sendModifiedOperators(int thisExerciseId) req.visibleExercises() = user.exerciseIds(); req.visiblePartiesByExercise() = user.visiblePartiesByExercise(); - DEBUG_LOG() << "Adding request: " << req; + DEBUG_LOG(m_logger) << "Adding request: " << req; m_requestHelper->addRequest([this, req, opmFtc]() { - DEBUG_LOG() << "Executing request: " << req; + DEBUG_LOG(m_logger) << "Executing request: " << req; return opmFtc->operatorCreateModifyRequest(req, this); }); @@ -991,7 +991,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) if (folderId <= 0) return false; - DEBUG_LOG() << "Exercise Folder created with id = " << folderId; + DEBUG_LOG(m_logger) << "Exercise Folder created with id = " << folderId; folderName = QStringLiteral("Documents") ; @@ -1000,7 +1000,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) if (subFolderId <= 0) return false; - DEBUG_LOG() << "Sub Folder Documents created with id = " << subFolderId; + DEBUG_LOG(m_logger) << "Sub Folder Documents created with id = " << subFolderId; QStringList folderNames; @@ -1008,7 +1008,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) folderNames << QStringLiteral("Incidents") << QStringLiteral("Instructions"); bool ok = createExerciseFolders(subFolderId, folderNames); - DEBUG_LOG() << "Created sub-folders Documents: " << ok; + DEBUG_LOG(m_logger) << "Created sub-folders Documents: " << ok; LtsUtils::ProjectSettings *ps = LtsUtils::ProjectSettings::getInstance(); @@ -1019,7 +1019,7 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) folderName = QStringLiteral("Phase Documents"); int folderPhaseDocsId = createFolder(subFolderId, folderName); - DEBUG_LOG() << "Phase Documents Folder created with id = " << folderPhaseDocsId; + DEBUG_LOG(m_logger) << "Phase Documents Folder created with id = " << folderPhaseDocsId; if (folderPhaseDocsId > 0) @@ -1027,14 +1027,14 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) int phId = m_dtc->exercise(newExId).activePhaseId(); const QString &phaseName = m_flmDtc->getPhaseFolderName(phId); int folderPhaseId = createFolder(folderPhaseDocsId, phaseName); - DEBUG_LOG() << "Phase Folder created with id = " << folderPhaseId; + DEBUG_LOG(m_logger) << "Phase Folder created with id = " << folderPhaseId; } } folderName = QStringLiteral("Markers"); subFolderId = createFolder(folderId, folderName); - DEBUG_LOG() << "Markers Folder created with id = " << subFolderId; + DEBUG_LOG(m_logger) << "Markers Folder created with id = " << subFolderId; FileManagement::PathCreateRequest req; req.parentId(folderId); @@ -1045,25 +1045,25 @@ bool ExerciseManagementEditDialog::createFolders(int newExId) bool success = m_flmFtc->pathCreateRequest(req); if (!success) - ERROR_LOG() << "Planning/TNE Lists could not be created"; + ERROR_LOG(m_logger) << "Planning/TNE Lists could not be created"; req.path({"Tactical Plans", "BDA"}); success = m_flmFtc->pathCreateRequest(req); if (!success) - ERROR_LOG() << "Tactical Plans/BDA could not be created"; + ERROR_LOG(m_logger) << "Tactical Plans/BDA could not be created"; req.path({"Tactical Plans", "HQ Data"}); success = m_flmFtc->pathCreateRequest(req); if (!success) - ERROR_LOG() << "Tactical Plans/HQ Data could not be created"; + ERROR_LOG(m_logger) << "Tactical Plans/HQ Data could not be created"; folderNames.clear(); folderNames << QStringLiteral("Reports") << QStringLiteral("Snapshots"); ok = createExerciseFolders(folderId, folderNames); - DEBUG_LOG() << "Created last exercise documents: " << ok; + DEBUG_LOG(m_logger) << "Created last exercise documents: " << ok; return true; } @@ -1086,7 +1086,7 @@ int ExerciseManagementEditDialog::createFolder(int parentFolderId, const QString return m_flmFtc->folderModifyRequest(req, this); }); - DEBUG_LOG() << "Created folder id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Created folder id = " << m_requestHelper->getRepliedId(); return m_requestHelper->getRepliedId(); } @@ -1239,13 +1239,13 @@ ExerciseModifyRequest ExerciseManagementEditDialog::jsonToExercise(const QByteAr void ExerciseManagementEditDialog::onCreateFolders() { - DEBUG_LOG() << "onCreateFolders"; + DEBUG_LOG(m_logger) << "onCreateFolders"; if (m_exerciseId > 0 && getExerciseFolder() <= 0 ) { bool ok = createFolders(m_exerciseId); if (!ok) { - WARNING_LOG() << "Could not create exercise folders"; + WARNING_LOG(m_logger) << "Could not create exercise folders"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Could not create exercise folders")); } else @@ -1262,7 +1262,7 @@ int ExerciseManagementEditDialog::getExerciseFolder() return 0; const int folderId = m_flmDtc->getExerciseFolderId(m_exerciseId); - DEBUG_LOG() << "getExerciseFolder: folderId = " << folderId; + DEBUG_LOG(m_logger) << "getExerciseFolder: folderId = " << folderId; return folderId; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_dialog.h index 007679f0e..53104744c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_dialog.h @@ -78,6 +78,8 @@ public: ~ExerciseManagementEditDialog(); protected: + +NGL::INGLLogger &m_logger; void onExerciseCreateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onExerciseModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onExerciseImageModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); imageModifyError(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.cpp index 348835574..00f1c19cb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.cpp @@ -90,7 +90,7 @@ bool ExerciseEditPartyDialog::init(LtsSession::LtsSessionDataDds *session) bool ExerciseEditPartyDialog::operatorUpdateVisiblePartiesByExercise(const OperatorManagement::OperatorUpdateVisiblePartiesByExerciseRequest &req) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; return m_requestHelper->startSingleRequest([this, req]() { return m_opmFtc->operatorUpdateVisiblePartiesByExerciseRequest(req, this); @@ -143,7 +143,7 @@ void ExerciseEditPartyDialog::setAdlerVisiblePartiesUncheckable() bool ExerciseEditPartyDialog::apply() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_operatorId <= 0) return true; @@ -163,9 +163,9 @@ bool ExerciseEditPartyDialog::apply() const QVector hiddenPartyIds = m_visiblePartiesModel->getUncheckedIds(); for (const int visible : visiblePartyIds) - DEBUG_LOG() << "visible party: " << visible; + DEBUG_LOG(m_logger) << "visible party: " << visible; for (const int hidden : hiddenPartyIds) - DEBUG_LOG() << "hidden party: " << hidden; + DEBUG_LOG(m_logger) << "hidden party: " << hidden; req.hiddenParties().set({}); req.visibleParties().set({}); std::copy(hiddenPartyIds.begin(), hiddenPartyIds.end(), std::back_inserter(req.hiddenParties().get())); @@ -173,7 +173,7 @@ bool ExerciseEditPartyDialog::apply() req.properties(adlerVisiblePartiesToJson().toStdString()); - DEBUG_LOG() << "----------------- opId: " << req.id() << ", exId:" << req.exerciseId() << ", req.hiddenParties.size:" << hiddenPartyIds.size() + DEBUG_LOG(m_logger) << "----------------- opId: " << req.id() << ", exId:" << req.exerciseId() << ", req.hiddenParties.size:" << hiddenPartyIds.size() << "adlerVisibleParties: " << req.properties(); return operatorUpdateVisiblePartiesByExercise(req); @@ -206,7 +206,7 @@ void ExerciseEditPartyDialog::onSwitchCheckbox(const QModelIndex &index) return; } - DEBUG_LOG() << Q_FUNC_INFO << "index.row():" << index.row(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "index.row():" << index.row(); const QPair row = m_visiblePartiesModel->getRowData(index.row()); QPair rowAdler = m_adlerVisiblePartiesModel->getRowData(index.row()); @@ -222,7 +222,7 @@ void ExerciseEditPartyDialog::onDoubleClicked(const QModelIndex &index) return; } - DEBUG_LOG() << Q_FUNC_INFO << "index.row():" << index.row(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "index.row():" << index.row(); bool isChecked = m_visiblePartiesModel->getRowData(index.row()).first; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.h index 9576a3af2..a8b350689 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_party_dialog.h @@ -42,6 +42,8 @@ public: void onOperatorUpdateVisiblePartiesByExerciseReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; QByteArray adlerVisiblePartiesToJson() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_phase_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_phase_dialog.h index c024c7f66..f3a79efef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_phase_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_edit_phase_dialog.h @@ -43,6 +43,8 @@ signals: void sendData(const ExerciseManagement::ExercisePhase &data); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_operator_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_operator_edit.cpp index c247fccc6..416349fe2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_operator_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_operator_edit.cpp @@ -110,7 +110,7 @@ void ExerciseManagementOperatorEdit::sendModifiedOperators(int thisExerciseId) std::shared_ptr opmFtc; if (!m_session->getFtc(opmFtc)) { - ERROR_LOG() << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ; + ERROR_LOG(m_logger) << "Cannot change add/remove Operators to/from Exercise as the OPM-FTC could not be fetched." ; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_edit.cpp index 925424fcb..5806a3d76 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_edit.cpp @@ -94,7 +94,7 @@ void ExerciseManagementPhaseEdit::onEditExercisePhase() if (exPhase.id() <= 0) return; - DEBUG_LOG() << "current exPhase Id: " << exPhase.id(); + DEBUG_LOG(m_logger) << "current exPhase Id: " << exPhase.id(); ExerciseManagementPhaseEditDialog *dialog = new ExerciseManagementPhaseEditDialog(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.cpp index 74aeb77d1..8355b42f4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.cpp @@ -30,7 +30,7 @@ bool ExercisePhaseModel::initModel(int exerciseId, const std::shared_ptrexercisePhases([this](const ExercisePhase &item) { insertRow(item); }); - INFO_LOG() << "initModel - #exercise phases: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #exercise phases: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.h index 6edb723ff..5f70f099a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ExerciseManagement/Gui/ExerciseEdit/exm_phase_model.h @@ -36,6 +36,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ExercisePhase &data, DataModification modType) const override { if (data.exerciseId() != m_exerciseId) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.cpp index 65041a2fd..b0387b442 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.cpp @@ -31,7 +31,7 @@ bool FlmHqReportConverter::init(LtsSession::LtsSession *session, int currentPart { if (session == nullptr) { - ERROR_LOG() << "Got invalid session"; + ERROR_LOG(m_logger) << "Got invalid session"; return false; } @@ -40,28 +40,28 @@ bool FlmHqReportConverter::init(LtsSession::LtsSession *session, int currentPart if (!m_session->getDtc(m_flmDtc)) { - ERROR_LOG() << "Could not get FLM Dtc."; + ERROR_LOG(m_logger) << "Could not get FLM Dtc."; return false; } if (!m_session->getFtc(m_flmFtc)) { - ERROR_LOG() << "Could not get FLM Ftc."; + ERROR_LOG(m_logger) << "Could not get FLM Ftc."; return false; } if (!session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not get PPM Dtc."; + ERROR_LOG(m_logger) << "Could not get PPM Dtc."; return false; } if (!m_flmFtc->enableFileContentModify()) { - ERROR_LOG() << "Could enable fileContentModify."; + ERROR_LOG(m_logger) << "Could enable fileContentModify."; return false; } @@ -104,7 +104,7 @@ void FlmHqReportConverter::processCollectedHqs() for (int id : reportIds) { - DEBUG_LOG() << "Request File with ID: " << id << " from plan with ID: " << planId; + DEBUG_LOG(m_logger) << "Request File with ID: " << id << " from plan with ID: " << planId; FileManagement::GetFileContentDataRequest request(id); m_flmFtc->getFileContentDataRequest(request, this); } @@ -128,16 +128,16 @@ void FlmHqReportConverter::onGetFileContentDataReply( if (reply.errorString().size() > 0) { - ERROR_LOG() << "Got onGetFileContentDataReply error: " << reply.errorString(); + ERROR_LOG(m_logger) << "Got onGetFileContentDataReply error: " << reply.errorString(); return; } int id = static_cast(reply.id()); int planId = -1; - DEBUG_LOG() << "Reply File with ID: " << id << " from plan with ID: " << planId; + DEBUG_LOG(m_logger) << "Reply File with ID: " << id << " from plan with ID: " << planId; - INFO_LOG() << "Got reply with id " << id << " and errorString " << reply.errorString(); + INFO_LOG(m_logger) << "Got reply with id " << id << " and errorString " << reply.errorString(); QByteArray fileContent = QByteArray(reinterpret_cast(reply.content().data()), reply.content().size()); @@ -146,7 +146,7 @@ void FlmHqReportConverter::onGetFileContentDataReply( HqReportData data = m_parser.parse(fileContent); data.contentFileId = id; - DEBUG_LOG() << "Party: " << m_partyId << " has Color: "<< QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color())).value(); + DEBUG_LOG(m_logger) << "Party: " << m_partyId << " has Color: "<< QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color())).value(); data.partyColor = QColor::fromRgb(QRgb(m_ppmDtc->party(m_partyId).color())); @@ -161,36 +161,36 @@ void FlmHqReportConverter::onGetFileContentDataReply( m_convertedHqToPlanIds[planId].append(data); - DEBUG_LOG() << "Content size: " << reply.content().size(); + DEBUG_LOG(m_logger) << "Content size: " << reply.content().size(); checkIfAllFinished(); } void FlmHqReportConverter::onFileContentModifyReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got FileContentModify Reply: " << reply.translated(); + DEBUG_LOG(m_logger) << "Got FileContentModify Reply: " << reply.translated(); if (reply.error()) { - ERROR_LOG() << "Error while insert HX Message: " << reply.translated() + ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error(); } } void FlmHqReportConverter::onFileContentRemoveReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got FileContentRemove Reply: " << reply.translated(); + DEBUG_LOG(m_logger) << "Got FileContentRemove Reply: " << reply.translated(); if (reply.error()) { - ERROR_LOG() << "Error while insert HX Message: " << reply.translated() + ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error(); } } void FlmHqReportConverter::onRequestsFinished() { - DEBUG_LOG() << "ALL REQUESTS FINISHED"; + DEBUG_LOG(m_logger) << "ALL REQUESTS FINISHED"; for (auto it = m_convertedHqToPlanIds.constBegin(); it != m_convertedHqToPlanIds.constEnd(); ++it) { @@ -199,7 +199,7 @@ void FlmHqReportConverter::onRequestsFinished() for (auto &reportData : reportDatas) { - DEBUG_LOG() << "createGeometryFromReport :" << reportData.art; + DEBUG_LOG(m_logger) << "createGeometryFromReport :" << reportData.art; createGeometryFromReport(reportData); } @@ -207,7 +207,7 @@ void FlmHqReportConverter::onRequestsFinished() FileManagement::FileContentModifyRequest data; - DEBUG_LOG() << "FILE CONTENT: " << flc.name() << " " << flc.folderId(); + DEBUG_LOG(m_logger) << "FILE CONTENT: " << flc.name() << " " << flc.folderId(); data.id(flc.id()); data.name(flc.name()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.h index bc7201f25..047892758 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_converter.h @@ -43,6 +43,7 @@ private: void checkIfAllFinished(); protected: + NGL::INGLLogger &m_logger; void onGetFileContentDataReply(const FileManagement::GetFileContentDataReply &reply) override; void onFileContentModifyReply(const Core::FunctionReplyObject &reply) override; void onFileContentRemoveReply(const Core::FunctionReplyObject &reply) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.cpp index c51be66a3..7decc347b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.cpp @@ -40,7 +40,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId) { if (session == nullptr) { - ERROR_LOG() << "Got invalid session"; + ERROR_LOG(m_logger) << "Got invalid session"; return false; } @@ -51,35 +51,35 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId) if (!m_session->getForeignGuiInterface(partyCboInterface)) { - ERROR_LOG() << "Could not get Party Combobox Interface."; + ERROR_LOG(m_logger) << "Could not get Party Combobox Interface."; return false; } if (!partyCboInterface->fillPartyComboBox(m_ui->cboParties) || m_ui->cboParties->count() == 0) { - ERROR_LOG() << "Could not fill Parties."; + ERROR_LOG(m_logger) << "Could not fill Parties."; return false; } if (!m_session->getDtc(m_flmDtc)) { - ERROR_LOG() << "Could not get FLM Dtc."; + ERROR_LOG(m_logger) << "Could not get FLM Dtc."; return false; } if (!m_session->getFtc(m_flmFtc)) { - ERROR_LOG() << "Could not get FLM Ftc."; + ERROR_LOG(m_logger) << "Could not get FLM Ftc."; return false; } if (!m_flmFtc->enableFileContentModify()) { - ERROR_LOG() << "Could enable fileContentModify."; + ERROR_LOG(m_logger) << "Could enable fileContentModify."; return false; } @@ -100,7 +100,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId) if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan)) { - WARNING_LOG() << "Could not init planModel for partyId " << partyId; + WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId; delete planModel; planModel = nullptr; @@ -114,7 +114,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId) if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson)) { - WARNING_LOG() << "Could not init hqReportModel for partyId " << partyId; + WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId; delete planModel; planModel = nullptr; @@ -145,7 +145,7 @@ bool HQReportEdit::init(LtsSession::LtsSession *session, int partyId) if (!m_flmFtc->enableFileContentModify()) { - ERROR_LOG() << "Could enable fileContentModify."; + ERROR_LOG(m_logger) << "Could enable fileContentModify."; return false; } @@ -188,7 +188,7 @@ void HQReportEdit::createModels(const int partyId) const int partyFolderId = m_flmDtc->getPartyFolderId(m_session->exerciseId(), partyId); if (partyFolderId == 0) { - WARNING_LOG() << "No partyFolderId found for partyId " << partyId; + WARNING_LOG(m_logger) << "No partyFolderId found for partyId " << partyId; return; } @@ -197,7 +197,7 @@ void HQReportEdit::createModels(const int partyId) auto *planModel = new FlmHQReportModel(m_ui->listViewPlan); if (!planModel->init(m_session, partyFolderId, FileType::inner_enum::TacticalPlan)) { - WARNING_LOG() << "Could not init planModel for partyId " << partyId; + WARNING_LOG(m_logger) << "Could not init planModel for partyId " << partyId; delete planModel; return; } @@ -205,7 +205,7 @@ void HQReportEdit::createModels(const int partyId) auto *hqReportModel = new FlmHQReportModel(m_ui->listViewMessage); if (!hqReportModel->init(m_session, hqReportFolderId, FileType::inner_enum::AdlerJson)) { - WARNING_LOG() << "Could not init hqReportModel for partyId " << partyId; + WARNING_LOG(m_logger) << "Could not init hqReportModel for partyId " << partyId; delete planModel; delete hqReportModel; return; @@ -238,7 +238,7 @@ bool HQReportEdit::apply() if (hqRepConv->init(m_session, currentPartyId)) { - DEBUG_LOG() << "Add HQ to Converter"; + DEBUG_LOG(m_logger) << "Add HQ to Converter"; hqRepConv->addHqToPlanIds(allHqToPlanIds); @@ -258,7 +258,7 @@ void HQReportEdit::onPartyChanged(int index) if (!m_planModels.contains(currentPartyId) || !m_hqModels.contains(currentPartyId)) { - INFO_LOG() << "Models for party" << currentPartyId << "not found. Attempting to create..."; + INFO_LOG(m_logger) << "Models for party" << currentPartyId << "not found. Attempting to create..."; createModels(currentPartyId); } @@ -284,7 +284,7 @@ void HQReportEdit::onPartyChanged(int index) } else { - ERROR_LOG() << "Failed to switch to party" << currentPartyId << ": Models still missing."; + ERROR_LOG(m_logger) << "Failed to switch to party" << currentPartyId << ": Models still missing."; } } void HQReportEdit::onCreateNewPlanClicked() @@ -294,7 +294,7 @@ void HQReportEdit::onCreateNewPlanClicked() if (!ok) { - DEBUG_LOG() << "No name for new plan entered."; + DEBUG_LOG(m_logger) << "No name for new plan entered."; return; } @@ -303,7 +303,7 @@ void HQReportEdit::onCreateNewPlanClicked() if (planModel == nullptr) { - ERROR_LOG() << "Could not create plan --> no plan model present."; + ERROR_LOG(m_logger) << "Could not create plan --> no plan model present."; return; } @@ -312,14 +312,14 @@ void HQReportEdit::onCreateNewPlanClicked() if (geometryModel == nullptr) { - ERROR_LOG() << "Could not create plan --> not possible to create GeometryModel."; + ERROR_LOG(m_logger) << "Could not create plan --> not possible to create GeometryModel."; return; } if (m_session == nullptr) { - ERROR_LOG() << "Could not create plan --> not possible to create GeometryModel."; + ERROR_LOG(m_logger) << "Could not create plan --> not possible to create GeometryModel."; return; } @@ -345,7 +345,7 @@ void HQReportEdit::onCreateNewPlanClicked() { const QString errorMessage = tr("Could not save plan: %1").arg(QString::fromStdString(reply.str())); - ERROR_LOG() << errorMessage; + ERROR_LOG(m_logger) << errorMessage; new LtsWidgets::LtsMessageDialogNew(this, errorMessage, tr("Save failed")); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.h index 5cd11980a..bc521ef32 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_edit.h @@ -48,6 +48,8 @@ class HQReportEdit : public LtsWidgets::LtsDialog void onShiftClicked(); private: + + NGL::INGLLogger &m_logger; Ui::HQReportEdit *m_ui; QString m_menuGroup; LtsSession::LtsSession *m_session{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.cpp index 753d8ab9c..dcca1abf8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.cpp @@ -6,7 +6,7 @@ FlmHqReportJsonParser::FlmHqReportJsonParser() : m_logger(getLogger("HQReportPar HqReportData FlmHqReportJsonParser::parse(const QByteArray &data) { - DEBUG_LOG() << "START PARSING"; + DEBUG_LOG(m_logger) << "START PARSING"; QJsonDocument doc = QJsonDocument::fromJson(data); QJsonObject obj = doc.object(); HqReportData report; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.h index 16bd25b38..30b0b974c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_json_parser.h @@ -55,5 +55,6 @@ public: QString parseHqReportTime(const QJsonObject &obj); private: + NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.cpp index ce02f1dde..7efe456f9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.cpp @@ -5,23 +5,22 @@ namespace FileManagement { -FlmHQReportModel::FlmHQReportModel(QObject *parent) - : QAbstractListModel(parent) -{ +FlmHQReportModel::FlmHQReportModel(QObject *parent) : QAbstractListModel(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } bool FlmHQReportModel::init(LtsSession::LtsSession *session, int contentFolderId, const FileType &fileType) { if (!session) { - ERROR_LOG() << "Got invalid Session"; + ERROR_LOG(m_logger) << "Got invalid Session"; return false; } if (!session->getDtc(m_flmDtc)) { - ERROR_LOG() << "Could not get FLM Dtc"; + ERROR_LOG(m_logger) << "Could not get FLM Dtc"; return false; } @@ -251,7 +250,7 @@ void FlmHQReportModel::clearMovedData() QString FlmHQReportModel::createText(int dataIndex) const { - DEBUG_LOG() << Q_FUNC_INFO << " dataIndex: " << dataIndex; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dataIndex: " << dataIndex; if (dataIndex < 0 || dataIndex >= m_data.size()) return QString(); @@ -260,7 +259,7 @@ QString FlmHQReportModel::createText(int dataIndex) const if (!m_movedData.contains(data.id)) { - DEBUG_LOG() << "No moved data for " << data.name; + DEBUG_LOG(m_logger) << "No moved data for " << data.name; return data.name; } @@ -277,7 +276,7 @@ QString FlmHQReportModel::createText(int dataIndex) const void FlmHQReportModel::addMovedData(int dataIndex, const HQData &movedData) { - DEBUG_LOG() << Q_FUNC_INFO << " dataIndex: " << dataIndex << ", movedData.id: " << movedData.id << ", movedData.name: " << movedData.name; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " dataIndex: " << dataIndex << ", movedData.id: " << movedData.id << ", movedData.name: " << movedData.name; if (dataIndex < 0 || dataIndex >= m_data.size()) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.h index 4321c9f1f..5923959c6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/HQReports/flm_hq_report_model.h @@ -73,6 +73,8 @@ public: void clearMovedData(); private: + +NGL::INGLLogger &m_logger; QString createText(int dataIndex) const; void addMovedData(int dataIndex, const HQData &movedData); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.cpp index 60c6d61ca..68994e65c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.cpp @@ -100,24 +100,24 @@ void FileTopicEditor::updatePreview() if (m_userText.isEmpty()) { - DEBUG_LOG() << "file id = " << m_fileId; + DEBUG_LOG(m_logger) << "file id = " << m_fileId; m_fileContent = m_dtc->fileContent(m_fileId); m_fileName = QString::fromStdString(m_fileContent.name()); m_ui->leFileName->setText(m_fileName); - DEBUG_LOG() << "file name = " << m_fileName; + DEBUG_LOG(m_logger) << "file name = " << m_fileName; if (m_topicData.topicType == TopicEditorBase::TopicType::Pdf) { - DEBUG_LOG() << "zoom level = " << m_zoomLevel; + DEBUG_LOG(m_logger) << "zoom level = " << m_zoomLevel; m_ui->zoomSlider->setValue(m_zoomLevel); - DEBUG_LOG() << "rotation = " << m_rotation; + DEBUG_LOG(m_logger) << "rotation = " << m_rotation; m_ui->sbRotation->setValue(m_rotation); const int pageNo = m_pageNo; m_ui->sbPageNo->setRange(1, m_previewPlaybackWidget->getNumPages()); m_pageNo = pageNo; - DEBUG_LOG() << "page no = " << m_pageNo; + DEBUG_LOG(m_logger) << "page no = " << m_pageNo; m_ui->sbPageNo->setValue(m_pageNo); m_ui->sbPageNo->setEnabled(true); @@ -140,13 +140,13 @@ bool FileTopicEditor::fetchInterfaces() { if (!m_session->getForeignGuiInterface(m_guiIfc)) { - ERROR_LOG() << "Failed to retrieve Flm ForeignGuiInterface"; + ERROR_LOG(m_logger) << "Failed to retrieve Flm ForeignGuiInterface"; return false; } if (!m_session->getDtc(m_dtc)) { - ERROR_LOG() << "Failed to retrieve Flm Dtc"; + ERROR_LOG(m_logger) << "Failed to retrieve Flm Dtc"; return false; } @@ -386,13 +386,13 @@ void FileTopicEditor::onSelectFile() } else { - ERROR_LOG() << "Cannot load file from library"; + ERROR_LOG(m_logger) << "Cannot load file from library"; } } void FileTopicEditor::onZoomSliderChanged() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_zoomLevel = m_ui->zoomSlider->value(); m_ui->zoomSlider->setToolTip(tr("Zoom %1 %").arg(m_zoomLevel)); @@ -402,7 +402,7 @@ void FileTopicEditor::onZoomSliderChanged() void FileTopicEditor::onPageNoChanged(int pageNo) { - DEBUG_LOG() << Q_FUNC_INFO << "page no = " << pageNo; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "page no = " << pageNo; m_pageNo = pageNo; m_ui->sbPageNo->setValue(m_pageNo); @@ -453,7 +453,7 @@ void FileTopicEditor::onEnterText() void FileTopicEditor::onRotationChanged(int rotation) { - DEBUG_LOG() << Q_FUNC_INFO << " rotation = " << rotation; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " rotation = " << rotation; m_rotation = rotation; m_ui->sbRotation->setValue(m_rotation); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.h index cb2811755..de83f2eea 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/TopicEditor/topic_editor.h @@ -38,6 +38,8 @@ public: bool fetchInterfaces(); private: + +NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog.cpp index e13499b46..01b641477 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog.cpp @@ -87,10 +87,10 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, int folderId, const QString &xmlType) { - DEBUG_LOG() << "Start init FileManagementDialogWidget"; + DEBUG_LOG(m_logger) << "Start init FileManagementDialogWidget"; if (!session) { - ERROR_LOG() << "Failed to init FileManagementDialogWidget"; + ERROR_LOG(m_logger) << "Failed to init FileManagementDialogWidget"; return false; } @@ -146,7 +146,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, << tr("Name")); - DEBUG_LOG() << "Start init model folder"; + DEBUG_LOG(m_logger) << "Start init model folder"; m_modelFolder->init(m_session, m_isAdminMode); int opId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); if (m_dialogMode == FileDialogMode::Admin) @@ -159,7 +159,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, m_modelFile = new DialogModelFile(this); - DEBUG_LOG() << "Start init model file content"; + DEBUG_LOG(m_logger) << "Start init model file content"; auto predicate = [this](const FileManagement::FileContent &fc, const QString &xmlType) { @@ -196,7 +196,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, if (m_dialogMode == FileDialogMode::OpenFile || m_dialogMode == FileDialogMode::SaveFile) { - DEBUG_LOG() << "Init dialog for open/save modal dialog"; + DEBUG_LOG(m_logger) << "Init dialog for open/save modal dialog"; connect(m_ui->widgetFiles, &LtsDataView::LtsDataView::signalDoubleClicked, this, &FileManagementDialogWidget::onSelectFile); @@ -306,7 +306,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, if (m_dialogMode == FileDialogMode::SaveFile) { - DEBUG_LOG() << "DialogMode Save"; + DEBUG_LOG(m_logger) << "DialogMode Save"; m_ui->leFile->setEnabled(true); connect(m_ui->leFile, &QLineEdit::textChanged, this, &FileManagementDialogWidget::saveFileName); } @@ -333,7 +333,7 @@ bool FileManagementDialogWidget::init(LtsSession::LtsSession *session, void FileManagementDialogWidget::saveFileName(const QString &name) { - DEBUG_LOG() << "Saving: " << name; + DEBUG_LOG(m_logger) << "Saving: " << name; m_fileName = name; m_selectedFileContent = m_modelFile->findFileFromName(name); @@ -431,9 +431,9 @@ void FileManagementDialogWidget::enaDisa() m_selectedFolderId = 0; } - DEBUG_LOG() << "enableRemoveFolder=" << enableRemoveFolder; - DEBUG_LOG() << "enableEditFolder=" << enableEditFolder; - DEBUG_LOG() << "userHasRightsToEditFolder=" << userHasRightsToEditFolder; + DEBUG_LOG(m_logger) << "enableRemoveFolder=" << enableRemoveFolder; + DEBUG_LOG(m_logger) << "enableEditFolder=" << enableEditFolder; + DEBUG_LOG(m_logger) << "userHasRightsToEditFolder=" << userHasRightsToEditFolder; m_actionAddFolder->setEnabled(enableAddFolder && userHasRightsToEditFolder); m_actionRemoveFolder->setEnabled(enableRemoveFolder && userHasRightsToEditFolder); @@ -539,7 +539,7 @@ void FileManagementDialogWidget::enaDisa() bool FileManagementDialogWidget::isFolderRemovable(const QModelIndex &idx) const { - DEBUG_LOG() << "isFolderRemovable index = " << idx.row(); + DEBUG_LOG(m_logger) << "isFolderRemovable index = " << idx.row(); if (!idx.isValid()) return false; @@ -578,7 +578,7 @@ void FileManagementDialogWidget::onReject() void FileManagementDialogWidget::onAddFolder() { - DEBUG_LOG() << "onAddFolder"; + DEBUG_LOG(m_logger) << "onAddFolder"; QModelIndex selIndex = selectedIndexViewFolder(); if (!selIndex.isValid()) @@ -603,7 +603,7 @@ void FileManagementDialogWidget::onAddFolder() void FileManagementDialogWidget::onPasteFolder() { - DEBUG_LOG() << "onPasteFolder"; + DEBUG_LOG(m_logger) << "onPasteFolder"; QModelIndex selIndex = selectedIndexViewFolder(); if (!selIndex.isValid()) @@ -626,7 +626,7 @@ void FileManagementDialogWidget::onPasteFolder() void FileManagementDialogWidget::onPasteFile() { - DEBUG_LOG() << "onPasteFile"; + DEBUG_LOG(m_logger) << "onPasteFile"; if (m_selectedFolderId > 0 && m_copyFile.id() > 0) { @@ -697,7 +697,7 @@ void FileManagementDialogWidget::onPasteFile() void FileManagementDialogWidget::onRemoveFolder() { - DEBUG_LOG() << "onRemoveFolder id = " << m_selectedFolderId; + DEBUG_LOG(m_logger) << "onRemoveFolder id = " << m_selectedFolderId; QModelIndex selIndex = selectedIndexViewFolder(); if (!selIndex.isValid()) @@ -715,7 +715,7 @@ void FileManagementDialogWidget::onRemoveFolder() if (isFolderRemovable(selIndex)) { - DEBUG_LOG() << "Removing folder id = " << m_selectedFolderId; + DEBUG_LOG(m_logger) << "Removing folder id = " << m_selectedFolderId; Core::RemoveElementRequest req(m_selectedFolderId); m_requestHelper->startSingleRequest([req, this]() @@ -723,21 +723,21 @@ void FileManagementDialogWidget::onRemoveFolder() return m_ftc->folderRemoveRequest(req, this); }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove folder id = " << m_selectedFolderId; + ERROR_LOG(m_logger) << "Failed to remove folder id = " << m_selectedFolderId; } } void FileManagementDialogWidget::removeCurrentRowFolder() { - DEBUG_LOG() << "removeCurrentRowFolder"; + DEBUG_LOG(m_logger) << "removeCurrentRowFolder"; QModelIndex selIndex = selectedIndexViewFolder(); NGLTreeItem *item = m_modelFolder->privateData(selIndex); FileManagement::Folder fld = item->data().value(); bool isRootFolder = (fld.id() == 0); - DEBUG_LOG() << "isRootFolder = " << isRootFolder; + DEBUG_LOG(m_logger) << "isRootFolder = " << isRootFolder; if (!selIndex.isValid() || isRootFolder) return; @@ -754,7 +754,7 @@ QString FileManagementDialogWidget::getTemplateFile(const QString &fileName) void FileManagementDialogWidget::onRefreshFolders() { - DEBUG_LOG() << "onRefreshFolders"; + DEBUG_LOG(m_logger) << "onRefreshFolders"; m_modelFolder->initModel(m_session->exerciseId(), m_isAdminMode); m_ui->tvFolder->expandAll(); @@ -766,7 +766,7 @@ void FileManagementDialogWidget::onRefreshFolders() void FileManagementDialogWidget::onCopyFolder() { - DEBUG_LOG() << "onCopyFolder"; + DEBUG_LOG(m_logger) << "onCopyFolder"; QModelIndex selIndex = selectedIndexViewFolder(); NGLTreeItem *item = m_modelFolder->privateData(selIndex); @@ -779,7 +779,7 @@ void FileManagementDialogWidget::onCopyFolder() void FileManagementDialogWidget::onCopyFile() { - DEBUG_LOG() << "onCopyFile"; + DEBUG_LOG(m_logger) << "onCopyFile"; m_copyFile = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row()); @@ -791,7 +791,7 @@ void FileManagementDialogWidget::onCopyFile() void FileManagementDialogWidget::onCutFolder() { - DEBUG_LOG() << "onCutFolder"; + DEBUG_LOG(m_logger) << "onCutFolder"; QModelIndex selIndex = selectedIndexViewFolder(); NGLTreeItem *item = m_modelFolder->privateData(selIndex); @@ -806,7 +806,7 @@ void FileManagementDialogWidget::onCutFolder() void FileManagementDialogWidget::onCutFile() { - DEBUG_LOG() << "onCutFile"; + DEBUG_LOG(m_logger) << "onCutFile"; m_copyFile = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row()); @@ -820,7 +820,7 @@ void FileManagementDialogWidget::onCutFile() void FileManagementDialogWidget::onEditFolder() { - DEBUG_LOG() << "onEditFolder Id = " << m_selectedFolderId; + DEBUG_LOG(m_logger) << "onEditFolder Id = " << m_selectedFolderId; if (!m_actionRenameFolder->isEnabled()) return; @@ -862,7 +862,7 @@ void FileManagementDialogWidget::onRemoveFile() return; } - DEBUG_LOG() << "onRemoveFile"; + DEBUG_LOG(m_logger) << "onRemoveFile"; FileManagement::FileContent data = m_modelFile->getRowData(selIndex.row()); Core::RemoveElementRequest req(data.id()); @@ -872,7 +872,7 @@ void FileManagementDialogWidget::onRemoveFile() }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove file content"; + ERROR_LOG(m_logger) << "Failed to remove file content"; else reInitModelFile(); } @@ -884,7 +884,7 @@ void FileManagementDialogWidget::onDeleteFile() if (!selIndex.isValid()) return; - DEBUG_LOG() << "onDeleteFile"; + DEBUG_LOG(m_logger) << "onDeleteFile"; m_requestHelper->startSingleRequest([this]() { @@ -893,7 +893,7 @@ void FileManagementDialogWidget::onDeleteFile() if (data.fileStatus() == FileManagement::FileStatus::Deleted) return int64_t(0); - DEBUG_LOG() << "Deleting file id = " << data.id(); + DEBUG_LOG(m_logger) << "Deleting file id = " << data.id(); FileManagement::FileContentChangeStatusRequest req; req.id(data.id()); @@ -906,7 +906,7 @@ void FileManagementDialogWidget::onDeleteFile() }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to change status file content"; + ERROR_LOG(m_logger) << "Failed to change status file content"; else reInitModelFile(); } @@ -921,7 +921,7 @@ void FileManagementDialogWidget::reInitModelFile(bool restoreSelected) if (selIndex.isValid()) { selectedFileId = m_modelFile->getRowData(selIndex.row()).id(); - ERROR_LOG() << "Selected file id = " << selectedFileId; + ERROR_LOG(m_logger) << "Selected file id = " << selectedFileId; } } else @@ -938,7 +938,7 @@ void FileManagementDialogWidget::reInitModelFile(bool restoreSelected) if (restoreSelected && selectedFileId > 0) { - DEBUG_LOG() << "Restoring selection on file " << selectedFileId; + DEBUG_LOG(m_logger) << "Restoring selection on file " << selectedFileId; QModelIndex idx = m_modelFile->findIndexForId(selectedFileId); if (idx.isValid()) m_ui->widgetFiles->setCurrentIndex(idx); @@ -952,7 +952,7 @@ void FileManagementDialogWidget::onRestoreFile() if (!selIndex.isValid()) return; - DEBUG_LOG() << "onRestoreFile"; + DEBUG_LOG(m_logger) << "onRestoreFile"; m_requestHelper->startSingleRequest([this]() { @@ -961,7 +961,7 @@ void FileManagementDialogWidget::onRestoreFile() if (data.fileStatus() == FileManagement::FileStatus::Valid) return int64_t(0); - DEBUG_LOG() << "Deleting file id = " << data.id(); + DEBUG_LOG(m_logger) << "Deleting file id = " << data.id(); FileManagement::FileContentChangeStatusRequest req; req.id(data.id()); @@ -974,7 +974,7 @@ void FileManagementDialogWidget::onRestoreFile() }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to change status file content"; + ERROR_LOG(m_logger) << "Failed to change status file content"; else reInitModelFile(); } @@ -982,7 +982,7 @@ void FileManagementDialogWidget::onRestoreFile() void FileManagementDialogWidget::onEditFile() { - DEBUG_LOG() << "onEditFileContent"; + DEBUG_LOG(m_logger) << "onEditFileContent"; if (!m_actionEditFile->isEnabled()) return; @@ -992,7 +992,7 @@ void FileManagementDialogWidget::onEditFile() return; FileManagement::FileContent data = m_modelFile->getRowData(m_ui->widgetFiles->currentIndex().row()); - DEBUG_LOG() << "onEditFileContent Id = " << data.id(); + DEBUG_LOG(m_logger) << "onEditFileContent Id = " << data.id(); m_getContent->getContent(data.id(), m_content); @@ -1015,7 +1015,7 @@ void FileManagementDialogWidget::onEditFile() void FileManagementDialogWidget::onImportFile() { - DEBUG_LOG() << "onImportFile"; + DEBUG_LOG(m_logger) << "onImportFile"; const QStringList filter( @@ -1057,7 +1057,7 @@ void FileManagementDialogWidget::onImportFile() QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Cannot read file " << fileName; + ERROR_LOG(m_logger) << "Cannot read file " << fileName; return; } QByteArray fileContent = file.readAll(); @@ -1098,7 +1098,7 @@ void FileManagementDialogWidget::onImportFile() phId = 0; } - DEBUG_LOG() << "Exercise id = " << exId << ", phase Id = " << phId; + DEBUG_LOG(m_logger) << "Exercise id = " << exId << ", phase Id = " << phId; if (exId > 0) data.exerciseId(exId); @@ -1150,7 +1150,7 @@ void FileManagementDialogWidget::createNewOfficeFile(const QString &fileName) QFile file(absFilePath); if (!file.open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Cannot read file " << absFilePath; + ERROR_LOG(m_logger) << "Cannot read file " << absFilePath; return; } QByteArray fileContent = file.readAll(); @@ -1271,7 +1271,7 @@ void FileManagementDialogWidget::onNewFileFromTemplate() void FileManagementDialogWidget::onFolderSelectionChanged() { - DEBUG_LOG() << "onFolderSelectionChanged"; + DEBUG_LOG(m_logger) << "onFolderSelectionChanged"; enaDisa(); reInitModelFile(); @@ -1352,7 +1352,7 @@ void FileManagementDialogWidget::fileContextMenuRequested(const QPoint &position void FileManagementDialogWidget::onFolderChanged(const FileManagement::Folder &data, DataModification modType) { - DEBUG_LOG() << "onFolderChanged: folder name = " << data.name(); + DEBUG_LOG(m_logger) << "onFolderChanged: folder name = " << data.name(); Q_UNUSED(data); @@ -1388,12 +1388,12 @@ FileManagement::FileType FileManagementDialogWidget::getFileType(const QString & void FileManagementDialogWidget::onPreviewFile() { - DEBUG_LOG() << "onPreviewFile"; + DEBUG_LOG(m_logger) << "onPreviewFile"; QModelIndex selIndex = m_ui->widgetFiles->currentIndex(); if (!selIndex.isValid()) { - ERROR_LOG() << "No valid selected file for preview!"; + ERROR_LOG(m_logger) << "No valid selected file for preview!"; return; } @@ -1499,25 +1499,25 @@ QString FileManagementDialogWidget::getFileTypeStr(FileManagement::FileType file void FileManagementDialogWidget::onExportFile() { - DEBUG_LOG() << "onExportFile(): fileName = " << m_fileName; + DEBUG_LOG(m_logger) << "onExportFile(): fileName = " << m_fileName; static QString defaultPath = QDir::homePath() + QStringLiteral("/scanner/"); - DEBUG_LOG() << "onExportFile(): old path = " << defaultPath; + DEBUG_LOG(m_logger) << "onExportFile(): old path = " << defaultPath; QString folderName = QFileDialog::getExistingDirectory(this, tr("Save file from library to local Workstation"), defaultPath, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); - DEBUG_LOG() << "onExportFile(): folderName = " << folderName; + DEBUG_LOG(m_logger) << "onExportFile(): folderName = " << folderName; if (folderName.isEmpty()) { - DEBUG_LOG() << "onExportFile(): folderName.isEmpty()"; + DEBUG_LOG(m_logger) << "onExportFile(): folderName.isEmpty()"; return; } m_getContent->getContent(m_selectedFileContent.id(), m_content); - DEBUG_LOG() << "onExportFile(): Save File to '" << folderName << "/" << m_fileName << "'" + DEBUG_LOG(m_logger) << "onExportFile(): Save File to '" << folderName << "/" << m_fileName << "'" << " fileType = " << m_selectedFileContent.fileType() << " getFileTypeStr = " << getFileTypeStr(m_selectedFileContent.fileType()) << " exportFileName = " << m_selectedFileContent.exportFileName() @@ -1532,14 +1532,14 @@ void FileManagementDialogWidget::onExportFile() if (file.exists()) { - DEBUG_LOG() << "onExportFile(): File already exists (" << completeFileName << ") in folder " << folderName; + DEBUG_LOG(m_logger) << "onExportFile(): File already exists (" << completeFileName << ") in folder " << folderName; if (LtsWidgets::LtsMessageDialog::showMessage(this, tr("Yes - overwrite file.
" "No - do not overwrite file.
"), tr("Do you want to overwrite the existing file?"), LtsWidgets::Behaviour::Modal, LtsWidgets::Button::Yes | LtsWidgets::Button::No) != LtsWidgets::Button::Yes) { - DEBUG_LOG() << "onExportFile(): File exists, will not be overwritten (" << completeFileName << ") in folder " << folderName; + DEBUG_LOG(m_logger) << "onExportFile(): File exists, will not be overwritten (" << completeFileName << ") in folder " << folderName; return; } } @@ -1548,13 +1548,13 @@ void FileManagementDialogWidget::onExportFile() file.write(LtsUtils::toQByteArray(m_content)); file.close(); - DEBUG_LOG() << "onExportFile(): Exported file " << completeFileName << " in folder " << folderName; + DEBUG_LOG(m_logger) << "onExportFile(): Exported file " << completeFileName << " in folder " << folderName; } void FileManagementDialogWidget::onSelectFile() { - DEBUG_LOG() << "onSelectFile"; + DEBUG_LOG(m_logger) << "onSelectFile"; QModelIndex selIndex = m_ui->widgetFiles->currentIndex(); @@ -1563,18 +1563,18 @@ void FileManagementDialogWidget::onSelectFile() m_selectedFileContent = m_modelFile->getRowData(selIndex.row()); - DEBUG_LOG() << "Selected file content id = " << m_selectedFileContent.id(); + DEBUG_LOG(m_logger) << "Selected file content id = " << m_selectedFileContent.id(); emit accepted(); } void FileManagementDialogWidget::onChooseFileName() { - DEBUG_LOG() << "onChooseFileName"; + DEBUG_LOG(m_logger) << "onChooseFileName"; if ((FileDialogMode::SaveFile == m_dialogMode) && (!m_fileName.isEmpty())) { - DEBUG_LOG() << "Choosen file name = " << m_fileName; + DEBUG_LOG(m_logger) << "Choosen file name = " << m_fileName; emit accepted(); } } @@ -1583,7 +1583,7 @@ void FileManagementDialogWidget::onChooseFileName() void FileManagementDialogWidget::onFileChanged(const FileManagement::FileContent &data, DataModification modType) { bool condition = showFile(data, m_xmlType); - DEBUG_LOG() << "onFileChanged file name = " << data.name() << ", condition = " << condition << ", modType = " << modType; + DEBUG_LOG(m_logger) << "onFileChanged file name = " << data.name() << ", condition = " << condition << ", modType = " << modType; bool reInit = false; int row = 0; @@ -1627,19 +1627,19 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, { if (fc.isDeleted()) { - DEBUG_LOG() << "is deleted: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "is deleted: " << fc.name().c_str(); return false; } if (fc.folderId() != m_selectedFolderId) { - DEBUG_LOG() << "Folder id does not match: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "Folder id does not match: " << fc.name().c_str(); return false; } if (!m_fileTypes.isEmpty() && !m_fileTypes.contains(fc.fileType())) { - DEBUG_LOG() << "file type does not match: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "file type does not match: " << fc.name().c_str(); return false; } @@ -1647,7 +1647,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, { if (fc.fileStatus() != FileManagement::FileStatus::Valid) { - DEBUG_LOG() << "file status is not valid: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "file status is not valid: " << fc.name().c_str(); return false; } @@ -1662,16 +1662,16 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, { const int operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); - DEBUG_LOG() << "Filtering files on OperatorId = " << operatorId; + DEBUG_LOG(m_logger) << "Filtering files on OperatorId = " << operatorId; if (fc.operatorId() != operatorId) { - DEBUG_LOG() << "operator id does not match: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "operator id does not match: " << fc.name().c_str(); return false; } - DEBUG_LOG() << "Filtering files on User Category"; + DEBUG_LOG(m_logger) << "Filtering files on User Category"; if (fc.fileCategory() != FileManagement::FileCategory::User) { - DEBUG_LOG() << "User category does not match: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "User category does not match: " << fc.name().c_str(); } @@ -1680,7 +1680,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, { if (fc.exerciseId().is_set() && fc.exerciseId().get() != m_session->exerciseId()) { - DEBUG_LOG() << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId() + DEBUG_LOG(m_logger) << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId() << " should be " << m_session->exerciseId(); return false; } @@ -1691,19 +1691,19 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, if (fldPath.contains(FileManagement::MainFolder::ExerciseDocuments)) { - DEBUG_LOG() << "Filtering files on Exercise Category"; + DEBUG_LOG(m_logger) << "Filtering files on Exercise Category"; if (fc.fileCategory() != FileManagement::FileCategory::Exercise) { - DEBUG_LOG() << "exercise category does not match: " << fc.name().c_str(); + DEBUG_LOG(m_logger) << "exercise category does not match: " << fc.name().c_str(); return false; } if (m_session->exerciseId() > 0) { - DEBUG_LOG() << "Filtering files on Exercise Category and exerciseId = " << m_session->exerciseId(); + DEBUG_LOG(m_logger) << "Filtering files on Exercise Category and exerciseId = " << m_session->exerciseId(); if (fc.exerciseId().is_set() && fc.exerciseId().get() != m_session->exerciseId()) { - DEBUG_LOG() << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId() + DEBUG_LOG(m_logger) << "exercise does not match: " << fc.name().c_str() << " is: " << fc.exerciseId() << " should be " << m_session->exerciseId(); return false; } @@ -1716,7 +1716,7 @@ bool FileManagementDialogWidget::showFile(const FileManagement::FileContent &fc, const QString &prop = QString::fromStdString(fc.properties()); if (!prop.contains(xmlType, Qt::CaseSensitive)) { - DEBUG_LOG() << "XmlType not found " << xmlType; + DEBUG_LOG(m_logger) << "XmlType not found " << xmlType; return false; } } @@ -1761,7 +1761,7 @@ FileManagementDialogTab::FileManagementDialogTab(const QString &menuGroup, QWidg if (menuGroup == tr("Exercise Documents")) setOnlineHelpFilename(QStringLiteral("Situation-Library_Organisation")); - DEBUG_LOG() << "Ctor FileManagementDialogTab"; + DEBUG_LOG(m_logger) << "Ctor FileManagementDialogTab"; LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print; LtsWidgets::DialogButton btnEditFolder = LtsWidgets::DialogButton::Import; @@ -1857,7 +1857,7 @@ FileManagementDialog::FileManagementDialog(QWidget *parent) , m_buttonBox(new LtsWidgets::LtsDialogButtonBox(this)) , m_dialogMode(FileDialogMode::OpenFile) { - DEBUG_LOG() << "Ctor FileManagementDialog"; + DEBUG_LOG(m_logger) << "Ctor FileManagementDialog"; LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print; LtsWidgets::DialogButton btnSelectFile = LtsWidgets::DialogButton::Load; @@ -1888,11 +1888,11 @@ bool FileManagementDialogTab::init(LtsSession::LtsSession *session, const int &folderId, const QString &buttonName) { - DEBUG_LOG() << "Start init FileManagementDialogTab"; + DEBUG_LOG(m_logger) << "Start init FileManagementDialogTab"; if (!m_editItemWidget->init(session, dlgMode, fileTypes, folderId)) { - ERROR_LOG() << "Init FileManagementDialogTab failed!"; + ERROR_LOG(m_logger) << "Init FileManagementDialogTab failed!"; return false; } @@ -1937,12 +1937,12 @@ bool FileManagementDialog::init(LtsSession::LtsSession *session, int folderId, const QString &xmlType) { - DEBUG_LOG() << "Start init FileManagementDialog"; - DEBUG_LOG() << "Initial folder to select: " << folderId; + DEBUG_LOG(m_logger) << "Start init FileManagementDialog"; + DEBUG_LOG(m_logger) << "Initial folder to select: " << folderId; if (!m_editItemWidget->init(session, dlgMode, fileTypes, folderId, xmlType)) { - ERROR_LOG() << "Init FileManagementDialogWidget failed!"; + ERROR_LOG(m_logger) << "Init FileManagementDialogWidget failed!"; return false; } @@ -1981,7 +1981,7 @@ void FileManagementDialog::accept() void FileManagementDialog::enaDisa() { - DEBUG_LOG() << "FileManagementDialog::enaDisa()"; + DEBUG_LOG(m_logger) << "FileManagementDialog::enaDisa()"; LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print; m_buttonBox->setButtonEnabled(btnAddFolder, false); @@ -1997,8 +1997,8 @@ void FileManagementDialog::enaDisa() if (m_dialogMode == FileDialogMode::OpenFile && idxFile.isValid()) m_buttonBox->setButtonEnabled(btnSelectFile, true); - DEBUG_LOG() << "DialogMode: " << (int)m_dialogMode; - DEBUG_LOG() << "FileName: " << m_editItemWidget->m_fileName; + DEBUG_LOG(m_logger) << "DialogMode: " << (int)m_dialogMode; + DEBUG_LOG(m_logger) << "FileName: " << m_editItemWidget->m_fileName; if (m_dialogMode == FileDialogMode::SaveFile && !m_editItemWidget->m_fileName.isEmpty()) m_buttonBox->setButtonEnabled(btnSelectFile, true); @@ -2007,7 +2007,7 @@ void FileManagementDialog::enaDisa() void FileManagementDialogTab::enaDisa() { - DEBUG_LOG() << "FileManagementDialogTab::enaDisa()"; + DEBUG_LOG(m_logger) << "FileManagementDialogTab::enaDisa()"; LtsWidgets::DialogButton btnAddFolder = LtsWidgets::DialogButton::Print; LtsWidgets::DialogButton btnEditFolder = LtsWidgets::DialogButton::Import; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.cpp index cc4f6c977..0ae5d0bd2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.cpp @@ -66,7 +66,7 @@ bool DialogModelFile::initModel(LtsSession::LtsSession *session, insertRow(fc); }; m_flmDtc->fileContents(files); - DEBUG_LOG() << "initModel - #Files: " << m_vecData.size(); + DEBUG_LOG(m_logger) << "initModel - #Files: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.h index 2f6b4564a..733d1eaa0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_file.h @@ -54,6 +54,8 @@ public: FileManagement::FileContent findFileFromName(const QString &fileName) const; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_flmDtc; std::shared_ptr m_opmDtc; std::shared_ptr m_exmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.cpp index 672eb44c7..d22da6671 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.cpp @@ -179,7 +179,7 @@ bool DialogModelFolder::isRowRemovable(const NGLTreeItem *parentItem) const bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode) { - DEBUG_LOG() << "initModel Folder"; + DEBUG_LOG(m_logger) << "initModel Folder"; NGLTreeModel::resetModel(); @@ -199,7 +199,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode) int exId = folderName.remove(0, 4).toInt(); if ((exerciseId > 0 && exId != exerciseId) || exId != m_exmDtc->exercise(exId).id()) { - DEBUG_LOG() << "Excluded exercise id " << exId << ", folder id " << data.id(); + DEBUG_LOG(m_logger) << "Excluded exercise id " << exId << ", folder id " << data.id(); idsToExclude.append(data.id()); } } @@ -229,8 +229,8 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode) if (!parentItemIndexCache.contains(parentId)) { - WARNING_LOG() << "Invalid folder structure, parent may be hidden: " << parentId; - WARNING_LOG() << "Folder " << fld.name() << ", hidden: " << fld.isHidden(); + WARNING_LOG(m_logger) << "Invalid folder structure, parent may be hidden: " << parentId; + WARNING_LOG(m_logger) << "Folder " << fld.name() << ", hidden: " << fld.isHidden(); } else { @@ -238,7 +238,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode) int rowPos = -1; onInsertRow(rowPos, pIndex, fld); parentItemIndexCache.insert(folderId, index(rowPos, 0, pIndex)); - DEBUG_LOG() << "Added to tree (folder id, parent id) : (" << folderId << ", " << parentId << ")"; + DEBUG_LOG(m_logger) << "Added to tree (folder id, parent id) : (" << folderId << ", " << parentId << ")"; } } @@ -248,7 +248,7 @@ bool DialogModelFolder::initModel(int exerciseId, bool isAdminMode) bool DialogModelFolder::onInsertRow(int &row, const QModelIndex &parent, const FileManagement::Folder &folderData) { - DEBUG_LOG() << "onInsertRow"; + DEBUG_LOG(m_logger) << "onInsertRow"; row = rowCount(parent); QVariant data; @@ -267,7 +267,7 @@ bool DialogModelFolder::onInsertRow(int &row, const QModelIndex &parent, const F bool DialogModelFolder::onUpdateRow(const QModelIndex &index, const FileManagement::Folder &folderData) { - DEBUG_LOG() << "onUpdateRow"; + DEBUG_LOG(m_logger) << "onUpdateRow"; QVariant data; data.setValue(folderData); @@ -282,7 +282,7 @@ bool DialogModelFolder::onUpdateRow(const QModelIndex &index, const FileManageme bool DialogModelFolder::onDeleteRow(const QModelIndex &idx, bool isFirstItem) { - DEBUG_LOG() << "onDeleteRow"; + DEBUG_LOG(m_logger) << "onDeleteRow"; while (rowCount(idx) > 0) onDeleteRow(NGLTreeModel::index(0, 0, idx), false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.h index 63c2df837..85879e895 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_dialog_model_folder.h @@ -63,6 +63,8 @@ Q_SIGNALS: void internalDataChanged(); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_flmDtc; std::shared_ptr m_flmFtc; std::shared_ptr m_exmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.cpp index a7dafec46..6b7003361 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.cpp @@ -69,7 +69,7 @@ bool FileContentEditDialog::init(LtsSession::LtsSession *session, { if (!session) { - ERROR_LOG() << "Failed to init FileContentEditDialog"; + ERROR_LOG(m_logger) << "Failed to init FileContentEditDialog"; return false; } @@ -144,7 +144,7 @@ bool FileContentEditDialog::init(LtsSession::LtsSession *session, void FileContentEditDialog::getMetaData() { - DEBUG_LOG() << "getMetaData"; + DEBUG_LOG(m_logger) << "getMetaData"; m_ui->cbExercises->setCurrentIndex(0); m_ui->cbExercises->setEnabled(false); @@ -186,7 +186,7 @@ void FileContentEditDialog::getMetaData() void FileContentEditDialog::setMetaData() { - DEBUG_LOG() << "setMetaData"; + DEBUG_LOG(m_logger) << "setMetaData"; m_editData.name(m_ui->leName->text().toStdString()); m_editData.fileType(static_cast(m_ui->cbFileType->currentData().toInt())); @@ -219,7 +219,7 @@ void FileContentEditDialog::setMetaData() void FileContentEditDialog::onAddItem() { - DEBUG_LOG() << "onAddItem"; + DEBUG_LOG(m_logger) << "onAddItem"; setMetaData(); @@ -249,7 +249,7 @@ void FileContentEditDialog::onAddItem() m_editData.exerciseId(); m_editData.phaseId(); } - DEBUG_LOG() << "onAddItem: Content size = " << m_content.size(); + DEBUG_LOG(m_logger) << "onAddItem: Content size = " << m_content.size(); data.content(m_content); data.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); @@ -266,7 +266,7 @@ void FileContentEditDialog::onAddItem() void FileContentEditDialog::onEditItem() { - DEBUG_LOG() << "onEditItem"; + DEBUG_LOG(m_logger) << "onEditItem"; setMetaData(); @@ -300,10 +300,10 @@ void FileContentEditDialog::onEditItem() data.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); data.lastModified(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "onEditItem: Content size = " << m_content.size(); + DEBUG_LOG(m_logger) << "onEditItem: Content size = " << m_content.size(); data.content(m_content); - DEBUG_LOG() << "Modify FileContent id = " << data.id(); + DEBUG_LOG(m_logger) << "Modify FileContent id = " << data.id(); if (!m_requestHelper->startSingleRequest([ = ]() { @@ -318,7 +318,7 @@ void FileContentEditDialog::onEditItem() void FileContentEditDialog::onComboFileTypeChanged(int crt) { - DEBUG_LOG() << "onComboFileTypeChanged crt = " << crt; + DEBUG_LOG(m_logger) << "onComboFileTypeChanged crt = " << crt; m_ui->cbFileType->setCurrentIndex(crt); m_editData.fileType(static_cast(m_ui->cbFileType->currentData().toInt())); } @@ -326,7 +326,7 @@ void FileContentEditDialog::onComboFileTypeChanged(int crt) void FileContentEditDialog::onComboFileStatusChanged(int crt) { - DEBUG_LOG() << "onComboFileStatusChanged crt = " << crt; + DEBUG_LOG(m_logger) << "onComboFileStatusChanged crt = " << crt; m_ui->cbFileStatus->setCurrentIndex(crt); m_editData.fileStatus(static_cast(m_ui->cbFileStatus->currentData().toInt())); } @@ -334,7 +334,7 @@ void FileContentEditDialog::onComboFileStatusChanged(int crt) void FileContentEditDialog::onComboFileCategoryChanged(int crt) { - DEBUG_LOG() << "onComboFileCategoryChanged crt = " << crt; + DEBUG_LOG(m_logger) << "onComboFileCategoryChanged crt = " << crt; m_ui->cbFileCategory->setCurrentIndex(crt); m_editData.fileCategory(static_cast(m_ui->cbFileCategory->currentData().toInt())); @@ -346,7 +346,7 @@ void FileContentEditDialog::onComboFileCategoryChanged(int crt) void FileContentEditDialog::onComboExerciseChanged(int crt) { - DEBUG_LOG() << "onComboExerciseChanged crt = " << crt; + DEBUG_LOG(m_logger) << "onComboExerciseChanged crt = " << crt; m_ui->cbExercises->setCurrentIndex(crt); if (m_ui->cbExercises->currentData().toInt() > 0) { @@ -365,7 +365,7 @@ void FileContentEditDialog::onComboExerciseChanged(int crt) void FileContentEditDialog::onComboPhaseChanged(int crt) { - DEBUG_LOG() << "onComboPhaseChanged crt = " << crt; + DEBUG_LOG(m_logger) << "onComboPhaseChanged crt = " << crt; m_ui->cbPhases->setCurrentIndex(crt); if (m_ui->cbPhases->currentData().toInt() > 0) m_editData.phaseId(m_ui->cbPhases->currentData().toInt()); @@ -376,7 +376,7 @@ void FileContentEditDialog::onComboPhaseChanged(int crt) void FileContentEditDialog::fillExercisesComboBox() { - DEBUG_LOG() << "fillExercisesComboBox"; + DEBUG_LOG(m_logger) << "fillExercisesComboBox"; QSignalBlocker blocker(m_ui->cbExercises); m_ui->cbExercises->clear(); m_ui->cbExercises->addItem(tr(""), 0); @@ -390,14 +390,14 @@ void FileContentEditDialog::fillExercisesComboBox() void FileContentEditDialog::fillPhasesComboBox() { - DEBUG_LOG() << "fillPhasesComboBox"; + DEBUG_LOG(m_logger) << "fillPhasesComboBox"; QSignalBlocker blocker(m_ui->cbPhases); m_ui->cbPhases->clear(); m_ui->cbPhases->addItem(tr(""), 0); if (m_editData.exerciseId().is_set()) { const int exId = m_editData.exerciseId().get(); - DEBUG_LOG() << "ExId = " << exId; + DEBUG_LOG(m_logger) << "ExId = " << exId; if (exId > 0) { auto cbPhases = [this, exId] (const ExerciseManagement::ExercisePhase &ph) @@ -415,7 +415,7 @@ void FileContentEditDialog::fillPhasesComboBox() void FileContentEditDialog::onPropertiesClicked() { - DEBUG_LOG() << "onPropertiesClicked"; + DEBUG_LOG(m_logger) << "onPropertiesClicked"; SetPropertiesDialog *dialog = new SetPropertiesDialog(m_ui->leProperties, this); dialog->init(); dialog->setAttribute(Qt::WA_DeleteOnClose); @@ -425,7 +425,7 @@ void FileContentEditDialog::onPropertiesClicked() void FileContentEditDialog::onCheckUsedStateChanged(int newState) { - DEBUG_LOG() << "onCheckUsedClicked: newState = " << newState; + DEBUG_LOG(m_logger) << "onCheckUsedClicked: newState = " << newState; if (newState == Qt::Checked) m_editData.usedBy(1); else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.h index 52be8b448..38c162741 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_file_content.h @@ -37,6 +37,8 @@ public: const std::vector &content = {}); protected: + +NGL::INGLLogger &m_logger; void onFileContentModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.cpp index 5cf3a697a..d4217dbc1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.cpp @@ -94,7 +94,7 @@ void FolderEditDialog::onAddEditFolder() if (apply()) { close(); - DEBUG_LOG() << "Added / Edited folder " << m_editData.name(); + DEBUG_LOG(m_logger) << "Added / Edited folder " << m_editData.name(); } } @@ -104,7 +104,7 @@ bool FolderEditDialog::apply() if (m_folderId > 0) { - DEBUG_LOG() << "Rename folder id = " << m_folderId; + DEBUG_LOG(m_logger) << "Rename folder id = " << m_folderId; m_requestHelper->addRequest([this]() { FolderModifyRequest req; @@ -122,7 +122,7 @@ bool FolderEditDialog::apply() else { - DEBUG_LOG() << "Create new folder"; + DEBUG_LOG(m_logger) << "Create new folder"; FolderModifyRequest req; req.name(m_ui->leName->text().toStdString()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.h index 0090dd511..5befdecf4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_edit_folder.h @@ -36,6 +36,8 @@ public: bool apply(); protected: + +NGL::INGLLogger &m_logger; void onFolderModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.cpp index 1b657fee3..e531a5203 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.cpp @@ -126,33 +126,33 @@ QVector InterfaceImpl::getActions() bool InterfaceImpl::fetchInterfaces() { - DEBUG_LOG() << "Fetching FLM interfaces for " << m_session->domainId() << ", " << m_session->exerciseId() << ", " << m_session->partitionId(); + DEBUG_LOG(m_logger) << "Fetching FLM interfaces for " << m_session->domainId() << ", " << m_session->exerciseId() << ", " << m_session->partitionId(); if (!m_session->getDtc(m_dtc)) { - DEBUG_LOG() << "getDtc for FileManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for FileManagement::DataInterface failed."; return false; } if (!m_session->getFtc(m_ftc)) { - DEBUG_LOG() << "getFtc for FileManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getFtc for FileManagement::DataInterface failed."; return false; } if (!m_session->getForeignGuiInterface(m_flmGuiCbxIfc)) { - DEBUG_LOG() << "getForeignGuiInterface for FileManagement::ForeignGuiComboboxInterface failed."; + DEBUG_LOG(m_logger) << "getForeignGuiInterface for FileManagement::ForeignGuiComboboxInterface failed."; return false; } if (!m_session->getDtc(m_opmDtc)) { - DEBUG_LOG() << "getDtc for OperatorManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for OperatorManagement::DataInterface failed."; return false; } if (!m_session->getDtc(m_exmDtc)) { - DEBUG_LOG() << "getDtc for ExerciseManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for ExerciseManagement::DataInterface failed."; return false; } return true; @@ -177,13 +177,13 @@ QString InterfaceImpl::menuGroup() const LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementDialog(QWidget *parent) { - DEBUG_LOG() << "onShowFileManagementDialog"; + DEBUG_LOG(m_logger) << "onShowFileManagementDialog"; FileManagementDialogTab *dialog = new FileManagementDialogTab(menuGroup(), parent); if (!dialog->init(m_session, FileDialogMode::User)) { - ERROR_LOG() << "Failed to init dialog"; + ERROR_LOG(m_logger) << "Failed to init dialog"; dialog->deleteLater(); } @@ -195,13 +195,13 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementDialog(QWidget *parent LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementAdminDialog(QWidget *parent) { - DEBUG_LOG() << "onShowFileManagementDialog"; + DEBUG_LOG(m_logger) << "onShowFileManagementDialog"; FileManagementDialogTab *dialog = new FileManagementDialogTab(menuGroup(), parent); if (!dialog->init(m_session, FileDialogMode::Admin)) { - ERROR_LOG() << "Failed to init dialog"; + ERROR_LOG(m_logger) << "Failed to init dialog"; dialog->deleteLater(); } @@ -212,12 +212,12 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowFileManagementAdminDialog(QWidget *p LtsWidgets::LtsDialog *InterfaceImpl::onShowHQReportDialog(QWidget *parent) { - DEBUG_LOG() << "onShowHQReportDialog"; + DEBUG_LOG(m_logger) << "onShowHQReportDialog"; HQReportEdit *dialog = new HQReportEdit(menuGroup(), parent); if (!dialog->init(m_session)) { - ERROR_LOG() << "Failed to init dialog"; + ERROR_LOG(m_logger) << "Failed to init dialog"; dialog->deleteLater(); } dialog->show(); @@ -239,13 +239,13 @@ void InterfaceImpl::onShowHQReportDialog(int partyId) LtsWidgets::LtsFramelessDialog *InterfaceImpl::onSelectFileDialog(QWidget *parent) { - DEBUG_LOG() << "onSelectFileDialog"; + DEBUG_LOG(m_logger) << "onSelectFileDialog"; FileManagementDialog *dialog = new FileManagementDialog(parent); if (!dialog->init(m_session, FileDialogMode::SaveFile, {FileType::Jpg, FileType::Png}, 6, tr("Save File"))) { - ERROR_LOG() << "Failed to init dialog"; + ERROR_LOG(m_logger) << "Failed to init dialog"; dialog->deleteLater(); } @@ -266,11 +266,11 @@ int InterfaceImpl::saveFileContent(QWidget *parent, if (initialFolderId == 0 && exerciseId > 0) initialFolderId = m_dtc->getExerciseFolderId(exerciseId); - DEBUG_LOG() << "Initial folder Id = " << initialFolderId; + DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId; if (!dialog->init(m_session, FileManagement::FileDialogMode::SaveFile, QVector() << targetFileType, initialFolderId)) { - ERROR_LOG() << "Failed to init save dialog"; + ERROR_LOG(m_logger) << "Failed to init save dialog"; delete dialog; return 0; } @@ -279,7 +279,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent, if (res != QDialog::Accepted) { delete dialog; - DEBUG_LOG() << "Save dialog closed by user"; + DEBUG_LOG(m_logger) << "Save dialog closed by user"; return 0; } const int folderId = dialog->getSelectedFolderId(); @@ -287,13 +287,13 @@ int InterfaceImpl::saveFileContent(QWidget *parent, const FileManagement::FileContent fileToModify = dialog->getSelectedFile(); delete dialog; - INFO_LOG() << "FileToSave: Folder id = " << folderId + INFO_LOG(m_logger) << "FileToSave: Folder id = " << folderId << ", File id = " << fileToModify.id() << ", File name = " << fileName; if (folderId < 1 || fileName.isEmpty()) { - DEBUG_LOG() << "Save dialog closed by user"; + DEBUG_LOG(m_logger) << "Save dialog closed by user"; return 0; } @@ -306,7 +306,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent, , LtsWidgets::Button::Yes | LtsWidgets::Button::No)); if (doNotOverwrite) { - DEBUG_LOG() << "File not overwritten as chosen by user"; + DEBUG_LOG(m_logger) << "File not overwritten as chosen by user"; return 0; } } @@ -395,7 +395,7 @@ int InterfaceImpl::saveFileContent(QWidget *parent, int fileId = m_requestHelper->getRepliedId(); - DEBUG_LOG() << "saveFileContent: File Id = " << fileId; + DEBUG_LOG(m_logger) << "saveFileContent: File Id = " << fileId; return fileId; } @@ -492,7 +492,7 @@ bool InterfaceImpl::deleteFileContent(int fileId) if (fc.fileStatus() == FileManagement::FileStatus::Deleted) { - WARNING_LOG() << "File content already deleted for id = " << fileId; + WARNING_LOG(m_logger) << "File content already deleted for id = " << fileId; return true; } @@ -528,12 +528,12 @@ int InterfaceImpl::loadFileContent(QWidget *parent, initialFolderId = 1; } - DEBUG_LOG() << "Initial folder Id = " << initialFolderId; + DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId; QPointer dialog = new FileManagement::FileManagementDialog(parent); if (!dialog->init(m_session, FileManagement::FileDialogMode::OpenFile, fileTypes, initialFolderId, xmlType)) { - ERROR_LOG() << "Failed to init open dialog"; + ERROR_LOG(m_logger) << "Failed to init open dialog"; delete dialog; return 0; } @@ -548,7 +548,7 @@ int InterfaceImpl::loadFileContent(QWidget *parent, const int fileId = dialog->getSelectedFileId(); delete dialog; - INFO_LOG() << "FileToLoad: File id = " << fileId; + INFO_LOG(m_logger) << "FileToLoad: File id = " << fileId; if (fileId < 1) return 0; @@ -587,12 +587,12 @@ int InterfaceImpl::selectFileContent(QWidget *parent, initialFolderId = 1; } - DEBUG_LOG() << "Initial folder Id = " << initialFolderId; + DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId; QPointer dialog = new FileManagement::FileManagementDialog(parent); if (!dialog->init(m_session, FileManagement::FileDialogMode::OpenFile, fileTypes, initialFolderId)) { - ERROR_LOG() << "Failed to init open dialog"; + ERROR_LOG(m_logger) << "Failed to init open dialog"; delete dialog; return 0; } @@ -614,7 +614,7 @@ int InterfaceImpl::selectFileContent(QWidget *parent, bool InterfaceImpl::loadContent(int fileId, QByteArray &content, bool bQuiet) { - DEBUG_LOG() << "loadContent: File id = " << fileId; + DEBUG_LOG(m_logger) << "loadContent: File id = " << fileId; if (fileId < 1) return false; @@ -652,7 +652,7 @@ QString InterfaceImpl::hasXmlType(const QByteArray &content) const { if (content.isEmpty()) { - WARNING_LOG() << "Empty xml file content!"; + WARNING_LOG(m_logger) << "Empty xml file content!"; return QString(); } @@ -660,11 +660,11 @@ QString InterfaceImpl::hasXmlType(const QByteArray &content) const const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return QString(); } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); const QJsonObject obj(doc.object()); QString type = obj[QStringLiteral("XmlType")].toString(); @@ -714,7 +714,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) { QUrlQuery query(ev->url()); const int partyId = query.queryItemValue(QStringLiteral("party")).toInt(); - DEBUG_LOG() << "[flm_explorer] partyId: " << partyId; + DEBUG_LOG(m_logger) << "[flm_explorer] partyId: " << partyId; onShowHQReportDialog(partyId); event->accept(); @@ -787,13 +787,13 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib if (!m_previewWidget) { - ERROR_LOG() << "Preview widget not available for fileId = " << fileId; + ERROR_LOG(m_logger) << "Preview widget not available for fileId = " << fileId; return false; } if (!m_previewWidget->init(fc, pageNo, zoomLevel / 100., rotation, 0 , userText)) { - ERROR_LOG() << "Preview widget cannot be initialized for fileId = " << fileId; + ERROR_LOG(m_logger) << "Preview widget cannot be initialized for fileId = " << fileId; return false; } @@ -828,7 +828,7 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu - DEBUG_LOG() << "Trying to export file with id " << fileId << " to " << strPathToFile; + DEBUG_LOG(m_logger) << "Trying to export file with id " << fileId << " to " << strPathToFile; FileManagement::FileContent fc = m_dtc->fileContent(fileId); GetFileContentAsync *getFileContent = new GetFileContentAsync(fc.id(), m_ftc); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.h index a7317297a..5e1f0f9d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_explorer_gui_plugin.h @@ -105,6 +105,8 @@ public: TopicEditorBase::TopicEditor *createTopicEditor(const TopicEditorBase::TopicData &data) override; protected: + +NGL::INGLLogger &m_logger; bool eventFilter(QObject *obj, QEvent *event) override; private: void onGetFileContentDataReply(const GetFileContentDataReply &reply) override { m_requestHelper->requestReply(reply); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_get_content.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_get_content.cpp index cda58cdf8..4e7f073a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_get_content.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_get_content.cpp @@ -24,12 +24,12 @@ GetFileContent::~GetFileContent() bool GetFileContent::getContent(int fileContentId, std::vector &content) { - DEBUG_LOG() << "New Get Content"; + DEBUG_LOG(m_logger) << "New Get Content"; auto handleContent = [this, &content](const Core::FunctionReply & baseReply) { const GetFileContentDataReply &reply = static_cast(baseReply); content = reply.content(); - DEBUG_LOG() << "Content size: " << content.size(); + DEBUG_LOG(m_logger) << "Content size: " << content.size(); }; auto sendReq = [this, fileContentId]() @@ -41,11 +41,11 @@ bool GetFileContent::getContent(int fileContentId, std::vector &content if (!m_requestHelper->startSingleRequest(sendReq, handleContent)) { - ERROR_LOG() << "Cannot retrieve file content for id = " << fileContentId; + ERROR_LOG(m_logger) << "Cannot retrieve file content for id = " << fileContentId; return false; } - DEBUG_LOG() << "Content size: " << content.size(); + DEBUG_LOG(m_logger) << "Content size: " << content.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.cpp index 0a4a63dd4..d76b71bcb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.cpp @@ -15,10 +15,9 @@ namespace FileManagement { -OfficeIntegration::OfficeIntegration(const FileManagement::FileContent &fileContent, QObject *parent) - : QObject(parent) - , m_selectedFileContent(fileContent) -{} +OfficeIntegration::OfficeIntegration(const FileManagement::FileContent &fileContent, QObject *parent) : QObject(parent) + , m_selectedFileContent(fileContent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} OfficeIntegration::~OfficeIntegration() { @@ -31,7 +30,7 @@ bool OfficeIntegration::openOfficeWindow() const bool bUseMSOffice = LtsUtils::ProjectSettings::getInstance()->value(QStringLiteral("Office"), QStringLiteral("Type")).toString() == QStringLiteral("MSOffice"); const bool bRet = bUseMSOffice ? callWfica() : callLibreOffice(); if (!bRet) - ERROR_LOG() << m_errorString; + ERROR_LOG(m_logger) << m_errorString; return bRet; } @@ -78,9 +77,9 @@ bool OfficeIntegration::callWfica() this, &OfficeIntegration::deleteLater); myProcess->start(program, arguments); - INFO_LOG() << "icaFile: =" << m_icaFile->fileName() << + INFO_LOG(m_logger) << "icaFile: =" << m_icaFile->fileName() << ", args: '" << arguments.join(QLatin1Char(' ')); - DEBUG_LOG() << "FileManagement::OfficeIntegration::callWfica(): " << myProcess->errorString(); + DEBUG_LOG(m_logger) << "FileManagement::OfficeIntegration::callWfica(): " << myProcess->errorString(); return true; } @@ -94,7 +93,7 @@ bool OfficeIntegration::callLibreOffice() connString.replace(QStringLiteral("%DB_NAME%"), s->databaseName()); connString.replace(QStringLiteral("%DB_HOST%"), s->databaseHostname()); - DEBUG_LOG() << "DB connection string: " << connString; + DEBUG_LOG(m_logger) << "DB connection string: " << connString; QString program = QStringLiteral("java"); QStringList arguments; @@ -110,7 +109,7 @@ bool OfficeIntegration::callLibreOffice() connect(myProcess, QOverload::of(&QProcess::finished), myProcess, &QProcess::deleteLater); connect(myProcess, &QProcess::errorOccurred, this, [this, myProcess](QProcess::ProcessError error) { - ERROR_LOG() << "FileManagement::OfficeIntegration::callLibreOffice(): " << error << " = " << myProcess->errorString(); + ERROR_LOG(m_logger) << "FileManagement::OfficeIntegration::callLibreOffice(): " << error << " = " << myProcess->errorString(); }); myProcess->start(program, arguments); @@ -129,7 +128,7 @@ void OfficeIntegration::startLibreOfficeServer() this, &OfficeIntegration::deleteLater); myProcess->start(program, arguments); - DEBUG_LOG() << "FileManagement::OfficeIntegration::startLibreOfficeServer(): " << myProcess->errorString(); + DEBUG_LOG(m_logger) << "FileManagement::OfficeIntegration::startLibreOfficeServer(): " << myProcess->errorString(); } QString OfficeIntegration::getParas() const diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.h index 757120cb0..8bc645c08 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_office_integration.h @@ -21,6 +21,7 @@ public: bool openOfficeWindow(); QString errorString() const { return m_errorString; } private: +NGL::INGLLogger &m_logger; bool callWfica(); bool callLibreOffice(); void startLibreOfficeServer(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_file_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_file_dialog.cpp index f5b8d5a56..49262e406 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_file_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_file_dialog.cpp @@ -56,7 +56,7 @@ bool FileContentPreviewDialog::init(const FileContent &data) m_ui->lblTitle->setText(tr("Preview File Content: %1").arg(QString::fromStdString(data.name()))); - DEBUG_LOG() << "Content size: " << m_content.size(); + DEBUG_LOG(m_logger) << "Content size: " << m_content.size(); switch (data.fileType().underlying()) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_playback.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_playback.cpp index e85f06220..203a7acb3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_playback.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_preview_playback.cpp @@ -14,12 +14,11 @@ namespace FileManagement static Poppler::Page::Rotation getRotationFromValue(int rotation); -FileContentPreviewPlaybackWidget::FileContentPreviewPlaybackWidget(const std::shared_ptr &ftc, QWidget *parent) - : QWidget(parent) +FileContentPreviewPlaybackWidget::FileContentPreviewPlaybackWidget(const std::shared_ptr &ftc, QWidget *parent) : QWidget(parent) , m_ui(new Ui::FileContentPreviewPlaybackWidget) , m_getContent(new FileManagement::GetFileContent(ftc, this)) - , m_closeTimer(new QTimer(this)) -{ + , m_closeTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); m_ui->lblPixmap->setVisible(false); @@ -71,13 +70,13 @@ bool FileContentPreviewPlaybackWidget::init(const FileContent &data, int pageNo, m_rotation = rotation; m_userText = userText; - DEBUG_LOG() << "FileContentPreviewPlaybackWidget::init - (fileId, pageNo, zoomFactor, rotation) = (" + DEBUG_LOG(m_logger) << "FileContentPreviewPlaybackWidget::init - (fileId, pageNo, zoomFactor, rotation) = (" << m_data.id() << "," << m_pageNo << "," << m_zoomFactor << ", " << m_rotation << ")"; if (m_userText.isEmpty() && m_data.id() > 0) m_getContent->getContent(m_data.id(), m_content); - DEBUG_LOG() << "Content size: " << m_content.size() << ", " << m_pageNo; + DEBUG_LOG(m_logger) << "Content size: " << m_content.size() << ", " << m_pageNo; if (m_duration > 0) startTimer(); @@ -162,7 +161,7 @@ bool FileContentPreviewPlaybackWidget::init(const FileContent &data, int pageNo, bool FileContentPreviewPlaybackWidget::pauseTimer() { m_closeTimer.stop(); - DEBUG_LOG() << "Timer stopped "; + DEBUG_LOG(m_logger) << "Timer stopped "; return true; } @@ -172,7 +171,7 @@ bool FileContentPreviewPlaybackWidget::startTimer() m_closeTimer.setInterval(m_duration * 1000); connect(&m_closeTimer, &QTimer::timeout, this, &FileContentPreviewPlaybackWidget::close); m_closeTimer.start(); - DEBUG_LOG() << "Timer started interval = " << m_closeTimer.interval(); + DEBUG_LOG(m_logger) << "Timer started interval = " << m_closeTimer.interval(); return true; } @@ -193,7 +192,7 @@ void FileContentPreviewPlaybackWidget::setPage(int pageNo) { if (m_pageNo == pageNo) return; - DEBUG_LOG() << "setPage = " << pageNo; + DEBUG_LOG(m_logger) << "setPage = " << pageNo; m_pageNo = pageNo; m_pdfWidget->setPage(pageNo); emit currentPageChanged(m_pageNo); @@ -204,7 +203,7 @@ void FileContentPreviewPlaybackWidget::setZoomFactor(double zoomFactor) { if (qFuzzyCompare(m_zoomFactor, zoomFactor)) return; - DEBUG_LOG() << "setZoomFactor = " << zoomFactor; + DEBUG_LOG(m_logger) << "setZoomFactor = " << zoomFactor; m_zoomFactor = zoomFactor; m_pdfWidget->setZoomFactor(zoomFactor); } @@ -214,7 +213,7 @@ void FileContentPreviewPlaybackWidget::setRotation(int rotation) { if (m_rotation == rotation) return; - DEBUG_LOG() << "setRotation = " << rotation; + DEBUG_LOG(m_logger) << "setRotation = " << rotation; m_rotation = rotation; m_pdfWidget->setRotation(getRotationFromValue(m_rotation)); emit rotationChanged(rotation); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.cpp index 84cc0259d..356145437 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.cpp @@ -18,7 +18,7 @@ SetPropertiesDialog::SetPropertiesDialog(QLineEdit *lineEdit, QWidget *parent) , m_ui(new Ui::SetPropertiesDialog) , m_lineEdit(lineEdit) { - DEBUG_LOG() << "Ctor SetPropertiesDialog"; + DEBUG_LOG(m_logger) << "Ctor SetPropertiesDialog"; m_ui->setupUi(this); } @@ -31,7 +31,7 @@ SetPropertiesDialog::~SetPropertiesDialog() void SetPropertiesDialog::init() { - DEBUG_LOG() << "Init SetPropertiesDialog"; + DEBUG_LOG(m_logger) << "Init SetPropertiesDialog"; connect(m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Close), &QPushButton::clicked, this, &SetPropertiesDialog::close); m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Apply)->hide(); @@ -50,13 +50,13 @@ void SetPropertiesDialog::init() if (error.error != QJsonParseError::NoError) { - ERROR_LOG() << error.errorString(); + ERROR_LOG(m_logger) << error.errorString(); return; } if (!doc.isObject()) { - ERROR_LOG() << "Properties String is no JSON-Object"; + ERROR_LOG(m_logger) << "Properties String is no JSON-Object"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.h index 1de3a558a..1d722cf34 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FileManagement/Gui/Explorer/flm_set_properties_dialog.h @@ -31,6 +31,8 @@ private Q_SLOTS: void onAddClicked(); private: + +NGL::INGLLogger &m_logger; enum class PropValType { INT, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.cpp index fe6ee6e46..79e374c42 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.cpp @@ -79,10 +79,10 @@ bool AesDisplayFilterImpl::setFilterFromData(const AesFilter &filterData) const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return false; } - DEBUG_LOG() << "json to parse: " << doc.toJson(QJsonDocument::Compact); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(QJsonDocument::Compact); const QJsonObject obj(doc.object()); return setFilterFromData(obj); @@ -158,7 +158,7 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, qint64 effectDuration, qint64 currentTimeMSec) const { - DEBUG_LOG() << "visible check for " << aesType << " - state: " << aesState + DEBUG_LOG(m_logger) << "visible check for " << aesType << " - state: " << aesState << ", charge: " << chargeTypeId << ", party: " << partyId << ", isCentral: " << isCentral << ", effectstart: " << effectStart @@ -169,13 +169,13 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, if ((partyId > -1) && (m_visiblePartiesCheck && !m_visiblePartiesCheck(partyId))) { - DEBUG_LOG() << "Operator is not allowed to see aes for party " << partyId; + DEBUG_LOG(m_logger) << "Operator is not allowed to see aes for party " << partyId; return false; } if ((partyId > -1) && (m_visiblePartiesCheck && !m_visiblePartiesCheck(partyId))) { - DEBUG_LOG() << "Operator is not allowed to see aes for party " << partyId; + DEBUG_LOG(m_logger) << "Operator is not allowed to see aes for party " << partyId; return false; } @@ -183,7 +183,7 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, if (it == m_effectStateMap.end()) { - DEBUG_LOG() << "No filter entry for " << aesType << " - always visible"; + DEBUG_LOG(m_logger) << "No filter entry for " << aesType << " - always visible"; return true; } @@ -191,14 +191,14 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, if (ess.limitOnChargeTypes && chargeTypeId > 0) { - DEBUG_LOG() << "filtering for chargeType... "; + DEBUG_LOG(m_logger) << "filtering for chargeType... "; if (!ess.visibleChargeTypeIds.contains(chargeTypeId)) { - DEBUG_LOG() << "... is NOT allowed"; + DEBUG_LOG(m_logger) << "... is NOT allowed"; return false; } else - DEBUG_LOG() << "... is allowed"; + DEBUG_LOG(m_logger) << "... is allowed"; } if (!displayCentralPeripheralHelper(ess, isCentral)) @@ -206,31 +206,31 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, if (ess.limitOnParties && partyId > 0) { - DEBUG_LOG() << "filtering for partyId... "; + DEBUG_LOG(m_logger) << "filtering for partyId... "; if (!ess.visiblePartyIds.contains(partyId)) { - DEBUG_LOG() << "... is NOT allowed"; + DEBUG_LOG(m_logger) << "... is NOT allowed"; return false; } else - DEBUG_LOG() << "... is allowed"; + DEBUG_LOG(m_logger) << "... is allowed"; } - DEBUG_LOG() << "filtering for state ... "; + DEBUG_LOG(m_logger) << "filtering for state ... "; switch (aesState) { case AreaEffectSimulation::AesEffectState_def::EsCreated: case AreaEffectSimulation::AesEffectState_def::EsReceived: - DEBUG_LOG() << "... created/received visible: " << ess.displayCreated; + DEBUG_LOG(m_logger) << "... created/received visible: " << ess.displayCreated; return ess.displayCreated; case AreaEffectSimulation::AesEffectState_def::EsPrepared: case AreaEffectSimulation::AesEffectState_def::EsFired: - DEBUG_LOG() << "... prepared/fired visible: " << ess.displayPrepared; + DEBUG_LOG(m_logger) << "... prepared/fired visible: " << ess.displayPrepared; return ess.displayPrepared; case AreaEffectSimulation::AesEffectState_def::EsActivated: case AreaEffectSimulation::AesEffectState_def::EsPaused: - DEBUG_LOG() << "... active/paused visible: " << ess.displayActivated; + DEBUG_LOG(m_logger) << "... active/paused visible: " << ess.displayActivated; return ess.displayActivated; case AreaEffectSimulation::AesEffectState_def::EsExpired: { @@ -247,20 +247,20 @@ bool AesDisplayFilterImpl::isVisible(AreaEffectSimulation::AesType aesType, return false; const auto displayEnd = effectStart + effectDuration + ess.expiredAfterglowDurationMSec; - DEBUG_LOG() << "... expired visible: " << (currentTimeMSec < displayEnd) + DEBUG_LOG(m_logger) << "... expired visible: " << (currentTimeMSec < displayEnd) << ", calc expiry time: " << displayEnd << ", return: " << (currentTimeMSec < displayEnd); return (currentTimeMSec < displayEnd); } case AreaEffectSimulation::AesEffectState_def::EsRemoved: - DEBUG_LOG() << "... removed - NOT visible"; + DEBUG_LOG(m_logger) << "... removed - NOT visible"; return false; case AreaEffectSimulation::AesEffectState_def::EsUnknown: case AreaEffectSimulation::AesEffectState_def::EsError: break; } - DEBUG_LOG() << "... unknown - visible"; + DEBUG_LOG(m_logger) << "... unknown - visible"; return true; } @@ -347,7 +347,7 @@ AesDisplayFilterImpl::EffectStateStruct AesDisplayFilterImpl::effectStateFilter( { if (!m_effectStateMap.contains(aesType)) - WARNING_LOG() << "AesType not found!!! " << aesType; + WARNING_LOG(m_logger) << "AesType not found!!! " << aesType; return m_effectStateMap.value(aesType); } @@ -404,7 +404,7 @@ bool AesDisplayFilterImpl::parseFilterData(const QJsonObject &obj, const QJsonObject inner = obj.value(strType).toObject(); if (inner.isEmpty()) return false; - DEBUG_LOG() << "Parsing filter data for " << aesType + DEBUG_LOG(m_logger) << "Parsing filter data for " << aesType << ", json: " << QJsonDocument(inner).toJson(); EffectStateStruct &ess = m_effectStateMap[aesType]; ess.displayCreated = inner.value(QStringLiteral("created")).toBool(ess.displayCreated); @@ -465,10 +465,10 @@ void AesDisplayFilterImpl::addFilterData(QJsonObject &obj, AreaEffectSimulation: void AesDisplayFilterImpl::callFilterChangedCb(AreaEffectSimulation::AesType aesType) { - DEBUG_LOG() << Q_FUNC_INFO << ", call cbs, START, size=" << m_filterChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", call cbs, START, size=" << m_filterChangedCb.size(); for (auto *ptr : std::as_const(m_filterChangedCb)){ ptr->onAesDisplayFilterChanged(aesType); } - DEBUG_LOG() << Q_FUNC_INFO << ", call cbs, END, size=" << m_filterChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", call cbs, END, size=" << m_filterChangedCb.size(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.h index 83b38111d..4361cced9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/aes_display_filter_impl.h @@ -65,6 +65,7 @@ public: bool showExplosionClusterDetonationSphere() const override; bool showNotTriggeredCDMine() const override; protected: + NGL::INGLLogger &m_logger; bool showDetails2(AreaEffectSimulation::AesType aesType) const; bool showDetails3(AreaEffectSimulation::AesType aesType) const; bool showDetails4(AreaEffectSimulation::AesType aesType) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.cpp index 011fb3c86..da31b1264 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.cpp @@ -18,15 +18,15 @@ BuildingComponentSettingsImpl::BuildingComponentSettingsImpl(const QString &work : BuildingComponentSettings() , m_workspaceId(workspaceId) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; resetBuildingComponentSettings(); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } BuildingComponentSettingsImpl::~BuildingComponentSettingsImpl() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } void BuildingComponentSettingsImpl::resetBuildingComponentSettings() @@ -36,7 +36,7 @@ void BuildingComponentSettingsImpl::resetBuildingComponentSettings() bool BuildingComponentSettingsImpl::setBldCmpSettingsFromData(const BuildingComponentFilter &filterData) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; m_ddsFilterContent = filterData; @@ -49,27 +49,27 @@ bool BuildingComponentSettingsImpl::setBldCmpSettingsFromData(const BuildingComp const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return false; } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); const QJsonObject obj(doc.object()); if (obj.isEmpty()) return false; - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); BldCmpSettings settings; if (!settingsFromJsonInternal(doc.object(), settings)) { - ERROR_LOG() << "json to parse: " << doc.toJson(); + ERROR_LOG(m_logger) << "json to parse: " << doc.toJson(); return false; } setBldCmpSettings(settings); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return true; } @@ -105,11 +105,11 @@ QJsonObject BuildingComponentSettingsImpl::bldCmpSettingsToJson() const BuildingComponentFilter BuildingComponentSettingsImpl::bldCmpSettingsToData() const { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; BuildingComponentFilter ret(m_ddsFilterContent); const QJsonDocument doc(bldCmpSettingsToJson()); ret.content(doc.toJson(QJsonDocument::Compact).constData()); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return ret; } @@ -142,7 +142,7 @@ bool BuildingComponentSettingsImpl::settingsFromJsonInternal(const QJsonObject & bool BuildingComponentSettingsImpl::setBldCmpSettings(const QJsonObject &obj) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; BldCmpSettings settings; if (!settingsFromJsonInternal(obj, settings)) return false; @@ -151,15 +151,15 @@ bool BuildingComponentSettingsImpl::setBldCmpSettings(const QJsonObject &obj) bool BuildingComponentSettingsImpl::setBldCmpSettings(const BuildingComponentSettings::BldCmpSettings &s) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this << "; workspace " << m_workspaceId << "'"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this << "; workspace " << m_workspaceId << "'"; if (s == m_bldCmpSettings) { - DEBUG_LOG() << " Settings 's' and m_bldCmpSettings are equal -> return (workspace " << m_workspaceId << ")"; + DEBUG_LOG(m_logger) << " Settings 's' and m_bldCmpSettings are equal -> return (workspace " << m_workspaceId << ")"; return true; } - DEBUG_LOG() << " Settings 's' and m_bldCmpSettings are different -> update (workspace " << m_workspaceId << ")"; + DEBUG_LOG(m_logger) << " Settings 's' and m_bldCmpSettings are different -> update (workspace " << m_workspaceId << ")"; m_bldCmpSettings = s; @@ -185,13 +185,13 @@ bool BuildingComponentSettingsImpl::isChangedCallbackRegistered(BuildingComponen void BuildingComponentSettingsImpl::callSettingsChangedCb() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this << "; workspace " << m_workspaceId << "'" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this << "; workspace " << m_workspaceId << "'" << " call cbs now: size=" << m_settingsChangedCb.size(); for (auto *ptr : std::as_const(m_settingsChangedCb)) ptr->onBuildingComponentSettingsChanged(); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this << "; workspace " << m_workspaceId << "'" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this << "; workspace " << m_workspaceId << "'" << " call cbs now: size=" << m_settingsChangedCb.size(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.h index ed5343011..6cb2477a4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/building_cmpnt_settings_impl.h @@ -42,6 +42,8 @@ public: bool isChangedCallbackRegistered(SettingsChangedCallback *cb) const override; private: + +NGL::INGLLogger &m_logger; void callSettingsChangedCb(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/symbol_appearance_settings_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/symbol_appearance_settings_impl.cpp index ff7594ff2..99fb611c6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/symbol_appearance_settings_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/Common/symbol_appearance_settings_impl.cpp @@ -21,7 +21,7 @@ SymbolAppearanceSettingsImpl::SymbolAppearanceSettingsImpl(const std::shared_ptr , m_dtcPpm(dtcPpm) , m_workspaceId(workspaceId) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; if (m_dtcPpm) { connect(m_dtcPpm.get(), &ParticipantManagement::Interface::Dtc::participantChanged, @@ -32,28 +32,28 @@ SymbolAppearanceSettingsImpl::SymbolAppearanceSettingsImpl(const std::shared_ptr this, &SymbolAppearanceSettingsImpl::onRebuildCollapsExpandFilter); m_dtcPpm->participants([this](const ParticipantManagement::Participant &p) {onParticipantChanged(p, ParticipantManagement::DataModification::eAdded);}); } - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } SymbolAppearanceSettingsImpl::~SymbolAppearanceSettingsImpl() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } void SymbolAppearanceSettingsImpl::resetSymbolAppearanceSettings() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; setSettings(Settings(), Part::All); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } bool SymbolAppearanceSettingsImpl::setSettingsFromData(const SymbolAppearance &data) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this << ", m_settingsChangedCb.size()=" << m_settingsChangedCb.size(); - DEBUG_LOG() << " old symbolTransparency is " << m_settings.symbolSettings.symbolTransparency; + DEBUG_LOG(m_logger) << " old symbolTransparency is " << m_settings.symbolSettings.symbolTransparency; @@ -74,33 +74,33 @@ bool SymbolAppearanceSettingsImpl::setSettingsFromData(const SymbolAppearance &d const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return false; } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); Settings settings; if (!settingsFromJsonInternal(doc.object(), settings)) return false; m_settings.symbolSettings.symbolTransparency = -1.23; setSettings(settings, Part::All); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return true; } bool SymbolAppearanceSettingsImpl::settingsFromJsonInternal(const QJsonObject &obj, Settings &settings) const { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; auto &sym = settings.symbolSettings; QJsonObject symApp = obj[QStringLiteral("SymbolAppearances")].toObject(); sym.symbolScale = symApp[QStringLiteral("scale")].toDouble(sym.symbolScale); - DEBUG_LOG() << "set symbolScale to " << sym.symbolScale << " for workspace " << m_workspaceId; + DEBUG_LOG(m_logger) << "set symbolScale to " << sym.symbolScale << " for workspace " << m_workspaceId; sym.symbolTransparency = symApp[QStringLiteral("transparency")].toDouble(sym.symbolTransparency); - DEBUG_LOG() << "set symbolTransparency to " << sym.symbolTransparency << " for workspace " << m_workspaceId; + DEBUG_LOG(m_logger) << "set symbolTransparency to " << sym.symbolTransparency << " for workspace " << m_workspaceId; sym.symbolFireEventFlashingMSec = symApp[QStringLiteral("fireEventFlashing")].toDouble(sym.symbolFireEventFlashingMSec); sym.hitLineDisplayLengthMSec = symApp[QStringLiteral("hitLineDisplayLength")].toDouble(sym.hitLineDisplayLengthMSec); @@ -147,7 +147,7 @@ bool SymbolAppearanceSettingsImpl::settingsFromJsonInternal(const QJsonObject &o settings.colExpand.hiddenParticipantIds = fromJsonArray(obj.value(QStringLiteral("colExpHidden")).toArray()); settings.bIsValid = true; - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return true; } @@ -218,17 +218,17 @@ QJsonObject SymbolAppearanceSettingsImpl::settingsToJson() const SymbolAppearance SymbolAppearanceSettingsImpl::settingsToData() const { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; SymbolAppearance ret(m_ddsSettings); const QJsonDocument doc(settingsToJson()); ret.setContent(QString::fromUtf8(doc.toJson(QJsonDocument::Compact))); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return ret; } bool SymbolAppearanceSettingsImpl::setSettings(const QJsonObject &obj, Part part) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; Settings settings; if (!settingsFromJsonInternal(obj, settings)) return false; @@ -238,7 +238,7 @@ bool SymbolAppearanceSettingsImpl::setSettings(const QJsonObject &obj, Part part bool SymbolAppearanceSettingsImpl::setSettings(const Settings &s, Part part) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this << ", part=" << (int)part; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this << ", part=" << (int)part; bool bNeedRebuildCollapsExpandFilter = false; switch (part) @@ -246,18 +246,18 @@ bool SymbolAppearanceSettingsImpl::setSettings(const Settings &s, Part part) case Part::All: if (s == m_settings) { - DEBUG_LOG() << " Settings 's' and m_settings are equal -> return (workspace " << m_workspaceId << ")"; + DEBUG_LOG(m_logger) << " Settings 's' and m_settings are equal -> return (workspace " << m_workspaceId << ")"; return true; } bNeedRebuildCollapsExpandFilter = s.colExpand != m_settings.colExpand; m_settings = s; - INFO_LOG() << "set symbol scale (?) of " << s.symbolSettings.symbolScale << " in workspace " << m_workspaceId; + INFO_LOG(m_logger) << "set symbol scale (?) of " << s.symbolSettings.symbolScale << " in workspace " << m_workspaceId; break; case Part::Symbol: if (s.symbolSettings == m_settings.symbolSettings) return true; m_settings.symbolSettings = s.symbolSettings; - INFO_LOG() << "set symbol scale of " << s.symbolSettings.symbolScale << " in workspace " << m_workspaceId; + INFO_LOG(m_logger) << "set symbol scale of " << s.symbolSettings.symbolScale << " in workspace " << m_workspaceId; break; case Part::Types: if (s.hiddenTypeFilter == m_settings.hiddenTypeFilter && @@ -287,18 +287,18 @@ bool SymbolAppearanceSettingsImpl::isParticipantVisibileCollapseExpand(int parti void SymbolAppearanceSettingsImpl::addChangedCallback(SettingsChangedCallback *cb) { - DEBUG_LOG() << Q_FUNC_INFO << ", add cb=" << cb; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", add cb=" << cb; m_settingsChangedCb.removeAll(cb); m_settingsChangedCb.push_back(cb); - DEBUG_LOG() << Q_FUNC_INFO << ", add cb=" << cb << " done"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", add cb=" << cb << " done"; } void SymbolAppearanceSettingsImpl::removeChangedCallback(SettingsChangedCallback *cb) { - DEBUG_LOG() << Q_FUNC_INFO << ", remove cb=" << cb << " current size=" << m_settingsChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", remove cb=" << cb << " current size=" << m_settingsChangedCb.size(); m_settingsChangedCb.removeAll(cb); - DEBUG_LOG() << Q_FUNC_INFO << ", remove cb=" << cb << " done, current size=" << m_settingsChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", remove cb=" << cb << " done, current size=" << m_settingsChangedCb.size(); } bool SymbolAppearanceSettingsImpl::isChangedCallbackRegistered(SymbolAppearanceSettings::SettingsChangedCallback *cb) const @@ -308,10 +308,10 @@ bool SymbolAppearanceSettingsImpl::isChangedCallbackRegistered(SymbolAppearanceS void SymbolAppearanceSettingsImpl::callSettingsChangedCb(Part part) { - DEBUG_LOG() << Q_FUNC_INFO << ", call cbs, START , part=" << (int)part << ", size=" << m_settingsChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", call cbs, START , part=" << (int)part << ", size=" << m_settingsChangedCb.size(); for (auto *ptr : std::as_const(m_settingsChangedCb)) ptr->onSymbolAppearanceSettingsChanged(part); - DEBUG_LOG() << Q_FUNC_INFO << ", call cbs, END , part=" << (int)part << ", size=" << m_settingsChangedCb.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", call cbs, END , part=" << (int)part << ", size=" << m_settingsChangedCb.size(); } SymbolAppearanceSettingsImpl::SymbolVisibility SymbolAppearanceSettingsImpl::readSymbolVisibility(const QJsonObject &obj, @@ -398,7 +398,7 @@ void SymbolAppearanceSettingsImpl::onParticipantChanged(const ParticipantManagem void SymbolAppearanceSettingsImpl::onRebuildCollapsExpandFilter() { - DEBUG_LOG() << "Rebuilding CollapseExpand filter, participant2Superior size: " << m_participantId2SuperiorId.size(); + DEBUG_LOG(m_logger) << "Rebuilding CollapseExpand filter, participant2Superior size: " << m_participantId2SuperiorId.size(); QSet filteredParticipantsColExp = m_settings.colExpand.hiddenParticipantIds; for (auto it = m_participantId2SuperiorId.begin(); it != m_participantId2SuperiorId.end(); ++it) @@ -418,15 +418,15 @@ void SymbolAppearanceSettingsImpl::onRebuildCollapsExpandFilter() sl.reserve(20); for(int i : std::as_const(m_settings.colExpand.hiddenParticipantIds)) sl += QString::number(i); - DEBUG_LOG() << "Hidden participant ids: " << sl.join(QLatin1Char(' ')); + DEBUG_LOG(m_logger) << "Hidden participant ids: " << sl.join(QLatin1Char(' ')); sl.clear(); for(int i : std::as_const(m_settings.colExpand.collapsedParticipantIds)) sl += QString::number(i); - DEBUG_LOG() << "Collapsed participant ids: " << sl.join(QLatin1Char(' ')); + DEBUG_LOG(m_logger) << "Collapsed participant ids: " << sl.join(QLatin1Char(' ')); sl.clear(); for(int i : std::as_const(filteredParticipantsColExp)) sl += QString::number(i); - DEBUG_LOG() << "Result: " << sl.join(QLatin1Char(' ')); + DEBUG_LOG(m_logger) << "Result: " << sl.join(QLatin1Char(' ')); } if (m_filteredParticipantsColExp == filteredParticipantsColExp) @@ -446,7 +446,7 @@ bool SymbolAppearanceSettingsImpl::isInCollapsedTree(int participantId, QSet &visitedIds) const; private: + NGL::INGLLogger &m_logger; QVector m_settingsChangedCb; QHash m_participantId2SuperiorId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.cpp index 7f89ea47c..e37f261c2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.cpp @@ -46,12 +46,12 @@ bool AesFilterDialog::init(LtsSession::LtsSession *session) m_session = session; if (!session->getForeignGuiInterface(m_fltIfc)) { - WARNING_LOG() << "Can not get Foreign data interface for FilterManagement"; + WARNING_LOG(m_logger) << "Can not get Foreign data interface for FilterManagement"; return false; } if (!session->getFtc(m_fltFtc)) { - WARNING_LOG() << "Can not get Foreign data interface for FilterManagement"; + WARNING_LOG(m_logger) << "Can not get Foreign data interface for FilterManagement"; return false; } @@ -111,14 +111,14 @@ void AesFilterDialog::onAesFilterUpdateReply(const Core::FunctionReplyObject &re void AesFilterDialog::onUnknownChangesRecognized() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_unknowChangesNotifiyTimer->start(); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void AesFilterDialog::onProcessUnknownChanges() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_widget->updateGuiToFilter(); @@ -126,7 +126,7 @@ void AesFilterDialog::onProcessUnknownChanges() __unchange__(); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void AesFilterDialog::onLoadButtonClicked() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.h index f2ea59ce8..eaa1397e8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_dialog.h @@ -31,6 +31,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; bool apply() override; void dialogCanceled() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.cpp index 3dca85c78..136b2827b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.cpp @@ -316,7 +316,7 @@ void AesFilterWidget::setFilter() for (const auto &p : m_checkBoxes) { const AesDisplayFilter::EffectStateStruct ess(m_filter->effectStateFilter(p.first)); - DEBUG_LOG() << "Set Filter for " << p.first << ": " + DEBUG_LOG(m_logger) << "Set Filter for " << p.first << ": " << ess.displayCreated << ", " << ess.displayPrepared << ", " << ess.displayActivated; @@ -523,7 +523,7 @@ void AesFilterWidget::onSldMineAreaChanged() void AesFilterWidget::onSldAreaFireChanged() { onUpdateSliderTextAreaFire(); - DEBUG_LOG()<<">> slider area fire changed"; + DEBUG_LOG(m_logger)<<">> slider area fire changed"; if(!m_filter) return; const AreaEffectSimulation::AesType t(AreaEffectSimulation::AesType::AtExplosionArea); @@ -688,10 +688,10 @@ void AesFilterWidget::onChbTriggeredCDMineAreaClicked() void AesFilterWidget::onAesDisplayFilterChanged(AreaEffectSimulation::AesType aesType) { Q_UNUSED(aesType); - DEBUG_LOG() << Q_FUNC_INFO << " START, m_doUpdateViaCallback=" << m_doUpdateViaCallback; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, m_doUpdateViaCallback=" << m_doUpdateViaCallback; if (m_doUpdateViaCallback) emit unknownChangesRecognized(); - DEBUG_LOG() << Q_FUNC_INFO << " END, m_doUpdateViaCallback=" << m_doUpdateViaCallback; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, m_doUpdateViaCallback=" << m_doUpdateViaCallback; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.h index 239024d39..803bc5a58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Aes/flt_aes_filter_widget.h @@ -44,6 +44,8 @@ signals: void unknownChangesRecognized(); private: + +NGL::INGLLogger &m_logger; void setFilter(); private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.cpp index d73034723..c13f2e29c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.cpp @@ -22,20 +22,20 @@ BuildingComponentFilterDialog::BuildingComponentFilterDialog(QWidget *parent) , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_session(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; connect(m_widget, &BuildingComponentSettingsWidget::changesMade, this, &BuildingComponentFilterDialog::slotChangesMade); QGridLayout *gl = new QGridLayout(this); gl->setMargin(0); gl->addWidget(m_widget, 0, 0); setOnlineHelpFilename(QStringLiteral("Situation-Situation_Filter")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } BuildingComponentFilterDialog::~BuildingComponentFilterDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingComponentFilterDialog::init(LtsSession::LtsSession *session) @@ -43,12 +43,12 @@ bool BuildingComponentFilterDialog::init(LtsSession::LtsSession *session) m_session = session; if (!session->getForeignGuiInterface(m_fltIfc)) { - WARNING_LOG() << "Can not get Foreign data interface for FilterManagement"; + WARNING_LOG(m_logger) << "Can not get Foreign data interface for FilterManagement"; return false; } if (!session->getFtc(m_fltFtc)) { - WARNING_LOG() << "Can not get Foreign data interface for FilterManagement"; + WARNING_LOG(m_logger) << "Can not get Foreign data interface for FilterManagement"; return false; } @@ -58,7 +58,7 @@ bool BuildingComponentFilterDialog::init(LtsSession::LtsSession *session) std::shared_ptr m_ismDtc; if (!session->getDtc(m_ismDtc)) { - WARNING_LOG() << "Can not get Foreign data interface for FilterManagement"; + WARNING_LOG(m_logger) << "Can not get Foreign data interface for FilterManagement"; return false; } @@ -110,7 +110,7 @@ void BuildingComponentFilterDialog::onBuildingComponentFilterUpdateReply(const C void BuildingComponentFilterDialog::onUnknownChangesRecognized() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_widget->updateGuiToFilter(); @@ -118,7 +118,7 @@ void BuildingComponentFilterDialog::onUnknownChangesRecognized() __unchange__(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void BuildingComponentFilterDialog::onLoadButtonClicked() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.h index 58e24580b..38e4cf594 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_filter_dialog.h @@ -31,6 +31,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; bool apply() override; void dialogCanceled() override; void onBuildingComponentFilterUpdateReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.cpp index 8a6338aea..68647f41a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.cpp @@ -46,7 +46,7 @@ BuildingComponentSettingsWidget::BuildingComponentSettingsWidget(QWidget *parent , m_ui(new Ui::BuildingComponentSettingsWidget) , m_doUpdateViaCallback(true) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); @@ -75,7 +75,7 @@ BuildingComponentSettingsWidget::BuildingComponentSettingsWidget(QWidget *parent connect(cb , &QCheckBox::clicked, this, &BuildingComponentSettingsWidget::readUpdateFilterFromUi); - TRACE_LOG() << Q_FUNC_INFO << " STARTXXXX"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " STARTXXXX"; cb->setContextMenuPolicy(Qt::CustomContextMenu); @@ -95,17 +95,17 @@ BuildingComponentSettingsWidget::BuildingComponentSettingsWidget(QWidget *parent } } - TRACE_LOG() << Q_FUNC_INFO << " END, m_checkBoxesComponents.size = " << m_checkBoxesComponents.size() + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, m_checkBoxesComponents.size = " << m_checkBoxesComponents.size() << ", labelComponents.size()=" << labelComponents.size(); } BuildingComponentSettingsWidget::~BuildingComponentSettingsWidget() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_buildingComponentSettings) m_buildingComponentSettings->removeChangedCallback(this); delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingComponentSettingsWidget::init(const std::shared_ptr &filter, @@ -113,7 +113,7 @@ bool BuildingComponentSettingsWidget::init(const std::shared_ptrbldCmpSettingsToJson()).toJson(); + DEBUG_LOG(m_logger) << "onDataChanged ... " << QJsonDocument(newFilter->bldCmpSettingsToJson()).toJson(); setBuildingComponentSettings(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.h index c36949ee7..3298b2536 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_component_settings_widget.h @@ -70,6 +70,8 @@ private slots: void onComponentSelection(bool onOff); private: + +NGL::INGLLogger &m_logger; bool setupFloorUi(const QVector &floorIds); void setBuildingComponentSettings(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.cpp index d19eb61d1..b7dfcd5b0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.cpp @@ -87,7 +87,7 @@ QVector InterfaceImpl::getActions() void InterfaceImpl::onBuildingComponentFilterChanged(const FilterManagement::BuildingComponentFilter &data, DataModification mod) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; auto it = m_buildingComponentFilterMap.find(FilterKey{data.operatorId(), data.ctx()}); if (it != m_buildingComponentFilterMap.end()) @@ -108,13 +108,13 @@ void InterfaceImpl::onBuildingComponentFilterChanged(const FilterManagement::Bui m_buildingComponentFilterMap.erase(it); } } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } std::shared_ptr InterfaceImpl::buildingComponentSettingsForOperator(int operatorId, const QString &context) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << ", operatorId=" << operatorId << ", context=" << context; std::shared_ptr ret; @@ -159,7 +159,7 @@ std::shared_ptr InterfaceImpl::buildingComponentSetti m_buildingComponentFilterMap[FilterKey(operatorId, context.toStdString())] = ret; } - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << ", operatorId=" << operatorId << ", context=" << context; return ret; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.h index 31b7e3380..416caf048 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/BuildingComponents/flt_building_components_gui_plugin.h @@ -55,6 +55,8 @@ private slots: private: + +NGL::INGLLogger &m_logger; struct FilterKey { int operatorId = 0; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.cpp index 3fe557ab2..35fb323eb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.cpp @@ -68,30 +68,30 @@ bool FilterChangeDialog::init(LtsSession::LtsSession *session, if (!m_session) { - ERROR_LOG() << Q_FUNC_INFO << " no session"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no session"; return false; } { int myOperatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); int myScreenId = m_session->screenId(); - DEBUG_LOG() << Q_FUNC_INFO << " my operatorId=" << myOperatorId << " my screenId=" << myScreenId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " my operatorId=" << myOperatorId << " my screenId=" << myScreenId; } if (!m_session->getForeignGuiInterface(m_fltParticipantGuiIfc)) { - WARNING_LOG() << "Can not get Foreign gui interface for FilterManagement/Participant"; + WARNING_LOG(m_logger) << "Can not get Foreign gui interface for FilterManagement/Participant"; return false; } if (!m_session->getForeignGuiInterface(m_fltAesIfc)) { - WARNING_LOG() << "Can not get Foreign gui interface for FilterManagement/AES"; + WARNING_LOG(m_logger) << "Can not get Foreign gui interface for FilterManagement/AES"; return false; } if (!m_session->getForeignGuiInterface(m_fltBuildingComponentIfc)) { - WARNING_LOG() << "Can not get Foreign gui interface for FilterManagement/BuildingComponent"; + WARNING_LOG(m_logger) << "Can not get Foreign gui interface for FilterManagement/BuildingComponent"; } @@ -99,19 +99,19 @@ bool FilterChangeDialog::init(LtsSession::LtsSession *session, if (!m_session->getForeignGuiInterface(m_opmCbxDtc)) { - DEBUG_LOG() << "getForeignGuiInterface for OperatorManagement failed."; + DEBUG_LOG(m_logger) << "getForeignGuiInterface for OperatorManagement failed."; return false; } if (!m_session->getFtc(m_fltFtc)) { - DEBUG_LOG() << "getFtc for FilterManagement failed."; + DEBUG_LOG(m_logger) << "getFtc for FilterManagement failed."; return false; } if (!m_session->getDtc(m_fltDtc)) { - DEBUG_LOG() << "getDtc for FilterManagement failed."; + DEBUG_LOG(m_logger) << "getDtc for FilterManagement failed."; return false; } @@ -173,7 +173,7 @@ bool FilterChangeDialog::init(LtsSession::LtsSession *session, currentAppId, m_session->exerciseId(), LtsSessionData::LtsSessionData::getInstance()->getOperatorId())) - ERROR_LOG() << Q_FUNC_INFO << " fillActiveAppOperatorComboBox failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " fillActiveAppOperatorComboBox failed"; return true; } @@ -181,7 +181,7 @@ bool FilterChangeDialog::init(LtsSession::LtsSession *session, void FilterChangeDialog::onOperatorChanged() { const int operatorId = m_ui->cbxOperator->currentData().toInt(); - DEBUG_LOG() << Q_FUNC_INFO << " START, change to operatorId=" << operatorId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, change to operatorId=" << operatorId << ", m_session->exerciseId()=" << m_session->exerciseId(); if (!m_opmCbxDtc) return; @@ -214,7 +214,7 @@ void FilterChangeDialog::onOperatorChanged() FilterManagement::TriggerFilterData req; req.operatorId(operatorId); req.requestTime(m_session->partitionTime()); - INFO_LOG() << Q_FUNC_INFO << "TriggerFilterData: " << req; + INFO_LOG(m_logger) << Q_FUNC_INFO << "TriggerFilterData: " << req; return m_fltFtc->triggerFilterDataUpdateRequest(req, this); }; m_requestHelper->startSingleRequest(cb); @@ -222,7 +222,7 @@ void FilterChangeDialog::onOperatorChanged() - DEBUG_LOG() << Q_FUNC_INFO << " END, change to operatorId=" << operatorId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, change to operatorId=" << operatorId; } @@ -231,7 +231,7 @@ void FilterChangeDialog::onScreenChanged() m_ui->cbxScreenContainer->clear(); const int screenId = m_ui->cbxScreen->currentData().toInt(); - DEBUG_LOG() << Q_FUNC_INFO << " START, change to ScreenId=" << screenId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, change to ScreenId=" << screenId; if (!m_opmCbxDtc) return; @@ -289,23 +289,23 @@ void FilterChangeDialog::onScreenChanged() enableDisable(); - DEBUG_LOG() << Q_FUNC_INFO << " END, change to ScreenId=" << screenId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, change to ScreenId=" << screenId; } void FilterChangeDialog::onScreenContainerChanged() { const int screenContainerId = m_ui->cbxScreen->currentData().toInt(); - DEBUG_LOG() << Q_FUNC_INFO << " START, change to ScreenContainerId=" << screenContainerId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, change to ScreenContainerId=" << screenContainerId; if (!m_opmCbxDtc) return; enableDisable(); - DEBUG_LOG() << Q_FUNC_INFO << " END, change to ScreenContainerId=" << screenContainerId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, change to ScreenContainerId=" << screenContainerId; } void FilterChangeDialog::onFilterDataChanged(const FilterData &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " START, we got FilterData " << data + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, we got FilterData " << data << ", modType " << modType; if ((modType != DataModification::eAdded) && (modType != DataModification::eModified)) @@ -320,7 +320,7 @@ void FilterChangeDialog::onFilterDataChanged(const FilterData &data, DataModific if (data.operatorId() != requestedOperatorId) return; - DEBUG_LOG() << Q_FUNC_INFO << " START, we got new FilterData for 'our' operator: " << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, we got new FilterData for 'our' operator: " << data; @@ -329,7 +329,7 @@ void FilterChangeDialog::onFilterDataChanged(const FilterData &data, DataModific const int screenId = data.screenId(); const int screenContainerId = data.screenContainerId(); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " insert " << " QPair<> " << "(screenId, " << screenId << "(screenContainerId, " << screenContainerId << ")" @@ -338,7 +338,7 @@ void FilterChangeDialog::onFilterDataChanged(const FilterData &data, DataModific enableDisable(); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool FilterChangeDialog::apply() @@ -348,7 +348,7 @@ bool FilterChangeDialog::apply() if (!m_filterDataPerScreen.contains(QPair(screenId, screenContainerId))) { - ERROR_LOG() << Q_FUNC_INFO << " not found: " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not found: " << " screenId=" << screenId << ", screenContainerId=" << screenContainerId << "; available screenId count = " << m_filterDataPerScreen.count(); @@ -366,7 +366,7 @@ bool FilterChangeDialog::apply() { if (fData.symbolAppearanceContent().size() <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " FilterData (SymbolAppearance) is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " FilterData (SymbolAppearance) is empty"; return false; } @@ -388,7 +388,7 @@ bool FilterChangeDialog::apply() s = impl.settings(); } - DEBUG_LOG() << " set SymbolAppearance..." + DEBUG_LOG(m_logger) << " set SymbolAppearance..." << " m_ui->cbSymbolappear->isChecked()=" << m_ui->cbSymbolappear->isChecked() << " m_ui->cbTypeFilter->isChecked()=" << m_ui->cbTypeFilter->isChecked() << " m_ui->cbCollapseExpand->isChecked()=" << m_ui->cbCollapseExpand->isChecked(); @@ -402,7 +402,7 @@ bool FilterChangeDialog::apply() auto cb = [this]() -> bool { const SymbolAppearance &symbolAppearance = m_symbolAppearanceSettings->settingsToData(); - INFO_LOG() << "symbolAppearance content " << symbolAppearance.setContent(); + INFO_LOG(m_logger) << "symbolAppearance content " << symbolAppearance.setContent(); return m_fltFtc->symbolAppearanceUpdateRequest(symbolAppearance, this); }; m_requestHelper->addRequest(cb); @@ -415,7 +415,7 @@ bool FilterChangeDialog::apply() { if (fData.aesFilterContent().size() <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " FilterData (AesFilter) is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " FilterData (AesFilter) is empty"; return false; } @@ -431,7 +431,7 @@ bool FilterChangeDialog::apply() auto cb = [this]() -> bool { const AesFilter &aesFilter = m_aesDisplayFilter->filterToData(); - INFO_LOG() << "AesFilter content " << aesFilter.setContent(); + INFO_LOG(m_logger) << "AesFilter content " << aesFilter.setContent(); return m_fltFtc->aesFilterUpdateRequest(aesFilter, this); }; m_requestHelper->addRequest(cb); @@ -444,7 +444,7 @@ bool FilterChangeDialog::apply() { if (fData.buildingComponentsFilterContent().size() <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " FilterData (BuildingComponentFilter) is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " FilterData (BuildingComponentFilter) is empty"; return false; } @@ -460,7 +460,7 @@ bool FilterChangeDialog::apply() auto cb = [this]() -> bool { const BuildingComponentFilter &filterData = m_buildingComponentSettings->bldCmpSettingsToData(); - INFO_LOG() << "BuildingComponentFilter content " << filterData.setContent(); + INFO_LOG(m_logger) << "BuildingComponentFilter content " << filterData.setContent(); return m_fltFtc->buildingComponentFilterUpdateRequest(filterData, this); }; m_requestHelper->addRequest(cb); @@ -474,14 +474,14 @@ bool FilterChangeDialog::apply() { if (fData.operatorMapSettingsContent().size() <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " FilterData (OperatorMapSettings) is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " FilterData (OperatorMapSettings) is empty"; return false; } std::shared_ptr sitMapIfc; if (!m_session->getForeignGuiInterface(sitMapIfc)) { - ERROR_LOG() << Q_FUNC_INFO << " no SituationMap::ForeignGuiInterface"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no SituationMap::ForeignGuiInterface"; return false; } sitMapIfc->setOperatorMapSettingsJson(QByteArray::fromRawData(fData.operatorMapSettingsContent().c_str(), fData.operatorMapSettingsContent().size())); @@ -521,7 +521,7 @@ void FilterChangeDialog::enableDisable() { int myOperatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); int myScreenId = m_session->screenId(); - DEBUG_LOG() << Q_FUNC_INFO << " my operatorId=" << myOperatorId << " my screenId=" << myScreenId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " my operatorId=" << myOperatorId << " my screenId=" << myScreenId; } @@ -541,7 +541,7 @@ void FilterChangeDialog::enableDisable() dump(); - DEBUG_LOG() << Q_FUNC_INFO << " cbxScreenId=" << cbxScreenId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cbxScreenId=" << cbxScreenId << " cbxScreenContainerId=" << cbxScreenContainerId << ", availableScreenId count=" << m_filterDataPerScreen.count() << ", DialogButton::Ok: enabled=" << m_ui->buttonBox->getButton(LtsWidgets::DialogButton::Ok)->isEnabled(); @@ -549,11 +549,11 @@ void FilterChangeDialog::enableDisable() void FilterChangeDialog::dump() { - DEBUG_LOG() << Q_FUNC_INFO << " -------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " -------------------------"; { int myOperatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); int myScreenId = m_session->screenId(); - DEBUG_LOG()<< ", myOperatorId=" << myOperatorId << ", myScreenId=" << myScreenId; + DEBUG_LOG(m_logger)<< ", myOperatorId=" << myOperatorId << ", myScreenId=" << myScreenId; } @@ -561,7 +561,7 @@ void FilterChangeDialog::dump() const int cbxOperatorId = m_ui->cbxOperator->currentData().toInt(); const int cbxScreenId = m_ui->cbxScreen->currentData().toInt(); const int cbxScreenContainerId = m_ui->cbxScreenContainer->currentData().toInt(); - DEBUG_LOG()<< ", cbxOperatorId=" << cbxOperatorId << ", cbxScreenId=" << cbxScreenId << ", cbxScreenContainerId=" << cbxScreenContainerId; + DEBUG_LOG(m_logger)<< ", cbxOperatorId=" << cbxOperatorId << ", cbxScreenId=" << cbxScreenId << ", cbxScreenContainerId=" << cbxScreenContainerId; } QMapIterator, FilterData> it(m_filterDataPerScreen); @@ -569,9 +569,9 @@ void FilterChangeDialog::dump() { it.next(); QPair key = it.key(); - DEBUG_LOG() << " ScreenId=" << key.first << ", ScreenContainerId=" << key.second; + DEBUG_LOG(m_logger) << " ScreenId=" << key.first << ", ScreenContainerId=" << key.second; } - DEBUG_LOG() << Q_FUNC_INFO << " -------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " -------------------------"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.h index 78622cfd3..03f17e2ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/FilterChange/flt_filter_change.h @@ -58,6 +58,8 @@ public: } private: + +NGL::INGLLogger &m_logger; bool apply(); void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &replyObject) override; void onAesFilterUpdateReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.cpp index 37a371374..762686d21 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.cpp @@ -117,7 +117,7 @@ void CollapseExpandParticipantDialog::onLoadButtonClicked() void CollapseExpandParticipantDialog::onDataChanged(const SymbolAppearance &data, DataModification modType) { - DEBUG_LOG() << "onDataChanged ... " << data; + DEBUG_LOG(m_logger) << "onDataChanged ... " << data; if (modType != DataModification::eRemoved && data.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.h index 31562e916..7f3f06771 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_dialog.h @@ -37,6 +37,7 @@ public: void retranslate() override; bool init(LtsSession::LtsSession *session); protected: +NGL::INGLLogger &m_logger; bool apply() override; void dialogCanceled() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.cpp index e21fad93d..bd87634c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.cpp @@ -117,11 +117,11 @@ void CollapseExpandParticipantWidget::apply() sl.reserve(m_currentSymbolAppearance.colExpand.hiddenParticipantIds.size()); for (int i : std::as_const(m_currentSymbolAppearance.colExpand.hiddenParticipantIds)) sl += QString::number(i); - DEBUG_LOG() << "Hidden participant ids: " << sl.join(QLatin1Char(' ')); + DEBUG_LOG(m_logger) << "Hidden participant ids: " << sl.join(QLatin1Char(' ')); sl.clear(); for (int i : std::as_const(m_currentSymbolAppearance.colExpand.collapsedParticipantIds)) sl += QString::number(i); - DEBUG_LOG() << "Collapsed participant ids: " << sl.join(QLatin1Char(' ')); + DEBUG_LOG(m_logger) << "Collapsed participant ids: " << sl.join(QLatin1Char(' ')); } m_symbolAppearanceSettings->setSettings(m_currentSymbolAppearance, SymbolAppearanceSettings::Part::CollapseExpand); @@ -250,7 +250,7 @@ void CollapseExpandParticipantWidget::onDataChanged(const std::shared_ptrsettings(); m_symbolAppearanceSettings = newFilter; - DEBUG_LOG() << "onDataChanged ... " << QJsonDocument(newFilter->settingsToJson()).toJson(); + DEBUG_LOG(m_logger) << "onDataChanged ... " << QJsonDocument(newFilter->settingsToJson()).toJson(); collapseExpand(m_ui->tvParticipants->rootIndex()); m_model->setCheckStateForParticipants(m_originalSymbolAppearance.colExpand.hiddenParticipantIds, Qt::Unchecked); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.h index 5a283ff68..43bed7048 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_collapse_expand_participants_widget.h @@ -61,6 +61,8 @@ private slots: void showContextMenu(const QPoint &position); private: + +NGL::INGLLogger &m_logger; void collapseExpand(const QModelIndex &idx); QSet collapsedParticipants(const QModelIndex &idx) const; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.cpp index 52f4563ac..26e41f961 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.cpp @@ -122,7 +122,7 @@ QVector InterfaceImpl::getActions() void InterfaceImpl::onSymbolAppearanceChanged(const FilterManagement::SymbolAppearance &data, DataModification mod) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; auto it = m_symbolAppearanceMap.find(FilterKey{data.operatorId(), data.ctx()}); if (it != m_symbolAppearanceMap.end()) @@ -143,13 +143,13 @@ void InterfaceImpl::onSymbolAppearanceChanged(const FilterManagement::SymbolAppe m_symbolAppearanceMap.erase(it); } } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } std::shared_ptr InterfaceImpl::symbolAppearanceForOperator(int operatorId, const QString &context) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << ", operatorId=" << operatorId << ", context=" << context << ", m_session->toString " << m_session->toString(); @@ -198,7 +198,7 @@ std::shared_ptr InterfaceImpl::symbolAppearanceForOper m_symbolAppearanceMap[FilterKey(operatorId, context.toStdString())] = ret; } - TRACE_LOG() << Q_FUNC_INFO << " END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << ", operatorId=" << operatorId << ", context=" << context; return ret; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.h index 27a2c9bc0..c3590fa1a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_participant_gui_plugin.h @@ -53,6 +53,8 @@ private slots: private: + +NGL::INGLLogger &m_logger; struct FilterKey { int operatorId = 0; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.cpp index 860a8a59a..a3f876a86 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.cpp @@ -37,14 +37,14 @@ SymbolAppearanceDialog::~SymbolAppearanceDialog() bool SymbolAppearanceDialog::init(LtsSession::LtsSession *session) { - TRACE_LOG() << Q_FUNC_INFO << " m_session = " << session->toString(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " m_session = " << session->toString(); m_session = session; if (!session->getForeignGuiInterface(m_fltParticipantGuiIfc) || !session->getDtc(m_fltDtc) || !session->getFtc(m_fltFtc)) { - WARNING_LOG() << "Can not use Filter Management"; + WARNING_LOG(m_logger) << "Can not use Filter Management"; return false; } @@ -66,7 +66,7 @@ bool SymbolAppearanceDialog::init(LtsSession::LtsSession *session) std::shared_ptr ppmDtc; if (!session->getDtc(ppmDtc)) { - WARNING_LOG() << "Can not get data interface for ParticipantManagement"; + WARNING_LOG(m_logger) << "Can not get data interface for ParticipantManagement"; return false; } QMap parties; @@ -167,18 +167,18 @@ void SymbolAppearanceDialog::onExportButtonClicked() saveObject[QStringLiteral("content")] = s->settingsToJson(); const QJsonDocument saveDoc(saveObject); - DEBUG_LOG() << "Saving: " << saveDoc.toJson(); + DEBUG_LOG(m_logger) << "Saving: " << saveDoc.toJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), saveDoc.toJson(QJsonDocument::Compact)); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void SymbolAppearanceDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::FLTSymbolAppearance)); @@ -197,7 +197,7 @@ void SymbolAppearanceDialog::onImportButtonClicked() else { const QJsonDocument loadDoc(QJsonDocument::fromJson(content)); - DEBUG_LOG() << "Loading: " << loadDoc.toJson(); + DEBUG_LOG(m_logger) << "Loading: " << loadDoc.toJson(); m_widget->filter()->setSettings(loadDoc.object().value(QStringLiteral("content")).toObject(), FilterManagement::SymbolAppearanceSettings::Part::Symbol); const SymbolAppearance symbolAppearance = m_widget->filter()->settingsToData(); @@ -214,7 +214,7 @@ void SymbolAppearanceDialog::onImportButtonClicked() void SymbolAppearanceDialog::onUnknownChangesRecognized() { - DEBUG_LOG() << " onUnknownChangesRecognized() "; + DEBUG_LOG(m_logger) << " onUnknownChangesRecognized() "; m_widget->updateGuiToFilter(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.h index 704cad23b..06b6986d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_dialog.h @@ -37,6 +37,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; bool apply() override; void dialogCanceled() override; void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.cpp index de66bc9a6..a8a53f225 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.cpp @@ -367,13 +367,13 @@ void SymbolAppearanceWidget::onSymbolAppearanceSettingsChanged(SymbolAppearanceS { Q_UNUSED(part); - DEBUG_LOG() << Q_FUNC_INFO << " START, m_doUpdateViaCallback=" << m_doUpdateViaCallback; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, m_doUpdateViaCallback=" << m_doUpdateViaCallback; if (m_doUpdateViaCallback) { updateGuiToFilter(); emit unknownChangesRecognized(); } - DEBUG_LOG() << Q_FUNC_INFO << " END, m_doUpdateViaCallback=" << m_doUpdateViaCallback; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, m_doUpdateViaCallback=" << m_doUpdateViaCallback; } void SymbolAppearanceWidget::updateGuiToFilter() @@ -513,7 +513,7 @@ void SymbolAppearanceWidget::onDataChanged(const std::shared_ptrsettings(); m_symbolAppearanceSettings = newFilter; - DEBUG_LOG() << "onDataChanged ... " << QJsonDocument(newFilter->settingsToJson()).toJson(); + DEBUG_LOG(m_logger) << "onDataChanged ... " << QJsonDocument(newFilter->settingsToJson()).toJson(); setSymbolAppearanceSettings(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.h index 61925f33f..e606bbca8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_symbol_appearance_widget.h @@ -68,6 +68,8 @@ private slots: void readUpdateFilterFromUi(); private: + +NGL::INGLLogger &m_logger; void setSymbolAppearanceSettings(); void buildPartyTable(const QMap &parties); static void fillCbSymbolVisibility(QComboBox *cbx, int defaultValue = 0); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.cpp index 456fa1946..ea894c723 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.cpp @@ -55,13 +55,13 @@ bool TypeFilterDialog::init(LtsSession::LtsSession *session) !session->getDtc(m_fltDtc) || !session->getFtc(m_fltFtc)) { - WARNING_LOG() << "Can not use Filter Management"; + WARNING_LOG(m_logger) << "Can not use Filter Management"; return false; } if (!session->getDtc(ppmDtc)) { - WARNING_LOG() << "Can not get data interface for Participant Management"; + WARNING_LOG(m_logger) << "Can not get data interface for Participant Management"; return false; } @@ -167,18 +167,18 @@ void TypeFilterDialog::onExportButtonClicked() saveObject[QStringLiteral("content")] = s->settingsToJson(); const QJsonDocument saveDoc(saveObject); - DEBUG_LOG() << "Saving: " << saveDoc.toJson(); + DEBUG_LOG(m_logger) << "Saving: " << saveDoc.toJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), saveDoc.toJson(QJsonDocument::Compact)); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void TypeFilterDialog::onImportButtonClicked() { - DEBUG_LOG() << " onImportButtonClicked() "; + DEBUG_LOG(m_logger) << " onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, m_session->exerciseId(), FileManagement::toString(FileManagement::XmlType::FLTTypeFilter)); @@ -197,7 +197,7 @@ void TypeFilterDialog::onImportButtonClicked() else { const QJsonDocument loadDoc(QJsonDocument::fromJson(content)); - DEBUG_LOG() << "Loading: " << loadDoc.toJson(); + DEBUG_LOG(m_logger) << "Loading: " << loadDoc.toJson(); m_widget->filter()->setSettings(loadDoc.object().value(QStringLiteral("content")).toObject(), FilterManagement::SymbolAppearanceSettings::Part::Types); const SymbolAppearance symbolAppearance = m_widget->filter()->settingsToData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.h index 0ff806678..3e99e17f7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_dialog.h @@ -31,6 +31,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; bool apply() override; void dialogCanceled() override; void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_widget.h index 58fc6c2ca..3cc749989 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/FilterManagement/Gui/Participant/flt_type_filter_widget.h @@ -46,6 +46,8 @@ Q_SIGNALS: void typeFilterChanged(); private: + +NGL::INGLLogger &m_logger; void initTypeClassElements(bool ocMode); void initStateElements(); void setSymbolAppearanceSettings(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/InfoDialog/gim_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/InfoDialog/gim_info_dialog.h index d83e72bd8..90d4d5b72 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/InfoDialog/gim_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/InfoDialog/gim_info_dialog.h @@ -44,6 +44,8 @@ public: const std::shared_ptr &asbIfc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void showIedInfos(); void setPosition(const IedPosition &pos); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.cpp index 33b05033c..0a70792e2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.cpp @@ -47,21 +47,21 @@ bool PairingEditDialog::init(LtsSession::LtsSessionDataDds *session) m_sessionData->getDtc(m_dtc); if (!m_dtc || !m_dtc->enableIed()) { - ERROR_LOG() << "could not enable Ied DDS-objects in GuezIedManagement DTC "; + ERROR_LOG(m_logger) << "could not enable Ied DDS-objects in GuezIedManagement DTC "; return false; } m_sessionData->getFtc(m_ftc); if (!m_ftc || !m_ftc->enablePairIed()) { - ERROR_LOG() << "could not enable pair Ied DDS-Function in GuezIedManagement FTC "; + ERROR_LOG(m_logger) << "could not enable pair Ied DDS-Function in GuezIedManagement FTC "; return false; } m_sessionData->getDtc(m_ppmDtc); if (!m_ppmDtc || !m_ppmDtc->enableParticipant()) { - ERROR_LOG() << "could not enable Participant DDS-objects in ParticipantManagement DTC "; + ERROR_LOG(m_logger) << "could not enable Participant DDS-objects in ParticipantManagement DTC "; return false; } @@ -131,7 +131,7 @@ void PairingEditDialog::onIedChanged(const Ied &data, DataModification modType) void PairingEditDialog::onParticipantSelected(const QModelIndex &idx) { - DEBUG_LOG() << "Index of Item: " << idx.row() << " " << idx.column(); + DEBUG_LOG(m_logger) << "Index of Item: " << idx.row() << " " << idx.column(); if (checkSelectedParticipantType()) { Ied ied = m_dtc->ied(m_ui->cbxIed->currentData().toInt()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.h index e68dc8192..832bf31fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezIedManagement/Gui/PairingEdit/gim_pairing_edit_dialog.h @@ -51,6 +51,8 @@ private slots: void onPrint(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/assign_gna_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/assign_gna_dialog.cpp index d4f4bc0f4..354f6cd80 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/assign_gna_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/assign_gna_dialog.cpp @@ -94,7 +94,7 @@ void AssignGuezNasatPartDialog::retranslate() bool AssignGuezNasatPartDialog::apply() { - INFO_LOG() << "AssignGuezNasatPartDialog::apply()"; + INFO_LOG(m_logger) << "AssignGuezNasatPartDialog::apply()"; int32_t participantId = m_ui->cmbParticipants->currentData().toInt(); int32_t nasatAircraftId = m_ui->cmbNasats->currentData().toInt(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/gna_part_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/gna_part_dialog.cpp index 07fa2edfd..d68eb9988 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/gna_part_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/AssignNasat/gna_part_dialog.cpp @@ -45,7 +45,7 @@ bool GuezNasatPartDialog::init(const std::shared_ptr m_exmDtc = exmDtc; m_ppmDtc = ppmDtc; - INFO_LOG() << "GuezNasatPartDialog::init"; + INFO_LOG(m_logger) << "GuezNasatPartDialog::init"; m_nasatAircraftParticipantModel = new GuezNasat::NasatAircraftParticipantModel(this); m_nasatAircraftParticipantModel->initModel(m_dtc, m_exmDtc, m_ppmDtc, ppmGuiCbxIfc, m_session); m_ui->widget->setModel(m_nasatAircraftParticipantModel); @@ -89,11 +89,11 @@ void GuezNasatPartDialog::retranslate() void GuezNasatPartDialog::onNewAircraftPart() { - INFO_LOG() << "onNewAircraft"; + INFO_LOG(m_logger) << "onNewAircraft"; AssignGuezNasatPartDialog *assignGuezNasatPartDialog = new AssignGuezNasatPartDialog(m_session->exerciseId(), this); if (!assignGuezNasatPartDialog->init(m_ftc, m_nasatAircraftParticipantModel)) { - ERROR_LOG() << QLatin1String("Can't initialize AssignGuezNasatPartDialog!"); + ERROR_LOG(m_logger) << QLatin1String("Can't initialize AssignGuezNasatPartDialog!"); delete assignGuezNasatPartDialog; return; } @@ -107,11 +107,11 @@ void GuezNasatPartDialog::onEditAircraftPart() const QModelIndex curIdx = m_ui->widget->currentIndex(); if (!curIdx.isValid()) return; - INFO_LOG() << "onEditAircraft"; + INFO_LOG(m_logger) << "onEditAircraft"; AssignGuezNasatPartDialog *assignGuezNasatPartDialog = new AssignGuezNasatPartDialog(m_session->exerciseId(), this); if (!assignGuezNasatPartDialog->init(m_ftc, m_nasatAircraftParticipantModel, m_nasatAircraftParticipantModel->getRowData(curIdx.row()))) { - ERROR_LOG() << QLatin1String("Can't initialize assignGuezNasatPartDialog!"); + ERROR_LOG(m_logger) << QLatin1String("Can't initialize assignGuezNasatPartDialog!"); delete assignGuezNasatPartDialog; return; } @@ -130,7 +130,7 @@ void GuezNasatPartDialog::onRemoveAircraftPart() const QModelIndex curIdx = m_ui->widget->currentIndex(); if (!curIdx.isValid()) return; - INFO_LOG() << "onRemoveNewAircraft"; + INFO_LOG(m_logger) << "onRemoveNewAircraft"; NasatAircraftParticipant req; req.id(m_nasatAircraftParticipantModel->getRowData(curIdx.row()).id()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_model.cpp index 66cb2048f..f56ac27e9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_model.cpp @@ -42,7 +42,7 @@ bool NasatAircraftModel::initModel(const std::shared_ptr m_dtc; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_part_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_part_model.cpp index 43b160130..022dd838a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_part_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/Common/gna_nasat_aircraft_part_model.cpp @@ -39,7 +39,7 @@ bool NasatAircraftParticipantModel::initModel(const std::shared_ptr nasatAircraftParticipants = m_dtc->nasatAircraftParticipants(); - INFO_LOG() << "initModel - #NasatAircraftParticipantModel: " << nasatAircraftParticipants.size() ; + INFO_LOG(m_logger) << "initModel - #NasatAircraftParticipantModel: " << nasatAircraftParticipants.size() ; connect(m_dtc.get(), &Interface::Dtc::nasatAircraftParticipantChanged, this, &NasatAircraftParticipantModel::onNasatAircraftParticipantChanged); @@ -83,7 +83,7 @@ bool NasatAircraftParticipantModel::initModel(const std::shared_ptr m_dtc; std::shared_ptr m_exm_dtc; std::shared_ptr m_ppm_dtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/ConfigNasat/gna_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/ConfigNasat/gna_dialog.cpp index cbe92e068..810d67eb2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/ConfigNasat/gna_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/GuezNasat/Gui/ConfigNasat/gna_dialog.cpp @@ -35,7 +35,7 @@ bool GuezNasatDialog::init(const std::shared_ptr &ftc m_ftc = ftc; m_dtc = dtc; - INFO_LOG() << "GuezNasatDialog::init"; + INFO_LOG(m_logger) << "GuezNasatDialog::init"; m_nasatAircraftModel = new GuezNasat::NasatAircraftModel(this); m_nasatAircraftModel->initModel(m_dtc); m_ui->widget->setModel(m_nasatAircraftModel); @@ -74,11 +74,11 @@ void GuezNasatDialog::retranslate() void GuezNasatDialog::onNewAircraft() { - INFO_LOG() << "onNewAircraft"; + INFO_LOG(m_logger) << "onNewAircraft"; NewGuezNasatDialog *newGuezNasatDialog = new NewGuezNasatDialog(this); if (!newGuezNasatDialog->init(m_ftc)) { - ERROR_LOG() << "Can't initialize NewGuezNasatDialog!"; + ERROR_LOG(m_logger) << "Can't initialize NewGuezNasatDialog!"; delete newGuezNasatDialog; return; } @@ -93,11 +93,11 @@ void GuezNasatDialog::onEditAircraft() if (!curIdx.isValid()) return; - INFO_LOG() << "onEditAircraft"; + INFO_LOG(m_logger) << "onEditAircraft"; NewGuezNasatDialog *editGuezNasatDialog = new NewGuezNasatDialog(this); if (!editGuezNasatDialog->init(m_ftc, m_nasatAircraftModel->getRowData(curIdx.row()))) { - ERROR_LOG() << "Can't initialize NewGuezNasatDialog!"; + ERROR_LOG(m_logger) << "Can't initialize NewGuezNasatDialog!"; delete editGuezNasatDialog; return; } @@ -117,7 +117,7 @@ void GuezNasatDialog::onRemoveAircraft() if (!curIdx.isValid()) return; - INFO_LOG() << "onRemoveNewAircraft"; + INFO_LOG(m_logger) << "onRemoveNewAircraft"; NasatAircraft req; req.id(m_nasatAircraftModel->getRowData(curIdx.row()).id()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.cpp index fecc7ce50..1d325edcc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.cpp @@ -49,7 +49,7 @@ void ForeignInterfaceImpl::enableIsmForeignInterface() const if (!m_mountingPoints.isEmpty()) { - DEBUG_LOG() << Q_FUNC_INFO << " START, ismDataDtc, m_exerciseId = " << m_exerciseId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, ismDataDtc, m_exerciseId = " << m_exerciseId << " already initialized -> return"; return; } @@ -117,7 +117,7 @@ MainSchedule ForeignInterfaceImpl::mainSchedule(int32_t scheduleId) void ForeignInterfaceImpl::setScheduleId(int32_t scheduleId) { - DEBUG_LOG() << "setScheduleId to: " << scheduleId + DEBUG_LOG(m_logger) << "setScheduleId to: " << scheduleId << " (was " << m_scheduleId << ")"; enableIsmForeignInterface(); @@ -183,7 +183,7 @@ void ForeignInterfaceImpl::onMainStructureElementChanged(const MainStructureElem const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) - WARNING_LOG() << "Invalid properties for MSE " << data.id() << ", " << data.name(); + WARNING_LOG(m_logger) << "Invalid properties for MSE " << data.id() << ", " << data.name(); else { const QJsonArray exercises(QJsonObject(doc.object()).value(QStringLiteral("available_in_exercise")).toArray()); @@ -221,7 +221,7 @@ void ForeignInterfaceImpl::onMainStructureElementChanged(const MainStructureElem if (realChange) { - DEBUG_LOG() << Q_FUNC_INFO << " m_bldgsInExcersise updated." + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_bldgsInExcersise updated." << " (mseId=" << mseId << " name=" << data.name(); emit buildingsInCurrentExerciseChanged(); } @@ -247,7 +247,7 @@ void ForeignInterfaceImpl::onMainStructureElementChanged(const MainStructureElem if (!m_dtc->getStructureElementById(curPath[1], seFloor)) - WARNING_LOG() << " getStructureElementById failed for " << curPath[1]; + WARNING_LOG(m_logger) << " getStructureElementById failed for " << curPath[1]; } @@ -268,7 +268,7 @@ void ForeignInterfaceImpl::onMainStructureElementChanged(const MainStructureElem mountingPointRef.updateData(currentStructEle, floorId); emit mountingPointChanged(mountingPointRef, DataModification::eModified); } else { - DEBUG_LOG() << "New Mounting point with id " << currentStructEle.id() + DEBUG_LOG(m_logger) << "New Mounting point with id " << currentStructEle.id() << " and type " << currentStructEle.mountingPointTypeId() << " (type " << currentStructEle.mountingPointTypeId().underlying() << ")" << " subid: " << currentStructEle.mountingPointId() << this; @@ -294,7 +294,7 @@ void ForeignInterfaceImpl::onMountingPointAssetChanged(const MountingPointAsset { const int32_t structureElementId = data.structureElementId(); - DEBUG_LOG() << "onMountingPointAssetChanged se id: " << structureElementId << ", assetId: " << data.assetId(); + DEBUG_LOG(m_logger) << "onMountingPointAssetChanged se id: " << structureElementId << ", assetId: " << data.assetId(); @@ -366,7 +366,7 @@ void ForeignInterfaceImpl::onMainScheduleChanged(const MainSchedule &data, DataM void ForeignInterfaceImpl::init() { - DEBUG_LOG() << Q_FUNC_INFO << " START, ismDataDtc, m_exerciseId = " << m_exerciseId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, ismDataDtc, m_exerciseId = " << m_exerciseId << " - m_mountingPoints.size()=" << m_mountingPoints.size() << ", (m_mountingPointAssetMap.size()=" << m_mountingPointAssetMap.size() << ")"; @@ -425,12 +425,12 @@ void ForeignInterfaceImpl::init() int firstBldg = -1; if (!m_bldgsInExcersise.isEmpty()) firstBldg = *m_bldgsInExcersise.begin(); - DEBUG_LOG() << Q_FUNC_INFO << ", exerciseId = " << m_exerciseId << ", bldgs in excersise = " << m_bldgsInExcersise.size() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", exerciseId = " << m_exerciseId << ", bldgs in excersise = " << m_bldgsInExcersise.size() << ", firstBldg: " << firstBldg; - DEBUG_LOG() << Q_FUNC_INFO << "XXXXX" << m_bldgsInExcersise.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "XXXXX" << m_bldgsInExcersise.size(); - DEBUG_LOG() << Q_FUNC_INFO << " END, ismDataDtc, m_exerciseId = " << m_exerciseId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, ismDataDtc, m_exerciseId = " << m_exerciseId << " - m_mountingPoints.size()=" << m_mountingPoints.size() << ", (m_mountingPointAssetMap.size()=" << m_mountingPointAssetMap.size() << ")"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.h index f4eac987a..0feaf80f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Data/ism_foreign_data_plugin.h @@ -53,6 +53,8 @@ private Q_SLOTS: void onMainScheduleChanged(const InfrastructureManagement::MainSchedule &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; void init(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.cpp index e57d32742..c5011aba2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.cpp @@ -73,7 +73,7 @@ bool SetRecordingDialog::init(const std::shared_ptr &ismDtc, con if (!(m_ismDtc->enableMainStructureElement() && m_ismFtc->enableMainStructureElementModify())) { - ERROR_LOG() << "Could not enable ISM topics"; + ERROR_LOG(m_logger) << "Could not enable ISM topics"; return false; } @@ -88,7 +88,7 @@ bool SetRecordingDialog::init(const std::shared_ptr &ismDtc, con { delete m_model; m_model = nullptr; - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.h index 0161eae88..28fc79807 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog.h @@ -41,6 +41,8 @@ public: void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector &roles); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.cpp index 698c23d7f..d0a7b1fe2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.cpp @@ -13,8 +13,8 @@ namespace InfrastructureManagement { -SetRecordingDialogModel::SetRecordingDialogModel(QObject *parent) - : NGLTreeModel(parent, new NGLTreeItem(QVariant()), { tr("Name") }) +SetRecordingDialogModel::SetRecordingDialogModel(QObject *parent) : NGLTreeModel(parent, new NGLTreeItem(QVariant()),, + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { tr("Name") }) , m_dtc(nullptr) { } @@ -53,7 +53,7 @@ bool SetRecordingDialogModel::initModel(const std::shared_ptr &d if (!(m_dtc->enableMainStructureElement() && m_dtc->enableMountingPointAsset())) { - ERROR_LOG() << "Could not enable Datatopics"; + ERROR_LOG(m_logger) << "Could not enable Datatopics"; return false; } @@ -62,7 +62,7 @@ bool SetRecordingDialogModel::initModel(const std::shared_ptr &d connect(m_dataInterface.get(), &ForeignDataInterface::mountingPointChanged, this, &SetRecordingDialogModel::onMountingPointChanged); - INFO_LOG() << "initModel successfull"; + INFO_LOG(m_logger) << "initModel successfull"; initData(); @@ -121,7 +121,7 @@ void SetRecordingDialogModel::initData() if(mapGroup.contains(groupId)) continue; const QString sectionText = InfrastructureManagement::toString(static_cast(groupId)); - DEBUG_LOG()<<" >> Adding section >> "<> Adding section >> "<appendChild(mapGroup.value(groupId)); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.h index c33ee6b47..92fdfcf43 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/AudioVideoConfig/SetRecording/ism_set_recording_dialog_model.h @@ -55,6 +55,8 @@ public Q_SLOTS: void onMountingPointChanged(const MountingPoint &mountingPoint, DataModification modType); private: + +NGL::INGLLogger &m_logger; static SimpleRecordingData toSimpleRecordingData(const MountingPoint &mountingPoint); static SimpleRecordingData toSimpleRecordingData(const StructureElement &mountingPoint); static bool hasCorrectType(const MountingPoint &mountingPoint); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.cpp index b5d1357fd..f0f485596 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.cpp @@ -56,19 +56,19 @@ bool ExerciseAssignmentDialog::init(const std::shared_ptr &ismDt if (!m_ismFtc->enableInstrumentationAssetModify()) { - ERROR_LOG() << "Could not enable FT InstrumentationAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT InstrumentationAssetModify of ISM"; return false; } if (!m_ismFtc->enableMainStructureElementModify()) { - ERROR_LOG() << "Could not enable FT MainStructureElementModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MainStructureElementModify of ISM"; return false; } if (!m_exmDtc->enableExercise()) { - ERROR_LOG() << "Could not enable DT Exercise of EXM"; + ERROR_LOG(m_logger) << "Could not enable DT Exercise of EXM"; return false; } @@ -83,7 +83,7 @@ bool ExerciseAssignmentDialog::init(const std::shared_ptr &ismDt m_model = new ExerciseAssignmentDialogModel(this); if (!m_model->initModel(m_ismDtc, m_exmDtc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_model; m_model = nullptr; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.h index d38bc82bd..866fe9b27 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog.h @@ -45,6 +45,8 @@ private Q_SLOTS: void onPrint(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.cpp index ad881c33f..252be9324 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.cpp @@ -46,7 +46,7 @@ QVariant ExerciseAssignmentDialogModel::data(const QModelIndex &index, int role) if (parseError.error != QJsonParseError::NoError) { - INFO_LOG() << "Could not parse JSON props of building with ID " + INFO_LOG(m_logger) << "Could not parse JSON props of building with ID " << currentMainStructureElement.id() << ". Reason: " << parseError.errorString() @@ -83,13 +83,13 @@ bool ExerciseAssignmentDialogModel::initModel(const std::shared_ptrenableInstrumentationAsset()) { - ERROR_LOG() << "Could not enable Datatopic InstrumentationAsset of the Data Topic Client"; + ERROR_LOG(m_logger) << "Could not enable Datatopic InstrumentationAsset of the Data Topic Client"; return false; } if (!m_exmDtc->enableExercise()) { - ERROR_LOG() << "Could not enable Topic Exercise from Exercise Management DTC"; + ERROR_LOG(m_logger) << "Could not enable Topic Exercise from Exercise Management DTC"; return false; } @@ -102,7 +102,7 @@ bool ExerciseAssignmentDialogModel::initModel(const std::shared_ptrmainStructureElements(cb); - INFO_LOG() << "initModel successful"; + INFO_LOG(m_logger) << "initModel successful"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.h index 28bebbef7..0e4e954c2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ExerciseAssignmentClassic/ism_exercise_assignment_dialog_model.h @@ -25,6 +25,8 @@ public: bool initModel(const std::shared_ptr &dtc, const std::shared_ptr &exmDtc); protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const InfrastructureManagement::MainStructureElement &data, DataModification modType) const override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.cpp index 6c0583ca3..388fa6d27 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.cpp @@ -53,7 +53,7 @@ bool ApproachingPointsDialog::init(const std::shared_ptr &dtc, m_model = new ApproachingPointsDialogModel(this); if (!m_model->initModel(dtc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_model; m_model = nullptr; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.h index d10348832..12149612d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog.h @@ -49,6 +49,8 @@ private Q_SLOTS: void onAddApproachingPoint(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.cpp index f4b5e2c17..dd999c703 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.cpp @@ -66,7 +66,7 @@ bool ApproachingPointsDialogModel::initModel(const std::shared_ptrmainStructureElements(cb); - INFO_LOG() << "initModel successful"; + INFO_LOG(m_logger) << "initModel successful"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.h index 24aeffc90..23dc7265a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_approaching_point_list_dialog_model.h @@ -32,6 +32,8 @@ public: }; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const InfrastructureManagement::MainStructureElement &data, DataModification modType) const override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_edit_approaching_point_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_edit_approaching_point_dialog.h index 3f36d7529..9241f6585 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_edit_approaching_point_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ApproachingPoints/ism_edit_approaching_point_dialog.h @@ -49,6 +49,8 @@ private slots: void getPosition(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void fillCbDepartureDirection(); void setData(const MainStructureElement &approachingPoint); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.cpp index 99e616dc6..50747e7ef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.cpp @@ -265,7 +265,7 @@ InstrumentationAsset AssetListDialog::importData(const QVector &segm { if (bOk) *bOk = false; - WARNING_LOG() << "Could not determine mounting point type from barcode: " << dmc.toString(); + WARNING_LOG(m_logger) << "Could not determine mounting point type from barcode: " << dmc.toString(); } return asset; @@ -411,40 +411,40 @@ bool AssetListDialog::init(const std::shared_ptr &dtc, if (!m_ftc->enableStructureElementModify()) { - ERROR_LOG() << "Could not enable FT StructureElementModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT StructureElementModify of ISM"; return false; } if (!m_ftc->enableMountingPointAssetModify()) { - ERROR_LOG() << "Could not enable FT MountingPointAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MountingPointAssetModify of ISM"; return false; } if (!m_ftc->enableMountingPointAssetRemove()) { - ERROR_LOG() << "Could not enable FT MountingPointAssetRemove of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MountingPointAssetRemove of ISM"; return false; } if (!m_ftc->enableInstrumentationAssetModify()) { - ERROR_LOG() << "Could not enable FT InstrumentationAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT InstrumentationAssetModify of ISM"; return false; } if (!m_ftc->enableInstrumentationAssetUnmount()) { - ERROR_LOG() << "Could not enable FT InstrumentationAssetUnmount of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT InstrumentationAssetUnmount of ISM"; return false; } if (!m_cmoFtc->enableTriggerUpdate()) { - ERROR_LOG() << "Could not enable FT TriggerUpdate of CMO"; + ERROR_LOG(m_logger) << "Could not enable FT TriggerUpdate of CMO"; return false; } if(m_ftc->enableInstrumentationAssetSetState() == false) { - ERROR_LOG()<<"Couldn't enable InstrumentationAssetSetState"; + ERROR_LOG(m_logger)<<"Couldn't enable InstrumentationAssetSetState"; return false; } @@ -455,7 +455,7 @@ bool AssetListDialog::init(const std::shared_ptr &dtc, if (!m_model->initModel(m_dtc, m_cmoDtc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_model; m_model = nullptr; return false; @@ -610,7 +610,7 @@ void AssetListDialog::onImportClicked() QVector segments = line.splitRef(QLatin1Char(';')); if (segments.size() < 10) { - WARNING_LOG() << "Skipping line '" << line << "' - to few data"; + WARNING_LOG(m_logger) << "Skipping line '" << line << "' - to few data"; continue; } const InstrumentationAsset ia = importData(segments, &bOk); @@ -649,7 +649,7 @@ void AssetListDialog::onExportClicked() AssetFilterDialog *filterDialog = new AssetFilterDialog(m_model, this); if (!filterDialog->init(m_ui->assetListView->selectionModel()->selectedRows().size() > 0)) { - ERROR_LOG() << "Unexpected error"; + ERROR_LOG(m_logger) << "Unexpected error"; return; } filterDialog->fillAssetComboBoxes(); @@ -678,7 +678,7 @@ void AssetListDialog::onUnmountButtonClicked() StructureElement se; if(m_dtc->getStructureElementInMntPointAssetByAssetId(asset.id(), se) == false) { - WARNING_LOG()<<" asset not mounted. name: "<hasRequests() && m_requestHelper->startRequests() == false) { - ERROR_LOG()<<" Couldn't unmount selected assets"; + ERROR_LOG(m_logger)<<" Couldn't unmount selected assets"; } m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Load,false); @@ -753,7 +753,7 @@ void AssetListDialog::onFilterSelected(const AssetFilterDialog::Export &exp, con void AssetListDialog::onCustomContextMenuRequested(const QPoint &globalPos, const QModelIndex &indexSrc) { - DEBUG_LOG() << Q_FUNC_INFO << " START, indexSrc" << indexSrc.row(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, indexSrc" << indexSrc.row(); if (!indexSrc.isValid()) return; @@ -777,7 +777,7 @@ void AssetListDialog::onReachabilityUpdateAction() if (bhasHostnameForTriggerUpdate) { m_hostsForUpdate.insert(QString::fromStdString(ia.hostname())); - DEBUG_LOG() << Q_FUNC_INFO << " trigger update for " << ia; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " trigger update for " << ia; } } @@ -786,7 +786,7 @@ void AssetListDialog::onReachabilityUpdateAction() void AssetListDialog::onHostsForUpdateNotifyTimeout() { - INFO_LOG() << Q_FUNC_INFO << " START, hostsForUpdate.size() = " << m_hostsForUpdate.size(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, hostsForUpdate.size() = " << m_hostsForUpdate.size(); if (!m_cmoFtc) return; @@ -794,7 +794,7 @@ void AssetListDialog::onHostsForUpdateNotifyTimeout() return; for (auto item : std::as_const(m_hostsForUpdate)) - DEBUG_LOG() << Q_FUNC_INFO << " host = " << item; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " host = " << item; std::vector hostnameStd; @@ -806,7 +806,7 @@ void AssetListDialog::onHostsForUpdateNotifyTimeout() ComponentMonitor::TriggerUpdate request; request.hostnames(hostnameStd); - DEBUG_LOG() << Q_FUNC_INFO << " TriggerUpdate - request = " << request; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " TriggerUpdate - request = " << request; m_requestHelper->addRequest([request, this]() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.h index b10ecf8a0..c428f7710 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog.h @@ -74,6 +74,8 @@ public: void onInstrumentationAssetChanged(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog_model.cpp index 4bcda456f..8647dd61a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_asset_list_dialog_model.cpp @@ -310,12 +310,12 @@ bool AssetListDialogModel::initModel(const std::shared_ptr &dtc, if (!m_dtc->enableInstrumentationAsset()) { - ERROR_LOG() << "Could not enable Datatopic InstrumentationAsset of the Data Topic Client"; + ERROR_LOG(m_logger) << "Could not enable Datatopic InstrumentationAsset of the Data Topic Client"; return false; } if (!m_cmoDtc->enableComponentStatus()) { - ERROR_LOG() << "Could not enable Datatopic enableComponentStatus of cmo"; + ERROR_LOG(m_logger) << "Could not enable Datatopic enableComponentStatus of cmo"; return false; } @@ -366,7 +366,7 @@ bool AssetListDialogModel::initModel(const std::shared_ptr &dtc, connect(this, &AssetListDialogModel::modelReset, this, &AssetListDialogModel::onUpdateFilter); onUpdateFilter(); - INFO_LOG() << "initModel successfull"; + INFO_LOG(m_logger) << "initModel successfull"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_edit_asset_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_edit_asset_dialog.h index ad281b021..f9a1f4732 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_edit_asset_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_edit_asset_dialog.h @@ -44,6 +44,7 @@ private slots: void slotSetAssetToDefect(); void slotClose(); private: +NGL::INGLLogger &m_logger; bool apply(const InstrumentationAssetState newState) ; Ui::EditAssetDialog *m_ui; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.cpp index 2fb6756ad..26e2a01a9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.cpp @@ -45,13 +45,13 @@ void SetPropertiesDialog::init() if (error.error != QJsonParseError::NoError) { - ERROR_LOG() << error.errorString(); + ERROR_LOG(m_logger) << error.errorString(); return; } if (!doc.isObject()) { - ERROR_LOG() << "Properties String is no JSON-Object"; + ERROR_LOG(m_logger) << "Properties String is no JSON-Object"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.h index 17d8b7db8..2de74d816 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/AssetList/ism_set_properties_dialog.h @@ -25,6 +25,8 @@ public: ~SetPropertiesDialog(); private: + +NGL::INGLLogger &m_logger; void init(); private Q_SLOTS: void onOkClicked(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.cpp index 157551d49..6ce7c4923 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.cpp @@ -46,13 +46,13 @@ ExerciseAssignmentDialog::ExerciseAssignmentDialog(LtsSession::LtsSession *sessi if (!m_ftc->enableMainStructureElementModify()) { - ERROR_LOG() << "Could not enable FT MainStructureElementModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MainStructureElementModify of ISM"; throw std::exception(); } if (!exmDtc->enableExercise()) { - ERROR_LOG() << "Could not enable DT Exercise of EXM"; + ERROR_LOG(m_logger) << "Could not enable DT Exercise of EXM"; throw std::exception(); } @@ -241,7 +241,7 @@ bool ExerciseAssignmentDialog::apply() } catch (...) { - ERROR_LOG() << "can't parse json for mseId " << ri.mseId << " and excId " << ri.exerciseId << " - using new json"; + ERROR_LOG(m_logger) << "can't parse json for mseId " << ri.mseId << " and excId " << ri.exerciseId << " - using new json"; Q_ASSERT(false); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.h index 3721726f0..5cfd60555 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog.h @@ -41,6 +41,8 @@ private slots: void onPrint(); private: + +NGL::INGLLogger &m_logger; void onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &mse, DataModification modType); void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_model.cpp index 534fe59f3..37b3aa07f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_model.cpp @@ -45,7 +45,7 @@ void ExerciseAssignmentDialogModel::addMse(int mseId, int sectionId, const QStri return; } } - ERROR_LOG() << "Did not find section with enum value " << sectionId; + ERROR_LOG(m_logger) << "Did not find section with enum value " << sectionId; return; } @@ -244,14 +244,13 @@ QVector ExerciseAssignmentDialogModel::getRequestInfos(bool all) c -TreeItem::TreeItem(int mseId, int sectionId, const QString &displayName, int exerciseId, TreeItem *parentItem) - : m_mseId(mseId) +TreeItem::TreeItem(int mseId, int sectionId, const QString &displayName, int exerciseId, TreeItem *parentItem) : m_mseId(mseId) , m_sectionId(sectionId) , m_displayName(displayName) , m_exerciseId(exerciseId) , m_originalExerciseId(exerciseId) - , m_parentItem(parentItem) -{ + , m_parentItem(parentItem), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_proxy_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_proxy_model.h index 7e9323966..457bc48dc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_proxy_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ExerciseAssignment/ism_exercise_assignment_dialog_proxy_model.h @@ -35,6 +35,8 @@ signals: void doRefilter(const QSet &setToExpand); protected: + +NGL::INGLLogger &m_logger; bool filterAcceptsRow(const int sourceRow, const QModelIndex &sourceParent) const override; bool lessThan(const QModelIndex &left, const QModelIndex &rioght) const override; QVariant headerData(int section, Qt::Orientation orientation, int role) const override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.cpp index 4faebba52..8adf91f4e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.cpp @@ -65,7 +65,7 @@ bool MountingPointInfoDialog::init(const std::shared_ptr &ismIfc, const std::shared_ptr &avmIfc) { - DEBUG_LOG() << "Initializing MountingPointInfoDialog ..."; + DEBUG_LOG(m_logger) << "Initializing MountingPointInfoDialog ..."; disconnect(); m_dtc = dtc; @@ -216,11 +216,11 @@ bool MountingPointInfoDialog::init(const std::shared_ptrgbxAsset->hide(); @@ -322,7 +322,7 @@ void MountingPointInfoDialog::removeAsset() void MountingPointInfoDialog::addAssetProperty(const QString &propName, const QString &propValue) { - DEBUG_LOG() << "Adding asset property " + DEBUG_LOG(m_logger) << "Adding asset property " << propName << ':' << propValue; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.h index fd145c6b4..e4b47048f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointInfo/ism_mounting_point_info_dialog.h @@ -40,6 +40,8 @@ private Q_SLOTS: void onAnnouncement() const; private: + +NGL::INGLLogger &m_logger; void retranslate() override; void showAsset(const InfrastructureManagement::InstrumentationAsset &asset); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.cpp index f660fe1ca..0f47dbf13 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.cpp @@ -70,17 +70,17 @@ MountingPointListDialog::MountingPointListDialog(const QString &menuGroup, QWidg , m_scheduleId(-1) , m_ui(new Ui::MountingPointListDialog) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); setOnlineHelpFilename(QStringLiteral("Ressourcen-Mounting_Point_List")); m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &MountingPointListDialog::onPrint); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } MountingPointListDialog::~MountingPointListDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_mapGuiInterface->removeObjectIndicator(); m_mapGuiInterface->setSkipMapObjectSelectionDialog(false); @@ -95,7 +95,7 @@ MountingPointListDialog::~MountingPointListDialog() delete m_ui; delete m_ddsSelector; delete m_requestHelper; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void MountingPointListDialog::retranslate() @@ -112,7 +112,7 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, const std::shared_ptr &mapIfc, const std::shared_ptr fltBuildingComponentIfc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_dtc = dtc; m_ftc = ftc; m_dataIfc = dataInterface; @@ -126,43 +126,43 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, if (!m_ftc->enableInstrumentationAssetModify()) { - ERROR_LOG() << "Could not enable FT InstrumentationAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT InstrumentationAssetModify of ISM"; return false; } if (!m_ftc->enableInstrumentationAssetModify()) { - ERROR_LOG() << "Could not enable FT enableInstrumentationAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT enableInstrumentationAssetModify of ISM"; return false; } if (!m_ftc->enableInstrumentationAssetRemove()) { - ERROR_LOG() << "Could not enable FT enableInstrumentationAssetRemove of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT enableInstrumentationAssetRemove of ISM"; return false; } if (!m_ftc->enableInstrumentationAssetUnmount()) { - ERROR_LOG() << "Could not enable FT enableInstrumentationAssetUnmount of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT enableInstrumentationAssetUnmount of ISM"; return false; } if (!m_ftc->enableMountingPointAssetModify()) { - ERROR_LOG() << "Could not enable FT MountingPointAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MountingPointAssetModify of ISM"; return false; } if (!m_ftc->enableMountingPointAssetRemove()) { - ERROR_LOG() << "Could not enable FT MountingPointAssetRemove of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MountingPointAssetRemove of ISM"; return false; } if (!m_ftc->enableStructureElementModify()) { - ERROR_LOG() << "Could not enable FT enableStructureElementModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT enableStructureElementModify of ISM"; return false; } @@ -183,7 +183,7 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, m_sourceModel->setMntPointFilterTypes(filters); if (!m_sourceModel->initModel(m_dtc, m_dataIfc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_sourceModel; m_sourceModel = nullptr; return false; @@ -255,7 +255,7 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, m_buildingComponentSettings->addChangedCallback(this); else { - ERROR_LOG() << Q_FUNC_INFO << " addChangedCallback fltBuildingComponentIfc failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " addChangedCallback fltBuildingComponentIfc failed"; #ifdef LTS_DEBUG Q_ASSERT(false); #endif @@ -264,7 +264,7 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, onBuildingComponentSettingsChanged(); }else { - ERROR_LOG() << "No BuildingCOmponentIfc "; + ERROR_LOG(m_logger) << "No BuildingCOmponentIfc "; } @@ -340,7 +340,7 @@ bool MountingPointListDialog::init(LtsSession::LtsSession *session, this, &MountingPointListDialog::onInfoMountButtonClicked, Qt::UniqueConnection); onUpdateInfoMountButtonAndBehaviour(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -352,7 +352,7 @@ void MountingPointListDialog::getMountingPointPlanData(const QModelIndex &index, if (item->data().canConvert()) { const SimpleMountingPointData &data = item->data().value(); - DEBUG_LOG() << "Item: " << m_sourceModel->data(index, Qt::DisplayRole).toString() + DEBUG_LOG(m_logger) << "Item: " << m_sourceModel->data(index, Qt::DisplayRole).toString() << ", Structure Element Id: " << data.id; if (mppMap.contains(data.id)) @@ -362,7 +362,7 @@ void MountingPointListDialog::getMountingPointPlanData(const QModelIndex &index, } else if (data.aimState != MountingPointState_def::Idle) { - DEBUG_LOG() << "Not available in Map. Desired: " << data.aimState; + DEBUG_LOG(m_logger) << "Not available in Map. Desired: " << data.aimState; modify.push_back(MountingPointPlan(data.id, data.aimState)); } } @@ -418,7 +418,7 @@ void MountingPointListDialog::onMountingPointAssetRemoveReply(const Core::Functi void MountingPointListDialog::onBuildingComponentSettingsChanged() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; @@ -452,7 +452,7 @@ void MountingPointListDialog::onBuildingComponentSettingsChanged() m_sortProxyModel->setFloorFilter(visibleFloors); } - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool MountingPointListDialog::apply() @@ -688,7 +688,7 @@ void MountingPointListDialog::onUnmountButtonClicked() }); if (!ret) - WARNING_LOG()<<" couldn't unmount asset on MountingPoinAsset id: "<setButtonEnabled(LtsWidgets::DialogButton::Load,false); } @@ -703,7 +703,7 @@ void MountingPointListDialog::onUnmountButtonClicked() } else { - ERROR_LOG()<<" Couldn't convert to SimpleMountingPointData: "; + ERROR_LOG(m_logger)<<" Couldn't convert to SimpleMountingPointData: "; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.h index 360380f9e..eae213ca5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog.h @@ -107,6 +107,8 @@ private slots: void onUpdateInfoMountButtonAndBehaviour(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; bool isIncludedId(int32_t mountingPointId) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.cpp index b04778618..965eede92 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.cpp @@ -28,11 +28,11 @@ MountingPointListDialogModel::MountingPointListDialogModel(QObject *parent) , m_scheduleId(-1) , m_dataChangedTimer(new QTimer(this)) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_dataChangedTimer->setSingleShot(true); m_dataChangedTimer->setInterval(100); connect(m_dataChangedTimer, &QTimer::timeout, this, &MountingPointListDialogModel::emitDataChanged); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -87,11 +87,11 @@ QVariant MountingPointListDialogModel::data(const QModelIndex &index, int role) const SimpleMountingPointData itemData = item->data().value(); if (itemData.mpType.underlying() == MountingPointType::Unknown) { - ERROR_LOG() << "unknown!!!"; + ERROR_LOG(m_logger) << "unknown!!!"; return QVariant(); } - ERROR_LOG() << "mpType = " << itemData.mpType.underlying(); + ERROR_LOG(m_logger) << "mpType = " << itemData.mpType.underlying(); if(itemData.mpType == MountingPointType::OutdoorIPS) return MountingPointType::IndoorIPS; @@ -113,14 +113,14 @@ QVariant MountingPointListDialogModel::data(const QModelIndex &index, int role) bool MountingPointListDialogModel::initModel(const std::shared_ptr &dtc, const std::shared_ptr &dataInterface) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_dtc == dtc) return true; if (!(dtc->enableMainStructureElement() && dtc->enableMountingPointAsset())) { - ERROR_LOG() << "Could not enable Datatopics"; + ERROR_LOG(m_logger) << "Could not enable Datatopics"; return false; } m_dtc = dtc; @@ -131,14 +131,14 @@ bool MountingPointListDialogModel::initModel(const std::shared_ptr MountingPointListDialogModel::getAvailableFloors() const @@ -441,7 +441,7 @@ void MountingPointListDialogModel::onScheduleIdChanged(int32_t scheduleId) if (scheduleId == m_scheduleId) return; - DEBUG_LOG() << "onScheduleIdChanged: " << scheduleId; + DEBUG_LOG(m_logger) << "onScheduleIdChanged: " << scheduleId; m_scheduleId = scheduleId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.h index b44c42da0..ca1fe3a60 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointList/ism_mounting_point_list_dialog_model.h @@ -92,6 +92,8 @@ private slots: void emitDataChanged(); private: + +NGL::INGLLogger &m_logger; void initData(); friend class MountingPointListSortModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.cpp index 674524512..e6cbf971d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.cpp @@ -21,7 +21,7 @@ MountingPointSelector::MountingPointSelector(const std::shared_ptrenableMountingPointPlanModify()) { - ERROR_LOG() << "Could not enable FT MountingPointPlanModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MountingPointPlanModify of ISM"; } } @@ -31,10 +31,10 @@ void MountingPointSelector::onMountingPointPlanModifyReply(const Core::FunctionR m_requestHelper->requestReply(replyObject); if (replyObject.error()) - ERROR_LOG() << "MountingPointPlansRemove error: " + ERROR_LOG(m_logger) << "MountingPointPlansRemove error: " << replyObject.str(); else - DEBUG_LOG() << "MountingPointPlansRemove success"; + DEBUG_LOG(m_logger) << "MountingPointPlansRemove success"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.h index 0c4edf7d5..3651b70f4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/MountingPointMapSelection/ism_selector.h @@ -28,6 +28,8 @@ public: void onMountingPointPlanModifyReply(const Core::FunctionReplyObject &replyObject) override final; protected: + +NGL::INGLLogger &m_logger; void startModifyRequest(const std::vector &data); protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_dialog.cpp index 6d40e6623..aa62b0c56 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_dialog.cpp @@ -54,7 +54,7 @@ bool ConflictsDialog::init(LtsSession::LtsSession *session, if (m_scheduleId <= 0) { - ERROR_LOG() << "Invalid id for Instrumentation plan: " << m_scheduleId; + ERROR_LOG(m_logger) << "Invalid id for Instrumentation plan: " << m_scheduleId; return false; } @@ -64,7 +64,7 @@ bool ConflictsDialog::init(LtsSession::LtsSession *session, if (!m_sourceModel->initModel(m_scheduleId, m_anotherScheduleId, m_dtc)) { - ERROR_LOG() << "Could not init ConflictsDialogModel"; + ERROR_LOG(m_logger) << "Could not init ConflictsDialogModel"; delete m_sourceModel; m_sourceModel = nullptr; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.cpp index d06c01d6b..fee08649c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.cpp @@ -128,7 +128,7 @@ bool ConflictsDialogModel::initModel(int scheduleId, if (!(dtc->enableMainStructureElement() && dtc->enableMainSchedule())) { - ERROR_LOG() << "Could not enable Data Topics"; + ERROR_LOG(m_logger) << "Could not enable Data Topics"; return false; } @@ -302,7 +302,7 @@ void ConflictsDialogModel::initData() if (mountingPoint.mountingPointState() == compareMountingPointState) { - DEBUG_LOG() << "No conflict for mounting point id = " << currentElement.id() << " - " << currentElement.name(); + DEBUG_LOG(m_logger) << "No conflict for mounting point id = " << currentElement.id() << " - " << currentElement.name(); continue; } @@ -314,11 +314,11 @@ void ConflictsDialogModel::initData() mpData.conflictState = compareMountingPointState; mpData.mpType = currentElement.mountingPointTypeId(); - DEBUG_LOG() << "## MP Id = " << mpData.id; - DEBUG_LOG() << "## MP Name = " << mpData.name; - DEBUG_LOG() << "## Aim state = " << mpData.aimState; + DEBUG_LOG(m_logger) << "## MP Id = " << mpData.id; + DEBUG_LOG(m_logger) << "## MP Name = " << mpData.name; + DEBUG_LOG(m_logger) << "## Aim state = " << mpData.aimState; - DEBUG_LOG() << "Adding mounting point id = " << mpData.id << " - " << mpData.name; + DEBUG_LOG(m_logger) << "Adding mounting point id = " << mpData.id << " - " << mpData.name; item = new NGLTreeItem(QVariant::fromValue(mpData)); } @@ -338,16 +338,16 @@ void ConflictsDialogModel::initData() parentIndex = m_mountingPointIndexes.value(path.at(path.size() - 2), indexFromItem(m_rootItem)); if (!parentIndex.isValid()) { - DEBUG_LOG() << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); + DEBUG_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); for (const StructureElement &se : mse.elements()) - DEBUG_LOG() << " se: " << se.id() << ", " << se.displayName() << ", " << se.name(); + DEBUG_LOG(m_logger) << " se: " << se.id() << ", " << se.displayName() << ", " << se.name(); } } else { parentIndex = groupIndex.isValid() ? groupIndex : indexFromItem(m_rootItem); - DEBUG_LOG() << "Insert row under root: " << currentElement.displayName(); + DEBUG_LOG(m_logger) << "Insert row under root: " << currentElement.displayName(); } insertRow(rowCount(parentIndex), parentIndex, item); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.h index 203e7371a..7c6d4c5ee 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_conflicts_model.h @@ -70,6 +70,7 @@ public: public slots: void onConflictedDataChanged(); private: +NGL::INGLLogger &m_logger; void initData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog.cpp index d316061fc..e4581f303 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog.cpp @@ -26,7 +26,7 @@ OverviewDialog::OverviewDialog(const QString &menuGroup, LtsSession::LtsSession , m_ui(new Ui::OverviewDialog) , m_menuGroup(menuGroup) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); m_timerUpdateView = new QTimer(this); m_timerUpdateView->setSingleShot(true); @@ -36,19 +36,19 @@ OverviewDialog::OverviewDialog(const QString &menuGroup, LtsSession::LtsSession connect(m_ui->cbBasePlan, QOverload::of(&QComboBox::currentIndexChanged), this, &OverviewDialog::onCbBasePlanIndexChanged); setOnlineHelpFilename(QStringLiteral("Ressourcen-Overview")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } OverviewDialog::~OverviewDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::aboutToClose() { - DEBUG_LOG() << "About to close"; + DEBUG_LOG(m_logger) << "About to close"; if (m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))) m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))->closeRequest(); } @@ -69,7 +69,7 @@ bool OverviewDialog::init(int planId, const std::shared_ptr &ftc, const std::shared_ptr &dataInterface) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_scheduleId = planId; m_dtc = dtc; m_ftc = ftc; @@ -93,32 +93,32 @@ bool OverviewDialog::init(int planId, connect(m_timerUpdateView, &QTimer::timeout, this, &OverviewDialog::reloadModel); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void OverviewDialog::setCbBasePlan() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbBasePlan->clear(); m_ui->cbBasePlan->addItem(tr("Actual Mountings"), 0); m_ui->cbBasePlan->insertSeparator(1); for (auto ms : m_dtc->mainSchedules()) m_ui->cbBasePlan->addItem(QString::fromStdString(ms.name()), ms.id()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::setCbComparePlan() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbComparePlan->clear(); m_ui->cbComparePlan->addItem(tr("All active(*) plans"),0); m_ui->cbComparePlan->insertSeparator(1); for (auto ms : m_dtc->mainSchedules()) m_ui->cbComparePlan->addItem((ms.statusId() == ScheduleStatus_def::Active ? QLatin1Literal("* ") : QLatin1Literal(" ")) + QString::fromStdString(ms.name()), ms.id()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::onPrint() @@ -150,7 +150,7 @@ void OverviewDialog::onPrint() void OverviewDialog::onScheduleIdChanged(int32_t scheduleId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_scheduleId == scheduleId) return; setCbComparePlan(); @@ -163,30 +163,30 @@ void OverviewDialog::onScheduleIdChanged(int32_t scheduleId) m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))->closeRequest(); retranslate(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::onCbComparePlanIndexChanged(int index) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; Q_UNUSED(index); updateOverviewData(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::onCbBasePlanIndexChanged(int index) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; Q_UNUSED(index); updateOverviewData(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::onPlansDataChanged() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; updateOverviewData(); ConflictsDialog *dialog = static_cast(m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))); if (dialog) @@ -194,7 +194,7 @@ void OverviewDialog::onPlansDataChanged() dialog->updateModel(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void OverviewDialog::updateOverviewData() @@ -204,7 +204,7 @@ void OverviewDialog::updateOverviewData() void OverviewDialog::reloadModel() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_model == nullptr) return; @@ -217,7 +217,7 @@ void OverviewDialog::reloadModel() if (m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))) m_session->baseLayout()->getWidget(m_menuGroup, QStringLiteral("OverviewConflicts"))->closeRequest(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.cpp index 51f377199..1ab1db4dd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.cpp @@ -31,7 +31,7 @@ OverviewDialogModel::OverviewDialogModel(QObject *parent) , m_comparedScheduleId(0) , m_dtc(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; @@ -53,7 +53,7 @@ OverviewDialogModel::OverviewDialogModel(QObject *parent) m_refMap[MountingPointType_def::IndoorCamera] = 2; m_refMap[MountingPointType_def::IndoorIPS] = 3; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } QVariant OverviewDialogModel::data(const QModelIndex &index, int role) const @@ -113,7 +113,7 @@ bool OverviewDialogModel::initModel(int32_t mainScheduleId, const std::shared_ptr &dtc, int32_t comparedScheduleId, int32_t basePlanId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_dtc = dtc; m_loadedScheduleId = mainScheduleId; m_comparedScheduleId = comparedScheduleId; @@ -124,19 +124,19 @@ bool OverviewDialogModel::initModel(int32_t mainScheduleId, if (!m_dtc->mainSchedules().contains(m_loadedScheduleId)) { m_loadedScheduleId = -1; - ERROR_LOG() << "Invalid scheduleId = " << mainScheduleId; + ERROR_LOG(m_logger) << "Invalid scheduleId = " << mainScheduleId; return false; } - DEBUG_LOG() << "[INITIAL] loaded: "< OverviewDialogModel::mergePlans(const QHash &currPlan, const int cmpPlanId) { - DEBUG_LOG()<<"[MERGE PLANs] currPlanId: "< mergedPlan = currPlan; const auto msConst = m_dtc->mainSchedules(); @@ -243,7 +243,7 @@ QHash OverviewDialogModel::mergePlans(const QHash baseMountingPointPlans; - DEBUG_LOG() << "We compare plan " << m_basePlanId << " with " << m_comparedScheduleId; + DEBUG_LOG(m_logger) << "We compare plan " << m_basePlanId << " with " << m_comparedScheduleId; baseMountingPointPlans.clear(); m_conflictedStructureElementIds.clear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.h index 3ad41322e..3c5cef044 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_dialog_model.h @@ -56,6 +56,8 @@ public: QMap getOtherActiveNeeded(const int &currPlanId); private: + +NGL::INGLLogger &m_logger; QHash mergePlans(const QHash &currPlan, const int cmpPlanId); void setTotalCmpActiveNeed(const QMap &mergedPlan); MountingPointType getMountingPointTypeId(int structureElementId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_dialog.cpp index 7e07cd4ea..4d9d4788c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_dialog.cpp @@ -27,7 +27,7 @@ OverviewMountingPointListDialog::OverviewMountingPointListDialog(const QString & , m_printMountingAction(new QAction(tr("To Mount"), this)) , m_printUnmountingAction(new QAction(tr("To Unmount"), this)) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; setAttribute(Qt::WA_DeleteOnClose); m_ui->setupUi(this); @@ -39,14 +39,14 @@ OverviewMountingPointListDialog::OverviewMountingPointListDialog(const QString & connect(m_actionMenu, &QMenu::triggered, this, &OverviewMountingPointListDialog::onPrint); m_buttonBox->setMenu(LtsWidgets::DialogButton::Print, m_actionMenu); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } OverviewMountingPointListDialog::~OverviewMountingPointListDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -57,7 +57,7 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session, const std::shared_ptr &dataInterface, int32_t scheduleId) { - TRACE_LOG() << Q_FUNC_INFO << " START, scheduleId=" << scheduleId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, scheduleId=" << scheduleId; m_dtc = dtc; m_dataIfc = dataInterface; m_session = session; @@ -68,30 +68,30 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session, if (!m_ftc->enableInstrumentationAssetModify()) { - ERROR_LOG() << "Could not enable FT InstrumentationAssetModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT InstrumentationAssetModify of ISM"; return false; } if (!m_ftc->enableMountingPointPlanModify()) { - ERROR_LOG() << "Could not enable FT enableMountingPointPlansModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT enableMountingPointPlansModify of ISM"; return false; } - DEBUG_LOG() << Q_FUNC_INFO << " new ViewMountingPointListModel..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " new ViewMountingPointListModel..."; delete m_sourceModel; m_sourceModel = new ViewMountingPointListModel(this); if (!m_sourceModel->initModel(m_dtc, m_dataIfc, m_scheduleId)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_sourceModel; m_sourceModel = nullptr; return false; } - DEBUG_LOG() << Q_FUNC_INFO << " new m_mountedPointSortProxyModel ..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " new m_mountedPointSortProxyModel ..."; delete m_mountedPointSortProxyModel; m_mountedPointSortProxyModel = new ViewMountingPointListSortModel(this); m_mountedPointSortProxyModel->setVisibleState(MountingPointState::Equipped); @@ -103,7 +103,7 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session, m_ui->mountingPointListView->setSortingEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " new m_unmountedPointSortProxyModel ..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " new m_unmountedPointSortProxyModel ..."; delete m_unmountedPointSortProxyModel; m_unmountedPointSortProxyModel = new ViewMountingPointListSortModel(this); m_unmountedPointSortProxyModel->setVisibleState(MountingPointState::Empty); @@ -133,7 +133,7 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session, - DEBUG_LOG() << Q_FUNC_INFO << " filter... ..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " filter... ..."; const auto filters = { MountingPointType::BuildingSensorModule, @@ -215,7 +215,7 @@ bool OverviewMountingPointListDialog::init(LtsSession::LtsSession *session, retranslate(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.cpp index bb6e07466..a63df4dfe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.cpp @@ -28,11 +28,11 @@ ViewMountingPointListModel::ViewMountingPointListModel(QObject *parent) , m_dtc(nullptr) , m_dataChangedTimer(new QTimer(this)) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_dataChangedTimer->setSingleShot(true); m_dataChangedTimer->setInterval(100); connect(m_dataChangedTimer, &QTimer::timeout, this, &ViewMountingPointListModel::emitDataChanged); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -105,7 +105,7 @@ bool ViewMountingPointListModel::initModel(const std::shared_ptr const std::shared_ptr &dataInterface, int32_t requestedScheduleId) { - TRACE_LOG() << Q_FUNC_INFO << " START, scheduleId=" << requestedScheduleId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, scheduleId=" << requestedScheduleId; if (m_dtc == dtc) return true; @@ -113,7 +113,7 @@ bool ViewMountingPointListModel::initModel(const std::shared_ptr if (!(dtc->enableMainStructureElement() && dtc->enableMountingPointAsset())) { - ERROR_LOG() << "Could not enable Datatopics"; + ERROR_LOG(m_logger) << "Could not enable Datatopics"; return false; } m_dtc = dtc; @@ -132,11 +132,11 @@ bool ViewMountingPointListModel::initModel(const std::shared_ptr connect(m_dataInterface.get(), &ForeignDataInterface::mountingPointChanged, this, &ViewMountingPointListModel::onMountingPointChanged); - DEBUG_LOG() << "initModel successful"; + DEBUG_LOG(m_logger) << "initModel successful"; initData(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -177,7 +177,7 @@ inline int getFakeBuildingGroupId(int seId) void ViewMountingPointListModel::initData() { - TRACE_LOG() << Q_FUNC_INFO << " START, m_scheduleId=" << m_scheduleId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_scheduleId=" << m_scheduleId; #ifdef BENCHMARK @@ -311,9 +311,9 @@ void ViewMountingPointListModel::initData() parentIndex = m_mountingPointIndexes.value(path.at(path.size() - 2), indexFromItem(m_visRoot)); if (!parentIndex.isValid()) { - ERROR_LOG() << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); + ERROR_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); for (const StructureElement &se : mse.elements()) - ERROR_LOG() << " se: " << se.id() << ", " << se.displayName() << ", " << se.name(); + ERROR_LOG(m_logger) << " se: " << se.id() << ", " << se.displayName() << ", " << se.name(); } } else @@ -345,18 +345,18 @@ void ViewMountingPointListModel::initData() qCritical() << " ViewMountingPointListModel::initData-BENCHMARK: m_scheduleId=" << m_scheduleId << " took " << elapsedTimer1.elapsed() << " [ms]"; #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool ViewMountingPointListModel::mountingPointHasAssetMounted(int32_t mountingPointId, const QMap &mountingPointAssetMap) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; for (const MountingPointAsset &mpa : mountingPointAssetMap) { if (mpa.structureElementId() == mountingPointId) return true; } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.h index 08409bd1e..0c42543ee 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Overview/ism_overview_mounting_point_list_model.h @@ -90,6 +90,8 @@ private Q_SLOTS: void emitDataChanged(); private: + +NGL::INGLLogger &m_logger; void initData(); void initMountedData(); void initUnmountedData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.cpp index 16fa7730f..8c1339054 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.cpp @@ -9,11 +9,10 @@ namespace InfrastructureManagement { -NewPlanDialog::NewPlanDialog(LtsSession::LtsSession *session, QWidget *parent) - : QDialog(parent) +NewPlanDialog::NewPlanDialog(LtsSession::LtsSession *session, QWidget *parent) : QDialog(parent) , m_ui(new Ui::NewPlanDialog) - , m_session(session) -{ + , m_session(session), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { setWindowTitle(tr("Create New Plan")); m_ui->setupUi(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.h index 0d6d8d59a..494ff3552 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/new_plan_dialog.h @@ -29,6 +29,8 @@ public: bool getData(QString &name, qint64 &begin, qint64 &end, int &status); private: + +NGL::INGLLogger &m_logger; Ui::NewPlanDialog* m_ui; std::shared_ptr m_ismGuiCbx{nullptr}; LtsSession::LtsSession *m_session{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.cpp index 65fdc4d7c..bc10711e0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.cpp @@ -20,13 +20,12 @@ namespace InfrastructureManagement { -PlanChooser::PlanChooser(const std::shared_ptr &dtc, QWidget *parent) - : QDialog(parent) +PlanChooser::PlanChooser(const std::shared_ptr &dtc, QWidget *parent) : QDialog(parent) , m_ui(new Ui::PlanChooser) , m_model(nullptr) , m_dtc(dtc) - , m_selected(false) -{ + , m_selected(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { LtsWidgets::LtsGlobalWaitDialog::getInstance()->setVisible(false); m_ui->setupUi(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.h index d90d99f88..b61538e91 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/PlanChooser/plan_chooser.h @@ -32,6 +32,8 @@ public: void selectPlan(int planId); private: + +NGL::INGLLogger &m_logger; Ui::PlanChooser *m_ui{nullptr}; PlanDialogModel *m_model{nullptr}; LtsSession::LtsSession *m_session{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_dialog.cpp index bc66ba0a1..6ab316a7d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_dialog.cpp @@ -47,7 +47,7 @@ bool ScheduleDifferencesListDialog::init(LtsSession::LtsSession *session, if (m_scheduleId <= 0) { - ERROR_LOG() << "Invalid id for Instrumentation plan: " << m_scheduleId; + ERROR_LOG(m_logger) << "Invalid id for Instrumentation plan: " << m_scheduleId; return false; } @@ -57,7 +57,7 @@ bool ScheduleDifferencesListDialog::init(LtsSession::LtsSession *session, if (!m_sourceModel->initModel(m_scheduleId, m_dtc)) { - ERROR_LOG() << "Could not init ScheduleDifferencesListDialogModel"; + ERROR_LOG(m_logger) << "Could not init ScheduleDifferencesListDialogModel"; delete m_sourceModel; m_sourceModel = nullptr; return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_model.cpp index f68db10c3..56150d865 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ScheduleDifferences_old/ism_schedule_differences_list_model.cpp @@ -75,28 +75,28 @@ bool ScheduleDifferencesListDialogModel::initModel(int scheduleId, m_scheduleId = scheduleId; if (m_scheduleId <= 0) { - ERROR_LOG() << "Invalid scheduleId = " << m_scheduleId; + ERROR_LOG(m_logger) << "Invalid scheduleId = " << m_scheduleId; return false; } QList diff; bool isComplete = m_dtc->getScheduleDifferences(m_scheduleId, diff); - DEBUG_LOG() << "Plan id = " << m_scheduleId << ", Differences = " << diff.size(); + DEBUG_LOG(m_logger) << "Plan id = " << m_scheduleId << ", Differences = " << diff.size(); if (isComplete) { - WARNING_LOG() << "Instrumentation plan is complete. No differences to show."; + WARNING_LOG(m_logger) << "Instrumentation plan is complete. No differences to show."; return false; } for (const MountingPointPlan &mpp : std::as_const(diff)) { - DEBUG_LOG() << "Adding to model MPP = " << mpp.id(); + DEBUG_LOG(m_logger) << "Adding to model MPP = " << mpp.id(); insertRow(mpp); } - DEBUG_LOG() << "initModel successful"; + DEBUG_LOG(m_logger) << "initModel successful"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_dialog.cpp index cf48017fd..bfbe386f5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_dialog.cpp @@ -29,7 +29,7 @@ PlanTimeLineDialog::PlanTimeLineDialog(LtsSession::LtsSession *session, const QS , m_ui(new Ui::PlanTimeLineDialog) , m_logger(getLogger(QStringLiteral("PlanTimeLineDialog"))) { - DEBUG_LOG() << Q_FUNC_INFO << " "; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " "; m_ui->setupUi(this); @@ -52,7 +52,7 @@ PlanTimeLineDialog::~PlanTimeLineDialog() bool PlanTimeLineDialog::init(const std::shared_ptr &dtc, const std::shared_ptr &ftc, const std::shared_ptr &dataInterface, InfrastructureManagement::ForeignResourceManagementGuiInterface *ismGuiIfc) { - DEBUG_LOG() << "Start init FileManagementDialogWidget..."; + DEBUG_LOG(m_logger) << "Start init FileManagementDialogWidget..."; m_dtc = dtc; m_ftc = ftc; @@ -68,7 +68,7 @@ bool PlanTimeLineDialog::init(const std::shared_ptrtimeline->view(), this); if (!m_model->initModel(m_dtc, m_dataIfc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; delete m_model; m_model = nullptr; return false; @@ -133,7 +133,7 @@ void PlanTimeLineDialog::setScheduleId(const int scheduleId) return; } - DEBUG_LOG() << "ism_plan_tln_dialog: setScheduleId = " << m_scheduleId; + DEBUG_LOG(m_logger) << "ism_plan_tln_dialog: setScheduleId = " << m_scheduleId; ismIfc->setScheduleId(m_scheduleId); @@ -158,7 +158,7 @@ void PlanTimeLineDialog::onLoad() int scheduleId = m_model->getScheduleIdOfItem(m_selectedItem); if (scheduleId == -1) { - ERROR_LOG() << "onLoad failed: Could not find model for selected item:" << m_selectedItem; + ERROR_LOG(m_logger) << "onLoad failed: Could not find model for selected item:" << m_selectedItem; return; } @@ -231,7 +231,7 @@ void PlanTimeLineDialog::onApply() int seId = m_model->getScheduleIdOfItem(itemId); if (seId == -1) { - WARNING_LOG() << "Could not find schedule for item id:" << itemId; + WARNING_LOG(m_logger) << "Could not find schedule for item id:" << itemId; continue; } InfrastructureManagement::MainSchedule mse = m_dtc->mainSchedule(seId); @@ -311,13 +311,13 @@ void PlanTimeLineDialog::updateTimeLine() if (m_scheduleId == -1) { - ERROR_LOG() << "Invalid schedule id: timeline update aborted!"; + ERROR_LOG(m_logger) << "Invalid schedule id: timeline update aborted!"; return; } if (m_model!= nullptr && !m_model->updateModel()) { - ERROR_LOG() << "Invalid model!"; + ERROR_LOG(m_logger) << "Invalid model!"; return; } resizeView(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_model.cpp index 5b3835cad..0c4f57c71 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/Timeline/ism_plan_tln_model.cpp @@ -24,7 +24,7 @@ PlanTimelineModel::PlanTimelineModel(TimelineView *tlv, QObject *parent) bool PlanTimelineModel::initModel(const std::shared_ptr &dtc, const std::shared_ptr &dataInterface) { - DEBUG_LOG() << "Start init FileManagement timeline model..."; + DEBUG_LOG(m_logger) << "Start init FileManagement timeline model..."; if (m_dtc == dtc) return true; @@ -42,17 +42,17 @@ bool PlanTimelineModel::initModel(const std::shared_ptr &dtc, if (!m_model->initModel(m_dtc)) { - ERROR_LOG() << "Could not init model"; + ERROR_LOG(m_logger) << "Could not init model"; return false; } @@ -94,7 +94,7 @@ bool BuildingMountPointDialog::init(const std::shared_ptr &dtc, if (!m_ftc->enableMainStructureElementModify()) { - ERROR_LOG() << "Could not enable FT MainStructureElementModify of ISM"; + ERROR_LOG(m_logger) << "Could not enable FT MainStructureElementModify of ISM"; return false; } @@ -217,7 +217,7 @@ bool BuildingMountPointDialog::exportData(const std::vector &s void BuildingMountPointDialog::onExportClicked() { - DEBUG_LOG() << "**** onExportClicked() "; + DEBUG_LOG(m_logger) << "**** onExportClicked() "; const QModelIndexList indexList = m_ui->tvBuildings->selectionModel()->selectedRows(); if (indexList.isEmpty()) @@ -251,14 +251,14 @@ void BuildingMountPointDialog::onExportClicked() tr("CSV-Files (*.csv)")); if (!fileNameTemplate.contains(placeholder)) { - ERROR_LOG() << " no placeholder '" << placeholder << "'"; + ERROR_LOG(m_logger) << " no placeholder '" << placeholder << "'"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("The name must have a placeholder (%1). Please try again.").arg(placeholder)); return; } const QString &dir = QFileInfo(fileNameTemplate).absolutePath(); fileNameTemplate.replace(placeholder, QStringLiteral("%1")); - DEBUG_LOG() << " fileNameTemplate after '" << fileNameTemplate << "'"; + DEBUG_LOG(m_logger) << " fileNameTemplate after '" << fileNameTemplate << "'"; for (auto idxItem : indexList) { const QModelIndex &idx = m_proxyModel->mapToSource(idxItem); @@ -266,16 +266,16 @@ void BuildingMountPointDialog::onExportClicked() const QString bldgName = QString::fromStdString(m_model->getMainStructureElement(idx).name()); if (bldgName.isEmpty()) { - ERROR_LOG() << " bldgName is empty"; + ERROR_LOG(m_logger) << " bldgName is empty"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Name is empty").arg(dir)); return; } const QString &fileName = QString(fileNameTemplate).arg(bldgName); - DEBUG_LOG() << " fileName '" << fileName << "'"; + DEBUG_LOG(m_logger) << " fileName '" << fileName << "'"; if (!exportData(structureElements, fileName)) - ERROR_LOG() << " exportData failed bldgName " << bldgName; + ERROR_LOG(m_logger) << " exportData failed bldgName " << bldgName; } LtsWidgets::LtsMessageDialog::showMessage(this, @@ -312,7 +312,7 @@ void BuildingMountPointDialog::onExportAllClicked() void BuildingMountPointDialog::onImportClicked() { - DEBUG_LOG() << "**** onImportClicked() "; + DEBUG_LOG(m_logger) << "**** onImportClicked() "; QModelIndexList indexList = m_ui->tvBuildings->selectionModel()->selectedRows(); if (indexList.isEmpty() || indexList.size() > 1) @@ -342,7 +342,7 @@ void BuildingMountPointDialog::onImportClicked() int colBarcode = 0; int colMountingPointId = 1; - DEBUG_LOG() << "colBarcode: " << colBarcode + DEBUG_LOG(m_logger) << "colBarcode: " << colBarcode << ", colMountingPointId: " << colMountingPointId; m_importedModelIndex = m_proxyModel->mapToSource(indexList.at(0)); @@ -358,7 +358,7 @@ void BuildingMountPointDialog::onImportClicked() if (colMountingPointId >= values.size() || colBarcode >= values.size()) { - WARNING_LOG() << "skipping line - to few data: '" << line << "'"; + WARNING_LOG(m_logger) << "skipping line - to few data: '" << line << "'"; continue; } QString newBarCode = values.at(colBarcode).toString(); @@ -378,7 +378,7 @@ void BuildingMountPointDialog::onImportClicked() barcodes.insert(curMountingPointId, newBarCode); prevMountingPointId = curMountingPointId; } - DEBUG_LOG() << "mountingPoint: " << curMountingPointId + DEBUG_LOG(m_logger) << "mountingPoint: " << curMountingPointId << ", new barcode: " << newBarCode; } file.close(); @@ -432,7 +432,7 @@ bool BuildingMountPointDialog::apply() void BuildingMountPointDialog::onResetClicked() { - DEBUG_LOG() << "**** onResetClicked() "; + DEBUG_LOG(m_logger) << "**** onResetClicked() "; m_model->resetNewItems(m_importedModelIndex); m_model->resetNewBarcodes(m_importedModelIndex); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_dialog.h index 804a3be5e..66f309e7f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_dialog.h @@ -53,6 +53,8 @@ private slots: bool apply() override; private: + +NGL::INGLLogger &m_logger; bool exportData(const std::vector &structureElements, const QString &fileName); void expandCollapseRecursivly(const QModelIndex &idx, bool bExpand); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_model.cpp index 246e917c0..6a8f0a016 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_building_mount_point_model.cpp @@ -356,7 +356,7 @@ void BuildingMountPointModel::modifyBuilding(const MainStructureElement &mse) if (!building) { - WARNING_LOG()<<">>> not found section: "<>> not found section: "<setupUi(this); m_buttonBox->connectButton(LtsWidgets::DialogButton::Print, this, &PlanDialog::onPrint); m_buttonBox->connectButton(LtsWidgets::DialogButton::Remove, this, &PlanDialog::onRemove); @@ -47,14 +47,14 @@ PlanDialog::PlanDialog(const QString &menuGroup, LtsSession::LtsSession * sessio connect(m_ui->planView, &LtsDataView::LtsDataView::doubleClicked, this, &PlanDialog::onEdit); setOnlineHelpFilename(QStringLiteral("Ressourcen-Plans")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } PlanDialog::~PlanDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::retranslate() @@ -74,7 +74,7 @@ bool PlanDialog::init(int scheduleId, const std::shared_ptr &dtc const std::shared_ptr &dataInterface, ForeignResourceManagementGuiInterface *ismGuiIfc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_scheduleId = scheduleId; m_dtc = dtc; @@ -96,7 +96,7 @@ bool PlanDialog::init(int scheduleId, const std::shared_ptr &dtc if (!bRet) { - ERROR_LOG() << "Could not enable DTC or FTC from ISM"; + ERROR_LOG(m_logger) << "Could not enable DTC or FTC from ISM"; return false; } @@ -111,17 +111,17 @@ bool PlanDialog::init(int scheduleId, const std::shared_ptr &dtc connect(m_dataIfc.get(), &ForeignDataInterface::scheduleIdChanged, this, &PlanDialog::onScheduleIdchanged); m_ui->planView->setToolTip(tr("Current Instrumentation Plan Id = %1").arg(m_scheduleId)); - DEBUG_LOG() << "m_scheduleId = " << m_scheduleId; + DEBUG_LOG(m_logger) << "m_scheduleId = " << m_scheduleId; setScheduleId(m_scheduleId); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void PlanDialog::setScheduleId(const int scheduleId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_scheduleId = scheduleId; std::shared_ptr ismIfc; @@ -131,7 +131,7 @@ void PlanDialog::setScheduleId(const int scheduleId) return; } - DEBUG_LOG() << "setScheduleId = " << m_scheduleId; + DEBUG_LOG(m_logger) << "setScheduleId = " << m_scheduleId; ismIfc->setScheduleId(m_scheduleId); @@ -144,7 +144,7 @@ void PlanDialog::setScheduleId(const int scheduleId) m_ui->planView->setToolTip(tr("Current Instrumentation Plan Id = %1").arg(m_scheduleId)); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onPrint() @@ -154,11 +154,11 @@ void PlanDialog::onPrint() void PlanDialog::onMainScheduleChanged(const MainSchedule &data, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_scheduleId = data.id(); enaDisa(); Q_UNUSED(modType); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onScheduleIdchanged(int32_t id) @@ -169,7 +169,7 @@ void PlanDialog::onScheduleIdchanged(int32_t id) void PlanDialog::onLoad() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QModelIndexList indexList = m_ui->planView->selectedRows(); if (indexList.size() == 0) @@ -187,12 +187,12 @@ void PlanDialog::onLoad() setScheduleId(m_scheduleId); m_ismGuiIfc->setPlanId(m_scheduleId); enaDisa(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onRemove() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QModelIndexList indexList = m_ui->planView->selectedRows(); if (indexList.size() == 0) @@ -244,12 +244,12 @@ void PlanDialog::onRemove() { return m_ftc->mainScheduleRemoveRequest(rmReq, this); }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::enaDisa() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Add, true); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Print, true); @@ -272,12 +272,12 @@ void PlanDialog::enaDisa() m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, (indexList.size() == 1) ); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Show, (indexList.size() == 1) ); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Save, (indexList.size() == 1 && !isComplete) ); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onEdit() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QModelIndexList indexList = m_ui->planView->selectedRows(); if (indexList.size() == 0) return; @@ -286,7 +286,7 @@ void PlanDialog::onEdit() if (item.id() < 0 ) return; - DEBUG_LOG() << "onEdit schedule with id = " << item.id(); + DEBUG_LOG(m_logger) << "onEdit schedule with id = " << item.id(); PlanEditDialog *dialog = new PlanEditDialog(this); if (!dialog->init(m_session, item.id(), m_dtc, m_ftc, m_ismGuiCbx)) @@ -296,12 +296,12 @@ void PlanDialog::onEdit() } addDialog(dialog, m_menuGroup, QStringLiteral("EditSchedule%1").arg(item.id()), LtsWidgets::LayoutArea::eDialogTab); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onAdd() { - DEBUG_LOG() << "onAdd"; + DEBUG_LOG(m_logger) << "onAdd"; PlanEditDialog *dialog = new PlanEditDialog(this); if (!dialog->init(m_session, 0, m_dtc, m_ftc, m_ismGuiCbx)) { @@ -313,7 +313,7 @@ void PlanDialog::onAdd() void PlanDialog::onCheck() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QModelIndexList indexList = m_ui->planView->selectedRows(); if (indexList.size() == 0) return; @@ -322,7 +322,7 @@ void PlanDialog::onCheck() if (item.id() < 0 ) return; - DEBUG_LOG() << "show Differences schedule with id = " << item.id(); + DEBUG_LOG(m_logger) << "show Differences schedule with id = " << item.id(); @@ -341,13 +341,13 @@ void PlanDialog::onCheck() } addDialog(dialog, m_menuGroup, QStringLiteral("ShowDifferences%1").arg(item.id()), LtsWidgets::LayoutArea::eDialogTab); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void PlanDialog::onCopy() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QModelIndexList indexList = m_ui->planView->selectedRows(); if (indexList.size() == 0) return; @@ -356,7 +356,7 @@ void PlanDialog::onCopy() if (item.id() < 0 ) return; - DEBUG_LOG() << "onCopy schedule with id = " << item.id(); + DEBUG_LOG(m_logger) << "onCopy schedule with id = " << item.id(); MainScheduleCopyRequest req; req.id(item.id()); @@ -366,7 +366,7 @@ void PlanDialog::onCopy() return m_ftc->mainScheduleCopyRequest(req, this); }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog.h index 0055fe1c7..7ea7567c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog.h @@ -50,6 +50,8 @@ public: void setScheduleId(const int scheduleId); protected: + +NGL::INGLLogger &m_logger; void onMainScheduleRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.cpp index 0929f2305..0c06d4e0e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.cpp @@ -19,27 +19,27 @@ PlanDialogModel::PlanDialogModel(QObject *parent) parent) , m_dtc(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } PlanDialogModel::~PlanDialogModel() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool PlanDialogModel::initModel(const std::shared_ptr &dtc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_dtc = dtc; connect(m_dtc.get(), &Interface::Dtc::mainScheduleChanged, this, &PlanDialogModel::onDataChanged); m_dtc->mainSchedules([this](const MainSchedule &ms){ onDataChanged(ms, DataModification::eAdded); }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.h index ce87da659..c7763f84c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_dialog_model.h @@ -36,6 +36,8 @@ public: }; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_edit_dialog.h index 085d05e84..8320d6417 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/InfrastructureManagement/Gui/ResourceManagement/ism_plan_edit_dialog.h @@ -47,6 +47,8 @@ public: ~PlanEditDialog(); protected: + +NGL::INGLLogger &m_logger; void onMainScheduleModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void enaDisa(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.cpp index a4b3eb5f0..20ac177b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.cpp @@ -25,7 +25,7 @@ MarkerManagementApplyFilter::MarkerManagementApplyFilter(LtsSession::LtsSession m_session->getForeignGuiInterface(spSitMapGuiIfc); if (!spSitMapGuiIfc) { - ERROR_LOG() << "No spSitMapGuiIfc"; + ERROR_LOG(m_logger) << "No spSitMapGuiIfc"; return; } m_sitMapGuiIfc = spSitMapGuiIfc; @@ -46,7 +46,7 @@ const QJsonObject MarkerManagementApplyFilter::getFilterParamsJson() const obj[QStringLiteral("SymbolAppearanceJson")] = symbolAppearanceSettings->settingsToJson(); } else - WARNING_LOG() << "cannot get filter as SymApp filter ifc is missing"; + WARNING_LOG(m_logger) << "cannot get filter as SymApp filter ifc is missing"; } @@ -59,7 +59,7 @@ const QJsonObject MarkerManagementApplyFilter::getFilterParamsJson() const obj[QStringLiteral("AesFilterJson")] = aesDisplayFilter->filterToJson(); } else - WARNING_LOG() << "cannot get filter as aes filter ifc is missing"; + WARNING_LOG(m_logger) << "cannot get filter as aes filter ifc is missing"; } @@ -72,7 +72,7 @@ const QJsonObject MarkerManagementApplyFilter::getFilterParamsJson() const obj[QStringLiteral("BuildingComponentSettingsJson")] = buildingComponentSettings->bldCmpSettingsToJson(); } else - WARNING_LOG() << "cannot get filter as BldgCmpnt filter ifc is missing"; + WARNING_LOG(m_logger) << "cannot get filter as BldgCmpnt filter ifc is missing"; } return obj; @@ -88,14 +88,14 @@ bool MarkerManagementApplyFilter::applyFilter(const QByteArray &filterContent) { if (filterContent.isEmpty()) { - ERROR_LOG() << "filterContent is empty"; + ERROR_LOG(m_logger) << "filterContent is empty"; return false; } QJsonParseError parserError; const QJsonDocument jDoc(QJsonDocument::fromJson(filterContent, &parserError)); if (parserError.error != QJsonParseError::NoError) { - ERROR_LOG() << "Error parsing json document: " << parserError.errorString(); + ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return false; } return applyFilter(jDoc.object()); @@ -110,7 +110,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent) { const QJsonObject innerObj = filterContent[QStringLiteral("AesFilterJson")].toObject(); if (innerObj.isEmpty()) - ERROR_LOG() << "inner content AesFilterJson is empty"; + ERROR_LOG(m_logger) << "inner content AesFilterJson is empty"; else aesFilter.content(QJsonDocument(innerObj).toJson().constData()); } @@ -123,7 +123,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent) { QJsonObject innerObj = filterContent[QStringLiteral("SymbolAppearanceJson")].toObject(); if (innerObj.isEmpty()) - ERROR_LOG() << "inner content SymbolAppearanceJson is empty"; + ERROR_LOG(m_logger) << "inner content SymbolAppearanceJson is empty"; else symbolAppearance.content(QJsonDocument(innerObj).toJson().constData()); } @@ -136,7 +136,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent) { QJsonObject innerObj = filterContent[QStringLiteral("BuildingComponentSettingsJson")].toObject(); if (innerObj.isEmpty()) - ERROR_LOG() << "inner content BuildingComponentSettingsJson is empty"; + ERROR_LOG(m_logger) << "inner content BuildingComponentSettingsJson is empty"; else buildingComponentFilter.content(QJsonDocument(innerObj).toJson().constData()); } @@ -187,7 +187,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent) appearanceSettings->setSettingsFromData(symbolAppearance); } else - WARNING_LOG() << "cannot set filter as at least one filter ifc is missing (fltParticipantIfc|fltIfcPtr)"; + WARNING_LOG(m_logger) << "cannot set filter as at least one filter ifc is missing (fltParticipantIfc|fltIfcPtr)"; @@ -206,7 +206,7 @@ bool MarkerManagementApplyFilter::applyFilter(const QJsonObject &filterContent) buildingComponentSettings->setBldCmpSettingsFromData(buildingComponentFilter); } else - WARNING_LOG() << "cannot set filter as at least one filter ifc is missing (fltBldgCmpntIfc)"; + WARNING_LOG(m_logger) << "cannot set filter as at least one filter ifc is missing (fltBldgCmpntIfc)"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.h index 8a5b4cd0c..5ead92e50 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_apply_filter.h @@ -31,6 +31,8 @@ public: const QJsonObject getFilterParamsJson() const; private: + +NGL::INGLLogger &m_logger; LtsSession::LtsSession *m_session; std::weak_ptr m_fltParticipantIfc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.cpp index 1943506dc..e02cba2aa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.cpp @@ -92,7 +92,7 @@ void MarkerManagementDialogModel::loadPreview(int fileContentId, int rowId) QByteArray byteArray; if (m_flmGui->loadContent(fileContentId, byteArray, true) && byteArray.size() > 0) { - DEBUG_LOG() << "m_previews.insert fileContentId=" << fileContentId + DEBUG_LOG(m_logger) << "m_previews.insert fileContentId=" << fileContentId << " size Preview=" << byteArray.size(); QString str = QStringLiteral("
").arg(QString::fromLatin1(byteArray.toBase64())); m_previews.insert(fileContentId, str); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.h index bb6fe5bbb..e683585b0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/Common/mrk_dialog_model.h @@ -56,6 +56,8 @@ private slots: void loadPreview(int fileContentId, int rowId); private: + +NGL::INGLLogger &m_logger; void requestNextFileContent(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.cpp index 2be47d4cc..4445e3bf5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.cpp @@ -62,21 +62,21 @@ SnapshotTopicEditor::~SnapshotTopicEditor() void SnapshotTopicEditor::updateInternalData() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_ui->snapshotsDataView->selectionModel()->clear(); m_snapshotId = m_topicData.properties.value(QStringLiteral("snapshotId")).toInt(0); if (m_snapshotId > 0) { - DEBUG_LOG() << "snapshotId = " << m_snapshotId; + DEBUG_LOG(m_logger) << "snapshotId = " << m_snapshotId; QModelIndex idx = m_snapshotModel->findIndexForId(m_snapshotId); if (idx.isValid()) { m_ui->snapshotsDataView->selectRow(m_proxyModel->mapFromSource(idx)); const MarkerManagement::Snapshot snapshot = m_snapshotModel->getRowData(idx.row()); - DEBUG_LOG() << "SnapShot Selected " << snapshot.id() ; + DEBUG_LOG(m_logger) << "SnapShot Selected " << snapshot.id() ; m_snapshotId = snapshot.id(); m_ui->lblName->setText(QString::fromStdString(snapshot.name())); } @@ -114,7 +114,7 @@ void SnapshotTopicEditor::onSnapshotSelected() return; m_snapshotId = snapshot.id(); - DEBUG_LOG() << "new snapshot id = " << m_snapshotId; + DEBUG_LOG(m_logger) << "new snapshot id = " << m_snapshotId; m_ui->lblName->setText(QString::fromStdString(snapshot.name())); slotChangesMade(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.h index ee69b1d0c..b410d7499 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/TopicEditor/topic_editor.h @@ -31,6 +31,8 @@ public: ~SnapshotTopicEditor(); private: + +NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.cpp index a20aec87e..1ceb38e87 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.cpp @@ -76,7 +76,7 @@ bool SnapshotCreateDialog::init(const std::shared_ptrgetForeignGuiInterface(m_flmGui)) - ERROR_LOG() << "flm gui missing - cannot create screenshots for a snapshot"; + ERROR_LOG(m_logger) << "flm gui missing - cannot create screenshots for a snapshot"; m_ui->cbSavePreview->setEnabled(false); m_ui->cbSavePreview->setChecked(true); @@ -126,8 +126,8 @@ void SnapshotCreateDialog::sendSnapshotRequest() req.timeStamp(partitionTime); req.fileContentId(m_fileId); - DEBUG_LOG() << "Edit/Create snapshot id = " << m_editData.id(); - DEBUG_LOG() << "File id = " << m_fileId; + DEBUG_LOG(m_logger) << "Edit/Create snapshot id = " << m_editData.id(); + DEBUG_LOG(m_logger) << "File id = " << m_fileId; if (m_requestHelper->startSingleRequest([req, this]() { @@ -135,7 +135,7 @@ void SnapshotCreateDialog::sendSnapshotRequest() })) { m_editData.id(m_requestHelper->getRepliedId()); - DEBUG_LOG() << "Saved snapshot with id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Saved snapshot with id = " << m_requestHelper->getRepliedId(); __unchange__(); closeRequest(); } @@ -190,12 +190,12 @@ void SnapshotCreateDialog::saveSnapshotPreviewInLibrary() const QString title = ( m_ui->leName->text() + QStringLiteral(" (")+ dtg + QStringLiteral(")")); - DEBUG_LOG() << "saveSnapshotPreviewInLibrary: " << title; + DEBUG_LOG(m_logger) << "saveSnapshotPreviewInLibrary: " << title; auto spSitMapGuiIfc = m_sitMapGuiIfc.lock(); if (!spSitMapGuiIfc->isMapReady()) { - ERROR_LOG() << Q_FUNC_INFO << " sitMapGuiInterface not ready"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " sitMapGuiInterface not ready"; return; } @@ -223,7 +223,7 @@ void SnapshotCreateDialog::saveSnapshotPreviewInLibrary() initialFolderId = exeFolderId; } - DEBUG_LOG() << "Initial folder Id = " << initialFolderId + DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId << " snapshotFolderId =" << snapshotFolderId; const int folderId = snapshotFolderId > 0 ? snapshotFolderId : initialFolderId; @@ -252,13 +252,13 @@ void SnapshotCreateDialog::saveSnapshotPreviewInLibrary() })) { m_fileId = m_requestHelper->getRepliedId(); - DEBUG_LOG() << "Saved file in library with id = " << m_fileId; + DEBUG_LOG(m_logger) << "Saved file in library with id = " << m_fileId; sendSnapshotRequest(); if (m_editData.fileContentId() != m_fileId) { - DEBUG_LOG() << "One more request needed!"; + DEBUG_LOG(m_logger) << "One more request needed!"; m_editData.fileContentId(m_fileId); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.h index ae2bcfc10..4d5c4b2fd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_create_snapshot.h @@ -52,6 +52,8 @@ public: bool apply() override final; protected: + +NGL::INGLLogger &m_logger; void retranslate() override; QByteArray getFilterParams() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.cpp index 2deb9ad5a..3979a1a98 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.cpp @@ -120,7 +120,7 @@ void MarkerManagementDialog::onEditMarker() if (marker.id() <= 0) return; - DEBUG_LOG() << "current MarkerId: " << marker.id(); + DEBUG_LOG(m_logger) << "current MarkerId: " << marker.id(); AudioVideoManagement::StreamNameMapping *streamNameMapping = nullptr; if (m_avmInterface) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.h index 301806c8e..267a96757 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_dialog.h @@ -60,6 +60,8 @@ private slots: void onShowOtherUsersMarkers(bool isChecked); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_dialog.h index 3385221c0..003b3ead5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_dialog.h @@ -41,6 +41,8 @@ public: void onMarkerModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + +NGL::INGLLogger &m_logger; void retranslate() override; void createDescriptions(const MarkerManagement::Marker &marker); QString toDisplayNames(const QString &videoStreams); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.cpp index 39eb855ad..59fe1df61 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.cpp @@ -55,27 +55,27 @@ bool InterfaceImpl::fetchInterfaces() m_session->getForeignDataInterface_NEW(m_flmGui); if (!m_session->getDtc(m_opmDtc)) - WARNING_LOG() << "No Opm Dtc, no Snapshots"; + WARNING_LOG(m_logger) << "No Opm Dtc, no Snapshots"; if (!m_session->getDtc(m_flmDtc)) - WARNING_LOG() << "No Flm Dtc, no Snapshots"; + WARNING_LOG(m_logger) << "No Flm Dtc, no Snapshots"; if (!m_session->getFtc(m_flmFtc)) - WARNING_LOG() << "No Flm Ftc, no Snapshots"; + WARNING_LOG(m_logger) << "No Flm Ftc, no Snapshots"; if (!m_session->getForeignGuiInterface(m_sitMapGuiIfc)) - WARNING_LOG() << "No SitMap, no Snapshots"; + WARNING_LOG(m_logger) << "No SitMap, no Snapshots"; if (!m_session->getDtc(m_coreDtc)) { - WARNING_LOG() << "No ReplayManagement!!"; + WARNING_LOG(m_logger) << "No ReplayManagement!!"; return false; } if (m_session->app() == LtsAppDescriptor::App::Scripts && !m_session->getForeignGuiInterface(m_srpIfc)) { - WARNING_LOG() << "Scripts: MarkerManagement: no srp, no topic!"; + WARNING_LOG(m_logger) << "Scripts: MarkerManagement: no srp, no topic!"; return false; } @@ -91,43 +91,43 @@ bool InterfaceImpl::fetchInterfacesReplay() if (!m_session->getForeignDataInterface(m_srmForeign)) { - WARNING_LOG() << "No Srm, no Snapshots"; + WARNING_LOG(m_logger) << "No Srm, no Snapshots"; m_snapshotsAvailable = false; } if (!LtsAppManager::LtsAppManager::getInstance()->hasApp(LtsAppDescriptor::App::Snapshot)) { - DEBUG_LOG() << "No Snapshot App? no Snapshots!"; + DEBUG_LOG(m_logger) << "No Snapshot App? no Snapshots!"; m_snapshotsAvailable = false; } if (!m_session->getDtc(m_opmDtc)) { - WARNING_LOG() << "No Opm, no Snapshots"; + WARNING_LOG(m_logger) << "No Opm, no Snapshots"; m_snapshotsAvailable = false; } if (!m_session->getForeignGuiInterface(m_fltParticipantIfc)) { - WARNING_LOG() << "No Flt/Part, no Snapshots"; + WARNING_LOG(m_logger) << "No Flt/Part, no Snapshots"; m_snapshotsAvailable = false; } if (!m_session->getForeignGuiInterface(m_fltAesIfc)) { - WARNING_LOG() << "No Flt/Aes, no Snapshots"; + WARNING_LOG(m_logger) << "No Flt/Aes, no Snapshots"; m_snapshotsAvailable = false; } if (!m_session->getForeignGuiInterface(m_fltBuildingComponentIfc)) { - DEBUG_LOG() << "No Flt/BuildingComponent"; + DEBUG_LOG(m_logger) << "No Flt/BuildingComponent"; } if (!m_session->getForeignGuiInterface(m_flmGui)) { - WARNING_LOG() << "No Flm, no Snapshots"; + WARNING_LOG(m_logger) << "No Flm, no Snapshots"; m_snapshotsAvailable = false; } @@ -306,30 +306,30 @@ void InterfaceImpl::startSnapshot() try { - DEBUG_LOG() << "replayPartitionCreateRequest ..."; + DEBUG_LOG(m_logger) << "replayPartitionCreateRequest ..."; m_replayPartitionId = m_srmForeign->replayPartitionCreateRequest(m_session->exerciseId(), LtsSessionData::LtsSessionData::getInstance()->getWorkstationId(), LtsSessionData::LtsSessionData::getInstance()->getOperatorId(), Core::ReplayType_def::SnapshotData); - DEBUG_LOG() << "replayPartitionCreateRequest ...DONE"; + DEBUG_LOG(m_logger) << "replayPartitionCreateRequest ...DONE"; } catch(const std::runtime_error &rterr) { - ERROR_LOG() << "Failed to start replay partition for snapshot. std::runtime_error"; - ERROR_LOG() << "Failed to start replay partition for snapshot. std::runtime_error: " << rterr.what(); + ERROR_LOG(m_logger) << "Failed to start replay partition for snapshot. std::runtime_error"; + ERROR_LOG(m_logger) << "Failed to start replay partition for snapshot. std::runtime_error: " << rterr.what(); new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(), tr("Failed to start replay partition for snapshot!")); return; } catch(const std::exception &exception) { - ERROR_LOG() << "Failed to start replay partition for snapshot. Exception: " << exception.what(); + ERROR_LOG(m_logger) << "Failed to start replay partition for snapshot. Exception: " << exception.what(); new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(), tr("Failed to start replay partition for snapshot!")); return; } catch(...) { - ERROR_LOG() << "Failed to start replay partition for snapshot. Exception: ... "; + ERROR_LOG(m_logger) << "Failed to start replay partition for snapshot. Exception: ... "; new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(), tr("Failed to start replay partition for snapshot!")); return; } @@ -337,7 +337,7 @@ void InterfaceImpl::startSnapshot() if (m_replayPartitionId < 0) { - ERROR_LOG() << "Failed to start replay partition for snapshot - invalid replay partition id!"; + ERROR_LOG(m_logger) << "Failed to start replay partition for snapshot - invalid replay partition id!"; new LtsWidgets::LtsMessageDialogNew(m_session->baseLayout(), tr("Failed to start replay partition for snapshot - invalid replay partition id!")); return; } @@ -458,12 +458,12 @@ bool InterfaceImpl::applyFilter(const Snapshot &snapshot, NGL::INGLLogger &logge } else { - ERROR_LOG() << Q_FUNC_INFO << "Error while applying filters"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error while applying filters"; } } else { - ERROR_LOG() << Q_FUNC_INFO << "No Filter Ifc (Part or Aes) to apply filters"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "No Filter Ifc (Part or Aes) to apply filters"; } return false; @@ -504,7 +504,7 @@ bool InterfaceImpl::snapshotAdjustSitMap(const Snapshot &snapshot, bool bApplyFi if (!planOverlay.isEmpty()) { const bool bIsMapReady = sitMapGuiIfc->isMapReady(); - DEBUG_LOG() << Q_FUNC_INFO << " bIsMapReady = " << bIsMapReady; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " bIsMapReady = " << bIsMapReady; if (bIsMapReady) { @@ -540,7 +540,7 @@ bool InterfaceImpl::snapshotAdjustSitMap(const Snapshot &snapshot, bool bApplyFi << " planOverlay: " << planOverlay; }; if (!sitMapGuiIfc->setMapReadyCallback(this, onMapIsReadyFn)) - ERROR_LOG() << Q_FUNC_INFO << ", setMapReadyCallback failed, snapShotOverlayId: " << snapShotOverlayId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", setMapReadyCallback failed, snapShotOverlayId: " << snapShotOverlayId; } } @@ -595,7 +595,7 @@ void InterfaceImpl::resetReplay() } else { - WARNING_LOG() << "could not reset sit map original settings - leaving settings as is..."; + WARNING_LOG(m_logger) << "could not reset sit map original settings - leaving settings as is..."; } } @@ -604,7 +604,7 @@ TopicReplay::Interface *InterfaceImpl::createInterface(TopicEditorBase::TopicTyp { std::shared_ptr mrkDtc; if (!m_session->getDtc(mrkDtc)) - WARNING_LOG() << "mrk dtc missing - snapshot topics cannot live fetch data but instead uses data saved inside the topic"; + WARNING_LOG(m_logger) << "mrk dtc missing - snapshot topics cannot live fetch data but instead uses data saved inside the topic"; return new TopicReplayInterface(m_srpIfc, mrkDtc, m_scriptsMrkIfc , m_logger); } @@ -636,7 +636,7 @@ bool TopicReplayInterface::playbackInit(const QJsonObject &attributes) { if (m_srpIfc == nullptr) { - WARNING_LOG() << "MarkerManagement:TopicReplayInterface::playbackInit: no srp ifc, no playback"; + WARNING_LOG(m_logger) << "MarkerManagement:TopicReplayInterface::playbackInit: no srp ifc, no playback"; return false; } @@ -648,7 +648,7 @@ bool TopicReplayInterface::playbackInit(const QJsonObject &attributes) if (m_snapshot.id() <= 0 || m_snapshot.timeStamp() < 1) { - WARNING_LOG() << "cannot fetch live snapshot data (maybe snapshot with id '"<snapshotAdjustSitMap(m_snapshot, true, m_originalMapSettings, nullptr, m_logger)) { - WARNING_LOG() << "Cannot adjust Situation Map Ifc from Snapshot app"; + WARNING_LOG(m_logger) << "Cannot adjust Situation Map Ifc from Snapshot app"; return false; } @@ -720,15 +720,15 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) event->type() == LtsWidgets::AddSnapshotEvent::addSnapshotEventId() || event->type() == LtsWidgets::SaveSnapshotEvent::saveSnapshotEventId())) { - ERROR_LOG() << "Filtering voice commands (add/set marker, add/save snapshot)"; + ERROR_LOG(m_logger) << "Filtering voice commands (add/set marker, add/save snapshot)"; if (event->type() == LtsWidgets::SetMarkerEvent::setMarkerEventId()) { - DEBUG_LOG() << "Set marker"; + DEBUG_LOG(m_logger) << "Set marker"; auto ev = static_cast(event); - DEBUG_LOG() << "Event description = " << ev->getDescription(); + DEBUG_LOG(m_logger) << "Event description = " << ev->getDescription(); MarkerManagement::Marker req; @@ -763,13 +763,13 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) })) { req.id(m_requestHelper->getRepliedId()); - DEBUG_LOG() << "Saved Marker with id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Saved Marker with id = " << m_requestHelper->getRepliedId(); } } if (event->type() == LtsWidgets::AddMarkerEvent::addMarkerEventId()) { - DEBUG_LOG() << "init dialog Add marker"; + DEBUG_LOG(m_logger) << "init dialog Add marker"; LtsWidgets::LtsBaseLayoutWidget *baseLayout = m_session->baseLayout(); @@ -793,7 +793,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) } if (event->type() == LtsWidgets::AddSnapshotEvent::addSnapshotEventId() && m_snapshotsAvailable) { - DEBUG_LOG() << "init dialog Add snapshot"; + DEBUG_LOG(m_logger) << "init dialog Add snapshot"; LtsWidgets::LtsBaseLayoutWidget *baseLayout = m_session->baseLayout(); @@ -818,11 +818,11 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) if (event->type() == LtsWidgets::SaveSnapshotEvent::saveSnapshotEventId() && m_snapshotsAvailable) { - DEBUG_LOG() << "Save snapshot"; + DEBUG_LOG(m_logger) << "Save snapshot"; auto ev = static_cast(event); - DEBUG_LOG() << "Event description = " << ev->getDescription(); + DEBUG_LOG(m_logger) << "Event description = " << ev->getDescription(); qint64 partitionTime = m_session->partitionTime(); @@ -854,7 +854,7 @@ bool InterfaceImpl::eventFilter(QObject *obj, QEvent *event) })) { req.id(m_requestHelper->getRepliedId()); - DEBUG_LOG() << "Saved Snapshot with id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Saved Snapshot with id = " << m_requestHelper->getRepliedId(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.h index 7eb0daef6..feb1aa005 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_edit_gui_plugin.h @@ -73,6 +73,8 @@ public: QVector additionalTrackEntries(const QJsonObject &attributes) const override; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_srpIfc; Snapshot m_snapshot; QByteArray m_originalMapSettings; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_set_markers.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_set_markers.cpp index 4bd73562a..5f7839d3e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_set_markers.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/mrk_set_markers.cpp @@ -61,7 +61,8 @@ bool containsStream(QComboBox *cb, const QString &internalStreamName) namespace MarkerManagement { -FinishedSignal::FinishedSignal():QObject(){} +FinishedSignal::FinishedSignal() : QObject(), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} SetMarkers::SetMarkers(LtsSession::LtsSession *session, QWidget *parent) @@ -169,7 +170,7 @@ bool SetMarkers::apply() } catch(const std::exception &ex) { - ERROR_LOG() << "saving marker failed: " << ex.what(); + ERROR_LOG(m_logger) << "saving marker failed: " << ex.what(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("Failed to save marker. Please try again later.")); return false; } @@ -333,13 +334,13 @@ void SetMarkers::sendMarkerRequest() noexcept(false) req.timeStampOffset(m_ui->cbxOffset->currentText().toInt() * 1000); req.fileContentId(m_fileId); - DEBUG_LOG() << "Start Marker request with file content Id = " << m_fileId; + DEBUG_LOG(m_logger) << "Start Marker request with file content Id = " << m_fileId; auto id = m_ftc->markerModifyRequest(req); m_editData.id(id); - DEBUG_LOG() << "Saved marker with id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Saved marker with id = " << m_requestHelper->getRepliedId(); } void SetMarkers::saveMarkerInLibrary() noexcept(false) @@ -351,13 +352,13 @@ void SetMarkers::saveMarkerInLibrary() noexcept(false) .arg(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) .arg(m_ui->teNote->toPlainText().left(20)); - DEBUG_LOG() << "saveMarkerInLibrary: " << title; + DEBUG_LOG(m_logger) << "saveMarkerInLibrary: " << title; auto spSitMapGuiIfc = m_sitMapGuiIfc.lock(); if (!spSitMapGuiIfc->isMapReady()) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Cannot create a marker as the map is not ready yet.")); - ERROR_LOG() << Q_FUNC_INFO << " sitMapGuiInterface not ready"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " sitMapGuiInterface not ready"; return; } @@ -369,13 +370,13 @@ void SetMarkers::saveMarkerInLibrary() noexcept(false) auto onImage = [this, &fig, &image](const QImage &_image) { image = _image; - DEBUG_LOG() << "onImage callback: image size (w, h) = (" << image.width() << ", " << image.height() << ")"; + DEBUG_LOG(m_logger) << "onImage callback: image size (w, h) = (" << image.width() << ", " << image.height() << ")"; QMetaObject::invokeMethod(fig.get(), &FinishedSignal::finished, Qt::QueuedConnection); }; if (!spSitMapGuiIfc->toImage(this, onImage)) { - ERROR_LOG() << "Failed to save marker image from map"; + ERROR_LOG(m_logger) << "Failed to save marker image from map"; return; } @@ -418,17 +419,17 @@ void SetMarkers::saveMarkerInLibrary() noexcept(false) } catch(const std::exception &ex) { - ERROR_LOG() << "failed to save image for marker: " << ex.what(); + ERROR_LOG(m_logger) << "failed to save image for marker: " << ex.what(); return; } - DEBUG_LOG() << "Saved file in library with id = " << m_fileId; + DEBUG_LOG(m_logger) << "Saved file in library with id = " << m_fileId; sendMarkerRequest(); if (m_editData.fileContentId() != m_fileId) { - DEBUG_LOG() << "One more request needed!"; + DEBUG_LOG(m_logger) << "One more request needed!"; m_editData.fileContentId(m_fileId); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.cpp index a28099b2e..e0d7afaf7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.cpp @@ -51,7 +51,7 @@ SnapshotDialog::SnapshotDialog(const QString &menuGroup, LtsSession::LtsSession , m_planEditorApp(nullptr) , m_fileId(-1) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); m_buttonBox->connectButton(LtsWidgets::DialogButton::Show, @@ -82,16 +82,16 @@ SnapshotDialog::SnapshotDialog(const QString &menuGroup, LtsSession::LtsSession setOnlineHelpFilename(QStringLiteral("Situation-Snapshots")); m_ui->widget->setSelectionMode(QAbstractItemView::SelectionMode::ExtendedSelection); session->getForeignGuiInterface(m_flmGui); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } SnapshotDialog::~SnapshotDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -120,7 +120,7 @@ void SnapshotDialog::onShow() void SnapshotDialog::onRefreshCurrent(const Snapshot &snapshot) { - INFO_LOG() << Q_FUNC_INFO << " current SnapshotId: " << snapshot.id(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << snapshot.id(); if (snapshot.id() != m_currentSnapshot.id()) @@ -133,7 +133,7 @@ void SnapshotDialog::onRefreshCurrent(const Snapshot &snapshot) void SnapshotDialog::showSnapshot() { - INFO_LOG() << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id(); showSnapshotInternal(m_currentSnapshot, true); enaDisa(); @@ -146,7 +146,7 @@ bool SnapshotDialog::applyFilter(const Snapshot &snapshot) if (filterContent.isEmpty()) { - ERROR_LOG() << "filterContent is empty, snapshot.id()="<< snapshot.id(); + ERROR_LOG(m_logger) << "filterContent is empty, snapshot.id()="<< snapshot.id(); return false; } @@ -155,7 +155,7 @@ bool SnapshotDialog::applyFilter(const Snapshot &snapshot) if (!appFilter.applyFilter(filterContent)) { - ERROR_LOG() << Q_FUNC_INFO << " Error while applying filters"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error while applying filters"; return false; } @@ -178,13 +178,13 @@ bool SnapshotDialog::applyFilter(const Snapshot &snapshot) MarkerManagementApplyFilter appFilter2(pe_session, pe_fltParticipantIfc, pe_fltAesIfc, pe_fltBuildingComponentIfc); if (!appFilter2.applyFilter(filterContent)) { - ERROR_LOG() << Q_FUNC_INFO << "Error while applying filters"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error while applying filters"; return false; } } else - ERROR_LOG() << Q_FUNC_INFO << "getForeignGuiInterface failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "getForeignGuiInterface failed"; } else - ERROR_LOG() << Q_FUNC_INFO << "Internal error - can not get previously created session!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Internal error - can not get previously created session!"; } @@ -204,7 +204,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF SituationMap::SitMapUpdatesEnabledHelper sitMapHelper(spSitMapGuiIfc); const int partitionId = m_session->partitionId(); - INFO_LOG() << Q_FUNC_INFO << " current Snapshot: " << snapshot + INFO_LOG(m_logger) << Q_FUNC_INFO << " current Snapshot: " << snapshot << ", replayPartition: " << partitionId << ", applyFilter=" << bApplyFilter; @@ -218,7 +218,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF if (!m_requestHelper->startSingleRequest([req, this]() { return m_srpFtc->changeReplayStateRequest(req, this); })) { - ERROR_LOG() << "Replay could not be started for partition id = " << partitionId; + ERROR_LOG(m_logger) << "Replay could not be started for partition id = " << partitionId; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Replay could not be started for partition with id %1").arg(partitionId)); return false; } @@ -229,7 +229,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF if (bApplyFilter) if (!applyFilter(snapshot)) { - ERROR_LOG() << "applyFilter failed, partition id = " << partitionId; + ERROR_LOG(m_logger) << "applyFilter failed, partition id = " << partitionId; success = false; } @@ -239,7 +239,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF std::shared_ptr ovrDtc; if (m_session->getForeignGuiInterface(ovrDtc)) { - INFO_LOG() << Q_FUNC_INFO << " unloadAllPlans via PlanOverlaysPlugin to update dialog"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " unloadAllPlans via PlanOverlaysPlugin to update dialog"; ovrDtc->unloadAllPlans(); } @@ -254,13 +254,13 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF { const bool bIsMapReady = spSitMapGuiIfc->isMapReady(); - INFO_LOG() << Q_FUNC_INFO << " bIsMapReady = " << bIsMapReady; + INFO_LOG(m_logger) << Q_FUNC_INFO << " bIsMapReady = " << bIsMapReady; if (bIsMapReady) { if (!spSitMapGuiIfc->planOverlaySetContent(snapShotOverlayId, tr("Snapshot-PlanOverlay"), planOverlay, true)) { - ERROR_LOG() << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshot.id() + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshot.id() << " planOverlay.size()=" << planOverlay.size() << " planOverlay=" << planOverlay; success = false; @@ -298,16 +298,16 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF const int snapshotId = snapshot.id(); auto onMapIsReadyFn = [this, spSitMapGuiIfc, planOverlay, snapshotId]() { - INFO_LOG() << Q_FUNC_INFO << " try again: do planOverlaySetContent..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " try again: do planOverlaySetContent..."; if (!spSitMapGuiIfc->planOverlaySetContent(snapShotOverlayId, tr("Snapshot-PlanOverlay"), planOverlay, true)) { - ERROR_LOG() << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshotId + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error add planOverlay to snapshot, SnapshotId: " << snapshotId << " planOverlay.size()=" << planOverlay.size() << " planOverlay=" << planOverlay; } }; if (!spSitMapGuiIfc->setMapReadyCallback(this, onMapIsReadyFn)) - ERROR_LOG() << Q_FUNC_INFO << ", setMapReadyCallback failed, SnapshotId: " << snapshotId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", setMapReadyCallback failed, SnapshotId: " << snapshotId; } } @@ -320,7 +320,7 @@ bool SnapshotDialog::showSnapshotInternal(const Snapshot &snapshot, bool bApplyF const QByteArray ba(QByteArray::fromRawData(snapshot.movementTracks().c_str(), snapshot.movementTracks().size())); if (!spSitMapGuiIfc->setMovementTrackManagerSettingsJSon(ba)) { - ERROR_LOG() << Q_FUNC_INFO << " Error setMovementTrackManagerSettingsJSon, SnapshotId: " << snapshot.id(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error setMovementTrackManagerSettingsJSon, SnapshotId: " << snapshot.id(); success = false; } } @@ -367,7 +367,7 @@ void SnapshotDialog::onEditPlan() if (!m_planEditorApp) { - ERROR_LOG() << "Creating Plan Editor-Snapshot failed."; + ERROR_LOG(m_logger) << "Creating Plan Editor-Snapshot failed."; return; } @@ -391,7 +391,7 @@ void SnapshotDialog::onEditPlan() void SnapshotDialog::onPlaneditorFinished() { - DEBUG_LOG() << Q_FUNC_INFO << " onPlaneditorFinished" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " onPlaneditorFinished" << " m_planEditorHasUpdatedThePlan=" << m_planEditorHasUpdatedThePlan; @@ -417,7 +417,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() auto session = m_planEditorApp->getSession(IDL::PartitionType::Replay, partitionId); if (!session) { - ERROR_LOG() << Q_FUNC_INFO << " Internal error - can not get previously created session!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Internal error - can not get previously created session!"; return; } @@ -436,7 +436,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() session->getForeignGuiInterface(planEditorIfc); if (!sitMapGuiIfc || !planEditorIfc) { - WARNING_LOG() << "Can not create plan editor app - found not all required interfaces"; + WARNING_LOG(m_logger) << "Can not create plan editor app - found not all required interfaces"; m_planEditorApp->deleteLater(); m_planEditorApp = nullptr; return; @@ -446,7 +446,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() - DEBUG_LOG() << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " current SnapshotId: " << m_currentSnapshot.id() << ", PlanEditor - partitionId = " << partitionId; SituationReplay::ChangeReplayStateRequest req; @@ -459,7 +459,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() if (!m_requestHelper->startSingleRequest([req, this]() { return m_srpFtc->changeReplayStateRequest(req, this); })) { - ERROR_LOG() << Q_FUNC_INFO << " Replay could not be started for partition id = " << partitionId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Replay could not be started for partition id = " << partitionId; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Replay could not be started for partition with id %1").arg(partitionId)); m_planEditorApp->deleteLater(); return; @@ -474,7 +474,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() const QJsonDocument jDoc(QJsonDocument::fromJson(ba, &parserError)); if (parserError.error != QJsonParseError::NoError) { - ERROR_LOG() << "Error parsing json document: " << parserError.errorString(); + ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return; } @@ -483,7 +483,7 @@ void SnapshotDialog::slotReplaySessionForPlanEditorStarted() if (oms.mode == SituationMap::Mode::Mode_3D) { - DEBUG_LOG() << " PlanEditor in 3D not supported yet, use 2D"; + DEBUG_LOG(m_logger) << " PlanEditor in 3D not supported yet, use 2D"; oms.mode = SituationMap::Mode::Mode_2D; sitMapGuiIfc->setOperatorMapSettingsJson(oms.toJson()); } else { @@ -534,12 +534,12 @@ void SnapshotDialog::prepareIndex(const QModelIndex &idx) { const MarkerManagement::Snapshot &snapshot = m_model->getRowData(idx.row()); - DEBUG_LOG() << "Prepare index for snapshot with id = " << snapshot.id(); + DEBUG_LOG(m_logger) << "Prepare index for snapshot with id = " << snapshot.id(); const int fileId = snapshot.fileContentId(); if (fileId > 0) { - DEBUG_LOG() << "Loading file content with id = " << fileId; + DEBUG_LOG(m_logger) << "Loading file content with id = " << fileId; QByteArray content; if (m_flmGui->loadContent(fileId, content) && content.size() > 0) @@ -551,17 +551,17 @@ void SnapshotDialog::prepareIndex(const QModelIndex &idx) m_imageTitles.append( name + QStringLiteral(" (")+ timeStr + QStringLiteral(")")); m_images.append(QImage::fromData(content)); - DEBUG_LOG() << " title=" << m_imageTitles.last() + DEBUG_LOG(m_logger) << " title=" << m_imageTitles.last() << " description=" << m_descriptions.last() << " content.size=" << content.size(); } else { - ERROR_LOG() << "Cannot retrieve file content for fileId = " << fileId; + ERROR_LOG(m_logger) << "Cannot retrieve file content for fileId = " << fileId; } } else - WARNING_LOG() << "Not found: file id = 0 for snapshot id = " << snapshot.id(); + WARNING_LOG(m_logger) << "Not found: file id = 0 for snapshot id = " << snapshot.id(); } @@ -572,20 +572,20 @@ void SnapshotDialog::onPrint() m_imageTitles.clear(); m_images.clear(); - DEBUG_LOG() << "selectedRows.size()=" << selectedRows.size(); + DEBUG_LOG(m_logger) << "selectedRows.size()=" << selectedRows.size(); for (const QModelIndex &idx : selectedRows) prepareIndex(idx); if (m_images.size() > 0) LtsPrinting::printImages(m_session, this, tr("Snapshots"), m_images, m_imageTitles, m_descriptions); else - ERROR_LOG() << "No snapshots selected or no valid images to print"; + ERROR_LOG(m_logger) << "No snapshots selected or no valid images to print"; } bool SnapshotDialog::saveSnapshotPlan(const QByteArray &planXMLContent) { - DEBUG_LOG() << Q_FUNC_INFO << " save snapshot"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " save snapshot"; m_currentSnapshot.planOverlay(planXMLContent.constData()); @@ -597,7 +597,7 @@ bool SnapshotDialog::saveSnapshotPlan(const QByteArray &planXMLContent) if (!ok) { - ERROR_LOG() << "Error while updating snapshot plan overlay"; + ERROR_LOG(m_logger) << "Error while updating snapshot plan overlay"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error while updating snapshot plan overlay"), tr("Saving Plan to Snapshot") ); } else @@ -656,7 +656,7 @@ bool SnapshotDialog::init(const std::shared_ptrsetMapReadyCallback(this, [this]() { enaDisa(); })) - ERROR_LOG() << Q_FUNC_INFO << " setMapReadyCallback failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " setMapReadyCallback failed" << ", m_session->toString " << m_session->toString() << ", this=" << this; }); @@ -669,7 +669,7 @@ bool SnapshotDialog::init(const std::shared_ptrdisconnect(this); @@ -778,7 +778,7 @@ void SnapshotDialog::onEditMetaData() if (snapshot.id() <= 0) return; - INFO_LOG() << "current SnapshotId: " << snapshot.id(); + INFO_LOG(m_logger) << "current SnapshotId: " << snapshot.id(); if (snapshot.operatorId() == LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) { @@ -874,7 +874,7 @@ void SnapshotDialog::saveSnapshotFilter() auto spSitMapGuiIfc = m_sitMapGuiIfc.lock(); if (!spSitMapGuiIfc) { - ERROR_LOG() << Q_FUNC_INFO << ", no m_sitMapGuiIfc, return"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", no m_sitMapGuiIfc, return"; return; } @@ -886,7 +886,7 @@ void SnapshotDialog::saveSnapshotFilter() req.mapSettings(mapSettings.data()); req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); - DEBUG_LOG() << "File content id (of preview image) = " << m_currentSnapshot.fileContentId(); + DEBUG_LOG(m_logger) << "File content id (of preview image) = " << m_currentSnapshot.fileContentId(); req.fileContentId(m_fileId); @@ -902,7 +902,7 @@ void SnapshotDialog::saveSnapshotFilter() if (!m_requestHelper->startSingleRequest([req, this]() { return m_mrkFtc->snapshotModifyRequest(req, this);})) - ERROR_LOG() << "Saving snapshot filter failed"; + ERROR_LOG(m_logger) << "Saving snapshot filter failed"; else { __unchange__(); @@ -935,12 +935,12 @@ void SnapshotDialog::saveSnapshotPreviewInLibrary(const QString &snapshotTitle) .arg(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) .arg(snapshotTitle.left(20)); - DEBUG_LOG() << "saveSnapshotPreviewInLibrary: " << title; + DEBUG_LOG(m_logger) << "saveSnapshotPreviewInLibrary: " << title; auto spSitMapGuiIfc = m_sitMapGuiIfc.lock(); if (!spSitMapGuiIfc->isMapReady()) { - ERROR_LOG() << Q_FUNC_INFO << " sitMapGuiInterface not ready"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " sitMapGuiInterface not ready"; return; } @@ -966,7 +966,7 @@ void SnapshotDialog::saveSnapshotPreviewInLibrary(const QString &snapshotTitle) snapshotFolderId = m_flmDtc->findFolder(initialFolderId, QStringLiteral("Snapshots")); } - DEBUG_LOG() << "Initial folder Id = " << initialFolderId + DEBUG_LOG(m_logger) << "Initial folder Id = " << initialFolderId << " snapshotFolderId =" << snapshotFolderId; const int folderId = snapshotFolderId > 0 ? snapshotFolderId : initialFolderId; @@ -995,17 +995,17 @@ void SnapshotDialog::saveSnapshotPreviewInLibrary(const QString &snapshotTitle) })) { m_fileId = m_requestHelper->getRepliedId(); - DEBUG_LOG() << Q_FUNC_INFO << " Saved file in library with id = " << m_fileId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Saved file in library with id = " << m_fileId; saveSnapshotFilter(); if (m_currentSnapshot.fileContentId() != m_fileId) { - DEBUG_LOG() << Q_FUNC_INFO << " One more request needed!"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " One more request needed!"; m_currentSnapshot.fileContentId(m_fileId); } } else { - ERROR_LOG() << Q_FUNC_INFO << " Saved file in library with id = " << m_fileId << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Saved file in library with id = " << m_fileId << " failed"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.h index 1a277e186..3e931eec1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog.h @@ -63,6 +63,7 @@ public: void showSnapshot(); protected: + NGL::INGLLogger &m_logger; void onSnapshotRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onReplayPartitionRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject);} void onChangeReplayStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject);} @@ -80,6 +81,7 @@ public: void onSymbolAppearanceUpdateReply(const Core::FunctionReplyObject &reply) override final { m_requestHelper->requestReply(reply); } protected: + NGL::INGLLogger &m_logger; void aboutToClose() override; private slots: void enaDisa(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog_model.cpp index 8a261990c..1a184dc44 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MarkerManagement/Gui/MarkerEdit/snapshot_dialog_model.cpp @@ -182,7 +182,7 @@ void SnapshotDialogModel::loadPreview(int fileContentId, int rowId) QByteArray byteArray; if (m_flmGui->loadContent(fileContentId, byteArray, true) && byteArray.size() > 0) { - DEBUG_LOG() << "m_previews.insert fileContentId=" << fileContentId + DEBUG_LOG(m_logger) << "m_previews.insert fileContentId=" << fileContentId << " size Preview=" << byteArray.size(); QImage img = LtsUtils::getImage(byteArray); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging.h index 7458e09c7..5a9cd72d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging.h @@ -41,6 +41,8 @@ public: const MessagingModel::Box &box); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onShowMessage(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.cpp index 9b3dee468..99c2bfb69 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.cpp @@ -151,7 +151,7 @@ void MessagingModel::onSpecificsEquipmentChanged(const TrainingAreaBaseOC::Speci int oldParticipantId = m_ownParticipantId; m_ownParticipantId = m_ppmDtc->participantIdByEquipmentNumber(data.equipmentNumber()); if (m_ownParticipantId <= 0) - WARNING_LOG() << "EquipmentNumber " << data.equipmentNumber() << " is not present in current set of PPM-participants."; + WARNING_LOG(m_logger) << "EquipmentNumber " << data.equipmentNumber() << " is not present in current set of PPM-participants."; if (oldParticipantId != m_ownParticipantId) reInitModel(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.h index 71524e966..368217364 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_messaging_model.h @@ -50,6 +50,8 @@ public: QVariant data(const QModelIndex &, int) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const OperatorMessage &msg, DataModification modType) const override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_new_message_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_new_message_dialog.cpp index fe59172f0..4093df327 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_new_message_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_new_message_dialog.cpp @@ -93,7 +93,7 @@ NewMessageDialog::NewMessageDialog(LtsSession::LtsSession *session, QWidget *par , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_session(session) { - INFO_LOG() << "NewMessageDialog::Konstruktor"; + INFO_LOG(m_logger) << "NewMessageDialog::Konstruktor"; m_ui->setupUi(this); m_ui->leSubject->clear(); @@ -166,7 +166,7 @@ bool NewMessageDialog::init(const std::shared_ptr &dt m_ftc = ftc; m_opmCbxDtc = opmCbxDtc; - INFO_LOG() << "NewMessageDialog::init"; + INFO_LOG(m_logger) << "NewMessageDialog::init"; fillAddressBox(); return true; @@ -182,7 +182,7 @@ bool NewMessageDialog::initAnswerDialog(const Messaging::OperatorMessage &msg) if (msg.senderType() == Messaging::AddressType_def::ObserverController) { int idx = m_ui->cmbOperators->findData(0-msg.senderId()); - INFO_LOG() << "senderId=" << 0-msg.senderId() + INFO_LOG(m_logger) << "senderId=" << 0-msg.senderId() << " idx = " << idx; m_ui->cmbOperators->setCurrentIndex(idx); } @@ -223,11 +223,11 @@ bool NewMessageDialog::initAnswerDialog(const Messaging::OperatorMessage &msg) bool NewMessageDialog::apply() { - DEBUG_LOG() << "--- onSendMessage() "; + DEBUG_LOG(m_logger) << "--- onSendMessage() "; QString subject = m_ui->leSubject->text(); QString message = m_ui->teMessage->toPlainText(); - DEBUG_LOG() << "subject = " << subject + DEBUG_LOG(m_logger) << "subject = " << subject << ",message = " << message; @@ -238,7 +238,7 @@ bool NewMessageDialog::apply() { CreateOperatorMessageRequest comr; - DEBUG_LOG() << "request for Operators"; + DEBUG_LOG(m_logger) << "request for Operators"; comr.senderId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); comr.subject(subject.toStdString()); comr.senderType(Messaging::AddressType_def::type::Operator); @@ -250,21 +250,21 @@ bool NewMessageDialog::apply() for (const RecipientModel::Recipient &r : recvOperators) { comr.recipientIds().push_back(r.recipientId); - DEBUG_LOG() << "recipientId =" << r.recipientId; + DEBUG_LOG(m_logger) << "recipientId =" << r.recipientId; } m_requestHelper->addRequest([comr, this]() { - DEBUG_LOG() << "m_ftc->createOperatorMessageRequest "; + DEBUG_LOG(m_logger) << "m_ftc->createOperatorMessageRequest "; return m_ftc->createOperatorMessageRequest(comr, this); }); } - DEBUG_LOG() << " m_recipientModel->countOcMessages=" << recvOCs.size(); + DEBUG_LOG(m_logger) << " m_recipientModel->countOcMessages=" << recvOCs.size(); if (!recvOCs.isEmpty()) { CreateOperatorMessageRequest comrOC; - DEBUG_LOG() << "request for OCs"; + DEBUG_LOG(m_logger) << "request for OCs"; comrOC.senderId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); comrOC.subject(subject.toStdString()); comrOC.senderType(Messaging::AddressType_def::type::Operator); @@ -275,11 +275,11 @@ bool NewMessageDialog::apply() for (const RecipientModel::Recipient &r : recvOCs) { comrOC.recipientIds().push_back(r.recipientId); - DEBUG_LOG() << "recipientId OC =" << r.recipientId; + DEBUG_LOG(m_logger) << "recipientId OC =" << r.recipientId; } m_requestHelper->addRequest([comrOC, this]() { - DEBUG_LOG() << "m_ftc->createOperatorMessageRequest OC"; + DEBUG_LOG(m_logger) << "m_ftc->createOperatorMessageRequest OC"; return m_ftc->createOperatorMessageRequest(comrOC, this); }); } @@ -295,7 +295,7 @@ void NewMessageDialog::fillAddressBox() void NewMessageDialog::addrTypeChanged() { - DEBUG_LOG() << "************** addrTypeChanged "; + DEBUG_LOG(m_logger) << "************** addrTypeChanged "; fillAddressBox(); if (m_session->app() != LtsAppDescriptor::App::OC) m_ui->lblCharsLeft->setVisible(m_ui->cbxAddrType->isChecked() || m_recipientsContainsOc); @@ -310,13 +310,13 @@ void NewMessageDialog::addAddr() r.recipientId = abs(m_ui->cmbOperators->currentData().toInt()); m_recipientModel->addData(r); - DEBUG_LOG() << "************** addAddr: " << m_ui->cmbOperators->currentText() + DEBUG_LOG(m_logger) << "************** addAddr: " << m_ui->cmbOperators->currentText() << " isOperator:" << r.isOperator; } void NewMessageDialog::removeAddr() { - DEBUG_LOG() << "************** removeAddr "; + DEBUG_LOG(m_logger) << "************** removeAddr "; QModelIndex modelIndex = m_ui->addrListView->currentIndex(); m_recipientModel->removeData(modelIndex); m_ui->addrRemoveButton->setEnabled(m_recipientModel->rowCount() > 0); @@ -325,7 +325,7 @@ void NewMessageDialog::removeAddr() void NewMessageDialog::onAddrSelectionChanged() { - DEBUG_LOG() << "************** onAddrSelectionChanged "; + DEBUG_LOG(m_logger) << "************** onAddrSelectionChanged "; m_ui->addrRemoveButton->setEnabled(true); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_show_message_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_show_message_dialog.cpp index b9363e6f5..f85b18f2c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_show_message_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Messaging/Gui/Messaging/msg_show_message_dialog.cpp @@ -71,7 +71,7 @@ bool ShowMessageDialog::init(const std::shared_ptr &dtc, QDateTime qDateTime; qDateTime.setMSecsSinceEpoch(operatorMessage.timeStamp()); QString time = qDateTime.toUTC().toString(); - INFO_LOG() << " time = " << time; + INFO_LOG(m_logger) << " time = " << time; m_ui->time->setText(time); m_ui->msgContent->append(QString::fromStdString(operatorMessage.message())); @@ -128,13 +128,13 @@ void ShowMessageDialog::onAnswerMessage() NewMessageDialog *answerDialog = new NewMessageDialog(m_session, this); if (!answerDialog->init(m_dtc, m_ftc, m_opmCbxDtc)) { - ERROR_LOG() << "Can't initialize NewMessageDialog!"; + ERROR_LOG(m_logger) << "Can't initialize NewMessageDialog!"; return; } if (!answerDialog->initAnswerDialog(m_operatorMessage)) { - ERROR_LOG() << "Can't set values from previous message!"; + ERROR_LOG(m_logger) << "Can't set values from previous message!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.cpp index e0b60292e..adccc4085 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.cpp @@ -101,7 +101,7 @@ void MeteoDataView::onEditStaticMeteoData() MeteoDataManagement::MeteoData meteoData = m_model->getRowData(row); - DEBUG_LOG() << "--- onEditStaticMeteoData() " + DEBUG_LOG(m_logger) << "--- onEditStaticMeteoData() " << " id: " << meteoData.id() << " mduId: " << meteoData.weatherStationId() << " isStaticData: " << meteoData.isStaticMeteoData() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.h index 006cce0b2..73ddb2c1c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data.h @@ -30,6 +30,8 @@ public: const std::shared_ptr &ftc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); void onEditStaticMeteoData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data_model.h index 7bb0706e4..7b983a0e2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_meteo_data_model.h @@ -35,6 +35,8 @@ public: QVariant data(const QModelIndex &, int) const override final; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.cpp index 1f3a1cf63..788c68ae8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.cpp @@ -42,11 +42,11 @@ bool StaticMeteoDataEdit::init(const std::shared_ptr &ftc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "StaticMeteoDataEdit::init()"; + DEBUG_LOG(m_logger) << "StaticMeteoDataEdit::init()"; if (!dtc || !ftc || !session) { - ERROR_LOG() << "StaticMeteoDataEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "StaticMeteoDataEdit::init() Invalid shared_ptr!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.h index ba203a8f6..dc73087f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/MeteoDataManagement/Gui/MeteoData/mdm_static_meteo_data_edit.h @@ -34,6 +34,8 @@ public: bool apply() override; private: + +NGL::INGLLogger &m_logger; void retranslate() override; void loadStaticMeteoDataFromDatabase(); void onStaticMeteoDataModifyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.cpp index 977d26195..d57d41bf2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.cpp @@ -107,7 +107,7 @@ void NotificationManagementDialog::onAcknowledgeNotification() m_requestHelper->startSingleRequest( [&]() { - DEBUG_LOG() << "m_ftc->readReceipt "; + DEBUG_LOG(m_logger) << "m_ftc->readReceipt "; return m_ftc->readReceiptRequest(request, this); }); } @@ -162,7 +162,7 @@ void NotificationManagementDialog::onRemoveNotification() m_requestHelper->startSingleRequest( [&]() { - DEBUG_LOG() << "m_ftc->readReceipt "; + DEBUG_LOG(m_logger) << "m_ftc->readReceipt "; return m_ftc->deleteMessageRequest(request, this); }); } @@ -187,7 +187,7 @@ void NotificationManagementDialog::onShowNotificationContent() QString content = QCoreApplication::translate("Notification", noti.content().c_str()); NomNotification notiDDS = m_dtc->nomNotification(noti.id()); - DEBUG_LOG() << "onShowNotificationContent" + DEBUG_LOG(m_logger) << "onShowNotificationContent" << ", content=" << noti.content() << ", contentArgs().size()=" << noti.contentArgs().size() << ", notiDDS.contentArgs().size()=" << notiDDS.contentArgs().size(); @@ -195,7 +195,7 @@ void NotificationManagementDialog::onShowNotificationContent() for (const std::string& arg : notiDDS.contentArgs()) { content = content.arg(QString::fromStdString(arg)); - DEBUG_LOG() << ".arg() ersetzt immer den kleinsten freien Platzhalter" + DEBUG_LOG(m_logger) << ".arg() ersetzt immer den kleinsten freien Platzhalter" << ", arg=" << arg << ", content=" << content; } @@ -211,7 +211,7 @@ void NotificationManagementDialog::onShowNotificationContent() wid->setMarkdown(content); connect(wid, &QTextBrowser::anchorClicked, this, [this, contentPopup](QUrl link ) { - DEBUG_LOG() << "LINK CLICKED: " << link.toString(); + DEBUG_LOG(m_logger) << "LINK CLICKED: " << link.toString(); auto *event = new LtsWidgets::LtsLinkEvent(link, m_session->baseLayoutWidget()); event->setAccepted(false); QApplication::postEvent(qApp, event); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.h index fa7c2da1e..7694d2ee1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog.h @@ -41,6 +41,8 @@ class NotificationManagementDialog void onShowNotificationContent(); protected: + + NGL::INGLLogger &m_logger; void onReadReceiptReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onDeleteMessageReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.cpp index b46a35d1b..2cca7513c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.cpp @@ -52,7 +52,7 @@ bool NotificationManagementDialogModel::initModel(const LtsSession::LtsSessionDa insertRow(noti); }); - INFO_LOG() << "initModel - #notis: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #notis: " << m_vecData.size(); return true; } @@ -189,7 +189,7 @@ QString NotificationManagementDialogModel::getNameByAddressId(int addressId, con { if (addr.addressType() == AddressType_def::Operator) { - DEBUG_LOG() << "addressId=" << addressId + DEBUG_LOG(m_logger) << "addressId=" << addressId << ", addr.addressId()).name()=" << QString::fromStdString(m_dtcOpm->user(addr.addressId()).name()); return QString::fromStdString(m_dtcOpm->user(addr.addressId()).name()); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.h index bd0f914c9..3ccabbc29 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/NotificationManagement/Gui/NotificationEdit/nom_dialog_model.h @@ -38,6 +38,8 @@ class NotificationManagementDialogModel final : public LtsWidgets::LtsAbstractTa bool initModel(const LtsSession::LtsSessionDataDds *session); protected: + + NGL::INGLLogger &m_logger; int getId(const NotificationManagement::NomNotification &data) const override final; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.cpp index 317422323..0a7544dab 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.cpp @@ -121,7 +121,7 @@ bool BaseDownloader::init() void BaseDownloader::onStartBaseDownloadReply(const BaseDownloadReply &replyObject) { - DEBUG_LOG() << "NEW STATE REPLY: " << replyObject.currentStep() << " \n" << replyObject.progress(); + DEBUG_LOG(m_logger) << "NEW STATE REPLY: " << replyObject.currentStep() << " \n" << replyObject.progress(); switch (replyObject.replyState().underlying()) { case Core::FtReplyState::InProgress: @@ -208,7 +208,7 @@ void BaseDownloader::startBaseDownload() m_ui->leServer->text().toStdString(), QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "EXERCISE ID: " << m_exerciseId; + DEBUG_LOG(m_logger) << "EXERCISE ID: " << m_exerciseId; if (m_ftc->startBaseDownloadRequest(req, this)) { @@ -317,13 +317,13 @@ void BaseDownloader::onNewTextMessageFromSocket(const QString &message) m_timer->stop(); if (m_state == ConnectionState::ConnectedToExternalServer) { - DEBUG_LOG() << "message from SVC " << message; + DEBUG_LOG(m_logger) << "message from SVC " << message; doConnectToExerciseManagement(message); } else if (m_state == ConnectionState::ConnectedToExerciseManagement) { - DEBUG_LOG() << "message from EXM " << message; + DEBUG_LOG(m_logger) << "message from EXM " << message; fillExerciseModel(message); } } @@ -400,7 +400,7 @@ void BaseDownloader::onOcPdfDownloadClicked() } const QString matrixOperator = LtsSessionData::LtsSessionData::getInstance()->getOperatorName(); - DEBUG_LOG()<ocPdfDownloadRequest(req, this); } @@ -417,12 +417,12 @@ void BaseDownloader::doConnectToExerciseManagement(const QString &message) QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8()); if (!doc.isObject()) { - WARNING_LOG() << "No Valid Object in " << message; + WARNING_LOG(m_logger) << "No Valid Object in " << message; return; } if (!doc.object().value(QStringLiteral("data")).isArray()) { - WARNING_LOG() << "No Data Array in" << message; + WARNING_LOG(m_logger) << "No Data Array in" << message; return; } @@ -456,7 +456,7 @@ void BaseDownloader::doConnectToExerciseManagement(const QString &message) if (exPort > 0) { - DEBUG_LOG() << "Connect To EXM"; + DEBUG_LOG(m_logger) << "Connect To EXM"; m_socket->open(getUrl(m_ui->leServer->text(), exPort)); } @@ -465,14 +465,14 @@ void BaseDownloader::doConnectToExerciseManagement(const QString &message) QUrl BaseDownloader::getUrl(const QString &adress, unsigned short port) const { QString url = QLatin1String("ws://") + adress + QLatin1Char(':') + QString::number(port); - DEBUG_LOG() << "Connect to: " << url; + DEBUG_LOG(m_logger) << "Connect to: " << url; return QUrl(url); } void BaseDownloader::sendProcessListRequest() { - DEBUG_LOG() << "send processListRequest message to SVC"; + DEBUG_LOG(m_logger) << "send processListRequest message to SVC"; m_timer->start(); m_socket->sendTextMessage(QStringLiteral("{\"type\": \"servicePortsInformationRequest\",\"uuid\": \"7777\"}")); m_ui->leStatus->setText(tr("Wait for Service Data.")); @@ -481,7 +481,7 @@ void BaseDownloader::sendProcessListRequest() void BaseDownloader::sendExerciseListRequest() { - DEBUG_LOG() << "send exerciseListRequest message to EXM"; + DEBUG_LOG(m_logger) << "send exerciseListRequest message to EXM"; m_timer->start(); m_ftcTimer->start(); m_socket->sendTextMessage(QStringLiteral("{\"type\": \"exerciseInformationRequest\",\"uuid\": \"7777\"}")); @@ -498,7 +498,7 @@ void BaseDownloader::fillExerciseModel(const QString &exerciseList) QJsonDocument doc = QJsonDocument::fromJson(exerciseList.toUtf8()); if (!doc.isObject() || !doc.object().value(QStringLiteral("data")).isArray()) { - WARNING_LOG() << "No Valid Object in " << exerciseList; + WARNING_LOG(m_logger) << "No Valid Object in " << exerciseList; m_ui->leStatus->setText(tr("Got Invalid Data from Exercise Management.")); return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.h index a6e43afc0..669152b59 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader.h @@ -67,6 +67,8 @@ private Q_SLOTS: void onOcPdfDownloadClicked(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void doConnectToExerciseManagement(const QString &message); QUrl getUrl(const QString &adress, unsigned short port) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_message.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_message.h index 62fcdb3f1..d1568646a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_message.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_message.h @@ -32,6 +32,8 @@ private Q_SLOTS: private: + +NGL::INGLLogger &m_logger; private: Ui::BaseDownloaderMessage *m_ui; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_pdf_selector.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_pdf_selector.h index e27034c69..0912de3a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_pdf_selector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_base_downloader_pdf_selector.h @@ -37,6 +37,8 @@ Q_SIGNALS: void ok(); private: + +NGL::INGLLogger &m_logger; void addFile(const PdfInfo &document); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_ex_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_ex_model.h index d63e47fe2..69a6e04e8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_ex_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcBaseDownload/Gui/BaseDownloader/obd_ex_model.h @@ -32,6 +32,8 @@ public: QVariant data(const QModelIndex &, int) const override final; private: + +NGL::INGLLogger &m_logger; friend class ExProxyModel; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_demand_situation.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_demand_situation.h index 1bf639679..7f3d158c5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_demand_situation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_demand_situation.h @@ -58,6 +58,7 @@ private Q_SLOTS: void onCoordinate(const QPointF &coord, double radius); void onClearCoordinate(); private: +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void dialogCanceled () override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_edit_folder_content.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_edit_folder_content.cpp index 6607d6f70..9343be0eb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_edit_folder_content.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/OcTerminal/osc_edit_folder_content.cpp @@ -60,7 +60,7 @@ bool FolderContentEditDialog::init(LtsSession::LtsSessionDataDds *session) m_session = session; if (!m_session->getFtc(m_obdFtc)) { - ERROR_LOG() << "Cant get Obd FTC can't download"; + ERROR_LOG(m_logger) << "Cant get Obd FTC can't download"; return false; } @@ -130,7 +130,7 @@ void FolderContentEditDialog::onOcPdfDownloadClicked() } const QString matrixOperator = LtsSessionData::LtsSessionData::getInstance()->getOperatorName(); - DEBUG_LOG()<startSingleRequest([req, this]() { @@ -157,13 +157,13 @@ void FolderContentEditDialog::onPreviewFile() if(m_pdfWidget == nullptr) { - WARNING_LOG()<<" pdf widget not initialized. trying to init..."; + WARNING_LOG(m_logger)<<" pdf widget not initialized. trying to init..."; initPdfWidow(); } QFile f(m_currViewPath); if(f.open(QIODevice::ReadOnly)) { - DEBUG_LOG() << "Current File: " << m_currViewPath; + DEBUG_LOG(m_logger) << "Current File: " << m_currViewPath; setPage(1); setZoomFactor(ZOOM_DEFAULT); setRotation(Poppler::Page::Rotate0); @@ -178,7 +178,7 @@ void FolderContentEditDialog::onPreviewFile() void FolderContentEditDialog::onDeleteFile() { - TRACE_LOG()<<" delete file START "; + TRACE_LOG(m_logger)<<" delete file START "; QItemSelectionModel *select = m_ui->filesView->selectionModel(); if(select == nullptr) return; @@ -190,7 +190,7 @@ void FolderContentEditDialog::onDeleteFile() for(const auto index : std::as_const(indexList)) { fileInfoList << m_fileSystemModel->fileInfo(index); - TRACE_LOG()<< "file path:"<setMovementTrackCallback(this, onMovementTrackChangedFunc)) - ERROR_LOG() << Q_FUNC_INFO << " setMovementTrackCallback failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " setMovementTrackCallback failed"; } break; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/ParticipantInfoOc/osc_participant_info.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/ParticipantInfoOc/osc_participant_info.h index e1e5fef34..1b3f16a45 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/ParticipantInfoOc/osc_participant_info.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/ParticipantInfoOc/osc_participant_info.h @@ -37,6 +37,9 @@ public: private: + + +NGL::INGLLogger &m_logger; void retranslate() override; static void setRed(QWidget *w, bool bRed); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list.h index 09ff24804..5b51f43a5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list.h @@ -28,6 +28,8 @@ Q_SIGNALS: void updateAesList(const QSet &newList); private: + +NGL::INGLLogger &m_logger; void retranslate() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list_model.h index 8092f7dde..ab5a209b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_close_aes_list_model.h @@ -38,6 +38,8 @@ public: QVariant data(const QModelIndex &, int) const override; private: + +NGL::INGLLogger &m_logger; LtsSession::LtsSession *m_session; std::shared_ptr m_aesDtc; std::shared_ptr m_pdmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.cpp index ac407b4fe..4e595f9b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.cpp @@ -25,7 +25,7 @@ SelfTest::SelfTest(LtsSession::LtsSession *session, QWidget *parent) if ( m_session->getDtc(m_tabocDtc)) { - WARNING_LOG() << "load tab settings"; + WARNING_LOG(m_logger) << "load tab settings"; connect(m_tabocDtc.get(), &TrainingAreaBaseOC::Interface::Dtc::technicalStateSfmChanged, this, &SelfTest::onSfmStatusChanged); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.h index 86438b3c0..7786a3313 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_selftest.h @@ -35,6 +35,8 @@ private Q_SLOTS: void onCheckLastCondition(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; QString getTechStatError(u_char errorID) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_settings.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_settings.h index a1d3f8b51..208be28fe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_settings.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OcSituationClient/Gui/System/osc_settings.h @@ -51,6 +51,7 @@ private Q_SLOTS: void onResetRange(); void onSoundCheck(); private: +NGL::INGLLogger &m_logger; void loadOperatorSettings(); void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.cpp index 90c7abd2d..388f765b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.cpp @@ -38,7 +38,7 @@ bool OnlineHelpViewerDialog::init(const QString &fileName) else helpDir += (locale + QStringLiteral("/%1.html").arg(fileName)); - INFO_LOG() << "helpDir=" << helpDir; + INFO_LOG(m_logger) << "helpDir=" << helpDir; #ifndef LTS_DEBUG m_ui->lblPage->setVisible(false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.h index 8cef53fcd..de9adcfcb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineHelp/Gui/OnlineHelpViewer/online_help_viewer_dialog.h @@ -30,6 +30,7 @@ private slots: void onContextdMenuReloadRequested(); private: + NGL::INGLLogger &m_logger; void retranslate() override; Ui::OnlineHelpViewerDialog *m_ui; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.cpp index a9d002b6a..52ccd17c9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.cpp @@ -99,10 +99,9 @@ void DetailedChartModel::onDynamicParticipantDataChanged(const ParticipantManage emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1)); } -DetailedChartModel::DetailedChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent) - : AbstractChartModel(config, parent) - .getNGLLogger("OnlineReportDetailedChartModel")) -{ +DetailedChartModel::DetailedChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent) : AbstractChartModel(config, parent) + .getNGLLogger("OnlineReportDetailedChartModel")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_participantStates.insert(ProjectDataManagement::VulnerabilityState::CombatReady, QSet()); m_participantStates.insert(ProjectDataManagement::VulnerabilityState::LightDamage, QSet()); m_participantStates.insert(ProjectDataManagement::VulnerabilityState::MediumDamage, QSet()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.h index 4dd33efee..7292dd754 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_detailed_chart_model.h @@ -24,6 +24,8 @@ private Q_SLOTS: void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; explicit DetailedChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.cpp index 0e302c5de..090b474b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.cpp @@ -61,8 +61,8 @@ void SimpleChartModel::onDynamicParticipantDataChanged(const ParticipantManageme const ParticipantManagement::StateInformation &stateInfo = m_config.ppmDtc->youngestStateInformation(data.stateHistory()); - DEBUG_LOG() << "Participant id = " << data.participantId(); - DEBUG_LOG() << "State Info Vulnerability = " << stateInfo.vulnerabilityState(); + DEBUG_LOG(m_logger) << "Participant id = " << data.participantId(); + DEBUG_LOG(m_logger) << "State Info Vulnerability = " << stateInfo.vulnerabilityState(); if (stateInfo.vulnerabilityState() < ProjectDataManagement::VulnerabilityState::CatastrophicKill) setCombatReady(data.participantId()); @@ -72,10 +72,9 @@ void SimpleChartModel::onDynamicParticipantDataChanged(const ParticipantManageme emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1)); } -SimpleChartModel::SimpleChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent) - : AbstractChartModel(config, parent) - .getNGLLogger("OnlineReportSimpleChartModel")) -{ +SimpleChartModel::SimpleChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent) : AbstractChartModel(config, parent) + .getNGLLogger("OnlineReportSimpleChartModel")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { auto cb = [this](const ParticipantManagement::DynamicParticipantData & data) { if (!m_config.participantIds.contains(data.participantId())) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.h index 7345f3c84..a3f3fbfbe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/Charts/ore_simple_chart_model.h @@ -24,6 +24,8 @@ private Q_SLOTS: void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; explicit SimpleChartModel(const AbstractChartModel::ChartConfig &config, QObject *parent); void setCombatReady(int32_t participantId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.cpp index ec2ff5c39..218bef554 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.cpp @@ -184,7 +184,7 @@ bool CreateReportDialog::apply() m_ppmDtc, participantIds); - DEBUG_LOG() << "Creating new ReportDialog with config: " + DEBUG_LOG(m_logger) << "Creating new ReportDialog with config: " << chartConfig.toJson().toJson(); ReportDialog *dialog = new ReportDialog(chartConfig, this); @@ -215,7 +215,7 @@ void CreateReportDialog::setChildrenSelected(const QModelIndex &parent) if (m_participantModel->hasChildren(childIndex)) setChildrenSelected(childIndex); - DEBUG_LOG() << "Setting row " + DEBUG_LOG(m_logger) << "Setting row " << childIndex.row() << " selected"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.h index 2c62c5e3f..9ee8e7cd4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_create_report_dialog.h @@ -43,6 +43,8 @@ private slots: void onRemoveName(const QString &name); private: + +NGL::INGLLogger &m_logger; bool apply() override; void retranslate() override; void setChildrenSelected(const QModelIndex &parent); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.cpp index 0a135373a..931f66735 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.cpp @@ -37,7 +37,7 @@ ReportDialog::ReportDialog(const AbstractChartModel::ChartConfig &config, QWidge { QString errorStr = tr("Not possible to draw diagram. There are no participants to be looked at"); m_ui->verticalLayout->addWidget(new QLabel(errorStr, this)); - ERROR_LOG() << errorStr; + ERROR_LOG(m_logger) << errorStr; return; } @@ -152,7 +152,7 @@ KDChart::Chart *ReportDialog::createNewChart(const AbstractChartModel::ChartConf if (!diagram) { - ERROR_LOG() << "Got unkown chart type. Aborting."; + ERROR_LOG(m_logger) << "Got unkown chart type. Aborting."; return result; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.h index 9c8b3a9a7..4b13e05b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_report_dialog.h @@ -35,6 +35,8 @@ Q_SIGNALS: void removeName(const QString &name); private: + +NGL::INGLLogger &m_logger; void retranslate() override; static QVector brushes(const AbstractChartModel::ChartConfig &config); KDChart::Chart *createNewChart(const AbstractChartModel::ChartConfig &config, const QPen &linePen, bool hasToCreateLegend, const QString &header = QString()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_type_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_type_model.h index 61758ee0e..425c4c60a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_type_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OnlineReports/Gui/OnlineReports/ore_type_model.h @@ -20,6 +20,8 @@ public: QVariant data(const QModelIndex &index, int role) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ParticipantManagement::Type &data, DataModification modType) const override; private: std::shared_ptr m_ppmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Common/operator_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Common/operator_dialog_model.h index f6da8447a..8839d4d37 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Common/operator_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Common/operator_dialog_model.h @@ -47,6 +47,8 @@ public: bool isFiltered( const OperatorManagement::User &data, DataModification modType ) const override; private: + +NGL::INGLLogger &m_logger; QString hasVisibleParties(const std::vector &vpbe) const; QString visibleParties(const std::vector &parties) const; QString effectiveAcls(std::vector acls) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Login/opm_login_remote_shutdown_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Login/opm_login_remote_shutdown_dialog.cpp index 5f36e5acc..2a865cde6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Login/opm_login_remote_shutdown_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/Login/opm_login_remote_shutdown_dialog.cpp @@ -41,7 +41,7 @@ bool RemoteShutdownDialog::init(const std::shared_ptr &asmDtc) { int thisWsId = LtsSessionData::LtsSessionData::getInstance()->getWorkstationId(); - DEBUG_LOG() << "ws id = " << thisWsId; + DEBUG_LOG(m_logger) << "ws id = " << thisWsId; if (thisWsId <= 0 || asmFtc == nullptr) return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog.h index e81487a0d..1035a3872 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog.h @@ -28,6 +28,8 @@ public: const std::shared_ptr &ftc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; AclDialogModel *m_model; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog_model.h index 837edfedb..666f2111e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/acl_dialog_model.h @@ -27,6 +27,8 @@ public: QVariant data(const QModelIndex &, int) const override final; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; std::shared_ptr m_ftc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_edit_dialog.h index 1dc2ede46..48185bc93 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_edit_dialog.h @@ -44,6 +44,8 @@ class GroupEditDialog void onGroupChangeNameReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_model.h index 99bc22255..75eaf968a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/group_model.h @@ -32,6 +32,7 @@ public: QVariant data(const QModelIndex &, int) const override final; protected: +NGL::INGLLogger &m_logger; bool isFiltered(const Group &data, DataModification modType) const override { if (m_hideHidden && data.isHidden()) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.cpp index 83467ed29..1ccf357cb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.cpp @@ -120,7 +120,7 @@ void OperatorDialog::onEditOperator() if (op.id() <= 0) return; - DEBUG_LOG() << "current Operator Id: " << op.id(); + DEBUG_LOG(m_logger) << "current Operator Id: " << op.id(); OperatorEditDialog *dialog = new OperatorEditDialog(op.id(), m_session, m_menuGroup, this); const QString identifier = QLatin1String("EditOperator") + QString::number(op.id()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.h index f5adbda97..d6fa994c3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_dialog.h @@ -40,6 +40,7 @@ public: bool init(LtsSession::LtsSession *session); private: + NGL::INGLLogger &m_logger; void retranslate() override; void onOperatorRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.cpp index 1a993d998..bc6a680d3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.cpp @@ -170,7 +170,7 @@ bool OperatorEditDialog::operatorCreateModify(const OperatorCreateModifyRequest return false; } - DEBUG_LOG() << "req.name: " << req.name(); + DEBUG_LOG(m_logger) << "req.name: " << req.name(); return m_requestHelper->startSingleRequest([this, req]() { return m_ftc->operatorCreateModifyRequest(req, this); @@ -365,7 +365,7 @@ bool OperatorEditDialog::apply() const QVector visiblePartyIds = m_visiblePartiesModel->getCheckedIds(); std::vector vpbe; PartiesByExercise pbe; - DEBUG_LOG() << "----------------- m_session.exerciseId:" << m_session->exerciseId(); + DEBUG_LOG(m_logger) << "----------------- m_session.exerciseId:" << m_session->exerciseId(); pbe.exerciseId(0); pbe.visibleParties().set({}); std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties().get())); @@ -402,7 +402,7 @@ bool OperatorEditDialog::apply() const QVector visiblePartyIds = m_visiblePartiesModel->getCheckedIds(); std::vector vpbe; PartiesByExercise pbe; - DEBUG_LOG() << "----------------- m_session.exerciseId:" << m_session->exerciseId(); + DEBUG_LOG(m_logger) << "----------------- m_session.exerciseId:" << m_session->exerciseId(); pbe.exerciseId(0); pbe.visibleParties().set({}); std::copy(visiblePartyIds.begin(), visiblePartyIds.end(), std::back_inserter(pbe.visibleParties().get())); @@ -460,7 +460,7 @@ void OperatorEditDialog::createFolders() return; } - DEBUG_LOG() << "User Folder created with id = " << folderId; + DEBUG_LOG(m_logger) << "User Folder created with id = " << folderId; #ifdef GUEZ_MODE @@ -473,7 +473,7 @@ void OperatorEditDialog::createFolders() return; } - DEBUG_LOG() << "User Subfolder created with id = " << subFolderId; + DEBUG_LOG(m_logger) << "User Subfolder created with id = " << subFolderId; #endif LtsWidgets::LtsMessageDialog::showMessage(this, tr("User folders successfully created")); @@ -499,7 +499,7 @@ int OperatorEditDialog::createFolder(int parentFolderId, const QString &folderNa return m_flmFtc->folderModifyRequest(req, this); }); - DEBUG_LOG() << "Created folder id = " << m_requestHelper->getRepliedId(); + DEBUG_LOG(m_logger) << "Created folder id = " << m_requestHelper->getRepliedId(); return m_requestHelper->getRepliedId(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.h index e0814be73..d7bd85cb2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/operator_edit_dialog.h @@ -49,6 +49,7 @@ public: void onFolderModifyReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; int createFolder(int parentFolderId, const QString &folderName, int userId, bool isHidden = false); @@ -69,6 +70,7 @@ signals: void sendData(const OperatorManagement::User &data); private: + NGL::INGLLogger &m_logger; int m_operatorId; bool m_pictureChanged; bool m_visiblePartiesChanged; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/preset_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/preset_dialog.h index 6d14d65e9..12044269d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/preset_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorEdit/preset_dialog.h @@ -35,6 +35,8 @@ public: bool hideHidden = true); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onGroupRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorOverview/operator_overview_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorOverview/operator_overview_dialog.h index dc951f7b2..76a8f6767 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorOverview/operator_overview_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorOverview/operator_overview_dialog.h @@ -35,6 +35,8 @@ public: bool init(LtsSession::LtsSession *session); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onOperatorRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.cpp index 0cad45095..b08529e73 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.cpp @@ -25,7 +25,7 @@ bool SettingsGroup::init() if (!m_subSetHandler || !m_opSettings) { - ERROR_LOG() << " SettingsGroup::init() failed. this=" << this + ERROR_LOG(m_logger) << " SettingsGroup::init() failed. this=" << this << ", typeid.name='" << typeid(*this).name() << ", m_id='" << m_id << ", m_group='" << m_group; @@ -71,7 +71,7 @@ void SettingsGroup::startLoad() #else if (!m_subSetHandler) { - ERROR_LOG() << " SettingsGroup::startLoad() : no m_subSetHandler. this=" << this + ERROR_LOG(m_logger) << " SettingsGroup::startLoad() : no m_subSetHandler. this=" << this << ", typeid.name='" << typeid(*this).name() << ", m_id='" << m_id << ", m_group='" << m_group; @@ -93,19 +93,19 @@ void SettingsGroup::startSave() return; for (SubSet &subset : m_subsets) { - DEBUG_LOG() << "saving11 subset for group: " << m_group + DEBUG_LOG(m_logger) << "saving11 subset for group: " << m_group << ", id:" << m_id << ", subset.name=" << subset.name << ", subset.data=" << subset.data.toString(); bool saveSubSetOk = m_subSetHandler->saveSubSet(subset); if (!saveSubSetOk) - WARNING_LOG() << "saving22 subset failed for group: " << m_group + WARNING_LOG(m_logger) << "saving22 subset failed for group: " << m_group << ", id:" << m_id << ", subset.name=" << subset.name << ", subset.data=" << subset.data.toString(); else - DEBUG_LOG() << "saving22 subset for group: " << m_group + DEBUG_LOG(m_logger) << "saving22 subset for group: " << m_group << ", id:" << m_id << ", subset.name=" << subset.name << ", subset.data=" << subset.data.toString(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.h index 923c077c9..9c71bb7be 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/SettingsGroup/opm_settings_group.h @@ -87,6 +87,8 @@ public: protected: + +NGL::INGLLogger &m_logger; virtual bool aboutToLoad() { return true; } virtual bool aboutToSave() { return true; } virtual bool aboutToDelete() { return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.cpp index 49d1de62f..4e040a98d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.cpp @@ -44,7 +44,7 @@ OperatorSettingsDialog::OperatorSettingsDialog(LtsSession::LtsSession *session, , m_workspaceMap(nullptr) , m_filterMap(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); @@ -59,7 +59,7 @@ OperatorSettingsDialog::OperatorSettingsDialog(LtsSession::LtsSession *session, connect(m_ui->pbDEBUGNewWsID, &QPushButton::clicked, this, [this]() { const QString newId(QUuid::createUuid().toString()); - ERROR_LOG() << "new WsId" << newId; + ERROR_LOG(m_logger) << "new WsId" << newId; m_session->setWorkspaceId(newId); }); } @@ -146,17 +146,17 @@ OperatorSettingsDialog::OperatorSettingsDialog(LtsSession::LtsSession *session, connect(m_ui->cbScriptsHideOnDrag, &QCheckBox::toggled, m_timer, static_cast(&QTimer::start)); m_ui->cbScriptsHideOnDrag->setChecked(m_opSettings->value(QStringLiteral("Scripts"), QStringLiteral("HideOnDrag"), true).toBool()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } OperatorSettingsDialog::~OperatorSettingsDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_timer->isActive()) onTimerTimeout(); delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -258,7 +258,7 @@ void OperatorSettingsDialog::onWorkspaceLoad() QString workspaceId = m_ui->cbWorkspaces->currentData().toString(); if (workspaceId.compare(QUuid().toString()) == 0) { - WARNING_LOG() << "Tried to load a Workspace with Null-Uuid! ... skipping"; + WARNING_LOG(m_logger) << "Tried to load a Workspace with Null-Uuid! ... skipping"; m_ui->cbWorkspaces->setCurrentIndex(0); return; } @@ -297,7 +297,7 @@ void OperatorSettingsDialog::onWorkspaceOverwrite() - DEBUG_LOG() << Q_FUNC_INFO << " emit signalOverwriteWorkspace: " + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " emit signalOverwriteWorkspace: " << " workspaceId= '" << workspaceId << "'" << " workspaceName= '" << workspaceName << "'"; emit signalOverwriteWorkspace(workspaceId, workspaceName, QString()); @@ -324,7 +324,7 @@ void OperatorSettingsDialog::onWorkspacesComboboxIndexChanged(int index) { const QString &wspId = m_ui->cbWorkspaces->itemData(index).toString(); - DEBUG_LOG() << Q_FUNC_INFO << " id: '" << wspId << "'" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: '" << wspId << "'" << " itemText: '" << m_ui->cbWorkspaces->itemText(index) << "'"; if (!m_workspaceMap->contains(wspId) || m_workspaceMap->value(wspId)->data().isEmpty()) @@ -370,7 +370,7 @@ void OperatorSettingsDialog::onFilterPresetLoad() QString filterPresetId = m_ui->cbFilterPresets->currentData().toString(); if (filterPresetId.compare(QUuid().toString()) == 0) { - WARNING_LOG() << "Tried to load a FilterPreset with Null-Uuid! ... skipping"; + WARNING_LOG(m_logger) << "Tried to load a FilterPreset with Null-Uuid! ... skipping"; m_ui->cbFilterPresets->setCurrentIndex(0); return; } @@ -451,7 +451,7 @@ void OperatorSettingsDialog::onFilterPresetDelete() void OperatorSettingsDialog::onFilterPresetsComboboxIndexChanged(int index) { const QString &id = m_ui->cbFilterPresets->itemData(index).toString(); - DEBUG_LOG() << Q_FUNC_INFO << " id: '" << id << "'" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id: '" << id << "'" << " itemText: '" << m_ui->cbFilterPresets->itemText(index) << "'"; m_ui->pbLoadFilterPreset->setProperty(DISABLE_FAST_CLICKS_PROPERTY, QVariant()); @@ -498,13 +498,13 @@ void OperatorSettingsDialog::updateCombobox(QComboBox *cbx, const QMapdata(); if (mapValue.isEmpty()) { - WARNING_LOG() << "Entry with Id: " << it.key() << " has empty data! ... skipping this entry"; + WARNING_LOG(m_logger) << "Entry with Id: " << it.key() << " has empty data! ... skipping this entry"; continue; } QString name = mapValue.value(QStringLiteral("name")).toString(); if (name.isEmpty()) { - WARNING_LOG() << "Entry with Id: " << it.key() << " has empty name! ... skipping this entry"; + WARNING_LOG(m_logger) << "Entry with Id: " << it.key() << " has empty name! ... skipping this entry"; continue; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.h index 55e6fc228..772df8139 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/OperatorManagement/Gui/OperatorSettings/operator_settings_dialog.h @@ -184,6 +184,7 @@ signals: void linesRemovedChanged(int numLines); protected: + NGL::INGLLogger &m_logger; void paintEvent(QPaintEvent *event) override; void keyPressEvent(QKeyEvent *event) override; void timerEvent(QTimerEvent *event) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.cpp index dddf847d4..9e6f2f43e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.cpp @@ -23,8 +23,7 @@ static int s_lastTypeUsed = -1; ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportService, LtsSession::LtsSession *session, - QWidget *parent) - : QWidget(parent) + QWidget *parent) : QWidget(parent) , m_asSupportService(asSupportService) , m_bEditMode(false) , m_typeMinimum(0) @@ -34,8 +33,8 @@ ParticipantEditItemWidgetBase::ParticipantEditItemWidgetBase(bool asSupportServi , m_dtc(nullptr) , m_ppmGuiCbxIfc(nullptr) , m_session(session) - , m_ui(new Ui::ParticipantEditItemWidgetBase) -{ + , m_ui(new Ui::ParticipantEditItemWidgetBase), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); setWindowTitle(tr("Edit Participant")); connect(m_ui->pbIcon, &QToolButton::clicked, this, &ParticipantEditItemWidgetBase::onSymbolSelection); @@ -106,7 +105,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptr &asb, const bool addItem) { - DEBUG_LOG() << "init addItem=" << addItem + DEBUG_LOG(m_logger) << "init addItem=" << addItem << " m_bEditMode=" << m_bEditMode; if (!dtc || !ppmGuiCbxIfc) return false; @@ -121,7 +120,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptrcbTypeClass->setCurrentIndex(m_ui->cbTypeClass->findData(s_lastTypeClassUsed)); const int idx = m_ui->cbType->findData(s_lastTypeUsed); @@ -131,7 +130,7 @@ bool ParticipantEditItemWidgetBase::init(const std::shared_ptrpbSymbolConfig->setEnabled(false); } @@ -260,7 +259,7 @@ void ParticipantEditItemWidgetBase::onChangeSymbol(const QString &sidc) m_symbolConfig = nullptr; } - DEBUG_LOG() << "Changing symbol to " << sidc << " is in progress"; + DEBUG_LOG(m_logger) << "Changing symbol to " << sidc << " is in progress"; } ParticipantManagement::TypeClass ParticipantEditItemWidgetBase::typeClassIdFromTypeId(int typeId) const diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.h index 50c4bed85..2c990a906 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_item_widget_base.h @@ -36,6 +36,7 @@ public: ~ParticipantEditItemWidgetBase(); protected: + NGL::INGLLogger &m_logger; bool init(const std::shared_ptr &dtc, const std::shared_ptr &ppmGuiCbxIfc, const std::shared_ptr &asb, @@ -56,6 +57,7 @@ protected Q_SLOTS: void onChangeSymbol(const QString &sidc); protected: + NGL::INGLLogger &m_logger; ParticipantManagement::TypeClass typeClassIdFromTypeId(int typeId) const; bool isUnitType(int typeId) const; @@ -66,6 +68,7 @@ Q_SIGNALS: void readyToClose(); protected: + NGL::INGLLogger &m_logger; bool m_asSupportService; bool m_bEditMode; int m_typeMinimum; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.cpp index bc6fbcb87..75a032a72 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.cpp @@ -360,7 +360,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data, if (!isUnitType(parentItem->participant.typeId())) return false; - DEBUG_LOG() << "can drop on " << row << ", " << column << ", parent: " + DEBUG_LOG(m_logger) << "can drop on " << row << ", " << column << ", parent: " << parent.row() << "," << parent.column() << ", " << parent.isValid() << ", action: " << action; @@ -389,7 +389,7 @@ bool ParticipantEditModel::canDropMimeData(const QMimeData *data, if (idSource != 0 && isParentOf(parentItem, idSource)) { - DEBUG_LOG() << "isParentOf() for idSource: " << idSource << " is true - no drop"; + DEBUG_LOG(m_logger) << "isParentOf() for idSource: " << idSource << " is true - no drop"; return false; } } @@ -802,7 +802,7 @@ void ParticipantEditModel::insertChildrenOf(int parentId, auto it = tmap.constFind(childId); if (it == tmap.constEnd()) { - WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring"; + WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring"; continue; } const ParticipantData &data = it.value(); @@ -827,11 +827,11 @@ void ParticipantEditModel::insertChildrenOf(int parentId, childItem->participant = data; childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << parent << " at pos " << insertPos; if ( data.id() == 0 && data.hierarchyNumber() == 0) { - WARNING_LOG() << "avoid endless loop in recursion"; + WARNING_LOG(m_logger) << "avoid endless loop in recursion"; return; } insertRow(insertPos, parentIdx, childItem); @@ -1086,7 +1086,7 @@ void ParticipantEditModel::onParticipantChanged(const ParticipantManagement::Par CheckedTreeItem *childItem = static_cast(createItem(QVariant(), QIcon())); childItem->participant = m_dtc->convertParticipantToParticipantData(data); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << ctiParent << " at pos " << insertPos; insertRow(insertPos, indexFromItem(ctiParent), childItem); tryRenderSymbol(QString::fromStdString(data.symbol()), childItem); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.h index a40c9bc4e..9cef36479 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_edit_model.h @@ -101,6 +101,7 @@ public: QString getHierarchyFromIndex(const QModelIndex &index) const; protected: + NGL::INGLLogger &m_logger; void gatherParticipants(QHash &tmap, QHash> &parentId2id) const; @@ -148,6 +149,7 @@ signals: void internalDataChanged(); protected: + NGL::INGLLogger &m_logger; int m_partyId; bool m_bRowsAreCheckable; bool m_bUnitsSelectable; @@ -176,6 +178,7 @@ public: int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; @@ -249,6 +252,7 @@ public: SortData sortData() const { return m_sortData; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override; bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.cpp index 3f39f3465..1d4334205 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.cpp @@ -75,7 +75,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte { AdvancedSymbology::SymbolDataToRender symDataToRender(symbol); symDataToRender.role = m_partyRole; - DEBUG_LOG() << "Rendering symbol '" << symbol << "' for item " << item; + DEBUG_LOG(m_logger) << "Rendering symbol '" << symbol << "' for item " << item; if (m_partyColor.isValid()) { symDataToRender.fillColor = m_partyColor; @@ -92,7 +92,7 @@ void ParticipantIconModelBase::tryRenderSymbol(const QString &symbol, NGLTreeIte AdvancedSymbology::SymbolResult *symResPtr = symRes.data(); if (!symResPtr) { - WARNING_LOG() << "Can not render symbol for sidc '" << symbol << "'"; + WARNING_LOG(m_logger) << "Can not render symbol for sidc '" << symbol << "'"; return; } @@ -138,11 +138,11 @@ void ParticipantIconModelBase::symbolRendered(AdvancedSymbology::SymbolResult *s const QIcon icon(QPixmap::fromImage(symResData.result->symbolImage().image())); for (NGLTreeItem *item : symResData.treeItems) { - DEBUG_LOG() << "Symbol for " << item << " ready"; + DEBUG_LOG(m_logger) << "Symbol for " << item << " ready"; if (!updateIcon(QModelIndex(), item, icon)) - WARNING_LOG() << "updateIcon failed for item " << item; + WARNING_LOG(m_logger) << "updateIcon failed for item " << item; } m_symbolResultMapping.erase(it); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.h index aac414ad0..cb14577c9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Common/participant_icon_model_base.h @@ -35,6 +35,7 @@ class PPMCOMMON_EXPORT ParticipantIconModelBase : public NGLTreeModel { Q_OBJECT protected: + NGL::INGLLogger &m_logger; ParticipantIconModelBase(const std::shared_ptr &ppmDtc, const std::shared_ptr &asbIfc, const QStringList &hdr, @@ -53,10 +54,12 @@ protected: bool updateIcon(const QModelIndex ¤tIndex, NGLTreeItem *itemToUpdate, const QIcon &icon); protected: + NGL::INGLLogger &m_logger; void onTypeChanged(const ParticipantManagement::Type &data, DataModification modType); protected: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; QHash m_types; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/MSDL/ppm_msdl_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/MSDL/ppm_msdl_edit.h index 21a53c203..47d9d914e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/MSDL/ppm_msdl_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/MSDL/ppm_msdl_edit.h @@ -40,6 +40,8 @@ public: const std::shared_ptr &ppmGuiCbxIfc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void lock() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/participant_show.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/participant_show.h index 9fc4f3029..6ba02fbfa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/participant_show.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/participant_show.h @@ -45,6 +45,8 @@ public: const QString &nameParty); private: + +NGL::INGLLogger &m_logger; void retranslate() override; protected slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_model.h index e90725789..74a9e1367 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_model.h @@ -43,6 +43,8 @@ public: protected: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_view.h index 2f5ef0296..ec77ea390 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_party_view.h @@ -40,6 +40,8 @@ public: const std::shared_ptr &asbIfc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.cpp index 927ea2b94..cd4fc918f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.cpp @@ -16,7 +16,7 @@ ParticipantPlanningModel::ParticipantPlanningModel(QObject *parent, { m_titles += tr("Hierarchy"); - DEBUG_LOG() << "ParticipantPlanningModel::ParticipantPlanningModel"; + DEBUG_LOG(m_logger) << "ParticipantPlanningModel::ParticipantPlanningModel"; } QVariant ParticipantPlanningModel::data(const QModelIndex &index, int role) const diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.h index 15250515a..09bb596ff 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/OperationalPlanning/ppm_planning_model.h @@ -28,5 +28,7 @@ signals: void newData(); private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.cpp index 305bafa52..a4f35bbde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.cpp @@ -234,17 +234,17 @@ void ParticipantEdit::showIsSimulated() void ParticipantEdit::lock() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbParty->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantEdit::unlock() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbParty->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantEdit::onPartyChanged() @@ -320,7 +320,7 @@ void ParticipantEdit::onEnaDisa() { if (m_dtc->isAdlerVerbund(m_pTreehandler->getSelectedData().typeId())) { - DEBUG_LOG() << "Can't Edit Adler SAA Participants"; + DEBUG_LOG(m_logger) << "Can't Edit Adler SAA Participants"; enableEdit = true; } else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.h index 90c7debe0..bd6e8d76a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_edit.h @@ -60,6 +60,7 @@ public: const std::shared_ptr &asbIfc); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void showIsSimulated(); @@ -88,6 +89,7 @@ private slots: private: + NGL::INGLLogger &m_logger; void tableColumnOrganiserSetting() override; bool m_asSupportService; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.cpp index 48632cf48..4d8a150da 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.cpp @@ -78,7 +78,7 @@ void ParticipantOrganisationDialog::retranslate() void ParticipantOrganisationDialog::lock() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbParty->setEnabled(true); @@ -90,12 +90,12 @@ void ParticipantOrganisationDialog::lock() m_ui->tvDetached->setEnabled(false); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantOrganisationDialog::unlock() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbParty->setEnabled(true); @@ -103,7 +103,7 @@ void ParticipantOrganisationDialog::unlock() m_ui->tvAttached->setEnabled(true); m_ui->tvCooperate->setEnabled(true); m_ui->tvDetached->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool ParticipantOrganisationDialog::init(const std::shared_ptr &dtc, @@ -356,7 +356,7 @@ void ParticipantOrganisationDialog::onPartyChanged() s_preselectedParty = curPartyId; - DEBUG_LOG() << Q_FUNC_INFO << " START, curPartyId" << curPartyId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, curPartyId" << curPartyId << ", m_asSupportService=" << m_asSupportService; @@ -421,9 +421,8 @@ void ParticipantOrganisationDialog::showContextMenu(const QPoint &position) -DeleteDelegate::DeleteDelegate(QObject *parent) - : QItemDelegate(parent) -{ +DeleteDelegate::DeleteDelegate(QObject *parent) : QItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } void DeleteDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.h index f8660f06c..4a34687c7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_organisation.h @@ -72,6 +72,8 @@ public: void unlock() override; private: + +NGL::INGLLogger &m_logger; QModelIndex selectedIndexView() const; bool saveParticipantData(const ModifyParticipantDataRequest &request); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.cpp index 62006c0f5..9b41c84e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.cpp @@ -153,7 +153,7 @@ bool ParticipantPoolModel::dropMimeData(const QMimeData *data, Qt::DropAction ac if (action != Qt::CopyAction && action != Qt::MoveAction) return false; - DEBUG_LOG() << "dropMimeData: " << data->formats().join(QLatin1Char(',')); + DEBUG_LOG(m_logger) << "dropMimeData: " << data->formats().join(QLatin1Char(',')); if (!data->hasFormat(ParticipantTemplateRoot) && !data->hasFormat(ParticipantPartyRoot) && @@ -250,7 +250,7 @@ void ParticipantPoolModel::onParticipantDataChanged(const Participant &data, Dat const ParticipantData &part = m_vecData.at(i); if (part.id() == data.id()) { - DEBUG_LOG() << "Modifed participant " << data.id() << ", old party: " << part.partyId() << ", new: " << data.partyId(); + DEBUG_LOG(m_logger) << "Modifed participant " << data.id() << ", old party: " << part.partyId() << ", new: " << data.partyId(); if (data.partyId() != poolPartyId()) { @@ -301,7 +301,7 @@ void ParticipantPoolModel::onParticipantOrganisationChanged(const ParticipantOrg bool ParticipantPoolModel::moveFromPartyToPool(int rootParticipantId, const QString &mimeType) { - ERROR_LOG() << "Moving participant " << rootParticipantId << " from party to root with mime type " << mimeType; + ERROR_LOG(m_logger) << "Moving participant " << rootParticipantId << " from party to root with mime type " << mimeType; const Participant part = m_dtc->participant(rootParticipantId); const QVector newParticipants = getSuperiorParticipants(part.id()); @@ -400,7 +400,7 @@ void ParticipantPoolModel::tryRemoveParticipantFromModel(int participantId) const ParticipantData &part = m_vecData.at(i); if (part.id() == participantId) { - DEBUG_LOG() << "Removing participant " << participantId; + DEBUG_LOG(m_logger) << "Removing participant " << participantId; LtsWidgets::LtsAbstractTableModel::removeRow(i); break; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.h index 986d4d50d..7d9c35bea 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_pool_model.h @@ -64,6 +64,7 @@ Q_SIGNALS: void modifyParticipantData(const QVector &participantData, const QString &originatorMimeType); private: + NGL::INGLLogger &m_logger; bool moveFromPartyToPool(int rootParticipantId, const QString &mimeType); QVector getSuperiorParticipants(int participantId); bool convertFromParticipantTemplateToParticipantData(const ParticipantManagement::TemplateParticipant &inputParticipant, ParticipantManagement::ParticipantData &outPutData); @@ -74,6 +75,7 @@ private: int poolPartyId() const { return m_asSupportService ? 1 : 0; } private: + NGL::INGLLogger &m_logger; bool m_asSupportService; QVector m_fullPoolData; QVector m_dataToDelete; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_unit_namer.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_unit_namer.h index bfaad1c2d..85002e624 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_unit_namer.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/participant_unit_namer.h @@ -28,6 +28,8 @@ Q_SIGNALS: void newUnitNames(const QString &, const QString &); private: + +NGL::INGLLogger &m_logger; Ui::ParticipantUnitNamer *m_ui; QValidator *m_validator; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.cpp index 15b2b5c66..9cdf199a5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.cpp @@ -63,7 +63,7 @@ bool TacticalOrganisation::init(const std::shared_ptrcreateTopicClient(m_coreFtc)) { - ERROR_LOG() << Q_FUNC_INFO << " create coreFtc failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " create coreFtc failed"; return false; } @@ -150,7 +150,7 @@ void TacticalOrganisation::onReinitLeft() s_preselectedPartyLeft = partyId; auto *model = modelForParty(partyId, true); - INFO_LOG() << "Set model left: " << model; + INFO_LOG(m_logger) << "Set model left: " << model; m_ui->dvPartyLeft->setModel(model); #ifndef LTS_DEBUG m_ui->dvPartyLeft->setColumnHidden(ParticipantEditModel::ColParticipantId, true); @@ -164,7 +164,7 @@ void TacticalOrganisation::onReinitRight() s_preselectedPartyRight = partyId; auto *model = modelForParty(partyId, false); - INFO_LOG() << "Set model right: " << model; + INFO_LOG(m_logger) << "Set model right: " << model; m_ui->dvPartyRight->setModel(model); #ifndef LTS_DEBUG m_ui->dvPartyRight->setColumnHidden(ParticipantEditModel::ColParticipantId, true); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.h index e07376e15..d25567044 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantEdit/tactical_organisation.h @@ -53,6 +53,7 @@ public: void retranslate() override; protected: + NGL::INGLLogger &m_logger; bool apply() override; void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override; private Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_bite_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_bite_dialog.h index 464ff2be2..7be85d07c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_bite_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_bite_dialog.h @@ -55,6 +55,8 @@ public: void onCallBiteReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + +NGL::INGLLogger &m_logger; void retranslate() override; void addLabel(const QString &text, int row, int column, LabelType labelType = LabelType::Normal); int checkArguments(bool available, bool statusOk, qint64 bitValue, int i); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.cpp index 526db7a23..0835509f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.cpp @@ -346,7 +346,7 @@ void ParticipantConfigDialog::onSelectionChanged() for (const QModelIndex &index : currentlySelectedParticipants) { - DEBUG_LOG() << "setChildrenSelected row =" << index.row() << " column=" << index.column(); + DEBUG_LOG(m_logger) << "setChildrenSelected row =" << index.row() << " column=" << index.column(); ParticipantManagement::ParticipantData data = m_model->getParticipantData(index); TypeClass tc = m_dtc->type(data.typeId()).typeClass(); if (tc != TypeClass::Human && tc != TypeClass::Unit) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.h index f701f258c..6354161de 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_dialog.h @@ -61,6 +61,7 @@ public: private: + NGL::INGLLogger &m_logger; void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onInitParticipantReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onSendMessageReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } @@ -80,6 +81,7 @@ private slots: void onSelectionChanged(); private: + NGL::INGLLogger &m_logger; bool apply() override final; void changeLabelText(QLabel *label, int value); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.cpp index 6e42e7692..bbabb9994 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.cpp @@ -370,7 +370,7 @@ bool ParticipantConfigModel::canDropMimeData(const QMimeData *data, if (!isUnitType(parentItem->participant.typeId())) return false; - DEBUG_LOG() << "can drop on " << row << ", " << column << ", parent: " + DEBUG_LOG(m_logger) << "can drop on " << row << ", " << column << ", parent: " << parent.row() << "," << parent.column() << ", " << parent.isValid() << ", action: " << action; @@ -399,7 +399,7 @@ bool ParticipantConfigModel::canDropMimeData(const QMimeData *data, if (idSource != 0 && isParentOf(parentItem, idSource)) { - DEBUG_LOG() << "isParentOf() for idSource: " << idSource << " is true - no drop"; + DEBUG_LOG(m_logger) << "isParentOf() for idSource: " << idSource << " is true - no drop"; return false; } } @@ -759,7 +759,7 @@ void ParticipantConfigModel::insertChildrenOf(int parentId, auto it = tmap.constFind(childId); if (it == tmap.constEnd()) { - WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring"; + WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring"; continue; } const ParticipantData &data = it.value(); @@ -784,7 +784,7 @@ void ParticipantConfigModel::insertChildrenOf(int parentId, childItem->participant = data; childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << parent << " at pos " << insertPos; insertRow(insertPos, parentIdx, childItem); tryRenderSymbol(QString::fromStdString(data.symbol()), childItem); @@ -1074,7 +1074,7 @@ void ParticipantConfigModel::onParticipantChanged(const ParticipantManagement::P CheckedTreeItem *childItem = static_cast(createItem(QVariant(), QIcon())); childItem->participant = m_dtc->convertParticipantToParticipantData(data); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << ctiParent << " at pos " << insertPos; insertRow(insertPos, indexFromItem(ctiParent), childItem); tryRenderSymbol(QString::fromStdString(data.symbol()), childItem); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.h index ee6062199..65e32bd36 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_config_model.h @@ -103,6 +103,7 @@ public: QString getHierarchyFromIndex(const QModelIndex &index) const; protected: + NGL::INGLLogger &m_logger; void gatherParticipants(QHash &tmap, QHash> &parentId2id) const; @@ -151,6 +152,7 @@ signals: void internalDataChanged(); protected: + NGL::INGLLogger &m_logger; int m_partyId; bool m_bRowsAreCheckable; bool m_bUnitsSelectable; @@ -178,6 +180,7 @@ public: int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; @@ -251,6 +254,7 @@ public: SortData sortData() const { return m_sortData; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override; bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_follow_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_follow_dialog.cpp index c88fdddcc..72de80ab3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_follow_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_follow_dialog.cpp @@ -55,7 +55,7 @@ bool ParticipantFollowDialog::init(LtsSession::LtsSession *session, const std::shared_ptr &dtc, const std::shared_ptr &ppmGuiIfc) { - DEBUG_LOG() << "ParticipantFollowDialog::init"; + DEBUG_LOG(m_logger) << "ParticipantFollowDialog::init"; m_dtc = dtc; m_ppmGuiIfc = ppmGuiIfc; enadisa(); @@ -227,7 +227,7 @@ void ParticipantFollowDialog::onDoubleClicked() m_followParticipantId = data.id(); m_followEquipmentNo = getEquipmentNumber(m_followParticipantId); enadisa(); - DEBUG_LOG() << "onDoubleClicked follow Participant Id =" << m_followParticipantId + DEBUG_LOG(m_logger) << "onDoubleClicked follow Participant Id =" << m_followParticipantId << " m_followEquipmentNo=" << m_followEquipmentNo; } @@ -337,7 +337,7 @@ void ParticipantFollowDialog::fillParticipantMapFromTree(const QModelIndex &pare int ParticipantFollowDialog::getEquipmentNumber(const int participantId) { - DEBUG_LOG() << "getEquipmentNumber(" << participantId << ")"; + DEBUG_LOG(m_logger) << "getEquipmentNumber(" << participantId << ")"; int equipmentNumber = 0; QMapIterator iter(m_participantMap); @@ -345,10 +345,10 @@ int ParticipantFollowDialog::getEquipmentNumber(const int participantId) while (iter.hasNext()) { iter.next(); - DEBUG_LOG() << iter.key() << " : " << iter.value(); + DEBUG_LOG(m_logger) << iter.key() << " : " << iter.value(); if (iter.value() == participantId) { - DEBUG_LOG() << "return: " << iter.key(); + DEBUG_LOG(m_logger) << "return: " << iter.key(); return (iter.key()); } } @@ -358,13 +358,13 @@ int ParticipantFollowDialog::getEquipmentNumber(const int participantId) void ParticipantFollowDialog::onStartFollowClicked() { int participantId = m_participantMap.value(m_equipNo); - DEBUG_LOG() << "Follow Participant id=" << participantId << " on Map"; + DEBUG_LOG(m_logger) << "Follow Participant id=" << participantId << " on Map"; if (!m_ui->cbAll->isChecked()) onDoubleClicked(); else { - DEBUG_LOG() << "Start Follow Participant id=" << participantId << " on Map"; + DEBUG_LOG(m_logger) << "Start Follow Participant id=" << participantId << " on Map"; m_followParticipantId = participantId; m_followEquipmentNo = m_equipNo; } @@ -373,7 +373,7 @@ void ParticipantFollowDialog::onStartFollowClicked() void ParticipantFollowDialog::onStopFollowClicked() { - DEBUG_LOG() << "Stop Follow Participant id=" << m_followParticipantId << " on Map"; + DEBUG_LOG(m_logger) << "Stop Follow Participant id=" << m_followParticipantId << " on Map"; m_followParticipantId = 0; m_followEquipmentNo = 0; enadisa(); @@ -408,9 +408,9 @@ void ParticipantFollowDialog::enadisa() labelText.append(QStringLiteral(")")); } m_ui->lbFollow->setText(labelText); - DEBUG_LOG() << "labelText=" << labelText; - DEBUG_LOG() << " m_ui->lbFollow->getText()" << m_ui->lbFollow->text(); - DEBUG_LOG() << "newFollowEquipment(" << m_followEquipmentNo << ", " + DEBUG_LOG(m_logger) << "labelText=" << labelText; + DEBUG_LOG(m_logger) << " m_ui->lbFollow->getText()" << m_ui->lbFollow->text(); + DEBUG_LOG(m_logger) << "newFollowEquipment(" << m_followEquipmentNo << ", " << m_followParticipantId << ")"; emit newFollowEquipment(m_followEquipmentNo,m_followParticipantId ); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.cpp index 861aebe50..2f124dd80 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.cpp @@ -64,13 +64,13 @@ bool ParticipantGearRestock::init(LtsSession::LtsSession *session, bool showAllO if (!m_pdmDtc->canRestock(m_gearTypeId) && m_dialogMode == DialogMode::DM_Restock) { - WARNING_LOG() << "Not possible to restock gearTypeId = " << m_gearTypeId; + WARNING_LOG(m_logger) << "Not possible to restock gearTypeId = " << m_gearTypeId; return false; } if (!m_pdmDtc->canSetDefaults(m_gearTypeId) && m_dialogMode == DialogMode::DM_SetRestockDefaults) { - WARNING_LOG() << "Not possible to set restock defaults gearTypeId = " << m_gearTypeId; + WARNING_LOG(m_logger) << "Not possible to set restock defaults gearTypeId = " << m_gearTypeId; return false; } @@ -107,7 +107,7 @@ bool ParticipantGearRestock::init(LtsSession::LtsSession *session, bool showAllO int chargeTypeId = gearType2ChargeType.chargeTypeId(); int maxCharge = m_pdmDtc->maxCharge(m_gearTypeId, chargeTypeId); - DEBUG_LOG() << "maxCharge = " << maxCharge; + DEBUG_LOG(m_logger) << "maxCharge = " << maxCharge; ParticipantGearRestockCharge* pgrc = new ParticipantGearRestockCharge(m_ui->scrollArea, showAllOptions); pgrc->init(chargeTypeId, m_pdmDtc->trChargeTypeShortName(chargeTypeId, true), m_pdmDtc->factoryDefault(m_gearTypeId, chargeTypeId), maxCharge); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.h index 5f19571dc..4aa75f21d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_gear_restock.h @@ -47,6 +47,7 @@ public: bool init(LtsSession::LtsSession *session, bool showAllOptions = false); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override final; void onSelectiveReammunitionReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } @@ -55,6 +56,7 @@ private slots: void validate(int newVal); private: + NGL::INGLLogger &m_logger; LtsUtils::RequestHelper *m_requestHelper; LtsSession::LtsSession *m_session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog.h index 48a3cabd0..99f79450e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog.h @@ -36,6 +36,8 @@ public: const std::shared_ptr &aesDtc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; int m_ddsId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog_model.h index a9c145ed8..54dedc176 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_history_dialog_model.h @@ -43,6 +43,8 @@ private Q_SLOTS: void onDynamicParticipantDataChanged(const DynamicParticipantData &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; void reinitModel(const std::vector &newData); QVariant dataInternal(const QModelIndex &index) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_hitline_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_hitline_info_dialog.cpp index 456489564..6d117e7a8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_hitline_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_hitline_info_dialog.cpp @@ -69,7 +69,7 @@ bool HitLineInfoDialog::init(const std::shared_ptr &sitMapGuiIfc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void showHitLineInfos(); void findOnMap(int id); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_dialog.cpp index db6c4e6dc..ddf670880 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_dialog.cpp @@ -144,7 +144,7 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session, const std::shared_ptr &asbInterface, const std::shared_ptr &ppmGuiIfc) { - DEBUG_LOG()<< "ParticipantInfoDialog::init"; + DEBUG_LOG(m_logger)<< "ParticipantInfoDialog::init"; m_session = session; m_dtc = dtc; m_ftc = ftc; @@ -187,7 +187,7 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session, }); - DEBUG_LOG()<< "Vor setUiValues"; + DEBUG_LOG(m_logger)<< "Vor setUiValues"; return setUiValues(); } @@ -197,7 +197,7 @@ bool ParticipantInfoDialog::setUiValues() - DEBUG_LOG() << "------------------setUiValues-----------------"; + DEBUG_LOG(m_logger) << "------------------setUiValues-----------------"; if (!m_dtc || !m_ftc || m_participant.id() < 0) return false; @@ -224,7 +224,7 @@ bool ParticipantInfoDialog::setUiValues() const bool isUas = m_dtc->isTypeUas(participantData.typeId()); - DEBUG_LOG() << "------------------UAS-----------------" + DEBUG_LOG(m_logger) << "------------------UAS-----------------" << " isTypeUas" << isUas << " participantId=" <>> last state: "<>> last state: "<lblVitality->setText(QString::number(lastState.vitality()) + QStringLiteral("%")); @@ -541,7 +541,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici const int BCONTAMINATION = 0x8000; const int CCONTAMINATION = 0x10000; QStringList contaminationList; - DEBUG_LOG() << "Set Contamination" + DEBUG_LOG(m_logger) << "Set Contamination" << " time=" << youngestState.stateTime() << " vulnerabilityKindId=" << youngestState.vulnerabilityKindId() << " vulnerabilityBits=" << youngestState.vulnerabilityBits() @@ -549,7 +549,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici if ( youngestState.vulnerabilityBits() & NCONTAMINATION) { - DEBUG_LOG() << "append N"; + DEBUG_LOG(m_logger) << "append N"; const ProjectDataManagement::VulnerabilityState vs(static_cast(14)); QString fullName = ProjectDataManagement::toString(vs); @@ -560,7 +560,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici } if ( youngestState.vulnerabilityBits() & BCONTAMINATION) { - DEBUG_LOG() << "append B"; + DEBUG_LOG(m_logger) << "append B"; const ProjectDataManagement::VulnerabilityState vs(static_cast(15)); QString fullName = ProjectDataManagement::toString(vs); @@ -571,7 +571,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici } if ( youngestState.vulnerabilityBits() & CCONTAMINATION) { - DEBUG_LOG() << "append C"; + DEBUG_LOG(m_logger) << "append C"; const ProjectDataManagement::VulnerabilityState vs(static_cast(16)); QString fullName = ProjectDataManagement::toString(vs); @@ -615,7 +615,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici m_ui->lbContamination->setHidden(contaminationListIsEmpty); m_ui->lblContamination->setHidden(contaminationListIsEmpty); - DEBUG_LOG()<< "setBackgroundColor ="<< data.manipulation().size(); + DEBUG_LOG(m_logger)<< "setBackgroundColor ="<< data.manipulation().size(); setBackgroundColor(m_ui->lblEquipNr, Qt::red, data.manipulation().size()); @@ -791,11 +791,11 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici { m_ui->twGear->hide(); } - DEBUG_LOG() << "### m_sanMatStock: " << m_sanMatStock.size(); + DEBUG_LOG(m_logger) << "### m_sanMatStock: " << m_sanMatStock.size(); - DEBUG_LOG() << "### data.sanitationMaterialStock(): " << data.sanitationMaterialStock().size(); - DEBUG_LOG() << "### data.participantId(): " << data.participantId(); - DEBUG_LOG() << "### data.sampleTime(): " << data.sampleTime(); + DEBUG_LOG(m_logger) << "### data.sanitationMaterialStock(): " << data.sanitationMaterialStock().size(); + DEBUG_LOG(m_logger) << "### data.participantId(): " << data.participantId(); + DEBUG_LOG(m_logger) << "### data.sampleTime(): " << data.sampleTime(); if (data.sanitationMaterialStock().size() == 0) @@ -806,8 +806,8 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici } else if (data.sanitationMaterialStock() != m_sanMatStock) { - DEBUG_LOG() << "### data.qualification(): " << data.qualification(); - DEBUG_LOG() << "### data.sanitationUniqueId(): " << data.sanitationUniqueId(); + DEBUG_LOG(m_logger) << "### data.qualification(): " << data.qualification(); + DEBUG_LOG(m_logger) << "### data.sanitationUniqueId(): " << data.sanitationUniqueId(); m_ui->gbSanitation->show(); m_ui->lblSanAssignState->setText(ParticipantManagement::toString(data.qualification().underlying())); @@ -1008,7 +1008,7 @@ void ParticipantInfoDialog::onPositionChanged(const ParticipantPosition &positio isOpsBuildingSource = true; - DEBUG_LOG() << "reportingSource = OpsBuilding true" ; + DEBUG_LOG(m_logger) << "reportingSource = OpsBuilding true" ; setBackgroundColor(m_ui->lblPositionData, Qt::lightGray, isOpsBuildingSource ); onUpdatePosition(position.participantId(), position.pos(), position.sampleTime()); @@ -1214,7 +1214,7 @@ void ParticipantInfoDialog::setSanitationLabelColor(SanitationResult proceduresD case SanitationResult::deprecatedNA: break; } - DEBUG_LOG() << "Set Color to: " << proceduresDone.underlying(); + DEBUG_LOG(m_logger) << "Set Color to: " << proceduresDone.underlying(); m_ui->lblKind->setPalette(pal); m_ui->lblKind->setAutoFillBackground(true); m_ui->lblKind->setToolTip(toolTip); @@ -1406,7 +1406,7 @@ void ParticipantInfoDialog::onPartitionTimeChanged(qint64 newPartitionTime) { if (LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec) ) { - DEBUG_LOG()<< "setBackgroundColor ="<< LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec); + DEBUG_LOG(m_logger)<< "setBackgroundColor ="<< LtsUtils::isPositionTimeOutdated(newPartitionTime, m_lastPositionMSec); setBackgroundColor(m_ui->lblPositionData, Qt::red, true); } qint64 lastPosSec = (newPartitionTime - m_lastPositionMSec) / 1000; @@ -1502,7 +1502,7 @@ void ParticipantInfoDialog::onTargetConfig() { if (!m_tgtFtc) return; - INFO_LOG() << "onTargetConfig send TargetConfigRequest"; + INFO_LOG(m_logger) << "onTargetConfig send TargetConfigRequest"; TargetManagement::ConfigureTargetRequest request; @@ -1521,7 +1521,7 @@ void ParticipantInfoDialog::onTargetConfigChanged(const TargetManagement::Target { if (modType == DataModification::eRemoved) return; - INFO_LOG() << "onTargetConfigChanged participantId = " << m_participant.id() + INFO_LOG(m_logger) << "onTargetConfigChanged participantId = " << m_participant.id() << " data.participantId = " << data.participantId(); if (data.participantId() != m_participant.id()) return; @@ -1538,7 +1538,7 @@ void ParticipantInfoDialog::onTargetModeChangeed() { if (!m_tgtFtc) return; - INFO_LOG() << "onTargetModeChangeed"; + INFO_LOG(m_logger) << "onTargetModeChangeed"; TargetManagement::ConfigureTargetRequest request; request.id(0); @@ -1546,7 +1546,7 @@ void ParticipantInfoDialog::onTargetModeChangeed() request.tgtCommand(TargetManagement::TgtCommand_def::SetMode); int modeInt = m_ui->cbTargetMode->currentData().toInt(); TargetManagement::Mode mode = static_cast (modeInt); - INFO_LOG() << "onTargetModeChangeed=" << mode; + INFO_LOG(m_logger) << "onTargetModeChangeed=" << mode; request.mode(mode); auto cb = [request, this]() @@ -1566,7 +1566,7 @@ void ParticipantInfoDialog::onTargetWeaponChanged() request.participantId(m_participant.id()); request.tgtCommand(TargetManagement::TgtCommand_def::SetWeapon); request.weapon(m_ui->cbTargetWeapon->currentData().toInt()); - INFO_LOG() << "onTargetWeaponChangeed = " << request.weapon(); + INFO_LOG(m_logger) << "onTargetWeaponChangeed = " << request.weapon(); auto cb = [request, this]() { @@ -1594,8 +1594,8 @@ void ParticipantInfoDialog::onContextMenuRequested(const QPoint &position) GearInformation &gear = m_gearList[pointedItem->row()]; - DEBUG_LOG() << "gear type selected = " << gear.gearTypeId(); - DEBUG_LOG() << "gear Id = " << gear.gearId(); + DEBUG_LOG(m_logger) << "gear type selected = " << gear.gearTypeId(); + DEBUG_LOG(m_logger) << "gear Id = " << gear.gearId(); QList actions; @@ -1677,16 +1677,16 @@ void ParticipantInfoDialog::onUnlockUAS() { UAS uas = m_dtc->getUasByParticipantId(m_participant.id(), m_session->exerciseId()); m_uasId = uas.id(); - DEBUG_LOG()<<" -- onUnlockUAS uasId: "<< uas.id() <<" /// participantId: "< &newData) { - TRACE_LOG() << Q_FUNC_INFO; + TRACE_LOG(m_logger) << Q_FUNC_INFO; if (!m_tableWidget) return; @@ -36,7 +35,7 @@ void ParticipantInfoLtdGearComponent::updateData(const std::vector &newData) { - TRACE_LOG() << Q_FUNC_INFO; + TRACE_LOG(m_logger) << Q_FUNC_INFO; if (!m_tableWidget) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_ltd_gear_component.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_ltd_gear_component.h index 33e6a4ab5..c4256f443 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_ltd_gear_component.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_ltd_gear_component.h @@ -33,6 +33,7 @@ public: static const int LTD_ID {1043}; private: + NGL::INGLLogger &m_logger; struct LtdRow { QTableWidgetItem *chargeType {nullptr} ; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_dialog.cpp index 976337556..9f2d347de 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_dialog.cpp @@ -52,7 +52,7 @@ void ParticipantInfoTableDialog::retranslate() bool ParticipantInfoTableDialog::init(LtsSession::LtsSession *session, const std::shared_ptr &dtc) { - DEBUG_LOG() << "**** init"; + DEBUG_LOG(m_logger) << "**** init"; m_session = session; m_dtc = dtc; @@ -104,7 +104,7 @@ void ParticipantInfoTableDialog::onColumnContextMenu(const QPoint &position) void ParticipantInfoTableDialog::onAddClicked() { - DEBUG_LOG() << "**** onAddClicked() "; + DEBUG_LOG(m_logger) << "**** onAddClicked() "; InfoTableAddDialog *addParticipantsDialog = new InfoTableAddDialog(this); addParticipantsDialog->init(m_session, m_dtc); @@ -118,7 +118,7 @@ void ParticipantInfoTableDialog::onAddClicked() void ParticipantInfoTableDialog::onRemoveClicked() { - DEBUG_LOG() << "**** onRemoveClicked() "; + DEBUG_LOG(m_logger) << "**** onRemoveClicked() "; const QModelIndexList selectedRows = m_ui->tvParticipant->selectionModel()->selectedRows(); if (!selectedRows.count()) @@ -138,7 +138,7 @@ void ParticipantInfoTableDialog::onRemoveClicked() void ParticipantInfoTableDialog::onSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected) { - DEBUG_LOG() << "onSelectionChanged"; + DEBUG_LOG(m_logger) << "onSelectionChanged"; Q_UNUSED(selected); Q_UNUSED(deselected); @@ -148,7 +148,7 @@ void ParticipantInfoTableDialog::onSelectionChanged(const QItemSelection &select void ParticipantInfoTableDialog::onShowTlnInfo(const QModelIndex &idx) { - DEBUG_LOG() << "onDoubleClick --> showTlnInfo"; + DEBUG_LOG(m_logger) << "onDoubleClick --> showTlnInfo"; QModelIndex realIdx = m_sortFilterProxyModel->mapToSource(idx); const int id = m_infoTableModel->getRowData(realIdx.row()).id(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.cpp index c43529540..e0443fc25 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.cpp @@ -42,7 +42,7 @@ bool ParticipantInfoTableModel::initModel(LtsSession::LtsSession *session, const std::shared_ptr &ppmDtc, bool bWithPositionandBiteResult) { - DEBUG_LOG() << "**** initModel"; + DEBUG_LOG(m_logger) << "**** initModel"; m_session = session; m_ppmDtc = ppmDtc; @@ -210,7 +210,7 @@ void ParticipantInfoTableModel::updateDataView(const QSet &participantIds) void ParticipantInfoTableModel::onParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "**** participantDataChanged"; + DEBUG_LOG(m_logger) << "**** participantDataChanged"; const int row = findRowForId(data.participantId()); if (row < 0) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.h index ee2c644c8..ccb14875d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_info_table_model.h @@ -74,6 +74,7 @@ protected Q_SLOTS: void onTimeoutCheck(); private: + NGL::INGLLogger &m_logger; ParticipantInfo setInfoData(const ParticipantManagement::Participant &part) const; void fillParticipantContent(ParticipantInfo &info, const DynamicParticipantData &data) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_search_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_search_dialog.h index 903c33b1c..9f18fcd8e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_search_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_search_dialog.h @@ -56,6 +56,8 @@ private slots: void leaveEvent(QEvent *e) override; private: + +NGL::INGLLogger &m_logger; void retranslate() override; int changeLabelText(int value); void onClicked(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.cpp index eed6a3d66..8f1c85424 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.cpp @@ -175,7 +175,7 @@ void ParticipantSetInjuryDialog::setOldData(const DynamicParticipantData &data) int index = m_ui->cbState->findData(lastState.vulnerabilityState().underlying()); - DEBUG_LOG() << "Old vulnerability state = " << index; + DEBUG_LOG(m_logger) << "Old vulnerability state = " << index; if (index > 0) m_ui->cbState->setCurrentIndex(index); @@ -188,10 +188,10 @@ uint32_t ParticipantSetInjuryDialog::getInjuryBit() int side = m_bgSide->button(1)->isEnabled() ? m_bgSide->checkedId() : 0; - DEBUG_LOG() << "getInjuryBit() -------------- "; - DEBUG_LOG() << "Injury = " << m_bgInjury->checkedId(); - DEBUG_LOG() << "Body = " << m_bgBodypart->checkedId(); - DEBUG_LOG() << "Side = " << side; + DEBUG_LOG(m_logger) << "getInjuryBit() -------------- "; + DEBUG_LOG(m_logger) << "Injury = " << m_bgInjury->checkedId(); + DEBUG_LOG(m_logger) << "Body = " << m_bgBodypart->checkedId(); + DEBUG_LOG(m_logger) << "Side = " << side; return (((((m_bgInjury->checkedId() * 16) + m_bgBodypart->checkedId()) * 4) + side) + 2048); @@ -328,8 +328,8 @@ bool ParticipantSetInjuryDialog::apply() req.participantIds({m_participantId}); req.vulnerabilityKind(getInjuryBit()); - DEBUG_LOG() << "Saving vulnerability state = " << req.vulnerabilityState(); - DEBUG_LOG() << "Saving vulnerability kind = " << req.vulnerabilityKind(); + DEBUG_LOG(m_logger) << "Saving vulnerability state = " << req.vulnerabilityState(); + DEBUG_LOG(m_logger) << "Saving vulnerability kind = " << req.vulnerabilityKind(); return m_requestHelper->startSingleRequest([req, this]() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.h index 11bed01ef..ed72f2ac6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_injury_dialog.h @@ -78,6 +78,7 @@ public: ~ParticipantSetInjuryDialog(); private: + NGL::INGLLogger &m_logger; void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void retranslate() override; @@ -93,9 +94,11 @@ private slots: void resetRadioStates(bool onlySides = false); private: + NGL::INGLLogger &m_logger; bool apply() override final; private: + NGL::INGLLogger &m_logger; int m_participantId; int m_eqId; LtsSession::LtsSession *m_session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.cpp index 6376c12af..f009a9995 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.cpp @@ -197,8 +197,8 @@ bool ParticipantSetSanitationDialog::apply() sanDat.originatorEquipmentNumber(0); req.data(sanDat); - DEBUG_LOG() << "Medic treatment: qualification = " << sanDat.qualification(); - DEBUG_LOG() << "Medic treatment: procedures = " << sanDat.sanitationProceduresTaken(); + DEBUG_LOG(m_logger) << "Medic treatment: qualification = " << sanDat.qualification(); + DEBUG_LOG(m_logger) << "Medic treatment: procedures = " << sanDat.sanitationProceduresTaken(); return m_requestHelper->startSingleRequest([req, this]() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.h index 87fae01b8..342eb6634 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_set_sanitation_dialog.h @@ -46,6 +46,7 @@ public: private slots: void onQualificationChanged(); private: + NGL::INGLLogger &m_logger; void fillCb(); void setCbxName(); qint64 getProcedures(); @@ -56,6 +57,7 @@ private: void onSetSanitationReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + NGL::INGLLogger &m_logger; LtsUtils::RequestHelper *m_requestHelper; int m_participantId; int m_eqId{-1}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_shootback_area_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_shootback_area_model.cpp index a99ba8504..e2f2b56d3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_shootback_area_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_shootback_area_model.cpp @@ -33,7 +33,7 @@ parent) bool AreaModel::initModel(const TargetInformation &targetInformation) { - INFO_LOG() << "initModel - #AreaModel: " << targetInformation.shootbackAreas().size(); + INFO_LOG(m_logger) << "initModel - #AreaModel: " << targetInformation.shootbackAreas().size(); for (auto singleArea : std::as_const(targetInformation.shootbackAreas())) onShootbackAreaChanged(singleArea, DataModification::eAdded); @@ -79,7 +79,7 @@ QVariant AreaModel::headerData(int section, Qt::Orientation orientation, int rol QVariant AreaModel::data(const QModelIndex &index, int role) const { - INFO_LOG() << Q_FUNC_INFO << " role=" << role + INFO_LOG(m_logger) << Q_FUNC_INFO << " role=" << role << " index = " << index.column(); if (!indexIsValid(index)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_target_config_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_target_config_dialog.cpp index eb37d0072..fd34d3bfc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_target_config_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participant_target_config_dialog.cpp @@ -36,16 +36,16 @@ ParticipantTargetConfigurationDialog::ParticipantTargetConfigurationDialog(QWidg , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_ui(new Ui::ParticipantTargetConfigurationDialog) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } ParticipantTargetConfigurationDialog::~ParticipantTargetConfigurationDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::retranslate() @@ -58,14 +58,14 @@ void ParticipantTargetConfigurationDialog::retranslate() bool ParticipantTargetConfigurationDialog::apply() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; ModifyTargetInformationRequest req; req.targetInfo(m_targetInformation); - DEBUG_LOG() << Q_FUNC_INFO << " update m_targetInformation: " << m_targetInformation; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " update m_targetInformation: " << m_targetInformation; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_requestHelper->startSingleRequest([req, this]() { return m_ftc->modifyTargetInformationRequest(req, this); @@ -77,11 +77,11 @@ bool ParticipantTargetConfigurationDialog::init(int participantId, const std::shared_ptr &ftc, const std::shared_ptr &sitMapGuiIfc) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_participantId = participantId; if (m_participantId <= 0) { - ERROR_LOG() << Q_FUNC_INFO << " participant invalid, participantId = " << m_participantId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " participant invalid, participantId = " << m_participantId; return false; } @@ -156,7 +156,7 @@ bool ParticipantTargetConfigurationDialog::init(int participantId, { onTargetInformationChanged(m_targetInformation, DataModification::eAdded); } else { - DEBUG_LOG() << Q_FUNC_INFO << " targetInformation not found for participantId = " << m_participantId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " targetInformation not found for participantId = " << m_participantId << " - use default."; m_targetInformation.participantId(m_participantId); } @@ -167,7 +167,7 @@ bool ParticipantTargetConfigurationDialog::init(int participantId, m_ui->cb_showOnMap->setChecked(true); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -190,8 +190,8 @@ void ParticipantTargetConfigurationDialog::onDynamicParticipantDataChanged(const const ProjectDataManagement::VulnerabilityState_def::type vulStateType = vulState.underlying(); int idx = m_ui->cb_status->findData(vulStateType); - DEBUG_LOG() << Q_FUNC_INFO << " cb_status: vulState=" << vulState; - DEBUG_LOG() << Q_FUNC_INFO << " cb_status: setCurrentIndex idx=" << idx; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cb_status: vulState=" << vulState; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cb_status: setCurrentIndex idx=" << idx; m_ui->cb_status->setCurrentIndex(idx); m_ui->cb_status->setEnabled(true); } @@ -213,7 +213,7 @@ void ParticipantTargetConfigurationDialog::onTargetInformationChanged(const Targ case DataModification::eAdded: case DataModification::eModified: { - DEBUG_LOG() << Q_FUNC_INFO << " got new targetInformation from dds: " << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " got new targetInformation from dds: " << data; m_targetInformation = data; } break; @@ -224,7 +224,7 @@ void ParticipantTargetConfigurationDialog::onTargetInformationChanged(const Targ void ParticipantTargetConfigurationDialog::onStatusChanged() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cb_status->setEnabled(false); @@ -293,7 +293,7 @@ void ParticipantTargetConfigurationDialog::onStatusChanged() - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -400,7 +400,7 @@ bool updateValue(ProjectDataManagement::VulnerabilityState& oldValueRef, Project void ParticipantTargetConfigurationDialog::onGuiChanged() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; bool hasChanged = false; @@ -417,26 +417,26 @@ void ParticipantTargetConfigurationDialog::onGuiChanged() hasChanged |= updateValue(m_targetInformation.takedownEffect(), static_cast(m_ui->cb_takeDownEffect->currentData().toInt()) ); hasChanged |= updateValue(m_targetInformation.takedownInterval(), m_ui->sb_takeDownInterval->value()); - DEBUG_LOG() << Q_FUNC_INFO << " hasChanged=" << hasChanged; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hasChanged=" << hasChanged; const std::vector &modelAreasStdVec = m_areaModel.getDataStdVector(); if (modelAreasStdVec != m_targetInformation.shootbackAreas()) { - DEBUG_LOG() << Q_FUNC_INFO << " hasChanged=" << hasChanged; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hasChanged=" << hasChanged; hasChanged = true; m_targetInformation.shootbackAreas(modelAreasStdVec); } - DEBUG_LOG() << Q_FUNC_INFO << " slotChangesMade sChanged=" << hasChanged; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " slotChangesMade sChanged=" << hasChanged; this->slotChangesMade(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::onDataChanged() { - TRACE_LOG() << Q_FUNC_INFO << " START, m_targetInformation=" << m_targetInformation; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_targetInformation=" << m_targetInformation; int idx; @@ -461,12 +461,12 @@ void ParticipantTargetConfigurationDialog::onDataChanged() QVector qVec = QVector(areas.begin(), areas.end()); m_areaModel.setData(qVec); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::onAddBtnClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_sitMapGuiIfc) return; @@ -477,7 +477,7 @@ void ParticipantTargetConfigurationDialog::onAddBtnClicked() s_minPoints, s_maxPoints); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } QPolygonF areaToPolygon(const ShootbackArea &area) @@ -506,14 +506,14 @@ QPolygonF areaToPolygon(const ShootbackArea &area) void ParticipantTargetConfigurationDialog::onEditBtnClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_sitMapGuiIfc) return; const QModelIndex curIdx = m_ui->ltsDataView->currentIndex(); if (!curIdx.isValid()) return; - INFO_LOG() << " edit..."; + INFO_LOG(m_logger) << " edit..."; const ShootbackArea &area = m_areaModel.getRowData(curIdx.row()); @@ -531,24 +531,24 @@ void ParticipantTargetConfigurationDialog::onEditBtnClicked() -1, coordinates); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::onRemoveBtnClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const QModelIndex curIdx = m_ui->ltsDataView->currentIndex(); if (!curIdx.isValid()) return; - INFO_LOG() << " remove..."; + INFO_LOG(m_logger) << " remove..."; m_areaModel.removeRow(curIdx.row()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_sitMapGuiIfc) return; @@ -562,7 +562,7 @@ void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int) for (int row = 0; row < rowCount; ++row) { const ShootbackArea ¤tArea = m_areaModel.getRowData(row); - INFO_LOG() << " row=" << row << " ; currentArea " << currentArea; + INFO_LOG(m_logger) << " row=" << row << " ; currentArea " << currentArea; const QPolygonF &poly = areaToPolygon(currentArea); polyVec.append(poly); } @@ -571,7 +571,7 @@ void ParticipantTargetConfigurationDialog::onShowOnMapChanged(int) } else { m_sitMapGuiIfc->removePreviewObject(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ParticipantTargetConfigurationDialog::onSelectionChanged() @@ -592,7 +592,7 @@ void ParticipantTargetConfigurationDialog::onSelectionChanged() int row = curIdx.row(); ShootbackArea currentArea = m_areaModel.getRowData(row); - INFO_LOG() << " currentArea "<< currentArea; + INFO_LOG(m_logger) << " currentArea "<< currentArea; m_previewPolygon = areaToPolygon(currentArea); @@ -602,11 +602,11 @@ void ParticipantTargetConfigurationDialog::onSelectionChanged() void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly) { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; if (poly.size() < 3) { - ERROR_LOG() << Q_FUNC_INFO << " polygon insufficiant, size=" << poly.size(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " polygon insufficiant, size=" << poly.size(); return; } @@ -627,13 +627,13 @@ void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly) return; ShootbackArea temp = m_areaModel.getRowData(curIdx.row()); newArea.identifier(temp.identifier()); - DEBUG_LOG() << Q_FUNC_INFO << "updating newArea = " << newArea; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "updating newArea = " << newArea; m_areaModel.setRowData(curIdx.row(), newArea); } else { int size = m_areaModel.rowCount(); newArea.identifier(QString(QStringLiteral("Area_%1")).arg(size).toStdString()); - DEBUG_LOG() << Q_FUNC_INFO << " adding tempArea = " << newArea; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " adding tempArea = " << newArea; m_areaModel.insertRow(newArea); QModelIndex mi = m_areaModel.index(size, 0); @@ -649,22 +649,21 @@ void ParticipantTargetConfigurationDialog::onPolygonData(const QPolygonF &poly) void ParticipantTargetConfigurationDialog::showPreviewObject() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_sitMapGuiIfc || m_previewPolygon.isEmpty()) return; m_sitMapGuiIfc->displayPreviewObject(this, m_previewPolygon, true); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } -EditNameDelegate::EditNameDelegate(QWidget *parent) - : QItemDelegate(parent) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; +EditNameDelegate::EditNameDelegate(QWidget *parent) : QItemDelegate(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } QWidget *EditNameDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, @@ -691,7 +690,7 @@ void EditNameDelegate::setEditorData(QWidget *editor, const QModelIndex &index) QVariant v = index.data(Qt::EditRole); le->setText(v.toString()); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " rox/column: " << index.row() << "/" << index.column() << " Input: " << v.toString(); } @@ -704,7 +703,7 @@ void EditNameDelegate::setModelData(QWidget *editor, if (!le) return; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " rox/column: " << index.row() << "/" << index.column() << " setData... Input: " << le->text(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participants_mounted_table_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participants_mounted_table_dialog.cpp index cd6add9b5..c1a59f48e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participants_mounted_table_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantInfo/participants_mounted_table_dialog.cpp @@ -45,7 +45,7 @@ void ParticipantsMountedTableDialog::onShowTlnInfo() if (!m_ppmGuiIfc) return; - DEBUG_LOG() << "onDoubleClick --> showTlnInfo"; + DEBUG_LOG(m_logger) << "onDoubleClick --> showTlnInfo"; const QModelIndex idx = m_ui->tvMountedParticipants->currentIndex(); const int id = m_mountedTableModel->getRowData(idx.row()).id(); m_ppmGuiIfc->showParticipantInfoWindow(id); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.cpp index db2dc5763..87e7c4786 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.cpp @@ -43,7 +43,7 @@ bool CombatPower::init(const std::shared_ptr= 0) m_ui->cbParty->setCurrentIndex(idx); - DEBUG_LOG() << "Init CombatPower - parties: " << m_ui->cbParty->count(); + DEBUG_LOG(m_logger) << "Init CombatPower - parties: " << m_ui->cbParty->count(); onPartyChanged(); m_ui->vLay->addWidget(m_orgChart); return true; @@ -75,7 +75,7 @@ bool CombatPower::init(const std::shared_ptrcbParty->count(); + DEBUG_LOG(m_logger) << "onPartyChanged - parties: " << m_ui->cbParty->count(); if (s_preselectedParty == -1) m_ui->cbParty->setCurrentIndex(s_preselectedParty); s_preselectedParty = m_ui->cbParty->currentData().toUInt(); @@ -91,7 +91,7 @@ void CombatPower::onOpenInfo(int id) void CombatPower::onUpdateParticipant(const Participant &data, DataModification modType) { - DEBUG_LOG() << "onUpdateParticipant - parties: " << m_ui->cbParty->count(); + DEBUG_LOG(m_logger) << "onUpdateParticipant - parties: " << m_ui->cbParty->count(); if (data.partyId() != m_ui->cbParty->currentData().toInt()) return; if (modType == DataModification::eModified) @@ -102,7 +102,7 @@ void CombatPower::onUpdateParticipant(const Participant &data, DataModification void CombatPower::onUpdateDynamicParticipantData(const DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "onUpdateDynamicParticipantData - parties: " << m_ui->cbParty->count(); + DEBUG_LOG(m_logger) << "onUpdateDynamicParticipantData - parties: " << m_ui->cbParty->count(); if (m_dtc->participant(data.participantId()).partyId() != m_ui->cbParty->currentData().toInt()) return; if (modType == DataModification::eModified) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.h index 4697625a9..c1f85cc11 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/combat_power.h @@ -42,6 +42,7 @@ private slots: void onUpdateParticipant(const Participant &data, DataModification modType); private: + NGL::INGLLogger &m_logger; void retranslate() override; ParticipantManagement::LtsParticipantsOrgChart *m_orgChart; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.cpp index 7c38cdc5d..2b2fd4c83 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.cpp @@ -47,7 +47,9 @@ OrgChartMain::OrgChartMain(LtsSession::LtsSession *session OrgChartMain::~OrgChartMain() { +#ifdef BUILD_RTI m_topicLockHanderData.disconnect(); +#endif m_orgChart->setParent(nullptr); m_orgChart->deleteLater(); @@ -62,11 +64,11 @@ void OrgChartMain::retranslate() void OrgChartMain::fillComboBoxes() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_isTemplate) m_ppmGuiCbxIfc->fillPartyComboBox(m_ui->cbParty); - DEBUG_LOG() << "Init OrgChartMain - parties: " << m_ui->cbParty->count() << " is template? " << m_isTemplate; + DEBUG_LOG(m_logger) << "Init OrgChartMain - parties: " << m_ui->cbParty->count() << " is template? " << m_isTemplate; } void OrgChartMain::updateButtonMimeData() @@ -99,7 +101,7 @@ void OrgChartMain::updateButtonMimeData() QColor OrgChartMain::currentPartyColor() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QColor color = AdvancedSymbology::SymbolDataToRender::unknownColor(); int partyId = -1; @@ -109,7 +111,7 @@ QColor OrgChartMain::currentPartyColor() if (partyId > 0) color = QColor::fromRgb(QRgb(m_dtc->party(partyId).color())); - TRACE_LOG() << Q_FUNC_INFO << " color=" << color.name() + TRACE_LOG(m_logger) << Q_FUNC_INFO << " color=" << color.name() << " (partyId = " << partyId << ")" << " (m_asSupportService=" << m_asSupportService << ")" << " (m_ui->cbParty->isVisible()=" << m_ui->cbParty->isVisible() << ")"; @@ -118,7 +120,7 @@ QColor OrgChartMain::currentPartyColor() AdvancedSymbology::Role OrgChartMain::currentPartyRole() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; AdvancedSymbology::Role role = AdvancedSymbology::Role::Unknown; @@ -129,7 +131,7 @@ AdvancedSymbology::Role OrgChartMain::currentPartyRole() if (partyId > 0) role = AdvancedSymbology::roleToRole<>(m_dtc->party(partyId).role()); - TRACE_LOG() << Q_FUNC_INFO << " role=" << role + TRACE_LOG(m_logger) << Q_FUNC_INFO << " role=" << role << " (partyId = " << partyId << ")" << " (m_asSupportService=" << m_asSupportService << ")" << " (m_ui->cbParty->isVisible()=" << m_ui->cbParty->isVisible() << ")"; @@ -147,7 +149,7 @@ bool OrgChartMain::init(const std::shared_ptrvLay->addWidget(m_orgChart); if (m_session->partitionType() != IDL::PartitionType::Global) @@ -181,7 +185,7 @@ bool OrgChartMain::init(const std::shared_ptrfillPartyComboBox(m_ui->cbParty); - DEBUG_LOG() << "Init OrgChartMain - parties: " << m_ui->cbParty->count(); + DEBUG_LOG(m_logger) << "Init OrgChartMain - parties: " << m_ui->cbParty->count(); onPartyChanged(); } else @@ -194,13 +198,14 @@ bool OrgChartMain::init(const std::shared_ptr coreFtc; if (!m_session->createTopicClient(coreFtc)) { - ERROR_LOG() << Q_FUNC_INFO << " create coreFtc failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " create coreFtc failed"; return; } coreFtc->enableAll(); @@ -212,7 +217,7 @@ void OrgChartMain::initTopicLockHandler() void OrgChartMain::onLockDataChanged() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->cbParty->setEnabled(true); @@ -223,7 +228,7 @@ void OrgChartMain::onLockDataChanged() if (m_topicLockedBy.isEmpty()) { - DEBUG_LOG() << Q_FUNC_INFO << " READ-WRITE"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " READ-WRITE"; setUnchangeable(false); m_orgChart->setDisabled(false); @@ -231,7 +236,7 @@ void OrgChartMain::onLockDataChanged() else { - DEBUG_LOG() << Q_FUNC_INFO << " READ-ONLY"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " READ-ONLY"; setUnchangeable(true); m_orgChart->setDisabled(true); @@ -239,7 +244,7 @@ void OrgChartMain::onLockDataChanged() retranslate(); } - +#endif bool OrgChartMain::loadTemplate(int templateRootId, bool isSupport) { @@ -323,7 +328,7 @@ bool OrgChartMain::initButtons() return true; for (const ParticipantManagement::TemplateParticipant &templateData : std::as_const(templates)) { - DEBUG_LOG() << Q_FUNC_INFO << " templateId = " << templateData.templateId() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " templateId = " << templateData.templateId() << " typeId = " << templateData.typeId() << " designator= " << templateData.designator().c_str() << " tactIdent= " << templateData.tacticalIdentifier().c_str(); @@ -363,7 +368,7 @@ bool OrgChartMain::initButtons() m_templateMimeDataHelpers[icon] = mimeDataHelper; if (!mimeDataHelper->init(icon, templateId, m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType())) { - ERROR_LOG() << Q_FUNC_INFO << " init failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed" << " (m_ui->cbParty->isVisible() " << m_ui->cbParty->isVisible() << ")"; continue; } @@ -553,14 +558,15 @@ void OrgChartMain::onPartyChanged() __unchange__(); - DEBUG_LOG() << "onPartyChanged - parties: " << m_ui->cbParty->count(); + DEBUG_LOG(m_logger) << "onPartyChanged - parties: " << m_ui->cbParty->count(); m_party = m_ui->cbParty->currentData().toInt(); - DEBUG_LOG() << " OrgChartMain::onPartyChanged()!!! -> newPartyId" << m_party; + DEBUG_LOG(m_logger) << " OrgChartMain::onPartyChanged()!!! -> newPartyId" << m_party; m_ui->cbParty->setEnabled(false); +#ifdef BUILD_RTI if (m_topicLockHanderData.isLocked()) { @@ -573,6 +579,7 @@ void OrgChartMain::onPartyChanged() topicInfo.setEntity(m_party); topicInfo.setValid(); m_topicLockHanderData.slotTryLock(topicInfo); +#endif if (m_orgChart) m_orgChart->loadParty(m_party); @@ -644,7 +651,7 @@ void OrgChartMain::onDelete(const QString &data) void OrgChartMain::onUpdateItem(const QModelIndex &parent, const ParticipantData &editData) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; Q_UNUSED(parent); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.h index e1708de24..caa217238 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main.h @@ -17,7 +17,9 @@ #include #include +#ifdef BUILD_RTI #include +#endif #include #include @@ -50,13 +52,16 @@ public: , bool useSymData = true , bool asSupportService = false , int templateId = -1); +#ifdef BUILD_RTI void initTopicLockHandler(); +#endif void onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } bool loadTemplate(int templateRootId, bool isSupport = false); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool initButtons(); QByteArray getMimeData(const Type &type, const QImage &image); @@ -80,9 +85,12 @@ private slots: void onReload(); void onUpdateParticipant(const Participant &data, DataModification modType); +#ifdef BUILD_RTI void onLockDataChanged(); +#endif private: + NGL::INGLLogger &m_logger; ParticipantManagement::LtsParticipantsOrgChart *m_orgChart; std::shared_ptr m_dtc; std::shared_ptr m_ftc; @@ -98,9 +106,9 @@ private: QMap, QPointer> m_templateMimeDataHelpers; - +#ifdef BUILD_RTI LtsSession::TopicLockHanderData m_topicLockHanderData; - +#endif bool m_useSymData; bool m_asSupportService; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.cpp index 62fd6e8e6..a39cfadf1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.cpp @@ -12,16 +12,16 @@ namespace ParticipantManagement OrgChartMain_MimeDataHelper::OrgChartMain_MimeDataHelper(QObject *parent) : QObject(parent) { - TRACE_LOG() << Q_FUNC_INFO << "START"; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } OrgChartMain_MimeDataHelper::~OrgChartMain_MimeDataHelper() { - TRACE_LOG() << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; delete m_bulkRendererFindImage; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget, @@ -29,14 +29,14 @@ bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget, const std::shared_ptr &dtc, AdvancedSymbology::SymbologyType symbologyType) { - TRACE_LOG() << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; m_templateId = templateId; m_symbologyType = symbologyType; if (!widget) { - ERROR_LOG() << Q_FUNC_INFO << "no widget"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "no widget"; return false; } m_widget = widget; @@ -44,18 +44,18 @@ bool OrgChartMain_MimeDataHelper::init(LtsWidgets::LtsDragIcon *widget, if (!dtc) { - ERROR_LOG() << "Could not load all interfaces needed"; + ERROR_LOG(m_logger) << "Could not load all interfaces needed"; return false; } m_dtc = dtc; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; return true; } void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor &color) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << " m_symbologyType = " << m_symbologyType << " role = " << role << " color = " << color.name(); @@ -65,7 +65,7 @@ void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor if (!m_dtc) { - ERROR_LOG() << "Could not load all interfaces needed"; + ERROR_LOG(m_logger) << "Could not load all interfaces needed"; return; } @@ -83,12 +83,12 @@ void OrgChartMain_MimeDataHelper::run(AdvancedSymbology::Role role, const QColor m_bulkRendererFindImage->run(); - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << " templateId= " << templateId; const TemplateParticipant &tPart = m_dtc->templateParticipant(templateId); @@ -96,7 +96,7 @@ void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId) const AdvancedSymbology::SymbolDataToRender &symDataToRender = symbolDataToRender(QString::fromStdString(tPart.symbol())); - DEBUG_LOG() << Q_FUNC_INFO << " addRequest for templateId = " << templateId << ": " + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " addRequest for templateId = " << templateId << ": " << " tPart = " << tPart << " symDataToRender=" << symDataToRender.toString(); @@ -112,7 +112,7 @@ void OrgChartMain_MimeDataHelper::prepareBulkRenderer(int templateId) prepareBulkRenderer(infId); } - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId) @@ -141,7 +141,7 @@ QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId) const AdvancedSymbology::SymbolDataToRender &symDataToRender = symbolDataToRender(QString::fromStdString(tPart.symbol())); - DEBUG_LOG() << Q_FUNC_INFO << " getResult for templateId = " << templateId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " getResult for templateId = " << templateId << " symDataToRender=" << symDataToRender.toString(); QSharedPointer watcher = @@ -157,7 +157,7 @@ QJsonObject OrgChartMain_MimeDataHelper::getMimeData(int templateId) .arg(QString::fromLatin1(data.toBase64())); retObj.insert(QStringLiteral("image"), imageAdd); } else { - ERROR_LOG() << Q_FUNC_INFO << " getResult failed! " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " getResult failed! " << " templateId = " << templateId << " symDataToRender=" << symDataToRender.toString(); } @@ -189,10 +189,10 @@ AdvancedSymbology::SymbolDataToRender OrgChartMain_MimeDataHelper::symbolDataToR void OrgChartMain_MimeDataHelper::onRenderingFinished() { - TRACE_LOG() << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size(); const QJsonObject &obj = getMimeData(m_templateId); - DEBUG_LOG() << Q_FUNC_INFO << " m_templateId =" << m_templateId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_templateId =" << m_templateId << " obj.size = " << obj.size() << " size2 = " << QJsonDocument(obj).toJson().size(); @@ -202,7 +202,7 @@ void OrgChartMain_MimeDataHelper::onRenderingFinished() m_widget->setEnabled(true); } - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.h index 48294c28a..f72ebf57b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/org_chart_main_helper.h @@ -41,6 +41,8 @@ protected slots: void onRenderingFinished(); private: + +NGL::INGLLogger &m_logger; void prepareBulkRenderer(int templateId); QJsonObject getMimeData(int templateId); AdvancedSymbology::SymbolDataToRender symbolDataToRender(const QString &sidc); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.cpp index 574793d67..3d69f64c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.cpp @@ -127,7 +127,7 @@ bool LtsParticipantsOrgChart::init(const std::shared_ptr participantMap = m_dtc->participants(); @@ -159,7 +159,7 @@ void LtsParticipantsOrgChart::loadParty(int partyId) m_participantOrgChart_MimeDataHelper = new ParticipantOrgChart_MimeDataHelper(this); if (!m_participantOrgChart_MimeDataHelper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), true)) { - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; return; } @@ -175,7 +175,7 @@ void LtsParticipantsOrgChart::loadParty(int partyId) void LtsParticipantsOrgChart::onParticipantOrgChart_MimeDataHelperFinished() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QString preDefThing = QLatin1String(" var datascource = "); @@ -205,13 +205,13 @@ void LtsParticipantsOrgChart::onParticipantOrgChart_MimeDataHelperFinished() m_ui->wevOrgChart->reload(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool LtsParticipantsOrgChart::loadTemplate(int templateRootId) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; ParticipantManagement::TemplateParticipant root = m_dtc->templateParticipant(templateRootId); if (m_ui->wevOrgChart->page()->url().toString() == QLatin1String("about:blank")) @@ -224,7 +224,7 @@ bool LtsParticipantsOrgChart::loadTemplate(int templateRootId) m_participantOrgChart_MimeDataHelper = new ParticipantOrgChart_MimeDataHelper(this); if (!m_participantOrgChart_MimeDataHelper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), false)) { - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; return false; } @@ -247,7 +247,7 @@ void LtsParticipantsOrgChart::updateParticipant(int participantId) if (!helper->init(m_dtc, AdvancedSymbology::SymbolDictionary::defaultSymbologyType(), true)) { - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; return; } @@ -265,24 +265,24 @@ void LtsParticipantsOrgChart::updateParticipant(int participantId) void LtsParticipantsOrgChart::onSingleParticipantOrgChart_MimeDataHelperFinished() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; ParticipantOrgChart_MimeDataHelper *senderWatcher = qobject_cast(sender()); if (!senderWatcher) { - ERROR_LOG() << Q_FUNC_INFO << " sender failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " sender failed"; return; } const int participantId = senderWatcher->getParticipantId(); const QJsonObject &newJson = senderWatcher->getMimeDataResult(); - DEBUG_LOG() << Q_FUNC_INFO << " sendUpdateString:" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " sendUpdateString:" << " participantId=" << participantId; emit sendUpdateString(participantId, newJson); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -298,12 +298,11 @@ void LtsParticipantsOrgChart::getWholeHierarchy() -WebNofitifier::WebNofitifier(QObject *parent) - : QObject(parent) +WebNofitifier::WebNofitifier(QObject *parent) : QObject(parent) , m_currentJsonString(QString()) , m_updateString(QString()) - , m_updateTimer(new QTimer(this)) -{ + , m_updateTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_updateTimer, &QTimer::timeout, this, &WebNofitifier::onTimerTick); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.h index a76763d18..ad59c624a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart.h @@ -96,6 +96,8 @@ signals: void sendUpdateString(int, const QJsonObject &); private: + +NGL::INGLLogger &m_logger; int m_partyId; bool m_useSymData; bool m_isMenuEnabled; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.cpp index 469fd3997..88ebe381b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.cpp @@ -13,40 +13,40 @@ namespace ParticipantManagement ParticipantOrgChart_MimeDataHelper::ParticipantOrgChart_MimeDataHelper(QObject *parent) : QObject(parent) { - TRACE_LOG() << Q_FUNC_INFO << "START"; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } ParticipantOrgChart_MimeDataHelper::~ParticipantOrgChart_MimeDataHelper() { - TRACE_LOG() << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; delete m_bulkRendererFindImage; delete m_bulkRendererFindBaseSymbol; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } bool ParticipantOrgChart_MimeDataHelper::init(const std::shared_ptr &dtc, AdvancedSymbology::SymbologyType symbologyType, bool participantMode) { - TRACE_LOG() << Q_FUNC_INFO << "START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START"; m_symbologyType = symbologyType; m_participantMode = participantMode; if (!dtc) { - ERROR_LOG() << "Could not load all interfaces needed"; + ERROR_LOG(m_logger) << "Could not load all interfaces needed"; return false; } m_dtc = dtc; - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; return true; } void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, AdvancedSymbology::Role role, const QColor &color, bool useSymData) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << ", participantId=" << participantId << ", single=" << single << ", role=" << role @@ -61,7 +61,7 @@ void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, Adv if (!m_dtc) { - ERROR_LOG() << "Could not load all interfaces needed"; + ERROR_LOG(m_logger) << "Could not load all interfaces needed"; return; } @@ -87,14 +87,14 @@ void ParticipantOrgChart_MimeDataHelper::run(int participantId, bool single, Adv else m_bulkRendererFindBaseSymbol->run(); - TRACE_LOG() << Q_FUNC_INFO << "END" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END" << ", color=" << color.name() << ", useSymData" << useSymData; } bool ParticipantOrgChart_MimeDataHelper::prepareBulkRenderer(int participantId, bool single) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << ", participantId=" << participantId << ", single=" << single; @@ -139,13 +139,13 @@ bool ParticipantOrgChart_MimeDataHelper::prepareBulkRenderer(int participantId, for (int infId : inferior) prepareBulkRenderer(infId, single); - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; return true; } QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, bool single) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << ", participantId=" << participantId << ", single=" << single; @@ -200,7 +200,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, b .arg(QString::fromLatin1(data.toBase64())); retObj.insert(QStringLiteral("image"), imageAdd); } else { - ERROR_LOG() << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found"; } @@ -223,7 +223,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getMimeData(int participantId, b QJsonObject ParticipantOrgChart_MimeDataHelper::getTemplateMimeData(int participantId, bool single) { - TRACE_LOG() << Q_FUNC_INFO << "START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START" << ", participantTemplateId=" << participantId << ", single=" << single; @@ -278,7 +278,7 @@ QJsonObject ParticipantOrgChart_MimeDataHelper::getTemplateMimeData(int particip .arg(QString::fromLatin1(data.toBase64())); retObj.insert(QStringLiteral("image"), imageAdd); } else { - ERROR_LOG() << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " SymbolResultWatcher for 2nd recusion not found"; } @@ -350,12 +350,12 @@ AdvancedSymbology::SymbolDataToRender ParticipantOrgChart_MimeDataHelper::symbol void ParticipantOrgChart_MimeDataHelper::onRenderingFinished() { - TRACE_LOG() << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << "START, bulkRendererFindImage->size: " << m_bulkRendererFindImage->size(); if (m_participantMode) m_mimeData = getMimeData(m_participantId, m_single); else m_mimeData = getTemplateMimeData(m_participantId, m_single); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_participantId =" << m_participantId << " m_single = " << m_single << " m_mimeData.size = " << m_mimeData.size() @@ -363,7 +363,7 @@ void ParticipantOrgChart_MimeDataHelper::onRenderingFinished() emit finished(); - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.h index 665fe003f..93b2d9c33 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantOrgChart/participant_org_chart_helper.h @@ -39,6 +39,8 @@ protected slots: void onRenderingFinished(); private: + +NGL::INGLLogger &m_logger; bool prepareBulkRenderer(int participantId, bool single = false); QJsonObject getMimeData(int participantId, bool single = false); QJsonObject getTemplateMimeData(int participantId, bool single = false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection.h index cf1dfaeb1..0dcde2276 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection.h @@ -62,6 +62,8 @@ private: + +NGL::INGLLogger &m_logger; protected slots: void onEnaDisa(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.cpp index 089b19d7d..4ea57ba86 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.cpp @@ -657,7 +657,7 @@ void ParticipantSelectionModel::insertChildrenOf(int parentId, auto it = tmap.constFind(childId); if (it == tmap.constEnd()) { - WARNING_LOG() << "Can not find participant with id " << childId << " - ignoring"; + WARNING_LOG(m_logger) << "Can not find participant with id " << childId << " - ignoring"; continue; } const ParticipantData &data = it.value(); @@ -682,7 +682,7 @@ void ParticipantSelectionModel::insertChildrenOf(int parentId, childItem->participant = data; childItem->bIsChecked = isChecked(checkedParticipants.contains(data.id()), cs); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << parent << " at pos " << insertPos; insertRow(insertPos, parentIdx, childItem); tryRenderSymbol(QString::fromStdString(data.symbol()), childItem); @@ -913,7 +913,7 @@ void ParticipantSelectionModel::onParticipantChanged(const ParticipantManagement CheckedTreeItem *childItem = static_cast(createItem(QVariant(), QIcon())); childItem->participant = m_dtc->convertParticipantToParticipantData(data); - DEBUG_LOG() << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() + DEBUG_LOG(m_logger) << "insert Child " << childItem << "(" << data.id() << ", " << data.hierarchyNumber() << ") to parent " << ctiParent << " at pos " << insertPos; insertRow(insertPos, indexFromItem(ctiParent), childItem); tryRenderSymbol(QString::fromStdString(data.symbol()), childItem); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.h index 5aaf842f8..7a0b67895 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantSelection/participant_selection_model.h @@ -95,6 +95,7 @@ public: QString getHierarchyFromIndex(const QModelIndex &index) const; protected: + NGL::INGLLogger &m_logger; void gatherParticipants(QHash &tmap, QHash> &parentId2id) const; @@ -140,6 +141,7 @@ signals: void internalDataChanged(); protected: + NGL::INGLLogger &m_logger; int m_partyId; bool m_bRowsAreCheckable; bool m_bUnitsSelectable; @@ -167,6 +169,7 @@ public: int partyId() const { return m_sourceModel ? m_sourceModel->partyId() : -1; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; @@ -240,6 +243,7 @@ public: SortData sortData() const { return m_sortData; } protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &sourceLeft, const QModelIndex &sourceRight) const override; bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const override; bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser.h index d5390eec6..1041f2cf0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser.h @@ -46,6 +46,8 @@ private slots: void onPrint(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onModifyTemplateDataReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_frameless.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_frameless.h index 4f0e6652a..159d4d9d1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_frameless.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_frameless.h @@ -33,6 +33,8 @@ Q_SIGNALS: void selectedTemplate(int); private: + +NGL::INGLLogger &m_logger; ParticipantTemplateChooserModel *m_model; std::shared_ptr m_dtc; LtsSession::LtsSession *m_session; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_model.h index a0d9b7599..5c60c4545 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_chooser_model.h @@ -46,6 +46,8 @@ public: Qt::DropActions supportedDragActions() const override { return Qt::CopyAction; } protected: + +NGL::INGLLogger &m_logger; int getId(const TemplateParticipant &data) const override { return data.templateId(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.cpp index 4e846edeb..5e792cfef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.cpp @@ -402,7 +402,7 @@ void ParticipantTemplateEdit::onDoubleClicked(const QModelIndex &selIndex) void ParticipantTemplateEdit::onSelectionChanged(const QItemSelection & , const QItemSelection & ) { - DEBUG_LOG() << "onSelectionChanged"; + DEBUG_LOG(m_logger) << "onSelectionChanged"; enaDisa(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.h index faac8c3a5..fb5b87943 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/participant_template_edit.h @@ -55,6 +55,7 @@ public Q_SLOTS: bool apply() override final; private: + NGL::INGLLogger &m_logger; void retranslate() override; QModelIndex selectedIndexView() const; bool isContainer(const QModelIndex &index); @@ -84,6 +85,7 @@ protected slots: private: + NGL::INGLLogger &m_logger; int m_rootId; bool m_asSupportService; bool m_bNeedCommitModifedData; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/template_unit_namer.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/template_unit_namer.h index 09bae3553..df82dff3b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/template_unit_namer.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/ParticipantTemplates/template_unit_namer.h @@ -29,6 +29,8 @@ public: ~TemplateUnitNamer(); private: + +NGL::INGLLogger &m_logger; void onSetUnitName(); void onTypeClassChanged(); void enaDisa(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.cpp index ead2ec52a..3d0605c6f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.cpp @@ -48,17 +48,17 @@ bool OperatorPartyAssignment::init(LtsSession::LtsSession *session) m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setVisible(false); if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG()<<" -- Couldn't init ppmDtc"; + ERROR_LOG(m_logger)<<" -- Couldn't init ppmDtc"; return false; } if (!m_session->getDtc(m_opmDtc)) { - ERROR_LOG()<<" -- Couldn't init opmDtc"; + ERROR_LOG(m_logger)<<" -- Couldn't init opmDtc"; return false; } if (!m_session->getFtc(m_ppmFtc)) { - ERROR_LOG()<<" -- Couldn't init ppmFtc"; + ERROR_LOG(m_logger)<<" -- Couldn't init ppmFtc"; return false; } @@ -98,7 +98,7 @@ QMap OperatorPartyAssignment::getPartyStatesForOpertator() const - DEBUG_LOG()<<" -- [getPartyStatesForOpertator] -> "; + DEBUG_LOG(m_logger)<<" -- [getPartyStatesForOpertator] -> "; const auto &partys = m_ppmDtc->partys(); QMap mapPartyCheckStates; for (auto p : partys) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.h index 4cd6d7b2b..4de2e271d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment.h @@ -41,11 +41,13 @@ private slots: void onOperatorChanged(const OperatorManagement::User &data, DataModification modType); void onSelectionOperatorChanged(const int index); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void enaDisa(); private: + NGL::INGLLogger &m_logger; QString m_menuGroup; std::shared_ptr m_ppmDtc; std::shared_ptr m_ppmFtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment_model.h index 9bc4a7004..a1430c43d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/operator_party_assignment_model.h @@ -35,6 +35,8 @@ public slots: void updateView(const QMap partyCheckStates); protected: + +NGL::INGLLogger &m_logger; QVariant data(const QModelIndex &, int) const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override final; Qt::ItemFlags flags(const QModelIndex &index) const override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_edit.cpp index a2c1f927c..2dddaf083 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_edit.cpp @@ -70,7 +70,7 @@ void PartyEdit::lock() bool PartyEdit::init(int partyId, LtsSession::LtsSession *session) { - DEBUG_LOG() << "PartyEdit::init()"; + DEBUG_LOG(m_logger) << "PartyEdit::init()"; m_session = session; if (!m_session->getDtc(m_dtc)) @@ -179,7 +179,7 @@ bool PartyEdit::apply() reqOpm.rolePresetId(user.rolePresetId()); QString properties = QString::fromUtf8(QJsonDocument(opmProperties).toJson()); - DEBUG_LOG() << "properties: " << properties; + DEBUG_LOG(m_logger) << "properties: " << properties; reqOpm.properties(properties.toStdString()); m_requestHelper->addRequest([reqOpm, this]() @@ -364,14 +364,14 @@ void PartyEdit::notificationCheck() { if (!m_dtcOpm->isAdlerAllowedParty(m_session->exerciseId(), m_partyId, LtsSessionData::LtsSessionData::getInstance()->getOperatorId())) { - WARNING_LOG() << "Party " << m_partyId << " not allowed for this user"; + WARNING_LOG(m_logger) << "Party " << m_partyId << " not allowed for this user"; m_ui->lblNotifications->hide(); m_ui->cbAdlerNotification->hide(); m_ui->cbCombatOrder->hide(); return; } - DEBUG_LOG() << "Party allowed for ADLER notifications"; + DEBUG_LOG(m_logger) << "Party allowed for ADLER notifications"; const std::string properties = m_dtcOpm->user(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()).properties(); QJsonObject opmProperties(QJsonDocument::fromJson(QByteArray::fromStdString(properties)).object()); @@ -407,7 +407,7 @@ void PartyEdit::notificationCheck() void PartyEdit::modifyPartyProperties() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; ParticipantManagement::Party requestParty; requestParty = m_dtc->party(m_partyId); @@ -422,11 +422,11 @@ void PartyEdit::modifyPartyProperties() if (parserError.error != QJsonParseError::NoError) { - ERROR_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'"; + ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'"; doc = QJsonDocument(); } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); QJsonObject obj(doc.object()); obj[QStringLiteral("Adler")] = adlerPropertiesObj; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.cpp index 6a0e0a8cb..d35aa05ac 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.cpp @@ -34,12 +34,12 @@ bool PartyModel::initModel(LtsSession::LtsSession *session) m_session = session; if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG()<<" Couldn't load ppmDtc!!! "; + ERROR_LOG(m_logger)<<" Couldn't load ppmDtc!!! "; return false; } if (!m_session->getDtc(m_opmDtc)) { - ERROR_LOG()<<" Couldn't load opmDtc!!! "; + ERROR_LOG(m_logger)<<" Couldn't load opmDtc!!! "; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.h index 4f3dfb86d..3df5dd2f5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_model.h @@ -40,6 +40,8 @@ public: QVariant data(const QModelIndex &, int) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const Party &data, DataModification modType) const override { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.cpp index 14df6ad71..64f4389e8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.cpp @@ -196,7 +196,7 @@ void PartyView::onSyncParties() SyncPartiesRequest req; req.exerciseId(m_session->exerciseId()); - DEBUG_LOG() << "Sync parties for exercise " << req.exerciseId(); + DEBUG_LOG(m_logger) << "Sync parties for exercise " << req.exerciseId(); return m_ftc->syncPartiesRequest(req, this); }); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.h index 9d2859f75..612f6b78d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/PartyEdit/ppm_party_view.h @@ -39,6 +39,11 @@ public: private: + + + + +NGL::INGLLogger &m_logger; void retranslate() override; void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } void onRemovePartyReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/ppm_saab_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/ppm_saab_edit.h index 2dd9ef419..cd323f810 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/ppm_saab_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/ppm_saab_edit.h @@ -42,6 +42,8 @@ public: const std::shared_ptr &ppmGuiCbxIfc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_export.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_export.cpp index 0c8f3a9df..7128a9325 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_export.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_export.cpp @@ -91,14 +91,14 @@ void ExportSaab::onStartExport() if (!file.open(QIODevice::WriteOnly)) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. You do not have the permission to write the selected file.")); - ERROR_LOG() << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing"; + ERROR_LOG(m_logger) << "Could not export exercise: \"" << strExportFile << "\" could not be opened for writing"; return; } if (!isValidConfigFile()) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to start export. Config file invalid.")); - ERROR_LOG() << "Could not export exercise: \"" << strConfigFile << "\" invalid"; + ERROR_LOG(m_logger) << "Could not export exercise: \"" << strConfigFile << "\" invalid"; return; } @@ -181,13 +181,13 @@ bool ExportSaab::isValidConfigFile() { if (!m_configFile) { - ERROR_LOG() << "Not possible to read config: No file selected"; + ERROR_LOG(m_logger) << "Not possible to read config: No file selected"; return false; } if (!m_configFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to read config: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \"" << m_configFile->fileName() << "\" for reading."; return false; @@ -217,11 +217,11 @@ bool ExportSaab::isValidConfigFile() m_configFile->close(); if (!hasEchelons) - ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"'; if (!hasSymbols) - ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"'; if (!hasForces) - ERROR_LOG() << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_FORCES() << " in file \"" << m_configFile->fileName() << '\"'; return hasEchelons && hasSymbols && hasForces; } @@ -243,13 +243,13 @@ void ExportSaab::importConfig() if (!m_configFile) { - ERROR_LOG() << "Not possible to read config: No file selected"; + ERROR_LOG(m_logger) << "Not possible to read config: No file selected"; return; } if (!m_configFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to read config: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \"" << m_configFile->fileName() << "\" for reading."; return; @@ -456,13 +456,13 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p { if (participant.isDeleted()) { - DEBUG_LOG() << "Participant with id " << participant.id() << " id deleted --> skipping"; + DEBUG_LOG(m_logger) << "Participant with id " << participant.id() << " id deleted --> skipping"; return nullptr; } if (participant.externalId()) { - DEBUG_LOG() << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported."; + DEBUG_LOG(m_logger) << "Particpant with id " << participant.id() << " has external ID set to " << participant.externalId() << " --> not being exported."; return nullptr; } @@ -491,7 +491,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p { result = new SaabUnit; - DEBUG_LOG() << "Reading unit with " << participant.inferiorIds().size() << " inferiors"; + DEBUG_LOG(m_logger) << "Reading unit with " << participant.inferiorIds().size() << " inferiors"; for (int32_t id : participant.inferiorIds()) { @@ -499,7 +499,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p if (player == nullptr) { - DEBUG_LOG() << "Skipping inferior with id " << id; + DEBUG_LOG(m_logger) << "Skipping inferior with id " << id; continue; } @@ -509,7 +509,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p if (!static_cast(result)->inferiors.size()) { - DEBUG_LOG() << "Unit " << participant.id() << " has no inferiors."; + DEBUG_LOG(m_logger) << "Unit " << participant.id() << " has no inferiors."; return nullptr; } @@ -519,7 +519,7 @@ SaabPlayer *ExportSaab::toSaabPlayer(const ParticipantManagement::Participant &p case ParticipantManagement::TypeClass::Aircraft: case ParticipantManagement::TypeClass::Unknown: default: - DEBUG_LOG() << "Type " << participant.typeId() << " is not supported."; + DEBUG_LOG(m_logger) << "Type " << participant.typeId() << " is not supported."; return nullptr; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_import.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_import.cpp index 56ecffdff..089fdda07 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_import.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Saab/saab/saab_import.cpp @@ -35,7 +35,7 @@ ImportSaab::ImportSaab(ParticipantManagement::ParticipantEditModel *pModel, cons if (!pSession->getDtc(m_ppmDtc) || !pSession->getFtc(m_ppmFtc)) { - ERROR_LOG() << "Fetching m_ppmDtc or m_ppmFtc failed!"; + ERROR_LOG(m_logger) << "Fetching m_ppmDtc or m_ppmFtc failed!"; setEnabled(false); } else @@ -230,13 +230,13 @@ void ImportSaab::importOrbat() { if (!m_xmlFile) { - ERROR_LOG() << "Not possible to import ORBAT: No file selected"; + ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected"; return; } if (!m_xmlFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to import ORBAT: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \"" << m_xmlFile->fileName() << "\" for reading."; return; @@ -267,7 +267,7 @@ void ImportSaab::importOrbat() if (m_logger.isDebugEnabled()) { for (SaabUnit *u : std::as_const(m_rootUnits)) - DEBUG_LOG() << u->toString(); + DEBUG_LOG(m_logger) << u->toString(); } m_xmlFile->close(); @@ -290,13 +290,13 @@ void ImportSaab::importConfig() if (!m_configFile) { - ERROR_LOG() << "Not possible to read config: No file selected"; + ERROR_LOG(m_logger) << "Not possible to read config: No file selected"; return; } if (!m_configFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to read config: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \"" << m_configFile->fileName() << "\" for reading."; return; @@ -374,7 +374,7 @@ QVector ImportSaab::inferiors(SaabPlayer *player) const SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const { - DEBUG_LOG() << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); + DEBUG_LOG(m_logger) << "reading unit: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); SaabUnit *result = new SaabUnit; @@ -433,7 +433,7 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const int index = playerIndexByGuid(result->guid, result->inferiors); if (index < 0) - WARNING_LOG() << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found."; + WARNING_LOG(m_logger) << SAAB_POSITION_BY_PLAYER_ID() << " set, but GUID " << result->positionByPlayerId << " could not be found."; else result->inferiors.prepend(result->inferiors.takeAt(index)); } @@ -443,21 +443,21 @@ SaabPlayer *ImportSaab::readUnit(QXmlStreamReader *reader) const SaabPlayer *ImportSaab::readOcPlayer(QXmlStreamReader *reader) const { - DEBUG_LOG() << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); + DEBUG_LOG(m_logger) << "reading oc player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); return readPersonOcPlayer(reader, XmlStrings::SAAB_OC_PLAYER());; } SaabPlayer *ImportSaab::readPersonPlayer(QXmlStreamReader *reader) const { - DEBUG_LOG() << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); + DEBUG_LOG(m_logger) << "reading person player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); return readPersonOcPlayer(reader, XmlStrings::SAAB_PERSON_PLAYER()); } SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const { - DEBUG_LOG() << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); + DEBUG_LOG(m_logger) << "reading vehicle player: tokentype: " << reader->tokenString() << " | name: " << reader->name().toString(); using namespace XmlStrings; @@ -468,7 +468,7 @@ SaabPlayer *ImportSaab::readVehiclePlayer(QXmlStreamReader *reader) const SaabVehicle vehicle = saabVehicleByGUID(reader->readElementText()); if (vehicle.guid.isEmpty()) - WARNING_LOG() << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found."; + WARNING_LOG(m_logger) << SAAB_VEHICLE_REF_ID() << " set, but GUID " << result->refId << " could not be found."; else { result->registrationNumber = vehicle.registrationNumber; @@ -577,7 +577,7 @@ void ImportSaab::buildImportTreeView(const QVector &vecUnitsWithVa if (vecUnitsWithValidDISTypes.contains(player->superior)) tmp.append(player); else - WARNING_LOG() << "Parent missing: Could not import player " << player->designation; + WARNING_LOG(m_logger) << "Parent missing: Could not import player " << player->designation; continue; } @@ -595,13 +595,13 @@ bool ImportSaab::isValidSaabOrbatFile() const { if (!m_xmlFile) { - ERROR_LOG() << "Not possible to import ORBAT: No file selected"; + ERROR_LOG(m_logger) << "Not possible to import ORBAT: No file selected"; return false; } if (!m_xmlFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to import ORBAT: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to import ORBAT: Could not open file \"" << m_xmlFile->fileName() << "\" for reading."; return false; @@ -631,11 +631,11 @@ bool ImportSaab::isValidSaabOrbatFile() const m_xmlFile->close(); if (!hasExerciseOrbatRoot) - ERROR_LOG() << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"'; if (!hasExercise) - ERROR_LOG() << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_EXERCISE() << " in file \"" << m_xmlFile->fileName() << '\"'; if (!hasOrbat) - ERROR_LOG() << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_ORBAT() << " in file \"" << m_xmlFile->fileName() << '\"'; return hasExerciseOrbatRoot && hasExercise && hasOrbat; } @@ -644,13 +644,13 @@ bool ImportSaab::isValidConfigFile() const { if (!m_configFile) { - ERROR_LOG() << "Not possible to read config: No file selected"; + ERROR_LOG(m_logger) << "Not possible to read config: No file selected"; return false; } if (!m_configFile->open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Not possible to read config: Could not open file \"" + ERROR_LOG(m_logger) << "Not possible to read config: Could not open file \"" << m_configFile->fileName() << "\" for reading."; return false; @@ -677,9 +677,9 @@ bool ImportSaab::isValidConfigFile() const m_configFile->close(); if (!hasEchelons) - ERROR_LOG() << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_ECHELONS() << " in file \"" << m_configFile->fileName() << '\"'; if (!hasSymbols) - ERROR_LOG() << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"'; + ERROR_LOG(m_logger) << "Could not find " << SAAB_SYMBOLS() << " in file \"" << m_configFile->fileName() << '\"'; return hasEchelons && hasSymbols; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.cpp index 328e66c22..99c1d5583 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.cpp @@ -66,11 +66,11 @@ bool TypeEdit::init(int typeId, const std::shared_ptr &flmDtc, const std::shared_ptr &flmFtc) { - DEBUG_LOG() << "TypeEdit::init()"; + DEBUG_LOG(m_logger) << "TypeEdit::init()"; if (!dtc || !ftc || !ppmGuiCbxIfc) { - ERROR_LOG() << "TypeEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "TypeEdit::init() Invalid shared_ptr!"; return false; } @@ -82,9 +82,9 @@ bool TypeEdit::init(int typeId, m_flmFtc = flmFtc; if (m_flmDtc && !m_flmDtc->enableFileContent()) - WARNING_LOG() << "Could not enable FLM DTC fileContent!"; + WARNING_LOG(m_logger) << "Could not enable FLM DTC fileContent!"; if (m_flmFtc && !m_flmFtc->enableFileContentSetUsed()) - WARNING_LOG() << "Could not enable FLM FTC fileContentSetUsed!"; + WARNING_LOG(m_logger) << "Could not enable FLM FTC fileContentSetUsed!"; std::shared_ptr msdlInterface; m_session->getForeignGuiInterface(msdlInterface); @@ -157,13 +157,13 @@ bool TypeEdit::apply() }); - DEBUG_LOG() << "Old symbol: " << m_symbolSidcOld; - DEBUG_LOG() << "New symbol: " << m_symbolSidc; + DEBUG_LOG(m_logger) << "Old symbol: " << m_symbolSidcOld; + DEBUG_LOG(m_logger) << "New symbol: " << m_symbolSidc; if (!m_symbolSidc.isEmpty()) { int symbolId = AdvancedSymbology::SidcCodec::decodeCivilXml(m_symbolSidc); - DEBUG_LOG() << "Symbol Id = " << symbolId; + DEBUG_LOG(m_logger) << "Symbol Id = " << symbolId; if (symbolId > 0) { FileManagement::FileContent data = m_flmDtc->fileContent(symbolId); @@ -188,7 +188,7 @@ bool TypeEdit::apply() if (!m_symbolSidcOld.isEmpty() && m_symbolSidcOld != m_symbolSidc) { int symbolId = AdvancedSymbology::SidcCodec::decodeCivilXml(m_symbolSidcOld); - DEBUG_LOG() << "Symbol Id = " << symbolId; + DEBUG_LOG(m_logger) << "Symbol Id = " << symbolId; if (symbolId > 0) { FileManagement::FileContent data = m_flmDtc->fileContent(symbolId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.h index 8d3bd3f4e..cc0a08964 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_edit.h @@ -61,6 +61,8 @@ public slots: void onChangeSymbolInternal(const QString &sidc, bool bInitial = false); private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void fillComboboxes(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_model.h index 3ddf8b093..f604b872a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_model.h @@ -49,6 +49,8 @@ protected slots: void onDataChangedLocal(const Type &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; void updateFilterTypeClasses(); private: QHash m_equipmentTypes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_view.h index fe0e6151b..8efa698d2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/TypeEdit/ppm_type_view.h @@ -37,6 +37,8 @@ public: const std::shared_ptr &flmFtc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onRemoveTypeReply(const Core::FunctionReplyObject &replyObject) override { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_dialog.h index dd7880b00..4e818b1cd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_dialog.h @@ -48,6 +48,8 @@ public: bool init(); private: + +NGL::INGLLogger &m_logger; void onRemoveUasReply(const Core::FunctionReplyObject &reply) override; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.cpp index b1098d7f5..19c6a1412 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.cpp @@ -57,7 +57,7 @@ bool UasListModel::initModel(LtsSession::LtsSession *session) m_exmDtc->waitForHistoricalDataExercise(500); - DEBUG_LOG() << "UasListModel initialised for exercise " << m_exerciseId; + DEBUG_LOG(m_logger) << "UasListModel initialised for exercise " << m_exerciseId; return true; } @@ -124,7 +124,7 @@ void UasListModel::onUasChanged(const UAS &data, const DataModification modType) case DataModification::eModified: case DataModification::eAdded: { - DEBUG_LOG() << "DataModification::eModified and eAdded: "; + DEBUG_LOG(m_logger) << "DataModification::eModified and eAdded: "; if (row < 0) insertRow(data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.h index 4f789368b..95fdcd10e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ParticipantManagement/Gui/Uas/ppm_uas_list_model.h @@ -51,6 +51,7 @@ class UasListModel : public LtsWidgets::LtsAbstractTableModel void onUasChanged(const ParticipantManagement::UAS &data, const DataModification modType); private: + NGL::INGLLogger &m_logger; int32_t m_exerciseId { 0 }; std::shared_ptr m_ppmDtc; std::shared_ptr m_exmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/Test/main.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/Test/main.cpp index d7ed8b234..85aeb4ca1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/Test/main.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/Test/main.cpp @@ -171,7 +171,7 @@ class TestMainWindow : public QMainWindow if (!QFile::exists(initFilePath)) FATAL_LOG(m_logger) << Q_FUNC_INFO << " MapIniFile location Failed"; else - DEBUG_LOG() << Q_FUNC_INFO << " MapIniFile found: " << initFilePath; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapIniFile found: " << initFilePath; SituationMap::MapSettings * mapSettings = new SituationMap::MapSettings(initFilePath, m_map); MapInitializer *mapInitializer = new MapInitializer(*m_map, *mapSettings, QLatin1String("PlanEditorTest"), m_map); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/attribute_dialog_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/attribute_dialog_manager.cpp index 5bf34aa15..0511f2409 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/attribute_dialog_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/attribute_dialog_manager.cpp @@ -261,7 +261,7 @@ public: if (partyColors.size() > customColorCount) { - WARNING_LOG() << Q_FUNC_INFO << " To much party colors (" + WARNING_LOG(m_logger) << Q_FUNC_INFO << " To much party colors (" << partyColors.size() << ") color dialog custom colors are limited to " << customColorCount @@ -602,7 +602,7 @@ void AttributeDialogManager::onResetWidgets() AdvancedSymbology::Gui::SymbolModificationDialog *AttributeDialogManager::InternalData::buildSymbolModifyDialog(QWidget *parent, bool isParticipant) { - TRACE_LOG() << Q_FUNC_INFO << " START " + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << ", isParticipant=" << isParticipant << ", this=" << this; @@ -641,7 +641,7 @@ static void colorizeButton(QAbstractButton *button, const QColor color) SymbologyXML::SymbolDialog *AttributeDialogManager::InternalData::buildSymbolXMLDialog(QWidget *parent) { - TRACE_LOG() << Q_FUNC_INFO << " START " << ", this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << ", this=" << this; SymbologyXML::SymbolDialog *dlg = new SymbologyXML::SymbolDialog(m_map->symbolDictionary(),m_geoModel,true,parent); if(dlg) @@ -1106,7 +1106,7 @@ LtsWidgets::LtsDialog *AttributeDialogManager::InternalData::buildTextAttrBox(QW LtsWidgets::LtsDialog * AttributeDialogManager::InternalData::buildParticipantBox(QWidget *parent) { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; Dialog *dlg = new Dialog(parent); dlg->setObjectName(QLatin1String("PlanEditor::ParticipantData")); @@ -1334,7 +1334,7 @@ LtsWidgets::LtsDialog * AttributeDialogManager::InternalData::buildParticipantBo m_self->onCloseDialog(); }); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; return dlg; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/geometry_placer.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/geometry_placer.h index 743c0f9da..eb159a41f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/geometry_placer.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/geometry_placer.h @@ -158,7 +158,7 @@ template GeometryPlacer::GeometryPlacer( if (m_uidList.isEmpty()) { - WARNING_LOG() << Q_FUNC_INFO << "Object list of GeometryPlacer is empty."; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "Object list of GeometryPlacer is empty."; return; } @@ -167,7 +167,7 @@ template GeometryPlacer::GeometryPlacer( - ERROR_LOG() << Q_FUNC_INFO << "Can't determine bounding box of selected features"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Can't determine bounding box of selected features"; #ifdef LTS_DEBUG diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp index 6a5f7cedd..dcd176e82 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/mil2525d_to_mil2525c.cpp @@ -137,7 +137,7 @@ public: if (lineNo > 1) { if (!parseLine(stripLeadingAndTrailingQuotes(line))) - ERROR_LOG() << "Error while parsing MIL2525D_toMIL2525C.def in line " << lineNo << ENDLOG(); + ERROR_LOG(m_logger) << "Error while parsing MIL2525D_toMIL2525C.def in line " << lineNo << ENDLOG(); } } file.close(); @@ -186,9 +186,9 @@ public: } #endif } - else ERROR_LOG() << "Open file for reading failed: " << file.fileName() << ENDLOG(); + else ERROR_LOG(m_logger) << "Open file for reading failed: " << file.fileName() << ENDLOG(); } - else ERROR_LOG() << "File doesn't exist: " << file.fileName() << ENDLOG(); + else ERROR_LOG(m_logger) << "File doesn't exist: " << file.fileName() << ENDLOG(); } ~Internal() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor.h index 404d53b9e..eb765ecb6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor.h @@ -286,6 +286,8 @@ public slots: protected: + +NGL::INGLLogger &m_logger; bool eventFilter(QObject *obj, QEvent *event) override; void initializePlan(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor_internal.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor_internal.h index cfa5d3e11..450a4b17e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor_internal.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/plan_editor_internal.h @@ -308,12 +308,12 @@ public: if (m_geoModel == nullptr) { - ERROR_LOG() << Q_FUNC_INFO << " Creating Geometry Model failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Creating Geometry Model failed."; return; } if (m_geoModelRenderer == nullptr) { - ERROR_LOG() << Q_FUNC_INFO << " Creating Geometry Model Renderer failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Creating Geometry Model Renderer failed."; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/selection_worker.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/selection_worker.cpp index e80547d0d..7015d0bcc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/selection_worker.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/selection_worker.cpp @@ -19,13 +19,12 @@ SelectionWorker::SelectionWorker(PlanEditor *planEditor , SituationMap::GeometryModel *geometryModel , SituationMap::Map *map , SelectionMode mode - , const QPointF &viewPortPosition) - : QObject(planEditor) + , const QPointF &viewPortPosition) : QObject(planEditor) , m_planEditor(planEditor) , m_geometryModel(geometryModel) , m_map(map) - , m_rubberband(nullptr) -{ + , m_rubberband(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { switch (mode) { @@ -47,7 +46,7 @@ SelectionWorker::SelectionWorker(PlanEditor *planEditor connect(rubberband, &SituationMap::RB::Rubberband::apply, this, &SelectionWorker::onLineSelect); connect(rubberband, &SituationMap::RB::Rubberband::abort, this, &SelectionWorker::onAbortSelect); } - else ERROR_LOG() << Q_FUNC_INFO << "Creating rubberband for line selection failed."; + else ERROR_LOG(m_logger) << Q_FUNC_INFO << "Creating rubberband for line selection failed."; } break; case SelectionMode::Lasso : @@ -65,7 +64,7 @@ SelectionWorker::SelectionWorker(PlanEditor *planEditor connect(rubberband, &SituationMap::RB::Rubberband::apply, this, &SelectionWorker::onLassoSelect); connect(rubberband, &SituationMap::RB::Rubberband::abort, this, &SelectionWorker::onAbortSelect); } - else ERROR_LOG() << Q_FUNC_INFO << "Creating rubberband for lasso selection failed."; + else ERROR_LOG(m_logger) << Q_FUNC_INFO << "Creating rubberband for lasso selection failed."; } break; case SelectionMode::Rectangle : @@ -82,7 +81,7 @@ SelectionWorker::SelectionWorker(PlanEditor *planEditor connect(rubberband, &SituationMap::RB::Rubberband::apply, this, &SelectionWorker::onRectSelect); connect(rubberband, &SituationMap::RB::Rubberband::abort, this, &SelectionWorker::onAbortSelect); } - else ERROR_LOG() << Q_FUNC_INFO << "Creating rubberband for rectangle selection failed."; + else ERROR_LOG(m_logger) << Q_FUNC_INFO << "Creating rubberband for rectangle selection failed."; } break; case SelectionMode::Picking : diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/symbol_favourites.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/symbol_favourites.cpp index e99303da0..5f0d93823 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/symbol_favourites.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanEditor/symbol_favourites.cpp @@ -391,7 +391,7 @@ public: if (!setContent(xml, &errorMsg, &errorLine, &errorColumn)) { - ERROR_LOG() << Q_FUNC_INFO << " parsing xml input failed: " << errorMsg << " at line " << errorLine << " , column " << errorColumn; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " parsing xml input failed: " << errorMsg << " at line " << errorLine << " , column " << errorColumn; setContent(backup); return false; } @@ -412,7 +412,7 @@ public: if (!setContent(device, &errorMsg, &errorLine, &errorColumn)) { - ERROR_LOG() << Q_FUNC_INFO << " parsing xml input failed: " << errorMsg << " at line " << errorLine << " , column " << errorColumn; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " parsing xml input failed: " << errorMsg << " at line " << errorLine << " , column " << errorColumn; setContent(backup); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.cpp index c9d67e4dd..044ca1553 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.cpp @@ -91,7 +91,7 @@ void PlanTopicEditor::updateInternalData() if (fileId != -1) { - DEBUG_LOG() << "topic compatibility mode - converting.."; + DEBUG_LOG(m_logger) << "topic compatibility mode - converting.."; QJsonObject fakePlanItem; fakePlanItem[QStringLiteral("keyId")] = 0; @@ -111,7 +111,7 @@ void PlanTopicEditor::updateInternalData() if (m_planItems.isEmpty()) { - WARNING_LOG() << "topic empty"; + WARNING_LOG(m_logger) << "topic empty"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.h index 3a947ee94..d007037cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/TopicEditor/topic_editor.h @@ -34,6 +34,10 @@ public: private: + + + +NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.cpp index 36a21db5f..fbd6d138b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.cpp @@ -381,7 +381,7 @@ void PlanOverlayModel::updatePlanItem(const PlanItem &planItem) { if (!planItem.isValid()) { - ERROR_LOG() << "planItem has invalid key"; + ERROR_LOG(m_logger) << "planItem has invalid key"; return; } @@ -539,12 +539,12 @@ void PlanOverlayModel::removeOverlay(int keyId) bool PlanOverlayModel::reInitModel(int exerciseId, int phaseId) { - DEBUG_LOG() << "ReInit Model for exerciseId = " << exerciseId << ", phaseId = " << phaseId; + DEBUG_LOG(m_logger) << "ReInit Model for exerciseId = " << exerciseId << ", phaseId = " << phaseId; if ((exerciseId < 1) || (phaseId < 1)) { - WARNING_LOG() << Q_FUNC_INFO << " has been called with undefined exercise and/or phaseId"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " has been called with undefined exercise and/or phaseId"; return false; } @@ -558,7 +558,7 @@ bool PlanOverlayModel::reInitModel(int exerciseId, int phaseId) int planExId = it.value().m_exerciseId; int planPhId = it.value().m_phaseId; - DEBUG_LOG() << "Plan name = " << it.value().m_fileName << " exercise = " << planExId << " phase = " << planPhId; + DEBUG_LOG(m_logger) << "Plan name = " << it.value().m_fileName << " exercise = " << planExId << " phase = " << planPhId; if ((planExId < 1) || (planPhId < 1) || ((planExId == exerciseId) && (planPhId == phaseId))) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.h index fab86c467..67c3a9cd4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlay_model.h @@ -174,6 +174,7 @@ signals: private: + NGL::INGLLogger &m_logger; PlanItem &planItemRef(int keyId); class InternalData; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.cpp index 297263f64..72f2d3c1f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.cpp @@ -122,31 +122,31 @@ bool InterfaceImpl::fetchInterfaces() if (!m_session->getDtc(m_internal->m_dtc)) { - DEBUG_LOG() << "getDtc for FileManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for FileManagement::DataInterface failed."; return false; } if (!m_session->getDtc(m_internal->m_opmDtc)) { - DEBUG_LOG() << "getDtc for OperatorManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for OperatorManagement::DataInterface failed."; return false; } if (!m_session->getDtc(m_internal->m_exmDtc)) { - DEBUG_LOG() << "getDtc for ExerciseManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getDtc for ExerciseManagement::DataInterface failed."; return false; } if (!m_session->getFtc(m_internal->m_ftc)) { - DEBUG_LOG() << "getFtc for FileManagement::DataInterface failed."; + DEBUG_LOG(m_logger) << "getFtc for FileManagement::DataInterface failed."; return false; } if (!m_session->getForeignGuiInterface(m_internal->m_situationMapGui)) { - DEBUG_LOG() << "getForeignGuiInterface for SituationMap::ForeignGuiInterface failed."; + DEBUG_LOG(m_logger) << "getForeignGuiInterface for SituationMap::ForeignGuiInterface failed."; return false; } @@ -238,7 +238,7 @@ bool InterfaceImpl::loadPlan(int planFileId, if (overrideSitMapIfc == nullptr) { - ERROR_LOG() << "no sit map ifc to load a plan on!"; + ERROR_LOG(m_logger) << "no sit map ifc to load a plan on!"; return false; } @@ -250,7 +250,7 @@ bool InterfaceImpl::loadPlan(int planFileId, if (fileContent.id() <= 0) { - ERROR_LOG() << "Could not find plan with id " << planFileId << " in filemanagement - removing"; + ERROR_LOG(m_logger) << "Could not find plan with id " << planFileId << " in filemanagement - removing"; return false; } @@ -265,7 +265,7 @@ bool InterfaceImpl::loadPlan(int planFileId, if (!overrideSitMapIfc->planOverlaySetContent(planFileId, nameOfPlan, planXMLContent)) { - ERROR_LOG() << "no sit map ifc to load a plan on!"; + ERROR_LOG(m_logger) << "no sit map ifc to load a plan on!"; return false; } @@ -307,7 +307,7 @@ bool InterfaceImpl::loadPlan(int planFileId, else planItem.m_maxScale = 0.0; - DEBUG_LOG() << " load plan and set minMaxScale:" + DEBUG_LOG(m_logger) << " load plan and set minMaxScale:" << " minScaleStr = " << minScaleStr << " maxScaleStr = " << maxScaleStr << " planItem.m_minScale = " << planItem.m_minScale @@ -363,7 +363,7 @@ bool InterfaceImpl::loadPlan(int planFileId, bool InterfaceImpl::unloadAllPlans() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; const QMap &planStore = m_internal->m_overlayModel->planStore(); @@ -372,12 +372,12 @@ bool InterfaceImpl::unloadAllPlans() { mapIt.next(); unsigned int planId = mapIt.key(); - DEBUG_LOG() << Q_FUNC_INFO << " removeOverlay, planId=" << planId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " removeOverlay, planId=" << planId; m_internal->m_overlayModel->removeOverlay(planId); } - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -387,7 +387,7 @@ void InterfaceImpl::onUpdatePlan(int planId) PlanOverlaysPlugin::PlanOverlayModel::PlanItem planItem = m_internal->m_overlayModel->planItemValue(planId); if (!planItem.isValid()) { - ERROR_LOG() << "plan item with id " << planId << " not found in model"; + ERROR_LOG(m_logger) << "plan item with id " << planId << " not found in model"; return; } @@ -405,7 +405,7 @@ void InterfaceImpl::onUpdatePlan(int planId) if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(planFileId, planItem.m_fileName, planXMLContent)) { - ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << planItem.m_fileName << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << planItem.m_fileName << "]"; return false; } @@ -423,7 +423,7 @@ void InterfaceImpl::onUpdatePlan(int planId) if (!ok) { - ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << planItem.m_fileName << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << planItem.m_fileName << "]"; LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), tr("Reading plan '%1' from database failed").arg(planItem.m_fileName), m_internal->m_messageBoxTitle); } } @@ -498,7 +498,7 @@ QWidget *InterfaceImpl::openPlanOverlayDialog(const QJsonArray &planItems, bool { if (!planItemValue.isObject()) { - WARNING_LOG() << "planItem from json array is not an object! " << planItemValue.type(); + WARNING_LOG(m_logger) << "planItem from json array is not an object! " << planItemValue.type(); continue; } @@ -506,7 +506,7 @@ QWidget *InterfaceImpl::openPlanOverlayDialog(const QJsonArray &planItems, bool int planFileId = planItemObj[QStringLiteral("fileId")].toInt(-1); if (!loadPlan(planFileId, planItemObj)) - ERROR_LOG() << "could not load plan with file id " << planFileId; + ERROR_LOG(m_logger) << "could not load plan with file id " << planFileId; } @@ -562,7 +562,7 @@ void InterfaceImpl::onReloadPlanById(int planId) const QByteArray &planXMLContent = LtsUtils::toQByteArray(reply.content()); if (planXMLContent.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty"; return false; } @@ -570,7 +570,7 @@ void InterfaceImpl::onReloadPlanById(int planId) if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(planItem.m_fileId, planItem.m_fileName, planXMLContent)) { - ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]"; return false; } @@ -595,7 +595,7 @@ void InterfaceImpl::onReloadPlanById(int planId) if (!ok) { - ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]"; const QString & msg = tr("Reading plan '%1' from database failed").arg(nameOfPlan); LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), msg, m_internal->m_messageBoxTitle); return; @@ -617,14 +617,14 @@ bool InterfaceImpl::removePlan(int planId, SituationMap::ForeignGuiInterface* ov if (overrideSitMapIfc == nullptr) { - ERROR_LOG() << "no sit map ifc to remove a plan from for planId " << planId; + ERROR_LOG(m_logger) << "no sit map ifc to remove a plan from for planId " << planId; return false; } const PlanOverlaysPlugin::PlanOverlayModel::PlanItem & planItem = m_internal->m_overlayModel->planItem(planId); if (!planItem.isValid()) { - ERROR_LOG() << "plan item invalid for planId " << planId; + ERROR_LOG(m_logger) << "plan item invalid for planId " << planId; return false; } @@ -708,7 +708,7 @@ void InterfaceImpl::onExerciseChanged(const ExerciseManagement::Exercise &data, { case DataModification::eModified: { - DEBUG_LOG() << "onExerciseChanged - Modified"; + DEBUG_LOG(m_logger) << "onExerciseChanged - Modified"; m_internal->m_overlayModel->reInitModel(data.id(), data.activePhaseId()); break; } @@ -727,12 +727,12 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode { int planFileId = m_internal->m_dtc->getFileId(FileManagement::FileType::TacticalPlan, planItem.m_fileName, exerciseId, phaseId); - DEBUG_LOG() << "Plan File Id = " << planFileId; + DEBUG_LOG(m_logger) << "Plan File Id = " << planFileId; if (planFileId < 1) { if (removeFromModel) *removeFromModel = true; - INFO_LOG() << "Plan overlay will be removed: name = " << planItem.m_fileName; + INFO_LOG(m_logger) << "Plan overlay will be removed: name = " << planItem.m_fileName; return; } @@ -747,7 +747,7 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode const QByteArray &planXMLContent = LtsUtils::toQByteArray(reply.content()); if (planXMLContent.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error plan [" << nameOfPlan << "] is empty"; return false; } else @@ -757,13 +757,13 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode if (!m_internal->m_foreignSitmapIfc->planOverlayRemove(pi.m_fileId)) { - ERROR_LOG() << Q_FUNC_INFO << "Error removing plan overlay from map failed [" << nameOfPlan << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error removing plan overlay from map failed [" << nameOfPlan << "]"; } if (!m_internal->m_foreignSitmapIfc->planOverlaySetContent(fileContent.id(), nameOfPlan, planXMLContent)) { - ERROR_LOG() << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error rendering planContent [" << nameOfPlan << "]"; return false; } @@ -797,7 +797,7 @@ void InterfaceImpl::onReloadPlanByName(const PlanOverlaysPlugin::PlanOverlayMode if (!ok) { - ERROR_LOG() << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Error reading planContent [" << nameOfPlan << "]"; const QString & msg = tr("Reading plan '%1' from database failed").arg(nameOfPlan); LtsWidgets::LtsMessageDialog::showMessage(m_session->baseLayout(), msg, m_internal->m_messageBoxTitle); } @@ -809,7 +809,7 @@ TopicEditorBase::TopicEditor *InterfaceImpl::createTopicEditor(const TopicEditor { std::shared_ptr flmDtc; if (!m_session->getDtc(flmDtc)) - WARNING_LOG() << "flm dtc missing - plan topic compatibility mode file name resolution not available"; + WARNING_LOG(m_logger) << "flm dtc missing - plan topic compatibility mode file name resolution not available"; PlanTopicEditor *editor = new PlanTopicEditor(&m_foreignIfc, flmDtc); editor->setTopicData(data); @@ -839,7 +839,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib { if (!m_foreignSitmapIfc) { - ERROR_LOG() << Q_FUNC_INFO << "No foreign sitMapIfc, use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface. Can't load tactical plan for playback ..."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "No foreign sitMapIfc, use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface. Can't load tactical plan for playback ..."; return false; } @@ -849,8 +849,8 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib if (planFileId != -1) { - WARNING_LOG() << "Plan Overlays topic in compatibility mode!"; - DEBUG_LOG() << "Loading plan id = " << planFileId; + WARNING_LOG(m_logger) << "Plan Overlays topic in compatibility mode!"; + DEBUG_LOG(m_logger) << "Loading plan id = " << planFileId; if (!m_ovr->loadPlan(planFileId, false, m_foreignSitmapIfc)) return false; @@ -866,7 +866,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib { if (!planItemValue.isObject()) { - ERROR_LOG() << "PlanItem from json array is not an object! " << planItemValue.type(); + ERROR_LOG(m_logger) << "PlanItem from json array is not an object! " << planItemValue.type(); continue; } @@ -875,7 +875,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib if (!m_ovr->loadPlan(planFileId, planItemObj)) { - ERROR_LOG() << "could not load plan with file id " << planFileId; + ERROR_LOG(m_logger) << "could not load plan with file id " << planFileId; continue; } @@ -891,16 +891,16 @@ bool InterfaceImpl::TopicReplayInterface::playbackStop() { if (nullptr == m_foreignSitmapIfc) { - ERROR_LOG() << Q_FUNC_INFO << "Use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface ..."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Use PlanOverlaysPlugin::ForeignGuiInterface::setForeignSitMapGuiIfc() to define SituationMapGuiPlugin interface ..."; return false; } while (!m_loadedPlanFileIds.isEmpty()) { int planFileId = m_loadedPlanFileIds.takeFirst(); - DEBUG_LOG() << " removePlan with file id " << planFileId; + DEBUG_LOG(m_logger) << " removePlan with file id " << planFileId; if (!m_ovr->removePlan(planFileId, m_foreignSitmapIfc)) - ERROR_LOG() << "could not unload plan with file id " << planFileId; + ERROR_LOG(m_logger) << "could not unload plan with file id " << planFileId; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.h index f3ab0d548..cffafc122 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PlanOverlays/Gui/plan_overlays_gui_plugin.h @@ -111,6 +111,9 @@ public: private: + + +NGL::INGLLogger &m_logger; void onReloadPlanById(int planId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.cpp index 305c97383..78f628b76 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.cpp @@ -21,7 +21,7 @@ PresentationEditDialog::PresentationEditDialog(QWidget *parent) , m_presentationId(-1) , m_ui(new Ui::PresentationEditDialog) { - DEBUG_LOG() << "PresentationEditDialog ctor"; + DEBUG_LOG(m_logger) << "PresentationEditDialog ctor"; m_ui->setupUi(this); @@ -51,7 +51,7 @@ bool PresentationEditDialog::init(int presentationId, const std::shared_ptr &ftc, const std::shared_ptr &opmDtc) { - DEBUG_LOG() << "PresentationEditDialog::init"; + DEBUG_LOG(m_logger) << "PresentationEditDialog::init"; m_presentationId = presentationId; m_dtc = dtc; m_ftc = ftc; @@ -140,7 +140,7 @@ bool PresentationEditDialog::apply() } } - DEBUG_LOG() << "Content size = " << m_content.size() << " for presentationId: " << m_presentationId; + DEBUG_LOG(m_logger) << "Content size = " << m_content.size() << " for presentationId: " << m_presentationId; req.content(m_content); m_presentationId = m_ftc->presentationModifyRequest(req); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.h index 19acc558c..e33d06909 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_edit_dialog.h @@ -46,6 +46,8 @@ private slots: void onReturnPressed(); private: + +NGL::INGLLogger &m_logger; bool apply(); std::shared_ptr m_dtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_mobile_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_mobile_model.h index 71454983f..ef38f93f5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_mobile_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_mobile_model.h @@ -28,6 +28,7 @@ public: Q_SIGNALS: void checkboxClicked(); protected: +NGL::INGLLogger &m_logger; void switchCheckbox(const QModelIndex &index); private: friend class PreMobileDialogProxyModel; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.cpp index 953cf965e..af159a87b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.cpp @@ -46,7 +46,7 @@ bool PresentationManagementDialogModel::initModel(const std::shared_ptr(it.value().id()), QString::fromStdString(it.value().name())); } - INFO_LOG() << "initModel - #presentations: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #presentations: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.h index 0a1e5c535..82f66ef54 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Common/pre_model.h @@ -41,6 +41,8 @@ public: QVariant data(const QModelIndex &, int) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const Presentation &data, DataModification modType) const override { if (!m_predicate(data)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.cpp index 5a56f3939..4fabcc440 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.cpp @@ -22,7 +22,7 @@ PresentationManagementDialog::PresentationManagementDialog(QWidget *parent) , m_ftc(nullptr) , m_requestHelper(new LtsUtils::RequestHelper(this)) { - DEBUG_LOG() << "PresentationManagementDialog ctor"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog ctor"; m_ui->setupUi(this); } @@ -84,7 +84,7 @@ void PresentationManagementDialog::enaDisa() void PresentationManagementDialog::slotAdd() { - DEBUG_LOG() << "PresentationManagementDialog::slotAdd"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotAdd"; PresentationEditDialog *dialog = new PresentationEditDialog(this); if (!dialog->init(-1 , m_dtc, m_ftc, m_opmDtc)) { @@ -101,7 +101,7 @@ void PresentationManagementDialog::slotAdd() void PresentationManagementDialog::slotEdit() { - DEBUG_LOG() << "PresentationManagementDialog::slotEdit"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotEdit"; PresentationEditDialog *dialog = new PresentationEditDialog(this); @@ -126,13 +126,13 @@ void PresentationManagementDialog::slotEdit() void PresentationManagementDialog::slotRemove() { - DEBUG_LOG() << "PresentationManagementDialog::slotRemove"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotRemove"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; Core::RemoveElementRequest req(m_model->getRowData(selIndex.row()).id()); - DEBUG_LOG() << "Removing presentation id = " << req.id(); + DEBUG_LOG(m_logger) << "Removing presentation id = " << req.id(); m_requestHelper->startSingleRequest([req, this]() { @@ -140,18 +140,18 @@ void PresentationManagementDialog::slotRemove() }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove presentation"; + ERROR_LOG(m_logger) << "Failed to remove presentation"; } void PresentationManagementDialog::slotDelete() { - DEBUG_LOG() << "PresentationManagementDialog::slotDelete"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotDelete"; changeStatus(FileStatus::Deleted); } void PresentationManagementDialog::slotRestore() { - DEBUG_LOG() << "PresentationManagementDialog::slotRestore"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::slotRestore"; changeStatus(FileStatus::Valid); } @@ -172,14 +172,14 @@ void PresentationManagementDialog::changeStatus(const FileStatus &fs) req.fileStatus(fs); req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); req.lastModified(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "Changing status for presentation id = " << pre.id(); + DEBUG_LOG(m_logger) << "Changing status for presentation id = " << pre.id(); m_requestHelper->startSingleRequest([this, req]() { return m_ftc->presentationChangeStatusRequest(PresentationChangeStatusRequest(req), this); }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to change status for presentation"; + ERROR_LOG(m_logger) << "Failed to change status for presentation"; } @@ -195,7 +195,7 @@ bool PresentationManagementDialog::init(const ScriptsDialogMode &dlgMode, const std::shared_ptr &opmDtc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "PresentationManagementDialog::init"; + DEBUG_LOG(m_logger) << "PresentationManagementDialog::init"; m_modeDialog = dlgMode; m_dtc = dtc; m_ftc = ftc; @@ -221,12 +221,12 @@ bool PresentationManagementDialog::init(const ScriptsDialogMode &dlgMode, const QMap presentations = dtc->presentations(); for (const auto &p : presentations) - DEBUG_LOG() << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); + DEBUG_LOG(m_logger) << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &PresentationManagementDialog::enaDisa, Qt::UniqueConnection); m_loadedScriptId = m_session->getSavegame()[QStringLiteral("ScriptId")].toInt(); - ERROR_LOG() << "Loaded script id = " << m_loadedScriptId; + ERROR_LOG(m_logger) << "Loaded script id = " << m_loadedScriptId; if (m_modeDialog != ScriptsDialogMode::modeView) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.h index 2100399e2..b19777b88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_dialog.h @@ -45,6 +45,8 @@ public: LtsSession::LtsSession *session); protected: + +NGL::INGLLogger &m_logger; void onPresentationRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onPresentationChangeStatusReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.cpp index 21205f70c..8843de45f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.cpp @@ -38,7 +38,7 @@ PreMobileDialog::PreMobileDialog(QWidget *parent) , m_avScriptsCount(0) , m_avScriptsActualDone(0) { - DEBUG_LOG() << "PreMobileDialog ctor"; + DEBUG_LOG(m_logger) << "PreMobileDialog ctor"; connect(&m_copyExercise, &DBAdministration::CopyExercise::copyDbFailed, this, &PreMobileDialog::onCopyDbFailed); connect(&m_copyExercise, &DBAdministration::CopyExercise::copyDbFinished, this, &PreMobileDialog::onCopyDbFinished); @@ -49,7 +49,7 @@ PreMobileDialog::PreMobileDialog(QWidget *parent) m_progressBar = new QProgressBar(); m_label = new QLabel(); connect(m_label, &QLabel::destroyed, this, [this]() - {ERROR_LOG() << "Label destroyed";}); + {ERROR_LOG(m_logger) << "Label destroyed";}); m_widgetProgressBar->layout()->addWidget(m_label); m_widgetProgressBar->layout()->addWidget(m_progressBar); m_progressBar->setMinimum(0); @@ -116,7 +116,7 @@ void PreMobileDialog::slotDownload() connect(&m_copyExercise, &DBAdministration::CopyExercise::nextProgress, this, &PreMobileDialog::onProgressBar); if (!m_copyExercise.doCopy(exerciseId)) - ERROR_LOG() << "Failed to copy database from " << DBAdministration::Settings::serverDatabaseHost() << " to " << hostname; + ERROR_LOG(m_logger) << "Failed to copy database from " << DBAdministration::Settings::serverDatabaseHost() << " to " << hostname; @@ -159,7 +159,7 @@ bool PreMobileDialog::init(const std::shared_ptr &dtc, const std::shared_ptr &avmDataIfc, LtsSession::LtsSession *session) { - DEBUG_LOG() << "PreMobileDialog::init"; + DEBUG_LOG(m_logger) << "PreMobileDialog::init"; m_session = session; m_avmDataIfc = avmDataIfc; m_dtc = dtc; @@ -186,7 +186,7 @@ bool PreMobileDialog::init(const std::shared_ptr &dtc, const QMap presentations = dtc->presentations(); for (const auto &p : presentations) - DEBUG_LOG() << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); + DEBUG_LOG(m_logger) << "Presentation: id = " << p.id() << ", name = " << p.name().c_str() << ", desc = " << p.description().c_str(); connect(m_ui->widget, &LtsDataView::LtsDataView::signalSelectionChanged, this, &PreMobileDialog::enaDisa, Qt::UniqueConnection); @@ -246,7 +246,7 @@ void PreMobileDialog::handlePresentationContent(const GetPresentationContentRepl if (contentList.empty()) { - WARNING_LOG() << "No content for Script Id = " << reply.id(); + WARNING_LOG(m_logger) << "No content for Script Id = " << reply.id(); return; } @@ -268,28 +268,28 @@ void PreMobileDialog::handlePresentationContent(const GetPresentationContentRepl bool PreMobileDialog::downloadAVScripts() { - INFO_LOG() << "IN downloadAVScripts"; + INFO_LOG(m_logger) << "IN downloadAVScripts"; int nextProgress = 76; m_progressBar->setValue(nextProgress); if (!m_avmDataIfc->hasAvsSession()) { - ERROR_LOG() << "avm hasAvsSession failed"; + ERROR_LOG(m_logger) << "avm hasAvsSession failed"; m_copyExercise.stopPing(); return false; } - INFO_LOG() << "hasAVsSession ok"; + INFO_LOG(m_logger) << "hasAVsSession ok"; AudioVideoManagement::AvaSession *avaSession = m_avmDataIfc->avaSession(); if (!avaSession->isEstablished()) { - ERROR_LOG() << "avaSession not established, abort"; + ERROR_LOG(m_logger) << "avaSession not established, abort"; m_copyExercise.stopPing(); return false; } - INFO_LOG() << "avaSession established"; + INFO_LOG(m_logger) << "avaSession established"; m_avaControl = avaSession->control(); @@ -323,14 +323,14 @@ void PreMobileDialog::slotScriptSet(const AudioVideoManagement::AvaStreamInfo &s { if (streamState == AudioVideoManagement::AvaStreamState::NotPossible) { - ERROR_LOG() << "Script " << m_lastScriptName << " not correctly downloaded"; + ERROR_LOG(m_logger) << "Script " << m_lastScriptName << " not correctly downloaded"; slotScriptDownloaded(streamState); return; } - DEBUG_LOG() << "ScriptName: " << m_lastScriptName; - DEBUG_LOG() << "streamInfo: start" << streamInfo.duration.count(); - DEBUG_LOG() << "streamState: " << static_cast(streamState); + DEBUG_LOG(m_logger) << "ScriptName: " << m_lastScriptName; + DEBUG_LOG(m_logger) << "streamInfo: start" << streamInfo.duration.count(); + DEBUG_LOG(m_logger) << "streamState: " << static_cast(streamState); m_avaControl->startScript(QStringLiteral("LOCAL_RECORD"), m_lastScriptName, LtsUtils::createConnection(m_avaControl, &AudioVideoManagement::AvaControl::startScriptResponse, @@ -339,7 +339,7 @@ void PreMobileDialog::slotScriptSet(const AudioVideoManagement::AvaStreamInfo &s void PreMobileDialog::slotScriptDownloaded(AudioVideoManagement::AvaStreamState streamState) { - DEBUG_LOG() << "streamState: " << static_cast(streamState); + DEBUG_LOG(m_logger) << "streamState: " << static_cast(streamState); m_avScriptsActualDone += 1; QString labelText = tr("Downloaded Audio Video Data: ") + QString::number(m_avScriptsActualDone) + QStringLiteral(" / ") + QString::number(m_avScriptsCount); @@ -349,7 +349,7 @@ void PreMobileDialog::slotScriptDownloaded(AudioVideoManagement::AvaStreamState if (streamState == AudioVideoManagement::AvaStreamState::NotPossible) { - ERROR_LOG() << "Script " << m_lastScriptName << " not correctly downloaded"; + ERROR_LOG(m_logger) << "Script " << m_lastScriptName << " not correctly downloaded"; QString msg = tr("Could not download data - Audio/Video download - Script %1 failed").arg(m_lastScriptName); auto x = new LtsWidgets::LtsMessageDialogNew(this, msg); connect(x, &LtsWidgets::LtsMessageDialogNew::ok, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.h index 73518e786..5550483b9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/PresentationEdit/pre_mobile_dialog.h @@ -57,6 +57,7 @@ private slots: void slotScriptDownloadedStep2(); void onProgressBar(int nextProgress); private: + NGL::INGLLogger &m_logger; void retranslate() override; void changeStatus(const FileStatus &fs); bool downloadAVScripts(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.cpp index f3a31a235..5bf899140 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.cpp @@ -57,7 +57,7 @@ ScriptChooser::ScriptChooser(const std::shared_ptr &dtc, PresentationManagementDialogModel::Columns::Operator, QVariant(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) ); if (!bSetOperator) - WARNING_LOG() << "could not set initial operator id to " << operatorId; + WARNING_LOG(m_logger) << "could not set initial operator id to " << operatorId; connect(m_ui->ltsDataView, &LtsDataView::LtsDataView::signalSelectionChanged, this, &ScriptChooser::onEnaDisa, Qt::QueuedConnection); @@ -186,7 +186,7 @@ void ScriptChooser::onDeleteScript() req.fileStatus(fs); req.operatorId(LtsSessionData::LtsSessionData::getInstance()->getOperatorId()); req.lastModified(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "Changing status for presentation id = " << pre.id(); + DEBUG_LOG(m_logger) << "Changing status for presentation id = " << pre.id(); m_requestHelper->startSingleRequest([this, req]() { @@ -197,7 +197,7 @@ void ScriptChooser::onDeleteScript() m_ui->ltsDataView->proxyModel()->removeRow(srcIdx.row()); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to change status for presentation-script_chooser"; + ERROR_LOG(m_logger) << "Failed to change status for presentation-script_chooser"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.h index 0ed04846f..f264c378f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/ScriptChooser/script_chooser.h @@ -38,6 +38,7 @@ public: ~ScriptChooser(); protected: + NGL::INGLLogger &m_logger; void closeEvent(QCloseEvent *event) override; void onPresentationRemoveReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onPresentationChangeStatusReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.cpp index 6147b60af..720495121 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.cpp @@ -41,17 +41,17 @@ bool DbReader::loadPlugin(const LtsPluginManager::PluginInstance &pi) RecordReplay::RecordReplayPlugin *recPlugin = qobject_cast(pi.plugin); if (!recPlugin) { - ERROR_LOG() << "Cannot load RecordReplayPlugin " << pi.fileName; + ERROR_LOG(m_logger) << "Cannot load RecordReplayPlugin " << pi.fileName; return false; } if (!recPlugin->initCopy(m_exerciseId, m_bSupportsSchemasFrom, m_bSupportsSchemasTo)) { - ERROR_LOG() << "Initialisation for RecordReplayPlugin " << pi.fileName << " failed "; + ERROR_LOG(m_logger) << "Initialisation for RecordReplayPlugin " << pi.fileName << " failed "; return false; } - INFO_LOG() << "Loaded record replay plugin " << recPlugin->pluginName(); + INFO_LOG(m_logger) << "Loaded record replay plugin " << recPlugin->pluginName(); m_plugins += recPlugin; return true; @@ -89,7 +89,7 @@ bool DbReader::createTables() if (record.isEmpty()) { - ERROR_LOG() << "Empty record for " << fqTableName; + ERROR_LOG(m_logger) << "Empty record for " << fqTableName; return false; } @@ -102,7 +102,7 @@ bool DbReader::createTables() bool DbReader::copyData(qint64 fromTime, qint64 toTime) { - INFO_LOG() << "IN readData"; + INFO_LOG(m_logger) << "IN readData"; if (!m_queryFrom || !m_queryTo) return false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.h index 8be325c4c..e4165a190 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/db_reader.h @@ -30,8 +30,10 @@ public: static bool createTable(NSqlQuery &q, const QString &tableName, const QSqlRecord &record, const QSqlIndex &pk, NGL::INGLLogger &logger); private: + NGL::INGLLogger &m_logger; bool loadPlugin(const LtsPluginManager::PluginInstance &pi); private: + NGL::INGLLogger &m_logger; int m_exerciseId; QSqlDatabase m_dbFrom; QSqlDatabase m_dbTo; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.cpp index 6145b5370..049178476 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.cpp @@ -61,12 +61,12 @@ void DVDWriter::incomingDataAvailable() while (m_dvdBurnProcess && m_dvdBurnProcess->canReadLine()) { const QByteArray qB = m_dvdBurnProcess->readLine().trimmed(); - INFO_LOG() << "qb = " << qB.data() + INFO_LOG(m_logger) << "qb = " << qB.data() << " m_packageDir=" << m_packageDir; if (qB.contains(":-[")) { - ERROR_LOG() << "growisofs error: '" << qB << "'"; + ERROR_LOG(m_logger) << "growisofs error: '" << qB << "'"; cleanupProcess(); QString errString = QString::fromUtf8(qB.mid(3)); @@ -108,7 +108,7 @@ void DVDWriter::incomingDataAvailable() m_pProgressDlg->setValue(100); else if (qB.contains("media is not recognized")) { - ERROR_LOG() << "growisofs error: '" << qB << "'"; + ERROR_LOG(m_logger) << "growisofs error: '" << qB << "'"; cleanupProcess(); if (LtsWidgets::LtsMessageDialog::showMessage(qobject_cast(parent()), tr("No DVD in drive. Try again?"), @@ -122,7 +122,7 @@ void DVDWriter::incomingDataAvailable() } else if (qB.contains(":-( unable to open")) { - ERROR_LOG() << "growisofs error: '" << qB << "'"; + ERROR_LOG(m_logger) << "growisofs error: '" << qB << "'"; cleanupProcess(); if (LtsWidgets::LtsMessageDialog::showMessage(qobject_cast(parent()), tr("Unable to open DVD device. Try again?"), @@ -136,7 +136,7 @@ void DVDWriter::incomingDataAvailable() } else if (qB.contains(":-(")) { - ERROR_LOG() << "growisofs error: '" << qB << "'"; + ERROR_LOG(m_logger) << "growisofs error: '" << qB << "'"; cleanupProcess(); QString strError(tr("Unable to open DVD device")); @@ -159,12 +159,12 @@ void DVDWriter::incomingDataAvailable() void DVDWriter::dvdFinished(int exitCode, QProcess::ExitStatus exitStatus) { - INFO_LOG() << "growisofs ends with extitCode : '" << exitCode << " and ExitStatus '" << exitStatus; + INFO_LOG(m_logger) << "growisofs ends with extitCode : '" << exitCode << " and ExitStatus '" << exitStatus; if (!m_dvdBurnProcess) { - WARNING_LOG() << "dvdFinished with error code: " << exitCode << ", status: " << exitStatus + WARNING_LOG(m_logger) << "dvdFinished with error code: " << exitCode << ", status: " << exitStatus << " process is already cleaned up"; return; } @@ -180,7 +180,7 @@ void DVDWriter::dvdFinished(int exitCode, QProcess::ExitStatus exitStatus) } else { - ERROR_LOG() << "dvdFinished with error code: " << exitCode << ", status: " << exitStatus; + ERROR_LOG(m_logger) << "dvdFinished with error code: " << exitCode << ", status: " << exitStatus; LtsWidgets::LtsMessageDialog::showMessage(qobject_cast(parent()), tr("Burning aborted with an unkown error %1").arg(exitCode)); cleanup(false); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.h index e5c2443ce..e86d791a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/dvd_writer.h @@ -33,6 +33,8 @@ private slots: void dvdFinished(int exitCode, QProcess::ExitStatus exitStatus); private: + +NGL::INGLLogger &m_logger; void cleanup(bool success); void cleanupProcess(); bool checkBuringCapabilities(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.cpp index 69abae3a7..aa8c4b0f3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.cpp @@ -112,7 +112,7 @@ void ExportProcess::slotStartExport() auto it = m_trackEntryAssignments.constFind(QString::fromStdString(content.presentationTopicType())); if (it == m_trackEntryAssignments.constEnd()) { - ERROR_LOG() << "Invalid content for type (" << content.presentationTopicType() << "): " << QString::fromStdString(content.presentationTopicType()); + ERROR_LOG(m_logger) << "Invalid content for type (" << content.presentationTopicType() << "): " << QString::fromStdString(content.presentationTopicType()); continue; } @@ -147,7 +147,7 @@ void ExportProcess::slotStartExport() if (it == m_trackEntryAssignments.constEnd()) { - ERROR_LOG() << "Invalid content for presentation type " << content.presentationTopicType(); + ERROR_LOG(m_logger) << "Invalid content for presentation type " << content.presentationTopicType(); continue; } @@ -256,7 +256,7 @@ QVector ExportProcess::checkAdditionalExportEntries( addData.id = parentData.id; auto topicExportIfc = topicIfcFromType(addData.topicType, ExportOrReplay::Export); - DEBUG_LOG() << "addEntry type: " << addData.topicType << ", ifc: " << topicExportIfc; + DEBUG_LOG(m_logger) << "addEntry type: " << addData.topicType << ", ifc: " << topicExportIfc; if (!topicExportIfc) continue; @@ -264,7 +264,7 @@ QVector ExportProcess::checkAdditionalExportEntries( ret += createExportStep(realParentId, addData, topicExportIfc, allSitReplayTimes); m_cntTopicsToExport++; } - DEBUG_LOG() << "topic count: " << m_cntTopicsToExport; + DEBUG_LOG(m_logger) << "topic count: " << m_cntTopicsToExport; return ret; } @@ -285,7 +285,7 @@ ExportStep *ExportProcess::createExportStep( connect(pExportStep, &TakeHomePackageGenerator::ExportStep::signalExportFailed, this, &ExportProcess::slotRunExportStep, Qt::QueuedConnection); - DEBUG_LOG() << "Adding filter step " << data.topicType; + DEBUG_LOG(m_logger) << "Adding filter step " << data.topicType; return pExportStep; } @@ -294,7 +294,7 @@ TopicReplay::Interface *ExportProcess::topicIfcFromType(TopicEditorBase::TopicTy auto it = m_trackEntryAssignments.constFind(TopicEditorBase::topicTypeString(type)); if (it == m_trackEntryAssignments.constEnd()) { - WARNING_LOG() << "Invalid content for presentation type " << type; + WARNING_LOG(m_logger) << "Invalid content for presentation type " << type; return nullptr; } @@ -302,7 +302,7 @@ TopicReplay::Interface *ExportProcess::topicIfcFromType(TopicEditorBase::TopicTy TopicReplay::Interface *topicIfc = exportOrReplay == ExportOrReplay::Export ? ta.topicExportFactory->createInterface(ta.topicType) : ta.topicReplayFactory->createInterface(ta.topicType); if (!topicIfc) - WARNING_LOG() << "Could not find replay interface for " << type; + WARNING_LOG(m_logger) << "Could not find replay interface for " << type; return topicIfc; } @@ -319,13 +319,13 @@ void ExportProcess::slotRunExportStep() { if (m_logger.isDebugEnabled()) { - DEBUG_LOG() << "ExportProcess::slotRunExportStep() CALLED, m_vecExportSteps.size(): " << m_vecExportSteps.size() + DEBUG_LOG(m_logger) << "ExportProcess::slotRunExportStep() CALLED, m_vecExportSteps.size(): " << m_vecExportSteps.size() << ", m_vecExportStepsExecuted.size(): " << m_vecExportStepsExecuted.size(); for (const auto &s : std::as_const(m_vecExportSteps)) - DEBUG_LOG() << "m_vecExportSteps: " << s << " compare: " << (s == sender()); + DEBUG_LOG(m_logger) << "m_vecExportSteps: " << s << " compare: " << (s == sender()); for (const auto &s : std::as_const(m_vecExportStepsExecuted)) - DEBUG_LOG() << "m_vecExportStepsExecuted: " << s << " compare: " << (s == sender()); + DEBUG_LOG(m_logger) << "m_vecExportStepsExecuted: " << s << " compare: " << (s == sender()); } if (m_pProgressDlg->wasCanceled()) @@ -346,7 +346,7 @@ void ExportProcess::slotRunExportStep() .arg(TopicEditorBase::topicTypeString(pExportStep->m_topicData.topicType)) .arg(m_vecExportStepsExecuted.size()) .arg(m_cntTopicsToExport)); - DEBUG_LOG() << strExportLabel; + DEBUG_LOG(m_logger) << strExportLabel; m_pProgressDlg->setLabelText(strExportLabel); QString strExportPath(contentPath() + QString::number(pExportStep->topicId()) + QLatin1Char('/')); @@ -438,11 +438,11 @@ void ExportProcess::createDataJson(const std::shared_ptrexerciseId()) + QStringLiteral("data.json")); - INFO_LOG() << "ExportProcess::createDataJson " << exportPath(m_pSession->exerciseId()) + QStringLiteral("data.json"); + INFO_LOG(m_logger) << "ExportProcess::createDataJson " << exportPath(m_pSession->exerciseId()) + QStringLiteral("data.json"); if (!file.open(QFile::ReadWrite)) return; @@ -507,7 +507,7 @@ void ExportProcess::createDataJson(const std::shared_ptrexportFailed()) { - WARNING_LOG() << "Export failed for " << s->topicId(); + WARNING_LOG(m_logger) << "Export failed for " << s->topicId(); continue; } @@ -620,9 +620,9 @@ void ExportProcess::copyStaticContent() const QString exportPathStr = exportPath(m_pSession->exerciseId()); exportPathStr.truncate(exportPathStr.size() - 1); if (!NGL::copyDirContentsToDir(QStringLiteral("thp"), exportPathStr, true)) - WARNING_LOG() << "Could not find thp static content directory exportPath=" << exportPathStr; + WARNING_LOG(m_logger) << "Could not find thp static content directory exportPath=" << exportPathStr; if (!NGL::copyDirContentsToDir(QStringLiteral("thp_standalone"), exportPathStr + QDir::separator() + QString::number(m_scriptId), true)) - WARNING_LOG() << "Could not find thp_standalone static content directory exportPath=" << exportPathStr + QDir::separator() + QString::number(m_scriptId); + WARNING_LOG(m_logger) << "Could not find thp_standalone static content directory exportPath=" << exportPathStr + QDir::separator() + QString::number(m_scriptId); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.h index 426966418..466a3db26 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/export_process.h @@ -70,6 +70,7 @@ private slots: void slotRunExportStep(); private: + NGL::INGLLogger &m_logger; QVector parseFilterSteps( int parentTopicId, QJsonObject &detailData, const QVector &allSitReplayTimes ); @@ -101,6 +102,7 @@ private: void copyStaticContent() const; private: + NGL::INGLLogger &m_logger; QVector m_vecExportSteps; QVector m_vecExportStepsExecuted; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.cpp index 7c2b5dc0b..2dac37d29 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.cpp @@ -41,7 +41,7 @@ SituationExporter::~SituationExporter() bool SituationExporter::exportStaticData(const QString &strPathToFile) { - DEBUG_LOG() << "Exporting static data to " << strPathToFile; + DEBUG_LOG(m_logger) << "Exporting static data to " << strPathToFile; m_dbIn.close(); m_dbOut.close(); @@ -106,7 +106,7 @@ bool SituationExporter::exportStaticData(const QString &strPathToFile) { if (!copyTable(t, false)) { - ERROR_LOG() << "Copying table " << t.schema << "." << t.table << " failed... "; + ERROR_LOG(m_logger) << "Copying table " << t.schema << "." << t.table << " failed... "; return false; } } @@ -123,7 +123,7 @@ bool SituationExporter::exportStaticData(const QString &strPathToFile) { if (!copyTable(t, true)) { - ERROR_LOG() << "Copying table " << t.schema << "." << t.table << " failed... "; + ERROR_LOG(m_logger) << "Copying table " << t.schema << "." << t.table << " failed... "; return false; } } @@ -160,11 +160,11 @@ bool SituationExporter::copyTable(const StaticTableToCopy &t, bool bOnlyCreateSc const QString fqTableName(t.schema.isEmpty() ? t.table : (t.schema + QLatin1Char('.') + t.table)); - DEBUG_LOG() << "Copying " << fqTableName << " started"; + DEBUG_LOG(m_logger) << "Copying " << fqTableName << " started"; const QSqlRecord record = m_dbIn.record(fqTableName); if (record.isEmpty()) { - ERROR_LOG() << "Empty record for " << fqTableName; + ERROR_LOG(m_logger) << "Empty record for " << fqTableName; return false; } QStringList selectTableColumns; @@ -197,17 +197,17 @@ bool SituationExporter::copyTable(const StaticTableToCopy &t, bool bOnlyCreateSc selectTableColumns.join(QStringLiteral(", ")), insertTablePlaceholder.join(QStringLiteral(", ")))); - DEBUG_LOG() << selectTableCommand; - DEBUG_LOG() << insertTableCommand; + DEBUG_LOG(m_logger) << selectTableCommand; + DEBUG_LOG(m_logger) << insertTableCommand; if (!qOut.prepare(insertTableCommand)) { - ERROR_LOG() << "qOut prepare failed... " << qOut.lastError().text(); + ERROR_LOG(m_logger) << "qOut prepare failed... " << qOut.lastError().text(); return false; } if (!qIn.exec(selectTableCommand)) { - ERROR_LOG() << "qIn select failed... " << qIn.lastError().text(); + ERROR_LOG(m_logger) << "qIn select failed... " << qIn.lastError().text(); return false; } while (qIn.next()) @@ -216,11 +216,11 @@ bool SituationExporter::copyTable(const StaticTableToCopy &t, bool bOnlyCreateSc qOut.bindValue(insertTablePlaceholder.at(i), qIn.value(i)); if (!qOut.exec()) { - ERROR_LOG() << "qOut insert failed.. " << qOut.lastError().text(); + ERROR_LOG(m_logger) << "qOut insert failed.. " << qOut.lastError().text(); return false; } } - DEBUG_LOG() << "Copying " << fqTableName << " finished"; + DEBUG_LOG(m_logger) << "Copying " << fqTableName << " finished"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.h index b11c80c3e..9dfeda17b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/Common/TakeHomePackageGenerator/situation_exporter.h @@ -18,6 +18,7 @@ public: bool exportDynamicData(qint64 fromTime, qint64 toTime); private: + NGL::INGLLogger &m_logger; struct StaticTableToCopy { QString schema; @@ -27,6 +28,7 @@ private: bool copyTable(const StaticTableToCopy &t, bool bOnlyCreateSchema); private: + NGL::INGLLogger &m_logger; int m_exerciseId; QSqlDatabase m_dbIn; QSqlDatabase m_dbOut; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.cpp index c30e8a55b..5b269d9c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.cpp @@ -309,7 +309,7 @@ void ScriptDialog::slotTrackEntryDeleted(const int topicId) if (m_currentTopicEditor != nullptr && m_currentTopicEditor->topicId() == topicId) { - ERROR_LOG() << "slotTrackEntryDeleted" << topicId << "editor" << m_currentTopicEditor->topicId(); + ERROR_LOG(m_logger) << "slotTrackEntryDeleted" << topicId << "editor" << m_currentTopicEditor->topicId(); m_currentTopicEditor->deleteLater(); m_currentTopicEditor = nullptr; } @@ -347,7 +347,7 @@ void ScriptDialog::slotEditEntry(const int topicId) } } - ERROR_LOG() << "could not find coresponding track entry with id " << topicId; + ERROR_LOG(m_logger) << "could not find coresponding track entry with id " << topicId; } @@ -408,7 +408,7 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay if (m_essentialsViewSession == nullptr) { - WARNING_LOG() << "no session for m_essentialsViewSession"; + WARNING_LOG(m_logger) << "no session for m_essentialsViewSession"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Essentials View was not properly initialized"), tr("Essentials View Session")); m_essentialsViewApp->deleteLater(); m_essentialsViewApp = nullptr; @@ -433,13 +433,13 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, applyFilterPtr, [applyFilter]() { delete applyFilter; }); sitMapFilterIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set filter topic editor's flt ifc to essentials view's flt ifc"; + DEBUG_LOG(m_logger) << "set filter topic editor's flt ifc to essentials view's flt ifc"; } else - WARNING_LOG() << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; + WARNING_LOG(m_logger) << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; } else - WARNING_LOG() << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find essentials view's flt ifc"; + WARNING_LOG(m_logger) << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find essentials view's flt ifc"; } @@ -458,13 +458,13 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay sitMapFilterGuiIfc->setSitMapGuiIfc(nullptr); }); - DEBUG_LOG() << "set sit map filter gui ifc's sit map gui ifc to essential view's sit map gui ifc"; + DEBUG_LOG(m_logger) << "set sit map filter gui ifc's sit map gui ifc to essential view's sit map gui ifc"; } else - WARNING_LOG() << "unable to initialize situation map filter gui plugin - sit map filter gui ifc"; + WARNING_LOG(m_logger) << "unable to initialize situation map filter gui plugin - sit map filter gui ifc"; } else - WARNING_LOG() << "unable to initialize situation map filter gui plugin - sit map gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize situation map filter gui plugin - sit map gui ifc missing!"; } @@ -478,13 +478,13 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay thisSrpGuiIfc->setSrpIfc(m_essentialsViewsSrpGuiIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisSrpGuiIfc]() { thisSrpGuiIfc->setSrpIfc(nullptr); }); connect(m_essentialsViewSession, &LtsSession::LtsSession::signalClose, this, [this]() { m_essentialsViewsSrpGuiIfc = nullptr; }); - DEBUG_LOG() << "set srp gui ifc's srp gui ifc to essential view's srp gui ifc"; + DEBUG_LOG(m_logger) << "set srp gui ifc's srp gui ifc to essential view's srp gui ifc"; } else - WARNING_LOG() << "unable to initialize srp gui plugin - this srp gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize srp gui plugin - this srp gui ifc missing!"; } else - WARNING_LOG() << "unable to initialize srp gui plugin - essentials view's srp gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize srp gui plugin - essentials view's srp gui ifc missing!"; @@ -496,10 +496,10 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay { thisPlanOverlayGuiIfc->setForeignPlanOverlaysGuiIfc(essentialsViewPlanOverlaysGuiIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisPlanOverlayGuiIfc]() { thisPlanOverlayGuiIfc->setForeignPlanOverlaysGuiIfc(nullptr); }); - WARNING_LOG() << "set this plan overlay's own gui ifc to essential view's plan overlays gui ifc"; + WARNING_LOG(m_logger) << "set this plan overlay's own gui ifc to essential view's plan overlays gui ifc"; } else - WARNING_LOG() << "unable to initialize plan overlays gui plugin - essential view's plan overlays gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize plan overlays gui plugin - essential view's plan overlays gui ifc missing!"; std::shared_ptr essentialsViewSitMapGuiIfc; @@ -507,13 +507,13 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay { thisPlanOverlayGuiIfc->setForeignSitMapGuiIfc(essentialsViewSitMapGuiIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisPlanOverlayGuiIfc]() { thisPlanOverlayGuiIfc->setForeignSitMapGuiIfc(nullptr); }); - DEBUG_LOG() << "set this plan overlay's sitMap gui ifc to essential view's sitMap gui ifc"; + DEBUG_LOG(m_logger) << "set this plan overlay's sitMap gui ifc to essential view's sitMap gui ifc"; } else - WARNING_LOG() << "unable to initialize sitMap gui plugin - essential view's sitMap gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize sitMap gui plugin - essential view's sitMap gui ifc missing!"; } else - WARNING_LOG() << "unable to initialize plan overlay gui plugin - this plan overlay gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize plan overlay gui plugin - this plan overlay gui ifc missing!"; @@ -521,10 +521,10 @@ void ScriptDialog::startEssentialsViewStage2(const Core::ReplayPartition &replay if (m_essentialsViewSession->getForeignGuiInterface(bgvIfc)) { bgvIfc->initTopicEditor(); - DEBUG_LOG() << "set bgv gui ifc's session"; + DEBUG_LOG(m_logger) << "set bgv gui ifc's session"; } else - WARNING_LOG() << "unable to set bgv gui ifc's session - essentials view's bgv ifc missing!"; + WARNING_LOG(m_logger) << "unable to set bgv gui ifc's session - essentials view's bgv ifc missing!"; }); } @@ -567,7 +567,7 @@ void ScriptDialog::slotStartEssentialsView() this, [this, replayId, t]() { int tries = t->property("tries").toInt(); - INFO_LOG() << "try # " << tries; + INFO_LOG(m_logger) << "try # " << tries; Core::ReplayPartition replay = m_coreDtc->replayPartition(replayId); @@ -670,7 +670,7 @@ void ScriptDialog::slotSetTopicPosition(QWidget *previewWidget, int ignoreTopicF if (thaRealTe == nullptr) { - ERROR_LOG() << "te not found: " << topicId; + ERROR_LOG(m_logger) << "te not found: " << topicId; return; } @@ -875,7 +875,7 @@ void ScriptDialog::getPresentationContent() if (contentList.size() < 1) { - WARNING_LOG() << "No content for Script Id = " << m_scriptId; + WARNING_LOG(m_logger) << "No content for Script Id = " << m_scriptId; setUnchangeable(false); return; } @@ -889,7 +889,7 @@ void ScriptDialog::getPresentationContent() auto tea = m_trackEntryAssignments.constFind(QString::fromStdString(content.presentationTopicType())); if (tea == m_trackEntryAssignments.constEnd()) { - ERROR_LOG() << "Invalid content for type " << QString::fromStdString(content.presentationTopicType()); + ERROR_LOG(m_logger) << "Invalid content for type " << QString::fromStdString(content.presentationTopicType()); continue; } @@ -903,7 +903,7 @@ void ScriptDialog::getPresentationContent() if (!m_ui->widget->addTopic(te)) { - WARNING_LOG() << "couldn't load topic #" << te->m_topicId; + WARNING_LOG(m_logger) << "couldn't load topic #" << te->m_topicId; delete te; } } @@ -920,13 +920,13 @@ void ScriptDialog::getPresentationContent() m_requestHelper = new LtsUtils::RequestHelper(this); - DEBUG_LOG() << "waiting for script content.."; + DEBUG_LOG(m_logger) << "waiting for script content.."; if (!m_requestHelper->startSingleRequest([this]() { return m_ftc->getPresentationContentRequest(GetPresentationContentRequest(m_scriptId), this); }, handlePresentationContent)) { - ERROR_LOG() << "Cannot retrieve Presentation Content for ScriptId = " << m_scriptId; + ERROR_LOG(m_logger) << "Cannot retrieve Presentation Content for ScriptId = " << m_scriptId; setUnchangeable(false); } @@ -1019,7 +1019,7 @@ void ScriptDialog::startReplaySession() if (replayId < 1) { - ERROR_LOG() << "replayId < 1"; + ERROR_LOG(m_logger) << "replayId < 1"; initFailed(__LINE__); return; } @@ -1058,7 +1058,7 @@ void ScriptDialog::startReplaySession() if (rp.id() != replayId) { - ERROR_LOG() << "Script Player: replay ids do not match!!! cannot start app"; + ERROR_LOG(m_logger) << "Script Player: replay ids do not match!!! cannot start app"; initFailed(__LINE__); return; } @@ -1068,7 +1068,7 @@ void ScriptDialog::startReplaySession() if (m_replaySession == nullptr) { - ERROR_LOG() << "m_replaySession == nullptr"; + ERROR_LOG(m_logger) << "m_replaySession == nullptr"; initFailed(__LINE__); return; } @@ -1092,11 +1092,11 @@ void ScriptDialog::startReplaySession() QString result(resultList.join(QStringLiteral("
- "))); if (r && !result.isEmpty()) - WARNING_LOG() << "At least one optional widget & control interface failed to load: " << result; + WARNING_LOG(m_logger) << "At least one optional widget & control interface failed to load: " << result; if (!r) { - ERROR_LOG() << "At least one widget & control interface failed to load: " << result; + ERROR_LOG(m_logger) << "At least one widget & control interface failed to load: " << result; initFailed(__LINE__); return; } @@ -1115,7 +1115,7 @@ void ScriptDialog::startReplaySession() m_requestHelper->deleteLater(); m_requestHelper = nullptr; - ERROR_LOG() << "replayPartitionCreateRequest failed"; + ERROR_LOG(m_logger) << "replayPartitionCreateRequest failed"; initFailed(__LINE__); }; @@ -1293,7 +1293,7 @@ void ScriptDialog::createSitMapApp() if (m_sitMapApp == nullptr) { LtsSessionData::LtsSessionData::getInstance()->setDebugFlagValue(QStringLiteral("DoNotCreateInstant.ReplayControl"), oldFlagValue); - ERROR_LOG() << "createApp returned nullptr for m_sitMapApp"; + ERROR_LOG(m_logger) << "createApp returned nullptr for m_sitMapApp"; initFailed(__LINE__); return; } @@ -1351,7 +1351,7 @@ void ScriptDialog::createSitMapApp() } else { - ERROR_LOG() << "setting SitMapFilterIfc's SitMapPtr to this SitMapIfc failed, because the SitMapFilterIfc could not be found !!"; + ERROR_LOG(m_logger) << "setting SitMapFilterIfc's SitMapPtr to this SitMapIfc failed, because the SitMapFilterIfc could not be found !!"; initFailed(__LINE__); return; } @@ -1366,14 +1366,14 @@ void ScriptDialog::createSitMapApp() } else { - ERROR_LOG() << "setting ReplayControlIfc's SitMapPtr to this SitMapIfc failed, because the ReplayControlIfc could not be found !!"; + ERROR_LOG(m_logger) << "setting ReplayControlIfc's SitMapPtr to this SitMapIfc failed, because the ReplayControlIfc could not be found !!"; initFailed(__LINE__); return; } } else { - ERROR_LOG() << "setting SitMapFilterIfc's SitMapPtr to this SitMapIfc failed, because the SitMapIfc could not be found !!"; + ERROR_LOG(m_logger) << "setting SitMapFilterIfc's SitMapPtr to this SitMapIfc failed, because the SitMapIfc could not be found !!"; initFailed(__LINE__); return; } @@ -1397,23 +1397,23 @@ void ScriptDialog::createSitMapApp() if (m_replaySession->getForeignGuiInterface(sitMapFilterGuiIfc)) { sitMapFilterGuiIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set sit map filter ifc's apply filter"; + DEBUG_LOG(m_logger) << "set sit map filter ifc's apply filter"; } else - WARNING_LOG() << "cannot set sit map filter ifc's apply filter - cannot find filter topic's ifc"; + WARNING_LOG(m_logger) << "cannot set sit map filter ifc's apply filter - cannot find filter topic's ifc"; std::shared_ptr sitRepIfc; if (m_replaySession->getForeignGuiInterface(sitRepIfc)) { sitRepIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set sit replay ifc's apply filter"; + DEBUG_LOG(m_logger) << "set sit replay ifc's apply filter"; } else - WARNING_LOG() << "cannot set sit replay ifc's apply filter - cannot find filter topic's ifc"; + WARNING_LOG(m_logger) << "cannot set sit replay ifc's apply filter - cannot find filter topic's ifc"; } else - WARNING_LOG() << "cannot set sit map filter ifc's apply filter - cannot find map's flt ifc"; + WARNING_LOG(m_logger) << "cannot set sit map filter ifc's apply filter - cannot find map's flt ifc"; } @@ -1429,14 +1429,14 @@ void ScriptDialog::createSitMapApp() } else { - DEBUG_LOG() << "setting planOverlayIfc's SitMapPtr to this SitMapIfc failed, because the SitMapIfc could not be found !!"; + DEBUG_LOG(m_logger) << "setting planOverlayIfc's SitMapPtr to this SitMapIfc failed, because the SitMapIfc could not be found !!"; initFailed(__LINE__); return; } } else { - DEBUG_LOG() << "setting planOverlayIfc's SitMapPtr to this SitMapIfc failed, because the SitMapFilterIfc could not be found !!"; + DEBUG_LOG(m_logger) << "setting planOverlayIfc's SitMapPtr to this SitMapIfc failed, because the SitMapFilterIfc could not be found !!"; initFailed(__LINE__); return; } @@ -1451,14 +1451,14 @@ void ScriptDialog::createSitMapApp() thisMrkIfc->setScriptsMrkIfc(sitMapMrkIfc.get()); else { - DEBUG_LOG() << "setting mrkIfc redirection failed - sitMap mrkIfc not found !"; + DEBUG_LOG(m_logger) << "setting mrkIfc redirection failed - sitMap mrkIfc not found !"; initFailed(__LINE__); return; } } else { - DEBUG_LOG() << "setting mrkIfc redirection failed - this mrkIfc not found !"; + DEBUG_LOG(m_logger) << "setting mrkIfc redirection failed - this mrkIfc not found !"; initFailed(__LINE__); return; } @@ -1471,7 +1471,7 @@ void ScriptDialog::createSitMapApp() } else { - ERROR_LOG() << "could not start situation map app !!"; + ERROR_LOG(m_logger) << "could not start situation map app !!"; initFailed(__LINE__); return; } @@ -1479,7 +1479,7 @@ void ScriptDialog::createSitMapApp() } else { - ERROR_LOG() << "Failed to start Situation App!"; + ERROR_LOG(m_logger) << "Failed to start Situation App!"; initFailed(__LINE__); return; } @@ -1608,7 +1608,7 @@ bool ScriptDialog::apply() return false; else { - ERROR_LOG() << "Creating a copy of script " << m_scriptId; + ERROR_LOG(m_logger) << "Creating a copy of script " << m_scriptId; m_scriptId = 0; name = tr("Copy of ")+ name; } @@ -1770,7 +1770,7 @@ int ScriptDialog::nextTopicTime() const auto nextTopicIter = topicMap.upperBound(m_positionTime); if (nextTopicIter == topicMap.constEnd()) { - DEBUG_LOG() << "There is no next topic!"; + DEBUG_LOG(m_logger) << "There is no next topic!"; return -1; } @@ -1806,7 +1806,7 @@ void ScriptDialog::slotPlayUntilNextTopic() if (topicTime < 0) { - DEBUG_LOG() << "There is no next topic to play until!"; + DEBUG_LOG(m_logger) << "There is no next topic to play until!"; return; } @@ -1818,7 +1818,7 @@ int ScriptDialog::previousTopicTime() const { if (m_topicMap.isEmpty()) { - DEBUG_LOG() << "There are no topics while checking for previous topic!"; + DEBUG_LOG(m_logger) << "There are no topics while checking for previous topic!"; return -1; } @@ -1838,7 +1838,7 @@ int ScriptDialog::previousTopicTime() const if (prevTopicIter == topicMap.constBegin()) { - DEBUG_LOG() << "There is no previous topic! (1)"; + DEBUG_LOG(m_logger) << "There is no previous topic! (1)"; return -1; } @@ -1846,7 +1846,7 @@ int ScriptDialog::previousTopicTime() const if (prevTopicIter == topicMap.constEnd()) { - DEBUG_LOG() << "There is no previous topic! (2)"; + DEBUG_LOG(m_logger) << "There is no previous topic! (2)"; return -1; } @@ -1898,7 +1898,7 @@ Screen *ScriptDialog::getProjectionWidget(const ScriptDialog::ProjectionWidget & ScriptDialog::ProjectionWidget ScriptDialog::identifyProjectionWidget(TrackEntry *topic) const { - DEBUG_LOG() << "identifyProjectionWidget: channel name: " << topic->m_channelName << ", filter parent channel name: " << topic->m_filterParentChannel; + DEBUG_LOG(m_logger) << "identifyProjectionWidget: channel name: " << topic->m_channelName << ", filter parent channel name: " << topic->m_filterParentChannel; if (topic->m_channelName == QStringLiteral("Screen 2")) return ProjectionWidget::Screen2; @@ -1937,7 +1937,7 @@ bool ScriptDialog::_tryAddTopic(TrackEntryType trackEntryType, { if (!ta.m_topicEditorIfc->initTopicEditor()) { - ERROR_LOG() << "Cannot add topic type " << typeName << " since 'initTopicEditor' failed"; + ERROR_LOG(m_logger) << "Cannot add topic type " << typeName << " since 'initTopicEditor' failed"; resultList.append(typeName); return false; } @@ -2017,14 +2017,14 @@ void ScriptDialog::setReplayWidgetPosition(PlayingTopic *playingTopic) if (projectionWidget == nullptr) { - ERROR_LOG() << "screen for topic #" << playingTopic->topic->m_topicId << " not found"; + ERROR_LOG(m_logger) << "screen for topic #" << playingTopic->topic->m_topicId << " not found"; return; } int projectionWidth = projectionWidget->width(); int projectionHeight = projectionWidget->height(); - DEBUG_LOG() << "projection w: " << projectionWidth << ", h: " << projectionHeight; + DEBUG_LOG(m_logger) << "projection w: " << projectionWidth << ", h: " << projectionHeight; TrackEntry *topic = playingTopic->topic; @@ -2048,7 +2048,7 @@ void ScriptDialog::setReplayWidgetPosition(PlayingTopic *playingTopic) if (replayWidget == nullptr) { - WARNING_LOG() << "no replay widget for topic" << topic->m_topicId; + WARNING_LOG(m_logger) << "no replay widget for topic" << topic->m_topicId; return; } @@ -2057,7 +2057,7 @@ void ScriptDialog::setReplayWidgetPosition(PlayingTopic *playingTopic) || (topic->x < 0 || topic->w < 0 || topic->y < 0 || topic->h < 0)) { replayWidget->setGeometry(x, y, projectionWidth, projectionHeight); - ERROR_LOG() << "set geo of replay widget !! #1 x" << x << "y" << y; + ERROR_LOG(m_logger) << "set geo of replay widget !! #1 x" << x << "y" << y; } else { @@ -2069,7 +2069,7 @@ void ScriptDialog::setReplayWidgetPosition(PlayingTopic *playingTopic) replayWidget->setGeometry(x + qRound(projectionX), y + qRound(projectionY), qRound(projectionW), qRound(projectionH)); } - DEBUG_LOG() << "final widget geo: " << replayWidget->geometry().x() + DEBUG_LOG(m_logger) << "final widget geo: " << replayWidget->geometry().x() << ", " << replayWidget->geometry().y() << ", " << replayWidget->geometry().width() << ", " << replayWidget->geometry().height(); @@ -2089,7 +2089,7 @@ void ScriptDialog::setReplayWidgetFreestanding(PlayingTopic *playingTopic, bool if (projectionWidget == nullptr) { - ERROR_LOG() << "screen for topic #" << playingTopic->topic->m_topicId << " not found"; + ERROR_LOG(m_logger) << "screen for topic #" << playingTopic->topic->m_topicId << " not found"; return; } @@ -2145,7 +2145,7 @@ void ScriptDialog::avsVisibilityHack(QWidget *parentForScreen, bool visible) QPoint pos(m_currentTopicDesigner->parentWidget()->mapToGlobal(geo.topLeft())); widget->setGeometry(QRect(pos, s)); - ERROR_LOG() << "geo x" << widget->geometry().x() << "geo y" << widget->geometry().y() << "geo h" << widget->geometry().height() << "geo w" << widget->geometry().width(); + ERROR_LOG(m_logger) << "geo x" << widget->geometry().x() << "geo y" << widget->geometry().y() << "geo h" << widget->geometry().height() << "geo w" << widget->geometry().width(); widget->setWindowFlags(Qt::FramelessWindowHint); @@ -2174,7 +2174,7 @@ void ScriptDialog::avsVisibilityHack(QWidget *parentForScreen, bool visible) m_currentTopicDesigner->setParent(widget); m_currentTopicDesigner->show(); - ERROR_LOG() << "made freestanding"; + ERROR_LOG(m_logger) << "made freestanding"; } } @@ -2219,7 +2219,7 @@ void ScriptDialog::setFreestanding(bool freestanding, const ProjectionWidget &pw case ProjectionWidget::Unknown: { - ERROR_LOG() << "trying to set freestanding with unknown projection widget - cannot set freestanding"; + ERROR_LOG(m_logger) << "trying to set freestanding with unknown projection widget - cannot set freestanding"; return; } } @@ -2243,7 +2243,7 @@ bool ScriptDialog::isScreenFreestanding(const ProjectionWidget &pw) const case ProjectionWidget::Screen2: return m_currentlyFreestandingTopicsScreen2; case ProjectionWidget::Unknown: - ERROR_LOG() << "projection widget unknown"; + ERROR_LOG(m_logger) << "projection widget unknown"; return false; } return true; @@ -2286,7 +2286,7 @@ void ScriptDialog::addReplayWidget(PlayingTopic *playingTopic, QWidget *replayWi case ProjectionWidget::Unknown: { - ERROR_LOG() << "projection widget unknown - cannot add replay widget"; + ERROR_LOG(m_logger) << "projection widget unknown - cannot add replay widget"; return; } } @@ -2305,7 +2305,7 @@ bool ScriptDialog::enableFireEventFlash(bool enable) if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) success = sitMapIfc->enableFireEventFlashing(enable); else - WARNING_LOG() << Q_FUNC_INFO << " Cannot execute enableFireEventFlashing with enable=" << enable; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot execute enableFireEventFlashing with enable=" << enable; return success; } @@ -2338,11 +2338,11 @@ void ScriptDialog::playTopic(TrackEntry *topic) for (const TopicAssignment &ta : std::as_const(m_trackEntryAssignments)) { - DEBUG_LOG() << Q_FUNC_INFO << " ta.m_topicName = " << ta.m_topicName; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ta.m_topicName = " << ta.m_topicName; if (topic->m_type == ta.m_trackEntryType) { - DEBUG_LOG() << Q_FUNC_INFO << " createInterface"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " createInterface"; playingTopic->topicTypeName = ta.m_topicName; playingTopic->trackEntryType = ta.m_trackEntryType; @@ -2352,17 +2352,17 @@ void ScriptDialog::playTopic(TrackEntry *topic) if (playingTopic->topicTypeName.isEmpty() || playingTopic->topicReplayIfc == nullptr) { - WARNING_LOG() << "Topic could not be assigned!! type name: " << playingTopic->topicTypeName << "replay ifc: " << (void *)playingTopic->topicReplayIfc; + WARNING_LOG(m_logger) << "Topic could not be assigned!! type name: " << playingTopic->topicTypeName << "replay ifc: " << (void *)playingTopic->topicReplayIfc; return; } - DEBUG_LOG() << Q_FUNC_INFO << " playingTopic->trackEntryType " << playingTopic->trackEntryType; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " playingTopic->trackEntryType " << playingTopic->trackEntryType; if (playingTopic->trackEntryType == TrackEntryType::SituationMap || playingTopic->trackEntryType == TrackEntryType::Situation) { - DEBUG_LOG() << Q_FUNC_INFO << " addReplayWidget"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " addReplayWidget"; m_sitMapSession->baseLayout()->setAutoFillBackground(true); addReplayWidget(playingTopic, m_sitMapSession->baseLayout()); @@ -2370,33 +2370,33 @@ void ScriptDialog::playTopic(TrackEntry *topic) if (sitMapIfc || m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->forceUpdate(); else - WARNING_LOG() << "Cannot force update on Situation Map - map might be stuck!"; + WARNING_LOG(m_logger) << "Cannot force update on Situation Map - map might be stuck!"; if (playingTopic->trackEntryType == TrackEntryType::Situation) { - DEBUG_LOG() << Q_FUNC_INFO << " Situation -> ENable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Situation -> ENable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; } } else { - DEBUG_LOG() << Q_FUNC_INFO << " non-sitmap"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " non-sitmap"; if (playingTopic->trackEntryType == TrackEntryType::Snapshot) { - DEBUG_LOG() << Q_FUNC_INFO << " Snapshot -> DISable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Snapshot -> DISable FireEventFlashing"; if (!enableFireEventFlash(false)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot disableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot disableFireEventFlashing at Situation Map"; } else if (playingTopic->trackEntryType == TrackEntryType::SituationReplay) { - DEBUG_LOG() << Q_FUNC_INFO << " SituationReplay -> ENable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " SituationReplay -> ENable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; } @@ -2424,14 +2424,14 @@ void ScriptDialog::playTopic(TrackEntry *topic) } } else - WARNING_LOG() << "topic #" << playingTopic->topic->m_topicId << " has no widget to show on presentation screen"; + WARNING_LOG(m_logger) << "topic #" << playingTopic->topic->m_topicId << " has no widget to show on presentation screen"; } if (topic->m_detailData.isEmpty()) { - WARNING_LOG() << "Note: Topic id " << topic->m_topicId << " has no JSON data"; + WARNING_LOG(m_logger) << "Note: Topic id " << topic->m_topicId << " has no JSON data"; } @@ -2447,7 +2447,7 @@ void ScriptDialog::playTopic(TrackEntry *topic) if (!playingTopic->topicReplayIfc->playbackInit(obj)) { - WARNING_LOG() << "Playing topic # " << topic->m_topicId << " playback init failed! Playback of this topic failed!"; + WARNING_LOG(m_logger) << "Playing topic # " << topic->m_topicId << " playback init failed! Playback of this topic failed!"; return; } @@ -2465,9 +2465,9 @@ void ScriptDialog::playTopic(TrackEntry *topic) }); } - DEBUG_LOG() << "playbackStart at offset" << m_positionTime - topic->m_startTime; + DEBUG_LOG(m_logger) << "playbackStart at offset" << m_positionTime - topic->m_startTime; if (!playingTopic->topicReplayIfc->playbackStart(m_positionTime - topic->m_startTime )) - WARNING_LOG() << "Playing topic # " << topic->m_topicId << " playback start failed! Playback of this topic failed!"; + WARNING_LOG(m_logger) << "Playing topic # " << topic->m_topicId << " playback start failed! Playback of this topic failed!"; m_journal.journalList.append(new NextTopicJournal(m_positionTime, playingTopic->isFilter, playingTopic->topicTypeName, topic->m_length)); } @@ -2559,7 +2559,7 @@ void ScriptDialog::slotTimerTick() if (m_positionTime >= topic->m_startTime && m_positionTime < (topic->m_startTime + topic->m_length)) { - DEBUG_LOG() << "Playing topic id " << topic->m_topicId << " with description " << topic->m_description; + DEBUG_LOG(m_logger) << "Playing topic id " << topic->m_topicId << " with description " << topic->m_description; playTopic(topic); } } @@ -2591,7 +2591,7 @@ void ScriptDialog::slotTimerTick() int realFilterTime = filterTe->m_startTime; if (m_positionTime >= (realFilterTime + 1) && m_positionTime <= (realFilterTime + filterTe->m_length)) { - DEBUG_LOG() << "Playing filter topic id " << filterTe->m_topicId << " with description " << filterTe->m_description; + DEBUG_LOG(m_logger) << "Playing filter topic id " << filterTe->m_topicId << " with description " << filterTe->m_description; playTopic(filterTe); @@ -2720,10 +2720,10 @@ void ScriptDialog::slotPlay() { if (playingTopic->topicReplayIfc != nullptr && m_ignoreTopicForReplay != playingTopic->topic->m_topicId) { - DEBUG_LOG() << "playbackStart (resume) at offset" << m_positionTime - playingTopic->topic->m_startTime; + DEBUG_LOG(m_logger) << "playbackStart (resume) at offset" << m_positionTime - playingTopic->topic->m_startTime; if (!playingTopic->topicReplayIfc->playbackStart(m_positionTime - playingTopic->topic->m_startTime )) - WARNING_LOG() << "Playing topic # " << playingTopic->topic->m_topicId << " playback start failed! Re-playback of this topic failed!"; + WARNING_LOG(m_logger) << "Playing topic # " << playingTopic->topic->m_topicId << " playback start failed! Re-playback of this topic failed!"; } @@ -2731,15 +2731,15 @@ void ScriptDialog::slotPlay() if (playingTopic->trackEntryType == TrackEntryType::Snapshot) { - DEBUG_LOG() << Q_FUNC_INFO << " Snapshot -> DISable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Snapshot -> DISable FireEventFlashing"; if (!enableFireEventFlash(false)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot disableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot disableFireEventFlashing at Situation Map"; } else if (playingTopic->trackEntryType == TrackEntryType::SituationReplay) { - DEBUG_LOG() << Q_FUNC_INFO << " Snapshot -> ENable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Snapshot -> ENable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; } @@ -2792,7 +2792,7 @@ void ScriptDialog::slotPause() if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->enableFireEventFlashing(false); else - WARNING_LOG() << "Cannot update sit map fire event flashing"; + WARNING_LOG(m_logger) << "Cannot update sit map fire event flashing"; } @@ -2847,7 +2847,7 @@ void ScriptDialog::stop(bool ended, bool ignoreFireEventFlashing) if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->enableFireEventFlashing(true); else - WARNING_LOG() << "Cannot update sit map fire event flashing"; + WARNING_LOG(m_logger) << "Cannot update sit map fire event flashing"; } } @@ -2866,7 +2866,7 @@ void ScriptDialog::pausePlayingTopics() { if (playingTopic->topicReplayIfc != nullptr) { - DEBUG_LOG() << "Pause topic: " << playingTopic->topicTypeName; + DEBUG_LOG(m_logger) << "Pause topic: " << playingTopic->topicTypeName; playingTopic->topicReplayIfc->playbackPause(); QString status = tr("Currently paused topic '%1' %2") @@ -2875,7 +2875,7 @@ void ScriptDialog::pausePlayingTopics() m_ui->lwStatus->addItem(status); } else - DEBUG_LOG() << "Topic not paused: " << playingTopic->topicTypeName; + DEBUG_LOG(m_logger) << "Topic not paused: " << playingTopic->topicTypeName; } } @@ -2934,7 +2934,7 @@ void ScriptDialog::initProjectionWidget(Screen **pointerToWidgetPointer) { if (static_cast(*pointerToWidgetPointer) == sender()) *pointerToWidgetPointer = nullptr; - INFO_LOG() << "a projection windows was destroyed"; + INFO_LOG(m_logger) << "a projection windows was destroyed"; }); *pointerToWidgetPointer = projWindow; @@ -2951,7 +2951,7 @@ void ScriptDialog::fillTopicVector() for (const LtsScriptTimeline::TrackEntry *trackEntry : std::as_const(m_topicVector)) { - DEBUG_LOG() << "m_topicVector index=" << trackEntry->index + DEBUG_LOG(m_logger) << "m_topicVector index=" << trackEntry->index << " topicId=" << trackEntry->m_topicId << " type=" << trackEntry->m_type; @@ -2975,7 +2975,7 @@ void ScriptDialog::fillTopicVector() for (const FilterTopic &filterTopic : std::as_const(m_filterTopicVector)) { const LtsScriptTimeline::TrackEntry *trackEntry = filterTopic.filterTopic; - DEBUG_LOG() << "m_filterTopicVector mainTopicId=" << filterTopic.mainTopicId + DEBUG_LOG(m_logger) << "m_filterTopicVector mainTopicId=" << filterTopic.mainTopicId << " index=" << trackEntry->index << " topicId=" << trackEntry->m_topicId << " type=" << trackEntry->m_type @@ -3091,7 +3091,7 @@ void ScriptDialog::exportPresentationContent(const Core::FunctionReply &baseRepl if (contentList.size() < 1) { - ERROR_LOG() << "No Presentation Content for Script Id " << reply.id(); + ERROR_LOG(m_logger) << "No Presentation Content for Script Id " << reply.id(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("No presentation content, nothing to export!")); return; } @@ -3106,7 +3106,7 @@ void ScriptDialog::exportPresentationContent(const Core::FunctionReply &baseRepl if (!topicStringToType(QString::fromStdString(content.presentationTopicType()), tet) || tet == TrackEntryType::INVALID) { - ERROR_LOG() << "Topic ignored at export - invalid topic type for presentation's content id " << content.id(); + ERROR_LOG(m_logger) << "Topic ignored at export - invalid topic type for presentation's content id " << content.id(); continue; } #ifndef EXPORT_BDV_TOPIC_AS_JSON @@ -3132,7 +3132,7 @@ void ScriptDialog::exportPresentationContent(const Core::FunctionReply &baseRepl eVSession()->baseLayout()->focusTab(pBaseGuiIfc->menuGroup(), QStringLiteral("bdvShowBdv"), LtsWidgets::LayoutArea::eMainTab); } else - ERROR_LOG() << "Fetching ForeignGuiInterface of BuildingViewer failed!"; + ERROR_LOG(m_logger) << "Fetching ForeignGuiInterface of BuildingViewer failed!"; } @@ -3244,7 +3244,7 @@ void ScriptDialog::slotLoadScript() std::shared_ptr opmDtc; if (!m_exerciseSession->getDtc(opmDtc)) { - ERROR_LOG() << "opm dtc missing for script chooser ..."; + ERROR_LOG(m_logger) << "opm dtc missing for script chooser ..."; return; } @@ -3297,7 +3297,7 @@ void ScriptDialog::slotExportScript() return; QString exportPath = TakeHomePackageGenerator::ExportProcess::exportPath(m_exerciseSession->exerciseId()) + QString::number(m_scriptId); - DEBUG_LOG() << "exportPath: " << exportPath; + DEBUG_LOG(m_logger) << "exportPath: " << exportPath; QDir dir(exportPath); if (!dir.exists()) @@ -3315,7 +3315,7 @@ void ScriptDialog::slotExportScript() if (dir.exists() && !dir.isEmpty()) { - INFO_LOG() << "slotExportScript: dir.exists() && !dir.isEmpty()" ; + INFO_LOG(m_logger) << "slotExportScript: dir.exists() && !dir.isEmpty()" ; LtsWidgets::Button button = LtsWidgets::LtsMessageDialog::showMessage(this, tr("Specified folder already exists and is not empty. Do you want to overwrite this folder?"), tr("Information: %1").arg(dir.absolutePath()), diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.h index 492585b12..01a533301 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptEditor/pre_script_dialog.h @@ -226,7 +226,7 @@ private: if (!m_exerciseSession->interfaceFromGui(topicEditorIfc)) { - ERROR_LOG() << "getTopicEditorIfc failed: Cannot add topic type " + ERROR_LOG(m_logger) << "getTopicEditorIfc failed: Cannot add topic type " << LtsScriptTimeline::trackEntryTypeName(trackEntryType) << " because topic editor ifc is missing."; return nullptr; @@ -243,7 +243,7 @@ private: if (!m_replaySession->interfaceFromGui(topicReplayFactory)) { - ERROR_LOG() << "getTopicIfcFactory failed: Cannot add topic type " + ERROR_LOG(m_logger) << "getTopicIfcFactory failed: Cannot add topic type " << LtsScriptTimeline::trackEntryTypeName(trackEntryType) << " because topic ifc factory is missing."; return nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_journal_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_journal_dialog.h index 9c34f0b01..b89db692e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_journal_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_journal_dialog.h @@ -27,6 +27,8 @@ public: void retranslate() override final; private: + +NGL::INGLLogger &m_logger; void fillJournal(); private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.cpp index 1973bce33..8757aa482 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.cpp @@ -17,7 +17,7 @@ ScreenRecorder::ScreenRecorder(QObject *parent) : QObject(parent) , m_logger(getLogger(QStringLiteral("ScreenRecorder"))) { - connect(this, &ScreenRecorder::newTime, this, [this](qint64 _t1){ DEBUG_LOG() << "newTime: " << _t1; }); + connect(this, &ScreenRecorder::newTime, this, [this](qint64 _t1){ DEBUG_LOG(m_logger) << "newTime: " << _t1; }); } @@ -34,7 +34,7 @@ void ScreenRecorder::cut() } catch (const QString &msg) { - ERROR_LOG() << "Cutting recording of topic '" << tr->topicName() << "', id: " << tr->topicId() << " failed! " << msg; + ERROR_LOG(m_logger) << "Cutting recording of topic '" << tr->topicName() << "', id: " << tr->topicId() << " failed! " << msg; m_failedExportTopicIds += tr->topicId(); } } @@ -54,7 +54,7 @@ void ScreenRecorder::save(const QString &tmpDirPath) } catch (const QString &msg) { - ERROR_LOG() << "Saving recording of topic '" << tr->topicName() << "', id: " << tr->topicId() << " failed! " << msg; + ERROR_LOG(m_logger) << "Saving recording of topic '" << tr->topicName() << "', id: " << tr->topicId() << " failed! " << msg; m_failedExportTopicIds += tr->topicId(); } } @@ -81,14 +81,14 @@ void ScreenRecorder::addTopicsForScreen(Screen *screen, const std::vectorwaitForFinishedRecording(); - DEBUG_LOG() << "... all TopicRecorder finished."; + DEBUG_LOG(m_logger) << "... all TopicRecorder finished."; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.h index f7006f1de..c83f51716 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_recorder.h @@ -49,6 +49,8 @@ signals: void cancel(); private: + +NGL::INGLLogger &m_logger; QVector m_topicRecorder; QSet m_failedExportTopicIds; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.cpp index 8d501c43b..40dd579df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.cpp @@ -33,7 +33,7 @@ void ScreenShotter::addTopicsForScreen(Screen *screen, const std::vectortopicName() << "', id: " << tr->topicId() << " failed! " << msg; + ERROR_LOG(m_logger) << "Saving screenshot of topic '" << tr->topicName() << "', id: " << tr->topicId() << " failed! " << msg; m_failedExportTopicIds += tr->topicId(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.h index b81ac23db..754f9a587 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_screen_shotter.h @@ -36,6 +36,8 @@ signals: void topicExportFailed(const int failedTopicId); private: + +NGL::INGLLogger &m_logger; QVector m_topicShotter; QSet m_failedExportTopicIds; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp index 2c0178592..e1358b256 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.cpp @@ -147,7 +147,7 @@ ScriptTimelineDialog::ScriptTimelineDialog(const QString &menuGroup, QWidget *pa #endif #ifdef EXPORT_BDV_TOPIC_AS_JSON - WARNING_LOG() << "EXPORT_BDV_TOPIC_AS_JSON active!"; + WARNING_LOG(m_logger) << "EXPORT_BDV_TOPIC_AS_JSON active!"; #endif @@ -264,7 +264,7 @@ void ScriptTimelineDialog::initInternal() } catch(const std::runtime_error &ex) { - ERROR_LOG() << "initInternal failed: " << ex.what(); + ERROR_LOG(m_logger) << "initInternal failed: " << ex.what(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("Scripts app could not be initialized."), tr("Initialization failed")); emit m_session->signalClose(); return; @@ -455,8 +455,8 @@ bool ScriptTimelineDialog::import(const QVector &contents) { bRet = m_model->import(contents); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } if (!bRet) new LtsWidgets::LtsMessageDialogNew(this, tr("Script cannot be inserted at the given position."), tr("Import failed")); @@ -475,7 +475,7 @@ void ScriptTimelineDialog::load() m_scriptOwner = QString::fromStdString(m_opmDtc->user(presentation.operatorId()).name()); m_lastModified = presentation.lastModified(); m_exerciseName = QString::fromStdString(m_exmDtc->exercise(m_exerciseSession->exerciseId()).name()); - DEBUG_LOG() << "### ###Name: " << m_exerciseName; + DEBUG_LOG(m_logger) << "### ###Name: " << m_exerciseName; m_exerciseSession->baseLayout()->setCustomText(tr("Script: %1").arg(m_scriptName)); QJsonObject savegame = m_exerciseSession->getSavegame(); @@ -622,7 +622,7 @@ bool ScriptTimelineDialog::apply() return false; } - ERROR_LOG() << "Creating a copy of script " << m_scriptId; + ERROR_LOG(m_logger) << "Creating a copy of script " << m_scriptId; m_scriptId = 0; name = tr("Copy of ") + name; } @@ -643,7 +643,7 @@ bool ScriptTimelineDialog::apply() for (const int &topicItemId : std::as_const(mainTopicItemIds)) { TopicItem &topicItem = m_model->topicItem(topicItemId); - DEBUG_LOG() << "Adding topic item: id=" << topicItem.id() << ", start=" << topicItem.startTime() / 1000 + DEBUG_LOG(m_logger) << "Adding topic item: id=" << topicItem.id() << ", start=" << topicItem.startTime() / 1000 << ", duration=" << topicItem.duration() / 1000 << ", type=" << topicTypeString(topicItem.topicType()) << ", channel=" << topicItem.channel() << ", parentChannel=" << topicItem.parentChannel(); content[i++] = m_model->topicItemPresentationContent(topicItemId); @@ -651,13 +651,13 @@ bool ScriptTimelineDialog::apply() } catch (const QString &str) { - ERROR_LOG() << Q_FUNC_INFO << " " << str; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; new LtsWidgets::LtsMessageDialogNew(this, tr("Saving script failed. Please try again later.")); return false; } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; new LtsWidgets::LtsMessageDialogNew(this, tr("Saving script failed. Please try again later.")); return false; } @@ -714,7 +714,7 @@ void ScriptTimelineDialog::getReplaySession() noexcept(false) - ERROR_LOG() << "replayId: " << replayId; + ERROR_LOG(m_logger) << "replayId: " << replayId; bool found = false; Core::ReplayPartition rp; @@ -742,7 +742,7 @@ void ScriptTimelineDialog::getReplaySession() noexcept(false) } catch (...) { - ERROR_LOG() << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() + ERROR_LOG(m_logger) << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() << " - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); } @@ -752,7 +752,7 @@ void ScriptTimelineDialog::getReplaySession() noexcept(false) if (!found) { throw std::runtime_error("replay timed out"); - WARNING_LOG() << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() + WARNING_LOG(m_logger) << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() << " - replay partition does not exist - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); rmPartFn(); @@ -789,7 +789,7 @@ void ScriptTimelineDialog::getReplaySession() noexcept(false) bool bResult = getTopics(resultList); QString result(resultList.join(L("
- "))); if (bResult && !result.isEmpty()) - WARNING_LOG() << "At least one optional widget & control interface failed to load: " << result; + WARNING_LOG(m_logger) << "At least one optional widget & control interface failed to load: " << result; if (!bResult) { @@ -902,7 +902,7 @@ bool ScriptTimelineDialog::getTopic(TopicEditorBase::TopicType topicType, { if (!topicAssignment.topicEditorIfc->initTopicEditor()) { - ERROR_LOG() << "Cannot add topic type " << typeName << " since 'initTopicEditor' failed"; + ERROR_LOG(m_logger) << "Cannot add topic type " << typeName << " since 'initTopicEditor' failed"; resultList.append(typeName); return false; } @@ -995,7 +995,7 @@ void ScriptTimelineDialog::getPresentationContent() setUnchangeable(true); m_model->clear(); - DEBUG_LOG() << "waiting for script content.."; + DEBUG_LOG(m_logger) << "waiting for script content.."; try { @@ -1004,7 +1004,7 @@ void ScriptTimelineDialog::getPresentationContent() } catch(...) { - ERROR_LOG() << "Cannot retrieve PresentationContent for script with id = " << m_scriptId; + ERROR_LOG(m_logger) << "Cannot retrieve PresentationContent for script with id = " << m_scriptId; setUnchangeable(false); LtsWidgets::LtsMessageDialog::showMessage(this, tr("Failed to load script. Please try again later.")); return; @@ -1120,22 +1120,22 @@ void ScriptTimelineDialog::getSitMapApp() noexcept(false) if (m_replaySession->getForeignGuiInterface(sitMapFilterGuiIfc)) { sitMapFilterGuiIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set sit map filter ifc's apply filter"; + DEBUG_LOG(m_logger) << "set sit map filter ifc's apply filter"; } else - WARNING_LOG() << "cannot set sit map filter ifc's apply filter - cannot find filter topic's ifc"; + WARNING_LOG(m_logger) << "cannot set sit map filter ifc's apply filter - cannot find filter topic's ifc"; std::shared_ptr sitRepIfc; if (m_replaySession->getForeignGuiInterface(sitRepIfc)) { sitRepIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set sit replay ifc's apply filter"; + DEBUG_LOG(m_logger) << "set sit replay ifc's apply filter"; } else - WARNING_LOG() << "cannot set sit replay ifc's apply filter - cannot find filter topic's ifc"; + WARNING_LOG(m_logger) << "cannot set sit replay ifc's apply filter - cannot find filter topic's ifc"; } else - WARNING_LOG() << "cannot set sit map filter ifc's apply filter - cannot find map's flt ifc"; + WARNING_LOG(m_logger) << "cannot set sit map filter ifc's apply filter - cannot find map's flt ifc"; } @@ -1201,7 +1201,7 @@ void ScriptTimelineDialog::getProjectionWidget(Screen **pointerToWidgetPointer, { if (static_cast(*pointerToWidgetPointer) == sender()) *pointerToWidgetPointer = nullptr; - INFO_LOG() << "a projection window was destroyed"; + INFO_LOG(m_logger) << "a projection window was destroyed"; }); *pointerToWidgetPointer = screenPtr; @@ -1210,7 +1210,7 @@ void ScriptTimelineDialog::getProjectionWidget(Screen **pointerToWidgetPointer, else { if (!LtsMultiMonitor::LtsMultiMonitor::getInstance()->putScreenAutomatically(screenPtr)) - ERROR_LOG() << "Could not place screen automatically!"; + ERROR_LOG(m_logger) << "Could not place screen automatically!"; } }, Qt::QueuedConnection); } @@ -1223,7 +1223,7 @@ bool ScriptTimelineDialog::enableFireEventFlash(bool enable) if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) success = sitMapIfc->enableFireEventFlashing(enable); else - WARNING_LOG() << Q_FUNC_INFO << " Cannot execute enableFireEventFlashing with enable=" << enable; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot execute enableFireEventFlashing with enable=" << enable; return success; } @@ -1235,7 +1235,7 @@ void ScriptTimelineDialog::exportPresentationContent(const Core::FunctionReply & if (contentList.size() < 1) { - ERROR_LOG() << "No Presentation Content for Script Id " << reply.id(); + ERROR_LOG(m_logger) << "No Presentation Content for Script Id " << reply.id(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("No presentation content, nothing to export!")); return; } @@ -1248,7 +1248,7 @@ void ScriptTimelineDialog::exportPresentationContent(const Core::FunctionReply & TopicEditorBase::TopicType topicType = TopicEditorBase::topicTypeFromString(QString::fromStdString(content.presentationTopicType())); if (topicType == TopicEditorBase::TopicType::Invalid) { - ERROR_LOG() << "Topic ignored at export - invalid topic type for presentation's content id " << content.id(); + ERROR_LOG(m_logger) << "Topic ignored at export - invalid topic type for presentation's content id " << content.id(); continue; } #ifndef EXPORT_BDV_TOPIC_AS_JSON @@ -1274,7 +1274,7 @@ void ScriptTimelineDialog::exportPresentationContent(const Core::FunctionReply & essentialsViewSession()->baseLayout()->focusTab(pBaseGuiIfc->menuGroup(), L("bdvShowBdv"), LtsWidgets::LayoutArea::eMainTab); } else - ERROR_LOG() << "Fetching ForeignGuiInterface of BuildingViewer failed!"; + ERROR_LOG(m_logger) << "Fetching ForeignGuiInterface of BuildingViewer failed!"; } QProgressDialog *pProgressDlg = new QProgressDialog(tr("Export in progress..."), tr("Cancel"), 0, 0, this); @@ -1328,7 +1328,7 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition } catch (...) { - ERROR_LOG() << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() + ERROR_LOG(m_logger) << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() << " - replay id: " << replay.id() << " - url " << m_session->tcpConnectionUrl().toString(); } @@ -1361,7 +1361,7 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition m_essentialsViewSession = m_essentialsViewApp->getSession(params.partitionType, params.partitionId); if (m_essentialsViewSession == nullptr) { - WARNING_LOG() << "no session for m_essentialsViewSession"; + WARNING_LOG(m_logger) << "no session for m_essentialsViewSession"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Essentials View was not properly initialized"), tr("Essentials View Session")); m_essentialsViewApp->deleteLater(); m_essentialsViewApp = nullptr; @@ -1391,10 +1391,10 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, applyFilterPtr, [applyFilter]() { delete applyFilter; }); sitMapFilterIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set filter topic editor's flt ifc to essentials view's flt ifc"; + DEBUG_LOG(m_logger) << "set filter topic editor's flt ifc to essentials view's flt ifc"; } else - WARNING_LOG() << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; + WARNING_LOG(m_logger) << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; std::shared_ptr srpIfc; @@ -1408,14 +1408,14 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, applyFilterPtr, [applyFilter]() { delete applyFilter; }); srpIfc->setApplyFilter(applyFilter); - DEBUG_LOG() << "set srp topic editor's flt ifc to essentials view's flt ifc"; + DEBUG_LOG(m_logger) << "set srp topic editor's flt ifc to essentials view's flt ifc"; } else - WARNING_LOG() << "cannot set srp topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; + WARNING_LOG(m_logger) << "cannot set srp topic editor's flt ifc to essentials view's flt ifc - cannot find topic editor"; } else - WARNING_LOG() << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find essentials view's flt ifc"; + WARNING_LOG(m_logger) << "cannot set filter topic editor's flt ifc to essentials view's flt ifc - cannot find essentials view's flt ifc"; } { @@ -1433,13 +1433,13 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition sitMapFilterGuiIfc->setSitMapGuiIfc(nullptr); }); - DEBUG_LOG() << "set sit map filter gui ifc's sit map gui ifc to essential view's sit map gui ifc"; + DEBUG_LOG(m_logger) << "set sit map filter gui ifc's sit map gui ifc to essential view's sit map gui ifc"; } else - WARNING_LOG() << "unable to initialize situation map filter gui plugin - sit map filter gui ifc"; + WARNING_LOG(m_logger) << "unable to initialize situation map filter gui plugin - sit map filter gui ifc"; } else - WARNING_LOG() << "unable to initialize situation map filter gui plugin - sit map gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize situation map filter gui plugin - sit map gui ifc missing!"; } @@ -1453,13 +1453,13 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition thisSrpGuiIfc->setEssentialsViewInterfaces(m_essentialsViewsSrpIfc.get(), m_essentialsViewsSitMapIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisSrpGuiIfc]() { thisSrpGuiIfc->setEssentialsViewInterfaces(nullptr, nullptr); }); connect(m_essentialsViewSession, &LtsSession::LtsSession::signalClose, this, [this]() { m_essentialsViewsSrpIfc = nullptr; m_essentialsViewsSitMapIfc = nullptr; }); - DEBUG_LOG() << "set srp gui ifc's srp gui ifc to essential view's srp gui ifc"; + DEBUG_LOG(m_logger) << "set srp gui ifc's srp gui ifc to essential view's srp gui ifc"; } else - WARNING_LOG() << "unable to initialize srp gui plugin - this srp gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize srp gui plugin - this srp gui ifc missing!"; } else - WARNING_LOG() << "unable to initialize srp gui plugin - essentials view's srp / sitmap ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize srp gui plugin - essentials view's srp / sitmap ifc missing!"; std::shared_ptr thisPlanOverlayGuiIfc; @@ -1470,33 +1470,33 @@ void ScriptTimelineDialog::startEssentialsViewStage2(const Core::ReplayPartition { thisPlanOverlayGuiIfc->setForeignPlanOverlaysGuiIfc(essentialsViewPlanOverlaysGuiIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisPlanOverlayGuiIfc]() { thisPlanOverlayGuiIfc->setForeignPlanOverlaysGuiIfc(nullptr); }); - WARNING_LOG() << "set this plan overlay's own gui ifc to essential view's plan overlays gui ifc"; + WARNING_LOG(m_logger) << "set this plan overlay's own gui ifc to essential view's plan overlays gui ifc"; } else - WARNING_LOG() << "unable to initialize plan overlays gui plugin - essential view's plan overlays gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize plan overlays gui plugin - essential view's plan overlays gui ifc missing!"; std::shared_ptr essentialsViewSitMapGuiIfc; if (m_essentialsViewSession->getForeignGuiInterface(essentialsViewSitMapGuiIfc)) { thisPlanOverlayGuiIfc->setForeignSitMapGuiIfc(essentialsViewSitMapGuiIfc.get()); connect(m_essentialsViewSession, &LtsSession::LtsSession::destroyed, this, [thisPlanOverlayGuiIfc]() { thisPlanOverlayGuiIfc->setForeignSitMapGuiIfc(nullptr); }); - DEBUG_LOG() << "set this plan overlay's sitMap gui ifc to essential view's sitMap gui ifc"; + DEBUG_LOG(m_logger) << "set this plan overlay's sitMap gui ifc to essential view's sitMap gui ifc"; } else - WARNING_LOG() << "unable to initialize sitMap gui plugin - essential view's sitMap gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize sitMap gui plugin - essential view's sitMap gui ifc missing!"; } else - WARNING_LOG() << "unable to initialize plan overlay gui plugin - this plan overlay gui ifc missing!"; + WARNING_LOG(m_logger) << "unable to initialize plan overlay gui plugin - this plan overlay gui ifc missing!"; std::shared_ptr bgvIfc; if (m_essentialsViewSession->getForeignGuiInterface(bgvIfc)) { bgvIfc->initTopicEditor(); - DEBUG_LOG() << "set bgv gui ifc's session"; + DEBUG_LOG(m_logger) << "set bgv gui ifc's session"; } else - WARNING_LOG() << "unable to set bgv gui ifc's session - essentials view's bgv ifc missing!"; + WARNING_LOG(m_logger) << "unable to set bgv gui ifc's session - essentials view's bgv ifc missing!"; if (openTopicEditor) { @@ -1547,7 +1547,7 @@ TopicEditorBase::TopicEditor *ScriptTimelineDialog::createTopicEditor(const Topi if (it == m_topicAssignments.cend()) { - ERROR_LOG() << "no topic assignment for topic with type = " << topicTypeString(data.topicType); + ERROR_LOG(m_logger) << "no topic assignment for topic with type = " << topicTypeString(data.topicType); return nullptr; } @@ -1635,7 +1635,7 @@ Screen *ScriptTimelineDialog::getProjectionWidget(const ProjectionWidget &projec ScriptTimelineDialog::ProjectionWidget ScriptTimelineDialog::identifyProjectionWidget(const TopicItem &topicItem) const { - DEBUG_LOG() << "identifyProjectionWidget: channel name: " << topicItem.channel() + DEBUG_LOG(m_logger) << "identifyProjectionWidget: channel name: " << topicItem.channel() << ", filter parent channel name: " << topicItem.parentChannel(); if (topicItem.channel() == L("Screen 2")) @@ -1693,7 +1693,7 @@ void ScriptTimelineDialog::addReplayWidget(int topicItemId, QWidget *replayWidge break; case ProjectionWidget::Unknown: - ERROR_LOG() << "projection widget unknown - cannot add replay widget"; + ERROR_LOG(m_logger) << "projection widget unknown - cannot add replay widget"; return; } @@ -1701,7 +1701,7 @@ void ScriptTimelineDialog::addReplayWidget(int topicItemId, QWidget *replayWidge } catch (...) { - ERROR_LOG() << "unknown topic item with id = " << topicItemId; + ERROR_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } @@ -1715,13 +1715,13 @@ void ScriptTimelineDialog::setReplayWidgetPosition(int topicItemId) QWidget *projectionWidgetPtr = getProjectionWidget(projectionWidgetType); if (projectionWidgetPtr == nullptr) { - ERROR_LOG() << "screen for topic item with id = " << topicItemId << " not found"; + ERROR_LOG(m_logger) << "screen for topic item with id = " << topicItemId << " not found"; return; } int projectionWidth = projectionWidgetPtr->width(); int projectionHeight = projectionWidgetPtr->height(); - DEBUG_LOG() << "projection: width = " << projectionWidth << ", height = " << projectionHeight; + DEBUG_LOG(m_logger) << "projection: width = " << projectionWidth << ", height = " << projectionHeight; const TopicEditorBase::TopicData &data = topicItem.topicData(); int x = 0; int y = 0; @@ -1740,7 +1740,7 @@ void ScriptTimelineDialog::setReplayWidgetPosition(int topicItemId) QWidget *replayWidget = topicItem.replayWidget(); if (replayWidget == nullptr) { - WARNING_LOG() << "no replay widget for topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "no replay widget for topic item with id = " << topicItemId; return; } @@ -1749,7 +1749,7 @@ void ScriptTimelineDialog::setReplayWidgetPosition(int topicItemId) (data.x < 0.00000 || data.w < 0.00001 || data.y < 0.00000 || data.h < 0.00001)) { replayWidget->setGeometry(x, y, projectionWidth, projectionHeight); - WARNING_LOG() << "set geo of replay widget !! #1 x" << x << "y" << y; + WARNING_LOG(m_logger) << "set geo of replay widget !! #1 x" << x << "y" << y; } else { @@ -1762,14 +1762,14 @@ void ScriptTimelineDialog::setReplayWidgetPosition(int topicItemId) { double oldW = dataW; dataW = 1.0 - dataX - 0.001; - ERROR_LOG() << "############## oldW = " << oldW << ", newW = " << dataW; + ERROR_LOG(m_logger) << "############## oldW = " << oldW << ", newW = " << dataW; } if ((dataY + dataH) > 1.0) { double oldH = dataH; dataH = 1.0 - dataY - 0.001; - ERROR_LOG() << "############## oldH = " << oldH << ", newH = " << dataH; + ERROR_LOG(m_logger) << "############## oldH = " << oldH << ", newH = " << dataH; } double projectionX = projectionWidth; projectionX *= dataX; @@ -1780,13 +1780,13 @@ void ScriptTimelineDialog::setReplayWidgetPosition(int topicItemId) replayWidget->setGeometry(x + qRound(projectionX), y + qRound(projectionY), qRound(projectionW), qRound(projectionH)); } - DEBUG_LOG() << "final widget geo: " << replayWidget->geometry().x() << ", " << replayWidget->geometry().y() + DEBUG_LOG(m_logger) << "final widget geo: " << replayWidget->geometry().x() << ", " << replayWidget->geometry().y() << ", " << replayWidget->geometry().width() << ", " << replayWidget->geometry().height(); replayWidget->show(); } catch (...) { - ERROR_LOG() << "unknown topic item with id = " << topicItemId; + ERROR_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } @@ -1803,7 +1803,7 @@ void ScriptTimelineDialog::setReplayWidgetFreestanding(int topicItemId, bool fre QWidget *projectionWidgetPtr = getProjectionWidget(identifyProjectionWidget(topicItem)); if (projectionWidgetPtr == nullptr) { - ERROR_LOG() << "screen for topic #" << topicItemId << " not found"; + ERROR_LOG(m_logger) << "screen for topic #" << topicItemId << " not found"; return; } @@ -1829,7 +1829,7 @@ void ScriptTimelineDialog::setReplayWidgetFreestanding(int topicItemId, bool fre } catch (...) { - ERROR_LOG() << "unknown topic item with id = " << topicItemId; + ERROR_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } @@ -1870,7 +1870,7 @@ bool ScriptTimelineDialog::isScreenFreestanding(const ProjectionWidget &projecti return m_isTopicsScreen2Freestanding; case ProjectionWidget::Unknown: default: - ERROR_LOG() << "projection widget unknown"; + ERROR_LOG(m_logger) << "projection widget unknown"; return false; } Q_UNREACHABLE(); @@ -1893,7 +1893,7 @@ void ScriptTimelineDialog::setProjectionWidgetFreestanding(bool freestanding, co break; case ProjectionWidget::Unknown: - ERROR_LOG() << "trying to set freestanding with unknown projection widget - cannot set freestanding"; + ERROR_LOG(m_logger) << "trying to set freestanding with unknown projection widget - cannot set freestanding"; return; } try @@ -1907,7 +1907,7 @@ void ScriptTimelineDialog::setProjectionWidgetFreestanding(bool freestanding, co } catch (...) { - ERROR_LOG() << "search over topic items failed"; + ERROR_LOG(m_logger) << "search over topic items failed"; } } @@ -1962,7 +1962,7 @@ void ScriptTimelineDialog::avsVisibilityHack(QWidget *parentForScreen, bool visi m_currentTopicDesigner->setParent(widget); m_currentTopicDesigner->show(); - DEBUG_LOG() << "made freestanding"; + DEBUG_LOG(m_logger) << "made freestanding"; } } @@ -2056,8 +2056,8 @@ void ScriptTimelineDialog::openContextMenu(QPoint pos, int topicItemId) { m_model->cutToClipboard(topicItemIds); } - catch (const QString &str) { ERROR_LOG() << str; } - catch (...) { ERROR_LOG() << "cutToClipboard failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << str; } + catch (...) { ERROR_LOG(m_logger) << "cutToClipboard failed"; } } }); contextMenu->addAction(action); @@ -2080,8 +2080,8 @@ void ScriptTimelineDialog::openContextMenu(QPoint pos, int topicItemId) { m_model->copyToClipboard(topicItemIds); } - catch (const QString &str) { ERROR_LOG() << str; } - catch (...) { ERROR_LOG() << "copyToClipboard failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << str; } + catch (...) { ERROR_LOG(m_logger) << "copyToClipboard failed"; } } }); contextMenu->addAction(action); @@ -2101,8 +2101,8 @@ void ScriptTimelineDialog::openContextMenu(QPoint pos, int topicItemId) { m_model->pasteFromClipboard(m_ui->timeline->view()->toTime(pos.x())); } - catch (const QString &str) { ERROR_LOG() << str; } - catch (...) { ERROR_LOG() << "pasteFromClipboard failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << str; } + catch (...) { ERROR_LOG(m_logger) << "pasteFromClipboard failed"; } }); contextMenu->addAction(action); } @@ -2133,8 +2133,8 @@ void ScriptTimelineDialog::setTopicDescription(int topicItemId) slotChangesMade(); } } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << topicItemId; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << topicItemId; } } @@ -2159,8 +2159,8 @@ void ScriptTimelineDialog::enableTopicEditors(bool enable) topicEditor->setEnabled(enable); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << itemId << ": " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << itemId; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << itemId << ": " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << itemId; } } } @@ -2237,47 +2237,47 @@ void ScriptTimelineDialog::playTopic(int topicItemId) if (!topicItem.replayInterface()) { - WARNING_LOG() << "no replay interface for topic of type = " << topicTypeString(topicItem.topicType()); + WARNING_LOG(m_logger) << "no replay interface for topic of type = " << topicTypeString(topicItem.topicType()); return; } - DEBUG_LOG() << Q_FUNC_INFO << " playing topic of type = " << topicTypeString(topicItem.topicType()); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " playing topic of type = " << topicTypeString(topicItem.topicType()); if (topicItem.topicType() == TopicEditorBase::TopicType::SituationMap || topicItem.topicType() == TopicEditorBase::TopicType::Situation) { - DEBUG_LOG() << Q_FUNC_INFO << " addReplayWidget"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " addReplayWidget"; m_sitMapSession->baseLayout()->setAutoFillBackground(true); addReplayWidget(topicItemId, m_sitMapSession->baseLayout()); if (sitMapIfc || m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->forceUpdate(); else - WARNING_LOG() << "Cannot force update on Situation Map - map might be stuck!"; + WARNING_LOG(m_logger) << "Cannot force update on Situation Map - map might be stuck!"; if (topicItem.topicType() == TopicEditorBase::TopicType::Situation) { - DEBUG_LOG() << Q_FUNC_INFO << " Situation -> ENable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Situation -> ENable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Cannot enableFireEventFlashing at Situation Map"; } } else { - DEBUG_LOG() << Q_FUNC_INFO << " non-sitmap"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " non-sitmap"; if (topicItem.topicType() == TopicEditorBase::TopicType::Snapshot) { - DEBUG_LOG() << Q_FUNC_INFO << " disable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " disable FireEventFlashing"; if (!enableFireEventFlash(false)) - WARNING_LOG() << Q_FUNC_INFO << " disableFireEventFlashing failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " disableFireEventFlashing failed"; } else if (topicItem.topicType() == TopicEditorBase::TopicType::SituationReplay) { - DEBUG_LOG() << Q_FUNC_INFO << " enable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " enable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " enableFireEventFlashing failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " enableFireEventFlashing failed"; } bool isAvs = isUsingAvsWindow(topicItem.topicType()); @@ -2298,7 +2298,7 @@ void ScriptTimelineDialog::playTopic(int topicItemId) if (!isProjectionWidgetAvailable && !isFreeStandingHackActive && !isAudio && !isReplay) { - DEBUG_LOG() << Q_FUNC_INFO << " Can't use Projection Widget " << topicItem.description(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Can't use Projection Widget " << topicItem.description(); return; } if (!isAvs || (isAvs && !isAudio && isProjectionWidgetAvailable)) @@ -2307,7 +2307,7 @@ void ScriptTimelineDialog::playTopic(int topicItemId) if (!isAvs && isProjectionWidgetAvailable && !getProjectionWidget(projectionWidgetType)->isVisible() && !isFreeStandingHackActive ) { - DEBUG_LOG() << Q_FUNC_INFO << " Can't Widget "<< topicItem.description(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Can't Widget "<< topicItem.description(); return; } replayWidget = topicItem.replayInterface()->createWidget(); @@ -2315,7 +2315,7 @@ void ScriptTimelineDialog::playTopic(int topicItemId) if (isAvs && !getProjectionWidget(projectionWidgetType)->isVisible() && !isFreeStandingHackActive ) { - DEBUG_LOG() << Q_FUNC_INFO << " Can't get AVS Widget "<< topicItem.description(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Can't get AVS Widget "<< topicItem.description(); return; } @@ -2334,13 +2334,13 @@ void ScriptTimelineDialog::playTopic(int topicItemId) } } else - WARNING_LOG() << "topic item with id = " << topicItemId << " has no widget to show on presentation screen" << " NAME: " << topicItem.description(); + WARNING_LOG(m_logger) << "topic item with id = " << topicItemId << " has no widget to show on presentation screen" << " NAME: " << topicItem.description(); } if (topicItem.properties().isEmpty()) { - WARNING_LOG() << "topic item with id " << topicItemId << " has no JSON data"; + WARNING_LOG(m_logger) << "topic item with id " << topicItemId << " has no JSON data"; } @@ -2353,7 +2353,7 @@ void ScriptTimelineDialog::playTopic(int topicItemId) if (!topicItem.replayInterface()->playbackInit(obj)) { - WARNING_LOG() << "playbackInit of topic item with id = " << topicItemId << " failed"; + WARNING_LOG(m_logger) << "playbackInit of topic item with id = " << topicItemId << " failed"; return; } @@ -2371,9 +2371,9 @@ void ScriptTimelineDialog::playTopic(int topicItemId) }); } - DEBUG_LOG() << "playback starts at offset = " << positionTime() / 1000 - topicItem.startTime() / 1000; + DEBUG_LOG(m_logger) << "playback starts at offset = " << positionTime() / 1000 - topicItem.startTime() / 1000; if (!topicItem.replayInterface()->playbackStart(positionTime() / 1000 - topicItem.startTime() / 1000 )) - WARNING_LOG() << "playback of topic item with id = " << topicItemId << " failed"; + WARNING_LOG(m_logger) << "playback of topic item with id = " << topicItemId << " failed"; m_journal.journalList.append( new NextTopicJournal( positionTime() / 1000, topicItem.topicType() == TopicEditorBase::TopicType::Situation, @@ -2383,7 +2383,7 @@ void ScriptTimelineDialog::playTopic(int topicItemId) } catch (...) { - ERROR_LOG() << "playback of topic item with id = " << topicItemId << " failed"; + ERROR_LOG(m_logger) << "playback of topic item with id = " << topicItemId << " failed"; } } @@ -2398,10 +2398,10 @@ void ScriptTimelineDialog::pause() TopicItem &topicItem = m_model->topicItem(topicItemId); if (!topicItem.replayInterface()) { - DEBUG_LOG() << "pausing topic item with id = " << topicItemId << " failed"; + DEBUG_LOG(m_logger) << "pausing topic item with id = " << topicItemId << " failed"; continue; } - DEBUG_LOG() << "pausing topic item with id = " << topicItemId; + DEBUG_LOG(m_logger) << "pausing topic item with id = " << topicItemId; topicItem.replayInterface()->playbackPause(); QString status = tr("Currently paused topic '%1' %2").arg( topicTypeTranslation(topicItem.topicType()), topicItem.description() @@ -2410,7 +2410,7 @@ void ScriptTimelineDialog::pause() } catch (...) { - WARNING_LOG() << "pausing topic item with id = " << topicItemId << " failed"; + WARNING_LOG(m_logger) << "pausing topic item with id = " << topicItemId << " failed"; } } @@ -2461,7 +2461,7 @@ void ScriptTimelineDialog::stop(bool ended, bool ignoreFireEventFlashing) if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->enableFireEventFlashing(true); else - WARNING_LOG() << "Cannot update sit map fire event flashing"; + WARNING_LOG(m_logger) << "Cannot update sit map fire event flashing"; } m_model->setEditable(true); enableTopicEditors(true); @@ -2482,7 +2482,7 @@ qint64 ScriptTimelineDialog::previousTopicTime() const if (time < itemPtr->startTime() && itemPtr->startTime() < positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking audio track for previous topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking audio track for previous topic time failed"; } try { @@ -2490,7 +2490,7 @@ qint64 ScriptTimelineDialog::previousTopicTime() const if (time < itemPtr->startTime() && itemPtr->startTime() < positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking replay track for previous topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking replay track for previous topic time failed"; } try { @@ -2504,7 +2504,7 @@ qint64 ScriptTimelineDialog::previousTopicTime() const if (time < itemPtr->startTime() && itemPtr->startTime() < positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking screen 1 track for previous topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking screen 1 track for previous topic time failed"; } try { @@ -2518,7 +2518,7 @@ qint64 ScriptTimelineDialog::previousTopicTime() const if (time < itemPtr->startTime() && itemPtr->startTime() < positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking screen 2 track for previous topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking screen 2 track for previous topic time failed"; } return time; } @@ -2534,7 +2534,7 @@ qint64 ScriptTimelineDialog::nextTopicTime() const if (time > itemPtr->startTime() && itemPtr->startTime() > positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking audio track for next topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking audio track for next topic time failed"; } try { @@ -2542,7 +2542,7 @@ qint64 ScriptTimelineDialog::nextTopicTime() const if (time > itemPtr->startTime() && itemPtr->startTime() > positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking replay track for next topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking replay track for next topic time failed"; } try { @@ -2556,7 +2556,7 @@ qint64 ScriptTimelineDialog::nextTopicTime() const if (time > itemPtr->startTime() && itemPtr->startTime() > positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking screen 1 track for next topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking screen 1 track for next topic time failed"; } try { @@ -2570,7 +2570,7 @@ qint64 ScriptTimelineDialog::nextTopicTime() const if (time > itemPtr->startTime() && itemPtr->startTime() > positionTime()) time = itemPtr->startTime(); } - catch (...) { WARNING_LOG() << "checking screen 2 track for next topic time failed"; } + catch (...) { WARNING_LOG(m_logger) << "checking screen 2 track for next topic time failed"; } return time == LLONG_MAX ? -1 : time; } @@ -2612,7 +2612,7 @@ void ScriptTimelineDialog::removeTopicItemFromPlaylist(int topicItemId) } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " unknown topic item with id = " << topicItemId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " unknown topic item with id = " << topicItemId; } } @@ -2662,7 +2662,7 @@ void ScriptTimelineDialog::onChangesWereMade() const TopicItem &topicItem = m_model->topicItem(m_currentTopicEditor->topicId()); m_currentTopicEditor->setDuration(topicItem.duration()); } - catch (...) { WARNING_LOG() << "update of length in topic editor failed for topic with id = " << m_currentTopicEditor->topicId(); } + catch (...) { WARNING_LOG(m_logger) << "update of length in topic editor failed for topic with id = " << m_currentTopicEditor->topicId(); } } @@ -2706,7 +2706,7 @@ void ScriptTimelineDialog::onLoad() std::shared_ptr opmDtc; if (!m_exerciseSession->getDtc(opmDtc)) { - ERROR_LOG() << "opm dtc missing for script chooser ..."; + ERROR_LOG(m_logger) << "opm dtc missing for script chooser ..."; return; } ScriptChooser *scriptChooser = new ScriptChooser(m_dtc, m_ftc, opmDtc, false); @@ -2747,7 +2747,7 @@ void ScriptTimelineDialog::onExport() return; const QString exportPath(TakeHomePackageGenerator::ExportProcess::exportPath(m_exerciseSession->exerciseId()) + QString::number(m_scriptId)); - DEBUG_LOG() << "exportPath: " << exportPath; + DEBUG_LOG(m_logger) << "exportPath: " << exportPath; QDir dir(exportPath); if (!dir.exists()) @@ -2762,7 +2762,7 @@ void ScriptTimelineDialog::onExport() if (dir.exists() && !dir.isEmpty()) { - INFO_LOG() << "onExportScript: dir.exists() && !dir.isEmpty()" ; + INFO_LOG(m_logger) << "onExportScript: dir.exists() && !dir.isEmpty()" ; LtsWidgets::Button button = LtsWidgets::LtsMessageDialog::showMessage( this, tr("Specified folder already exists and is not empty. Do you want to overwrite this folder?"), tr("Information: %1").arg(dir.absolutePath()), LtsWidgets::Behaviour::Modal, @@ -2957,17 +2957,17 @@ void ScriptTimelineDialog::onExport2() catch (const ExportError &ee) { new LtsWidgets::LtsMessageDialogNew(this, ee.userMessage); - ERROR_LOG() << "Export failed: " << (ee.logMessage.isEmpty() ? ee.userMessage : ee.logMessage); + ERROR_LOG(m_logger) << "Export failed: " << (ee.logMessage.isEmpty() ? ee.userMessage : ee.logMessage); } catch (const std::exception &ex) { new LtsWidgets::LtsMessageDialogNew(this, defaultErrorMessage); - ERROR_LOG() << "Export failed: " << ex.what(); + ERROR_LOG(m_logger) << "Export failed: " << ex.what(); } catch (...) { new LtsWidgets::LtsMessageDialogNew(this, defaultErrorMessage); - ERROR_LOG() << "Export failed with unknown error!"; + ERROR_LOG(m_logger) << "Export failed with unknown error!"; } mmm->unfreezeMagicCorner(proj1ScreenId); @@ -2999,7 +2999,7 @@ QSet CoolExporter::go() noexcept(false) const int exId = m_this.m_exerciseSession->exerciseId(); const int scriptIdPure = m_this.m_scriptId; - DEBUG_LOG() <<"CoolExporter::go(): exId: "<exerciseId()<<" exName: "<exerciseId()<<" exName: "< CoolExporter::go() noexcept(false) QTemporaryDir tmpDir; - ERROR_LOG() << "##### tmpDir: " << tmpDir.path(); + ERROR_LOG(m_logger) << "##### tmpDir: " << tmpDir.path(); if (!tmpDir.isValid()) { @@ -3065,7 +3065,7 @@ QSet CoolExporter::go() noexcept(false) if (!m_this.m_exerciseSession->getForeignGuiInterface(flmIfc)) { - ERROR_LOG() << "File management interface missing! No file exports possible!"; + ERROR_LOG(m_logger) << "File management interface missing! No file exports possible!"; } @@ -3098,7 +3098,7 @@ QSet CoolExporter::go() noexcept(false) const int id = td.id; const QString &channelName = td.channel; - DEBUG_LOG() << "channel" << channelName << "start" << td.startTime + DEBUG_LOG(m_logger) << "channel" << channelName << "start" << td.startTime << "props" << QString::fromUtf8(QJsonDocument(td.properties).toJson()) << "type" << (int)td.topicType; const QPair thpChannelIdAndThpFilterId = findThpChannelIdAndThpFilterId(channelName); @@ -3230,7 +3230,7 @@ compiler_warning("TODO: percentage? 0-100?") if (filename.isEmpty()) { - WARNING_LOG() << L("Image topic with id %1 and file id %2 doesn't have a file name! Guessing extension jpg :(").arg(id).arg(fileId).toStdString(); + WARNING_LOG(m_logger) << L("Image topic with id %1 and file id %2 doesn't have a file name! Guessing extension jpg :(").arg(id).arg(fileId).toStdString(); return L("jpg"); } @@ -3238,7 +3238,7 @@ compiler_warning("TODO: percentage? 0-100?") if (filenameComponents.length() < 2) { - WARNING_LOG() << L("Image topic with id %1 and file id %2 doesn't have a file extension. Guessing extension jpg :(").arg(id).arg(fileId).toStdString(); + WARNING_LOG(m_logger) << L("Image topic with id %1 and file id %2 doesn't have a file extension. Guessing extension jpg :(").arg(id).arg(fileId).toStdString(); return L("jpg"); } @@ -3294,7 +3294,7 @@ compiler_warning("TODO: percentage? 0-100?") } }; - DEBUG_LOG() << "td id: " << id << ", desc: " << td.description << ", x: " << td.x << ", y: " << td.y; + DEBUG_LOG(m_logger) << "td id: " << id << ", desc: " << td.description << ", x: " << td.x << ", y: " << td.y; QMapIterator it(specificTopicData); while (it.hasNext()) @@ -3310,7 +3310,7 @@ compiler_warning("TODO: percentage? 0-100?") catch (const std::exception &ex) { addFailedTopicId(topicItemId); - ERROR_LOG() << "Unable to export topic with id " << topicItemId << ": " << ex.what(); + ERROR_LOG(m_logger) << "Unable to export topic with id " << topicItemId << ": " << ex.what(); } } @@ -3366,7 +3366,7 @@ compiler_warning("TODO: percentage? 0-100?") setStatusText(tr("Exporting pdf and image files")); - DEBUG_LOG() << "topicItemIdsToExportFile count " << topicItemIdsToExportFile.count(); + DEBUG_LOG(m_logger) << "topicItemIdsToExportFile count " << topicItemIdsToExportFile.count(); for (const ExportFileInfo &efi : topicItemIdsToExportFile) @@ -3374,7 +3374,7 @@ compiler_warning("TODO: percentage? 0-100?") try { - DEBUG_LOG() << "Exporting file with file id " << efi.fileId << " for topic id " << efi.topicId << " and extension " << efi.fileExtension; + DEBUG_LOG(m_logger) << "Exporting file with file id " << efi.fileId << " for topic id " << efi.topicId << " and extension " << efi.fileExtension; QByteArray content; @@ -3392,7 +3392,7 @@ compiler_warning("TODO: percentage? 0-100?") catch (const std::exception &ex) { addFailedTopicId(efi.topicId); - ERROR_LOG() << "File export for topic " << efi.topicId << " failed: " << ex.what(); + ERROR_LOG(m_logger) << "File export for topic " << efi.topicId << " failed: " << ex.what(); } } } @@ -3463,13 +3463,13 @@ compiler_warning("TODO: percentage? 0-100?") connect(exportNotifier, &TopicEditorBase::ExportNotifier::exportFailed, this, [this, &exportSuccess, exportNotifier]() { exportSuccess = false; - ERROR_LOG() << "Export notifier: export failed!"; + ERROR_LOG(m_logger) << "Export notifier: export failed!"; exportNotifier->deleteLater(); }); connect(exportNotifier, &TopicEditorBase::ExportNotifier::exportSuccessful, this, [this, &exportSuccess, exportNotifier]() { exportSuccess = true; - DEBUG_LOG() << "Export notifier: export successful"; + DEBUG_LOG(m_logger) << "Export notifier: export successful"; exportNotifier->deleteLater(); }); connect(exportNotifier, &TopicEditorBase::ExportNotifier::exportFinished, exportNotifier, &QObject::deleteLater, Qt::QueuedConnection); @@ -3513,7 +3513,7 @@ compiler_warning("TODO: percentage? 0-100?") catch (const std::exception &ex) { addFailedTopicId(topicItemId); - ERROR_LOG() << "Report export for topic " << topicItemId << " failed: " << ex.what(); + ERROR_LOG(m_logger) << "Report export for topic " << topicItemId << " failed: " << ex.what(); } } } @@ -3525,7 +3525,7 @@ compiler_warning("TODO: percentage? 0-100?") const int topicItemId = exportReportInfo.first; addFailedTopicId(topicItemId); } - ERROR_LOG() << "Failed to export reports from the report management"; + ERROR_LOG(m_logger) << "Failed to export reports from the report management"; } } @@ -3583,7 +3583,7 @@ compiler_warning("TODO: percentage? 0-100?") QDir xx(avTempDir.path() + QDir::separator() + QString::number(topicItemId)); for (const QString &f : xx.entryList()) x += f; - DEBUG_LOG() << "files inside " << avTempDir.path() << ": " << x.join(QStringLiteral(", ")); + DEBUG_LOG(m_logger) << "files inside " << avTempDir.path() << ": " << x.join(QStringLiteral(", ")); } throw std::runtime_error(L("no video file found in directory '%1' in a/v temp dir '%2'!").arg(QString::number(topicItemId), avTempDir.path()).toStdString()); } @@ -3600,7 +3600,7 @@ compiler_warning("TODO: percentage? 0-100?") catch (const std::exception &ex) { addFailedTopicId(topicItemId); - ERROR_LOG() << "Audio / video export for topic " << topicItemId << " failed: " << ex.what(); + ERROR_LOG(m_logger) << "Audio / video export for topic " << topicItemId << " failed: " << ex.what(); } } } @@ -3788,12 +3788,12 @@ compiler_warning("TODO: percentage? 0-100?") copyFiles(fileList, &m_this); - DEBUG_LOG() << "ExId: " << exId << " ScriptId: " << scriptIdPure << " Name: " << m_this.m_scriptName; + DEBUG_LOG(m_logger) << "ExId: " << exId << " ScriptId: " << scriptIdPure << " Name: " << m_this.m_scriptName; if (exId == -1 || scriptIdPure == -1 || m_this.m_scriptName == QLatin1String("")) { - ERROR_LOG() << "Missing values for writing scripts.js"; + ERROR_LOG(m_logger) << "Missing values for writing scripts.js"; return failedTopicIds; } @@ -3926,7 +3926,7 @@ void ScriptTimelineDialog::onPresentationContent(const GetPresentationContentRep if (contentList.size() == 0) { - WARNING_LOG() << "No content for script with id = " << m_scriptId; + WARNING_LOG(m_logger) << "No content for script with id = " << m_scriptId; __unchange__(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Hide, false); setUnchangeable(false); @@ -3942,8 +3942,8 @@ void ScriptTimelineDialog::onPresentationContent(const GetPresentationContentRep const TopicItem &topicItem = m_model->topicItem(topicItemId); m_lastTopicTime = std::max(m_lastTopicTime, topicItem.startTime() + topicItem.duration()); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } setUnchangeable(false); setPositionTime(0); @@ -4020,7 +4020,7 @@ void ScriptTimelineDialog::startEssentialsView(int topicItemId, int topicType, b } catch (...) { - ERROR_LOG() << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() + ERROR_LOG(m_logger) << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() << " - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); } @@ -4030,7 +4030,7 @@ void ScriptTimelineDialog::startEssentialsView(int topicItemId, int topicType, b if (!found) { new LtsWidgets::LtsMessageDialogNew(this, tr("Cannot start Essentials View because Replay Partition timed out")); - WARNING_LOG() << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() + WARNING_LOG(m_logger) << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() << " - replay partition does not exist - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); rmPartFn(); @@ -4046,14 +4046,14 @@ void ScriptTimelineDialog::onTopicItemPositionChanged(QWidget *previewWidget, in TopicEditorBase::TopicEditor *topicEditor = qobject_cast(sender()); if (!topicEditor) { - WARNING_LOG() << Q_FUNC_INFO << " unknown sender"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " unknown sender"; return; } TopicEditorBase::TopicData data = topicEditor->topicData(); if (data.id == -1) { - WARNING_LOG() << Q_FUNC_INFO << " received invalid topic data from topic editor"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " received invalid topic data from topic editor"; return; } @@ -4115,7 +4115,7 @@ void ScriptTimelineDialog::onTopicItemPositionChanged(QWidget *previewWidget, in connect(topicEditor, &TopicEditor::topicDataChanged, this, [this, topicItemId]() { if(!m_currentTopicDesigner) - ERROR_LOG() << " topicDataChanged: No topic designer currently available "; + ERROR_LOG(m_logger) << " topicDataChanged: No topic designer currently available "; else m_currentTopicDesigner->setTopicData(m_model->topicItem(topicItemId).topicData()); }); @@ -4123,7 +4123,7 @@ void ScriptTimelineDialog::onTopicItemPositionChanged(QWidget *previewWidget, in } catch (...) { - ERROR_LOG() << "topic item with id = " << data.id << " not found"; + ERROR_LOG(m_logger) << "topic item with id = " << data.id << " not found"; } } @@ -4132,14 +4132,14 @@ void ScriptTimelineDialog::onCheckTopicItemDuration(int duration, LtsUtils::Prom { if (!m_model->isEditable()) { - ERROR_LOG() << Q_FUNC_INFO << " failed because model is currently not editable"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed because model is currently not editable"; promise->reject(); } TopicEditorBase::TopicEditor *topicEditor = qobject_cast(sender()); if (!topicEditor) { - ERROR_LOG() << Q_FUNC_INFO << " sender is not a TopicEditor"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " sender is not a TopicEditor"; new LtsWidgets::LtsMessageDialogNew(this, tr("A check has failed...")); promise->reject(); return; @@ -4162,13 +4162,13 @@ void ScriptTimelineDialog::onCheckTopicItemDuration(int duration, LtsUtils::Prom } catch (const QString &str) { - DEBUG_LOG() << Q_FUNC_INFO << " " << str; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " " << str; promise->resolve(); } catch (...) { - DEBUG_LOG() << Q_FUNC_INFO << " failed for topic item with id = " << topicEditor->topicId(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed for topic item with id = " << topicEditor->topicId(); promise->resolve(); } } @@ -4179,13 +4179,13 @@ void ScriptTimelineDialog::onTopicItemModified() TopicEditorBase::TopicEditor *topicEditor = qobject_cast(sender()); if (!topicEditor) { - WARNING_LOG() << Q_FUNC_INFO << " unknown sender"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " unknown sender"; return; } if (!m_model->isEditable()) { - INFO_LOG() << Q_FUNC_INFO << " called but model is not editable"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " called but model is not editable"; onUpdateTopicEditor(topicEditor->topicId()); return; } @@ -4223,7 +4223,7 @@ void ScriptTimelineDialog::onTopicItemModified() } catch (...) { - DEBUG_LOG() << "unknown topic item with id = " << topicItemId; + DEBUG_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } onChangesMade(); } @@ -4238,8 +4238,8 @@ void ScriptTimelineDialog::onTopicItemRemoved(int topicItemId) { m_model->removeItem(topicItemId); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } if (m_currentTopicEditor && m_currentTopicEditor->topicId() == topicItemId) { @@ -4285,8 +4285,8 @@ void ScriptTimelineDialog::onTopicItemSelectionChanged(const QVector &selec } m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Edit, selectedItemIds.size() == 1); } - catch (const QString &errMsg) { WARNING_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { DEBUG_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { WARNING_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } @@ -4308,8 +4308,8 @@ void ScriptTimelineDialog::onUpdateTopicEditor(int topicItemId) topicEditor->setTopicData(topicItem.topicData()); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << topicItemId; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << topicItemId; } } @@ -4317,7 +4317,7 @@ void ScriptTimelineDialog::onTopicDesignerChangesMade() { if (!m_currentTopicDesigner) { - ERROR_LOG() << Q_FUNC_INFO << " failed because no topic designer currently available"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed because no topic designer currently available"; return; } @@ -4336,14 +4336,14 @@ void ScriptTimelineDialog::onTopicDesignerChangesMade() if(!m_modifiedTopicTypesList.contains(data.topicType)) m_modifiedTopicTypesList.append(data.topicType); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } void ScriptTimelineDialog::onTopicEditorChangesSaved(const TopicData &data) { - WARNING_LOG()<<" onTopicEditorChangesSaved(): Reset previewTopic modify flag."; + WARNING_LOG(m_logger)<<" onTopicEditorChangesSaved(): Reset previewTopic modify flag."; if(m_modifiedTopicTypesList.contains(data.topicType)) try{ m_modifiedTopicTypesList.removeAll(data.topicType); } catch(...){}; @@ -4409,7 +4409,7 @@ void ScriptTimelineDialog::onEditTopicItem(int itemId) TopicEditorBase::TopicEditor *editor = createTopicEditor(data); if (!editor) { - ERROR_LOG() << "cannot create topic editor for topic item with id = " << data.id; + ERROR_LOG(m_logger) << "cannot create topic editor for topic item with id = " << data.id; return; } @@ -4419,8 +4419,8 @@ void ScriptTimelineDialog::onEditTopicItem(int itemId) addDialog(editor, m_menuGroup, identifier, LtsWidgets::LayoutArea::eDialogTab, true, true ); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << itemId; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << itemId; } } @@ -4443,8 +4443,8 @@ void ScriptTimelineDialog::onRemoveSelectedTopics() } m_model->removeItem(topicItemId); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } for (const int &topicItemId : std::as_const(mainTopicItemIds)) { @@ -4452,8 +4452,8 @@ void ScriptTimelineDialog::onRemoveSelectedTopics() { m_model->removeItem(topicItemId); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } m_ui->timeline->view()->clearSelectedItems(); } @@ -4502,7 +4502,7 @@ void ScriptTimelineDialog::onTimeout() } catch (...) { - WARNING_LOG() << "unknown topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } m_playlistTopicItemIds = playlist; @@ -4520,7 +4520,7 @@ void ScriptTimelineDialog::onTimeout() } catch (...) { - WARNING_LOG() << "unknown topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } @@ -4542,7 +4542,7 @@ void ScriptTimelineDialog::onTimeout() } catch (...) { - WARNING_LOG() << "unknown topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } if (m_stopAfterPlayingFilterTopic) @@ -4670,7 +4670,7 @@ void ScriptTimelineDialog::onPlay() } catch (...) { - WARNING_LOG() << "unknown topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } m_playlistTopicItemIds = playlist; @@ -4681,26 +4681,26 @@ void ScriptTimelineDialog::onPlay() TopicItem &topicItem = m_model->topicItem(topicItemId); if (topicItemId != m_ignoreTopicForReplay && topicItem.replayInterface()) { - DEBUG_LOG() << "start/resume playback with offset = " << positionTime() / 1000 - topicItem.startTime() / 1000; + DEBUG_LOG(m_logger) << "start/resume playback with offset = " << positionTime() / 1000 - topicItem.startTime() / 1000; if (!topicItem.replayInterface()->playbackStart(positionTime() / 1000 - topicItem.startTime() / 1000)) - WARNING_LOG() << "playing topic item with id = " << topicItemId << " failed"; + WARNING_LOG(m_logger) << "playing topic item with id = " << topicItemId << " failed"; } if (topicItem.topicType() == TopicEditorBase::TopicType::Snapshot) { - DEBUG_LOG() << Q_FUNC_INFO << " disable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " disable FireEventFlashing"; if (!enableFireEventFlash(false)) - WARNING_LOG() << Q_FUNC_INFO << " disableFireEventFlashing failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " disableFireEventFlashing failed"; } else if (topicItem.topicType() == TopicEditorBase::TopicType::SituationReplay) { - DEBUG_LOG() << Q_FUNC_INFO << " enable FireEventFlashing"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " enable FireEventFlashing"; if (!enableFireEventFlash(true)) - WARNING_LOG() << Q_FUNC_INFO << " enableFireEventFlashing failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " enableFireEventFlashing failed"; } } catch (...) { - WARNING_LOG() << "unknown topic item with id = " << topicItemId; + WARNING_LOG(m_logger) << "unknown topic item with id = " << topicItemId; } } m_nextPauseTime = -1; @@ -4751,7 +4751,7 @@ void ScriptTimelineDialog::onPause() if (m_sitMapSession->getForeignGuiInterface(sitMapIfc)) sitMapIfc->enableFireEventFlashing(false); else - WARNING_LOG() << "Cannot update sit map fire event flashing"; + WARNING_LOG(m_logger) << "Cannot update sit map fire event flashing"; } @@ -4794,7 +4794,7 @@ void ScriptTimelineDialog::onPlayUntilNextTopic() qint64 time = nextTopicTime(); if (time < 0) { - DEBUG_LOG() << "There is no next topic to play until!"; + DEBUG_LOG(m_logger) << "There is no next topic to play until!"; return; } m_nextPauseTime = time; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.h index 02eb73b5e..ec4c37bea 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_dialog.h @@ -218,7 +218,7 @@ private: if (!m_exerciseSession->interfaceFromGui(topicEditorIfc)) { - ERROR_LOG() << "getTopicEditorIfc failed: Cannot add topic type " + ERROR_LOG(m_logger) << "getTopicEditorIfc failed: Cannot add topic type " << TopicEditorBase::topicTypeString(topicType) << " because topic editor ifc is missing."; return nullptr; @@ -234,7 +234,7 @@ private: if (!m_replaySession->interfaceFromGui(topicReplayFactory)) { - ERROR_LOG() << "getTopicIfcFactory failed: Cannot add topic type " + ERROR_LOG(m_logger) << "getTopicIfcFactory failed: Cannot add topic type " << TopicEditorBase::topicTypeString(topicType) << " because topic ifc factory is missing."; return nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.cpp index 792732359..923ee38ce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.cpp @@ -164,8 +164,8 @@ int ScriptModel::addItem(const QString &trackName, TopicItem &&_topicItem, qint6 return lambda(m_screen2TrackId, std::move(_topicItem)); } } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with trackName = " << trackName << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with trackName = " << trackName << " failed"; } return -1; } @@ -216,8 +216,8 @@ std::vector ScriptModel::topicItems() const for (const ItemPtr &_itemPtr: _trackPtr->items()) ret.push_back(static_cast(*_itemPtr.get()).copy()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return ret; } @@ -243,11 +243,11 @@ std::vector ScriptModel::topicItemsByTrackId(int trackId) const } catch (const QString &errMsg) { - ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return ret; @@ -279,8 +279,8 @@ QVector ScriptModel::mainTopicItemIds() const for (const ItemPtr &_itemPtr: _screen2Track.items()) ret.append(_itemPtr->id()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return ret; } @@ -344,8 +344,8 @@ QVector ScriptModel::filterTopicItemIds() const for (const ItemPtr &_itemPtr: _trackPtr->items()) ret.append(_itemPtr->id()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return ret; } @@ -363,8 +363,8 @@ QVector ScriptModel::filterTopicItemIds(int _topicItemId) const if (_trackPtr->isItemsBetween(_topicItem.startTime(), end, {})) ret += _trackPtr->itemIdsBetween(_topicItem.startTime(), end, false, true); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return ret; } @@ -402,8 +402,8 @@ qint64 ScriptModel::firstTopicStart() const firstStart = std::min(firstStart, time); } } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return firstStart == LLONG_MAX ? -1 : firstStart; } @@ -428,8 +428,8 @@ qint64 ScriptModel::lastTopicEnd() const if (time != -1) lastEnd = std::max(lastEnd, time); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return lastEnd; } @@ -460,7 +460,7 @@ bool ScriptModel::isMainTrack(int _trackId) const { return track(_trackId).parentId() == m_rootTrack.id(); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } catch (...) {} return false; } @@ -476,7 +476,7 @@ bool ScriptModel::isFilterTrack(int _trackId) const { return track(_trackId).parentId() != m_rootTrack.id(); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } catch (...) {} return false; } @@ -676,12 +676,12 @@ bool ScriptModel::import(const QVector &contents) noexcept( } catch (const QString &errMsg) { - ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; return false; } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; return false; } } @@ -706,12 +706,12 @@ bool ScriptModel::import(const QVector &contents) noexcept( } catch (const QString &errMsg) { - ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; return false; } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; return false; } @@ -763,8 +763,8 @@ void ScriptModel::insertTopicItem(int _trackId, TopicItem &&__topicItem) if (isFilterTrack(_topicTrack.id())) _topicItem.setParentChannel(static_cast(track(_topicTrack.parentId())).internalName()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } @@ -926,8 +926,8 @@ bool ScriptModel::canDropItem(const Item &_item, int _trackId, qint64 start) con return !isTopicItemBlocked(_topicItem, static_cast(track(_trackId)), start, _topicItem.duration()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } return false; } @@ -980,8 +980,8 @@ bool ScriptModel::canMoveItem(const Item &_item, qint64 start) const static_cast(_item), static_cast(track(_item.parentTrackId())), start, _item.duration() ); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << _item.id(); } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << _item.id(); } return false; } @@ -1050,8 +1050,8 @@ bool ScriptModel::canResizeItem(const Item &_item, qint64 start, int duration) c static_cast(_item), static_cast(track(_item.parentTrackId())), start, duration ); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << _item.id(); } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << _item.id(); } return false; } @@ -1068,7 +1068,7 @@ void ScriptModel::copyToClipboard(const QVector &_itemIds) noexcept(false) _topicItemPtr->m_parentTrackId = _topicItem.m_parentTrackId; minTime = std::min(minTime, _topicItem.startTime()); m_clipboard.push_back(std::move(_topicItemPtr)); - DEBUG_LOG() << Q_FUNC_INFO << " copied item with id = " << _topicItem.id() << " to clipboard"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " copied item with id = " << _topicItem.id() << " to clipboard"; }; for (int _topicItemId : _itemIds) @@ -1181,8 +1181,8 @@ void ScriptModel::pasteFromClipboard(qint64 time) noexcept(false) _topicItem.setTopicId(_itemId); _topicItem.topicData().startTime = _topicItem.startTime() / 1000LL; } - catch (const QString &errMsg) { ERROR_LOG() << "adding item failed: " << errMsg; } - catch (...) { ERROR_LOG() << "adding item failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "adding item failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << "adding item failed"; } } m_clipboard.clear(); @@ -1214,12 +1214,12 @@ ScriptModel::PasteTestResult ScriptModel::canPasteFromClipboard(qint64 time) con } catch (const QString &errMsg) { - ERROR_LOG() << "checking for collision failed: " << errMsg; + ERROR_LOG(m_logger) << "checking for collision failed: " << errMsg; return PasteTestResult::No; } catch (...) { - ERROR_LOG() << "checking for collision failed"; + ERROR_LOG(m_logger) << "checking for collision failed"; return PasteTestResult::No; } } @@ -1386,7 +1386,7 @@ bool ScriptModel::canDropTopicType(TopicType _topicType, int _trackId) const } return true; } - catch (const QString &errMsg) { ERROR_LOG() << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << errMsg; } catch (...) {} return false; } @@ -1469,8 +1469,8 @@ bool ScriptModel::isTopicItemBlocked(const TopicItem &_topicItem, const TopicTra return false; } } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for itemId = " << _topicItem.id() << " and trackId = " << _topicTrack.id(); } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for itemId = " << _topicItem.id() << " and trackId = " << _topicTrack.id(); } return false; } @@ -1500,8 +1500,8 @@ void ScriptModel::getActualFilterTopicRange(int parentTrackId, TopicItem &_topic if (_topicItem.startTime() + _topicItem.duration() > _mainTopicAtItemEnd.startTime() + _mainTopicAtItemEnd.duration()) _topicItem.setDuration(_mainTopicAtItemEnd.startTime() + _mainTopicAtItemEnd.duration() - _topicItem.startTime()); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for parentTrackId = " << parentTrackId; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for parentTrackId = " << parentTrackId; } } @@ -1524,8 +1524,8 @@ void ScriptModel::onInsertTrack(const QModelIndex &idx) emit dataChanged(idx, idx); m_dialog->timeline()->view()->expand(idx); } - catch (const QString &errMsg) { ERROR_LOG() << errMsg; } - catch (...) { ERROR_LOG() << "Adding child track to track with id = " << idx.internalId() << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << errMsg; } + catch (...) { ERROR_LOG(m_logger) << "Adding child track to track with id = " << idx.internalId() << " failed"; } } void ScriptModel::onRemoveTrack(const QModelIndex &idx) @@ -1554,8 +1554,8 @@ void ScriptModel::onRemoveTrack(const QModelIndex &idx) } emit dataChanged(parentIndex, parentIndex); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.h index 47fafa8a0..7dc92feef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_script_model.h @@ -117,6 +117,8 @@ public: bool canDropTopicType(TopicType _topicType, int _trackId) const; private: + +NGL::INGLLogger &m_logger; bool isTopicItemBlocked(const TopicItem &_topicItem, const TopicTrack &_topicTrack, qint64 start, int duration) const; void getActualFilterTopicRange(int parentTrackId, TopicItem &_topicItem) const noexcept(false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_storyboard.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_storyboard.h index e59b474bb..fbea3a345 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_storyboard.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_storyboard.h @@ -43,6 +43,7 @@ public slots: void onPrint(); void onColumnWidthChanged(); private: +NGL::INGLLogger &m_logger; LtsSession::LtsSession *m_session; std::vector m_topicItems; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.cpp index 44b482689..4085d82af 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.cpp @@ -26,15 +26,14 @@ static QString s_program(L("ffmpeg")); TopicRecorder::TopicRecorder(const int topicId, const QString &topicName, const Screen *screen, qint32 offset, qint64 startTime, qint64 stopTime, const double topicX, const double topicY, - const double topicW, const double topicH, QObject *parent) - : QObject(parent) + const double topicW, const double topicH, QObject *parent) : QObject(parent) , m_recordingProcess(new QProcess(this)) , m_startTime(startTime) , m_stopTime(stopTime) , m_topicName(topicName) , m_topicId(topicId) - , m_length((m_stopTime - (m_startTime - offset)) / 1000) -{ + , m_length((m_stopTime - (m_startTime - offset)) / 1000), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { const auto screenGlobalPos = screen->mapToGlobal({0,0}); const auto screenGeo = screen->geometry(); @@ -53,20 +52,20 @@ TopicRecorder::TopicRecorder(const int topicId, const QString &topicName, const const qint32 inputW = (qint32)(fullscreen ? screenW : screenW * topicW); const qint32 inputH = (qint32)(fullscreen ? screenH : screenH * topicH); - ERROR_LOG() << "TopicRecorder: fullscreen? " << fullscreen; - ERROR_LOG() << "TopicRecorder: topic - x: " << topicX << ", y: " << topicY << ", w: " << topicW << ", h: " << topicH; - ERROR_LOG() << "TopicRecorder: screen - x: " << screenX << ", y: " << screenY << ", w: " << screenW << ", h: " << screenH; - ERROR_LOG() << "TopicRecorder: input - x: " << inputX << ", y: " << inputY << ", w: " << inputW << ", h: " << inputH; + ERROR_LOG(m_logger) << "TopicRecorder: fullscreen? " << fullscreen; + ERROR_LOG(m_logger) << "TopicRecorder: topic - x: " << topicX << ", y: " << topicY << ", w: " << topicW << ", h: " << topicH; + ERROR_LOG(m_logger) << "TopicRecorder: screen - x: " << screenX << ", y: " << screenY << ", w: " << screenW << ", h: " << screenH; + ERROR_LOG(m_logger) << "TopicRecorder: input - x: " << inputX << ", y: " << inputY << ", w: " << inputW << ", h: " << inputH; if (!m_tmpRecordingFile.open()) throw std::runtime_error(L("Failed to open temporary recording file: %1").arg(m_tmpRecordingFile.errorString()).toStdString()); m_recordingProcess->setProgram(s_program); m_recordingProcess->setArguments(L("-hide_banner -f x11grab -s %1x%2 -i :0.0+%3,%4 -c:v libx264 -y -map 0 -movflags +faststart -f %5 %6").arg(inputW).arg(inputH).arg(inputX).arg(inputY).arg(s_container).arg(m_tmpRecordingFile.fileName()).split(L(" "))); - ERROR_LOG() << "args: " << m_recordingProcess->arguments().join(L(" ")); - connect(m_recordingProcess, &QProcess::readyReadStandardOutput, [this]() { ERROR_LOG() << "REC [ ]: " << QString::fromUtf8(m_recordingProcess->readAllStandardOutput()); }); - connect(m_recordingProcess, &QProcess::readyReadStandardError, [this]() { ERROR_LOG() << "REC [!]: " << QString::fromUtf8(m_recordingProcess->readAllStandardError()); }); - connect(m_recordingProcess, &QProcess::started, [this]() { ERROR_LOG() << "REC started successfully!"; }); + ERROR_LOG(m_logger) << "args: " << m_recordingProcess->arguments().join(L(" ")); + connect(m_recordingProcess, &QProcess::readyReadStandardOutput, [this]() { ERROR_LOG(m_logger) << "REC [ ]: " << QString::fromUtf8(m_recordingProcess->readAllStandardOutput()); }); + connect(m_recordingProcess, &QProcess::readyReadStandardError, [this]() { ERROR_LOG(m_logger) << "REC [!]: " << QString::fromUtf8(m_recordingProcess->readAllStandardError()); }); + connect(m_recordingProcess, &QProcess::started, [this]() { ERROR_LOG(m_logger) << "REC started successfully!"; }); if (!m_tmpCuttingFile.open()) throw std::runtime_error(L("Failed to open temporary cutting file: %1").arg(m_tmpCuttingFile.errorString()).toStdString()); @@ -96,11 +95,11 @@ void TopicRecorder::cut() cuttingProcess->setProgram(s_program); cuttingProcess->setArguments(L("-hide_banner -y -sseof -%1 -i %2 -c:v libx264 -f %3 %4").arg(m_length).arg(m_tmpRecordingFile.fileName(), s_container, m_tmpCuttingFile.fileName()).split(L(" "))); - connect(cuttingProcess, &QProcess::readyReadStandardOutput, this, [this, cuttingProcess]() { ERROR_LOG() << "CUT [ ]: " << QString::fromUtf8(cuttingProcess->readAllStandardOutput()); }); - connect(cuttingProcess, &QProcess::readyReadStandardError, this, [this, cuttingProcess]() { ERROR_LOG() << "CUT [!]: " << QString::fromUtf8(cuttingProcess->readAllStandardError()); }); - connect(cuttingProcess, &QProcess::started, this, [this]() { ERROR_LOG() << "CUT started successfully!"; }); + connect(cuttingProcess, &QProcess::readyReadStandardOutput, this, [this, cuttingProcess]() { ERROR_LOG(m_logger) << "CUT [ ]: " << QString::fromUtf8(cuttingProcess->readAllStandardOutput()); }); + connect(cuttingProcess, &QProcess::readyReadStandardError, this, [this, cuttingProcess]() { ERROR_LOG(m_logger) << "CUT [!]: " << QString::fromUtf8(cuttingProcess->readAllStandardError()); }); + connect(cuttingProcess, &QProcess::started, this, [this]() { ERROR_LOG(m_logger) << "CUT started successfully!"; }); - ERROR_LOG() << "start cut"; + ERROR_LOG(m_logger) << "start cut"; cuttingProcess->start(); @@ -119,7 +118,7 @@ void TopicRecorder::cut() } catch (...) { - ERROR_LOG() << "cut failed (error) with exitCode=" << cuttingProcess->exitCode() << " and exitStatus=" << (cuttingProcess->exitStatus() == QProcess::ExitStatus::CrashExit ? "Crash" : "Normal Exit"); + ERROR_LOG(m_logger) << "cut failed (error) with exitCode=" << cuttingProcess->exitCode() << " and exitStatus=" << (cuttingProcess->exitStatus() == QProcess::ExitStatus::CrashExit ? "Crash" : "Normal Exit"); m_failed = true; cuttingProcess->deleteLater(); return; @@ -127,14 +126,14 @@ void TopicRecorder::cut() if (cuttingProcess->exitCode() != 0) { - ERROR_LOG() << "cut failed with non-zero exitCode=" << cuttingProcess->exitCode() << " and exitStatus=" << (cuttingProcess->exitStatus() == QProcess::ExitStatus::CrashExit ? "Crash" : "Normal Exit"); + ERROR_LOG(m_logger) << "cut failed with non-zero exitCode=" << cuttingProcess->exitCode() << " and exitStatus=" << (cuttingProcess->exitStatus() == QProcess::ExitStatus::CrashExit ? "Crash" : "Normal Exit"); m_failed = true; cuttingProcess->deleteLater(); return; } - ERROR_LOG() << "cut done"; + ERROR_LOG(m_logger) << "cut done"; cuttingProcess->deleteLater(); } @@ -173,7 +172,7 @@ void TopicRecorder::onExportFailed(const QProcess::ProcessError error) void TopicRecorder::onExportFailed(const QString &errorMessage) { - ERROR_LOG() << "Export failed for topic '" << m_topicName << "': " << errorMessage; + ERROR_LOG(m_logger) << "Export failed for topic '" << m_topicName << "': " << errorMessage; emit exportFailed(errorMessage); } @@ -214,16 +213,16 @@ void TopicRecorder::waitForFinishedRecording() } catch (...) { - ERROR_LOG() << "waitForFinishedRecording: catch!"; + ERROR_LOG(m_logger) << "waitForFinishedRecording: catch!"; } - ERROR_LOG() << "waitForFinishedRecording: done waiting!"; + ERROR_LOG(m_logger) << "waitForFinishedRecording: done waiting!"; } void TopicRecorder::onNewTime(qint64 time) { - ERROR_LOG() << "onNewTime: " << time << ", startTime: " << m_startTime; + ERROR_LOG(m_logger) << "onNewTime: " << time << ", startTime: " << m_startTime; switch (m_recordingState) { @@ -231,9 +230,9 @@ void TopicRecorder::onNewTime(qint64 time) if (time < m_startTime) return; - ERROR_LOG() << "onNewTime: started at " << time << " while startTime is " << m_startTime; + ERROR_LOG(m_logger) << "onNewTime: started at " << time << " while startTime is " << m_startTime; - ERROR_LOG() << "Starting \"" << processToString(m_recordingProcess) << "\""; + ERROR_LOG(m_logger) << "Starting \"" << processToString(m_recordingProcess) << "\""; m_recordingProcess->start(); @@ -244,7 +243,7 @@ void TopicRecorder::onNewTime(qint64 time) if (time < m_stopTime) return; - ERROR_LOG() << "Stopping recording for " << m_topicName; + ERROR_LOG(m_logger) << "Stopping recording for " << m_topicName; m_recordingProcess->terminate(); @@ -261,7 +260,7 @@ void TopicRecorder::onNewTime(qint64 time) void TopicRecorder::onRecordingProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) { m_recordingState = RecordingState::Done; - ERROR_LOG() << "Recording finished for " << m_topicName << ", with exitCode=" << exitCode << " and exitStatus=" << exitStatus; + ERROR_LOG(m_logger) << "Recording finished for " << m_topicName << ", with exitCode=" << exitCode << " and exitStatus=" << exitStatus; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.h index 712b1dbdc..373cf88ea 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_recorder.h @@ -44,6 +44,8 @@ public Q_SLOTS: void onNewTime(qint64 time); private: + +NGL::INGLLogger &m_logger; enum class RecordingState { Waiting, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.cpp index f57859c18..913873803 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.cpp @@ -14,8 +14,7 @@ namespace PresentationManagement TopicShotter::TopicShotter(const int topicId, const QString &topicName, const Screen *screen, qint32 offset, qint64 startTime, qint64 stopTime, const double topicX, const double topicY, - const double topicW, const double topicH, const bool isFilterTopic, const QString &desc, QObject *parent) - : QObject(parent) + const double topicW, const double topicH, const bool isFilterTopic, const QString &desc, QObject *parent) : QObject(parent) , m_startTime(startTime) , m_topicName(topicName) , m_topicId(topicId) @@ -25,8 +24,8 @@ TopicShotter::TopicShotter(const int topicId, const QString &topicName, const Sc , m_topicW(topicW) , m_topicH(topicH) , m_desc(desc) - , m_isFilterTopic(isFilterTopic) -{} + , m_isFilterTopic(isFilterTopic), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} TopicShotter::~TopicShotter() @@ -48,7 +47,7 @@ void TopicShotter::saveRecording(const QString &saveToPath) void TopicShotter::onExportFailed(const QString &errorMessage) { - ERROR_LOG() << "Export failed for topic '" << m_topicName << "': " << errorMessage; + ERROR_LOG(m_logger) << "Export failed for topic '" << m_topicName << "': " << errorMessage; emit exportFailed(errorMessage); } @@ -59,7 +58,7 @@ void TopicShotter::onNewTime(qint64 time) const qint64 filterTopicDelay = (m_isFilterTopic ? 1000 : 0); const qint64 startTime = m_startTime + filterTopicDelay + 1000 ; - DEBUG_LOG() << "onNewTime: " << time << ", startTime: " << startTime << ", isFilterTopic? " << m_isFilterTopic << ", desc: " << m_desc; + DEBUG_LOG(m_logger) << "onNewTime: " << time << ", startTime: " << startTime << ", isFilterTopic? " << m_isFilterTopic << ", desc: " << m_desc; if (time < startTime) return; @@ -68,7 +67,7 @@ void TopicShotter::onNewTime(qint64 time) return; isStarted = true; - DEBUG_LOG() << "onNewTime: started at " << time << " while startTime is " << startTime; + DEBUG_LOG(m_logger) << "onNewTime: started at " << time << " while startTime is " << startTime; if (!m_tmpFile.open()) { @@ -101,7 +100,7 @@ void TopicShotter::onNewTime(qint64 time) connect(t, &QTimer::timeout, this, [this, inputX, inputY, inputW, inputH, _screen]() { const WId winId = m_screen->winId(); - DEBUG_LOG() << "## CHEESE! ## grabWindow: x: " << inputX << ", y: " << inputY << ", w: " << inputW << ", h: " << inputH << ", name: " << m_topicName << ", id: " << m_topicId << ", desc: " << m_desc; + DEBUG_LOG(m_logger) << "## CHEESE! ## grabWindow: x: " << inputX << ", y: " << inputY << ", w: " << inputW << ", h: " << inputH << ", name: " << m_topicName << ", id: " << m_topicId << ", desc: " << m_desc; const QPixmap pix = _screen->grabWindow(winId, inputX, inputY, inputW, inputH); if (!pix.save(&m_tmpFile, "PNG")) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.h index 1985dd24c..9a43de7bc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/PresentationManagement/Gui/Script/ScriptTimelineEditor/pre_topic_shotter.h @@ -41,6 +41,8 @@ private Q_SLOTS: void onExportFailed(const QString &errorMessage); private: + +NGL::INGLLogger &m_logger; const qint64 m_startTime; const QString m_topicName; QTemporaryFile m_tmpFile; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.cpp index 54270257d..b6d28c8c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.cpp @@ -61,10 +61,10 @@ bool VncHandler::handleData(QDataStream &stream) if (handleVersion(version)) { setNextExpectedMessageType(RfbProtocol::STC::RFB_SUP_SECURITY_TYPES); - DEBUG_LOG() << "RfbVersion handled Successfully!"; + DEBUG_LOG(m_logger) << "RfbVersion handled Successfully!"; return true; } - ERROR_LOG() << "RfbVersion handshake Error!"; + ERROR_LOG(m_logger) << "RfbVersion handshake Error!"; break; } @@ -78,10 +78,10 @@ bool VncHandler::handleData(QDataStream &stream) if (handleSupportedSecurityTypes(supTypes)) { setNextExpectedMessageType(RfbProtocol::STC::RFB_VNC_AUTHENTICATION); - DEBUG_LOG() << "RfbSecurityType handled Successfully!"; + DEBUG_LOG(m_logger) << "RfbSecurityType handled Successfully!"; return true; } - ERROR_LOG() << "RfbSecurityType handshake Error!"; + ERROR_LOG(m_logger) << "RfbSecurityType handshake Error!"; break; } @@ -95,10 +95,10 @@ bool VncHandler::handleData(QDataStream &stream) if (handleVncAuthentication(auth)) { setNextExpectedMessageType(RfbProtocol::STC::RFB_SECURITY_RESULT); - DEBUG_LOG() << "RfbVncAuthentication handled Successfully!"; + DEBUG_LOG(m_logger) << "RfbVncAuthentication handled Successfully!"; return true; } - ERROR_LOG() << "RfbVncAuthentication Error!"; + ERROR_LOG(m_logger) << "RfbVncAuthentication Error!"; break; } @@ -112,10 +112,10 @@ bool VncHandler::handleData(QDataStream &stream) if (handleSecurityResult(result)) { setNextExpectedMessageType(RfbProtocol::STC::RFB_SERVER_INIT); - DEBUG_LOG() << "RfbSecurityResult handled Successfully!"; + DEBUG_LOG(m_logger) << "RfbSecurityResult handled Successfully!"; return true; } - ERROR_LOG() << "RfbSecurityResult Error!"; + ERROR_LOG(m_logger) << "RfbSecurityResult Error!"; break; } @@ -140,7 +140,7 @@ bool VncHandler::handleData(QDataStream &stream) emit connected(); m_socket->write(RfbProtocol::CTS::RfbFrameBufferUpdateRequest(false, 0, 0, 1920, 1200)); setNextExpectedMessageType(RfbProtocol::STC::RFB_FRAMEBUFFER_UPDATE); - DEBUG_LOG() << "RfbServerInit handled Successfully!"; + DEBUG_LOG(m_logger) << "RfbServerInit handled Successfully!"; } return true; } @@ -155,7 +155,7 @@ bool VncHandler::handleData(QDataStream &stream) stream.startTransaction(); quint8 msgType; stream >> msgType; - DEBUG_LOG() << "got message from server: " << QString::number(msgType, 16); + DEBUG_LOG(m_logger) << "got message from server: " << QString::number(msgType, 16); switch (msgType) { case RfbProtocol::STC::RFB_FRAMEBUFFER_UPDATE: @@ -167,7 +167,7 @@ bool VncHandler::handleData(QDataStream &stream) case RfbProtocol::STC::RFB_SERVER_CUTTEXT: return handleServerCuttext(stream); default: - WARNING_LOG() << "Unknown message type from server (" << QString::number(msgType, 16) << ") - reconnecting"; + WARNING_LOG(m_logger) << "Unknown message type from server (" << QString::number(msgType, 16) << ") - reconnecting"; stream.abortTransaction(); slotOnDisconnected(); return false; @@ -241,7 +241,7 @@ void VncHandler::writeData(const QByteArray &data) void VncHandler::error() { - ERROR_LOG() << "SocketError " << m_socket->errorString(); + ERROR_LOG(m_logger) << "SocketError " << m_socket->errorString(); } void VncHandler::resetHandler() @@ -261,7 +261,7 @@ bool VncHandler::handleVersion(const RfbProtocol::STC::RfbVersion &version) version.minorVersion())); return true; } - ERROR_LOG() << "Unsupported Version: " << version.majorVersion() << "." << version.minorVersion(); + ERROR_LOG(m_logger) << "Unsupported Version: " << version.majorVersion() << "." << version.minorVersion(); return false; } @@ -276,7 +276,7 @@ bool VncHandler::handleSupportedSecurityTypes(const RfbProtocol::STC::RfbSupport for (quint8 type : supportedTypes.types()) typesString.append(QString::number(type)).append(QLatin1Char(' ')); if (typesString.isEmpty()) typesString = QStringLiteral("EMPTY"); - ERROR_LOG() << "Unsupported Security Types: " << typesString; + ERROR_LOG(m_logger) << "Unsupported Security Types: " << typesString; return false; } @@ -327,7 +327,7 @@ bool VncHandler::handleSecurityResult(const RfbProtocol::STC::RfbSecurityResult } else { - ERROR_LOG() << result.reason(); + ERROR_LOG(m_logger) << result.reason(); return false; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.h index 0149794f6..bad42fc3d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Common/pws_vnc_handler.h @@ -39,6 +39,8 @@ private slots: void error(); private: + +NGL::INGLLogger &m_logger; bool handleData(QDataStream &stream); bool handleFrameBufferUpdate(QDataStream &stream); bool handleSetColormap(QDataStream &stream); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_control_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_control_dialog.cpp index 69299546b..e64f7183e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_control_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_control_dialog.cpp @@ -137,7 +137,7 @@ bool ControlDialog::init(LtsSession::LtsSession *session, if (info.addresses().size() > 0) m_host = info.addresses().at(0); else - ERROR_LOG() << "Address for host " << m_ui->cbxWorkstations->currentText() << " not found!"; + ERROR_LOG(m_logger) << "Address for host " << m_ui->cbxWorkstations->currentText() << " not found!"; } return true; } @@ -160,7 +160,7 @@ void ControlDialog::aboutToClose() void ControlDialog::slotOnConnectClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this; if (!m_isConnected) { initWebSocketHandler(); @@ -178,9 +178,9 @@ void ControlDialog::slotOnConnectClicked() m_webSocketClient->webSocket()->close(); } } - DEBUG_LOG() << Q_FUNC_INFO << " connect clicked, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " connect clicked, this=" << this; updateConnectButton(); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this; } void ControlDialog::slotOnLogoutClicked() @@ -190,7 +190,7 @@ void ControlDialog::slotOnLogoutClicked() m_webSocketClient->addReply((new LtsProjectionWorkstation::CTS::LogoutRequest(QUuid::createUuid().toString()))->toReplyMessage()); m_webSocketClient->webSocket()->close(); } - DEBUG_LOG() << Q_FUNC_INFO << " logout clicked, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " logout clicked, this=" << this; updateConnectButton(); } @@ -210,7 +210,7 @@ void ControlDialog::slotOnWebSocketConnected() if (workspaceIdToUse.isEmpty()) { workspaceIdToUse = QUuid::createUuid().toString(); - INFO_LOG() << "workspaceIdToUse " << workspaceIdToUse; + INFO_LOG(m_logger) << "workspaceIdToUse " << workspaceIdToUse; } m_opmIfc->callWorkspaceSaveUnsaved(workspaceIdToUse); LtsUtils::OperatorSettings* opSettings = LtsUtils::OperatorSettings::getInstance(); @@ -229,7 +229,7 @@ void ControlDialog::slotOnWebSocketConnected() - INFO_LOG() << " connect userId=" << userId + INFO_LOG(m_logger) << " connect userId=" << userId << ", with prio=" << user.projectionPriority() << ", PwsWorkspace/Id='" << workspaceIdToUse << "'"; @@ -244,7 +244,7 @@ void ControlDialog::slotOnWebSocketConnected() void ControlDialog::slotOnVncDisconnected() { - INFO_LOG() << " slotOnVncDisconnected"; + INFO_LOG(m_logger) << " slotOnVncDisconnected"; if (m_webSocketClient) { @@ -255,7 +255,7 @@ void ControlDialog::slotOnVncDisconnected() if (!m_ui || !m_ui->pbnConnect) return; m_ui->pbnConnect->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " VNC disconnected, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " VNC disconnected, this=" << this; updateConnectButton(); } @@ -267,18 +267,18 @@ void ControlDialog::slotOnWebSocketDisconnected() m_isConnected = false; if (m_ui && m_ui->pbnConnect) m_ui->pbnConnect->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " WEBSOCKET disconnected, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " WEBSOCKET disconnected, this=" << this; updateConnectButton(); } void ControlDialog::slotOnWebSocketError() { - ERROR_LOG() << m_webSocketClient->webSocket()->errorString(); + ERROR_LOG(m_logger) << m_webSocketClient->webSocket()->errorString(); LtsWidgets::LtsMessageDialog::showMessage(this, m_webSocketClient->webSocket()->errorString(), tr("Connection to the presentation workstation failed!")); m_isConnected = false; m_ui->pbnConnect->setEnabled(true); - DEBUG_LOG() << Q_FUNC_INFO << " VWEBSOCKET ERROR, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " VWEBSOCKET ERROR, this=" << this; updateConnectButton(); } @@ -299,7 +299,7 @@ void ControlDialog::slotCbxWorkstationsChanged() if (info.addresses().size() > 0) m_host = info.addresses().at(0); else - ERROR_LOG() << "Address for host " << m_ui->cbxWorkstations->currentText() << " not found!"; + ERROR_LOG(m_logger) << "Address for host " << m_ui->cbxWorkstations->currentText() << " not found!"; } @@ -324,14 +324,14 @@ void ControlDialog::fillCombobox() void ControlDialog::updateConnectButton() { - TRACE_LOG() << Q_FUNC_INFO << " START, this=" << this + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, this=" << this << ", m_isConnected=" << m_isConnected << ", pbnConnect->text()=" << m_ui->pbnConnect->text(); if (!m_ui) return; m_ui->pbnConnect->setText(m_isConnected ? tr("Disonnect") : tr("Connect")); m_ui->pbnLogout->setEnabled(m_isConnected); - TRACE_LOG() << Q_FUNC_INFO << " END, this=" << this + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, this=" << this << ", m_isConnected=" << m_isConnected << ", pbnConnect->text()=" << m_ui->pbnConnect->text(); } @@ -358,7 +358,7 @@ void ControlDialog::handleMessage(LtsWebSocket::AbstractClientMessage *message) LtsWidgets::LayoutArea::eDialogTab, false, false); } } - DEBUG_LOG() << Q_FUNC_INFO << " LoginSuccessful YES, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " LoginSuccessful YES, this=" << this; m_isConnected = true; m_ui->pbnConnect->setEnabled(true); updateConnectButton(); @@ -377,7 +377,7 @@ void ControlDialog::handleMessage(LtsWebSocket::AbstractClientMessage *message) } LtsWidgets::LtsMessageDialog::showMessage(this, errMsg, tr("Login failed!")); - DEBUG_LOG() << Q_FUNC_INFO << " LoginSuccessful NO, this=" << this; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " LoginSuccessful NO, this=" << this; m_isConnected = false; m_ui->pbnConnect->setEnabled(true); updateConnectButton(); @@ -388,13 +388,13 @@ void ControlDialog::handleMessage(LtsWebSocket::AbstractClientMessage *message) LtsProjectionWorkstation::STC::DedicatedDisconnect *disconnect = dynamic_cast(message); if (disconnect) { - INFO_LOG() << " DedicatedDisconnect.. " + INFO_LOG(m_logger) << " DedicatedDisconnect.. " << ", getOperatorId=" << LtsSessionData::LtsSessionData::getInstance()->getOperatorId() << ", disconnect->userid()=" << disconnect->userid(); if ( (disconnect->userid() != LtsSessionData::LtsSessionData::getInstance()->getOperatorId()) && m_isConnected) { slotOnWebSocketDisconnected(); - INFO_LOG() << " DedicatedDisconnect.. done"; + INFO_LOG(m_logger) << " DedicatedDisconnect.. done"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.cpp index 335e5f47a..6cc2fa99d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.cpp @@ -32,7 +32,7 @@ bool OperatorSettingsLoader::init(LtsSession::LtsSession *session) { if (!session->getFtc(m_opmFtc)) { - ERROR_LOG() << "Failed to load OperatorManagement FTC!"; + ERROR_LOG(m_logger) << "Failed to load OperatorManagement FTC!"; return false; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.h index 63e6bb7ff..a80eb67cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_operator_settings_loader.h @@ -29,6 +29,8 @@ public: private: + +NGL::INGLLogger &m_logger; bool loadOperatorRights(); LtsProjectionWorkstation:: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_vnc_viewer_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_vnc_viewer_dialog.cpp index 89a8533b5..9c0b3bdf6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_vnc_viewer_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ProjectionWorkstation/Gui/pws_vnc_viewer_dialog.cpp @@ -72,7 +72,7 @@ void VncViewerDialog::retranslate() void VncViewerDialog::handleServerCuttext(const QString &cutText) { - DEBUG_LOG() << "Got cuttext: " << cutText; + DEBUG_LOG(m_logger) << "Got cuttext: " << cutText; } void VncViewerDialog::slotOnDisconnected() @@ -240,7 +240,7 @@ void VncRenderAreaWorker::onRfbFrameBufferUpdate(const QVector(rect.pixelData.data()), @@ -249,7 +249,7 @@ void VncRenderAreaWorker::onRfbFrameBufferUpdate(const QVector m_ismDtc; ReportType m_reportType; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_charge_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_charge_model.h index 0a06c0dd0..5f5a10ce6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_charge_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_charge_model.h @@ -31,6 +31,8 @@ public: QVariant data(const QModelIndex &index, int role) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ProjectDataManagement::ChargeType &data, DataModification modType) const override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_sanitation_material_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_sanitation_material_model.h index e23b9610b..e199c2d4e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_sanitation_material_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_sanitation_material_model.h @@ -29,6 +29,8 @@ public: QVariant data(const QModelIndex &index, int role) const override; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_pdmDtc; ReportType m_reportType; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_type_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_type_model.h index 08aa51100..f305f465c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_type_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Input/rep_input_type_model.h @@ -30,6 +30,8 @@ public: QVariant data(const QModelIndex &index, int role) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ParticipantManagement::Type &data, DataModification) const override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_air_support_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_air_support_model.cpp index 16123458c..4b9f2ec24 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_air_support_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_air_support_model.cpp @@ -109,12 +109,12 @@ bool AirSupportModel::fetchInterfaces() { if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } if (!m_session->getDtc(m_aesDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -328,7 +328,7 @@ QVariant AirSupportModel::headerData(int section, Qt::Orientation orientation, i void AirSupportModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int chargeTypeId = -1; QMap > sums; @@ -350,10 +350,10 @@ void AirSupportModel::fillReportData() resData.hits[2] = obj[QStringLiteral("hits")].toInt(); resData.hits[1] = resData.hits[2] + resData.hits[3] + resData.hits[0]; - INFO_LOG() << "Charge type id = " << resData.chargeTypeId; - INFO_LOG() << "Start time = " << resData.startTime; - INFO_LOG() << "VulnerabilityState = " << resData.vulnerabilityState; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId; + INFO_LOG(m_logger) << "Start time = " << resData.startTime; + INFO_LOG(m_logger) << "VulnerabilityState = " << resData.vulnerabilityState; + INFO_LOG(m_logger) << "Hits = (" << resData.hits[0] << ", " << resData.hits[1] << ", " << resData.hits[2] << ", " @@ -362,7 +362,7 @@ void AirSupportModel::fillReportData() if (chargeTypeId != resData.chargeTypeId) { - DEBUG_LOG() << "New chargeTypeId: " << resData.chargeTypeId; + DEBUG_LOG(m_logger) << "New chargeTypeId: " << resData.chargeTypeId; if (chargeTypeId != -1) { resultDataTable totalChargeTypeId; @@ -380,7 +380,7 @@ void AirSupportModel::fillReportData() } else { - DEBUG_LOG() << "Adding values to chargeType id: " << chargeTypeId; + DEBUG_LOG(m_logger) << "Adding values to chargeType id: " << chargeTypeId; resData.hits[4] = 0; sumUp(sums[chargeTypeId], resData.hits, resData.hits.size()); } @@ -414,7 +414,7 @@ void AirSupportModel::fillReportData() void AirSupportModel::fillPieData() { - DEBUG_LOG() << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); QMap, QVector > sums; @@ -430,9 +430,9 @@ void AirSupportModel::fillPieData() resPieData.hits[2] = obj[QStringLiteral("hits")].toInt(); resPieData.hits[1] = resPieData.hits[2] + resPieData.hits[3]; - INFO_LOG() << "Charge type id = " << resPieData.chargeTypeId; - INFO_LOG() << "Start time = " << resPieData.startTime; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Charge type id = " << resPieData.chargeTypeId; + INFO_LOG(m_logger) << "Start time = " << resPieData.startTime; + INFO_LOG(m_logger) << "Hits = (" << resPieData.hits[0] << ", " << resPieData.hits[1] << ", " << resPieData.hits[2] << ", " @@ -458,10 +458,10 @@ void AirSupportModel::fillPieData() resPie.startTime = key.second; resPie.hits = sums[key]; - INFO_LOG() << "ChargeType: " << resPie.chargeTypeId; - INFO_LOG() << "StartTime: " << resPie.startTime; + INFO_LOG(m_logger) << "ChargeType: " << resPie.chargeTypeId; + INFO_LOG(m_logger) << "StartTime: " << resPie.startTime; for(int i = 0; i < resPie.hits.size(); ++i) - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Hits = (" << resPie.hits[0] << ", " << resPie.hits[1] << ", " << resPie.hits[2] << ", " diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_building_damage_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_building_damage_model.cpp index 47d172a0b..2781a8454 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_building_damage_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_building_damage_model.cpp @@ -160,7 +160,7 @@ QVariant BuildingDamageModel::headerData(int section, Qt::Orientation orientatio void BuildingDamageModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray)) { @@ -176,10 +176,10 @@ void BuildingDamageModel::fillReportData() resData.damages[4] = obj[QStringLiteral("damage_100")].toInt(); resData.buildingDamagePercent = obj[QStringLiteral("damage_percent")].toInt(); - INFO_LOG() << "Building Id = " << resData.buildingId; - INFO_LOG() << "Time point = " << resData.timePoint; - INFO_LOG() << "Damages = " << resData.damages; - INFO_LOG() << "Building Damage Percent = " << resData.buildingDamagePercent; + INFO_LOG(m_logger) << "Building Id = " << resData.buildingId; + INFO_LOG(m_logger) << "Time point = " << resData.timePoint; + INFO_LOG(m_logger) << "Damages = " << resData.damages; + INFO_LOG(m_logger) << "Building Damage Percent = " << resData.buildingDamagePercent; m_data.append(std::move(resData)); } @@ -190,7 +190,7 @@ bool BuildingDamageModel::fetchInterfaces() { if (!m_session->getDtc(m_ismDtc)) { - ERROR_LOG() << "Could not fetch ISM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch ISM DTC Interface"; return false; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.cpp index 08277d753..fa9c56937 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.cpp @@ -57,7 +57,7 @@ bool ChargeAdministrationModel::fetchInterfaces() { if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -184,7 +184,7 @@ QVariant ChargeAdministrationModel::headerData(int section, Qt::Orientation orie void ChargeAdministrationModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int sums[6] = {0, 0, 0, 0, 0, 0}; int bigTotal[6] = {0, 0, 0, 0, 0, 0}; @@ -204,15 +204,15 @@ void ChargeAdministrationModel::fillReportData() resData.charges[4] = obj[QStringLiteral("charge_planned")].toInt(); resData.charges[5] = obj[QStringLiteral("charge_available")].toInt(); - INFO_LOG() << "Charge type id = " << resData.chargeTypeId; - INFO_LOG() << "Effect Source id = " << resData.effectSourceId; - INFO_LOG() << "Charges = (" << resData.charges[0] << ", " << resData.charges[1] << ", " << resData.charges[2] << ", " << resData.charges[3] << ", " + INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId; + INFO_LOG(m_logger) << "Effect Source id = " << resData.effectSourceId; + INFO_LOG(m_logger) << "Charges = (" << resData.charges[0] << ", " << resData.charges[1] << ", " << resData.charges[2] << ", " << resData.charges[3] << ", " << resData.charges[4] << ", " << resData.charges[5] << ")"; if (effectSourceId != resData.effectSourceId) { - DEBUG_LOG() << "New effectSourceId: " << resData.effectSourceId; + DEBUG_LOG(m_logger) << "New effectSourceId: " << resData.effectSourceId; if (effectSourceId != ProjectDataManagement::EffectSource::ES_Unknown) { resultData totalEffectSource; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.h index 93b1f16c1..e4e1d89e2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_administration_model.h @@ -23,6 +23,8 @@ class ChargeAdministrationModel final : public AbstractModel bool fetchInterfaces() override final; private: + + NGL::INGLLogger &m_logger; explicit ChargeAdministrationModel(const ReportManagement::ReportInfo &report, LtsSession::LtsSession *session, QObject *parent); void fillReportData() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_resupply_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_resupply_model.cpp index f384b4fbb..ddfc412bc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_resupply_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_charge_resupply_model.cpp @@ -99,12 +99,12 @@ bool ChargeResupplyModel::fetchInterfaces() { if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } return true; @@ -251,7 +251,7 @@ QVariant ChargeResupplyModel::headerData(int section, Qt::Orientation orientatio void ChargeResupplyModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int participantTypeId = -1; QMap > sums; @@ -271,9 +271,9 @@ void ChargeResupplyModel::fillReportData() resData.charges[3] = obj[QStringLiteral("charge_end")].toInt(); resData.charges[4] = obj[QStringLiteral("charge_fired")].toInt(); - INFO_LOG() << "Participant type id = " << resData.participantTypeId; - INFO_LOG() << "Charge type id = " << resData.chargeTypeId; - INFO_LOG() << "Charges = (" + INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId; + INFO_LOG(m_logger) << "Charges = (" << resData.charges[0] << ", " << resData.charges[1] << ", " << resData.charges[2] << ", " @@ -282,7 +282,7 @@ void ChargeResupplyModel::fillReportData() if (participantTypeId != resData.participantTypeId) { - DEBUG_LOG() << "New participant type id: " << resData.participantTypeId; + DEBUG_LOG(m_logger) << "New participant type id: " << resData.participantTypeId; if (participantTypeId != -1) { resultData totalType; @@ -299,7 +299,7 @@ void ChargeResupplyModel::fillReportData() } else { - DEBUG_LOG() << "Adding values to participant type id: " << participantTypeId; + DEBUG_LOG(m_logger) << "Adding values to participant type id: " << participantTypeId; sumUp(sums[participantTypeId], resData.charges, resData.charges.size()); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_firings_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_firings_model.cpp index d048c43f6..fcf14a07c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_firings_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_firings_model.cpp @@ -108,7 +108,7 @@ bool FiringsModel::fetchInterfaces() { if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -314,7 +314,7 @@ QVariant FiringsModel::headerData(int section, Qt::Orientation orientation, int void FiringsModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int chargeTypeId = -1; QMap > sums; @@ -335,10 +335,10 @@ void FiringsModel::fillReportData() resData.hits[2] = obj[QStringLiteral("hits")].toInt(); resData.hits[1] = resData.hits[2] + resData.hits[3]; - INFO_LOG() << "Charge type id = " << resData.chargeTypeId; - INFO_LOG() << "Start time = " << resData.startTime; - INFO_LOG() << "VulnerabilityState = " << resData.vulnerabilityState; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Charge type id = " << resData.chargeTypeId; + INFO_LOG(m_logger) << "Start time = " << resData.startTime; + INFO_LOG(m_logger) << "VulnerabilityState = " << resData.vulnerabilityState; + INFO_LOG(m_logger) << "Hits = (" << resData.hits[0] << ", " << resData.hits[1] << ", " << resData.hits[2] << ", " @@ -346,7 +346,7 @@ void FiringsModel::fillReportData() if (chargeTypeId != resData.chargeTypeId) { - DEBUG_LOG() << "New charge type id: " << resData.chargeTypeId; + DEBUG_LOG(m_logger) << "New charge type id: " << resData.chargeTypeId; if (chargeTypeId != -1) { resultDataTable totalChargeType; @@ -364,7 +364,7 @@ void FiringsModel::fillReportData() } else { - DEBUG_LOG() << "Adding values to charge type id: " << chargeTypeId; + DEBUG_LOG(m_logger) << "Adding values to charge type id: " << chargeTypeId; sumUp(sums[chargeTypeId], resData.hits, resData.hits.size()); } @@ -397,7 +397,7 @@ void FiringsModel::fillReportData() void FiringsModel::fillPieData() { - DEBUG_LOG() << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillPieData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); QMap, QVector > sums; @@ -414,9 +414,9 @@ void FiringsModel::fillPieData() resPieData.hits[2] = obj[QStringLiteral("hits")].toInt(); resPieData.hits[1] = resPieData.hits[2] + resPieData.hits[3]; - INFO_LOG() << "Charge type id = " << resPieData.chargeTypeId; - INFO_LOG() << "Start time = " << resPieData.startTime; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Charge type id = " << resPieData.chargeTypeId; + INFO_LOG(m_logger) << "Start time = " << resPieData.startTime; + INFO_LOG(m_logger) << "Hits = (" << resPieData.hits[0] << ", " << resPieData.hits[1] << ", " << resPieData.hits[2] << ", " @@ -440,10 +440,10 @@ void FiringsModel::fillPieData() resPie.startTime = key.second; resPie.hits = sums[key]; - INFO_LOG() << "ChargeType: " << resPie.chargeTypeId; - INFO_LOG() << "StartTime: " << resPie.startTime; + INFO_LOG(m_logger) << "ChargeType: " << resPie.chargeTypeId; + INFO_LOG(m_logger) << "StartTime: " << resPie.startTime; for(int i = 0; i < resPie.hits.size(); ++i) - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Hits = (" << resPie.hits[0] << ", " << resPie.hits[1] << ", " << resPie.hits[2] << ", " diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_maintenance_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_maintenance_model.cpp index dc888e558..e9a560c83 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_maintenance_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_maintenance_model.cpp @@ -16,10 +16,9 @@ using namespace ReportManagement; -MaintenanceModel::MaintenanceModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) - : AbstractModel(report, session, parent) - , m_ppmDtc(nullptr) -{ +MaintenanceModel::MaintenanceModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent) + , m_ppmDtc(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!fetchInterfaces()) return; @@ -68,7 +67,7 @@ bool MaintenanceModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } return true; @@ -197,7 +196,7 @@ QVariant MaintenanceModel::headerData(int section, Qt::Orientation orientation, void MaintenanceModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray)) { @@ -212,11 +211,11 @@ void MaintenanceModel::fillReportData() resData.time_position = obj[QStringLiteral("time_position_changed")].toDouble(); resData.time_vulnerability = obj[QStringLiteral("time_vulnerability")].toDouble(); - INFO_LOG() << "Participant id = " << resData.participantId; - INFO_LOG() << "Participant type id = " << resData.participantTypeId; - INFO_LOG() << "Time event = " << resData.time_event; - INFO_LOG() << "Time pos = " << resData.time_position; - INFO_LOG() << "Time vulnerability = " << resData.time_vulnerability; + INFO_LOG(m_logger) << "Participant id = " << resData.participantId; + INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + INFO_LOG(m_logger) << "Time event = " << resData.time_event; + INFO_LOG(m_logger) << "Time pos = " << resData.time_position; + INFO_LOG(m_logger) << "Time vulnerability = " << resData.time_vulnerability; m_data.append(std::move(resData)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_medevac_nine_liner_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_medevac_nine_liner_model.cpp index 98ecfb9bd..f66041e5e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_medevac_nine_liner_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_medevac_nine_liner_model.cpp @@ -52,7 +52,7 @@ bool MedevacNineLinerModel::fetchInterfaces() { if (!m_session->getDtc(m_evlDtc)) { - ERROR_LOG() << "Could not fetch EVL DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch EVL DTC Interface"; return false; } return true; @@ -162,7 +162,7 @@ QVariant MedevacNineLinerModel::headerData(int section, Qt::Orientation orientat void MedevacNineLinerModel::fillReportData() { - ERROR_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + ERROR_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray)) { @@ -170,7 +170,7 @@ void MedevacNineLinerModel::fillReportData() resultData resData; resData.nineLinerId = obj[QStringLiteral("nine_liner_id")].toInt(); - DEBUG_LOG() << "Nine Liner id = " << resData.nineLinerId; + DEBUG_LOG(m_logger) << "Nine Liner id = " << resData.nineLinerId; Evaluations::SanNineLiner crtNineLiner = m_evlDtc->sanNineLiner(resData.nineLinerId); if (crtNineLiner.id() <= 0 ) @@ -184,7 +184,7 @@ void MedevacNineLinerModel::fillReportData() QVector linesCategory = Evaluations::SanCategoryLine::fromJson(crtNineLiner.lines(), crtNineLiner.id()); - INFO_LOG() << "linesCategory size: " << linesCategory.size(); + INFO_LOG(m_logger) << "linesCategory size: " << linesCategory.size(); for (const Evaluations::Database::SanCategoryLine &cl : std::as_const(linesCategory)) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_mine_area_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_mine_area_model.cpp index c810c3522..70863da6b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_mine_area_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_mine_area_model.cpp @@ -72,7 +72,7 @@ bool MineAreaModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } return true; @@ -203,7 +203,7 @@ QVariant MineAreaModel::headerData(int section, Qt::Orientation orientation, int void MineAreaModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int mineAreaId = -1; QString mineAreaName; @@ -223,10 +223,10 @@ void MineAreaModel::fillReportData() resData.hits[2] = obj[QStringLiteral("hit_friendly_fire")].toInt(); resData.hits[1] = resData.hits[0] - resData.hits[2]; - INFO_LOG() << "Mine area id = " << resData.mineAreaId; - INFO_LOG() << "Mine area name = " << resData.mineAreaName; - INFO_LOG() << "Participant type id = " << resData.participantTypeId; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Mine area id = " << resData.mineAreaId; + INFO_LOG(m_logger) << "Mine area name = " << resData.mineAreaName; + INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + INFO_LOG(m_logger) << "Hits = (" << resData.hits[0] << ", " << resData.hits[1] << ", " << resData.hits[2] << ")" ; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_nbc_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_nbc_model.cpp index ba9cdac72..4d5ca1eda 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_nbc_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_nbc_model.cpp @@ -105,12 +105,12 @@ bool NbcModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -256,7 +256,7 @@ QVariant NbcModel::headerData(int section, Qt::Orientation orientation, int role void NbcModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int nbcId = -1; QString nbcName; @@ -278,10 +278,10 @@ void NbcModel::fillReportData() resData.hits[0] = obj[QStringLiteral("hit")].toInt(); resData.hits[1] = obj[QStringLiteral("protection")].toInt(); - INFO_LOG() << "Nbc id = " << resData.nbcId; - INFO_LOG() << "Nbc name = " << resData.nbcName; - INFO_LOG() << "Participant type id = " << resData.participantTypeId; - INFO_LOG() << "Hits = (" + INFO_LOG(m_logger) << "Nbc id = " << resData.nbcId; + INFO_LOG(m_logger) << "Nbc name = " << resData.nbcName; + INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + INFO_LOG(m_logger) << "Hits = (" << resData.hits[0] << ", " << resData.hits[1]; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_participant_distance_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_participant_distance_model.cpp index dd425af50..3bec186b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_participant_distance_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_participant_distance_model.cpp @@ -71,7 +71,7 @@ bool ParticipantDistanceModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } return true; @@ -199,7 +199,7 @@ QVariant ParticipantDistanceModel::headerData(int section, Qt::Orientation orien void ParticipantDistanceModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); int participantTypeId = -1; long bigTotal = 0; @@ -216,9 +216,9 @@ void ParticipantDistanceModel::fillReportData() resData.participantEqNo = obj[QStringLiteral("participant_equipment_number")].toInt(); resData.distance = obj[QStringLiteral("distance")].toDouble(); - INFO_LOG() << "Participant id = " << resData.participantId; - INFO_LOG() << "Participant type id = " << resData.participantTypeId; - INFO_LOG() << "Participant distance = " << resData.distance; + INFO_LOG(m_logger) << "Participant id = " << resData.participantId; + INFO_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + INFO_LOG(m_logger) << "Participant distance = " << resData.distance; if (participantTypeId != resData.participantTypeId) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_sanitation_material_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_sanitation_material_model.cpp index 3fc3a84d0..df7c71213 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_sanitation_material_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_sanitation_material_model.cpp @@ -93,7 +93,7 @@ bool SanitationMaterialModel::fetchInterfaces() { if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -235,7 +235,7 @@ QVariant SanitationMaterialModel::headerData(int section, Qt::Orientation orient void SanitationMaterialModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); @@ -256,11 +256,11 @@ void SanitationMaterialModel::fillReportData() resData.amounts[3] = obj[QStringLiteral("amount_used")].toInt(); resData.duration = obj[QStringLiteral("duration")].toDouble(); - ERROR_LOG() << "Unique id = " << resData.uniqueId; - ERROR_LOG() << "qualification = " << resData.qualification; - ERROR_LOG() << "Material id = " << resData.materialId; - ERROR_LOG() << "Duration with no stock = " << resData.duration; - ERROR_LOG() << "Amounts = (" + ERROR_LOG(m_logger) << "Unique id = " << resData.uniqueId; + ERROR_LOG(m_logger) << "qualification = " << resData.qualification; + ERROR_LOG(m_logger) << "Material id = " << resData.materialId; + ERROR_LOG(m_logger) << "Duration with no stock = " << resData.duration; + ERROR_LOG(m_logger) << "Amounts = (" << resData.amounts[0] << ", " << resData.amounts[1] << ", " << resData.amounts[2] << ", " @@ -291,7 +291,7 @@ void SanitationMaterialModel::fillReportData() totalMatId.qualification = 0; totalMatId.amounts = totals[matId]; - DEBUG_LOG() << "Totals per material id = " << matId << " : " + DEBUG_LOG(m_logger) << "Totals per material id = " << matId << " : " << totalMatId.amounts[0] << ", " << totalMatId.amounts[1] << ", " << totalMatId.amounts[2] << ", " diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_model.cpp index 775afe282..c26f843ef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_model.cpp @@ -20,11 +20,10 @@ using namespace ReportManagement; -TreatmentModel::TreatmentModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) - : AbstractModel(report, session, parent) +TreatmentModel::TreatmentModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent) , m_ppmDtc(nullptr) - , m_pdmDtc(nullptr) -{ + , m_pdmDtc(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!fetchInterfaces()) return; @@ -115,12 +114,12 @@ bool TreatmentModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -252,7 +251,7 @@ QVariant TreatmentModel::data(const QModelIndex &index, int role) const if (m_report.visualisationType() == VisualisationType::Bar && m_report.reportType() == ReportType::Treatment) { int sanResult = index.row(); - DEBUG_LOG() << "SanRes = " << sanResult; + DEBUG_LOG(m_logger) << "SanRes = " << sanResult; const resultDataPieEvaluation &pieInfo = m_bars[sanResult]; if (role == Qt::EditRole) return pieInfo.groupId; @@ -428,7 +427,7 @@ QVariant TreatmentModel::headerData(int section, Qt::Orientation orientation, in void TreatmentModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); resultDataPie pie; @@ -490,11 +489,11 @@ void TreatmentModel::fillReportData() { if (resData.timeTreatmentVulnerability < (10 * 60 * 1000)) resData.inbetween10Minutes = true; - DEBUG_LOG() << "qualification: " << resData.qualification; + DEBUG_LOG(m_logger) << "qualification: " << resData.qualification; if (resData.timeTreatmentVulnerability < (60 * 60 * 1000) && resData.qualification == ParticipantManagement::Qualification_def::SANPers) { resData.goldenHour = true; - DEBUG_LOG() << "golden hour particpantId: " << resData.participantId; + DEBUG_LOG(m_logger) << "golden hour particpantId: " << resData.participantId; } } if (resData.sanitationResult == ParticipantManagement::SanitationResult_def::Optimal) @@ -505,7 +504,7 @@ void TreatmentModel::fillReportData() int key = getParticipantKey(resData.participantId); - DEBUG_LOG() << "getParticipantKey: " << key; + DEBUG_LOG(m_logger) << "getParticipantKey: " << key; countVulnerabilityState(key, resData); @@ -533,12 +532,12 @@ void TreatmentModel::fillReportData() if (resData.timeEnterArea <= 0) { - DEBUG_LOG() << "1. not entered RS: " << resData.participantId; + DEBUG_LOG(m_logger) << "1. not entered RS: " << resData.participantId; if (!m_rescueStationNotTreated[key].contains(resData.participantId) && !m_rescueStationTreated[key].contains(resData.participantId)) { m_treatmentIntervalMap[key][PIE_notEnteredRecueArea].insert(resData.participantId); - DEBUG_LOG() << "2. not entered RS: " << resData.participantId; + DEBUG_LOG(m_logger) << "2. not entered RS: " << resData.participantId; } } @@ -581,19 +580,19 @@ void TreatmentModel::fillReportData() resDataTable.amountLightlyWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::LightDamage).size(); resDataTotal.amountLightlyWounded += resDataTable.amountLightlyWounded; for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::LightDamage)) - INFO_LOG() << "participantId: lightlyWouned: " << id; + INFO_LOG(m_logger) << "participantId: lightlyWouned: " << id; resDataTable.amountMediumWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::MediumDamage).size(); resDataTotal.amountMediumWounded += resDataTable.amountMediumWounded; for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::MediumDamage)) - INFO_LOG() << "participantId: mediumWouned: " << id; + INFO_LOG(m_logger) << "participantId: mediumWouned: " << id; resDataTable.amountHeavyWounded = tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::HeavyDamage).size(); resDataTotal.amountHeavyWounded += resDataTable.amountHeavyWounded; for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::HeavyDamage)) - INFO_LOG() << "participantId: heavyWouned: " << id; + INFO_LOG(m_logger) << "participantId: heavyWouned: " << id; resDataTable.amountInjuryTotal = resDataTable.amountLightlyWounded + resDataTable.amountMediumWounded @@ -607,7 +606,7 @@ void TreatmentModel::fillReportData() for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::CatastrophicKill)) { - INFO_LOG() << "participantId: KIA: " << id; + INFO_LOG(m_logger) << "participantId: KIA: " << id; m_rescueStationTreated[resDataTable.participantId].remove(id); m_rescueStationNotTreated[resDataTable.participantId].remove(id); } @@ -618,7 +617,7 @@ void TreatmentModel::fillReportData() for ( int id : tmpVulMap.value(ProjectDataManagement::VulnerabilityState_def::TemporarySeverance)) { - INFO_LOG() << "participantId: kiaAfterWia: " << id; + INFO_LOG(m_logger) << "participantId: kiaAfterWia: " << id; m_rescueStationTreated[resDataTable.participantId].remove(id); m_rescueStationNotTreated[resDataTable.participantId].remove(id); } @@ -627,7 +626,7 @@ void TreatmentModel::fillReportData() resDataTable.amountTreated = m_treatmentAmount.value(resDataTable.participantId).size(); resDataTotal.amountTreated += resDataTable.amountTreated; for ( int id : m_treatmentAmount.value(resDataTable.participantId)) - INFO_LOG() << "participantId: treated " << id; + INFO_LOG(m_logger) << "participantId: treated " << id; resDataTable.amountPlatin = m_treatmentIntervalMap[resDataTable.participantId][PIE_platin].size(); resDataTable.amountGoldenHour = m_treatmentIntervalMap[resDataTable.participantId][PIE_goldenHour].size(); @@ -645,13 +644,13 @@ void TreatmentModel::fillReportData() resDataTable.amountEnterRescueStationNotTreated = m_rescueStationNotTreated.value(resDataTable.participantId).size(); resDataTotal.amountEnterRescueStationNotTreated += resDataTable.amountEnterRescueStationNotTreated; for ( int id : m_rescueStationNotTreated.value(resDataTable.participantId)) - INFO_LOG() << "participantId: in RescueStation - not treated: " << id; + INFO_LOG(m_logger) << "participantId: in RescueStation - not treated: " << id; resDataTable.amountEnterRescueStationTreated = m_rescueStationTreated.value(resDataTable.participantId).size(); resDataTotal.amountEnterRescueStationTreated += resDataTable.amountEnterRescueStationTreated; for ( int id : m_rescueStationTreated.value(resDataTable.participantId)) - INFO_LOG() << "participantId: in RescueStation - treated: " << id; + INFO_LOG(m_logger) << "participantId: in RescueStation - treated: " << id; m_dataTable.append(std::move(resDataTable)); } @@ -664,7 +663,7 @@ void TreatmentModel::fillReportData() for ( const QMap> &map : std::as_const(m_treatmentIntervalMap)) { - INFO_LOG() << "not entered RS: " << map[PIE_notEnteredRecueArea].size(); + INFO_LOG(m_logger) << "not entered RS: " << map[PIE_notEnteredRecueArea].size(); pie.results[PIE_platin] += map[PIE_platin].size(); pie.results[PIE_goldenHour] += map[PIE_goldenHour].size(); pie.results[PIE_notEnteredRecueArea] += map[PIE_notEnteredRecueArea].size(); @@ -682,28 +681,28 @@ void TreatmentModel::fillReportData() for (auto it = m_bars.begin(); it != m_bars.end(); ++it) { resultDataPieEvaluation data = it.value(); - DEBUG_LOG() << it.key() << ", GroupId = " << data.groupId << ", results = {" << data.results[0] << "," << data.results[1] << "," << data.results[2] << "}"; + DEBUG_LOG(m_logger) << it.key() << ", GroupId = " << data.groupId << ", results = {" << data.results[0] << "," << data.results[1] << "," << data.results[2] << "}"; } - INFO_LOG() << "Pie Results: "; - INFO_LOG() << "Inbetween 10 min: " << pie.results[PIE_platin]; - INFO_LOG() << "Golden Hour: " << pie.results[PIE_goldenHour]; - INFO_LOG() << "KIA: " << pie.results[PIE_KIA]; - INFO_LOG() << "Enter RS: " << pie.results[PIE_enterRescueArea]; - INFO_LOG() << "Not Enter RS: " << pie.results[PIE_notEnteredRecueArea]; - INFO_LOG() << "Total: " << pie.results[PIE_total]; + INFO_LOG(m_logger) << "Pie Results: "; + INFO_LOG(m_logger) << "Inbetween 10 min: " << pie.results[PIE_platin]; + INFO_LOG(m_logger) << "Golden Hour: " << pie.results[PIE_goldenHour]; + INFO_LOG(m_logger) << "KIA: " << pie.results[PIE_KIA]; + INFO_LOG(m_logger) << "Enter RS: " << pie.results[PIE_enterRescueArea]; + INFO_LOG(m_logger) << "Not Enter RS: " << pie.results[PIE_notEnteredRecueArea]; + INFO_LOG(m_logger) << "Total: " << pie.results[PIE_total]; for (auto it = m_vulnerabilityMap.begin(); it != m_vulnerabilityMap.end(); ++it) { - INFO_LOG() << "UnitId: " << it.key(); + INFO_LOG(m_logger) << "UnitId: " << it.key(); for (auto it2 = it.value().begin(); it2 != it.value().end(); ++it2) - INFO_LOG() << "VulnerabilityState: " << it2.key() << ", Count: " << it2.value().size(); + INFO_LOG(m_logger) << "VulnerabilityState: " << it2.key() << ", Count: " << it2.value().size(); } for (auto it = m_rescueStationTreated.begin(); it != m_rescueStationTreated.end(); ++it) - INFO_LOG() << "troupId: " << it.key() << ", amount RescueStation - treated: " << it.value().size(); + INFO_LOG(m_logger) << "troupId: " << it.key() << ", amount RescueStation - treated: " << it.value().size(); for (auto it = m_rescueStationNotTreated.begin(); it != m_rescueStationNotTreated.end(); ++it) - INFO_LOG() << "troupId: " << it.key() << ", amount RescueStation - not treated: " << it.value().size(); + INFO_LOG(m_logger) << "troupId: " << it.key() << ", amount RescueStation - not treated: " << it.value().size(); m_dataPie.append(std::move(pie)); @@ -716,7 +715,7 @@ void TreatmentModel::fillParticipantMap() for (const Superior &sup : m_report.superiorIds()) m_partSuperiorMap.insert(sup.participantId(), sup.superiorId()); - DEBUG_LOG() << "size m_partSuperiorMap: " << m_partSuperiorMap.size(); + DEBUG_LOG(m_logger) << "size m_partSuperiorMap: " << m_partSuperiorMap.size(); QMapIterator it(m_partSuperiorMap); QList unitIdsNull; @@ -727,7 +726,7 @@ void TreatmentModel::fillParticipantMap() if (it.value() == 0) { unitIdsNull.append(it.key()); - DEBUG_LOG() << "unitId: " << it.key(); + DEBUG_LOG(m_logger) << "unitId: " << it.key(); } } @@ -740,10 +739,10 @@ void TreatmentModel::fillParticipantMap() m_participantMap.insert(it.key(), QSet()); } - DEBUG_LOG() << "size m_participantMap: " << m_participantMap.size(); + DEBUG_LOG(m_logger) << "size m_participantMap: " << m_participantMap.size(); const auto &ids = m_participantMap.keys(); for (int id : ids) - DEBUG_LOG() << "TroupId: " << id; + DEBUG_LOG(m_logger) << "TroupId: " << id; it.toFront(); @@ -759,7 +758,7 @@ void TreatmentModel::fillParticipantMap() while(it2.hasNext()) { it2.next(); - DEBUG_LOG() << "TroupId: " << it2.key(); + DEBUG_LOG(m_logger) << "TroupId: " << it2.key(); QMap> vulnMap; QSet partIds; @@ -775,7 +774,7 @@ void TreatmentModel::fillParticipantMap() m_rescueStationNotTreated.insert(it2.key(), partIds); for (int participantId : it2.value()) - DEBUG_LOG() << " Participants: " << participantId; + DEBUG_LOG(m_logger) << " Participants: " << participantId; } } @@ -808,7 +807,7 @@ int TreatmentModel::getParticipantKey(int participantId) while(it.hasNext()) { it.next(); - DEBUG_LOG() << "it.key: " << it.key() << ", participantId: " << participantId; + DEBUG_LOG(m_logger) << "it.key: " << it.key() << ", participantId: " << participantId; if (it.value().contains(participantId) || it.key() == participantId) { key = it.key(); @@ -829,7 +828,7 @@ void TreatmentModel::countVulnerabilityState( int key, const resultData &data) if ( key <= 0) return; - DEBUG_LOG() << "key: " << key << ", participantId: " << data.participantId; + DEBUG_LOG(m_logger) << "key: " << key << ", participantId: " << data.participantId; QMap> vulMapTemp = m_vulnerabilityMap.value(key); QMapIterator> itVul(vulMapTemp); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_timeline_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_timeline_model.cpp index 053e282d0..c1f1f0c11 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_timeline_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_treatment_timeline_model.cpp @@ -18,11 +18,10 @@ using namespace ReportManagement; -TreatmentTimelineModel::TreatmentTimelineModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) - : AbstractModel(report, session, parent) +TreatmentTimelineModel::TreatmentTimelineModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent) , m_ppmDtc(nullptr) - , m_pdmDtc(nullptr) -{ + , m_pdmDtc(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!fetchInterfaces()) return; @@ -137,12 +136,12 @@ bool TreatmentTimelineModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Could not fetch PDM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PDM DTC Interface"; return false; } return true; @@ -311,7 +310,7 @@ QVariant TreatmentTimelineModel::headerData(int section, Qt::Orientation orienta void TreatmentTimelineModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray)) { @@ -329,11 +328,11 @@ void TreatmentTimelineModel::fillReportData() resData.eventTypeId = static_cast(obj[QStringLiteral("event_type_id")].toInt()); resData.properties = obj[QStringLiteral("properties")].toString(); - DEBUG_LOG() << "Participant type id = " << resData.participantTypeId; - DEBUG_LOG() << "Participant id = " << resData.participantId; - DEBUG_LOG() << "Event type = " << resData.eventTypeId; - DEBUG_LOG() << "Event time = " << resData.eventTime; - DEBUG_LOG() << "Properties = " << resData.properties; + DEBUG_LOG(m_logger) << "Participant type id = " << resData.participantTypeId; + DEBUG_LOG(m_logger) << "Participant id = " << resData.participantId; + DEBUG_LOG(m_logger) << "Event type = " << resData.eventTypeId; + DEBUG_LOG(m_logger) << "Event time = " << resData.eventTime; + DEBUG_LOG(m_logger) << "Properties = " << resData.properties; m_data.append(std::move(resData)); } @@ -342,7 +341,7 @@ void TreatmentTimelineModel::fillReportData() QString TreatmentTimelineModel::getAreaName(const QString& properties) const { - DEBUG_LOG() << "getAreaName from " << properties; + DEBUG_LOG(m_logger) << "getAreaName from " << properties; QJsonDocument doc = QJsonDocument::fromJson(properties.toUtf8()); const QJsonObject obj = doc.object(); @@ -356,7 +355,7 @@ QString TreatmentTimelineModel::getAreaName(const QString& properties) const QColor TreatmentTimelineModel::eventColor(ReportManagement::EventType eventTypeId) const { - DEBUG_LOG() << "eventColor for event type " << eventTypeId; + DEBUG_LOG(m_logger) << "eventColor for event type " << eventTypeId; switch (eventTypeId.underlying()) { case ReportManagement::EventType::VBGChanged: return QColor(Qt::red); @@ -376,7 +375,7 @@ QColor TreatmentTimelineModel::eventColor(ReportManagement::EventType eventTypeI QString TreatmentTimelineModel::getSanProcs(const QString& properties) const { - DEBUG_LOG() << "getSanProcs from " << properties; + DEBUG_LOG(m_logger) << "getSanProcs from " << properties; QString sanProcs; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_unit_power_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_unit_power_model.cpp index 11e08382a..654c96b1c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_unit_power_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/Models/rep_unit_power_model.cpp @@ -15,10 +15,9 @@ using namespace ReportManagement; -UnitPowerModel::UnitPowerModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) - : AbstractModel(report, session, parent) - , m_ppmDtc(nullptr) -{ +UnitPowerModel::UnitPowerModel(const ReportInfo &report, LtsSession::LtsSession *session, QObject *parent) : AbstractModel(report, session, parent) + , m_ppmDtc(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (!fetchInterfaces()) return; @@ -50,7 +49,7 @@ bool UnitPowerModel::fetchInterfaces() { if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Could not fetch PPM DTC Interface"; + ERROR_LOG(m_logger) << "Could not fetch PPM DTC Interface"; return false; } return true; @@ -179,7 +178,7 @@ QVariant UnitPowerModel::headerData(int section, Qt::Orientation orientation, in void UnitPowerModel::fillReportData() { - DEBUG_LOG() << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); + DEBUG_LOG(m_logger) << "fillReportData(): m_reportJsonArray.size() = " << m_reportJsonArray.size(); for (const QJsonValue &arrVal : std::as_const(m_reportJsonArray)) { const QJsonObject obj = arrVal.toObject(); @@ -202,10 +201,10 @@ void UnitPowerModel::fillReportData() resData.notReadyVbgs[9] = obj[QStringLiteral("vulnerability_state10")].toInt(); resData.notReadyVbgs[10] = obj[QStringLiteral("vulnerability_state11")].toInt(); - INFO_LOG() << "Group id = " << resData.groupId; - INFO_LOG() << "Ready = " << resData.ready; - INFO_LOG() << "Not ready = " << resData.notReady; - INFO_LOG() << "Start time = " << resData.startTime; + INFO_LOG(m_logger) << "Group id = " << resData.groupId; + INFO_LOG(m_logger) << "Ready = " << resData.ready; + INFO_LOG(m_logger) << "Not ready = " << resData.notReady; + INFO_LOG(m_logger) << "Start time = " << resData.startTime; m_data.append(std::move(resData)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.cpp index 5934bd082..3b3887024 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.cpp @@ -66,7 +66,7 @@ ReportTopicEditor::~ReportTopicEditor() void ReportTopicEditor::updateInternalData() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_topicData.x < 0 && m_topicData.y < 0 && m_topicData.h < 0 && m_topicData.w < 0) { @@ -81,7 +81,7 @@ void ReportTopicEditor::updateInternalData() if (m_reportId > 0) { - DEBUG_LOG() << Q_FUNC_INFO << " report id = " << m_reportId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " report id = " << m_reportId; QModelIndex idx = m_reportModel->findIndexForId(m_reportId); const ReportManagement::ReportInfo report = m_reportModel->getRowData(idx.row()); @@ -91,7 +91,7 @@ void ReportTopicEditor::updateInternalData() m_ui->reportsDataView->selectRow(idx); m_ui->lblName->setText(QString::fromStdString(report.name())); m_reportInfo = m_reportModel->getRowData(idx.row()); - DEBUG_LOG() << Q_FUNC_INFO << " selected report: " << m_reportInfo.name(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " selected report: " << m_reportInfo.name(); } else { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.h index f140ae859..2a599a073 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/TopicEditor/topic_editor.h @@ -36,6 +36,8 @@ public: ~ReportTopicEditor(); private: + +NGL::INGLLogger &m_logger; void updateInternalData() override final; void retranslate() override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.cpp index 54c8fc83f..3597b968d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.cpp @@ -283,8 +283,8 @@ bool ReportEdit::init(const ReportInfo &currReport, LtsSession::LtsSession *sess m_minDateTime -= m_minDateTime % 1000; m_maxDateTime -= m_maxDateTime % 1000; - DEBUG_LOG() << "m_minDateTime = " << m_minDateTime; - DEBUG_LOG() << "m_maxDateTime = " << m_maxDateTime; + DEBUG_LOG(m_logger) << "m_minDateTime = " << m_minDateTime; + DEBUG_LOG(m_logger) << "m_maxDateTime = " << m_maxDateTime; m_ui->dteStart->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); }); m_ui->dteEnd->setRetrieveCurrentTimeCallback([this]() { return m_session->partitionTime(); }); @@ -1078,7 +1078,7 @@ bool ReportEdit::initInputs() }); } - DEBUG_LOG() << "m_report effectSources size: " << m_report.effectSources().size(); + DEBUG_LOG(m_logger) << "m_report effectSources size: " << m_report.effectSources().size(); if (!m_report.effectSources().empty()) { QStringList toolTip; @@ -1088,7 +1088,7 @@ bool ReportEdit::initInputs() auto it = std::find(m_report.effectSources().begin(), m_report.effectSources().end(), effectSourceId.underlying()); if (it != m_report.effectSources().end()) { - DEBUG_LOG() << "To be checked: effectSourceId: " << effectSourceId; + DEBUG_LOG(m_logger) << "To be checked: effectSourceId: " << effectSourceId; action->setChecked(true); toolTip.append(ProjectDataManagement::toString(effectSourceId)); } @@ -1113,7 +1113,7 @@ void ReportEdit::fillCbInterval() else { int mins = m_report.intervalTime() / (1000 * 60); - DEBUG_LOG() << "Report interval mins " << mins; + DEBUG_LOG(m_logger) << "Report interval mins " << mins; m_ui->cbInterval->setCurrentIndex(m_ui->cbInterval->findData(mins)); if (m_report.visualisationType() == VisualisationType::Pie || m_report.visualisationType() == VisualisationType::Table) m_ui->cbInterval->setCurrentIndex(0); @@ -1128,7 +1128,7 @@ void ReportEdit::getParticipantSuperiorAndUnitIds(std::vector &participantI if (!m_ui->treeViewParticipants->selectionModel()) return; - DEBUG_LOG() << "getParticipantAndUnitIds"; + DEBUG_LOG(m_logger) << "getParticipantAndUnitIds"; const QModelIndexList &selIndexs = m_ui->treeViewParticipants->selectionModel()->selectedRows(); @@ -1179,7 +1179,7 @@ void ReportEdit::recursiveGetParticipant(int participantId, std::vector &pa const int superiorId = part.superiorModId(); - ERROR_LOG() << "participantId: " << participantId << ", superiorId: " << superiorId; + ERROR_LOG(m_logger) << "participantId: " << participantId << ", superiorId: " << superiorId; Superior sup; sup.participantId(participantId); sup.superiorId(superiorId); @@ -1421,47 +1421,47 @@ bool ReportEdit::fetchInterfaces() { if (!m_session->getDtc(m_dtc)) { - ERROR_LOG() << "Cannot retrieve ReportManagament Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Dtc interface!"; return false; } if (!m_session->getFtc(m_ftc)) { - ERROR_LOG() << "Cannot retrieve ReportManagament Ftc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Ftc interface!"; return false; } if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Cannot retrieve ParticipantManagament Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Dtc interface!"; return false; } if (!m_session->getFtc(m_ppmFtc)) { - ERROR_LOG() << "Cannot retrieve ParticipantManagament Ftc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Ftc interface!"; return false; } if (!m_session->getDtc(m_aesDtc)) { - ERROR_LOG() << "Cannot retrieve AreaEffectSimulation Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve AreaEffectSimulation Dtc interface!"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Cannot retrieve ProjectDataManagement Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ProjectDataManagement Dtc interface!"; return false; } if (!m_session->getForeignGuiInterface(m_ppmGuiCbxIfc)) { - ERROR_LOG() << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!"; return false; } if (!m_session->getDtc(m_ismDtc)) { - ERROR_LOG() << "Cannot retrieve InfrastructureManagement Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve InfrastructureManagement Dtc interface!"; return false; } if (!m_session->getDtc(m_exmDtc)) { - ERROR_LOG() << "Cannot retrieve ExerciseManagement Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ExerciseManagement Dtc interface!"; return false; } m_session->getForeignGuiInterface(m_sitMapGuiIfc); @@ -1511,7 +1511,7 @@ bool ReportEdit::apply() break; } } - WARNING_LOG() << "Too many samples to be generated, max = " << MAX_SAMPLES_KDAB; + WARNING_LOG(m_logger) << "Too many samples to be generated, max = " << MAX_SAMPLES_KDAB; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Please limit time period and save again the report. Interval was changed to minimum value %1.") .arg(m_ui->cbInterval->currentText().toInt())); @@ -1603,7 +1603,7 @@ void ReportEdit::onCheck() if ((m_ui->pbEffectSource->isVisible() && m_activeEffectSources.size() == 0)) enabled = false; } - DEBUG_LOG() << "onCheck() : " << enabled; + DEBUG_LOG(m_logger) << "onCheck() : " << enabled; m_buttonBox->getButton(LtsWidgets::DialogButton::Ok)->setEnabled(enabled); if (enabled) @@ -1691,13 +1691,13 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO switch (replyObject.replyState().underlying()) { case Core::FtReplyState::InProgress: - DEBUG_LOG() << "onCreateModifyReportReply InProgress"; + DEBUG_LOG(m_logger) << "onCreateModifyReportReply InProgress"; m_ftcTimer->start(); break; case Core::FtReplyState::Completed: { m_ftcTimer->stop(); - DEBUG_LOG() << "onCreateModifyReportReply Completed"; + DEBUG_LOG(m_logger) << "onCreateModifyReportReply Completed"; m_requestHelper->requestReply(replyObject); if (!m_requestHelper->failed()) { @@ -1715,12 +1715,12 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO } case Core::FtReplyState::NotStarted: { - DEBUG_LOG() << "onCreateModifyReportReply NotStarted"; + DEBUG_LOG(m_logger) << "onCreateModifyReportReply NotStarted"; break; } case Core::FtReplyState::Error: { - DEBUG_LOG() << "onCreateModifyReportReply Error"; + DEBUG_LOG(m_logger) << "onCreateModifyReportReply Error"; m_ftcTimer->stop(); m_requestHelper->requestReply(replyObject); break; @@ -1731,7 +1731,7 @@ void ReportEdit::onCreateModifyReportReply(const CreateModifyReportReply &replyO void ReportEdit::onFtcTimerTimeout() { - ERROR_LOG() << "onFtcTimerTimeout"; + ERROR_LOG(m_logger) << "onFtcTimerTimeout"; m_requestHelper->failure(); m_ftcTimer->stop(); } @@ -1739,13 +1739,13 @@ void ReportEdit::onFtcTimerTimeout() void ReportEdit::onPreviewReport() { - DEBUG_LOG() << "onPreviewReport"; + DEBUG_LOG(m_logger) << "onPreviewReport"; ReportPreview *dialog = new ReportPreview(m_session, this); if (dialog->init(m_report)) dialog->previewReport(); else - ERROR_LOG() << "Can not preview report!"; + ERROR_LOG(m_logger) << "Can not preview report!"; } @@ -1868,11 +1868,11 @@ void ReportEdit::onSelectInterval() if (res != QDialog::Accepted) { delete dialog; - DEBUG_LOG() << "Select dialog closed by user"; + DEBUG_LOG(m_logger) << "Select dialog closed by user"; return; } - DEBUG_LOG() << "Set new values for start time = " << dialog->getStartTime(); + DEBUG_LOG(m_logger) << "Set new values for start time = " << dialog->getStartTime(); m_ui->dteStart->setMsecsSinceEpoch(dialog->getStartTime()); m_ui->dteEnd->setMsecsSinceEpoch(dialog->getEndTime()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.h index 64c5ca1c8..1774a50a6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_edit.h @@ -68,6 +68,8 @@ class ReportEdit void onCreateModifyReportReply(const CreateModifyReportReply &replyObject) override final; private: + + NGL::INGLLogger &m_logger; void retranslate() override; VisualisationType getVisualization() const; bool initInputs(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval.cpp index 8e1dd839a..240053acd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval.cpp @@ -34,7 +34,7 @@ bool ReportIntervalDialog::init(LtsSession::LtsSessionDataDds *session, const st m_session = session; m_exmDtc = exmDtc; - DEBUG_LOG() << "Exercise id = " << m_session->exerciseId(); + DEBUG_LOG(m_logger) << "Exercise id = " << m_session->exerciseId(); m_phaseModel = new ReportIntervalModel(this); m_phaseModel->initModel(m_session->exerciseId(), m_exmDtc); @@ -63,8 +63,8 @@ void ReportIntervalDialog::selectPhase() m_startTime = phase.beginTime(); m_endTime = phase.endTime(); - ERROR_LOG() << "Start time: " << m_startTime; - ERROR_LOG() << "End time: " << m_endTime; + ERROR_LOG(m_logger) << "Start time: " << m_startTime; + ERROR_LOG(m_logger) << "End time: " << m_endTime; accept(); close(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.cpp index 6d8a610f9..652d1fc0a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.cpp @@ -30,7 +30,7 @@ bool ReportIntervalModel::initModel(int exerciseId, const std::shared_ptrexercisePhases([this](const ExerciseManagement::ExercisePhase &item) { insertRow(item); }); - INFO_LOG() << "initModel - #exercise phases: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #exercise phases: " << m_vecData.size(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.h index b33c7ca61..adcb31311 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_interval_model.h @@ -33,6 +33,8 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override final; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ExerciseManagement::ExercisePhase &data, DataModification modType) const override { if (data.exerciseId() != m_exerciseId) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.cpp index f18a9d1a3..aae6c0a01 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.cpp @@ -143,14 +143,14 @@ void ReportList::onSelectionChanged() void ReportList::onEditReport() { - DEBUG_LOG() << "onEditReport"; + DEBUG_LOG(m_logger) << "onEditReport"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row()); - DEBUG_LOG() << "onEditReport Id = " << data.id(); + DEBUG_LOG(m_logger) << "onEditReport Id = " << data.id(); ReportEdit *dialog = new ReportEdit(m_session, this); if (!dialog->init(data, m_session)) @@ -165,14 +165,14 @@ void ReportList::onEditReport() void ReportList::onShowReport() { - DEBUG_LOG() << "onShowReport"; + DEBUG_LOG(m_logger) << "onShowReport"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row()); - DEBUG_LOG() << "onShowReport Id = " << data.id(); + DEBUG_LOG(m_logger) << "onShowReport Id = " << data.id(); ReportPreview *dialog = new ReportPreview(m_session, this); if (dialog->init(data)) @@ -186,10 +186,10 @@ void ReportList::onRemoveReport() if (!selIndex.isValid()) return; - DEBUG_LOG() << "onRemoveReport"; + DEBUG_LOG(m_logger) << "onRemoveReport"; ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row()); - INFO_LOG() << "Removing report with id = " << data.id(); + INFO_LOG(m_logger) << "Removing report with id = " << data.id(); Core::RemoveElementRequest req(data.id()); m_requestHelper->startSingleRequest([req, this]() { @@ -197,20 +197,20 @@ void ReportList::onRemoveReport() }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to remove report"; + ERROR_LOG(m_logger) << "Failed to remove report"; } void ReportList::slotDelete() { - DEBUG_LOG() << "ReportList::slotDelete"; + DEBUG_LOG(m_logger) << "ReportList::slotDelete"; changeStatus(FileStatus::Deleted); } void ReportList::slotRestore() { - DEBUG_LOG() << "ReportList::slotRestore"; + DEBUG_LOG(m_logger) << "ReportList::slotRestore"; changeStatus(FileStatus::Valid); } @@ -224,39 +224,39 @@ void ReportList::onPrint() void ReportList::onPreviewReport() { - DEBUG_LOG() << "onPreviewReport"; + DEBUG_LOG(m_logger) << "onPreviewReport"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row()); - DEBUG_LOG() << "onPreviewReport Id = " << data.id(); + DEBUG_LOG(m_logger) << "onPreviewReport Id = " << data.id(); ReportPreview *dialog = new ReportPreview(m_session, this); if (dialog->init(data)) dialog->previewReport(); else - ERROR_LOG() << "Can not preview report with id = " << data.id(); + ERROR_LOG(m_logger) << "Can not preview report with id = " << data.id(); } void ReportList::onExportReport() { - DEBUG_LOG() << "onExportReport"; + DEBUG_LOG(m_logger) << "onExportReport"; QModelIndex selIndex = m_ui->widget->currentIndex(); if (!selIndex.isValid()) return; ReportManagement::ReportInfo data = m_model->getRowData(m_ui->widget->currentIndex().row()); - DEBUG_LOG() << "onExportReport Id = " << data.id(); + DEBUG_LOG(m_logger) << "onExportReport Id = " << data.id(); ReportPreview *dialog = new ReportPreview(m_session, this); if (dialog->init(data)) dialog->onExport(); else - ERROR_LOG() << "Can not export report with id = " << data.id(); + ERROR_LOG(m_logger) << "Can not export report with id = " << data.id(); } @@ -274,7 +274,7 @@ void ReportList::changeStatus(const FileStatus &fs) m_requestHelper->startSingleRequest([ = ]() { - DEBUG_LOG() << "Changing status for report id = " << rep.id(); + DEBUG_LOG(m_logger) << "Changing status for report id = " << rep.id(); ReportChangeStatusRequest req; req.id(rep.id()); @@ -287,7 +287,7 @@ void ReportList::changeStatus(const FileStatus &fs) }); if (m_requestHelper->failed()) - ERROR_LOG() << "Failed to change status for report with id = " << rep.id(); + ERROR_LOG(m_logger) << "Failed to change status for report with id = " << rep.id(); } @@ -302,37 +302,37 @@ bool ReportList::fetchInterfaces() { if (!m_session->getDtc(m_dtc)) { - ERROR_LOG() << "Cannot retrieve ReportManagament Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Dtc interface!"; return false; } if (!m_session->getFtc(m_ftc)) { - ERROR_LOG() << "Cannot retrieve ReportManagament Ftc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ReportManagament Ftc interface!"; return false; } if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << "Cannot retrieve ParticipantManagament Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagament Dtc interface!"; return false; } if (!m_session->getDtc(m_aesDtc)) { - ERROR_LOG() << "Cannot retrieve AreaEffectSimulation Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve AreaEffectSimulation Dtc interface!"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - ERROR_LOG() << "Cannot retrieve ProjectDataManagement Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ProjectDataManagement Dtc interface!"; return false; } if (!m_session->getForeignGuiInterface(m_ppmGuiCbxIfc)) { - ERROR_LOG() << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve ParticipantManagement ForeignGuiCombobox interface!"; return false; } if (!m_session->getDtc(m_opmDtc)) { - ERROR_LOG() << "Cannot retrieve OperatorManagement Dtc interface!"; + ERROR_LOG(m_logger) << "Cannot retrieve OperatorManagement Dtc interface!"; return false; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.h index 93f8fc5b5..3abaa7585 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_list.h @@ -44,6 +44,8 @@ public: void onReportChangeStatusReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onSelectionChanged(); bool fetchInterfaces(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_model.h index 32c56ca20..b2d66dc88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_model.h @@ -49,6 +49,7 @@ public: QVariant data(const QModelIndex &, int) const override final; QVariant headerData(int section, Qt::Orientation orientation, int role) const override; protected: +NGL::INGLLogger &m_logger; void onUpdateComboboxFilterData(); void updateComboboxFilterData(const QSet &availableReportTypes, const QSet &availableVisualisationTypes, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.cpp index 387b8c1aa..796190d37 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.cpp @@ -116,7 +116,7 @@ bool ReportPreview::init(const ReportManagement::ReportInfo &report) (m_useAes && m_report.mineAreaIds().size() == 0 && m_report.nbcIds().size() == 0) || (m_useCharge && m_report.chargeTypeIds().size() == 0)) { - ERROR_LOG() << "Empty selection for report: m_report.id() = " << m_report.id(); + ERROR_LOG(m_logger) << "Empty selection for report: m_report.id() = " << m_report.id(); LtsWidgets::LtsMessageDialog::showMessage(this, tr("Not possible to preview this report! No elements selected!")); return false; } @@ -126,8 +126,8 @@ bool ReportPreview::init(const ReportManagement::ReportInfo &report) m_dataModel = AbstractModel::create(m_report, m_session, this); - DEBUG_LOG() << "m_dataModel.rowCount() = " << m_dataModel->rowCount(QModelIndex()); - DEBUG_LOG() << "m_dataModel.columnCount() = " << m_dataModel->columnCount(); + DEBUG_LOG(m_logger) << "m_dataModel.rowCount() = " << m_dataModel->rowCount(QModelIndex()); + DEBUG_LOG(m_logger) << "m_dataModel.columnCount() = " << m_dataModel->columnCount(); m_headerDataModel = new QStandardItemModel(this); @@ -179,7 +179,7 @@ bool ReportPreview::displayReport() displayReportAsTable(); break; default: - ERROR_LOG() << "Unknown visualisation type for report id = " << m_report.id() + ERROR_LOG(m_logger) << "Unknown visualisation type for report id = " << m_report.id() << ": " << m_report.visualisationType().underlying(); return false; } @@ -203,17 +203,17 @@ void ReportPreview::onExport() fileName += reportName; fileName += QStringLiteral(".jpg"); - DEBUG_LOG() << "Trying to export Report to " << fileName; + DEBUG_LOG(m_logger) << "Trying to export Report to " << fileName; bool ret = m_reportDisplay->exportToImage(QSize(1200, 1600), fileName, "jpg"); - INFO_LOG() << "Exported to " << fileName << " - " << ret; + INFO_LOG(m_logger) << "Exported to " << fileName << " - " << ret; if (ret) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly)) { - ERROR_LOG() << "Cannot read file " << fileName; + ERROR_LOG(m_logger) << "Cannot read file " << fileName; return; } @@ -222,8 +222,8 @@ void ReportPreview::onExport() int exeFolderId = m_flmDtc->getExerciseFolderId(m_session->exerciseId()); int folderId = m_flmDtc->findFolder(exeFolderId,QStringLiteral("Reports")); - DEBUG_LOG() << "ExeFolderId = " << exeFolderId; - DEBUG_LOG() << "FolderId = " << folderId; + DEBUG_LOG(m_logger) << "ExeFolderId = " << exeFolderId; + DEBUG_LOG(m_logger) << "FolderId = " << folderId; FileManagement::FileContentModifyRequest req; req.id(0); @@ -247,19 +247,19 @@ void ReportPreview::onExport() if (m_requestHelper->failed()) { - ERROR_LOG() << "Failed to save file content"; + ERROR_LOG(m_logger) << "Failed to save file content"; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Failed to save report image into library.")); } else { - INFO_LOG() << "Successfully exported to FLM (folderId, fileId, fileName) = (" << folderId << ", " << m_requestHelper->getRepliedId() << ", " << reportName; + INFO_LOG(m_logger) << "Successfully exported to FLM (folderId, fileId, fileName) = (" << folderId << ", " << m_requestHelper->getRepliedId() << ", " << reportName; LtsWidgets::LtsMessageDialog::showMessage(this, tr("Successfully saved report image into library.")); } } } else - WARNING_LOG() << "Failed to create report content"; + WARNING_LOG(m_logger) << "Failed to create report content"; } @@ -267,49 +267,49 @@ bool ReportPreview::fetchInterfaces() { if (!m_session->getFtc(m_ftc)) { - DEBUG_LOG() << "Failed to fetch Report Management FTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch Report Management FTC interface"; return false; } if (!m_session->getDtc(m_ppmDtc)) { - DEBUG_LOG() << "Failed to fetch Participant Management DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch Participant Management DTC interface"; return false; } if (!m_session->getDtc(m_exmDtc)) { - DEBUG_LOG() << "Failed to fetch Exercise Management DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch Exercise Management DTC interface"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - DEBUG_LOG() << "Failed to fetch ProjectDataManagement DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch ProjectDataManagement DTC interface"; return false; } if (!m_session->getDtc(m_aesDtc)) { - DEBUG_LOG() << "Failed to fetch AreaEffectSimulation DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch AreaEffectSimulation DTC interface"; return false; } if (!m_session->getDtc(m_ismDtc)) { - DEBUG_LOG() << "Failed to fetch InfrastructureManagement DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch InfrastructureManagement DTC interface"; return false; } if (!m_session->getFtc(m_flmFtc)) { - DEBUG_LOG() << "Failed to fetch FileManagement FTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch FileManagement FTC interface"; return false; } if (!m_session->getDtc(m_flmDtc)) { - DEBUG_LOG() << "Failed to fetch FileManagement DTC interface"; + DEBUG_LOG(m_logger) << "Failed to fetch FileManagement DTC interface"; return false; } @@ -508,7 +508,7 @@ bool ReportPreview::displayReportAsTable() { int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt(); QString title = m_dataModel->data(m_dataModel->index(i, 0), Qt::UserRole).toString(); - DEBUG_LOG() << "Group Id = " << groupId << ", title = " << title; + DEBUG_LOG(m_logger) << "Group Id = " << groupId << ", title = " << title; if (!m_groupIds.contains(groupId)) { @@ -563,7 +563,7 @@ bool ReportPreview::displayReportAsPie() for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i) { int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt(); - DEBUG_LOG() << "Group Id = " << groupId; + DEBUG_LOG(m_logger) << "Group Id = " << groupId; if (!m_groupIds.contains(groupId)) { @@ -593,14 +593,14 @@ bool ReportPreview::displayReportAsLine() for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i) { int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt(); - DEBUG_LOG() << "displayReportAsLine: Group Id = " << groupId; + DEBUG_LOG(m_logger) << "displayReportAsLine: Group Id = " << groupId; if (!m_groupIds.contains(groupId)) { m_groupIds.append(groupId); QString title = m_dataModel->data(m_dataModel->index(i, 0), Qt::UserRole).toString(); - DEBUG_LOG() << "displayReportAsLine: Group title = " << title; + DEBUG_LOG(m_logger) << "displayReportAsLine: Group title = " << title; AbstractProxyModel *proxyModel = new AbstractProxyModel(this); proxyModel->setSourceModel(m_dataModel); @@ -629,7 +629,7 @@ bool ReportPreview::displayReportAsBar() for (int i = 0; i < m_dataModel->rowCount(QModelIndex()); ++i) { int groupId = m_dataModel->data(m_dataModel->index(i, 0), Qt::EditRole).toInt(); - DEBUG_LOG() << "Group Id = " << groupId; + DEBUG_LOG(m_logger) << "Group Id = " << groupId; if (!m_groupIds.contains(groupId)) { @@ -673,7 +673,7 @@ void ReportPreview::addToHeaderData(const QString &strLeft, const QString &strRi item = new QStandardItem(strRight); itemList += item; - DEBUG_LOG() << "Added to header: " << strRight; + DEBUG_LOG(m_logger) << "Added to header: " << strRight; m_headerDataModel->appendRow(itemList); } @@ -983,7 +983,7 @@ KDChart::Chart *ReportPreview::createNewChart(const ChartType &chartType, bool h if (!diagram) { - ERROR_LOG() << "Got unkown chart type. Aborting."; + ERROR_LOG(m_logger) << "Got unkown chart type. Aborting."; return result; } @@ -1124,8 +1124,8 @@ KDChart::Chart *ReportPreview::createNewChart(const ChartType &chartType, bool h int eventTypeId = diagram->model()->data(diagram->model()->index(iRow, 0), Qt::UserRole + 1).toInt(); QColor eventColor = m_eventsModel->eventColor(static_cast(eventTypeId)); - DEBUG_LOG() << "Row " << iRow << ", eventTypeId " << eventTypeId; - DEBUG_LOG() << "Event color " << eventColor.name(); + DEBUG_LOG(m_logger) << "Row " << iRow << ", eventTypeId " << eventTypeId; + DEBUG_LOG(m_logger) << "Event color " << eventColor.name(); for (int iColumn = 0; iColumn < colCount; ++iColumn ) { QModelIndex mi = diagram->model()->index(iRow, iColumn); @@ -1281,7 +1281,7 @@ void EventTypeModel::initModel() QColor EventTypeModel::eventColor(ReportManagement::EventType eventTypeId) const { - DEBUG_LOG() << "eventColor for event type " << eventTypeId; + DEBUG_LOG(m_logger) << "eventColor for event type " << eventTypeId; switch (eventTypeId.underlying()) { case ReportManagement::EventType::VBGChanged: return QColor(Qt::red); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.h index 22cc653a2..096ddf6be 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_preview.h @@ -67,6 +67,8 @@ public: int columnCount(const QModelIndex &parent) const override final; private: + +NGL::INGLLogger &m_logger; }; class ReportPreview : public LtsWidgets::LtsFramelessDialog diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.cpp index 42d00ca39..fe6f62cd6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.cpp @@ -47,12 +47,12 @@ bool InterfaceImpl::fetchInterfaces() { if (!m_session->getDtc(m_dtc)) { - DEBUG_LOG() << "Failed to fetch ReportManagement DTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch ReportManagement DTC interface!"; return false; } if (!m_session->getFtc(m_ftc)) { - DEBUG_LOG() << "Failed to fetch ReportManagement FTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch ReportManagement FTC interface!"; return false; } @@ -60,22 +60,22 @@ bool InterfaceImpl::fetchInterfaces() if (!m_session->getDtc(m_ppmDtc)) { - DEBUG_LOG() << "Failed to fetch ParticipantManagement DTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch ParticipantManagement DTC interface!"; return false; } if (!m_session->getForeignGuiInterface(m_ppmGuiCbxIfc)) { - DEBUG_LOG() << "Failed to fetch ParticipantManagement ForeignGuiComboboxInterface!"; + DEBUG_LOG(m_logger) << "Failed to fetch ParticipantManagement ForeignGuiComboboxInterface!"; return false; } if (!m_session->getDtc(m_aesDtc)) { - DEBUG_LOG() << "Failed to fetch AreaEffectSimulation DTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch AreaEffectSimulation DTC interface!"; return false; } if (!m_session->getDtc(m_pdmDtc)) { - DEBUG_LOG() << "Failed to fetch ProjectDataManagement DTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch ProjectDataManagement DTC interface!"; return false; } @@ -85,7 +85,7 @@ bool InterfaceImpl::fetchInterfaces() if (!m_session->getDtc(m_opmDtc)) { - DEBUG_LOG() << "Failed to fetch OperatorManagement DTC interface!"; + DEBUG_LOG(m_logger) << "Failed to fetch OperatorManagement DTC interface!"; return false; } return true; @@ -478,29 +478,29 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib if (reportId > 0) ri = m_dtc->reportInfo(reportId); - DEBUG_LOG() << "Report Id = " << ri.id(); + DEBUG_LOG(m_logger) << "Report Id = " << ri.id(); if (!m_previewDialog) { - ERROR_LOG() << "Widgets1 not available, playback not possible for report id = "<< ri.id(); + ERROR_LOG(m_logger) << "Widgets1 not available, playback not possible for report id = "<< ri.id(); return false; } if ( !m_previewReport) { - ERROR_LOG() << "Widgets2 not available, playback not possible for report id = "<< ri.id(); + ERROR_LOG(m_logger) << "Widgets2 not available, playback not possible for report id = "<< ri.id(); return false; } if (!m_previewWidget) { - ERROR_LOG() << "Widgets3 not available, playback not possible for report id = "<< ri.id(); + ERROR_LOG(m_logger) << "Widgets3 not available, playback not possible for report id = "<< ri.id(); return false; } if (!m_previewDialog->init(ri)) { - ERROR_LOG() << "Preview dialog could not be initialized!"; + ERROR_LOG(m_logger) << "Preview dialog could not be initialized!"; return false; } m_previewDialog->getReportDisplay()->exportToFile(QStringLiteral("/tmp/rep.pdf")); @@ -549,7 +549,7 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu const int reportId = attributes.value(QStringLiteral("ReportId")).toInt(0); if (reportId < 1) { - ERROR_LOG() << "No valid report id given"; + ERROR_LOG(m_logger) << "No valid report id given"; pExportNotifier->setExportFailed(); return false; } @@ -563,14 +563,14 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu ReportManagement::ReportInfo ri = m_dtc->reportInfo(reportId); if (ri.fileStatus() != ReportManagement::FileStatus::Valid) { - ERROR_LOG() << "Report with id " << reportId << " was deleted"; + ERROR_LOG(m_logger) << "Report with id " << reportId << " was deleted"; pExportNotifier->setExportFailed(); return false; } if (!m_previewDialog->init(ri)) { - ERROR_LOG() << "Could not init preview for report id = " << reportId; + ERROR_LOG(m_logger) << "Could not init preview for report id = " << reportId; pExportNotifier->setExportFailed(); return false; } @@ -578,14 +578,14 @@ bool InterfaceImpl::TopicReplayInterface::exportTopic(const QJsonObject &attribu KDReports::Report* rp = m_previewDialog->getReportDisplay(); if (rp == nullptr) { - ERROR_LOG() << "Could not retrieve KDReport for report id = " << reportId; + ERROR_LOG(m_logger) << "Could not retrieve KDReport for report id = " << reportId; pExportNotifier->setExportFailed(); return false; } rp->exportToFile(strPathToFile + strFileName); pExportNotifier->setExportSuccessful(strFileName); - INFO_LOG() << "Successfully exported topic for report with id " << reportId; + INFO_LOG(m_logger) << "Successfully exported topic for report with id " << reportId; rp->deleteLater(); return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.h index a4749d6b1..3bfc056cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ReportManagement/Gui/ReportViewer/rep_report_viewer_gui_plugin.h @@ -63,6 +63,8 @@ public: TopicEditorBase::TopicEditor *createTopicEditor(const TopicEditorBase::TopicData &data) override; private: + +NGL::INGLLogger &m_logger; LtsWidgets::LtsDialog *onShowReportList(QWidget *parent); LtsWidgets::LtsDialog *onShowAddReport(QWidget *parent, const ReportType &reportType); QString getAESNbcReportTypeName(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.cpp index a09e0b7d5..b9876d4d8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.cpp @@ -103,7 +103,7 @@ QString SaaChooser::rdesktopCodeToString(RdesktopCodes code) SaaChooser::RdesktopCodes SaaChooser::getRdesktopInterpretation(int code) const { - DEBUG_LOG()<<">> getRdesktopInterpretation: rdesktop error code: "<> getRdesktopInterpretation: rdesktop error code: "<> process finished!! exitCode: "<> process finished!! exitCode: "<(sender()) || process.isNull()) return; - ERROR_LOG() << ">> SAA Remote desktop: error:" << process->readAllStandardError(); + ERROR_LOG(m_logger) << ">> SAA Remote desktop: error:" << process->readAllStandardError(); }); @@ -184,7 +184,7 @@ void SaaChooser::slotSelectSaa() { if (process != qobject_cast(sender()) || process.isNull()) return; - INFO_LOG() << ">> SAA Remote desktop: " << process->readAllStandardOutput(); + INFO_LOG(m_logger) << ">> SAA Remote desktop: " << process->readAllStandardOutput(); }); @@ -196,7 +196,7 @@ void SaaChooser::slotSelectSaa() if (process->state() != QProcess::Running) LtsWidgets::LtsGlobalWaitDialog::getInstance()->done(); - WARNING_LOG()<<">> saa with id ("<> saa with id ("<> saa with id ("<> saa with id ("<done(); @@ -219,11 +219,11 @@ void SaaChooser::slotSelectSaa() << QStringLiteral("-p")<< assetProps.password << saaIp; - DEBUG_LOG()<<">> Process rdesktop: "<> Process rdesktop: "<start(program, args); if (!process->waitForStarted()) { - ERROR_LOG() << "Could not start saa process "<program() <<" " << process->arguments().join(QStringLiteral(" ")); + ERROR_LOG(m_logger) << "Could not start saa process "<program() <<" " << process->arguments().join(QStringLiteral(" ")); process->deleteLater(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.h index 1efe97dd9..352c86e0a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/SAAChooser/saa_chooser.h @@ -62,6 +62,7 @@ private slots: void enaDisa(); private: + NGL::INGLLogger &m_logger; void tableColumnOrganiserSetting() override; Ui::SaaChooser *m_ui; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.cpp index 8bde0936b..c315245b0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.cpp @@ -17,30 +17,30 @@ SaaDialogModel::SaaDialogModel(QObject *parent) : LtsWidgets::LtsAbstractTableModel({tr("Id"), tr("Name"), tr("scenario is running"), tr("Used by Party")}, parent) , m_ppmDtc(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } SaaDialogModel::~SaaDialogModel() { stopPing(); - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool SaaDialogModel::initModel(LtsSession::LtsSession *session) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_session = session; if (!m_session->getDtc(m_ppmDtc)) { - ERROR_LOG() << " ppmDtc not set!!! " << m_logger.getLoggerName(); + ERROR_LOG(m_logger) << " ppmDtc not set!!! " << m_logger.getLoggerName(); return false; } if (!m_session->getDtc(m_asmDtc)) { - ERROR_LOG() << " asmDtc not set!!! " << m_logger.getLoggerName(); + ERROR_LOG(m_logger) << " asmDtc not set!!! " << m_logger.getLoggerName(); return false; } @@ -67,13 +67,13 @@ bool SaaDialogModel::initModel(LtsSession::LtsSession *session) onDataChanged(asset, DataModification::eAdded); }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void SaaDialogModel::pingAllSaa() { - DEBUG_LOG() << "====> pingAllSaa: saaList count: " << m_saaPingItems.count(); + DEBUG_LOG(m_logger) << "====> pingAllSaa: saaList count: " << m_saaPingItems.count(); if (m_saaPingItems.isEmpty()) return; @@ -98,7 +98,7 @@ void SaaDialogModel::pingAllSaa() { ParticipantManagement::Party party; getPartyWithAssetId(pi.assetId, party); - DEBUG_LOG() << " ping assetId: " << pi.assetId << " reacheable ? " << (exitCode == 0) << " Szenar ? " << (party.id() > 0) << " Ip: " << pi.host + DEBUG_LOG(m_logger) << " ping assetId: " << pi.assetId << " reacheable ? " << (exitCode == 0) << " Szenar ? " << (party.id() > 0) << " Ip: " << pi.host << " PortNumb: " << pi.port; pi.reachable = (exitCode == 0); pi.process->kill(); @@ -122,13 +122,13 @@ void SaaDialogModel::saaConnected(int assetId, bool state) void SaaDialogModel::stopPing() { - WARNING_LOG() << ">> stop ping saa..."; + WARNING_LOG(m_logger) << ">> stop ping saa..."; for (auto &pi : m_saaPingItems) { if (pi.process) { - WARNING_LOG() << ">> kill process saaId: " << pi.assetId; + WARNING_LOG(m_logger) << ">> kill process saaId: " << pi.assetId; pi.process->kill(); pi.process->deleteLater(); pi.process = nullptr; @@ -146,7 +146,7 @@ void SaaDialogModel::updateView() void SaaDialogModel::onPartyDataChanged(const ParticipantManagement::Party &data, DataModification modType) { Q_UNUSED(modType) - DEBUG_LOG() << ">>> SAA Dialog Party Data Changed: " << data.id() << " properties: " << data.properties(); + DEBUG_LOG(m_logger) << ">>> SAA Dialog Party Data Changed: " << data.id() << " properties: " << data.properties(); update(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.h index 5ff9eaef7..959964d6c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SAAs/Gui/saa_dialog_model.h @@ -41,6 +41,7 @@ public: void pingAllSaa(); void saaConnected(int assetId, bool state); protected: + NGL::INGLLogger &m_logger; void stopPing(); void updateView(); void onPartyDataChanged(const ParticipantManagement::Party &data, DataModification modType); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.cpp index f44a69798..f31be71fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.cpp @@ -50,7 +50,7 @@ bool ScreenRecordingDialog::init(LtsSession::LtsSession *session) if (m_baseLayoutPtr == nullptr) { - ERROR_LOG() << "base layout is nullptr"; + ERROR_LOG(m_logger) << "base layout is nullptr"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.h index 3d7c6b2c3..7efcd2d41 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_dialog.h @@ -78,6 +78,7 @@ private slots: private: + NGL::INGLLogger &m_logger; Ui::ScreenRecordingDialog *m_ui{nullptr}; LtsWidgets::LtsBaseLayoutWidget *m_baseLayoutPtr{nullptr}; QWidget *m_recAreaWidget{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.cpp index 0137c0b40..2dba1dcef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.cpp @@ -188,7 +188,7 @@ bool ScreenRecordingWorker::takeScreenshot(const QFileInfo &fileInfo, LtsWidgets { if (!s_imageFormats.contains(fileInfo.suffix())) { - DEBUG_LOG() << "file format not supported (must be .jpg, .jpeg or .png)"; + DEBUG_LOG(m_logger) << "file format not supported (must be .jpg, .jpeg or .png)"; return false; } @@ -205,7 +205,7 @@ bool ScreenRecordingWorker::takeScreenshot(const QFileInfo &fileInfo, LtsWidgets if (!proc->waitForStarted()) { - ERROR_LOG() << QLatin1String("Could not start process '") + EXECUTABLE + ERROR_LOG(m_logger) << QLatin1String("Could not start process '") + EXECUTABLE + QLatin1String("' with arguments '") + args.join(QLatin1String("', '")) + QLatin1String("'\n"); proc->deleteLater(); return false; @@ -213,7 +213,7 @@ bool ScreenRecordingWorker::takeScreenshot(const QFileInfo &fileInfo, LtsWidgets if (!proc->waitForFinished()) { - ERROR_LOG() << QLatin1String("Could not finish process '") + EXECUTABLE + ERROR_LOG(m_logger) << QLatin1String("Could not finish process '") + EXECUTABLE + QLatin1String("' with arguments '") + args.join(QLatin1String("', '")) + QLatin1String("'\n"); proc->deleteLater(); return false; @@ -226,7 +226,7 @@ bool ScreenRecordingWorker::stopRecording() { if (!m_isBusy) { - DEBUG_LOG() << "no running process"; + DEBUG_LOG(m_logger) << "no running process"; return false; } @@ -247,13 +247,13 @@ bool ScreenRecordingWorker::onStartRecording(const RecordingData &data) { if (m_isBusy) { - DEBUG_LOG() << "process is already running"; + DEBUG_LOG(m_logger) << "process is already running"; return false; } if (data.filePath.suffix() != s_videoFormat) { - DEBUG_LOG() << "file format not supported (must be .mp4)"; + DEBUG_LOG(m_logger) << "file format not supported (must be .mp4)"; return false; } @@ -263,7 +263,7 @@ bool ScreenRecordingWorker::onStartRecording(const RecordingData &data) if (!m_recProc->waitForStarted()) { - ERROR_LOG() << QLatin1String("Could not start process '") + EXECUTABLE + ERROR_LOG(m_logger) << QLatin1String("Could not start process '") + EXECUTABLE + QLatin1String("' with arguments '") + data.toStringList().join(QLatin1String("', '")) + QLatin1String("'\n"); m_recProc->deleteLater(); m_isBusy = false; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.h index a8922e3fa..b23f20236 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ScreenRecording/Gui/ScreenRecorder/screen_recording_worker.h @@ -102,6 +102,7 @@ public slots: private: + NGL::INGLLogger &m_logger; QProcess *m_recProc{nullptr}; bool m_isBusy{false}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.cpp index 941a2d548..1db0cba94 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.cpp @@ -68,13 +68,13 @@ bool ServiceManagementDialog::init(const std::shared_ptrlbNoServices->hide(); - INFO_LOG() << "initModel - #group information: " << groupInfo.size(); + INFO_LOG(m_logger) << "initModel - #group information: " << groupInfo.size(); @@ -128,7 +128,7 @@ GroupWidget *ServiceManagementDialog::addGroup(const Core::ServiceGroupType &gro QVBoxLayout *l = qobject_cast(m_ui->groupLayoutWidget->layout()); if (!l) - WARNING_LOG() << "ServiceManagementDialog::addGroup: group layout failed, cannot add group"; + WARNING_LOG(m_logger) << "ServiceManagementDialog::addGroup: group layout failed, cannot add group"; else l->addWidget(group, 0, Qt::AlignTop); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.h index 0c0a2410b..1186968d7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceManagement/Gui/ServiceEdit/scm_dialog.h @@ -61,6 +61,8 @@ public: } private: + +NGL::INGLLogger &m_logger; void retranslate() override; static QString craftBaseName(const QString &server, const QString &exercise) { return server + QLatin1Char('.') + exercise + QLatin1Char('.'); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_dialog.h index 7c3cab5f0..2d15420cf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_dialog.h @@ -40,6 +40,8 @@ public slots: void onPrint(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.cpp index e7331c960..4a2637d1a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.cpp @@ -42,7 +42,7 @@ bool EquipmentErrorRegistrationModel::initModel(LtsSession::LtsSession *session, if (!m_exmDtc->enableExercise()) { - ERROR_LOG() << " Could not enable Exercise Data-Topic in EXM DTC!"; + ERROR_LOG(m_logger) << " Could not enable Exercise Data-Topic in EXM DTC!"; return false; } @@ -135,7 +135,7 @@ void EquipmentErrorRegistrationModel::onLiveEvent(const ExerciseEventManagement: { if (ev.eventTypeId() != ProjectDataManagement::EventType_def::EquipmentErrorReport) return; - INFO_LOG() << "Event EquipmentNumber=" << ev.equipmentNumber(); + INFO_LOG(m_logger) << "Event EquipmentNumber=" << ev.equipmentNumber(); insertRow(event2Entry(ev)); emit chunksUpdated(m_chunksReceived, m_chunksRequested); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.h index 1fa0eeb2e..ddda28cc0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/EquipmentErrorRegistration/smo_equipment_error_registration_model.h @@ -52,6 +52,8 @@ signals: void chunksUpdated(int chunksReceived, int chunksRequested); private: + +NGL::INGLLogger &m_logger; void onRequestedDataAvailable(TimeLineManagement::TimelineDataProviderInterface *request); void onLiveEvent(const ExerciseEventManagement::Event &ev); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_dialog.h index c28e1b8b2..ab7fa32ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_dialog.h @@ -74,6 +74,8 @@ private slots: void onSelectionChanged(); private: + +NGL::INGLLogger &m_logger; bool hasValidPosition(); void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.cpp index 350085bf5..a674e84df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.cpp @@ -67,44 +67,44 @@ bool HgrAndMineSearchModel::initModel(LtsSession::LtsSession *session, if (!m_ppmDtc->enableEquipmentSystemEventFtcReply()) { - ERROR_LOG() << " Could not enable EquipmentSystemEventFtcReply Data-Topic in PPM DTC!"; + ERROR_LOG(m_logger) << " Could not enable EquipmentSystemEventFtcReply Data-Topic in PPM DTC!"; return false; } if (!m_ppmFtc->enableEquipmentSystemEventData()) { - ERROR_LOG() << " Could not enable EquipmentSystemEventData Function-Topic in PPM FTC!"; + ERROR_LOG(m_logger) << " Could not enable EquipmentSystemEventData Function-Topic in PPM FTC!"; return false; } if (!m_exmDtc->enableExercise()) { - ERROR_LOG() << " Could not enable Exercise Data-Topic in EXM DTC!"; + ERROR_LOG(m_logger) << " Could not enable Exercise Data-Topic in EXM DTC!"; return false; } if (!m_pdmDtc->enableEquipmentSystemEventFilter()) { - ERROR_LOG() << " Could not enable EquipmentSystemEventFilter Data-Topic in PDM DTC!"; + ERROR_LOG(m_logger) << " Could not enable EquipmentSystemEventFilter Data-Topic in PDM DTC!"; return false; } if (!m_pdmDtc->enableEventFilterHgrMineSearch()) { - ERROR_LOG() << " Could not enable EventFilterHgrMineSearch Data-Topic in PDM DTC!"; + ERROR_LOG(m_logger) << " Could not enable EventFilterHgrMineSearch Data-Topic in PDM DTC!"; return false; } if (!m_aesDtc->enableMineArea()) { - ERROR_LOG() << " Could not enable MineArea Data-Topic in AES DTC!"; + ERROR_LOG(m_logger) << " Could not enable MineArea Data-Topic in AES DTC!"; return false; } if (!m_aesDtc->enableDusMineState()) { - ERROR_LOG() << " Could not enable DusMineState Data-Topic in AES DTC!"; + ERROR_LOG(m_logger) << " Could not enable DusMineState Data-Topic in AES DTC!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.h index 9252505f1..0d0a5c035 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/HgrAndMineSearch/smo_hgr_and_mine_search_model.h @@ -67,6 +67,8 @@ signals: void chunksUpdated(int chunksReceived, int chunksRequested); protected: + +NGL::INGLLogger &m_logger; QIcon iconFromPartyId(int partyId) const; QVariant stringFromPartyId(int partyId) const; void onUpdateComboboxFilterData(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.cpp index 22afb1846..bb3da64da 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.cpp @@ -145,7 +145,7 @@ void BaseEquipmentCheck::onMappedEquipTimeout(int participantId, QTimer *timer) void BaseEquipmentCheck::onSelectionChanged() { - DEBUG_LOG() << "onSelectionChanged"; + DEBUG_LOG(m_logger) << "onSelectionChanged"; bool enable = false; const auto selectedIndexes = view()->selectedRows(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.h index f8558276d..361094cfc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_equipment_check.h @@ -66,6 +66,8 @@ protected slots: void onPrint(); protected: + +NGL::INGLLogger &m_logger; virtual LtsDataView::LtsDataView *view() = 0; virtual const LtsDataView::LtsDataView *view() const = 0; protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.cpp index a0b3dc0a5..9152f5201 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.cpp @@ -66,7 +66,7 @@ bool BasePlayerModel::initModel(LtsSession::LtsSessionDataDds *session) if (!session) return false; - DEBUG_LOG() << "**** initModel"; + DEBUG_LOG(m_logger) << "**** initModel"; m_session = session; m_partitionTime = m_session->partitionTime(); @@ -482,7 +482,7 @@ int BasePlayerModel::findRowForEquipmentNumber(int equipNo) const if (data.equipmentNumber == equipNo) { - DEBUG_LOG() << "** findRowForEquipmentNumber: " + DEBUG_LOG(m_logger) << "** findRowForEquipmentNumber: " << equipNo << "--> " << i; return i; } @@ -493,7 +493,7 @@ int BasePlayerModel::findRowForEquipmentNumber(int equipNo) const void BasePlayerModel::onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "**** onDynamicParticipantChanged: " << data; + DEBUG_LOG(m_logger) << "**** onDynamicParticipantChanged: " << data; int row = findRowForId(data.participantId()); if (row < 0) @@ -687,7 +687,7 @@ void BasePlayerModel::onPositionChanged(const ParticipantManagement::Participant { if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "**** onPositionChanged: " << position; + DEBUG_LOG(m_logger) << "**** onPositionChanged: " << position; m_positions[position.participantId()] = position; @@ -718,7 +718,7 @@ void BasePlayerModel::onBiteChanged(const ParticipantManagement::Bite &bite, { if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "**** onBiteChanged: " << bite; + DEBUG_LOG(m_logger) << "**** onBiteChanged: " << bite; m_bites[bite.equipmentNumber()] = bite; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.h index 8c22e4d25..f4fa35778 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_base_player_model.h @@ -126,6 +126,8 @@ protected slots: void onUpdatePositionAge(); protected: + +NGL::INGLLogger &m_logger; void updateUsedPartyIds(); void setBiteResult(int row, qint64 sampleTime, const QString &biteResult, const QString &warnings); QString getBitResult(const ParticipantManagement::Bite &bite, int equipmnetNumber) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.cpp index 1d37edc24..e2cdb3797 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.cpp @@ -22,7 +22,7 @@ BiteModel::BiteModel(QObject *parent) bool BiteModel::initModel(const std::shared_ptr &ppmDtc, const std::shared_ptr &pdmDtc) { - DEBUG_LOG() << "initModel"; + DEBUG_LOG(m_logger) << "initModel"; m_ppmDtc = ppmDtc; if (!m_ppmDtc) @@ -103,7 +103,7 @@ QString BiteModel::checkBit(const ParticipantManagement::Bite &bite, quint32 bit break; } } - DEBUG_LOG() << "** name: " << name; + DEBUG_LOG(m_logger) << "** name: " << name; QString ret; if (available) @@ -148,7 +148,7 @@ QString BiteModel::checkBatteryBit(int state, qint64 bitValue) const break; } } - DEBUG_LOG() << "** name: " << name; + DEBUG_LOG(m_logger) << "** name: " << name; if ((state & bitValue) == bitValue) return name; @@ -223,7 +223,7 @@ int BiteModel::findRowForEquipmentNumber(int equipNo) const { if (m_vecData.at(i).equipmentNumber() == equipNo) { - DEBUG_LOG() << "findRowForEquipmentNumber: " + DEBUG_LOG(m_logger) << "findRowForEquipmentNumber: " << equipNo << "-->" << i; return i; } @@ -234,7 +234,7 @@ int BiteModel::findRowForEquipmentNumber(int equipNo) const void BiteModel::biteDataChanged(const ParticipantManagement::Bite &data, DataModification modType) { - DEBUG_LOG() << "biteDataChanged"; + DEBUG_LOG(m_logger) << "biteDataChanged"; const int equipNo = data.equipmentNumber(); const int row = findRowForEquipmentNumber(equipNo); @@ -244,7 +244,7 @@ void BiteModel::biteDataChanged(const ParticipantManagement::Bite &data, case DataModification::eAdded: case DataModification::eModified: { - DEBUG_LOG() << " Modified bite msg"; + DEBUG_LOG(m_logger) << " Modified bite msg"; if (row < 0) { @@ -265,7 +265,7 @@ void BiteModel::biteDataChanged(const ParticipantManagement::Bite &data, } case DataModification::eRemoved: { - DEBUG_LOG() << " Remove bite msg"; + DEBUG_LOG(m_logger) << " Remove bite msg"; removeRow(row); break; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.h index 97209e2c8..1d46587ff 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_bite_model.h @@ -54,6 +54,8 @@ private slots: private: + +NGL::INGLLogger &m_logger; QString checkBit(const ParticipantManagement::Bite &bite, quint32 bitValue) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.cpp index 6ed8eb6aa..770446c86 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.cpp @@ -25,7 +25,7 @@ CtasErrorModel:: CtasErrorModel(QObject *parent) bool CtasErrorModel::initModel(const std::shared_ptr &ppmDtc) { - DEBUG_LOG() << "initModel"; + DEBUG_LOG(m_logger) << "initModel"; if (!ppmDtc) return false; @@ -252,11 +252,11 @@ QString CtasErrorModel::telegramId2Text(int id) const void CtasErrorModel::ctasErrorChanged(const ParticipantManagement::CtaError &data, DataModification modType) { - DEBUG_LOG() << "ctasErrorChanged"; + DEBUG_LOG(m_logger) << "ctasErrorChanged"; if (modType == DataModification::eAdded || modType == DataModification::eModified) { - DEBUG_LOG() << " Added Fehlermeldung GFD"; + DEBUG_LOG(m_logger) << " Added Fehlermeldung GFD"; insertRow(data); return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.h index 8f66516cb..0bc5f9b30 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_ctas_error_model.h @@ -39,6 +39,8 @@ private slots: DataModification modType); private: + +NGL::INGLLogger &m_logger; QString telegramId2Text(int id) const; std::shared_ptr m_ppmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.cpp index 9068a83a9..844c6619d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.cpp @@ -259,11 +259,11 @@ void ServiceMonitorDialog::onTableViewClicked(const QModelIndex &index) delete dlg; } } - TRACE_LOG() << Q_FUNC_INFO << " START, index=" << index.row() << " - " << index.column(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, index=" << index.row() << " - " << index.column(); if (!m_ui->ltsDataView->sourceModel()) return; onParticipantClicked(participantId(index)); - TRACE_LOG() << Q_FUNC_INFO << " END, index=" << index.row() << " - " << index.column(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, index=" << index.row() << " - " << index.column(); } void ServiceMonitorDialog::onEditItem() @@ -300,7 +300,7 @@ void ServiceMonitorDialog::onAllAuto() void ServiceMonitorDialog::onTableViewSelectionChanged(const QItemSelection &selected) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_monitor == Monitor::Egcu) { @@ -326,12 +326,12 @@ void ServiceMonitorDialog::onTableViewSelectionChanged(const QItemSelection &sel { onParticipantClicked(participantId(mil.first())); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ServiceMonitorDialog::onParticipantClicked(int participantId) { - TRACE_LOG() << Q_FUNC_INFO << " START, participantId=" << participantId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, participantId=" << participantId; if (!m_session) return; @@ -344,9 +344,9 @@ void ServiceMonitorDialog::onParticipantClicked(int participantId) sitMapGuiIfc->removeObjectIndicator(); else if (!sitMapGuiIfc->objectIndicatorToParticipant(participantId)) - ERROR_LOG() << Q_FUNC_INFO << " objectIndicatorToParticipant failed for participantId = " << participantId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " objectIndicatorToParticipant failed for participantId = " << participantId; - TRACE_LOG() << Q_FUNC_INFO << " END, participantId=" << participantId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, participantId=" << participantId; } void ServiceMonitorDialog::leaveEvent(QEvent *e) @@ -367,7 +367,7 @@ void ServiceMonitorDialog::onPrint() int ServiceMonitorDialog::participantId(const QModelIndex &index) const { - TRACE_LOG() << Q_FUNC_INFO << " START, index=" << index.row() << " - " << index.column(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, index=" << index.row() << " - " << index.column(); if (!m_ui->ltsDataView->sourceModel()) return -1; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.h index 0b2b9220d..0c4c443cf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_dialog.h @@ -70,6 +70,8 @@ private slots: void onShowContextMenu(const QPoint &position); private: + +NGL::INGLLogger &m_logger; void setAllOverrides(InfrastructureManagement::EffectOverride eo); void retranslate() override; void onPrint(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.cpp index 67dc7575c..c246d5344 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.cpp @@ -252,7 +252,7 @@ bool EgcuEdit::apply() } properties= structureElement.properties(); - DEBUG_LOG() << "structureElementId=" << m_egcuData.mountingPoint.id() + DEBUG_LOG(m_logger) << "structureElementId=" << m_egcuData.mountingPoint.id() << " properties=" << properties; QJsonArray arrRelays; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.h index 73ab17cc4..158022acf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_edit.h @@ -47,6 +47,7 @@ public: bool apply() override; private: +NGL::INGLLogger &m_logger; void retranslate() override; static void getRoomIds(QTreeWidgetItem *twi, QVariantList &vl); void updateRelays(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.cpp index 71dccd168..b6619ba04 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.cpp @@ -98,7 +98,7 @@ QVariant EgcuModel::data(const QModelIndex &index, int role) const switch (index.column()) { case Id: - DEBUG_LOG() << "EGCU DATA= " + DEBUG_LOG(m_logger) << "EGCU DATA= " << " instrumentationAsset.id=" << instrumentationAsset.id() << " hostname=" << instrumentationAsset.hostname() << " name=" << instrumentationAsset.name() @@ -234,7 +234,7 @@ QString EgcuModel::getOverridesString(const EgcuData &data) const QString EgcuModel::getRelaisStates(const EgcuData &data) const { - DEBUG_LOG() << "getRelaisStates" + DEBUG_LOG(m_logger) << "getRelaisStates" << " offlineTime=" << data.relayState.offlineTime() << " stateTime=" << data.relayState.stateTime() << " mountingPoint.id=" << data.mountingPoint.id() @@ -253,14 +253,14 @@ QString EgcuModel::getRelaisStates(const EgcuData &data) const QStringList sl; Buildings::RelayState relayState = m_bldDtc->relayState(data.mountingPointAsset.assetId()); - DEBUG_LOG() << "relayState id=" << relayState.id() + DEBUG_LOG(m_logger) << "relayState id=" << relayState.id() << " offlineTime=" << relayState.offlineTime() << " stateTime=" << relayState.stateTime() << " relayStates().size=" << relayState.relayStates().size(); if (relayState.offlineTime() > relayState.stateTime()) { - DEBUG_LOG() << QString(tr("Connection Error")); + DEBUG_LOG(m_logger) << QString(tr("Connection Error")); sl << QString(tr("Connection Error")); sl << QStringLiteral(" - "); } @@ -270,7 +270,7 @@ QString EgcuModel::getRelaisStates(const EgcuData &data) const { AssetManagement::RelayInfo relayInfo = m_asmDtc->relayInfo(relayState.relayStates()[i].id()); bool state = relayState.relayStates().at(i).state(); - DEBUG_LOG() << "relayInfo id=" << relayInfo.id() + DEBUG_LOG(m_logger) << "relayInfo id=" << relayInfo.id() << " name=" << relayInfo.name() << " property=" << relayInfo.property() << " state=" << state; @@ -359,7 +359,7 @@ bool EgcuModel::initModel(LtsSession::LtsSession *session) initData(); - DEBUG_LOG() << "initModel successfull"; + DEBUG_LOG(m_logger) << "initModel successfull"; return true; } @@ -370,7 +370,7 @@ QModelIndex EgcuModel::getIndexOfVisableRootItem() const bool EgcuModel::mseHasMountedAsset(const InfrastructureManagement::MainStructureElement &mse, InfrastructureManagement::MountingPointType mpType) { - DEBUG_LOG() << "mseHasMountedBsm mse.id=" << mse.id() + DEBUG_LOG(m_logger) << "mseHasMountedBsm mse.id=" << mse.id() << " name=" << mse.name(); for (const InfrastructureManagement::StructureElement &element : std::as_const(mse.elements())) { @@ -378,7 +378,7 @@ bool EgcuModel::mseHasMountedAsset(const InfrastructureManagement::MainStructure if (element.mountingPointTypeId() != mpType) continue; - DEBUG_LOG() << "Mountpoint BSM:" << element.id() + DEBUG_LOG(m_logger) << "Mountpoint BSM:" << element.id() << " name=" << element.name(); if (isMounted(element.id())) return true; @@ -388,10 +388,10 @@ bool EgcuModel::mseHasMountedAsset(const InfrastructureManagement::MainStructure bool EgcuModel::isMounted(int mountingPointId) { - DEBUG_LOG() << "isMounted id=" << mountingPointId; + DEBUG_LOG(m_logger) << "isMounted id=" << mountingPointId; for (const InfrastructureManagement::MountingPointAsset &asset : std::as_const(m_mountingPointAssets)) { - DEBUG_LOG() << "assetId=" << asset.structureElementId() + DEBUG_LOG(m_logger) << "assetId=" << asset.structureElementId() << " mountingPointId=" << mountingPointId; if (asset.structureElementId() == mountingPointId) return true; @@ -424,7 +424,7 @@ void EgcuModel::initData() if ( !m_dtc->isElementAssignedToExercise( mse, m_session->exerciseId())) { - DEBUG_LOG() << "EgcuModel::initData mseId=" << mse.id() << " not in Exercise"; + DEBUG_LOG(m_logger) << "EgcuModel::initData mseId=" << mse.id() << " not in Exercise"; continue; } @@ -456,9 +456,9 @@ void EgcuModel::initData() parentIndex = treeIndices.value(path.at(path.size() - 2), indexFromItem(m_rootItem)); if (!parentIndex.isValid()) { - INFO_LOG() << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); + INFO_LOG(m_logger) << "Did not find parent for structure element with id " << currentElement.id() << " mseid: " << mse.id(); for (const InfrastructureManagement::StructureElement &se : mse.elements()) - INFO_LOG() << " se: " << se.id() << ", " << se.name(); + INFO_LOG(m_logger) << " se: " << se.id() << ", " << se.name(); } } else @@ -496,7 +496,7 @@ NGLTreeItem* EgcuModel::createItemFromMountingPoint(const InfrastructureManageme { - DEBUG_LOG() << "mountingPoint Id=" << mountingPoint.buildingId() + DEBUG_LOG(m_logger) << "mountingPoint Id=" << mountingPoint.buildingId() << " properties=" << mountingPoint.properties() << " associatedAssetId=" << mountingPoint.associatedAssetId() << " isUsed=" << mountingPoint.data().isUsed() @@ -540,7 +540,7 @@ NGLTreeItem* EgcuModel::createItemFromMountingPoint(const InfrastructureManageme NGLTreeItem* EgcuModel::createItemFromStructureElement(const InfrastructureManagement::StructureElement ¤tElement) { - DEBUG_LOG() << "createItemFromStructureElement" << currentElement.displayName(); + DEBUG_LOG(m_logger) << "createItemFromStructureElement" << currentElement.displayName(); return new NGLTreeItem(QVariant::fromValue(currentElement)); } @@ -1191,7 +1191,7 @@ bool EgcuModel::readAllowance(InfrastructureManagement::EffectOverride eo, const QMap EgcuModel::setSelectedStructureElements(const QVector &structureElementIds) { QMap map; - ERROR_LOG() << "structureElementIds.size=" << structureElementIds.size() + ERROR_LOG(m_logger) << "structureElementIds.size=" << structureElementIds.size() << " id[0]=" << structureElementIds[0]; findStructureElementChildrenByIds(m_rootItem, structureElementIds, map); return map; @@ -1299,13 +1299,12 @@ void EgcuData::update(const InfrastructureManagement::InstrumentationAsset &ia, instrumentationAsset = ia; } -EgcuData::EgcuData(const InfrastructureManagement::InstrumentationAsset &ia, const InfrastructureManagement::MountingPoint &mp, const InfrastructureManagement::MainStructureElement &mse, const Buildings::RelayState &rs, const InfrastructureManagement::MountingPointAsset &mpa, const QSet &relayIds) - : instrumentationAsset(ia) +EgcuData::EgcuData(const InfrastructureManagement::InstrumentationAsset &ia, const InfrastructureManagement::MountingPoint &mp, const InfrastructureManagement::MainStructureElement &mse, const Buildings::RelayState &rs, const InfrastructureManagement::MountingPointAsset &mpa, const QSet &relayIds) : instrumentationAsset(ia) , mountingPoint(mp) , mainStructureElement(mse) , relayState(rs) - , mountingPointAsset(mpa) -{ + , mountingPointAsset(mpa), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { for (int relayId : relayIds) effectOverrides.insert(relayId, InfrastructureManagement::EffectOverride_def::Automatic); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.h index fc3e1922f..5d644ad89 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_egcu_model.h @@ -150,6 +150,8 @@ signals: void invalidateFilter(const QModelIndex &mi = QModelIndex()); private: + +NGL::INGLLogger &m_logger; void initData(); void removeUnused(NGLTreeItem *item); bool isMountpointEgcu(const QByteArray &properties); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.cpp index 7e84931f0..332768146 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.cpp @@ -211,7 +211,7 @@ void FaultMessageDialog::onSpecificsEquipmentChanged(const TrainingAreaBaseOC::S m_ownEquipmentId = data.equipmentNumber(); if (m_ownEquipmentId <= 0) - WARNING_LOG() << "EquipmentNumber " << data.equipmentNumber() << " is not present "; + WARNING_LOG(m_logger) << "EquipmentNumber " << data.equipmentNumber() << " is not present "; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.h index 5e7630032..ba60fd25a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_fault_message_dialog.h @@ -36,6 +36,8 @@ public: } private: + +NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.cpp index fed61c964..99aa24608 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.cpp @@ -20,7 +20,7 @@ ManipulationModel::ManipulationModel(QObject *parent) bool ManipulationModel::initModel(const std::shared_ptr &ppmDtc, const std::shared_ptr &pdmDtc) { - DEBUG_LOG() << "----- initModel"; + DEBUG_LOG(m_logger) << "----- initModel"; if (!pdmDtc || !ppmDtc) return false; @@ -76,7 +76,7 @@ QVariant ManipulationModel::data(const QModelIndex &index, void ManipulationModel::manipulationDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "manipulationDataChanged: " << data.manipulation().size() << ", " << modType; + DEBUG_LOG(m_logger) << "manipulationDataChanged: " << data.manipulation().size() << ", " << modType; const bool isManipulated = data.manipulation().size() > 0; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.h index d1df8317d..cfa3bdb49 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_manipulation_model.h @@ -53,6 +53,8 @@ private slots: void participantChanged(const ParticipantManagement::Participant &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; ManipulationData buildManipulationData(const ParticipantManagement::DynamicParticipantData &data) const; QString buildCanDeviceString(const std::vector& manipulations) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.cpp index d9d756175..853738400 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.cpp @@ -132,7 +132,7 @@ bool StructureElementEdit::apply() QByteArray content_neu; properties= m_structureElement.properties(); - DEBUG_LOG() << "structureElementId=" << m_structureElement.id() + DEBUG_LOG(m_logger) << "structureElementId=" << m_structureElement.id() << " properties=" << properties << " MountingPointType=" << m_structureElement.mountingPointTypeId() << " structureElementTypeId=" << m_structureElement.structureElementTypeId(); @@ -149,7 +149,7 @@ bool StructureElementEdit::apply() return true; m_structureElement.properties(content_neu.toStdString()); - ERROR_LOG() << "properties=" << m_structureElement.properties() + ERROR_LOG(m_logger) << "properties=" << m_structureElement.properties() << " name=" << m_structureElement.name() << " seId=" << m_structureElement.id() << " mountingPointId=" << m_structureElement.mountingPointId(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.h index 41f6c5420..b5681b7b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/ServiceMonitor/Gui/Monitors/smo_structure_element_edit.h @@ -43,6 +43,7 @@ public: bool apply() override; private: +NGL::INGLLogger &m_logger; void retranslate() override; void updateComboBoxes(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.cpp index 13c199803..e7d790e99 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.cpp @@ -83,11 +83,10 @@ namespace SituationMap { -AdapterDds::AdapterDds(QObject *parent) - : QObject(parent) -{ - TRACE_LOG() << Q_FUNC_INFO << " START DDDDDDDD" ; - TRACE_LOG() << Q_FUNC_INFO << " END" ; +AdapterDds::AdapterDds(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START DDDDDDDD" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; } AdapterDds::~AdapterDds() @@ -120,7 +119,7 @@ AdapterDds::~AdapterDds() bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer &movementTrackMgr, bool resourceMode) { - TRACE_LOG() << Q_FUNC_INFO << " START" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" ; if (!map || !pluginProvider) return false; @@ -143,7 +142,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(&m_map->layerFactory(), m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -169,7 +168,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -183,7 +182,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } } @@ -243,7 +242,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if(!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -274,7 +273,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -288,7 +287,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -302,7 +301,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(contIdx)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -316,7 +315,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -330,7 +329,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -355,7 +354,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } int drawOrder = 0; @@ -374,7 +373,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -391,7 +390,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -403,16 +402,16 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed (ChargeEffectToMap)"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed (ChargeEffectToMap)"; else - DEBUG_LOG() << Q_FUNC_INFO << " ChargeEffect2Map for ChargeEffect prepared"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ChargeEffect2Map for ChargeEffect prepared"; } } if (m_map->mode() == Mode::Mode_3D) { - INFO_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral"; initRenderer3D_AesCentral_Booby(layernameAesCentral, {AreaEffectSimulation::AesType_def::AtBoobyTrap, AreaEffectSimulation::AesType_def::AtOffRouteMine}); } @@ -427,7 +426,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG()<(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG()<(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -474,7 +473,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -488,7 +487,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } { @@ -502,7 +501,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -519,7 +518,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -536,7 +535,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -554,7 +553,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -570,7 +569,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointer(aesType)] = sim2Map; } if (!sim2Map->init(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -609,9 +608,9 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed (EmergencyCallToMap)"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed (EmergencyCallToMap)"; else - DEBUG_LOG() << Q_FUNC_INFO << " EmergencyCallToMap for AlmEmergencyCalls prepared"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " EmergencyCallToMap for AlmEmergencyCalls prepared"; } } @@ -627,7 +626,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointervalue(QStringLiteral("SituationMap"), QStringLiteral("enableDamageVisualizationAtBuilding2Map")).toBool(); if (!m_buildings->init(m_pluginProvider, enableDamageVisualization)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -641,7 +640,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } m_specialAreas = QSharedPointer(new SpecialAreaToSituationMap(m_map->objectFactory(), @@ -649,7 +648,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -658,7 +657,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider, resourceMode)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -667,7 +666,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider, resourceMode)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; if (!resourceMode) @@ -678,7 +677,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; m_mseBridges = QSharedPointer(new MSEBridgeToMap(m_map->objectFactory(), @@ -686,7 +685,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -695,7 +694,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; const bool bIsOfTypeOrganizer = (m_pluginProvider->operatorId() == 99) || @@ -709,7 +708,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; } @@ -719,7 +718,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -730,14 +729,14 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointerinit(m_map, m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; if ((m_map->mode() == Mode::Mode_3D) && (m_buildingContamination.isNull())) m_buildingContamination = QSharedPointer(new BuildingContamination(drawOrder++, this)); if (m_buildingContamination) if (!m_buildingContamination->init(m_map, m_pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed"; @@ -776,7 +775,7 @@ bool AdapterDds::init(Map *map, PluginProvider *pluginProvider, QPointermode() != Mode::Mode_3D) return false; - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; @@ -800,15 +799,15 @@ bool AdapterDds::initRenderer3D_AesExtrusion() connect(m_map, &Map::partysChangedDelayed, this, [this] () { - DEBUG_LOG() << Q_FUNC_INFO << " partysChangedDelayed ********"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " partysChangedDelayed ********"; bool successAes = assignUniqueValueRendererAesCentral3DExtrusion(layernameAes); if (successAes) - INFO_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion okay" << " ('" << layernameAes << "')"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion okay" << " ('" << layernameAes << "')"; else for (int i=0; i<5; ++i) - ERROR_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion failed" << " ('" << layernameAes << "')"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion failed" << " ('" << layernameAes << "')"; @@ -824,14 +823,14 @@ bool AdapterDds::initRenderer3D_AesExtrusion() bool successAes = assignUniqueValueRendererAesCentral3DExtrusion(layernameAes); if (successAes) - INFO_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion okay" << " ('" << layernameAes << "')"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion okay" << " ('" << layernameAes << "')"; else for (int i=0; i<5; ++i) - ERROR_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion failed" << " ('" << layernameAes << "')"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral3DExtrusion failed" << " ('" << layernameAes << "')"; }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -844,18 +843,18 @@ bool AdapterDds::initRenderer3D_AesCentral_Booby(const QString &layernameAesCent - INFO_LOG() << Q_FUNC_INFO << " START, layernameAesCentral=" << layernameAesCentral; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, layernameAesCentral=" << layernameAesCentral; connect(m_map, &Map::partysChangedDelayed, this, [this, layernameAesCentral, aesTypesForReRunIfPartyColorChanges] () { - DEBUG_LOG() << Q_FUNC_INFO << " partysChangedDelayed ********"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " partysChangedDelayed ********"; bool successAesCentral = assignUniqueValueRendererAesCentral(layernameAesCentral); if (successAesCentral) - DEBUG_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral okay" << " ('" << layernameAesCentral << "')"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral okay" << " ('" << layernameAesCentral << "')"; else for (int i=0; i<5; ++i) - ERROR_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral failed" << " ('" << layernameAesCentral << "')"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral failed" << " ('" << layernameAesCentral << "')"; @@ -873,18 +872,18 @@ bool AdapterDds::initRenderer3D_AesCentral_Booby(const QString &layernameAesCent bool successAesCentral = assignUniqueValueRendererAesCentral(layernameAesCentral); if (successAesCentral) - DEBUG_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral okay" << " ('" << layernameAesCentral << "')"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral okay" << " ('" << layernameAesCentral << "')"; else for (int i=0; i<5; ++i) - ERROR_LOG() << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral failed" << " ('" << layernameAesCentral << "')"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " assignUniqueValueRendererAesCentral failed" << " ('" << layernameAesCentral << "')"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } bool AdapterDds::assignUniqueValueRendererAesCentral(const QString &layername) { - TRACE_LOG() << Q_FUNC_INFO << " START, layername ='" << layername << "'" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, layername ='" << layername << "'" ; QVector typeVec; typeVec << LayerFactory::UniqueValueDataAesCentral::TYPE::CONE; @@ -893,7 +892,7 @@ bool AdapterDds::assignUniqueValueRendererAesCentral(const QString &layername) const PartyIdToColorFunctor::ColorMap &colorMap = m_map->partyIdToColorFunctor().colorMap(); if (colorMap.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << " colorMap is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " colorMap is empty"; return false; } QVector colVec; @@ -904,7 +903,7 @@ bool AdapterDds::assignUniqueValueRendererAesCentral(const QString &layername) for (const PartyIdToColorFunctor::PartyData &partyData : std::as_const(colorMap)) { - DEBUG_LOG() << Q_FUNC_INFO << " partyName=" << partyData.m_name << "'" << " partyColor=" << partyData.m_color.name() << "'"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " partyName=" << partyData.m_name << "'" << " partyColor=" << partyData.m_color.name() << "'"; colVec << partyData.m_color; @@ -972,7 +971,7 @@ bool AdapterDds::assignUniqueValueRendererAesCentral(const QString &layername) } } - INFO_LOG() << Q_FUNC_INFO + INFO_LOG(m_logger) << Q_FUNC_INFO << " typeVec.size() = " << typeVec.size() << " colVec.size() = " << colVec.size() << " (colorMap.size() = " << colorMap.size() << ")" << " radiuss.size() = " << radiuss.size() @@ -990,27 +989,27 @@ bool AdapterDds::assignUniqueValueRendererAesCentral(const QString &layername) uvCont); } - TRACE_LOG() << Q_FUNC_INFO << " END, layername ='" << layername << "'" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, layername ='" << layername << "'" ; return success; } bool AdapterDds::assignUniqueValueRendererAesCentral3DExtrusion(const QString &layername) { - DEBUG_LOG() << Q_FUNC_INFO << " START, layername ='" << layername << "'" ; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, layername ='" << layername << "'" ; QVector colVec; { const PartyIdToColorFunctor::ColorMap &colorMap = m_map->partyIdToColorFunctor().colorMap(); if (colorMap.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << " colorMap is empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " colorMap is empty"; return false; } colVec.reserve(colorMap.size()); for (const PartyIdToColorFunctor::PartyData &partyData : colorMap) { - DEBUG_LOG() << Q_FUNC_INFO << " partyName=" << partyData.m_name << "'" << " partyColor=" << partyData.m_color.name() << "'"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " partyName=" << partyData.m_name << "'" << " partyColor=" << partyData.m_color.name() << "'"; colVec << partyData.m_color << partyData.m_lightColor; } @@ -1062,18 +1061,18 @@ bool AdapterDds::assignUniqueValueRendererAesCentral3DExtrusion(const QString &l fieldnames, uvCont); - TRACE_LOG() << Q_FUNC_INFO << " END, layername ='" << layername << "'" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, layername ='" << layername << "'" << " success = " << success; return success; } bool AdapterDds::run() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_isRunning) { - ERROR_LOG() << Q_FUNC_INFO << " already running" ; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " already running" ; return false; } @@ -1129,11 +1128,11 @@ bool AdapterDds::run() m_isRunning = success; - INFO_LOG() << Q_FUNC_INFO << " connect to SymbolDictionary::changed" ; + INFO_LOG(m_logger) << Q_FUNC_INFO << " connect to SymbolDictionary::changed" ; connect(&m_map->symbolDictionary(), &AdvancedSymbology::SymbolDictionary::changed, this, &AdapterDds::startChangedDelayTimer, Qt::UniqueConnection); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return success; } @@ -1144,12 +1143,12 @@ bool AdapterDds::isRunning() const bool AdapterDds::stop() { - TRACE_LOG() << Q_FUNC_INFO << " START" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" ; if (m_pluginProvider && !m_pluginProvider->isSessionValid()) { m_isRunning = false; - DEBUG_LOG() << Q_FUNC_INFO << " no session anymore: ignore 'stop' -> return"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " no session anymore: ignore 'stop' -> return"; return false; } @@ -1195,13 +1194,13 @@ bool AdapterDds::stop() m_isRunning = false; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void AdapterDds::clearObjects() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const QList &sim2Map = listOfSim2Map(); for (Sim2SituationMapBase *item : std::as_const(sim2Map)) @@ -1247,23 +1246,23 @@ void AdapterDds::clearObjects() - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } ResourceManagerMode AdapterDds::resourceManagerMode() const { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_mountingPoints) return ResourceManagerMode::Undefined; ResourceManagerMode rmm = m_mountingPoints->resourceManagerMode(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return rmm; } bool AdapterDds::setResourceManagerMode(ResourceManagerMode rmm) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_mountingPoints) return false; @@ -1272,26 +1271,26 @@ bool AdapterDds::setResourceManagerMode(ResourceManagerMode rmm) emit resourceManagerModeChanged(m_mountingPoints->resourceManagerMode()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return success; } bool AdapterDds::showExpiredEmergencyCalls(bool bShowExpired) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_emergencyCalls) return false; m_emergencyCalls->showExpired(bShowExpired); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } bool AdapterDds::uniqueMapId2SimId(UniqueMapId uniqueMapIdIn, int32_t &simIdOut) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " uniqueMapId=" << uniqueMapIdIn; if (!SituationMap::isUniqueMapIdValid(uniqueMapIdIn)) @@ -1309,7 +1308,7 @@ bool AdapterDds::uniqueMapId2SimId(UniqueMapId uniqueMapIdIn, int32_t &simIdOut) bool AdapterDds::unifiedMapObjectData(UniqueMapId uniqueMapIdIn, UnifiedMapObjectData &umodOut) const { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " uniqueMapId=" << uniqueMapIdIn; if (!SituationMap::isUniqueMapIdValid(uniqueMapIdIn)) @@ -1332,14 +1331,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdParticipant(int32_t simId) const } RefPointer AdapterDds::simId2Participant(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId ; UniqueMapId mapId = simId2UniqueMapIdParticipant(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1355,14 +1354,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdAes(int32_t simId) const } RefPointer AdapterDds::simId2Aes(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId ; UniqueMapId mapId = simId2UniqueMapIdAes(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1375,14 +1374,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdBuilding(int32_t simId) const } RefPointer AdapterDds::simId2Building(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdBuilding(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1394,14 +1393,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdBridge(int32_t simId) const } RefPointer AdapterDds::simId2Bridge(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdBridge(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1414,14 +1413,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdMountingPoint(int32_t simId) const RefPointer AdapterDds::simId2MountingPoint(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdMountingPoint(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1433,14 +1432,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdGuezIed(int32_t simId) const } RefPointer AdapterDds::simId2GuezIed(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdGuezIed(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1453,14 +1452,14 @@ UniqueMapId AdapterDds::simId2UniqueMapIdChargeEffect(int32_t simId) const RefPointer AdapterDds::simId2ChargeEffect(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdChargeEffect(simId); if (!isUniqueMapIdValid(mapId)) return RefPointer(); RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1473,7 +1472,7 @@ UniqueMapId AdapterDds::simId2UniqueMapIdTrainingArea(int32_t simId) const RefPointer AdapterDds::simId2TrainingArea(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdTrainingArea(simId); if (!isUniqueMapIdValid(mapId)) @@ -1481,7 +1480,7 @@ RefPointer AdapterDds::simId2TrainingArea(int32_t simId) using MAP_T = TrainingAreaToSituationMap::MAP_T; RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1494,7 +1493,7 @@ UniqueMapId AdapterDds::simId2UniqueMapIdSpecialArea(int32_t simId) const RefPointer AdapterDds::simId2SpecialArea(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdSpecialArea(simId); if (!isUniqueMapIdValid(mapId)) @@ -1502,7 +1501,7 @@ RefPointer AdapterDds::simId2SpecialArea(int32_t simId) using MAP_T = SpecialAreaToSituationMap::MAP_T; RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1515,7 +1514,7 @@ UniqueMapId AdapterDds::simId2UniqueMapIdShootbackArea(int32_t simId) const RefPointer AdapterDds::simId2ShootbackArea(int32_t simId) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << simId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << simId; UniqueMapId mapId = simId2UniqueMapIdShootbackArea(simId); if (!isUniqueMapIdValid(mapId)) @@ -1523,7 +1522,7 @@ RefPointer AdapterDds::simId2ShootbackArea(int32_t simId) using MAP_T = ShootbackAreaToSituationMap::MAP_T; RefPointer mapObj = m_map->objectFactory().get(mapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1551,7 +1550,7 @@ UniqueMapId AdapterDds::simId2UniqueMapId(MapObjectType mot, int32_t simId) cons case MapObjectType::MOT_Aes: case MapObjectType::MOT_GuezIed: { - ERROR_LOG() << " not supported yet!!!"; + ERROR_LOG(m_logger) << " not supported yet!!!"; Q_FALLTHROUGH(); } default: @@ -1589,7 +1588,7 @@ QVector AdapterDds::simIds2UniqueMapIds(MapObjectType mot, QVector< case MapObjectType::MOT_Aes: case MapObjectType::MOT_GuezIed: { - ERROR_LOG() << " not supported yet!!!"; + ERROR_LOG(m_logger) << " not supported yet!!!"; Q_FALLTHROUGH(); } default: @@ -1614,7 +1613,7 @@ RefPointer AdapterDds::simId2MapObject(MapObjectType mot, int return {}; RefPointer mapObj = m_map->objectFactory().get(uniqueMapId); - TRACE_LOG() << Q_FUNC_INFO << " END" ; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" ; return mapObj; } @@ -1640,7 +1639,7 @@ Sim2SituationMapBase *AdapterDds::situationMapBase(MapObjectType mot) const case MapObjectType::MOT_Building: case MapObjectType::MOT_GuezIed: { - ERROR_LOG() << " not supported yet!!!"; + ERROR_LOG(m_logger) << " not supported yet!!!"; Q_FALLTHROUGH(); } default: @@ -1778,7 +1777,7 @@ bool AdapterDds::setOwnPositionVisible(bool enable) void AdapterDds::onSymbolDictionaryChanged() { - INFO_LOG() << Q_FUNC_INFO << " START, workspaceId" << m_pluginProvider->workspaceId(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, workspaceId" << m_pluginProvider->workspaceId(); if (m_particpants) m_particpants->reRenderObjects(); @@ -1798,7 +1797,7 @@ void AdapterDds::onSymbolDictionaryChanged() - INFO_LOG() << Q_FUNC_INFO << " END, workspaceId" << m_pluginProvider->workspaceId(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " END, workspaceId" << m_pluginProvider->workspaceId(); } @@ -1864,7 +1863,7 @@ void AdapterDds::onMapObjectChangedUpdateDrawOrder(UniqueMapId uniqueMapId) RefPointer mapObj = objFac.get(curUniqueMapId); if (!mapObj) { - WARNING_LOG() << Q_FUNC_INFO << " not found in objFac" + WARNING_LOG(m_logger) << Q_FUNC_INFO << " not found in objFac" << " curUniqueMapId = " << curUniqueMapId; return; } @@ -1872,10 +1871,10 @@ void AdapterDds::onMapObjectChangedUpdateDrawOrder(UniqueMapId uniqueMapId) mapObj->setDrawOrder(++drawOrderCounter); if (!mapObj->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " debugInfo='" << mapObj->debugInfo() << "'" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " debugInfo='" << mapObj->debugInfo() << "'" << " updateView failed"; } - INFO_LOG() << Q_FUNC_INFO << " debugInfo='" << mapObj->debugInfo() << "'" + INFO_LOG(m_logger) << Q_FUNC_INFO << " debugInfo='" << mapObj->debugInfo() << "'" << " set DrawOder to: " << drawOrderCounter; } } @@ -1889,7 +1888,7 @@ void AdapterDds::onMapObjectRemoved(UniqueMapId uniqueMapId) void AdapterDds::onParticipantOwnPositionChanged(const Point3D &newPos, int64_t sampleTime) { - DEBUG_LOG() << "Own Position Changed"; + DEBUG_LOG(m_logger) << "Own Position Changed"; if(!m_map) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.h index 2623106d3..1b6be4ebf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/adapter_dds.h @@ -234,12 +234,14 @@ private slots: void onParticipantOwnPositionChanged(const Point3D &newPos, int64_t sampleTime); private: + NGL::INGLLogger &m_logger; void startChangedDelayTimer(); void startOwnPositionOutdatedTimer(); QList listOfSim2Map() const; QList listOfAes2Map() const; private: + NGL::INGLLogger &m_logger; bool m_isShowOwnPosition{true}; bool m_isRunning{false}; QTimer *m_changedDelayTimer{nullptr}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.cpp index 830b58034..650fd5437 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.cpp @@ -135,22 +135,21 @@ public: -BuildingContamination::BuildingContamination(int drawOrder, QObject *parent) - : BaseClass(parent) - , d(new Private()) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; +BuildingContamination::BuildingContamination(int drawOrder, QObject *parent) : BaseClass(parent) + , d(new Private()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; d->m_drawOrder = drawOrder; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } BuildingContamination::~BuildingContamination() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; this->stop(); delete d; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingContamination::init(Map *map, PluginProvider *pluginProvider) @@ -178,17 +177,17 @@ void BuildingContamination::removeAllObjects() bool BuildingContamination::run() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!d->m_map) { - ERROR_LOG() << Q_FUNC_INFO << " no m_map"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_map"; return false; } if (!m_bldDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no m_bldDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_bldDtc"; return false; } @@ -223,7 +222,7 @@ bool BuildingContamination::run() RefPointer cube = d->getCreateCube(buildingId, floorId); if (!cube) - ERROR_LOG() << Q_FUNC_INFO << " no cube created"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no cube created"; cube->setVisibility(d->m_visible); cube->setDrawOrder(d->m_drawOrder); @@ -234,7 +233,7 @@ bool BuildingContamination::run() cube->setHeight(height); bool success = cube->updateView(); - INFO_LOG() << Q_FUNC_INFO << " cube->updateView " << success; + INFO_LOG(m_logger) << Q_FUNC_INFO << " cube->updateView " << success; }; @@ -245,15 +244,15 @@ bool BuildingContamination::run() } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void BuildingContamination::stop() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_bldDtc->disconnect(this); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingContamination::isVisible() const @@ -269,7 +268,7 @@ bool BuildingContamination::setVisible(bool visible) void BuildingContamination::onBuildingStateChanged(const Buildings::BuildingState &data, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const int buildingId = data.id(); @@ -286,19 +285,19 @@ void BuildingContamination::onBuildingStateChanged(const Buildings::BuildingStat break; } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void BuildingContamination::onResetBuildingState() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; d->removeCube(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void BuildingContamination::updateBuilding(int buildingId) { - DEBUG_LOG() << "update Building " << buildingId; + DEBUG_LOG(m_logger) << "update Building " << buildingId; const Buildings::BuildingState &bos = m_bldDtc->buildingState(buildingId); @@ -307,7 +306,7 @@ void BuildingContamination::updateBuilding(int buildingId) const auto contaminations = bos.contaminationStates(); - DEBUG_LOG() << "Statecount " << contaminations.size(); + DEBUG_LOG(m_logger) << "Statecount " << contaminations.size(); QSet contaminatedFloors; @@ -320,7 +319,7 @@ void BuildingContamination::updateBuilding(int buildingId) rooms.insert(room); } - DEBUG_LOG() << "contaminated rooms " << rooms.size(); + DEBUG_LOG(m_logger) << "contaminated rooms " << rooms.size(); for (int room : rooms) { @@ -331,7 +330,7 @@ void BuildingContamination::updateBuilding(int buildingId) } } - DEBUG_LOG() << "contaminated floors " << contaminatedFloors.size(); + DEBUG_LOG(m_logger) << "contaminated floors " << contaminatedFloors.size(); @@ -357,7 +356,7 @@ void BuildingContamination::updateBuilding(int buildingId) const bool isContaminaed = contaminatedFloors.contains(floorId); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " floorId=" << floorId << " height=" << height << " partyId=" << isContaminaed; @@ -383,7 +382,7 @@ void BuildingContamination::updateBuilding(int buildingId) cube->setHeight(height); if (!cube->updateView()) - ERROR_LOG() << Q_FUNC_INFO << " cube->updateView() failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " cube->updateView() failed"; } @@ -409,7 +408,7 @@ int BuildingContamination::findFloorIdByRoomId(int roomId) noexcept(false) InfrastructureManagement::StructureElement roomSe; if (!m_ismDtc->getStructureElementById(roomId, roomSe)) { - ERROR_LOG() << "getStructureElementById roomId=" << roomId << " not found"; + ERROR_LOG(m_logger) << "getStructureElementById roomId=" << roomId << " not found"; return -1; } @@ -457,12 +456,12 @@ bool BuildingContamination::getRoom(int roomSeId, InfrastructureManagement::Stru PositionCont BuildingContamination::retrieveBuildingGeometry(int buildingId, int floorId) const { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " buildingId=" << buildingId << " floorId=" << floorId; if (!m_ismDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no m_ismDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_ismDtc"; return PositionCont(); } @@ -474,7 +473,7 @@ PositionCont BuildingContamination::retrieveBuildingGeometry(int buildingId, int { const InfrastructureManagement::MainFootprint &mainFootprint = m_ismDtc->mainFootprint(buildingId); - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); relPositions.reserve(mainFootprint.elements().size()); @@ -581,7 +580,7 @@ PositionCont BuildingContamination::retrieveBuildingGeometry(int buildingId, int const Esri::ArcGISRuntime::ImmutablePointCollection &pointCollection = immutablePart.points(); const int size = pointCollection.size(); - INFO_LOG() << " pointCollection.size = " << pointCollection.size() + INFO_LOG(m_logger) << " pointCollection.size = " << pointCollection.size() << " - buildingId = " << buildingId << ", mse.name = " << mse.name(); @@ -597,7 +596,7 @@ PositionCont BuildingContamination::retrieveBuildingGeometry(int buildingId, int } #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return absPositionsGeo; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.h index e0ba6cd3c..2399d623d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_contamination.h @@ -56,6 +56,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; void updateBuilding(int buildingId); int findFloorIdByRoomId(int roomId); bool getRoom(int roomSeId, InfrastructureManagement::StructureElement &roomSe); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.cpp index 2db76d882..aa7a9711b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.cpp @@ -211,22 +211,21 @@ public: -BuildingOwnership::BuildingOwnership(int drawOrder, QObject *parent) - : BaseClass(parent) - , d(new Private()) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; +BuildingOwnership::BuildingOwnership(int drawOrder, QObject *parent) : BaseClass(parent) + , d(new Private()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; d->m_drawOrder = drawOrder; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } BuildingOwnership::~BuildingOwnership() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; this->stop(); delete d; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingOwnership::init(Map *map, PluginProvider *pluginProvider) @@ -256,17 +255,17 @@ void BuildingOwnership::removeAllObjects() bool BuildingOwnership::run() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!d->m_map) { - ERROR_LOG() << Q_FUNC_INFO << " no m_map"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_map"; return false; } if (!m_cesDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no m_cesDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_cesDtc"; return false; } @@ -301,7 +300,7 @@ bool BuildingOwnership::run() RefPointer cube = d->getCreateCube(buildingId, floorId); if (!cube) - ERROR_LOG() << Q_FUNC_INFO << " no cube created"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no cube created"; cube->setVisibility(d->m_visible); cube->setDrawOrder(d->m_drawOrder); @@ -312,7 +311,7 @@ bool BuildingOwnership::run() cube->setHeight(height); bool success = cube->updateView(); - INFO_LOG() << Q_FUNC_INFO << " cube->updateView " << success; + INFO_LOG(m_logger) << Q_FUNC_INFO << " cube->updateView " << success; }; @@ -323,15 +322,15 @@ bool BuildingOwnership::run() } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void BuildingOwnership::stop() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_cesDtc->disconnect(this); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingOwnership::isVisible() const @@ -347,7 +346,7 @@ bool BuildingOwnership::setVisible(bool visible) void BuildingOwnership::onBuildingOwnershipChanged(const CentralEffectSimulation::BuildingOwnership &data, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const int buildingId = data.buildingId(); @@ -364,14 +363,14 @@ void BuildingOwnership::onBuildingOwnershipChanged(const CentralEffectSimulation break; } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void BuildingOwnership::onResetBuildingOwnership() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; d->removeCube(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void BuildingOwnership::updateBuilding(int buildingId) @@ -416,7 +415,7 @@ void BuildingOwnership::updateBuilding(int buildingId) const int partyId = floor2Party.value(floorId, -1); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " floorId=" << floorId << " height=" << height << " partyId=" << partyId; @@ -436,7 +435,7 @@ void BuildingOwnership::updateBuilding(int buildingId) cube->setHeight(height); if (!cube->updateView()) - ERROR_LOG() << Q_FUNC_INFO << " cube->updateView() failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " cube->updateView() failed"; } } @@ -447,12 +446,12 @@ PositionCont BuildingOwnership::retrieveBuildingGeometry(int buildingId, int flo PositionCont BuildingOwnership::retrieveBuildingGeometryInternal(int buildingId, int floorId) const { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " buildingId=" << buildingId << " floorId=" << floorId; if (!m_ismDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no m_ismDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_ismDtc"; return PositionCont(); } @@ -464,7 +463,7 @@ PositionCont BuildingOwnership::retrieveBuildingGeometryInternal(int buildingId, { const InfrastructureManagement::MainFootprint &mainFootprint = m_ismDtc->mainFootprint(buildingId); - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); relPositions.reserve(mainFootprint.elements().size()); @@ -588,7 +587,7 @@ PositionCont BuildingOwnership::retrieveBuildingGeometryInternal(int buildingId, } #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return absPositionsGeo; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.h index 02d19755c..4e258e53a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/building_ownership.h @@ -56,6 +56,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; friend class BuildingGeometryCache; void updateBuilding(int buildingId); PositionCont retrieveBuildingGeometry(int buildingId, int floorId) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.cpp index 44fa09c03..c5653e742 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.cpp @@ -33,10 +33,10 @@ bool DusMineStateProxy::init(PluginProvider *pluginProvider) bool DusMineStateProxy::run() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_aesDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no dtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no dtc"; return false; } @@ -59,9 +59,9 @@ bool DusMineStateProxy::run() void DusMineStateProxy::stop() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; this->disconnect(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool DusMineStateProxy::dusMineStateAndPositionDatas(const std::function &cb) @@ -94,7 +94,7 @@ bool DusMineStateProxy::handleChanged(const AreaEffectSimulation::DusMineState & if (ddsData.id() != 0) return false; - TRACE_LOG() << Q_FUNC_INFO << " START, ddsData.id()=" << ddsData.id() + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, ddsData.id()=" << ddsData.id() << " ddsData.mines().size() = " << ddsData.mines().size(); if (modType == DataModification::eRemoved) @@ -112,7 +112,7 @@ bool DusMineStateProxy::handleChanged(const AreaEffectSimulation::AesItemView &d if (ddsData.id() != AreaEffectSimulation::AesType::AtMineAreaSingleMines) return false; - TRACE_LOG() << Q_FUNC_INFO << " START, ddsData.id()=" << ddsData.id() + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, ddsData.id()=" << ddsData.id() << " ddsData.form().size() = " << ddsData.form().size(); if (modType == DataModification::eRemoved) @@ -158,14 +158,14 @@ bool DusMineStateProxy::publishNewMap() m_map = mapContVeryNew; - DEBUG_LOG() << "Publishing new dus-mine map to situationMap adapter"; + DEBUG_LOG(m_logger) << "Publishing new dus-mine map to situationMap adapter"; return true; } const QMap DusMineStateProxy::getFromDds() { - TRACE_LOG() << Q_FUNC_INFO << " START, ddsData.id()=" << m_lastDusMineState.id() + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, ddsData.id()=" << m_lastDusMineState.id() << " ddsData.mines().size() = " << m_lastDusMineState.mines().size(); QMap mapCont; @@ -178,7 +178,7 @@ const QMap DusMineStateProxy::getFromDds() int idx = 0; for (const AreaEffectSimulation::DusMine &mine : mines) { - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " idx=" << idx++ << ", eqId=" << mine.eqId() << ", chargeTypeId=" << mine.chargeTypeId(); @@ -188,14 +188,14 @@ const QMap DusMineStateProxy::getFromDds() if (size != m_lastItemView.form().size()) { - ERROR_LOG() << Q_FUNC_INFO << " ddsData.id()=" << m_lastDusMineState.id() + ERROR_LOG(m_logger) << Q_FUNC_INFO << " ddsData.id()=" << m_lastDusMineState.id() << " size does not match" << " ddsData.mines().size() = " << mines.size() << " itemView.form().size() = " << m_lastItemView.form().size(); return mapCont; } - DEBUG_LOG() << Q_FUNC_INFO << " ddsData.id()=" << m_lastDusMineState.id() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ddsData.id()=" << m_lastDusMineState.id() << " size ::" << " ddsData.mines().size() = " << mines.size() << " itemView.form().size() = " << m_lastItemView.form().size(); @@ -211,7 +211,7 @@ const QMap DusMineStateProxy::getFromDds() pos ); - DEBUG_LOG() << Q_FUNC_INFO << " i=" << i << ", id/eqId=" << dusMine.eqId() << ", pos=" << pos; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " i=" << i << ", id/eqId=" << dusMine.eqId() << ", pos=" << pos; mapCont.insert(dusMine.eqId(), dmsDdsData); } @@ -248,7 +248,7 @@ bool MineAreaNull2SituationMap::init(PluginProvider *pluginProvider) { m_dusMineStateProxy = new DusMineStateProxy(this); if (!m_dusMineStateProxy->init(pluginProvider)) - ERROR_LOG() << Q_FUNC_INFO << " init failed for DusMineStateProxy"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " init failed for DusMineStateProxy"; } return true; } @@ -256,11 +256,11 @@ bool MineAreaNull2SituationMap::init(PluginProvider *pluginProvider) bool MineAreaNull2SituationMap::run() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_dusMineStateProxy) { - ERROR_LOG() << Q_FUNC_INFO << " no DusMineStateProxy"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no DusMineStateProxy"; return false; } @@ -275,7 +275,7 @@ bool MineAreaNull2SituationMap::run() handleChanged(data, DataModification::eAdded); }); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -330,10 +330,10 @@ bool MineAreaNull2SituationMap::unifiedMapObjectData(UniqueMapId uniqueMapId, Un bool MineAreaNull2SituationMap::updateVisibility(const Aes2SituationMap::DDS_TYPE &ddsData, RefPointer mapObj) { - TRACE_LOG() << Q_FUNC_INFO << " START, simId=" << getSimId(ddsData); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, simId=" << getSimId(ddsData); if (!BaseClass::updateVisibility(ddsData, mapObj)) { - ERROR_LOG() << Q_FUNC_INFO << " BaseClass::updateVisibility failed, simId=" << getSimId(ddsData); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " BaseClass::updateVisibility failed, simId=" << getSimId(ddsData); return false; } @@ -350,9 +350,9 @@ bool MineAreaNull2SituationMap::updateVisibility(const Aes2SituationMap::DDS_TYP } if (bUpdateView && !mapObj->updateView()) - ERROR_LOG()<< Q_FUNC_INFO << " simId = " << getSimId(ddsData) << " XXXX updateView failed"; + ERROR_LOG(m_logger)<< Q_FUNC_INFO << " simId = " << getSimId(ddsData) << " XXXX updateView failed"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -378,7 +378,7 @@ void MineAreaNull2SituationMap::onAesDisplayFilterChanged(AreaEffectSimulation:: bool MineAreaNull2SituationMap::updateElementImpl(const Sim2SituationMap::DDS_T &ddsData, RefPointer mapObj) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; mapObj->setVisibility(ObjectAppearance::Tactical, false); @@ -413,7 +413,7 @@ bool MineAreaNull2SituationMap::updateElementImpl(const Sim2SituationMap::DDS_T mapObj->setTextModifier(Participant::TextModifier::M_HigherFormation, QString::number(simId_eqId)); updateVisibility(ddsData, mapObj); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.h index ca837a005..76224f5f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/mine_area_null_to_map.h @@ -69,6 +69,8 @@ public: Core::GeoPosition2D position() const { return m_form_param; } private: + +NGL::INGLLogger &m_logger; int32_t m_id_param; AreaEffectSimulation::ChargeStruct m_chargeStruct; Core::GeoPosition2D m_form_param; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.cpp index b91ebc53a..21b18cfde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.cpp @@ -25,9 +25,8 @@ QString toString(SpecialChargeType value) return QStringLiteral("SpecialChargeTypeERROR"); } -PdmHandler::PdmHandler(const std::shared_ptr &dtcPdm) - : m_dtcPdm(dtcPdm) -{} +PdmHandler::PdmHandler(const std::shared_ptr &dtcPdm) : m_dtcPdm(dtcPdm), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void PdmHandler::initializePdm() @@ -85,7 +84,7 @@ ProjectDataManagement::ChargeType PdmHandler::chargeTypeFromId(int chargeTypeId) auto it = m_chargeTypes.constFind(chargeTypeId); if (it == m_chargeTypes.cend()) { - WARNING_LOG() << "Could not find charge type with id " << chargeTypeId; + WARNING_LOG(m_logger) << "Could not find charge type with id " << chargeTypeId; return ProjectDataManagement::ChargeType(); } return it.value(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.h index b46db26da..89ca6101f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/pdm_handler.h @@ -67,11 +67,13 @@ public: QVector casEffects(const AreaEffectSimulation::ChargeStruct &chargeStruct); private: + NGL::INGLLogger &m_logger; void initializePdm(); void onChargeTypeChanged(const ProjectDataManagement::ChargeType &data, DataModification mod); void onGearTypeChargeTypeChanged(const ProjectDataManagement::GearTypeChargeType &data, DataModification mod); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtcPdm; QMap m_chargeTypes; QMap m_gearTypeChargeTypes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/sim_to_situation_map_tmpl.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/sim_to_situation_map_tmpl.h index eb6ae3d97..4e4c4fdd8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/sim_to_situation_map_tmpl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/AdapterDds/sim_to_situation_map_tmpl.h @@ -161,7 +161,7 @@ public: mapObj->updateView(); if (!mapObj->updateView()) - ERROR_LOG() << Q_FUNC_INFO << " updateElement failed, " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateElement failed, " << " uniqueMapId = " << uniqueMapId << " debugInfo='" << mapObj->debugInfo() << "'"; } @@ -265,7 +265,7 @@ protected: virtual bool createElement(const DDS_T &ddsData) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " simId = " << getSimId(ddsData); const int32_t simId = getSimId(ddsData); @@ -273,7 +273,7 @@ protected: if (m_simId2UniqueMapId.contains(simId)) { - DEBUG_LOG() << Q_FUNC_INFO << " mapObject already exists" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " mapObject already exists" << " simId = " << simId; return true; } @@ -283,7 +283,7 @@ protected: RefPointer mapObj = m_objFac.create(layername, debugInfo); if (!mapObj) { - ERROR_LOG() << Q_FUNC_INFO << " creation failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " creation failed" << " simId = " << simId; return false; } @@ -297,14 +297,14 @@ protected: const UniqueMapId uniqueMapId = mapObj->uniqueMapId(); if (!isUniqueMapIdValid(uniqueMapId)) { - ERROR_LOG() << Q_FUNC_INFO << " uniqueMapId invalid" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " uniqueMapId invalid" << " simId = " << simId; return false; } m_simId2UniqueMapId[simId] = uniqueMapId; m_uniqueMapId2SimId[uniqueMapId] = simId; - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -312,7 +312,7 @@ protected: bool updateElement(const DDS_T &ddsData) { - DEBUG_LOG() << Q_FUNC_INFO << " START" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " simId = " << getSimId(ddsData); const int32_t simId = getSimId(ddsData); @@ -320,14 +320,14 @@ protected: const UniqueMapId uniqueMapId = m_simId2UniqueMapId.value(simId, INVALID_MAP_ID); if (!isUniqueMapIdValid(uniqueMapId)) { - ERROR_LOG() << Q_FUNC_INFO << " not found" << " simId = " << simId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not found" << " simId = " << simId; return false; } RefPointer mapObj = m_objFac.get(uniqueMapId); if (!mapObj) { - ERROR_LOG() << Q_FUNC_INFO << " not found in objFac" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not found in objFac" << " simId = " << simId << " uniqueMapId = " << uniqueMapId; return false; @@ -336,7 +336,7 @@ protected: bool success = updateElementImpl(ddsData, mapObj); if (!success) { - ERROR_LOG() << Q_FUNC_INFO << " updateElementImpl failed, " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateElementImpl failed, " << " simId = " << getSimId(ddsData); return false; } @@ -347,7 +347,7 @@ protected: if (!mapObj->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateElement failed, " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateElement failed, " << " simId = " << getSimId(ddsData); return false; } @@ -355,26 +355,26 @@ protected: emit mapObjectChanged(uniqueMapId); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } bool removeElement(const DDS_T &ddsData) { const int32_t simId = getSimId(ddsData); - DEBUG_LOG() << Q_FUNC_INFO << " START" << " simId = " << simId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " simId = " << simId; return removeElement(simId); } virtual bool removeElement(const int32_t simId) { - DEBUG_LOG() << Q_FUNC_INFO << " START" << " simId = " << simId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " simId = " << simId; const UniqueMapId uniqueMapId = m_simId2UniqueMapId.value(simId, INVALID_MAP_ID); if (!isUniqueMapIdValid(uniqueMapId)) { - TRACE_LOG() << Q_FUNC_INFO << " not found" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " not found" << ", simId = " << simId; return false; } @@ -388,12 +388,12 @@ protected: } else { - ERROR_LOG() << Q_FUNC_INFO << " not found in objFac" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not found in objFac" << " simId = " << simId << " uniqueMapId = " << uniqueMapId; } - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; emit mapObjectRemoved(uniqueMapId); @@ -422,7 +422,7 @@ protected: bool handleChanged(const DDS_T &ddsData, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " START" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " modType = " << modType << " simId = " << getSimId(ddsData); @@ -445,7 +445,7 @@ protected: success = this->removeElement(ddsData); break; } - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; return success; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.cpp index 3bf8aebff..b50cf8654 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.cpp @@ -86,11 +86,10 @@ void ConfigureSingleMapUrl::onClose() -ConfigureMapUrlsWidget::ConfigureMapUrlsWidget(QWidget *parent) - : QWidget(parent) - , m_ui(new Ui::Configure_Urls_Widget) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; +ConfigureMapUrlsWidget::ConfigureMapUrlsWidget(QWidget *parent) : QWidget(parent) + , m_ui(new Ui::Configure_Urls_Widget), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); connect(m_ui->pbUp, &QPushButton::clicked, this, &ConfigureMapUrlsWidget::onUpClicked); @@ -99,14 +98,14 @@ ConfigureMapUrlsWidget::ConfigureMapUrlsWidget(QWidget *parent) connect(m_ui->pbModify, &QPushButton::clicked, this, &ConfigureMapUrlsWidget::onModfiyClicked); connect(m_ui->pbRemove, &QPushButton::clicked, this, &ConfigureMapUrlsWidget::onRemoveClicked); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } ConfigureMapUrlsWidget::~ConfigureMapUrlsWidget() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ConfigureMapUrlsWidget::setModel(ConfigureMapUrlModel *model) @@ -171,7 +170,7 @@ void ConfigureMapUrlsWidget::onAddClicked() } void ConfigureMapUrlsWidget::addSingleUrl() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_configureMapUrlModel) return; @@ -200,7 +199,7 @@ void ConfigureMapUrlsWidget::onModfiyClicked() } void ConfigureMapUrlsWidget::modifySingleUrl() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_configureMapUrlModel) return; @@ -214,7 +213,7 @@ void ConfigureMapUrlsWidget::modifySingleUrl() void ConfigureMapUrlsWidget::onRemoveClicked() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; int currentRow = m_ui->tvLayer->currentIndex().row(); m_configureMapUrlModel->removeRow(currentRow); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.h index fd0b85c32..1e5f70d46 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_url_widget.h @@ -60,6 +60,8 @@ protected Q_SLOTS: void onClose(); private: + +NGL::INGLLogger &m_logger; Ui::Configure_Single_Url *m_ui; LtsWidgets::LtsDialogButtonBox *m_buttonBox; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.cpp index c1df303ee..528b28bde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.cpp @@ -22,7 +22,7 @@ ConfigureMapUrls::ConfigureMapUrls(QWidget *parent) , m_requestHelper(new LtsUtils::RequestHelper(this)) , m_ui(new Ui::Configure_Urls) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); @@ -56,24 +56,24 @@ ConfigureMapUrls::ConfigureMapUrls(QWidget *parent) setOnlineHelpFilename(QStringLiteral("Configuration_of_Modells_SLPKs")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } ConfigureMapUrls::~ConfigureMapUrls() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool ConfigureMapUrls::init(PluginProvider *pluginProvider) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_pluginProvider = pluginProvider; if (!m_pluginProvider) { - ERROR_LOG() << Q_FUNC_INFO << " no pluginProvider"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no pluginProvider"; return false; } @@ -81,14 +81,14 @@ bool ConfigureMapUrls::init(PluginProvider *pluginProvider) m_asmDtc = m_pluginProvider->asmDtc(); if (!m_asmDtc) { - ERROR_LOG() << Q_FUNC_INFO << " Can not retrieve AssetManagement::DTC"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Can not retrieve AssetManagement::DTC"; bRet = false; } m_asmFtc = m_pluginProvider->asmFtc(); if (!m_asmFtc) { - ERROR_LOG() << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; bRet = false; } @@ -100,16 +100,16 @@ bool ConfigureMapUrls::init(PluginProvider *pluginProvider) fillTrainingAreaCbx(); syncTaToGui(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return bRet; } void ConfigureMapUrls::fillTrainingAreaCbx() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_asmDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no dtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no dtc"; return; } @@ -135,18 +135,18 @@ void ConfigureMapUrls::fillTrainingAreaCbx() const int newTrainingAreaId = m_ui->cbTrainingArea->currentData().toInt(); if (!retrieveTaOfService(newTrainingAreaId)) { - ERROR_LOG() << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; return; } } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ConfigureMapUrls::onSelectedTrainingAreaChanged(const QString & ) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; const int newTrainingAreaId = m_ui->cbTrainingArea->currentData().toInt(); if (m_trainingArea.id() == newTrainingAreaId) return; @@ -159,23 +159,23 @@ void ConfigureMapUrls::onSelectedTrainingAreaChanged(const QString & ) apply(); if (!retrieveTaOfService(newTrainingAreaId)) { - ERROR_LOG() << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; return; } break; case LtsWidgets::Button::Cancel: - INFO_LOG() << Q_FUNC_INFO << " set back to m_trainingArea.id() = " << m_trainingArea.id(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " set back to m_trainingArea.id() = " << m_trainingArea.id(); m_ui->cbTrainingArea->setCurrentIndex(m_ui->cbTrainingArea->findData(QVariant(m_trainingArea.id()), Qt::UserRole)); break; case LtsWidgets::Button::Discard: if (!retrieveTaOfService(newTrainingAreaId)) { - ERROR_LOG() << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; return; } break; default: - ERROR_LOG() << Q_FUNC_INFO << " got unexpected!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " got unexpected!!!"; break; } } @@ -183,22 +183,22 @@ void ConfigureMapUrls::onSelectedTrainingAreaChanged(const QString & ) { if (!retrieveTaOfService(newTrainingAreaId)) { - ERROR_LOG() << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " retrieveTrainingAreaOfService failed"; return; } } syncTaToGui(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool ConfigureMapUrls::retrieveTaOfService(int trainingAreaId) { - TRACE_LOG() << Q_FUNC_INFO << " START, trainingAreaId=" << trainingAreaId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, trainingAreaId=" << trainingAreaId; if (!m_asmDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no dtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no dtc"; return false; } @@ -210,14 +210,14 @@ bool ConfigureMapUrls::retrieveTaOfService(int trainingAreaId) AssetManagement::TrainingArea ta = m_asmDtc->trainingArea(trainingAreaId); if (ta.id() != trainingAreaId) { - ERROR_LOG() << Q_FUNC_INFO << " switch to m_trainingArea failed (taId=" << trainingAreaId << ")"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " switch to m_trainingArea failed (taId=" << trainingAreaId << ")"; return false; } m_trainingArea = ta; - INFO_LOG() << Q_FUNC_INFO << " switch to m_trainingArea " << m_trainingArea.id() + INFO_LOG(m_logger) << Q_FUNC_INFO << " switch to m_trainingArea " << m_trainingArea.id() << ", ta" << ta; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -251,7 +251,7 @@ void basicConfig(ConfigureMapUrlsWidget *tv, bool showTypeMinMax = true) void ConfigureMapUrls::syncTaToGui() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; ConfigureMapUrlsWidget *w; @@ -259,7 +259,7 @@ void ConfigureMapUrls::syncTaToGui() if (w && w->model()) { w->model()->setData(vecToVec(m_trainingArea.map2D())); - TRACE_LOG() << Q_FUNC_INFO << " model->rowCount()" << w->model()->rowCount(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " model->rowCount()" << w->model()->rowCount(); } basicConfig(w); @@ -274,7 +274,7 @@ void ConfigureMapUrls::syncTaToGui() if (w && w->model()) { w->model()->setData(vecToVec(m_trainingArea.scene3D())); - TRACE_LOG() << Q_FUNC_INFO << " model->rowCount()" << w->model()->rowCount(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " model->rowCount()" << w->model()->rowCount(); } basicConfig(w); @@ -288,12 +288,12 @@ void ConfigureMapUrls::syncTaToGui() w->model()->setData(vecToVec(m_trainingArea.sceneObjects())); basicConfig(w, false); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ConfigureMapUrls::syncGuiToTa() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; ConfigureMapUrlsWidget *w; @@ -326,7 +326,7 @@ void ConfigureMapUrls::syncGuiToTa() item.mapDescriptionTypeId(AssetManagement::MapDescriptionType_def::SceneObj); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void ConfigureMapUrls::retranslate() @@ -337,11 +337,11 @@ void ConfigureMapUrls::retranslate() bool ConfigureMapUrls::apply() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_asmFtc) { - ERROR_LOG() << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Can not retrieve AssetManagement::FTC"; return false; } @@ -352,24 +352,24 @@ bool ConfigureMapUrls::apply() return m_asmFtc->trainingAreaModifyRequest(m_trainingArea, this); }); - TRACE_LOG() << Q_FUNC_INFO << " END, scucess=" << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, scucess=" << success; return success; } void ConfigureMapUrls::onTrainingAreaModifyReply(const Core::FunctionReplyObject &reply) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (reply.error()) { - ERROR_LOG() << Q_FUNC_INFO << "Got onTrainingAreaModifyReply error: " << reply(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Got onTrainingAreaModifyReply error: " << reply(); return; } - INFO_LOG() << Q_FUNC_INFO << " Got onTrainingAreaModifyReply with id " << reply.id(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " Got onTrainingAreaModifyReply with id " << reply.id(); m_requestHelper->requestReply(reply); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.h index 7dfe4819f..e51e2fc58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/ConfigureUrl/sitmap_configure_urls.h @@ -46,6 +46,8 @@ public: bool init(PluginProvider *pluginProvider); protected: + +NGL::INGLLogger &m_logger; void fillTrainingAreaCbx(); bool retrieveTaOfService(int trainingAreaId); void syncTaToGui(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.cpp index 6dca05550..fefe5ac73 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.cpp @@ -99,14 +99,14 @@ MapObjectModel::MapObjectModel(QObject *parent) }, parent) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } MapObjectModel::~MapObjectModel() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void MapObjectModel::initModel(Map *map) @@ -441,7 +441,7 @@ UniqueMapId MapObjectModel::uniqueMapIdOfIndex(const QModelIndex &index) const void MapObjectModel::onDataChanged(UniqueMapId uniqueMapId) { - TRACE_LOG() << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; int row = findRowForUniqueMapId(uniqueMapId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.h index 8d6c9f389..970aa1b31 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_model.h @@ -168,9 +168,11 @@ public: void setSourceModel(QAbstractItemModel *sourceModel) override; protected: + NGL::INGLLogger &m_logger; bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; protected: + NGL::INGLLogger &m_logger; MapObjectModel *m_sourceModel = nullptr; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_selection_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_selection_widget.cpp index 60f40a641..f51e1ef00 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_selection_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/MapObjectSelection/map_object_selection_widget.cpp @@ -306,40 +306,39 @@ void MapObjectSelectionLtsDialog::onServiceMonitorRequestedAdd() -MapObjectSelectionWidget::MapObjectSelectionWidget(QWidget *parent) - : BaseClass(parent) - , m_ui(new Ui::MapObjectSelectionDialog) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; +MapObjectSelectionWidget::MapObjectSelectionWidget(QWidget *parent) : BaseClass(parent) + , m_ui(new Ui::MapObjectSelectionDialog), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } MapObjectSelectionWidget::~MapObjectSelectionWidget() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; clearSelectionOfMapObjects(true); delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool MapObjectSelectionWidget::init(Map *map, AdapterDds *adapterDds) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!map) { - ERROR_LOG() << Q_FUNC_INFO << " no map"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no map"; return false; } if (!adapterDds) { - ERROR_LOG() << Q_FUNC_INFO << " no adapterDds"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no adapterDds"; return false; } @@ -351,7 +350,7 @@ bool MapObjectSelectionWidget::init(Map *map, AdapterDds *adapterDds) connect(&m_map->partyIdToColorFunctor(), &PartyIdToColorFunctor::partyChanged, this, &MapObjectSelectionWidget::onPartyIdsChanged, Qt::UniqueConnection); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -417,11 +416,11 @@ void MapObjectSelectionWidget::setMapObjectsToDisplay(const Map::RefPointerMapOb void MapObjectSelectionWidget::setMapObjectsToDisplay(const QVector &uniqueMapIds) { - TRACE_LOG() << Q_FUNC_INFO << " START, uniqueMapIds.size()=" << uniqueMapIds.size(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, uniqueMapIds.size()=" << uniqueMapIds.size(); if (m_map.isNull()) { - ERROR_LOG() << Q_FUNC_INFO << " no map"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no map"; return; } @@ -481,7 +480,7 @@ void MapObjectSelectionWidget::setMapObjectsToDisplay(const QVector if (m_adapterDds->unifiedMapObjectData(uniqueMapId, umodOut)) mapObjectDataVec.append(dataFromUnified(uniqueMapId, umodOut)); else - ERROR_LOG() << Q_FUNC_INFO << " unifiedMapObjectData failed, uniqueMapId=" << uniqueMapId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " unifiedMapObjectData failed, uniqueMapId=" << uniqueMapId; } @@ -491,7 +490,7 @@ void MapObjectSelectionWidget::setMapObjectsToDisplay(const QVector m_ui->ltsDataView->setSortIndicator(MapObjectModel::Columns::EQUIPMENT_NUMBER, Qt::AscendingOrder); m_ui->ltsDataView->setSortIndicator(MapObjectModel::Columns::PARTY, Qt::AscendingOrder); - TRACE_LOG() << Q_FUNC_INFO << " END, uniqueMapIds.size()=" << uniqueMapIds.size(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, uniqueMapIds.size()=" << uniqueMapIds.size(); } @@ -563,7 +562,7 @@ QVector MapObjectSelectionWidget::visibleBuildingIds() const bool MapObjectSelectionWidget::addMapObject(const UniqueMapId &uniqueMapId) { - TRACE_LOG() << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; if (m_map.isNull() || m_adapterDds.isNull() || m_mapObjectModel.isNull()) return false; @@ -575,13 +574,13 @@ bool MapObjectSelectionWidget::addMapObject(const UniqueMapId &uniqueMapId) if (m_adapterDds->unifiedMapObjectData(uniqueMapId, umodOut)) return m_mapObjectModel->addMapObjectData(dataFromUnified(uniqueMapId, umodOut)); - TRACE_LOG() << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; return false; } bool MapObjectSelectionWidget::updateMapObject(const UniqueMapId &uniqueMapId) { - TRACE_LOG() << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; if (m_map.isNull() || m_adapterDds.isNull() || !m_mapObjectModel) return false; @@ -593,20 +592,20 @@ bool MapObjectSelectionWidget::updateMapObject(const UniqueMapId &uniqueMapId) if (m_adapterDds->unifiedMapObjectData(uniqueMapId, umodOut)) return m_mapObjectModel->updateMapObjectData(dataFromUnified(uniqueMapId, umodOut)); - ERROR_LOG() << Q_FUNC_INFO << " unifiedMapObjectData failed, uniqueMapId=" << uniqueMapId; - TRACE_LOG() << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " unifiedMapObjectData failed, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; return false; } void MapObjectSelectionWidget::onMapObjectRemoved(UniqueMapId uniqueMapId) { - TRACE_LOG() << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, uniqueMapId=" << uniqueMapId; if (!m_mapObjectModel) return; m_mapObjectModel->remove(uniqueMapId); - TRACE_LOG() << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, uniqueMapId=" << uniqueMapId; } void MapObjectSelectionWidget::onPartyIdsChanged() @@ -647,7 +646,7 @@ void MapObjectSelectionWidget::onMapObjectClicked(UniqueMapId uniqueMapId) void MapObjectSelectionWidget::onMapObjectEntered(const QModelIndex &index) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_mapObjectModel) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.cpp index c78d1211a..c548624d0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.cpp @@ -14,10 +14,9 @@ namespace SituationMap { -LayersModel::LayersModel(LtsSession::LtsSession *session, QObject *parent) - : QAbstractTableModel(parent) - , m_session(session) -{} +LayersModel::LayersModel(LtsSession::LtsSession *session, QObject *parent) : QAbstractTableModel(parent) + , m_session(session), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool LayersModel::initModel(Map *situationMap) { @@ -61,9 +60,9 @@ bool LayersModel::initModel(Map *situationMap) insertRow(li); } - INFO_LOG() << "initModel - #layers: " << m_vecData.size(); + INFO_LOG(m_logger) << "initModel - #layers: " << m_vecData.size(); for (const LayerInfo &item : std::as_const(m_vecData)) - INFO_LOG() << "initModel - layers: " << item.layerName; + INFO_LOG(m_logger) << "initModel - layers: " << item.layerName; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.h index 5b6bac1e5..ae856f8f7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/layers_model.h @@ -63,6 +63,7 @@ Q_SIGNALS: void layerDataChanged(const QString &layerName, int newValue, int column); void isVisibleChanged(const QString &layerName, bool isVisible); private: + NGL::INGLLogger &m_logger; LtsSession::LtsSession *m_session{nullptr}; QVector m_vecData; QStringList m_layerDisplayNameFilterList{}; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.cpp index 11c4ed654..d9fa5f59b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.cpp @@ -113,7 +113,7 @@ static_assert((int)SituationMap::MapFillPattern::Vertical == (int)Situat namespace SituationMap { -#define LOG_ERROR_SIT ERROR_LOG() << Q_FUNC_INFO << " no situationMapInit" +#define LOG_ERROR_SIT ERROR_LOG(m_logger) << Q_FUNC_INFO << " no situationMapInit" #define CHECK_SMI_RETVAL if (!(m_situationMapInit)) { LOG_ERROR_SIT; return {}; } #define CHECK_SMI if (!(m_situationMapInit)) { LOG_ERROR_SIT; return; } @@ -433,7 +433,7 @@ QVector InterfaceImpl::getActions() bool curVisi = m_situationMapInit->isBuildingOwnershipVisible(); bool success = m_situationMapInit->setBuildingOwnershipVisible(!curVisi); if (!success) - WARNING_LOG() << Q_FUNC_INFO << "setBuildingOwnershipVisible failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "setBuildingOwnershipVisible failed"; if (menueBtnBuildingOwnership) menueBtnBuildingOwnership->setChecked(m_situationMapInit->isBuildingOwnershipVisible()); @@ -462,7 +462,7 @@ QVector InterfaceImpl::getActions() bool curVisi = m_situationMapInit->isBuildingContaminationVisible(); bool success = m_situationMapInit->setBuildingContaminationVisible(!curVisi); if (!success) - WARNING_LOG() << Q_FUNC_INFO << "setBuildingContaminationVisible failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << "setBuildingContaminationVisible failed"; if (menueBtnBuildingContamination) menueBtnBuildingContamination->setChecked(m_situationMapInit->isBuildingContaminationVisible()); @@ -597,7 +597,7 @@ bool InterfaceImpl::fetchInterfaces() if (!m_session->getForeignGuiInterface(m_asbGuiIfc)) { - DEBUG_LOG() << Q_FUNC_INFO << " getForeignGuiInterface for ForeignGuiFlmSymbolsProxyInterface failed."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface for ForeignGuiFlmSymbolsProxyInterface failed."; return false; } @@ -610,7 +610,7 @@ bool InterfaceImpl::fetchInterfaces() std::shared_ptr fltDtc = m_pluginProvider->fltDtc(); if (!fltDtc) { - ERROR_LOG() << Q_FUNC_INFO << " no fltDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no fltDtc"; return false; } @@ -631,7 +631,7 @@ bool InterfaceImpl::fetchInterfaces() onTrainingAreaChanged(data, DataModification::eAdded); }); } else { - WARNING_LOG() << Q_FUNC_INFO << " no m_asmDtc"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " no m_asmDtc"; } @@ -688,7 +688,7 @@ bool InterfaceImpl::clearObjects() void InterfaceImpl::onChangeModeRequested() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!this->isMapReady()) return; @@ -720,7 +720,7 @@ void InterfaceImpl::onChangeModeRequested() if (!lp.visible) { - DEBUG_LOG() << Q_FUNC_INFO << " EmergencyCall Timer ..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " EmergencyCall Timer ..."; @@ -734,7 +734,7 @@ void InterfaceImpl::onChangeModeRequested() if (lpCurrent.visible) { m_situationMap->layerFactory().switchEmergencyCallLayerOff(); - DEBUG_LOG() << Q_FUNC_INFO << " EmergencyCall Timer ... Done"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " EmergencyCall Timer ... Done"; } } }); @@ -748,7 +748,7 @@ void InterfaceImpl::onChangeModeRequested() void InterfaceImpl::reCreateSituationMapInitAndAddToLayoutAndReInit() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_situationMapInit) { @@ -770,13 +770,13 @@ void InterfaceImpl::reCreateSituationMapInitAndAddToLayoutAndReInit() m_mapLayerControl->deleteLater(); m_mapLayerControl = nullptr; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } LtsWidgets::LtsDialog *InterfaceImpl::onShowSituationMapDialog(QWidget *parent) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; @@ -809,7 +809,7 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowSituationMapDialog(QWidget *parent) reCreateSituationMapInitAndAddToLayout(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_ltsDialogSitMapWidget; } @@ -820,7 +820,7 @@ TopicReplay::Interface *InterfaceImpl::createInterface(TopicEditorBase::TopicTyp QWidget *InterfaceImpl::reCreateSituationMapInit() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; @@ -838,14 +838,14 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() std::shared_ptr preventDestruction2; if (m_session->isReplayPartition() && fltParticipantIfc && fltAesIfc) { - INFO_LOG() << Q_FUNC_INFO << " FILTER: PREVENT DESTRUCTION "; + INFO_LOG(m_logger) << Q_FUNC_INFO << " FILTER: PREVENT DESTRUCTION "; const int operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId(); const QString &wsId_context = m_session->workspaceId(); preventDestruction1 = fltParticipantIfc->symbolAppearanceForOperator(operatorId, wsId_context); preventDestruction2 = fltAesIfc->aesFilterForOperator(operatorId, wsId_context); } else { - INFO_LOG() << Q_FUNC_INFO << " SKIP FILTER: PREVENT DESTRUCTION "; + INFO_LOG(m_logger) << Q_FUNC_INFO << " SKIP FILTER: PREVENT DESTRUCTION "; } @@ -937,7 +937,7 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() { if (lsd.isEmpty()) - ERROR_LOG() << Q_FUNC_INFO << " LocalServiceData empty, no viewshedUrl"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " LocalServiceData empty, no viewshedUrl"; m_situationMap->viewshed().setViewshedUrl(lsd.svcUrl().toString()); @@ -964,12 +964,12 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() { connect(mapNotifier.data(), &MapNotifier::mapReadyAndSymbolDictionaryLoaded, this, [this ]() { - INFO_LOG() << Q_FUNC_INFO << " currentTimeMsec: " << m_session->partitionTime(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " currentTimeMsec: " << m_session->partitionTime(); if (m_operatorMapSettings2achieve.isEmpty()) - WARNING_LOG() << Q_FUNC_INFO << " oms empty!?"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " oms empty!?"; else if (!restoreOperatorMapSettingsOverlays(m_operatorMapSettings2achieve)) - ERROR_LOG() << Q_FUNC_INFO << " restoreOperatorMapSettings failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " restoreOperatorMapSettings failed"; if (isAutoSetExerciseTimeString()) showExerciseTimeString(true); @@ -977,7 +977,7 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() if (m_session->app() == LtsAppDescriptor::App::OC) connect(mapNotifier.data(), &MapNotifier::mapReadyAndSymbolDictionaryLoaded, this, [this]() { - INFO_LOG() << Q_FUNC_INFO << " currentTimeMsec: " << m_session->partitionTime(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " currentTimeMsec: " << m_session->partitionTime(); QTimer::singleShot(1000, this, &InterfaceImpl::restoreOcSituationRange); }); mapNotifier->run(); @@ -997,16 +997,16 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() if (!m_situationMapInit->initAdapter(m_movementTrackManager, resourceMode)) { - ERROR_LOG() << Q_FUNC_INFO << " m_situationMapInit->init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " m_situationMapInit->init failed"; return nullptr; } bool enableFireEventFlashing = (m_session->app() != LtsAppDescriptor::App::Snapshot); if (!m_situationMapInit->enableFireEventFlashing(enableFireEventFlashing)) - WARNING_LOG() << Q_FUNC_INFO << " enableFireEventFlashing failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " enableFireEventFlashing failed"; if (!m_situationMapInit->setResourceManagerMode(savedRMM)) - WARNING_LOG() << Q_FUNC_INFO << " setResourceManagerMode failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " setResourceManagerMode failed"; @@ -1016,7 +1016,7 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() m_registerAppHandler.registerApp(this, m_session); } else - ERROR_LOG() << Q_FUNC_INFO << " no opmDtc/opmFtc, register of active app will not work"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no opmDtc/opmFtc, register of active app will not work"; @@ -1026,7 +1026,7 @@ QWidget *InterfaceImpl::reCreateSituationMapInit() QTimer::singleShot(0, this, &InterfaceImpl::enableDisable); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_situationMap.data(); } @@ -1037,7 +1037,7 @@ void InterfaceImpl::doFindChild() const LtsWidgets::LtsBaseLayoutWidget *baseLayout = m_session->baseLayout(); if (!baseLayout) { - ERROR_LOG() << Q_FUNC_INFO << " no baseLayout found"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no baseLayout found"; return; } @@ -1066,13 +1066,13 @@ void InterfaceImpl::doFindChild() void InterfaceImpl::enableDisable() { - DEBUG_LOG() << Q_FUNC_INFO << " getAppName()= " << LtsSession::LtsSession::appToString(appId()); - DEBUG_LOG() << Q_FUNC_INFO << " m_session->partitionType()= " << m_session->partitionType(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " getAppName()= " << LtsSession::LtsSession::appToString(appId()); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_session->partitionType()= " << m_session->partitionType(); if (!m_situationMap) return; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_situationMap->mode()= " << m_situationMap->mode() << " this->isMapReady()= " << this->isMapReady(); @@ -1204,20 +1204,20 @@ void InterfaceImpl::enableDisable() void InterfaceImpl::onInitialOperatorMapSettingsTimeout() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_waitForInitialOperatorMapSettings.clear(); reCreateSituationMapInitAndAddToLayout(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void InterfaceImpl::reCreateSituationMapInitAndAddToLayout() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_ltsDialogSitMapWidget) { - ERROR_LOG() << Q_FUNC_INFO << " no m_ltsDialog"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_ltsDialog"; return; } @@ -1309,7 +1309,7 @@ void InterfaceImpl::reCreateSituationMapInitAndAddToLayout() #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } QPointer InterfaceImpl::map() const @@ -1319,7 +1319,7 @@ QPointer InterfaceImpl::map() const void InterfaceImpl::setMapUpdatesEnabled(bool bEnabled) { - INFO_LOG() << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, START, bEnabled= " << bEnabled; + INFO_LOG(m_logger) << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, START, bEnabled= " << bEnabled; @@ -1328,20 +1328,20 @@ void InterfaceImpl::setMapUpdatesEnabled(bool bEnabled) if (m_ltsDialogSitMapWidget) { - INFO_LOG() << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, switch from " << m_ltsDialogSitMapWidget->updatesEnabled() << " to " << bEnabled; + INFO_LOG(m_logger) << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, switch from " << m_ltsDialogSitMapWidget->updatesEnabled() << " to " << bEnabled; m_ltsDialogSitMapWidget->setUpdatesEnabled(bEnabled); } - INFO_LOG() << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, END, bEnabled= " << bEnabled; + INFO_LOG(m_logger) << Q_FUNC_INFO << " XXX setMapUpdatesEnabled, END, bEnabled= " << bEnabled; } bool InterfaceImpl::isMapReady() const { - TRACE_LOG() << Q_FUNC_INFO << " START, m_situationMap" << m_situationMap; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_situationMap" << m_situationMap; if (!m_situationMap) return false; const bool ret = m_situationMap->isReady() && m_situationMap->isSymbolDictionaryLoaded(); - TRACE_LOG() << Q_FUNC_INFO << " END, " + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, " << " m_situationMap->isReady()=" << m_situationMap->isReady() << " m_situationMap->isSymbolDictionaryLoaded()=" << m_situationMap->isSymbolDictionaryLoaded() << ", ret = " << ret; @@ -1352,7 +1352,7 @@ bool InterfaceImpl::setMapReadyCallback(QObject *context, const std::functionshow(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_mapWidgetControl; } LtsWidgets::LtsDialog *InterfaceImpl::onShowLayerControlDialog(QWidget *parent) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_mapLayerControl) m_mapLayerControl = new LayerControlDialog(parent); @@ -1517,13 +1517,13 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowLayerControlDialog(QWidget *parent) if (m_situationMap) m_mapLayerControl->init(m_session, m_situationMap.data()); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_mapLayerControl; } LtsWidgets::LtsDialog *InterfaceImpl::onShowConfigureUrlsDialog(QWidget *parent) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_pluginProvider) return nullptr; @@ -1534,7 +1534,7 @@ LtsWidgets::LtsDialog *InterfaceImpl::onShowConfigureUrlsDialog(QWidget *parent) if (m_configureMapUrls) m_configureMapUrls->init(m_pluginProvider); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_configureMapUrls; } @@ -1558,14 +1558,14 @@ bool InterfaceImpl::setMovementTrackCallback(QObject *context, const std::functi { if (m_situationMapInit.isNull()) { - ERROR_LOG() << Q_FUNC_INFO << " no m_situationMapInit"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_situationMapInit"; return false; } QPointer movementTrackManager = m_situationMapInit->movementTrackManager(); if (!movementTrackManager) { - ERROR_LOG() << Q_FUNC_INFO << " no movementTrackManager"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no movementTrackManager"; return false; } @@ -1797,7 +1797,7 @@ bool InterfaceImpl::getCoordinate(QObject *objectToInform, const char *replySlot } break; case SituationMap::MapMode::Undefined: - ERROR_LOG() << Q_FUNC_INFO << " ModeMode == Undefined "; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " ModeMode == Undefined "; return false; break; } @@ -1821,13 +1821,13 @@ bool InterfaceImpl::getCorridor(QObject *objectToInform, if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -1854,7 +1854,7 @@ bool InterfaceImpl::getCorridor(QObject *objectToInform, { QPolygonF bufferPolygon; if (!rubberband->bufferPolygon(bufferPolygon)) - ERROR_LOG() << Q_FUNC_INFO << " rubberband->bufferPolygon() failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " rubberband->bufferPolygon() failed"; m_replySlot.invoke(m_objToInform, Qt::DirectConnection, Q_ARG(double, rubberband->corridorWidth()), @@ -1877,13 +1877,13 @@ QVector InterfaceImpl::getParallelTranslation(const QVector &l if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return QVector(); } if (line.size() < 2) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - line has less than 2 coordinates!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - line has less than 2 coordinates!!!"; return QVector(); } @@ -1891,7 +1891,7 @@ QVector InterfaceImpl::getParallelTranslation(const QVector &l if (nullptr == mapCtFunctor) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - coordinate translation to map coordinates is not defined!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - coordinate translation to map coordinates is not defined!!!"; return QVector(); } @@ -1899,7 +1899,7 @@ QVector InterfaceImpl::getParallelTranslation(const QVector &l if (parallelLine.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - calculation of parallel line failed! May be invalid input line!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - calculation of parallel line failed! May be invalid input line!"; return QVector(); } @@ -1911,18 +1911,18 @@ QVector InterfaceImpl::getParallelTranslation(const QVector &l bool InterfaceImpl::getCircle(QObject *objectToInform, const char *replySlot, const char *errorSlot, double radiusMin, double radiusMax, const QPointF &pos, double initialRadius) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -1984,18 +1984,18 @@ void inline getSectorStartEnd(double angle, double rotation, double &aStartRad, bool InterfaceImpl::getCircleSectorFixRadius(QObject *objectToInform, const char *replySlot, const char *errorSlot, double radius, const QPointF ¢er, double openingAngle, double rotationDegNorth) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2057,18 +2057,18 @@ bool InterfaceImpl::getCircleSector(QObject *objectToInform, const char *replySl double radiusInitial, double radiusMin, double radiusMax, const QPointF &pos, double openingAngle, double rotationDegNorth) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2133,18 +2133,18 @@ bool InterfaceImpl::getTwoCircleSector(QObject *objectToInform, const char *repl double radius2Initial, double radius2Min, double radius2Max, const QPointF &pos, double openingAngle, double rotationDegNorth) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2226,13 +2226,13 @@ bool InterfaceImpl::getRectangle(QObject *objectToInform, const char *replySlot, if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2292,13 +2292,13 @@ bool InterfaceImpl::getRectangleNorth(QObject *objectToInform, const char *reply if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2350,13 +2350,13 @@ bool InterfaceImpl::getPolygon(QObject *objectToInform, const char *replySlot, c if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2392,13 +2392,13 @@ bool InterfaceImpl::getPolyline(QObject *objectToInform, const char *replySlot, if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (m_situationMap && m_situationMap->mode() == Mode::Mode_3D) { - ERROR_LOG() << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " requested Rubberband is not allowd in this mode."; return false; } @@ -2430,7 +2430,7 @@ void InterfaceImpl::cancelActiveRubberbands() { if (!m_situationMap) { - ERROR_LOG() << Q_FUNC_INFO << " no situationMap"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no situationMap"; return; } @@ -2449,7 +2449,7 @@ bool InterfaceImpl::displayPreviewObjects(QObject *parent, const QVectorisReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2515,7 +2515,7 @@ bool InterfaceImpl::displayPreviewObjects(QObject *parent, const QVectorisReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2563,7 +2563,7 @@ bool InterfaceImpl::displayPreviewObject(QObject *parent, const QPointF ¢erP if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2611,7 +2611,7 @@ bool InterfaceImpl::displayPreviewObjects(QObject *parent, const QVectorisReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2673,7 +2673,7 @@ void InterfaceImpl::startMeasureLength() if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return; } @@ -2774,7 +2774,7 @@ bool InterfaceImpl::ocSituationRange_create(const QPointF &origin_lonLatRadiant, if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2789,7 +2789,7 @@ bool InterfaceImpl::ocSituationRange_create(const QPointF &origin_lonLatRadiant, if (!ocSituationRangeObject) { - ERROR_LOG() << Q_FUNC_INFO << " create failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " create failed"; return false; } @@ -2821,7 +2821,7 @@ bool InterfaceImpl::ocSituationRange_create(const QPointF &origin_lonLatRadiant, if (!ocSituationRangeObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } return true; @@ -2834,7 +2834,7 @@ bool InterfaceImpl::ocSituationRange_create(int participantId, double radius_met if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2847,7 +2847,7 @@ bool InterfaceImpl::ocSituationRange_create(int participantId, double radius_met RefPointer participant = m_situationMapInit->simId2Participant(m_ocRange.participantId); if (!participant) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - participantId not found" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - participantId not found" << " (" << participantId << ")"; return false; } @@ -2858,7 +2858,7 @@ bool InterfaceImpl::ocSituationRange_create(int participantId, double radius_met if (!ocSituationRange_create(participant->origin().toPointF(), radius_meter, attributesLocal)) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - ocSituationRange_create failed" + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - ocSituationRange_create failed" << " (" << participantId << ")"; } @@ -2876,7 +2876,7 @@ bool InterfaceImpl::ocSituationRange_show(bool visible) if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2885,7 +2885,7 @@ bool InterfaceImpl::ocSituationRange_show(bool visible) if (!ocSituationRangeObject) { - DEBUG_LOG() << Q_FUNC_INFO << " not found"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " not found"; return false; } @@ -2893,7 +2893,7 @@ bool InterfaceImpl::ocSituationRange_show(bool visible) if (ocSituationRangeObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } return true; @@ -2908,7 +2908,7 @@ bool InterfaceImpl::ocSituationRange_remove() if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2923,7 +2923,7 @@ bool InterfaceImpl::ocSituationRange_remove() if (!ocSituationRangeObject) { - DEBUG_LOG() << Q_FUNC_INFO << " not found"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " not found"; return false; } @@ -2976,7 +2976,7 @@ bool InterfaceImpl::escOrderPosition_create(const QPointF &origin_lonLatRadiant, if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -2993,7 +2993,7 @@ bool InterfaceImpl::escOrderPosition_create(const QPointF &origin_lonLatRadiant, if (!escOrderAreaPositionObject) { - ERROR_LOG() << Q_FUNC_INFO << " create failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " create failed"; return false; } @@ -3030,7 +3030,7 @@ bool InterfaceImpl::escOrderPosition_create(const QPointF &origin_lonLatRadiant, if (!escOrderAreaPositionObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } } @@ -3043,7 +3043,7 @@ bool InterfaceImpl::escOrderPosition_create(const QPointF &origin_lonLatRadiant, if (!escOrderStartPositionObject) { - ERROR_LOG() << Q_FUNC_INFO << " create failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " create failed"; return false; } @@ -3076,7 +3076,7 @@ bool InterfaceImpl::escOrderPosition_create(const QPointF &origin_lonLatRadiant, if (!escOrderStartPositionObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } } @@ -3092,7 +3092,7 @@ bool InterfaceImpl::escOrderPosition_show(bool visible) if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -3106,7 +3106,7 @@ bool InterfaceImpl::escOrderPosition_show(bool visible) if (!escOrderAreaPositionObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } } @@ -3123,7 +3123,7 @@ bool InterfaceImpl::escOrderPosition_show(bool visible) if (!escOrderStartPositionObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return false; } } @@ -3135,7 +3135,7 @@ void InterfaceImpl::showExerciseTimeString(bool visible) { if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return; } @@ -3152,7 +3152,7 @@ bool InterfaceImpl::escOrderPosition_remove() if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -3168,7 +3168,7 @@ bool InterfaceImpl::escOrderPosition_remove() m_situationMap->objectFactory().get(m_escOrderStartPosition.uniqueMapId); if (!escOrderStartPositionObject) { - DEBUG_LOG() << Q_FUNC_INFO << " not found"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " not found"; return false; } escOrderStartPositionObject->removeMySelf(); @@ -3180,7 +3180,7 @@ bool InterfaceImpl::escOrderPosition_remove() m_situationMap->objectFactory().get(m_escOrderAreaPosition.uniqueMapId); if (!escOrderAreaPositionObject) { - DEBUG_LOG() << Q_FUNC_INFO << " not found"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " not found"; return false; } @@ -3195,7 +3195,7 @@ bool InterfaceImpl::isEscOrderPositionVisible() { if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -3220,7 +3220,7 @@ void InterfaceImpl::onParticipantPositionChanged(const int32_t participantId, co if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return; } @@ -3229,7 +3229,7 @@ void InterfaceImpl::onParticipantPositionChanged(const int32_t participantId, co if (!ocSituationRangeObject) { - ERROR_LOG() << Q_FUNC_INFO << " not found"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not found"; return; } @@ -3237,7 +3237,7 @@ void InterfaceImpl::onParticipantPositionChanged(const int32_t participantId, co ocSituationRangeObject->setOrigin(newPos); if (!ocSituationRangeObject->updateView()) { - ERROR_LOG() << Q_FUNC_INFO << " updateView failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateView failed"; return; } return; @@ -3245,7 +3245,7 @@ void InterfaceImpl::onParticipantPositionChanged(const int32_t participantId, co void InterfaceImpl::onTrainingAreaChanged(const AssetManagement::TrainingArea &trainingArea, DataModification modType) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " TrainingArea = " << trainingArea << ", modType=" << modType; @@ -3321,10 +3321,10 @@ bool InterfaceImpl::setInitialOperatorMapSettings(const QJsonValue &data) oms.fromJsonObject(data.toObject()); if (oms.isEmpty()) - ERROR_LOG() << Q_FUNC_INFO << " oms.isEmpty (mode is undefined)"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " oms.isEmpty (mode is undefined)"; else { - INFO_LOG() << Q_FUNC_INFO << " got data :-)" + INFO_LOG(m_logger) << Q_FUNC_INFO << " got data :-)" << ", mode = " << oms.mode << ", viewpoint = " << oms.viewpoint << ", camera = " << oms.camera; @@ -3367,7 +3367,7 @@ QByteArray InterfaceImpl::operatorMapSettingsJson() const bool InterfaceImpl::setOperatorMapSettingsJson(const QByteArray &data) { - DEBUG_LOG() << Q_FUNC_INFO << " START" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << ", this->isMapReady()=" << this->isMapReady() << ", data=>>>" << data << "<<<"; return setOperatorMapSettings(QJsonDocument::fromJson(data).object()); @@ -3386,13 +3386,13 @@ bool InterfaceImpl::setOperatorMapSettings(const QJsonValue &data) bool bIsTimerActive = false; if (m_waitForInitialOperatorMapSettings) bIsTimerActive = m_waitForInitialOperatorMapSettings->isActive(); - DEBUG_LOG() << Q_FUNC_INFO << " START" << ", this->isMapReady()=" << this->isMapReady() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << ", this->isMapReady()=" << this->isMapReady() << ", data.isNull() =" << data.isNull() << ", m_waitForInitialOperatorMapSettings->isActive() =" << bIsTimerActive; if (data.isNull() && m_waitForInitialOperatorMapSettings && m_waitForInitialOperatorMapSettings->isActive()) { - INFO_LOG() << Q_FUNC_INFO << " skip waitForInitialOperatorMapSettings"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " skip waitForInitialOperatorMapSettings"; m_waitForInitialOperatorMapSettings->start(10); return true; } @@ -3413,12 +3413,12 @@ bool InterfaceImpl::setOperatorMapSettings(const QJsonValue &data) if (oms.mode == Mode::Undefined) { - ERROR_LOG() << Q_FUNC_INFO << " mode of map settings is invalid (0 / undefined)"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " mode of map settings is invalid (0 / undefined)"; bRet = false; } else if (oms.mode != static_cast(this->mapMode())) { - INFO_LOG() << Q_FUNC_INFO << " mode switching required"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " mode switching required"; @@ -3435,7 +3435,7 @@ bool InterfaceImpl::setOperatorMapSettings(const QJsonValue &data) } else { - ERROR_LOG() << Q_FUNC_INFO << " map not ready yet!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " map not ready yet!"; bRet = false; } return bRet; @@ -3453,7 +3453,7 @@ bool InterfaceImpl::setMovementTrackManagerSettingsJSon(const QByteArray &data) { if (!m_movementTrackManager) { - ERROR_LOG() << Q_FUNC_INFO << " no MovementTrackManager"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no MovementTrackManager"; return false; } @@ -3461,7 +3461,7 @@ bool InterfaceImpl::setMovementTrackManagerSettingsJSon(const QByteArray &data) const QJsonDocument jDoc(QJsonDocument::fromJson(data, &parserError)); if (parserError.error != QJsonParseError::NoError) { - ERROR_LOG() << Q_FUNC_INFO << " Error parsing json document: " << parserError.errorString(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error parsing json document: " << parserError.errorString(); return false; } @@ -3469,7 +3469,7 @@ bool InterfaceImpl::setMovementTrackManagerSettingsJSon(const QByteArray &data) const QJsonObject &innerObj = object[QLatin1String("MovemenTrackManager")].toObject(); if (innerObj.isEmpty()) { - ERROR_LOG() << "inner content MovementTracks is empty"; + ERROR_LOG(m_logger) << "inner content MovementTracks is empty"; return false; } @@ -3490,7 +3490,7 @@ bool InterfaceImpl::setMovementTrackManagerSettings(const QJsonValue &data) if (!m_movementTrackManager) return false; - INFO_LOG() << Q_FUNC_INFO << " read MovementTrackManagerSettings"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " read MovementTrackManagerSettings"; bool success = m_movementTrackManager->read(data.toObject()); return success; @@ -3501,24 +3501,24 @@ bool InterfaceImpl::restoreOperatorMapSettingsOverlays(OperatorMapSettings &oms) CHECK_SMI_RETVAL; if (!m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } if (oms.isEmpty()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - oms empty"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - oms empty"; return false; } - DEBUG_LOG() << Q_FUNC_INFO << " oms = " << QJsonDocument(oms.toJsonObject()).toJson(QJsonDocument::Indented) ; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " oms = " << QJsonDocument(oms.toJsonObject()).toJson(QJsonDocument::Indented) ; m_situationMap->overlayHandler().removeAllOverlays(); if (!m_situationMap->restoreOperatorMapSettings(oms)) - WARNING_LOG() << Q_FUNC_INFO << " restoreOperatorMapSettings failed"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " restoreOperatorMapSettings failed"; @@ -3529,7 +3529,7 @@ bool InterfaceImpl::restoreOperatorMapSettingsOverlays(OperatorMapSettings &oms) const QList orderedOverlayIds = oms.orderedOverlays; - INFO_LOG() << Q_FUNC_INFO << " restore OverlayIds: " << orderedOverlayIds; + INFO_LOG(m_logger) << Q_FUNC_INFO << " restore OverlayIds: " << orderedOverlayIds; QVector unloadableOverlayIds; @@ -3545,7 +3545,7 @@ bool InterfaceImpl::restoreOperatorMapSettingsOverlays(OperatorMapSettings &oms) if (overlayId < 0) continue; - INFO_LOG() << Q_FUNC_INFO << " restore overlayId: " << overlayId; + INFO_LOG(m_logger) << Q_FUNC_INFO << " restore overlayId: " << overlayId; if (!ovrDtc->loadPlan(overlayId)) { unloadableOverlayIds.append(overlayId); @@ -3554,7 +3554,7 @@ bool InterfaceImpl::restoreOperatorMapSettingsOverlays(OperatorMapSettings &oms) } } else - WARNING_LOG() << Q_FUNC_INFO << " getForeignGuiInterface for PlanOverlaysPlugin::ForeignGuiInterface failed, but it is optional"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " getForeignGuiInterface for PlanOverlaysPlugin::ForeignGuiInterface failed, but it is optional"; } @@ -3569,7 +3569,7 @@ bool InterfaceImpl::restoreOperatorMapSettingsOverlays(OperatorMapSettings &oms) { NOTICE_LOG(m_logger) << " due to error on loading, following overlayId is removed: " << unloadableOverlayId; if (!m_situationMap->overlayHandler().removeOverlay(unloadableOverlayId)) - ERROR_LOG() << " due to error on loading, following overlayId is removed: " << unloadableOverlayId + ERROR_LOG(m_logger) << " due to error on loading, following overlayId is removed: " << unloadableOverlayId << ", but removeOverlay failed"; } @@ -3592,7 +3592,7 @@ bool InterfaceImpl::restoreOcSituationRange() CHECK_SMI_RETVAL; if (!m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -3624,7 +3624,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi if (data.operatorId() != operatorId) return; - DEBUG_LOG() << Q_FUNC_INFO << " Someone would like to use our (Filter) settings "; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Someone would like to use our (Filter) settings "; std::shared_ptr fltFtc = m_pluginProvider->fltFtc(); std::shared_ptr fltParticipantIfc = m_pluginProvider->fltParticipantIfc(); @@ -3636,7 +3636,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi ) { - ERROR_LOG() << Q_FUNC_INFO << " no fltIfc/fltFtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no fltIfc/fltFtc"; return; } @@ -3660,7 +3660,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi FilterManagement::AesFilter aesFilter = displayFilter->filterToData(); req.aesFilterContent(aesFilter.content()); } else { - ERROR_LOG() << Q_FUNC_INFO << " no AesDisplayFilter"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no AesDisplayFilter"; } } @@ -3673,7 +3673,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi FilterManagement::SymbolAppearance symApp = symbolAppearanceSettings->settingsToData(); req.symbolAppearanceContent(symApp.content()); } else { - ERROR_LOG() << Q_FUNC_INFO << " no SymbolAppearanceSettings"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no SymbolAppearanceSettings"; } } @@ -3690,7 +3690,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi FilterManagement::BuildingComponentFilter filter = buildingComponentSettings->bldCmpSettingsToData(); req.buildingComponentsFilterContent(filter.content()); } else { - WARNING_LOG() << Q_FUNC_INFO << " no BuildingComponentSettings"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " no BuildingComponentSettings"; } } } @@ -3700,7 +3700,7 @@ void InterfaceImpl::onTriggerFilterDataChanged(const FilterManagement::TriggerFi req.operatorMapSettingsContent(operatorMapSettingsJson().constData()); } - DEBUG_LOG() << Q_FUNC_INFO << " filterDataUpdateRequest:" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " filterDataUpdateRequest:" << ", OperatorId= " << req.operatorId() << ", screenId= " << req.screenId() << ", screenContainerId= " << req.screenContainerId() @@ -3747,14 +3747,14 @@ QByteArray InterfaceImpl::planOverlayContent(int id) const bool InterfaceImpl::planOverlaySetContent(int id, const QString &name, const QByteArray &xmlContent, bool isSnapshot) { - TRACE_LOG() << Q_FUNC_INFO << " START" + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START" << " id=" << id << " name='" << name << "'" << " isSnapshot=" << isSnapshot; if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return false; } @@ -3782,7 +3782,7 @@ void InterfaceImpl::planOverlayChangeOrder(const QVector &orderOfIds) { if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return; } SituationMap::OverlayHandler &overlayHandler = m_situationMap->overlayHandler(); @@ -3855,7 +3855,7 @@ void InterfaceImpl::setPlanOverlayOpacity(int id, double opacity) void InterfaceImpl::setPlanOverlayMinScale(int id, double minScale) { - DEBUG_LOG() << Q_FUNC_INFO << " minScale= " << minScale; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " minScale= " << minScale; if (!m_situationMap) return; SituationMap::OverlayHandler &overlayHandler = m_situationMap->overlayHandler(); @@ -3867,7 +3867,7 @@ void InterfaceImpl::setPlanOverlayMinScale(int id, double minScale) void InterfaceImpl::setPlanOverlayMaxScale(int id, double maxScale) { - DEBUG_LOG() << Q_FUNC_INFO << " maxScale= " << maxScale; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " maxScale= " << maxScale; if (!m_situationMap) return; SituationMap::OverlayHandler &overlayHandler = m_situationMap->overlayHandler(); @@ -3892,7 +3892,7 @@ double InterfaceImpl::getCurrentMapScale() const { if (!m_situationMap || !m_situationMap->isReady()) { - ERROR_LOG() << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure - map is not ready yet!!!"; return 0.0; } return m_situationMap->scale(); @@ -3903,13 +3903,13 @@ bool InterfaceImpl::toImage(QObject *context, const std::functionisReady() && m_situationMap->isSymbolDictionaryLoaded())) { - ERROR_LOG() << Q_FUNC_INFO << " not ready yet"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " not ready yet"; return false; } @@ -3918,7 +3918,7 @@ bool InterfaceImpl::toImage(QObject *context, const std::functionisFireEventFlashingEnabled(); if (!m_situationMapInit->enableFireEventFlashing(false)) - ERROR_LOG() << Q_FUNC_INFO << " enableFireEventFlashing failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " enableFireEventFlashing failed"; } @@ -4038,7 +4038,7 @@ void InterfaceImpl::onMapObjectsClickedByIds(const QVector &coords) break; } - DEBUG_LOG() << Q_FUNC_INFO << " visible" << visible; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " visible" << visible; if (!visible) m_situationMap->zoomToArea(coords, 100); @@ -4247,7 +4247,7 @@ void InterfaceImpl::doPrint() if (!toImage(this, onImage)) { - ERROR_LOG() << Q_FUNC_INFO << " toImage failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " toImage failed"; blw->setMenuVisible(menuVisible); @@ -4291,7 +4291,7 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, QFile f(folderPath + QLatin1Char('/') + filename); if (!f.open(QIODevice::WriteOnly)) { - WARNING_LOG() << "Can not open file '" << f.fileName() << "' for writing!"; + WARNING_LOG(m_logger) << "Can not open file '" << f.fileName() << "' for writing!"; pExportNotifier->setExportFailed(); return false; } @@ -4317,11 +4317,11 @@ bool TopicReplayInterface::exportTopic(const QJsonObject &attributes, if(arr.empty()) { bool ret = f.remove(); - WARNING_LOG() << " remove sitmap.json file with empty 'replays' ? " <setExportSuccessful({}); return true; } - DEBUG_LOG() << "SitMap filename: " << f.fileName(); + DEBUG_LOG(m_logger) << "SitMap filename: " << f.fileName(); pExportNotifier->setExportSuccessful(filename); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.h index 255234207..65ad382b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_gui_plugin.h @@ -64,6 +64,8 @@ Q_SIGNALS: void aboutToCloseSignal(); protected: + +NGL::INGLLogger &m_logger; void aboutToClose() override; void retranslate() override; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.cpp index 64c13660b..1d861bc7d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.cpp @@ -187,20 +187,20 @@ LayerControlDialog::LayerControlDialog(QWidget *parent) , m_layersModel(nullptr) , m_ui(new Ui::LayerControlDialog) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); m_ui->tvLayer->setItemDelegate(new SpinBoxDelegate(this)); setOnlineHelpFilename(QStringLiteral("Situation-Layer_Control")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } LayerControlDialog::~LayerControlDialog() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_layersModel; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void LayerControlDialog::retranslate() @@ -210,7 +210,7 @@ void LayerControlDialog::retranslate() bool LayerControlDialog::init(LtsSession::LtsSession *session, SituationMap::Map *map) { - TRACE_LOG() << Q_FUNC_INFO << " START " << " map=" << map; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << " map=" << map; if (!session || !map) return false; @@ -344,7 +344,7 @@ bool LayerControlDialog::init(LtsSession::LtsSession *session, SituationMap::Map m_ui->tbBaseSurfaceOpacity->hide(); } - TRACE_LOG() << Q_FUNC_INFO << " END " << " map=" << map; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END " << " map=" << map; return true; } @@ -416,7 +416,7 @@ void LayerControlDialog::onLoadButtonClicked() void LayerControlDialog::onMapReady() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; onZoomSliderInit(); @@ -425,7 +425,7 @@ void LayerControlDialog::onMapReady() m_ui->slBaseSurfaceOpacity->setValue(static_cast(m_situationMap->baseSurfaceOpacity()*100.0f)); m_ui->slBaseSurfaceOpacity->setToolTip(QString::number(m_ui->slBaseSurfaceOpacity->value())); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void LayerControlDialog::onMapDestroyed() @@ -435,13 +435,13 @@ void LayerControlDialog::onMapDestroyed() void LayerControlDialog::onLayerParamterChanged() { - DEBUG_LOG() << Q_FUNC_INFO << " XXXXXXXXX "; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " XXXXXXXXX "; if (!m_situationMap) return; if (m_ignoreLayerParameterChanged) { - DEBUG_LOG() << Q_FUNC_INFO << " skip due to m_ignoreLayerParameterChanged"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " skip due to m_ignoreLayerParameterChanged"; return; } @@ -472,7 +472,7 @@ void LayerControlDialog::onRotationOfMapChanged(double rotation) void LayerControlDialog::onZoomSliderInit() { - TRACE_LOG() << Q_FUNC_INFO << "'" << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "'" << " START"; if (!m_ui || !m_ui->slZoom) return; @@ -483,7 +483,7 @@ void LayerControlDialog::onZoomSliderInit() if (m_ui->slZoom->minimum() == m_ui->slZoom->maximum()) { - WARNING_LOG() << Q_FUNC_INFO << " min/max value are identical" + WARNING_LOG(m_logger) << Q_FUNC_INFO << " min/max value are identical" << " minimum=" << m_ui->slZoom->minimum() << " maximum=" << m_ui->slZoom->maximum() << " value=" << m_ui->slZoom->value(); @@ -491,7 +491,7 @@ void LayerControlDialog::onZoomSliderInit() m_ui->slZoom->setMinimum(static_cast(sqrt(500))); m_ui->slZoom->setMaximum(static_cast(sqrt(100000))); - WARNING_LOG() << Q_FUNC_INFO << " min/max value are identical" + WARNING_LOG(m_logger) << Q_FUNC_INFO << " min/max value are identical" << " minimum=" << m_ui->slZoom->minimum() << " maximum=" << m_ui->slZoom->maximum() << " value=" << m_ui->slZoom->value(); @@ -504,7 +504,7 @@ void LayerControlDialog::onZoomSliderInit() onMapExtentChanged(); m_ui->slZoom->blockSignals(false); - TRACE_LOG() << Q_FUNC_INFO << "'" << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "'" << " END"; } void LayerControlDialog::onZoomSliderValueChanged() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.h index dafb6517d..aab302f53 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_layer_control.h @@ -39,6 +39,8 @@ public: bool init(LtsSession::LtsSession *session, SituationMap::Map *map); private: + +NGL::INGLLogger &m_logger; void retranslate() override; private Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_register_app_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_register_app_handler.cpp index a9fe4a55d..7e324b631 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_register_app_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_register_app_handler.cpp @@ -17,12 +17,11 @@ static inline bool isScreenIdValid(const OperatorManagement::ActiveApp &item) } -RegisterAppHandler::RegisterAppHandler() - : BaseClass() - , m_updateTimer(new QTimer(this)) -{ - INFO_LOG() << "RAH c_tor"; - TRACE_LOG() << Q_FUNC_INFO << " START"; +RegisterAppHandler::RegisterAppHandler() : BaseClass() + , m_updateTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + INFO_LOG(m_logger) << "RAH c_tor"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_activeApp.id(-1); m_activeApp.appId(-1); @@ -35,20 +34,20 @@ RegisterAppHandler::RegisterAppHandler() m_updateTimer->setSingleShot(true); m_updateTimer->setInterval(5000); connect(m_updateTimer, &QTimer::timeout, this, &RegisterAppHandler::onUpdateTimeout); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } RegisterAppHandler::~RegisterAppHandler() { - INFO_LOG() << "RAH d_tor"; - TRACE_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << "RAH d_tor"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; Q_ASSERT(m_finalized); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void RegisterAppHandler::finalize() { - INFO_LOG() << "RAH finalize"; + INFO_LOG(m_logger) << "RAH finalize"; QMetaObject::invokeMethod(this, [this]() @@ -56,7 +55,7 @@ void RegisterAppHandler::finalize() if (m_updateTimer) m_updateTimer->stop(); deRegisterApp(m_activeApp); - INFO_LOG() << "RAH finalize DONE"; + INFO_LOG(m_logger) << "RAH finalize DONE"; deleteLater(); m_finalized = true; }); @@ -122,7 +121,7 @@ void RegisterAppHandler::deRegisterApp(QObject *plugin) void RegisterAppHandler::registerApp(const OperatorManagement::ActiveApp &item) { - TRACE_LOG() << Q_FUNC_INFO << " START " << item; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << item; if (m_activeApp == item) return; @@ -134,50 +133,50 @@ void RegisterAppHandler::registerApp(const OperatorManagement::ActiveApp &item) if (m_activeApp.id() <= 0) m_updateTimer->start(); - TRACE_LOG() << Q_FUNC_INFO << " END " << item; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END " << item; } void RegisterAppHandler::deRegisterApp(const OperatorManagement::ActiveApp &item) { - TRACE_LOG() << Q_FUNC_INFO << " START " << item; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << item; if (!isScreenIdValid(item)) return; if (m_activeApp.id() <= 0) { - WARNING_LOG() << Q_FUNC_INFO << " nothing was registered, skip DeRegister - " << m_activeApp; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " nothing was registered, skip DeRegister - " << m_activeApp; return; } if (!removeRequest()) - WARNING_LOG() << "removeRequest failed"; - TRACE_LOG() << Q_FUNC_INFO << " END" << item; + WARNING_LOG(m_logger) << "removeRequest failed"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END" << item; } bool RegisterAppHandler::updateRequest() { if (!m_opmFtc) { - ERROR_LOG() << Q_FUNC_INFO << " no fltFtc!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no fltFtc!"; return false; } - INFO_LOG() << Q_FUNC_INFO << " startSingleRequest " << m_activeApp; + INFO_LOG(m_logger) << Q_FUNC_INFO << " startSingleRequest " << m_activeApp; try { - INFO_LOG() << "RAH update"; + INFO_LOG(m_logger) << "RAH update"; m_activeApp.id(m_opmFtc->activeAppUpdateRequest(m_activeApp)); } catch(const std::runtime_error &err) { - ERROR_LOG() << "failed to update active app: " << err.what(); + ERROR_LOG(m_logger) << "failed to update active app: " << err.what(); Q_ASSERT(false); return false; } - DEBUG_LOG() << Q_FUNC_INFO << " m_requestHelper->getRepliedId() " << m_activeApp.id(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_requestHelper->getRepliedId() " << m_activeApp.id(); return true; } @@ -188,7 +187,7 @@ bool RegisterAppHandler::removeRequest() if (!m_opmFtc) { - ERROR_LOG() << Q_FUNC_INFO << " no fltFtc!"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no fltFtc!"; return false; } @@ -197,13 +196,13 @@ bool RegisterAppHandler::removeRequest() try { - INFO_LOG() << "RAH remove"; + INFO_LOG(m_logger) << "RAH remove"; m_opmFtc->activeAppRemoveRequest(Core::RemoveElementRequest(m_activeApp.id())); return true; } catch (const std::runtime_error &err) { - ERROR_LOG() << "failed to remove active app: " << err.what(); + ERROR_LOG(m_logger) << "failed to remove active app: " << err.what(); Q_ASSERT(false); return false; } @@ -211,9 +210,9 @@ bool RegisterAppHandler::removeRequest() void RegisterAppHandler::onUpdateTimeout() { - DEBUG_LOG() << Q_FUNC_INFO << " START" << " m_opmFtc = " << m_opmFtc + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " m_opmFtc = " << m_opmFtc << " m_activeApp = " << m_activeApp; - INFO_LOG() << "RAH timer"; + INFO_LOG(m_logger) << "RAH timer"; updateRequest(); } @@ -226,22 +225,22 @@ void RegisterAppHandler::handleSvcStartupRequest(const OperatorManagement::Activ if ((data.operatorId() < 0) && (m_activeApp.appId() >= 0)) { - INFO_LOG() << Q_FUNC_INFO << " startUpRequest recognized, reDo updateRequest"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " startUpRequest recognized, reDo updateRequest"; updateRequest(); } } void RegisterAppHandler::onScreenIdChanged(int screenId, int screenContainerId, int screenTypeId) { - TRACE_LOG() << Q_FUNC_INFO << " START, screenId=" << screenId << ", screenContainerId=" << screenContainerId << ", screenTypeId=" << screenTypeId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, screenId=" << screenId << ", screenContainerId=" << screenContainerId << ", screenTypeId=" << screenTypeId; - INFO_LOG() << Q_FUNC_INFO << " screenId: " << m_activeApp.screenId() << " -> " << screenId; + INFO_LOG(m_logger) << Q_FUNC_INFO << " screenId: " << m_activeApp.screenId() << " -> " << screenId; m_activeApp.screenTypeId(screenTypeId); m_activeApp.screenId(screenId); m_activeApp.screenContainerId(screenContainerId); updateRequest(); - TRACE_LOG() << Q_FUNC_INFO << " END, screenId=" << screenId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, screenId=" << screenId; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.cpp index f4aff320b..ed72a1fa0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.cpp @@ -29,19 +29,19 @@ MapWidgetControl::MapWidgetControl(const QString &menuGroup, QWidget *parent) , m_tb2D3D(nullptr) , m_session(nullptr) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ui->setupUi(this); setOnlineHelpFilename(QStringLiteral("Situation-Map_Widgets")); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } MapWidgetControl::~MapWidgetControl() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete m_ui; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void MapWidgetControl::retranslate() @@ -52,7 +52,7 @@ void MapWidgetControl::retranslate() bool MapWidgetControl::init(SituationMap::Map *map, LtsSession::LtsSession *session ) { - TRACE_LOG() << Q_FUNC_INFO << " START " << " map=" << map; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START " << " map=" << map; if (!map) return false; @@ -62,12 +62,12 @@ bool MapWidgetControl::init(SituationMap::Map *map, LtsSession::LtsSession *sess if (m_situationMap == nullptr) { - ERROR_LOG() << "invalid situation map given"; + ERROR_LOG(m_logger) << "invalid situation map given"; return false; } reBuildUi(); - TRACE_LOG() << Q_FUNC_INFO << " END " << " map=" << map; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END " << " map=" << map; return true; } @@ -88,7 +88,7 @@ bool MapWidgetControl::isReplay() const { if (m_situationMap == nullptr) { - ERROR_LOG() << "cannot check if situation map is in replay, no situation map available"; + ERROR_LOG(m_logger) << "cannot check if situation map is in replay, no situation map available"; return false; } return m_situationMap->isReplay(); @@ -104,7 +104,7 @@ void MapWidgetControl::onChangeModeRequested() { if (m_tb2D3D == nullptr) { - ERROR_LOG() << "cannot process change mode request, no 2D/3D option available"; + ERROR_LOG(m_logger) << "cannot process change mode request, no 2D/3D option available"; return; } m_tb2D3D->setEnabled(false); @@ -133,7 +133,7 @@ void MapWidgetControl::reBuildUi() if (m_situationMap == nullptr) { - ERROR_LOG() << "cannot rebuild ui, no situation map available"; + ERROR_LOG(m_logger) << "cannot rebuild ui, no situation map available"; return; } @@ -344,12 +344,12 @@ void MapWidgetControl::enaDisa() if (m_situationMap == nullptr) { - ERROR_LOG() << "cannot enable/disable ui, no situation map available"; + ERROR_LOG(m_logger) << "cannot enable/disable ui, no situation map available"; return; } if ( m_tb2D3D && !enable3dMap) { - DEBUG_LOG() << "m_tb2D3D->hide();" + DEBUG_LOG(m_logger) << "m_tb2D3D->hide();" << "m_enable3dMap=" << enable3dMap; m_tb2D3D->hide(); } @@ -362,13 +362,13 @@ void MapWidgetControl::enaDisa() case Mode::Mode_2D: m_tb2D3D->setText(tr("Switch to 3D")); m_tb2D3D->setIcon(QIcon(QLatin1String("icon:map_3d.svg"))); - DEBUG_LOG() << "m_tb2D3D Switch to 3D" + DEBUG_LOG(m_logger) << "m_tb2D3D Switch to 3D" << "enable3dMap=" << enable3dMap; break; case Mode::Mode_3D: m_tb2D3D->setText(tr("Switch to 2D")); m_tb2D3D->setIcon(QIcon(QLatin1String("icon:map_2d.svg"))); - DEBUG_LOG() << "m_tb2D3D Switch to 2D" + DEBUG_LOG(m_logger) << "m_tb2D3D Switch to 2D" << "enable3dMap=" << enable3dMap; break; default: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.h index 2afc72f0b..5520d559d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/sitmap_widget_control.h @@ -47,6 +47,8 @@ private Q_SLOTS: private: + +NGL::INGLLogger &m_logger; struct MenuWidgetPosition { int row; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.cpp index 36d91504a..b7935ad5f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.cpp @@ -174,24 +174,24 @@ SituationMapInit::SituationMapInit(QObject *parent) : QObject(parent) , m_logger(SituationMap::getLogger("SituationMapInit")) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } SituationMapInit::~SituationMapInit() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_pluginProvider == nullptr) { - ERROR_LOG() << Q_FUNC_INFO << " !m_pluginProvider"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " !m_pluginProvider"; m_adapterDds.clear(); return; } if (!m_pluginProvider->isSessionValid()) { - INFO_LOG() << Q_FUNC_INFO << " no session anymore: return"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " no session anymore: return"; m_adapterDds.clear(); return; } @@ -211,30 +211,30 @@ SituationMapInit::~SituationMapInit() if (m_situationMap) { - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: DELETE ...., isNull = " << m_situationMap->property(MapCacheState).isNull(); - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: DELETE ...., property = '" << (m_situationMap ? m_situationMap->property(MapCacheState).toString().toStdString() : "-") << "'"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: DELETE ...., isNull = " << m_situationMap->property(MapCacheState).isNull(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: DELETE ...., property = '" << (m_situationMap ? m_situationMap->property(MapCacheState).toString().toStdString() : "-") << "'"; if (m_situationMap->property(MapCacheState).isNull()) { - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: DELETE YES"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: DELETE YES"; delete m_situationMap; m_situationMap.clear(); } else { - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: DELETE NO, setParent->null"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: DELETE NO, setParent->null"; m_situationMap->setParent(nullptr, true); m_situationMap->setProperty(MapCacheState, QVariant()); } } #else - DEBUG_LOG() << Q_FUNC_INFO << " DELETE situationMap: YES"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " DELETE situationMap: YES"; delete m_situationMap; m_situationMap.clear(); #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } @@ -244,7 +244,7 @@ ThatPartyIdToColorFunctor::ThatPartyIdToColorFunctor(const std::shared_ptrwaitForHistoricalDataParty(1000); @@ -255,12 +255,12 @@ ThatPartyIdToColorFunctor::ThatPartyIdToColorFunctor(const std::shared_ptr &movementTrack if (!m_adapterDds->init(m_situationMap, m_pluginProvider, movementTrackMgr, resourceMode)) { - ERROR_LOG() << Q_FUNC_INFO << " m_adapterDds->init failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " m_adapterDds->init failed"; return false; } @@ -356,7 +356,7 @@ bool SituationMapInit::initAdapter(QPointer &movementTrack connect(m_adapterDds.data(), &AdapterDds::participantPositionChanged, this, &SituationMapInit::participantPositionChanged); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } @@ -407,7 +407,7 @@ bool SituationMapInit::clearObjects() if (remainingObjectsCount != 0) { - WARNING_LOG() << Q_FUNC_INFO << " remainingObjectsCount should be '0', is: " << remainingObjectsCount; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " remainingObjectsCount should be '0', is: " << remainingObjectsCount; } return true; @@ -468,7 +468,7 @@ bool SituationMapInit::enableGearRanges(int participantId, bool enable) return false; ptr->setRangesVisibility(enable); if (!ptr->updateView()) - ERROR_LOG() << "Couldn't updateview after setting setRangesVisibility(" << enable << ") for SimId: " << participantId; + ERROR_LOG(m_logger) << "Couldn't updateview after setting setRangesVisibility(" << enable << ") for SimId: " << participantId; return true; } @@ -519,7 +519,7 @@ bool SituationMapInit::centerMapToAesObject(int entityId) if (!bbox.isValid()) { - WARNING_LOG() << Q_FUNC_INFO + WARNING_LOG(m_logger) << Q_FUNC_INFO << " boundingBox not valid: bbox=" << bbox; return false; } @@ -542,7 +542,7 @@ bool SituationMapInit::centerMapToBuildingObject(int entityId) if (!bbox.isValid()) { - WARNING_LOG() << Q_FUNC_INFO + WARNING_LOG(m_logger) << Q_FUNC_INFO << " boundingBox not valid: bbox=" << bbox; return false; } @@ -587,7 +587,7 @@ bool SituationMapInit::centerMapToMapObject(MapObjectType mot, int entityId) if (!bbox.isValid()) { - WARNING_LOG() << Q_FUNC_INFO + WARNING_LOG(m_logger) << Q_FUNC_INFO << " boundingBox not valid: bbox=" << bbox; return false; } @@ -800,7 +800,7 @@ void SituationMapInit::modifyViewshed(double alpha, double innerRadius, double o if (m_viewshedId >= 0) m_situationMap->viewshed().modify(m_viewshedId, alpha, innerRadius, observerHeight, targetHeight, beamAngle); else - DEBUG_LOG() << Q_FUNC_INFO << " m_viewshedId invalid (" << m_viewshedId << ")"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_viewshedId invalid (" << m_viewshedId << ")"; } } @@ -886,22 +886,22 @@ SituationMap::RB::RubberbandFactory &SituationMapInit::rubberbandFactory() ResourceManagerMode SituationMapInit::resourceManagerMode() const { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_adapterDds) return ResourceManagerMode::Undefined; ResourceManagerMode rmm = m_adapterDds->resourceManagerMode(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return rmm; } bool SituationMapInit::setResourceManagerMode(ResourceManagerMode rmm) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (!m_adapterDds) return false; bool success = m_adapterDds->setResourceManagerMode(rmm); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return success; } @@ -953,7 +953,7 @@ static QVector convertMapDecription2BaseUrlVec(const std::vectorexmDtc() || !m_pluginProvider->asmDtc()) return false; @@ -968,7 +968,7 @@ bool SituationMapInit::trainingAreaExists() const const AssetManagement::TrainingArea &ta = m_pluginProvider->asmDtc()->trainingArea(trainingAreaId); - TRACE_LOG() << Q_FUNC_INFO << " END, trainingAreaExists = " << (ta.id() == trainingAreaId); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, trainingAreaExists = " << (ta.id() == trainingAreaId); return (ta.id() == trainingAreaId); } @@ -986,7 +986,7 @@ MapSettingsJson SituationMapInit::getMapSettingsFromService() const if (ta.id() != trainingAreaId) { - ERROR_LOG() << Q_FUNC_INFO << " TrainingArea does not exists (yet)"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " TrainingArea does not exists (yet)"; return msj; } @@ -1002,7 +1002,7 @@ MapSettingsJson SituationMapInit::getMapSettingsFromService() const bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, const SituationMap::Viewpoint2D &viewPoint) { - INFO_LOG() << Q_FUNC_INFO << " START, enableSelection=" << enableSelection + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, enableSelection=" << enableSelection << ", mapMode=" << mapMode; #ifdef USE_MAP_CACHE @@ -1023,11 +1023,11 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, { m_situationMap = mapCacheItemRef.m_mapWidget; m_situationMap->setProperty(MapCacheState, QVariant(QStringLiteral("3D/reUsed/taken"))); - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: ReUse Mode_3D" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: ReUse Mode_3D" << " (updatesEnabled()=" << m_situationMap->updatesEnabled() << ")"; reUsing = true; } else { - DEBUG_LOG() << Q_FUNC_INFO << " MapCache: CREATE Mode_3D"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " MapCache: CREATE Mode_3D"; m_situationMap = SituationMap::Map::create(); mapCacheItemRef.m_mapWidget = m_situationMap; mapCacheItemRef.m_mapWidget->setProperty(MapCacheState, QVariant(QStringLiteral("3D/created"))); @@ -1081,7 +1081,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, #endif - INFO_LOG() << Q_FUNC_INFO << " ***** initMap:" + INFO_LOG(m_logger) << Q_FUNC_INFO << " ***** initMap:" << ", mapMode=" << mapMode << ", m_pluginProvider->toString=" << m_pluginProvider->toString() << ", exerciseId()= " << m_pluginProvider->exerciseId(); @@ -1102,7 +1102,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, const bool bTrainingAreaExists = this->trainingAreaExists(); - INFO_LOG() << Q_FUNC_INFO << " bTrainingAreaExists=" << bTrainingAreaExists + INFO_LOG(m_logger) << Q_FUNC_INFO << " bTrainingAreaExists=" << bTrainingAreaExists << ", m_pluginProvider->toString " << m_pluginProvider->toString(); bool bIsOfTypeOrganizer = @@ -1130,7 +1130,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, { int tries = waitForTa->property("tries").toInt(); - INFO_LOG() << Q_FUNC_INFO << " waiting for trainingAreaExists " << trainingAreaExists() << ", tries = " << tries; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for trainingAreaExists " << trainingAreaExists() << ", tries = " << tries; if (this->trainingAreaExists()) { @@ -1139,7 +1139,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, const MapSettingsJson &mapSettingsFromService = getMapSettingsFromService(); if (!initMapPart2(mapMode, viewPoint, &mapSettingsFromService)) - ERROR_LOG() << Q_FUNC_INFO << " initMapPart2 failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " initMapPart2 failed"; } if (tries > 30) @@ -1152,7 +1152,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, << " giving up"; if (!initMapPart2(mapMode, viewPoint)) - ERROR_LOG() << Q_FUNC_INFO << " initMapPart2 failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " initMapPart2 failed"; return; } waitForTa->setProperty("tries", ++tries); @@ -1163,7 +1163,7 @@ bool SituationMapInit::initMap(bool enableSelection, SituationMap::Mode mapMode, return true; } - TRACE_LOG() << Q_FUNC_INFO << " END, success=" << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, success=" << success; return success; } @@ -1171,7 +1171,7 @@ bool SituationMapInit::initMapPart2(SituationMap::Mode mapMode, const SituationMap::Viewpoint2D &viewPoint, const MapSettingsJson* mapSettingJson) { - INFO_LOG() << Q_FUNC_INFO << " mapSettingJson=" << mapSettingJson; + INFO_LOG(m_logger) << Q_FUNC_INFO << " mapSettingJson=" << mapSettingJson; bool success = true; @@ -1183,7 +1183,7 @@ bool SituationMapInit::initMapPart2(SituationMap::Mode mapMode, return false; } else - DEBUG_LOG() << Q_FUNC_INFO << " ***** MapIniFile found: " << initFilePath; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ***** MapIniFile found: " << initFilePath; SituationMap::MapSettings *mapSettings = @@ -1215,13 +1215,13 @@ bool SituationMapInit::initMapPart2(SituationMap::Mode mapMode, SituationMap::FunctionDialog::addButtonToMap(m_situationMap); #endif - TRACE_LOG() << Q_FUNC_INFO << " END, success=" << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, success=" << success; return success; } void SituationMapInit::myMapWidgetDialogIsAboutToBeClosed() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_adapterDds) @@ -1239,7 +1239,7 @@ void SituationMapInit::myMapWidgetDialogIsAboutToBeClosed() - INFO_LOG() << Q_FUNC_INFO << " MapCache: prevent destruction"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " MapCache: prevent destruction"; m_situationMap->setParent(nullptr, true); } @@ -1260,7 +1260,7 @@ bool SituationMapInit::updateAll() if (!m_situationMap->isReady()) { - INFO_LOG() << Q_FUNC_INFO << " Map Not ready Yet: Skip "; + INFO_LOG(m_logger) << Q_FUNC_INFO << " Map Not ready Yet: Skip "; return false; } @@ -1270,19 +1270,19 @@ bool SituationMapInit::updateAll() void SituationMapInit::onMapbeginDestroy() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_adapterDds) { m_adapterDds->stop(); m_adapterDds.clear(); } - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void SituationMapInit::onMapObjectsClicked(const SituationMap::Map::RefPointerMapObjectList &mapObjList, const QPointF &viewportPosition) { - TRACE_LOG() << Q_FUNC_INFO << " ViewPort X: " << viewportPosition.x() << " Y: " << viewportPosition.y(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " ViewPort X: " << viewportPosition.x() << " Y: " << viewportPosition.y(); onMapObjectClickedByArea(mapObjList); } @@ -1323,7 +1323,7 @@ void SituationMapInit::onMapObjectClickedByArea(const SituationMap::Map::RefPoin const auto &mapObj = mapObjList.front(); { if (!m_adapterDds->onMapObjectClicked(mapObj)) - WARNING_LOG() << Q_FUNC_INFO << " Click on a map object but found no handler for it ... " + WARNING_LOG(m_logger) << Q_FUNC_INFO << " Click on a map object but found no handler for it ... " << " mapObj: debugInfo='" << mapObj->debugInfo() << "'" << " uniqueMapId=" << mapObj->uniqueMapId(); } @@ -1338,7 +1338,7 @@ void SituationMapInit::onProcessMapObjectClicked(const QVectoronMapObjectsClicked(uniqueMapIds)) - WARNING_LOG() << Q_FUNC_INFO << " onMapObjectsClicked failed ... "; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " onMapObjectsClicked failed ... "; } void SituationMapInit::onContextMenuRequested(const SituationMap::Map::RefPointerMapObjectList &mapObjList, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.h index 7a3e0c969..359c3e5c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init.h @@ -162,6 +162,7 @@ private Q_SLOTS: void onViewshedFinished(long viewshedId); protected: + NGL::INGLLogger &m_logger; virtual bool trainingAreaExists() const; virtual MapSettingsJson getMapSettingsFromService() const; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init_p.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init_p.h index 72eb381f3..c5d196ba9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init_p.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/situation_map_init_p.h @@ -118,6 +118,8 @@ protected Q_SLOTS: void onPartyChanged(const ParticipantManagement::Party &data, DataModification modType = DataModification::eAdded); private: + +NGL::INGLLogger &m_logger; bool m_doRemovePartyFlag = true; std::shared_ptr m_ppmDtc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/terrain_profile_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/terrain_profile_handler.cpp index 20923faad..c5d0cb04a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/terrain_profile_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMap/terrain_profile_handler.cpp @@ -10,9 +10,8 @@ namespace SituationMap { -TerrainProfileHandler::TerrainProfileHandler(const QString &menuGroup) - : m_menuGroup(menuGroup) -{} +TerrainProfileHandler::TerrainProfileHandler(const QString &menuGroup) : m_menuGroup(menuGroup), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} TerrainProfileHandler::~TerrainProfileHandler() { @@ -55,7 +54,7 @@ bool TerrainProfileHandler::showTerrainProfileResults(long id, const QVector > &results); private: + NGL::INGLLogger &m_logger; QPointer m_session; QPointer m_situationMap; QPointer m_terrainProfileDialog; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMapScriptFilter/sitmap_script_filter_gui_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMapScriptFilter/sitmap_script_filter_gui_plugin.cpp index ff49c4143..3466dcfba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMapScriptFilter/sitmap_script_filter_gui_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationMapPlugin/Gui/SituationMapScriptFilter/sitmap_script_filter_gui_plugin.cpp @@ -27,17 +27,17 @@ TopicEditorBase::TopicEditor *InterfaceImpl::createTopicEditor(const TopicEditor if (m_sitmapIfc == nullptr) - DEBUG_LOG() << "SituationMapScriptFilter: createTopicEditor: sitmap ifc missing"; + DEBUG_LOG(m_logger) << "SituationMapScriptFilter: createTopicEditor: sitmap ifc missing"; MarkerManagement::MarkerManagementDialogModel *markerModel = nullptr; if (m_mrkIfc) markerModel = m_mrkIfc->createMarkerModel(); else - WARNING_LOG() << "No Mrk Ifc for ScriptFilter Topic Editor"; + WARNING_LOG(m_logger) << "No Mrk Ifc for ScriptFilter Topic Editor"; if (m_applyFilter == nullptr) - DEBUG_LOG() << "SituationMapScriptFilter: createTopicEditor: apply filter missing!"; + DEBUG_LOG(m_logger) << "SituationMapScriptFilter: createTopicEditor: apply filter missing!"; return new SituationMapScriptFilterTopicEditor(markerModel, &m_sitmapIfc, m_applyFilter); } @@ -60,7 +60,7 @@ bool InterfaceImpl::fetchInterfaces() { if (!m_session->getForeignGuiInterface(m_mrkIfc)) { - DEBUG_LOG() << "getForeignGuiInterface for MarkerManagement::ForeignGuiInterface failed."; + DEBUG_LOG(m_logger) << "getForeignGuiInterface for MarkerManagement::ForeignGuiInterface failed."; return false; } @@ -87,7 +87,7 @@ InterfaceImpl::TopicReplayInterface::~TopicReplayInterface() { if (m_sitmapIfc == nullptr) { - WARNING_LOG() << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; + WARNING_LOG(m_logger) << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; return; } @@ -104,13 +104,13 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib { if (m_sitmapIfc == nullptr) { - WARNING_LOG() << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; + WARNING_LOG(m_logger) << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; return false; } if (m_applyFilter == nullptr) { - WARNING_LOG() << "ApplyFilter missing for SitMapScriptFilter TopicReplayInterface"; + WARNING_LOG(m_logger) << "ApplyFilter missing for SitMapScriptFilter TopicReplayInterface"; return false; } @@ -118,7 +118,7 @@ bool InterfaceImpl::TopicReplayInterface::playbackInit(const QJsonObject &attrib if (mapConfig.isNull()) { - WARNING_LOG() << "Note: Situation Map Script Filter settings is empty"; + WARNING_LOG(m_logger) << "Note: Situation Map Script Filter settings is empty"; return true; } @@ -142,7 +142,7 @@ QVector InterfaceImpl::TopicReplayInterface::additio { if (m_sitmapIfc == nullptr) { - WARNING_LOG() << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; + WARNING_LOG(m_logger) << "SitMapIfc missing for SitMapScriptFilter TopicReplayInterface"; return {}; } const QJsonValue mapConfig = attributes[QStringLiteral("settings")]; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.cpp index b17d60a5c..f82513221 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.cpp @@ -112,12 +112,12 @@ SituationReplayEditor::SituationReplayEditor( if ((*m_essentialsViewsSrpIfc) != nullptr) { - WARNING_LOG() << "essentials view available - using srp replay control widget as editor!"; + WARNING_LOG(m_logger) << "essentials view available - using srp replay control widget as editor!"; onAddReplayControlWidget(); } else { - WARNING_LOG() << "essentials view not available - using traditional editor"; + WARNING_LOG(m_logger) << "essentials view not available - using traditional editor"; } setOnlineHelpFilename(QStringLiteral("Script_Editor-Add_Situation_Replay_Topic")); @@ -133,7 +133,7 @@ SituationReplayEditor::~SituationReplayEditor() void SituationReplayEditor::updateInternalData() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (m_firstUpdate) { @@ -181,7 +181,7 @@ void SituationReplayEditor::updateInternalData() void SituationReplayEditor::updateInternalLength() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; qint64 end = calculateEnd(m_ui->dteStartTime->msecsSinceEpoch(), m_topicData.duration, m_ui->sbSpeed->value(), true); bool hasChanges = hasUnsavedChanges(); m_ui->dteEndTime->setMsecsSinceEpoch(end); @@ -226,19 +226,19 @@ qint64 SituationReplayEditor::calculateEnd(qint64 startTime, int lengthInSeconds else result /= speed; result += startTime; - DEBUG_LOG() << Q_FUNC_INFO << " result = " << result; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " result = " << result; return result; } qint64 SituationReplayEditor::calculateDuration(qint64 startTime, qint64 endTime, double speed) { - DEBUG_LOG() << Q_FUNC_INFO << " startTime=" << startTime << " endTime=" << endTime << " speed=" << speed; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " startTime=" << startTime << " endTime=" << endTime << " speed=" << speed; qint64 duration = endTime - startTime; double result = duration; result /= speed; qint64 result2 = result; result2 += 500; - DEBUG_LOG() << Q_FUNC_INFO << " result = " << result2; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " result = " << result2; return result2; } @@ -256,7 +256,7 @@ void SituationReplayEditor::setMapSettings(const QByteArray &mapSettings) if (parseError.error != QJsonParseError::NoError) { - ERROR_LOG() << "map settings not valid json at" << parseError.errorString(); + ERROR_LOG(m_logger) << "map settings not valid json at" << parseError.errorString(); return; } @@ -271,7 +271,7 @@ void SituationReplayEditor::setMapFilter(const QByteArray &mapFilter) if (parseError.error != QJsonParseError::NoError) { - ERROR_LOG() << "filter settings not valid json at" << parseError.errorString(); + ERROR_LOG(m_logger) << "filter settings not valid json at" << parseError.errorString(); return; } @@ -345,7 +345,7 @@ bool SituationReplayEditor::apply2() m_ui->lblDuration->setText(QStringLiteral(" - ")); else { - DEBUG_LOG() << Q_FUNC_INFO << " setText length = " << duration; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " setText length = " << duration; m_ui->lblDuration->setText(tr("%1 sec").arg(m_topicDuration)); } } @@ -463,7 +463,7 @@ void SituationReplayEditor::onMarkerSelected(const QModelIndex &idx) if (marker.id() <= 0) { - ERROR_LOG() << "marker has id 0"; + ERROR_LOG(m_logger) << "marker has id 0"; return; } @@ -477,13 +477,13 @@ void SituationReplayEditor::onMarkerSelected(const QModelIndex &idx) void SituationReplayEditor::onChangesMade() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; qint64 start = m_ui->dteStartTime->msecsSinceEpoch(); qint64 end = m_ui->dteEndTime->msecsSinceEpoch(); double speed = m_ui->sbSpeed->value(); qint64 duration = calculateDuration(start, end, speed) / 1000; - DEBUG_LOG() << Q_FUNC_INFO << " duration = " << duration; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " duration = " << duration; if (duration < 0) m_ui->lblDuration->setText(QStringLiteral(" - ")); @@ -493,7 +493,7 @@ void SituationReplayEditor::onChangesMade() m_topicData.duration = duration; m_ui->widget->previewer()->setTopicData(m_topicData); m_ui->lblDuration->setText(tr("%1 sec").arg(m_topicDuration)); - DEBUG_LOG() << Q_FUNC_INFO << " setText duration = " << duration; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " setText duration = " << duration; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.h index 96d8e329f..f58ba8355 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/TopicEditor/topic_editor.h @@ -38,6 +38,8 @@ public: ~SituationReplayEditor(); private: + +NGL::INGLLogger &m_logger; void updateInternalData() override; void updateInternalLength() override; void retranslate() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_dialog.h index d8e70751d..a5cd30c30 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_dialog.h @@ -18,6 +18,8 @@ public: explicit SituationReplayControlDialog(SituationReplayControlWidget *replayWidget, QWidget *parent = nullptr); private: + +NGL::INGLLogger &m_logger; void retranslate() override; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.cpp index c27a1ed1d..7eda68af2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.cpp @@ -116,7 +116,7 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session, if (!m_session->getDtc(m_exmDtc)) { - ERROR_LOG()<<" couldn't init exmDtc!"; + ERROR_LOG(m_logger)<<" couldn't init exmDtc!"; return false; } @@ -140,7 +140,7 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session, { m_state = replay.state(); m_id = replay.id(); - DEBUG_LOG() << "recycling replay with id" << m_id; + DEBUG_LOG(m_logger) << "recycling replay with id" << m_id; m_ui->dteStartTime->setMsecsSinceEpoch(replay.beginTime()); useExistingReplay = true; break; @@ -220,19 +220,19 @@ bool SituationReplayControlWidget::init(LtsSession::LtsSession *session, if (beginTime > 0) { - WARNING_LOG() << "no exc start time set, using exc begin time " << beginTime; + WARNING_LOG(m_logger) << "no exc start time set, using exc begin time " << beginTime; m_ui->dteStartTime->setMsecsSinceEpoch(beginTime); } else { - WARNING_LOG() << "no valid exc for getting exercise start time"; + WARNING_LOG(m_logger) << "no valid exc for getting exercise start time"; m_ui->dteStartTime->setMsecsSinceEpoch(QDateTime::currentDateTime().addDays(-5).toMSecsSinceEpoch()); } } } else { - WARNING_LOG() << "no exc dtc for getting exercise start time"; + WARNING_LOG(m_logger) << "no exc dtc for getting exercise start time"; m_ui->dteStartTime->setMsecsSinceEpoch(QDateTime::currentDateTime().addDays(-5).toMSecsSinceEpoch()); } } @@ -294,10 +294,10 @@ qint64 SituationReplayControlWidget::startTime() const void SituationReplayControlWidget::setStartTime(qint64 startTime) { - ERROR_LOG() << Q_FUNC_INFO << " " << startTime; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << startTime; if (startTime < 0) { - DEBUG_LOG() << Q_FUNC_INFO << " called with invalid start time: " << startTime; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " called with invalid start time: " << startTime; return; } @@ -361,7 +361,7 @@ void SituationReplayControlWidget::pauseReplay() if (m_id == 0) { - WARNING_LOG() << "replay pause requested, but no replay active in this context"; + WARNING_LOG(m_logger) << "replay pause requested, but no replay active in this context"; return; } @@ -381,13 +381,13 @@ void SituationReplayControlWidget::pauseReplay() })) { enaDisa(); - ERROR_LOG() << "pausing failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); + ERROR_LOG(m_logger) << "pausing failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); } else emit replayPaused(); } else - ERROR_LOG() << "pause requested, but replay state was not resumed or started, but " << m_state << " for " << m_id; + ERROR_LOG(m_logger) << "pause requested, but replay state was not resumed or started, but " << m_state << " for " << m_id; } @@ -398,7 +398,7 @@ void SituationReplayControlWidget::stopReplay() if (m_id == 0) { - WARNING_LOG() << "replay stop requested, but no replay active in this context"; + WARNING_LOG(m_logger) << "replay stop requested, but no replay active in this context"; return; } @@ -424,7 +424,7 @@ void SituationReplayControlWidget::stopReplay() else { enaDisa(); - ERROR_LOG() << "stopping failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); + ERROR_LOG(m_logger) << "stopping failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); } m_requestHelper->setQuiet(wasQuiet); @@ -453,14 +453,14 @@ void SituationReplayControlWidget::resumeReplay() })) { enaDisa(); - ERROR_LOG() << "resuming failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); + ERROR_LOG(m_logger) << "resuming failed for replay " << m_id << ": " << m_requestHelper->getErrorString(); } } void SituationReplayControlWidget::onSitReplayChanged(const SitReplay &data, DataModification modType) { - DEBUG_LOG() << "onSitReplayChanged: id = " << data.id() << ", exId = " << data.exerciseId() << ", repPartitionId = " << data.replayPartitionId() + DEBUG_LOG(m_logger) << "onSitReplayChanged: id = " << data.id() << ", exId = " << data.exerciseId() << ", repPartitionId = " << data.replayPartitionId() << ", state = " << (int)data.state().underlying() << ", m_partitionId = " << m_partitionId << ", modType = " << (int)modType; if (m_partitionId != data.replayPartitionId()) @@ -512,7 +512,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index) ) appFilter = new MarkerManagement::MarkerManagementApplyFilter(m_session, fltParticipantIfc, fltAesIfc, fltBuildingComponentGuiIfc); else - WARNING_LOG() << "unable to set filters from marker as flt ifc`s are missing"; + WARNING_LOG(m_logger) << "unable to set filters from marker as flt ifc`s are missing"; @@ -522,7 +522,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index) if (appFilter->applyFilter(mapFilter)) emit signalSetMapFilter(mapFilter); else - ERROR_LOG() << "Error while setting filters"; + ERROR_LOG(m_logger) << "Error while setting filters"; } else { @@ -545,20 +545,20 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index) if (appFilter) { QByteArray mapSettings(QByteArray::fromRawData(marker.mapSettings().c_str(), marker.mapSettings().size())); - DEBUG_LOG() << "set map settings from marker " << (mapSettings.toStdString()); + DEBUG_LOG(m_logger) << "set map settings from marker " << (mapSettings.toStdString()); SituationMap::OperatorMapSettings oms; oms.fromJson(mapSettings); - DEBUG_LOG() << ">>>> oms.orderedLayers.size() " << oms.orderedLayers.size(); + DEBUG_LOG(m_logger) << ">>>> oms.orderedLayers.size() " << oms.orderedLayers.size(); static const QLatin1String LayerNameEmergencyCall("EmergencyCall"); auto pos = std::remove_if( oms.orderedLayers.begin(), oms.orderedLayers.end(), [](const QPair &pair) { return pair.first == LayerNameEmergencyCall; } ); - DEBUG_LOG() << ">>>> remove iterator: " << pos << " END: " << oms.orderedLayers.end(); + DEBUG_LOG(m_logger) << ">>>> remove iterator: " << pos << " END: " << oms.orderedLayers.end(); if(pos != oms.orderedLayers.end()) oms.orderedLayers.erase(pos); @@ -569,7 +569,7 @@ void SituationReplayControlWidget::onMarkerClicked(const QModelIndex &index) if (appFilter->applyMapSettings(mapSettings)) emit signalSetMapSettings(mapSettings); else - ERROR_LOG() << "Error while setting mapSettings"; + ERROR_LOG(m_logger) << "Error while setting mapSettings"; } delete appFilter; } @@ -634,7 +634,7 @@ bool SituationReplayControlWidget::startReplayDelayed(qint64 start, qint64 end, req.endTime(end); req.pace(speed); - ERROR_LOG() << "Start Replay Partition: " + ERROR_LOG(m_logger) << "Start Replay Partition: " << "id: " << m_id << ", partition id: " << m_partitionId << ", partition type: " << m_session->partitionType() @@ -652,15 +652,15 @@ bool SituationReplayControlWidget::startReplayDelayed(qint64 start, qint64 end, if (repliedId > 0) { m_id = repliedId; - ERROR_LOG() << "Replied replay id: " << repliedId; + ERROR_LOG(m_logger) << "Replied replay id: " << repliedId; emit replayStarted(); return true; } - ERROR_LOG() << "replay start didn't return a replay id!"; + ERROR_LOG(m_logger) << "replay start didn't return a replay id!"; } - ERROR_LOG() << "could not start replay: " << m_requestHelper->getErrorString() << " (" << m_requestHelper->getRepliedId() << ")"; + ERROR_LOG(m_logger) << "could not start replay: " << m_requestHelper->getErrorString() << " (" << m_requestHelper->getRepliedId() << ")"; enaDisa(); return false; } @@ -671,7 +671,7 @@ void SituationReplayControlWidget::onStartReplay() double speed = m_ui->slSpeed->value(); speed /= 10; qint64 startInSecs = getSecs(m_ui->dteStartTime->msecsSinceEpoch()); - DEBUG_LOG() << "onStartReplay startInSecs=" << startInSecs; + DEBUG_LOG(m_logger) << "onStartReplay startInSecs=" << startInSecs; m_ui->slPeriodSlider->setValue(startInSecs); startReplay(m_ui->dteStartTime->msecsSinceEpoch(), 0 , speed); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.h index 411bb24ca..d9497e7a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplay/Gui/ReplayControl/replay_control_widget.h @@ -97,6 +97,8 @@ private slots: void onDteStartChanged(); private: + +NGL::INGLLogger &m_logger; void disableAllReplayButtons(); qint64 getMSecs(qint64 sec); qint64 getSecs(qint64 msec); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.cpp index e95409d2a..b9b2c9e3c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.cpp @@ -82,7 +82,7 @@ public: - DEBUG_LOG() << Q_FUNC_INFO << " START" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << ", domainId = " << domainId << ", domainIdReplay = " << domainIdReplay << ", tcpConnectionUrl = " << tcpConnectionUrl.toDisplayString() @@ -107,7 +107,7 @@ public: } - DEBUG_LOG() << Q_FUNC_INFO << " idToUse = " << idToUse; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " idToUse = " << idToUse; @@ -120,7 +120,7 @@ public: connect(repl.proc, &QProcess::errorOccurred, this, [this, idToUse](const QProcess::ProcessError &error) { - ERROR_LOG() << "QProcess::ProcessError occured: " + ERROR_LOG(m_logger) << "QProcess::ProcessError occured: " << ", idToUse = " << idToUse; qCritical() << "QProcess::ProcessError: " << error; } ); @@ -130,11 +130,11 @@ public: connect(proc, &QProcess::readyReadStandardError, this, [this, idToUse, proc]() { - DEBUG_LOG() << "REPLAY #" << idToUse << " [!]: " << QString::fromUtf8(proc->readAllStandardError()); + DEBUG_LOG(m_logger) << "REPLAY #" << idToUse << " [!]: " << QString::fromUtf8(proc->readAllStandardError()); }); connect(proc, &QProcess::readyReadStandardOutput, this, [this, idToUse, proc]() { - DEBUG_LOG() << "REPLAY #" << idToUse << " [ ]: " << QString::fromUtf8(proc->readAllStandardOutput()); + DEBUG_LOG(m_logger) << "REPLAY #" << idToUse << " [ ]: " << QString::fromUtf8(proc->readAllStandardOutput()); }); repl.fi = nullptr; @@ -158,9 +158,9 @@ public: m_replayPartitions.insert(idToUse, repl); - DEBUG_LOG() << Q_FUNC_INFO << " repl.proc->start()..."; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " repl.proc->start()..."; repl.proc->start(); - DEBUG_LOG() << Q_FUNC_INFO << " repl.proc->start()...DONE"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " repl.proc->start()...DONE"; if (wait) { @@ -187,7 +187,7 @@ public: NOTICE_LOG(m_logger) << " LtsUtils::awaitWithCancelationSignal ... DONE"; processStarted(proc, idToUse); - DEBUG_LOG() << "Replay started: " << idToUse; + DEBUG_LOG(m_logger) << "Replay started: " << idToUse; return idToUse; } catch (const std::exception &ex) @@ -207,7 +207,7 @@ public: if (bIsStartedSuccessfully) { processStarted(proc, idToUse); - DEBUG_LOG() << "Replay started: " << idToUse; + DEBUG_LOG(m_logger) << "Replay started: " << idToUse; return idToUse; } else @@ -250,7 +250,7 @@ public: if (proc->exitCode() != 0 || proc->exitStatus() != QProcess::NormalExit) { - WARNING_LOG() << "SituationReplay process exited with error: " << proc->exitCode() + WARNING_LOG(m_logger) << "SituationReplay process exited with error: " << proc->exitCode() << ", status: " << proc->exitStatus() << ", stdout: " << proc->readAllStandardOutput() << ", stderr: " << proc->readAllStandardError(); @@ -270,7 +270,7 @@ public: auto it = m_replayPartitions.find(replayId); if (it == m_replayPartitions.end()) { - WARNING_LOG() << "Got a processStarted signal from a process for replay " << replayId + WARNING_LOG(m_logger) << "Got a processStarted signal from a process for replay " << replayId << " but found not corresponding entry in m_replayPartitions"; return; } @@ -323,7 +323,7 @@ public: proc->kill(); const auto err(proc->readAllStandardError()); if (!err.isEmpty()) - WARNING_LOG() << "stderr: " << err; + WARNING_LOG(m_logger) << "stderr: " << err; delete proc; }; @@ -332,12 +332,12 @@ public: { try { - DEBUG_LOG() << "Waiting for replay to process to shutdown... Replay id: " << rp.id(); + DEBUG_LOG(m_logger) << "Waiting for replay to process to shutdown... Replay id: " << rp.id(); LtsUtils::awaitTimeout(10000, rp.proc, QOverload::of(&QProcess::finished), true); } catch (...) { - WARNING_LOG() << "Timeout waiting for the replay process to quit gracefully - killing the process! Replay id: " << rp.id(); + WARNING_LOG(m_logger) << "Timeout waiting for the replay process to quit gracefully - killing the process! Replay id: " << rp.id(); cb(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.h index ebc93b039..07d1f9790 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Data/srm_data_plugin.h @@ -48,6 +48,8 @@ public: std::shared_ptr getForeignDataInterface() override { return m_foreignInterface; } private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; std::shared_ptr m_foreignInterface; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog.h index e691975fe..b7d2fd3d6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog.h @@ -47,6 +47,9 @@ private slots: private: + + +NGL::INGLLogger &m_logger; void retranslate() override; void tableColumnOrganiserSetting() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog_model.h index 619b0f0d2..35949936b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/SituationReplayManagement/Gui/ReplayManagement/replay_dialog_model.h @@ -38,6 +38,8 @@ public: bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override final; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const Core::ReplayPartition &data, DataModification modType) const override { if (data.exerciseId() != m_partitionid) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/Common/tpm_exported_scripts_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/Common/tpm_exported_scripts_model.cpp index 023ed4f87..1858d5c7a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/Common/tpm_exported_scripts_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/Common/tpm_exported_scripts_model.cpp @@ -31,7 +31,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) m_vecData.clear(); QVector localExercises; - DEBUG_LOG() << "ExportedScriptsModel::init rootDirectoryToScan=" << rootDirectoryToScan + DEBUG_LOG(m_logger) << "ExportedScriptsModel::init rootDirectoryToScan=" << rootDirectoryToScan ; @@ -39,10 +39,10 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) { - DEBUG_LOG() << "Get all local exercises rootDirectoryToScan=" << rootDirectoryToScan ; + DEBUG_LOG(m_logger) << "Get all local exercises rootDirectoryToScan=" << rootDirectoryToScan ; QFile file(rootDirectoryToScan + QDir::separator() + QStringLiteral("exercises.json")); if (!file.open(QFile::ReadOnly)) - WARNING_LOG() << "Cannot open " << file.fileName() << " for read/write: " << file.errorString(); + WARNING_LOG(m_logger) << "Cannot open " << file.fileName() << " for read/write: " << file.errorString(); const QJsonDocument doc(QJsonDocument::fromJson(file.readAll())); const QJsonObject obj = doc.object(); @@ -52,7 +52,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) localExercises.append(ele.toInt()); } - WARNING_LOG() << "local exericses: " << localExercises.count(); + WARNING_LOG(m_logger) << "local exericses: " << localExercises.count(); for (const int exId : std::as_const(localExercises)) @@ -62,7 +62,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) if (!file.open(QIODevice::ReadOnly)) { - WARNING_LOG() << "Cannot open " << file.fileName() << " for reading: " << file.errorString() << " - not critical"; + WARNING_LOG(m_logger) << "Cannot open " << file.fileName() << " for reading: " << file.errorString() << " - not critical"; return true; } @@ -71,14 +71,14 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) const QJsonObject obj = doc.object(); const QJsonArray presentations = obj[QStringLiteral("presentations")].toArray(); - DEBUG_LOG() << "exercise: " << exId << ", presentations: " << presentations.size(); + DEBUG_LOG(m_logger) << "exercise: " << exId << ", presentations: " << presentations.size(); for (const QJsonValue &val : presentations) { ExportedScriptInformation esi = ExportedScriptInformation::fromJson(val); - DEBUG_LOG() << "obj=" << QJsonDocument(obj).toJson(QJsonDocument::Compact); + DEBUG_LOG(m_logger) << "obj=" << QJsonDocument(obj).toJson(QJsonDocument::Compact); const QJsonObject presentationObj = val.toObject(); - DEBUG_LOG() << "presentationObj=" << QJsonDocument(presentationObj).toJson(QJsonDocument::Compact); + DEBUG_LOG(m_logger) << "presentationObj=" << QJsonDocument(presentationObj).toJson(QJsonDocument::Compact); if (obj.contains(QStringLiteral("exerciseId"))) { esi.exerciseId = obj[QStringLiteral("exerciseId")].toInt(); @@ -90,7 +90,7 @@ bool ExportedScriptsModel::init(const QString &rootDirectoryToScan) } esi.local = true; - DEBUG_LOG() << "push_back " + DEBUG_LOG(m_logger) << "push_back " << " exportTime=" << esi.exportTime << " scriptId=" << esi.scriptId << " scriptName=" << esi.scriptName @@ -120,14 +120,14 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) QMap> exerciseContentScriptIds; QMap> exerciseScriptIds; - DEBUG_LOG() << "ExportedScriptsModel::setServerContent jsonArray =" << jsonArray; + DEBUG_LOG(m_logger) << "ExportedScriptsModel::setServerContent jsonArray =" << jsonArray; QJsonParseError err; const QJsonArray presentations = QJsonDocument::fromJson(jsonArray.toUtf8(), &err).array(); - DEBUG_LOG() << "presentations.size() =" << presentations.size(); + DEBUG_LOG(m_logger) << "presentations.size() =" << presentations.size(); if (err.error != QJsonParseError::NoError) { - ERROR_LOG() << "json array invalid at offset " << err.offset << ": " << err.errorString(); + ERROR_LOG(m_logger) << "json array invalid at offset " << err.offset << ": " << err.errorString(); return; } @@ -135,7 +135,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) for (const auto &data : std::as_const(m_vecData)) { exerciseScriptIds[data.exerciseId].append(data.scriptId); - DEBUG_LOG() << "exerciseId=" << data.exerciseId + DEBUG_LOG(m_logger) << "exerciseId=" << data.exerciseId << " modelScriptIds.append: " << data.scriptId; } @@ -152,7 +152,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) { const auto &rowData = m_vecData[i]; const QVector contentScriptIds = exerciseContentScriptIds.value(rowData.exerciseId); - DEBUG_LOG() << "m_vecData.at(" << i << ").scriptId=" << rowData.scriptId + DEBUG_LOG(m_logger) << "m_vecData.at(" << i << ").scriptId=" << rowData.scriptId << " exerciseId=" << rowData.exerciseId << " contentScriptIds.contains=" << contentScriptIds.contains(rowData.scriptId) << " rowData.local=" << rowData.local @@ -165,7 +165,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) { - DEBUG_LOG() << "removeRow(" << i << ")" + DEBUG_LOG(m_logger) << "removeRow(" << i << ")" << " ScriptId=" << rowData.scriptId << " ExerciseId=" << rowData.exerciseId; removeRow(i); @@ -185,7 +185,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) { ExportedScriptInformation esi = ExportedScriptInformation::fromJson(val, false, ThpAlreadyUploaded); QVector modelScriptIds = exerciseScriptIds.value(esi.exerciseId); - DEBUG_LOG() << " exportTime=" << esi.exportTime + DEBUG_LOG(m_logger) << " exportTime=" << esi.exportTime << " scriptId=" << esi.scriptId << " exerciseId=" << esi.exerciseId << " exerciseName=" << esi.exerciseName @@ -196,7 +196,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) if (!modelScriptIds.contains(esi.scriptId)) { - DEBUG_LOG() << "insertRow()"; + DEBUG_LOG(m_logger) << "insertRow()"; insertRow(esi); continue; } @@ -208,7 +208,7 @@ void ExportedScriptsModel::setServerContent(const QString &jsonArray) if (rowData.scriptId == esi.scriptId && rowData.exerciseId == esi.exerciseId) { - DEBUG_LOG() << "setUploadState i=" << i + DEBUG_LOG(m_logger) << "setUploadState i=" << i << " esi.scriptId=" << esi.scriptId << " esi.exerciseId=" << esi.exerciseId << " esi.fileSize=" << esi.fileSize @@ -230,7 +230,7 @@ qint64 ExportedScriptsModel::downloadTime(const ExportedScriptInformation &val) return 0; QString filename(QStringLiteral("%1/THP-Download/Exercise_%2/%3/index.html").arg(QDir::tempPath()).arg(val.exerciseId).arg(val.scriptId)); - DEBUG_LOG() << "downloadTime: filename " << filename; + DEBUG_LOG(m_logger) << "downloadTime: filename " << filename; QFileInfo fi(filename); if (!fi.exists()) @@ -334,16 +334,16 @@ bool ExportedScriptsModel::createDataJson(const QString &rootDirectory, if (!QDir().mkpath(baseDir)) { - ERROR_LOG() << "Failed to create path " << baseDir; + ERROR_LOG(m_logger) << "Failed to create path " << baseDir; return false; } QFile file(baseDir + QStringLiteral("data.json")); - DEBUG_LOG() << "createDataJson=" << file.fileName(); + DEBUG_LOG(m_logger) << "createDataJson=" << file.fileName(); if (!file.open(QFile::ReadWrite)) { QString msg(tr("Could not open data file in script directory: %1").arg(file.errorString())); - ERROR_LOG() << msg << " - " << file.fileName(); + ERROR_LOG(m_logger) << msg << " - " << file.fileName(); return false; } @@ -351,7 +351,7 @@ bool ExportedScriptsModel::createDataJson(const QString &rootDirectory, QJsonObject obj = doc.object(); if (obj[QStringLiteral("exerciseId")].toInt() == exerciseId) { - DEBUG_LOG() << baseDir << " exists for exerciseId " << QString::number(exerciseId); + DEBUG_LOG(m_logger) << baseDir << " exists for exerciseId " << QString::number(exerciseId); return true; } @@ -381,18 +381,18 @@ void ExportedScriptsModel::addDownloadData(const ExportedScriptInformation &esi) { - DEBUG_LOG() << "Add exercise to ExportRootPath"; + DEBUG_LOG(m_logger) << "Add exercise to ExportRootPath"; if (!QDir(esi.rootDirectory).exists()) { - ERROR_LOG() << "Cannot modify exercises.json as the info's root directory '"<setCancelEnabled(false); }); @@ -71,12 +70,12 @@ HttpProcess::HttpProcess(ExportedScriptInformation &&esi, QObject *parent) bool k = false; int _timeout = timeoutVar.toInt(&k); - DEBUG_LOG() << "TPM.Timeout debug value set! k = " << k << "_timeout = " << _timeout; + DEBUG_LOG(m_logger) << "TPM.Timeout debug value set! k = " << k << "_timeout = " << _timeout; if (k) { timeout = _timeout; - DEBUG_LOG() << "new timeout set to " << timeout; + DEBUG_LOG(m_logger) << "new timeout set to " << timeout; } } @@ -89,7 +88,7 @@ HttpProcess::HttpProcess(ExportedScriptInformation &&esi, QObject *parent) { stopTimeout(); new LtsWidgets::LtsMessageDialogNew(qobject_cast(this->parent()), tr("Timeout occured during the operation - aborted")); - WARNING_LOG() << "Timeout occured during the operation - aborted"; + WARNING_LOG(m_logger) << "Timeout occured during the operation - aborted"; m_isTimeout = true; emit signalTimeout(); @@ -99,7 +98,7 @@ HttpProcess::HttpProcess(ExportedScriptInformation &&esi, QObject *parent) HttpProcess::~HttpProcess() { - DEBUG_LOG() << "~HttpProcess"; + DEBUG_LOG(m_logger) << "~HttpProcess"; delete m_process; } @@ -175,7 +174,7 @@ QNetworkReply *HttpProcess::deleteResource(const QString &path, const QUrlQuery void HttpProcess::slotSuccess() { - DEBUG_LOG() << "success"; + DEBUG_LOG(m_logger) << "success"; stopTimeout(); if (!m_isError && !m_wasCanceled && !m_isTimeout) @@ -185,7 +184,7 @@ void HttpProcess::slotSuccess() void HttpProcess::slotError() { - DEBUG_LOG() << "error"; + DEBUG_LOG(m_logger) << "error"; stopTimeout(); @@ -207,7 +206,7 @@ void HttpProcess::slotError() void HttpProcess::slotReadyRead() { - DEBUG_LOG() << "readyRead"; + DEBUG_LOG(m_logger) << "readyRead"; resetTimeout(); QNetworkReply *r = qobject_cast(sender()); @@ -354,23 +353,23 @@ UploadProcess::UploadProcess(const QString &rootFolder, ExportedScriptInformatio - DEBUG_LOG() << "TPM.TestBigFile? " << LtsSessionData::LtsSessionData::getInstance()->debugFlagValue(QStringLiteral("TPM.TestBigFile")).toString(); - DEBUG_LOG() << "TPM.TestBigFile check? " + DEBUG_LOG(m_logger) << "TPM.TestBigFile? " << LtsSessionData::LtsSessionData::getInstance()->debugFlagValue(QStringLiteral("TPM.TestBigFile")).toString(); + DEBUG_LOG(m_logger) << "TPM.TestBigFile check? " << (LtsSessionData::LtsSessionData::getInstance()->debugFlagValue(QStringLiteral("TPM.TestBigFile")) == QVariant(true)); #ifndef LTS_DEBUG if (LtsSessionData::LtsSessionData::getInstance()->debugFlagValue(QStringLiteral("TPM.TestBigFile")) == QVariant(true)) #endif { - DEBUG_LOG() << "TPM.TestBigFile!!"; + DEBUG_LOG(m_logger) << "TPM.TestBigFile!!"; if (QGuiApplication::queryKeyboardModifiers() == Qt::ControlModifier) { QFile test(QStringLiteral("%1/%2/big.file").arg(ExportedScriptsDialog::getContentFolder(m_rootDir, m_esi.exerciseId), dstDir)); - DEBUG_LOG() << ">>> BIG FILE ACTIVE ("<>> BIG FILE ACTIVE ("<debugFlagValue(bigFileSize).toInt(&k); if (!k) - DEBUG_LOG() << "Invalid value for " << bigFileSize; + DEBUG_LOG(m_logger) << "Invalid value for " << bigFileSize; else { times = _times; - DEBUG_LOG() << "big file size was set to " << times; + DEBUG_LOG(m_logger) << "big file size was set to " << times; } } else - DEBUG_LOG() << "TPM.TestBigFile.Size not set - using default of " << times; + DEBUG_LOG(m_logger) << "TPM.TestBigFile.Size not set - using default of " << times; for (int i = 0; i < times; i++) @@ -411,7 +410,7 @@ UploadProcess::UploadProcess(const QString &rootFolder, ExportedScriptInformatio test.flush(); m_tempFile->setAutoRemove(false); - DEBUG_LOG() << "big compressed file: " << m_tempFile->fileName(); + DEBUG_LOG(m_logger) << "big compressed file: " << m_tempFile->fileName(); } } @@ -419,9 +418,9 @@ UploadProcess::UploadProcess(const QString &rootFolder, ExportedScriptInformatio connect(m_compress, &NGL::Compress::finished, this, &UploadProcess::compressionDone); - DEBUG_LOG() << "compress called..."; + DEBUG_LOG(m_logger) << "compress called..."; m_compress->compress(m_tempFile, srcDir, dstDir); - DEBUG_LOG() << "...!"; + DEBUG_LOG(m_logger) << "...!"; } @@ -436,17 +435,17 @@ void UploadProcess::abortCompress() void UploadProcess::compressionDone() { - DEBUG_LOG() << "m_wasCanceled = " << m_wasCanceled << ", compress success = " << m_compress->success(); + DEBUG_LOG(m_logger) << "m_wasCanceled = " << m_wasCanceled << ", compress success = " << m_compress->success(); stopTimeout(); if (!m_compress->success() || m_wasCanceled) { - DEBUG_LOG() << "compression aborted"; + DEBUG_LOG(m_logger) << "compression aborted"; deleteLater(); return; } - DEBUG_LOG() << "okay"; + DEBUG_LOG(m_logger) << "okay"; QUrlQuery q; q.addQueryItem(QStringLiteral("exerciseId"), QString::number(m_esi.exerciseId)); @@ -455,7 +454,7 @@ void UploadProcess::compressionDone() q.addQueryItem(QStringLiteral("name"), m_esi.scriptName); - DEBUG_LOG() << "posting file of size " << m_tempFile->size(); + DEBUG_LOG(m_logger) << "posting file of size " << m_tempFile->size(); m_tempFile->seek(0); QNetworkReply *rep = post(QStringLiteral("/thp"), m_tempFile, q); @@ -463,7 +462,7 @@ void UploadProcess::compressionDone() connect(this, &HttpProcess::signalSuccess, this, [this]() { - DEBUG_LOG() << "Uploaded script successfully"; + DEBUG_LOG(m_logger) << "Uploaded script successfully"; new LtsWidgets::LtsMessageDialogNew(qobject_cast(parent()), tr("Uploaded script successfully")); deleteLater(); }); @@ -612,7 +611,7 @@ void DownloadProcess::downloadFinished() { stopTimeout(); - DEBUG_LOG() << "m_compress->success()? " << m_compress->success() << ", m_wasCanceled? " << m_wasCanceled << ", m_isError? " << m_isError; + DEBUG_LOG(m_logger) << "m_compress->success()? " << m_compress->success() << ", m_wasCanceled? " << m_wasCanceled << ", m_isError? " << m_isError; if (m_compress->success() && !m_wasCanceled && !m_isError) { new LtsWidgets::LtsMessageDialogNew(qobject_cast(parent()), tr("Downloaded script successfully")); @@ -858,7 +857,7 @@ bool ExportedScriptsDialog::init(LtsSession::LtsSession *session) if (!QDir().mkpath(getContentFolder(m_exerciseId))) { QString msg(tr("Cannot create script folder at %1").arg(getContentFolder(m_exerciseId))); - ERROR_LOG() << msg; + ERROR_LOG(m_logger) << msg; return false; } @@ -875,7 +874,7 @@ bool ExportedScriptsDialog::init(LtsSession::LtsSession *session) #else NGL::Settings *s = new NGL::Settings(NGL::findProjectConfigFile()); const QString hostname = s->getString(QStringLiteral("TabOC"), QStringLiteral("remoteServerHostname"), QStringLiteral("exctds01")); - WARNING_LOG() << "Hostname used for THP: " << hostname; + WARNING_LOG(m_logger) << "Hostname used for THP: " << hostname; sock->open(QUrl(QStringLiteral("ws://%1:%2/thp").arg(hostname).arg(NGL::Connections::port(NGL::Connections::eConnection::FLM_THP_SERVER)))); delete s; #endif @@ -904,7 +903,7 @@ bool ExportedScriptsDialog::init(LtsSession::LtsSession *session) connect(sock, &QWebSocket::disconnected, this, [this, sock, openFn]() { - WARNING_LOG() << "disconnected from ws... reconnecting in 3..."; + WARNING_LOG(m_logger) << "disconnected from ws... reconnecting in 3..."; setWsConnectionStatus(WsConnectionStatus::Disconnected); QTimer *t = new QTimer(sock); @@ -925,7 +924,7 @@ bool ExportedScriptsDialog::init(LtsSession::LtsSession *session) connect(sock, &QWebSocket::textMessageReceived, this, [this](const QString &msg) { - DEBUG_LOG() << "new msg: '" << msg << "'"; + DEBUG_LOG(m_logger) << "new msg: '" << msg << "'"; m_lastServerContent = msg; m_model->setServerContent(msg); onSelectionChanged(); @@ -938,7 +937,7 @@ bool ExportedScriptsDialog::init(LtsSession::LtsSession *session) bool ExportedScriptsDialog::initModel() { - DEBUG_LOG() << "(re)initModel !!"; + DEBUG_LOG(m_logger) << "(re)initModel !!"; QString rootDirectory(getRootFolder()); @@ -1017,7 +1016,7 @@ void ExportedScriptsDialog::downloadScript() if (!mi.isValid()) { - ERROR_LOG() << "could not update model data after download! cover up.."; + ERROR_LOG(m_logger) << "could not update model data after download! cover up.."; return; } @@ -1053,7 +1052,7 @@ void ExportedScriptsDialog::removeScriptFromServer() if (!mi.isValid()) { - ERROR_LOG() << "could not update model data after deletion! cover up.."; + ERROR_LOG(m_logger) << "could not update model data after deletion! cover up.."; return; } @@ -1090,7 +1089,7 @@ void ExportedScriptsDialog::removeScriptLocal() m_buttonBox->getButton(LtsWidgets::DialogButton::Show)->setEnabled(false); QString currentDirectory = QStringLiteral("%1/%2").arg(getContentFolder(esi.exerciseId), QString::number(esi.scriptId)); - DEBUG_LOG() << "currentDirectory=" << currentDirectory; + DEBUG_LOG(m_logger) << "currentDirectory=" << currentDirectory; QDir d(currentDirectory); if (!d.removeRecursively()) @@ -1118,7 +1117,7 @@ void ExportedScriptsDialog::removeScriptLocal() if (err.error != QJsonParseError::NoError) { new LtsWidgets::LtsMessageDialogNew(this, tr("Cannot read index file"), removingScriptFailedText); - ERROR_LOG() << "Cannot read index file at offset" << err.offset << ": " << err.errorString(); + ERROR_LOG(m_logger) << "Cannot read index file at offset" << err.offset << ": " << err.errorString(); return; } @@ -1145,7 +1144,7 @@ void ExportedScriptsDialog::removeScriptLocal() if (scriptId == -1) { - WARNING_LOG() << "cannot find scriptId in presentations array object from data.json"; + WARNING_LOG(m_logger) << "cannot find scriptId in presentations array object from data.json"; continue; } @@ -1192,7 +1191,7 @@ void ExportedScriptsDialog::openScript() args.append(QStringLiteral("-t")); args.append(pathToScript); - DEBUG_LOG() << "pathToScript: " << pathToScript; + DEBUG_LOG(m_logger) << "pathToScript: " << pathToScript; #ifndef WIN32 QProcess().startDetached(QLatin1String("./thp_viewer"), args, QCoreApplication::applicationDirPath()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpManagement/tpm_exported_scripts_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpManagement/tpm_exported_scripts_dialog.h index 1107f114a..bb752a50f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpManagement/tpm_exported_scripts_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpManagement/tpm_exported_scripts_dialog.h @@ -67,6 +67,9 @@ protected slots: private: + + +NGL::INGLLogger &m_logger; void doConnections(QNetworkReply *r); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.cpp index 2b32e4f59..348f5ee6e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.cpp @@ -68,7 +68,7 @@ #endif #ifndef ELOG -#define ELOG ERROR_LOG() +#define ELOG ERROR_LOG(m_logger) #endif @@ -431,7 +431,7 @@ void USBDialog::initUsbModel() if (!m_usbThpModel->init(m_usbRoot)) { new LtsWidgets::LtsMessageDialogNew(this, tr("The directory '%1' doesn't contain valid THP data.").arg(m_usbRoot)); - ERROR_LOG() << "cannot initialize usb thp model from usb root" << m_usbRoot; + ERROR_LOG(m_logger) << "cannot initialize usb thp model from usb root" << m_usbRoot; return; } @@ -519,7 +519,7 @@ void USBDialog::slotChangePath() if (!m_usbThpModel->createDataJson(m_usbRoot, exmDtc, asmDtc, m_exerciseId)) { - ERROR_LOG() << "Failed to initialize data.json"; + ERROR_LOG(m_logger) << "Failed to initialize data.json"; return; } @@ -550,7 +550,7 @@ void USBDialog::slotCopyMaps() if (!dstDir.exists()) { - ERROR_LOG() << "dst dir " << m_usbRoot << " is not accessible"; + ERROR_LOG(m_logger) << "dst dir " << m_usbRoot << " is not accessible"; return; } @@ -559,7 +559,7 @@ void USBDialog::slotCopyMaps() return; - DEBUG_LOG() << "mil.size()" << mil.size(); + DEBUG_LOG(m_logger) << "mil.size()" << mil.size(); @@ -602,13 +602,13 @@ void USBDialog::onNextMap() auto path = m_files.firstKey(); { QString src(path); - DEBUG_LOG() << "src" << src; + DEBUG_LOG(m_logger) << "src" << src; QDir srcDir(src); if (!srcDir.exists()) { - ERROR_LOG() << "src dir " << src << " is not accessible"; + ERROR_LOG(m_logger) << "src dir " << src << " is not accessible"; return; } QDir dstDir(getContentFolder(m_usbRoot) + QDir::separator() + QStringLiteral("Maps")); @@ -710,12 +710,12 @@ void USBDialog::generateLayerMappingXML() if (!layersMapping.open(QIODevice::WriteOnly)) { - WARNING_LOG() << "Couldn't open save file."; + WARNING_LOG(m_logger) << "Couldn't open save file."; return; } if (!layersMappingAtMaps.open(QIODevice::WriteOnly)) { - WARNING_LOG() << "Couldn't open save file in folder Maps."; + WARNING_LOG(m_logger) << "Couldn't open save file in folder Maps."; return; } QJsonDocument doc(layers); @@ -763,13 +763,13 @@ void USBDialog::slotCopyWinBin() if (!srcDir.exists()) { - ERROR_LOG() << "src dir " << src << " is not accessible"; + ERROR_LOG(m_logger) << "src dir " << src << " is not accessible"; return; } QFileInfoList fil; fil = prepareFileInfoListForFolder(src, fil); - DEBUG_LOG() << "XXXXXXXXXXX filsize is: " << fil.size(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXX filsize is: " << fil.size(); auto cp = new CopyProcess(srcDir, dstDir, fil, false, this); setOverlay(cp->process()); @@ -804,19 +804,19 @@ void USBDialog::slotCopyWinBinP2() if (initFilePath.isEmpty()) { - ERROR_LOG() << "sitmap init is not accessible"; + ERROR_LOG(m_logger) << "sitmap init is not accessible"; return; } QFileInfo fileInfo(initFilePath); QFileInfoList fil2; fil2.append(fileInfo); - DEBUG_LOG() << "XXXXXXXXXXX sitmap is: " << fileInfo.absoluteFilePath(); - ERROR_LOG() << "XXXXXXXXXXX filsize is: " << fil2.size(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXX sitmap is: " << fileInfo.absoluteFilePath(); + ERROR_LOG(m_logger) << "XXXXXXXXXXX filsize is: " << fil2.size(); const QDir dstDir2(dstDir.absolutePath() + QDir::separator() + QStringLiteral("thp") + QDir::separator() + QStringLiteral("share") + QDir::separator() + QStringLiteral("LTS") + QDir::separator() + QStringLiteral("situation_Map")) ; - DEBUG_LOG() << "XXXXXXXXXXX sitmap dst is: " << dstDir2.absolutePath(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXX sitmap dst is: " << dstDir2.absolutePath(); auto cp2 = new CopyProcess(fileInfo.absoluteDir(), dstDir2, fil2, false, this); setOverlay(cp2->process()); @@ -849,15 +849,15 @@ void USBDialog::slotCopyWinBinP3() const QString autorunFile = NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("autorun.inf")); if (autorunFile.isEmpty()) { - ERROR_LOG() << "autorunFile init is not accessible"; + ERROR_LOG(m_logger) << "autorunFile init is not accessible"; return; } QFileInfo fileInfo2(autorunFile); QFileInfoList fil; fil = prepareFileInfoListForFolder(fileInfo2.absoluteDir().path(), fil); - DEBUG_LOG() << "XXXXXXXXXXX autofinFile is: " << fileInfo2.absoluteDir().path(); - DEBUG_LOG() << "XXXXXXXXXXX filsize is: " << fil.size(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXX autofinFile is: " << fileInfo2.absoluteDir().path(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXX filsize is: " << fil.size(); auto cp3 = new CopyProcess(fileInfo2.absoluteDir(), dstDir, fil, false, this); setOverlay(cp3->process()); @@ -1206,7 +1206,7 @@ void USBDialog::scriptDeleted(int scriptId) const QFileInfoList fil(dir.entryInfoList()); if (fil.isEmpty()) { - DEBUG_LOG() << "no scripts left"; + DEBUG_LOG(m_logger) << "no scripts left"; @@ -1220,7 +1220,7 @@ void USBDialog::scriptDeleted(int scriptId) } catch (const QString &str) { - ERROR_LOG() << "ExerciseJsonHandler failed: " << str; + ERROR_LOG(m_logger) << "ExerciseJsonHandler failed: " << str; return; } @@ -1234,7 +1234,7 @@ void USBDialog::scriptDeleted(int scriptId) } catch (const QString &str) { - ERROR_LOG() << "DataJsonHandler failed: " << str; + ERROR_LOG(m_logger) << "DataJsonHandler failed: " << str; } } @@ -1276,7 +1276,7 @@ void USBDialog::scriptCopied(int ) } catch (const QString &str) { - ERROR_LOG() << "DataJsonHandler failed: " << str; + ERROR_LOG(m_logger) << "DataJsonHandler failed: " << str; return; } @@ -1319,7 +1319,7 @@ void USBDialog::slotCopy() if (!dstDir.exists()) { - ERROR_LOG() << "dst dir " << m_usbRoot << " is not accessible"; + ERROR_LOG(m_logger) << "dst dir " << m_usbRoot << " is not accessible"; return; } @@ -1327,7 +1327,7 @@ void USBDialog::slotCopy() if (!dstDir.mkpath(dstDir.absolutePath())) { - ERROR_LOG() << "Could not create destination path " << dstDir.absolutePath(); + ERROR_LOG(m_logger) << "Could not create destination path " << dstDir.absolutePath(); return; } @@ -1343,14 +1343,14 @@ void USBDialog::slotCopy() return; QString src(getScriptFolder(esi.rootDirectory, esi.exerciseId, esi.scriptId)); - DEBUG_LOG() << "src" << src; + DEBUG_LOG(m_logger) << "src" << src; QDir srcDir(src); QDir bldgDir( QStringLiteral("%1/BuildingModels").arg(getContentFolder(esi.rootDirectory, esi.exerciseId))); if (!srcDir.exists()) { - ERROR_LOG() << "src dir " << src << " is not accessible"; + ERROR_LOG(m_logger) << "src dir " << src << " is not accessible"; return; } @@ -1395,7 +1395,7 @@ void USBDialog::slotRemove() return; - DEBUG_LOG() << "mil.size()" << mil.size(); + DEBUG_LOG(m_logger) << "mil.size()" << mil.size(); for (const QModelIndex &idx : mil) @@ -1421,7 +1421,7 @@ void USBDialog::slotRemoveMaps() if (!dir.exists()) { - ERROR_LOG() << "dir " << m_usbRoot << " is not accessible"; + ERROR_LOG(m_logger) << "dir " << m_usbRoot << " is not accessible"; return; } @@ -1430,12 +1430,12 @@ void USBDialog::slotRemoveMaps() return; - DEBUG_LOG() << "mil.size()" << mil.size(); + DEBUG_LOG(m_logger) << "mil.size()" << mil.size(); for (const QModelIndex &idx : mil) { - DEBUG_LOG() << "rm" << idx.data().toString(); + DEBUG_LOG(m_logger) << "rm" << idx.data().toString(); QFile::remove(dir.absolutePath() + QDir::separator() + idx.data().toString()); } @@ -1515,7 +1515,7 @@ void USBDialog::retranslate() void USBDialog::initModel() { - DEBUG_LOG() << "(re)initModel !!"; + DEBUG_LOG(m_logger) << "(re)initModel !!"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.h index 95a7b3f35..e23dc1287 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/OldTHP/ThpUsbManagement/tpm_usb_dialog.h @@ -91,6 +91,10 @@ private slots: private: + + + +NGL::INGLLogger &m_logger; enum class What { ScriptWasDeletedFromExercise, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.cpp index 9ffc8cbea..ef135b794 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.cpp @@ -208,11 +208,11 @@ void ExportedScriptsModel::setServerContent(const QString &jsonObject) } catch(const std::runtime_error &err) { - ERROR_LOG() << "something went wrong: " << err.what(); + ERROR_LOG(m_logger) << "something went wrong: " << err.what(); } catch(...) { - ERROR_LOG() << "something went wrong"; + ERROR_LOG(m_logger) << "something went wrong"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.h index fb0b0df51..66a3cd649 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_exported_scripts_model.h @@ -43,6 +43,8 @@ public: void writeScriptsJson() noexcept(false); protected: + +NGL::INGLLogger &m_logger; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_topics_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_topics_model.h index 5c62869c4..6981921df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_topics_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Common2/tpm_topics_model.h @@ -32,5 +32,7 @@ public: QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.cpp index a03142a9c..2e8fb6a80 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.cpp @@ -41,7 +41,7 @@ #ifndef ELOG -#define ELOG ERROR_LOG() +#define ELOG ERROR_LOG(m_logger) #endif using err = std::runtime_error; @@ -51,9 +51,8 @@ err error(const QString &msg) { return err(msg.toStdString()); } namespace TakeHomePackageManager { -Compressor::Compressor() - : QObject(nullptr) -{} +Compressor::Compressor() : QObject(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void Compressor::go(ProcessOverlay *processOverlay, QIODevice &out, const QString &sourceDir, const QString &destRootDir) noexcept(false) @@ -131,7 +130,7 @@ HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMes connect(m_process, &ProcessOverlay::signalCancel, this, [this]() { - DEBUG_LOG() << "m_wasCanceled!!"; + DEBUG_LOG(m_logger) << "m_wasCanceled!!"; m_process->setCancelEnabled(false); emit signalCancel(); }); @@ -143,7 +142,7 @@ HttpProcess::HttpProcess(LtsWidgets::LtsDialog *dialog, const QString &statusMes HttpProcess::~HttpProcess() { - DEBUG_LOG() << "~HttpProcess"; + DEBUG_LOG(m_logger) << "~HttpProcess"; m_process->deleteLater(); m_nam->deleteLater(); } @@ -361,7 +360,7 @@ void UploadProcess::go(const QString &rootFolder, const ExportedScriptInformatio connect(this, &HttpProcess::signalCancel, &compressor, &Compressor::abort); compressor.go(m_process, *tempFile.get(), srcDir, dstDir); - DEBUG_LOG() << "posting file of size " << tempFile->size(); + DEBUG_LOG(m_logger) << "posting file of size " << tempFile->size(); tempFile->seek(0); QNetworkReply *rep = post(L("/thp2"), tempFile.get(), {}, L("application/octet-stream"), { { L("x-thp-info"), QString::fromUtf8(QJsonDocument(esi.toJson().toObject()).toJson(QJsonDocument::JsonFormat::Compact)) } }); @@ -586,7 +585,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW connect(sock, &QWebSocket::disconnected, this, [this, sock, openFn]() { - WARNING_LOG() << "disconnected from ws... reconnecting in 3..."; + WARNING_LOG(m_logger) << "disconnected from ws... reconnecting in 3..."; setWsConnectionStatus(WsConnectionStatus::Disconnected); QTimer *t = new QTimer(sock); @@ -607,7 +606,7 @@ ExportedScriptsDialog::ExportedScriptsDialog(LtsSession::LtsSession *session, QW connect(sock, &QWebSocket::textMessageReceived, this, [this](const QString &msg) { - DEBUG_LOG() << "new msg: '" << msg << "'"; + DEBUG_LOG(m_logger) << "new msg: '" << msg << "'"; m_lastServerContent = msg; m_model->setServerContent(msg); onSelectionChanged(); @@ -757,7 +756,7 @@ void ExportedScriptsDialog::setWsConnectionStatusLabel() void ExportedScriptsDialog::initModel() noexcept(false) { - DEBUG_LOG() << "(re)initModel !!"; + DEBUG_LOG(m_logger) << "(re)initModel !!"; const QString rootDirectory(localThpDir()); @@ -768,7 +767,7 @@ void ExportedScriptsDialog::initModel() noexcept(false) catch(...) { new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)")); - WARNING_LOG()<<" data corrupted path: "<< localThpDir(); + WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir(); } m_model->setOC(isOCApp()); @@ -805,12 +804,12 @@ void ExportedScriptsDialog::uploadScript() } catch(const std::runtime_error &err) { - ERROR_LOG() << "Uploaded script FAILED: " << err.what(); + ERROR_LOG(m_logger) << "Uploaded script FAILED: " << err.what(); new LtsWidgets::LtsMessageDialogNew(this, tr("Uploading script failed: %1").arg(QString::fromUtf8(err.what()))); return; } - DEBUG_LOG() << "Uploaded script successfully"; + DEBUG_LOG(m_logger) << "Uploaded script successfully"; new LtsWidgets::LtsMessageDialogNew(this, tr("Uploaded script successfully")); } @@ -855,7 +854,7 @@ void ExportedScriptsDialog::downloadScript() } catch(const std::runtime_error &err) { - ERROR_LOG() << "Downloading script FAILED: " << err.what(); + ERROR_LOG(m_logger) << "Downloading script FAILED: " << err.what(); new LtsWidgets::LtsMessageDialogNew(this, tr("Downloading script failed: %1").arg(QString::fromUtf8(err.what()))); return; } @@ -863,7 +862,7 @@ void ExportedScriptsDialog::downloadScript() - DEBUG_LOG() << "Downloaded script successfully"; + DEBUG_LOG(m_logger) << "Downloaded script successfully"; new LtsWidgets::LtsMessageDialogNew(this, tr("Downloaded script successfully")); } @@ -888,7 +887,7 @@ void ExportedScriptsDialog::removeScriptFromServer() } catch (const std::runtime_error &err) { - ERROR_LOG() << err.what(); + ERROR_LOG(m_logger) << err.what(); new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script from server!")); return; } @@ -941,7 +940,7 @@ void ExportedScriptsDialog::removeScriptLocal() } catch (const std::runtime_error &err) { - ERROR_LOG() << err.what(); + ERROR_LOG(m_logger) << err.what(); new LtsWidgets::LtsMessageDialogNew(this, tr("Failed to remove script locally!")); return; } @@ -965,7 +964,7 @@ void ExportedScriptsDialog::openScript() const auto path(QDir(scriptHtmlLocation(localThpDir(), esi.id())).path()); const auto url(QUrl::fromLocalFile(path)); const bool openUrlResult = QDesktopServices::openUrl(url); - DEBUG_LOG() << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult; + DEBUG_LOG(m_logger) << "path: " << path << " - url: " << url.toString() << " - success? " << openUrlResult; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.h index 6d279fce3..f9c1145c5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2Management/tpm2_exported_scripts_dialog.h @@ -73,6 +73,8 @@ signals: void signalCancel(); protected: + +NGL::INGLLogger &m_logger; void waitForAnswer(QNetworkReply *r, const int expectedResponseStatus) noexcept(false); QNetworkReply *post(const QString &path, QIODevice *data, const QUrlQuery &q = QUrlQuery(), const QString &contentType = QStringLiteral("application/octet-stream"), const QMap &additionalHeaders = {}) noexcept(false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.cpp index ef43774ce..1c805e2d1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.cpp @@ -63,7 +63,7 @@ WARNING_LOG(x) #endif #ifndef ELOG -#define ELOG ERROR_LOG() +#define ELOG ERROR_LOG(m_logger) #endif @@ -84,7 +84,7 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent) m_ui->setupUi(this); - WARNING_LOG()<<" USB2Dialog::USB2Dialog() START "; + WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() START "; connect(m_ui->pbCHange, &QPushButton::clicked, this, &USB2Dialog::slotChangePath); @@ -135,13 +135,13 @@ USB2Dialog::USB2Dialog(LtsSession::LtsSession *session, QWidget *parent) } catch(...) { - WARNING_LOG()<<" data corrupted path: "<< localThpDir(); + WARNING_LOG(m_logger)<<" data corrupted path: "<< localThpDir(); new LtsWidgets::LtsMessageDialogNew(this, tr("Couldn't Load THP(s)")); } setOnlineHelpFilename(QStringLiteral("Script_Editor-Export_Script_Administration")); - WARNING_LOG()<<" USB2Dialog::USB2Dialog() END "; + WARNING_LOG(m_logger)<<" USB2Dialog::USB2Dialog() END "; } @@ -185,15 +185,15 @@ void USB2Dialog::unmountUSB(const QString &device) while (process.canReadLine()) { QString outputLine = QString::fromUtf8(process.readLine()); - DEBUG_LOG() << "OutputLine: " << outputLine; + DEBUG_LOG(m_logger) << "OutputLine: " << outputLine; auto outputDevicePath = outputLine.split(QStringLiteral(" ")).last(); - DEBUG_LOG() << "OutputDevicePath: " << outputDevicePath; + DEBUG_LOG(m_logger) << "OutputDevicePath: " << outputDevicePath; auto outputPathStripped = outputDevicePath.replace(QLatin1String("\\x20"), QLatin1String(" ")); - DEBUG_LOG() << "OutputPathStripped: " << outputPathStripped; + DEBUG_LOG(m_logger) << "OutputPathStripped: " << outputPathStripped; auto outputDeviceName = outputPathStripped.split(QStringLiteral("/")).last(); - DEBUG_LOG() << "OutputDeviceName: " << outputDeviceName; + DEBUG_LOG(m_logger) << "OutputDeviceName: " << outputDeviceName; if (outputDeviceName.trimmed().compare(device.trimmed()) == 0) { @@ -201,7 +201,7 @@ void USB2Dialog::unmountUSB(const QString &device) auto serialPort = outputLine.split(QStringLiteral(" ")).first(); QString absPath = QStringLiteral("/dev/") + serialPort; - DEBUG_LOG() << "Serial Port: " << absPath; + DEBUG_LOG(m_logger) << "Serial Port: " << absPath; process.start(QStringLiteral("udisksctl"), QStringList() << QStringLiteral("unmount") << QStringLiteral("-b") << absPath); process.waitForFinished(); reset(); @@ -328,7 +328,7 @@ void USB2Dialog::slotUnmount() for(const auto &folder : std::as_const(folderNames)) { - DEBUG_LOG() << "Folder: " << folder << " USB Root: " << m_usbRoot; + DEBUG_LOG(m_logger) << "Folder: " << folder << " USB Root: " << m_usbRoot; if(m_usbRoot.contains(folder)) { @@ -479,7 +479,7 @@ void USB2Dialog::slotRemove() if (mil.size() < 1) return; - DEBUG_LOG() << "mil.size()" << mil.size(); + DEBUG_LOG(m_logger) << "mil.size()" << mil.size(); QStringList scriptIdList; for (const QModelIndex &idx : mil) @@ -604,7 +604,7 @@ void USB2Dialog::retranslate() void USB2Dialog::initLocalModel() noexcept(false) { - DEBUG_LOG() << "(re)initModel !!"; + DEBUG_LOG(m_logger) << "(re)initModel !!"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.h index d5407fe2f..37ee5a9e6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TakeHomePackageManager/THP2/Thp2UsbManagement/tpm_usb_dialog.h @@ -52,6 +52,8 @@ private slots: void slotUnmount(); private: + +NGL::INGLLogger &m_logger; void removeScript(const QString &scriptId); void reset(); void initLocalModel() noexcept(false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_model.h index dfeef7731..fd4cac502 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_model.h @@ -44,6 +44,8 @@ public: QVariant data(const QModelIndex &, int) const override; protected: + +NGL::INGLLogger &m_logger; bool isFiltered(const ShootbackTarget &data, DataModification modType) const override { return BaseClass::isFiltered(data, modType); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_view.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_view.h index 8ca53fd3b..5744dd87a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_view.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/old/tgt_shootback_target_view.h @@ -35,6 +35,8 @@ public: const std::shared_ptr &ftc); private: + +NGL::INGLLogger &m_logger; void retranslate() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_dialog.cpp index d1e7f74c5..8ad9f2813 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_dialog.cpp @@ -55,7 +55,7 @@ bool AreaDialog::init() return false; - INFO_LOG() << "AreaDialog::init"; + INFO_LOG(m_logger) << "AreaDialog::init"; m_areaModel = new AreaModel(this); m_areaModel->initModel(m_dtc); @@ -139,13 +139,13 @@ void AreaDialog::keyPressEvent(QKeyEvent *event) void AreaDialog::onNewArea() { - INFO_LOG() << "onNewArea"; + INFO_LOG(m_logger) << "onNewArea"; AreaEdit *dialog = new AreaEdit(this); if (!dialog->init(m_dtc, m_ftc, m_sitMapGuiIfc, m_areaModel)) { - ERROR_LOG() << QLatin1String("Can't initialize AreaEdit!"); + ERROR_LOG(m_logger) << QLatin1String("Can't initialize AreaEdit!"); delete dialog; return; } @@ -175,7 +175,7 @@ void AreaDialog::onEditArea() const QModelIndex curIdx = selectedRows.first(); if (!curIdx.isValid()) return; - INFO_LOG() << " onEditTargetPart"; + INFO_LOG(m_logger) << " onEditTargetPart"; AreaEdit *dialog = new AreaEdit(this); @@ -183,7 +183,7 @@ void AreaDialog::onEditArea() if (!dialog->init(m_dtc, m_ftc, m_sitMapGuiIfc, m_areaModel, area)) { - ERROR_LOG() << Q_FUNC_INFO << QLatin1String("Can't initialize AreaEdit!"); + ERROR_LOG(m_logger) << Q_FUNC_INFO << QLatin1String("Can't initialize AreaEdit!"); delete dialog; return; } @@ -218,7 +218,7 @@ QByteArray AreaDialog::toJson() const QJsonDocument doc(obj); - DEBUG_LOG() << " json = " << doc.toJson(); + DEBUG_LOG(m_logger) << " json = " << doc.toJson(); return doc.toJson(QJsonDocument::Compact); } @@ -259,9 +259,9 @@ void AreaDialog::onExportButtonClicked() QByteArray byteArray = toJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << Q_FUNC_INFO << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "Saved file with id = " << fileId; else - ERROR_LOG() << Q_FUNC_INFO << "Could not save file in library "; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not save file in library "; } void AreaDialog::onImportButtonClicked() @@ -282,7 +282,7 @@ void AreaDialog::onImportButtonClicked() void AreaDialog::onImport() { - INFO_LOG() << Q_FUNC_INFO << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << Q_FUNC_INFO << "--- onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, @@ -318,7 +318,7 @@ void AreaDialog::onImport() const QVector vecDataCandidate(fromJson(content)); for (ShootbackArea area : vecDataCandidate) { - DEBUG_LOG() << "area " <addRequest([this, area]() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_edit.cpp index ef3035e4b..d1fd5cf2e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_edit.cpp @@ -44,11 +44,11 @@ bool AreaEdit::init(const std::shared_ptr &dtc AreaModel *areaModel, const ShootbackArea &area) { - DEBUG_LOG() << "AreaEdit::init()"; + DEBUG_LOG(m_logger) << "AreaEdit::init()"; if (!dtc || !ftc || !sitMapGuiIfc) { - ERROR_LOG() << "AreaEdit::init() Invalid shared_ptr!"; + ERROR_LOG(m_logger) << "AreaEdit::init() Invalid shared_ptr!"; return false; } @@ -122,7 +122,7 @@ void AreaEdit::onRectData(const QPointF ¢erPoint, double width, double heigh m_ui->positionEdit->setCoordinate(centerPoint); m_ui->sbWidth->setValue(width); m_ui->sbHeight->setValue(height); - DEBUG_LOG() << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; + DEBUG_LOG(m_logger) << "Pos X: " << centerPoint.x() << " Y: " << centerPoint.y() << " W: " << width << " H: " << height; showPreviewObject(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_model.cpp index 12ee17d8e..46ae7fdbd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_area_model.cpp @@ -39,7 +39,7 @@ bool AreaModel::initModel(const std::shared_ptr areas = m_tgt_dtc->shootbackAreas(); - INFO_LOG() << "initModel - #AreaModel: " << areas.size(); + INFO_LOG(m_logger) << "initModel - #AreaModel: " << areas.size(); connect(m_tgt_dtc.get(), &Interface::Dtc::shootbackAreaChanged, this, &AreaModel::onShootbackAreaChanged); @@ -88,7 +88,7 @@ QVariant AreaModel::headerData(int section, Qt::Orientation orientation, int rol QVariant AreaModel::data(const QModelIndex &index, int role) const { - INFO_LOG() << Q_FUNC_INFO << " role=" << role + INFO_LOG(m_logger) << Q_FUNC_INFO << " role=" << role << " index = " << index.column(); if (!indexIsValid(index)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_assignment_part_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_assignment_part_model.cpp index 24c7aa54a..f27984519 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_assignment_part_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_assignment_part_model.cpp @@ -96,7 +96,7 @@ bool AssignmentParticipantModel::initModel(const std::shared_ptr targetAreaAssignments = m_tgt_dtc->targetAreaAssignments(); - INFO_LOG() << "initModel - #targetAreaAssignments.size(): " << targetAreaAssignments.size(); + INFO_LOG(m_logger) << "initModel - #targetAreaAssignments.size(): " << targetAreaAssignments.size(); connect(m_tgt_dtc.get(), &Interface::Dtc::targetAreaAssignmentChanged, this, &AssignmentParticipantModel::onTargetAreaAssignmentChanged); @@ -105,7 +105,7 @@ bool AssignmentParticipantModel::initModel(const std::shared_ptrtargetAreaAssignments(cb); } - INFO_LOG() << "initModel - #targetAreaAssignments.size(): " << targetAreaAssignments.size() << " DONE"; + INFO_LOG(m_logger) << "initModel - #targetAreaAssignments.size(): " << targetAreaAssignments.size() << " DONE"; connect(this, &AssignmentParticipantModel::rowsInserted, this, &AssignmentParticipantModel::updateColumnFilter); @@ -210,7 +210,7 @@ QVariant handleIsDefault(const TargetManagement::TargetAreaAssignment &assignmen QVariant AssignmentParticipantModel::data(const QModelIndex &index, int role) const { - INFO_LOG() << Q_FUNC_INFO << " role=" << role + INFO_LOG(m_logger) << Q_FUNC_INFO << " role=" << role << " index = " << index.column(); if (!indexIsValid(index)) @@ -465,7 +465,7 @@ int AssignmentParticipantModel::findRowForAreaTargetParticipantId(int areaId, in void AssignmentParticipantModel::addGapFillerForArea(int areaId) { - DEBUG_LOG() << Q_FUNC_INFO << " START, areaId=" << areaId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, areaId=" << areaId; const QSet &associatedParticipantIds = getAssociatedParticipantIdsForArea(areaId); @@ -509,12 +509,12 @@ void AssignmentParticipantModel::addGapFillerForArea(int areaId) #endif this->insertRows(gapFillers); - DEBUG_LOG() << Q_FUNC_INFO << " END, areaId=" << areaId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, areaId=" << areaId; } void AssignmentParticipantModel::addGapFillerForTargetParticipantId(int targetParticipantId) { - DEBUG_LOG() << Q_FUNC_INFO << " START, targetParticipantId=" << targetParticipantId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, targetParticipantId=" << targetParticipantId; const QSet &associatedAreaIds = getAssociatedAreasIdsForParticipantId(targetParticipantId); @@ -535,19 +535,19 @@ void AssignmentParticipantModel::addGapFillerForTargetParticipantId(int targetPa m_tgt_dtc->shootbackAreas(cb); this->insertRows(gapFillers); - DEBUG_LOG() << Q_FUNC_INFO << " END, targetParticipantId=" << targetParticipantId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, targetParticipantId=" << targetParticipantId; } void AssignmentParticipantModel::onTargetAreaAssignmentChanged(const TargetManagement::TargetAreaAssignment &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << " modType=" << modType << " data=" << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " modType=" << modType << " data=" << data; if (modType == DataModification::eAdded) { int row = findRowForAreaTargetParticipantId(data.areaId(), data.targetParticipantId()); - DEBUG_LOG() << Q_FUNC_INFO << " row=" << row; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " row=" << row; if (row >= 0) { setRowData(row, data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_participant_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_participant_handler.cpp index 4bcfe24ad..af9389d5b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_participant_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_participant_handler.cpp @@ -87,7 +87,7 @@ QString ParticipantHandler::target_wmsTypeClassToString(const ParticipantManagem void ParticipantHandler::onShootbackTargetChanged(const TargetManagement::ShootbackTarget &data, const DataModification modType) { - INFO_LOG() << "onShootbackTargetChanged: " << data << ", " << modType; + INFO_LOG(m_logger) << "onShootbackTargetChanged: " << data << ", " << modType; switch (modType) { @@ -104,7 +104,7 @@ void ParticipantHandler::onShootbackTargetChanged(const TargetManagement::Shootb void ParticipantHandler::onTypeChanged(const ParticipantManagement::Type &data, const DataModification modType) { - INFO_LOG() << "onTypeChanged:" << data << ", " << modType; + INFO_LOG(m_logger) << "onTypeChanged:" << data << ", " << modType; switch (modType) { @@ -121,7 +121,7 @@ void ParticipantHandler::onTypeChanged(const ParticipantManagement::Type &data, void ParticipantHandler::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType) { - TRACE_LOG() << "onParticipantChanged: " << data << ", " << modType; + TRACE_LOG(m_logger) << "onParticipantChanged: " << data << ", " << modType; if (data.isDeleted()) modType = DataModification::eRemoved; @@ -137,7 +137,7 @@ void ParticipantHandler::onParticipantChanged(const ParticipantManagement::Parti case DataModification::eModified: case DataModification::eAdded: { - DEBUG_LOG() << "DataModification::eAdded Participant" + DEBUG_LOG(m_logger) << "DataModification::eAdded Participant" << " Id=" << dataId << " TypeId=" << data.typeId() << " eqId=" << (data.equipmentNumber().is_set() ? data.equipmentNumber().get() : -1) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_shootback_target_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_shootback_target_edit.cpp index 6ba3ecdd0..d8b3be9a7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_shootback_target_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_shootback_target_edit.cpp @@ -37,11 +37,11 @@ bool ShootbackTargetEdit::init(const std::shared_ptrinitModel(m_dtc, m_ppmDtc, m_ppmGuiCbxIfc, m_session); @@ -246,13 +246,13 @@ void AssignmentDialog::keyPressEvent(QKeyEvent *event) void AssignmentDialog::onNewAssignment() { - INFO_LOG() << "onNew"; + INFO_LOG(m_logger) << "onNew"; AssignmentEditDialog *dialog = new AssignmentEditDialog(this); if (!dialog->init(m_dtc, m_ftc, m_assignmentParticipantModel)) { - ERROR_LOG() << QLatin1String("Can't initialize AssignmentEditDialog!"); + ERROR_LOG(m_logger) << QLatin1String("Can't initialize AssignmentEditDialog!"); delete dialog; return; } @@ -290,10 +290,10 @@ void AssignmentDialog::onEditAssignment() const TargetAreaAssignment &assignment = m_assignmentParticipantModel->getRowData(curIdx.row()); - DEBUG_LOG() << " onEditTargetArea, row = " << curIdx.row() << ", assignment.id() = " << assignment.id(); + DEBUG_LOG(m_logger) << " onEditTargetArea, row = " << curIdx.row() << ", assignment.id() = " << assignment.id(); if (!dialog->init(m_dtc, m_ftc, m_assignmentParticipantModel, assignment)) { - ERROR_LOG() << Q_FUNC_INFO << QLatin1String("Can't initialize ShootbackTarget!"); + ERROR_LOG(m_logger) << Q_FUNC_INFO << QLatin1String("Can't initialize ShootbackTarget!"); delete dialog; return; } @@ -308,7 +308,7 @@ void AssignmentDialog::onEditAssignment() void AssignmentDialog::onUpdateItem(const TargetAreaAssignment &assignment) { - INFO_LOG() << Q_FUNC_INFO << " got item to update, item=" << assignment; + INFO_LOG(m_logger) << Q_FUNC_INFO << " got item to update, item=" << assignment; if (assignment.id()>0) { @@ -317,7 +317,7 @@ void AssignmentDialog::onUpdateItem(const TargetAreaAssignment &assignment) QModelIndex mi = m_assignmentParticipantModel->findIndexForId(assignment.id()); int row = mi.row(); - INFO_LOG() << Q_FUNC_INFO << " got item to update, row=" << row; + INFO_LOG(m_logger) << Q_FUNC_INFO << " got item to update, row=" << row; if (row < 0) { abort(); @@ -329,7 +329,7 @@ void AssignmentDialog::onUpdateItem(const TargetAreaAssignment &assignment) if (m_assignmentParticipantModel->getRowData(row) != assignment) { m_assignmentParticipantModel->setRowData(row, assignment); - INFO_LOG() << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED, row = " << row; + INFO_LOG(m_logger) << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED, row = " << row; slotChangesMade(); } } @@ -339,18 +339,18 @@ void AssignmentDialog::onUpdateItem(const TargetAreaAssignment &assignment) int row = m_assignmentParticipantModel->findRowForAreaTargetParticipantId(assignment.areaId(), assignment.targetParticipantId()); - INFO_LOG() << Q_FUNC_INFO << " got item to update, row=" << row; + INFO_LOG(m_logger) << Q_FUNC_INFO << " got item to update, row=" << row; if (row < 0) { m_assignmentParticipantModel->insertRow(assignment); - INFO_LOG() << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED"; } else { if (m_assignmentParticipantModel->getRowData(row) != assignment) { m_assignmentParticipantModel->setRowData(row, assignment); - INFO_LOG() << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED, row = " << row; + INFO_LOG(m_logger) << Q_FUNC_INFO << " CHANGED CHANGED CHANGED CHANGED CHANGED, row = " << row; slotChangesMade(); } } @@ -396,7 +396,7 @@ QByteArray AssignmentDialog::toJson() const } QJsonDocument doc(obj); - DEBUG_LOG() << " json = " << doc.toJson(); + DEBUG_LOG(m_logger) << " json = " << doc.toJson(); return doc.toJson(QJsonDocument::Compact); } @@ -440,7 +440,7 @@ QVector AssignmentDialog::fromJson(const bool AssignmentDialog::apply() { - DEBUG_LOG() << Q_FUNC_INFO << " APPLY"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " APPLY"; const QVector &assignments = m_assignmentParticipantModel->getData(); for (const TargetAreaAssignment &updateCandidate : std::as_const(assignments)) @@ -451,9 +451,9 @@ bool AssignmentDialog::apply() if (updateCandidate.isActive() && isDefault(updateCandidate.configuration())) { - ERROR_LOG() << Q_FUNC_INFO << " APPLY NOT ALLOWED - Invalid configuration provided for at least one active assignment"; - ERROR_LOG() << Q_FUNC_INFO << " APPLY NOT ALLOWED - Invalid configuration provided for at least one active assignment"; - ERROR_LOG() << Q_FUNC_INFO << " updateCandidate " << updateCandidate; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " APPLY NOT ALLOWED - Invalid configuration provided for at least one active assignment"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " APPLY NOT ALLOWED - Invalid configuration provided for at least one active assignment"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " updateCandidate " << updateCandidate; QMessageBox::warning(this, tr("No configuration"), tr("Invalid configuration provided for at least one active assignment.") @@ -468,7 +468,7 @@ bool AssignmentDialog::apply() bool isGapFiller = (assignmentId <= 0); if (!isEqual(curAssignment, updateCandidate, isGapFiller)) { - INFO_LOG() << Q_FUNC_INFO << " add request for: assignmentId:" << assignmentId + INFO_LOG(m_logger) << Q_FUNC_INFO << " add request for: assignmentId:" << assignmentId << " name: " << QString::fromStdString(updateCandidate.name()); m_requestHelper->addRequest([this, updateCandidate]() { @@ -493,14 +493,14 @@ void AssignmentDialog::onExportButtonClicked() QByteArray byteArray = toJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << Q_FUNC_INFO << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "Saved file with id = " << fileId; else - ERROR_LOG() << Q_FUNC_INFO << "Could not save file in library "; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not save file in library "; } void AssignmentDialog::onImportButtonClicked() { - INFO_LOG() << Q_FUNC_INFO << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << Q_FUNC_INFO << "--- onImportButtonClicked() "; QHash buttonTexts; buttonTexts.insert(LtsWidgets::Button::Ok, tr("Overwrite")); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_area_assignment_edit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_area_assignment_edit.cpp index 8dfb79362..2b9d01771 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_area_assignment_edit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_area_assignment_edit.cpp @@ -39,11 +39,11 @@ bool AssignmentEditDialog::init(const std::shared_ptrinitModel(m_dtc, m_ppmDtc, m_ppmGuiCbxIfc, m_session); @@ -189,13 +189,13 @@ void TargetPartDialog::retranslate() void TargetPartDialog::onNewTargetPart() { - INFO_LOG() << "onNewTargetPart"; + INFO_LOG(m_logger) << "onNewTargetPart"; ShootbackTargetEdit *dialog = new ShootbackTargetEdit(this); if (!dialog->init(m_dtc, m_ftc, m_targetParticipantModel)) { - ERROR_LOG() << QLatin1String("Can't initialize shootbackTargetEdit!"); + ERROR_LOG(m_logger) << QLatin1String("Can't initialize shootbackTargetEdit!"); delete dialog; return; } @@ -228,7 +228,7 @@ void TargetPartDialog::onEditTargetPart() const QModelIndex curIdx = selectedRows.first(); if (!curIdx.isValid()) return; - INFO_LOG() << " onEditTargetPart"; + INFO_LOG(m_logger) << " onEditTargetPart"; ShootbackTargetEdit *dialog = new ShootbackTargetEdit(this); @@ -236,7 +236,7 @@ void TargetPartDialog::onEditTargetPart() if (!dialog->init(m_dtc, m_ftc, m_targetParticipantModel, tgt)) { - ERROR_LOG() << Q_FUNC_INFO << QLatin1String("Can't initialize shootbackTargetEdit!"); + ERROR_LOG(m_logger) << Q_FUNC_INFO << QLatin1String("Can't initialize shootbackTargetEdit!"); delete dialog; return; } @@ -283,7 +283,7 @@ QByteArray TargetPartDialog::toJson() const } QJsonDocument doc(obj); - DEBUG_LOG() << " json = " << doc.toJson(); + DEBUG_LOG(m_logger) << " json = " << doc.toJson(); return doc.toJson(QJsonDocument::Compact); } @@ -330,9 +330,9 @@ void TargetPartDialog::onExportButtonClicked() QByteArray byteArray = toJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - DEBUG_LOG() << Q_FUNC_INFO << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "Saved file with id = " << fileId; else - ERROR_LOG() << Q_FUNC_INFO << "Could not save file in library "; + ERROR_LOG(m_logger) << Q_FUNC_INFO << "Could not save file in library "; } void TargetPartDialog::onImportButtonClicked() @@ -353,7 +353,7 @@ void TargetPartDialog::onImportButtonClicked() void TargetPartDialog::onImport() { - INFO_LOG() << Q_FUNC_INFO << "--- onImportButtonClicked() "; + INFO_LOG(m_logger) << Q_FUNC_INFO << "--- onImportButtonClicked() "; QByteArray content; int fileId = m_flmGui->loadFileContent(this, content, {FileManagement::FileType::Xml}, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_part_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_part_model.cpp index a220d6023..9cb3dafde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_part_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TargetManagement/Gui/ShootbackTargetConfiguration/tgt_target_part_model.cpp @@ -73,7 +73,7 @@ bool TargetParticipantModel::initModel(const std::shared_ptr targetParticipants = m_tgt_dtc->shootbackTargets(); - INFO_LOG() << "initModel - #TargetParticipantModel: " << targetParticipants.size(); + INFO_LOG(m_logger) << "initModel - #TargetParticipantModel: " << targetParticipants.size(); connect(m_tgt_dtc.get(), &Interface::Dtc::shootbackTargetChanged, this, &TargetParticipantModel::onShootbackTargetChanged); @@ -150,7 +150,7 @@ QVariant TargetParticipantModel::headerData(int section, Qt::Orientation orienta QVariant TargetParticipantModel::data(const QModelIndex &index, int role) const { - INFO_LOG() << Q_FUNC_INFO << " role=" << role + INFO_LOG(m_logger) << Q_FUNC_INFO << " role=" << role << " index = " << index.column(); if (!indexIsValid(index)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.cpp index 2cd87b976..65b37799c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.cpp @@ -134,7 +134,7 @@ TimelineDataProvider::TimelineDataProvider(int requestId, const QUrl &url, realUrl.setQuery(query); m_webSocketEem->open(realUrl); - DEBUG_LOG() << "requesting data from EEM: " << realUrl.toString(); + DEBUG_LOG(m_logger) << "requesting data from EEM: " << realUrl.toString(); } TimelineDataProvider::~TimelineDataProvider() @@ -157,13 +157,13 @@ void TimelineDataProvider::textMessageFromEem(const QString &message) { if (message.isEmpty() || message == QStringLiteral("{}")) { - DEBUG_LOG() << "textMessageFromEem - finished"; + DEBUG_LOG(m_logger) << "textMessageFromEem - finished"; disconnectedFromEem(); return; } const QJsonDocument doc(QJsonDocument::fromJson(message.toUtf8())); const QJsonArray arr = doc.array(); - DEBUG_LOG() << "textMessageFromEem - #events: " << arr.size(); + DEBUG_LOG(m_logger) << "textMessageFromEem - #events: " << arr.size(); m_eventData.reserve(m_eventData.size() + arr.size()); using namespace ExerciseEventManagement::Database; std::transform(arr.begin(), arr.end(), @@ -175,7 +175,7 @@ TimelineDataProviderInterface *ForeignInterfaceImpl::requestData(qint64 from, qi { if (!m_webSocketEem) { - WARNING_LOG() << "No connection to EEM - can not request data!"; + WARNING_LOG(m_logger) << "No connection to EEM - can not request data!"; return nullptr; } static int s_requestId = 0; @@ -185,7 +185,7 @@ TimelineDataProviderInterface *ForeignInterfaceImpl::requestData(qint64 from, qi connect(tldp, &TimelineDataProvider::finished, this, &ForeignInterfaceImpl::requestFinished); connect(tldp, &TimelineDataProvider::destroyed, this, [this, curRequestId]() { m_pendingRequests.remove(curRequestId);}); m_pendingRequests[curRequestId] = tldp; - DEBUG_LOG() << "add to m_pendingRequests: " << curRequestId << ", " << tldp; + DEBUG_LOG(m_logger) << "add to m_pendingRequests: " << curRequestId << ", " << tldp; return tldp; } @@ -208,26 +208,26 @@ void ForeignInterfaceImpl::connectToScm() const QUrl scmUrl(QStringLiteral("ws://%1:%2") .arg(NGL::Connections::hostName(NGL::Connections::eConnection::SCM_WEBSOCKET)) .arg(NGL::Connections::port(NGL::Connections::eConnection::SCM_WEBSOCKET))); - DEBUG_LOG() << "Trying to connect to SCM at " << scmUrl.toString(); + DEBUG_LOG(m_logger) << "Trying to connect to SCM at " << scmUrl.toString(); m_webSocketScm->open(scmUrl); } void ForeignInterfaceImpl::connectedToScm() { - DEBUG_LOG() << "Connected to SCM..."; + DEBUG_LOG(m_logger) << "Connected to SCM..."; m_webSocketScm->sendTextMessage(QStringLiteral("{\"type\": \"servicePortsInformationRequest\",\"uuid\": \"7777\"}")); } void ForeignInterfaceImpl::textMessageFromScm(const QString &message) { - DEBUG_LOG() << "textMessageFromScm from scm: " << message; + DEBUG_LOG(m_logger) << "textMessageFromScm from scm: " << message; const QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8()); const QJsonArray exercises = doc.object().value(QStringLiteral("data")).toArray(); for (const QJsonValue &valEx : exercises) { const QJsonObject &exercise = valEx.toObject(); const int exerciseId = exercise.value(QStringLiteral("exerciseId")).toInt(); - DEBUG_LOG() << "textMessageFromScm from scm - exerciseId " << exerciseId; + DEBUG_LOG(m_logger) << "textMessageFromScm from scm - exerciseId " << exerciseId; if (exerciseId != m_session->exerciseId()) continue; @@ -237,7 +237,7 @@ void ForeignInterfaceImpl::textMessageFromScm(const QString &message) { const QJsonObject &service = valSvc.toObject(); const QString svcName = service.value(QStringLiteral("nameAbbrevation")).toString().toUpper(); - DEBUG_LOG() << "textMessageFromScm from scm - svcName " << svcName; + DEBUG_LOG(m_logger) << "textMessageFromScm from scm - svcName " << svcName; if (svcName != QStringLiteral("EEM")) continue; @@ -272,24 +272,24 @@ void ForeignInterfaceImpl::connectToEem() this, &ForeignInterfaceImpl::textMessageFromEem); QUrl url(eemUrl()); url.setPath(QStringLiteral("/live")); - DEBUG_LOG() << "Trying to connect to EEM at " << url.toString(); + DEBUG_LOG(m_logger) << "Trying to connect to EEM at " << url.toString(); m_webSocketEem->open(url); } void ForeignInterfaceImpl::connectedToEem() { - DEBUG_LOG() << "Connected to EEM..."; + DEBUG_LOG(m_logger) << "Connected to EEM..."; } void ForeignInterfaceImpl::disconnectedFromEem() { - WARNING_LOG() << "EEM connection closed - try to reconnect"; + WARNING_LOG(m_logger) << "EEM connection closed - try to reconnect"; QTimer::singleShot(500, this, &ForeignInterfaceImpl::connectToScm); } void ForeignInterfaceImpl::textMessageFromEem(const QString &message) { - TRACE_LOG() << "textMessageFromEem: " << message; + TRACE_LOG(m_logger) << "textMessageFromEem: " << message; const QJsonObject obj(QJsonDocument::fromJson(message.toUtf8()).object()); using namespace ExerciseEventManagement::Database; @@ -303,16 +303,16 @@ void ForeignInterfaceImpl::requestFinished() TimelineDataProvider *tldp = qobject_cast(sender()); if (!tldp) { - WARNING_LOG() << "requestFinished without valid sender"; + WARNING_LOG(m_logger) << "requestFinished without valid sender"; return; } auto it = m_pendingRequests.find(tldp->requestId()); if (it == m_pendingRequests.end()) { - WARNING_LOG() << "requestFinished but request not found in pending requests: " << tldp->requestId() << ", " << tldp; + WARNING_LOG(m_logger) << "requestFinished but request not found in pending requests: " << tldp->requestId() << ", " << tldp; return; } - DEBUG_LOG() << "emit requestedDataAvailable for " << tldp->requestId() << ", #events: " << tldp->eventData().size() << ", " << tldp; + DEBUG_LOG(m_logger) << "emit requestedDataAvailable for " << tldp->requestId() << ", #events: " << tldp->eventData().size() << ", " << tldp; emit requestedDataAvailable(it.value()); it.value()->deleteLater(); m_pendingRequests.erase(it); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.h index 8c9c0c737..63a1bcc9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Data/tln_data_plugin.h @@ -44,6 +44,8 @@ public: std::shared_ptr getForeignDataInterface() override { return m_foreign; } private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_foreign; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_event_factory.h index 668b6fa65..e9fe79519 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_filter.h index 37a543cf7..0cf694719 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_item.h index ea9d3c361..55c433b9d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BCContamination/tln_bccontamination_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_event_factory.h index 6bd6a0c8a..5f0fc711a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; BiteMessageFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_filter.h index a0e9b7109..b7b98decb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_filter.h @@ -24,6 +24,8 @@ public: bool check(const AbstractEventItem &item) const override; private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_item.h index c51b3d583..bdf5c0475 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/BiteMessage/tln_bite_message_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *) override {} private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_event_factory.h index a8feb18f7..e74f85085 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_filter.h index 885bf4070..4f35c14f9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_item.h index bcbdb5c1a..61d8e8094 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Borderline/tln_borderline_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_event_factory.h index d2a22f901..234a27b13 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_event_factory.h @@ -34,6 +34,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; CameraVideoFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.cpp index 8fb0dffd2..2e621fef0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.cpp @@ -70,7 +70,7 @@ bool CameraVideoFilter::init( { if (!ismDtc) { - ERROR_LOG() << "Unable to load MainStructureElement IDs from ISM-DTC"; + ERROR_LOG(m_logger) << "Unable to load MainStructureElement IDs from ISM-DTC"; return false; } @@ -86,7 +86,7 @@ bool CameraVideoFilter::init( { if (!m_avmDtc || !m_avmDataIfc || !m_avmDataIfc->hasAvsSession() || !m_avmDataIfc->menus()) { - ERROR_LOG() << "Unable to load Video Menus"; + ERROR_LOG(m_logger) << "Unable to load Video Menus"; return false; } @@ -109,7 +109,7 @@ bool CameraVideoFilter::init( if (newActiveVideoMenu == m_activeVideoMenu) return; - DEBUG_LOG() << "Changed active video menu from: " << m_activeVideoMenu << ", to: " << newActiveVideoMenu; + DEBUG_LOG(m_logger) << "Changed active video menu from: " << m_activeVideoMenu << ", to: " << newActiveVideoMenu; m_activeVideoMenu = newActiveVideoMenu; @@ -375,7 +375,7 @@ QStringList CameraVideoFilter::getInternalStreamNamesBySelectedStreams() const if (!m_avmDtc) { - ERROR_LOG() << "Unable to get internal stream names (avm dtc missing)"; + ERROR_LOG(m_logger) << "Unable to get internal stream names (avm dtc missing)"; return {}; } @@ -447,7 +447,7 @@ void CameraVideoFilter::onMainStructureElementChanged(const InfrastructureManage if (parseError.error != QJsonParseError::NoError) { - INFO_LOG() << "Could not parse JSON props of building with ID " + INFO_LOG(m_logger) << "Could not parse JSON props of building with ID " << data.id() << ". Reason: " << parseError.errorString() @@ -493,7 +493,7 @@ void CameraVideoFilter::onStreamListReceived(const QMap &mapIn { if (!m_avmDtc) { - ERROR_LOG() << "Unable to load Video Menus"; + ERROR_LOG(m_logger) << "Unable to load Video Menus"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.h index ea588d459..cd8827531 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_filter.h @@ -44,6 +44,8 @@ public: static const std::vector s_excluded_mse_ids; private: + +NGL::INGLLogger &m_logger; void updateMenuStreams(); void updateFilterString() override; QStringList getInternalStreamNamesBySelectedStreams() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.cpp index 791028def..11490d8fc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.cpp @@ -53,7 +53,7 @@ void CameraVideoItem::addItemInfoRows(QFormLayout *form) CameraVideoFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "CameraVideoFilter unavailable"; + ERROR_LOG(m_logger) << "CameraVideoFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.h index a5fa90a4a..56f07d95c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CameraVideo/tln_camera_video_item.h @@ -29,6 +29,8 @@ public: QString internalStreamName() const { return m_streamName; } private: + +NGL::INGLLogger &m_logger; int m_mainStructureElementId; QString m_streamName; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_event_factory.h index 51160853d..604672efd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_event_factory.h @@ -28,6 +28,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; CrossBorderlineFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_filter.h index f8c14c341..f48f2d8d3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_filter.h @@ -21,6 +21,8 @@ public: bool check(const AbstractEventItem &item) const override; private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.cpp index e18b57251..7eea7284d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.cpp @@ -62,7 +62,7 @@ void CrossBorderlineItem::addItemInfoRows(QFormLayout *form) CrossBorderlineFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "CrossBorderlineFilter unavailable"; + ERROR_LOG(m_logger) << "CrossBorderlineFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.h index f2f3a85cc..2eb5c387a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/CrossBorderline/tln_cross_borderline_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_event_factory.h index 522605282..a14fbf628 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_filter.h index 13fc037ea..07c4063c2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_item.h index 2b5f43efa..880f27f7b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/DangerArea/tln_danger_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_event_factory.h index e45bf4a26..442a80353 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_filter.h index ca7fa5844..b07c087a4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_item.h index 66bd75f0d..449e2ae76 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EmergencyCall/tln_emergency_call_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index, const LtsUtils::QPoint3D &position) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_event_factory.h index 1aea8bc45..e517d0095 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_filter.h index d076ebb2e..dfddb57c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_filter.h @@ -26,6 +26,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_item.h index 91e9ac996..45d75801b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterDangerArea/tln_enter_danger_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_event_factory.h index 296c7be35..9b493bb45 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_filter.h index fecad3a51..ae6208e85 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_filter.h @@ -26,6 +26,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_item.h index e1a4d814a..9fd0eda16 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterFunctionalArea/tln_enter_functional_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_event_factory.h index c81c547c4..21e501381 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_filter.h index 1396a63a2..8d562972c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_filter.h @@ -25,6 +25,8 @@ public: QStringList attributeNames() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_item.h index 520cf1643..fa8d83cce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterMineArea/tln_enter_mine_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_event_factory.h index f6b7edc7a..1247c0ecc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_event_factory.h @@ -22,6 +22,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_filter.h index 13eff8dc1..47bf8ee66 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_filter.h @@ -26,6 +26,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_item.h index d453792cc..d485333c4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EnterNuclear/tln_enter_nuclear_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_event_factory.h index 3b7b738b6..19b7bd451 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_filter.h index 6c486d62c..d73b41ab9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_item.h index b95cc69b5..3b1e02cba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/EquipmentErrorReport/tln_equipment_error_report_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_event_factory.h index ff29e6638..3f7107251 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_event_factory.h @@ -31,6 +31,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; FireEventFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_filter.cpp index d382c39cc..2153c8cdc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_filter.cpp @@ -35,7 +35,7 @@ bool FireEventFilter::init(std::shared_ptrtrChargeTypeShortName(id); } private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.cpp index fd7a48178..8c4f8374c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.cpp @@ -58,7 +58,7 @@ void FireEventItem::addItemInfoRows(QFormLayout *form) FireEventFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "FireEventFilter unavailable"; + ERROR_LOG(m_logger) << "FireEventFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.h index 711b29f4e..87c811945 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FireEvent/tln_fire_event_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_event_factory.h index e7596aac6..130182e51 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_filter.h index ed7a87b28..853e42fc8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_item.h index 202719e20..339c8a91c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FriendlyFire/tln_friendly_fire_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_event_factory.h index bfde93241..835d654bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_filter.h index 905261a33..05e697dd2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_item.h index f5d784adf..7c1dd9459 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/FunctionalArea/tln_functional_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_event_factory.h index 7dffa0212..db2cb009c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_filter.h index 56ae3f425..14be94b71 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_item.h index 56396cb0d..d1956de70 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/GasPipe/tln_gas_pipe_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_event_factory.h index 36f3e8e10..78921d68d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_event_factory.h @@ -34,6 +34,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; HitFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.cpp index 7f5e4068f..573418ef2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.cpp @@ -54,12 +54,12 @@ bool HitFilter::init( if (!m_ppmDtc) { - ERROR_LOG() << "PPM-DTC is not running"; + ERROR_LOG(m_logger) << "PPM-DTC is not running"; return false; } if (!m_pdmDtc) { - ERROR_LOG() << "PDM-DTC is not running"; + ERROR_LOG(m_logger) << "PDM-DTC is not running"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.h index 3637fcb11..404399f58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_filter.h @@ -45,6 +45,8 @@ public: QString party(int id) const { return ParticipantManagement::trPartyName(m_ppmDtc->party(id).name()); } private: + +NGL::INGLLogger &m_logger; void addOriginatorEquipmentNumberWidgetToLayout(QGridLayout *layout, LtsWidgets::LtsDialog *dialog) const; void updateFilterString() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.cpp index 4a87cbc1f..ed2d70bbc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.cpp @@ -59,7 +59,7 @@ void HitItem::addItemInfoRows(QFormLayout *form) HitFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "HitFilter unavailable"; + ERROR_LOG(m_logger) << "HitFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.h index 9f3083679..2e1166c4a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Hit/tln_hit_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_event_factory.h index 575c59d69..58d9fd1df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_filter.h index 451fc0959..5918e8a98 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_item.h index b893da02b..a43bf3328 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitB/tln_hit_b_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_event_factory.h index 9797d7722..fd14310c7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_event_factory.h @@ -37,6 +37,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; HitBuildingFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.cpp index c4a2963f3..958cfe0ce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.cpp @@ -63,19 +63,19 @@ bool HitBuildingFilter::init( if (!m_ismDtc) { - ERROR_LOG() << "ISM-DTC is not running"; + ERROR_LOG(m_logger) << "ISM-DTC is not running"; return false; } if (!m_ppmDtc) { - ERROR_LOG() << "PPM-DTC is not running"; + ERROR_LOG(m_logger) << "PPM-DTC is not running"; return false; } if (!m_pdmDtc) { - ERROR_LOG() << "PDM-DTC is not running"; + ERROR_LOG(m_logger) << "PDM-DTC is not running"; return false; } @@ -228,7 +228,7 @@ QString HitBuildingFilter::getChargeTypeShortName(int id) { if(!m_pdmDtc) { - ERROR_LOG() << "Unable to load ChargeType IDs from PDM-DTC"; + ERROR_LOG(m_logger) << "Unable to load ChargeType IDs from PDM-DTC"; return {}; } return m_pdmDtc->trChargeTypeShortName(id); @@ -377,7 +377,7 @@ void HitBuildingFilter::onMainStructureElementChanged(const InfrastructureManage if (parseError.error != QJsonParseError::NoError) { - INFO_LOG() << "Could not parse JSON props of building with ID " + INFO_LOG(m_logger) << "Could not parse JSON props of building with ID " << data.id() << ". Reason: " << parseError.errorString() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.h index a182d9b88..35e70ac77 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_filter.h @@ -49,6 +49,9 @@ public: private: + + +NGL::INGLLogger &m_logger; void addOriginatorEquipmentNumberWidgetToLayout(QGridLayout *layout, LtsWidgets::LtsDialog *dialog) const; void updateFilterString() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.cpp index c3df2f3e9..6bfbf1b89 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.cpp @@ -60,7 +60,7 @@ void HitBuildingItem::addItemInfoRows(QFormLayout *form) HitBuildingFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "HitBuildingFilter unavailable"; + ERROR_LOG(m_logger) << "HitBuildingFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.h index 48b58fd68..2114c5aa6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitBuilding/tln_hit_building_item.h @@ -28,6 +28,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; int m_mainStructureElementId; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_event_factory.h index e4ce84392..6cff80175 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_filter.h index 314eb70f3..2892b6d38 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_item.h index 698fabdb8..df616b467 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitC/tln_hit_c_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_event_factory.h index 69067bdb3..ff22eaa5b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_event_factory.h @@ -32,6 +32,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; HitEffectSimulationFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_filter.cpp index 0be3d0d50..1a41025fe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_filter.cpp @@ -45,7 +45,7 @@ bool HitEffectSimulationFilter::init(std::shared_ptr s_originatorChargeTypesIds; private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.cpp index ad7c4da4e..79044f440 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.cpp @@ -61,7 +61,7 @@ void HitEffectSimulationItem::addItemInfoRows(QFormLayout *form) HitEffectSimulationFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "HitEffectSimulationFilter unavailable"; + ERROR_LOG(m_logger) << "HitEffectSimulationFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.h index 39f570927..cfce1a989 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_event_factory.h index fa07b42b2..fbc79d72f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_filter.h index 892f6d9fe..fd7cc75b3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_item.h index 99b2a5381..6d54ba687 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitGasPipe/tln_hit_gas_pipe_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_event_factory.h index 45f94d88b..9978ae4bc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_filter.h index aa28049eb..a5a6600f5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_item.h index 6f4f4f760..15007e1b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitMine/tln_hit_mine_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_event_factory.h index aeae4d518..089f5c034 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_filter.h index b72b5ac49..7f8fe81d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_item.h index 73e7f1c84..f3a2d7af9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/HitN/tln_hit_n_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_event_factory.h index 8f6fd6c24..813021982 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_filter.h index 60cc54698..3572da11a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_item.h index dbcc69a91..290f7c23c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveDangerArea/tln_leave_danger_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_event_factory.h index 47e91f7ee..bd375c359 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_filter.h index 6a344d726..3d5c859bf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_item.h index a4bceec12..1572645db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveFunctionalArea/tln_leave_functional_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_event_factory.h index c3383e7bc..cd0935c10 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_filter.h index 32c556e32..c1a51868d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_item.h index 4d0576f4e..8e60a4df5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveMineArea/tln_leave_mine_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_event_factory.h index aa7f882cf..b7f45af03 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_filter.h index deecee776..f8431f307 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_item.h index 7d89dc37f..108504283 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/LeaveNuclear/tln_leave_nuclear_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_event_factory.h index 3d17c269e..05d3f609b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; ManipulationFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_filter.h index 6abe24a10..d47bcf1f8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_filter.h @@ -24,6 +24,8 @@ public: bool check(const AbstractEventItem &item) const override; private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_item.h index 8150ca7c2..e200974b0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Manipulation/tln_manipulation_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override {} private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_event_factory.h index a68c2735e..ca9d049bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_event_factory.h @@ -36,6 +36,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; MarkerFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.cpp index 4ed464f4d..2b018123e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.cpp @@ -39,7 +39,7 @@ bool MarkerFilter::init(std::shared_ptr opmD { if (!opmDtc) { - ERROR_LOG() << "Unable to load Users/Operators from OPM-DTC"; + ERROR_LOG(m_logger) << "Unable to load Users/Operators from OPM-DTC"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.h index bb64c777d..e6ea08662 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_filter.h @@ -37,6 +37,8 @@ public: QString user(int id) const { return m_users.value(id, QApplication::tr("unknown")); } private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.cpp index 495c8eaad..1c7ea2469 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.cpp @@ -56,7 +56,7 @@ void MarkerItem::addItemInfoRows(QFormLayout *form) MarkerFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "MarkerFilter unavailable"; + ERROR_LOG(m_logger) << "MarkerFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.h index 45eeafc6f..193b7827e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Marker/tln_marker_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_event_factory.h index c8cb56d01..84f089d60 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_filter.h index caf45d4cb..3b2f0a9ba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_item.h index c18739927..4dd7ab6d7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineArea/tln_mine_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_event_factory.h index ddef627ff..ce25cb29b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_filter.h index 67cd045b0..4a328dfdf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_item.h index 1ec09acf6..273b809ab 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/MineCorridor/tln_mine_corridor_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_event_factory.h index 5cf218fb7..ef54ee3fe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_filter.h index 7084aabd5..557ac282c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_item.h index e45f587d6..117f23935 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/NContamination/tln_n_contamination_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_event_factory.h index 9a434db81..0c74de5e0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_event_factory.h @@ -32,6 +32,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; RadioCnrFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_filter.h index 4ffb0521c..d6e1b26f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_filter.h @@ -35,6 +35,8 @@ public: QString stream(int id); private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.cpp index 51f2cae26..732eef52d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.cpp @@ -50,7 +50,7 @@ void RadioCnrItem::addItemInfoRows(QFormLayout *form) RadioCnrFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "RadioCnrFilter unavailable"; + ERROR_LOG(m_logger) << "RadioCnrFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.h index 9657c6661..5360f6583 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioCnr/tln_radio_cnr_item.h @@ -28,6 +28,8 @@ public: QString displayStreamName() const { return m_properties[QStringLiteral("streamName")].toString(); } private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_event_factory.h index 06e352f5e..be6a2844b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_event_factory.h @@ -32,6 +32,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; RadioTvcFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_filter.h index 1c19768ef..1b890c5c5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_filter.h @@ -33,6 +33,8 @@ public: QString stream(int id) const { return m_streams.value(id); } private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.cpp index a266c454b..c2df62483 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.cpp @@ -51,7 +51,7 @@ void RadioTvcItem::addItemInfoRows(QFormLayout *form) RadioTvcFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "RadioTvcFilter unavailable"; + ERROR_LOG(m_logger) << "RadioTvcFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.h index 8fdc8092a..d57b04fbc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/RadioTvc/tln_radio_tvc_item.h @@ -28,6 +28,8 @@ public: QString displayStreamName() const { return m_properties[QStringLiteral("streamName")].toString(); } private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_event_factory.h index d8e1b4e82..fa9ec1149 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_filter.h index 5c0999b3e..65a988f50 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_item.h index 8ad5aa8ec..477b18888 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/Sanitation/tln_sanitation_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_event_factory.h index 356cf9113..ace1745cf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_event_factory.h @@ -26,6 +26,8 @@ public: AbstractEventFilter *createFilter() const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_filter.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_filter.h index 3e160044f..15e2daf4c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_filter.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_filter.h @@ -28,6 +28,8 @@ public: QWidget *widget() override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_item.h index 85d21b7b8..202e9a3e1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/TechnicalArea/tln_technical_area_item.h @@ -21,6 +21,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_event_factory.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_event_factory.h index 3dc9714cb..90a2b3c9a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_event_factory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_event_factory.h @@ -32,6 +32,8 @@ public: AbstractEventFilter *createFilter() override; private: + +NGL::INGLLogger &m_logger; WeaponAssignmentFilter *m_filter{nullptr}; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_filter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_filter.cpp index 83ec521b5..de47b2c27 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_filter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_filter.cpp @@ -42,7 +42,7 @@ bool WeaponAssignmentFilter::init(std::shared_ptr s_filteredGearIds; private: + +NGL::INGLLogger &m_logger; void updateFilterString() override; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.cpp index 396e74037..537ca42b9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.cpp @@ -62,7 +62,7 @@ void WeaponAssignmentItem::addItemInfoRows(QFormLayout *form) WeaponAssignmentFilter *filter = static_cast(m_factory->filter()); if (!filter) { - ERROR_LOG() << "WeaponAssignmentFilter unavailable"; + ERROR_LOG(m_logger) << "WeaponAssignmentFilter unavailable"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.h index b234f0dbf..2e98920a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/EventTypes/WeaponAssignment/tln_weapon_assignment_item.h @@ -26,6 +26,8 @@ public: void addItemInfoRows(QFormLayout *form) override; private: + +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.cpp index e73953c64..d4de4a524 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.cpp @@ -191,7 +191,7 @@ void FilterDialog::onShowFilterItems() { if (!m_model->rootItem()) { - DEBUG_LOG() << "invalid root item"; + DEBUG_LOG(m_logger) << "invalid root item"; return; } @@ -201,7 +201,7 @@ void FilterDialog::onShowFilterItems() { if (!item) { - WARNING_LOG() << Q_FUNC_INFO << " nullptr item in filter model"; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " nullptr item in filter model"; continue; } eventTypesOfFiltersToShow.append(item->eventType()); @@ -226,22 +226,22 @@ void FilterDialog::onLoad() else { bool bResult = m_model->jsonToTimelineFilter(content); - INFO_LOG() << "import file return: " << bResult; + INFO_LOG(m_logger) << "import file return: " << bResult; } } else - ERROR_LOG() << Q_FUNC_INFO << " failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } void FilterDialog::onSave() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QByteArray byteArray = m_model->modelToJson(); int fileId = m_flmGui->saveFileContent(this, FileManagement::FileType::Xml, m_session->exerciseId(), byteArray); if (fileId > 0) - INFO_LOG() << "Saved file with id = " << fileId; + INFO_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } void FilterDialog::onShowOnlyActiveFilters(bool show) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.h index 554fa9913..a604a7103 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_dialog.h @@ -33,6 +33,8 @@ public: void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; private: + +NGL::INGLLogger &m_logger; FilterDialog *m_dialog { nullptr }; QPushButton *m_button { nullptr }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.cpp index 294801ffd..1d9ab242f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.cpp @@ -62,18 +62,18 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) if (index >= count) break; filter->clearAttributeValues(attributeName); - ERROR_LOG() << "count: " << m_ui->layout->count() << ", index: " << index; + ERROR_LOG(m_logger) << "count: " << m_ui->layout->count() << ", index: " << index; QGroupBox *attributeGroupBox = qobject_cast(m_ui->layout->itemAt(index++)->widget()); if (!attributeGroupBox) { - ERROR_LOG() << "Could not convert attribute '" << attributeName << "' to QGroupBox"; + ERROR_LOG(m_logger) << "Could not convert attribute '" << attributeName << "' to QGroupBox"; continue; } QVBoxLayout *vbox = qobject_cast(attributeGroupBox->layout()->itemAt(0)->widget()->layout()); if (!vbox) { - ERROR_LOG() << "Could not convert Group Box layout for attribute '" << attributeName << "' to QVBoxLayout"; + ERROR_LOG(m_logger) << "Could not convert Group Box layout for attribute '" << attributeName << "' to QVBoxLayout"; continue; } @@ -91,11 +91,11 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) LtsWidgets::LtsSpinBox *spinBox = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()); if (!spinBox) { - WARNING_LOG() << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; continue; } if (!filter->insertAttributeValue(attributeName, spinBox->value())) - DEBUG_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + DEBUG_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -104,11 +104,11 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) QComboBox *comboBox = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()); if (!comboBox) { - WARNING_LOG() << "Could not convert widget to QComboBox for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to QComboBox for attribute '" << attributeName << "'"; continue; } if (!filter->insertAttributeValue(attributeName, comboBox->currentData().toInt())) - DEBUG_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + DEBUG_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -117,11 +117,11 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) QCheckBox *checkBox = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()); if (!checkBox) { - WARNING_LOG() << "Could not convert widget to QCheckBox for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to QCheckBox for attribute '" << attributeName << "'"; continue; } if (!filter->insertAttributeValue(attributeName, checkBox->isChecked())) - DEBUG_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + DEBUG_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -130,11 +130,11 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) QComboBox *comboBox = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()); if (!comboBox) { - WARNING_LOG() << "Could not convert widget to QComboBox for attribute '" << attributeName << "', , type was " << vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()->metaObject()->className(); + WARNING_LOG(m_logger) << "Could not convert widget to QComboBox for attribute '" << attributeName << "', , type was " << vbox->itemAt(row)->widget()->layout()->itemAt(0)->widget()->metaObject()->className(); continue; } if (!filter->insertAttributeValue(attributeName, comboBox->currentText())) - DEBUG_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + DEBUG_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -143,13 +143,13 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) LtsWidgets::LtsSpinBox *spinBoxMin = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(1)->widget()); if (!spinBoxMin) { - WARNING_LOG() << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; continue; } LtsWidgets::LtsSpinBox *spinBoxMax = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(3)->widget()); if (!spinBoxMax) { - WARNING_LOG() << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to LtsSpinBox for attribute '" << attributeName << "'"; continue; } int minValue = spinBoxMin->value(); @@ -160,7 +160,7 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) maxValue *= 1000; } if (!filter->insertAttributeValue(attributeName, QList({ minValue, maxValue }))) - DEBUG_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + DEBUG_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -174,19 +174,19 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) LtsWidgets::LtsDateTimeEdit *dateTimeEditMin = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(1)->widget()); if (!dateTimeEditMin) { - WARNING_LOG() << "Could not convert widget to LtsDateTimeEdit for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to LtsDateTimeEdit for attribute '" << attributeName << "'"; continue; } LtsWidgets::LtsDateTimeEdit *dateTimeEditMax = qobject_cast(vbox->itemAt(row)->widget()->layout()->itemAt(3)->widget()); if (!dateTimeEditMax) { - WARNING_LOG() << "Could not convert widget to LtsDateTimeEdit for attribute '" << attributeName << "'"; + WARNING_LOG(m_logger) << "Could not convert widget to LtsDateTimeEdit for attribute '" << attributeName << "'"; continue; } if (!filter->insertAttributeValue( attributeName, QList({ dateTimeEditMin->msecsSinceEpoch(), dateTimeEditMax->msecsSinceEpoch() }) )) - WARNING_LOG() << "Inserting value for attribute '" << attributeName << "' failed"; + WARNING_LOG(m_logger) << "Inserting value for attribute '" << attributeName << "' failed"; continue; } @@ -199,8 +199,8 @@ bool FilterEditDialog::applyToFilter(AbstractEventFilter *filter) continue; } } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed for attribute: " << attributeName; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for attribute: " << attributeName; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.h index f94b80005..1876934c4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_edit_dialog.h @@ -24,6 +24,8 @@ public: ~FilterEditDialog(); private: + +NGL::INGLLogger &m_logger; bool applyToFilter(AbstractEventFilter *filter); void retranslate() override; bool apply() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.cpp index 4ad392b6c..cdb20cea8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.cpp @@ -315,7 +315,7 @@ QVariant FilterModel::data(const QModelIndex &index, int role) const } default: - WARNING_LOG() << "eIntCompare for EventType " << eventTypeString(item->eventType()) << " not supported"; + WARNING_LOG(m_logger) << "eIntCompare for EventType " << eventTypeString(item->eventType()) << " not supported"; return {}; } @@ -414,7 +414,7 @@ bool FilterModel::applyFilterStates() if (filter->isActive() != active) { - DEBUG_LOG() <<"applyFilterStates: item()_name:"<name() + DEBUG_LOG(m_logger) <<"applyFilterStates: item()_name:"<name() <<" , item_active:"<isActive() <<" <|||> filter_name:"<type()) <<" , filter_active:"<isActive(); @@ -431,7 +431,7 @@ void FilterModel::toggleFilterState(EventType eventType, bool active) { if (!m_filter.contains(eventType)) { - ERROR_LOG() << "unknown event type = " << eventTypeString(eventType) << " (" << static_cast(eventType) << ")"; + ERROR_LOG(m_logger) << "unknown event type = " << eventTypeString(eventType) << " (" << static_cast(eventType) << ")"; return; } @@ -467,7 +467,7 @@ QByteArray FilterModel::modelToJson() AbstractEventFilter *filterPtr = it.value(); if (!filterPtr) { - ERROR_LOG() << "Filter for event type " << eventTypeString(eventType) << " not available"; + ERROR_LOG(m_logger) << "Filter for event type " << eventTypeString(eventType) << " not available"; continue; } @@ -523,7 +523,7 @@ QByteArray FilterModel::modelToJson() obj[QStringLiteral("id")] = 0; obj[QStringLiteral("XmlType")] = FileManagement::toString(FileManagement::XmlType::TLNTimelineFilter); obj[QStringLiteral("content")] = array; - DEBUG_LOG() << "Saving filter to JSON: " << QJsonDocument(obj).toJson(); + DEBUG_LOG(m_logger) << "Saving filter to JSON: " << QJsonDocument(obj).toJson(); return QJsonDocument(obj).toJson(QJsonDocument::Compact); } @@ -535,7 +535,7 @@ bool FilterModel::jsonToTimelineFilter(const QByteArray &content) if (contentObject.isEmpty()) { - ERROR_LOG() << " JSON file is empty "; + ERROR_LOG(m_logger) << " JSON file is empty "; return false; } @@ -549,7 +549,7 @@ bool FilterModel::jsonToTimelineFilter(const QByteArray &content) if (!filterPtr) { - ERROR_LOG() << "Filter for event type " << eventTypeString(eventType) << " not available"; + ERROR_LOG(m_logger) << "Filter for event type " << eventTypeString(eventType) << " not available"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.h index 56bd9ece7..b524d59ad 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_filter_model.h @@ -58,6 +58,8 @@ public: int row() const { return m_parent ? m_parent->m_children.indexOf(const_cast(this)) : 0; } private: + +NGL::INGLLogger &m_logger; EventType m_eventType; FilterAttribute::Type m_attributeType; QString m_name; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.cpp index d96f9519d..40589d40c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.cpp @@ -42,11 +42,11 @@ ItemInfoDialog::ItemInfoDialog(QWidget *parent) if (this->m_replayAppSession == nullptr || !m_replayAppSession->getForeignGuiInterface(srpIfc)) { - WARNING_LOG() << "missing Replay App. emitting start Situation replay app..."; + WARNING_LOG(m_logger) << "missing Replay App. emitting start Situation replay app..."; emit startSituationReplayApp(); } else { - WARNING_LOG() << "Replay App exist; only start replay"; + WARNING_LOG(m_logger) << "Replay App exist; only start replay"; onStartReplay(); } }); @@ -107,7 +107,7 @@ bool ItemInfoDialog::init(EventItemPtr &&itemPtr, int equipmentNumber, std::shared_ptr sitMapIfc; if (!m_session->getDtc(m_mrkDtc)) - WARNING_LOG() << "!m_session->getDtc(m_mrkDtc)"; + WARNING_LOG(m_logger) << "!m_session->getDtc(m_mrkDtc)"; m_mrkDtc->enableMarker(); @@ -123,15 +123,15 @@ bool ItemInfoDialog::init(EventItemPtr &&itemPtr, int equipmentNumber, m_fltAesIfc = fltAesIfc; m_fltBuildingComponentIfc = fltBuildingComponentIfc; if (m_avmIfc == nullptr) - WARNING_LOG() << "missing AVM-IFC"; + WARNING_LOG(m_logger) << "missing AVM-IFC"; if (m_mrkIfc == nullptr) - WARNING_LOG() << "missing MRK-IFC"; + WARNING_LOG(m_logger) << "missing MRK-IFC"; if (m_fltParticipantIfc == nullptr) - WARNING_LOG() << "missing FLT-Part-IFC"; + WARNING_LOG(m_logger) << "missing FLT-Part-IFC"; if (m_fltAesIfc == nullptr) - WARNING_LOG() << "missing FLT-Aes-IFC"; + WARNING_LOG(m_logger) << "missing FLT-Aes-IFC"; if (m_fltBuildingComponentIfc == nullptr) - WARNING_LOG() << "missing FLT-BuildingComponent-IFC"; + WARNING_LOG(m_logger) << "missing FLT-BuildingComponent-IFC"; enableDisableButtons(srpIfc, sitMapIfc); @@ -284,7 +284,7 @@ bool ItemInfoDialog::getStreamName(QString &streamName, bool silent) const if (_streamName.isEmpty()) { if (!silent) - ERROR_LOG() << "stream name is empty: " << QJsonDocument(m_item->properties()).toJson(); + ERROR_LOG(m_logger) << "stream name is empty: " << QJsonDocument(m_item->properties()).toJson(); return false; } streamName = _streamName; @@ -356,7 +356,7 @@ void ItemInfoDialog::onStartReplay() if (m_replayAppSession == nullptr) { - ERROR_LOG() << "missing Replay App, no replay in TimelineItemInfoDialog"; + ERROR_LOG(m_logger) << "missing Replay App, no replay in TimelineItemInfoDialog"; return; } @@ -365,20 +365,20 @@ void ItemInfoDialog::onStartReplay() if (!m_replayAppSession->getForeignGuiInterface(srpIfc)) { m_ui->pbStartReplay->setToolTip(tr("Situation Replay App not started.")); - ERROR_LOG() << ">>> missing SRP-IFC, no replay in TimelineItemInfoDialog"; + ERROR_LOG(m_logger) << ">>> missing SRP-IFC, no replay in TimelineItemInfoDialog"; return; } std::shared_ptr sitMapIfc; if (!m_replayAppSession->getForeignGuiInterface(sitMapIfc)) { m_ui->pbStartReplay->setToolTip(tr("This app has no map to focus this event on.")); - ERROR_LOG() << ">>> missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 1"; + ERROR_LOG(m_logger) << ">>> missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 1"; return; } if (m_item->type() != EventType::Marker && !m_item->isPositionValid()) { m_ui->pbStartReplay->setToolTip(tr("Event has an invalid position, cannot be focused and therefore has no replay capability.")); - ERROR_LOG() << ">>> Event has an invalid position"; + ERROR_LOG(m_logger) << ">>> Event has an invalid position"; return; } @@ -403,24 +403,24 @@ void ItemInfoDialog::onFocusOnMap() { if (m_replayAppSession == nullptr) { - WARNING_LOG() << "missing Replay App, no focus in TimelineItemInfoDialog"; + WARNING_LOG(m_logger) << "missing Replay App, no focus in TimelineItemInfoDialog"; return; } std::shared_ptr sitMapIfc; if (!m_replayAppSession->getForeignGuiInterface(sitMapIfc)) { - WARNING_LOG() << "missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 1"; + WARNING_LOG(m_logger) << "missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 1"; return; } if (!sitMapIfc) { - WARNING_LOG() << "missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 2"; + WARNING_LOG(m_logger) << "missing SitMap-IFC, no focus on replay in TimelineItemInfoDialog 2"; return; } if (!m_item->isPositionValid() && qFuzzyIsNull(static_cast(m_item->position2D().x())) && qFuzzyIsNull(static_cast(m_item->position2D().y()))) { - WARNING_LOG() << "event has no valid position, skip onFocusOnMap"; + WARNING_LOG(m_logger) << "event has no valid position, skip onFocusOnMap"; return; } @@ -438,11 +438,11 @@ void ItemInfoDialog::onFocusOnMap() MarkerManagement::MarkerManagementApplyFilter applyFilter(m_replayAppSession, m_fltParticipantIfc, m_fltAesIfc, m_fltBuildingComponentIfc); if(!applyFilter.applyMapSettings(mapSettings.toString().toUtf8())) - WARNING_LOG() << "map settings for #" << m_item->id() << " could not be applied"; + WARNING_LOG(m_logger) << "map settings for #" << m_item->id() << " could not be applied"; if (!applyFilter.applyFilter(filterSettings.toObject())) { - WARNING_LOG() << "filters from event #" << m_item->id() << " could not be applied"; + WARNING_LOG(m_logger) << "filters from event #" << m_item->id() << " could not be applied"; return; } } @@ -458,14 +458,14 @@ void ItemInfoDialog::updateMarker(const MarkerManagement::Marker &data, DataModi QJsonObject obj = m_item->properties(); QJsonValue val; - DEBUG_LOG() << "ShowDetailsDialog::updateMarker" + DEBUG_LOG(m_logger) << "ShowDetailsDialog::updateMarker" << " id=" << data.id() << " id Marke=" << m_item->markerDbId() << " note=" << data.note(); for(int i=0 ; i < obj.keys().length() ; i++) { - DEBUG_LOG() << "i=" << i + DEBUG_LOG(m_logger) << "i=" << i << " " << (obj.keys().at(i)) << " value=" << obj[obj.keys().at(i)].toString(); } @@ -475,20 +475,20 @@ void ItemInfoDialog::updateMarker(const MarkerManagement::Marker &data, DataModi val = QJsonValue(str); obj.insert (QStringLiteral("MarkerNote"), QJsonValue(val)); - DEBUG_LOG() << "update MarkerNote:" << str ; - DEBUG_LOG() << " value=" << obj[QStringLiteral("MarkerNote")].toString(); + DEBUG_LOG(m_logger) << "update MarkerNote:" << str ; + DEBUG_LOG(m_logger) << " value=" << obj[QStringLiteral("MarkerNote")].toString(); m_item->setProperties(obj); QString result = QString::fromUtf8(QJsonDocument(m_item->properties()).toJson(QJsonDocument::Indented)); - DEBUG_LOG() << "Result=" << result; + DEBUG_LOG(m_logger) << "Result=" << result; m_ui->pteDetailDataTest->setPlainText(QString::fromUtf8(QJsonDocument(m_item->properties()).toJson(QJsonDocument::Indented))); for ( int i = m_ui->formLayout->rowCount() -1 ; i >=m_formCount; i--) { - DEBUG_LOG() << "remove row i=" << i; + DEBUG_LOG(m_logger) << "remove row i=" << i; m_ui->formLayout->removeRow(i); } m_item->addItemInfoRows(m_ui->formLayout); @@ -503,7 +503,7 @@ void ItemInfoDialog::startSituationPlayback(const QPointersingleShot(2000, this, [this, timer,replayAppSession]() { - WARNING_LOG() << ">>>>>>> initialization of the Replay session app."; + WARNING_LOG(m_logger) << ">>>>>>> initialization of the Replay session app."; std::shared_ptr srpIfc; std::shared_ptr sitMapIfc; initReplayAppSession(replayAppSession, &srpIfc, &sitMapIfc); @@ -526,7 +526,7 @@ void ItemInfoDialog::initReplayAppSession(const QPointer { setButtonDisabled(m_ui->pbFocus, m_ui->tbFocus, tr("No map available.")); m_replayAppSession = nullptr; - WARNING_LOG() << "Session replay app deleted!"; + WARNING_LOG(m_logger) << "Session replay app deleted!"; @@ -534,10 +534,10 @@ void ItemInfoDialog::initReplayAppSession(const QPointer if (!replayAppSession->getForeignGuiInterface(*srpIfc)) - WARNING_LOG() << "missing SRP-IFC, no replay in TimelineItemInfoDialog"; + WARNING_LOG(m_logger) << "missing SRP-IFC, no replay in TimelineItemInfoDialog"; if (!replayAppSession->getForeignGuiInterface(*sitMapIfc)) - WARNING_LOG() << "missing SitMap-IFC, no focusing on replay in TimelineItemInfoDialog"; + WARNING_LOG(m_logger) << "missing SitMap-IFC, no focusing on replay in TimelineItemInfoDialog"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.h index be87eb103..ee73e26a5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_info_dialog.h @@ -51,6 +51,8 @@ public: void retranslate() override; private: + +NGL::INGLLogger &m_logger; void enableDisableButtons( std::shared_ptr srpIfc, std::shared_ptr sitMapIfc ); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.cpp index b2a8d0afb..71176f3b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.cpp @@ -39,7 +39,7 @@ ItemListDialog::ItemListDialog( if (showMarkers) { - ERROR_LOG() << "Show markers"; + ERROR_LOG(m_logger) << "Show markers"; m_ui->ltsDataView->setModel(m_model); } else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.h index 515fb2e8f..716a69482 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_dialog.h @@ -49,6 +49,8 @@ public: ItemListProxyModel *proxyModel() const { return m_proxyModel; } private: + +NGL::INGLLogger &m_logger; void retranslate() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.cpp index 97b3e9a25..094d20b5d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.cpp @@ -86,7 +86,7 @@ void ItemListModel::init(EventItemPtrs &&items) insertRow(itemPtr.get()); if (!m_session->getDtc(m_mrkDtc)) - WARNING_LOG() << "!m_session->getDtc(m_mrkDtc)"; + WARNING_LOG(m_logger) << "!m_session->getDtc(m_mrkDtc)"; m_mrkDtc->enableMarker(); @@ -176,8 +176,8 @@ QVariant ItemListModel::data(const QModelIndex &index, int role) const int partyId = static_cast(m_model->track(item->parentTrackId())).partyId(); return ParticipantManagement::trPartyName(m_ppmDtc->party(partyId).name()); } - catch (const QString &str) { DEBUG_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { DEBUG_LOG() << Q_FUNC_INFO << " failed for item with id = " << item->id(); } + catch (const QString &str) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << item->id(); } return {}; } case Columns::EquipNo: @@ -193,8 +193,8 @@ QVariant ItemListModel::data(const QModelIndex &index, int role) const return {}; return equipmentNumber; } - catch (const QString &str) { DEBUG_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { DEBUG_LOG() << Q_FUNC_INFO << " failed for item with id = " << item->id(); } + catch (const QString &str) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << item->id(); } return {}; } case Columns::Hierarchy: @@ -208,8 +208,8 @@ QVariant ItemListModel::data(const QModelIndex &index, int role) const int participantId = static_cast(m_model->track(item->parentTrackId())).participantId(); return m_ppmDtc->hierarchyFromParticipant(participantId); } - catch (const QString &str) { DEBUG_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { DEBUG_LOG() << Q_FUNC_INFO << " failed for item with id = " << item->id(); } + catch (const QString &str) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << item->id(); } return {}; } case Columns::ParticipantId: @@ -222,8 +222,8 @@ QVariant ItemListModel::data(const QModelIndex &index, int role) const { return static_cast(m_model->track(item->parentTrackId())).participantId(); } - catch (const QString &str) { DEBUG_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { DEBUG_LOG() << Q_FUNC_INFO << " failed for item with id = " << item->id(); } + catch (const QString &str) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { DEBUG_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << item->id(); } return {}; } case Columns::AesType: @@ -410,12 +410,12 @@ QVariant ItemListModel::data(const QModelIndex &index, int role) const void ItemListModel::updateMarker(const MarkerManagement::Marker &data, DataModification modType) { - DEBUG_LOG() << "ShowDetailsDialog::updateMarker" + DEBUG_LOG(m_logger) << "ShowDetailsDialog::updateMarker" << " id=" << data.id() << " note=" << data.note(); for (EventItemPtr &itemPtr : m_items) { - DEBUG_LOG() << "id=" << itemPtr.get()->id() + DEBUG_LOG(m_logger) << "id=" << itemPtr.get()->id() << " dbId=" << itemPtr.get()->markerDbId(); if ( itemPtr.get()->markerDbId() == data.id()) { @@ -426,7 +426,7 @@ void ItemListModel::updateMarker(const MarkerManagement::Marker &data, DataModif properties.insert (QStringLiteral("MarkerNote"), QJsonValue(val)); itemPtr->setProperties(properties); - DEBUG_LOG() << "Update Marker"; + DEBUG_LOG(m_logger) << "Update Marker"; clear(); for (EventItemPtr &itemPtr : m_items) insertRow(itemPtr.get()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.h index 9a032406c..349f68e1c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_item_list_model.h @@ -86,6 +86,8 @@ private slots: void updateMarker(const MarkerManagement::Marker &data, DataModification modType); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_ppmDtc; std::shared_ptr m_pdmDtc; std::shared_ptr m_ismDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_legend.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_legend.h index 64e0f95e3..3d7769383 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_legend.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_legend.h @@ -29,6 +29,8 @@ public: ~TimelineLegend(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.cpp index 56beb85df..a5aa21277 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.cpp @@ -90,7 +90,7 @@ TimelineDialog::TimelineDialog( , m_liveTimer(new QTimer(this)) , m_ui(new Ui::TimelineDialog) { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; setOnlineHelpFilename(QStringLiteral("Timeline-Application")); m_ui->setupUi(this); @@ -182,44 +182,44 @@ TimelineDialog::TimelineDialog( if (!static_cast(m_model->filter(EventType::CameraVideo))->init(m_avmDtc, m_ismDtc, m_avmDataIfc, m_avmIfc, exc.id())) - WARNING_LOG() << "initializing CameraVideoFilter failed"; + WARNING_LOG(m_logger) << "initializing CameraVideoFilter failed"; if (!static_cast(m_model->filter(EventType::FireEvent))->init(m_pdmDtc)) - WARNING_LOG() << "initializing FireEventFilter failed"; + WARNING_LOG(m_logger) << "initializing FireEventFilter failed"; if (!static_cast(m_model->filter(EventType::Hit))->init(m_session, m_pdmDtc, m_ppmDtc)) - WARNING_LOG() << "initializing HitFilter failed"; + WARNING_LOG(m_logger) << "initializing HitFilter failed"; if (!static_cast(m_model->filter(EventType::HitBuilding))->init(m_session, m_ismDtc, m_pdmDtc, m_ppmDtc)) - WARNING_LOG() << "initializing HitBuildingFilter failed"; + WARNING_LOG(m_logger) << "initializing HitBuildingFilter failed"; if (!static_cast(m_model->filter(EventType::HitEffectSimulation))->init(m_pdmDtc)) - WARNING_LOG() <<"initializing HitEffectSimulationFilter failed"; + WARNING_LOG(m_logger) <<"initializing HitEffectSimulationFilter failed"; if (!static_cast(m_model->filter(EventType::Marker))->init(m_opmDtc)) - WARNING_LOG() << "initializing MarkerFilter failed"; + WARNING_LOG(m_logger) << "initializing MarkerFilter failed"; if (!static_cast(m_model->filter(EventType::RadioCnr))->init(m_avmDtc, exc.id(), m_model)) - WARNING_LOG() << "initializing RadioCnrFilter failed"; + WARNING_LOG(m_logger) << "initializing RadioCnrFilter failed"; if (!static_cast(m_model->filter(EventType::RadioTvc))->init(m_avmDtc, exc.id(), m_model)) - WARNING_LOG() << "initializing RadioTvcFilter failed"; + WARNING_LOG(m_logger) << "initializing RadioTvcFilter failed"; if (!static_cast(m_model->filter(EventType::WeaponAssignment))->init(m_pdmDtc)) - WARNING_LOG() << "initializing WeaponAssignmentFilter failed"; + WARNING_LOG(m_logger) << "initializing WeaponAssignmentFilter failed"; if (!static_cast(m_model->tempFilter(EventType::CameraVideo))->init(m_avmDtc, m_ismDtc, m_avmDataIfc, m_avmIfc, exc.id())) - WARNING_LOG() << "initializing CameraVideoFilter failed"; + WARNING_LOG(m_logger) << "initializing CameraVideoFilter failed"; if (!static_cast(m_model->tempFilter(EventType::FireEvent))->init(m_pdmDtc)) - WARNING_LOG() << "initializing FireEventFilter failed"; + WARNING_LOG(m_logger) << "initializing FireEventFilter failed"; if (!static_cast(m_model->tempFilter(EventType::Hit))->init(m_session, m_pdmDtc, m_ppmDtc)) - WARNING_LOG() << "initializing HitFilter failed"; + WARNING_LOG(m_logger) << "initializing HitFilter failed"; if (!static_cast(m_model->tempFilter(EventType::HitBuilding))->init(m_session, m_ismDtc, m_pdmDtc, m_ppmDtc)) - WARNING_LOG() << "initializing HitBuildingFilter failed"; + WARNING_LOG(m_logger) << "initializing HitBuildingFilter failed"; if (!static_cast(m_model->tempFilter(EventType::HitEffectSimulation))->init(m_pdmDtc)) - WARNING_LOG() <<"initializing HitEffectSimulationFilter failed"; + WARNING_LOG(m_logger) <<"initializing HitEffectSimulationFilter failed"; if (!static_cast(m_model->tempFilter(EventType::Marker))->init(m_opmDtc)) - WARNING_LOG() << "initializing MarkerFilter failed"; + WARNING_LOG(m_logger) << "initializing MarkerFilter failed"; if (!static_cast(m_model->tempFilter(EventType::RadioCnr))->init(m_avmDtc, exc.id(), m_model)) - WARNING_LOG() << "initializing RadioCnrFilter failed"; + WARNING_LOG(m_logger) << "initializing RadioCnrFilter failed"; if (!static_cast(m_model->tempFilter(EventType::RadioTvc))->init(m_avmDtc, exc.id(), m_model)) - WARNING_LOG() << "initializing RadioTvcFilter failed"; + WARNING_LOG(m_logger) << "initializing RadioTvcFilter failed"; if (!static_cast(m_model->tempFilter(EventType::WeaponAssignment))->init(m_pdmDtc)) - WARNING_LOG() << "initializing WeaponAssignmentFilter failed"; + WARNING_LOG(m_logger) << "initializing WeaponAssignmentFilter failed"; view->setItemDelegate(new TimelineDelegate(view)); @@ -361,7 +361,7 @@ TimelineDialog::TimelineDialog( hideProgress(); setLive(false); - INFO_LOG() << Q_FUNC_INFO << " FINISH"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " FINISH"; } @@ -607,8 +607,8 @@ void TimelineDialog::openItemInfoDialog(AbstractEventItem &item, bool scrollToPo equipmentNumber = participantItem.isEquipmentNumberSet() ? participantItem.equipmentNumber() : dynamic_cast(m_model->track(item.parentTrackId())).equipmentNumber(); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " obtaining equipment number failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " obtaining equipment number failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " obtaining equipment number failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " obtaining equipment number failed"; } } if (scrollToPosition) @@ -634,11 +634,11 @@ void TimelineDialog::openItemInfoDialog(AbstractEventItem &item, bool scrollToPo else uIdString = QString::fromUtf8(QCryptographicHash::hash(QJsonDocument(item.properties()).toJson(), QCryptographicHash::Md5).toHex()); - ERROR_LOG() << "uIdString = " << uIdString; + ERROR_LOG(m_logger) << "uIdString = " << uIdString; addDialog(dialog, m_menuGroup, QStringLiteral("ItemInfoDialog_%1").arg(uIdString), LtsWidgets::LayoutArea::eInfoTab); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " failed for type "<<(int)eventType<<": " << str; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for type "<<(int)eventType<<": " << str; } } @@ -654,12 +654,12 @@ void TimelineDialog::openItemListDialog(const QVector &itemIds) if (item.type() == EventType::Block) { - WARNING_LOG() << "openItemListDialog does not handle block items"; + WARNING_LOG(m_logger) << "openItemListDialog does not handle block items"; continue; } items.push_back(m_model->eventFactory(item.type())->copyItem(item)); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } } if (!items.empty()) openItemListDialog(std::move(items)); @@ -680,8 +680,8 @@ void TimelineDialog::openItemListDialog(EventItemPtrs &&items) }); addDialog(dialog, m_menuGroup, {}, LtsWidgets::LayoutArea::eDialogTab); } - catch (const QString &str) { ERROR_LOG() << Q_FUNC_INFO << " " << str; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed"; } + catch (const QString &str) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed"; } } void TimelineDialog::setZoomForDuration(const qint64 &durationInMSecs) @@ -753,7 +753,7 @@ void TimelineDialog::onStartReplay() } catch (...) { - ERROR_LOG() << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() + ERROR_LOG(m_logger) << "[timeout] Failed to remove failed-to-start replay. domainId: " << m_session->domainId() << " - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); } @@ -763,7 +763,7 @@ void TimelineDialog::onStartReplay() if (!found) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error trying to create a replay session")); - WARNING_LOG() << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() + WARNING_LOG(m_logger) << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() << " - replay partition does not exist - replay id: " << replayId << " - url " << m_session->tcpConnectionUrl().toString(); rmPartFn(); @@ -776,7 +776,7 @@ void TimelineDialog::onStartReplay() if (m_replayApp == nullptr) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error trying to create a replay session")); - WARNING_LOG() << "Error while trying to create a replay session: domainId: " << m_session->domainId() << + WARNING_LOG(m_logger) << "Error while trying to create a replay session: domainId: " << m_session->domainId() << " - partition create reply (failed) - replay id: " << replayId << " - url: " << m_session->tcpConnectionUrl().toString(); rmPartFn(); @@ -798,7 +798,7 @@ void TimelineDialog::onStartReplay() auto fn = [this, replayAppSession]() { m_replayAppSession = replayAppSession; - WARNING_LOG() << "New Situation replay App started"; + WARNING_LOG(m_logger) << "New Situation replay App started"; emit situtionReplayAppStarted(m_replayAppSession); }; @@ -919,7 +919,7 @@ void TimelineDialog::onEditFilter(EventType eventType) LtsWidgets::LtsDateTimeEdit *dteEnd = qobject_cast(hbox->itemAt(3)->widget()); if (!dteStart || !dteEnd) { - ERROR_LOG() << "could not convert widgets to LtsDateTimeEdit for range start and end"; + ERROR_LOG(m_logger) << "could not convert widgets to LtsDateTimeEdit for range start and end"; return; } dteStart->setMsecsSinceEpoch(m_ui->timeline->view()->startTime()); @@ -931,14 +931,14 @@ void TimelineDialog::onEditFilter(EventType eventType) void TimelineDialog::onShowItemsForAllFilters() { - DEBUG_LOG() << "onShowItemsForAllFilters"; + DEBUG_LOG(m_logger) << "onShowItemsForAllFilters"; EventTypes eventTypes; eventTypes.reserve(m_model->filters().size()); for (auto it = m_model->filters().constBegin(); it != m_model->filters().constEnd(); ++it) { if (it.value()->isActive()) { - DEBUG_LOG() << "onShowItemsForAllFilters: add active event type = " << it.key(); + DEBUG_LOG(m_logger) << "onShowItemsForAllFilters: add active event type = " << it.key(); eventTypes.append(it.key()); } } @@ -947,7 +947,7 @@ void TimelineDialog::onShowItemsForAllFilters() void TimelineDialog::onShowItemsForEventWithUnsavedFilters(EventType eventType) { - DEBUG_LOG() << __FUNCTION__; + DEBUG_LOG(m_logger) << __FUNCTION__; std::unique_ptr filter(m_model->eventFactories().value(eventType)->filter()); showItemListDialogByFilter(QVector() << filter.get()); } @@ -971,25 +971,25 @@ void TimelineDialog::showItemListDialogByFilter(const QVectordone(); } void TimelineDialog::onShowItemsForEvents(EventTypes eventTypes) { - DEBUG_LOG() << "onShowItemsForFilters: " << eventTypes.size(); + DEBUG_LOG(m_logger) << "onShowItemsForFilters: " << eventTypes.size(); QVector filters; filters.reserve(eventTypes.size()); for (EventType eventType : std::as_const(eventTypes)) { - DEBUG_LOG() << "onShowItemsForFilters: EventType = " << QString::number(eventType); + DEBUG_LOG(m_logger) << "onShowItemsForFilters: EventType = " << QString::number(eventType); if (m_model->filters().contains(eventType)) { - DEBUG_LOG() << "onShowItemsForFilters: Add EventType = " << QString::number(eventType); + DEBUG_LOG(m_logger) << "onShowItemsForFilters: Add EventType = " << QString::number(eventType); filters.append(m_model->filter(eventType)); } } @@ -1025,7 +1025,7 @@ void TimelineDialog::onOpenItemInfoDialog(int itemId) { openItemInfoDialog(static_cast(m_model->item(itemId)), signalFromFilterEditDialog); } - catch (const QString &str) { ERROR_LOG() << str; } + catch (const QString &str) { ERROR_LOG(m_logger) << str; } } void TimelineDialog::onTrackActivated(int trackId) @@ -1088,7 +1088,7 @@ void TimelineDialog::addItemToMap(int itemId, QMap &map) noexcept( map.insert(hashHex, itemId); } - catch (const QString &msg) { ERROR_LOG() << "cannot find item for item id" << itemId << ": " << msg; } + catch (const QString &msg) { ERROR_LOG(m_logger) << "cannot find item for item id" << itemId << ": " << msg; } } @@ -1129,7 +1129,7 @@ void TimelineDialog::onItemsSelected(const QVector &itemIds) { openItemInfoDialog(static_cast(m_model->item(uniqueItems.first()))); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } return; @@ -1191,7 +1191,7 @@ void TimelineDialog::onItemsSelected(const QVector &itemIds) catch (...) { return; } } } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << itemId << ": " << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << itemId << ": " << errMsg; } } @@ -1212,7 +1212,7 @@ void TimelineDialog::onItemsSelected(const QVector &itemIds) const AbstractEventItem &item = static_cast(m_model->item(itemId)); items.push_back(m_model->eventFactory(item.type())->copyItem(item)); } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed for x item with id = " << itemId << ": " << errMsg; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for x item with id = " << itemId << ": " << errMsg; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.h index 6c4b67379..6c10004dc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_dialog.h @@ -82,6 +82,8 @@ public: LtsTimeline::TimelineView *view(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void aboutToClose() override; void resizeEvent(QResizeEvent *event) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.cpp index ff388722a..4c43213e4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.cpp @@ -190,13 +190,13 @@ TimelineModel::TimelineModel(LtsSession::LtsSession *session, TimelineDialog *di m_db = DBConnection::open(m_logger, dbUser, dbPasswd, driver, hostname, dbname); delete s; - DEBUG_LOG() << "s->databaseDriver() " << driver << ", s->databaseName() " << dbname; + DEBUG_LOG(m_logger) << "s->databaseDriver() " << driver << ", s->databaseName() " << dbname; - DEBUG_LOG() << "Trying to open database " << hostname << ":" << dbname; + DEBUG_LOG(m_logger) << "Trying to open database " << hostname << ":" << dbname; if (!m_db.isOpen()) { - ERROR_LOG() << "Error opening database " << hostname << ":" << dbname << " - " << m_db.lastError().text(); + ERROR_LOG(m_logger) << "Error opening database " << hostname << ":" << dbname << " - " << m_db.lastError().text(); throw "cannot open connection to database"; } else @@ -372,10 +372,10 @@ void TimelineModel::clearUnusedTempTables() if (!tableName.startsWith(QStringLiteral("tln_temp_view_"))) throw QStringLiteral("tried to drop a table that isn't a timeline temp view! '%1'").arg(tableName); executeQuery(QStringLiteral("DROP TABLE %1").arg(tableName)); - } catch(const QString &msg) { ERROR_LOG() << "cannot remove stale temp table '" << tableName << "': " << msg; } + } catch(const QString &msg) { ERROR_LOG(m_logger) << "cannot remove stale temp table '" << tableName << "': " << msg; } } } - catch(const QString &msg) { ERROR_LOG() << "cannot remove stale temp tables: " << msg; } + catch(const QString &msg) { ERROR_LOG(m_logger) << "cannot remove stale temp tables: " << msg; } } @@ -400,14 +400,14 @@ void TimelineModel::getParticipantTracks() for (ParticipantManagement::Party party : m_ppmDtc->partys()) { - DEBUG_LOG() << "party id: " << party.id() << ", name: " << party.name(); + DEBUG_LOG(m_logger) << "party id: " << party.id() << ", name: " << party.name(); try { m_modelState.partys.insert(party.id(), Party(party.id(), addTrack(rootTrack().id(), PartyTrack(ParticipantManagement::trPartyName(party.name()), party.id())))); } catch (const QString &msg) { - ERROR_LOG() << "getParticipantTracks: cannot add party track: " << msg; + ERROR_LOG(m_logger) << "getParticipantTracks: cannot add party track: " << msg; continue; } } @@ -425,7 +425,7 @@ void TimelineModel::getParticipantTracks() int equipmentNumber = participant.equipmentNumber().is_set() ? participant.equipmentNumber().get() : 0; if (QString::fromStdString(participant.designator()).contains(QStringLiteral("Ausb"))) - DEBUG_LOG() << "FOUND Ausb! " << participant.id(); + DEBUG_LOG(m_logger) << "FOUND Ausb! " << participant.id(); QVector inferiorIds; std::transform(participant.inferiorIds().cbegin(), participant.inferiorIds().cend(), std::back_inserter(inferiorIds), @@ -442,7 +442,7 @@ void TimelineModel::getParticipantTracks() QStringList infs; std::transform(participant.inferiorIds().cbegin(), participant.inferiorIds().cend(), std::back_inserter(infs), [](int32_t id) { return QString::number(id); }); - DEBUG_LOG() << "sup " << participant.id() << " has infs: " << infs.join(QStringLiteral(", ")); + DEBUG_LOG(m_logger) << "sup " << participant.id() << " has infs: " << infs.join(QStringLiteral(", ")); superiorIds += participant.id(); } }; @@ -456,7 +456,7 @@ void TimelineModel::getParticipantTracks() if (it == m_modelState.partys.constEnd()) { - WARNING_LOG() << "participant with id " << superior.participantId << " has non-existant party id " << superior.partyId; + WARNING_LOG(m_logger) << "participant with id " << superior.participantId << " has non-existant party id " << superior.partyId; continue; } @@ -550,7 +550,7 @@ void TimelineModel::onMarkerChanged(const MarkerManagement::Marker &marker, Data } catch (const QString &errMsg) { - ERROR_LOG() << "Marker " << marker.id() << " has invalid properties: " << errMsg; + ERROR_LOG(m_logger) << "Marker " << marker.id() << " has invalid properties: " << errMsg; } @@ -579,7 +579,7 @@ void TimelineModel::onMarkerChanged(const MarkerManagement::Marker &marker, Data } catch (const QString &msg) { - ERROR_LOG() << "cannot add/modify ("<<(int)mod<<") marker with id "<(i).setProperties(properties); @@ -633,21 +633,21 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) try { Item &i = item(id); - DEBUG_LOG() << "item already exists"; + DEBUG_LOG(m_logger) << "item already exists"; updateItem(i, track(i.parentTrackId())); } catch (const QString &msg) { - DEBUG_LOG() << "update failed for item with id " << id << "!! " << msg; + DEBUG_LOG(m_logger) << "update failed for item with id " << id << "!! " << msg; } } - ERROR_LOG() << "done"; + ERROR_LOG(m_logger) << "done"; return; } catch (const QString &msg) { - DEBUG_LOG() << "!!!!! " << msg; + DEBUG_LOG(m_logger) << "!!!!! " << msg; bool foundAtLeastOne = false; QVector ids; @@ -671,7 +671,7 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) if (ei2.dbId() == eemEvent.id()) { updateItem(ei2, track(bi.parentTrackId())); - DEBUG_LOG() << "done2"; + DEBUG_LOG(m_logger) << "done2"; found = true; foundAtLeastOne = true; break; @@ -707,7 +707,7 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) catch (...) { - DEBUG_LOG() << "not found anymore"; + DEBUG_LOG(m_logger) << "not found anymore"; } } @@ -718,7 +718,7 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) qint64 start = eemEvent.sampleTime(); - DEBUG_LOG() << "start = " << start; + DEBUG_LOG(m_logger) << "start = " << start; EventType eventType = static_cast(static_cast(eemEvent.eventTypeId().underlying())); @@ -738,13 +738,13 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) if (!eventFilter->check(*eventItem.get())) { - ERROR_LOG() << "event does not comply with filter"; + ERROR_LOG(m_logger) << "event does not comply with filter"; return; } } catch (const QString &errMsg) { - ERROR_LOG() << "failed to add live event: " << errMsg; + ERROR_LOG(m_logger) << "failed to add live event: " << errMsg; return; } @@ -773,8 +773,8 @@ void TimelineModel::onLiveEvent(const ExerciseEventManagement::Event &eemEvent) } } - catch (const QString &errMsg) { ERROR_LOG() << Q_FUNC_INFO << " failed: " << errMsg; } - catch (...) { ERROR_LOG() << Q_FUNC_INFO << " failed: "; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed: "; } } void TimelineModel::onStreamListReceived(const QMap &streamList) @@ -834,11 +834,11 @@ bool TimelineModel::isBlockItem(int itemId) const } catch (const QString &str) { - ERROR_LOG() << Q_FUNC_INFO << " " << str; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " " << str; } catch (...) { - ERROR_LOG() << Q_FUNC_INFO << " failed for item with id = " << itemId; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " failed for item with id = " << itemId; } return false; } @@ -863,7 +863,7 @@ std::vector TimelineModel::getEventsByFilter(const QVectortype(); + DEBUG_LOG(m_logger) << "getEventsByFilter: " << filter->type(); eventTypes.append(QString::number(filter->type())); @@ -883,7 +883,7 @@ std::vector TimelineModel::getEventsByFilter(const QVector TimelineModel::getEventsByFilter(const QVector> rows: " << q.size() << "\n" << ">> query: " << query.toStdString().c_str() << "\n" << "\n"; @@ -1030,7 +1030,7 @@ QVector TimelineModel::executeQuery(const QString &query, const QS if (!res) { - ERROR_LOG() << (ignoreError ? "[ ]" : "[!]") << " query failed! query: '" << q.executedQuery() << "' - error: '" << q.lastError().text() << "'"; + ERROR_LOG(m_logger) << (ignoreError ? "[ ]" : "[!]") << " query failed! query: '" << q.executedQuery() << "' - error: '" << q.lastError().text() << "'"; if (!ignoreError) throw QStringLiteral("executeQuery: query failed: %1 - query was: '%2' ('%3')").arg(q.lastError().text(), q.executedQuery(), query); @@ -1138,7 +1138,7 @@ void TimelineModel::backwardsChannelSumEvents(const Track &t) } catch (const QString &msg) { - ERROR_LOG() << "dataChanged failed: " << msg; + ERROR_LOG(m_logger) << "dataChanged failed: " << msg; } } @@ -1168,7 +1168,7 @@ void TimelineModel::sumEvents(LtsTimeline::Track &track) auto it = m_itemCache.find(id); if (it == m_itemCache.end()) { - ERROR_LOG() << "cannot erase item ("<(toEventType(eventTypeId))); if (eventFactoryIt == m_eventFactories.end()) { - ERROR_LOG() << "event factory for event type id " << eventTypeId << " not found!"; + ERROR_LOG(m_logger) << "event factory for event type id " << eventTypeId << " not found!"; throw QStringLiteral("createItemFromRow: cannot create item because the event factory is missing for type id %1").arg(eventTypeId); } LtsUtils::QPoint3D position(posX, posY, posZ); @@ -1297,7 +1297,7 @@ std::vector TimelineModel::createItemsFromRows(const Rows &rows) } catch (const QString &msg) { - ERROR_LOG() << "cannot create item: " << msg; + ERROR_LOG(m_logger) << "cannot create item: " << msg; } } return ret; @@ -1364,7 +1364,7 @@ QJsonObject TimelineModel::eventPropertiesFromMarker(const MarkerManagement::Mar } default: { - WARNING_LOG() << "Marker " << marker.id() << "'s description has an invalid marker type: " << (int)md.markerType().underlying(); + WARNING_LOG(m_logger) << "Marker " << marker.id() << "'s description has an invalid marker type: " << (int)md.markerType().underlying(); break; } } @@ -1426,7 +1426,7 @@ std::vector TimelineModel::getMarkerItems(const Filters &filters, } catch (const QString &errMsg) { - ERROR_LOG() << "Marker " << data.id() << " has invalid properties: " << errMsg; + ERROR_LOG(m_logger) << "Marker " << data.id() << " has invalid properties: " << errMsg; } @@ -1515,7 +1515,7 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) } else { - DEBUG_LOG() << "finding track for camera video event wijth msei " << msei << " and stream name '" << streamName << "' ..."; + DEBUG_LOG(m_logger) << "finding track for camera video event wijth msei " << msei << " and stream name '" << streamName << "' ..."; @@ -1544,7 +1544,7 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) beginInsertRows(idx, rowCount, rowCount); trackId = addTrack(m_outdoorCameraRootTrackId, OutdoorCameraTrack(streamName)); m_outdoorCameraTracks.insert(streamName, trackId); - ERROR_LOG() << "outdoor camera stream track not found, created new track"; + ERROR_LOG(m_logger) << "outdoor camera stream track not found, created new track"; } } else @@ -1554,7 +1554,7 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) try { trackId = constFinder(m_buildingStreamsTracks, QPair(msei, streamName)); - ERROR_LOG() << "track id for camera video event with msei " << msei << " and stream name '" << streamName << "' found by internal name!!"; + ERROR_LOG(m_logger) << "track id for camera video event with msei " << msei << " and stream name '" << streamName << "' found by internal name!!"; } catch (...) { @@ -1563,7 +1563,7 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) try { trackId = constFinder(m_videoTracks, streamName); - ERROR_LOG() << "track id for camera video event wijth msei " << msei << " and stream name '" << streamName << "' found by display name!!"; + ERROR_LOG(m_logger) << "track id for camera video event wijth msei " << msei << " and stream name '" << streamName << "' found by display name!!"; } catch (...) { @@ -1582,13 +1582,13 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) trackId = addTrack(m_videosRootTrackId, VideoTrack(streamName)); m_videoTracks.insert(streamName, trackId); - ERROR_LOG() << "track not found, created new track"; + ERROR_LOG(m_logger) << "track not found, created new track"; } } } } - ERROR_LOG() << "track id for camera video event with msei " << msei << " and stream name '" << streamName << "' ... is " << trackId; + ERROR_LOG(m_logger) << "track id for camera video event with msei " << msei << " and stream name '" << streamName << "' ... is " << trackId; } else if (eventType == EventType::RadioCnr) { @@ -1608,7 +1608,7 @@ int TimelineModel::findTrack(const AbstractEventItem &_eventItem) } catch (const QString &msg) { - ERROR_LOG() << "cannot find cnr track for stream '"<waitForHistoricalDataMarker(5000); std::vector markerItems = getMarkerItems(m_filter.values().toVector(), false, -1); - ERROR_LOG() << "markers: " << markerItems.size(); + ERROR_LOG(m_logger) << "markers: " << markerItems.size(); for (EventItemPtr &ptr : markerItems) { @@ -1972,7 +1972,7 @@ void TimelineModel::getMarkers() noexcept(false) } catch (const QString &msg) { - ERROR_LOG() << "cannot add marker with db id "< id: " << config.id() << ", circuit: " << QString::fromStdString(config.radioCircuit()) + DEBUG_LOG(m_logger) << "!!!!!!!!!! config => id: " << config.id() << ", circuit: " << QString::fromStdString(config.radioCircuit()) << ", channelId: " << config.cnrChannelId(); } } @@ -2149,11 +2149,11 @@ void TimelineModel::getRadioTracks() } catch (const QString &msg) { - ERROR_LOG() << "display name for cnr channel '"< id: " << channelId << ", name: " << internalChannelName << ", display name: " << displayName; + DEBUG_LOG(m_logger) << "!!!!!!!!!! channel => id: " << channelId << ", name: " << internalChannelName << ", display name: " << displayName; m_cnrStreams.insert(channelId, displayName); try @@ -2162,7 +2162,7 @@ void TimelineModel::getRadioTracks() } catch (const QString &msg) { - ERROR_LOG() << "cannot add cnr channel '"< id: " << config.id() << ", circuit: " << QString::fromStdString(config.radioCircuit()) + DEBUG_LOG(m_logger) << "!!!!!!!!!! TETRA config => id: " << config.id() << ", circuit: " << QString::fromStdString(config.radioCircuit()) << ", channelId: " << config.tetraChannelId(); } } @@ -2198,11 +2198,11 @@ void TimelineModel::getRadioTracks() } catch (const QString &msg) { - ERROR_LOG() << "display name for tvc channel '"< id: " << channelId << ", name: " << internalChannelName << ", display name: " << displayName; + DEBUG_LOG(m_logger) << "!!!!!!!!!! channel => id: " << channelId << ", name: " << internalChannelName << ", display name: " << displayName; m_tvcStreams.insert(channelId, displayName); try @@ -2211,7 +2211,7 @@ void TimelineModel::getRadioTracks() } catch (const QString &msg) { - ERROR_LOG() << "cannot add tvc channel '"<>>>>>>>>> open sql connections: " << QSqlDatabase::connectionNames().count() << ": " << QSqlDatabase::connectionNames().join(QStringLiteral(", ")); + DEBUG_LOG(m_logger) << ">>>>>>>>>> open sql connections: " << QSqlDatabase::connectionNames().count() << ": " << QSqlDatabase::connectionNames().join(QStringLiteral(", ")); emit updateStatusChanged(true); @@ -2357,7 +2357,7 @@ void TimelineModel::update(bool fake) + TimelineDelegate::s_zeroDurationItemWidth; m_zeroDurationItemWidthTime = m_view->toTime(x) - m_view->currentTime(); - DEBUG_LOG() << "m_zeroDurationItemWidthTime = " << m_zeroDurationItemWidthTime; + DEBUG_LOG(m_logger) << "m_zeroDurationItemWidthTime = " << m_zeroDurationItemWidthTime; @@ -2419,7 +2419,7 @@ void TimelineModel::update(bool fake) { executeQuery(QStringLiteral("DROP TABLE IF EXISTS temp_range_%1").arg(m_modelState.dbUuid), true); } - catch (const QString &errMsg) { ERROR_LOG() << "drop TempRangeTable failed: " << errMsg; return; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "drop TempRangeTable failed: " << errMsg; return; } @@ -2436,7 +2436,7 @@ void TimelineModel::update(bool fake) .arg(m_view->endTime()) ); } - catch (const QString &errMsg) { ERROR_LOG() << "create TempRangeTable failed: " << errMsg; return; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "create TempRangeTable failed: " << errMsg; return; } m_modelState.tempRangeStart = m_view->startTime(); m_modelState.tempRangeEnd = m_view->endTime(); @@ -2446,7 +2446,7 @@ void TimelineModel::update(bool fake) { executeQuery(QStringLiteral("DROP TABLE IF EXISTS %1").arg(m_modelState.publicTableName), true); } - catch (const QString &errMsg) { ERROR_LOG() << "drop TempViewTable failed: " << errMsg; return; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "drop TempViewTable failed: " << errMsg; return; } try { @@ -2462,7 +2462,7 @@ void TimelineModel::update(bool fake) .arg(m_view->currentTime() + m_view->zoomFactor()) ); } - catch (const QString &errMsg) { ERROR_LOG() << "create TempViewTable failed: " << errMsg; return; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "create TempViewTable failed: " << errMsg; return; } try @@ -2474,13 +2474,13 @@ void TimelineModel::update(bool fake) count = getInt(rows.first(), QStringLiteral("count")); } - catch (const QString &errMsg) { ERROR_LOG() << "countTempView" << errMsg; return; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "countTempView" << errMsg; return; } - DEBUG_LOG() << "number of events in range = " << count; + DEBUG_LOG(m_logger) << "number of events in range = " << count; if (count == 0) { - WARNING_LOG() << "no events in selected range: " << QDateTime::fromMSecsSinceEpoch(m_modelState.tempRangeStart).toString() << " - " << QDateTime::fromMSecsSinceEpoch(m_modelState.tempRangeEnd).toString(); + WARNING_LOG(m_logger) << "no events in selected range: " << QDateTime::fromMSecsSinceEpoch(m_modelState.tempRangeStart).toString() << " - " << QDateTime::fromMSecsSinceEpoch(m_modelState.tempRangeEnd).toString(); m_modelState.knownStart = start; m_modelState.knownEnd = end; @@ -2490,7 +2490,7 @@ void TimelineModel::update(bool fake) if (count > 750000) { - ERROR_LOG() << "more than 750.000 events requested - aborted"; + ERROR_LOG(m_logger) << "more than 750.000 events requested - aborted"; emit errorCountExceeded(); return; } @@ -2530,7 +2530,7 @@ void TimelineModel::update(bool fake) EventItemPtrs eventItemPtrs = createItemsFromRows(*m_sharedThing[i]); - DEBUG_LOG() << "create took " << t.elapsed() << "ms"; + DEBUG_LOG(m_logger) << "create took " << t.elapsed() << "ms"; m_sharedThing[i]->clear(); @@ -2538,7 +2538,7 @@ void TimelineModel::update(bool fake) t.start(); insertItems(eventItemPtrs); - DEBUG_LOG() << "insert took " << t.elapsed() << "ms"; + DEBUG_LOG(m_logger) << "insert took " << t.elapsed() << "ms"; m_isCurrentlyUpdating = false; emit dataChanged({}, {}); @@ -2595,7 +2595,7 @@ void TimelineModel::update(bool fake) (*m_lockyMcLockLock) = threads; - DEBUG_LOG() << "threads = " << threads << ", main thread id = " << QThread::currentThreadId(); + DEBUG_LOG(m_logger) << "threads = " << threads << ", main thread id = " << QThread::currentThreadId(); for (int i = 0; i < threads; ++i) { QString stmt(QStringLiteral("SELECT * FROM %1 LIMIT %2 OFFSET %3") @@ -2618,7 +2618,7 @@ void TimelineModel::update(bool fake) QSqlDatabase db(QSqlDatabase::cloneDatabase(m_db, connectionName)); if (!db.open()) { - ERROR_LOG() << "thread " << (qintptr)QThread::currentThreadId() << " cannot connect to db: " << db.lastError().text() + ERROR_LOG(m_logger) << "thread " << (qintptr)QThread::currentThreadId() << " cannot connect to db: " << db.lastError().text() << " connectionName=" << connectionName; return; } @@ -2641,7 +2641,7 @@ void TimelineModel::update(bool fake) } catch (const QString &msg) { - ERROR_LOG() << "thread " << QThread::currentThreadId() << " failed: " << msg; + ERROR_LOG(m_logger) << "thread " << QThread::currentThreadId() << " failed: " << msg; } db.close(); @@ -2651,7 +2651,7 @@ void TimelineModel::update(bool fake) - DEBUG_LOG() << "Update took " << t.elapsed() << "ms in thread " << QThread::currentThreadId(); + DEBUG_LOG(m_logger) << "Update took " << t.elapsed() << "ms in thread " << QThread::currentThreadId(); return; }); @@ -2675,8 +2675,8 @@ void TimelineModel::updateFilterTable() } - catch (const QString &errMsg) { ERROR_LOG() << "updating filter table failed: " << errMsg; } - catch (...) { ERROR_LOG() << "updating filter table failed"; } + catch (const QString &errMsg) { ERROR_LOG(m_logger) << "updating filter table failed: " << errMsg; } + catch (...) { ERROR_LOG(m_logger) << "updating filter table failed"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.h index 88180d879..4e5073905 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_model.h @@ -78,6 +78,8 @@ public: const QStringList &tableNames() const { return m_tableNames; } private: + +NGL::INGLLogger &m_logger; friend struct TimelineTableInfosHandler; QStringList m_tableNames; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.cpp index 11ee85a04..63e4c36d8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.cpp @@ -15,10 +15,9 @@ namespace Timeline { -TimelineProgress::TimelineProgress( QWidget *parent ) - : QWidget(parent) - , m_ui(new Ui::TimelineProgress) -{ +TimelineProgress::TimelineProgress( QWidget *parent ) : QWidget(parent) + , m_ui(new Ui::TimelineProgress), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); setAttribute(Qt::WA_StyledBackground); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.h index f5a11432f..1dee571cd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_timeline_progress.h @@ -36,6 +36,8 @@ public: private: + +NGL::INGLLogger &m_logger; protected slots: signals: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.cpp index 8e2b930cd..94fb2fe5a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.cpp @@ -59,7 +59,7 @@ AbstractAttributeWidget *EditingModeUI::createAttributeUIWidget(DetailData *deta if (!minb || !maxb) { - WARNING_LOG() << "createAttributeUIWidget: !minb (" << minb << ") || !maxb (" << maxb << ")"; + WARNING_LOG(m_logger) << "createAttributeUIWidget: !minb (" << minb << ") || !maxb (" << maxb << ")"; break; } @@ -90,7 +90,7 @@ AbstractAttributeWidget *EditingModeUI::createAttributeUIWidget(DetailData *deta break; } - WARNING_LOG() << "DetailData::ATTRIBUTE_UI_TYPE_RAD_RANGE_WIDGET: errorious values!"; + WARNING_LOG(m_logger) << "DetailData::ATTRIBUTE_UI_TYPE_RAD_RANGE_WIDGET: errorious values!"; break; } @@ -115,7 +115,7 @@ AbstractAttributeWidget *EditingModeUI::createAttributeUIWidget(DetailData *deta break; } - WARNING_LOG() << "DetailData::ATTRIBUTE_UI_TYPE_AREA_RANGE_WIDGET: errorious values!"; + WARNING_LOG(m_logger) << "DetailData::ATTRIBUTE_UI_TYPE_AREA_RANGE_WIDGET: errorious values!"; break; } @@ -137,7 +137,7 @@ AbstractAttributeWidget *EditingModeUI::createAttributeUIWidget(DetailData *deta default: { - WARNING_LOG() << "createAttributeUIWidget: invalid attribute type #" << attributeUIType << "!"; + WARNING_LOG(m_logger) << "createAttributeUIWidget: invalid attribute type #" << attributeUIType << "!"; break; } @@ -155,7 +155,7 @@ void EditingModeUI::addAttributeContainer(int eventType, const QString &initialV if (attributeUIWidget == nullptr) { - DEBUG_LOG() << "addAttributeContainer: !attributeUIWidget"; + DEBUG_LOG(m_logger) << "addAttributeContainer: !attributeUIWidget"; return; } @@ -166,11 +166,10 @@ void EditingModeUI::addAttributeContainer(int eventType, const QString &initialV attributeUIWidget->setFocus(); } -EditingModeUI::EditingModeUI(DetailData *detailData, const QString &attributeType, QWidget *parent) - : QWidget(parent) +EditingModeUI::EditingModeUI(DetailData *detailData, const QString &attributeType, QWidget *parent) : QWidget(parent) , attributeType(attributeType) - , m_detailData(detailData) -{ + , m_detailData(detailData), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { QVBoxLayout *editingModeLayout = new QVBoxLayout; QWidget *filterTextWidget = new QWidget; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.h index fc2546e6a..87db3b3f0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeEditingModeUI.h @@ -30,6 +30,8 @@ public: QPushButton *pbAddAttributeContainer; private: + +NGL::INGLLogger &m_logger; Timeline::AbstractAttributeWidget *createAttributeUIWidget(DetailData *detailData, const QString &attributeType, int eventType, const QString &initialValue); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.cpp index 35c022929..8dcb92112 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.cpp @@ -30,7 +30,7 @@ QComboBox *SelectionModeUI::createAttributesComboBox(int eventType) if (cbAttribute.isEmpty()) { - WARNING_LOG() << "SelectionModeUI::createAttributesComboBox: event type " << eventType << " has no attribute text for attribute " << attributeKey << " for attribute event lookup - not added"; + WARNING_LOG(m_logger) << "SelectionModeUI::createAttributesComboBox: event type " << eventType << " has no attribute text for attribute " << attributeKey << " for attribute event lookup - not added"; } else { @@ -42,10 +42,9 @@ QComboBox *SelectionModeUI::createAttributesComboBox(int eventType) } -SelectionModeUI::SelectionModeUI(DetailData *detailData, const int eventType) - : eventType(eventType) - , m_detailData(detailData) -{ +SelectionModeUI::SelectionModeUI(DetailData *detailData, const int eventType) : eventType(eventType) + , m_detailData(detailData), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { selectionModeWidget = new QWidget(); selectionModeLayout = new QHBoxLayout(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.h index 16f8ec413..72a21e860 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/AttributeSelectionModeUI.h @@ -21,6 +21,7 @@ class SelectionModeUI : public QObject { Q_OBJECT private: +NGL::INGLLogger &m_logger; SelectionModeUI &operator=(const SelectionModeUI &); public: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.cpp index 97079a403..deaabf6d7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.cpp @@ -18,8 +18,7 @@ namespace Timeline { -FilterTableEntry::FilterTableEntry(DetailData *detailData, const int &eventType, const bool &active, QWidget *parent) - : QGroupBox(parent) +FilterTableEntry::FilterTableEntry(DetailData *detailData, const int &eventType, const bool &active, QWidget *parent) : QGroupBox(parent) , m_eventType(eventType) @@ -32,8 +31,8 @@ FilterTableEntry::FilterTableEntry(DetailData *detailData, const int &eventType, , m_pbFilterActive(new QPushButton(tr("Active"))) , m_pbOK(new QPushButton(tr("OK"))) , m_lbSelectText(new QLabel(tr("Select event type to filter:"))) - , m_detailData(detailData) -{ + , m_detailData(detailData), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_cbEventSelector = getEventTypesComboBox(); m_pbDelete->setPalette(QPalette(QColor("red"))); @@ -104,7 +103,7 @@ void FilterTableEntry::updateData() if (!ftec) { - WARNING_LOG() << "FilterTableEntry::filterText(): !ftec"; + WARNING_LOG(m_logger) << "FilterTableEntry::filterText(): !ftec"; continue; } @@ -130,7 +129,7 @@ const QJsonObject FilterTableEntry::filter(bool typeSafe) const if (m_eventType == -1) { - WARNING_LOG() << "FilterTableEntry has no event type."; + WARNING_LOG(m_logger) << "FilterTableEntry has no event type."; return {}; } @@ -165,7 +164,7 @@ const QJsonObject FilterTableEntry::filter(bool typeSafe) const if (!ftec) { - WARNING_LOG() << "FilterTableEntry::filterText(): !ftec"; + WARNING_LOG(m_logger) << "FilterTableEntry::filterText(): !ftec"; continue; } @@ -209,7 +208,7 @@ void FilterTableEntry::slotSelectEventType() if (m_eventType == -1) { - WARNING_LOG() << "slotSelectEventType: m_eventType == -1"; + WARNING_LOG(m_logger) << "slotSelectEventType: m_eventType == -1"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.h index 116a1c99c..3c5e3e5d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntry.h @@ -36,6 +36,7 @@ public: private: + NGL::INGLLogger &m_logger; QComboBox *getEventTypesComboBox(); int m_eventType; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.cpp index c8af9f60a..ccb7ce726 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.cpp @@ -16,15 +16,14 @@ namespace Timeline { -FilterTableEntryAttribute::FilterTableEntryAttribute(DetailData *detailData, int eventType, const QString &attributeType, QWidget *parent) - : QGroupBox(parent) +FilterTableEntryAttribute::FilterTableEntryAttribute(DetailData *detailData, int eventType, const QString &attributeType, QWidget *parent) : QGroupBox(parent) , m_eventType(eventType) , m_attributeType(attributeType) , m_selectionModeUI(nullptr) , m_editionModeUI(nullptr) , m_attributesLayout(new QVBoxLayout()) - , m_detailData(detailData) -{ + , m_detailData(detailData), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { this->setTitle(QString()); @@ -76,7 +75,7 @@ const QJsonObject FilterTableEntryAttribute::filter(bool typeSafe) const { if (m_attributeType.isEmpty()) { - WARNING_LOG() << "filterText: m_attributeType == -1"; + WARNING_LOG(m_logger) << "filterText: m_attributeType == -1"; return QJsonObject(); } @@ -93,7 +92,7 @@ const QJsonObject FilterTableEntryAttribute::filter(bool typeSafe) const if (attributeTypeName.isEmpty()) { - WARNING_LOG() << "filterText: !attributeTypeName.length()"; + WARNING_LOG(m_logger) << "filterText: !attributeTypeName.length()"; return QJsonObject(); } @@ -174,7 +173,7 @@ void FilterTableEntryAttribute::slotAddEditingMode(bool createBlankContainer) if (m_attributeType.isEmpty()) { - WARNING_LOG() << "slotAddEditingMode: invalid attribute type string!"; + WARNING_LOG(m_logger) << "slotAddEditingMode: invalid attribute type string!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.h index c19bffc0e..2a68ddd12 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterTableEntryAttribute.h @@ -41,6 +41,7 @@ signals: void attributeChanged(const bool &hasAttribute); private: + NGL::INGLLogger &m_logger; private slots: void slotAddAttributeContainer(); void slotDeleteAttributeContainer(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.cpp index 8d44bc93d..255f0a077 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.cpp @@ -30,14 +30,13 @@ namespace Timeline FilterWindow::FilterWindow(DetailData *detailData, const std::shared_ptr &flmIfc, LtsSession::LtsSession *session, - QWidget *parent) - : LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel) + QWidget *parent) : LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::OkApplyCancel) , m_flmIfc(flmIfc) , m_ui(new Ui::FilterWindow) , updateTimer(new QTimer(this)) , m_detailData(detailData) - , m_session(session) -{ + , m_session(session), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ui->setupUi(this); setMinimumSize(1500, 800); @@ -100,11 +99,11 @@ void FilterWindow::slotSave() filterToDoc(exportFilter())); if (fileId > 0) { - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; __unchange__(); } else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.h index 4c05401f1..c5c4b8b7f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/FilterWindow.h @@ -44,6 +44,7 @@ public: bool loadFilters(const QJsonArray &filter); private: + NGL::INGLLogger &m_logger; void retranslate() override; bool apply() override; void aboutToClose() override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.cpp index cb0d719df..ae725745c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.cpp @@ -11,11 +11,10 @@ namespace Timeline { -ComboBox::ComboBox(DetailData *detailData, const QString &attributeType, int eventType, const QString &initialValue, QWidget* parent) - : AbstractAttributeWidget(parent) +ComboBox::ComboBox(DetailData *detailData, const QString &attributeType, int eventType, const QString &initialValue, QWidget* parent) : AbstractAttributeWidget(parent) , m_cbValues(new QComboBox()) - , m_eventType(eventType) -{ + , m_eventType(eventType), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_cbValues, static_cast(&QComboBox::currentIndexChanged), this, &ComboBox::signalChanges); addCustomWidget(m_cbValues); @@ -32,7 +31,7 @@ ComboBox::ComboBox(DetailData *detailData, const QString &attributeType, int eve if (initialValueKey < 0 || !k) { - WARNING_LOG() << "ComboBox::c_tor: initialValueKey < 0 (" << initialValueKey << ")" << "initialValue: " << initialValue; + WARNING_LOG(m_logger) << "ComboBox::c_tor: initialValueKey < 0 (" << initialValueKey << ")" << "initialValue: " << initialValue; return; } @@ -73,7 +72,7 @@ void ComboBox::updateData(DetailData *detailData) m_cbValues->setCurrentIndex(m_cbValues->findData(lastSelectedKey, Qt::UserRole)); - DEBUG_LOG() << "ComboBox: no initial item index found for value id" << lastSelectedKey; + DEBUG_LOG(m_logger) << "ComboBox: no initial item index found for value id" << lastSelectedKey; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.h index 4e38a9b50..9981718e3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/ComboBox.h @@ -25,6 +25,7 @@ public: void updateData(DetailData *detailData) override; private: + NGL::INGLLogger &m_logger; QComboBox *m_cbValues; int m_eventType; QString m_concreteAttributeType; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.cpp index 4c653be78..3caec72b3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.cpp @@ -13,11 +13,10 @@ namespace Timeline { -DefaultRangeWidget::DefaultRangeWidget(unsigned int min, unsigned int max, const QString &prefix, const QString &suffix, const QString &initialValue, QWidget *parent) - : AbstractAttributeWidget(parent) +DefaultRangeWidget::DefaultRangeWidget(unsigned int min, unsigned int max, const QString &prefix, const QString &suffix, const QString &initialValue, QWidget *parent) : AbstractAttributeWidget(parent) , box1(new QSpinBox()) - , box2(new QSpinBox()) -{ + , box2(new QSpinBox()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(box1, static_cast(&QSpinBox::valueChanged), this, &DefaultRangeWidget::signalChanges); connect(box2, static_cast(&QSpinBox::valueChanged), this, &DefaultRangeWidget::signalChanges); @@ -56,7 +55,7 @@ DefaultRangeWidget::DefaultRangeWidget(unsigned int min, unsigned int max, const if (valueList.count() != 2) { - WARNING_LOG() << "DefaultRangeWidget: invalid initial value '" << initialValue << "'"; + WARNING_LOG(m_logger) << "DefaultRangeWidget: invalid initial value '" << initialValue << "'"; return; } @@ -68,7 +67,7 @@ DefaultRangeWidget::DefaultRangeWidget(unsigned int min, unsigned int max, const if (!k1 || !k2) { - WARNING_LOG() << "DefaultRangeWidget: initial value is not numeric '" << initialValue << "'"; + WARNING_LOG(m_logger) << "DefaultRangeWidget: initial value is not numeric '" << initialValue << "'"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.h index d2eb1a984..096096471 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/DefaultRangeWidget.h @@ -30,6 +30,7 @@ public: void updateData(DetailData *detailData) override; private: + NGL::INGLLogger &m_logger; QSpinBox* box1; QSpinBox* box2; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.cpp index 556c4f46b..23f3f6bb2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.cpp @@ -16,11 +16,10 @@ namespace Timeline { -TimeRangeWidget::TimeRangeWidget(DetailData *detailData, const QString &initialValue, QWidget *parent) - : AbstractAttributeWidget(parent) +TimeRangeWidget::TimeRangeWidget(DetailData *detailData, const QString &initialValue, QWidget *parent) : AbstractAttributeWidget(parent) , m_edit1(new LtsWidgets::LtsDateTimeEdit(this)) - , m_edit2(new LtsWidgets::LtsDateTimeEdit(this)) -{ + , m_edit2(new LtsWidgets::LtsDateTimeEdit(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_edit1, &LtsWidgets::LtsDateTimeEdit::dateTimeChanged, this, &TimeRangeWidget::signalChanges); connect(m_edit2, &LtsWidgets::LtsDateTimeEdit::dateTimeChanged, this, &TimeRangeWidget::signalChanges); @@ -55,7 +54,7 @@ TimeRangeWidget::TimeRangeWidget(DetailData *detailData, const QString &initialV if (initialTimeRange.count() != 2) { - WARNING_LOG() << "invalid initial time range value: " << initialValue; + WARNING_LOG(m_logger) << "invalid initial time range value: " << initialValue; return; } @@ -64,7 +63,7 @@ TimeRangeWidget::TimeRangeWidget(DetailData *detailData, const QString &initialV time *= 1000; if (!k) - WARNING_LOG() << "invalid initial time range start value: " << initialTimeRange.at(0).toString(); + WARNING_LOG(m_logger) << "invalid initial time range start value: " << initialTimeRange.at(0).toString(); else m_edit1->setMsecsSinceEpoch(time); @@ -73,7 +72,7 @@ TimeRangeWidget::TimeRangeWidget(DetailData *detailData, const QString &initialV time *= 1000; if (!k) - WARNING_LOG() << "invalid initial time range start value: " << initialTimeRange.at(1).toString(); + WARNING_LOG(m_logger) << "invalid initial time range start value: " << initialTimeRange.at(1).toString(); else m_edit2->setMsecsSinceEpoch(time); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.h index 6f7fac2e7..3d830587b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/EventFilter/widgets/TimeRangeWidget.h @@ -26,6 +26,7 @@ public: void updateData(DetailData *detailData) override; private: + NGL::INGLLogger &m_logger; public: LtsWidgets::LtsDateTimeEdit *m_edit1; LtsWidgets::LtsDateTimeEdit *m_edit2; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/attribute_value_lookup.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/attribute_value_lookup.h index 875b8a43a..189725695 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/attribute_value_lookup.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/attribute_value_lookup.h @@ -63,6 +63,7 @@ public: AttributeValueMap getAttributeValueMap(int eventType) const override; QString getValueStringFromValueId(int attributeValueId) const override; private: +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.cpp index 76b8cb2ac..fe7e85af3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.cpp @@ -396,7 +396,7 @@ DetailData::GetDetailDataResultList DetailData::getDetailData(const LtsTimelineC const QJsonObject &root = event->detailData(); for (auto i = root.constBegin(); i != root.constEnd(); ++i) { - DEBUG_LOG() << "Adding Detail Data for: " << i.key(); + DEBUG_LOG(m_logger) << "Adding Detail Data for: " << i.key(); result.append(getDetailDataForAttribute(i.key(), *i)); } @@ -416,7 +416,7 @@ DetailData::GetDetailDataForAttributeResult DetailData::getDetailDataForAttribut if (attribute.isNull() || attribute.isUndefined()) { - WARNING_LOG() << "DetailData::getDetailDataForAttribute: no attribute type " << attributeType + WARNING_LOG(m_logger) << "DetailData::getDetailDataForAttribute: no attribute type " << attributeType << " in " << QJsonDocument(root).toJson(); result.requestResult = DetailData::RequestResult::InvalidAttributeType; @@ -461,7 +461,7 @@ DetailData::GetDetailDataForAttributeResult DetailData::getDetailDataForAttribut case QJsonValue::Null: case QJsonValue::Undefined: { - WARNING_LOG() << "Timeline: DetailData::getDetailDataForAttribute: attribute value is null or undefined! " << attributeValueJson.toString(); + WARNING_LOG(m_logger) << "Timeline: DetailData::getDetailDataForAttribute: attribute value is null or undefined! " << attributeValueJson.toString(); result.requestResult = DetailData::RequestResult::InvalidAttributeTypeJson; return result; } @@ -497,7 +497,7 @@ DetailData::GetDetailDataForAttributeResult DetailData::getDetailDataForAttribut default: { - WARNING_LOG() << "Timeline: DetailData::getDetailDataForAttribute: attribute value cannot be handled. Type " << attributeValueJson.type() << attributeValueJson.toString(); + WARNING_LOG(m_logger) << "Timeline: DetailData::getDetailDataForAttribute: attribute value cannot be handled. Type " << attributeValueJson.type() << attributeValueJson.toString(); result.requestResult = DetailData::RequestResult::InvalidAttributeType; return result; } @@ -547,7 +547,7 @@ DetailData::GetDetailDataForAttributeResult DetailData::getDetailDataForAttribut if (concreteAttributeType == attributeType) { - ERROR_LOG() << "getDetailDataForAttribute: attribute type " << attributeType << " does not have an UiType !!!"; + ERROR_LOG(m_logger) << "getDetailDataForAttribute: attribute type " << attributeType << " does not have an UiType !!!"; result.requestResult = DetailData::RequestResult::NoUiTypeForAttribute; } else @@ -691,7 +691,7 @@ QString DetailData::AttributeTypeLookup::getAttributeType(const QString &attribu return i.key(); } - WARNING_LOG() << "getAttributeType: attribute type not found by text '" << attributeText << "'"; + WARNING_LOG(m_logger) << "getAttributeType: attribute type not found by text '" << attributeText << "'"; return QString(); } @@ -721,7 +721,7 @@ void DetailData::AttributeParameterLookup::addParameter(const QString &attribute { if (!parameterMap.count()) { - WARNING_LOG() << "addParameter: parameter map is empty!"; + WARNING_LOG(m_logger) << "addParameter: parameter map is empty!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.h index 36d9c728b..02752f2fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/detail_data.h @@ -144,6 +144,7 @@ public: explicit LookupBase(const QString &lookupClassName); protected: + NGL::INGLLogger &m_logger; QString m_lookupClassName; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.cpp index 4cf5a185f..3dc6c2504 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.cpp @@ -273,7 +273,7 @@ bool TimelineViewDialog::init(const std::shared_ptrinit(eemForeign, mrkDtc, exmDtc, ppmDtc, pdmDtc, ismDtc, session, m_detailData, m_streamNameMapping)) { - ERROR_LOG() << "model init failed"; + ERROR_LOG(m_logger) << "model init failed"; return false; } @@ -402,7 +402,7 @@ bool TimelineViewDialog::init(const std::shared_ptrsetAttribute(Qt::WA_DeleteOnClose, true); @@ -429,7 +429,7 @@ bool TimelineViewDialog::init(const std::shared_ptrhasActiveEventTypes()) { - DEBUG_LOG() << "range changed, but no active event types! not arming timer.."; + DEBUG_LOG(m_logger) << "range changed, but no active event types! not arming timer.."; return; } @@ -469,7 +469,7 @@ bool TimelineViewDialog::init(const std::shared_ptrbaseLayout(), tr("Exercise data not available or exercise not started yet."), tr("Cannot open timeline")); - ERROR_LOG() << "exercise data not available - exercise start: " << m_exerciseStart; + ERROR_LOG(m_logger) << "exercise data not available - exercise start: " << m_exerciseStart; return false; } @@ -623,7 +623,7 @@ void TimelineViewDialog::slotStartReplaySituation() if (rp.id() == 0) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error trying to create a replay session in stage 1.")); - WARNING_LOG() << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() << + WARNING_LOG(m_logger) << "[timeout] Error while trying to create a replay session: domainId: " << m_session->domainId() << " - replay partition does not exist - replay id: " << m_requestHelper->getRepliedId() << " - url " << m_session->tcpConnectionUrl().toString(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Import, true); @@ -637,7 +637,7 @@ void TimelineViewDialog::slotStartReplaySituation() if (m_replayApp == nullptr) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("Error trying to create a replay session in stage 2.")); - WARNING_LOG() << "Error while trying to create a replay session: domainId: " << m_session->domainId() << + WARNING_LOG(m_logger) << "Error while trying to create a replay session: domainId: " << m_session->domainId() << " - partition create reply (failed) - replay id: " << m_requestHelper->getRepliedId() << " - url: " << m_session->tcpConnectionUrl().toString(); m_buttonBox->setButtonEnabled(LtsWidgets::DialogButton::Import, true); @@ -989,12 +989,12 @@ void TimelineViewDialog::slotWaitForReady() if (partitionTime < ex.beginTime()) { LtsWidgets::LtsMessageDialog::showMessage(this, tr("The current time is outside of the Exercise's period.
Events are only recorded in Exercise period boundaries."), tr("No Events available")); - WARNING_LOG() << "Partition time was " << partitionTime << ", exercise begin time: " << ex.beginTime(); + WARNING_LOG(m_logger) << "Partition time was " << partitionTime << ", exercise begin time: " << ex.beginTime(); } } else { - WARNING_LOG() << "TimelineViewDialog::init: could not check exercise's boundaries!"; + WARNING_LOG(m_logger) << "TimelineViewDialog::init: could not check exercise's boundaries!"; } LtsWidgets::LtsGlobalWaitDialog::getInstance()->done(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.h index 4fc4c3d75..cea9ffc2f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog.h @@ -110,6 +110,8 @@ signals: void signalInitEventList(); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onReplayPartitionCreateReply(const Core::FunctionReplyObject &reply) override { m_requestHelper->requestReply(reply); } qint64 currentSpanTime() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.cpp index 4e54f2a78..2c78507b1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.cpp @@ -175,14 +175,14 @@ void DDSTimelineModel::slotAddLiveEvent(const ExerciseEventManagement::Event &ev QJsonObject root(getDetailData(event)); ev->setEndT(root[QStringLiteral("endTime")].toDouble()); ev->setDetailData(root); - DEBUG_LOG() << "live event not added - already exists - modified instead - end"; + DEBUG_LOG(m_logger) << "live event not added - already exists - modified instead - end"; return; } if (!isLive()) { - DEBUG_LOG() << "not adding live event because we're not live"; + DEBUG_LOG(m_logger) << "not adding live event because we're not live"; return; } @@ -191,7 +191,7 @@ void DDSTimelineModel::slotAddLiveEvent(const ExerciseEventManagement::Event &ev int eventType = static_cast(event.eventTypeId().underlying()); if (!m_activeEventTypeIds.contains(eventType)) { - DEBUG_LOG() << "live event not added - event type ("< m_cacheSize) { - DEBUG_LOG() << "more than " << m_cacheSize << " live events - archiving and clearing"; + DEBUG_LOG(m_logger) << "more than " << m_cacheSize << " live events - archiving and clearing"; saveAndClearLiveCache(); } @@ -219,7 +219,7 @@ void DDSTimelineModel::slotAddLiveEvent(const ExerciseEventManagement::Event &ev rebuildTimelineKnownRanges(); #ifdef LTS_DEBUG - DEBUG_LOG() << "added live event at " << eventTime << " - cache: " << start << " " << end << ", " << m_liveCache.events.count() << " events"; + DEBUG_LOG(m_logger) << "added live event at " << eventTime << " - cache: " << start << " " << end << ", " << m_liveCache.events.count() << " events"; #endif addEventAndFilter(ltsEvent); @@ -279,7 +279,7 @@ void DDSTimelineModel::addCacheRange(const LtsTimelineClassic::Range &range, con rebuildTimelineKnownRanges(); } - DEBUG_LOG() << "added cache for " << range.start << " to " << range.end << " - event count now: " << m_eventCount; + DEBUG_LOG(m_logger) << "added cache for " << range.start << " to " << range.end << " - event count now: " << m_eventCount; } @@ -302,7 +302,7 @@ void DDSTimelineModel::_uncache(const CacheRange &cr) void DDSTimelineModel::uncache(CacheRange &cr) { QString hash(QStringLiteral("<%1:%2:%3>").arg(cr.start).arg(cr.end).arg(cr.events.count())); - DEBUG_LOG() << "uncaching " << QString::number(qHash(hash), 16) << " " << cr.start << " "<< cr.end; + DEBUG_LOG(m_logger) << "uncaching " << QString::number(qHash(hash), 16) << " " << cr.start << " "<< cr.end; cr.visible = false; _uncache(cr); @@ -343,7 +343,7 @@ void DDSTimelineModel::forceUncache() uncache(cr); m_eventCount -= cr.events.count(); m_cachedEvents.erase(i); - DEBUG_LOG() << "removed an invisible & incomplete cache - event count now: " << m_eventCount; + DEBUG_LOG(m_logger) << "removed an invisible & incomplete cache - event count now: " << m_eventCount; return; } } @@ -357,7 +357,7 @@ void DDSTimelineModel::forceUncache() uncache(cr); m_eventCount -= cr.events.count(); m_cachedEvents.erase(i); - DEBUG_LOG() << "removed an invisible cache - event count now: " << m_eventCount; + DEBUG_LOG(m_logger) << "removed an invisible cache - event count now: " << m_eventCount; return; } } @@ -396,7 +396,7 @@ void DDSTimelineModel::forceUncache() m_cachedEvents.erase(lowestEnd); } - WARNING_LOG() << "force-removing a visible cache ... - event count now: " << m_eventCount; + WARNING_LOG(m_logger) << "force-removing a visible cache ... - event count now: " << m_eventCount; } @@ -434,7 +434,7 @@ void DDSTimelineModel::processEventList(qint64 &highest, bool &incomplete, QVect count++; if (count > m_cacheSize) { - WARNING_LOG() << "max cache exceeded - not adding more than " << m_cacheSize << " events"; + WARNING_LOG(m_logger) << "max cache exceeded - not adding more than " << m_cacheSize << " events"; incomplete = true; emit signalTooMuchEvents(); break; @@ -459,12 +459,12 @@ void DDSTimelineModel::receivedEvents(const LtsTimelineClassic::Range &range, QV if (isCacheFull()) { - DEBUG_LOG() << "receivedEvents: cache full - force uncache"; + DEBUG_LOG(m_logger) << "receivedEvents: cache full - force uncache"; forceUncache(); } #ifdef LTS_DEBUG - DEBUG_LOG() << "received events count: " << receivedEventsList.count(); + DEBUG_LOG(m_logger) << "received events count: " << receivedEventsList.count(); #endif qint64 highest = 0; @@ -474,7 +474,7 @@ void DDSTimelineModel::receivedEvents(const LtsTimelineClassic::Range &range, QV processEventList(highest, incomplete, cachedEvents, receivedEventsList); addCacheRange(range, cachedEvents, incomplete ? highest : 0); - DEBUG_LOG() << "receivedEvents: loading done"; + DEBUG_LOG(m_logger) << "receivedEvents: loading done"; emit signalLoadingDone(); } @@ -505,7 +505,7 @@ void DDSTimelineModel::slotRequestMessageReceived(const QString &message) EventRequest *er = qobject_cast(sender()); if (er == nullptr) { - DEBUG_LOG() << "not an EventRequest: " << sender(); + DEBUG_LOG(m_logger) << "not an EventRequest: " << sender(); return; } @@ -538,7 +538,7 @@ void DDSTimelineModel::slotRequestMessageReceived(const QString &message) if (err.error != QJsonParseError::NoError) { - ERROR_LOG() << "Event #" << id << " with event type id " << eventTypeId << " and start time " << startTime << " json detail data cannot be parsed: " << err.errorString() << " at offset " << err.offset; + ERROR_LOG(m_logger) << "Event #" << id << " with event type id " << eventTypeId << " and start time " << startTime << " json detail data cannot be parsed: " << err.errorString() << " at offset " << err.offset; continue; } @@ -618,7 +618,7 @@ void DDSTimelineModel::slotRequestMessageReceived(const QString &message) path, paintFunc, color, root, -1, pos, m_session); #ifdef LTS_DEBUG - DEBUG_LOG() << "Event #" << event->uniqueId() << " with event type id " << event->typeId() << " and start time " << event->startTime() << " created"; + DEBUG_LOG(m_logger) << "Event #" << event->uniqueId() << " with event type id " << event->typeId() << " and start time " << event->startTime() << " created"; #endif er->append(event); @@ -628,13 +628,13 @@ void DDSTimelineModel::slotRequestMessageReceived(const QString &message) void DDSTimelineModel::requestEvents(const LtsTimelineClassic::Range &range) { - DEBUG_LOG() << "requesting events from " << QDateTime::fromMSecsSinceEpoch(range.start).toString() + DEBUG_LOG(m_logger) << "requesting events from " << QDateTime::fromMSecsSinceEpoch(range.start).toString() << " to " << QDateTime::fromMSecsSinceEpoch(range.end).toString(); if (m_createFakeEvents) - DEBUG_LOG() << "requesting fake events .."; + DEBUG_LOG(m_logger) << "requesting fake events .."; else - DEBUG_LOG() << "requesting real events .."; + DEBUG_LOG(m_logger) << "requesting real events .."; EventRequest *request = new EventRequest(m_createFakeEvents ? QUrl(QStringLiteral("ws://127.0.0.1:10090")) : m_eemForeign->eemUrl(), range.start, range.end, m_activeEventTypeIds, m_cacheSize); @@ -643,7 +643,7 @@ void DDSTimelineModel::requestEvents(const LtsTimelineClassic::Range &range) this, [this, range, request]() { QVector eventList = request->eventList(); - DEBUG_LOG() << ".. received real events! " << range.start << " - " << range.end; + DEBUG_LOG(m_logger) << ".. received real events! " << range.start << " - " << range.end; receivedEvents(range, eventList); request->deleteLater(); @@ -652,7 +652,7 @@ void DDSTimelineModel::requestEvents(const LtsTimelineClassic::Range &range) connect(request, &EventRequest::signalRequestFailed, this, [this, request](const QString &errorString) { - ERROR_LOG() << ".. event request from " << request->start() << " to " << request->end() << " failed! '" << errorString << "'"; + ERROR_LOG(m_logger) << ".. event request from " << request->start() << " to " << request->end() << " failed! '" << errorString << "'"; emit signalLoadingDone(); }); @@ -704,12 +704,12 @@ bool DDSTimelineModel::splitLowest(qint64 &rangeMin , qint64 rangeMax , qint64 requestMin = rangeMin; requestMax = lowestCache.start - 1; - DEBUG_LOG() << "splitLowest: there is an uncached range before the lowest cache, adding this uncached range to the request " << requestMin << " - " << requestMax << " and set rangeMin now to " << rangeMin << " while rangeMax keeps being " << rangeMax; + DEBUG_LOG(m_logger) << "splitLowest: there is an uncached range before the lowest cache, adding this uncached range to the request " << requestMin << " - " << requestMax << " and set rangeMin now to " << rangeMin << " while rangeMax keeps being " << rangeMax; } else { - DEBUG_LOG() << "splitLowest: no uncached range at the start of the requested range, no need to request events here - skipping"; + DEBUG_LOG(m_logger) << "splitLowest: no uncached range at the start of the requested range, no need to request events here - skipping"; } @@ -717,11 +717,11 @@ bool DDSTimelineModel::splitLowest(qint64 &rangeMin , qint64 rangeMax , qint64 if (rangeMin > rangeMax) { - DEBUG_LOG() << "splitLowest: rangeMin > rangeMax - lowestCache.end " << lowestCache.end; + DEBUG_LOG(m_logger) << "splitLowest: rangeMin > rangeMax - lowestCache.end " << lowestCache.end; rangeMin = rangeMax; } - DEBUG_LOG() << "splitLowest: space? " << spaceBeforeCache << " | requestMin" << requestMin << " - requestMax " << requestMax << " | oldRangeMin " << oldRangeMin << " - rangeMin " << rangeMin; + DEBUG_LOG(m_logger) << "splitLowest: space? " << spaceBeforeCache << " | requestMin" << requestMin << " - requestMax " << requestMax << " | oldRangeMin " << oldRangeMin << " - rangeMin " << rangeMin; return spaceBeforeCache; } @@ -759,27 +759,27 @@ void DDSTimelineModel::getAllEventsOfType(const QSet &eventTypeIds) if (icr == m_cachedEvents.end()) { - WARNING_LOG() << "cr after request for crId " << crId << " not available anymore"; + WARNING_LOG(m_logger) << "cr after request for crId " << crId << " not available anymore"; return; } CacheRange &cr = icr->second; QVector eventList = request->eventList(); - DEBUG_LOG() << "getAllEventsOfType: .. received real events! " << cr.start << " - " << cr.end; + DEBUG_LOG(m_logger) << "getAllEventsOfType: .. received real events! " << cr.start << " - " << cr.end; if (isCacheFull()) { - DEBUG_LOG() << "getAllEventsOfType: receivedEvents: cache full - not adding new events"; + DEBUG_LOG(m_logger) << "getAllEventsOfType: receivedEvents: cache full - not adding new events"; cr.incomplete = true; return; } #ifdef LTS_DEBUG - DEBUG_LOG() << "getAllEventsOfType: received events count: " << eventList.count(); + DEBUG_LOG(m_logger) << "getAllEventsOfType: received events count: " << eventList.count(); #endif qint64 highest = 0; @@ -817,14 +817,14 @@ void DDSTimelineModel::getAllEventsOfType(const QSet &eventTypeIds) rebuildTimelineKnownRanges(); - DEBUG_LOG() << "getAllEventsOfType: receivedEvents: loading done"; + DEBUG_LOG(m_logger) << "getAllEventsOfType: receivedEvents: loading done"; request->deleteLater(); }); connect(request, &EventRequest::signalRequestFailed, this, [this, request](const QString &errorString) { - ERROR_LOG() << "getAllEventsOfType: event request from " << request->start() << " to " << request->end() << " failed! '" << errorString << "'"; + ERROR_LOG(m_logger) << "getAllEventsOfType: event request from " << request->start() << " to " << request->end() << " failed! '" << errorString << "'"; emit signalLoadingDone(); }); @@ -836,17 +836,17 @@ void DDSTimelineModel::getAllEventsOfType(const QSet &eventTypeIds) void DDSTimelineModel::getEvents(qint64 rangeMin, qint64 rangeMax) { - DEBUG_LOG() << "getEvents: requesting events from " << QDateTime::fromMSecsSinceEpoch(rangeMin).toString() << rangeMin << " to " << QDateTime::fromMSecsSinceEpoch(rangeMax).toString() << rangeMax; + DEBUG_LOG(m_logger) << "getEvents: requesting events from " << QDateTime::fromMSecsSinceEpoch(rangeMin).toString() << rangeMin << " to " << QDateTime::fromMSecsSinceEpoch(rangeMax).toString() << rangeMax; if (!hasActiveEventTypes()) { - DEBUG_LOG() << "no active event types selected"; + DEBUG_LOG(m_logger) << "no active event types selected"; return; } if (m_liveCache.start != 0 && rangeMax > m_liveCache.start) { - DEBUG_LOG() << "live cache active & in range - limited range max from " << rangeMax << " to " << m_liveCache.start - 1; + DEBUG_LOG(m_logger) << "live cache active & in range - limited range max from " << rangeMax << " to " << m_liveCache.start - 1; rangeMax = m_liveCache.start - 1; } @@ -855,17 +855,17 @@ void DDSTimelineModel::getEvents(qint64 rangeMin, qint64 rangeMax) for (auto &it : m_cachedEvents) { CacheRange &cr = it.second; - DEBUG_LOG() << "> start " << cr.start << " end " << cr.end; + DEBUG_LOG(m_logger) << "> start " << cr.start << " end " << cr.end; bool inside = isInsideCachedRange(cr, rangeMin, rangeMax); if (!inside) continue; - DEBUG_LOG() << "found range that was cached, using it instead of requesting new events"; + DEBUG_LOG(m_logger) << "found range that was cached, using it instead of requesting new events"; if (!cr.visible) { - DEBUG_LOG() << "found range that was cached AND not visible, showing it again"; + DEBUG_LOG(m_logger) << "found range that was cached AND not visible, showing it again"; showCached(cr); } @@ -900,18 +900,18 @@ void DDSTimelineModel::getEvents(qint64 rangeMin, qint64 rangeMax) if (rangeMin < rangeMax) { - DEBUG_LOG() << "adding request for leftovers from " << rangeMin << " - " << rangeMax; + DEBUG_LOG(m_logger) << "adding request for leftovers from " << rangeMin << " - " << rangeMax; requestRanges.append(Range(rangeMin, rangeMax)); } int requestRangesCount = requestRanges.count(); - DEBUG_LOG() << "requestRanges: " << requestRangesCount; + DEBUG_LOG(m_logger) << "requestRanges: " << requestRangesCount; for (const auto &range : std::as_const(requestRanges)) requestEvents(range); if (requestRangesCount < 1) - DEBUG_LOG() << "nothing requested (requestRangesCount empty)"; + DEBUG_LOG(m_logger) << "nothing requested (requestRangesCount empty)"; } @@ -1090,7 +1090,7 @@ QJsonObject DDSTimelineModel::createMarkerDetailData(const MarkerManagement::Mar } default: { - WARNING_LOG() << "Marker " << data.id() << "'s description has an invalid marker type: " << (int)md.markerType().underlying(); + WARNING_LOG(m_logger) << "Marker " << data.id() << "'s description has an invalid marker type: " << (int)md.markerType().underlying(); break; } } @@ -1184,7 +1184,7 @@ void DDSTimelineModel::addMarkerManagementMarker(const MarkerManagement::Marker m_session)); #ifdef LTS_DEBUG - DEBUG_LOG() << "marker added! uniqueId " << data.id() << ", startTime " << data.timeStamp(); + DEBUG_LOG(m_logger) << "marker added! uniqueId " << data.id() << ", startTime " << data.timeStamp(); #endif } @@ -1218,7 +1218,7 @@ const QJsonObject DDSTimelineModel::getDetailData(const QByteArray &data, int id QJsonDocument doc(QJsonDocument::fromJson(data, &err)); if (err.error != QJsonParseError::NoError) { - ERROR_LOG() << "getDetailData: Event #" << id << " with event type id " << type << " and start time " << startTime << " json detail data cannot be parsed: " << err.errorString() << " at offset " << err.offset; + ERROR_LOG(m_logger) << "getDetailData: Event #" << id << " with event type id " << type << " and start time " << startTime << " json detail data cannot be parsed: " << err.errorString() << " at offset " << err.offset; return QJsonObject(); } @@ -1317,7 +1317,7 @@ LtsTimelineClassic::Event *DDSTimelineModel::createEvent(const ExerciseEventMana #ifdef LTS_DEBUG - DEBUG_LOG() << "Event #" << event->uniqueId() << " with event type id " << event->typeId() << " and start time " << event->startTime() << " created"; + DEBUG_LOG(m_logger) << "Event #" << event->uniqueId() << " with event type id " << event->typeId() << " and start time " << event->startTime() << " created"; #endif return event; @@ -1370,7 +1370,7 @@ QStringList DDSTimelineModel::getPathForAvsEvents(const QString &type, const QJs QStringList result; int buildingId = obj[QStringLiteral("MainStructureElementId")].toInt(); - DEBUG_LOG() << "Building Id = " << buildingId; + DEBUG_LOG(m_logger) << "Building Id = " << buildingId; if (buildingId > 0) { const QString buildingName = m_ismDtc->getBuildingDisplayName(buildingId); @@ -1397,7 +1397,7 @@ QStringList DDSTimelineModel::getPathForBuildingEvents(const QString &type, cons QString buildingName; int buildingId = obj[QStringLiteral("MainStructureElementId")].toInt(); - DEBUG_LOG() << "Building Id = " << buildingId; + DEBUG_LOG(m_logger) << "Building Id = " << buildingId; if (buildingId > 0) { buildingName = m_ismDtc->getBuildingDisplayName(buildingId); @@ -1416,7 +1416,7 @@ QStringList DDSTimelineModel::getPathForAesEvents(const QString &type, const QJs result << type; QString aesName = obj[QStringLiteral("AesName")].toString(); - DEBUG_LOG() << "AesName = " << aesName; + DEBUG_LOG(m_logger) << "AesName = " << aesName; result << aesName; return result; @@ -1436,7 +1436,7 @@ void DDSTimelineModel::removeEvent(int eventId) } } - WARNING_LOG() << "removeEvent: event "< DDSTimelineModel::createTestEvents(qint64 t -EventRequest::EventRequest(const QUrl &url, qint64 start, qint64 end, const QSet &eventTypes, int limit) - : m_start(start) +EventRequest::EventRequest(const QUrl &url, qint64 start, qint64 end, const QSet &eventTypes, int limit) : m_start(start) , m_end(end) - , m_timeoutTimer(new QTimer(this)) -{ + , m_timeoutTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { QUrl realUrl(url); realUrl.setPath(QStringLiteral("/request")); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.h index 5ecf7cb95..36968fa99 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_dialog_model.h @@ -78,6 +78,9 @@ public: private: + + +NGL::INGLLogger &m_logger; qint64 currentTime() const override; QStringList getPathForAvsEvents(const QString &type, const QJsonObject &obj) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.cpp index 3456c5d42..a3591557d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.cpp @@ -74,7 +74,7 @@ EventListDialog::EventListDialog(const QString &menuGroup, EventListDialog::~EventListDialog() { - DEBUG_LOG() << "~EventListDialog"; + DEBUG_LOG(m_logger) << "~EventListDialog"; if (m_proxyModel != nullptr) m_proxyModel->setInvalid(); m_model->setInvalid(); @@ -139,10 +139,10 @@ void EventListDialog::initColumns() columnInfos.reserve(colCount); const auto header = m_ui->ltsDataView->searchView()->header(); - DEBUG_LOG() << "concealed count: " << m_concealedColumns.length(); + DEBUG_LOG(m_logger) << "concealed count: " << m_concealedColumns.length(); for (int visualIndex = 0; visualIndex < colCount; ++visualIndex) { - DEBUG_LOG() << visualIndex << " concealed? " << m_concealedColumns.contains(visualIndex); + DEBUG_LOG(m_logger) << visualIndex << " concealed? " << m_concealedColumns.contains(visualIndex); if (m_concealedColumns.contains(visualIndex)) continue; @@ -153,7 +153,7 @@ void EventListDialog::initColumns() ci.visible = !header->isSectionHidden(ci.logicalIndex); ci.name = m_model->headerData(ci.logicalIndex, Qt::Orientation::Horizontal, Qt::DisplayRole).toString(); - DEBUG_LOG() << "InitColumns: Adding column " << ci.name << + DEBUG_LOG(m_logger) << "InitColumns: Adding column " << ci.name << " with visual index = " << ci.visualIndex << ", logical index = " << ci.logicalIndex; @@ -237,7 +237,7 @@ void EventListDialog::showColumns() { int oldVisualIndex = header->visualIndex(ci.logicalIndex); - DEBUG_LOG() << "ShowColumns: Column " << ci.name + DEBUG_LOG(m_logger) << "ShowColumns: Column " << ci.name << ", colVisible: " << ci.visible << ", logical index: " << ci.logicalIndex << ", old index: " << oldVisualIndex @@ -264,8 +264,8 @@ void EventListDialog::reInitEventList(const LtsTimelineClassic::EventList &event newEventList += e; } - DEBUG_LOG() << "reInitEventList size = " << eventList.size(); - DEBUG_LOG() << "reInitEventList new size = " << newEventList.size(); + DEBUG_LOG(m_logger) << "reInitEventList size = " << eventList.size(); + DEBUG_LOG(m_logger) << "reInitEventList new size = " << newEventList.size(); m_model->clear(); m_model->setData(newEventList); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.h index b51b1c528..fa595c523 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list.h @@ -49,6 +49,8 @@ public: void reInitEventList(const LtsTimelineClassic::EventList &eventList, qint64 startTime, qint64 endTime); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void initColumns(); void addConcealedColumns(const QVector &concealedColumns); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.cpp index f0b40784c..e0662912a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.cpp @@ -146,14 +146,14 @@ void EventListColumns::loadColumns(const QJsonArray &cols) if (elc) { - ERROR_LOG() << "Modifed Column: " << ci.visualIndex + ERROR_LOG(m_logger) << "Modifed Column: " << ci.visualIndex << ", " << ci.logicalIndex << ", " << ci.name << ", " << ci.visible << ", " << objName; elc->setChecked(ci.visible); } else { - ERROR_LOG() << "New Column: " << ci.visualIndex + ERROR_LOG(m_logger) << "New Column: " << ci.visualIndex << ", " << ci.logicalIndex << ", " << ci.name << ", " << ci.visible << ", " << objName; elc = new EventListColumn(ci); @@ -167,9 +167,9 @@ bool EventListColumns::save() { int fileId = m_flmIfc->saveFileContent(this, FileManagement::FileType::Xml, 0, columnsToDoc(exportColumns())); if (fileId > 0) - DEBUG_LOG() << "Saved file with id = " << fileId; + DEBUG_LOG(m_logger) << "Saved file with id = " << fileId; else - ERROR_LOG() << "Could not save file in library "; + ERROR_LOG(m_logger) << "Could not save file in library "; return (fileId > 0); } @@ -190,7 +190,7 @@ const QJsonArray EventListColumns::exportColumns() const for (const EventListColumn *elc : children) { const auto &ci = elc->columnInfo(); - DEBUG_LOG() << "Saving column: " << ci.visualIndex << ", " << elc->text() << ", " << elc->isChecked(); + DEBUG_LOG(m_logger) << "Saving column: " << ci.visualIndex << ", " << elc->text() << ", " << elc->isChecked(); QJsonObject elcObj; elcObj[QStringLiteral("visualIndex")] = ci.visualIndex; elcObj[QStringLiteral("logicalIndex")] = ci.logicalIndex; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.h index a24dcdb9b..7c5164ab7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_columns.h @@ -44,6 +44,8 @@ public: const ColumnInfo &columnInfo() const { return m_ci; } private: + +NGL::INGLLogger &m_logger; ColumnInfo m_ci; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_model.h index 5f237c4b3..17f53be02 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_event_list_model.h @@ -59,6 +59,8 @@ public slots: void appendEventList(const QVector &eventList); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_ppmDtc; std::shared_ptr m_pdmDtc; std::shared_ptr m_ismDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.cpp index fe1410d01..158288e0c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.cpp @@ -72,7 +72,7 @@ void TimelineLegendDialog::setActiveEventTypeIds(const QSet &activeEventTyp if (cb != nullptr) cb->setChecked(true); else - WARNING_LOG() << "cb for event type " << activeEventType << " not found!"; + WARNING_LOG(m_logger) << "cb for event type " << activeEventType << " not found!"; } setUnchangeable(false); @@ -255,7 +255,7 @@ bool TimelineLegendDialog::init(DDSTimelineModel *model, const QSet &active if (paintFunc == nullptr) { - WARNING_LOG() << "No draw function for event " << eventType; + WARNING_LOG(m_logger) << "No draw function for event " << eventType; Q_ASSERT(false); continue; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.h index fad609e9c..9d1f7a876 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_legend.h @@ -35,6 +35,8 @@ signals: void signalEventTypesChanged(const QSet &activeEventTypeIds); private: + +NGL::INGLLogger &m_logger; void retranslate() override; static QString checkBoxName(int eventTypeId) { return QStringLiteral("CheckBoxEvent%1").arg(eventTypeId); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.cpp index 747a7d86c..c767f8a1a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.cpp @@ -82,7 +82,7 @@ void ShowDetailsDialog::slotFocusOnMap() { if (m_replayAppSession == nullptr) { - WARNING_LOG() << "ShowDetailsDialog::init: no replay app, no focus"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no replay app, no focus"; return; } @@ -90,13 +90,13 @@ void ShowDetailsDialog::slotFocusOnMap() if (!m_replayAppSession->getForeignGuiInterface(sitMapIfc)) { - WARNING_LOG() << "no sitMapIfc, no focusing on replay in Show Details Dialog 1"; + WARNING_LOG(m_logger) << "no sitMapIfc, no focusing on replay in Show Details Dialog 1"; return; } if (!sitMapIfc) { - WARNING_LOG() << "no sitMapIfc, no focusing on replay in Show Details Dialog 2"; + WARNING_LOG(m_logger) << "no sitMapIfc, no focusing on replay in Show Details Dialog 2"; return; } @@ -104,7 +104,7 @@ void ShowDetailsDialog::slotFocusOnMap() { if (!m_event->positionValid()) { - WARNING_LOG() << "event has no valid position, skip focusOnMap"; + WARNING_LOG(m_logger) << "event has no valid position, skip focusOnMap"; return; } @@ -124,7 +124,7 @@ void ShowDetailsDialog::slotFocusOnMap() MarkerManagement::MarkerManagementApplyFilter applyFilter(m_replayAppSession, m_fltParticipantIfc, m_fltAesIfc, m_fltBuildingComponentIfc); if (!applyFilter.applyFilter(filterSettings.toObject())) { - WARNING_LOG() << "filters from event #"<uniqueId()<<" could not be applied"; + WARNING_LOG(m_logger) << "filters from event #"<uniqueId()<<" could not be applied"; return; } } @@ -153,14 +153,14 @@ bool ShowDetailsDialog::getStreamNameAndEndTime(QString &streamName, qint64 &end if (_streamName.isEmpty()) { if (!silent) - ERROR_LOG() << "ShowDetailsDialog::slotStartVideo(): stream name is empty " << QJsonDocument(m_event->detailData()).toJson(); + ERROR_LOG(m_logger) << "ShowDetailsDialog::slotStartVideo(): stream name is empty " << QJsonDocument(m_event->detailData()).toJson(); return false; } qint64 _endTime = root[QStringLiteral("endTime")].toDouble(0); if (_endTime == 0 && !silent) - WARNING_LOG() << "ShowDetailsDialog::slotStartPlayback: event " << m_event->uniqueId() << " has no end time!"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::slotStartPlayback: event " << m_event->uniqueId() << " has no end time!"; streamName = _streamName; endTime = _endTime; @@ -189,7 +189,7 @@ void ShowDetailsDialog::slotStartReplay() { if (m_replayAppSession == nullptr) { - ERROR_LOG() << "ShowDetailsDialog::slotStartReplay: no replay app, no replay"; + ERROR_LOG(m_logger) << "ShowDetailsDialog::slotStartReplay: no replay app, no replay"; return; } @@ -197,7 +197,7 @@ void ShowDetailsDialog::slotStartReplay() if (!m_replayAppSession->getForeignGuiInterface(srpIfc)) { - ERROR_LOG() << "ShowDetailsDialog::slotStartReplay: no srp, no replay in Show Details Dialog"; + ERROR_LOG(m_logger) << "ShowDetailsDialog::slotStartReplay: no srp, no replay in Show Details Dialog"; return; } @@ -287,7 +287,7 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E std::shared_ptr srpIfc; std::shared_ptr sitMapIfc; if (!m_session->getDtc(m_mrkDtc)) - WARNING_LOG() << "!m_session->getDtc(m_mrkDtc)"; + WARNING_LOG(m_logger) << "!m_session->getDtc(m_mrkDtc)"; m_mrkDtc->enableMarker(); @@ -307,10 +307,10 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E }); if (!replayAppSession->getForeignGuiInterface(srpIfc)) - WARNING_LOG() << "ShowDetailsDialog::init: no srp, no replay in Show Details Dialog"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no srp, no replay in Show Details Dialog"; if (!replayAppSession->getForeignGuiInterface(sitMapIfc)) - WARNING_LOG() << "ShowDetailsDialog::init: no sitMapIfc, no focusing on replay in Show Details Dialog"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no sitMapIfc, no focusing on replay in Show Details Dialog"; } m_avmIfc = avmIfc; @@ -321,22 +321,22 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E m_streamNameMapping = streamNameMapping; if (m_avmIfc == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no avm ifc given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no avm ifc given"; if (m_mrkIfc == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no mrk ifc given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no mrk ifc given"; if (m_fltParticipantIfc == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no flt Part ifc given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no flt Part ifc given"; if (m_fltAesIfc == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no flt Aes ifc given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no flt Aes ifc given"; if (m_fltBuildingComponentIfc == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no flt buildingComponent ifc given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no flt buildingComponent ifc given"; if (m_streamNameMapping == nullptr) - WARNING_LOG() << "ShowDetailsDialog::init: no stream name mapping given"; + WARNING_LOG(m_logger) << "ShowDetailsDialog::init: no stream name mapping given"; m_event = event; int eventTypeId = event->typeId(); @@ -423,7 +423,7 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E else if (attributeDetail.requestResult == DetailData::RequestResult::InvalidAttributeType) { - DEBUG_LOG() << "Unhandled attribute " << attributeDetail.attributeTypeId << " - skipping"; + DEBUG_LOG(m_logger) << "Unhandled attribute " << attributeDetail.attributeTypeId << " - skipping"; continue; } else @@ -431,7 +431,7 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E attributeTypeText = QStringLiteral("%1 (%2)").arg(tr(""), attributeDetail.attributeTypeId); attributeValueText = tr(""); - WARNING_LOG() << "getDetailData failed with message id " << (int)attributeDetail.requestResult << " for attribute " << attributeDetail.attributeTypeId; + WARNING_LOG(m_logger) << "getDetailData failed with message id " << (int)attributeDetail.requestResult << " for attribute " << attributeDetail.attributeTypeId; continue; } } @@ -475,9 +475,9 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E QLabel *attributeValueTextLabel = new QLabel(attributeValueText); - DEBUG_LOG() << "attributeValueText=" << attributeValueText; + DEBUG_LOG(m_logger) << "attributeValueText=" << attributeValueText; attributeValueTextLabel->setTextInteractionFlags(attributeValueTextLabel->textInteractionFlags() | Qt::TextInteractionFlag::TextSelectableByMouse); - DEBUG_LOG() << "attributeTypeText=" << attributeTypeText + DEBUG_LOG(m_logger) << "attributeTypeText=" << attributeTypeText << " attributeValueTextLabel=" << attributeValueTextLabel; m_ui->formLayout->addRow(new QLabel(attributeTypeText), attributeValueTextLabel); } @@ -496,7 +496,7 @@ bool ShowDetailsDialog::init(DetailData *detailData, const LtsTimelineClassic::E void ShowDetailsDialog::updateMarker() { - DEBUG_LOG() << "ShowDetailsDialog::updateMarker"; + DEBUG_LOG(m_logger) << "ShowDetailsDialog::updateMarker"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.h index b5792579a..ca424202a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimelineClassic/tln_show_details.h @@ -60,6 +60,8 @@ private slots: void updateMarker(); private: + +NGL::INGLLogger &m_logger; bool hasNameAndEndTime() const; bool getStreamNameAndEndTime(QString &streamName, qint64 &endTime, bool silent = false) const; void setButtonDisabled(QPushButton *button, QToolButton *warningButton, const QString &reasonMessage, bool hide = false); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_dialog.h index 165d891a7..0f8f62674 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_dialog.h @@ -28,6 +28,8 @@ public: bool init(const std::shared_ptr &dtc, LtsNotification::LtsNotification *notiSfmMsg, qint64 lastClearTime); private: + +NGL::INGLLogger &m_logger; void retranslate() override; void onPrint(); void onClear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.cpp index 3e9bec0be..7bad17318 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.cpp @@ -231,9 +231,9 @@ QVariant MessagingModel::data(const QModelIndex &index, int role) const void MessagingModel::clearModel() { - ERROR_LOG() << QDateTime::currentMSecsSinceEpoch(); + ERROR_LOG(m_logger) << QDateTime::currentMSecsSinceEpoch(); m_lastClearTime = QDateTime::currentMSecsSinceEpoch(); - ERROR_LOG() << m_lastClearTime; + ERROR_LOG(m_logger) << m_lastClearTime; clear(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.h index a3c1aba48..1ea10126e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/TrainingAreaBaseOC/Gui/SfmMessaging/taboc_sfm_messaging_model.h @@ -57,6 +57,8 @@ public slots: void clearModel(); private: + +NGL::INGLLogger &m_logger; void insertData(const TrainingAreaBaseOC::FreeText &data, DataModification modType = DataModification::eAdded); void insertData(const TrainingAreaBaseOC::ShortMessage &data, DataModification modType = DataModification::eAdded); bool dontAdd(qint64 timeToCheck); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.cpp index 6a44f2745..5e89fc59b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.cpp @@ -50,7 +50,7 @@ bool EquipmentEditDialog::init() !m_session->getFtc(m_ftc) || !m_ftc->enableAll()) { - ERROR_LOG() << "whm equ WarehouseManagement dtc/ftc not found!"; + ERROR_LOG(m_logger) << "whm equ WarehouseManagement dtc/ftc not found!"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.h index fc36c4b9c..9e7c6ef29 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_edit_dialog.h @@ -42,6 +42,8 @@ signals: void sendData(const WarehouseGuez::EquipmentTypeWh &data); protected: + +NGL::INGLLogger &m_logger; void onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_list.h index 96b150432..00aa17ff6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_list.h @@ -36,6 +36,8 @@ public: bool init(); protected: + +NGL::INGLLogger &m_logger; void onRemoveEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override; void onModifyEquipmentTypeWhReply(const Core::FunctionReplyObject &reply) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.cpp index 6aa4437d8..73649ab4a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.cpp @@ -51,7 +51,7 @@ bool EquipmentModel::initModel(const std::shared_ptrenableEquipmentTypeWh() || !m_dtc->enableInjuryModelAgdusWh()) { - ERROR_LOG() << "dtc not okay"; + ERROR_LOG(m_logger) << "dtc not okay"; return false; } connect(m_dtc.get(), &WarehouseGuez::Interface::Dtc::equipmentTypeWhChanged, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.h index 8d6e4abe2..b3783f567 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/equipment_type_model.h @@ -52,6 +52,7 @@ public: QMap equipmentTypeNames() const; protected: +NGL::INGLLogger &m_logger; void onInjuryModelChanged(const WarehouseGuez::InjuryModelAgdusWh &im); private: std::shared_ptr m_dtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_edit_dialog.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_edit_dialog.h index de606c34a..7ee4c4564 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_edit_dialog.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_edit_dialog.h @@ -40,6 +40,8 @@ signals: void sendData(const WarehouseGuez::InjuryModelAgdusWh &data); protected: + +NGL::INGLLogger &m_logger; void onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_list.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_list.h index d525f0e68..d8ab95cd7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_list.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_list.h @@ -36,6 +36,8 @@ public: bool init(); protected: + +NGL::INGLLogger &m_logger; void onRemoveInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override; void onModifyInjuryModelAgdusWhReply(const Core::FunctionReplyObject &reply) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_model.h b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_model.h index 9c04c0bc5..aadef4a22 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_model.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Plugins/WarehouseManagement/Gui/injury_model_model.h @@ -32,6 +32,8 @@ public: QSet takenIds() const; private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_dtc; WarehouseGuez:: }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.cpp index 75f20c611..7e3afde31 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.cpp @@ -33,7 +33,7 @@ bool Api::init(const BuildingBsmConfig &bsmConfig) bool Api::triggerFlashlight(int bsmId, const QString &hostname, int numberOfFlashes, int pauseBetweenFlashesSec) { - DEBUG_LOG() << "triggerFlashlight bsmId=" << bsmId + DEBUG_LOG(m_logger) << "triggerFlashlight bsmId=" << bsmId << " hostname=" << hostname << " numberOfFlashes=" << numberOfFlashes << " pauseBetweenFlashesSec=" << pauseBetweenFlashesSec; @@ -46,7 +46,7 @@ bool Api::triggerFlashlightPulse(int bsmId, const QString &hostname, int choppedConfiguration, int flashDuration) { - DEBUG_LOG() << "triggerFlashlightPulse bsmId=" << bsmId + DEBUG_LOG(m_logger) << "triggerFlashlightPulse bsmId=" << bsmId << " hostname=" << hostname << " numberOfFlashes=" << numberOfFlashes << " pauseDuration=" << pauseDuration @@ -60,7 +60,7 @@ bool Api::triggerFlashlights( int numberOfFlashes, int choppedConfiguration, int flashDuration) { - DEBUG_LOG() << "triggerFlashlights numberOfFlashes=" << numberOfFlashes + DEBUG_LOG(m_logger) << "triggerFlashlights numberOfFlashes=" << numberOfFlashes << " pauseDuration=" << pauseDuration << " choppedConfiguration" << choppedConfiguration << " flashDuration=" << flashDuration; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.h index 621d06f91..4c9f92087 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_api.h @@ -50,6 +50,7 @@ Q_SIGNALS: DamageState damageState); void bsmStateChanged(const QVector &bsmStates); private: +NGL::INGLLogger &m_logger; SocketHandler *m_socketHandler; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.cpp index 50015005b..0ba822b04 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.cpp @@ -45,10 +45,10 @@ bool Socket::sendData(const QByteArray &data) { if (!isConnected()) { - WARNING_LOG() << "BSM " << m_config.id << ": Trying to send data but not connected!"; + WARNING_LOG(m_logger) << "BSM " << m_config.id << ": Trying to send data but not connected!"; return false; } - DEBUG_LOG() << "BSM " << m_config.id << ": sending data: 0x" << data.toHex(); + DEBUG_LOG(m_logger) << "BSM " << m_config.id << ": sending data: 0x" << data.toHex(); m_tcpSocket->write(data); m_tcpSocket->flush(); return true; @@ -57,7 +57,7 @@ bool Socket::sendData(const QByteArray &data) void Socket::setVersionInformation(int verMajor, int verMinor, int verRev, const QString &manufacturer) { m_versionInfo = QStringLiteral("%1.%2-%3 (%4)").arg(verMajor).arg(verMinor).arg(verRev).arg(manufacturer); - INFO_LOG() << "BSM " << m_config.id + INFO_LOG(m_logger) << "BSM " << m_config.id << ": version = " << m_versionInfo; } @@ -71,7 +71,7 @@ void Socket::gotAlive() void Socket::onConnected() { - INFO_LOG() << "BSM " << m_config.id << " is connected to " + INFO_LOG(m_logger) << "BSM " << m_config.id << " is connected to " << m_tcpSocket->peerAddress().toString() << ":" << m_tcpSocket->peerPort(); Telegrams::PanConfigurationSetup tele; tele.m_aliveMessage = s_aliveTimeout; @@ -83,7 +83,7 @@ void Socket::onConnected() void Socket::onDisconnected() { - INFO_LOG() << "BSM " << m_config.id << " is disconnected"; + INFO_LOG(m_logger) << "BSM " << m_config.id << " is disconnected"; m_versionInfo.clear(); startReconnectTimer(); emit disconnected(m_config.id); @@ -91,7 +91,7 @@ void Socket::onDisconnected() void Socket::onError(QAbstractSocket::SocketError error) { - DEBUG_LOG() << "BSM " << m_config.id + DEBUG_LOG(m_logger) << "BSM " << m_config.id << " can not connect to " << m_config.hostname << ":" << m_config.port << ": " << m_tcpSocket->errorString() << " (" << error << ");"; @@ -100,7 +100,7 @@ void Socket::onError(QAbstractSocket::SocketError error) void Socket::onConnect() { - DEBUG_LOG() << "BSM " << m_config.id + DEBUG_LOG(m_logger) << "BSM " << m_config.id << " trying to connect to " << m_config.hostname << ":" << m_config.port; m_tcpSocket->connectToHost(m_config.hostname, m_config.port); } @@ -112,7 +112,7 @@ void Socket::onReadyRead() void Socket::onAliveTimeout() { - WARNING_LOG() << "BSM " << m_config.id + WARNING_LOG(m_logger) << "BSM " << m_config.id << " alive timeout! Reconnecting"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.h index d32bf3298..1a45ca91c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket.h @@ -39,6 +39,7 @@ private Q_SLOTS: void onReadyRead(); void onAliveTimeout(); private: +NGL::INGLLogger &m_logger; void startReconnectTimer(); private: BuildingControlUnit::Bsm m_config; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.cpp index b09ad56f0..bd29ba61d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.cpp @@ -66,7 +66,7 @@ bool SocketHandler::triggerFlashlight(int bsmId, const QString &hostname, int nu Socket *s = hostname.isEmpty() ? getSocketForBsm(bsmId) : getSocketForBsm(hostname); if (!s) return false; - DEBUG_LOG() << "triggerFlashlight BSM Socket with socketId " << bsmId; + DEBUG_LOG(m_logger) << "triggerFlashlight BSM Socket with socketId " << bsmId; Telegrams::PanChoppedSignalFlashlight flash; flash.m_noOfFlashes = qBound(0, numberOfFlashes, 255); flash.m_pauseDuration = qBound(1, pauseBetweenFlashesSec, 10); @@ -83,7 +83,7 @@ bool SocketHandler::triggerFlashlightPulse(int bsmId, const QString &hostname, Socket *s = hostname.isEmpty() ? getSocketForBsm(bsmId) : getSocketForBsm(hostname); if (!s) return false; - DEBUG_LOG() << "triggerFlashlightPulse BSM Socket with socketId " << bsmId + DEBUG_LOG(m_logger) << "triggerFlashlightPulse BSM Socket with socketId " << bsmId << " hostname=" << hostname << " numberOfFlashes=" << numberOfFlashes << " pauseDuration=" << pauseDuration @@ -118,12 +118,12 @@ bool SocketHandler::triggerFlashlights(int numberOfFlashes, ++cntSocketsActive; } else - WARNING_LOG() << "BSM " << s->bsmConfig().id + WARNING_LOG(m_logger) << "BSM " << s->bsmConfig().id << " is not connected - can not activate flash light"; } if (cntSocketsActive == 0) { - WARNING_LOG() << "No active bsm - can not trigger flash light for all bsm"; + WARNING_LOG(m_logger) << "No active bsm - can not trigger flash light for all bsm"; return false; } return true; @@ -184,13 +184,13 @@ void SocketHandler::onDataAvailable(int id, const QByteArray &data) void SocketHandler::onSocketConnected(int id) { requestVersion(id); - DEBUG_LOG() << "BSM Socket with id " << id << " connected"; + DEBUG_LOG(m_logger) << "BSM Socket with id " << id << " connected"; m_bsmStateTimer.start(); } void SocketHandler::onSocketDisconnected(int id) { - DEBUG_LOG() << "BSM Socket with id " << id << " disconnected"; + DEBUG_LOG(m_logger) << "BSM Socket with id " << id << " disconnected"; m_socketData[id].clear(); m_bsmStateTimer.start(); } @@ -216,12 +216,12 @@ Socket *SocketHandler::getSocketForBsm(int bsmId) Socket *s = m_sockets.value(bsmId); if (!s) { - WARNING_LOG() << "Got invalid bsm id (" << bsmId << ") to trigger flashlight"; + WARNING_LOG(m_logger) << "Got invalid bsm id (" << bsmId << ") to trigger flashlight"; return nullptr; } if (!s->isConnected()) { - WARNING_LOG() << "Bsm with id " << bsmId + WARNING_LOG(m_logger) << "Bsm with id " << bsmId << " is not connected - can not activate flash light"; return nullptr; } @@ -269,7 +269,7 @@ void SocketHandler::parseBsmTelegram(int id, const QByteArray &baTele) if (!tele) return; if (tele->telId() != Telegrams::PanTelegramId::ALIVE) - DEBUG_LOG() << "Got tele from bsm with id " << id << ": " << tele->print(); + DEBUG_LOG(m_logger) << "Got tele from bsm with id " << id << ": " << tele->print(); switch (tele->telId()) { case Telegrams::PanTelegramId::ALIVE: @@ -317,7 +317,7 @@ void SocketHandler::parseBsmTelegram(int id, const QByteArray &baTele) bool SocketHandler::requestVersion(int id) { - DEBUG_LOG() << "Requesting version for BSM " << id; + DEBUG_LOG(m_logger) << "Requesting version for BSM " << id; Socket *s = m_sockets.value(id); if (!s || !s->isConnected()) return false; @@ -333,7 +333,7 @@ void SocketHandler::handleDirectFire(int id, const Telegrams::PanDirectFire *tel if (tele->m_ammunitionId == 0) { - WARNING_LOG() << "Got direct fire without valid ammunition - ignoring: " << tele->print(); + WARNING_LOG(m_logger) << "Got direct fire without valid ammunition - ignoring: " << tele->print(); return; } OpticalShot osNew; @@ -351,21 +351,21 @@ void SocketHandler::handleDirectFire(int id, const Telegrams::PanDirectFire *tel void SocketHandler::handleDirectFireSummray() { - DEBUG_LOG() << "handleDirectFireSummray m_lastShots.size=" << m_lastShots.size(); + DEBUG_LOG(m_logger) << "handleDirectFireSummray m_lastShots.size=" << m_lastShots.size(); OpticalShot osNew; if ( m_lastShots.size() == 0) return; int distance = 3000; - DEBUG_LOG() << "distance=" << distance; + DEBUG_LOG(m_logger) << "distance=" << distance; for (const OpticalShot &os : std::as_const(m_lastShots)) { int act_distance = os.deposition1 * os.deposition1 + os.deposition2 * os.deposition2; - DEBUG_LOG() << "act_distance=" << act_distance << " BSM-ID=" << os.id + DEBUG_LOG(m_logger) << "act_distance=" << act_distance << " BSM-ID=" << os.id << " ammunitionId=" << os.ammunitionId; if ( act_distance < distance) { distance = act_distance; - DEBUG_LOG() << "distance=" << distance << " BSM-ID=" << os.id; + DEBUG_LOG(m_logger) << "distance=" << distance << " BSM-ID=" << os.id; osNew = os; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.h index 9b5dfbdfc..aea9cb5f3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/BSM/bsm_socket_handler.h @@ -69,6 +69,8 @@ private Q_SLOTS: void handleDirectFireSummray(); private: + +NGL::INGLLogger &m_logger; Socket *getSocketForBsm(int bsmId); Socket *getSocketForBsm(const QString &hostname); QByteArray parseBuffer(int id, const QByteArray &buffer); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffect.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffect.cpp index 1300ec777..1f329b71f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffect.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffect.cpp @@ -61,22 +61,22 @@ void HandelEffect::handleEffect() switch (m_currentAction->aclass) { case AC_Unset: - DEBUG_LOG() << "---- This is unset ----"; + DEBUG_LOG(m_logger) << "---- This is unset ----"; break; case AC_Standard: { - DEBUG_LOG() << "---- This is a standard Action ----"; + DEBUG_LOG(m_logger) << "---- This is a standard Action ----"; if (!m_currentAction->url.isEmpty()) { - DEBUG_LOG() << "---- emit newHttpRequest(a->url):" << m_currentAction->url.toString(); + DEBUG_LOG(m_logger) << "---- emit newHttpRequest(a->url):" << m_currentAction->url.toString(); emit newHttpRequest(m_currentAction->url); } break; } case AC_Repeat: { - DEBUG_LOG() << "---- This is a Repeat Action"; + DEBUG_LOG(m_logger) << "---- This is a Repeat Action"; const RepeatAction *ra = static_cast(m_currentAction); HandelEffect *he = new HandelEffect(this); @@ -92,7 +92,7 @@ void HandelEffect::handleEffect() case AC_Pause: { const PauseAction *pa = static_cast(m_currentAction); - DEBUG_LOG() << "---- This is a Pause Action Pause=" << pa->pause + DEBUG_LOG(m_logger) << "---- This is a Pause Action Pause=" << pa->pause << " comment=" << pa->comment; QTimer::singleShot(pa->pause, this, &HandelEffect::handleEffect); @@ -102,11 +102,11 @@ void HandelEffect::handleEffect() } case AC_Bsm: { - DEBUG_LOG() << "---- This is a Bsm Action "; + DEBUG_LOG(m_logger) << "---- This is a Bsm Action "; const BsmAction *ba = static_cast(m_currentAction); if (!ba->isNull()) { - DEBUG_LOG() << "emit triggerAllFlashlights ------ atype=" << m_currentAction->atype + DEBUG_LOG(m_logger) << "emit triggerAllFlashlights ------ atype=" << m_currentAction->atype << " pause=" << ba->pause << " choplength=" << ba->choplength << " pulses=" << ba->pulses @@ -120,7 +120,7 @@ void HandelEffect::handleEffect() default: break; } - DEBUG_LOG() << "--- End Action "; + DEBUG_LOG(m_logger) << "--- End Action "; QTimer::singleShot(0, this, &HandelEffect::handleEffect); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffects.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffects.cpp index f9e522ba5..1ce6b5725 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffects.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/handeleffects.cpp @@ -22,7 +22,7 @@ HandelEffects::HandelEffects(QObject *parent, const QString &loggerchannel) , m_getRelayStateTimer(new QTimer(this)) , m_logger(getLogger(QStringLiteral("HandelEffects.") + loggerchannel)) { - DEBUG_LOG() << "HandelEffects::init loggerchannel=" << loggerchannel; + DEBUG_LOG(m_logger) << "HandelEffects::init loggerchannel=" << loggerchannel; @@ -40,7 +40,7 @@ void HandelEffects::init(const QString &controlEffectsCfg, const QString &hostna { m_xmlReader.init(controlEffectsCfg); - DEBUG_LOG() << "HandelEffects::init"; + DEBUG_LOG(m_logger) << "HandelEffects::init"; m_hostname = hostname; m_lastDamage = -1; m_effectType = et; @@ -53,7 +53,7 @@ void HandelEffects::startEffects(int damagePercent) { if (m_lastDamage == damagePercent) { - DEBUG_LOG() << "damagePercent=" << damagePercent + DEBUG_LOG(m_logger) << "damagePercent=" << damagePercent << " m_lastDamage=" << m_lastDamage << " return"; return; @@ -73,7 +73,7 @@ void HandelEffects::startEffects(int damagePercent) if (e->effectType == ET_Relay && m_effectType == ET_BsmFlash) continue; - DEBUG_LOG() << "- HandelEffects::Starting Effect " << e << " of Type " << e->effectType << ". ----" + DEBUG_LOG(m_logger) << "- HandelEffects::Starting Effect " << e << " of Type " << e->effectType << ". ----" << " name=" << e->name; for (const Range *range : e->constRanges()) { @@ -87,7 +87,7 @@ void HandelEffects::startEffects(int damagePercent) createEffectHandler(e, range); } - DEBUG_LOG() << "- End Effect "; + DEBUG_LOG(m_logger) << "- End Effect "; } m_lastDamage = damagePercent; } @@ -103,7 +103,7 @@ void HandelEffects::createEffectHandler(Effect *e, const Range *range) { if (m_effectType == ET_BsmFlash) { - INFO_LOG() << "setOverrides connect Flashes" ; + INFO_LOG(m_logger) << "setOverrides connect Flashes" ; connect(handelEffect, &HandelEffect::triggerAllFlashlights, this, &HandelEffects::triggerAllFlashlights, Qt::UniqueConnection); } else @@ -112,15 +112,15 @@ void HandelEffects::createEffectHandler(Effect *e, const Range *range) connect(handelEffect, &HandelEffect::effectReady, this, &HandelEffects::onEffectReady); - DEBUG_LOG() << "-- HandelEffects::Starting Range " << range->min << " - " << range->max + DEBUG_LOG(m_logger) << "-- HandelEffects::Starting Range " << range->min << " - " << range->max << ". ----"; - DEBUG_LOG() << "-- Range has " << range->actions.count() << " actions"; + DEBUG_LOG(m_logger) << "-- Range has " << range->actions.count() << " actions"; handelEffect->init(range->actions, 1); QTimer::singleShot(0, handelEffect, &HandelEffect::handleEffect); - DEBUG_LOG() << "-- End Range "; + DEBUG_LOG(m_logger) << "-- End Range "; } void HandelEffects::playHitSound(const int hitSoundId) @@ -162,18 +162,18 @@ void HandelEffects::switchRelay(const SwitchRelayValues &switchRelayValues) void HandelEffects::setOverrides(const QVector &effectStates) { m_effectStates = effectStates; - DEBUG_LOG() << "In set overrides for " << m_hostname << ", effectStates.size: " << effectStates.size(); + DEBUG_LOG(m_logger) << "In set overrides for " << m_hostname << ", effectStates.size: " << effectStates.size(); for(const auto &es : std::as_const(m_effectStates)) { - DEBUG_LOG() << "m_effectStates: es.id=" << es.id + DEBUG_LOG(m_logger) << "m_effectStates: es.id=" << es.id << ", es.type=" << es.type << ", es.override=" << es.effectOverride; } m_sounds = EffectOverride::EO_Auto; - DEBUG_LOG() << "Nun die Schleife:"; + DEBUG_LOG(m_logger) << "Nun die Schleife:"; for(const auto &es : std::as_const(effectStates)) { - DEBUG_LOG() << "es.id=" << es.id + DEBUG_LOG(m_logger) << "es.id=" << es.id << ", es.type=" << es.type << ", es.override=" << es.effectOverride; switch (es.type) { @@ -194,14 +194,14 @@ void HandelEffects::setOverrides(const QVector &effectStates) if (e->effectHandler) { disconnect(e->effectHandler, &HandelEffect::newHttpRequest, this, &HandelEffects::sendHttpRequest); - INFO_LOG() << "setOverrides emit triggerAllFlashlights(0,0,0,0)" ; + INFO_LOG(m_logger) << "setOverrides emit triggerAllFlashlights(0,0,0,0)" ; emit triggerAllFlashlights(0,0,0,0); } } } if (es.effectOverride == BEO_Off ) { - DEBUG_LOG() << "BEO_Off"; + DEBUG_LOG(m_logger) << "BEO_Off"; QUrl url = XmlReader::createPreparedUrl(contents(), m_hostname); QUrlQuery query; @@ -260,7 +260,7 @@ void HandelEffects::setOverrides(const QVector &effectStates) { if (e->effectHandler) { - INFO_LOG() << "setOverrides disconnect Flashes" ; + INFO_LOG(m_logger) << "setOverrides disconnect Flashes" ; disconnect (e->effectHandler, &HandelEffect::triggerAllFlashlights, this, &HandelEffects::triggerAllFlashlights); } } @@ -309,7 +309,7 @@ QVector HandelEffects::getOverrides() break; } - DEBUG_LOG() << "getOverrides " + DEBUG_LOG(m_logger) << "getOverrides " << " id=" << override.id << " type=" << override.type << " override" << override.effectOverride; @@ -335,7 +335,7 @@ void HandelEffects::sendHttpRequest(const QUrl &url) { QUrl copy = url; copy.setHost(m_hostname); - DEBUG_LOG() << "sendHttpRequest" << copy.toString(); + DEBUG_LOG(m_logger) << "sendHttpRequest" << copy.toString(); emit newHttpRequest(copy, HandleHttpQueueMessageStatus::MS_Single); } @@ -349,7 +349,7 @@ void HandelEffects::onRelayStateTimerTimeout() emit sendRelayState(m_relayState); m_overridesSend = false; } - DEBUG_LOG() << "send get relay-State contents()=" << contents().toString() + DEBUG_LOG(m_logger) << "send get relay-State contents()=" << contents().toString() << " m_offlineCounter=" << m_offlineCounter; QUrl url = XmlReader::createPreparedUrl(contents(), m_hostname); url.setPath(QStringLiteral("/relay.php")); @@ -364,12 +364,12 @@ void HandelEffects::onRelayStateTimerTimeout() void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray &data) { bool relayStateChanged = false; - TRACE_LOG() << "handleEgcuReply Object:" << data + TRACE_LOG(m_logger) << "handleEgcuReply Object:" << data << " m_offlineState=" << m_offlineState; if (m_offlineState) { - DEBUG_LOG() << "State wiederherstellen !!!!!!!!!!! m_offlineState=" << m_offlineState; + DEBUG_LOG(m_logger) << "State wiederherstellen !!!!!!!!!!! m_offlineState=" << m_offlineState; m_offlineState = false; setOverrides(m_effectStates); } @@ -384,7 +384,7 @@ void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray rsi.id = it.key().toInt(); rsi.state = it.value().isString() ? (it.value().toString().compare(QLatin1String("on"), Qt::CaseInsensitive) == 0) : it.value().toBool(false); m_relayState.relayStates.append(rsi); - TRACE_LOG() << "id=" << rsi.id + TRACE_LOG(m_logger) << "id=" << rsi.id << " state=" << rsi.state; } if ( m_relayState.relayStates.size() == lastRelayState.relayStates.size()) @@ -393,19 +393,19 @@ void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray { if (m_relayState.relayStates[i].state != lastRelayState.relayStates[i].state) { - TRACE_LOG() << "Values relayStateChanged = true"; + TRACE_LOG(m_logger) << "Values relayStateChanged = true"; relayStateChanged = true; } } } else { - TRACE_LOG() << "Size relayStateChanged = true"; + TRACE_LOG(m_logger) << "Size relayStateChanged = true"; relayStateChanged = true; } if ( m_offlineCounter > 1) { - TRACE_LOG() << "m_offlineCounter=" << m_offlineCounter; + TRACE_LOG(m_logger) << "m_offlineCounter=" << m_offlineCounter; relayStateChanged = true; } @@ -413,7 +413,7 @@ void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray m_relayState.stateTime = QDateTime::currentMSecsSinceEpoch(); m_relayState.offlineTime = 0; m_offlineCounter=0; - DEBUG_LOG() << "host=" << host.toLower() + DEBUG_LOG(m_logger) << "host=" << host.toLower() << " relayStateChanged=" << relayStateChanged << " m_overridesSend=" << m_overridesSend << " m_offlineState=" << m_offlineState; @@ -427,7 +427,7 @@ void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray if ( m_relayState.hostname.toLower() == host.toLower() && relayStateChanged) { - DEBUG_LOG() << "emit sendRelayState(m_relayState) relayStateChanged"; + DEBUG_LOG(m_logger) << "emit sendRelayState(m_relayState) relayStateChanged"; emit sendRelayState(m_relayState); } } @@ -435,7 +435,7 @@ void HandelEffects::handleEgcuReplyObject(const QString &host, const QByteArray void HandelEffects::handleEgcuReplyArray(const QString &host, const QByteArray &data) { Q_UNUSED (host); - TRACE_LOG() << "handleEgcuReply Array:" << data; + TRACE_LOG(m_logger) << "handleEgcuReply Array:" << data; m_relayState.relayStates.clear(); const QJsonObject jsonObject = QJsonDocument::fromJson(data).object(); @@ -449,7 +449,7 @@ void HandelEffects::handleEgcuReplyArray(const QString &host, const QByteArray & rsi.id = i; rsi.state = stateArray[i].isString() ? (stateArray[i].toString().compare(QLatin1String("on"), Qt::CaseInsensitive)== 0 ): stateArray[i].toBool(false); m_relayState.relayStates.append(rsi); - TRACE_LOG() << "id=" << rsi.id + TRACE_LOG(m_logger) << "id=" << rsi.id << " state=" << rsi.state; } @@ -466,7 +466,7 @@ void HandelEffects::handleEgcuReplyArray(const QString &host, const QByteArray & void HandelEffects::handleEgcuReply(const QString &host, const QByteArray &data) { - DEBUG_LOG() << "HandelEffects::handleEgcuReply host=" << host + DEBUG_LOG(m_logger) << "HandelEffects::handleEgcuReply host=" << host << " m_hostname=" << m_hostname << " m_overridesSend=" << m_overridesSend; @@ -477,18 +477,18 @@ void HandelEffects::handleEgcuReply(const QString &host, const QByteArray &data) if (!jsonObject.contains(QStringLiteral("State")) ) { m_overridesSend = true; - TRACE_LOG() << "No State return"; + TRACE_LOG(m_logger) << "No State return"; return; } const QJsonValue jsonValue = jsonObject[QStringLiteral("State")]; if (jsonValue.isArray()) { - TRACE_LOG() << "data isArray\n"; + TRACE_LOG(m_logger) << "data isArray\n"; handleEgcuReplyArray(host, data); } else { - TRACE_LOG() << "data isObject\n"; + TRACE_LOG(m_logger) << "data isObject\n"; handleEgcuReplyObject(host, data); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.cpp index 10e103f63..e41caff0e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.cpp @@ -21,11 +21,11 @@ bool XmlReader::init(const QString &effectConfigFile) m_contents.effects.clear(); QFile file(effectConfigFile); - DEBUG_LOG() << "open effectConfigFile: " << effectConfigFile; + DEBUG_LOG(m_logger) << "open effectConfigFile: " << effectConfigFile; if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) { - WARNING_LOG() << "Couldn't open EffectConfigFile: " << effectConfigFile; + WARNING_LOG(m_logger) << "Couldn't open EffectConfigFile: " << effectConfigFile; return false; } @@ -63,18 +63,18 @@ bool XmlReader::init(const QString &effectConfigFile) if (xml.hasError()) { - ERROR_LOG() << "Effect Config File had XML Errors:\n" << xml.errorString(); + ERROR_LOG(m_logger) << "Effect Config File had XML Errors:\n" << xml.errorString(); return false; } - DEBUG_LOG() << "Effect Config File Contents: " << m_contents.toString(); + DEBUG_LOG(m_logger) << "Effect Config File Contents: " << m_contents.toString(); createHttpRequests(); return true; } Effect *XmlReader::parseEffect(QXmlStreamReader &xml) { - DEBUG_LOG() << "- parseEffect Start"; + DEBUG_LOG(m_logger) << "- parseEffect Start"; if (xml.tokenType() != QXmlStreamReader::StartElement || xml.name() != QStringLiteral("effect")) @@ -125,12 +125,12 @@ Effect *XmlReader::parseEffect(QXmlStreamReader &xml) } xml.readNext(); } - DEBUG_LOG() << "- parseEffect: Name: " << e->id + DEBUG_LOG(m_logger) << "- parseEffect: Name: " << e->id << ", Type: " << e->effectType << ", Category: " << e->category << ", Name: " << e->name << ", override: " << e->override; - DEBUG_LOG() << "- parseEffect End. It has " << e->ranges.size() << " ranges"; + DEBUG_LOG(m_logger) << "- parseEffect End. It has " << e->ranges.size() << " ranges"; return e; } @@ -140,7 +140,7 @@ Range *XmlReader::parseRange(QXmlStreamReader &xml) xml.name() != QStringLiteral("range")) return {}; - DEBUG_LOG() << "-- parseRange Start"; + DEBUG_LOG(m_logger) << "-- parseRange Start"; Range *r = new Range(); QXmlStreamAttributes attributes = xml.attributes(); @@ -164,10 +164,10 @@ Range *XmlReader::parseRange(QXmlStreamReader &xml) xml.readNext(); } - DEBUG_LOG() << "-- parseRange: [" << r->min << "-" << r->max << "]" + DEBUG_LOG(m_logger) << "-- parseRange: [" << r->min << "-" << r->max << "]" << ", restartOnChange: " <restartOnChange << ", ActionCount: " << r->actions.count(); - DEBUG_LOG() << "-- parseRange End"; + DEBUG_LOG(m_logger) << "-- parseRange End"; return r; } @@ -188,7 +188,7 @@ Action *XmlReader::parseAction(QXmlStreamReader &xml) if (xml.name() == QStringLiteral("bsm")) return parseBsmAction(xml); - WARNING_LOG() << "--- parseUnknownAction with name '" << xml.name().string() << "'cannot be handled."; + WARNING_LOG(m_logger) << "--- parseUnknownAction with name '" << xml.name().string() << "'cannot be handled."; return {}; } @@ -198,18 +198,18 @@ PauseAction *XmlReader::parsePauseAction(QXmlStreamReader &xml) xml.name() != QLatin1String("pause")) return {}; - DEBUG_LOG() << "--- parsePauseAction Start"; + DEBUG_LOG(m_logger) << "--- parsePauseAction Start"; QXmlStreamAttributes attributes = xml.attributes(); PauseAction *p = new PauseAction(); p->atype = static_cast(attributes.value(QStringLiteral("type")).toInt()); if (attributes.hasAttribute(QStringLiteral("comment"))) p->comment = attributes.value(QStringLiteral("comment")).toString(); p->pause = xml.readElementText().toInt(); - DEBUG_LOG() << "--- parsePauseAction: " + DEBUG_LOG(m_logger) << "--- parsePauseAction: " << " Pause: " << p->pause << ", Comment: " << p->comment; - DEBUG_LOG() << "--- parsePauseAction End"; + DEBUG_LOG(m_logger) << "--- parsePauseAction End"; return p; } @@ -218,7 +218,7 @@ RepeatAction *XmlReader::parseRepeatAction(QXmlStreamReader &xml) if (xml.tokenType() != QXmlStreamReader::StartElement || xml.name() != QStringLiteral("repeat")) return {}; - DEBUG_LOG() << "--- parseRepeatAction Start"; + DEBUG_LOG(m_logger) << "--- parseRepeatAction Start"; RepeatAction *ra = new RepeatAction(); QXmlStreamAttributes attributes = xml.attributes(); @@ -244,8 +244,8 @@ RepeatAction *XmlReader::parseRepeatAction(QXmlStreamReader &xml) QString repetitions = QString::number(ra->count); if (ra->count < 0) repetitions = QLatin1String("Infinite"); - DEBUG_LOG() << "--- parseRepeatAction: Repetitions: " << repetitions << ", Comment: " << ra->comment; - DEBUG_LOG() << "--- parseRepeatAction End"; + DEBUG_LOG(m_logger) << "--- parseRepeatAction: Repetitions: " << repetitions << ", Comment: " << ra->comment; + DEBUG_LOG(m_logger) << "--- parseRepeatAction End"; return ra; } @@ -256,7 +256,7 @@ Action *XmlReader::parseStandardAction(QXmlStreamReader &xml) xml.name() != QStringLiteral("action")) return {}; - DEBUG_LOG() << "--- parseStandardAction Start"; + DEBUG_LOG(m_logger) << "--- parseStandardAction Start"; QXmlStreamAttributes attributes = xml.attributes(); @@ -269,9 +269,9 @@ Action *XmlReader::parseStandardAction(QXmlStreamReader &xml) a->atype = static_cast(attributes.value(QStringLiteral("type")).toInt()); if (attributes.hasAttribute(QStringLiteral("comment"))) a->comment = attributes.value(QStringLiteral("comment")).toString(); - DEBUG_LOG() << "--- parseStandardAction: Type: " << a->atype + DEBUG_LOG(m_logger) << "--- parseStandardAction: Type: " << a->atype << ", Comment: " << a->comment; - DEBUG_LOG() << "--- parseStandardAction End"; + DEBUG_LOG(m_logger) << "--- parseStandardAction End"; return a; } @@ -280,7 +280,7 @@ BsmAction *XmlReader::parseBsmAction(QXmlStreamReader &xml) QXmlStreamAttributes attributes = xml.attributes(); - DEBUG_LOG() << "--- parseBsmAction Start"; + DEBUG_LOG(m_logger) << "--- parseBsmAction Start"; BsmAction *a = new BsmAction(); a->atype = static_cast(attributes.value(QStringLiteral("type")).toInt()); if (attributes.hasAttribute(QStringLiteral("comment"))) @@ -302,14 +302,14 @@ BsmAction *XmlReader::parseBsmAction(QXmlStreamReader &xml) xml.readNext(); } - DEBUG_LOG() << "--- parseBsmAction: Type: " << a->atype + DEBUG_LOG(m_logger) << "--- parseBsmAction: Type: " << a->atype << ", Pause: " << a->pause << ", Choplength: " << a->choplength << ", Count: " << a->count << ", Pulses: " << a->pulses << ", Pulseduration: " << a->pulseduration << ", Comment: " << a->comment; - DEBUG_LOG() << "--- parseBsmAction End"; + DEBUG_LOG(m_logger) << "--- parseBsmAction End"; return a; } @@ -384,7 +384,7 @@ void XmlReader::generateUrl(const Effect *e, Action *a) } url.setQuery(query); a->url = url; - DEBUG_LOG() << "Effect " << e->name << ", Action '" << a->comment << "' now has URL: " << url.toString(); + DEBUG_LOG(m_logger) << "Effect " << e->name << ", Action '" << a->comment << "' now has URL: " << url.toString(); break; } case AC_Repeat: @@ -397,7 +397,7 @@ void XmlReader::generateUrl(const Effect *e, Action *a) case AC_Pause: case AC_Bsm: default: - DEBUG_LOG() << "Effect " << e->name << ", Action '" << a->comment << "' of Type " << a->aclass << " needs no URL"; + DEBUG_LOG(m_logger) << "Effect " << e->name << ", Action '" << a->comment << "' of Type " << a->aclass << " needs no URL"; break; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.h index 8a012b98f..1d2dd387f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/ControlEffects/xmlreader.h @@ -178,6 +178,7 @@ public: XmlContents contents() const { return m_contents; } private: + NGL::INGLLogger &m_logger; void createHttpRequests(); static QString categoryName(Category c); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.cpp index 48612109d..1b9a54ce4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.cpp @@ -65,7 +65,7 @@ void Api::sendHitResult(const HitResult &hitResult, const QMap telegramId(): " << tele->telegramId(); + DEBUG_LOG(m_logger) << "tele->telegramId(): " << tele->telegramId(); if (tele->telegramId() == Telegrams::SetDamageState::telegramId()) { @@ -271,7 +271,7 @@ void Api::onTelegramReceived(const std::shared_ptr &tel emit getBsmTechnicalStatus(tel->sensorId); return; } - WARNING_LOG() << "Received unhandled telegram " << tele->telegramId(); + WARNING_LOG(m_logger) << "Received unhandled telegram " << tele->telegramId(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.h index 711ad649a..b27f71490 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/json_api.h @@ -76,6 +76,7 @@ Q_SIGNALS: private Q_SLOTS: void onTelegramReceived(const std::shared_ptr &tele); private: +NGL::INGLLogger &m_logger; WebSocketHandler *m_webSocketHandler; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.cpp index 60f3c9c46..d29af15a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.cpp @@ -11,10 +11,9 @@ namespace BuildingControlUnit { namespace Json { -WebSocketHandler::WebSocketHandler(QObject *parent) - : QObject(parent) - , m_webSocketServer(new QWebSocketServer(QStringLiteral("BCU"), QWebSocketServer::NonSecureMode, this)) -{} +WebSocketHandler::WebSocketHandler(QObject *parent) : QObject(parent) + , m_webSocketServer(new QWebSocketServer(QStringLiteral("BCU"), QWebSocketServer::NonSecureMode, this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} WebSocketHandler::~WebSocketHandler() { @@ -30,7 +29,7 @@ bool WebSocketHandler::init(quint16 listenPort) { if (!m_webSocketServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting"; + WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting"; return false; } @@ -48,7 +47,7 @@ bool WebSocketHandler::sendTelegram(const Telegrams::BaseTelegram *tele, QWebSoc return false; const QString jsonStr = QString::fromUtf8(tele->toJson()); - DEBUG_LOG() << "jsonStr" << jsonStr; + DEBUG_LOG(m_logger) << "jsonStr" << jsonStr; bool bOk = false; for (QWebSocket *ws : std::as_const(m_webSockets)) @@ -68,7 +67,7 @@ void WebSocketHandler::onNewConnection() QWebSocket *ws = m_webSocketServer->nextPendingConnection(); if (!ws) return; - DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); + DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); connect(ws, &QWebSocket::textMessageReceived, this, &WebSocketHandler::onTextMessageReceived); @@ -82,11 +81,11 @@ void WebSocketHandler::onNewConnection() void WebSocketHandler::onTextMessageReceived(const QString &msg) { - DEBUG_LOG() << "new text message: " << msg; + DEBUG_LOG(m_logger) << "new text message: " << msg; auto tele = std::shared_ptr(Telegrams::BaseTelegram::telegramFromJson(msg.toUtf8())); if (!tele) { - WARNING_LOG() << "Error parsing incoming json data: '" << msg << "'"; + WARNING_LOG(m_logger) << "Error parsing incoming json data: '" << msg << "'"; return; } emit telegramReceived(tele); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.h index 87c14e7e8..7971e8ac5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/Json/web_socket_handler.h @@ -41,6 +41,7 @@ private Q_SLOTS: void onWebSocketDisconnected(); void onTextMessageReceived(const QString &msg); private: + NGL::INGLLogger &m_logger; QWebSocketServer *m_webSocketServer; QSet m_webSockets; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.cpp index 937876e48..6ce133f7f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.cpp @@ -13,10 +13,9 @@ #include -Test::Test() - : m_api(new BuildingControlUnit::VWM::Api(this)) - .getNGLLogger("BCU.VWM.Test")) -{ +Test::Test() : m_api(new BuildingControlUnit::VWM::Api(this)) + .getNGLLogger("BCU.VWM.Test")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_api, &BuildingControlUnit::VWM::Api::hitResult, this, &Test::hitResult); QTimer::singleShot(0, this, &Test::test1); @@ -29,7 +28,7 @@ Test::~Test() void Test::hitResult(const BuildingControlUnit::HitResult &result) { - INFO_LOG() << "Hit Result: sensorId = " << result.sensorId + INFO_LOG(m_logger) << "Hit Result: sensorId = " << result.sensorId << ", originatorId = " << result.originatorId << ", chargeTypeId = " << result.chargeTypeId << ", dmgPercentOld = " << result.damagePercentOld @@ -54,18 +53,18 @@ void Test::test1() const auto hitPos = BuildingControlUnit::VWM::Math::checkBsmPosition(bsm.position, bsm.direction, rooms); if (hitPos.state != BuildingControlUnit::VWM::HitPosition::State::OuterWall) { - WARNING_LOG() << "Effect on bsm " << bsm.id << " does not hit building ! - position: " + WARNING_LOG(m_logger) << "Effect on bsm " << bsm.id << " does not hit building ! - position: " << bsm.position << ", direction: " << bsm.direction; } else if (hitPos.distance < 0) { - WARNING_LOG() << "Effect on bsm " << bsm.id << " results in hit pos behind a wall (" + WARNING_LOG(m_logger) << "Effect on bsm " << bsm.id << " results in hit pos behind a wall (" << hitPos.distance << "m) instead in front - BSM is not modelled in the correct place: " << bsm.position << ", direction: " << bsm.direction << ", roomId which was hit: " << hitPos.roomId; } else { - DEBUG_LOG() << "BSM with id " << bsm.id << " looks fine - room which will be hit: " << hitPos.roomId; + DEBUG_LOG(m_logger) << "BSM with id " << bsm.id << " looks fine - room which will be hit: " << hitPos.roomId; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.h index f60085971..750860d2c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/test_read_xml.h @@ -24,4 +24,5 @@ private Q_SLOTS: void test5(); void test6(); private: +NGL::INGLLogger &m_logger; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.cpp index 3964d8173..09f8f612c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.cpp @@ -38,7 +38,7 @@ bool Api::init(const QString &chargesConfig, const BuildingBsmConfig &bsmConfig, const bool initBuilding) { - DEBUG_LOG() << "chargesConfig=" << chargesConfig; + DEBUG_LOG(m_logger) << "chargesConfig=" << chargesConfig; if (!XmlReader::readCharges(chargesConfig, m_chargeMap)) return false; if (!XmlReader::readBuilding(vulBuildingConfig, m_building)) @@ -48,21 +48,21 @@ bool Api::init(const QString &chargesConfig, QString fltXml = QString(QStringLiteral("/opt/BuildingModels/StaticMeshes/%1.flt.xml")).arg(m_building.name()); if (!XmlReader::readBuildingGeometry(fltXml, m_buildingRoomGeometry )) { - ERROR_LOG() << "Error reading buildingRoomGeometry from file: " << fltXml << "'"; + ERROR_LOG(m_logger) << "Error reading buildingRoomGeometry from file: " << fltXml << "'"; } - DEBUG_LOG() << "Building buildingRoomGeometry read successfully from file: " << fltXml << "'"; + DEBUG_LOG(m_logger) << "Building buildingRoomGeometry read successfully from file: " << fltXml << "'"; int numberOfRemoved = m_building.cleanupPolygons(); int numberOfDuplicates = m_building.checkPolygons(); - DEBUG_LOG() << "Building cleanupPolygons: " << m_building.name() << "' -> " << numberOfRemoved << " points removed"; + DEBUG_LOG(m_logger) << "Building cleanupPolygons: " << m_building.name() << "' -> " << numberOfRemoved << " points removed"; if (numberOfDuplicates > 0) - ERROR_LOG() << "Building checkPolygons: " << m_building.name() << "' -> " << numberOfDuplicates << " duplicates"; + ERROR_LOG(m_logger) << "Building checkPolygons: " << m_building.name() << "' -> " << numberOfDuplicates << " duplicates"; else - DEBUG_LOG() << "Building checkPolygons: " << m_building.name() << "' -> " << numberOfDuplicates << " duplicates"; + DEBUG_LOG(m_logger) << "Building checkPolygons: " << m_building.name() << "' -> " << numberOfDuplicates << " duplicates"; m_bsmMap = bsmConfig.bsmMap; @@ -85,7 +85,7 @@ void Api::onHitOptical(qint64 timeMSec, int sensorId, int originatorId, int char if (!bsm.isValid()) { - WARNING_LOG() << "Given bsm id " << sensorId << " is not in our internal bsm list!"; + WARNING_LOG(m_logger) << "Given bsm id " << sensorId << " is not in our internal bsm list!"; return; } @@ -105,7 +105,7 @@ void Api::onHitOptical(qint64 timeMSec, int sensorId, int originatorId, int char void Api::onSetEffectStatesRequest(const QString &hostname, const QVector &effectStates) { - DEBUG_LOG() << "onSetEffectStatesRequest:" + DEBUG_LOG(m_logger) << "onSetEffectStatesRequest:" << " hostname= " << hostname << " effectStes.zize=" << effectStates.size(); @@ -120,7 +120,7 @@ void Api::onSetEffectStatesRequest(const QString &hostname, const QVector found no room"; } else { if (roomsWithDetonation.size() == 1) - INFO_LOG() << "XXXX Building '" << m_building.name() << "'" + INFO_LOG(m_logger) << "XXXX Building '" << m_building.name() << "'" << ", detonationLocation = " << detonationLocation << " -> found just one room: " << roomsWithDetonation.first(); else - INFO_LOG() << "XXXX Building '" << m_building.name() << "'" + INFO_LOG(m_logger) << "XXXX Building '" << m_building.name() << "'" << ", detonationLocation = " << detonationLocation << " -> found several rooms, choose first: " << roomsWithDetonation.first(); @@ -541,7 +541,7 @@ void Api::onHitCes3D_Evaluation(const qint64 effectTimeMSec, LtsUtils::QPoint3D directionWallElementPointToDetonationOut; NearestWall nearestWall = findNearestWall(detonationLocation, distanceOut, directionWallElementPointToDetonationOut); - INFO_LOG() << "XXXXX CES Hit outside building - searching nearest wall ..." + INFO_LOG(m_logger) << "XXXXX CES Hit outside building - searching nearest wall ..." << ", detonationDistance = " << detonationDistance << ", nearestWall.roomId = " << nearestWall.roomId; @@ -588,7 +588,7 @@ void Api::onHitCes3D_Evaluation(const qint64 effectTimeMSec, bool hitSuccess = m_building.hit(LtsUtils::QPoint3D(), LtsUtils::QPoint3D(), charge, &hitPosPreCalculated); - INFO_LOG() << "onHitCes3D_Evaluation hitSuccess=" << hitSuccess; + INFO_LOG(m_logger) << "onHitCes3D_Evaluation hitSuccess=" << hitSuccess; result.rooms = m_building.roomStates(); result.damageState = m_building.damageState(); @@ -627,7 +627,7 @@ void Api::onFortifyFactorRequest(int originatorId, const QVector &f void Api::onRelayStatesRequest(const QString &hostname, const QVector &relayStateInfos) { - DEBUG_LOG() << "onRelayStateRequest hostname=" << hostname + DEBUG_LOG(m_logger) << "onRelayStateRequest hostname=" << hostname << " only hanlde in svcBuildings" << " relayStateInfos.size()=" << relayStateInfos.size(); } @@ -649,14 +649,14 @@ void Api::sendOverrides() QJsonObject docObj = QJsonObject(doc.object()); - DEBUG_LOG() << "sendOverrides hostname=" << hostname + DEBUG_LOG(m_logger) << "sendOverrides hostname=" << hostname << " properties=" << properties; { - DEBUG_LOG() << "sendOverrides hostname=" << hostname + DEBUG_LOG(m_logger) << "sendOverrides hostname=" << hostname << " properties=" << properties << "BCU-Flash"; BcuEffectState bcuEffectState; bcuEffectState.id = 1; @@ -677,7 +677,7 @@ void Api::sendOverrides() } if (eo != BcuEffectOverride::BEO_Auto) { - DEBUG_LOG() << "bcuEffectState.effectOverride = eo" << eo; + DEBUG_LOG(m_logger) << "bcuEffectState.effectOverride = eo" << eo; bcuEffectState.effectOverride = eo; emit newOverrides({}, {bcuEffectState}); } @@ -726,7 +726,7 @@ void Api::sendHitToVwm(const Hit &hit) { m_hitsSinceLastInit += hit; - INFO_LOG() << " XXXXX sendHitToVwm, Incoming hit=" << hit + INFO_LOG(m_logger) << " XXXXX sendHitToVwm, Incoming hit=" << hit << " hit.chargeTypeId=" << hit.chargeTypeId << " originatorId=" << hit.originatorId << " typeOfHit=" << hit.typeOfHit; @@ -753,7 +753,7 @@ void Api::sendHitToVwm(const Hit &hit) charge.penetrationEffect = hit.penetrationFactor; } - DEBUG_LOG() << "charge=" << charge.chargeTypeId + DEBUG_LOG(m_logger) << "charge=" << charge.chargeTypeId << " destructiveFactor" << charge.destructiveFactor << " penetrationEffect" << charge.penetrationEffect; chargeOrg = charge; @@ -770,23 +770,23 @@ void Api::sendHitToVwm(const Hit &hit) LtsUtils::QPoint3D dummyDist = hit.position - hit.direction; - INFO_LOG() << " XXXX CES outside bulding, reduce charge: " << charge + INFO_LOG(m_logger) << " XXXX CES outside bulding, reduce charge: " << charge << ", hit.position " << hit.position << ", hit.direction " << hit.direction << ", dummyDist " << dummyDist.length(); charge.destructiveFactor *= 0.5; charge.penetrationEffect *= 0.5; - INFO_LOG() << " XXXX CES outside bulding, reduce charge: " << charge; + INFO_LOG(m_logger) << " XXXX CES outside bulding, reduce charge: " << charge; } if (!charge.isValid()) { if (hit.originatorType == OriginatorType::CesHit) - WARNING_LOG() << "Charge with id " << hit.chargeTypeId + WARNING_LOG(m_logger) << "Charge with id " << hit.chargeTypeId << " not configured - can not caluclate impact effect for this charge"; else { - WARNING_LOG() << "Direct charge with id " << hit.chargeTypeId + WARNING_LOG(m_logger) << "Direct charge with id " << hit.chargeTypeId << " not configured - can not caluclate impact effect for this charge"; emit unknownDirectHit(hit.sensorId); } @@ -794,7 +794,7 @@ void Api::sendHitToVwm(const Hit &hit) } if (!m_building.hit(hit.position, hit.direction, charge)) { - WARNING_LOG() << "Detected hit was outside of the building - ignored"; + WARNING_LOG(m_logger) << "Detected hit was outside of the building - ignored"; break; } result.rooms = m_building.roomStates(); @@ -832,7 +832,7 @@ void Api::sendHitToVwm(const Hit &hit) { case DamageState::NoDamage: { - DEBUG_LOG() << "Hit OC/ECC with NoDamage"; + DEBUG_LOG(m_logger) << "Hit OC/ECC with NoDamage"; m_building.init(); result.effectSoundId = Settings::effectSoundIdEccActivate(); @@ -855,7 +855,7 @@ void Api::sendHitToVwm(const Hit &hit) } case DamageState::Destroyed: { - DEBUG_LOG() << "Hit OC/ECC with Destroyed"; + DEBUG_LOG(m_logger) << "Hit OC/ECC with Destroyed"; const DamageState dsOld = m_building.damageState(); m_building.destroyAllRooms(); @@ -879,14 +879,14 @@ void Api::sendHitToVwm(const Hit &hit) break; } default: - WARNING_LOG() << "Invalid damage state override given: " << hit.damageStateOverride; + WARNING_LOG(m_logger) << "Invalid damage state override given: " << hit.damageStateOverride; result = HitResult(); break; } break; } case OriginatorType::Unknown: - WARNING_LOG() << "Unknown originator type given: " << hit.originatorType; + WARNING_LOG(m_logger) << "Unknown originator type given: " << hit.originatorType; result = HitResult(); break; } @@ -905,7 +905,7 @@ const Charge Api::chargeFromChargeTypeId(int chargeTypeId) const for (auto i = m_chargeMap.cbegin(), end = m_chargeMap.cend(); i != end; ++i) { - TRACE_LOG() << "key=" << i.key() << " value=" << i.value(); + TRACE_LOG(m_logger) << "key=" << i.key() << " value=" << i.value(); if ( chargeTypeId == i.value().id) return m_chargeMap.value(i.key()); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.h index 8d27466ef..1beb276a9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_api.h @@ -77,6 +77,7 @@ Q_SIGNALS: void newOverrides( const QString &hostname, const QVector &effectStates); void unknownDirectHit(int sensorId); private: +NGL::INGLLogger &m_logger; void sendHitToVwm(const Hit &hit); private: QMap m_bsmMap; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.cpp index 66b27aef6..133a42448 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.cpp @@ -354,7 +354,7 @@ int Building::cleanupDublicatePointsInPolygon(int roomId, int idx, int subIdx, c auto p2 = points.at(j); if (qFuzzyCompare(p1, p2)) { - DEBUG_LOG() << "Building '" << m_name << "' -> " + DEBUG_LOG(m_logger) << "Building '" << m_name << "' -> " << "Polygon point " << i << " (" << p1 << ") and " << j << " (" << p2 << ") in room " << roomId << ", " << type << "[" << idx << "], element[" << subIdx << "] are the same! -> REMOVE"; @@ -410,7 +410,7 @@ QVector Building::roomStates() const hr.fortifyFactor = room.fortifyFactor(); hr.directHit = room.isDirectHit(); ret += hr; - DEBUG_LOG() << "HitRoom " << hr.roomId + DEBUG_LOG(m_logger) << "HitRoom " << hr.roomId << " damage: " << hr.damagePercent << "%, remainEffect: " << hr.remainingEffectPercent << "%" << ", remainingEffectChargeTypeId: " << hr.remainingEffectChargeTypeId << "%" @@ -448,7 +448,7 @@ void Building::setRoomState(DamageState damageState, const QVector &afffect auto it = m_rooms.find(roomId); if (it == m_rooms.end()) { - WARNING_LOG() << "Could not find room with id " << roomId; + WARNING_LOG(m_logger) << "Could not find room with id " << roomId; continue; } if (damageState == DamageState::Destroyed) @@ -465,7 +465,7 @@ void Building::setFortifyInfo(const QVector &foritfyInfos) auto it = m_rooms.find(info.roomId); if (it == m_rooms.end()) { - WARNING_LOG() << "Could not find room with id " << info.roomId; + WARNING_LOG(m_logger) << "Could not find room with id " << info.roomId; continue; } Room &room = it.value(); @@ -538,14 +538,14 @@ bool Building::hit(const LtsUtils::QPoint3D &pos, const LtsUtils::QPoint3D &dir, const bool bBelowGround = isLastHitPositionBelowGroundHack(); if (bBelowGround) { - INFO_LOG() << " XXXX CES belowGround, reduce charge: " << charge; + INFO_LOG(m_logger) << " XXXX CES belowGround, reduce charge: " << charge; charge.destructiveFactor *= 0.25; charge.penetrationEffect *= 0.25; - INFO_LOG() << " XXXX CES belowGround, reduce charge: " << charge; + INFO_LOG(m_logger) << " XXXX CES belowGround, reduce charge: " << charge; } - INFO_LOG() << "XXXXX HitPosition: state=" << m_lastHitPosition.state + INFO_LOG(m_logger) << "XXXXX HitPosition: state=" << m_lastHitPosition.state << ", m_name=" << m_name << ", m_modelId=" << m_modelId << ", roomId=" << m_lastHitPosition.roomId @@ -560,7 +560,7 @@ bool Building::hit(const LtsUtils::QPoint3D &pos, const LtsUtils::QPoint3D &dir, Room &hitRoom = m_rooms[m_lastHitPosition.roomId]; if (!hitRoom.isValid()) { - ERROR_LOG() << "Internal error in hit calculation - could not find room with id " << m_lastHitPosition.roomId; + ERROR_LOG(m_logger) << "Internal error in hit calculation - could not find room with id " << m_lastHitPosition.roomId; return false; } @@ -651,7 +651,7 @@ QMap Building::checkHitNeighbours(const QMap Building::checkHitNeighbours(const QMap new: " << neighbour.remainingEffect(); @@ -740,7 +740,7 @@ int Building::checkDublicatePointsInPolygon(int roomId, int idx, int subIdx, con if (qFuzzyCompare(p1, p2)) { ++numberOfDuplicates; - WARNING_LOG() << "Building '" << m_name << "' -> " + WARNING_LOG(m_logger) << "Building '" << m_name << "' -> " << "Polygon point " << i << " (" << p1 << ") and " << j << " (" << p2 << ") in room " << roomId << ", " << type << "[" << idx << "], element[" << subIdx << "] are the same! (size=" << points.size() << ")"; @@ -750,7 +750,7 @@ int Building::checkDublicatePointsInPolygon(int roomId, int idx, int subIdx, con if (numberOfDuplicates > 0) for (auto point : points) - WARNING_LOG() << "Building '" << m_name << "' -> " << "point =" << point << " (same points)"; + WARNING_LOG(m_logger) << "Building '" << m_name << "' -> " << "point =" << point << " (same points)"; return numberOfDuplicates; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.h index f6be135ec..fe502b617 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building.h @@ -29,6 +29,8 @@ public: private: + +NGL::INGLLogger &m_logger; int m_id = 0; double m_transitionFactor = 0; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.cpp index 28d00d52f..49fae2531 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.cpp @@ -17,30 +17,30 @@ namespace VWM BuildingRoomGeometry::BuildingRoomGeometry() : m_logger(BuildingControlUnit::getLogger("VWM.BuildingRoomGeometry")) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } BuildingRoomGeometry::~BuildingRoomGeometry() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool BuildingRoomGeometry::init(const QDomElement &domRoot) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; parse(domRoot); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } QVector BuildingRoomGeometry::pointIsInWhichRooms(const LtsUtils::QPoint3D &pointToFind) { - TRACE_LOG() << Q_FUNC_INFO << " START, pointToFind" << pointToFind + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, pointToFind" << pointToFind << ", m_roomOutlines.size() " << m_roomOutlines.size(); QVector roomtIds; @@ -52,26 +52,26 @@ QVector BuildingRoomGeometry::pointIsInWhichRooms(const LtsUtils::QPoint3D const int roomId = it.key(); const RoomOutlineData &rod = it.value(); - DEBUG_LOG() << Q_FUNC_INFO << " check room " << roomId << " (check maxZ " << rod.maxZ << " ; minZ " << rod.minZ; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " check room " << roomId << " (check maxZ " << rod.maxZ << " ; minZ " << rod.minZ; if (m_logger.isDebugEnabled()) qCritical() << " check room " << roomId << ", outline: " << rod.outline; if (rod.outline.containsPoint( {pointToFind.x(), pointToFind.y()}, Qt::OddEvenFill)) { - DEBUG_LOG() << Q_FUNC_INFO << " within room " << roomId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " within room " << roomId; if ((rod.maxZ > pointToFind.z()) && (pointToFind.z() > rod.minZ)) { - DEBUG_LOG() << Q_FUNC_INFO << " found roomId: " << roomId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " found roomId: " << roomId << " pointToFind: " << pointToFind.x() << " , " << pointToFind.y(); roomtIds.append(roomId); } } } - TRACE_LOG() << Q_FUNC_INFO << " END, roomtIds.size() " << roomtIds.size(); + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, roomtIds.size() " << roomtIds.size(); return roomtIds; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.h index 63b76ded8..fe5288902 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/VWM/vwm_building_room_geometry.h @@ -36,6 +36,8 @@ public: QVector pointIsInWhichRooms(const LtsUtils::QPoint3D &pointToFind); private: + +NGL::INGLLogger &m_logger; bool parse(const QDomElement &domGroup); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.cpp index a5c8a861f..fcef85a54 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.cpp @@ -9,12 +9,11 @@ namespace BuildingControlUnit { -HandleHttpRequest::HandleHttpRequest(bool useQueue, QObject *parent) - : QObject(parent) +HandleHttpRequest::HandleHttpRequest(bool useQueue, QObject *parent) : QObject(parent) , m_nam(new QNetworkAccessManager(this)) - , m_bUseQueue(useQueue) -{ - INFO_LOG() << "Using Queue: " << m_bUseQueue; + , m_bUseQueue(useQueue), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + INFO_LOG(m_logger) << "Using Queue: " << m_bUseQueue; connect(m_nam, &QNetworkAccessManager::finished, this, &HandleHttpRequest::onReplyFinished); connect(m_nam, &QNetworkAccessManager::authenticationRequired, @@ -41,7 +40,7 @@ void HandleHttpRequest::enqueue(const QUrl &url, HandleHttpQueueMessageStatus st if ((HandleHttpQueueMessageStatus::MS_Cyclic == status) && m_queueMap[host].uniquenessChecker.contains(url.toString())) { - WARNING_LOG() << "Discarding duplicate url \"" << url.toString() << "\" due to slow message handling."; + WARNING_LOG(m_logger) << "Discarding duplicate url \"" << url.toString() << "\" due to slow message handling."; } else { @@ -49,7 +48,7 @@ void HandleHttpRequest::enqueue(const QUrl &url, HandleHttpQueueMessageStatus st networkRequest.request = QNetworkRequest(url); m_queueMap[host].uniquenessChecker.insert(url.toString()); m_queueMap[host].requests.enqueue(networkRequest); - DEBUG_LOG() << "Added '" << url.toString() << " to queue for host: " << host + DEBUG_LOG(m_logger) << "Added '" << url.toString() << " to queue for host: " << host << " Queue has " << m_queueMap[host].requests.count() << " elements"; trySendNextRequest(); } @@ -59,21 +58,21 @@ void HandleHttpRequest::onAuthenticationRequired(QNetworkReply *reply, QAuthenti { if (!reply || !authenticator) { - ERROR_LOG() << "Internal error - Nullptr exception!"; + ERROR_LOG(m_logger) << "Internal error - Nullptr exception!"; } else if (!m_queueMap.contains(reply->url().host())) { - WARNING_LOG() << "Internal error - got auth reply from unknown host!"; + WARNING_LOG(m_logger) << "Internal error - got auth reply from unknown host!"; } else { if (m_bUseQueue && reply != m_queueMap[reply->url().host()].activeReply) - WARNING_LOG() << "Internal error - got auth reply from unknown request!"; + WARNING_LOG(m_logger) << "Internal error - got auth reply from unknown request!"; if (m_queueMap[reply->url().host()].bAuthAlreadyRequested) return; - DEBUG_LOG() << "Authentication request"; + DEBUG_LOG(m_logger) << "Authentication request"; authenticator->setUser(m_username); authenticator->setPassword(m_passwd); m_queueMap[reply->url().host()].bAuthAlreadyRequested = true; @@ -89,17 +88,17 @@ void HandleHttpRequest::onReplyFinished(QNetworkReply *reply) } if (!reply) { - ERROR_LOG() << "Internal error - Nullptr exception!"; + ERROR_LOG(m_logger) << "Internal error - Nullptr exception!"; } else if (!m_queueMap.contains(reply->url().host())) { reply->deleteLater(); - WARNING_LOG() << "Internal error - got reply from unknown host!"; + WARNING_LOG(m_logger) << "Internal error - got reply from unknown host!"; } else if (m_bUseQueue && reply != m_queueMap[reply->url().host()].activeReply) { reply->deleteLater(); - WARNING_LOG() << "Internal error - got reply from unknown request!"; + WARNING_LOG(m_logger) << "Internal error - got reply from unknown request!"; } else { @@ -109,16 +108,16 @@ void HandleHttpRequest::onReplyFinished(QNetworkReply *reply) if ( m_newConnection) { m_newConnection = false; - DEBUG_LOG() << "emit newEgcuConnection host=" << reply->url().host(); + DEBUG_LOG(m_logger) << "emit newEgcuConnection host=" << reply->url().host(); emit newEgcuConnection(reply->url().host()); } - DEBUG_LOG() << "Request successfull"; + DEBUG_LOG(m_logger) << "Request successfull"; } else - WARNING_LOG() << "Invalid request for host " << reply->url().host() << ", response code: " << responseCode << ", query: " << reply->url().toString(); + WARNING_LOG(m_logger) << "Invalid request for host " << reply->url().host() << ", response code: " << responseCode << ", query: " << reply->url().toString(); QByteArray replyData = reply->readAll(); - DEBUG_LOG() << "Got reply (" << reply->url().toString() << "): " << replyData + DEBUG_LOG(m_logger) << "Got reply (" << reply->url().toString() << "): " << replyData << " host=" << reply->url().host(); emit egcuReply(reply->url().host(), replyData); @@ -133,7 +132,7 @@ void HandleHttpRequest::sendNextRequest(HandleHttpQueue& queue) { if (m_bUseQueue && queue.activeReply != nullptr) { - WARNING_LOG() << "Internal error - active reply not yet finished!"; + WARNING_LOG(m_logger) << "Internal error - active reply not yet finished!"; } else if (!queue.requests.isEmpty()) { @@ -144,11 +143,11 @@ void HandleHttpRequest::sendNextRequest(HandleHttpQueue& queue) if ( networkRequest.time.secsTo(QTime::currentTime()) < 5) { queue.activeReply = m_nam->get(request); - DEBUG_LOG() << "Send request " << request.url().toString() << " and waiting for reply (" << queue.activeReply << ")"; + DEBUG_LOG(m_logger) << "Send request " << request.url().toString() << " and waiting for reply (" << queue.activeReply << ")"; } else { - DEBUG_LOG() << "remove request " << request.url().toString() + DEBUG_LOG(m_logger) << "remove request " << request.url().toString() << " because it's too old" << networkRequest.time.secsTo(QTime::currentTime()); sendNextRequest(queue); m_newConnection = true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.h index f4d785f1e..eeff72cdd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/handle_http_request.h @@ -68,6 +68,7 @@ private Q_SLOTS: void trySendNextRequest(); private: + NGL::INGLLogger &m_logger; QNetworkAccessManager *m_nam; bool m_bUseQueue; QString m_username; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.cpp index a87cc398a..948fc67b4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.cpp @@ -11,15 +11,14 @@ namespace BuildingControlUnit { -MainHandler::MainHandler() - : QObject() +MainHandler::MainHandler() : QObject() , m_bsmApi(nullptr) , m_jsonApi(nullptr) , m_vwmApi(nullptr) , m_handelEffectsBsm(nullptr) , m_handleHttpRequest(nullptr) - , m_bsmFlash(BEO_Auto) -{} + , m_bsmFlash(BEO_Auto), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -59,17 +58,17 @@ bool MainHandler::init(const QString &ammuXml, } if (!m_vwmApi->init(ammuXml, vwmXml, bsmConfig, initBuilding)) { - ERROR_LOG() << "Can not initialize VWM API - aborting"; + ERROR_LOG(m_logger) << "Can not initialize VWM API - aborting"; return false; } if (!m_jsonApi->init(listenPort)) { - ERROR_LOG() << "Can not initialize Json API - aborting"; + ERROR_LOG(m_logger) << "Can not initialize Json API - aborting"; return false; } if (!m_bsmApi->init(bsmConfig)) { - ERROR_LOG() << "Can not initialize BSM API - aborting"; + ERROR_LOG(m_logger) << "Can not initialize BSM API - aborting"; return false; } @@ -135,16 +134,16 @@ bool MainHandler::init(const QString &ammuXml, void MainHandler::setInitialOverrides(const QString &hostname) { - DEBUG_LOG() << "setInitialOverrides m_handelEffectsVec.size()=" << m_handelEffectsVec.size(); + DEBUG_LOG(m_logger) << "setInitialOverrides m_handelEffectsVec.size()=" << m_handelEffectsVec.size(); for ( int i = 0; i < m_handelEffectsVec.size(); i++) { QString hostnameLocal = m_handelEffectsVec.at(i)->hostname(); const QVector effectStates = m_handelEffectsVec.at(i)->getOverrides(); - DEBUG_LOG() << "setInitialOverrides host=" << hostnameLocal + DEBUG_LOG(m_logger) << "setInitialOverrides host=" << hostnameLocal << " effectStates.size=" << effectStates.size(); for (int j = 0; j < effectStates.size(); j++) - DEBUG_LOG() << "setInitialOverrides j=" << j + DEBUG_LOG(m_logger) << "setInitialOverrides j=" << j << " id=" << effectStates[j].id << " type=" << effectStates[j].type << " override=" << effectStates[j].effectOverride; @@ -171,7 +170,7 @@ void MainHandler::onHitResult(const HitResult &result, const QMapchargeFromChargeTypeId(result.chargeTypeId); - DEBUG_LOG() << "onHitResult chargeTypeId=" << result.chargeTypeId + DEBUG_LOG(m_logger) << "onHitResult chargeTypeId=" << result.chargeTypeId << " result.effectSoundId=" << result.effectSoundId << " damagePercentNew=" << result.damagePercentNew << " destructiveFactor=" << charge.destructiveFactor; @@ -182,15 +181,15 @@ void MainHandler::onHitResult(const HitResult &result, const QMaphostname() << ", SoundId: " << result.effectSoundId; + DEBUG_LOG(m_logger) << "playHitSound @EGCU " << he->hostname() << ", SoundId: " << result.effectSoundId; he->playHitSound(result.effectSoundId); } } - DEBUG_LOG() << "HitResult: " << result; + DEBUG_LOG(m_logger) << "HitResult: " << result; if (result.sensorId != 0 && result.originatorId != 0 && m_bsmFlash != BEO_Off && charge.destructiveFactor > 1 ) { - DEBUG_LOG() << "BSM Flash"; + DEBUG_LOG(m_logger) << "BSM Flash"; m_bsmApi->triggerFlashlight(result.sensorId); m_bsmApi->triggerFlashlightPulse(result.sensorId, QString(), @@ -200,7 +199,7 @@ void MainHandler::onHitResult(const HitResult &result, const QMapstartEffects(result.damagePercentNew); } @@ -231,22 +230,22 @@ void MainHandler::onUnknownDirectHit(int sensorId) void MainHandler::onSetEffectStatesRequest(const QString &hostname, const QVector &effectStates) { - DEBUG_LOG() << "1 BSM flash hostname='" << hostname + DEBUG_LOG(m_logger) << "1 BSM flash hostname='" << hostname << "' isEmpty:"<< hostname.isEmpty() <<" isNull:" << hostname.isNull(); m_effectStates.insert(hostname, effectStates); if (hostname.isEmpty()) { m_bsmFlash = BEO_Auto; - DEBUG_LOG() << "2 BSM flash =" << m_bsmFlash; + DEBUG_LOG(m_logger) << "2 BSM flash =" << m_bsmFlash; m_handelEffectsBsm->setOverrides(effectStates); for ( int i = 0; i < effectStates.size(); i++) { - DEBUG_LOG() << "3 BSM flash =" << m_bsmFlash; + DEBUG_LOG(m_logger) << "3 BSM flash =" << m_bsmFlash; if ( effectStates.at(i).type == BET_BsmFlash) { m_bsmFlash = effectStates.at(i).effectOverride; - DEBUG_LOG() << "4 BSM flash =" << m_bsmFlash; + DEBUG_LOG(m_logger) << "4 BSM flash =" << m_bsmFlash; break; } } @@ -266,7 +265,7 @@ void MainHandler::onSwitchRelayRequest(const QString &hostname, const SwitchRela { if (m_handelEffectsVec[i]->hostname() == hostname ) { - DEBUG_LOG() << "switchRelay " + DEBUG_LOG(m_logger) << "switchRelay " << " id=" << switchRelayValues.id << " bcuRelayState=" << switchRelayValues.bcuRelayState; m_handelEffectsVec[i]->switchRelay(switchRelayValues); @@ -328,7 +327,7 @@ QVector MainHandler::getSegmentDamage(const QVector &allHitRooms, if (egcu.roomIds.size() > 0 ) averageDamage = damagePercentSegment / egcu.roomIds.size(); result.append(averageDamage); - INFO_LOG() << "getSegmentDamage[" << egcu.hostname << "]=" << averageDamage; + INFO_LOG(m_logger) << "getSegmentDamage[" << egcu.hostname << "]=" << averageDamage; } } return result; @@ -337,7 +336,7 @@ QVector MainHandler::getSegmentDamage(const QVector &allHitRooms, void MainHandler::flashBuildingDestructionIndicator(int egcu) { - ERROR_LOG() << "TODO flashBuildingDestructionIndicator egcu=" << egcu; + ERROR_LOG(m_logger) << "TODO flashBuildingDestructionIndicator egcu=" << egcu; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.h index ca0ed0fcd..a7f7f333b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/BuildingControlUnit/main_handler.h @@ -37,12 +37,14 @@ private Q_SLOTS: void onSwitchRelayRequest(const QString &hostname, const SwitchRelayValues &switchRelayValues); void webSocketSendInitialData(QWebSocket *ws); private: + NGL::INGLLogger &m_logger; QVector getAffectedRoomIds(const QVector &allHitRooms) const; QVector getSegmentDamage(const QVector &allHitRooms, const int damagePercentNew) const; int getHitRoomId(const QVector &allHitRooms) const; void flashBuildingDestructionIndicator(int egcu); void cleanup(); private: + NGL::INGLLogger &m_logger; BSM::Api *m_bsmApi; Json::Api *m_jsonApi; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.cpp index 592bc949c..5bcc55df1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.cpp @@ -40,13 +40,13 @@ BuildingControlHandler::~BuildingControlHandler() bool BuildingControlHandler::init() { - DEBUG_LOG()<<"BuildingControlHandler::init exerciseId="<exerciseId(); + DEBUG_LOG(m_logger)<<"BuildingControlHandler::init exerciseId="<exerciseId(); const QString bcuName = QStringLiteral("BuildingControlUnit"); m_bcuExecutableName = QStandardPaths::findExecutable(bcuName, { QCoreApplication::applicationDirPath()}); if (m_bcuExecutableName.isEmpty()) { - WARNING_LOG() << "Executable " << bcuName << " not found - can not start building control unit processes!"; + WARNING_LOG(m_logger) << "Executable " << bcuName << " not found - can not start building control unit processes!"; return false; } if (m_mainHandler->exerciseId() > 0) @@ -61,18 +61,18 @@ bool BuildingControlHandler::init() const QMultiMap latestStates = recordReplay.getHistoryStateMap(); - DEBUG_LOG() << "Starting to read HistoryStatedata from record replay. Size: " + DEBUG_LOG(m_logger) << "Starting to read HistoryStatedata from record replay. Size: " << latestStates.size(); for (auto it = latestStates.begin(); it != latestStates.end(); ++it) { const Buildings::HistoryState &historyState = it.value(); if (!m_mainHandler->ismHandler()->isElementAssignedToExercise(historyState.mseId(),m_mainHandler->exerciseId() )) { - DEBUG_LOG()<<"[INIT] [recordReplay]>>>>>>> mseId=" << historyState.mseId() << " not in execise"; + DEBUG_LOG(m_logger)<<"[INIT] [recordReplay]>>>>>>> mseId=" << historyState.mseId() << " not in execise"; continue; } m_historyStates.insert(historyState.mseId(), historyState); - DEBUG_LOG()<<"[INIT] [recordReplay]>>>>>>> "<>>>>>> "<ddsHandler()->fts()->setBuildingContaminationStateReply(cookie, fro); } void BuildingControlHandler::onSetBuildingStatesRequest(const rti::core::SampleIdentity &cookie, const SetBuildingStatesRequest &request) { - DEBUG_LOG() << "onSetBuildingStatesRequest " << request; + DEBUG_LOG(m_logger) << "onSetBuildingStatesRequest " << request; const Core::FunctionReplyObject fro = onSetBuildingStatesRequestInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->setBuildingStatesReply(cookie, fro); } void BuildingControlHandler::onSetFortifyFactorRequest(const rti::core::SampleIdentity &cookie, const SetFortifyFactorRequest &request) { - DEBUG_LOG() << "onSetFortifyFactorRequest " << request; + DEBUG_LOG(m_logger) << "onSetFortifyFactorRequest " << request; const Core::FunctionReplyObject fro = onSetFortifyFactorRequestInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->setFortifyFactorReply(cookie, fro); } void BuildingControlHandler::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &cookie, const SendCesHitOnBuildingRequest &request) { - DEBUG_LOG() << "onSendCesHitOnBuildingRequest " << request; + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequest " << request; const Core::FunctionReplyObject fro = onSendCesHitOnBuildingRequestInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->sendCesHitOnBuildingReply(cookie, fro); } void BuildingControlHandler::onSendCesHit3DonBuildingRequest(const rti::core::SampleIdentity &cookie, const SendCesHit3DonBuildingRequest &request) { - DEBUG_LOG() << "onSendCesHit3DonBuildingRequest " << request; + DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequest " << request; const Core::FunctionReplyObject fro = onSendCesHit3DonBuildingRequestInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->sendCesHit3DonBuildingReply(cookie, fro); } void BuildingControlHandler::onTriggerBsmFlashRequest(const rti::core::SampleIdentity &cookie, const TriggerBsmFlashRequest &request) { - DEBUG_LOG() << "onTriggerBsmFlashRequest " << request; + DEBUG_LOG(m_logger) << "onTriggerBsmFlashRequest " << request; const Core::FunctionReplyObject fro = onTriggerBsmFlashInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->triggerBsmFlashReply(cookie, fro); } @@ -255,7 +255,7 @@ Core::FunctionReplyObject BuildingControlHandler::onSetFortifyFactorRequestInter void BuildingControlHandler::setEffectStates(const int buildingId, const int assetId, const QByteArray &properties) { - DEBUG_LOG() << "BuildingControlHandler::setEffectStates" + DEBUG_LOG(m_logger) << "BuildingControlHandler::setEffectStates" << " buildingId=" << buildingId << " assetId=" << assetId << " properties=" << properties; @@ -282,11 +282,11 @@ void BuildingControlHandler::onRelayInfoChanged(const AssetManagement::RelayInfo Core::FunctionReplyObject BuildingControlHandler::onSendCesHitOnBuildingRequestInternal(const SendCesHitOnBuildingRequest &data) { - DEBUG_LOG() << "onSendCesHitOnBuildingRequestInternal"; + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal"; auto it = m_buildings.find(data.buildingId()); if (it == m_buildings.end()) { - DEBUG_LOG() << "onSendCesHitOnBuildingRequestInternal return"; + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal return"; return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId()); } @@ -295,21 +295,21 @@ Core::FunctionReplyObject BuildingControlHandler::onSendCesHitOnBuildingRequestI data.aesId(), data.impactPosition(), QString::fromStdString(data.properties()))) { - DEBUG_LOG() << "onSendCesHitOnBuildingRequestInternal return Can not send ces hit to building control process"; + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequestInternal return Can not send ces hit to building control process"; return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send ces hit to building control process.")); } - DEBUG_LOG() << "FunctionReplyObject"; + DEBUG_LOG(m_logger) << "FunctionReplyObject"; return Core::FunctionReplyObject(); } Core::FunctionReplyObject BuildingControlHandler::onSendCesHit3DonBuildingRequestInternal(const SendCesHit3DonBuildingRequest &data) { - DEBUG_LOG() << "onSendCesHit3DonBuildingRequestInternal"; + DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal"; auto it = m_buildings.find(data.buildingId()); if (it == m_buildings.end()) { - DEBUG_LOG() << "onSendCesHit3DonBuildingRequestInternal return"; + DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal return"; return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId()); } @@ -318,16 +318,16 @@ Core::FunctionReplyObject BuildingControlHandler::onSendCesHit3DonBuildingReques data.aesId(), data.impactPosition(), data.detonationLocation(), data.detonationDistance(), QString::fromStdString(data.properties()))) { - DEBUG_LOG() << "onSendCesHit3DonBuildingRequestInternal return Can not send ces hit to building control process"; + DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingRequestInternal return Can not send ces hit to building control process"; return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send ces hit to building control process.")); } - DEBUG_LOG() << "FunctionReplyObject"; + DEBUG_LOG(m_logger) << "FunctionReplyObject"; return Core::FunctionReplyObject(); } Core::FunctionReplyObject BuildingControlHandler::onTriggerBsmFlashInternal(const TriggerBsmFlashRequest &data) { - DEBUG_LOG() << "onTriggerBsmFlashInternal"; + DEBUG_LOG(m_logger) << "onTriggerBsmFlashInternal"; { @@ -340,34 +340,34 @@ Core::FunctionReplyObject BuildingControlHandler::onTriggerBsmFlashInternal(cons BuildingInfo buildingInfo= bldg->buildingInfo(); BsmInfo bsmInfo = buildingInfo.bsms.value(data.assetId()); - DEBUG_LOG() << " BuildingId=" << data.buildingId() + DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId() << " assetId=" << bsmInfo.assetId << " hostname=" << bsmInfo.hostname; if (!bldg->triggerFlashlight(data)) { - DEBUG_LOG() << "onTriggerBsmFlashInternal return Can not send trigger flashlight to building control process"; + DEBUG_LOG(m_logger) << "onTriggerBsmFlashInternal return Can not send trigger flashlight to building control process"; return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Can not send trigger flashlight to building control process")); } } - DEBUG_LOG() << "FunctionReplyObject"; + DEBUG_LOG(m_logger) << "FunctionReplyObject"; return Core::FunctionReplyObject(); } void BuildingControlHandler::onSwitchRelayRequest(const rti::core::SampleIdentity &cookie, const SwitchRelayRequest &request) { - DEBUG_LOG() << "SwitchRelayRequest " << request; + DEBUG_LOG(m_logger) << "SwitchRelayRequest " << request; const Core::FunctionReplyObject fro = onSwitchRelayInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->switchRelayReply(cookie, fro); } Core::FunctionReplyObject BuildingControlHandler::onSwitchRelayInternal(const SwitchRelayRequest &data) { - DEBUG_LOG() << "onSwitchRelayInternal " << data; + DEBUG_LOG(m_logger) << "onSwitchRelayInternal " << data; auto it = m_buildings.find(data.buildingId()); if (it == m_buildings.end()) return Core::FunctionReplyObject(data.buildingId(), tr_lts("dds", "Building with id %1 not found.")).arg(data.buildingId()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.h index 9dfa2fb3f..7156ece93 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_control_handler.h @@ -39,6 +39,7 @@ public Q_SLOTS: void setEffectStates(const int buildingId, const int assetId, const QByteArray &properties); void onRelayInfoChanged(const AssetManagement::RelayInfo &info, const DataModification mod); private: + NGL::INGLLogger &m_logger; void onSetBuildingContaminationStateRequest(const rti::core::SampleIdentity &cookie, const SetBuildingContaminationStateRequest &request) override; void onSetBuildingStatesRequest(const rti::core::SampleIdentity &cookie, @@ -63,6 +64,7 @@ private: Core::FunctionReplyObject onSwitchRelayInternal(const SwitchRelayRequest &data); private: + NGL::INGLLogger &m_logger; QMap m_buildings; QMap m_historyStates; QMap m_relayInfos; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.cpp index 924e94240..2f76d2218 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.cpp @@ -80,22 +80,22 @@ void BuildingProcess::setBuildingInfo(const BuildingInfo &info) void BuildingProcess::onStructureElementUpdateEffectOverrideReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); } bool BuildingProcess::start() { - DEBUG_LOG() << "BuildingProcess::start mseId = " << m_buildingInfo.mseId + DEBUG_LOG(m_logger) << "BuildingProcess::start mseId = " << m_buildingInfo.mseId << " m_historyState.size() = " << m_historyState.stateHistory().size() << " m_initBuilding=" << m_initBuilding; if (m_buildingInfo.mseId <= 0) { - WARNING_LOG() << "No valid building information set - can not start building process"; + WARNING_LOG(m_logger) << "No valid building information set - can not start building process"; return false; } if (m_proc.state() != QProcess::NotRunning) { - WARNING_LOG() << "Process for building " << m_buildingInfo.mseId << " is already running!"; + WARNING_LOG(m_logger) << "Process for building " << m_buildingInfo.mseId << " is already running!"; return false; } @@ -120,13 +120,13 @@ bool BuildingProcess::start() const QByteArray bldCfgData = generateBuildingConfigData(); const QString effectConfigFilename = NGL::findFile(NGL::FileType::ConfigFile, QStringLiteral("effect_config.xml")); - WARNING_LOG() << "(effectConfigFilename) = " << effectConfigFilename; + WARNING_LOG(m_logger) << "(effectConfigFilename) = " << effectConfigFilename; const QString bldDataFilename = tmpPath + QStringLiteral("bldg_%1_building_config.xml").arg(m_buildingInfo.mseId); if (!writeFile(bldDataFilename, bldCfgData)) { - WARNING_LOG() << "(!writeFile(bldDataFilename, bldCfgData)"; + WARNING_LOG(m_logger) << "(!writeFile(bldDataFilename, bldCfgData)"; return false; } @@ -134,7 +134,7 @@ bool BuildingProcess::start() const QString chargesDataFilename = tmpPath + QStringLiteral("bldg_%1_charges.xml").arg(m_buildingInfo.mseId); if (!writeFile(chargesDataFilename, chargesData)) { - WARNING_LOG() << "(!writeFile(chargesDataFilename, chargesData)"; + WARNING_LOG(m_logger) << "(!writeFile(chargesDataFilename, chargesData)"; return false; } @@ -148,7 +148,7 @@ bool BuildingProcess::start() if (!effectPtr) continue; - DEBUG_LOG() << "effect->id=" << effectPtr->id + DEBUG_LOG(m_logger) << "effect->id=" << effectPtr->id << " effect->category=" << effectPtr->category << " effect->effectType=" << effectPtr->effectType << " effect->override=" << static_cast(effectPtr->override); @@ -201,9 +201,9 @@ void BuildingProcess::shutdown() void BuildingProcess::setHistoryState(const Buildings::HistoryState &historyState) { - DEBUG_LOG() << "BuildingProcess::setHistoryState size =" << historyState.stateHistory().size(); + DEBUG_LOG(m_logger) << "BuildingProcess::setHistoryState size =" << historyState.stateHistory().size(); - ERROR_LOG() << "[BuildingProcess::setHistoryState]>>> history =" << historyState; + ERROR_LOG(m_logger) << "[BuildingProcess::setHistoryState]>>> history =" << historyState; m_historyState = historyState; m_historyState.sampleTime(QDateTime::currentMSecsSinceEpoch()); m_mainHandler->ddsHandler()->dts()->publish(m_historyState); @@ -211,7 +211,7 @@ void BuildingProcess::setHistoryState(const Buildings::HistoryState &historyStat bool BuildingProcess::setVulnerabilityState(ProjectDataManagement::VulnerabilityState state, const std::vector &roomIds) { - DEBUG_LOG() << "BuildingProcess::setVulnerabilityState:" << state; + DEBUG_LOG(m_logger) << "BuildingProcess::setVulnerabilityState:" << state; if (!m_wsSocket || !m_wsSocket->isValid()) return false; BuildingControlUnit::Json::Telegrams::SetDamageState tele; @@ -223,7 +223,7 @@ bool BuildingProcess::setVulnerabilityState(ProjectDataManagement::Vulnerability tele.roomIds += m_buildingInfo.roomId2SubId.value(id); tele.originatorId = 0; - DEBUG_LOG() << "setVulnerabilityState websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "setVulnerabilityState websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; @@ -231,7 +231,7 @@ bool BuildingProcess::setVulnerabilityState(ProjectDataManagement::Vulnerability bool BuildingProcess::setContaminationState(const int &bldId, const ContaminationState &contaminationState) { - DEBUG_LOG() << "BuildingProcess::setContaminationState bldId: "<isValid()) return false; BuildingControlUnit::Json::Telegrams::SetContaminationState tele; @@ -244,18 +244,18 @@ bool BuildingProcess::setContaminationState(const int &bldId, const Contaminatio contState.rooms = contaminationState.rooms(); tele.contaminationStates.push_back(contState); - DEBUG_LOG() << "SetContaminationState websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "SetContaminationState websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; } bool BuildingProcess::resetContaminationState() { - DEBUG_LOG() << "BuildingProcess::resetContaminationState" ; + DEBUG_LOG(m_logger) << "BuildingProcess::resetContaminationState" ; if (!m_wsSocket || !m_wsSocket->isValid()) return false; BuildingControlUnit::Json::Telegrams::ResetContaminationState tele; - DEBUG_LOG() << "ResetContaminationState websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "ResetContaminationState websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; @@ -276,7 +276,7 @@ bool BuildingProcess::setFortifyFactors(const std::vectorsendTextMessage(QString::fromUtf8(tele.toJson())); return true; } @@ -293,7 +293,7 @@ bool BuildingProcess::setEffectStates( const int assetId, const QByteArray &prop if (!m_wsSocket || !m_wsSocket->isValid()) return false; - DEBUG_LOG() << "setEffectStates" + DEBUG_LOG(m_logger) << "setEffectStates" << " assetId=" << assetId << " properties=" << properties; @@ -301,24 +301,24 @@ bool BuildingProcess::setEffectStates( const int assetId, const QByteArray &prop { for (const EgcuInfo &egcu : std::as_const(m_buildingInfo.egcus)) { - DEBUG_LOG() << "EGCU: " << egcu.assetName + DEBUG_LOG(m_logger) << "EGCU: " << egcu.assetName << " assetId=" << egcu.assetId << " egcu.assetId=" << egcu.assetId << " hostname=" << egcu.hostname; if ( assetId == egcu.assetId) { - DEBUG_LOG() << "segment=" << egcu.hostname; + DEBUG_LOG(m_logger) << "segment=" << egcu.hostname; tele.segment = egcu.hostname; } } if (tele.segment.isEmpty()) { - WARNING_LOG() << "Asset with id " << assetId << " not found in this building"; + WARNING_LOG(m_logger) << "Asset with id " << assetId << " not found in this building"; return false; } if (tele.segment == QString()) { - ERROR_LOG() << "Asset with id=" << assetId << " has no Hostname!!!!"; + ERROR_LOG(m_logger) << "Asset with id=" << assetId << " has no Hostname!!!!"; return false; } } @@ -385,9 +385,9 @@ bool BuildingProcess::setEffectStates( const int assetId, const QByteArray &prop } QString valueStr = QString::fromUtf8(tele.toJson()); - DEBUG_LOG() << "setEffectStates websocket send: " << valueStr; + DEBUG_LOG(m_logger) << "setEffectStates websocket send: " << valueStr; qint64 sendBytesCount = m_wsSocket->sendTextMessage(valueStr); - DEBUG_LOG() << "sendBytesCount= " << sendBytesCount; + DEBUG_LOG(m_logger) << "sendBytesCount= " << sendBytesCount; m_effectStates.insert(assetId, valueStr); return true; @@ -408,7 +408,7 @@ bool BuildingProcess::relayState(const std::vector &r tele.relayStates.push_back(info); } - DEBUG_LOG() << "relayState websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "relayState websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; @@ -455,7 +455,7 @@ bool BuildingProcess::sendCesHitOnBuilding(const qint64 effectTimeMSec, tele.relPosition.z = relPos.offsetZ(); tele.properties = properties; - DEBUG_LOG() << "sendCesHitOnBuilding websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "sendCesHitOnBuilding websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; } @@ -525,7 +525,7 @@ bool BuildingProcess::sendCesHit3DonBuilding(const qint64 effectTimeMSec, const tele.detonationDistance = detonationDistance; tele.properties = properties; - DEBUG_LOG() << "sendCesHit3DonBuilding websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "sendCesHit3DonBuilding websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; } @@ -536,7 +536,7 @@ bool BuildingProcess::switchRelay(const SwitchRelayRequest &data) if (!m_wsSocket || !m_wsSocket->isValid()) return false; - DEBUG_LOG() << "switchRelay" + DEBUG_LOG(m_logger) << "switchRelay" << " buildingId=" << data.buildingId() << " assetId=" << data.assetId() << data.state(); @@ -544,10 +544,10 @@ bool BuildingProcess::switchRelay(const SwitchRelayRequest &data) for (const EgcuInfo &egcu : std::as_const(m_buildingInfo.egcus)) { - DEBUG_LOG() << "EGCU: " << egcu.assetName + DEBUG_LOG(m_logger) << "EGCU: " << egcu.assetName << " assetId=" << egcu.assetId << " hostname=" << egcu.hostname; - DEBUG_LOG() << "data.assetId()=" << data.assetId() + DEBUG_LOG(m_logger) << "data.assetId()=" << data.assetId() << "egcu.assetId=" << egcu.assetId; if ( data.assetId() != egcu.assetId) continue; @@ -561,7 +561,7 @@ bool BuildingProcess::switchRelay(const SwitchRelayRequest &data) tele.switchRelayValues.delay = data.pulseAttributes().get().delay(); tele.switchRelayValues.pulse = data.pulseAttributes().get().pulse(); } - DEBUG_LOG() << "switchRelay websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "switchRelay websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; } @@ -574,7 +574,7 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data) if (!m_wsSocket || !m_wsSocket->isValid()) return false; - DEBUG_LOG() << "triggerFlashlight" + DEBUG_LOG(m_logger) << "triggerFlashlight" << " BuildingId=" << data.buildingId() << " assetId=" << data.assetId() << " m_buildingInfo.bsms.size()" << m_buildingInfo.bsms.size(); @@ -582,7 +582,7 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data) QMapIterator i(m_buildingInfo.bsms); while (i.hasNext()) { i.next(); - DEBUG_LOG() << "key=" << i.key() + DEBUG_LOG(m_logger) << "key=" << i.key() << " assetId=" << i.value().assetId << " bsmId=" << i.value().bsmId << " hostname=" << i.value().hostname @@ -592,7 +592,7 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data) if ( m_buildingInfo.bsms.contains(data.assetId())) { BsmInfo bsmInfo = m_buildingInfo.bsms.value(data.assetId()); - DEBUG_LOG() << " BuildingId=" << data.buildingId() + DEBUG_LOG(m_logger) << " BuildingId=" << data.buildingId() << " assetId=" << bsmInfo.assetId << " hostname=" << bsmInfo.hostname; @@ -601,7 +601,7 @@ bool BuildingProcess::triggerFlashlight(const TriggerBsmFlashRequest data) tele.pauseBetweenFlashesSec = 0; tele.sensorId = 0; - DEBUG_LOG() << "triggerFlashlight websocket send: " << QString::fromUtf8(tele.toJson()); + DEBUG_LOG(m_logger) << "triggerFlashlight websocket send: " << QString::fromUtf8(tele.toJson()); m_wsSocket->sendTextMessage(QString::fromUtf8(tele.toJson())); return true; } @@ -615,7 +615,7 @@ void BuildingProcess::onReadyRead() if (data.contains(strToSearch)) { m_wsUrl = data.split(strToSearch).at(1).split(QLatin1Char('\n')).at(0).trimmed(); - INFO_LOG() << "Using web socket url '" << m_wsUrl << "' for building " << m_buildingInfo.mseId; + INFO_LOG(m_logger) << "Using web socket url '" << m_wsUrl << "' for building " << m_buildingInfo.mseId; openWebSocket(); } } @@ -626,12 +626,12 @@ void BuildingProcess::onProcessFinished(int exitCode, QProcess::ExitStatus exitS if (exitCode == 0 && exitStatus == QProcess::NormalExit) return; const char *what = exitStatus == QProcess::NormalExit ? "stopped" : "crashed"; - WARNING_LOG() << "building control process for building " << m_buildingInfo.mseId + WARNING_LOG(m_logger) << "building control process for building " << m_buildingInfo.mseId << " " << what << " with exit code " << exitCode << " - restarting in 1 second"; if (exitCode != 0) { - WARNING_LOG() << "stdout: " << m_proc.readAllStandardOutput(); - WARNING_LOG() << "stderr: " << m_proc.readAllStandardError(); + WARNING_LOG(m_logger) << "stdout: " << m_proc.readAllStandardOutput(); + WARNING_LOG(m_logger) << "stderr: " << m_proc.readAllStandardError(); } closeWebSocket(); QTimer::singleShot(1000, this, &BuildingProcess::start); @@ -639,12 +639,12 @@ void BuildingProcess::onProcessFinished(int exitCode, QProcess::ExitStatus exitS void BuildingProcess::onTextMessageReceived(const QString &message) { - TRACE_LOG() << "Got message from building control process: " << message; + TRACE_LOG(m_logger) << "Got message from building control process: " << message; BuildingControlUnit::Json::Telegrams::BaseTelegram *tel = BuildingControlUnit::Json::Telegrams::BaseTelegram::telegramFromJson(message.toUtf8()); if (!tel) { - WARNING_LOG() << "Can not convert '" << message << "' to a valid telegram!"; + WARNING_LOG(m_logger) << "Can not convert '" << message << "' to a valid telegram!"; return; } if (tel->telegramId() == BuildingControlUnit::Json::Telegrams::BsmState::telegramId()) @@ -656,7 +656,7 @@ void BuildingProcess::onTextMessageReceived(const QString &message) else if (tel->telegramId() == BuildingControlUnit::Json::Telegrams::EffectOverride::telegramId()) handleEffectOverride(static_cast(tel)); else - WARNING_LOG() << "Unhandled incoming telegram with id '" << tel->telegramId() << "'"; + WARNING_LOG(m_logger) << "Unhandled incoming telegram with id '" << tel->telegramId() << "'"; delete tel; } @@ -692,7 +692,7 @@ void BuildingProcess::historyState(const BuildingState &state) && state.originatorParticipantId() == 0 && state.contaminationStates().size() == 0) { - DEBUG_LOG() << "setVulnerabilityState->removeHistoryStateByKey:" << state.id(); + DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << state.id(); m_historyState.stateHistory().resize(0); } @@ -708,10 +708,10 @@ void BuildingProcess::historyState(const BuildingState &state) historyStateItem.contaminationStates() = state.contaminationStates(); m_historyState.stateHistory().push_back(std::move(historyStateItem)); - DEBUG_LOG() << "BuildingProcess::historyState contaminationStates:" << state; + DEBUG_LOG(m_logger) << "BuildingProcess::historyState contaminationStates:" << state; m_historyState.mseId(state.id()); - DEBUG_LOG() << "setVulnerabilityState->removeHistoryStateByKey:" << m_historyState.mseId(); + DEBUG_LOG(m_logger) << "setVulnerabilityState->removeHistoryStateByKey:" << m_historyState.mseId(); m_historyState.sampleTime(QDateTime::currentMSecsSinceEpoch()); m_mainHandler->ddsHandler()->dts()->publish(m_historyState); } @@ -721,16 +721,16 @@ void BuildingProcess::handleHitResult(BuildingControlUnit::Json::Telegrams::HitR const BuildingControlUnit::Json::Telegrams::HitResult::HitResultInfo &data = tel->hitResult; BuildingState state; - DEBUG_LOG() << Q_FUNC_INFO << " data.hitOnRoomId=" << data.hitOnRoomId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " data.hitOnRoomId=" << data.hitOnRoomId; state.id(m_buildingInfo.mseId); int assetId = m_mainHandler->ddsHandler()->dtcIsm()->getAssetIdFromMountingPointId(m_buildingInfo.mseId, data.sensorId); - DEBUG_LOG() << "handleHitResult assetId=" << assetId; + DEBUG_LOG(m_logger) << "handleHitResult assetId=" << assetId; state.assetId(assetId); InfrastructureManagement::StructureElement se; m_mainHandler->ddsHandler()->dtcIsm()->getStructureElementInMntPointAssetByAssetId(assetId, se); - DEBUG_LOG() << "handleHitResult structureElementId=" << se.id(); + DEBUG_LOG(m_logger) << "handleHitResult structureElementId=" << se.id(); state.structureElementId(se.id()); state.sampleTime(QDateTime::currentMSecsSinceEpoch()); if (data.originatorType == BuildingControlUnit::OriginatorType::DirectHit) @@ -808,7 +808,7 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment) - DEBUG_LOG() << "handleReconnectEgcu segment =" << segment; + DEBUG_LOG(m_logger) << "handleReconnectEgcu segment =" << segment; for (const EgcuInfo &egcu : std::as_const(m_buildingInfo.egcus)) { @@ -817,7 +817,7 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment) const auto keys = m_effectOverridesReconnect.keys(); for (const int &relayId : keys) { - DEBUG_LOG() << "RelayId=" << relayId + DEBUG_LOG(m_logger) << "RelayId=" << relayId << " Override=" << m_effectOverridesReconnect.value(relayId); if (m_effectOverridesReconnect.value(relayId) >= 0) @@ -827,7 +827,7 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment) int structureElementIdMp = m_mainHandler->ddsHandler()->dtcIsm()->getStructueElementIdFromAssetId(egcu.assetId); - DEBUG_LOG() << "EGCU: " << egcu.assetName + DEBUG_LOG(m_logger) << "EGCU: " << egcu.assetName << " assetId=" << egcu.assetId << " hostname='" << egcu.hostname << "' buildingName=" << egcu.buildingName @@ -840,9 +840,9 @@ void BuildingProcess::handleReconnectEgcu(const QString &segment) request.structureElementId(structureElementIdMp); request.effectId(relayId); request.effectOverride(override); - DEBUG_LOG() << "Vor structureElementUpdateEffectOverrideRequest"; + DEBUG_LOG(m_logger) << "Vor structureElementUpdateEffectOverrideRequest"; int result = m_mainHandler->ismHandler()->ftcIsm()->structureElementUpdateEffectOverrideRequest(request, this); - DEBUG_LOG() << "Nach structureElementUpdateEffectOverrideRequest result=" << result; + DEBUG_LOG(m_logger) << "Nach structureElementUpdateEffectOverrideRequest result=" << result; } } break; @@ -855,7 +855,7 @@ void BuildingProcess::handleRelayState(BuildingControlUnit::Json::Telegrams::Rel { RelayState state; - DEBUG_LOG() << "handleRelayState EGCU:" << tel->segment + DEBUG_LOG(m_logger) << "handleRelayState EGCU:" << tel->segment << " m_buildingInfo.egcus.size()=" << m_buildingInfo.egcus.size() << " stateTime=" << tel->stateTime << " offlineTime=" << tel->offlineTime; @@ -871,7 +871,7 @@ void BuildingProcess::handleRelayState(BuildingControlUnit::Json::Telegrams::Rel { if (QString::compare(egcu.hostname,tel->segment, Qt::CaseInsensitive) == 0) { - DEBUG_LOG() << "EGCU: " << egcu.assetName + DEBUG_LOG(m_logger) << "EGCU: " << egcu.assetName << " assetId=" << egcu.assetId << " hostname='" << egcu.hostname << "' buildingName=" << egcu.buildingName; @@ -897,18 +897,18 @@ void BuildingProcess::handleRelayState(BuildingControlUnit::Json::Telegrams::Rel void BuildingProcess::handleEffectOverride(BuildingControlUnit::Json::Telegrams::EffectOverride *tel) { - DEBUG_LOG() << "BuildingProcess::handleEffectOverride" + DEBUG_LOG(m_logger) << "BuildingProcess::handleEffectOverride" << " tel->overrides.size=" << tel->overrides.size(); InfrastructureManagement::StructureElementUpdateEffectOverrideRequest request; for ( int i = 0; i < m_buildingInfo.egcus.size(); i++) { - DEBUG_LOG() << "BuildingProcess::handleEffectOverride i=" << i; + DEBUG_LOG(m_logger) << "BuildingProcess::handleEffectOverride i=" << i; if ( m_buildingInfo.egcus[i].hostname.toLower() == tel->segment) { int structureElementIdMp = m_mainHandler->ddsHandler()->dtcIsm()->getStructueElementIdFromAssetId( m_buildingInfo.egcus.at(i).assetId); - DEBUG_LOG() << "BuildingProcess::handleEffectOverride i=" << i + DEBUG_LOG(m_logger) << "BuildingProcess::handleEffectOverride i=" << i << " mountPointId=" << m_buildingInfo.egcus.at(i).mountPointId << " assetId=" << m_buildingInfo.egcus.at(i).assetId << " structureElementId=" << m_buildingInfo.structureElementId @@ -938,14 +938,14 @@ void BuildingProcess::handleEffectOverride(BuildingControlUnit::Json::Telegrams: break; } } - DEBUG_LOG() << "Send Override Request" + DEBUG_LOG(m_logger) << "Send Override Request" << " structureElementId=" << request.structureElementId() << " effectId=" << request.effectId() << " effectOverride=" << request.effectOverride(); if ( request.structureElementId() > 0) m_mainHandler->ddsHandler()->ftcIsm()->structureElementUpdateEffectOverrideRequest(request, this); else - ERROR_LOG() << "request.structureElementId() =" << request.structureElementId() << " NOT VALID!!!"; + ERROR_LOG(m_logger) << "request.structureElementId() =" << request.structureElementId() << " NOT VALID!!!"; } } } @@ -1016,12 +1016,12 @@ bool BuildingProcess::writeFile(const QString &fn, const QByteArray &data) QFile f(fn); if (!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - WARNING_LOG() << "Can not open file '" << fn << "' - error: " << f.errorString(); + WARNING_LOG(m_logger) << "Can not open file '" << fn << "' - error: " << f.errorString(); return false; } if (f.write(data) != data.size()) { - WARNING_LOG() << "Can not write data to file '" << fn << "' - error: " << f.errorString(); + WARNING_LOG(m_logger) << "Can not write data to file '" << fn << "' - error: " << f.errorString(); return false; } return true; @@ -1112,7 +1112,7 @@ QByteArray BuildingProcess::generateChargesData() const auto it = chargeTypes.find(charge.chargeTypeId()); if (it == chargeTypes.end()) { - WARNING_LOG() << "Could not find charge type with id " << charge.chargeTypeId() << " - skipping"; + WARNING_LOG(m_logger) << "Could not find charge type with id " << charge.chargeTypeId() << " - skipping"; continue; } @@ -1154,7 +1154,7 @@ void BuildingProcess::openWebSocket() this, &BuildingProcess::onWebSocketDisconnected); connect(m_wsSocket, &QWebSocket::textMessageReceived, this, &BuildingProcess::onTextMessageReceived); - WARNING_LOG() << "openWebSocket:" << m_wsUrl.toLocal8Bit() + WARNING_LOG(m_logger) << "openWebSocket:" << m_wsUrl.toLocal8Bit() << " (buildingId: " << m_buildingInfo.mseId << ") - socket: " << m_wsSocket; m_wsSocket->open(QUrl::fromEncoded(m_wsUrl.toLocal8Bit())); } @@ -1163,7 +1163,7 @@ void BuildingProcess::closeWebSocket() { if (m_wsSocket) { - WARNING_LOG() << "closeWebSocket (buildingId : " << m_buildingInfo.mseId << ") - socket: " << m_wsSocket + WARNING_LOG(m_logger) << "closeWebSocket (buildingId : " << m_buildingInfo.mseId << ") - socket: " << m_wsSocket << " localPort=" << m_wsSocket->localPort() << ", error: " << ", " << m_wsSocket->errorString(); m_wsSocket->disconnect(this); m_wsSocket->close(); @@ -1177,7 +1177,7 @@ void BuildingProcess::onWebSocketError(QAbstractSocket::SocketError error) { if (!m_wsSocket) return; - WARNING_LOG() << "Error connecting to " << m_wsSocket->peerAddress().toString() << ": " << error + WARNING_LOG(m_logger) << "Error connecting to " << m_wsSocket->peerAddress().toString() << ": " << error << " (buildingId: " << m_buildingInfo.mseId << ") - socket: " << m_wsSocket; closeWebSocket(); m_wsReconnectTimer->start(1000); @@ -1185,22 +1185,22 @@ void BuildingProcess::onWebSocketError(QAbstractSocket::SocketError error) void BuildingProcess::onWebSocketConnected() { - INFO_LOG() << "connected to building control process " << m_buildingInfo.mseId << " via websockets localPort="<localPort(); + INFO_LOG(m_logger) << "connected to building control process " << m_buildingInfo.mseId << " via websockets localPort="<localPort(); QMapIterator i(m_effectStates); while (i.hasNext()) { i.next(); - DEBUG_LOG() << "setEffectStates websocket send: " << i.value(); + DEBUG_LOG(m_logger) << "setEffectStates websocket send: " << i.value(); qint64 sendBytesCount = m_wsSocket->sendTextMessage(i.value()); - DEBUG_LOG() << "sendBytesCount= " << sendBytesCount; + DEBUG_LOG(m_logger) << "sendBytesCount= " << sendBytesCount; } m_wsReconnectTimer->stop(); } void BuildingProcess::onWebSocketDisconnected() { - WARNING_LOG() << "Websocket to " << m_wsUrl << " closed - trying to reconnect in 1 sec" + WARNING_LOG(m_logger) << "Websocket to " << m_wsUrl << " closed - trying to reconnect in 1 sec" << " (buildingId : " << m_buildingInfo.mseId << ") - socket: " << m_wsSocket << " localPort=" << m_wsSocket->localPort(); closeWebSocket(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.h index 1cc962eb0..062c0a24e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/building_process.h @@ -36,6 +36,7 @@ public: quint16 getWebsocketPort() {return QUrl::fromEncoded(m_wsUrl.toLocal8Bit()).port();} protected: + NGL::INGLLogger &m_logger; void onStructureElementUpdateEffectOverrideReply(const Core::FunctionReplyObject &replyObject) override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.cpp index e7f52692b..2e1f597ad 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.cpp @@ -11,7 +11,7 @@ namespace Buildings DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Exercise, exerciseId)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -27,7 +27,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -47,16 +47,16 @@ bool DdsHandler::init(const QStringList &qosFileList) bool bRet = m_ddsDts->enableAll(); - DEBUG_LOG() << "Dts initialised"; + DEBUG_LOG(m_logger) << "Dts initialised"; bRet &= m_ddsFts->enableAll(); - INFO_LOG() << "Fts initialised"; + INFO_LOG(m_logger) << "Fts initialised"; bRet &= m_ftcIsm->enableStructureElementUpdateEffectOverride(); - INFO_LOG() << "ISM Ftc initialised"; + INFO_LOG(m_logger) << "ISM Ftc initialised"; bRet &= m_dtcPdm->enableChargeType(); - INFO_LOG() << "ISM Ftc initialised"; + INFO_LOG(m_logger) << "ISM Ftc initialised"; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.h index df23a9cb3..b6a3fdcc7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/dds_handler.h @@ -39,6 +39,7 @@ public: std::shared_ptr dtcPdm() const { return m_dtcPdm; } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_ddsDts; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.cpp index 8ed178dc5..d0758f9db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.cpp @@ -16,13 +16,12 @@ namespace Buildings { -IsmHandler::IsmHandler(MainHandler *mainHandler) - : m_mainHandler(mainHandler) +IsmHandler::IsmHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler) , m_dtcIsm(nullptr) , m_ftcIsm(nullptr) , m_changeTimeoutTimer(new QTimer(this)) - , m_changeTimeoutTimerInit(new QTimer(this)) -{ + , m_changeTimeoutTimerInit(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_changeTimeoutTimer, &QTimer::timeout, this, &IsmHandler::onBuildingsChanged); m_changeTimeoutTimer->setInterval(3 * 1000); @@ -57,13 +56,13 @@ bool IsmHandler::init() !m_dtcIsm->enableMountingPointAsset() || !m_dtcIsm->enableBridgeChangeStatus()) { - ERROR_LOG() << "Can not read data from ISM"; + ERROR_LOG(m_logger) << "Can not read data from ISM"; return false; } m_ftcIsm = InfrastructureManagement::Interface::Ftc::create(m_mainHandler->ddsHandler()->ddsConnector()); if (!m_ftcIsm->enableStructureElementUpdateEffectOverride()) { - ERROR_LOG() << "Can not read data from ISM"; + ERROR_LOG(m_logger) << "Can not read data from ISM"; return false; } m_changeTimeoutTimerInit->start(); @@ -105,14 +104,14 @@ void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::I case DataModification::eModified: { const int exerciseId = data.availableInExercise().size() == 0 ? 0 : data.availableInExercise().at(0); - DEBUG_LOG() << "setting asset " << data.id() << " available in exercise " << exerciseId; + DEBUG_LOG(m_logger) << "setting asset " << data.id() << " available in exercise " << exerciseId; m_assetMainStructureElementInExercise.insert(data.id(), exerciseId); break; } case DataModification::eRemoved: { const int exerciseId = data.availableInExercise().size() == 0 ? 0 : data.availableInExercise().at(0); - DEBUG_LOG() << "removing asset " << data.id() << " from exercise " << exerciseId; + DEBUG_LOG(m_logger) << "removing asset " << data.id() << " from exercise " << exerciseId; m_assetMainStructureElementInExercise.remove(data.id()); break; } @@ -127,11 +126,11 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou { case DataModification::eAdded: case DataModification::eModified: - DEBUG_LOG() << "mounting asset " << data.assetId() << " on structure element id " << data.structureElementId(); + DEBUG_LOG(m_logger) << "mounting asset " << data.assetId() << " on structure element id " << data.structureElementId(); m_structureElementId2AssetId.insert(data.structureElementId(), data.assetId()); break; case DataModification::eRemoved: - DEBUG_LOG() << "unmounting asset " << m_structureElementId2AssetId.value(data.structureElementId()) << " from structure element " << data.structureElementId(); + DEBUG_LOG(m_logger) << "unmounting asset " << m_structureElementId2AssetId.value(data.structureElementId()) << " from structure element " << data.structureElementId(); m_structureElementId2AssetId.remove(data.structureElementId()); break; } @@ -140,7 +139,7 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; switch (modType) { case DataModification::eAdded: @@ -149,10 +148,10 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M if (!isElementAssignedToExercise (data.id(),m_mainHandler->exerciseId() ) ) { m_mainStructureElements.remove(data.id()); - DEBUG_LOG() << "Building not in exercise id=" << data.id(); + DEBUG_LOG(m_logger) << "Building not in exercise id=" << data.id(); return; } - DEBUG_LOG() << "Building=" << data.name() + DEBUG_LOG(m_logger) << "Building=" << data.name() << " properties=" << data.properties(); QJsonParseError parserError; QByteArray content = QByteArray::fromStdString(data.properties()); @@ -160,24 +159,24 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return; } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); const QJsonObject objProperties(doc.object()); if ( objProperties.contains(QStringLiteral("start_building_process"))) { - DEBUG_LOG() << "properties contains start_building_process"; + DEBUG_LOG(m_logger) << "properties contains start_building_process"; bool startBuildingProcess = objProperties.value(QStringLiteral("start_building_process")).toBool(); if (!startBuildingProcess) { - DEBUG_LOG() << "Building=" << data.name() + DEBUG_LOG(m_logger) << "Building=" << data.name() << " start_building_process = false "; return; } } - DEBUG_LOG() << "##### onMainStructureElementChanged - ID = " << data.id(); + DEBUG_LOG(m_logger) << "##### onMainStructureElementChanged - ID = " << data.id(); checkOverride( m_mainStructureElements[data.id()], data); m_mainStructureElements[data.id()] = data; break; @@ -192,13 +191,13 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M void IsmHandler::onBridgeStatusChanged(const InfrastructureManagement::BridgeChangeStatus &data, DataModification modType) { static int s_id = 1; - DEBUG_LOG() << Q_FUNC_INFO << "s_id=" << s_id; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "s_id=" << s_id; switch (modType) { case DataModification::eAdded: case DataModification::eModified: { - DEBUG_LOG() << "##### onBridgeStatusChanged - buildingId = " << data.buildingId(); + DEBUG_LOG(m_logger) << "##### onBridgeStatusChanged - buildingId = " << data.buildingId(); BridgeStatus bs; bs.id(s_id++); bs.buildingId(data.buildingId()); @@ -215,17 +214,17 @@ void IsmHandler::onBridgeStatusChanged(const InfrastructureManagement::BridgeCha void IsmHandler::getEgcuToRoom(const InfrastructureManagement::MainStructureElement &mse, QVector &eis) { - INFO_LOG() << "properties=" << mse.properties(); + INFO_LOG(m_logger) << "properties=" << mse.properties(); QJsonParseError parserError; QByteArray content = QByteArray::fromStdString(mse.properties()); const QJsonDocument doc(QJsonDocument::fromJson(content, &parserError)); if (parserError.error != QJsonParseError::NoError) { - WARNING_LOG() << "Error parsing json document: " << parserError.errorString(); + WARNING_LOG(m_logger) << "Error parsing json document: " << parserError.errorString(); return; } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); const QJsonObject objEgcus(doc.object()); const QJsonArray arrEgcus(objEgcus.value(QStringLiteral("egcusToRooms")).toArray()); for (int i = 0; i < arrEgcus.size(); ++i) @@ -233,19 +232,19 @@ void IsmHandler::getEgcuToRoom(const InfrastructureManagement::MainStructureElem const QJsonObject objRooms(arrEgcus.at(i).toObject()); const int mountpointEgcuId = objRooms[QStringLiteral("mountpointEgcu")].toInt(); - INFO_LOG() << "mountpointEgcu=" << mountpointEgcuId; - INFO_LOG() << "i=" <exerciseId() != bi.currentExerciseId) { - DEBUG_LOG() << "Exercise id of building does not match current exercise: " << bi.currentExerciseId + DEBUG_LOG(m_logger) << "Exercise id of building does not match current exercise: " << bi.currentExerciseId << " != " << m_mainHandler->exerciseId() << " buildingId=" << bi.mseId << " buildingName" << bi.name; continue; } - INFO_LOG() << "Adding building configuration for " << mse.id() << " - " << mse.name(); + INFO_LOG(m_logger) << "Adding building configuration for " << mse.id() << " - " << mse.name(); availableBuildingIds += mse.id(); getEgcuToRoom(mse, bi.egcus); newBuildingConfiguration.insert(bi.mseId, bi); @@ -325,7 +324,7 @@ void IsmHandler::buildingsChanged(bool init) if (!availableBuildingIds.contains(buildingId)) { - INFO_LOG() << "Building " << buildingId << " no longer exists in this exercise - removing"; + INFO_LOG(m_logger) << "Building " << buildingId << " no longer exists in this exercise - removing"; emit buildingRemoved(buildingId); continue; } @@ -333,11 +332,11 @@ void IsmHandler::buildingsChanged(bool init) const BuildingInfo &biNew = newBuildingConfiguration.value(buildingId); if (biOld == biNew) { - INFO_LOG() << "Building " << buildingId << " did not change - nothing to do"; + INFO_LOG(m_logger) << "Building " << buildingId << " did not change - nothing to do"; } else { - INFO_LOG() << "setHistoryState Building " << buildingId << " changed -> updating configuration" + INFO_LOG(m_logger) << "setHistoryState Building " << buildingId << " changed -> updating configuration" << " biNew mseId=" << biNew.mseId << " init=" << init; bool initBuildingChanged = true; @@ -348,7 +347,7 @@ void IsmHandler::buildingsChanged(bool init) { if (m_currentBuildingConfiguration.contains(it.key())) continue; - INFO_LOG() << "setHistoryState New building added key= " << it.key() + INFO_LOG(m_logger) << "setHistoryState New building added key= " << it.key() << " init=" << init; emit buildingChanged(it.value(), init); } @@ -372,7 +371,7 @@ void IsmHandler::handleBuildingSensorModule(const InfrastructureManagement::Stru bsi.port = getBsmPortFromJSon(ia.properties()); bsi.relPosition = se.relPosition(); bsi.orientation = se.orientation(); - DEBUG_LOG() << "adding bsm sensor module to building " << bi.mseId << ": " << bsi.assetId << ", " << bsi.bsmId << ", " << bsi.hostname; + DEBUG_LOG(m_logger) << "adding bsm sensor module to building " << bi.mseId << ": " << bsi.assetId << ", " << bsi.bsmId << ", " << bsi.hostname; bi.bsms.insert(bsi.assetId, bsi); } @@ -387,7 +386,7 @@ void IsmHandler::handleBuildingControlUnit(const InfrastructureManagement::Struc auto itMpa = m_structureElementId2AssetId.find(se.id()); if (itMpa == m_structureElementId2AssetId.end()) { - INFO_LOG() << "structure element id " << se.id() << " not (yet)found" + INFO_LOG(m_logger) << "structure element id " << se.id() << " not (yet)found" << " bi.mseId=" << bi.mseId << " bi.assetId=" << bi.assetId << " bi.egcus.size=" << bi.egcus.size() @@ -398,31 +397,31 @@ void IsmHandler::handleBuildingControlUnit(const InfrastructureManagement::Struc const auto itAsset = m_assetMainStructureElementInExercise.find(assetId); if (itAsset == m_assetMainStructureElementInExercise.end()) { - ERROR_LOG() << "asset id " << assetId << " not found"; + ERROR_LOG(m_logger) << "asset id " << assetId << " not found"; Q_ASSERT(false); return; } bi.currentExerciseId = itAsset.value(); bi.assetId = itAsset.key(); - DEBUG_LOG() << "adding bsm control unit (virtual) to building " << bi.mseId << ": " << bi.assetId << ", " << bi.currentExerciseId; + DEBUG_LOG(m_logger) << "adding bsm control unit (virtual) to building " << bi.mseId << ": " << bi.assetId << ", " << bi.currentExerciseId; } void IsmHandler::handleEffectGenerationControlUnit(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const { - DEBUG_LOG() << "BuildingId=" << bi.mseId + DEBUG_LOG(m_logger) << "BuildingId=" << bi.mseId << " se.id=" << se.id(); auto itMpa = m_structureElementId2AssetId.find(se.id()); if (itMpa == m_structureElementId2AssetId.end()) { - INFO_LOG() << "Return m_structureElementId2AssetId.size()=" << m_structureElementId2AssetId.size(); + INFO_LOG(m_logger) << "Return m_structureElementId2AssetId.size()=" << m_structureElementId2AssetId.size(); return; } const int assetId = itMpa.value(); const auto itAsset = m_instAssets.find(assetId); if (itAsset == m_instAssets.end()) { - INFO_LOG() << "Return m_instAssets.size()=" << m_instAssets.size(); + INFO_LOG(m_logger) << "Return m_instAssets.size()=" << m_instAssets.size(); return; } const InfrastructureManagement::InstrumentationAsset &ia = itAsset.value(); @@ -433,12 +432,12 @@ void IsmHandler::handleEffectGenerationControlUnit(const InfrastructureManagemen egcu.mountPointId = se.mountingPointId(); egcu.hostname = QString::fromStdString(ia.hostname()); egcu.assetId = assetId; - DEBUG_LOG() << "Egcu.hostname=" << egcu.hostname; - INFO_LOG() << "properties=" << ia.properties(); + DEBUG_LOG(m_logger) << "Egcu.hostname=" << egcu.hostname; + INFO_LOG(m_logger) << "properties=" << ia.properties(); bi.egcus.push_back(egcu); - DEBUG_LOG() << "adding egcu to building " << bi.mseId << ": " << egcu.hostname + DEBUG_LOG(m_logger) << "adding egcu to building " << bi.mseId << ": " << egcu.hostname << " name=" << egcu.buildingName << " mountPointName=" << egcu.mountPointName << " mountPointId=" << egcu.mountPointId @@ -470,37 +469,37 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem const InfrastructureManagement::MainStructureElement &mseNew) { - DEBUG_LOG() << Q_FUNC_INFO; - DEBUG_LOG() << "mseOld.elements().size()=" << mseOld.elements().size() + DEBUG_LOG(m_logger) << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << "mseOld.elements().size()=" << mseOld.elements().size() << " mseNew.elements().size()=" << mseNew.elements().size(); for (const InfrastructureManagement::StructureElement &se : mseNew.elements()) { - DEBUG_LOG() << "se=" << se.id() + DEBUG_LOG(m_logger) << "se=" << se.id() << " name=" << se.name() << " displayName=" << se.displayName() << " properties=" << se.properties(); for (const InfrastructureManagement::StructureElement &seOld : mseOld.elements()) { - DEBUG_LOG() << "seOld.id=" << seOld.id() + DEBUG_LOG(m_logger) << "seOld.id=" << seOld.id() << " se.id=" << se.id(); if ( seOld.id() == se.id()) { - DEBUG_LOG() << "Properties =" << se.properties() + DEBUG_LOG(m_logger) << "Properties =" << se.properties() << " se.id=" << se.id() << " se.name=" << se.name() << " mountingPointId=" << se.mountingPointId(); - DEBUG_LOG() << "se.properties()=" << se.properties() + DEBUG_LOG(m_logger) << "se.properties()=" << se.properties() << " seOld.properties()=" << seOld.properties(); if (se.properties() != seOld.properties() ) { - DEBUG_LOG() << "HandleOverrides" + DEBUG_LOG(m_logger) << "HandleOverrides" "<< m_currentBuildingConfiguration.size=" << m_currentBuildingConfiguration.size(); if ( se.structureElementTypeId() == InfrastructureManagement::StructureElementType::Building) { - DEBUG_LOG() << "BSM-Flash, no EGCU"; + DEBUG_LOG(m_logger) << "BSM-Flash, no EGCU"; QByteArray properties = QByteArray::fromStdString(se.properties()); emit setEffectStates(mseNew.id(), 0, properties ); continue; @@ -508,13 +507,13 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem for (auto it = m_currentBuildingConfiguration.begin(); it != m_currentBuildingConfiguration.end(); ++it) { BuildingInfo &bi = it.value(); - DEBUG_LOG() << "key=" << it.key() + DEBUG_LOG(m_logger) << "key=" << it.key() << " id=" << bi.mseId << " assetId=" << bi.assetId << " egcus.size=" << bi.egcus.size(); for (const auto &egcu : std::as_const(bi.egcus)) { - DEBUG_LOG() << "AssetId=" << egcu.assetId + DEBUG_LOG(m_logger) << "AssetId=" << egcu.assetId << " assetName=" << egcu.assetName << " hostname=" << egcu.hostname << " egcu.mountPointId=" << egcu.mountPointId @@ -522,7 +521,7 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem if (egcu.mountPointId == se.mountingPointId()) { QByteArray properties = QByteArray::fromStdString(se.properties()); - DEBUG_LOG() << "Send Json SetEffectStates to BuildingProcess" + DEBUG_LOG(m_logger) << "Send Json SetEffectStates to BuildingProcess" << " buildingId=" << " assetId="<< egcu.assetId << " properties =" << properties; @@ -535,7 +534,7 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem } else { - TRACE_LOG() << "No changes do not HandleOverrides"; + TRACE_LOG(m_logger) << "No changes do not HandleOverrides"; } } @@ -549,7 +548,7 @@ void IsmHandler::checkOverride(const InfrastructureManagement::MainStructureElem int assetId; bool foundAssetId = m_dtcIsm->getAssetIdFromMountingPoint(se.id(), se.mountingPointId(), assetId); - DEBUG_LOG() << "Send Overrides to BuildingProcess (EGCU)" + DEBUG_LOG(m_logger) << "Send Overrides to BuildingProcess (EGCU)" << " foundAssetId=" << foundAssetId << " structureElementId=" << mseNew.id() << " se.id=" << se.id() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.h index 3560a9c1e..47daffab6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ism_handler.h @@ -170,6 +170,7 @@ private Q_SLOTS: void onBuildingsChangedInit(); private: + NGL::INGLLogger &m_logger; void handleBuildingSensorModule(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const; void handleBuildingControlUnit(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const; void handleEffectGenerationControlUnit(const InfrastructureManagement::StructureElement &se, BuildingInfo &bi) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.cpp index 97655b4fe..912faf336 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.cpp @@ -9,9 +9,8 @@ namespace Buildings { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -30,17 +29,17 @@ bool MainHandler::init(int domainId, int exerciseId) bool bRet = initInternal(domainId, exerciseId); - DEBUG_LOG() << "WebSocketInterfaceHandler initialized Port=" << m_webSocketHandler->listenPort(); + DEBUG_LOG(m_logger) << "WebSocketInterfaceHandler initialized Port=" << m_webSocketHandler->listenPort(); m_ddsHandler->pacemaker()->addPort(m_webSocketHandler->listenPort(), Core::PortType::WebSocketServer); if (bRet) { - DEBUG_LOG() << "svcBuildings successfully initialized"; + DEBUG_LOG(m_logger) << "svcBuildings successfully initialized"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running); } else { - ERROR_LOG() << "Error initializing svcBuildings..."; + ERROR_LOG(m_logger) << "Error initializing svcBuildings..."; if (m_ddsHandler && m_ddsHandler->pacemaker()) m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); } @@ -49,16 +48,16 @@ bool MainHandler::init(int domainId, int exerciseId) bool MainHandler::initInternal(int domainId, int exerciseId) { - INFO_LOG() << "MainHandler::init domainId = " << domainId + INFO_LOG(m_logger) << "MainHandler::init domainId = " << domainId << " exerciseId = " << exerciseId; m_dbHandler = std::make_shared(); if (!m_dbHandler->init(exerciseId, Settings::settings())) { - ERROR_LOG() << "Could not init DbHandler"; + ERROR_LOG(m_logger) << "Could not init DbHandler"; return false; } - INFO_LOG() << "DbHandler initialized"; + INFO_LOG(m_logger) << "DbHandler initialized"; m_ddsHandler = std::make_shared(domainId, exerciseId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.h index 002b87b5d..d4df8217d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/main_handler.h @@ -54,6 +54,7 @@ public: private slots: private: + NGL::INGLLogger &m_logger; bool initInternal(int domainId, int exerciseId); std::shared_ptr m_bcHandler; std::shared_ptr m_ddsHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.cpp index 3a31c3c6d..33618484f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.cpp @@ -7,10 +7,9 @@ namespace Buildings { -PdmHandler::PdmHandler(MainHandler *mainHandler) - : m_mainHandler(mainHandler) - , m_bPdmInitialized(false) -{} +PdmHandler::PdmHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler) + , m_bPdmInitialized(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} PdmHandler::~PdmHandler() {} @@ -26,7 +25,7 @@ void PdmHandler::initializePdm() !dtcPdm->waitForHistoricalDataChargeType(20000) || !dtcPdm->waitForHistoricalDataBuildingChargeEffect(20000)) { - ERROR_LOG() << "Can not read charge/gear types from PDM"; + ERROR_LOG(m_logger) << "Can not read charge/gear types from PDM"; m_bPdmInitialized = false; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.h index 1f0d2f4ff..393cd4011 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/pdm_handler.h @@ -18,8 +18,10 @@ public: QMap buildingChargeEffects(); QMap chargeTypes(); private: + NGL::INGLLogger &m_logger; void initializePdm(); private: + NGL::INGLLogger &m_logger; QMap m_chargeTypes; QMap m_buildingChargeEffects; MainHandler *m_mainHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.cpp index b3f321ca6..a43c10839 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.cpp @@ -6,9 +6,8 @@ namespace Buildings { -PpmHandler::PpmHandler(MainHandler *mainHandler) - : m_mainHandler(mainHandler) -{} +PpmHandler::PpmHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} PpmHandler::~PpmHandler() {} @@ -22,12 +21,12 @@ bool PpmHandler::init() this, &PpmHandler::onParticipantPositionChanged); if (!m_ppmDtc->enableEquipmentExerciseMapping()) { - ERROR_LOG() << "Can not read equipment/exercise mappings from PPM"; + ERROR_LOG(m_logger) << "Can not read equipment/exercise mappings from PPM"; return false; } if (!m_ppmDtc->enableParticipantPosition()) { - ERROR_LOG() << "Can not read ParticipantPositions from PPM"; + ERROR_LOG(m_logger) << "Can not read ParticipantPositions from PPM"; return false; } return true; @@ -37,7 +36,7 @@ int PpmHandler::equipmentNumberToParticipantId(int equipmentNumber) const { const int ret = m_equipmentNumber2ParticipantId.value(equipmentNumber, -1); if (ret < 0) - WARNING_LOG() << "Can not map equipment number " << equipmentNumber << " to a valid participant id - using -1"; + WARNING_LOG(m_logger) << "Can not map equipment number " << equipmentNumber << " to a valid participant id - using -1"; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.h index b47ee2c5f..b10ec5877 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/ppm_handler.h @@ -25,6 +25,7 @@ private Q_SLOTS: void onEquipmentExerciseMappingChanged(const ParticipantManagement::EquipmentExerciseMapping &data, DataModification modType); void onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ppmDtc; QHash m_equipmentNumber2ParticipantId; QHash m_participantPositions; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.cpp index 054bed97e..283fc2280 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.cpp @@ -23,10 +23,10 @@ bool RelayInfoHandler::init() void RelayInfoHandler::onSetRelayInfoRequest(const rti::core::SampleIdentity &cookie, const SetRelayInfoRequest &request) { - DEBUG_LOG() << "onSetRelayInfoRequest " << request; + DEBUG_LOG(m_logger) << "onSetRelayInfoRequest " << request; const Core::FunctionReplyObject fro = onSetRelayInfoRequestInternal(request); if (fro.error()) - WARNING_LOG() << fro(); + WARNING_LOG(m_logger) << fro(); m_mainHandler->ddsHandler()->fts()->setRelayInfoReply(cookie, fro); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.h index b81b6d755..5c25c9666 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/relay_info_handler.h @@ -23,6 +23,7 @@ public: private Q_SLOTS: private: + NGL::INGLLogger &m_logger; void onSetRelayInfoRequest(const rti::core::SampleIdentity &cookie, const SetRelayInfoRequest &request) override; Core::FunctionReplyObject onSetRelayInfoRequestInternal(const SetRelayInfoRequest &data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.cpp index 45a24bd60..378056328 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.cpp @@ -33,10 +33,10 @@ WebSocketHandler::~WebSocketHandler() bool WebSocketHandler::init(quint16 listenPort) { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; if (!m_webSocketServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting"; + WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting"; return false; } @@ -44,7 +44,7 @@ bool WebSocketHandler::init(quint16 listenPort) this, &WebSocketHandler::onNewConnection); - INFO_LOG() << "Listening on port " << m_webSocketServer->serverPort(); + INFO_LOG(m_logger) << "Listening on port " << m_webSocketServer->serverPort(); return true; } @@ -61,7 +61,7 @@ bool WebSocketHandler::init(const QPair &portRange) bool WebSocketHandler::sendTelegramInternal() const { - DEBUG_LOG() << "sendTelegramInternal"; + DEBUG_LOG(m_logger) << "sendTelegramInternal"; QJsonObject obj; obj[QStringLiteral("participantId")] = 1; obj[QStringLiteral("equipmentNumber")] = 2; @@ -82,7 +82,7 @@ bool WebSocketHandler::sendTelegramInternal() const bool WebSocketHandler::sendbuildingInfos() const { - DEBUG_LOG() << "sendbuildingInfos"; + DEBUG_LOG(m_logger) << "sendbuildingInfos"; QJsonObject obj; QJsonArray arr; @@ -93,7 +93,7 @@ bool WebSocketHandler::sendbuildingInfos() const BuildingProcess* buildingProcess = i.value(); BuildingInfo buildingInfo = buildingProcess->buildingInfo(); quint16 port = buildingProcess->getWebsocketPort(); - DEBUG_LOG() << "key=" << i.key() + DEBUG_LOG(m_logger) << "key=" << i.key() << " port= " << port << " buildingInfo.name=" << buildingInfo.name; QJsonObject objIter; @@ -119,8 +119,8 @@ bool WebSocketHandler::sendbuildingInfos() const void WebSocketHandler::onNewMessage(const QString &message) { - DEBUG_LOG() << "onNewMessage='" << message << "'"; - DEBUG_LOG() << "m_buildingControlHandler->m_buildings.size()=" << m_buildingControlHandler->getBuildings().size(); + DEBUG_LOG(m_logger) << "onNewMessage='" << message << "'"; + DEBUG_LOG(m_logger) << "m_buildingControlHandler->m_buildings.size()=" << m_buildingControlHandler->getBuildings().size(); if (message.indexOf(QStringLiteral("buildingRequest")) > 0) { @@ -128,7 +128,7 @@ void WebSocketHandler::onNewMessage(const QString &message) } if (message.indexOf(QStringLiteral("triggerFlashlight")) > 0) { - DEBUG_LOG() << "triggerFlashlight" ; + DEBUG_LOG(m_logger) << "triggerFlashlight" ; triggerFlashlight(message); } } @@ -148,12 +148,12 @@ QJsonObject WebSocketHandler::ObjectFromString(const QString& in) } else { - WARNING_LOG() << "Document is not an object"; + WARNING_LOG(m_logger) << "Document is not an object"; } } else { - WARNING_LOG() << "Invalid JSON...\n" << in ; + WARNING_LOG(m_logger) << "Invalid JSON...\n" << in ; } return obj; @@ -162,20 +162,20 @@ QJsonObject WebSocketHandler::ObjectFromString(const QString& in) void WebSocketHandler::triggerFlashlight(const QString &message) { - DEBUG_LOG() << "triggerFlashlight message=" << message; + DEBUG_LOG(m_logger) << "triggerFlashlight message=" << message; QJsonObject obj = ObjectFromString(message); QJsonObject dataObj = obj.value(QStringLiteral("data")).toObject(); int structureElementId = dataObj.value(QStringLiteral("structureElementId")).toInt(); QString hostnameBsm = dataObj.value(QStringLiteral("hostnameBsm")).toString(); - DEBUG_LOG() << "hostnameBsm=" << hostnameBsm + DEBUG_LOG(m_logger) << "hostnameBsm=" << hostnameBsm << " structureElementId=" << structureElementId; } void WebSocketHandler::onNewConnection() { - DEBUG_LOG() << "onNewConnection"; + DEBUG_LOG(m_logger) << "onNewConnection"; QWebSocket *ws = m_webSocketServer->nextPendingConnection(); if (!ws) @@ -188,12 +188,12 @@ void WebSocketHandler::onNewConnection() m_webSockets += ws; - INFO_LOG() << "New websocket connected"; + INFO_LOG(m_logger) << "New websocket connected"; } void WebSocketHandler::onWebSocketDisconnected() { - DEBUG_LOG() << "onWebSocketDisconnected"; + DEBUG_LOG(m_logger) << "onWebSocketDisconnected"; QWebSocket *ws = qobject_cast(sender()); if (!ws) return; @@ -201,7 +201,7 @@ void WebSocketHandler::onWebSocketDisconnected() m_webSockets.removeAll(ws); ws->deleteLater(); - INFO_LOG() << "A websocket disconnected"; + INFO_LOG(m_logger) << "A websocket disconnected"; } bool WebSocketHandler::sendPosition() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.h index e8df3a5de..f9fec27be 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/Buildings/web_socket_handler.h @@ -28,6 +28,7 @@ public: bool sendPosition(); private: + NGL::INGLLogger &m_logger; bool sendTelegramInternal() const; bool sendbuildingInfos() const; QJsonObject ObjectFromString(const QString& in); @@ -39,6 +40,7 @@ private Q_SLOTS: void onWebSocketDisconnected(); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_buildingControlHandler; QWebSocketServer* m_webSocketServer = nullptr; QVector m_webSockets; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.cpp index 24de43ce7..41fe7571c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.cpp @@ -30,7 +30,7 @@ bool ClientConnection::init() { if (m_socket == nullptr) { - ERROR_LOG() << "Initialisation failed due to an invalid socket"; + ERROR_LOG(m_logger) << "Initialisation failed due to an invalid socket"; return false; } @@ -51,17 +51,17 @@ void ClientConnection::addMessage(const CombatNetRadio::WebSocketInterface::Mess if (!m_socket || m_socket->state() != QAbstractSocket::ConnectedState) { m_messageQueue.enqueue(message); - DEBUG_LOG() << "Adding message to queue, size: " << m_messageQueue.size(); + DEBUG_LOG(m_logger) << "Adding message to queue, size: " << m_messageQueue.size(); return; } const QString msg(message.toJsonString()); - DEBUG_LOG() << "Send msg: " << msg; + DEBUG_LOG(m_logger) << "Send msg: " << msg; m_socket->sendTextMessage(msg); } void ClientConnection::onNewTextMessageFromSocket(const QString &message) { - DEBUG_LOG() << "Recv msg: " << message; + DEBUG_LOG(m_logger) << "Recv msg: " << message; emit newTextMessage(this, message); } @@ -73,15 +73,15 @@ void ClientConnection::sendMessagesFromQueue() { Messages::ReplyMessage message = m_messageQueue.dequeue(); const QString msg(message.toJsonString()); - TRACE_LOG() << "Send msg: " << msg; + TRACE_LOG(m_logger) << "Send msg: " << msg; m_socket->sendTextMessage(msg); - DEBUG_LOG() << "Sent message from queue, new size: " << m_messageQueue.size(); + DEBUG_LOG(m_logger) << "Sent message from queue, new size: " << m_messageQueue.size(); } } void ClientConnection::onSocketDisconnect() { - DEBUG_LOG() << "Client with ip " + DEBUG_LOG(m_logger) << "Client with ip " << m_ip.toString() << " disconnected"; emit disconnected(this); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.h index eeba04c30..c00036c8f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/client_connection.h @@ -40,9 +40,11 @@ private Q_SLOTS: void onSocketDisconnect(); private: + NGL::INGLLogger &m_logger; void sendMessages(); private: + NGL::INGLLogger &m_logger; QWebSocket *m_socket; QQueue m_messageQueue; QHostAddress m_ip; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.cpp index f35737fdd..6cdfb0359 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.cpp @@ -10,9 +10,8 @@ using namespace CombatNetRadio::WebSocketInterface::Connection; -ConnectionHandler::ConnectionHandler() - : m_server(nullptr) -{ +ConnectionHandler::ConnectionHandler() : m_server(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } ConnectionHandler::~ConnectionHandler() @@ -38,13 +37,13 @@ bool ConnectionHandler::init() quint16 port = 2081; - DEBUG_LOG() << "Trying to listen to port " << port; + DEBUG_LOG(m_logger) << "Trying to listen to port " << port; if (!m_server->listen(QHostAddress::Any, port)) { - ERROR_LOG() << "Not possible to listen to port " << port; + ERROR_LOG(m_logger) << "Not possible to listen to port " << port; return false; } - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "... ok"; return true; } @@ -63,7 +62,7 @@ void ConnectionHandler::onNewMessage(CombatNetRadio::WebSocketInterface::Message void ConnectionHandler::onServerError(QWebSocketProtocol::CloseCode closeCode) { - ERROR_LOG() << "Got server error with close code " << closeCode; + ERROR_LOG(m_logger) << "Got server error with close code " << closeCode; } void ConnectionHandler::onNewConnection() @@ -75,7 +74,7 @@ void ConnectionHandler::onNewConnection() if (!newConnection->init()) { - ERROR_LOG() << "Failed to initialise new client"; + ERROR_LOG(m_logger) << "Failed to initialise new client"; delete newConnection; newConnection = nullptr; continue; @@ -85,7 +84,7 @@ void ConnectionHandler::onNewConnection() connect(newConnection, &ClientConnection::disconnected, this, &ConnectionHandler::onDisconnected); m_connections.append(newConnection); - DEBUG_LOG() << "New client with ip " << newConnection->ip().toString() << " connected"; + DEBUG_LOG(m_logger) << "New client with ip " << newConnection->ip().toString() << " connected"; emit newClientConnection((qint64) static_cast(newConnection)); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.h index 743069526..bf5e4e3d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Connection/connection_handler.h @@ -50,6 +50,7 @@ private Q_SLOTS: void onDisconnected(ClientConnection *conn); private: + NGL::INGLLogger &m_logger; QWebSocketServer *m_server; QVector m_connections; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.cpp index 9e73f71ab..35891e214 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.cpp @@ -12,9 +12,8 @@ namespace WebSocketInterface namespace Messages { -MessageHandler::MessageHandler(ExerciseManager *exerciseManager) - : m_exerciseManager(exerciseManager) -{ +MessageHandler::MessageHandler(ExerciseManager *exerciseManager) : m_exerciseManager(exerciseManager), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { Q_ASSERT(exerciseManager); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.h index 70ea52b9f..ed4a920a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/Messages/message_handler.h @@ -28,6 +28,8 @@ public Q_SLOTS: void onNewTextMessage(MessageTransmitter *transmitter, const QString &message); private: + +NGL::INGLLogger &m_logger; ExerciseManager *m_exerciseManager; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/websocket_interface_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/websocket_interface_handler.cpp index bc8df02bb..4e4783e11 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/websocket_interface_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/WebSocketInterface/websocket_interface_handler.cpp @@ -39,7 +39,7 @@ bool WebSocketInterfaceHandler::init() if (!m_connectionHandler->init()) { - ERROR_LOG() << "Failed to initialise ConnectionHandler"; + ERROR_LOG(m_logger) << "Failed to initialise ConnectionHandler"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/config_cnr.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/config_cnr.cpp index 3b13209a2..2cdbe4b16 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/config_cnr.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/config_cnr.cpp @@ -16,12 +16,11 @@ namespace CombatNetRadio { -ConfigCnr::ConfigCnr(int exerciseId, AudioVideoManagement::Interface::Dtc *avmDtc, InfrastructureManagement::Interface::Dtc *ismDtc) - : m_exerciseId(exerciseId) +ConfigCnr::ConfigCnr(int exerciseId, AudioVideoManagement::Interface::Dtc *avmDtc, InfrastructureManagement::Interface::Dtc *ismDtc) : m_exerciseId(exerciseId) , m_avmDtc(avmDtc) , m_ismDtc(ismDtc) - , m_loggerJson(getLogger("ConfigCnr.Json")) -{ + , m_loggerJson(getLogger("ConfigCnr.Json")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { Q_ASSERT(avmDtc); Q_ASSERT(ismDtc); @@ -199,7 +198,7 @@ boost::optional ConfigCnr::activePlan() void ConfigCnr::onActiveFrequencyPlanningChanged(const AudioVideoManagement::ActiveFrequencyPlanning &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << ": " << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data; Q_UNUSED(modType); if (data.exerciseId() == m_exerciseId) @@ -208,7 +207,7 @@ void ConfigCnr::onActiveFrequencyPlanningChanged(const AudioVideoManagement::Act void ConfigCnr::onFrequencyPlanningChanged(const AudioVideoManagement::FrequencyPlanning &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << ": " << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data; Q_UNUSED(modType); @@ -223,7 +222,7 @@ void ConfigCnr::onFrequencyPlanningChanged(const AudioVideoManagement::Frequency void ConfigCnr::onCnrConfigChanged(const AudioVideoManagement::CnrConfig &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << ": " << data; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ": " << data; Q_UNUSED(modType); bool isGlobal = !data.exerciseId().is_set(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.cpp index 432e12a72..92b83c4b1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.cpp @@ -15,16 +15,16 @@ namespace CombatNetRadio DdsHandler::DdsHandler(int domainId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Global)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.h index 484a77a12..f5b1dbdc0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/dds_handler.h @@ -76,6 +76,7 @@ public: } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::unique_ptr m_pacemaker; std::shared_ptr m_asmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.cpp index 1b72d2131..e5559693f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.cpp @@ -111,13 +111,13 @@ std::vector ExerciseManager::radioSt WebSocketInterface::Messages::ReplyMessage ExerciseManager::configCnr(const QString &uuid) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; const WebSocketInterface::Messages::ErrorMessage noActivePlanning(1, uuid, QStringLiteral("No active frequency planning found")); if (m_parts.empty()) { - DEBUG_LOG() << "No active frequency planning due to empty m_parts."; + DEBUG_LOG(m_logger) << "No active frequency planning due to empty m_parts."; return noActivePlanning; } @@ -141,7 +141,7 @@ WebSocketInterface::Messages::ReplyMessage ExerciseManager::configCnr(const QStr if (configCnrData.radioCircuit.empty()) { - DEBUG_LOG() << "No active frequency planning due to empty radio circuits."; + DEBUG_LOG(m_logger) << "No active frequency planning due to empty radio circuits."; return noActivePlanning; } @@ -182,25 +182,25 @@ WebSocketInterface::Messages::ReplyMessage ExerciseManager::positionsCnr(const Q void ExerciseManager::onModifyFrequencyPlanningStatusReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Error while modifying FrequencyPlanningStatus: " << replyObject.str(); + ERROR_LOG(m_logger) << "Error while modifying FrequencyPlanningStatus: " << replyObject.str(); else - INFO_LOG() << "onModifyFrequencyPlanningStatusReply ok"; + INFO_LOG(m_logger) << "onModifyFrequencyPlanningStatusReply ok"; } void ExerciseManager::onClearFrequencyPlanningStatusReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Error while clearing FrequencyPlanningStatus: " << replyObject.str(); + ERROR_LOG(m_logger) << "Error while clearing FrequencyPlanningStatus: " << replyObject.str(); else - INFO_LOG() << "onClearFrequencyPlanningStatusReply ok"; + INFO_LOG(m_logger) << "onClearFrequencyPlanningStatusReply ok"; } void ExerciseManager::onRemoveFrequencyPlanningStatusByClientReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Error while removing FrequencyPlanningStatus: " << replyObject.str(); + ERROR_LOG(m_logger) << "Error while removing FrequencyPlanningStatus: " << replyObject.str(); else - INFO_LOG() << "onRemoveFrequencyPlanningStatusByClientReply ok"; + INFO_LOG(m_logger) << "onRemoveFrequencyPlanningStatusByClientReply ok"; } void ExerciseManager::setPositionsUpdateInterval(std::chrono::milliseconds interval) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.h index e6fe3ebb7..da1c5e92a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/exercise_manager.h @@ -68,6 +68,7 @@ signals: void positionsUpdate(const WebSocketInterface::Messages::ReplyMessage &positionsCnr); private: + NGL::INGLLogger &m_logger; void onExerciseActivated(int exerciseId); void onExerciseDeactivated(int exerciseId); void onPositionsUpdateTimeout(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/main_handler.cpp index f0139c631..0457761a4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/main_handler.cpp @@ -19,12 +19,12 @@ MainHandler::~MainHandler() = default; bool MainHandler::init(int domainId) { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; m_ddsHandler.reset(new DdsHandler(domainId)); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation DdsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DdsHandler failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -35,7 +35,7 @@ bool MainHandler::init(int domainId) m_webSocketInterfaceHandler.reset(new WebSocketInterface::WebSocketInterfaceHandler(m_exerciseManager.get())); if (!m_webSocketInterfaceHandler->init()) { - ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed."; + ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/training_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/training_area.cpp index f47aa5390..c37921ff4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/training_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/CombatNetRadio/training_area.cpp @@ -72,7 +72,7 @@ void TrainingArea::getRadioStations(InfrastructureManagement::Interface::Dtc *is data.id = stationId(mse); if (data.id == 0) { - WARNING_LOG() << "Got MainStructureElement of type 'RadioStation' but property 'stationId' was not set" + WARNING_LOG(m_logger) << "Got MainStructureElement of type 'RadioStation' but property 'stationId' was not set" << " - database id: " << mse.id() << " - ignoring!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.cpp index 375d84866..ada0ee635 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.cpp @@ -14,27 +14,26 @@ namespace ComponentMonitor { -CheckmkHandler::CheckmkHandler() - : QObject() - , m_socket(new QTcpSocket(this)) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; +CheckmkHandler::CheckmkHandler() : QObject() + , m_socket(new QTcpSocket(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } CheckmkHandler::~CheckmkHandler() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; if (m_timer) m_timer->stop(); delete m_socket; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool CheckmkHandler::initialize(const QString &checkMkServerHostname, int checkMkServerPort, int checkIntervalSec) { - DEBUG_LOG() << Q_FUNC_INFO << " START" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START" << " , hostname=" << checkMkServerHostname << " , port=" << checkMkServerPort << " , m_checkIntervalSec=" << checkIntervalSec; @@ -58,22 +57,22 @@ bool CheckmkHandler::initialize(const QString &checkMkServerHostname, int checkM this, &CheckmkHandler::onConnected); connect(m_socket, &QTcpSocket::readyRead, this, &CheckmkHandler::readData); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void CheckmkHandler::run() { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; m_timer->start(); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; } void CheckmkHandler::stop() { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; m_timer->stop(); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; } void CheckmkHandler::onTimeout() @@ -86,7 +85,7 @@ void CheckmkHandler::onTimeout() m_timer->setInterval(m_checkIntervalSec*1000); } - INFO_LOG() << Q_FUNC_INFO << " Timeout, m_highFrequencyCheck=" << m_highFrequencyCheck + INFO_LOG(m_logger) << Q_FUNC_INFO << " Timeout, m_highFrequencyCheck=" << m_highFrequencyCheck << ", current Interval=" << m_timer->interval() << " [msec]"; if (m_socket->state() == QAbstractSocket::SocketState::ConnectedState) @@ -99,37 +98,37 @@ void CheckmkHandler::onTimeout() bool CheckmkHandler::doConnect() { - INFO_LOG() << Q_FUNC_INFO << " START, (int)m_socket->state()=" << (int)m_socket->state(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, (int)m_socket->state()=" << (int)m_socket->state(); m_socket->connectToHost(m_checkMkHost, m_checkMkPort); if (!m_socket->waitForConnected(5000)) { - ERROR_LOG() << Q_FUNC_INFO << " Could not (re)open tcp destination " << m_checkMkHost << ":" << m_checkMkPort << ", error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Could not (re)open tcp destination " << m_checkMkHost << ":" << m_checkMkPort << ", error: " << m_socket->errorString(); return false; } - INFO_LOG() << Q_FUNC_INFO << " (Re)openend tcp destination " << m_checkMkHost << ":" << m_checkMkPort; + INFO_LOG(m_logger) << Q_FUNC_INFO << " (Re)openend tcp destination " << m_checkMkHost << ":" << m_checkMkPort; - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void CheckmkHandler::onImmediateGetStateRequested() { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; m_highFrequencyCheck = 3; onTimeout(); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool CheckmkHandler::writeGetStateRequest() { if (!m_socket->isOpen()) { - ERROR_LOG() << Q_FUNC_INFO << " socket not open"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " socket not open"; return false; } @@ -160,16 +159,16 @@ bool CheckmkHandler::writeGetStateRequest() const char* cmdCheck = "GET hosts\nResponseHeader: fixed16\nColumns: name state last_check \nKeepAlive: on\n\n"; int bWritten = m_socket->write(cmdCheck); - INFO_LOG() << Q_FUNC_INFO << " cmdCheck= '" << cmdCheck << "'"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " cmdCheck= '" << cmdCheck << "'"; - INFO_LOG() << Q_FUNC_INFO << " bWritten= " << bWritten; + INFO_LOG(m_logger) << Q_FUNC_INFO << " bWritten= " << bWritten; return true; } void CheckmkHandler::readData() { - DEBUG_LOG() << Q_FUNC_INFO << " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; while (m_socket->canReadLine()) processLine(m_socket->readLine().trimmed()); @@ -204,10 +203,10 @@ bool CheckmkHandler::processLine(const QByteArray &line) if (sl.size() < 2) { if (str.startsWith(QStringLiteral("200"))) - DEBUG_LOG() << Q_FUNC_INFO << " size to small " << sl.size() + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " size to small " << sl.size() << ", line='" << str << "'"; else - WARNING_LOG() << Q_FUNC_INFO << " size to small " << sl.size() + WARNING_LOG(m_logger) << Q_FUNC_INFO << " size to small " << sl.size() << ", line='" << str << "'"; return false; } @@ -238,7 +237,7 @@ bool CheckmkHandler::processLine(const QByteArray &line) lastCheck = lastCheckStr.toLongLong(); } - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " name: '" << name << "'" << ", stateInt: '" << stateInt << "'" << ", reachable: '" << reachable << "'" diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.h index ba7eefd09..4130e6c4e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler.h @@ -56,6 +56,7 @@ private Q_SLOTS: protected: + NGL::INGLLogger &m_logger; bool processLine(const QByteArray &line); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.cpp index d30501ad6..3d26b5e6b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.cpp @@ -17,17 +17,17 @@ CheckmkHandlerScheduleCheck::CheckmkHandlerScheduleCheck(const std::shared_ptrstop(); delete m_socket; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool CheckmkHandlerScheduleCheck::initialize(const QString &checkMkServerHostname, int checkMkServerPort) @@ -36,7 +36,7 @@ bool CheckmkHandlerScheduleCheck::initialize(const QString &checkMkServerHostnam << " , hostname=" << checkMkServerHostname << " , port=" << checkMkServerPort; - DEBUG_LOG() << Q_FUNC_INFO << " ddsHandler referenced"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ddsHandler referenced"; m_checkMkHost = checkMkServerHostname; m_checkMkPort = checkMkServerPort; @@ -55,22 +55,22 @@ bool CheckmkHandlerScheduleCheck::initialize(const QString &checkMkServerHostnam connect(m_socket, &QTcpSocket::connected, this, &CheckmkHandlerScheduleCheck::onConnected); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void CheckmkHandlerScheduleCheck::run(int timoutMsec) { - INFO_LOG() << Q_FUNC_INFO << " START, timoutMsec=" << timoutMsec; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, timoutMsec=" << timoutMsec; m_timer->start(timoutMsec); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; } void CheckmkHandlerScheduleCheck::stop() { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; m_timer->stop(); - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; } void CheckmkHandlerScheduleCheck::onTimeout() @@ -85,7 +85,7 @@ void CheckmkHandlerScheduleCheck::onTimeout() bool CheckmkHandlerScheduleCheck::doConnect() { - INFO_LOG() << Q_FUNC_INFO << " START, (int)m_socket->state()=" << (int)m_socket->state(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, (int)m_socket->state()=" << (int)m_socket->state(); @@ -93,30 +93,30 @@ bool CheckmkHandlerScheduleCheck::doConnect() m_socket->connectToHost(m_checkMkHost, m_checkMkPort); if (!m_socket->waitForConnected(5000)) { - ERROR_LOG() << Q_FUNC_INFO << " Could not (re)open tcp destination " << m_checkMkHost << ":" << m_checkMkPort << ", error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Could not (re)open tcp destination " << m_checkMkHost << ":" << m_checkMkPort << ", error: " << m_socket->errorString(); return false; } - INFO_LOG() << Q_FUNC_INFO << " (Re)openend tcp destination " << m_checkMkHost << ":" << m_checkMkPort; + INFO_LOG(m_logger) << Q_FUNC_INFO << " (Re)openend tcp destination " << m_checkMkHost << ":" << m_checkMkPort; - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } void CheckmkHandlerScheduleCheck::addScheduleCheckHostnames(const QStringList &hostnames) { - INFO_LOG() << Q_FUNC_INFO << " hostnames: " << hostnames.join(QStringLiteral(";")); + INFO_LOG(m_logger) << Q_FUNC_INFO << " hostnames: " << hostnames.join(QStringLiteral(";")); m_scheduleCheckHostnames += hostnames; } bool CheckmkHandlerScheduleCheck::writeScheduleUpdateRequest() { - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " state " << (int)m_socket->state() << ", isOpen " << m_socket->isOpen(); if (!m_socket->isOpen() || (m_socket->state() != QAbstractSocket::SocketState::ConnectedState)) { - ERROR_LOG() << Q_FUNC_INFO << " socket not open or connected " + ERROR_LOG(m_logger) << Q_FUNC_INFO << " socket not open or connected " << " host/port: " << m_checkMkHost << ":" << m_checkMkPort; return false; } @@ -137,13 +137,13 @@ bool CheckmkHandlerScheduleCheck::writeScheduleUpdateRequest() qint64 now = QDateTime::currentSecsSinceEpoch(); const QString cmd = QString(QStringLiteral("COMMAND [%1] SCHEDULE_FORCED_HOST_CHECK;%2;%3")).arg(now).arg(hostname.toUpper()).arg(now); - DEBUG_LOG() << Q_FUNC_INFO << " cmd= '" << cmd << "'"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " cmd= '" << cmd << "'"; int bWritten = m_socket->write(cmd.toUtf8()) + m_socket->write("\n\n"); - DEBUG_LOG() << Q_FUNC_INFO << " bWritten= " << bWritten; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " bWritten= " << bWritten; bWrittenAll += bWritten; } - INFO_LOG() << Q_FUNC_INFO << " bWrittenAll= " << bWrittenAll; + INFO_LOG(m_logger) << Q_FUNC_INFO << " bWrittenAll= " << bWrittenAll; m_scheduleCheckHostnames.clear(); @@ -165,7 +165,7 @@ void CheckmkHandlerScheduleCheck::onConnected() void CheckmkHandlerScheduleCheck::onStateChanged(const QAbstractSocket::SocketState &newState) { - DEBUG_LOG() << Q_FUNC_INFO << " SocketState changed to: " << newState; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " SocketState changed to: " << newState; qInfo() << " CheckmkHandlerScheduleCheck: SocketState changed to: " << newState; } @@ -177,8 +177,8 @@ void CheckmkHandlerScheduleCheck::onSocketError(const QAbstractSocket::SocketErr void CheckmkHandlerScheduleCheck::onTriggerUpdateRequest(const rti::core::SampleIdentity &cookie, const TriggerUpdate &request) { - INFO_LOG() << Q_FUNC_INFO << " request=" << request; - DEBUG_LOG() << Q_FUNC_INFO << " m_socket->state=" << (int)m_socket->state(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " request=" << request; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_socket->state=" << (int)m_socket->state(); @@ -230,7 +230,7 @@ void CheckmkHandlerScheduleCheck::onTriggerUpdateRequest(const rti::core::Sample } } else { - WARNING_LOG() << Q_FUNC_INFO << " socket not connected" + WARNING_LOG(m_logger) << Q_FUNC_INFO << " socket not connected" << ", (int)m_socket->state()=" << (int)m_socket->state() << ", destination " << m_checkMkHost << ":" << m_checkMkPort << ", -> queued cmd/request: " << request; @@ -238,13 +238,13 @@ void CheckmkHandlerScheduleCheck::onTriggerUpdateRequest(const rti::core::Sample } - INFO_LOG() << Q_FUNC_INFO << " m_ddsHandler = " << m_ddsHandler; - INFO_LOG() << Q_FUNC_INFO << " m_ddsHandler->fts() = " << m_ddsHandler->fts(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " m_ddsHandler = " << m_ddsHandler; + INFO_LOG(m_logger) << Q_FUNC_INFO << " m_ddsHandler->fts() = " << m_ddsHandler->fts(); if (m_ddsHandler && m_ddsHandler->fts()) m_ddsHandler->fts()->triggerUpdateReply(cookie, ret); else - ERROR_LOG() << Q_FUNC_INFO << " no m_ddsHandler or m_ddsHandler->fts()"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " no m_ddsHandler or m_ddsHandler->fts()"; if (!connected) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.h index c472141bc..b7a94c88e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/checkmk_handler_schedule_check.h @@ -60,6 +60,7 @@ private: protected: + NGL::INGLLogger &m_logger; bool processLine(const QByteArray &line); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.cpp index 9f2c75268..10da69fcf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.cpp @@ -12,35 +12,34 @@ namespace ComponentMonitor { -ComponentStatusHandler::ComponentStatusHandler() - : QObject() -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; +ComponentStatusHandler::ComponentStatusHandler() : QObject(), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } ComponentStatusHandler::~ComponentStatusHandler() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ddsHandler = nullptr; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool ComponentStatusHandler::initialize(const std::shared_ptr &ddsHandler) { - INFO_LOG() << Q_FUNC_INFO << " START initialize ComponentStatusHandler"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START initialize ComponentStatusHandler"; m_ddsHandler = ddsHandler; - DEBUG_LOG() << Q_FUNC_INFO << " ddsHandler referenced"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ddsHandler referenced"; m_ismDtc = m_ddsHandler->ismDtc(); if (!m_ismDtc) { - ERROR_LOG() << Q_FUNC_INFO << " Failure: no ismDtc"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Failure: no ismDtc"; return false; } @@ -48,7 +47,7 @@ bool ComponentStatusHandler::initialize(const std::shared_ptr &ddsHa m_ismDtc->enableInstrumentationAsset(); m_ismDtc->waitForHistoricalDataInstrumentationAsset(2000); - DEBUG_LOG() << Q_FUNC_INFO << " instrumentationAssets-size = " << m_ismDtc->instrumentationAssets().size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " instrumentationAssets-size = " << m_ismDtc->instrumentationAssets().size(); @@ -65,8 +64,8 @@ bool ComponentStatusHandler::initialize(const std::shared_ptr &ddsHa QTimer::singleShot(35000, this, &ComponentStatusHandler::dump); - DEBUG_LOG() << Q_FUNC_INFO << "initialize succesful, statusMapSize=" << statusMapSize(); - INFO_LOG() << Q_FUNC_INFO << " END initialize ComponentStatusHandler, statusMapSize=" << statusMapSize(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "initialize succesful, statusMapSize=" << statusMapSize(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " END initialize ComponentStatusHandler, statusMapSize=" << statusMapSize(); return true; } @@ -95,7 +94,7 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM static int assetChangedCounter = 0; const int iAssetId = iAsset.id(); - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", iAssetId=" << iAssetId << " (assetChangedCounter=" << ++assetChangedCounter << ")"; @@ -139,62 +138,62 @@ void ComponentStatusHandler::onInstrumentationAssetChanged(const InfrastructureM void ComponentStatusHandler::dump() { - DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << Q_FUNC_INFO << " DUMP START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " DUMP START"; int counter = 0; counter = 0; - DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << " REACHABLE:"; + DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << " REACHABLE:"; for (const ComponentStatus &status : std::as_const(m_statusMap)) { if (status.state().underlying() == ComponentState_def::Reachable) { - DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable"; + DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Reachable"; ++counter; } } - DEBUG_LOG() << " REACHABLE hostCounter = " << counter; + DEBUG_LOG(m_logger) << " REACHABLE hostCounter = " << counter; counter = 0; - DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << " UNREACHABLE:"; + DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << " UNREACHABLE:"; for (const ComponentStatus &status : std::as_const(m_statusMap)) { if (status.state().underlying() == ComponentState_def::Unreachable) { - DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable"; + DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Unreachable"; ++counter; } } - DEBUG_LOG() << " UNREACHABLE hostCounter = " << counter; + DEBUG_LOG(m_logger) << " UNREACHABLE hostCounter = " << counter; counter = 0; - DEBUG_LOG() << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << " UNDEFINED:"; + DEBUG_LOG(m_logger) << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << " UNDEFINED:"; for (const ComponentStatus &status : std::as_const(m_statusMap)) { if (status.state().underlying() == ComponentState_def::Undefined) { - DEBUG_LOG() << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined"; + DEBUG_LOG(m_logger) << " id=" << status.id() << ", host '" << status.hostname().c_str() << " -> Undefined"; ++counter; } } - DEBUG_LOG() << " UNDEFINED hostCounter = " << counter; + DEBUG_LOG(m_logger) << " UNDEFINED hostCounter = " << counter; - DEBUG_LOG() << Q_FUNC_INFO << " DUMP END"; - DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; - DEBUG_LOG() << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " DUMP END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " +++++++++++++++++++++++++++++++++++++++++++++"; } void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable, long long lastCheckSec) { - DEBUG_LOG() << Q_FUNC_INFO << " hostname=" << hostname + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " hostname=" << hostname << ", reachable=" << reachable << ", lastCheckSec=" << lastCheckSec; @@ -219,7 +218,7 @@ void ComponentStatusHandler::onNewState(const QString &hostname, bool reachable, void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &hostnamesForUpdateLastCheckTime, qint64 lastCheckSec) { - DEBUG_LOG() << Q_FUNC_INFO << " START hostnamesForLastCheckTime=" << hostnamesForUpdateLastCheckTime.join(QStringLiteral(";")); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START hostnamesForLastCheckTime=" << hostnamesForUpdateLastCheckTime.join(QStringLiteral(";")); for (ITERATOR_T it = m_statusMap.begin(); it != m_statusMap.end(); ++it) { @@ -236,12 +235,12 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host if ((curState == ComponentState_def::Reachable) || (curState == ComponentState_def::Unreachable)) { - DEBUG_LOG() << Q_FUNC_INFO << " updateLastCheckTimeDirect" + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updateLastCheckTimeDirect" << " host: '" << curHostname << "'" << " newLastCheck= " << lastCheckSec; - INFO_LOG() << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it); + INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2a (*it) " << (*it); cs.last_check(lastCheckSec); - INFO_LOG() << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it); + INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF_2b (*it) " << (*it); m_ddsHandler->dts()->publish(cs); } } @@ -250,7 +249,7 @@ void ComponentStatusHandler::onUpdateLastCheckTimeDirect(const QStringList &host bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it, const ComponentStatus &cs) { - DEBUG_LOG() << Q_FUNC_INFO << " START add/Update: cs=" << cs + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START add/Update: cs=" << cs << ", curSize=" << m_statusMap.size() << ")"; const int id = cs.id(); @@ -260,8 +259,8 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle if ((*it) != cs) { - INFO_LOG() << Q_FUNC_INFO << " DIFF (*it) " << (*it); - INFO_LOG() << Q_FUNC_INFO << " DIFF cs " << cs; + INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF (*it) " << (*it); + INFO_LOG(m_logger) << Q_FUNC_INFO << " DIFF cs " << cs; (*it) = cs; m_ddsHandler->dts()->publish(cs); @@ -274,7 +273,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle m_statusMap.insert(id, cs); m_ddsHandler->dts()->publish(cs); } - DEBUG_LOG() << Q_FUNC_INFO << " END add/Update: cs=" << cs + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END add/Update: cs=" << cs << ", curSize=" << m_statusMap.size() << ")"; return true; } @@ -282,7 +281,7 @@ bool ComponentStatusHandler::addUpdateInstrumentationAsset(ComponentStatusHandle bool ComponentStatusHandler::removeInstrumentationAsset(ComponentStatusHandler::ITERATOR_T it) { const int id = it.value().id(); - DEBUG_LOG() << Q_FUNC_INFO << " remove: id=" << id; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " remove: id=" << id; m_statusMap.remove(id); m_ddsHandler->dts()->removeComponentStatusByKey(id); return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.h index 6d4750348..ed45692ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/component_status_handler.h @@ -49,6 +49,7 @@ private Q_SLOTS: void dump(); protected: + NGL::INGLLogger &m_logger; bool addUpdateInstrumentationAsset(ITERATOR_T it, const ComponentStatus &cs); bool removeInstrumentationAsset(ITERATOR_T it); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.cpp index b997c01db..22f718746 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.cpp @@ -17,7 +17,7 @@ namespace ComponentMonitor DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Global, exerciseId)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -27,7 +27,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -45,10 +45,10 @@ bool DdsHandler::init(const QStringList &qosFileList) m_ddsFts = ComponentMonitor::Interface::Fts::create(m_ddsConnector); bool bRet = m_ddsDts->enableAll(); - INFO_LOG() << "Dts initialised"; + INFO_LOG(m_logger) << "Dts initialised"; bRet &= m_ddsFts->enableAll(); - INFO_LOG() << "Fts initialised"; + INFO_LOG(m_logger) << "Fts initialised"; m_ismDtc = InfrastructureManagement::Interface::Dtc::create(m_ddsConnector); @@ -60,9 +60,9 @@ bool DdsHandler::init(const QStringList &qosFileList) void DdsHandler::enableDtcs() { - DEBUG_LOG() << Q_FUNC_INFO << " START Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); m_ismDtc->enableInstrumentationAsset(); - DEBUG_LOG() << Q_FUNC_INFO << " END Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END Enable DTCs(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); } std::shared_ptr DdsHandler::ismDtc() const diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.h index ee33ee180..89cea33db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/dds_handler.h @@ -53,6 +53,7 @@ public: std::shared_ptr ismDtc() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_dtsCurrentRunningState; std::shared_ptr m_pacemaker; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.cpp index 5c401897a..c847041a7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.cpp @@ -14,29 +14,29 @@ namespace ComponentMonitor Initialization::Initialization() : m_logger(getLogger("Initialization")) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } Initialization::~Initialization() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_checkmkHandler = nullptr; m_componentStatusHandler = nullptr; m_ddsHandler = nullptr; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool Initialization::initialize(const std::shared_ptr &ddsHandler) { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ddsHandler = ddsHandler; - DEBUG_LOG() << Q_FUNC_INFO << "ddsHandler referenced"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "ddsHandler referenced"; @@ -73,10 +73,10 @@ bool Initialization::initialize(const std::shared_ptr &ddsHandler) if (!m_checkmkHandler->initialize(host, port, intervalSec)) { - ERROR_LOG() << Q_FUNC_INFO << " CheckmkHandler::initialize failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " CheckmkHandler::initialize failed"; return false; } - INFO_LOG() << Q_FUNC_INFO << " CheckmkHandler:initialize succesful"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " CheckmkHandler:initialize succesful"; QObject::connect(m_checkmkHandler.get(), &CheckmkHandler::newState, m_componentStatusHandler.get(), &ComponentStatusHandler::onNewState, Qt::UniqueConnection); @@ -88,10 +88,10 @@ bool Initialization::initialize(const std::shared_ptr &ddsHandler) m_checkmkHandlerScheduleCheck = std::make_shared(m_ddsHandler); if (!m_checkmkHandlerScheduleCheck->initialize(host, port)) { - ERROR_LOG() << Q_FUNC_INFO << " CheckmkHandlerScheduleCheck::initialize failed"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " CheckmkHandlerScheduleCheck::initialize failed"; return false; } - INFO_LOG() << Q_FUNC_INFO << " CheckmkHandlerScheduleCheck:initialize succesful"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " CheckmkHandlerScheduleCheck:initialize succesful"; #ifdef LTS_DEBUG @@ -110,21 +110,21 @@ bool Initialization::initialize(const std::shared_ptr &ddsHandler) #endif - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } bool Initialization::delayedInit() { - INFO_LOG() << Q_FUNC_INFO << " START"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START"; bool success = true; if (!m_componentStatusHandler->initialize(m_ddsHandler)) { - ERROR_LOG() << Q_FUNC_INFO << " initialize failed for ComponentStatusHandler"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " initialize failed for ComponentStatusHandler"; success = false; } - INFO_LOG() << Q_FUNC_INFO << " ComponentStatusHandler, statusMapSize=" << m_componentStatusHandler->getHostnames().size(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " ComponentStatusHandler, statusMapSize=" << m_componentStatusHandler->getHostnames().size(); m_checkmkHandler->run(); @@ -144,7 +144,7 @@ bool Initialization::delayedInit() - INFO_LOG() << Q_FUNC_INFO << " END"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END"; return success; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.h index 6f7c7ca32..9c813e6e8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/initialization.h @@ -38,6 +38,7 @@ public: protected: + NGL::INGLLogger &m_logger; private: std::shared_ptr m_ddsHandler; std::shared_ptr m_componentStatusHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.cpp index 6230637aa..bde0efe57 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.cpp @@ -11,19 +11,18 @@ namespace ComponentMonitor { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; +MainHandler::MainHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } MainHandler::~MainHandler() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_cmoService = nullptr; m_ddsHandler = nullptr; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool MainHandler::init(int domainId) @@ -33,11 +32,11 @@ bool MainHandler::init(int domainId) m_ddsHandler = std::make_shared(domainId, excerciseId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation ddsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation ddsHandler failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } - DEBUG_LOG() << "Initialisation ddsHandler succesful."; + DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful."; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.h index 171edd5bf..97d425fd5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/ComponentMonitor/main_handler.h @@ -25,6 +25,7 @@ public: std::shared_ptr dds() const { return m_ddsHandler; } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_cmoService; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.cpp index f7843b674..93e5d0149 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.cpp @@ -10,18 +10,18 @@ namespace DifferentialGPS DdsHandler::DdsHandler(int domainId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Global)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { - INFO_LOG() << "--- Start DifferentialGPS DDSHandler."; + INFO_LOG(m_logger) << "--- Start DifferentialGPS DDSHandler."; if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.h index a6f8824d0..ea6af8335 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/dds_handler.h @@ -30,6 +30,7 @@ public: } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.cpp index e5fb1c767..1837d7df0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.cpp @@ -59,7 +59,7 @@ bool MainThread::init(int domainId) m_ddsHandler.reset(new DdsHandler(domainId)); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation DdsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DdsHandler failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.h index 6c1cdbae5..050c27846 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/mainthread.h @@ -30,6 +30,7 @@ public: Q_SIGNALS: void newDataAvailable(); protected: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; QByteArray m_dgpsData; QTimer *m_dgpsTimer; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.cpp index f172e7b65..67c1ebb9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.cpp @@ -33,7 +33,7 @@ void TcpSocket::startThreadInternal(const QString &hostName, quint16 port) void TcpSocket::run() { - DEBUG_LOG() << "Starting thread"; + DEBUG_LOG(m_logger) << "Starting thread"; m_reconnectTimer = new QTimer(this); doConnect(); exec(); @@ -54,14 +54,14 @@ void TcpSocket::doConnect() connect(m_socket, &QTcpSocket::readyRead, this, &TcpSocket::onReadyRead); - INFO_LOG() << "Connecting to tcp server at " + INFO_LOG(m_logger) << "Connecting to tcp server at " << m_hostName << ":" << m_hostPort; m_socket->connectToHost(m_hostName, m_hostPort); } void TcpSocket::onConnected() { - INFO_LOG() << "Connected to " + INFO_LOG(m_logger) << "Connected to " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); m_waitTime = 1; @@ -69,13 +69,13 @@ void TcpSocket::onConnected() void TcpSocket::onDisconnected() { - INFO_LOG() << "Disconnected from " << m_socket->peerAddress().toString() + INFO_LOG(m_logger) << "Disconnected from " << m_socket->peerAddress().toString() << ":" << m_socket->peerPort(); } void TcpSocket::onError(QAbstractSocket::SocketError err) { - ERROR_LOG() << "Socket error: " << err + ERROR_LOG(m_logger) << "Socket error: " << err << " " << m_socket->errorString() << ":" << m_socket->peerPort() << " - trying to reconnect in " << m_waitTime << " seconds"; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.h index c8804e18f..4bc59689b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/DifferentialGPS/tcpsocket.h @@ -19,6 +19,7 @@ public: ~TcpSocket(); protected: + NGL::INGLLogger &m_logger; void startThreadInternal(const QString &hostName, quint16 port); void run() override; @@ -33,6 +34,7 @@ protected Q_SLOTS: virtual void onError(QAbstractSocket::SocketError); virtual void onReadyRead() = 0; protected: + NGL::INGLLogger &m_logger; QString m_hostName; quint16 m_hostPort; QTcpSocket *m_socket; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.cpp index 17e4528d6..4cce81f48 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.cpp @@ -17,11 +17,10 @@ namespace FeedGeoJson { -FeedGeoJson::FeedGeoJson(QObject *parent) - : QObject(parent) +FeedGeoJson::FeedGeoJson(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) - , m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) -{} + , m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} FeedGeoJson::~FeedGeoJson() {} @@ -30,7 +29,7 @@ bool FeedGeoJson::init(const int domainId, const int exerciseId, WebSocketServe { m_websocketServer = &webSocketServer; bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_ddsConnector42 = std::make_shared(domainId, IDL::PartitionType::Exercise, exerciseId); m_ddsConnector42->init(); @@ -104,15 +103,15 @@ return message; void FeedGeoJson::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType) { NOTICE_LOG(m_logger) << "onParticipantPositionChanged: " << data; - DEBUG_LOG() << "onParticipantPositionChanged: " << data; + DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data; if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.participantId(); + DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.participantId(); } else { - DEBUG_LOG() << "Handle ParticipantPosition"; + DEBUG_LOG(m_logger) << "Handle ParticipantPosition"; QString posGeoJson = getGeoJsonPosition(data); m_websocketServer->sendMessage(posGeoJson); } @@ -120,7 +119,7 @@ void FeedGeoJson::onParticipantPositionChanged(const ParticipantManagement::Part void FeedGeoJson::onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "onDynamicParticipantDataChanged"; + DEBUG_LOG(m_logger) << "onDynamicParticipantDataChanged"; if (modType == DataModification::eRemoved) return; @@ -129,14 +128,14 @@ void FeedGeoJson::onDynamicParticipantDataChanged(const ParticipantManagement::D void FeedGeoJson::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void FeedGeoJson::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.h index 656ccb9bc..30d88d258 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/FeedGeoJson/feedGeoJson.h @@ -46,6 +46,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: QString getGeoJsonPosition(const ParticipantManagement::ParticipantPosition &data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.cpp index 8c6567d47..d1b8e03b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.cpp @@ -41,16 +41,16 @@ void AbstractSocketHandler::textMessageReceived(const QByteArray &msg) { if (msg.isEmpty()) { - ERROR_LOG() << "Empty message received"; + ERROR_LOG(m_logger) << "Empty message received"; return; } const QJsonObject obj = QJsonDocument::fromJson(msg).object(); - DEBUG_LOG() << "incoming telegram: " << msg; + DEBUG_LOG(m_logger) << "incoming telegram: " << msg; const QJsonValue type = obj.value(QStringLiteral("type")); if (!type.isString()) { - ERROR_LOG() << "Can not read type id: " << msg; + ERROR_LOG(m_logger) << "Can not read type id: " << msg; return; } const QString typeStr = type.toString(); @@ -66,11 +66,11 @@ void AbstractSocketHandler::textMessageReceived(const QByteArray &msg) else if (typeStr.compare(Constraints::type(), Qt::CaseInsensitive) == 0) emit simulationStatusReceived(NasatSimulationStatus::fromJson(data)); else - ERROR_LOG() << "Got unknown json telegram: " << msg; + ERROR_LOG(m_logger) << "Got unknown json telegram: " << msg; } catch (const JsonException &ex) { - ERROR_LOG() << "Could not parse json telegram: " << msg + ERROR_LOG(m_logger) << "Could not parse json telegram: " << msg << ", error: " << ex.what(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.h index 083e66960..a0b7ec53f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/abstract_socket_handler.h @@ -30,11 +30,13 @@ Q_SIGNALS: void simulationStatusReceived(const NasatSimulationStatus &data); protected: + NGL::INGLLogger &m_logger; void textMessageReceived(const QByteArray &msg); bool sendTelegram(const NasatBase *tele); virtual bool sendTelegramInternal(const QByteArray &tele) = 0; protected: + NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.cpp index ae5b14fff..bdec746eb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.cpp @@ -26,22 +26,22 @@ Participant2Dds::Participant2Dds(const dds::domain::DomainParticipant &domainPar - DEBUG_LOG() << Q_FUNC_INFO << " create FTC..." << " exerciseId=" << exerciseId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " create FTC..." << " exerciseId=" << exerciseId; m_aesFtc = AreaEffectSimulation::Interface::Ftc::create(m_ddsConnector); if (!m_aesFtc->enableAirSupportImpactModify()) { - ERROR_LOG() << "Could not enable AES AirSupportImpactModify FTC for" + ERROR_LOG(m_logger) << "Could not enable AES AirSupportImpactModify FTC for" << " exerciseId=" << exerciseId; m_aesFtc = nullptr; } if (!m_aesFtc->enableExplosionClusterModify()) { - ERROR_LOG() << "Could not enable AES enableExplosionClusterModify FTC for" + ERROR_LOG(m_logger) << "Could not enable AES enableExplosionClusterModify FTC for" << " exerciseId=" << exerciseId; m_aesFtc = nullptr; } - DEBUG_LOG() << Q_FUNC_INFO << " create FTC..." << " exerciseId=" << exerciseId << " Done: " << m_aesFtc.get(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " create FTC..." << " exerciseId=" << exerciseId << " Done: " << m_aesFtc.get(); } bool Participant2Dds::publish(const TrainingAreaBase::EquipmentPosition &pos) @@ -51,7 +51,7 @@ bool Participant2Dds::publish(const TrainingAreaBase::EquipmentPosition &pos) m_tabDts = TrainingAreaBase::Interface::Dts::create(m_ddsConnector); if (!m_tabDts->enableEquipmentPosition()) { - ERROR_LOG() << "Could not enable TAB equipment position DTS for " + ERROR_LOG(m_logger) << "Could not enable TAB equipment position DTS for " << m_ddsConnector->getDefaultPartition(); m_tabDts = nullptr; return false; @@ -80,7 +80,7 @@ bool Participant2Dds::publish(const GuezNasat::Nasat9Liner &nl) m_gnaDts = GuezNasat::Interface::Dts::create(m_ddsConnector); if (!m_gnaDts->enableNasat9Liner()) { - ERROR_LOG() << "Could not enable GNA Nasat9Liner DTS for " + ERROR_LOG(m_logger) << "Could not enable GNA Nasat9Liner DTS for " << m_ddsConnector->getDefaultPartition(); m_gnaDts = nullptr; return false; @@ -92,13 +92,13 @@ bool Participant2Dds::publish(const GuezNasat::Nasat9Liner &nl) void Participant2Dds::addParticipantToWatch(int participantId) { - DEBUG_LOG() << "addParticipantToWatch: " << participantId; + DEBUG_LOG(m_logger) << "addParticipantToWatch: " << participantId; m_participantsToWatch += participantId; } void Participant2Dds::removeParticipantToWatch(int participantId) { - DEBUG_LOG() << "removeParticipantToWatch: " << participantId; + DEBUG_LOG(m_logger) << "removeParticipantToWatch: " << participantId; m_participantsToWatch -= participantId; } @@ -120,7 +120,7 @@ void Participant2Dds::onParticipantChanged(const ParticipantManagement::Particip { if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "onParticipantChanged: " << data.id() + DEBUG_LOG(m_logger) << "onParticipantChanged: " << data.id() << ", " << m_participantsToWatch.contains(data.id()) << ", " << m_participantsToWatch.size() << ", " << m_participantsToWatch.contains(data.id()) @@ -138,16 +138,16 @@ void Participant2Dds::onParticipantChanged(const ParticipantManagement::Particip DdsHandler::DdsHandler(const std::shared_ptr &ddsConnector) : m_ddsConnector(std::make_shared(ddsConnector->getDomainParticipant(), IDL::PartitionType::AllExercises)) { - DEBUG_LOG() << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { - INFO_LOG() << "--- Start GuezNasat DDSHandler."; + INFO_LOG(m_logger) << "--- Start GuezNasat DDSHandler."; if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -158,22 +158,22 @@ bool DdsHandler::init(const QStringList &qosFileList) m_ddsDts = GuezNasat::Interface::Dts::create(m_ddsConnector); bool bRet = m_ddsDts->enableNasatAircraft() && m_ddsDts->enableNasatAircraftParticipant(); - INFO_LOG() << "Dts initialised: " << bRet; + INFO_LOG(m_logger) << "Dts initialised: " << bRet; m_ddsFts = GuezNasat::Interface::Fts::create(m_ddsConnector); bRet &= m_ddsFts->enableAll(); - INFO_LOG() << "Fts initialised: " << bRet; + INFO_LOG(m_logger) << "Fts initialised: " << bRet; m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_exmDtc->enableExercise(); - INFO_LOG() << "EXM Dtc initialised: " << bRet; + INFO_LOG(m_logger) << "EXM Dtc initialised: " << bRet; m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_pdmDtc->enableChargeType(); - INFO_LOG() << "PDM Dtc initialised: " << bRet; + INFO_LOG(m_logger) << "PDM Dtc initialised: " << bRet; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.h index 012767fba..ecab7f0a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/dds_handler.h @@ -38,6 +38,7 @@ public: Q_SIGNALS: void participantRemoved(int exerciseId, int participantId); private: +NGL::INGLLogger &m_logger; void onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType); private: std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.cpp index 55bd70ae1..27ba08e8b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.cpp @@ -84,16 +84,16 @@ void HandlerNasatAircraft::flaFluSimulationChanged(int nasatId, bool bSimulation m_dts->publish(na); return; } - WARNING_LOG() << "Got a flaFluSimulationChanged information but aircraft with id " << nasatId << " is not available"; + WARNING_LOG(m_logger) << "Got a flaFluSimulationChanged information but aircraft with id " << nasatId << " is not available"; } void HandlerNasatAircraft::onModifyNasatAircraftRequest(const rti::core::SampleIdentity &cookie, const NasatAircraft &request) { - DEBUG_LOG() << "onModifyNasatAircraftRequest: " << request; + DEBUG_LOG(m_logger) << "onModifyNasatAircraftRequest: " << request; auto ret = request.id() > 0 ? modifyNasatAircraftRequest(request) : createNasatAircraftRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyNasatAircraftReply(cookie, ret); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.h index 643f7c58e..05db4d45d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft.h @@ -34,6 +34,7 @@ Q_SIGNALS: void activateNasatAircraftSimulation(int nasatId, bool bActivateSimulation); void nasatIdChanged(int oldNasatId, int newNasatId); protected: + NGL::INGLLogger &m_logger; void onModifyNasatAircraftRequest(const rti::core::SampleIdentity &cookie, const NasatAircraft &request) override; Core::FunctionReplyObject createNasatAircraftRequest(const NasatAircraft &request); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.cpp index e2a052cfe..e8b34c88d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.cpp @@ -40,26 +40,26 @@ HandlerNasatAircraftParticipant::HandlerNasatAircraftParticipant(Initialization , m_fts(mainHandler->dds()->fts()) , m_db(mainHandler->db()) { - DEBUG_LOG() << Q_FUNC_INFO << " START"; - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } HandlerNasatAircraftParticipant::~HandlerNasatAircraftParticipant() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; for (const auto &data : std::as_const(m_nasatAircraftParticipants)) m_dts->removeNasatAircraftByKey(data.id()); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool HandlerNasatAircraftParticipant::init() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; auto cb = [this](const Database::NasatAircraftParticipant & data) { const auto dds(fromDb(data)); - DEBUG_LOG() << "m_nasatAircraftParticipants.insert(" << dds.id() << ")"; + DEBUG_LOG(m_logger) << "m_nasatAircraftParticipants.insert(" << dds.id() << ")"; m_nasatAircraftParticipants.insert(dds.id(), dds); m_dts->publish(dds); m_mainHandler->handlerParticipant()->onNasatAircraftParticipantCreated(dds); @@ -85,16 +85,16 @@ bool HandlerNasatAircraftParticipant::init() dumpExercises(); }); - DEBUG_LOG() << "HandlerNasatAircraftParticipant init done"; + DEBUG_LOG(m_logger) << "HandlerNasatAircraftParticipant init done"; - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; return true; } void HandlerNasatAircraftParticipant::dumpNasatAircraftParticipants() { - DEBUG_LOG() << Q_FUNC_INFO << " START, size=" << m_nasatAircraftParticipants.size(); - DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, size=" << m_nasatAircraftParticipants.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------"; auto it = m_nasatAircraftParticipants.begin(); while (it != m_nasatAircraftParticipants.end()) @@ -102,17 +102,17 @@ void HandlerNasatAircraftParticipant::dumpNasatAircraftParticipants() const auto &id = it.key(); const auto &nap = it.value(); - DEBUG_LOG() << Q_FUNC_INFO << " id=" << id << " - nap=" << nap; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id=" << id << " - nap=" << nap; ++it; } - DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------"; - DEBUG_LOG() << Q_FUNC_INFO << " END, size=" << m_nasatAircraftParticipants.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, size=" << m_nasatAircraftParticipants.size(); } void HandlerNasatAircraftParticipant::dumpExercises() { - DEBUG_LOG() << Q_FUNC_INFO << " START, size=" << m_exercises.size(); - DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, size=" << m_exercises.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------"; auto it = m_exercises.begin(); while (it != m_exercises.end()) @@ -120,11 +120,11 @@ void HandlerNasatAircraftParticipant::dumpExercises() const auto &id = it.key(); const auto &nasatAircraftParticipant = it.value(); - DEBUG_LOG() << Q_FUNC_INFO << " id=" << id << " - nasatAircraftParticipant=" << nasatAircraftParticipant; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " id=" << id << " - nasatAircraftParticipant=" << nasatAircraftParticipant; ++it; } - DEBUG_LOG() << Q_FUNC_INFO << " --------------------------------------"; - DEBUG_LOG() << Q_FUNC_INFO << " END, size=" << m_exercises.size(); + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " --------------------------------------"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, size=" << m_exercises.size(); } void HandlerNasatAircraftParticipant::aircraftRemoved(int nasatAircraftId) @@ -145,7 +145,7 @@ void HandlerNasatAircraftParticipant::aircraftRemoved(int nasatAircraftId) void HandlerNasatAircraftParticipant::participantRemoved(int exerciseId, int participantId) { - DEBUG_LOG() << "participantRemoved: " << exerciseId << ", " << participantId; + DEBUG_LOG(m_logger) << "participantRemoved: " << exerciseId << ", " << participantId; auto it = m_nasatAircraftParticipants.begin(); while (it != m_nasatAircraftParticipants.end()) { @@ -179,7 +179,7 @@ bool isExerciseStateValid(ExerciseManagement::ExerciseState_def::type state) void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement::Exercise &exercise, DataModification modType) { - INFO_LOG() << Q_FUNC_INFO << " START" << " , exercise" << exercise << " , modType" << modType; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START" << " , exercise" << exercise << " , modType" << modType; const int exId = exercise.id(); switch (modType) @@ -190,10 +190,10 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement const bool valid = isExerciseStateValid(exercise.state().underlying()); if (!valid) { - INFO_LOG() << Q_FUNC_INFO << " STATE of exId=" << exId + INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId << " , state=" << exercise.state(); int cnt = removeNapsOfExercise(exId); - INFO_LOG() << Q_FUNC_INFO << " STATE of exId=" << exId << " not valid : counter of removed naps=" << cnt; + INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE of exId=" << exId << " not valid : counter of removed naps=" << cnt; } } break; @@ -205,11 +205,11 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement const bool valid = isExerciseStateValid(exercise.state().underlying()); if (!valid) { - INFO_LOG() << Q_FUNC_INFO << " STATE change of exId=" << exId + INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId << " , old state=" << exerciseRef.state() << " , new state=" << exercise.state(); int cnt = removeNapsOfExercise(exId); - INFO_LOG() << Q_FUNC_INFO << " STATE change of exId=" << exId << " : counter of removed naps=" << cnt; + INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of exId=" << exId << " : counter of removed naps=" << cnt; } } m_exercises[exId] = exercise; @@ -218,13 +218,13 @@ void HandlerNasatAircraftParticipant::onExerciseChanged(const ExerciseManagement case DataModification::eRemoved: { int cnt = removeNapsOfExercise(exId); - INFO_LOG() << Q_FUNC_INFO << " STATE change of Exercise, counter of removed naps=" << cnt; + INFO_LOG(m_logger) << Q_FUNC_INFO << " STATE change of Exercise, counter of removed naps=" << cnt; m_exercises.remove(exId); } break; } - INFO_LOG() << Q_FUNC_INFO << " END" << " , exercise" << exercise << " , modType" << modType; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << " , exercise" << exercise << " , modType" << modType; } void HandlerNasatAircraftParticipant::removeNasatAircraftParticipant(const NasatAircraftParticipant &val) @@ -238,10 +238,10 @@ void HandlerNasatAircraftParticipant::removeNasatAircraftParticipant(const Nasat void HandlerNasatAircraftParticipant::onModifyNasatAircraftParticipantRequest(const rti::core::SampleIdentity &cookie, const NasatAircraftParticipant &request) { - DEBUG_LOG() << "onModifyNasatAircraftParticipantRequest: " << request; + DEBUG_LOG(m_logger) << "onModifyNasatAircraftParticipantRequest: " << request; auto ret = request.id() <= 0 ? createNasatAircraftParticipantRequest(request) : modifyNasatAircraftParticipantRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyNasatAircraftParticipantReply(cookie, ret); } @@ -299,7 +299,7 @@ Core::FunctionReplyObject HandlerNasatAircraftParticipant::modifyNasatAircraftPa int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId) { - DEBUG_LOG() << Q_FUNC_INFO << " START, exerciseId=" << exerciseId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, exerciseId=" << exerciseId << ", m_nasatAircraftParticipants.size()" << m_nasatAircraftParticipants.size(); int count = 0; QHash napsCopy = m_nasatAircraftParticipants; @@ -308,7 +308,7 @@ int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId) { if (nap.exerciseId() == exerciseId) { - DEBUG_LOG() << Q_FUNC_INFO << " nap has to be removed: nap=" << nap; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " nap has to be removed: nap=" << nap; NasatAircraftParticipant napToTriggerRemoving; napToTriggerRemoving.id(nap.id()); @@ -319,7 +319,7 @@ int HandlerNasatAircraftParticipant::removeNapsOfExercise(int exerciseId) ++count; } } - DEBUG_LOG() << Q_FUNC_INFO << " END, exerciseId=" << exerciseId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END, exerciseId=" << exerciseId << ", m_nasatAircraftParticipants.size()" << m_nasatAircraftParticipants.size() << ", counter=" << count; return count; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.h index a6ae66200..376505233 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_aircraft_participant.h @@ -38,6 +38,7 @@ public Q_SLOTS: void dumpExercises(); protected: + NGL::INGLLogger &m_logger; void removeNasatAircraftParticipant(const NasatAircraftParticipant &val); void onModifyNasatAircraftParticipantRequest(const rti::core::SampleIdentity &cookie, const NasatAircraftParticipant &request) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.cpp index 2d6442cb5..62198002b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.cpp @@ -23,7 +23,7 @@ HandlerNasatImpact::HandlerNasatImpact(Initialization *mainHandler) : AreaEffectSimulation::Interface::Ftc::AirSupportImpactModifyReplyHandler() , m_mainHandler(mainHandler) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; auto pdmDtc = m_mainHandler->dds()->pdmDtc(); connect(pdmDtc.get(), &ProjectDataManagement::Interface::Dtc::chargeTypeChanged, this, &HandlerNasatImpact::onChargeTypeChanged); @@ -59,32 +59,32 @@ HandlerNasatImpact::HandlerNasatImpact(Initialization *mainHandler) #endif - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void HandlerNasatImpact::onAirSupportImpactModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - WARNING_LOG() << "Could not create single explosion for nasat impact: " << reply(); + WARNING_LOG(m_logger) << "Could not create single explosion for nasat impact: " << reply(); #ifdef NLDEVCTRL_844 testing.replyCounter++; - INFO_LOG() << "Got create reply: " << reply() << "(id=" << reply.id() << ")" + INFO_LOG(m_logger) << "Got create reply: " << reply() << "(id=" << reply.id() << ")" << ", this=" << this << " - replyCounter=" << testing.replyCounter; #else - INFO_LOG() << "Got create reply: " << reply() << "(id=" << reply.id() << ")" + INFO_LOG(m_logger) << "Got create reply: " << reply() << "(id=" << reply.id() << ")" << ", this=" << this; #endif } void HandlerNasatImpact::onExplosionClusterModifyReply(const Core::FunctionReplyObject &reply) { - INFO_LOG() << "Got create reply: " << reply() << "(id=" << reply.id() << ")" + INFO_LOG(m_logger) << "Got create reply: " << reply() << "(id=" << reply.id() << ")" << ", this=" << this << ", reply.error()=" << reply.error(); if (reply.error()) - ERROR_LOG() << "onExplosionClusterModifyReply: Got reply: " << reply() << "(id=" << reply.id() << ")" + ERROR_LOG(m_logger) << "onExplosionClusterModifyReply: Got reply: " << reply() << "(id=" << reply.id() << ")" << " '" << reply.translated() << "'"; } @@ -113,7 +113,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos, return; #endif - DEBUG_LOG() << Q_FUNC_INFO << " START, nasatId=" << nasatId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, nasatId=" << nasatId << ", pos=" << pos << ", flightTimeMsec = " << flightTimeMsec << ", impactTimeMsec = " << impactTimeMsec; @@ -121,7 +121,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos, const auto participants = m_mainHandler->handlerParticipant()->participantsForNasatId(nasatId); if (participants.isEmpty()) { - WARNING_LOG() << "Can not find a valid participant for nasat aircraft with id " << nasatId; + WARNING_LOG(m_logger) << "Can not find a valid participant for nasat aircraft with id " << nasatId; return; } @@ -145,7 +145,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos, if (m_logger.isDebugEnabled()) { const Core::GeoPosition &nasatPos = m_mainHandler->handlerParticipant()->nasatPosition(nasatId); - DEBUG_LOG() << Q_FUNC_INFO << " START, nasatId=" << nasatId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, nasatId=" << nasatId << ", pos=" << nasatPos << ", flightTimeMsec = " << flightTimeMsec << ", impactTimeMsec=" << impactTimeMsec; @@ -191,7 +191,7 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos, - DEBUG_LOG() << " Sending air support impact: number of participant= " << participants.size(); + DEBUG_LOG(m_logger) << " Sending air support impact: number of participant= " << participants.size(); for (const NasatAircraftParticipantEx *nap : participants) { @@ -205,17 +205,17 @@ void HandlerNasatImpact::nasatImpact(int nasatId, const Core::GeoPosition &pos, int success = nap->publisher()->publish(ecCommonModifyRequest, this); if (success) - DEBUG_LOG() << "Sending air support impact create request: " << ecReq << " to exercise " << nap->exerciseId() + DEBUG_LOG(m_logger) << "Sending air support impact create request: " << ecReq << " to exercise " << nap->exerciseId() << ", nap=" << nap->participant() << " -> success = " << success; else - ERROR_LOG() << "Error on Sending air support impact create request: " << ecReq << " to exercise " << nap->exerciseId() + ERROR_LOG(m_logger) << "Error on Sending air support impact create request: " << ecReq << " to exercise " << nap->exerciseId() << ", nap=" << nap->participant() << " -> success = " << success; #ifdef NLDEVCTRL_844 testing.requestCounter++; - INFO_LOG() << " requestCounter = " << testing.requestCounter; + INFO_LOG(m_logger) << " requestCounter = " << testing.requestCounter; #endif } @@ -254,7 +254,7 @@ void HandlerNasatImpact::onChargeTypeChanged(const ProjectDataManagement::Charge int nasatId = obj.value(QLatin1String("nasatId")).toInt(); if (nasatId == 0) { - WARNING_LOG() << "Found charge with an invalid property 'nasatId', id: " << ct.id(); + WARNING_LOG(m_logger) << "Found charge with an invalid property 'nasatId', id: " << ct.id(); return; } m_chargeMapping.insert(nasatId, ct.id()); @@ -266,7 +266,7 @@ int HandlerNasatImpact::chargeTypeFromMunitionCode(int nasatChargeCode) const auto it = m_chargeMapping.find(nasatChargeCode); if (it != m_chargeMapping.end()) return it.value(); - WARNING_LOG() << "Got unmapped nasat charge code " << nasatChargeCode; + WARNING_LOG(m_logger) << "Got unmapped nasat charge code " << nasatChargeCode; Q_ASSERT(false); return -1; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.h index f34772441..30c9a8758 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_impact.h @@ -30,9 +30,11 @@ public Q_SLOTS: void nasatImpact(int nasatId, const Core::GeoPosition &pos, qint64 flightTimeMsec, qint64 impactTimeMsec, int munitionCode, FuseType fuseType = FuseType::Instant); void onChargeTypeChanged(const ProjectDataManagement::ChargeType &ct); private: + NGL::INGLLogger &m_logger; int chargeTypeFromMunitionCode(int nasatChargeCode) const; int fuseTypeToPdmIgniterType(FuseType fusetype) const; private: + NGL::INGLLogger &m_logger; Initialization *m_mainHandler; QHash m_chargeMapping; #ifdef NLDEVCTRL_844 diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.cpp index c689b16ce..6a0b2e0a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.cpp @@ -25,7 +25,7 @@ bool HandlerNasatNineLiner::init() const connect(m_mainHandler->handlerParticipant().get(), &HandlerParticipant::nasatAircraftParticipantRemoved, this, &HandlerNasatNineLiner::onNasatAircraftParticipantRemoved, Qt::DirectConnection); - DEBUG_LOG() << "HandlerNasatNineLiner init done"; + DEBUG_LOG(m_logger) << "HandlerNasatNineLiner init done"; return true; @@ -108,18 +108,18 @@ static Nasat9Liner createDds9Liner(const NasatNineLiner &nasatNineLiner) void HandlerNasatNineLiner::nineLinerReceived(const NasatNineLiner &nasatNineLiner) { - DEBUG_LOG() << "nineLinerReceived, aircraftId=" << nasatNineLiner.aircraftId + DEBUG_LOG(m_logger) << "nineLinerReceived, aircraftId=" << nasatNineLiner.aircraftId << " - nasatNineLiner.aircraftId is aka nasatId"; const auto participants = m_mainHandler->handlerParticipant()->participantsForNasatId(nasatNineLiner.aircraftId); if (participants.isEmpty()) { - INFO_LOG() << "No exercise participants found to publish 9-liner for nasat aircraft with id " + INFO_LOG(m_logger) << "No exercise participants found to publish 9-liner for nasat aircraft with id " << nasatNineLiner.aircraftId; return; } - DEBUG_LOG() << "nineLinerReceived, publishing to exercises"; + DEBUG_LOG(m_logger) << "nineLinerReceived, publishing to exercises"; static int s_id = 1; Nasat9Liner nl = createDds9Liner(nasatNineLiner); @@ -129,7 +129,7 @@ void HandlerNasatNineLiner::nineLinerReceived(const NasatNineLiner &nasatNineLin const auto &exerciseParticipantId = it.key(); auto nape = it.value(); - DEBUG_LOG() << "nineLinerReceived, publishing to exercises, s_id=" << s_id + DEBUG_LOG(m_logger) << "nineLinerReceived, publishing to exercises, s_id=" << s_id << ", exerciseParticipantId.exerciseId=" << exerciseParticipantId.exerciseId << ", exerciseParticipantId.participantId=" << exerciseParticipantId.participantId; @@ -171,17 +171,17 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf const int nasatId = m_mainHandler->nasatAircraft()->nasatIdFromNasatAircraftId(nap.nasatAircraftId()); - INFO_LOG() << " onNasatAircraftParticipantRemoved, nap = " << nap << ", nasatId = " << nasatId; + INFO_LOG(m_logger) << " onNasatAircraftParticipantRemoved, nap = " << nap << ", nasatId = " << nasatId; if (nasatId < 0) { - WARNING_LOG() << " nasatIdFromNasatAircraftId failed, nap=" << nap; + WARNING_LOG(m_logger) << " nasatIdFromNasatAircraftId failed, nap=" << nap; return; } const auto participants = m_mainHandler->handlerParticipant()->participantsForNasatId(nasatId); if (participants.isEmpty()) { - INFO_LOG() << "No exercise participants found to publish 9-liner for nasat aircraft with id " + INFO_LOG(m_logger) << "No exercise participants found to publish 9-liner for nasat aircraft with id " << nap.nasatAircraftId(); return; } @@ -192,7 +192,7 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf auto nape = it.value(); auto &nineLinerParticipant = m_nineLiner[exerciseParticipantId]; - DEBUG_LOG() << Q_FUNC_INFO << " updating for removing " + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updating for removing " << ", exerciseParticipantId.exerciseId=" << exerciseParticipantId.exerciseId << ", exerciseParticipantId.participantId=" << exerciseParticipantId.participantId << ", nineLinerParticipant.isEmpty()=" << nineLinerParticipant.isEmpty(); @@ -202,7 +202,7 @@ void HandlerNasatNineLiner::onNasatAircraftParticipantRemoved(const NasatAircraf auto &oldLast = nineLinerParticipant.last(); if (oldLast.isCurrent()) { - DEBUG_LOG() << Q_FUNC_INFO << " updating for removing " + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " updating for removing " << ", exerciseParticipantId.exerciseId=" << exerciseParticipantId.exerciseId << ", exerciseParticipantId.participantId=" << exerciseParticipantId.participantId; oldLast.sampleTime(QDateTime::currentMSecsSinceEpoch()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.h index 80cc7b263..f39292404 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_nasat_nine_liner.h @@ -26,6 +26,7 @@ public Q_SLOTS: void onNasatAircraftParticipantRemoved(const NasatAircraftParticipant &nap); private: + NGL::INGLLogger &m_logger; QHash> m_nineLiner; Initialization *m_mainHandler; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.cpp index 2ce677274..4940dd060 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.cpp @@ -20,24 +20,24 @@ namespace GuezNasat NasatAircraftParticipantEx::NasatAircraftParticipantEx() : m_logger(getLogger("NasatAircraftParticipantEx")) { - DEBUG_LOG() << Q_FUNC_INFO << " START"; - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } NasatAircraftParticipantEx::NasatAircraftParticipantEx(const NasatAircraftParticipant &nap, const std::shared_ptr &publisher) : m_nap(nap) , m_publisher(publisher) { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_publisher->addParticipantToWatch(m_nap.participantId()); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } NasatAircraftParticipantEx::~NasatAircraftParticipantEx() { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; m_publisher->removeParticipantToWatch(m_nap.participantId()); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } int NasatAircraftParticipantEx::partyId() const @@ -82,23 +82,23 @@ void HandlerParticipant::onNasatAircraftParticipantRemoved(const NasatAircraftPa auto it = m_activePublisher.find(nasatId); if (it == m_activePublisher.end()) { - WARNING_LOG() << "No publisher for NasatAircraftParticipant " << nasatId << "(" << nap.nasatAircraftId() << ") found !?"; + WARNING_LOG(m_logger) << "No publisher for NasatAircraftParticipant " << nasatId << "(" << nap.nasatAircraftId() << ") found !?"; return; } auto itParticipants = it.value().find(ExerciseParticipantKey(nap.exerciseId(), nap.participantId())); if (itParticipants == it.value().end()) { - WARNING_LOG() << "No participant entry for NasatAircraftParticipant " << nasatId << "(" + WARNING_LOG(m_logger) << "No participant entry for NasatAircraftParticipant " << nasatId << "(" << nap.exerciseId() << "," << nap.participantId() << ") found !?"; return; } - DEBUG_LOG() << " emit nasatAircraftParticipantRemoved, nap = " << nap; + DEBUG_LOG(m_logger) << " emit nasatAircraftParticipantRemoved, nap = " << nap; emit nasatAircraftParticipantRemoved(nap); - DEBUG_LOG() << "Remove position publisher for " << nap; + DEBUG_LOG(m_logger) << "Remove position publisher for " << nap; NasatAircraftParticipantEx* napeCopy= itParticipants.value(); @@ -119,11 +119,11 @@ void HandlerParticipant::onNasatAircraftParticipantRemoved(const NasatAircraftPa Core::GeoPosition HandlerParticipant::nasatPosition(int nasatId) const { - DEBUG_LOG() << Q_FUNC_INFO << " START, nasatId=" << nasatId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, nasatId=" << nasatId; auto it = m_lastNasatPositionsAsCoreGeoposition.find(nasatId); if (it == m_lastNasatPositionsAsCoreGeoposition.end()) { - INFO_LOG() << "No NasatPosition for nasat id " << nasatId << " found"; + INFO_LOG(m_logger) << "No NasatPosition for nasat id " << nasatId << " found"; return {}; } return *it; @@ -131,7 +131,7 @@ Core::GeoPosition HandlerParticipant::nasatPosition(int nasatId) const void HandlerParticipant::onNasatPosition(const NasatPosition &position) { - DEBUG_LOG() << Q_FUNC_INFO << " START, position.aircraftId=" << position.aircraftId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, position.aircraftId=" << position.aircraftId; const Core::GeoPosition geoPos(position.position.lon * LtsCoordTrans::deg2rad(), position.position.lat * LtsCoordTrans::deg2rad(), position.position.height); @@ -144,11 +144,11 @@ void HandlerParticipant::onNasatPosition(const NasatPosition &position) void HandlerParticipant::onNasatAircraftPosition(int nasatId, const Core::GeoPosition &pos, qint64 ts) { - DEBUG_LOG() << Q_FUNC_INFO << " START, nasatId=" << nasatId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, nasatId=" << nasatId; auto it = m_activePublisher.find(nasatId); if (it == m_activePublisher.end()) { - INFO_LOG() << "No position publisher for nasat id " << nasatId << " found - ignoring " << m_activePublisher.size(); + INFO_LOG(m_logger) << "No position publisher for nasat id " << nasatId << " found - ignoring " << m_activePublisher.size(); return; } @@ -161,11 +161,11 @@ void HandlerParticipant::onNasatAircraftPosition(int nasatId, const Core::GeoPos tabPos.equipmentNumber(-napEx->participantId()); int success = napEx->publisher()->publish(tabPos); if (success) - DEBUG_LOG() << "Publishing positon: " << tabPos << " to exercise " << napEx->exerciseId() + DEBUG_LOG(m_logger) << "Publishing positon: " << tabPos << " to exercise " << napEx->exerciseId() << ", napEx: " << napEx->participant() << " -> success = " << success; else - ERROR_LOG() << "Error on Publishing positon: " << tabPos << " to exercise " << napEx->exerciseId() + ERROR_LOG(m_logger) << "Error on Publishing positon: " << tabPos << " to exercise " << napEx->exerciseId() << ", napEx: " << napEx->participant() << " -> success = " << success; @@ -180,7 +180,7 @@ void HandlerParticipant::onNasatIdChanged(int oldNasatId, int newNasatId) void HandlerParticipant::createNasatAircraftParticipant(const NasatAircraftParticipant &nap, int nasatId) { - DEBUG_LOG() << "Creating position publisher for " << nap + DEBUG_LOG(m_logger) << "Creating position publisher for " << nap << ", nasatId=" << nasatId; auto *napEx = new NasatAircraftParticipantEx(nap, m_mainHandler->dds()->ddsParticipant(nap.exerciseId())); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.h index 8d09a3a59..7f7663f26 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/handler_participant.h @@ -31,6 +31,7 @@ struct NasatAircraftParticipantEx final Q_DISABLE_COPY(NasatAircraftParticipantEx) private: +NGL::INGLLogger &m_logger; NasatAircraftParticipant m_nap; std::shared_ptr m_publisher; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.cpp index 15934dd02..cc58f00ba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.cpp @@ -43,13 +43,13 @@ Initialization::~Initialization() bool Initialization::initialize(const std::shared_ptr &ddsConnector, const QSqlDatabase &) { - INFO_LOG() << "Start GuezNasat Initialization."; + INFO_LOG(m_logger) << "Start GuezNasat Initialization."; m_ddsHandler = std::make_shared(ddsConnector); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation DdsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DdsHandler failed."; return false; } @@ -58,7 +58,7 @@ bool Initialization::initialize(const std::shared_ptrinit(ddsConnector->getPartitionId(), Settings::settings())) { - ERROR_LOG() << "Initialisation DbHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DbHandler failed."; return false; } @@ -80,16 +80,16 @@ bool Initialization::initialize(const std::shared_ptrinit()) { - ERROR_LOG() << "Initialisation HandlerNasatAircraft failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerNasatAircraft failed."; return false; } if (!m_handlerNasatAircraftParticipant->init()) { - ERROR_LOG() << "Initialisation HandlerNasatAircraftParticipant failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerNasatAircraftParticipant failed."; return false; } if (!m_handlerNasatImpact->init()) { - ERROR_LOG() << "Initialisation HandlerNasatImpact failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerNasatImpact failed."; return false; } if (!m_handlerNasatNineLiner->init()) { - ERROR_LOG() << "Initialisation HandlerNasatNineLiner failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerNasatNineLiner failed."; return false; } if (!m_handlerParticipant->init()) { - ERROR_LOG() << "Initialisation ParticipantPositionPublisher failed."; + ERROR_LOG(m_logger) << "Initialisation ParticipantPositionPublisher failed."; return false; } @@ -147,13 +147,13 @@ bool Initialization::loadFromDatabase() NOTICE_LOG(m_logger) << "Initialisation SocketHandler ...."; if (!m_jsonSocketHandler->init(Settings::socketListenPort())) { - ERROR_LOG() << "Initialisation WebSocketHandler failed."; + ERROR_LOG(m_logger) << "Initialisation WebSocketHandler failed."; } }); #else if (!m_jsonSocketHandler->init(Settings::socketListenPort())) { - ERROR_LOG() << "Initialisation WebSocketHandler failed."; + ERROR_LOG(m_logger) << "Initialisation WebSocketHandler failed."; return false; } #endif @@ -171,7 +171,7 @@ bool Initialization::loadFromDatabase() QObject::connect(m_jsonSocketHandler.get(), &AbstractSocketHandler::nineLinerReceived, m_handlerNasatNineLiner.get(), &HandlerNasatNineLiner::nineLinerReceived); - TRACE_LOG() << Q_FUNC_INFO << "END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << "END"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.h index 9e07c169a..8d74bae77 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/GuezNasat/initialization.h @@ -38,6 +38,7 @@ public: std::shared_ptr handlerParticipant() const { return m_handlerParticipant; } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_dbHandler; std::shared_ptr m_handlerNasatAircraft; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/aes_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/aes_handler.h index 6dca0f4e7..813b57236 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/aes_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/aes_handler.h @@ -36,6 +36,8 @@ private Q_SLOTS: void onAirSupportImpact(AreaEffectSimulation::AirSupportImpactModifyRequest asi, int equipmentNumber); private: + +NGL::INGLLogger &m_logger; NgsHandler *m_ngsHandler; std::shared_ptr m_dtcAes; std::shared_ptr m_ftcAes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.cpp index 4d1263d31..b0a955bba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.cpp @@ -9,11 +9,10 @@ namespace HighLevelArchitecture { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) - , m_exerciseHasHlaConnection(false) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) + , m_exerciseHasHlaConnection(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -27,7 +26,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.h index 0aed56eda..bf5a0dedb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/dds_handler.h @@ -32,8 +32,10 @@ public: Q_SIGNALS: void exerciseHlaStateChanged(bool bHlaEnabled); private: + NGL::INGLLogger &m_logger; void onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_dtcExm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.cpp index 292aa1a37..a28ba841f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.cpp @@ -13,10 +13,9 @@ namespace HighLevelArchitecture { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) - , m_exerciseId(0) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent) + , m_exerciseId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -31,7 +30,7 @@ bool MainHandler::init(int domainId, int exerciseId) m_ddsHandler = std::make_shared(domainId, exerciseId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Could not init DDS handler"; + ERROR_LOG(m_logger) << "Could not init DDS handler"; return false; } connect(m_ddsHandler.get(), &DdsHandler::exerciseHlaStateChanged, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.h index dfcb93b55..d8e7fbae0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/main_handler.h @@ -26,6 +26,7 @@ public: private Q_SLOTS: void onExerciseHlaStateChanged(bool bHlaEnabled); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_ngsHandler; std::shared_ptr m_wsHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.cpp index 8808209ee..66af94e11 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.cpp @@ -127,8 +127,7 @@ static inline rpr2::SpatialStruct spatialStructFromWorldLocation(const rpr2::Wor -NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) - : m_ngsHandler(ngsHandler) +NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) : m_ngsHandler(ngsHandler) , m_fedName(fedName) , m_swadmin(&ngs::SimulatedWorldAPI::getSimulatedWorldAdmin()) , m_master(nullptr) @@ -144,8 +143,8 @@ NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) , m_iaWeaponFireCallback(new ObserverWeaponFireCBNotifier()) , m_bInitialized(false) , m_bCanPublishData(false) - , m_timer(new QTimer(this)) -{ + , m_timer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_timer, &QTimer::timeout, this, &NgsConnector::go); connect(m_playerCallback, &PlayerCallback::firstTick, @@ -212,7 +211,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const ngs::NGSSimWorldException &e) { - ERROR_LOG() << "caught exception during init (getIFederationMaster): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (getIFederationMaster): " << e.print(); return false; } @@ -227,7 +226,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const NGSException &e) { - ERROR_LOG() << "caught exception during init (createFederation): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (createFederation): " << e.print(); return false; } player = &m_swadmin->getIPlayer(m_fedName.toStdString(), playerName.toStdString(), *m_playerCallback, Settings::swConfFileName().toLatin1().data(), Settings::fomIdentifier().toStdString(), Settings::rtiIdentifier().toStdString()); @@ -277,22 +276,22 @@ void NgsConnector::subscribeAtNgs() m_enitityNumberCounter = 1; m_eventCount = 1; - INFO_LOG() << "Subscribe at NGS - Human Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Human Objects"; rpr2::IObserverHumanObjClass &humanObjClass = m_somPlayer->getObserverHumanObjClass(*m_humanCallback); humanObjClass.subscribeAllAttributes(); humanObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - GroundVehicle Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - GroundVehicle Objects"; rpr2::IObserverGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.subscribeAllAttributes(); groundVehicleObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - LongBowApache Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - LongBowApache Objects"; rpr2::IObserverLongBowApacheObjClass &longBowApacheObjClass = m_somPlayer->getObserverLongBowApacheObjClass(*m_longBowApacheCallback); longBowApacheObjClass.subscribeAllAttributes(); longBowApacheObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Designator Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Designator Objects"; rpr2::IObserverDesignatorObjClass &designatorObjClass = m_somPlayer->getObserverDesignatorObjClass(*m_designatorCallback); designatorObjClass.subscribeAllAttributes(); designatorObjClass.subscribe(); @@ -321,35 +320,35 @@ void NgsConnector::unsubscribeFromNgs() if (m_somPlayer) { - INFO_LOG() << "Unsubscribe at NGS - Human Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Human Objects"; rpr2::IObserverHumanObjClass &humanObjClass = m_somPlayer->getObserverHumanObjClass(*m_humanCallback); humanObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - GroundVehicle Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - GroundVehicle Objects"; rpr2::IObserverGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - LongBowApache Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - LongBowApache Objects"; rpr2::IObserverLongBowApacheObjClass &longBowApacheObjClass = m_somPlayer->getObserverLongBowApacheObjClass(*m_longBowApacheCallback); longBowApacheObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Designator Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Designator Objects"; rpr2::IObserverDesignatorObjClass &designatorObjectClass = m_somPlayer->getObserverDesignatorObjClass(*m_designatorCallback); designatorObjectClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Engagement Reply Interaction"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Engagement Reply Interaction"; rpr2::IObserverEngagementReplyIntClass &enr = m_somPlayer->getObserverEngagementReplyIntClass(*m_iaEngagementReplyCallback); enr.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Event Report Interaction"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Event Report Interaction"; rpr2::IObserverEventReportIntClass &evr = m_somPlayer->getObserverEventReportIntClass(*m_iaEventReportCallback); evr.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Munition Detonation Interaction"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Munition Detonation Interaction"; rpr2::IObserverMunitionDetonationIntClass &md = m_somPlayer->getObserverMunitionDetonationIntClass(*m_iaMunitionDetonationCallback); md.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Weapon Fire Interaction"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Weapon Fire Interaction"; rpr2::IObserverWeaponFireIntClass &wf = m_somPlayer->getObserverWeaponFireIntClass(*m_iaWeaponFireCallback); wf.unsubscribe(); } @@ -515,7 +514,7 @@ bool NgsConnector::sendData(int eqNo, const QByteArray& data, int requestIdentif vds.NumberOfLongLongs__A__Padding__A__DatumValue.resize(data.size() / 8 + 1); vds.DatumLengthInBits = 8 * data.size(); - TRACE_LOG() << "--> Data. Receiver: " << eqNo << ", ReqID: " << requestIdentifier << ", Data: " << data; + TRACE_LOG(m_logger) << "--> Data. Receiver: " << eqNo << ", ReqID: " << requestIdentifier << ", Data: " << data; for (unsigned int i=0; i< vds.NumberOfLongLongs__A__Padding__A__DatumValue.size(); ++i) { @@ -682,11 +681,11 @@ void NgsConnector::go() } catch (const NGSException &ex) { - ERROR_LOG() << "NGS Exception caught in Event Loop" << ex.print(); + ERROR_LOG(m_logger) << "NGS Exception caught in Event Loop" << ex.print(); } catch (const std::exception &e) { - ERROR_LOG() << "Standard Exception caught in Event Loop: " << e.what(); + ERROR_LOG(m_logger) << "Standard Exception caught in Event Loop: " << e.what(); } catch (...) { @@ -1499,7 +1498,7 @@ void NgsConnector::onNewMunitionDetonation(const rpr2::IObserverMunitionDetonati const auto &objectIdentifier = interaction.getEventIdentifier().IssuingObjectIdentifier; int eqId = getEquipmentNoByRTIObjectId(objectIdentifier.ID); - DEBUG_LOG() << "Engagement Reply, Issuer: " << eqId; + DEBUG_LOG(m_logger) << "Engagement Reply, Issuer: " << eqId; if (m_playerMap.contains(eqId) || objectIdentifier.ID == std::to_string(IdentifierStruct(0).toInt64())) return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.h index 0a1fec516..68ef40c41 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_connector.h @@ -232,6 +232,7 @@ signals: void laserDesignation(const TrainingAreaBase::LaserDesignation &event); protected: + NGL::INGLLogger &m_logger; void subscribeAtNgs(); void unsubscribeFromNgs(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.cpp index 53a4f1814..dee732eb0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.cpp @@ -14,10 +14,9 @@ namespace HighLevelArchitecture { -NgsHandler::NgsHandler(QObject *parent) - : QObject(parent) - , m_ddsHandler(nullptr) -{} +NgsHandler::NgsHandler(QObject *parent) : QObject(parent) + , m_ddsHandler(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} NgsHandler::~NgsHandler() { @@ -39,7 +38,7 @@ bool NgsHandler::init(const std::shared_ptr &ddsHandler) ngs::IObserver::ProtocolType protocol = Settings::hlaProtocol(); - INFO_LOG() << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); + INFO_LOG(m_logger) << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); m_ngsConnector = @@ -61,9 +60,9 @@ void NgsHandler::onFirstTickFinished() m_ppmHandler = std::make_shared(this); m_aesHandler = std::make_shared(this); if (!m_ppmHandler->init()) - ERROR_LOG() << "Could not init ppm handler - not able to publish participants to HLA"; + ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish participants to HLA"; if (!m_aesHandler->init()) - ERROR_LOG() << "Could not init ppm handler - not able to publish area effect simulations to HLA"; + ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish area effect simulations to HLA"; connect(m_ppmHandler.get(), &PpmHandler::externalEquipmentNumberAdded, this, &NgsHandler::externalEquipmentNumberAdded); @@ -89,11 +88,11 @@ void NgsHandler::initSocketReaders() sr->start(); connect(sr, &SocketReader::newData, this, &NgsHandler::onNewSocketReaderData); m_socketReaders.append(sr); - INFO_LOG() << "SocketReader with ID " << sd.hlaRequestIdentifier << " connected"; + INFO_LOG(m_logger) << "SocketReader with ID " << sd.hlaRequestIdentifier << " connected"; } else { - ERROR_LOG() << "Could not initialize SocketReader " << sd.hlaRequestIdentifier; + ERROR_LOG(m_logger) << "Could not initialize SocketReader " << sd.hlaRequestIdentifier; } } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.h index 06efff02d..d8322c8ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ngs_handler.h @@ -49,6 +49,7 @@ private slots: private: + NGL::INGLLogger &m_logger; void initSocketReaders(); void deInitSocketReaders(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.cpp index 594cf3750..b318d7303 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.cpp @@ -82,7 +82,7 @@ bool PpmHandler::init() m_dtsTab->enableEquipmentGearAssignment()) ) { - ERROR_LOG() << "Enabling TAB DTS Data-Topics failed."; + ERROR_LOG(m_logger) << "Enabling TAB DTS Data-Topics failed."; return false; } @@ -172,7 +172,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy int equipmentNo = getEquipmentNo(data.participantId()); if (equipmentNo == 0) { - ERROR_LOG() << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA."; + ERROR_LOG(m_logger) << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA."; return; } @@ -235,7 +235,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType) { - DEBUG_LOG() << "onParticipantChanged: " << data; + DEBUG_LOG(m_logger) << "onParticipantChanged: " << data; switch (modType) { case DataModification::eAdded: @@ -314,7 +314,7 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant & void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType) { - DEBUG_LOG() << "onParticipantPositionChanged: " << data; + DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data; switch (modType) { case DataModification::eAdded: @@ -404,7 +404,7 @@ void PpmHandler::onChargeTypeChanged(const ProjectDataManagement::ChargeType &da void PpmHandler::startPublishToNgs() { - INFO_LOG() << "Recreating all players from scratch due to structure / exercise change"; + INFO_LOG(m_logger) << "Recreating all players from scratch due to structure / exercise change"; m_createdParticipantIds.clear(); @@ -413,7 +413,7 @@ void PpmHandler::startPublishToNgs() - INFO_LOG() << "(Re)Adding all players, size: " << m_partData.size(); + INFO_LOG(m_logger) << "(Re)Adding all players, size: " << m_partData.size(); for (const ParticipantManagement::Participant &participant : std::as_const(m_partData)) createParticipant(participant); @@ -474,7 +474,7 @@ rpr2::DetonationResultCodeEnum8::ET PpmHandler::rpr2DetonationResultFromPercenta void PpmHandler::participantVulnerabilityStateRequest(const TrainingAreaBase::TetraIcd::DemandVulnerabilityStateChange &request) { - DEBUG_LOG() << "Participant Vulnerability State Request"; + DEBUG_LOG(m_logger) << "Participant Vulnerability State Request"; rpr2::DetonationResultCodeEnum8::ET resCode = rpr2DetonationResultFromVulnerabilityState(request.reqestedState); m_ngsHandler->ngsConnector()->sendMunitionDetonation(request.header.equipmentNumber, @@ -503,7 +503,7 @@ void PpmHandler::createParticipant(const ParticipantManagement::Participant &par if (!m_ngsHandler->ngsConnector()->canPublishData()) { - WARNING_LOG() << "Can not publish data ... :("; + WARNING_LOG(m_logger) << "Can not publish data ... :("; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.h index 860ff7b89..cea8131b0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/ppm_handler.h @@ -90,6 +90,7 @@ public slots: void participantCesHitInformationRequest(const TrainingAreaBase::TetraIcd::CesHitInformation &request); private: + NGL::INGLLogger &m_logger; void createParticipant(const ParticipantManagement::Participant &participant); bool createHuman(const ParticipantManagement::Participant &participant); bool createGroundVehicle(const ParticipantManagement::Participant &participant); @@ -113,6 +114,7 @@ private: static rpr2::DetonationResultCodeEnum8::ET rpr2DetonationResultFromPercentage(int percentage); private: + NGL::INGLLogger &m_logger; NgsHandler *m_ngsHandler; std::shared_ptr m_dtcPpm; std::shared_ptr m_ftcPpm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.cpp index d56fd7931..5afeb9254 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.cpp @@ -22,6 +22,6 @@ void ObserverActionRequestCBNotifier::newActionRequestIntInstance(const rpr2::IO void ObserverActionRequestCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.h index c6d96bbf3..3b7d020a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_actionrequest.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newActionRequest(const rpr2::IObserverActionRequestIntInstance &interaction); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.cpp index d8f423aaf..bc877ad73 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.cpp @@ -22,6 +22,6 @@ void ObserverDataCBNotifier::newDataIntInstance(const rpr2::IObserverDataIntInst void ObserverDataCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.h index c1236648e..86535bf37 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_data.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newData(const rpr2::IObserverDataIntInstance &interaction); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.cpp index 2264c96f6..fbefa3d88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.cpp @@ -23,6 +23,6 @@ void ObserverEngagementReplyCBNotifier::newEngagementReplyIntInstance(const rpr2 void ObserverEngagementReplyCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.h index c8d08ab7b..910abc2e1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_engagementreply.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newEngagementReply(const rpr2::IObserverEngagementReplyIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.cpp index f5f7de69d..e68ba2bb3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.cpp @@ -22,6 +22,6 @@ void ObserverEventReportCBNotifier::newEventReportIntInstance(const rpr2::IObser void ObserverEventReportCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.h index 6b238c9f9..91971e55f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_eventreport.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newEventReport(const rpr2::IObserverEventReportIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.cpp index ba944fb85..34c0849a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.cpp @@ -17,6 +17,6 @@ void ObserverMunitionDetonationCBNotifier::newMunitionDetonationIntInstance(cons void ObserverMunitionDetonationCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.h index 0528e2e22..d7170ca95 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_munitiondetonation.h @@ -24,6 +24,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newMunitionDetonation(const rpr2::IObserverMunitionDetonationIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.cpp index 03c2aa975..2f4dce195 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.cpp @@ -23,6 +23,6 @@ void ObserverWeaponFireCBNotifier::newWeaponFireIntInstance(const rpr2::IObserve void ObserverWeaponFireCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.h index be317f4f7..b26d4d149 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_ia_weaponfire.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newWeaponFire(const rpr2::IObserverWeaponFireIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_observer_object_instance_cb.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_observer_object_instance_cb.h index 6f62ab32e..a650dbade 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_observer_object_instance_cb.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/rpr/rpr_observer_object_instance_cb.h @@ -25,7 +25,7 @@ public: void deleteObjectInstance() override { - DEBUG_LOG() << "deleteObjectInstance"; + DEBUG_LOG(m_logger) << "deleteObjectInstance"; if (m_pCB && m_pIObject) m_pCB->deleteObjectInstance(*m_pIObject); delete this; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.cpp index acb332fdf..1251da1a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.cpp @@ -12,17 +12,16 @@ namespace HighLevelArchitecture { -SocketReader::SocketReader(QObject *parent) - : QThread(parent) +SocketReader::SocketReader(QObject *parent) : QThread(parent) , m_socket(new QTcpSocket(this)) , m_hlaRequestIdentifier(0) - .getNGLLogger("SocketReader")) -{ + .getNGLLogger("SocketReader")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } bool SocketReader::init(const QString &host, quint16 port, int hlaRequestIdentifier) { - DEBUG_LOG() << "SR " << hlaRequestIdentifier << ": Trying to establish connection to " << host << ":" << port; + DEBUG_LOG(m_logger) << "SR " << hlaRequestIdentifier << ": Trying to establish connection to " << host << ":" << port; m_hlaRequestIdentifier = hlaRequestIdentifier; connect(m_socket, SIGNAL(readyRead()), this, SLOT(onReadyRead())); @@ -49,9 +48,9 @@ void SocketReader::onReadyRead() - DEBUG_LOG() << "SR "<< m_hlaRequestIdentifier << ": Data received, transmitting"; + DEBUG_LOG(m_logger) << "SR "<< m_hlaRequestIdentifier << ": Data received, transmitting"; QByteArray ba(m_socket->readAll()); - TRACE_LOG() << "SR "<< m_hlaRequestIdentifier << ": Data contents: " << ba.constData(); + TRACE_LOG(m_logger) << "SR "<< m_hlaRequestIdentifier << ": Data contents: " << ba.constData(); emit newData(ba, m_hlaRequestIdentifier); } @@ -75,7 +74,7 @@ void SocketReader::onSocketError(const QAbstractSocket::SocketError &error) } } - ERROR_LOG() << "SR "<< m_hlaRequestIdentifier << ": Socket Error: " << errorValue; + ERROR_LOG(m_logger) << "SR "<< m_hlaRequestIdentifier << ": Socket Error: " << errorValue; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.h index 6b860c110..c3e7f4dd0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/socketreader.h @@ -26,6 +26,7 @@ signals: void newData(const QByteArray &content, int id); protected: + NGL::INGLLogger &m_logger; QTcpSocket *m_socket; int m_hlaRequestIdentifier; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.cpp index 1a9988376..0770b94ad 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.cpp @@ -15,12 +15,11 @@ namespace HighLevelArchitecture { -WebSocketHandler::WebSocketHandler(int exerciseId, MainHandler *mainHandler, QObject *parent) - : QObject(parent) +WebSocketHandler::WebSocketHandler(int exerciseId, MainHandler *mainHandler, QObject *parent) : QObject(parent) , m_webSocketServer(new QWebSocketServer(QStringLiteral("WLS"), QWebSocketServer::NonSecureMode, this)) , m_mainHandler(mainHandler) - , m_exerciseId(exerciseId) -{} + , m_exerciseId(exerciseId), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} WebSocketHandler::~WebSocketHandler() { @@ -32,7 +31,7 @@ bool WebSocketHandler::init(quint16 listenPort) { if (!m_webSocketServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting"; + WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting"; return false; } connect(m_webSocketServer, &QWebSocketServer::newConnection, @@ -51,7 +50,7 @@ bool WebSocketHandler::sendTelegramInternal(const TrainingAreaBase::TetraIcd::Tr const QString jsonStr = QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact)); - DEBUG_LOG() << "jsonStr: " << jsonStr; + DEBUG_LOG(m_logger) << "jsonStr: " << jsonStr; bool bOk = false; for (auto wsw : std::as_const(m_webSockets)) @@ -68,12 +67,12 @@ void WebSocketHandler::sendHlaConnectionState() TrainingAreaBase::TetraIcd::ProxyConnectionState connState; connState.connectedToSystem = m_mainHandler->isConnectedToHla(); sendTelegram(&connState, m_exerciseId); - DEBUG_LOG() << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem; + DEBUG_LOG(m_logger) << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem; } void WebSocketHandler::sendParticipantConnectionStates() { - DEBUG_LOG() << "sendParticipantConnectionStates"; + DEBUG_LOG(m_logger) << "sendParticipantConnectionStates"; TrainingAreaBase::TetraIcd::WlsParticipantsConnectionState partConnState; partConnState.equipmentNumber = -1; partConnState.dataCommunicationPossible = false; @@ -81,7 +80,7 @@ void WebSocketHandler::sendParticipantConnectionStates() if (!m_mainHandler->isConnectedToHla()) { - INFO_LOG() << "We are (not) yet connected to HLA - don't send participant connection states"; + INFO_LOG(m_logger) << "We are (not) yet connected to HLA - don't send participant connection states"; return; } const auto externalEquipmentNumbers = m_mainHandler->ngsHandler()->ppmHandler()->externalEquipmentNumbers(); @@ -117,7 +116,7 @@ void WebSocketHandler::onNewConnection() QWebSocket *ws = m_webSocketServer->nextPendingConnection(); if (!ws) return; - DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); + DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); auto wsw = std::make_shared(ws); connect(wsw.get(), &WebSocketWrapper::textMessageReceived, @@ -132,11 +131,11 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) { using namespace TrainingAreaBase::TetraIcd; - TRACE_LOG() << "WebSocketHandler::onTextMessageReceived: " << baJson; + TRACE_LOG(m_logger) << "WebSocketHandler::onTextMessageReceived: " << baJson; WebSocketWrapper *wsw = qobject_cast(sender()); if (!wsw) { - ERROR_LOG() << "Internal error - sender is no WebSocketWrapper"; + ERROR_LOG(m_logger) << "Internal error - sender is no WebSocketWrapper"; return; } @@ -156,7 +155,7 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -185,14 +184,14 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) emit vulnerabilityStateRequest(DemandVulnerabilityStateChange::fromJson(data)); break; default: - WARNING_LOG() << "Handler for telegram Id " << typeId.toInt() + WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt() << " not yet implemented (" << baJson << ")"; return; } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.h index 843dccaf9..8c84dc493 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Apache/web_socket_handler.h @@ -54,6 +54,7 @@ public Q_SLOTS: void onExternalEquipmentNumberRemoved(int equipNo); private: + NGL::INGLLogger &m_logger; void sendDataCommunicationState(int equipNo, bool bIsAvailable); bool sendTelegramInternal(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, const QString &type, int exerciseId); @@ -62,6 +63,7 @@ private Q_SLOTS: void onWebSocketDisconnected(); void onTextMessageReceived(const QByteArray &baJson); private: + NGL::INGLLogger &m_logger; QWebSocketServer *m_webSocketServer; QVector> m_webSockets; MainHandler *m_mainHandler; @@ -85,6 +87,7 @@ Q_SIGNALS: private Q_SLOTS: void onTextMessageReceived(const QString &data); private: + NGL::INGLLogger &m_logger; QWebSocket *m_webSocket; int m_exerciseId; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.cpp index 8f9591da2..044dc3b85 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.cpp @@ -79,9 +79,9 @@ AesHandler::AesHandler(NgsHandler *ngsHandler) void AesHandler::onMineAreaModifyReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "ModifyReply: " << replyObject(); + WARNING_LOG(m_logger) << "ModifyReply: " << replyObject(); else - DEBUG_LOG() << "ModifyReply: " << replyObject(); + DEBUG_LOG(m_logger) << "ModifyReply: " << replyObject(); m_requestHelper->requestReply(replyObject); } @@ -176,7 +176,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification for (const auto &pos : data.form()) formString << ParticipantPosition(pos).toString(); - DEBUG_LOG() << "\n##############################" + DEBUG_LOG(m_logger) << "\n##############################" << "\n##### AesItemViewChanged #####" << "\n##############################" << "\nid: " << data.id() @@ -196,7 +196,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification data.effectStateId() == AesEffectState::EsExpired || data.effectStateId() == AesEffectState::EsRemoved) { - DEBUG_LOG() << "Item view with id " << data.aesItemId() << " removed"; + DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " removed"; m_aesItemViews.remove(data.aesItemId()); m_takenIndicesForAesItem.remove(data.aesItemId()); m_ngsHandler->ngsConnector()->setItemForm(data.aesItemId()); @@ -205,7 +205,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification else if (data.effectStateId() == AesEffectState::EsPrepared && data.aesTypeId() == AesType_def::AtExplosionAreaSingleExplosions) { - DEBUG_LOG() << "Item view with id " << data.aesItemId() << " added"; + DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " added"; m_aesItemViews.insert(data.aesItemId(), data); m_takenIndicesForAesItem.insert(data.aesItemId(), QVector()); } @@ -213,7 +213,7 @@ void AesHandler::onAesItemViewChanged(const AesItemView &data, DataModification else if (data.aesTypeId() == AesType_def::AtBCContamination) { m_ngsHandler->ngsConnector()->setItemForm(data.aesItemId(), data.aesTypeId().underlying(), data.form()); - DEBUG_LOG() << "Item view with id " << data.aesItemId() << " directly updated in ngsConnector"; + DEBUG_LOG(m_logger) << "Item view with id " << data.aesItemId() << " directly updated in ngsConnector"; } } @@ -229,7 +229,7 @@ void AesHandler::onTriggeredImpactsChanged(const TriggeredImpacts &data, DataMod } bitfield.append(QStringLiteral("]")); - DEBUG_LOG() << "\n#####################################" + DEBUG_LOG(m_logger) << "\n#####################################" << "\n##### triggered impacts changed #####" << "\n#####################################" << "\nid: " << data.id() @@ -349,7 +349,7 @@ void AesHandler::onAesExplosionSingleChanged(const ExplosionSingle &data, DataMo - DEBUG_LOG() << "\n####################################" + DEBUG_LOG(m_logger) << "\n####################################" << "\n##### single explosion changed #####" << "\n####################################" << "\nid: " << data.id() @@ -387,7 +387,7 @@ void AesHandler::onAesMineAreaChanged(const MineArea &data, DataModification mod { Q_UNUSED(modType); - DEBUG_LOG() << "\n#############################" + DEBUG_LOG(m_logger) << "\n#############################" << "\n##### mine area changed #####" << "\n#############################" << "\nid: " << data.id() @@ -410,7 +410,7 @@ void AesHandler::onAesMineCorridorChanged(const MineCorridor &data, DataModifica { Q_UNUSED(modType); - DEBUG_LOG() << "\n#################################" + DEBUG_LOG(m_logger) << "\n#################################" << "\n##### mine corridor changed #####" << "\n#################################" << "\nid: " << data.id() @@ -435,7 +435,7 @@ void AesHandler::onAesNContaminationChanged(const NContamination &data, DataModi Q_UNUSED(modType); m_ngsHandler->ngsConnector()->guezNuclearAgent(data); - DEBUG_LOG() << "\n####################################" + DEBUG_LOG(m_logger) << "\n####################################" << "\n##### n contamination changed #####" << "\n####################################" << "\nid: " << data.id() @@ -458,7 +458,7 @@ void AesHandler::onAesBCContaminationChanged(const BCContamination &data, DataMo Q_UNUSED(modType); m_ngsHandler->ngsConnector()->guezChemicalAgent(data); - DEBUG_LOG() << "\n####################################" + DEBUG_LOG(m_logger) << "\n####################################" << "\n##### bc contamination changed #####" << "\n####################################" << "\nid: " << data.id() @@ -563,7 +563,7 @@ void AesHandler::onAesRemoveItem(qint64 identifierInt) AesType type = m_dtcAes->aesItemIdFromExternalId(identifierInt, aesItemId); Core::RemoveElementRequest req(aesItemId); - DEBUG_LOG() << "Remove Item for " << aesItemId << " requested. Type: " << type; + DEBUG_LOG(m_logger) << "Remove Item for " << aesItemId << " requested. Type: " << type; switch (type.underlying()) { @@ -647,11 +647,11 @@ void AesHandler::onAesActivationTimeChanged(qint64 identifierInt, qint64 msecsSi } case AreaEffectSimulation::AesType_def::AtMineArea: { - DEBUG_LOG() << "onAesActivationTimeChanged / MineArea"; + DEBUG_LOG(m_logger) << "onAesActivationTimeChanged / MineArea"; MineAreaModifyRequest *req = static_cast(m_pendingRequests.value(aesItemId)); if (!req) { - DEBUG_LOG() << "onAesActivationTimeChanged / MineArea - Request NOT found"; + DEBUG_LOG(m_logger) << "onAesActivationTimeChanged / MineArea - Request NOT found"; AreaEffectSimulation::MineArea item = m_dtcAes->mineArea(aesItemId); if ((item.effectStart().is_set() && item.effectStart().get() == msecsSinceEpoch) || !isModifiable(item)) return; @@ -958,7 +958,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector< int aesItemId = 0; AesType type = m_dtcAes->aesItemIdFromExternalId(identifierInt, aesItemId); - DEBUG_LOG() << "Points Data changed for Aes Item ID: " << aesItemId << ". Type: " << type; + DEBUG_LOG(m_logger) << "Points Data changed for Aes Item ID: " << aesItemId << ". Type: " << type; switch (type.underlying()) { @@ -980,7 +980,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector< std::vector segments; if (!getCorridorSegment(pos, segments, width)) { - ERROR_LOG() << "Could not calculate Mine Area from given Points Data!"; + ERROR_LOG(m_logger) << "Could not calculate Mine Area from given Points Data!"; return; } req->segments(segments); @@ -1003,7 +1003,7 @@ void AesHandler::onAesPointsDataChanged(qint64 identifierInt, const std::vector< std::vector segments; if (!getCorridorSegment(pos, segments, width)) { - ERROR_LOG() << "Could not calculate Mine Area from given Points Data!"; + ERROR_LOG(m_logger) << "Could not calculate Mine Area from given Points Data!"; return; } req->segments(segments); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h index a056503eb..f806d1f48 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/aes_handler.h @@ -87,6 +87,7 @@ private Q_SLOTS: #endif private: + NGL::INGLLogger &m_logger; template void onSendRequest(const T &item); template @@ -94,6 +95,7 @@ private: static bool isModifiable(const AreaEffectSimulation::AesItem &item); private: + NGL::INGLLogger &m_logger; NgsHandler *m_ngsHandler; std::shared_ptr m_dtcAes; std::shared_ptr m_ftcAes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.cpp index cffb46124..4434de37b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.cpp @@ -9,11 +9,10 @@ namespace HighLevelArchitecture { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) - , m_hlaIsActive(false) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) + , m_hlaIsActive(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -27,7 +26,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.h index bc629ddf8..b8424120d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/dds_handler.h @@ -33,8 +33,10 @@ public: Q_SIGNALS: void exerciseHlaStateChanged(bool bHlaEnabled); private: + NGL::INGLLogger &m_logger; void onExerciseChanged(const ExerciseManagement::Exercise &ex, DataModification modType); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_dtcExm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.cpp index 7c6539f4d..23ee905b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.cpp @@ -15,10 +15,9 @@ namespace HighLevelArchitecture { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) - , m_exerciseId(0) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent) + , m_exerciseId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -34,7 +33,7 @@ bool MainHandler::init(int domainId, int exerciseId) m_ddsHandler = std::make_shared(domainId, exerciseId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Could not init DDS handler"; + ERROR_LOG(m_logger) << "Could not init DDS handler"; return false; } connect(m_ddsHandler.get(), &DdsHandler::exerciseHlaStateChanged, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.h index dfcb93b55..d8e7fbae0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/main_handler.h @@ -26,6 +26,7 @@ public: private Q_SLOTS: void onExerciseHlaStateChanged(bool bHlaEnabled); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_ngsHandler; std::shared_ptr m_wsHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.cpp index 2f3aafe7d..dbf4763ce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.cpp @@ -134,8 +134,7 @@ static inline rpr2::EnvironmentObjectTypeStruct dummyEOS() -NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) - : m_ngsHandler(ngsHandler) +NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) : m_ngsHandler(ngsHandler) , m_fedName(fedName) , m_swadmin(&ngs::SimulatedWorldAPI::getSimulatedWorldAdmin()) , m_master(nullptr) @@ -154,8 +153,8 @@ NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) , m_requestBiteReportCallback(new ObserverGuezRequestBiteReportCBNotifier()) , m_bInitialized(false) , m_bCanPublishData(false) - , m_timer(new QTimer(this)) -{ + , m_timer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_timer, &QTimer::timeout, this, &NgsConnector::go); connect(m_playerCallback, &PlayerCallback::firstTick, @@ -234,7 +233,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const ngs::NGSSimWorldException &e) { - ERROR_LOG() << "caught exception during init (getIFederationMaster): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (getIFederationMaster): " << e.print(); return false; } @@ -249,7 +248,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const NGSException &e) { - ERROR_LOG() << "caught exception during init (createFederation): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (createFederation): " << e.print(); return false; } player = &m_swadmin->getIPlayer(m_fedName.toStdString(), playerName.toStdString(), *m_playerCallback, Settings::swConfFileName().toLatin1().data(), Settings::fomIdentifier().toStdString(), Settings::rtiIdentifier().toStdString()); @@ -299,27 +298,27 @@ void NgsConnector::subscribeAtNgs() m_enitityNumberCounter = 1; m_eventCount = 1; - INFO_LOG() << "Subscribe at NGS - Guez Human Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez Human Objects"; rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback); humanObjClass.subscribeAllAttributes(); humanObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez ObserverController Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez ObserverController Objects"; rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback); observerControllerObjClass.subscribeAllAttributes(); observerControllerObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez GroundVehicle Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez GroundVehicle Objects"; rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.subscribeAllAttributes(); groundVehicleObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez MineField Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Objects"; rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback); minefieldObjClass.subscribeAllAttributes(); minefieldObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez MineField Breach Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Breach Objects"; rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback); minefieldBreachObjClass.subscribeAllAttributes(); minefieldBreachObjClass.subscribe(); @@ -355,23 +354,23 @@ void NgsConnector::unsubscribeFromNgs() if (m_somPlayer) { - INFO_LOG() << "Unsubscribe at NGS - Guez Human Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez Human Objects"; rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback); humanObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez ObserverController Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez ObserverController Objects"; rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback); observerControllerObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez GroundVehicle Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez GroundVehicle Objects"; rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez MineField Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Objects"; rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback); minefieldObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez MineField Breach Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Breach Objects"; rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback); minefieldBreachObjClass.unsubscribe(); } @@ -1097,11 +1096,11 @@ void NgsConnector::go() } catch (const NGSException &ex) { - ERROR_LOG() << "NGS Exception caught in Event Loop" << ex.print(); + ERROR_LOG(m_logger) << "NGS Exception caught in Event Loop" << ex.print(); } catch (const std::exception &e) { - ERROR_LOG() << "Standard Exception caught in Event Loop: " << e.what(); + ERROR_LOG(m_logger) << "Standard Exception caught in Event Loop: " << e.what(); } catch (...) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.h index b273b43f9..915315ab9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_connector.h @@ -284,6 +284,7 @@ signals: void newMinefieldBreach(AreaEffectSimulation::MineCorridorModifyRequest &mc); protected: + NGL::INGLLogger &m_logger; void subscribeAtNgs(); void unsubscribeFromNgs(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.cpp index 3a15d1a81..634edc64e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.cpp @@ -12,10 +12,9 @@ namespace HighLevelArchitecture { -NgsHandler::NgsHandler(QObject *parent) - : QObject(parent) - , m_ddsHandler(nullptr) -{} +NgsHandler::NgsHandler(QObject *parent) : QObject(parent) + , m_ddsHandler(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} NgsHandler::~NgsHandler() { @@ -37,7 +36,7 @@ bool NgsHandler::init(const std::shared_ptr &ddsHandler) ngs::IObserver::ProtocolType protocol = Settings::hlaProtocol(); - INFO_LOG() << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); + INFO_LOG(m_logger) << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); m_ngsConnector = @@ -59,9 +58,9 @@ void NgsHandler::onFirstTickFinished() m_ppmHandler = std::make_shared(this); m_aesHandler = std::make_shared(this); if (!m_ppmHandler->init()) - ERROR_LOG() << "Could not init ppm handler - not able to publish participants to HLA"; + ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish participants to HLA"; if (!m_aesHandler->init()) - ERROR_LOG() << "Could not init ppm handler - not able to publish area effect simulations to HLA"; + ERROR_LOG(m_logger) << "Could not init ppm handler - not able to publish area effect simulations to HLA"; emit firstTickFinished(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.h index 7234bd47d..65d9b40ac 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ngs_handler.h @@ -42,6 +42,7 @@ Q_SIGNALS: private slots: void onFirstTickFinished(); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_ppmHandler; std::shared_ptr m_aesHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.cpp index 46fae0dc6..61bc54536 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.cpp @@ -81,7 +81,7 @@ bool PpmHandler::init() m_dtsTab->enableEquipmentBite()) ) { - ERROR_LOG() << "Enabling TAB DTS Data-Topics failed."; + ERROR_LOG(m_logger) << "Enabling TAB DTS Data-Topics failed."; return false; } @@ -176,7 +176,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy int equipmentNo = getEquipmentNo(data.participantId()); if (equipmentNo == 0) { - ERROR_LOG() << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA."; + ERROR_LOG(m_logger) << "Could not find EquipmentNo for Participant " << data.participantId() << ". Cannot send Dynamic Participant Data Modification to HLA."; return; } @@ -255,7 +255,7 @@ void PpmHandler::onDynamicParticipantDataChanged(const ParticipantManagement::Dy void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType) { - DEBUG_LOG() << "onParticipantChanged: " << data; + DEBUG_LOG(m_logger) << "onParticipantChanged: " << data; switch (modType) { case DataModification::eAdded: @@ -337,7 +337,7 @@ void PpmHandler::onParticipantChanged(const ParticipantManagement::Participant & void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::ParticipantPosition &data, DataModification modType) { - DEBUG_LOG() << "onParticipantPositionChanged: " << data; + DEBUG_LOG(m_logger) << "onParticipantPositionChanged: " << data; switch (modType) { case DataModification::eAdded: @@ -446,7 +446,7 @@ void PpmHandler::onEquipmentBiteChanged(const TrainingAreaBase::EquipmentBite &d void PpmHandler::startPublishToNgs() { - INFO_LOG() << "Recreating all players from scratch due to structure / exercise change"; + INFO_LOG(m_logger) << "Recreating all players from scratch due to structure / exercise change"; m_createdParticipantIds.clear(); @@ -455,7 +455,7 @@ void PpmHandler::startPublishToNgs() - INFO_LOG() << "(Re)Adding all players, size: " << m_partData.size(); + INFO_LOG(m_logger) << "(Re)Adding all players, size: " << m_partData.size(); for (const ParticipantManagement::Participant &participant : std::as_const(m_partData)) createParticipant(participant); @@ -479,7 +479,7 @@ void PpmHandler::createParticipant(const ParticipantManagement::Participant &par if (!m_ngsHandler->ngsConnector()->canPublishData()) { - WARNING_LOG() << "Can not publish data ... :("; + WARNING_LOG(m_logger) << "Can not publish data ... :("; return; } @@ -1002,7 +1002,7 @@ bool PpmHandler::onExconInit(int eqNo, rpr2::ResetPlayerEnum8::ET rp, rpr2::Acti bool PpmHandler::onBiteReport(const TrainingAreaBase::EquipmentBite &report) { - DEBUG_LOG() << "Attempting to Forward Bite Report to DDS. dtsTab: " << m_dtsTab << ", report for EqId: " << report.equipmentNumber(); + DEBUG_LOG(m_logger) << "Attempting to Forward Bite Report to DDS. dtsTab: " << m_dtsTab << ", report for EqId: " << report.equipmentNumber(); if (!m_dtsTab) return false; return m_dtsTab->publish(report); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.h index 092caa164..d9d14207c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/ppm_handler.h @@ -89,6 +89,7 @@ public slots: void participantBiteRequest(const TrainingAreaBase::TetraIcd::DemandBite &request); private: + NGL::INGLLogger &m_logger; void createParticipant(const ParticipantManagement::Participant &participant); bool createHuman(const ParticipantManagement::Participant &participant); bool createGroundVehicle(const ParticipantManagement::Participant &participant); @@ -110,6 +111,7 @@ private: TypeStruct getTypestruct(int typeId); private: + NGL::INGLLogger &m_logger; NgsHandler *m_ngsHandler; std::shared_ptr m_dtcPpm; std::shared_ptr m_ftcPpm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.cpp index d6830d4e9..145894ec7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.cpp @@ -17,6 +17,6 @@ void ObserverGuezBiteReportCBNotifier::newGuezBiteReportIntInstance(const rpr2:: void ObserverGuezBiteReportCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.h index 97ea7951c..8d87de697 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_bitereport.h @@ -23,6 +23,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newGuezBiteReport(const rpr2::IObserverGuezBiteReportIntInstance &action); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.cpp index 9df89b90d..3c4602aa5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.cpp @@ -17,6 +17,6 @@ void ObserverGuezExconEngagementCBNotifier::newGuezExconEngagementIntInstance(co void ObserverGuezExconEngagementCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.h index 0179a2511..f380c08f9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_exconengagement.h @@ -23,6 +23,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newGuezExconEngagement(const rpr2::IObserverGuezExconEngagementIntInstance &action); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.cpp index 4661b25be..c336069e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.cpp @@ -18,6 +18,6 @@ void ObserverGuezHitCBNotifier::newGuezHitIntInstance(const rpr2::IObserverGuezH void ObserverGuezHitCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.h index fc26dfa2f..8b51bc2a6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_hit.h @@ -23,6 +23,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newGuezHit(const rpr2::IObserverGuezHitIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.cpp index eb88dc143..bf97aaac7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.cpp @@ -17,6 +17,6 @@ void ObserverGuezInitCBNotifier::newGuezInitIntInstance(const rpr2::IObserverGue void ObserverGuezInitCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.h index 396ea963f..04a07f14f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_init.h @@ -23,6 +23,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newGuezInit(const rpr2::IObserverGuezInitIntInstance &action); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.cpp index 4110428b8..fb0759e88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.cpp @@ -17,6 +17,6 @@ void ObserverGuezRequestBiteReportCBNotifier::newGuezRequestBiteReportIntInstanc void ObserverGuezRequestBiteReportCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.h index ef0905e61..8defab082 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_guez_requestbitereport.h @@ -23,6 +23,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newGuezRequestBiteReport(const rpr2::IObserverGuezRequestBiteReportIntInstance &action); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.cpp index ba944fb85..34c0849a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.cpp @@ -17,6 +17,6 @@ void ObserverMunitionDetonationCBNotifier::newMunitionDetonationIntInstance(cons void ObserverMunitionDetonationCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.h index 0528e2e22..d7170ca95 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_munitiondetonation.h @@ -24,6 +24,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newMunitionDetonation(const rpr2::IObserverMunitionDetonationIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.cpp index 03c2aa975..2f4dce195 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.cpp @@ -23,6 +23,6 @@ void ObserverWeaponFireCBNotifier::newWeaponFireIntInstance(const rpr2::IObserve void ObserverWeaponFireCBNotifier::deleteInterface() { - DEBUG_LOG() << "Delete Interface"; + DEBUG_LOG(m_logger) << "Delete Interface"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.h index be317f4f7..b26d4d149 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_ia_weaponfire.h @@ -25,6 +25,8 @@ public: void deleteInterface() override; protected: + +NGL::INGLLogger &m_logger; signals: void newWeaponFire(const rpr2::IObserverWeaponFireIntInstance &interaction); }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_observer_object_instance_cb.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_observer_object_instance_cb.h index e0b9acdf1..aa64ffbad 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_observer_object_instance_cb.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/rpr/rpr_observer_object_instance_cb.h @@ -25,7 +25,7 @@ public: void deleteObjectInstance() override { - DEBUG_LOG() << "deleteObjectInstance"; + DEBUG_LOG(m_logger) << "deleteObjectInstance"; if (m_pCB && m_pIObject) m_pCB->deleteObjectInstance(*m_pIObject); delete this; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.cpp index ddf4f57d7..359194695 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.cpp @@ -15,12 +15,11 @@ namespace HighLevelArchitecture { -WebSocketHandler::WebSocketHandler(int exerciseId, MainHandler *mainHandler, QObject *parent) - : QObject(parent) +WebSocketHandler::WebSocketHandler(int exerciseId, MainHandler *mainHandler, QObject *parent) : QObject(parent) , m_webSocketServer(new QWebSocketServer(QStringLiteral("WLS"), QWebSocketServer::NonSecureMode, this)) , m_mainHandler(mainHandler) - , m_exerciseId(exerciseId) -{} + , m_exerciseId(exerciseId), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} WebSocketHandler::~WebSocketHandler() { @@ -32,7 +31,7 @@ bool WebSocketHandler::init(quint16 listenPort) { if (!m_webSocketServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting"; + WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting"; return false; } connect(m_webSocketServer, &QWebSocketServer::newConnection, @@ -51,7 +50,7 @@ bool WebSocketHandler::sendTelegramInternal(const TrainingAreaBase::TetraIcd::Tr const QString jsonStr = QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact)); - DEBUG_LOG() << "jsonStr: " << jsonStr; + DEBUG_LOG(m_logger) << "jsonStr: " << jsonStr; bool bOk = false; for (const auto &wsw : std::as_const(m_webSockets)) @@ -68,12 +67,12 @@ void WebSocketHandler::sendHlaConnectionState() TrainingAreaBase::TetraIcd::ProxyConnectionState connState; connState.connectedToSystem = m_mainHandler->isConnectedToHla(); sendTelegram(&connState, m_exerciseId); - DEBUG_LOG() << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem; + DEBUG_LOG(m_logger) << "sendHlaConnectionState, isConnected: " << connState.connectedToSystem; } void WebSocketHandler::sendParticipantConnectionStates() { - DEBUG_LOG() << "sendParticipantConnectionStates"; + DEBUG_LOG(m_logger) << "sendParticipantConnectionStates"; TrainingAreaBase::TetraIcd::WlsParticipantsConnectionState partConnState; partConnState.equipmentNumber = -1; partConnState.dataCommunicationPossible = false; @@ -81,7 +80,7 @@ void WebSocketHandler::sendParticipantConnectionStates() if (!m_mainHandler->isConnectedToHla()) { - INFO_LOG() << "We are (not) yet connected to HLA - don't send participant connection states"; + INFO_LOG(m_logger) << "We are (not) yet connected to HLA - don't send participant connection states"; return; } const auto externalEquipmentNumbers = m_mainHandler->ngsHandler()->ppmHandler()->externalEquipmentNumbers(); @@ -117,7 +116,7 @@ void WebSocketHandler::onNewConnection() QWebSocket *ws = m_webSocketServer->nextPendingConnection(); if (!ws) return; - DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); + DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); auto wsw = std::make_shared(ws); connect(wsw.get(), &WebSocketWrapper::textMessageReceived, @@ -132,11 +131,11 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) { using namespace TrainingAreaBase::TetraIcd; - TRACE_LOG() << "WebSocketHandler::onTextMessageReceived: " << baJson; + TRACE_LOG(m_logger) << "WebSocketHandler::onTextMessageReceived: " << baJson; WebSocketWrapper *wsw = qobject_cast(sender()); if (!wsw) { - ERROR_LOG() << "Internal error - sender is no WebSocketWrapper"; + ERROR_LOG(m_logger) << "Internal error - sender is no WebSocketWrapper"; return; } @@ -156,7 +155,7 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -185,14 +184,14 @@ void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) emit vulnerabilityStateRequest(DemandVulnerabilityStateChange::fromJson(data)); break; default: - WARNING_LOG() << "Handler for telegram Id " << typeId.toInt() + WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt() << " not yet implemented (" << baJson << ")"; return; } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.h index e51febb05..d72b74e1d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Guez/web_socket_handler.h @@ -53,6 +53,7 @@ public Q_SLOTS: void onExternalEquipmentNumberRemoved(int equipNo); private: + NGL::INGLLogger &m_logger; void sendDataCommunicationState(int equipNo, bool bIsAvailable); bool sendTelegramInternal(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, const QString &type, int exerciseId); @@ -61,6 +62,7 @@ private Q_SLOTS: void onWebSocketDisconnected(); void onTextMessageReceived(const QByteArray &baJson); private: + NGL::INGLLogger &m_logger; QWebSocketServer *m_webSocketServer; QVector> m_webSockets; MainHandler *m_mainHandler; @@ -84,6 +86,7 @@ Q_SIGNALS: private Q_SLOTS: void onTextMessageReceived(const QString &data); private: + NGL::INGLLogger &m_logger; QWebSocket *m_webSocket; int m_exerciseId; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.cpp index 2327abdb3..f7fd91c7a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.cpp @@ -15,10 +15,9 @@ namespace HighLevelArchitecture { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) - , m_exerciseId(0) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent) + , m_exerciseId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -50,7 +49,7 @@ bool MainHandler::init(int exerciseId) int port = 23456; if (!m_wsInterface->init(port)) { - ERROR_LOG() << Q_FUNC_INFO + ERROR_LOG(m_logger) << Q_FUNC_INFO << " WsInterface::init failed on port: " << port; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.h index 3c3efce2a..aa0120473 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/main_handler.h @@ -27,6 +27,7 @@ public: private Q_SLOTS: private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ngsHandler; std::shared_ptr m_wsInterface; int m_exerciseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.cpp index 5f5ecd235..ef18d9ecc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.cpp @@ -130,8 +130,7 @@ static inline rpr2::EnvironmentObjectTypeStruct dummyEOS() -NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) - : m_ngsHandler(ngsHandler) +NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) : m_ngsHandler(ngsHandler) , m_fedName(fedName) , m_swadmin(&ngs::SimulatedWorldAPI::getSimulatedWorldAdmin()) , m_master(nullptr) @@ -150,8 +149,8 @@ NgsConnector::NgsConnector(const QString &fedName, NgsHandler *ngsHandler) , m_requestBiteReportCallback(new ObserverGuezRequestBiteReportCBNotifier()) , m_bInitialized(false) , m_bCanPublishData(false) - , m_timer(new QTimer(this)) -{ + , m_timer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_timer, &QTimer::timeout, this, &NgsConnector::go); connect(m_playerCallback, &PlayerCallback::firstTick, @@ -230,7 +229,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const ngs::NGSSimWorldException &e) { - ERROR_LOG() << "caught exception during init (getIFederationMaster): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (getIFederationMaster): " << e.print(); return false; } @@ -245,7 +244,7 @@ bool NgsConnector::initialize(ngs::IObserver::ProtocolType protocol, const QStri } catch (const NGSException &e) { - ERROR_LOG() << "caught exception during init (createFederation): " << e.print(); + ERROR_LOG(m_logger) << "caught exception during init (createFederation): " << e.print(); return false; } player = &m_swadmin->getIPlayer(m_fedName.toStdString(), playerName.toStdString(), *m_playerCallback, Settings::swConfFileName().toLatin1().data(), Settings::fomIdentifier().toStdString(), Settings::rtiIdentifier().toStdString()); @@ -295,27 +294,27 @@ void NgsConnector::subscribeAtNgs() m_enitityNumberCounter = 1; m_eventCount = 1; - INFO_LOG() << "Subscribe at NGS - Guez Human Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez Human Objects"; rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback); humanObjClass.subscribeAllAttributes(); humanObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez ObserverController Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez ObserverController Objects"; rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback); observerControllerObjClass.subscribeAllAttributes(); observerControllerObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez GroundVehicle Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez GroundVehicle Objects"; rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.subscribeAllAttributes(); groundVehicleObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez MineField Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Objects"; rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback); minefieldObjClass.subscribeAllAttributes(); minefieldObjClass.subscribe(); - INFO_LOG() << "Subscribe at NGS - Guez MineField Breach Objects"; + INFO_LOG(m_logger) << "Subscribe at NGS - Guez MineField Breach Objects"; rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback); minefieldBreachObjClass.subscribeAllAttributes(); minefieldBreachObjClass.subscribe(); @@ -351,23 +350,23 @@ void NgsConnector::unsubscribeFromNgs() if (m_somPlayer) { - INFO_LOG() << "Unsubscribe at NGS - Guez Human Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez Human Objects"; rpr2::IObserverGuezHumanObjClass &humanObjClass = m_somPlayer->getObserverGuezHumanObjClass(*m_humanCallback); humanObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez ObserverController Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez ObserverController Objects"; rpr2::IObserverGuezObserverControllerObjClass &observerControllerObjClass = m_somPlayer->getObserverGuezObserverControllerObjClass(*m_observerControllerCallback); observerControllerObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez GroundVehicle Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez GroundVehicle Objects"; rpr2::IObserverGuezGroundVehicleObjClass &groundVehicleObjClass = m_somPlayer->getObserverGuezGroundVehicleObjClass(*m_groundVehicleCallback); groundVehicleObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez MineField Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Objects"; rpr2::IObserverGuezMineFieldObjClass &minefieldObjClass = m_somPlayer->getObserverGuezMineFieldObjClass(*m_minefieldCallback); minefieldObjClass.unsubscribe(); - INFO_LOG() << "Unsubscribe at NGS - Guez MineField Breach Objects"; + INFO_LOG(m_logger) << "Unsubscribe at NGS - Guez MineField Breach Objects"; rpr2::IObserverGuezMineFieldBreachObjClass &minefieldBreachObjClass = m_somPlayer->getObserverGuezMineFieldBreachObjClass(*m_minefieldBreachCallback); minefieldBreachObjClass.unsubscribe(); } @@ -777,11 +776,11 @@ void NgsConnector::go() } catch (const NGSException &ex) { - ERROR_LOG() << "NGS Exception caught in Event Loop" << ex.print(); + ERROR_LOG(m_logger) << "NGS Exception caught in Event Loop" << ex.print(); } catch (const std::exception &e) { - ERROR_LOG() << "Standard Exception caught in Event Loop: " << e.what(); + ERROR_LOG(m_logger) << "Standard Exception caught in Event Loop: " << e.what(); } catch (...) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.h index 6f9af4088..a2d353d69 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_connector.h @@ -283,6 +283,7 @@ signals: void newMinefieldBreach(AreaEffectSimulation::MineCorridorModifyRequest &mc); protected: + NGL::INGLLogger &m_logger; void subscribeAtNgs(); void unsubscribeFromNgs(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.cpp index 2330370f9..ccf5a0c9d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.cpp @@ -17,9 +17,8 @@ namespace HighLevelArchitecture { -NgsHandler::NgsHandler(QObject *parent) - : QObject(parent) -{} +NgsHandler::NgsHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} NgsHandler::~NgsHandler() { @@ -36,7 +35,7 @@ bool NgsHandler::init() if (myVec < myVec2) { - INFO_LOG() << "Protocol = "; + INFO_LOG(m_logger) << "Protocol = "; } @@ -50,7 +49,7 @@ bool NgsHandler::init() ngs::IObserver::ProtocolType protocol = Settings::hlaProtocol(); - INFO_LOG() << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); + INFO_LOG(m_logger) << "Protocol = " << protToStr.value(protocol, QStringLiteral("UNKNOWN")); m_ngsConnector = diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.h index 69866fefa..d19ba79bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/ngs_handler.h @@ -37,6 +37,7 @@ Q_SIGNALS: private slots: void onFirstTickFinished(); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ngsConnector; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.cpp index 228fe02bb..7cfee8add 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.cpp @@ -19,26 +19,25 @@ namespace HighLevelArchitecture -WsInterface::WsInterface(std::shared_ptr ngsHandler, QObject *parent) - : QObject(parent) +WsInterface::WsInterface(std::shared_ptr ngsHandler, QObject *parent) : QObject(parent) , m_wsServer(new QWebSocketServer(QStringLiteral("GNA"), QWebSocketServer::NonSecureMode, this)) , m_ngsHandler(ngsHandler) - .getNGLLogger("HlaTestTool.WsInterface")) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + .getNGLLogger("HlaTestTool.WsInterface")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } WsInterface::~WsInterface() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; for (auto client : std::as_const(m_clients)) { client->disconnect(this); client->close(); } qDeleteAll(m_clients); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool WsInterface::init(quint16 listenPort) @@ -50,14 +49,14 @@ bool WsInterface::init(quint16 listenPort) if (!m_wsServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Cannot listen on port " << listenPort << " - aborting"; + WARNING_LOG(m_logger) << "Cannot listen on port " << listenPort << " - aborting"; return false; } - DEBUG_LOG() << "Listening on port " << listenPort; + DEBUG_LOG(m_logger) << "Listening on port " << listenPort; connect(m_wsServer, &QWebSocketServer::newConnection, this, &WsInterface::onNewConnection); - TRACE_LOG() << Q_FUNC_INFO << " END, listenPort=" << listenPort; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, listenPort=" << listenPort; return true; } @@ -79,19 +78,19 @@ void WsInterface::onNewConnection() void WsInterface::onWebSocketDisconnected() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; QWebSocket *ws = qobject_cast(sender()); if (!ws) return; NOTICE_LOG(m_logger) << "Websocket connection closed, ptr: " << ws; m_clients.remove(ws); ws->deleteLater(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void WsInterface::onError(QAbstractSocket::SocketError error) { - ERROR_LOG() << Q_FUNC_INFO << " Error occured, QAbstractSocket::SocketError = " << error; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Error occured, QAbstractSocket::SocketError = " << error; } void WsInterface::onTextMessageReceived(const QString &msg) @@ -100,15 +99,15 @@ void WsInterface::onTextMessageReceived(const QString &msg) if (msg.isEmpty()) { - ERROR_LOG() << "Empty message received"; + ERROR_LOG(m_logger) << "Empty message received"; return; } - DEBUG_LOG() << "incoming telegram: " << msg; + DEBUG_LOG(m_logger) << "incoming telegram: " << msg; const QByteArray baJson = msg.toUtf8(); processMessage(baJson); - DEBUG_LOG() << Q_FUNC_INFO << " END"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " END"; } void WsInterface::processMessage(const QByteArray baJson) @@ -120,7 +119,7 @@ void WsInterface::processMessage(const QByteArray baJson) if (parseError.error != QJsonParseError::NoError) { - ERROR_LOG() << "Could not parse JSON " + ERROR_LOG(m_logger) << "Could not parse JSON " << ". Reason: " << parseError.errorString() << "; baJson: '" @@ -156,7 +155,7 @@ void WsInterface::processMessage(const QByteArray baJson) } catch (const JsonException &ex) { - ERROR_LOG() << "Could not parse json telegram: " + ERROR_LOG(m_logger) << "Could not parse json telegram: " << ", error: " << ex.what(); } break; @@ -176,7 +175,7 @@ void WsInterface::processMessage(const QByteArray baJson) } catch (const JsonException &ex) { - ERROR_LOG() << "Could not parse json telegram: " + ERROR_LOG(m_logger) << "Could not parse json telegram: " << ", error: " << ex.what(); return; } @@ -206,7 +205,7 @@ void WsInterface::processMessage(const QByteArray baJson) } catch (const JsonException &ex) { - ERROR_LOG() << "Could not parse json telegram: " + ERROR_LOG(m_logger) << "Could not parse json telegram: " << ", error: " << ex.what(); return; } @@ -219,7 +218,7 @@ void WsInterface::processMessage(const QByteArray baJson) default: { - ERROR_LOG() << "Telegram with typeId '" << typeId << "' not handled in switch" + ERROR_LOG(m_logger) << "Telegram with typeId '" << typeId << "' not handled in switch" << ", doc= " << doc.toJson(QJsonDocument::Compact) << "<<<"; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.h index 753002ac0..6eaed0451 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/HighLevelArchitecture/Hla_test_tool/web_socket_interface.h @@ -33,6 +33,8 @@ public: signals: private: + +NGL::INGLLogger &m_logger; QWebSocketServer *m_wsServer; QSet m_clients; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp index a687683fa..96acf575e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp @@ -47,24 +47,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher) if (!m_ftcAes->enableAirSupportImpactModify() || !m_dtcAes->enableExplosionSingle()) { - ERROR_LOG() << "Can not enableAirSupportImpactModify or enableExplosionSingle"; + ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify or enableExplosionSingle"; } if (!m_dtcAes->enableExplosionCluster() || !m_ftcAes->enableExplosionClusterModify() || !m_ftcAes->enableExplosionClusterReleaseReceived() || !m_ftcAes->enableExplosionClusterPauseResume() || !m_ftcAes->enableTrajectoryAdlerModify() || !m_ftcAes->enableEffectClusterFireHalt()) { - ERROR_LOG() << "Can not enableExplosionCluster or enableExplosionClusterModify"; + ERROR_LOG(m_logger) << "Can not enableExplosionCluster or enableExplosionClusterModify"; } if (!m_dtcAes->enableEffectCluster() || !m_ftcAes->enableEffectClusterModify() || !m_ftcAes->enableEffectClusterReleaseReceived() || !m_ftcAes->enableEffectClusterPauseResume() || !m_ftcAes->enableEffectClusterRemove()) { - ERROR_LOG() << "Can not enableEffectnCluster or enableEffectClusterModify"; + ERROR_LOG(m_logger) << "Can not enableEffectnCluster or enableEffectClusterModify"; } - DEBUG_LOG() << "------ Connect Explosion Single Changed ------- "; + DEBUG_LOG(m_logger) << "------ Connect Explosion Single Changed ------- "; connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::explosionSingleChanged, this, &AesHandler::onExplosionSingleChanged); connect(m_dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::effectClusterChanged, this, &AesHandler::onEffectClusterChanged); @@ -73,24 +73,24 @@ bool AesHandler::init(MainDispatcher *mainDispatcher) void AesHandler::onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onOffRouteMineModifyReply" + DEBUG_LOG(m_logger) << "onOffRouteMineModifyReply" << ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated(); }; void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onEffectClusterModifyReply" + DEBUG_LOG(m_logger) << "onEffectClusterModifyReply" << ", replyObject.id :" << replyObject.id() << ", str :" << replyObject.str() << ", tanslated :" << replyObject.translated() << ", additinal Info :" << replyObject.additionalInfo(); m_requestHelper->requestReply(replyObject); - DEBUG_LOG() << "Got Reply"; + DEBUG_LOG(m_logger) << "Got Reply"; if (replyObject.error()) { - DEBUG_LOG() << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated(); + DEBUG_LOG(m_logger) << "Got onEffectClusterModifyReply ERROR: " << replyObject.translated(); ExTqTechnischeQuittung extq; extq.technischeDaten.beschreibung = replyObject.translated(); extq.technischeDaten.status = Status_L32::DAT; @@ -100,11 +100,11 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep } QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object(); - ERROR_LOG() << "Try send notification0"; + ERROR_LOG(m_logger) << "Try send notification0"; m_aesId = replyObject.id(); ProjectDataManagement::EffectSource effectSource = static_cast(propertiesObject.value(QStringLiteral("effectSource")).toInt()); - ERROR_LOG() << "Try send notification1 " << effectSource; + ERROR_LOG(m_logger) << "Try send notification1 " << effectSource; if (effectSource != ProjectDataManagement::EffectSource::ES_ADLER) return; @@ -181,14 +181,14 @@ void AesHandler::onEffectClusterModifyReply(const Core::FunctionReplyObject &rep m_mainDispatcher->ddsHandler()->ftcNom()->createNotificationRequest(req, this); } else - WARNING_LOG() << "No recipent found for exercise"; + WARNING_LOG(m_logger) << "No recipent found for exercise"; } void AesHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Got onCreateNotificationReply ERROR: " << replyObject.translated(); + ERROR_LOG(m_logger) << "Got onCreateNotificationReply ERROR: " << replyObject.translated(); } bool AesHandler::sendAesModifyRequest(const QJsonObject &data) @@ -247,7 +247,7 @@ void AesHandler::handleCreateSingleExplosion(const TrainingAreaBase::TetraIcd::C { auto strFromObj = QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact); m_singleExplosions.insert(data.aesDdsId, AreaEffectSimulation::AesEffectState_def::EsCreated); - DEBUG_LOG() << "TEST SINGLE EXPLOSION CREATED " << strFromObj; + DEBUG_LOG(m_logger) << "TEST SINGLE EXPLOSION CREATED " << strFromObj; } void AesHandler::handleEXFire(const Feuerkampfdaten &data, int wsId) @@ -280,7 +280,7 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId) const auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId); - DEBUG_LOG() << "[EX-FQ(nFN)] data from SSA " << wsId << " : " + DEBUG_LOG(m_logger) << "[EX-FQ(nFN)] data from SSA " << wsId << " : " << "verein: " << data.verein << " " << "kenner: " << data.kenner.underlying() << " " << "feuerkampfReferenz: " << data.feuerkampfReferenz; @@ -295,18 +295,18 @@ void AesHandler::handleEXDontFire(const Feuerkampfdaten &data, int wsId) void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "onTrajectoryAdlerModifyReply" + DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply" << ", aesId :" << reply.id() << ", str :" << reply.str() << ", m_wirkmittelIndex :" << m_wirkmittelIndex << ", m_data.feuerkommando.wirkmittel.size() :" << m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size(); if (reply.error()) - ERROR_LOG() << reply.translated(); + ERROR_LOG(m_logger) << reply.translated(); if (m_wirkmittelIndex == m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1) { - DEBUG_LOG() << "TAB->SAA EX-MQ" + DEBUG_LOG(m_logger) << "TAB->SAA EX-MQ" << ", feuerkampfReferenz :" << m_wirkfeldPlanungsData.feuerkampfReferenz; - DEBUG_LOG() << "onTrajectoryAdlerModifyReply " << reply.id(); + DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply " << reply.id(); ExFeuerbereit exFB; exFB.feuerkampfdaten.feuerkampfReferenz = m_wirkfeldPlanungsData.feuerkampfReferenz; @@ -318,7 +318,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r if (m_wirkmittelIndex < m_wirkfeldPlanungsData.feuerkommando.wirkmittel.size() - 1) { m_wirkmittelIndex++; - DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest" + DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest" << ", m_participantId :" << m_participantId << ", m_wirkmittelIndex :" << m_wirkmittelIndex << ", m_aesId :" << m_aesId; sendTrajectoryAdlerModifyRequest(m_wirkfeldPlanungsData, m_participantId, m_wirkmittelIndex, m_aesId); } @@ -327,7 +327,7 @@ void AesHandler::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &r void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &data, int participantId, int wirkmittelIndex, int aesId) { - DEBUG_LOG() << "sendTrajectoryAdlerModifyRequest" + DEBUG_LOG(m_logger) << "sendTrajectoryAdlerModifyRequest" << ", participantId :" << participantId << ", wirkmittelIndex :" << wirkmittelIndex << ", aesId:" << aesId; std::vector geometryRef; geometryRef.clear(); @@ -338,7 +338,7 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat for (int subordinate : std::as_const(subordinates)) { - DEBUG_LOG() << "subordinates(" << participantId << ") :" << subordinate; + DEBUG_LOG(m_logger) << "subordinates(" << participantId << ") :" << subordinate; subordinatePositions.append(m_dtcPpm->participantPosition(subordinate)); } @@ -385,10 +385,10 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat matrix.rotate(-grad); QPointF point(pntGeo.x(), pntGeo.y()); - DEBUG_LOG() << " POS bevore rot: " << point; + DEBUG_LOG(m_logger) << " POS bevore rot: " << point; auto rotatePoint = matrix.map(point); - DEBUG_LOG() << " POS after rot: " << rotatePoint; + DEBUG_LOG(m_logger) << " POS after rot: " << rotatePoint; pntGeo.setX(rotatePoint.x()); pntGeo.setY(rotatePoint.y()); @@ -410,11 +410,11 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat impactPosition.z(data.zieldaten.koordinate.hoehe); newRequest->impactPosition(impactPosition); newRequest->geometry(geometryRef); - DEBUG_LOG() << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size(); + DEBUG_LOG(m_logger) << "geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size(); if (newRequest->aesItemId() <= 0) { - ERROR_LOG() << "newRequest->aesItemId() <=0" + ERROR_LOG(m_logger) << "newRequest->aesItemId() <=0" << ", aesItemId :" << newRequest->aesItemId(); return; } @@ -428,12 +428,12 @@ void AesHandler::sendTrajectoryAdlerModifyRequest(const WirkfeldplanungData &dat void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) { - DEBUG_LOG() << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)" + DEBUG_LOG(m_logger) << "AesHandler::handleEffectCluster (Empfang WirkfeldplanungData)" << ", feuerkampfReferenz :" << data.feuerkampfReferenz << ", wirkmittel.size() :" << data.feuerkommando.wirkmittel.size(); if (!m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId)) { - ERROR_LOG() << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return"; + ERROR_LOG(m_logger) << "!m_mainDispatcher->jsonDispatcher()->getSAAByWs(" << wsId << ") return"; return; } const QString &verein = data.feuerkommando.verein; @@ -448,7 +448,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) if (part.id() <= 0) { - ERROR_LOG() << "Got EffectClusterData for " << verein << " but unit not found"; + ERROR_LOG(m_logger) << "Got EffectClusterData for " << verein << " but unit not found"; return; } @@ -472,7 +472,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) AreaEffectSimulation::AesExplosionGeometry geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; AreaEffectSimulation::Area area; const bool createArea = data.zieldaten.breiteRadius == 0 && data.zieldaten.tiefe == 0; - ERROR_LOG() << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe; + ERROR_LOG(m_logger) << "create AREA??? " << createArea << " breite " << data.zieldaten.breiteRadius << " tiefe " << data.zieldaten.tiefe; if (!createArea && data.zieldaten.geometrie == ProjectDataManagement::L4_TargetGeometry::Point) { @@ -485,7 +485,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion); const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId); - DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; + DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; area.height(impactRadius * 2); area.width(impactRadius * 2); } @@ -515,28 +515,28 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft()); const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint); - DEBUG_LOG() << "centerUtm=" + DEBUG_LOG(m_logger) << "centerUtm=" << ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone; const QPointF &bottomLeft = centerUtm.geographic(bl); - DEBUG_LOG() << "bl=" + DEBUG_LOG(m_logger) << "bl=" << ", x :" << bl.x() << ", y :" << bl.y(); - DEBUG_LOG() << "bottomLeft=" + DEBUG_LOG(m_logger) << "bottomLeft=" << ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y(); area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y())); - DEBUG_LOG() << "area.cornerBottomLeft=" + DEBUG_LOG(m_logger) << "area.cornerBottomLeft=" << ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat(); const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat()); - DEBUG_LOG() << "cornerBottomLeftUtm=" + DEBUG_LOG(m_logger) << "cornerBottomLeftUtm=" << ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone; } else { - DEBUG_LOG() << " Need to generate area"; + DEBUG_LOG(m_logger) << " Need to generate area"; if (data.feuerkommando.wirkmittel.size() == 1) { - DEBUG_LOG() << " Need to generate area SINGLE"; + DEBUG_LOG(m_logger) << " Need to generate area SINGLE"; geometry = AreaEffectSimulation::AesExplosionGeometry::EgPoint; @@ -549,7 +549,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion); const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId); - DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; + DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; area.height(impactRadius * 2); area.width(impactRadius * 2); @@ -561,25 +561,25 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const QPointF bl = QTransform().rotate(-area.rotation()).map(rect.topLeft()); const LtsCoordTrans::UtmCoordinate centerUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(centerPoint); - DEBUG_LOG() << "centerUtm=" + DEBUG_LOG(m_logger) << "centerUtm=" << ", x :" << centerUtm.x << ", y :" << centerUtm.y << ", zone :" << centerUtm.zone; const QPointF bottomLeft = centerUtm.geographic(bl); - DEBUG_LOG() << "bl=" + DEBUG_LOG(m_logger) << "bl=" << ", x :" << bl.x() << ", y :" << bl.y(); - DEBUG_LOG() << "bottomLeft=" + DEBUG_LOG(m_logger) << "bottomLeft=" << ", x :" << bottomLeft.x() << ", y :" << bottomLeft.y(); area.cornerBottomLeft(Core::GeoPosition2D(bottomLeft.x(), bottomLeft.y())); - DEBUG_LOG() << "area.cornerBottomLeft=" + DEBUG_LOG(m_logger) << "area.cornerBottomLeft=" << ", lon :" << area.cornerBottomLeft().lon() << ", lat :" << area.cornerBottomLeft().lat(); const LtsCoordTrans::UtmCoordinate cornerBottomLeftUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(area.cornerBottomLeft().lon(), area.cornerBottomLeft().lat()); - ERROR_LOG() << "cornerBottomLeftUtm=" + ERROR_LOG(m_logger) << "cornerBottomLeftUtm=" << ", x :" << cornerBottomLeftUtm.x << ", y :" << cornerBottomLeftUtm.y << ", zone :" << cornerBottomLeftUtm.zone; } else if (data.feuerkommando.wirkmittel.size() > 1) { - DEBUG_LOG() << " Need to generate area AREA"; + DEBUG_LOG(m_logger) << " Need to generate area AREA"; geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; @@ -590,7 +590,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const int igniterFunctionId = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(chargeData.zuenderFunktion); const int impactRadius = m_mainDispatcher->pdmHandler()->getDtc()->impactRadius(chargeTypeId, igniterTypeId, igniterFunctionId); - DEBUG_LOG() << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; + DEBUG_LOG(m_logger) << "Impact Radius for " << chargeTypeId << " " << igniterTypeId << " " << igniterTypeId << " is " << impactRadius; QList areas; @@ -628,11 +628,11 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) area = createMinimumRect(zone, vecPoints); - DEBUG_LOG() << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width(); + DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width(); } else if (data.feuerkommando.wirkmittelRakete.size() > 0) { - DEBUG_LOG() << " Need to generate area AREA"; + DEBUG_LOG(m_logger) << " Need to generate area AREA"; geometry = AreaEffectSimulation::AesExplosionGeometry::EgArea; @@ -677,7 +677,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) area = createMinimumRect(zone, vecPoints); - DEBUG_LOG() << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width(); + DEBUG_LOG(m_logger) << "FINAL AREA " << area.cornerBottomLeft() << " " << area.height() << " " << area.width(); } } @@ -725,9 +725,9 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender); effectorData.chargeStruct().igniterFunctionId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion); - DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte; - DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId(); - DEBUG_LOG() << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId(); + DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte; + DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId(); + DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId(); effectorData.participantId() = m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id(); std::vector flightCurve; @@ -735,20 +735,20 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) const auto &startPos = m_dtcPpm->participantPosition(effectorData.participantId()); const auto coordStart = LtsCoordTrans::UtmCoordinate::fromGeographic(startPos.pos().lon(), startPos.pos().lat()); - DEBUG_LOG() << "Start point: " << coordStart; + DEBUG_LOG(m_logger) << "Start point: " << coordStart; const auto coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(effectorAdler.auftreffpunkt.koordinate.longitude * (M_PI / 180.0), effectorAdler.auftreffpunkt.koordinate.latitude * (M_PI / 180.0)); - DEBUG_LOG() << "End point: " << coordEnd; + DEBUG_LOG(m_logger) << "End point: " << coordEnd; LtsCoordTrans::UtmCoordinate coordDiff = coordEnd; coordDiff.x = coordDiff.x - coordStart.x; coordDiff.y = coordDiff.y - coordStart.y; - DEBUG_LOG() << "Last point: " << coordDiff.x << " " << coordDiff.y; - DEBUG_LOG() << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x); + DEBUG_LOG(m_logger) << "Last point: " << coordDiff.x << " " << coordDiff.y; + DEBUG_LOG(m_logger) << "Last point ATAN: " << std::atan2(coordDiff.y, coordDiff.x); const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI); - DEBUG_LOG() << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI); + DEBUG_LOG(m_logger) << "Atan2 Deg to: last point " << std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI); for (const auto &flightPointAdler : std::as_const(effectorAdler.flugbahnpunkt)) { @@ -761,10 +761,10 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) QTransform matrix; matrix.rotate(useNewGrad); const QPointF point(flightPoint.offsetX(), flightPoint.offsetY()); - TRACE_LOG() << " POS bevore rot: " << point; + TRACE_LOG(m_logger) << " POS bevore rot: " << point; const auto rotatePoint = matrix.map(point); - TRACE_LOG() << " POS after rot: " << rotatePoint; + TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint; flightPoint.offsetX() = rotatePoint.x(); flightPoint.offsetY() = rotatePoint.y(); @@ -785,8 +785,8 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) effectorData.mhpScatterLengthDetonationHeight() = effectorAdler.streuung.laengsstreuungH; effectorData.mhpScatterWidth() = effectorAdler.streuung.seitenstreuung; effectorData.mhpScatterWidthDetonationHeight() = effectorAdler.streuung.seitenstreuungH; - DEBUG_LOG() << effectorAdler.kenner; - DEBUG_LOG() << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name() + DEBUG_LOG(m_logger) << effectorAdler.kenner; + DEBUG_LOG(m_logger) << "Looking for participantID with stats = party: " << part.partyId() << " unitname: " << part.name() << " effectorname: " << waffensystemkennerMap.key(effectorAdler.kenner); effectorData.peakHeight() = effectorAdler.gipfelhoehe; effectorVec.push_back(effectorData); @@ -809,14 +809,14 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) effectorData.chargeStruct().igniterFunctionId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterFunctionIdFromAdlerIgniterFunction(effectorAdler.geschoss.zuenderFunktion); - DEBUG_LOG() << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte; - DEBUG_LOG() << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId(); - DEBUG_LOG() << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId(); + DEBUG_LOG(m_logger) << "FOUND chargeTypeId " << effectorData.chargeStruct().chargeTypeId() << " for " << effectorAdler.geschoss.geschosssorte; + DEBUG_LOG(m_logger) << "igniterTypeId: " << effectorData.chargeStruct().igniterTypeId(); + DEBUG_LOG(m_logger) << "igniterFunctionId: " << effectorData.chargeStruct().igniterFunctionId(); effectorData.participantId() = m_dtcPpm->getParticipantByInternalName(part.partyId(), QString::fromStdString(part.name()), waffensystemkennerMap.key(effectorAdler.kenner)).id(); if (effectorData.participantId() == 0) - WARNING_LOG() << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner; + WARNING_LOG(m_logger) << "Could not find participant for partiyId " << part.partyId() << ", name " << part.name() << ", kenner " << effectorAdler.kenner; effectorData.chargeStruct().igniterTypeId() = m_mainDispatcher->pdmHandler()->getDtc()->getIgniterTypeIdFromAdlerIgniter(effectorAdler.geschoss.zuender); effectorData.interval() = effectorAdler.geschoss.intervall; @@ -852,7 +852,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) AreaEffectSimulation::TrajectoryGeoPosition trajectoryWithoutTime; if (!AreaEffectSimulation::TrajectoryGenerator::getInstance()->generateTrajectoryBiedziak(trajectoryStart, trajectoryEnd, 45.0, trajectoryWithoutTime)) - ERROR_LOG() << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein; + ERROR_LOG(m_logger) << "Could not create trajectory for Feuerkommando " << data.feuerkommando.verein; @@ -897,12 +897,12 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) req.tla(data.zieldaten.zog); if (data.feuerkommando.wirkmittel.empty()) - DEBUG_LOG() << "flugzeit :" + DEBUG_LOG(m_logger) << "flugzeit :" << " -"; else - DEBUG_LOG() << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit; + DEBUG_LOG(m_logger) << "flugzeit :" << data.feuerkommando.wirkmittel.at(0).flugzeit; - DEBUG_LOG() << "SEND " << data.feuerkampfReferenz << " "; + DEBUG_LOG(m_logger) << "SEND " << data.feuerkampfReferenz << " "; int ammoCounter = 0; std::vector refWirkmittel; refWirkmittel.reserve(data.feuerkommando.wirkmittel.size()); @@ -910,7 +910,7 @@ void AesHandler::handleEffectCluster(const WirkfeldplanungData &data, int wsId) for (const auto &wm : std::as_const(data.feuerkommando.wirkmittel)) { ammoCounter += wm.geschoss.anzahl; - DEBUG_LOG() << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner; + DEBUG_LOG(m_logger) << "INSERT KENNER INTO MAP: " << data.feuerkampfReferenz << "---------" << wm.kenner; refWirkmittel.push_back(wm.kenner); } @@ -966,7 +966,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo bool outOfAmmo = false; const int newAmmoAmount = std::max(0, refAmmoCounter - 1); - DEBUG_LOG() << "Handle ammo count - ID: " << aes.id() << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter + DEBUG_LOG(m_logger) << "Handle ammo count - ID: " << aes.id() << " | Ref: " << refTrimmed << " | PartyID: " << saaPartyId << " | oldAmmoCount: " << refAmmoCounter << " | newAmmoCount: " << newAmmoAmount; if (newAmmoAmount <= 0) @@ -991,7 +991,7 @@ void AesHandler::handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bo exvm.feuerkampfdaten.kenner = kenner; exvm.feuerkampfdaten.verein = data.verein; - DEBUG_LOG() << "------------ SENDE ExVollzugsmeldung fĂźr ------------ " << kenner; + DEBUG_LOG(m_logger) << "------------ SENDE ExVollzugsmeldung fĂźr ------------ " << kenner; m_mainDispatcher->jsonDispatcher()->sendExVollzugsmeldung(exvm, saaPartyId); } @@ -1014,15 +1014,15 @@ void AesHandler::removeAllPendingEffectCluster(int partyId) if (effectClusterIds.isEmpty()) return; - INFO_LOG() << "Pending effect cluster size: " << effectClusterIds.size(); + INFO_LOG(m_logger) << "Pending effect cluster size: " << effectClusterIds.size(); Core::RemoveElementRequest req; for (const qint32 id : std::as_const(effectClusterIds)) { req.id(id); - INFO_LOG() << "Remove effect cluster id: " << id; + INFO_LOG(m_logger) << "Remove effect cluster id: " << id; qint32 ret = m_ftcAes->effectClusterRemoveRequest(req); - INFO_LOG() << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret; + INFO_LOG(m_logger) << "m_ftsAes->effectClusterRemoveRequest(req) --> " << ret; } } @@ -1046,13 +1046,13 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "----------------- remove area ------------- "; + DEBUG_LOG(m_logger) << "----------------- remove area ------------- "; m_singleExplosions.remove(data.id()); return; } if (modType == DataModification::eAdded) { - DEBUG_LOG() << "----------------- add area ------------- " << data.effectStateId(); + DEBUG_LOG(m_logger) << "----------------- add area ------------- " << data.effectStateId(); m_singleExplosions.insert(data.id(), data.effectStateId()); return; } @@ -1060,7 +1060,7 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS && m_singleExplosions.value(data.id(), AreaEffectSimulation::AesEffectState::EsActivated) != AreaEffectSimulation::AesEffectState_def::EsActivated) { const auto state = data.effectStateId(); - DEBUG_LOG() << "----------------- switch state ------------- " << state; + DEBUG_LOG(m_logger) << "----------------- switch state ------------- " << state; m_singleExplosions.insert(data.id(), state); QJsonObject telegram; telegram[QStringLiteral("typeId")] = 80082; @@ -1089,12 +1089,12 @@ void AesHandler::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionS void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluster &data, DataModification modType) { - DEBUG_LOG() << "Try auto handle effectCluster: " << data.name(); + DEBUG_LOG(m_logger) << "Try auto handle effectCluster: " << data.name(); if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "Try auto handle effectCluster: probs: " << data.properties(); + DEBUG_LOG(m_logger) << "Try auto handle effectCluster: probs: " << data.properties(); if (data.properties().empty()) return; @@ -1102,20 +1102,20 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste if (!data.partyId().is_set()) return; - DEBUG_LOG() << "has PARTY " << data.properties(); + DEBUG_LOG(m_logger) << "has PARTY " << data.properties(); if (!data.participantId().is_set()) return; if (data.effectSourceId() != ProjectDataManagement::EffectSource::ES_ADLER) return; - DEBUG_LOG() << "has PARTICIPANTID " << data.properties(); + DEBUG_LOG(m_logger) << "has PARTICIPANTID " << data.properties(); QJsonObject propertiesObject = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object(); if (!propertiesObject.value(QStringLiteral("useReceived")).toBool()) return; - DEBUG_LOG() << "has USE RECEIVED " << data.effectStateId().underlying(); + DEBUG_LOG(m_logger) << "has USE RECEIVED " << data.effectStateId().underlying(); switch (data.effectStateId().underlying()) { @@ -1136,7 +1136,7 @@ void AesHandler::onEffectClusterChanged(const AreaEffectSimulation::EffectCluste m_aesIdToFeuerkampfReferenz.remove(data.id()); - DEBUG_LOG() << "SEND MQ for " << data.name() << " " << reference; + DEBUG_LOG(m_logger) << "SEND MQ for " << data.name() << " " << reference; break; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h index 9ed52cb1e..88925ee27 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.h @@ -60,16 +60,19 @@ class AesHandler std::shared_ptr getFtc() { return m_ftcAes; }; private: + NGL::INGLLogger &m_logger; AreaEffectSimulation::Area createMinimumRect(int zone, const QVector &points); signals: void explosionSingleChanged(const QJsonObject &jsonObj); private: + NGL::INGLLogger &m_logger; QList findAllPendingEffectCluster(int partyId); void handleAmmoCount(const Feuerkampfdaten &data, int saaPartyId, bool sendExVollzug = false); private: + NGL::INGLLogger &m_logger; MainDispatcher *m_mainDispatcher; std::shared_ptr m_ftcAes; std::shared_ptr m_dtcAes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/asm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/asm_handler.cpp index 10c324ff0..1d28adcc1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/asm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/asm_handler.cpp @@ -25,7 +25,7 @@ bool AsmHandler::init(MainDispatcher* mainDispatcher) m_dtcAsm = AssetManagement::Interface::Dtc::create(mainDispatcher->ddsHandler()->ddsConnector()); if (!m_dtcAsm->enableAsset()) { - ERROR_LOG()<<" Can't read data from ASM"; + ERROR_LOG(m_logger)<<" Can't read data from ASM"; return false; } m_exerciseId = mainDispatcher->exerciseId(); @@ -37,7 +37,7 @@ bool AsmHandler::init(MainDispatcher* mainDispatcher) void AsmHandler::modifyAssetAdlerProperties(int assetId, bool isSaaConnected) { - WARNING_LOG()<<">> modify asset properties: set exerciseId: "<> modify asset properties: set exerciseId: "<asset(assetId); if (asset.id() <= 0) @@ -51,7 +51,7 @@ void AsmHandler::modifyAssetAdlerProperties(int assetId, bool isSaaConnected) void AsmHandler::onAssetModifyReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got Function Reply error ? "< getFtc() { return m_ftcAsm; } void modifyAssetAdlerProperties(int assetId, bool isSaaConnected = false); private: + NGL::INGLLogger &m_logger; void onAssetModifyReply(const Core::FunctionReplyObject &reply) override; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtcAsm; std::shared_ptr m_ftcAsm; int m_exerciseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.cpp index 0e43480df..666bb32e4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.cpp @@ -48,7 +48,7 @@ bool FlmHandler::init(MainDispatcher *mainDispatcher) bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungsnummer, const QJsonObject &obj) { - ERROR_LOG() << "exerciseId: " << m_exerciseId << ", partyId: " << partyId + ERROR_LOG(m_logger) << "exerciseId: " << m_exerciseId << ", partyId: " << partyId << ", name: " << name << ", meldungsnummer: " << meldungsnummer; @@ -58,11 +58,11 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs const QString folderName = QStringLiteral("Messages"); int folderHXMessagesId = m_dtcFlm->findFolder(partyFolderId, folderName); - ERROR_LOG() << "folderHXMessagesId: " << folderHXMessagesId; + ERROR_LOG(m_logger) << "folderHXMessagesId: " << folderHXMessagesId; if (folderHXMessagesId <= 0) { - ERROR_LOG() << "Folder Messages does not exist for exerciseId: " << m_exerciseId << ", partyId: " << partyId; + ERROR_LOG(m_logger) << "Folder Messages does not exist for exerciseId: " << m_exerciseId << ", partyId: " << partyId; return false; } @@ -84,7 +84,7 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs fileContentReq.exerciseId(m_exerciseId); fileContentReq.operatorId(99); - DEBUG_LOG() << "HQ: name: " << fileContentReq.name() << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId; + DEBUG_LOG(m_logger) << "HQ: name: " << fileContentReq.name() << ", folderId: " << folderHXMessagesId << ", exerciseId: " << m_exerciseId << ", partyId: " << partyId; QRegularExpression re(QStringLiteral("_\\d+$")); @@ -93,12 +93,12 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs baseName = baseName.normalized(QString::NormalizationForm_C); - ERROR_LOG() << "BaseName: " << baseName << "|"; + ERROR_LOG(m_logger) << "BaseName: " << baseName << "|"; QStringList fileNames; if (!m_dtcFlm->getAllFiles(fileContentReq.fileType(), folderHXMessagesId, fileNames, true)) { - ERROR_LOG() << "Error while reading fileNames for folderId: " << folderHXMessagesId; + ERROR_LOG(m_logger) << "Error while reading fileNames for folderId: " << folderHXMessagesId; return false; } @@ -106,13 +106,13 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs for (const QString &fileName : std::as_const(fileNames)) { QString normalizedName = fileName.normalized(QString::NormalizationForm_C); - DEBUG_LOG() << "normalized fileName: " << normalizedName << "|"; + DEBUG_LOG(m_logger) << "normalized fileName: " << normalizedName << "|"; if (!normalizedName.startsWith(baseName)) continue; QString rest = fileName.mid(baseName.length()); - DEBUG_LOG() << "rest: " << rest; + DEBUG_LOG(m_logger) << "rest: " << rest; if (rest.contains(QStringLiteral("."))) rest = rest.section(QStringLiteral("."), 0, 0); @@ -128,12 +128,12 @@ bool FlmHandler::processHQMessage(int partyId, const QString &name, int meldungs if (ok) maxNumber = std::max(maxNumber, currentNum); } - DEBUG_LOG() << " maxNumber: " << maxNumber; + DEBUG_LOG(m_logger) << " maxNumber: " << maxNumber; } const QString newName = baseName + QStringLiteral("_") + QString::number(++maxNumber); - DEBUG_LOG() << "newName : " << newName; + DEBUG_LOG(m_logger) << "newName : " << newName; fileContentReq.name(newName.toStdString()); @@ -172,7 +172,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con notif.expiryTime(expiryTime); int prio = s->getInteger(QStringLiteral("NOM/notificationPriority"), 3); - DEBUG_LOG() << " Setting: NotificationPriority: " << prio; + DEBUG_LOG(m_logger) << " Setting: NotificationPriority: " << prio; notif.priority(static_cast(prio)); notif.processedPriority(NotificationManagement::Priority_def::Low); notif.exerciseId(m_exerciseId); @@ -191,7 +191,7 @@ void FlmHandler::createHQNotification(const int partyId, const int folderId, con notifReq.notification(notif); if (!m_ftcNom->createNotificationRequest(notifReq, this)) - ERROR_LOG() << "Error requesting create Notification data"; + ERROR_LOG(m_logger) << "Error requesting create Notification data"; } void FlmHandler::initHQFolders(int partyId) @@ -201,7 +201,7 @@ void FlmHandler::initHQFolders(int partyId) if (exerciseFolderId <= 0) { - ERROR_LOG() << "No exercise Folder for exerciseId: " << m_exerciseId; + ERROR_LOG(m_logger) << "No exercise Folder for exerciseId: " << m_exerciseId; return; } @@ -220,27 +220,27 @@ void FlmHandler::initHQFolders(int partyId) void FlmHandler::onFileContentModifyReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got Function Reply: " << reply.translated(); + DEBUG_LOG(m_logger) << "Got Function Reply: " << reply.translated(); if (reply.error()) - ERROR_LOG() << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error(); + ERROR_LOG(m_logger) << "Error while insert HX Message: " << reply.translated() << ", error: " << reply.error(); else createHQNotification(m_partyId, m_folderHXMessagesId, reply.id()); } void FlmHandler::onPathCreateReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got Function Reply: " << reply.translated(); + DEBUG_LOG(m_logger) << "Got Function Reply: " << reply.translated(); if (reply.error()) { - ERROR_LOG() << "Error while creating folders: " << reply.translated() << ", error: " << reply.error(); + ERROR_LOG(m_logger) << "Error while creating folders: " << reply.translated() << ", error: " << reply.error(); } } void FlmHandler::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "FlmHandler: Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); + INFO_LOG(m_logger) << "FlmHandler: Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); } bool FlmHandler::parseContent(const QString &contentString, QMap &retMap) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.h index dee7ccfb7..97e0e3e22 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/flm_handler.h @@ -41,12 +41,14 @@ class FlmHandler void initHQFolders(int partyId); private: + NGL::INGLLogger &m_logger; void onFileContentModifyReply(const Core::FunctionReplyObject &reply) override; void onPathCreateReply(const Core::FunctionReplyObject &reply) override; void onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) override final; bool parseContent(const QString &contentString, QMap &retMap); private: + NGL::INGLLogger &m_logger; MainDispatcher *m_mainDispatcher = nullptr; int m_exerciseId; int m_parentFolderId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.cpp index e1a378c92..57e84f9bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.cpp @@ -44,7 +44,7 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp, , m_webSocketReconnectTimer(new QTimer(this)) , m_bWarnedOnce(false) { - DEBUG_LOG() << "JsonDispatcher::JsonDispatcher"; + DEBUG_LOG(m_logger) << "JsonDispatcher::JsonDispatcher"; m_sendToWebsocket->setWSInterface(m_webSocketInterface); connect(m_webSocketInterface.get(), &TrainingAreaBase::WebSocketInterface::recivedTelegram, this, &JsonDispatcher::onRecivedTelegram, Qt::UniqueConnection); @@ -55,19 +55,19 @@ JsonDispatcher::JsonDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp, bool JsonDispatcher::init() { return true; } void JsonDispatcher::connectWebsocket() { - DEBUG_LOG() << "JsonDispatcher::connectWebsocket()"; + DEBUG_LOG(m_logger) << "JsonDispatcher::connectWebsocket()"; if (!m_webSocketInterface->init(Settings::getWebSocketServerPortRange(3))) { - DEBUG_LOG() << "Adler Could not open WebSocketInterface"; + DEBUG_LOG(m_logger) << "Adler Could not open WebSocketInterface"; } else { - DEBUG_LOG() << "Adler Could open WebSocketInterface on port " << m_webSocketInterface->getPort(); + DEBUG_LOG(m_logger) << "Adler Could open WebSocketInterface on port " << m_webSocketInterface->getPort(); } emit websocketConnected(m_webSocketInterface->getPort()); const QUrl url(webSocketUrl()); if (!m_bWarnedOnce) - DEBUG_LOG() << "Adler: Using WebSocket url: " << url.toString(); + DEBUG_LOG(m_logger) << "Adler: Using WebSocket url: " << url.toString(); if (m_webSocket->state() != QAbstractSocket::ConnectedState) m_webSocket->open(url); } @@ -76,7 +76,7 @@ void JsonDispatcher::onKeepAliveTimerTimeout() { QTimer *timer = qobject_cast(sender()); int wsId = m_connectionKeepaliveTimer.key(timer); - DEBUG_LOG() << "onKeepAliveTimerTimeout Timeout from " << wsId << " still in list " << (getSAAByWs(wsId) != nullptr); + DEBUG_LOG(m_logger) << "onKeepAliveTimerTimeout Timeout from " << wsId << " still in list " << (getSAAByWs(wsId) != nullptr); auto saa = getSAAByWs(wsId); @@ -86,14 +86,14 @@ void JsonDispatcher::onKeepAliveTimerTimeout() const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::NoHeartbeat; const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected); const int assetId = getAssetId(saa->getSAAName()); - DEBUG_LOG() << "Timeout from " << saa->getSAAName() << " ==> SAA URL: " << saaUrl.toString(); + DEBUG_LOG(m_logger) << "Timeout from " << saa->getSAAName() << " ==> SAA URL: " << saaUrl.toString(); m_ppmHandler ->modifyPartyAdlerProperties(wsId, assetId, saa->getPartyId(), saa->getSAAName(), saa->getSzenarName(), connectState, saa->getIsVerbund()); m_mainDispatcher->asmHandler()->modifyAssetAdlerProperties(assetId, isSaaConnected); saa->setIsAlive(false); } else - ERROR_LOG() << "Trying to remove an saa after timeout with the websocketId: " << wsId << " that is not connected"; + ERROR_LOG(m_logger) << "Trying to remove an saa after timeout with the websocketId: " << wsId << " that is not connected"; m_connectionKeepaliveTimer.remove(wsId); timer->stop(); @@ -131,11 +131,11 @@ std::shared_ptr JsonDispatcher::sendToTab() { retur bool JsonDispatcher::canSendData() const { return m_webSocket && m_webSocket->state() == QAbstractSocket::ConnectedState; } void JsonDispatcher::onNewWebsocketConnected(const int wsId, const QString &address, qint16 port) { - DEBUG_LOG() << "New Connection from: " << address << ", port: " << port << ", with id: " << wsId; + DEBUG_LOG(m_logger) << "New Connection from: " << address << ", port: " << port << ", with id: " << wsId; } void JsonDispatcher::onWSDisconnected(const int wsId) { - DEBUG_LOG() << "Connection disconnect wsId: " << wsId; + DEBUG_LOG(m_logger) << "Connection disconnect wsId: " << wsId; auto saa = getSAAByWs(wsId); if (saa) @@ -143,7 +143,7 @@ void JsonDispatcher::onWSDisconnected(const int wsId) } std::shared_ptr JsonDispatcher::getSAAByParty(const int partyId) { - DEBUG_LOG() << "getSAAByParty partyId: " << partyId; + DEBUG_LOG(m_logger) << "getSAAByParty partyId: " << partyId; if (m_saaInterfaces.empty()) return nullptr; auto it @@ -159,9 +159,9 @@ std::shared_ptr JsonDispatcher::getSAAByName(const QString &saaNam std::shared_ptr JsonDispatcher::getSAAByWs(const int wsId) { - TRACE_LOG() << "m_saaInterfaces.size :" << m_saaInterfaces.size() << ", wsId=" << wsId; + TRACE_LOG(m_logger) << "m_saaInterfaces.size :" << m_saaInterfaces.size() << ", wsId=" << wsId; for (int i = 0; i < m_saaInterfaces.size(); i++) - TRACE_LOG() << "i=" << i << ", getPartyId :" << m_saaInterfaces[i]->getPartyId() << ", getWsId :" << m_saaInterfaces[i]->getWsId(); + TRACE_LOG(m_logger) << "i=" << i << ", getPartyId :" << m_saaInterfaces[i]->getPartyId() << ", getWsId :" << m_saaInterfaces[i]->getWsId(); auto it = std::find_if(m_saaInterfaces.begin(), m_saaInterfaces.end(), [wsId](const std::shared_ptr &saa) { return saa.get()->getWsId() == wsId; }); return it != m_saaInterfaces.end() ? *it : nullptr; @@ -169,11 +169,11 @@ std::shared_ptr JsonDispatcher::getSAAByWs(const int wsId) bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const int partyId) { - DEBUG_LOG() << "TRY SEND EXFeuerbereit attempt for party " << partyId; + DEBUG_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for party " << partyId; auto saa = getSAAByParty(partyId); if (!saa) { - ERROR_LOG() << "sendExFeuerbereit no saa for paty:" << partyId; + ERROR_LOG(m_logger) << "sendExFeuerbereit no saa for paty:" << partyId; return false; } @@ -181,7 +181,7 @@ bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const in exFB.sender = QStringLiteral("EXCON@GUEZ.DE"); exFB.receiver = saa->getSAAName(); exFB.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); - WARNING_LOG() << "TRY SEND EXFeuerbereit attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); + WARNING_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exFB.toJson()); return true; @@ -189,7 +189,7 @@ bool JsonDispatcher::sendExFeuerbereit(const ExFeuerbereit &exFBDataIn, const in bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int partyId) { - DEBUG_LOG() << "TRY SEND EXFeuerbereit attempt for party " << partyId; + DEBUG_LOG(m_logger) << "TRY SEND EXFeuerbereit attempt for party " << partyId; auto saa = getSAAByParty(partyId); if (!saa) return false; @@ -198,7 +198,7 @@ bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int exAF.sender = QStringLiteral("EXCON@GUEZ.DE"); exAF.receiver = saa->getSAAName(); exAF.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); - WARNING_LOG() << "TRY SEND sendExAbgefeuert attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); + WARNING_LOG(m_logger) << "TRY SEND sendExAbgefeuert attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exAF.toJson()); return true; @@ -206,7 +206,7 @@ bool JsonDispatcher::sendExAbgefeuert(const ExAbgefeuert &exAFDataIn, const int bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDataIn, int partyId) { - DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for party " << partyId; + DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for party " << partyId; auto saa = getSAAByParty(partyId); if (!saa) return false; @@ -215,7 +215,7 @@ bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDa exMQ.sender = QStringLiteral("EXCON@GUEZ.DE"); exMQ.receiver = saa->getSAAName(); exMQ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); - DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); + DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exMQ.toJson()); return true; @@ -223,7 +223,7 @@ bool JsonDispatcher::sendExMqManuelleQuittung(const ExMqManuelleQuittung &exMQDa bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &exTQDataIn, int partyId) { - DEBUG_LOG() << "TRY SEND ExTqTechnischeQuittung attempt for party " << partyId; + DEBUG_LOG(m_logger) << "TRY SEND ExTqTechnischeQuittung attempt for party " << partyId; auto saa = getSAAByParty(partyId); if (!saa) return false; @@ -232,7 +232,7 @@ bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &ex exMQ.sender = QStringLiteral("EXCON@GUEZ.DE"); exMQ.receiver = saa->getSAAName(); exMQ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); - DEBUG_LOG() << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); + DEBUG_LOG(m_logger) << "TRY SEND ExMqManuelleQuittung attempt for SAA NAME " << saa->getSAAName() << " esid " << saa->getWsId(); m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exMQ.toJson()); return true; @@ -240,7 +240,7 @@ bool JsonDispatcher::sendExTqTechnischeQuittung(const ExTqTechnischeQuittung &ex bool JsonDispatcher::sendExVollzugsmeldung(const ExVollzugsmeldung &exVZDataIn, int partyId) { - DEBUG_LOG() << "TRY SEND ExVollzugsmeldung attempt for party " << partyId; + DEBUG_LOG(m_logger) << "TRY SEND ExVollzugsmeldung attempt for party " << partyId; auto saa = getSAAByParty(partyId); if (!saa) return false; @@ -249,33 +249,33 @@ bool JsonDispatcher::sendExVollzugsmeldung(const ExVollzugsmeldung &exVZDataIn, exVZ.sender = QStringLiteral("EXCON@GUEZ.DE"); exVZ.receiver = saa->getSAAName(); exVZ.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); - WARNING_LOG() << "TRY SEND ExVollzugsmeldung attempt for SAA NAME " << saa->getSAAName() << " WSID " << saa->getWsId(); + WARNING_LOG(m_logger) << "TRY SEND ExVollzugsmeldung attempt for SAA NAME " << saa->getSAAName() << " WSID " << saa->getWsId(); m_sendToWebsocket->onGenericTelegram1(saa->getWsId(), exVZ.toJson()); return true; } void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const QString &saaName, const QString &szenarName, bool isVerbund, const QString &uuid) { - DEBUG_LOG() << "Registration attempt from " << saaName << " for party " << partyId << ", saaName: " << saaName << ", uuid: " << uuid << ", wsId: " << wsId; + DEBUG_LOG(m_logger) << "Registration attempt from " << saaName << " for party " << partyId << ", saaName: " << saaName << ", uuid: " << uuid << ", wsId: " << wsId; ExAnmeldebestaetigung exRC; exRC.referenceUuid = uuid; exRC.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); exRC.anBestaetigungsdaten.error = AdlerJson::L45_AnmeldebestaetigungFehlercode::Ok; auto saa = getSAAByName(saaName); - DEBUG_LOG() << "is saa " << saa; + DEBUG_LOG(m_logger) << "is saa " << saa; if (saa) { - DEBUG_LOG() << "saa.get()->getPartyId(): " << saa.get()->getPartyId() << " partyId: " << partyId; + DEBUG_LOG(m_logger) << "saa.get()->getPartyId(): " << saa.get()->getPartyId() << " partyId: " << partyId; if (saa.get()->getPartyId() == partyId) { - DEBUG_LOG() << "saa already connected, reconnect!"; + DEBUG_LOG(m_logger) << "saa already connected, reconnect!"; onSAADeregistration(saa.get()->getWsId(), partyId); } else { - DEBUG_LOG() << "other saa connected to this party"; + DEBUG_LOG(m_logger) << "other saa connected to this party"; @@ -283,7 +283,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const } else if (getSAAByParty(partyId)) { - DEBUG_LOG() << "party is used by other saa"; + DEBUG_LOG(m_logger) << "party is used by other saa"; } @@ -296,10 +296,10 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const m_saaInterfaces.append(newSaa); int adlerOffset = m_settings->settings()->value(QLatin1String("TrainingAreaBase/AdlerKeepalive"), 30000).toInt(); - DEBUG_LOG() << "adlerOffset =" << adlerOffset; + DEBUG_LOG(m_logger) << "adlerOffset =" << adlerOffset; if (adlerOffset > 0) { - DEBUG_LOG() << "Started SAA with Keppalive Timer: " << adlerOffset; + DEBUG_LOG(m_logger) << "Started SAA with Keppalive Timer: " << adlerOffset; QTimer *keepaliveTimer = new QTimer(this); keepaliveTimer->setInterval(adlerOffset); m_connectionKeepaliveTimer.insert(wsId, keepaliveTimer); @@ -309,7 +309,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const saa = newSaa; - DEBUG_LOG() << "emit or answer without error wsId: " << wsId; + DEBUG_LOG(m_logger) << "emit or answer without error wsId: " << wsId; } exRC.sender = getSender(); exRC.receiver = saa->getSAAName(); @@ -326,7 +326,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Connected; const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected); const int assetId = getAssetId(saaName); - DEBUG_LOG() << "onSAARegistration modifyParty" + DEBUG_LOG(m_logger) << "onSAARegistration modifyParty" << " ==> SAA name " << saaName; createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "Reconnect to SAA")), NotificationManagement::MessageType_def::Success, @@ -340,7 +340,7 @@ void JsonDispatcher::onSAARegistration(const int wsId, const int partyId, const void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId) { - DEBUG_LOG() << "onSAADeregistration" + DEBUG_LOG(m_logger) << "onSAADeregistration" << " wsId: " << wsId << ", partyId: " << partyId; auto saa = getSAAByWs(wsId); @@ -349,7 +349,7 @@ void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId) const ParticipantManagement::ConnectState connectState = ParticipantManagement::ConnectState::Disconnected; const bool isSaaConnected = (connectState == ParticipantManagement::ConnectState::Connected); const int assetId = getAssetId(saa->getSAAName()); - DEBUG_LOG() << "Deregistation from " << saa->getSAAName(); + DEBUG_LOG(m_logger) << "Deregistation from " << saa->getSAAName(); createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification", "SAADeregistration")), NotificationManagement::MessageType_def::Info, NotificationManagement::NotificationType::AdlerNotification, @@ -360,12 +360,12 @@ void JsonDispatcher::onSAADeregistration(const int wsId, const int partyId) m_saaInterfaces.removeOne(saa); } else - ERROR_LOG() << "Trying to remove an saa with the websocketId: " << wsId << " that is not connected"; + ERROR_LOG(m_logger) << "Trying to remove an saa with the websocketId: " << wsId << " that is not connected"; } void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid) { - DEBUG_LOG() << "onSAAConnectionTest" + DEBUG_LOG(m_logger) << "onSAAConnectionTest" << " wsId: " << wsId << ", uuid: " << uuid; auto saa = getSAAByWs(wsId); @@ -379,10 +379,10 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid) QTimer *connectionTimer = m_connectionKeepaliveTimer.value(wsId); if (connectionTimer) { - DEBUG_LOG() << "connectionTimer->start()"; + DEBUG_LOG(m_logger) << "connectionTimer->start()"; connectionTimer->start(); } - DEBUG_LOG() << "ConnectionTest from " << saa->getSAAName(); + DEBUG_LOG(m_logger) << "ConnectionTest from " << saa->getSAAName(); EXConnectionTestReply exCTR; exCTR.referenceUuid = uuid; exCTR.timestamp = QDateTime::currentDateTime().toString(Qt::DateFormat::ISODate); @@ -392,13 +392,13 @@ void JsonDispatcher::onSAAConnectionTest(const int wsId, const QString &uuid) } void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status) { - DEBUG_LOG() << "onSAAStatus" + DEBUG_LOG(m_logger) << "onSAAStatus" << " wsId: " << wsId << ", status: " << static_cast(status.status); auto saa = getSAAByWs(wsId); if (saa) { - DEBUG_LOG() << "Status from " << saa->getSAAName() << AdlerJson::szenarstatusToStr(status.status); + DEBUG_LOG(m_logger) << "Status from " << saa->getSAAName() << AdlerJson::szenarstatusToStr(status.status); saa->setStatus(status.status); QString title; switch (status.status) @@ -429,7 +429,7 @@ void JsonDispatcher::onSAAStatus(const int wsId, const EXStatus &status) QString JsonDispatcher::getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund) { const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(verein, partyId, isVerbund); - DEBUG_LOG() << "ParticipantId=" << part.id(); + DEBUG_LOG(m_logger) << "ParticipantId=" << part.id(); QString ppmlink = QString::fromUtf8(tr_lts("Notification","Show Participant Info
")) .arg(part.id()); @@ -440,11 +440,11 @@ QString JsonDispatcher::getParticipantInfoLink(const QString &verein, const int void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten &exceptionStatus) { - DEBUG_LOG() << "onSAAExceptionStatus" + DEBUG_LOG(m_logger) << "onSAAExceptionStatus" << ", wsId: " << wsId << ", status: " << StatusL32Map.key(exceptionStatus.status) << ", beschreibung: " << exceptionStatus.beschreibung; const auto saa = getSAAByWs(wsId); - DEBUG_LOG() << "Sende Notification Technische Quittung"; + DEBUG_LOG(m_logger) << "Sende Notification Technische Quittung"; QString content = QString::fromUtf8(tr_lts("Notification", "Status: %1
Description: %2")); @@ -467,7 +467,7 @@ void JsonDispatcher::onSAAExceptionStatus(const int wsId, const TechnischeDaten void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS) { - DEBUG_LOG() << "onSAASQWS"; + DEBUG_LOG(m_logger) << "onSAASQWS"; const bool isVerbund = true; auto saa = getSAAByWs(wsId); int partyId = saa->getPartyId(); @@ -481,7 +481,7 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS) args.append(QString::number(exSQWS.einheit.r)); args.append(exSQWS.einheit.verein); - DEBUG_LOG() << "Stellungsmeldung Waffensystem content=" << content; + DEBUG_LOG(m_logger) << "Stellungsmeldung Waffensystem content=" << content; createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification","Weapon System Position Report")), NotificationManagement::MessageType_def::Info, @@ -494,7 +494,7 @@ void JsonDispatcher::onSAASQWS(const int wsId, const Waffensystemdaten &exSQWS) void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS) { - DEBUG_LOG() << "onSAASQFS"; + DEBUG_LOG(m_logger) << "onSAASQFS"; auto saa = getSAAByWs(wsId); int partyId = saa->getPartyId(); const bool isVerbund = true; @@ -508,7 +508,7 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS args.append(QString::number(exSQFS.feuereinheit.r)); args.append(exSQFS.feuereinheit.verein); - DEBUG_LOG() << "Stellungsmeldung Feuerstellung content=" << content; + DEBUG_LOG(m_logger) << "Stellungsmeldung Feuerstellung content=" << content; createNotificationRequest(wsId, QString::fromUtf8(tr_lts("Notification","Position Report: Firing Unit")), NotificationManagement::MessageType_def::Info, @@ -521,14 +521,14 @@ void JsonDispatcher::onSAASQFS(const int wsId, const Feuerstellungsdaten &exSQFS void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP) { - DEBUG_LOG() << "onSAASQLP"; + DEBUG_LOG(m_logger) << "onSAASQLP"; auto saa = getSAAByWs(wsId); int partyId = saa->getPartyId(); const bool isVerbund = true; QStringList args; const ParticipantManagement::Participant &part = m_ppmHandler->findParticipantByInternalName(exSQLP.einheit.verein, partyId, isVerbund); - DEBUG_LOG() << "ParticipantId=" << part.id(); + DEBUG_LOG(m_logger) << "ParticipantId=" << part.id(); QString content = QString::fromUtf8(tr_lts("Notification","Show Participant Info
Unit: %2/%3/%4")); @@ -543,29 +543,29 @@ void JsonDispatcher::onSAASQLP(const int wsId, const Ladeplatzdaten &exSQLP) NotificationManagement::NotificationType::AdlerNotification, content, args); - DEBUG_LOG() << "Stellungsmeldung Ladeplatz content=" << content; + DEBUG_LOG(m_logger) << "Stellungsmeldung Ladeplatz content=" << content; m_ppmHandler->parseSQLP(exSQLP, wsId); } void JsonDispatcher::onSAATrajectoryData(const int wsId, const Flugbahndaten &exFlugbahndaten, const QString referenceUuid) { - DEBUG_LOG() << "onSAATrajectoryData wsId=" << wsId << ", referenceUuid :" << referenceUuid; + DEBUG_LOG(m_logger) << "onSAATrajectoryData wsId=" << wsId << ", referenceUuid :" << referenceUuid; auto saa = getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "onSAATrajectoryData but SAA with wsId " << wsId << " not found"; + ERROR_LOG(m_logger) << "onSAATrajectoryData but SAA with wsId " << wsId << " not found"; return; } QString referenceUuidAlt = referenceUuid; referenceUuidAlt = referenceUuidAlt.replace(QStringLiteral("-"), QStringLiteral("")); if (!m_trajectoryIdentifier.contains(referenceUuidAlt)) { - DEBUG_LOG() << "referenceUuid not found in m_trajectoryIdentifier" + DEBUG_LOG(m_logger) << "referenceUuid not found in m_trajectoryIdentifier" << ", referenceUuid : " << referenceUuidAlt; for (auto it = m_trajectoryIdentifier.constBegin(); it != m_trajectoryIdentifier.constEnd(); ++it) { - DEBUG_LOG() << "m_trajectoryIdentifier key : " << it.key() << ", value aesItemId :" << it.value().aesItemId << ", explosionId :" << it.value().explosionId; + DEBUG_LOG(m_logger) << "m_trajectoryIdentifier key : " << it.key() << ", value aesItemId :" << it.value().aesItemId << ", explosionId :" << it.value().explosionId; } } @@ -583,7 +583,7 @@ void JsonDispatcher::onSAAHXGuidingLines(const int wsId, const Koordinierungsdat auto saa = getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ HX (K) from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ HX (K) from SAA but SAA with id " << wsId << " not found"; return; } @@ -598,7 +598,7 @@ void JsonDispatcher::onSAAHXGuidingLinesAndBoundaries(const int wsId, const Fueh auto saa = getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ HX (G) from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ HX (G) from SAA but SAA with id " << wsId << " not found"; return; } @@ -614,10 +614,10 @@ void JsonDispatcher::onSSAEXFIREHALT(const int wsId, const FeuerHaltDaten &feuer const auto saa = getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "EX-FH from SSA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "EX-FH from SSA but SAA with id " << wsId << " not found"; } - DEBUG_LOG() << "[EX-FH] data from SSA " << wsId << " : " + DEBUG_LOG(m_logger) << "[EX-FH] data from SSA " << wsId << " : " << "verein: " << feuerhaltdaten.verein << " " << "kenner: " << feuerhaltdaten.kenner.underlying() << " " << "kategorie: " << feuerhaltdaten.kategorie.underlying() << " " @@ -683,7 +683,7 @@ void JsonDispatcher::onWebSocketError() if (!m_webSocket) return; if (!m_bWarnedOnce) - WARNING_LOG() << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); + WARNING_LOG(m_logger) << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); m_webSocket->close(); m_webSocketReconnectTimer->start(5000); m_bWarnedOnce = true; @@ -715,11 +715,11 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram) QJsonDocument doc(telegram); if (!isConnectionTest(doc)) { - DEBUG_LOG() << "Text Message received: " << doc.toJson() << ", wsId: " << wsId; + DEBUG_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId; } else { - TRACE_LOG() << "Text Message received: " << doc.toJson() << ", wsId: " << wsId; + TRACE_LOG(m_logger) << "Text Message received: " << doc.toJson() << ", wsId: " << wsId; } int errorcode = 0; @@ -728,7 +728,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram) - TRACE_LOG() << "errorcode = " << errorcode; + TRACE_LOG(m_logger) << "errorcode = " << errorcode; const int typeId = telegram[JsonKeys::TYPE_ID()].toInt(); if (typeId != TelegramIds::EX_FLUGBAHNDATEN()) return; @@ -738,7 +738,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram) QString errorStr = FehlercodeMap.key(fehlercode); QString completeErrorStr = QStringLiteral("Calculate Trajectory failed: ") + errorStr; - DEBUG_LOG() << "errorStr :" << errorStr << ", completeErrorStr :" << completeErrorStr; + DEBUG_LOG(m_logger) << "errorStr :" << errorStr << ", completeErrorStr :" << completeErrorStr; Core::FunctionReplyObject reply = Core::FunctionReplyObject(-1, tr_lts("dds", completeErrorStr.toStdString()), {errorStr.toStdString()}); reply.setId(m_explosionIndex); @@ -753,7 +753,7 @@ void JsonDispatcher::onRecivedTelegram(int wsId, const QJsonObject &telegram) } void JsonDispatcher::onTextMessageReceived(const QByteArray &message) { - DEBUG_LOG() << "Text Message received: " << message; + DEBUG_LOG(m_logger) << "Text Message received: " << message; m_recvFromWebsocket->handleTelegram(message); } @@ -765,7 +765,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId Core::FunctionReplyObject ret; m_explosionIndex = request.explosionIndex(); m_cookieCalculateTrajectoryAdler = cookie; - DEBUG_LOG() << "Adler Plugin onSendCalculateTrajectoryAdlerRequest" + DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest" << ", m_saaInterfaces.size=" << m_saaInterfaces.size(); int wsId = 0; @@ -775,13 +775,13 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId if (wsId == 0) { - DEBUG_LOG() << " No wsId found wsId=" << wsId << " return"; + DEBUG_LOG(m_logger) << " No wsId found wsId=" << wsId << " return"; ret.setId(request.explosionIndex()); m_ftsTab->adlerCalculateTrajectoryReply(cookie, ret); return; } - DEBUG_LOG() << "Adler Plugin onSendCalculateTrajectoryAdlerRequest" + DEBUG_LOG(m_logger) << "Adler Plugin onSendCalculateTrajectoryAdlerRequest" << " connect to SAA and send data" << ", partyId :" << request.partyId() << ", wsId :" << wsId; ExFlugbahnberechnung exFlugbahnberechnung; @@ -790,7 +790,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId auto saa = getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found"; return; } exFlugbahnberechnung.receiver = saa->getSAAName(); @@ -806,27 +806,27 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId exFlugbahnberechnung.flugbahnberechnungDaten.zielkoordinate.hoehe = request.positionTarget().z(); exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem = ProjectDataManagement::L26_EffectingSystemType::inner_enum(request.weaponSystemType().underlying() + 1); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying(); + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 weaponSystemType " << request.weaponSystemType().underlying(); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem; + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 L26_EffectingSystemType " << exFlugbahnberechnung.flugbahnberechnungDaten.waffensystem; exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte = m_mainDispatcher->pdmHandler()->getDtc()->adlerChargeTypeName(request.trajectory().chargeTypeId()); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory().chargeTypeId(); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 geschosssorte " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte; + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 chargeTypeId " << request.trajectory().chargeTypeId(); + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 geschosssorte " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.geschosssorte; exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender = m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterTypeName(request.trajectory().igniterTypeId()); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory().igniterTypeId(); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuender " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender; + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterTypeId " << request.trajectory().igniterTypeId(); + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuender " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuender; exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion = m_mainDispatcher->pdmHandler()->getDtc()->adlerIgniterFunctionName(request.trajectory().igniterFunctionId()); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory().igniterFunctionId(); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuenderFunktion " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion; + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 igniterFunctionId " << request.trajectory().igniterFunctionId(); + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 zuenderFunktion " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.zuenderFunktion; if (request.trajectory().loadTypeId() > 0) exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung = m_mainDispatcher->pdmHandler()->getDtc()->adlerLoadTypeName(request.trajectory().loadTypeId()); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 ladung " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung; + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 ladung " << exFlugbahnberechnung.flugbahnberechnungDaten.geschoss.ladung; exFlugbahnberechnung.flugbahnberechnungDaten.sprenghoehe = static_cast(request.explosionHeight()); exFlugbahnberechnung.flugbahnberechnungDaten.winkelgruppe = AdlerJson::Winkelgruppe(request.angleGroup().underlying()); @@ -835,12 +835,12 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId if (request.properties().empty()) - ERROR_LOG() << "No properties available"; - DEBUG_LOG() << ", request.aesItemId() :" << request.aesItemId(); + ERROR_LOG(m_logger) << "No properties available"; + DEBUG_LOG(m_logger) << ", request.aesItemId() :" << request.aesItemId(); - DEBUG_LOG() << "UUID=" << exFlugbahnberechnung.uuid; + DEBUG_LOG(m_logger) << "UUID=" << exFlugbahnberechnung.uuid; TrajectoryIdentifier trajectoryIdentifier; trajectoryIdentifier.aesItemId = request.aesItemId(); @@ -851,7 +851,7 @@ void JsonDispatcher::onAdlerCalculateTrajectoryRequest(const rti::core::SampleId QJsonObject telegram; telegram = exFlugbahnberechnung.toJson(); - DEBUG_LOG() << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 " << QJsonDocument(telegram).toJson(QJsonDocument::JsonFormat::Compact); + DEBUG_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!77 " << QJsonDocument(telegram).toJson(QJsonDocument::JsonFormat::Compact); m_sendToWebsocket->onGenericTelegram1(wsId, telegram); } @@ -859,7 +859,7 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int { - DEBUG_LOG() << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId; + DEBUG_LOG(m_logger) << "cleanup saa partyId: " << partyId << " name: " << saaName << " wsId " << wsId; const auto copy = m_saaInterfaces; for (const auto &saa : copy) @@ -867,7 +867,7 @@ void JsonDispatcher::cleanupSaaInterfaces(const QString &saaName, int wsId, int if ((partyId > 0 && saa.get()->getPartyId() == partyId) || (!saaName.isEmpty() && saa.get()->getSAAName() == saaName) || (wsId > 0 && saa.get()->getWsId() == wsId)) { - DEBUG_LOG() << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId(); + DEBUG_LOG(m_logger) << "Cleanup SAA " << saa->getSAAName() << " for Party: " << saa->getPartyId(); m_saaInterfaces.removeOne(saa); } } @@ -894,7 +894,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId, const auto saa = getSAAByWs(wsId); if (!saa) { - WARNING_LOG() << "No valid SAA for wsId"; + WARNING_LOG(m_logger) << "No valid SAA for wsId"; return; } @@ -919,7 +919,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId, partyId, OperatorRights::AdlerExplosionClusterEdit, data.notification().notificationType().underlying()); - DEBUG_LOG() << "getCreateNotificationRequestData recipientIds.size=" << recipientIds.size() + DEBUG_LOG(m_logger) << "getCreateNotificationRequestData recipientIds.size=" << recipientIds.size() << ", exerciseId=" << m_mainDispatcher->exerciseId(); std::vector recipientIdsDds; recipientIdsDds.reserve(recipientIds.size()); @@ -933,7 +933,7 @@ void JsonDispatcher::getCreateNotificationRequestData(const int wsId, addr.name(user.name()); addr.addressType(NotificationManagement::AddressType_def::Operator); notif.recipientIds().push_back(addr); - DEBUG_LOG() << "recipientId=" << addr.name() + DEBUG_LOG(m_logger) << "recipientId=" << addr.name() << ", addr.addressId=" << addr.addressId(); } @@ -952,44 +952,44 @@ void JsonDispatcher::createNotificationRequest(const int wsId, const QString &content, const QStringList &args) { - DEBUG_LOG() << "createNotificationRequest" + DEBUG_LOG(m_logger) << "createNotificationRequest" << ", content=" << content; NotificationManagement::CreateNotification req; getCreateNotificationRequestData(wsId, title, req, content, args); if (req.notification().content().empty()) { - INFO_LOG() << "req.notification().content().empty()"; + INFO_LOG(m_logger) << "req.notification().content().empty()"; return; } req.notification().messageType(messageType); req.notification().notificationType(notificationType); - INFO_LOG() << "trying to send CreateNotificationRequest"; + INFO_LOG(m_logger) << "trying to send CreateNotificationRequest"; if (req.notification().recipientIds().size() == 0) { - INFO_LOG() << "req.notification().recipientIds().size() == 0"; + INFO_LOG(m_logger) << "req.notification().recipientIds().size() == 0"; return; } - INFO_LOG() << "CreateNotificationRequest"; + INFO_LOG(m_logger) << "CreateNotificationRequest"; if (!m_ftcNom->createNotificationRequest(req, this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; } } void JsonDispatcher::onCreateNotificationReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); + INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); if (replyObject.error()) { - ERROR_LOG() << "Error requesting CreateNotification"; + ERROR_LOG(m_logger) << "Error requesting CreateNotification"; return; } else { - DEBUG_LOG() << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok."; + DEBUG_LOG(m_logger) << "Requesting create data ok. Got new id:" << replyObject.id() << " ... ok."; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.h index 29a9c870f..6469de47a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_dispatcher.h @@ -115,6 +115,7 @@ class JsonDispatcher final void websocketConnected(quint16 port); private: + NGL::INGLLogger &m_logger; QUrl webSocketUrl() const; bool isConnectionTest(QJsonDocument &doc); QString getParticipantInfoLink(const QString &verein, const int partyId, const bool isVerbund); @@ -122,6 +123,7 @@ class JsonDispatcher final std::shared_ptr getSAAByName(const QString &saaName); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_recvFromTabCb; std::shared_ptr m_recvFromWebsocket; std::shared_ptr m_sendToWebsocket; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_rx.cpp index aab782b86..821c6c4af 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_rx.cpp @@ -14,15 +14,14 @@ JsonHandlerRx::JsonHandlerRx(const std::shared_ptr &sendToTabCb, JsonDispatcher *dispatcher, AesHandler *aesHandler, - PpmHandler *ppmHandler) - : m_rxHandler(recvFromTabCb) + PpmHandler *ppmHandler) : m_rxHandler(recvFromTabCb) , m_txHandler(sendToTabCb) , m_dispatcher(dispatcher) , m_bWarnedOnce(false) , m_bWarnedOnceTx(false) , m_aesHandler(aesHandler) - , m_ppmHandler(ppmHandler) -{ + , m_ppmHandler(ppmHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &errorcode) { @@ -31,7 +30,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e if (!telegram.contains(JsonKeys::TYPE_ID())) { - ERROR_LOG() << "telegram not contains typeId"; + ERROR_LOG(m_logger) << "telegram not contains typeId"; } const int typeId = telegram[JsonKeys::TYPE_ID()].toInt(); @@ -39,7 +38,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e const QString uuid = telegram[JsonKeys::UUID_()].toString(); const QString referenceUuid = telegram[JsonKeys::REFERENCE_UUID()].toString(); - INFO_LOG() << "[handleTelegram] typeId=" << typeId << " typeName=" << typeName << " uuid=" << uuid << " referenceUuid=" << referenceUuid; + INFO_LOG(m_logger) << "[handleTelegram] typeId=" << typeId << " typeName=" << typeName << " uuid=" << uuid << " referenceUuid=" << referenceUuid; try { @@ -53,7 +52,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e QString szenarName = dataObj.value(JsonKeys::SZENAR()).toString(); bool isVerbund = dataObj.value(JsonKeys::ADLER_VERBUND()).toBool(); m_dispatcher->onSAARegistration(wsId, partyId, saaName, szenarName, isVerbund, uuid); - WARNING_LOG() << "On Register ------------------- partyId= " << partyId << ", saaName= " << saaName << ", szenarName= " << szenarName + WARNING_LOG(m_logger) << "On Register ------------------- partyId= " << partyId << ", saaName= " << saaName << ", szenarName= " << szenarName << ", isVerbund= " << isVerbund << ", wsId= " << wsId; break; } @@ -61,18 +60,18 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e { const int partyId = telegram[JsonKeys::DATA()].toObject().value(JsonKeys::PARTY_ID()).toInt(0); m_dispatcher->onSAADeregistration(wsId, partyId); - WARNING_LOG() << "[EX_DEREGISTRATION_REQUEST] EX-Abmeldung -------------------------------------"; + WARNING_LOG(m_logger) << "[EX_DEREGISTRATION_REQUEST] EX-Abmeldung -------------------------------------"; break; } case TelegramIds::EX_CONNECTION_TEST_REQUEST(): { - DEBUG_LOG() << "[EX_CONNECTION_TEST_REQUEST] EX-Verbindungsanfrage -------------------------------------"; + DEBUG_LOG(m_logger) << "[EX_CONNECTION_TEST_REQUEST] EX-Verbindungsanfrage -------------------------------------"; m_dispatcher->onSAAConnectionTest(wsId, uuid); break; } case TelegramIds::EX_STATUS(): { - WARNING_LOG() << "[EX_STATUS] EX-Status -------------------------------------"; + WARNING_LOG(m_logger) << "[EX_STATUS] EX-Status -------------------------------------"; auto data = telegram[JsonKeys::DATA()]; const QString status = data.toObject().value(JsonKeys::STATUS()).toString(QStringLiteral("")); @@ -84,7 +83,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_TQ(): { - WARNING_LOG() << "[EX_TQ] Technische Quittierung -------------------------------------"; + WARNING_LOG(m_logger) << "[EX_TQ] Technische Quittierung -------------------------------------"; const auto data = telegram[JsonKeys::DATA()].toObject(); bool bOk = true; TechnischeDaten technischeDaten; @@ -94,7 +93,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_FIRE(): { - WARNING_LOG() << "[EX-FQ(FN)] EX-Feuern -------------------------------------"; + WARNING_LOG(m_logger) << "[EX-FQ(FN)] EX-Feuern -------------------------------------"; auto data = telegram[JsonKeys::DATA()].toObject(); bool bOk = true; Feuerkampfdaten exFire; @@ -107,12 +106,12 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_AWES_PLANNING(): { - WARNING_LOG() << "[EX_AWES_PLANNING] EX-FQ(BA-BB-FK) Wirkfeldplanung"; + WARNING_LOG(m_logger) << "[EX_AWES_PLANNING] EX-FQ(BA-BB-FK) Wirkfeldplanung"; auto data = telegram[JsonKeys::DATA()].toObject(); WirkfeldplanungData wirkfeldplanungData; bool bOk = true; wirkfeldplanungDataFromJson(data, wirkfeldplanungData, bOk); - DEBUG_LOG() << "\n-------------------" + DEBUG_LOG(m_logger) << "\n-------------------" << "\nwirkfeldplanungData" << "\n dauer: " << wirkfeldplanungData.dauer << "\n abfeuerungsArt: " << static_cast(wirkfeldplanungData.abfeuerungsArt) << "\n feuerkampfReferenz: '" << wirkfeldplanungData.feuerkampfReferenz << "'" @@ -124,14 +123,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_POSITION_REPORT_WEAPON(): { - DEBUG_LOG() << "[EX_POSITION_REPORT_WEAPON] Ex-SQ(WS) Stellungsmeldung Waffensystem"; + DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_WEAPON] Ex-SQ(WS) Stellungsmeldung Waffensystem"; auto data = telegram[JsonKeys::DATA()].toObject(); Waffensystemdaten exSQWS; bool bOk = true; waffensystemdatenFromJson(data, exSQWS, bOk); if (!bOk) { - ERROR_LOG() << "Received Ex-SQ(WS) but couldn't parse the jsondata "; + ERROR_LOG(m_logger) << "Received Ex-SQ(WS) but couldn't parse the jsondata "; break; } @@ -141,14 +140,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_POSITION_REPORT_FIRE(): { - DEBUG_LOG() << "[EX_POSITION_REPORT_FIRE] Ex-SQ(FS) Stellungsmeldung Feuerstellung"; + DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_FIRE] Ex-SQ(FS) Stellungsmeldung Feuerstellung"; auto data = telegram[JsonKeys::DATA()].toObject(); Feuerstellungsdaten exSQFS; bool bOk = true; feuerstellungsdatenFromJson(data, exSQFS, bOk); if (!bOk) { - ERROR_LOG() << "Received Ex-SQ(FS) but couldn't parse the jsondata "; + ERROR_LOG(m_logger) << "Received Ex-SQ(FS) but couldn't parse the jsondata "; break; } @@ -158,14 +157,14 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_POSITION_REPORT_LOADING_PLACE(): { - DEBUG_LOG() << "[EX_POSITION_REPORT_LOADING_PLACE] EX-SQ(LP)Stellungsmeldung Ladeplatz"; + DEBUG_LOG(m_logger) << "[EX_POSITION_REPORT_LOADING_PLACE] EX-SQ(LP)Stellungsmeldung Ladeplatz"; auto data = telegram[JsonKeys::DATA()].toObject(); Ladeplatzdaten exSQLP; bool bOk = true; ladeplatzdatenFromJson(data, exSQLP, bOk); if (!bOk) { - ERROR_LOG() << "Received Ex-SQ(LP) but couldn't parse the jsondata "; + ERROR_LOG(m_logger) << "Received Ex-SQ(LP) but couldn't parse the jsondata "; break; } @@ -175,17 +174,17 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_FLUGBAHNDATEN(): { - DEBUG_LOG() << "[EX_FLUGBAHNDATEN] EX-Flugbahndaten"; + DEBUG_LOG(m_logger) << "[EX_FLUGBAHNDATEN] EX-Flugbahndaten"; auto data = telegram[JsonKeys::DATA()].toObject(); Flugbahndaten flugbahndaten; bool bOk = true; flugbahndatenFromJson(data, flugbahndaten, bOk); if (!bOk) { - ERROR_LOG() << "Received EX-Flugbahndaten but couldn't parse the jsondata "; + ERROR_LOG(m_logger) << "Received EX-Flugbahndaten but couldn't parse the jsondata "; break; } - DEBUG_LOG() << "Vor onSAATrajectoryData wsId=" << wsId; + DEBUG_LOG(m_logger) << "Vor onSAATrajectoryData wsId=" << wsId; if (static_cast(flugbahndaten.fehlercode) == 0) m_dispatcher->onSAATrajectoryData(wsId, flugbahndaten, referenceUuid); else @@ -194,7 +193,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_GUIDING_LINES(): { - DEBUG_LOG() << "[EX_GUIDING_LINES] EX-HQ Koordinierungsmassnahmen"; + DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES] EX-HQ Koordinierungsmassnahmen"; auto data = telegram[JsonKeys::DATA()].toObject(); Koordinierungsdaten koordinierungsdaten; bool bOk = true; @@ -210,7 +209,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_GUIDING_LINES_AND_BOUNDARIES(): { - DEBUG_LOG() << "[EX_GUIDING_LINES_AND_BOUNDARIES] EX-HQ(G)Fuehrungslinien und Grenzen "; + DEBUG_LOG(m_logger) << "[EX_GUIDING_LINES_AND_BOUNDARIES] EX-HQ(G)Fuehrungslinien und Grenzen "; auto data = telegram[JsonKeys::DATA()].toObject(); Fuehrungsdaten fuehrungsdaten; bool bOk = true; @@ -226,7 +225,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_FIRE_HALT(): { - WARNING_LOG() << "[EX_FIRE_HALT] Feuerhalt"; + WARNING_LOG(m_logger) << "[EX_FIRE_HALT] Feuerhalt"; auto data = telegram[QStringLiteral("data")].toObject(); bool bOk = true; @@ -239,7 +238,7 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } case TelegramIds::EX_DONT_FIRE(): { - WARNING_LOG() << "[EX_DONT_FIRE] Dont Fire"; + WARNING_LOG(m_logger) << "[EX_DONT_FIRE] Dont Fire"; auto data = telegram[QStringLiteral("data")].toObject(); bool bOk = true; Feuerkampfdaten feuerkampfdaten; @@ -251,20 +250,20 @@ bool JsonHandlerRx::handleTelegram(int wsId, const QJsonObject &telegram, int &e } default: { - WARNING_LOG() << "Cant handle Telegram typeId=" << typeId; + WARNING_LOG(m_logger) << "Cant handle Telegram typeId=" << typeId; } } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << ")"; return false; } return true; } bool JsonHandlerRx::handleTelegram(const QByteArray &baJson) { - DEBUG_LOG() << "JsonHandlerRx::handleTelegram"; + DEBUG_LOG(m_logger) << "JsonHandlerRx::handleTelegram"; if (baJson.isEmpty()) return false; @@ -273,19 +272,19 @@ bool JsonHandlerRx::handleTelegram(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); if (typeId.toInt() != 21) - ERROR_LOG() << "Telegram before filter: " << baJson; + ERROR_LOG(m_logger) << "Telegram before filter: " << baJson; try { QJsonValue header = data[QStringLiteral("header")]; QJsonObject obj = header.toObject(); - ERROR_LOG() << "Telegram header: " << obj.count(); + ERROR_LOG(m_logger) << "Telegram header: " << obj.count(); if (!obj.isEmpty()) { int eqNo = obj[QStringLiteral("equipmentNumber")].toInt(0); @@ -295,11 +294,11 @@ bool JsonHandlerRx::handleTelegram(const QByteArray &baJson) return false; } if (typeId.toInt() != 21) - ERROR_LOG() << "Telegram after filter: " << baJson; + ERROR_LOG(m_logger) << "Telegram after filter: " << baJson; } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -313,7 +312,7 @@ template void JsonHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; @@ -328,7 +327,7 @@ template void JsonHandlerRx::txData(const T &data) { if (!m_bWarnedOnceTx) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnceTx = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_tx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_tx.cpp index bb209aef8..cde4ecaaa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_tx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/json_handler_tx.cpp @@ -39,7 +39,7 @@ void JsonHandlerTx::onWebsocketConnectedToExternalSystem(bool bConnected) { m_bWebsocketConnectedToExternalSystem = bConnected; - INFO_LOG() << "Connected to SAA"; + INFO_LOG(m_logger) << "Connected to SAA"; const auto tele2 = m_pdp->exerciseEnvironmentData(); sendToTx(&tele2, true); connect(m_mainDispatcher->aesHandler().get(), &AesHandler::explosionSingleChanged, this, &JsonHandlerTx::onGenericTelegram, Qt::UniqueConnection); @@ -353,7 +353,7 @@ bool JsonHandlerTx::txData(const TrainingAreaBase::TetraIcd::ExConfirmationRepor void JsonHandlerTx::onParticipantConnectionState(const int equipmentNumber, const bool dataCommunicationPossible) { - INFO_LOG() << "onParticipantConnectionState - " << equipmentNumber + INFO_LOG(m_logger) << "onParticipantConnectionState - " << equipmentNumber << ", communication possible: " << dataCommunicationPossible; if (equipmentNumber == -1) m_dataCommunicationPossible.clear(); @@ -365,7 +365,7 @@ void JsonHandlerTx::onGenericTelegram(const QJsonObject &telegram) if (!m_webSocket || !m_bWebsocketConnectedToExternalSystem) return; const QByteArray ba = QJsonDocument(telegram).toJson(QJsonDocument::Compact); - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; m_webSocket->sendTextMessage(QString::fromUtf8(ba)); } @@ -381,7 +381,7 @@ bool JsonHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTeleg telegram[QStringLiteral("data")] = data->toJson(); telegram[QStringLiteral("type")] = data->type(); telegram[QStringLiteral("typeId")] = data->id(); - ERROR_LOG() << QJsonDocument(telegram).toJson(QJsonDocument::Compact).toStdString(); + ERROR_LOG(m_logger) << QJsonDocument(telegram).toJson(QJsonDocument::Compact).toStdString(); onGenericTelegram(telegram); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.cpp index ceae1438e..a81211dcd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.cpp @@ -26,7 +26,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp, , m_domainId(pdp->domainId()) , m_exerciseId(pdp->exerciseId()) { - INFO_LOG() << "Plugin AdlerJson started"; + INFO_LOG(m_logger) << "Plugin AdlerJson started"; } MainDispatcher::~MainDispatcher() @@ -79,7 +79,7 @@ bool MainDispatcher::init() } void MainDispatcher::onWebsocketConnected(quint16 port) { - ERROR_LOG() << "ApAdler started, Domain Id: " << QString::number(port); + ERROR_LOG(m_logger) << "ApAdler started, Domain Id: " << QString::number(port); m_ddsHandler->pacemaker()->addPort(port, Core::PortType::WebSocketAdlerServer); m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.h index 91dd21c35..1baee6b30 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/main_dispatcher.h @@ -55,6 +55,7 @@ public: const char *name () const override { return tr_lts("dds", "ApHlaJson"); } private: + NGL::INGLLogger &m_logger; JsonDispatcher *m_adlerDispatcher; std::shared_ptr m_recvFromTabCb; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.cpp index 98717dcf5..daf626e7e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.cpp @@ -10,9 +10,8 @@ namespace AdlerJson { -PdmHandler::PdmHandler(QObject *parent) - : QObject(parent) -{} +PdmHandler::PdmHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool PdmHandler::init(MainDispatcher* mainDispatcher) { @@ -20,7 +19,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher) if (!m_dtcPdm->enableChargeType()) { - ERROR_LOG() << "Can not read data from Pdm"; + ERROR_LOG(m_logger) << "Can not read data from Pdm"; return false; } @@ -33,7 +32,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher) void PdmHandler::getChargeTypes() { - DEBUG_LOG() << "Get Charge Types"; + DEBUG_LOG(m_logger) << "Get Charge Types"; QJsonObject obj; QJsonArray dataArray; obj[QStringLiteral("type")] = QStringLiteral("ApacheHlaSendChargeTypes"); @@ -43,7 +42,7 @@ void PdmHandler::getChargeTypes() QMap chargeTypes = m_dtcPdm->chargeTypes(); QMap gearTypes = m_dtcPdm->gearTypes(); QMap gearTypeChargeTypes = m_dtcPdm->gearTypeChargeTypes(); - DEBUG_LOG() << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though."; + DEBUG_LOG(m_logger) << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though."; for(const ProjectDataManagement::ChargeType &charge : chargeTypes) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.h index b225c2d23..173c2b2f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/pdm_handler.h @@ -32,6 +32,7 @@ public slots: private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtcPdm; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.cpp index d81e791a5..85f1d69fc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.cpp @@ -36,10 +36,10 @@ bool PpmHandler::init(MainDispatcher *mainDispatcher) m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_mainDispatcher->ddsHandler()->ddsConnector()); - DEBUG_LOG() << "-------------<><><>------" << m_mainDispatcher->exerciseId(); + DEBUG_LOG(m_logger) << "-------------<><><>------" << m_mainDispatcher->exerciseId(); if (!m_dtcPpm->enableParticipant() || !m_dtcPpm->enableDynamicParticipantData() || !m_dtcPpm->enableParticipantPosition()) { - ERROR_LOG() << "Can not read data from Ppm"; + ERROR_LOG(m_logger) << "Can not read data from Ppm"; return false; } @@ -70,7 +70,7 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId, const ParticipantManagement::ConnectState &connectState, const bool isVerbund) { - DEBUG_LOG() << "modifyParty" + DEBUG_LOG(m_logger) << "modifyParty" << " assetId=" << assetId << " partyId=" << partyId << " saaName=" << saaName << " szenarName=" << szenarName << " connectState=" << connectState << " isVerbund=" << isVerbund; @@ -93,11 +93,11 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId, if (parserError.error != QJsonParseError::NoError) { - ERROR_LOG() << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'"; + ERROR_LOG(m_logger) << "Error parsing json document: " << parserError.errorString() << " '" << propertiesBa << "'"; doc = QJsonDocument(); } - DEBUG_LOG() << "json to parse: " << doc.toJson(); + DEBUG_LOG(m_logger) << "json to parse: " << doc.toJson(); QJsonObject obj(doc.object()); obj[QStringLiteral("Adler")] = adlerPropertiesObj; @@ -110,11 +110,11 @@ void PpmHandler::modifyPartyAdlerProperties(const int wsId, void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId) { - DEBUG_LOG() << "Start parse SQFS"; + DEBUG_LOG(m_logger) << "Start parse SQFS"; auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found"; return; } const QString &verein = exSQFS.feuereinheit.verein; @@ -179,7 +179,7 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId) const auto root = findRootUnit(saa->getPartyId()); if (root.id() > 0) { - DEBUG_LOG() << "Append FS Unit to root Unit"; + DEBUG_LOG(m_logger) << "Append FS Unit to root Unit"; list.push_back(root); } @@ -214,11 +214,11 @@ void PpmHandler::parseSQFS(const Feuerstellungsdaten &exSQFS, const int wsId) void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) { - DEBUG_LOG() << "Start parse SQWS"; + DEBUG_LOG(m_logger) << "Start parse SQWS"; auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ WS from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ WS from SAA but SAA with id " << wsId << " not found"; return; } const ProjectDataManagement::L27_EffectorId &internalName = exSQWS.kenner; @@ -253,7 +253,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) if (pp.id() > 0) { - DEBUG_LOG() << "Found Participant only update pos"; + DEBUG_LOG(m_logger) << "Found Participant only update pos"; sendPositionFromTempMap(currentRandomNumber, saa->getPartyId(), saa->getIsVerbund()); sendChargesFromTempMap(currentRandomNumber, saa->getPartyId(), saa->getIsVerbund()); @@ -267,10 +267,10 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) const ParticipantManagement::Type type = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType.underlying()), false, saa->getIsVerbund()); - DEBUG_LOG() << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType); + DEBUG_LOG(m_logger) << "found type with id: " << type.id() << " for name: " << waffensystemtypMap.key(internalType); if (type.id() <= 0) { - ERROR_LOG() << "NO Type Found"; + ERROR_LOG(m_logger) << "NO Type Found"; return; } @@ -280,12 +280,12 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) uint superiorModId = QRandomGenerator::global()->generate() / 2; ParticipantManagement::Participant pUnit = findParticipantByInternalName(verein, saa->getPartyId(), saa->getIsVerbund()); - DEBUG_LOG() << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId(); + DEBUG_LOG(m_logger) << "Looking for Verein: " << verein << " found Unit: " << pUnit.id() << " foundData: " << pUdata.modId(); if (pUdata.modId() > 0) { superiorModId = pUdata.modId(); - DEBUG_LOG() << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber; + DEBUG_LOG(m_logger) << "FOUND UNIT in list use their modId " << superiorModId << " RND: " << currentRandomNumber; } else if (pUnit.id() > 0) { @@ -296,7 +296,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) list.push_back(pUData); m_tempPartDataList.insert(currentRandomNumber, list); - DEBUG_LOG() << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber; + DEBUG_LOG(m_logger) << "CREATE Uit from ppm " << superiorModId << " RND: " << currentRandomNumber; ParticipantManagement::Participant tmp = pUnit; while (tmp.superiorId() > 0) { @@ -314,11 +314,11 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) const auto root = findRootUnit(saa->getPartyId()); if (root.id() > 0) { - DEBUG_LOG() << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber; + DEBUG_LOG(m_logger) << "Append to Unit" << superiorModId << " RND: " << currentRandomNumber; list.push_back(root); } const ParticipantManagement::Type unitType = m_dtcPpm->getTypeFromAdlerType(waffensystemtypMap.key(internalType), true, saa->getIsVerbund()); - DEBUG_LOG() << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber; + DEBUG_LOG(m_logger) << "CREATE NEW Unit use supId" << superiorModId << " RND: " << currentRandomNumber; ParticipantManagement::ParticipantData data; data.id(0); data.partyId(saa->getPartyId()); @@ -337,7 +337,7 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) list.push_back(data); } - DEBUG_LOG() << "Create new Participant" + DEBUG_LOG(m_logger) << "Create new Participant" << " RND: " << currentRandomNumber; ParticipantManagement::ParticipantData data; @@ -366,11 +366,11 @@ void PpmHandler::parseSQWS(const Waffensystemdaten &exSQWS, const int wsId) void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId) { - DEBUG_LOG() << "START parse SQLP"; + DEBUG_LOG(m_logger) << "START parse SQLP"; auto saa = m_mainDispatcher->jsonDispatcher()->getSAAByWs(wsId); if (!saa) { - ERROR_LOG() << "SQ LP from SAA but SAA with id " << wsId << " not found"; + ERROR_LOG(m_logger) << "SQ LP from SAA but SAA with id " << wsId << " not found"; return; } const QString &verein = exSQLP.einheit.verein; @@ -409,7 +409,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId) - DEBUG_LOG() << "Create new Participant LP"; + DEBUG_LOG(m_logger) << "Create new Participant LP"; std::vector list; @@ -418,7 +418,7 @@ void PpmHandler::parseSQLP(const Ladeplatzdaten &exSQLP, const int wsId) const auto root = findRootUnit(saa->getPartyId()); if (root.id() > 0) { - DEBUG_LOG() << "Append LP to Unit"; + DEBUG_LOG(m_logger) << "Append LP to Unit"; list.push_back(root); } @@ -471,7 +471,7 @@ void PpmHandler::removeAllSAAParticipants(const int partyId) list.push_back(pToDel); } req.data(list); - DEBUG_LOG() << "Remove all participants (without Units): " << list.size(); + DEBUG_LOG(m_logger) << "Remove all participants (without Units): " << list.size(); m_ftcPpm->modifyParticipantDataRequest(req, this); } @@ -676,7 +676,7 @@ void PpmHandler::onSendParticipantDataTimeout() { m_sendParticipantDataTimer->stop(); if (m_randomNumbers.empty()) - ERROR_LOG() << "Cant Send ParticipantData RandomNumbers is empty"; + ERROR_LOG(m_logger) << "Cant Send ParticipantData RandomNumbers is empty"; ParticipantManagement::ModifyParticipantDataRequest *newRequest = new ParticipantManagement::ModifyParticipantDataRequest(); int currentRandomNumber = m_randomNumbers.first(); newRequest->requestId(currentRandomNumber); @@ -707,7 +707,7 @@ void PpmHandler::handleParticipantPositionChangedExternal(const ParticipantManag void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position) { - DEBUG_LOG() << "handleParticipantPositionChangedInternal"; + DEBUG_LOG(m_logger) << "handleParticipantPositionChangedInternal"; ParticipantManagement::Participant part = m_dtcPpm->participant(position.participantId()); const bool hasMountedParticipants = position.mountedParticipants().is_set() && position.mountedParticipants().get().size() > 0; @@ -739,7 +739,7 @@ void PpmHandler::handleParticipantPositionChangedInternal(const ParticipantManag void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant &part, const ParticipantManagement::Participant &partToBeMounted) { m_mountedParticipants.insert(part.equipmentNumber().get(), partToBeMounted.equipmentNumber().get()); - ERROR_LOG() << "Mount Participant"; + ERROR_LOG(m_logger) << "Mount Participant"; QJsonObject telegram; telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantMount"); @@ -759,7 +759,7 @@ void PpmHandler::sendParticipantMount(const ParticipantManagement::Participant & void PpmHandler::sendParticipantUnmount(const ParticipantManagement::Participant &participant) { m_mountedParticipants.remove(participant.equipmentNumber().get()); - DEBUG_LOG() << "Unmount Participant"; + DEBUG_LOG(m_logger) << "Unmount Participant"; QJsonObject telegram; telegram[QStringLiteral("type")] = QStringLiteral("UFomHlaParticipantUnmount"); @@ -800,7 +800,7 @@ void PpmHandler::sendParticipantPositionChanged(const ParticipantManagement::Par void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "Got Function Reply " << reply.str(); + DEBUG_LOG(m_logger) << "Got Function Reply " << reply.str(); if (!reply.error()) { @@ -815,7 +815,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r const bool isVerbund = m_mainDispatcher->jsonDispatcher()->getSAAByParty(partyId)->getIsVerbund(); - DEBUG_LOG() << "Got ModifyParticipant Reply SEND from temp Maps (partyId: " << partyId << " , isVerbund: " << isVerbund << ")"; + DEBUG_LOG(m_logger) << "Got ModifyParticipant Reply SEND from temp Maps (partyId: " << partyId << " , isVerbund: " << isVerbund << ")"; if (m_tempPositionMap.contains(reply.id())) sendPositionFromTempMap(reply.id(), partyId, isVerbund); @@ -828,7 +828,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r } else { - ERROR_LOG() << "GOT ModifyParticipant Replay with error " << reply.translated(); + ERROR_LOG(m_logger) << "GOT ModifyParticipant Replay with error " << reply.translated(); } @@ -845,7 +845,7 @@ void PpmHandler::onModifyParticipantDataReply(const Core::FunctionReplyObject &r m_tempPartDataList.remove(reply.id()); } -void PpmHandler::onModifyPartyDataReply(const Core::FunctionReplyObject &reply) { DEBUG_LOG() << "Got Function Reply " << reply.str(); } +void PpmHandler::onModifyPartyDataReply(const Core::FunctionReplyObject &reply) { DEBUG_LOG(m_logger) << "Got Function Reply " << reply.str(); } QList PpmHandler::findAllSAAParticipants(const int partyId) { @@ -908,7 +908,7 @@ ParticipantManagement::ParticipantData PpmHandler::findRootUnit(const int partyI ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(const QString &internalName, const int partyId, const bool isVerbund) { ParticipantManagement::Participant pp; - DEBUG_LOG() << "START find participant: " << internalName; + DEBUG_LOG(m_logger) << "START find participant: " << internalName; auto participantMap = m_dtcPpm->participants(); for (const auto &part : std::as_const(participantMap)) { @@ -931,13 +931,13 @@ ParticipantManagement::Participant PpmHandler::findParticipantByInternalName(con void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataModification modType) { - DEBUG_LOG() << Q_FUNC_INFO << ", modType: " << modType; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << ", modType: " << modType; if (modType == DataModification::eRemoved) return; const ParticipantManagement::ConnectState connectState = m_dtcPpm->saaConnectedState(data.id()); - DEBUG_LOG() << "++++ connectState: " << connectState; + DEBUG_LOG(m_logger) << "++++ connectState: " << connectState; if (connectState != ParticipantManagement::ConnectState::Disconnecting) @@ -947,7 +947,7 @@ void PpmHandler::onPartyChanged(const ParticipantManagement::Party &data, DataMo if (!saa) return; - DEBUG_LOG() << "++++ szenarName: " << saa->getSzenarName() << ", wsId: " << saa->getWsId(); + DEBUG_LOG(m_logger) << "++++ szenarName: " << saa->getSzenarName() << ", wsId: " << saa->getWsId(); EXStatus status; status.status = Szenarstatus::Gestoppt; @@ -1015,7 +1015,7 @@ void PpmHandler::sendChargesFromTempMap(const int rndNmbr, const int partyId, co if (chargeTypeId <= 0) continue; - DEBUG_LOG() << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : ""); + DEBUG_LOG(m_logger) << "---- participant.id:" << participant.id() << (participant.typeId() == type.id() ? " (Ladeplatz)" : ""); QVector gearTypesIds = m_mainDispatcher->pdmHandler()->getDtc()->gearTypeIdFromChargeTypeId(chargeTypeId); @@ -1059,7 +1059,7 @@ int PpmHandler::convertStatus_L28(const ProjectDataManagement::L28_Status &statu return ADLER_NOT_OPERATIONAL; default: - WARNING_LOG() << "Status " << status << " not handled in switch"; + WARNING_LOG(m_logger) << "Status " << status << " not handled in switch"; break; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h index 72b3240d4..cc1d03af0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ppm_handler.h @@ -65,6 +65,7 @@ private slots: void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); void onSendParticipantDataTimeout(); private: + NGL::INGLLogger &m_logger; void handleParticipantPositionChangedExternal(const ParticipantManagement::ParticipantPosition &position); void handleParticipantPositionChangedInternal(const ParticipantManagement::ParticipantPosition &position); @@ -85,6 +86,7 @@ private: QVector sumUpAnzahlForSameGeschoss(const QVector &geschosse) const; private: + NGL::INGLLogger &m_logger; MainDispatcher *m_mainDispatcher; std::shared_ptr m_dtcPpm; std::shared_ptr m_ftcPpm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.cpp index 5fc7d5d55..3aca9071c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.cpp @@ -73,7 +73,7 @@ bool SAAInterface::init(std::shared_ptr ppmHandler, m_ftcAes = m_aesHandler->getFtc(); - DEBUG_LOG() << "INIT SAA Interface"; + DEBUG_LOG(m_logger) << "INIT SAA Interface"; return true; } @@ -123,7 +123,7 @@ static Core::RelativePositionRelativeTime convertFlugbahnpunkt(const Flugbahnpun void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int aesItemId, int exposionId, const Core::GeoPosition &positionLaunch) { - DEBUG_LOG() << "SAAInterface::parseFlugbahndaten"; + DEBUG_LOG(m_logger) << "SAAInterface::parseFlugbahndaten"; std::vector geometryRef; geometryRef.clear(); @@ -138,22 +138,22 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae const auto &utmLaunch = LtsCoordTrans::UtmCoordinate::fromGeographic(positionLaunch.lon(), positionLaunch.lat(), zone); - DEBUG_LOG() << " mmilirad: " << flugbahndaten.schussrichtung; + DEBUG_LOG(m_logger) << " mmilirad: " << flugbahndaten.schussrichtung; double grad = (flugbahndaten.schussrichtung / 6400.) * 360.0; - DEBUG_LOG() << " milli rad to degree" << (flugbahndaten.schussrichtung / 6400.) * 360; - DEBUG_LOG() << "Degree to target" << grad; + DEBUG_LOG(m_logger) << " milli rad to degree" << (flugbahndaten.schussrichtung / 6400.) * 360; + DEBUG_LOG(m_logger) << "Degree to target" << grad; - DEBUG_LOG() << "Start point: " << positionLaunch; + DEBUG_LOG(m_logger) << "Start point: " << positionLaunch; const auto &coordEnd = LtsCoordTrans::UtmCoordinate::fromGeographic(flugbahndaten.zielkoordinate.koordinate.longitude * (M_PI / 180.0), flugbahndaten.zielkoordinate.koordinate.latitude * (M_PI / 180.0)); - DEBUG_LOG() << "End point: " << coordEnd; + DEBUG_LOG(m_logger) << "End point: " << coordEnd; LtsCoordTrans::UtmCoordinate coordDiff = coordEnd; coordDiff.x = coordDiff.x - utmLaunch.x; coordDiff.y = coordDiff.y - utmLaunch.y; const double useNewGrad = -90 + std::atan2(coordDiff.y, coordDiff.x) * (180.0 / M_PI); - DEBUG_LOG() << "use new Degree " << useNewGrad; + DEBUG_LOG(m_logger) << "use new Degree " << useNewGrad; QTransform matrix; matrix.rotate(useNewGrad); @@ -169,11 +169,11 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae if (m_logger.isDebugEnabled()) { const auto &fbPosRelative = convertFlugbahnpunkt(pos, matrix, utmLaunch, m_logger); - DEBUG_LOG() << " fbPosRelative " << fbPosRelative; + DEBUG_LOG(m_logger) << " fbPosRelative " << fbPosRelative; } - TRACE_LOG() << "Flugbahnpunkt:" + TRACE_LOG(m_logger) << "Flugbahnpunkt:" << ", xRelativ :" << pos.xRelativ << ", yRelativ :" << pos.yRelativ << ", zRelativ :" << pos.zRelativ @@ -198,7 +198,7 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae utmCoord.zone = utmLaunch.zone; QPointF pntGeo = utmCoord.geographic(); - TRACE_LOG() << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid() + TRACE_LOG(m_logger) << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid() << ", pntGeo :" << pntGeo.x() << " / " << pntGeo.y() << " / " << z; QTransform matrix; matrix.rotate(useNewGrad); @@ -210,15 +210,15 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae flightPoint.relativeTime() = pos.zeit; QPointF point(flightPoint.offsetX(), flightPoint.offsetY()); - TRACE_LOG() << " POS bevore rot: " << point; + TRACE_LOG(m_logger) << " POS bevore rot: " << point; auto rotatePoint = matrix.map(point); - TRACE_LOG() << " POS after rot: " << rotatePoint; + TRACE_LOG(m_logger) << " POS after rot: " << rotatePoint; pntGeo.setX(rotatePoint.x()); pntGeo.setY(rotatePoint.y()); - TRACE_LOG() << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid() + TRACE_LOG(m_logger) << "utmCoord :" << utmCoord.x << " / " << utmCoord.y << ", utmCoord.zone :" << utmCoord.zone << ", utmCoord.isValid() :" << utmCoord.isValid() << ", pntGeo :" << pntGeo.x() << " / " << pntGeo.y() << " / " << z; @@ -245,7 +245,7 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae newRequest->mhpScatterWidthDetonationHeight(flugbahndaten.streuung.seitenstreuungH); newRequest->shootDirection((flugbahndaten.schussrichtung / 6400.) * 360); newRequest->errorcode(static_cast(flugbahndaten.fehlercode)); - DEBUG_LOG() << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size() + DEBUG_LOG(m_logger) << "!!!!!!!!!!!geometryRef.size=" << geometryRef.size() << ", newRequest->geometry().size() :" << newRequest->geometry().size() << ", newRequest->errorcode :" << newRequest->errorcode() << ", newRequest->Peak:" << newRequest->peakAltitude() << ", newRequest->direction:" << newRequest->shootDirection() << ", flugbahndaten.fehlercode :" << static_cast(flugbahndaten.fehlercode); @@ -254,10 +254,10 @@ void SAAInterface::parseFlugbahndaten(const Flugbahndaten &flugbahndaten, int ae void SAAInterface::onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) { - DEBUG_LOG() << "onTrajectoryAdlerModifyReply"; + DEBUG_LOG(m_logger) << "onTrajectoryAdlerModifyReply"; if (reply.error()) { - ERROR_LOG() << reply.translated(); + ERROR_LOG(m_logger) << reply.translated(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.h index 7f00b100c..84fa31ddc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/saa_interface.h @@ -75,6 +75,8 @@ public: void rxData (const T &data ); private: + +NGL::INGLLogger &m_logger; void onTrajectoryAdlerModifyReply(const Core::FunctionReplyObject &reply) override; int m_wsId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ws_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ws_handler.cpp index 9e83d8539..7ab3f24ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ws_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/ws_handler.cpp @@ -58,25 +58,25 @@ bool WebSocketHandler::sendTelegram(int typeId, const QJsonObject *data, int exe bool WebSocketHandler::sendTelegram(const int wsId, const QJsonObject *data) { - DEBUG_LOG() << "Send Telegram esId=" << wsId + DEBUG_LOG(m_logger) << "Send Telegram esId=" << wsId << ", m_connections.size=" << m_connections.size(); for (auto it = m_connections.begin(); it != m_connections.end(); it++) - DEBUG_LOG() << "key: " << it.key(); + DEBUG_LOG(m_logger) << "key: " << it.key(); const QString jsonStr = QString::fromUtf8(QJsonDocument(*data).toJson(QJsonDocument::Compact)); if(!m_connections.contains(wsId)) { - DEBUG_LOG() << "!m_connections.contains(" << wsId << ") return false;"; + DEBUG_LOG(m_logger) << "!m_connections.contains(" << wsId << ") return false;"; return false; } std::shared_ptr ws = m_connections.value(wsId); - DEBUG_LOG() << "Send Telegram to SAA: " << jsonStr<< " \n LocalPort" << ws->webSocket()->localAddress().toString() + DEBUG_LOG(m_logger) << "Send Telegram to SAA: " << jsonStr<< " \n LocalPort" << ws->webSocket()->localAddress().toString() << "." << ws->webSocket()->localPort() << " PeerPort " << ws->webSocket()->peerAddress().toString() << ":" <webSocket()->peerPort(); - DEBUG_LOG() << "VERSION " << ws->webSocket()->version(); + DEBUG_LOG(m_logger) << "VERSION " << ws->webSocket()->version(); return ws->sendTextMessage(jsonStr); } @@ -84,7 +84,7 @@ bool WebSocketHandler::disconnectWs(int wsId) { if(!m_connections.contains(wsId)) { - DEBUG_LOG() << "!m_connections.contains(" << wsId << ") return false;"; + DEBUG_LOG(m_logger) << "!m_connections.contains(" << wsId << ") return false;"; return false; } std::shared_ptr ws = m_connections.value(wsId); @@ -124,7 +124,7 @@ int WebSocketHandler::getExerciseId(int wsId) const void WebSocketHandler::onTextMessageReceived(const QByteArray &baJson) { - DEBUG_LOG() << "Receive Telegram from SAA <<<<< " << baJson; + DEBUG_LOG(m_logger) << "Receive Telegram from SAA <<<<< " << baJson; using namespace TrainingAreaBase::TetraIcd; WebSocketWrapper *wsw = qobject_cast(sender()); @@ -147,7 +147,7 @@ void WebSocketHandler::onNewConnection() if (!ws) return; - DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); + DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); auto wsw = std::make_shared(ws); int wsId = m_nextWsId; @@ -158,7 +158,7 @@ void WebSocketHandler::onNewConnection() wsw->setWsId(wsId); emit newConnection( wsId, ws->peerAddress().toString(),ws->peerPort()); m_connections.insert(wsId ,wsw); - DEBUG_LOG() << "m_connections.insert" + DEBUG_LOG(m_logger) << "m_connections.insert" << ", wsId :" << wsId; m_nextWsId++; @@ -181,10 +181,10 @@ void WebSocketHandler::onWebSocketDisconnected() for (auto it = copy.begin(); it != copy.end(); ++it) { auto wsw = *it; - DEBUG_LOG() << "peerPort :" << wsw->webSocket()->peerPort() << ", localPort :" << wsw->webSocket()->localPort(); + DEBUG_LOG(m_logger) << "peerPort :" << wsw->webSocket()->peerPort() << ", localPort :" << wsw->webSocket()->localPort(); if (wsw->webSocket() == ws) { - DEBUG_LOG() << it.key() << " Emit Disconnect ------------------------------------- esId=" << it.key(); + DEBUG_LOG(m_logger) << it.key() << " Emit Disconnect ------------------------------------- esId=" << it.key(); emit wsDisconnected(it.key()); m_connections.remove(it.key()); break; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.cpp index 4a3e5ced4..312bfae60 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.cpp @@ -25,7 +25,7 @@ bool AesHandler::init(MainDispatcher* mainDispatcher) if (!m_ftcAes->enableAirSupportImpactModify()) { - ERROR_LOG() << "Can not enableAirSupportImpactModify "; + ERROR_LOG(m_logger) << "Can not enableAirSupportImpactModify "; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.h index e88ca1ca0..65a159e58 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/aes_handler.h @@ -33,6 +33,7 @@ public: private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ftcAes; std::shared_ptr m_dtcPpm; LtsUtils::RequestHelper *m_requestHelper; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.cpp index 3380ed410..2c49cbb21 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.cpp @@ -8,17 +8,16 @@ namespace ApHlaJson { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.h index f1810b524..77be0a850 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/dds_handler.h @@ -31,6 +31,7 @@ public: } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.cpp index acd922914..dbe6c7719 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.cpp @@ -67,7 +67,7 @@ bool HlaDispatcher::canSendData() const void HlaDispatcher::onWebSocketConnected() { - INFO_LOG() << "WebSocket connected"; + INFO_LOG(m_logger) << "WebSocket connected"; QWebSocket *ws = qobject_cast(sender()); m_sendToHla->onWebSocketConnected(ws); m_webSocketReconnectTimer->stop(); @@ -76,7 +76,7 @@ void HlaDispatcher::onWebSocketConnected() void HlaDispatcher::onWebsocketDisconnected() { - INFO_LOG() << "Hla socket disconnected"; + INFO_LOG(m_logger) << "Hla socket disconnected"; m_sendToHla->onWebSocketDisconnected(); emit connectionState(QString::fromUtf8(name()), false); @@ -95,7 +95,7 @@ void HlaDispatcher::onWebSocketError() if (!m_webSocket) return; if (!m_bWarnedOnce) - WARNING_LOG() << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); + WARNING_LOG(m_logger) << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); m_webSocket->close(); m_webSocketReconnectTimer->start(5000); m_bWarnedOnce = true; @@ -106,7 +106,7 @@ void HlaDispatcher::onWebSocketError() void HlaDispatcher::onTextMessageReceived(const QByteArray &message) { - INFO_LOG() << "Text Message received: " << message; + INFO_LOG(m_logger) << "Text Message received: " << message; m_recvFromHla->handleTelegram(message); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.h index 4902a66bb..c29208f47 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_dispatcher.h @@ -50,8 +50,10 @@ Q_SIGNALS: void broadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter); void hlaTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele); private: + NGL::INGLLogger &m_logger; QUrl webSocketUrl() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_recvFromTabCb; std::shared_ptr m_recvFromHla; std::shared_ptr m_sendToHla; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.cpp index fe3f389af..65fae01f0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.cpp @@ -16,15 +16,14 @@ HlaHandlerRx::HlaHandlerRx(const std::shared_ptr const std::shared_ptr &sendToTabCb, HlaDispatcher *dispatcher, AesHandler* aesHandler, - PpmHandler* ppmHandler) - : m_rxHandler(recvFromTabCb) + PpmHandler* ppmHandler) : m_rxHandler(recvFromTabCb) , m_txHandler(sendToTabCb) , m_dispatcher(dispatcher) , m_bWarnedOnce(false) , m_bWarnedOnceTx(false) , m_aesHandler(aesHandler) - , m_ppmHandler(ppmHandler) -{} + , m_ppmHandler(ppmHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) { @@ -38,12 +37,12 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); if(typeId.toInt() != 21) - ERROR_LOG() << "Telegram before filter: " << baJson; + ERROR_LOG(m_logger) << "Telegram before filter: " << baJson; try { QJsonValue header = data[QStringLiteral("header")]; @@ -57,7 +56,7 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) return false; } if(typeId.toInt() != 21) - ERROR_LOG() << "Telegram after filter: " << baJson; + ERROR_LOG(m_logger) << "Telegram after filter: " << baJson; switch (typeId.toInt()) { case Constraints::id(): @@ -110,7 +109,7 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -130,7 +129,7 @@ void HlaHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; @@ -146,7 +145,7 @@ void HlaHandlerRx::txData(const T &data) { if (!m_bWarnedOnceTx) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnceTx = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.h index 419435c34..8c5057104 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_rx.h @@ -31,12 +31,14 @@ public: Q_SIGNALS: void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible); private: + NGL::INGLLogger &m_logger; template void rxData(const T &data); template void txData(const T &data); private: + NGL::INGLLogger &m_logger; bool checkExercise(int equipmentNumber) const; std::shared_ptr m_rxHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.cpp index f0bc32efb..6ad5ae4b8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.cpp @@ -296,7 +296,7 @@ bool HlaHandlerTx::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunitio void HlaHandlerTx::onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible) { - INFO_LOG() << "onParticipantConnectionState - " << equipmentNumber + INFO_LOG(m_logger) << "onParticipantConnectionState - " << equipmentNumber << ", communication possible: " << dataCommunicationPossible; if (equipmentNumber == -1) m_dataCommunicationPossible.clear(); @@ -308,7 +308,7 @@ void HlaHandlerTx::onGenericTelegram(const QJsonObject &telegram) if (!m_webSocket || !m_bHlaConnectedToExternalSystem) return; const QByteArray ba = QJsonDocument(telegram).toJson(QJsonDocument::Compact); - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; m_webSocket->sendTextMessage(QString::fromUtf8(ba)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.h index bf0c2a4b9..904559856 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/hla_handler_tx.h @@ -74,8 +74,10 @@ public slots: void onGenericTelegram(const QJsonObject &telegram); private: + NGL::INGLLogger &m_logger; bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, bool bForce = false); private: + NGL::INGLLogger &m_logger; QHash m_dataCommunicationPossible; TrainingAreaBase::Plugin::DataProvider *m_pdp; PpmHandler* m_ppmHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.cpp index d3aba8e68..ce9332c16 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.cpp @@ -23,7 +23,7 @@ MainDispatcher::MainDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp, , m_domainId(pdp->domainId()) , m_exerciseId(pdp->exerciseId()) { - INFO_LOG() << "ApHla started, Domain Id: " << m_domainId << " ExerciseId: " << m_exerciseId; + INFO_LOG(m_logger) << "ApHla started, Domain Id: " << m_domainId << " ExerciseId: " << m_exerciseId; } MainDispatcher::~MainDispatcher() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.h index a36d39a84..d992b5bde 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_dispatcher.h @@ -61,6 +61,7 @@ public: const char *name() const override { return tr_lts("dds", "ApHlaJson"); } private: + NGL::INGLLogger &m_logger; HlaDispatcher *m_hlaDispatcher; std::shared_ptr m_recvFromTabCb; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_handler_tx.h index 1f0c2618c..bc150f75f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/main_handler_tx.h @@ -61,6 +61,7 @@ public: bool txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) override; private: +NGL::INGLLogger &m_logger; template bool sendToTxMixin(const T *data); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.cpp index 1c3d7c16d..05543980f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.cpp @@ -10,9 +10,8 @@ namespace ApHlaJson { -PdmHandler::PdmHandler(QObject *parent) - : QObject(parent) -{} +PdmHandler::PdmHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool PdmHandler::init(MainDispatcher* mainDispatcher) { @@ -20,7 +19,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher) if (!m_dtcPdm->enableChargeType()) { - ERROR_LOG() << "Can not read data from Pdm"; + ERROR_LOG(m_logger) << "Can not read data from Pdm"; return false; } @@ -36,7 +35,7 @@ bool PdmHandler::init(MainDispatcher* mainDispatcher) void PdmHandler::getChargeTypes() { - DEBUG_LOG() << "Get Charge Types"; + DEBUG_LOG(m_logger) << "Get Charge Types"; QJsonObject obj; QJsonArray dataArray; obj[QStringLiteral("type")] = QStringLiteral("ApacheHlaSendChargeTypes"); @@ -46,7 +45,7 @@ void PdmHandler::getChargeTypes() QMap chargeTypes = m_dtcPdm->chargeTypes(); QMap gearTypes = m_dtcPdm->gearTypes(); QMap gearTypeChargeTypes = m_dtcPdm->gearTypeChargeTypes(); - DEBUG_LOG() << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though."; + DEBUG_LOG(m_logger) << "Fetched " << chargeTypes.size() << " ChargeTypes to send to WebSocket. Ommiting those without DIS-Entity though."; for(const ProjectDataManagement::ChargeType &charge : chargeTypes) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.h index f53540786..6a30dac1c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/pdm_handler.h @@ -29,6 +29,7 @@ public slots: private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtcPdm; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.cpp index 988c10529..6c00976c4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.cpp @@ -11,9 +11,8 @@ namespace ApHlaJson -PpmHandler::PpmHandler(QObject *parent) - : QObject(parent) -{} +PpmHandler::PpmHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool PpmHandler::init(MainDispatcher* mainDispatcher) { @@ -24,7 +23,7 @@ bool PpmHandler::init(MainDispatcher* mainDispatcher) if (!m_dtcPpm->enableParticipant() || !m_dtcPpm->enableDynamicParticipantData() || !m_dtcPpm->enableParticipantPosition()) { - ERROR_LOG() << "Can not read data from Ppm"; + ERROR_LOG(m_logger) << "Can not read data from Ppm"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.h index 33b65af4e..c59c6a00e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/ApacheHlaJson/ppm_handler.h @@ -35,6 +35,7 @@ private slots: void onDynamicParticipantDataChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtcPpm; QHash m_participantIdsByEqNo; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/convert_to_json_file.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/convert_to_json_file.h index ad7b550d9..cf2347bc2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/convert_to_json_file.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/convert_to_json_file.h @@ -63,6 +63,8 @@ public: bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &data) override; protected: + +NGL::INGLLogger &m_logger; template bool sendToTx(const T *data); protected: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.cpp index db9b37200..4246afc3f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.cpp @@ -19,12 +19,11 @@ namespace TetraRadio -DirectoryCleaner::DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent) - : QObject(parent) +DirectoryCleaner::DirectoryCleaner(const QString &directory, unsigned int maxAgeSec, QObject *parent) : QObject(parent) , m_cleanerThread(new QThread(this)) , m_worker(new DirectoryCleanerWorker(directory, maxAgeSec)) - .getNGLLogger("TAB.Plugin.DirectoryCleaner")) -{ + .getNGLLogger("TAB.Plugin.DirectoryCleaner")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { QDir().mkpath(directory); doInitialCleanup(directory); m_worker->moveToThread(m_cleanerThread); @@ -44,7 +43,7 @@ void DirectoryCleaner::doInitialCleanup(const QString &directory) QDir d(directory); if (!d.exists()) { - WARNING_LOG() << "Directory " << directory + WARNING_LOG(m_logger) << "Directory " << directory << " does not exist - can not cleanup directory"; return; } @@ -113,7 +112,7 @@ void DirectoryCleanerWorker::doCleanup() if (!d.exists()) { if (!m_bWarnedOnce) - WARNING_LOG() << "Directory " << m_directory + WARNING_LOG(m_logger) << "Directory " << m_directory << " does not exist - can not cleanup directory"; m_bWarnedOnce = true; return; @@ -127,12 +126,12 @@ void DirectoryCleanerWorker::doCleanup() const QString filename(it.fileName()); bool bOk = false; qint64 timestampUSec = filename.toLongLong(&bOk); - TRACE_LOG() << "File: " << filename + TRACE_LOG(m_logger) << "File: " << filename << " timestamp: " << timestampUSec << " remove time: " << tRemoveTimeMSec * 1000; if (!bOk) { - WARNING_LOG() << "Found file with name '" << filepath + WARNING_LOG(m_logger) << "Found file with name '" << filepath << " which is not a valid xdr filename" << " - removing this file when mtime older than " << m_maxAgeSec << "seconds"; @@ -146,9 +145,9 @@ void DirectoryCleanerWorker::doCleanup() if (timestampMSec < tRemoveTimeMSec) { if (!QFile::remove(filepath)) - WARNING_LOG() << "Could not remove " << filepath; + WARNING_LOG(m_logger) << "Could not remove " << filepath; else - TRACE_LOG() << "Removed " << filepath; + TRACE_LOG(m_logger) << "Removed " << filepath; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.h index aaa604705..e0d22461e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/DebugJsonDir/directory_cleaner.h @@ -19,6 +19,7 @@ public: private: + NGL::INGLLogger &m_logger; void doInitialCleanup(const QString &directory); bool teleShouldBeRemoved(int teleId); QThread *m_cleanerThread; @@ -34,8 +35,10 @@ public: public Q_SLOTS: void onTimeout(); private: + NGL::INGLLogger &m_logger; void doCleanup(); private: + NGL::INGLLogger &m_logger; QString m_directory; qint64 m_maxAgeSec; bool m_bWarnedOnce; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.cpp index 41076860d..de8c33fa0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.cpp @@ -67,7 +67,7 @@ void HlaDispatcher::onHlaConnected() void HlaDispatcher::onHlaDisconnected() { - INFO_LOG() << "Hla socket disconnected"; + INFO_LOG(m_logger) << "Hla socket disconnected"; m_webSocketReconnectTimer->start(5000); m_sendToHla->onHlaDisconnected(); @@ -85,7 +85,7 @@ void HlaDispatcher::onWebSocketError() if (!m_webSocket) return; if (!m_bWarnedOnce) - WARNING_LOG() << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); + WARNING_LOG(m_logger) << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); m_webSocket->close(); m_webSocketReconnectTimer->start(5000); m_bWarnedOnce = true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.h index 12996c3bb..8dcc54034 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_dispatcher.h @@ -41,8 +41,10 @@ Q_SIGNALS: void broadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter); void wlsTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele); private: + NGL::INGLLogger &m_logger; QUrl webSocketUrl() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_recvFromTabCb; std::shared_ptr m_recvFromHla; std::shared_ptr m_sendToHla; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.cpp index 8dcc50a5d..a98986309 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.cpp @@ -11,11 +11,10 @@ namespace HlaJson { HlaHandlerRx::HlaHandlerRx(const std::shared_ptr &recvFromTabCb, - HlaDispatcher *dispatcher) - : m_rxHandler(recvFromTabCb) + HlaDispatcher *dispatcher) : m_rxHandler(recvFromTabCb) , m_dispatcher(dispatcher) - , m_bWarnedOnce(false) -{} + , m_bWarnedOnce(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) { @@ -24,7 +23,7 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) if (baJson.isEmpty()) return false; const QJsonObject obj = QJsonDocument::fromJson(baJson).object(); - TRACE_LOG() << "incoming telegram: " << baJson; + TRACE_LOG(m_logger) << "incoming telegram: " << baJson; @@ -39,7 +38,7 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -125,7 +124,7 @@ bool HlaHandlerRx::handleTelegram(const QByteArray &baJson) } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -138,7 +137,7 @@ void HlaHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.h index 2772b8038..3a339012a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_rx.h @@ -24,9 +24,11 @@ public: Q_SIGNALS: void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible); private: + NGL::INGLLogger &m_logger; template void rxData(const T &data); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_rxHandler; HlaDispatcher *m_dispatcher; bool m_bWarnedOnce; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.cpp index f3dcba2c8..3ff382a56 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.cpp @@ -295,7 +295,7 @@ bool HlaHandlerTx::txData(const TrainingAreaBase::TetraIcd::OcCommand &data) void HlaHandlerTx::onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible) { - INFO_LOG() << "onParticipantConnectionState - " << equipmentNumber + INFO_LOG(m_logger) << "onParticipantConnectionState - " << equipmentNumber << ", communication possible: " << dataCommunicationPossible; if (equipmentNumber == -1) m_dataCommunicationPossible.clear(); @@ -314,7 +314,7 @@ bool HlaHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegr const QByteArray ba = QJsonDocument(obj).toJson(QJsonDocument::Compact); if (data->id() != TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG) - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; m_webSocket->sendTextMessage(QString::fromUtf8(ba)); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.h index 49f14e697..9bb89a424 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/hla_handler_tx.h @@ -73,8 +73,10 @@ public: public Q_SLOTS: void onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible); private: + NGL::INGLLogger &m_logger; bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, bool bForce = false); private: + NGL::INGLLogger &m_logger; QHash m_dataCommunicationPossible; TrainingAreaBase::Plugin::DataProvider *m_pdp; QWebSocket *m_webSocket; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_dispatcher.h index d56dc7ef4..2a1eadd03 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_dispatcher.h @@ -31,6 +31,8 @@ public: const char *name() const override { return tr_lts("dds", "HlaJson"); } private: + +NGL::INGLLogger &m_logger; HlaDispatcher *m_wlsDispatcher; std::shared_ptr m_recvFromTabCb; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_handler_tx.h index dc2205f37..fc7295e1a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/HlaJson/main_handler_tx.h @@ -68,6 +68,7 @@ public: bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &) override { return false; }; private: +NGL::INGLLogger &m_logger; template bool sendToTxMixin(const T *data); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_dispatcher.h index bac1e7035..16931d285 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_dispatcher.h @@ -31,6 +31,8 @@ public: const char *name() const override { return tr_lts("dds", "Nme"); } private: + +NGL::INGLLogger &m_logger; NmeaDispatcher *m_tetraDispatcher; NGL::Settings *m_settings; std::shared_ptr m_recvFromTabCb; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_handler_tx.h index c1771c6a8..f438f60f7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/main_handler_tx.h @@ -62,6 +62,7 @@ public: bool txData(const TrainingAreaBase::TetraIcd::SetDevicePowerRequest &data) override; bool txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) override; private: +NGL::INGLLogger &m_logger; template bool sendToTxMixin(const T *data); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.cpp index 1e370d0bc..996b8ccd7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.cpp @@ -29,7 +29,7 @@ NmeaDispatcher::NmeaDispatcher(TrainingAreaBase::Plugin::DataProvider *pdp, m_nmeaHost = getNmeaHost(); m_nmeaPort = getNmeaPort(); - DEBUG_LOG() << "Host: " << m_nmeaHost << " Port: " << m_nmeaPort; + DEBUG_LOG(m_logger) << "Host: " << m_nmeaHost << " Port: " << m_nmeaPort; m_socket = new QUdpSocket(this); connect(m_socket, &QUdpSocket::connected, this, &NmeaDispatcher::connected); connect(m_socket, &QUdpSocket::disconnected, this, &NmeaDispatcher::disconnected); @@ -59,12 +59,12 @@ void NmeaDispatcher::exerciseChanged() void NmeaDispatcher::reconnect() { - INFO_LOG() << "Connecting,.." << " host = " << m_nmeaHost + INFO_LOG(m_logger) << "Connecting,.." << " host = " << m_nmeaHost << " port = " << m_nmeaPort;; if(!m_socket->bind(m_nmeaPort, QAbstractSocket::BindFlag::ShareAddress | QAbstractSocket::BindFlag::ReuseAddressHint)) { - ERROR_LOG() << "Error from Socket: " << m_socket->errorString(); + ERROR_LOG(m_logger) << "Error from Socket: " << m_socket->errorString(); m_reconnectTimer->start(10000); } else @@ -77,25 +77,25 @@ void NmeaDispatcher::connected() { m_reconnectTimer->stop(); m_txHandler->onUdpSocketConnected(m_socket, m_nmeaPort, m_nmeaHost); - DEBUG_LOG() << "Connected!"; + DEBUG_LOG(m_logger) << "Connected!"; } void NmeaDispatcher::disconnected() { m_reconnectTimer->start(); - DEBUG_LOG() << "Disconnected!"; + DEBUG_LOG(m_logger) << "Disconnected!"; } void NmeaDispatcher::bytesWritten(qint64 bytes) { - DEBUG_LOG() << "We wrote: " << bytes; + DEBUG_LOG(m_logger) << "We wrote: " << bytes; } void NmeaDispatcher::reconnectTimerSlot() { m_reconnectTimer->stop(); - INFO_LOG() << "Reconnect NMEA-Socket " + INFO_LOG(m_logger) << "Reconnect NMEA-Socket " << " host = " << m_nmeaHost << " port = " << m_nmeaPort; reconnect(); @@ -104,7 +104,7 @@ void NmeaDispatcher::reconnectTimerSlot() void NmeaDispatcher::readyRead() { - DEBUG_LOG() << "Reading..."; + DEBUG_LOG(m_logger) << "Reading..."; QByteArray ba; @@ -114,18 +114,18 @@ void NmeaDispatcher::readyRead() ba.resize(int(m_socket->pendingDatagramSize())); m_socket->readDatagram(ba.data(), ba.size()); - INFO_LOG() << ba; + INFO_LOG(m_logger) << ba; QByteArray nmeaDataBa = ba; std::string nmeaDataStd = nmeaDataBa.toStdString() ; QString nmeaData = QString::fromLocal8Bit(nmeaDataStd.c_str()); - DEBUG_LOG() << "nmeaDecoder :" << nmeaData; + DEBUG_LOG(m_logger) << "nmeaDecoder :" << nmeaData; m_rxHandler->handleTelegram(nmeaData); - DEBUG_LOG() << "NMEA-Data=" << nmeaData; - DEBUG_LOG() << "NMEA-Data ba=" << ba; + DEBUG_LOG(m_logger) << "NMEA-Data=" << nmeaData; + DEBUG_LOG(m_logger) << "NMEA-Data ba=" << ba; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.h index 88d7475be..eb3676b8b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_dispatcher.h @@ -42,10 +42,12 @@ private slots: void readyRead(); void reconnectTimerSlot(); private: + NGL::INGLLogger &m_logger; void reconnect(); QString getNmeaHost(); int getNmeaPort(); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_rxHandler; std::shared_ptr m_txHandler; TrainingAreaBase::Plugin::DataProvider *m_dataProvider; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp index 70dd75b62..215b21210 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.cpp @@ -11,10 +11,9 @@ namespace Nmea { -NmeaHandlerRx::NmeaHandlerRx(const std::shared_ptr &rxHandler) - : m_rxHandler(rxHandler) - , m_bWarnedOnce(false) -{ +NmeaHandlerRx::NmeaHandlerRx(const std::shared_ptr &rxHandler) : m_rxHandler(rxHandler) + , m_bWarnedOnce(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { @@ -48,7 +47,7 @@ void NmeaHandlerRx::decode(QString nmeaPackage) nmeaPackage.remove(0, startingPoint); nmeaType = nmeaPackage.mid(1, 5); - INFO_LOG() << "nmeaType=" << nmeaType; + INFO_LOG(m_logger) << "nmeaType=" << nmeaType; if (nmeaType == QStringLiteral("IIXDR")) { @@ -57,10 +56,10 @@ void NmeaHandlerRx::decode(QString nmeaPackage) if (nmeaType == QStringLiteral("GPGGA")) { - INFO_LOG() << "Eigenposition"; + INFO_LOG(m_logger) << "Eigenposition"; if (checksum(nmeaPackage)) { - INFO_LOG() << "Eigenposition checksum ok"; + INFO_LOG(m_logger) << "Eigenposition checksum ok"; GPGGA(nmeaPackage); } } @@ -132,29 +131,29 @@ void NmeaHandlerRx::IIXDR(const QString &package) ServiceControl serviceControl; QRegExp sep(QStringLiteral("(\\,|\\*)")); QStringList pkt_data = package.split(sep); - INFO_LOG() << "----------------------------------------------------"; - INFO_LOG() << "batteryState pkt_data.size=" << pkt_data.size(); + INFO_LOG(m_logger) << "----------------------------------------------------"; + INFO_LOG(m_logger) << "batteryState pkt_data.size=" << pkt_data.size(); for (int i = 0; i < pkt_data.size(); i++) - INFO_LOG() << "i=" << i << "Value=" << pkt_data[i]; + INFO_LOG(m_logger) << "i=" << i << "Value=" << pkt_data[i]; int index = pkt_data.indexOf(QLatin1String("S")) + 1; if ( index >= 1) { - INFO_LOG() << "Ausschalten!!!"; + INFO_LOG(m_logger) << "Ausschalten!!!"; if (pkt_data[4] == QStringLiteral("SERVICE_CONTROL_PRESHUTDOWN")) { - INFO_LOG() << "SERVICE_CONTROL_PRESHUTDOWN"; + INFO_LOG(m_logger) << "SERVICE_CONTROL_PRESHUTDOWN"; serviceControl.serviceControlState = ServiceControlEnum::PRESHUTDOWN; } if (pkt_data[4] == QStringLiteral("SERVICE_CONTROL_SHUTDOWN")) { - INFO_LOG() << "SERVICE_CONTROL_SHUTDOWN"; + INFO_LOG(m_logger) << "SERVICE_CONTROL_SHUTDOWN"; serviceControl.serviceControlState = ServiceControlEnum::SHUTDOWN; } if (pkt_data[4] == QStringLiteral("SERVICE_CONTROL_STOP")) { - INFO_LOG() << "SERVICE_CONTROL_STOP"; + INFO_LOG(m_logger) << "SERVICE_CONTROL_STOP"; serviceControl.serviceControlState = ServiceControlEnum::STOP; } serviceControl.header.equipmentNumber = 1; @@ -229,7 +228,7 @@ void NmeaHandlerRx::IIXDR(const QString &package) batteryState.voltage = voltage; batteryState.serialNumber = serialNumber; - INFO_LOG() << "publish batteryState serialNumber=" << serialNumber; + INFO_LOG(m_logger) << "publish batteryState serialNumber=" << serialNumber; batteryInfo.batteryStates = {batteryState}; batteryInfo.header.equipmentNumber = 1; batteryInfo.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); @@ -243,7 +242,7 @@ void NmeaHandlerRx::IIALR(const QString &package) QRegExp sep(QStringLiteral("(\\,|\\*)")); QStringList pkt_data = package.split(sep); alarm_state packageData; - INFO_LOG() << "pkt_data.size=" << pkt_data.size(); + INFO_LOG(m_logger) << "pkt_data.size=" << pkt_data.size(); @@ -262,7 +261,7 @@ void NmeaHandlerRx::IIALR(const QString &package) qint64 timeAlarm = getDateTime(packageData.time); - INFO_LOG() << "time=" << packageData.time + INFO_LOG(m_logger) << "time=" << packageData.time << " timeAlarm=" << timeAlarm << " number=" << packageData.number << " condition=" << packageData.condition @@ -339,9 +338,9 @@ void NmeaHandlerRx::GPGGA(const QString &package) lonDeg *= -1; } - DEBUG_LOG() << "RAW Nmea Position: " << packageData.D_longitude << " | " << packageData.B_latitude; - DEBUG_LOG() << "Lat: " << latDeg; - DEBUG_LOG() << "Lon: " << lonDeg; + DEBUG_LOG(m_logger) << "RAW Nmea Position: " << packageData.D_longitude << " | " << packageData.B_latitude; + DEBUG_LOG(m_logger) << "Lat: " << latDeg; + DEBUG_LOG(m_logger) << "Lon: " << lonDeg; PositionExcon.geoPosition.lat = latDeg * M_PI / 180.0; PositionExcon.geoPosition.lon = lonDeg * M_PI / 180.0; @@ -371,7 +370,7 @@ void NmeaHandlerRx::GPRMC(const QString &package) packageData.K_variacao_magnetica_coord = pkt_data[11].toStdString()[0]; - INFO_LOG() << "velocidade=" << QString::number(packageData.G_velocity * 1.852); + INFO_LOG(m_logger) << "velocidade=" << QString::number(packageData.G_velocity * 1.852); } @@ -404,7 +403,7 @@ void NmeaHandlerRx::sendTestMessages() batteryState.generic = 1; batteryState.serialNumber = QStringLiteral("Test"); batteryState.temperature = 38.8; - DEBUG_LOG() << "Send BatteryInfo Message"; + DEBUG_LOG(m_logger) << "Send BatteryInfo Message"; batteryInfo.batteryStates = {batteryState}; batteryInfo.header.equipmentNumber = 1; batteryInfo.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); @@ -419,7 +418,7 @@ void NmeaHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.h index 6c5845a1f..26c03f25d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_rx.h @@ -123,6 +123,7 @@ private: qint64 getDateTime(QString receivedTimeStr); QStringList m_batteries; protected: + NGL::INGLLogger &m_logger; const std::shared_ptr m_rxHandler; bool m_bWarnedOnce; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_tx.h index c6fecb47a..2c94c8c0b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/Nmea/nmea_handler_tx.h @@ -69,6 +69,8 @@ signals: void outgoingMessage(const QByteArray &msg); private: + +NGL::INGLLogger &m_logger; QUdpSocket *m_udpSocket; QString m_nmeaHost; int m_nmeaPort; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.cpp index 56f016070..321f61689 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.cpp @@ -11,11 +11,10 @@ namespace TetraRadio { ConvertFromJson::ConvertFromJson(const std::shared_ptr &rxHandler, - const char *loggerName) - : m_rxHandler(rxHandler) + const char *loggerName) : m_rxHandler(rxHandler) , m_bWarnedOnce(false) - .getNGLLogger(loggerName)) -{} + .getNGLLogger(loggerName)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter) { @@ -30,14 +29,14 @@ bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter) if (!sendCounter.isDouble()) return false; recvCounter = sendCounter.toInt(-1); - DEBUG_LOG() << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString(); + DEBUG_LOG(m_logger) << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString(); if (recvCounter < 0) return false; } const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -163,14 +162,14 @@ bool ConvertFromJson::handleTelegram(const QByteArray &baJson, int &recvCounter) break; default: - WARNING_LOG() << "Handler for telegram Id " << typeId.toInt() + WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt() << " not yet implemented (" << baJson << ")"; return false; } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -183,7 +182,7 @@ void ConvertFromJson::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.h index fb39e3bdd..b2a5bbed5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_from_json.h @@ -16,6 +16,7 @@ public: virtual ~ConvertFromJson() = default; protected: + NGL::INGLLogger &m_logger; bool handleTelegram(const QByteArray &baJson, int &recvCounter); virtual void handleAcknowledge(qint64 timeStamp, int counter) = 0; virtual void handleTetraConnectionChanged(bool bConnected) = 0; @@ -28,6 +29,7 @@ private: static TrainingAreaBase::TetraIcd::BiteError convertBiteError(const QJsonObject &obj); std::shared_ptr m_rxHandler; protected: + NGL::INGLLogger &m_logger; bool m_bWarnedOnce; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.cpp index 990d26cf2..c84836713 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.cpp @@ -240,7 +240,7 @@ bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::Sanitation &data) bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) { - DEBUG_LOG() << "ConvertToJson::txData SelectiveReammunition"; + DEBUG_LOG(m_logger) << "ConvertToJson::txData SelectiveReammunition"; return sendToTx(&data); } @@ -251,7 +251,7 @@ bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::SetDevicePowerReque bool ConvertToJson::txData(const TrainingAreaBase::TetraIcd::OcCommand &data) { - DEBUG_LOG() << "ConvertToJson::txData OcCommand"; + DEBUG_LOG(m_logger) << "ConvertToJson::txData OcCommand"; return sendToTx(&data); } @@ -280,7 +280,7 @@ bool ConvertToJson::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTeleg obj[QStringLiteral("counter")] = m_sendCounter++; const QByteArray ba = QJsonDocument(obj).toJson(QJsonDocument::Compact); if (data->id() != TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG) - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; emit outgoingMessage(ba); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.h index 5a9b850c9..02179ae50 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/convert_to_json.h @@ -72,7 +72,9 @@ public: Q_SIGNALS: void outgoingMessage(const QByteArray &msg); protected: + NGL::INGLLogger &m_logger; protected: + NGL::INGLLogger &m_logger; int m_sendCounter; bool m_bConnected; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.cpp index 35353e55a..b19701868 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.cpp @@ -45,7 +45,7 @@ TetraJsonInterfaceImpl::TetraJsonInterfaceImpl(TrainingAreaBase::Plugin::DataPro settings->settings()->value(QLatin1String("AES/use2BytesForSingleFireDiameter"), true).toBool()); N_CoPrtCnv::CoPrtCnvTelegramConverter::setUsePvSan( settings->settings()->value(QLatin1String("TrainingAreaBase/UsePvSan"), false).toBool()); - ERROR_LOG() << "hello i got this!"; + ERROR_LOG(m_logger) << "hello i got this!"; } TetraJsonInterfaceImpl::~TetraJsonInterfaceImpl() @@ -70,7 +70,7 @@ void TetraJsonInterfaceImpl::exerciseChanged() NOTICE_LOG(m_logger) << "TetraJsonInterfaceImpl::exerciseChanged"; if (m_pdp->exerciseRadioGroup().id() != m_radioGrpId) if (!updatePrtCnv()) - ERROR_LOG() << "Error changing PrtCnv state from radio grp id: " + ERROR_LOG(m_logger) << "Error changing PrtCnv state from radio grp id: " << m_radioGrpId << " to " << m_pdp->exerciseRadioGroup().id(); } @@ -92,7 +92,7 @@ bool TetraJsonInterfaceImpl::updatePrtCnv() QFile::remove(iniFileOut()); if (!QFile::copy(iniFileIn(), iniFileOut())) { - ERROR_LOG() << "Error creating ini file for PrtCnv: " << iniFileOut(); + ERROR_LOG(m_logger) << "Error creating ini file for PrtCnv: " << iniFileOut(); return false; } @@ -133,10 +133,10 @@ bool TetraJsonInterfaceImpl::checkConfigTemplates() { if (!QFile::exists(iniFileIn())) { - INFO_LOG() << "Creating " << iniFileIn(); + INFO_LOG(m_logger) << "Creating " << iniFileIn(); if (!QFile::copy(QStringLiteral(":/PrtCnv.dat"), iniFileIn())) { - ERROR_LOG() << "Error creating " << iniFileIn(); + ERROR_LOG(m_logger) << "Error creating " << iniFileIn(); return false; } else @@ -145,10 +145,10 @@ bool TetraJsonInterfaceImpl::checkConfigTemplates() if (!QFile::exists(playerIdsFile())) { - INFO_LOG() << "Creating " << playerIdsFile(); + INFO_LOG(m_logger) << "Creating " << playerIdsFile(); if (!QFile::copy(QStringLiteral(":/playerIds.dat"), playerIdsFile())) { - ERROR_LOG() << "Error creating " << playerIdsFile(); + ERROR_LOG(m_logger) << "Error creating " << playerIdsFile(); return false; } else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.h index a7e608842..024d260f6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/TetraJson/plugin.h @@ -48,6 +48,7 @@ public: private Q_SLOTS: void onTetraConnectionChanged(bool bConnected); private: +NGL::INGLLogger &m_logger; void cleanupProcess(); static QString iniFileIn(); QString iniFileOut() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.cpp index 4e86180b2..b9ca1eac1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.cpp @@ -31,7 +31,7 @@ void Dispatcher::ReportCBitStatus(const std::string &KeyId, const M_BuiltInTest: { if (IsRemoved) { - DEBUG_LOG() << "isRemoved"; + DEBUG_LOG(m_logger) << "isRemoved"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.h index 499c8d17f..a15d4a22b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_cbit_status.h @@ -25,6 +25,7 @@ public: Dispatcher(); void ReportCBitStatus(const std::string &KeyId, const M_BuiltInTest::BitStatusType &status, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.cpp index 45524dd6e..f49edaa1f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.cpp @@ -37,23 +37,23 @@ Dispatcher::Dispatcher() void Dispatcher::ReportDeviceStatus(M_Device::DeviceStatusType const& status, bool IsRemoved) { - DEBUG_LOG() << "start"; + DEBUG_LOG(m_logger) << "start"; if (IsRemoved) { - DEBUG_LOG() << "isRemoved"; + DEBUG_LOG(m_logger) << "isRemoved"; return; } if (status.OperationStatus.Mode.empty()) { - DEBUG_LOG() << "no mode!"; + DEBUG_LOG(m_logger) << "no mode!"; return; } if (status.OperationStatus.Mode.front().EnumeratedValue.empty()) { - DEBUG_LOG() << "no enum value in mode!"; + DEBUG_LOG(m_logger) << "no enum value in mode!"; return; } @@ -62,7 +62,7 @@ void Dispatcher::ReportDeviceStatus(M_Device::DeviceStatusType const& status, bo Message msg; msg.Status = operationModeStateKindFromTms(val); - DEBUG_LOG() << "dispatch!"; + DEBUG_LOG(m_logger) << "dispatch!"; dispatch(msg); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.h index ac3263b4b..804054a7b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_device_status.h @@ -26,6 +26,7 @@ public: Dispatcher(); void ReportDeviceStatus(M_Device::DeviceStatusType const& status, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.cpp index 8d19d9d30..491b2a8e3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.cpp @@ -47,19 +47,19 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis { if (IsRemoved) { - DEBUG_LOG() << "isRemoved"; + DEBUG_LOG(m_logger) << "isRemoved"; return; } if (MissionStatus.CurrentAction.CurrentTask.EnumeratedValue.empty()) { - DEBUG_LOG() << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty"; + DEBUG_LOG(m_logger) << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty"; return; } if (!MissionStatus.CurrentAction.CurrentTask.TextualValue.empty()) { - DEBUG_LOG() << "text: " << QString::fromStdString(MissionStatus.CurrentAction.CurrentTask.TextualValue.front()); + DEBUG_LOG(m_logger) << "text: " << QString::fromStdString(MissionStatus.CurrentAction.CurrentTask.TextualValue.front()); } const Task currentTask = taskFromTms(MissionStatus.CurrentAction.CurrentTask.EnumeratedValue.front()); @@ -81,7 +81,7 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis } std::string missionName = MissionStatus.CurrentMissionName; - DEBUG_LOG() << "missionName before: " << missionName; + DEBUG_LOG(m_logger) << "missionName before: " << missionName; if (missionName.empty()) { for (const auto &additionalInfo : std::as_const(MissionStatus.CurrentAction.CurrentTask.AdditionalInfo)) @@ -93,7 +93,7 @@ void Dispatcher::ReportMissionStatus(M_MissionCtrl::MissionStatusType const& Mis } } } - DEBUG_LOG() << "missionName after: " << missionName; + DEBUG_LOG(m_logger) << "missionName after: " << missionName; dispatch({ missionName, currentTask, currentlyAllowedTasks, {} }); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.h index 008182f2c..b68822667 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_mission_status.h @@ -24,6 +24,7 @@ public: Dispatcher(); void ReportMissionStatus(M_MissionCtrl::MissionStatusType const& MissionStatus, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.cpp index eb9d6dd59..8b0b5b999 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.cpp @@ -17,7 +17,7 @@ Dispatcher::Dispatcher() void Dispatcher::ReportPoint(const M_Common::ObjectIdType &KeyId, const M_ObjectManager::PointObjectType &, bool IsRemoved) { - DEBUG_LOG() << "start"; + DEBUG_LOG(m_logger) << "start"; Message msg; @@ -25,13 +25,13 @@ void Dispatcher::ReportPoint(const M_Common::ObjectIdType &KeyId, const M_Object msg.uasId = std::stoi(KeyId); }catch(...) { - ERROR_LOG() << "KeyId not an int !"; + ERROR_LOG(m_logger) << "KeyId not an int !"; return; } msg.isRemoved = IsRemoved; - DEBUG_LOG() << "dispatch!"; + DEBUG_LOG(m_logger) << "dispatch!"; dispatch(msg); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.h index 484a04cbb..8ba2be4d9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_point.h @@ -23,6 +23,7 @@ public: Dispatcher(); void ReportPoint(const M_Common::ObjectIdType &KeyId, const M_ObjectManager::PointObjectType &Obj, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.cpp index 32530d729..fd72599ba 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.cpp @@ -19,14 +19,14 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit { if (IsRemoved) { - DEBUG_LOG() << "isRemoved"; + DEBUG_LOG(m_logger) << "isRemoved"; return; } if (KeyId != "UTM_GLOBAL_POSITION" && KeyId != "CURRENT_AIRFRAME_RAW" && KeyId != "CURRENT_AIRFRAME") { - DEBUG_LOG() << "KeyId unwanted (is '" << QString::fromStdString(KeyId) << "')"; + DEBUG_LOG(m_logger) << "KeyId unwanted (is '" << QString::fromStdString(KeyId) << "')"; return; } @@ -34,7 +34,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit if (PositionList.empty()) { - DEBUG_LOG() << "PositionList is empty"; + DEBUG_LOG(m_logger) << "PositionList is empty"; return; } @@ -42,7 +42,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit if (pos.Ellipsoidal.empty()) { - DEBUG_LOG() << "PositionList.Ellipsoidal is empty"; + DEBUG_LOG(m_logger) << "PositionList.Ellipsoidal is empty"; return; } @@ -50,7 +50,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit if (elip.Altitude.empty()) { - DEBUG_LOG() << "PositionList.Ellipsoidal.Altitude is empty"; + DEBUG_LOG(m_logger) << "PositionList.Ellipsoidal.Altitude is empty"; return; } @@ -58,7 +58,7 @@ void Dispatcher::ReportPositions(const std::string &KeyId, const M_Common::Posit if (pos.Timestamp.empty()) { - DEBUG_LOG() << "PositionList[0].Timestamp is empty"; + DEBUG_LOG(m_logger) << "PositionList[0].Timestamp is empty"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.h index 1675eec6c..686bf0c7a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_positions.h @@ -23,6 +23,7 @@ public: Dispatcher(); void ReportPositions(const std::string &KeyId, const M_Common::PositionListType &PositionList, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.cpp index 11af7f2f3..0b26d67c5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.cpp @@ -34,13 +34,13 @@ void Dispatcher::ReportRadioConnectionStatus(const std::string &, const M_Teleop { if (IsRemoved) { - DEBUG_LOG() << "isRemoved"; + DEBUG_LOG(m_logger) << "isRemoved"; return; } if (RadioConnectionStatus.LinkConnectionState == M_Teleoperation::RadioLinkConnectionState::Undefined) { - DEBUG_LOG() << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty"; + DEBUG_LOG(m_logger) << "MissionStatus.CurrentAction.CurrentTask.EnumeratedValue empty"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.h index 702676da5..c4bc95dc0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/dispatchers/report_radio_link_connection_state.h @@ -25,6 +25,7 @@ public: Dispatcher(); void ReportRadioConnectionStatus(std::string const& KeyId, M_Teleoperation::RadioConnectionStatusType const& RadioConnectionStatus, bool IsRemoved) override; private: +NGL::INGLLogger &m_logger; }; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/tms_if_adapter.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/tms_if_adapter.cpp index baf0ed608..7bb14a891 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/tms_if_adapter.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/tms_if_adapter.cpp @@ -67,7 +67,7 @@ public: , m_reader(m_master.dispatcher()) , m_writer(m_master.client()) { - ERROR_LOG() << "ctor"; + ERROR_LOG(m_logger) << "ctor"; connect(m_reader.readerSignal(), &ReaderSignal::dataReady, this, &InterfaceAdapterInitializer::updatePoint); @@ -77,7 +77,7 @@ public: { if (m_activeUas.empty()) { - ERROR_LOG() << "trying to stop active uas - DONE!"; + ERROR_LOG(m_logger) << "trying to stop active uas - DONE!"; t->stop(); m_parent->setReady(); @@ -85,7 +85,7 @@ public: return; } - ERROR_LOG() << "trying to stop active uas:" << m_activeUas.size(); + ERROR_LOG(m_logger) << "trying to stop active uas:" << m_activeUas.size(); for (const int activeUas : m_activeUas) { @@ -137,7 +137,7 @@ private: TmsIfAdapterImpl::TmsIfAdapterImpl() : m_iai(new InterfaceAdapterInitializer(this)) { - ERROR_LOG() << "TmsIfAdapter running!"; + ERROR_LOG(m_logger) << "TmsIfAdapter running!"; } @@ -145,7 +145,7 @@ TmsIfAdapterImpl::~TmsIfAdapterImpl() { delete m_iai; delete m_guard; - ERROR_LOG() << "!!! TmsIfAdapterImpl DTOR!"; + ERROR_LOG(m_logger) << "!!! TmsIfAdapterImpl DTOR!"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.cpp index 377405a7a..5b5a554d8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.cpp @@ -15,9 +15,8 @@ using namespace LtsUtils; namespace UAS { -Resolver::Resolver(QObject *parent) - : QObject(parent) -{ +Resolver::Resolver(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(this, &Resolver::resolve, this, &QObject::deleteLater); connect(this, &Resolver::reject, this, [this](){deleteLater();}); } @@ -33,7 +32,7 @@ UAVCommanderImpl::UAVCommanderImpl(int domainId, int uasId, QObject *parent) , m_Device(std::string("UAV_Device_") + std::to_string(uasId), domainId) , m_CoordinateFrame(std::string("UAV_CoordinateFrame_") + std::to_string(uasId), domainId) { - ERROR_LOG() << "ctor: " << (quintptr)this; + ERROR_LOG(m_logger) << "ctor: " << (quintptr)this; connect(m_MissionCtrl.reader.readerSignal(), &ReaderSignal::dataReady, this, &UAVCommanderImpl::updateMissionStatus); connect(m_TeleOperation.reader.readerSignal(), &ReaderSignal::dataReady, this, &UAVCommanderImpl::updateOperationalState); @@ -81,7 +80,7 @@ UAVCommanderImpl::MissionCtrlContainer::MissionCtrlContainer(const std::string & UAVCommanderImpl::~UAVCommanderImpl() { - ERROR_LOG() << "dtor: " << (quintptr)this; + ERROR_LOG(m_logger) << "dtor: " << (quintptr)this; if (m_createInterfaceAdapterInstance) { @@ -108,13 +107,13 @@ void UAVCommanderImpl::updateMissionStatus() const auto oldTask = m_MissionCtrl.currentTask; m_MissionCtrl.currentTask = msg.currentTask; - ERROR_LOG() << "currentTask = " << (int)m_MissionCtrl.currentTask; + ERROR_LOG(m_logger) << "currentTask = " << (int)m_MissionCtrl.currentTask; const auto oldMission = m_MissionCtrl.currentMission; m_MissionCtrl.currentMission = QString::fromStdString(msg.currentMissionName); - ERROR_LOG() << "oldTask = " << (int)oldTask; + ERROR_LOG(m_logger) << "oldTask = " << (int)oldTask; - ERROR_LOG() << "currentMission = " << QString::fromStdString(msg.currentMissionName); + ERROR_LOG(m_logger) << "currentMission = " << QString::fromStdString(msg.currentMissionName); m_MissionCtrl.currentlyAllowedTasks.swap(msg.currentlyAllowedTasks); @@ -122,7 +121,7 @@ void UAVCommanderImpl::updateMissionStatus() { - ERROR_LOG() << "Old Task" << oldTask << "new task " << m_MissionCtrl.currentTask ; + ERROR_LOG(m_logger) << "Old Task" << oldTask << "new task " << m_MissionCtrl.currentTask ; if (oldTask != m_MissionCtrl.currentTask) { if (!oldMission.isEmpty() && m_MissionCtrl.currentMission.isEmpty()) @@ -131,11 +130,11 @@ void UAVCommanderImpl::updateMissionStatus() } m_MissionCtrl.ReportMissionStatus_Callback(msg); - ERROR_LOG() << "################################# sending " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this; + ERROR_LOG(m_logger) << "################################# sending " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this; } else { - ERROR_LOG() << "################################# VERWERFING ! " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this; + ERROR_LOG(m_logger) << "################################# VERWERFING ! " << (int)m_MissionCtrl.currentTask << " " << (quintptr)this; } } @@ -151,7 +150,7 @@ void UAVCommanderImpl::updateMissionStatus() case MissionCtrl::Shutdown: { m_isReady = false; - ERROR_LOG() << "UAV not ready yet! currentTask: " << (int)m_MissionCtrl.currentTask; + ERROR_LOG(m_logger) << "UAV not ready yet! currentTask: " << (int)m_MissionCtrl.currentTask; break; } @@ -166,7 +165,7 @@ void UAVCommanderImpl::updateMissionStatus() { m_isReady_Callback(); } - ERROR_LOG() << "UAV now ready!"; + ERROR_LOG(m_logger) << "UAV now ready!"; break; } } @@ -253,7 +252,7 @@ void UAVCommanderImpl::updateCBitStaus() void UAVCommanderImpl::updateDeviceModeState() { - ERROR_LOG() << "start"; + ERROR_LOG(m_logger) << "start"; while (true) { @@ -264,10 +263,10 @@ void UAVCommanderImpl::updateDeviceModeState() m_Device.currentMessage.clear(); m_Device.currentMessage.emplace_back(msg); - ERROR_LOG() << "before callback"; + ERROR_LOG(m_logger) << "before callback"; if (m_Device.ReportDeviceStatus_Callback) { - ERROR_LOG() << "callback!"; + ERROR_LOG(m_logger) << "callback!"; m_Device.ReportDeviceStatus_Callback(msg); } } @@ -281,11 +280,11 @@ void UAVCommanderImpl::updateDeviceModeState() void UAVCommanderImpl::prepareMission(Resolver *resolver) { - ERROR_LOG() << "resolver = " << (quintptr)resolver; + ERROR_LOG(m_logger) << "resolver = " << (quintptr)resolver; if (isTaskAllowed(MissionCtrl::Task::Observe) || m_MissionCtrl.currentTask == MissionCtrl::Task::Connect ) { - ERROR_LOG() << "DONE! resolving " << (quintptr)resolver; + ERROR_LOG(m_logger) << "DONE! resolving " << (quintptr)resolver; emit resolver->resolve(); return; } @@ -294,7 +293,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver) connect(r, &Resolver::reject, resolver, &Resolver::reject); connect(r, &Resolver::resolve, resolver, [this, resolver]() { - ERROR_LOG() << "r ("<<(quintptr)resolver<<")! resolving!"; + ERROR_LOG(m_logger) << "r ("<<(quintptr)resolver<<")! resolving!"; Resolver *r2 = new Resolver(this); connect(r2, &Resolver::reject, resolver, &Resolver::reject); connect(r2, &Resolver::resolve, resolver, &Resolver::resolve); @@ -303,7 +302,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver) if (!m_MissionCtrl.currentMission.isEmpty()) { - ERROR_LOG() << " > mission '"<< m_MissionCtrl.currentMission << "' currently active - aborting mission and waiting for loitering"; + ERROR_LOG(m_logger) << " > mission '"<< m_MissionCtrl.currentMission << "' currently active - aborting mission and waiting for loitering"; sendCommand(r, {QStringLiteral("mission:abort (%1)").arg(m_MissionCtrl.currentMission), MissionCtrl::Task::Connect, [this]() { _abortMission(m_MissionCtrl.currentMission); }}); return; } @@ -312,28 +311,28 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver) { case MissionCtrl::Task::Disarm: { - ERROR_LOG() << " > arm"; + ERROR_LOG(m_logger) << " > arm"; arm(r); break; } case MissionCtrl::Task::Arm: { - ERROR_LOG() << " > takeoff"; + ERROR_LOG(m_logger) << " > takeoff"; takeoff(r); break; } case MissionCtrl::Task::Takeoff: { - ERROR_LOG() << " > waiting for Loiter ..."; + ERROR_LOG(m_logger) << " > waiting for Loiter ..."; sendCommand(r, {QStringLiteral("loiter"), MissionCtrl::Task::Loiter, nullptr}); break; } case MissionCtrl::Task::Loiter: { - ERROR_LOG() << " >WE loiter start to resolve"; + ERROR_LOG(m_logger) << " >WE loiter start to resolve"; emit resolver->resolve(); break; } @@ -342,7 +341,7 @@ void UAVCommanderImpl::prepareMission(Resolver *resolver) default: { - ERROR_LOG() << "help, I don't know what to do with "<<(int)m_MissionCtrl.currentTask<<" :("; + ERROR_LOG(m_logger) << "help, I don't know what to do with "<<(int)m_MissionCtrl.currentTask<<" :("; break; } } @@ -353,7 +352,7 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt { if (!m_isReady) { - ERROR_LOG() << "not ready"; + ERROR_LOG(m_logger) << "not ready"; throw std::runtime_error("UAV not ready"); } @@ -373,21 +372,21 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt } Resolver *r = new Resolver(this); - connect(r, &Resolver::reject, this, [this](const QString &msg) { ERROR_LOG() << "rejected: " << msg; }); + connect(r, &Resolver::reject, this, [this](const QString &msg) { ERROR_LOG(m_logger) << "rejected: " << msg; }); connect(r, &Resolver::resolve, [this, lat, lon, alt, missionName]() { - ERROR_LOG() << "!!!!!!!!!!!!!!!!!!!!!! going to observe now!!"; + ERROR_LOG(m_logger) << "!!!!!!!!!!!!!!!!!!!!!! going to observe now!!"; Resolver *r2 = new Resolver(this); - connect(r2, &Resolver::reject, [this](const QString &msg) { ERROR_LOG() << "################ failed to start mission :( " << msg; }); + connect(r2, &Resolver::reject, [this](const QString &msg) { ERROR_LOG(m_logger) << "################ failed to start mission :( " << msg; }); connect(r2, &Resolver::resolve, [this, missionName]() { Resolver *r3 = new Resolver(this); - connect(r3, &Resolver::reject, [this](const QString &msg) { ERROR_LOG() << "################ failed to wait for loiter :( " << msg; }); + connect(r3, &Resolver::reject, [this](const QString &msg) { ERROR_LOG(m_logger) << "################ failed to wait for loiter :( " << msg; }); connect(r3, &Resolver::resolve, [this, missionName]() { - ERROR_LOG() << "################ mission done" << missionName << " " << this << " "; + ERROR_LOG(m_logger) << "################ mission done" << missionName << " " << this << " "; @@ -395,7 +394,7 @@ void UAVCommanderImpl::sendMission(double lat, double lon, double alt, const QSt }); sendCommand(r3, {QStringLiteral("wait for mission to end (Loiter)"), MissionCtrl::Task::Loiter, nullptr}, -1); - ERROR_LOG() << "################ successfully started mission :)"; + ERROR_LOG(m_logger) << "################ successfully started mission :)"; }); sendCommand(r2, { QStringLiteral("mission:observe"), MissionCtrl::Task::Observe, [this, lat, lon, alt, missionName]() { _sendMission(lat, lon, alt, missionName); } }); }); @@ -419,18 +418,18 @@ void UAVCommanderImpl::_abortMission(const QString &missionName) void UAVCommanderImpl::_sendMission(double lat, double lon, double alt, const QString &missionName) { - ERROR_LOG() << "lat = " << lat << ", lon = " << lon << ", alt = " << alt << ", missionName = " << missionName; + ERROR_LOG(m_logger) << "lat = " << lat << ", lon = " << lon << ", alt = " << alt << ", missionName = " << missionName; M_Common::EllipsoidalPositionType pos; if (alt <= 0.1) { - ERROR_LOG() << "alt very low (<= 0.1) !"; + ERROR_LOG(m_logger) << "alt very low (<= 0.1) !"; } pos.Latitude = lat / LtsCoordTrans::deg2rad(); pos.Longitude = lon / LtsCoordTrans::deg2rad(); - ERROR_LOG() << "DEG lat = " << pos.Latitude << ", lon = " << pos.Longitude << ", alt = " << alt << ", missionName = " << missionName; + ERROR_LOG(m_logger) << "DEG lat = " << pos.Latitude << ", lon = " << pos.Longitude << ", alt = " << alt << ", missionName = " << missionName; pos.Altitude.push_back(alt); @@ -447,8 +446,8 @@ void UAVCommanderImpl::_sendMission(double lat, double lon, double alt, const QS void UAVCommanderImpl::returnToHome() { Resolver *r = new Resolver(this); - connect(r, &Resolver::reject, this, [this](const QString &error) { ERROR_LOG() << "returnToHome failed: " << error; }); - connect(r, &Resolver::resolve, this, [this]() { ERROR_LOG() << "returnToHome done :)"; }); + connect(r, &Resolver::reject, this, [this](const QString &error) { ERROR_LOG(m_logger) << "returnToHome failed: " << error; }); + connect(r, &Resolver::resolve, this, [this]() { ERROR_LOG(m_logger) << "returnToHome done :)"; }); sendCommand(r, { QStringLiteral("return"), MissionCtrl::Task::Return, [this]() { _returnToHome(); } }, -1 ); } @@ -467,12 +466,12 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t if (m_tried != 0) { - ERROR_LOG() << commandName << ": another request already running - replacing ("<stop(); guard->deleteLater(); - ERROR_LOG() << commandName << ": sending '"<< commandName <<"' command failed - max tries reached, giving up !"; + ERROR_LOG(m_logger) << commandName << ": sending '"<< commandName <<"' command failed - max tries reached, giving up !"; m_tried = 0; m_currentResolver.clear(); emit resolver->reject(QStringLiteral("Sending %1 command timed out!").arg(commandName)); @@ -540,7 +539,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t connect(reader->readerSignal(), &ReaderSignal::dataReady, this, [this, reader, guard, timeout, commandName, type, resolver]() { - ERROR_LOG() << commandName << ": reader signal for '"<< commandName <<"' !"; + ERROR_LOG(m_logger) << commandName << ": reader signal for '"<< commandName <<"' !"; while(true) { @@ -548,14 +547,14 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t { const auto msg = reader->getNext(); - ERROR_LOG() << "########## READER SIGNAL (should: " << (int)type << ", is: " << (int)msg.currentTask << ")"; + ERROR_LOG(m_logger) << "########## READER SIGNAL (should: " << (int)type << ", is: " << (int)msg.currentTask << ")"; if (msg.currentTask == type || (type == MissionCtrl::Task::Takeoff && msg.currentTask == MissionCtrl::Task::Connect) || (type == MissionCtrl::Task::Return && (msg.currentTask == MissionCtrl::Task::Disarm || msg.currentTask == MissionCtrl::Task::Land))) { - ERROR_LOG() << commandName << ": successfully set new task '"<< commandName <<"' !"; + ERROR_LOG(m_logger) << commandName << ": successfully set new task '"<< commandName <<"' !"; QTimer *x = new QTimer(guard); @@ -565,7 +564,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t connect(guard, &QObject::destroyed, x, &QTimer::stop); connect(x, &QTimer::timeout, this, [this, timeout, guard, resolver]() { - ERROR_LOG() << "############# RESOLVE AFTER 1s"; + ERROR_LOG(m_logger) << "############# RESOLVE AFTER 1s"; m_tried = 0; if (timeout != nullptr) @@ -588,7 +587,7 @@ void UAVCommanderImpl::sendCommand(Resolver *resolver, const Command &cmd, int t } } - ERROR_LOG() << commandName << ": command '"<< commandName <<"' not accepted (yet)"; + ERROR_LOG(m_logger) << commandName << ": command '"<< commandName <<"' not accepted (yet)"; }); @@ -642,7 +641,7 @@ void UAVCommanderImpl::sendTryReclaimAutoMode() } catch(const std::exception &ex) { - ERROR_LOG() << "Failed to send DeviceMode:" << ex.what(); + ERROR_LOG(m_logger) << "Failed to send DeviceMode:" << ex.what(); } } @@ -669,25 +668,25 @@ CreateInterfaceAdapterInstance::CreateInterfaceAdapterInstance(int uasId, const connect(m_reader.readerSignal(), &ReaderSignal::dataReady, this, [this, uasId]() { - ERROR_LOG() << "readerSignal for uasId" << m_uasId; + ERROR_LOG(m_logger) << "readerSignal for uasId" << m_uasId; const auto msgs = readAll(m_reader); - ERROR_LOG() << "msgs.size" << msgs.size() << m_uasId; + ERROR_LOG(m_logger) << "msgs.size" << msgs.size() << m_uasId; for (const auto &msg : msgs) { - ERROR_LOG() << "msg uas" << msg.uasId << "removed" << msg.isRemoved; + ERROR_LOG(m_logger) << "msg uas" << msg.uasId << "removed" << msg.isRemoved; if (msg.uasId == uasId && !msg.isRemoved) { - ERROR_LOG() << "DONE!!"; + ERROR_LOG(m_logger) << "DONE!!"; m_timeout->stop(); return; } } - ERROR_LOG() << "no ia instance for"<isActive()) { m_timeout->start(); @@ -706,7 +705,7 @@ CreateInterfaceAdapterInstance::CreateInterfaceAdapterInstance(int uasId, const void CreateInterfaceAdapterInstance::onStart() { - ERROR_LOG() << " -- CreateInterfaceAdapterInstance -- ::onStart() CmdAddUpdatePoint" << m_uasId<<" ip: "<(m_reader); - ERROR_LOG() << "msgs.size" << msgs.size() << m_uasId; + ERROR_LOG(m_logger) << "msgs.size" << msgs.size() << m_uasId; for (const auto &msg : msgs) { - ERROR_LOG() << "msg uas" << msg.uasId << "removed" << msg.isRemoved; + ERROR_LOG(m_logger) << "msg uas" << msg.uasId << "removed" << msg.isRemoved; if (msg.uasId == uasId && msg.isRemoved) { - ERROR_LOG() << "DONE!!"; + ERROR_LOG(m_logger) << "DONE!!"; m_done = true; deleteLater(); return; @@ -778,7 +777,7 @@ void KillInterfaceAdapterInstanceAsync::onStop() } catch (const std::exception &ex) { - ERROR_LOG() << "CmdRemove" << m_uasId << ":" << ex.what(); + ERROR_LOG(m_logger) << "CmdRemove" << m_uasId << ":" << ex.what(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.h index 2303d982b..4fe0eb30a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/TmsIfAdapter/src/uav_commander_impl.h @@ -48,6 +48,8 @@ private slots: void onStart(); private: + +NGL::INGLLogger &m_logger; mutable CommunicationMaster m_master; Reader m_reader; M_ObjectManager::Client m_writer; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.cpp index a664e83f8..45a37bdef 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.cpp @@ -115,12 +115,12 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::Init &data) bool FromTab::txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) { const int eqId = data.header.equipmentNumber; - DEBUG_LOG() << "eqId: " << eqId; + DEBUG_LOG(m_logger) << "eqId: " << eqId; const ParticipantManagement::Participant p = m_dtcPpm->participant(m_dtcPpm->participantIdByEquipmentNumber(eqId)); if (p.id() <= 0) { - WARNING_LOG() << "participant not found - stop"; + WARNING_LOG(m_logger) << "participant not found - stop"; return false; } @@ -130,7 +130,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &data) if (!m_uavIAManager->waypoint(p.id(), action.absPosition, QStringLiteral("%1_%2").arg(data.missionId).arg(data.missionName))) { - WARNING_LOG() << "sending waypoint failed!"; + WARNING_LOG(m_logger) << "sending waypoint failed!"; return false; } @@ -145,7 +145,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::UAVChangeState &data) if (p.id() <= 0) { - WARNING_LOG() << "participant not found - stop"; + WARNING_LOG(m_logger) << "participant not found - stop"; return false; } @@ -167,23 +167,23 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::CesHitRequest &data) { - DEBUG_LOG() << "data.chargeTasCodeDirect = " << data.chargeTasCodeDirect; + DEBUG_LOG(m_logger) << "data.chargeTasCodeDirect = " << data.chargeTasCodeDirect; if (!m_dtcPdm->isJamming(data.chargeTasCodeDirect,0,0)) { - WARNING_LOG() << "not jamming"; + WARNING_LOG(m_logger) << "not jamming"; return false; } - DEBUG_LOG() << "participantEventChanged: JAMMING! chargetasCodeDirect = " << data.chargeTasCodeDirect; + DEBUG_LOG(m_logger) << "participantEventChanged: JAMMING! chargetasCodeDirect = " << data.chargeTasCodeDirect; const int eqId = data.header.equipmentNumber; const ParticipantManagement::Participant p = m_dtcPpm->participant(m_dtcPpm->participantIdByEquipmentNumber(eqId)); if (p.id() <= 0) { - WARNING_LOG() << "participant not found - stop"; + WARNING_LOG(m_logger) << "participant not found - stop"; return false; } @@ -196,7 +196,7 @@ bool FromTab::txData(const TrainingAreaBase::TetraIcd::CesHitRequest &data) msg.vulnerabilityState = TrainingAreaBase::TetraIcd::VulnerabilityState::CatastrophicKill; msg.originatorId = data.originatorEquipmentNumber; - DEBUG_LOG() << "sending state change direct (kill) with jamming for eqId " << msg.header.equipmentNumber; + DEBUG_LOG(m_logger) << "sending state change direct (kill) with jamming for eqId " << msg.header.equipmentNumber; m_sendToDds->rxData(msg); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.h index 2f29564f2..5fda34d4e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/from_tab.h @@ -84,6 +84,7 @@ Q_SIGNALS: void outgoingMessage(const QByteArray &msg); protected: + NGL::INGLLogger &m_logger; bool m_isConnected; std::shared_ptr m_dtcPdm; std::shared_ptr m_dtcPpm; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.cpp index 185d0a9af..e5d039b2d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.cpp @@ -23,9 +23,8 @@ namespace UAS { -TmsIfModuleHandle::TmsIfModuleHandle() - : m_handle(ModuleLoader::load(QString(QCoreApplication::applicationDirPath() + QStringLiteral("/../lib/")).toStdString())) -{} +TmsIfModuleHandle::TmsIfModuleHandle() : m_handle(ModuleLoader::load(QString(QCoreApplication::applicationDirPath() + QStringLiteral("/../lib/")).toStdString())), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} TmsIfModuleHandle::~TmsIfModuleHandle() @@ -55,11 +54,11 @@ PluginInstance::PluginInstance(TrainingAreaBase::Plugin::DataProvider *dataProvi , m_uavIAManager(new UAVInterfaceAdapterManager(m_ddsHandler, m_sendToDds, m_tmsIfAdapter, m_exerciseId, this)) , m_fromTab(new FromTab(ddsHandler, m_sendToDds, m_uavIAManager, m_exerciseId)) { - DEBUG_LOG() << "UAS PluginInstance running!"; + DEBUG_LOG(m_logger) << "UAS PluginInstance running!"; if (!m_dtcPdm) { - WARNING_LOG() << "m_dtcPdm failed"; + WARNING_LOG(m_logger) << "m_dtcPdm failed"; throw std::runtime_error("m_dtcPdm failed"); } m_dtcPdm->enableChargeType(); @@ -68,7 +67,7 @@ PluginInstance::PluginInstance(TrainingAreaBase::Plugin::DataProvider *dataProvi if (!m_dtcPpm) { - WARNING_LOG() << "m_dtcPpm failed"; + WARNING_LOG(m_logger) << "m_dtcPpm failed"; throw std::runtime_error("m_dtcPpm failed"); } m_dtcPpm->enableParticipant(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.h index 0286fdf0b..7872b5b20 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/plugin_instance.h @@ -37,6 +37,8 @@ public: } private: + +NGL::INGLLogger &m_logger; void *m_handle { nullptr }; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.cpp index 9d2b04140..450aa10db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.cpp @@ -18,7 +18,7 @@ UAVInterfaceAdapter::UAVInterfaceAdapter(UAVInterfaceAdapterConfig uavConfig, UA UAVInterfaceAdapter::~UAVInterfaceAdapter() { - DEBUG_LOG() << "terminating IA for UAV - " << (quintptr)this; + DEBUG_LOG(m_logger) << "terminating IA for UAV - " << (quintptr)this; delete m_commander; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.h index c31945941..36b1bb869 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia.h @@ -57,6 +57,8 @@ public: UAVCommander &commander() { return *m_commander; } private: + +NGL::INGLLogger &m_logger; UAVInterfaceAdapterConfig m_config; UAVCommander *m_commander; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia_manager.cpp index d35ead2d7..4bfe0e5c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/UAS/uav_ia_manager.cpp @@ -25,19 +25,18 @@ const int UAVInterfaceAdapterManager::s_domainId = 4; UAVInterfaceAdapterManager::UAVInterfaceAdapterManager(const std::shared_ptr &ddsHandler, const std::shared_ptr &sendToDds, - TmsIfAdapter &tmsIfAdapter, int exerciseId, QObject *parent) - : QObject(parent) + TmsIfAdapter &tmsIfAdapter, int exerciseId, QObject *parent) : QObject(parent) , m_exerciseId(exerciseId) , m_dtcPpm(ParticipantManagement::Interface::Dtc::create(ddsHandler->ddsConnector())) , m_ftcPpm(ParticipantManagement::Interface::Ftc::create(ddsHandler->ddsConnector())) , m_tmsIfAdapter(tmsIfAdapter) - , m_sendToDds(sendToDds) -{} + , m_sendToDds(sendToDds), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void UAVInterfaceAdapterManager::init() { - DEBUG_LOG() << "UAVInterfaceAdapterManager starting for ex " << m_exerciseId; + DEBUG_LOG(m_logger) << "UAVInterfaceAdapterManager starting for ex " << m_exerciseId; m_dtcPpm->waitForHistoricalDataDynamicParticipantData(3000); m_dtcPpm->waitForHistoricalDataParticipant(3000); @@ -80,7 +79,7 @@ void UAVInterfaceAdapterManager::init() m_dtcPpm->enableUAS(); } - DEBUG_LOG() << "done"; + DEBUG_LOG(m_logger) << "done"; } @@ -95,21 +94,21 @@ void UAVInterfaceAdapterManager::removed(const ParticipantManagement::UAS &uas) if (m_uavs.find(uas.id()) != m_uavs.cend()) { - WARNING_LOG() << "tried removing participant " << uas.id() << " that doesn't exist"; + WARNING_LOG(m_logger) << "tried removing participant " << uas.id() << " that doesn't exist"; return; } - DEBUG_LOG() << "UAV with uas id " << uas.id() << " found! removing....."; + DEBUG_LOG(m_logger) << "UAV with uas id " << uas.id() << " found! removing....."; stop(uas); } void UAVInterfaceAdapterManager::modified(const ParticipantManagement::UAS &uas) { - DEBUG_LOG() << "modify uas " << uas.id(); + DEBUG_LOG(m_logger) << "modify uas " << uas.id(); if (uas.participantId() <= 0) { - WARNING_LOG() << "UAV with uas id " << uas.id() << " not a UAV anymore - removing"; + WARNING_LOG(m_logger) << "UAV with uas id " << uas.id() << " not a UAV anymore - removing"; stop(uas); return; } @@ -121,14 +120,14 @@ void UAVInterfaceAdapterManager::modified(const ParticipantManagement::UAS &uas) const auto i = m_uavs.find(uasId); if (i == m_uavs.cend()) { - WARNING_LOG() << "UAV with uas id " << uas.id() << " was modified but now found in our list - feeding it as 'added' instead as a bail-out"; + WARNING_LOG(m_logger) << "UAV with uas id " << uas.id() << " was modified but now found in our list - feeding it as 'added' instead as a bail-out"; added(uas); return; } const UAVInterfaceAdapter &uav2 = *i->second; - DEBUG_LOG() << "UAV with uas id " << uas.id() << " found"; + DEBUG_LOG(m_logger) << "UAV with uas id " << uas.id() << " found"; try { @@ -136,7 +135,7 @@ void UAVInterfaceAdapterManager::modified(const ParticipantManagement::UAS &uas) if (uav2.config() == config) { - DEBUG_LOG() << "UAV with uas id " << uas.id() << " already running and config has not changed - doing nothing (irrelevant data has changed)"; + DEBUG_LOG(m_logger) << "UAV with uas id " << uas.id() << " already running and config has not changed - doing nothing (irrelevant data has changed)"; return; } @@ -149,14 +148,14 @@ void UAVInterfaceAdapterManager::modified(const ParticipantManagement::UAS &uas) } catch(const std::exception &ex) { - WARNING_LOG() << "Failed to modify UAV: " << ex.what(); + WARNING_LOG(m_logger) << "Failed to modify UAV: " << ex.what(); } } void UAVInterfaceAdapterManager::added(const ParticipantManagement::UAS &uas) { - DEBUG_LOG() << "exId: " << m_exerciseId << ", uas: " << uas.id() << ", participantId: " << uas.participantId()<<" ## use tcp ? "<participant(uas.participantId()); @@ -170,17 +169,17 @@ void UAVInterfaceAdapterManager::added(const ParticipantManagement::UAS &uas) return; } - DEBUG_LOG() << "added uav with id " << uas.id() << " for pId " << uas.participantId(); + DEBUG_LOG(m_logger) << "added uav with id " << uas.id() << " for pId " << uas.participantId(); if (m_uavs.find(uas.id()) != m_uavs.cend()) { - DEBUG_LOG() << "participant " << uas.id() << " already started - doing nothing"; + DEBUG_LOG(m_logger) << "participant " << uas.id() << " already started - doing nothing"; return; } - DEBUG_LOG() << "############# ALLES OKAY uas: " << uas.id() << " - pId: " << uas.participantId(); - DEBUG_LOG() << "UAV with uas id " << uas.id() << " found"; + DEBUG_LOG(m_logger) << "############# ALLES OKAY uas: " << uas.id() << " - pId: " << uas.participantId(); + DEBUG_LOG(m_logger) << "UAV with uas id " << uas.id() << " found"; try { @@ -189,7 +188,7 @@ void UAVInterfaceAdapterManager::added(const ParticipantManagement::UAS &uas) } catch (const std::exception &ex) { - WARNING_LOG() << "Failed to start uav ia: " << ex.what(); + WARNING_LOG(m_logger) << "Failed to start uav ia: " << ex.what(); } } @@ -212,7 +211,7 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA const int droneDomainId = s_domainId; const bool useTcp = uas.useTcp(); - DEBUG_LOG() << "starting IA for eqId = " << droneEqId << ", pid = " << droneParticipantId << ", domain = " << droneDomainId << ", uasId = " << uasId<<" // ** useTcp: "<dynamicParticipantData(droneParticipantId); if (pdata.participantId() < 1 || pdata.stateHistory().empty()) { - DEBUG_LOG() << "pdata or state history for pid " << droneParticipantId << " is empty - sending init"; + DEBUG_LOG(m_logger) << "pdata or state history for pid " << droneParticipantId << " is empty - sending init"; TrainingAreaBase::TetraIcd::StateChange msg; msg.header.equipmentNumber = droneEqId; @@ -240,11 +239,11 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA m_sendToDds->rxData(msg); - DEBUG_LOG() << "sent combat ready for " << droneParticipantId << " - done"; + DEBUG_LOG(m_logger) << "sent combat ready for " << droneParticipantId << " - done"; } else { - WARNING_LOG() << "state history for pid " << droneParticipantId << " not empty - nothing to do"; + WARNING_LOG(m_logger) << "state history for pid " << droneParticipantId << " not empty - nothing to do"; } }; uav->set_isReady_Callback(fn); @@ -259,7 +258,7 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA msg.header.timeStamp = QDateTime::currentMSecsSinceEpoch(); msg.geoPosition = { data.lon * LtsCoordTrans::deg2rad(), data.lat * LtsCoordTrans::deg2rad(), data.alt }; - DEBUG_LOG() << "POSITION! sending PositionReport into TAB"; + DEBUG_LOG(m_logger) << "POSITION! sending PositionReport into TAB"; m_sendToDds->rxData(msg); }); @@ -317,19 +316,19 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA } m_sendToDds->rxData(msg); - DEBUG_LOG() << "RadioLinkConnectionState! sending RadioLinkConnectionState into TAB"; + DEBUG_LOG(m_logger) << "RadioLinkConnectionState! sending RadioLinkConnectionState into TAB"; }); uav->set_ReportRadioLinkConnectionState_Callback([this, droneEqId](const TeleOperation::RadioLinkConnectionState::Message &data) { - DEBUG_LOG() << "COULD! send RadioLinkConnectionState! sending RadioLinkConnectionState into TAB << " << droneEqId << " " << data.status; + DEBUG_LOG(m_logger) << "COULD! send RadioLinkConnectionState! sending RadioLinkConnectionState into TAB << " << droneEqId << " " << data.status; }); uav->set_ReportMissionStatus_Callback([this, droneEqId](const MissionCtrl::ReportMissionStatus::Message &data) { - DEBUG_LOG() << "ReportMissionStatus! sending ReportMissionStatus into TAB << " << droneEqId << " - currentTask = " << (int)data.currentTask << ", currentMission = " << data.currentMissionName; + DEBUG_LOG(m_logger) << "ReportMissionStatus! sending ReportMissionStatus into TAB << " << droneEqId << " - currentTask = " << (int)data.currentTask << ", currentMission = " << data.currentMissionName; TrainingAreaBase::TetraIcd::UAVMissionStatus msg; msg.header.equipmentNumber = droneEqId; @@ -345,7 +344,7 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA case MissionCtrl::Task::Connect: msg.currentAction = TrainingAreaBase::TetraIcd::UAVActionTask::Connect; break; case MissionCtrl::Task::Loiter: msg.currentAction = TrainingAreaBase::TetraIcd::UAVActionTask::Loiter; break; case MissionCtrl::Task::Return: msg.currentAction = TrainingAreaBase::TetraIcd::UAVActionTask::Return; - DEBUG_LOG() << "Return"; + DEBUG_LOG(m_logger) << "Return"; setMissionActionFulfilled(droneEqId); break; case MissionCtrl::Task::Observe: msg.currentAction = TrainingAreaBase::TetraIcd::UAVActionTask::Observe; break; @@ -358,23 +357,23 @@ void UAVInterfaceAdapterManager::start(const ParticipantManagement::UAS &uas, UA uav->startIA(config.m_ip.toStdString(), config.m_port, config.m_useTcp); - DEBUG_LOG() << "DONE STARTING UAV!"; + DEBUG_LOG(m_logger) << "DONE STARTING UAV!"; } catch (const std::exception &ex) { - WARNING_LOG() << "Failed to start UAV: " << ex.what(); + WARNING_LOG(m_logger) << "Failed to start UAV: " << ex.what(); } } void UAVInterfaceAdapterManager::stop(const ParticipantManagement::UAS &uas) { - DEBUG_LOG() << "############################### STOP !! " << uas.id(); + DEBUG_LOG(m_logger) << "############################### STOP !! " << uas.id(); auto it = m_uavs.find(uas.id()); if (it == m_uavs.cend()) { - DEBUG_LOG() << "uav not found - ignoring :/"; + DEBUG_LOG(m_logger) << "uav not found - ignoring :/"; return; } it->second->deleteLater(); @@ -388,7 +387,7 @@ bool UAVInterfaceAdapterManager::kill(int participantId) if (uas.id() < 1) { - DEBUG_LOG() << "uas by participant id " << participantId << " not found - stop"; + DEBUG_LOG(m_logger) << "uas by participant id " << participantId << " not found - stop"; return false; } @@ -396,7 +395,7 @@ bool UAVInterfaceAdapterManager::kill(int participantId) if (i == m_uavs.cend()) { - DEBUG_LOG() << "uav by participant id " << participantId << " not found - stop"; + DEBUG_LOG(m_logger) << "uav by participant id " << participantId << " not found - stop"; return false; } @@ -413,7 +412,7 @@ bool UAVInterfaceAdapterManager::waypoint(int participantId, TrainingAreaBase::T if (uas.id() < 1) { - DEBUG_LOG() << "uas by participant id " << participantId << " not found - stop"; + DEBUG_LOG(m_logger) << "uas by participant id " << participantId << " not found - stop"; return false; } @@ -421,11 +420,11 @@ bool UAVInterfaceAdapterManager::waypoint(int participantId, TrainingAreaBase::T if (i == m_uavs.cend()) { - DEBUG_LOG() << "uav by participant id " << participantId << " not found - stop"; + DEBUG_LOG(m_logger) << "uav by participant id " << participantId << " not found - stop"; for (const auto &uav : m_uavs) { - DEBUG_LOG() << "pid: " << uav.first; + DEBUG_LOG(m_logger) << "pid: " << uav.first; } return false; @@ -433,7 +432,7 @@ bool UAVInterfaceAdapterManager::waypoint(int participantId, TrainingAreaBase::T if (i->second == nullptr) { - WARNING_LOG() << "UAVInterfaceAdapterManager::waypoint: NULLPTR for "< bool sendToTxMixin(const T *data); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_wlsHandlerTx; std::shared_ptr m_tetraHandlerTx; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.cpp index 5a370f73b..2d2e00b51 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.cpp @@ -90,7 +90,7 @@ void TetraDispatcher::onSendInitialData() m_txHandler->setConnected(true); if (m_dataProvider) { - INFO_LOG() << "sending initial data"; + INFO_LOG(m_logger) << "sending initial data"; if (m_dataProvider->exerciseId() > 0) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.h index 63d6a9b87..d61a0d361 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_dispatcher.h @@ -39,6 +39,7 @@ public: const char *name() const override { return tr_lts("dds", "TETRA"); } private: + NGL::INGLLogger &m_logger; bool init(PrtCnv::PrtCnvApplication *prtCnvApp); private Q_SLOTS: @@ -46,9 +47,11 @@ private Q_SLOTS: void onSendInitialData(); private: + NGL::INGLLogger &m_logger; void disconnectSocket(QWebSocket *s); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_rxHandler; std::shared_ptr m_txHandler; TetraPrtCnv *m_tetraPrtCnv; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.cpp index ff63a0c27..0f568d116 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.cpp @@ -10,13 +10,12 @@ namespace WlsTetra { -TetraHandlerRx::TetraHandlerRx(const std::shared_ptr &rxHandler) - : m_rxHandler(rxHandler) +TetraHandlerRx::TetraHandlerRx(const std::shared_ptr &rxHandler) : m_rxHandler(rxHandler) , m_ackTimer(new QTimer(this)) , m_receiveCounter(0) , m_bWarnedOnce(false) - , m_bWaitForInitialAck(true) -{ + , m_bWaitForInitialAck(true), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ackTimer->setInterval(1000); m_ackTimer->setSingleShot(false); connect(m_ackTimer, &QTimer::timeout, @@ -37,14 +36,14 @@ bool TetraHandlerRx::handleTelegram(const QByteArray &baJson) if (!sendCounter.isDouble()) return false; m_receiveCounter = sendCounter.toInt(-1); - DEBUG_LOG() << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString(); + DEBUG_LOG(m_logger) << "Incoming telegram with Id " << obj.value(QStringLiteral("type")).toString(); if (m_receiveCounter < 0) return false; } const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -167,14 +166,14 @@ bool TetraHandlerRx::handleTelegram(const QByteArray &baJson) emit participantLicenseChange(ParticipantLicenseChange::fromJson(data)); break; default: - WARNING_LOG() << "Handler for telegram Id " << typeId.toInt() + WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt() << " not yet implemented (" << baJson << ")"; return false; } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -182,7 +181,7 @@ bool TetraHandlerRx::handleTelegram(const QByteArray &baJson) void TetraHandlerRx::handleAcknowledge(qint64 timeStamp, int counter) { - TRACE_LOG() << "Ack from Socket for time " << timeStamp + TRACE_LOG(m_logger) << "Ack from Socket for time " << timeStamp << " with counter " << counter << ", initial: " << m_bWaitForInitialAck; if (m_bWaitForInitialAck) @@ -209,7 +208,7 @@ void TetraHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.h index 3dbb728e5..bb424b5d3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_rx.h @@ -33,6 +33,7 @@ private: void rxData(const T &data); protected: + NGL::INGLLogger &m_logger; const std::shared_ptr m_rxHandler; QTimer *m_ackTimer; int m_receiveCounter; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.cpp index c263b9465..aa040b83e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.cpp @@ -40,14 +40,14 @@ bool TetraHandlerTx::sendTele(const QByteArray &ba) const QJsonValue typeId = obj[QStringLiteral("typeId")]; if (typeId.toInt() == TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG) { - TRACE_LOG() << "Outgoing ack"; + TRACE_LOG(m_logger) << "Outgoing ack"; emit outgoingMessage(ba); return true; } obj[QStringLiteral("counter")] = m_sendCounter++; const QByteArray baToSend = QJsonDocument(obj).toJson(QJsonDocument::Compact); - DEBUG_LOG() << "Outgoing message: " << typeId.toInt(); + DEBUG_LOG(m_logger) << "Outgoing message: " << typeId.toInt(); emit outgoingMessage(baToSend); return true; } @@ -234,7 +234,7 @@ bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::Sanitation &data) bool TetraHandlerTx::txData(const TrainingAreaBase::TetraIcd::SelectiveReammunition &data) { - DEBUG_LOG() << " TetraHandlerTx::txData: SelectiveReammunition"; + DEBUG_LOG(m_logger) << " TetraHandlerTx::txData: SelectiveReammunition"; return sendToTx(&data); } @@ -261,7 +261,7 @@ bool TetraHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTele obj[QStringLiteral("counter")] = m_sendCounter++; const QByteArray ba = QJsonDocument(obj).toJson(QJsonDocument::Compact); if (data->id() != TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG) - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; emit outgoingMessage(ba); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.h index 1aa5449eb..4c07577a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_handler_tx.h @@ -67,7 +67,9 @@ public: Q_SIGNALS: void outgoingMessage(const QByteArray &msg); protected: + NGL::INGLLogger &m_logger; protected: + NGL::INGLLogger &m_logger; int m_sendCounter = 1; bool m_bConnected = false; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.cpp index 93849de9d..f5203d238 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.cpp @@ -43,7 +43,7 @@ void TetraPrtCnv::onExerciseChanged() { if (m_pdp->exerciseRadioGroup().id() != m_radioGrpId) if (!updatePrtCnv()) - ERROR_LOG() << "Error changing PrtCnv state from radio grp id: " + ERROR_LOG(m_logger) << "Error changing PrtCnv state from radio grp id: " << m_radioGrpId << " to " << m_pdp->exerciseRadioGroup().id(); } @@ -72,7 +72,7 @@ bool TetraPrtCnv::updatePrtCnv() if (!QFile::copy(QStringLiteral(":/PrtCnv.dat"), iniFileOut()) || !QFile::setPermissions(iniFileOut(), QFile::ReadOwner | QFile::WriteOwner)) { - ERROR_LOG() << "Error creating ini file for PrtCnv: " << iniFileOut(); + ERROR_LOG(m_logger) << "Error creating ini file for PrtCnv: " << iniFileOut(); return false; } @@ -112,10 +112,10 @@ bool TetraPrtCnv::checkConfigTemplates() { if (!QFile::exists(playerIdsFile())) { - INFO_LOG() << "Creating " << playerIdsFile(); + INFO_LOG(m_logger) << "Creating " << playerIdsFile(); if (!QFile::copy(QStringLiteral(":/playerIds.dat"), playerIdsFile())) { - ERROR_LOG() << "Error creating " << playerIdsFile(); + ERROR_LOG(m_logger) << "Error creating " << playerIdsFile(); return false; } else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.h index 16099c93d..370be53ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/tetra_prtcnv.h @@ -31,6 +31,7 @@ Q_SIGNALS: void textMessageToPrtCnv(const QByteArray &message); void broadcastTelegramsRequest(int equipmentNumber, int broadcastIndex, int resetCounter); private: +NGL::INGLLogger &m_logger; void cleanupProcess(); static QString iniFileIn(); QString iniFileOut() const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.cpp index 4379165a3..f3a8dc3a5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.cpp @@ -67,7 +67,7 @@ void WlsDispatcher::onWlsConnected() void WlsDispatcher::onWlsDisconnected() { - INFO_LOG() << "Wls socket disconnected"; + INFO_LOG(m_logger) << "Wls socket disconnected"; m_webSocketReconnectTimer->start(5000); m_sendToWls->onWlsDisconnected(); @@ -85,7 +85,7 @@ void WlsDispatcher::onWebSocketError() if (!m_webSocket) return; if (!m_bWarnedOnce) - WARNING_LOG() << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); + WARNING_LOG(m_logger) << "Error connecting to " << webSocketUrl().toString() << ": " << m_webSocket->errorString(); m_webSocket->close(); m_webSocketReconnectTimer->start(5000); m_bWarnedOnce = true; @@ -101,7 +101,7 @@ void WlsDispatcher::onTextMessageReceived(const QString &message) void WlsDispatcher::onParticipantLicenseChange(const TrainingAreaBase::TetraIcd::ParticipantLicenseChange &lc) { - INFO_LOG() << "onParticipantLicenseChange id=" << lc.id() + INFO_LOG(m_logger) << "onParticipantLicenseChange id=" << lc.id() << " equipmentNumber=" << lc.equipmentNumber; m_recvFromWls->participantLicenseChange(lc); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.h index 59ef79280..b8f171dd6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_dispatcher.h @@ -43,8 +43,10 @@ Q_SIGNALS: void wlsTelegramReceived(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele); void wlsTelegramSent(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tele); private: + NGL::INGLLogger &m_logger; QUrl webSocketUrl() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_recvFromTabCb; std::shared_ptr m_recvFromWls; std::shared_ptr m_sendToWls; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.cpp index fa0ccb886..2f299fe14 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.cpp @@ -15,11 +15,10 @@ namespace WlsTetra { WlsHandlerRx::WlsHandlerRx(const std::shared_ptr &recvFromTabCb, - WlsDispatcher *dispatcher) - : m_rxHandler(recvFromTabCb) + WlsDispatcher *dispatcher) : m_rxHandler(recvFromTabCb) , m_dispatcher(dispatcher) - , m_bWarnedOnce(false) -{} + , m_bWarnedOnce(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool WlsHandlerRx::handleTelegram(const QByteArray &baJson) { @@ -28,7 +27,7 @@ bool WlsHandlerRx::handleTelegram(const QByteArray &baJson) if (baJson.isEmpty()) return false; const QJsonObject obj = QJsonDocument::fromJson(baJson).object(); - TRACE_LOG() << "incoming telegram: " << baJson; + TRACE_LOG(m_logger) << "incoming telegram: " << baJson; @@ -43,7 +42,7 @@ bool WlsHandlerRx::handleTelegram(const QByteArray &baJson) const QJsonValue typeId = obj.value(QStringLiteral("typeId")); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return false; } const QJsonObject data = obj.value(QStringLiteral("data")).toObject(); @@ -70,7 +69,7 @@ bool WlsHandlerRx::handleTelegram(const QByteArray &baJson) } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return false; } return true; @@ -187,7 +186,7 @@ bool WlsHandlerRx::handleTelegram(TrainingAreaBase::TetraIcd::TrainingAreaTelegr rxData(toSpecialized(tabTele)); break; default: - ERROR_LOG() << "WlsHandlerRx::handleTelegram no Handler for " << tabTele->id(); + ERROR_LOG(m_logger) << "WlsHandlerRx::handleTelegram no Handler for " << tabTele->id(); return false; } return true; @@ -210,7 +209,7 @@ void WlsHandlerRx::sfmData(const TrainingAreaBase::TetraIcd::WlsBinarySfmData &d { if (data.payload.size() < 2) { - ERROR_LOG() << "Invalid binary data from WLS: " << QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact); + ERROR_LOG(m_logger) << "Invalid binary data from WLS: " << QJsonDocument(data.toJson()).toJson(QJsonDocument::Compact); return; } @@ -222,7 +221,7 @@ void WlsHandlerRx::sfmData(const TrainingAreaBase::TetraIcd::WlsBinarySfmData &d TrainingAreaBase::TetraIcd::TrainingAreaTelegram *tabTele = CoPrtCnvTelegramConverter::convertToTabTele(&radio); if (!tabTele) { - WARNING_LOG() << "Can not convert binary sfm data to a valid tetra telegram - ignoring (" + WARNING_LOG(m_logger) << "Can not convert binary sfm data to a valid tetra telegram - ignoring (" << data.header.equipmentNumber << "): " << QByteArray::fromRawData(reinterpret_cast(data.payload.data()), data.payload.size()).toHex(); return; @@ -238,7 +237,7 @@ void WlsHandlerRx::rxData(const T &data) { if (!m_bWarnedOnce) { - ERROR_LOG() << "No RecvFromTab available"; + ERROR_LOG(m_logger) << "No RecvFromTab available"; m_bWarnedOnce = true; } return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.h index 5321b2f41..1611b7480 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_rx.h @@ -27,11 +27,13 @@ public: Q_SIGNALS: void participantConnectionState(int equipmentNumber, bool dataCommunicationPossible); private: + NGL::INGLLogger &m_logger; void sfmData(const TrainingAreaBase::TetraIcd::WlsBinarySfmData &data); template void rxData(const T &data); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_rxHandler; QSet m_licensedEquipmentNumbers; WlsDispatcher *m_dispatcher; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.cpp index 79f3179f5..09d9c03c1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.cpp @@ -301,7 +301,7 @@ bool WlsHandlerTx::txData(const TrainingAreaBase::TetraIcd::UAVPerformMission &d void WlsHandlerTx::onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible) { - DEBUG_LOG() << "onParticipantConnectionState - " << equipmentNumber + DEBUG_LOG(m_logger) << "onParticipantConnectionState - " << equipmentNumber << ", communication possible: " << dataCommunicationPossible; m_dataCommunicationPossible[equipmentNumber] = dataCommunicationPossible; } @@ -342,7 +342,7 @@ bool WlsHandlerTx::sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegr const QByteArray ba = QJsonDocument(obj).toJson(QJsonDocument::Compact); if (data->id() != TrainingAreaBase::TetraIcd::TelegramId::BESTAETIGUNG) - DEBUG_LOG() << "Sending tele: " << ba; + DEBUG_LOG(m_logger) << "Sending tele: " << ba; m_webSocket->sendTextMessage(QString::fromUtf8(ba)); if (!bIsAlreadyLogged) emit m_dispatcher->wlsTelegramSent(data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.h index 1e52304ed..de81c6d1f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/Plugins/WlsTetra/wls_handler_tx.h @@ -68,12 +68,14 @@ public: public Q_SLOTS: void onParticipantConnectionState(int equipmentNumber, bool dataCommunicationPossible); private: + NGL::INGLLogger &m_logger; template bool sendToTxBinary(const T *data); bool sendToTx(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, bool bForce = false, bool bIsAlreadyLogged = false); private: + NGL::INGLLogger &m_logger; QHash m_dataCommunicationPossible; TrainingAreaBase::Plugin::DataProvider *m_pdp; QWebSocket *m_webSocket; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/Messages/client_message.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/Messages/client_message.cpp index fdf4922db..cdaefc802 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/Messages/client_message.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/Messages/client_message.cpp @@ -46,9 +46,8 @@ ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandle -SendBiteRequest::SendBiteRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data) - : ClientMessage(dataManager, client, type, typeId, uuid, data) -{} +SendBiteRequest::SendBiteRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid, const QJsonValue &data) : ClientMessage(dataManager, client, type, typeId, uuid, data), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void SendBiteRequest::process() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/websocket_interface_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/websocket_interface_handler.cpp index 3572a6f82..82343a9fb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/websocket_interface_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/WebSocketInterface/websocket_interface_handler.cpp @@ -31,7 +31,7 @@ bool WebSocketInterfaceHandler::init() { cleanup(); - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "... ok"; m_dataManager = new DataManager(m_mainHandler); @@ -39,16 +39,16 @@ bool WebSocketInterfaceHandler::init() m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this); - DEBUG_LOG() << "Initialising LtsWebSocketServer"; + DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer"; if (!m_webSocketServer->init(QStringLiteral("TAB"), Settings::getWebSocketServerPortRange(1))) { - ERROR_LOG() << "Failed to initialise LtsWebSocketServer"; + ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer"; return false; } - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "... ok"; - DEBUG_LOG() << "Connection signals and slots"; - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "Connection signals and slots"; + DEBUG_LOG(m_logger) << "... ok"; return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.cpp index d870f9865..91f4325b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.cpp @@ -12,12 +12,11 @@ namespace TrainingAreaBase { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) , m_curMSecSinceEpoch(0) - , m_exerciseId(exerciseId) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + , m_exerciseId(exerciseId), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -39,7 +38,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -73,11 +72,11 @@ bool DdsHandler::init(const QStringList &qosFileList) DDS::Helper::getShortTopicName(DDS::topic_type_name::value())); - INFO_LOG() << "Dts TrainingAreaBase initialised"; + INFO_LOG(m_logger) << "Dts TrainingAreaBase initialised"; m_ftsTab = TrainingAreaBase::Interface::Fts::create(m_ddsConnector); bRet &= m_ftsTab->enableAll(); - INFO_LOG() << "Fts TrainingAreaBase initialised"; + INFO_LOG(m_logger) << "Fts TrainingAreaBase initialised"; m_ftcPpm = ParticipantManagement::Interface::Ftc::create(m_ddsConnector); bRet &= m_ftcPpm->enableSetMissionActionFulfilled(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.h index 7a12ca546..20e23ca0a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/dds_handler.h @@ -47,6 +47,7 @@ public: int getExerciseId() const { return m_exerciseId;} private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_dtcPartitionTime; std::shared_ptr m_pacemaker; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.cpp index 10fdb6511..2f19c2cce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.cpp @@ -20,7 +20,7 @@ bool ExmHandler::init() this, &ExmHandler::exerciseChanged); if (!m_exmDtc->enableExercise()) { - ERROR_LOG() << "Can not read equipment/exercise mappings from PPM"; + ERROR_LOG(m_logger) << "Can not read equipment/exercise mappings from PPM"; return false; } return true; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.h index c3c8bc952..43cb1ebd5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/exm_handler.h @@ -27,6 +27,7 @@ Q_SIGNALS: private Q_SLOTS: void onExerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType); private: + NGL::INGLLogger &m_logger; std::unordered_map m_exercise2RadioGroup; std::shared_ptr m_exmDtc; MainHandler *m_mainHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.cpp index 8884bf1ba..7412ee6fa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.cpp @@ -12,12 +12,11 @@ namespace TrainingAreaBase { -IsmHandler::IsmHandler(MainHandler *mainHandler) - : m_mainHandler(mainHandler) +IsmHandler::IsmHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler) , m_dtcIsm(nullptr) , m_distanceIpsToGps(Settings::distanceIpsToGps()) - , m_distanceOpsToGps(Settings::distanceOpsToGps()) -{} + , m_distanceOpsToGps(Settings::distanceOpsToGps()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool IsmHandler::init() { @@ -39,7 +38,7 @@ bool IsmHandler::init() !m_dtcIsm->enableMountingPointAsset() || !m_dtcIsm->enableMainFootprint()) { - ERROR_LOG() << "Can not read data from ISM"; + ERROR_LOG(m_logger) << "Can not read data from ISM"; return false; } @@ -63,7 +62,7 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode) { if ( m_opsData.contains(ipsCode)) { - DEBUG_LOG() << "dataFromOpsCode contains ipsCode:" << ipsCode + DEBUG_LOG(m_logger) << "dataFromOpsCode contains ipsCode:" << ipsCode << " assetId=" << m_opsData.value(ipsCode).assetId << " roomId=" << m_opsData.value(ipsCode).roomId << " mainStructureElementId=" << m_opsData.value(ipsCode).mainStructureElementId @@ -81,7 +80,7 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode) if ( assetId < 0) { - WARNING_LOG() << "No asset for ops code=" << ipsCode << " found"; + WARNING_LOG(m_logger) << "No asset for ops code=" << ipsCode << " found"; return {}; } opsData.opsCode = ipsCode; @@ -95,7 +94,7 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode) - DEBUG_LOG() << "OpsData.structureElementId=" << opsData.structureElementId + DEBUG_LOG(m_logger) << "OpsData.structureElementId=" << opsData.structureElementId << " assetId=" << opsData.assetId << " mountingPointTypeId=" << opsData.mountingPointTypeId << " opsCode=" << opsData.opsCode @@ -105,7 +104,7 @@ IsmHandler::OpsData IsmHandler::dataFromOpsCode(int ipsCode) { - DEBUG_LOG() <<"---------------- UPDATE OPS-Data ------------------"; + DEBUG_LOG(m_logger) <<"---------------- UPDATE OPS-Data ------------------"; updateOpsData(opsData, true); opsData= m_opsData[opsData.opsCode] ; } @@ -131,7 +130,7 @@ void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::I if ( i.value().assetId == data.id()) { opsCode = i.value().opsCode; - DEBUG_LOG() << "onInstrumentationAssetChanged assetId=" << data.id(); + DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id(); break; } } @@ -153,7 +152,7 @@ void IsmHandler::onInstrumentationAssetChanged(const InfrastructureManagement::I if ( i.value().assetId == data.id()) { opsCode = i.value().opsCode; - DEBUG_LOG() << "onInstrumentationAssetChanged assetId=" << data.id(); + DEBUG_LOG(m_logger) << "onInstrumentationAssetChanged assetId=" << data.id(); break; } } @@ -179,7 +178,7 @@ void IsmHandler::onMountingPointAssetChanged(const InfrastructureManagement::Mou break; } case DataModification::eRemoved: - DEBUG_LOG() << "onMountingPointAssetChanged Unmount id=" << data.id() + DEBUG_LOG(m_logger) << "onMountingPointAssetChanged Unmount id=" << data.id() << " assetId=" << data.assetId(); removeOpsAsset(data.assetId()); @@ -193,13 +192,13 @@ void IsmHandler::rotateBuildingFootprint(int mseId) if ( m_relBuildingFootprintsRotated.contains(mseId)) { - DEBUG_LOG() << " mainStructureElements.Rotate already done id=" << mseId; + DEBUG_LOG(m_logger) << " mainStructureElements.Rotate already done id=" << mseId; return; } InfrastructureManagement::MainStructureElement mse = m_dtcIsm->mainStructureElement(mseId); TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition()); - DEBUG_LOG() << " mainStructureElements.Rotate id=" << mseId; + DEBUG_LOG(m_logger) << " mainStructureElements.Rotate id=" << mseId; QMatrix matrix; QPolygonF relBuildingFootprintMgrs; qreal angle = mse.angle(); @@ -213,13 +212,13 @@ void IsmHandler::rotateBuildingFootprint(int mseId) QPointF relBuildingPoint(p.x() + relBldgPosition.offsetX, p.y() + relBldgPosition.offsetY); relBuildingFootprintMgrs.append(relBuildingPoint); - DEBUG_LOG() << " relBuildingFootprintRotated = " << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << " relBuildingFootprintRotated = " << p.x() << "/" << p.y() << " relBuildingPointMgrs=" << relBuildingPoint.x() << "/" << relBuildingPoint.y() << " angle=" << angle; } m_relBuildingFootprintsRotatedMgrs.insert(mseId, relBuildingFootprintMgrs); m_buildingBoundingBoxesMgrs.insert(mseId, relBuildingFootprintMgrs.boundingRect()); - DEBUG_LOG() << "BoundingBox bottomLeft=" << relBuildingFootprintMgrs.boundingRect().bottomLeft().x() << "/" << relBuildingFootprintMgrs.boundingRect().bottomLeft().x() + DEBUG_LOG(m_logger) << "BoundingBox bottomLeft=" << relBuildingFootprintMgrs.boundingRect().bottomLeft().x() << "/" << relBuildingFootprintMgrs.boundingRect().bottomLeft().x() << " topRight=" << relBuildingFootprintMgrs.boundingRect().topRight().x() << "/" << relBuildingFootprintMgrs.boundingRect().topRight().x(); } @@ -234,7 +233,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M int exerciseId = m_mainHandler->ddsHandler()->getExerciseId(); if ( !m_dtcIsm->isElementAssignedToExercise(data, exerciseId)) { - INFO_LOG() << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove"; + INFO_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << data.id() << " remove"; m_buildingBoundingBoxes.remove(data.id()); @@ -258,7 +257,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M iter.next(); if (iter.value().mainStructureElementId == data.id()) { - DEBUG_LOG() << "remove from m_opsData, key=" << iter.key(); + DEBUG_LOG(m_logger) << "remove from m_opsData, key=" << iter.key(); iter.remove(); break; } @@ -283,7 +282,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M if (it != m_opsData.end()) updateOpsData(it.value()); } - DEBUG_LOG() << " mainStructureElements Vor Rotate id=" << data.id(); + DEBUG_LOG(m_logger) << " mainStructureElements Vor Rotate id=" << data.id(); QMap mainFootprints = m_dtcIsm->getFootprintsByExerciseId(exerciseId); @@ -308,7 +307,7 @@ void IsmHandler::onMainStructureElementChanged(const InfrastructureManagement::M void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFootprint &data, DataModification modType) { - DEBUG_LOG() << "onMainFootprintChanged id=" << data.id() + DEBUG_LOG(m_logger) << "onMainFootprintChanged id=" << data.id() << " size=" << data.elements().size(); switch (modType) @@ -318,7 +317,7 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot { - DEBUG_LOG() << "mainStructureElements onMainFootprintChanged id=" << data.id(); + DEBUG_LOG(m_logger) << "mainStructureElements onMainFootprintChanged id=" << data.id(); double minX = 0; double maxX = 0; double minY = 0; @@ -335,11 +334,11 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot QPointF point(relPos.offsetX(), relPos.offsetY()); relBuildingFootprint.append(point); - DEBUG_LOG() << "relBuildingFootprint.append() " << point.x() << "/" << point.y() << ")"; + DEBUG_LOG(m_logger) << "relBuildingFootprint.append() " << point.x() << "/" << point.y() << ")"; } - DEBUG_LOG() << "minX=" << minX + DEBUG_LOG(m_logger) << "minX=" << minX << " maxX=" << maxX << " minY=" << minY << " maxY=" << maxY @@ -354,7 +353,7 @@ void IsmHandler::onMainFootprintChanged(const InfrastructureManagement::MainFoot m_relBuildingFootprints.insert(data.id(), relBuildingFootprint); for (const QPointF &p : std::as_const(relBuildingFootprint)) - DEBUG_LOG() << "relBuildingFootprint = " << p.x() << "/" << p.y(); + DEBUG_LOG(m_logger) << "relBuildingFootprint = " << p.x() << "/" << p.y(); rotateBuildingFootprint(data.id()); break; } @@ -402,7 +401,7 @@ int IsmHandler::getOpsCodeFromJSon(const std::string &s) const if (jError.error != QJsonParseError::NoError || !doc.isObject()) { - ERROR_LOG() << "Can not read json data from IPS asset - properties are not parsable: " + ERROR_LOG(m_logger) << "Can not read json data from IPS asset - properties are not parsable: " << jError.errorString() << " - '" << s << "'"; return 0; } @@ -417,7 +416,7 @@ bool IsmHandler::getIsOpsTunnel(const std::string &s) const if (jError.error != QJsonParseError::NoError || !doc.isObject()) { - ERROR_LOG() << "Can not read json data from IPS asset - properties are not parsable: " + ERROR_LOG(m_logger) << "Can not read json data from IPS asset - properties are not parsable: " << jError.errorString() << " - '" << s << "'"; return false; } @@ -430,12 +429,12 @@ bool IsmHandler::getIsOpsTunnel(const std::string &s) const void IsmHandler::updateOpsData(OpsData &data, bool force) { - DEBUG_LOG() << "updateOpsData" + DEBUG_LOG(m_logger) << "updateOpsData" << " opsCode=" << data.opsCode << " assetId=" << data.assetId << " force=" << force; int exerciseId = m_mainHandler->ddsHandler()->getExerciseId(); - DEBUG_LOG() << "updateOpsData for asset " << data.assetId << " with ops id " << data.opsCode; + DEBUG_LOG(m_logger) << "updateOpsData for asset " << data.assetId << " with ops id " << data.opsCode; const int seId = m_dtcIsm->getStructueElementIdFromAssetId(data.assetId); data.structureElementId = 0; @@ -464,7 +463,7 @@ void IsmHandler::updateOpsData(OpsData &data, bool force) data.position = se.geoPosition(); data.position.z(data.position.z() - mse.geoPosition().z()); m_structure_ElementId2AssetTypeId[seId] = se.mountingPointTypeId().underlying(); - DEBUG_LOG() << "found position for asset " << data.assetId << " with se id " << seId + DEBUG_LOG(m_logger) << "found position for asset " << data.assetId << " with se id " << seId << " " << data.position.lon() << "/" << data.position.lat() << "/" << data.position.z() << " name=" << se.name() << " type=" << se.mountingPointTypeId() @@ -476,24 +475,24 @@ void IsmHandler::updateOpsData(OpsData &data, bool force) } } } - DEBUG_LOG() << "found no position for asset " << data.assetId << " with se id " << seId; + DEBUG_LOG(m_logger) << "found no position for asset " << data.assetId << " with se id " << seId; } bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, const Core::GeoPosition &position, const int mountPointTypeId) const { int distance = 0; - DEBUG_LOG() << "IsmHandler::posInExtendedBuildingFootprint mainStructureElementId=" << mainStructureElementId + DEBUG_LOG(m_logger) << "IsmHandler::posInExtendedBuildingFootprint mainStructureElementId=" << mainStructureElementId << " mountPointTypeId=" << mountPointTypeId; if (m_distanceIpsToGps <= 0 && m_distanceOpsToGps <= 0) return false; switch (mountPointTypeId) { case InfrastructureManagement::MountingPointType_def::OutdoorIPS: - DEBUG_LOG() << "posInExtendedBuildingFootprint Distance = m_distanceOpsToGps"; + DEBUG_LOG(m_logger) << "posInExtendedBuildingFootprint Distance = m_distanceOpsToGps"; distance = m_distanceOpsToGps; break; case InfrastructureManagement::MountingPointType_def::IndoorIPS: - DEBUG_LOG() << "posInExtendedBuildingFootprint Distance = m_distanceIpsToGps"; + DEBUG_LOG(m_logger) << "posInExtendedBuildingFootprint Distance = m_distanceIpsToGps"; distance = m_distanceIpsToGps; break; default: @@ -503,7 +502,7 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons - DEBUG_LOG() << "mainStructureElementId=" << mainStructureElementId + DEBUG_LOG(m_logger) << "mainStructureElementId=" << mainStructureElementId << " position=" << position; @@ -519,7 +518,7 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons TetraIcd::RelativePosition relBldgPosition = m_mainHandler->posHandler()->geographicToRelative(mse.geoPosition()); TetraIcd::RelativePosition relPosition = m_mainHandler->posHandler()->geographicToRelative(position); - DEBUG_LOG() << "relBldgPosition=" << relBldgPosition.offsetX << "/" << relBldgPosition.offsetY + DEBUG_LOG(m_logger) << "relBldgPosition=" << relBldgPosition.offsetX << "/" << relBldgPosition.offsetY << ", relPosition=" << relPosition.offsetX << "/" << relPosition.offsetY; QPointF relPositionMgrs(relPosition.offsetX, relPosition.offsetY); @@ -532,14 +531,14 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons QPointF relPositionF(relPosition.offsetX - relBldgPosition.offsetX, relPosition.offsetY - relBldgPosition.offsetY); if (relBuildingFootprint.containsPoint(relPositionF, Qt::OddEvenFill)) { - DEBUG_LOG() << "Position is inside Building-Footprint"; + DEBUG_LOG(m_logger) << "Position is inside Building-Footprint"; return true; } - DEBUG_LOG() << "relBuildingFootprint.size=" << relBuildingFootprint.size(); + DEBUG_LOG(m_logger) << "relBuildingFootprint.size=" << relBuildingFootprint.size(); for (int i = 0; i < relBuildingFootprint.size() ; i++) { int nextPoint = i + 1; @@ -549,17 +548,17 @@ bool IsmHandler::posInExtendedBuildingFootprint(int mainStructureElementId, cons QPointF l1(relBuildingFootprint[i].x() + relBldgPosition.offsetX, relBuildingFootprint[i].y() + relBldgPosition.offsetY); QPointF l2(relBuildingFootprint[nextPoint].x() + relBldgPosition.offsetX, relBuildingFootprint[nextPoint].y() + relBldgPosition.offsetY); double distancePointLineValue = distancePointLine(relPositionMgrs, l1, l2); - DEBUG_LOG() << "distancePointLineValue=" << distancePointLineValue + DEBUG_LOG(m_logger) << "distancePointLineValue=" << distancePointLineValue << " Point =" << relPositionMgrs.x() << "/" << relPositionMgrs.y() << " Line=" << l1.x() << "/" << l1.y() << " " << l2.x() << "/" << l2.y(); if (distancePointLineValue < distance) { - DEBUG_LOG() << "IsmHandler::posInExtendedBuildingFootprint return true"; + DEBUG_LOG(m_logger) << "IsmHandler::posInExtendedBuildingFootprint return true"; return true; } } - DEBUG_LOG() << "IsmHandler::posInExtendedBuildingFootprint return false"; + DEBUG_LOG(m_logger) << "IsmHandler::posInExtendedBuildingFootprint return false"; return false; } @@ -577,7 +576,7 @@ double IsmHandler::distancePointLine(const QPointF &p, const QPointF &l1, qreal length2 = pToP2.length(); if (length1 < length2) { - DEBUG_LOG() << "a distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "a distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << length1 @@ -586,7 +585,7 @@ double IsmHandler::distancePointLine(const QPointF &p, const QPointF &l1, } else { - DEBUG_LOG() << "b distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "b distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << length2 @@ -600,7 +599,7 @@ double IsmHandler::distancePointLine(const QPointF &p, const QPointF &l1, double distance = sqrt(squareLen(p, intersectPnt)); - DEBUG_LOG() << "c distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "c distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << distance; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.h index 65df04ef3..039f978ea 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ism_handler.h @@ -54,6 +54,7 @@ private Q_SLOTS: void onMainFootprintChanged(const InfrastructureManagement::MainFootprint &data, DataModification modType); private: + NGL::INGLLogger &m_logger; void rotateBuildingFootprint(int mseId); void removeOpsDataByStructureElementId(int structureElementId); void removeOpsAsset(int assetId); @@ -65,6 +66,7 @@ private: private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; QHash m_opsData; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.cpp index 383a38a2d..00e4ae37d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.cpp @@ -120,7 +120,7 @@ bool MainHandler::init(int domainId, int exerciseId) if (m_interfaces.empty()) { - WARNING_LOG() << "Could not load any training area plugin - can not send data to training area"; + WARNING_LOG(m_logger) << "Could not load any training area plugin - can not send data to training area"; return false; } @@ -131,15 +131,15 @@ bool MainHandler::init(int domainId, int exerciseId) m_handlerWebSocket = std::make_shared(this); - DEBUG_LOG() << "Reset WebSocketInterfaceHandler successful."; + DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler successful."; if (!m_handlerWebSocket->init()) { - ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed."; + ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed."; return false; } m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer, QStringLiteral("{\"id\":\"TAB\"}")); - DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler successful."; + DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler successful."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running); @@ -173,19 +173,19 @@ ProjectDataManagement::RadioGroup MainHandler::exerciseRadioGroup() const bool MainHandler::loadPlugin(const LtsPluginManager::PluginInstance &pi) { - INFO_LOG() << "Trying to load plugin '" << pi.fullFileName << "'"; + INFO_LOG(m_logger) << "Trying to load plugin '" << pi.fullFileName << "'"; Plugin::Plugin *tabPlugin = qobject_cast(pi.plugin); if (!tabPlugin) { - WARNING_LOG() << "failed loading a training area plugin - not a TrainingAreaPlugin object!"; + WARNING_LOG(m_logger) << "failed loading a training area plugin - not a TrainingAreaPlugin object!"; return false; } - INFO_LOG() << "... success"; + INFO_LOG(m_logger) << "... success"; std::shared_ptr ifc = tabPlugin->createInterface(this, m_rxHandler, m_txHandler, m_ddsHandler, Settings::settings()); if (!ifc || !ifc->init()) { - WARNING_LOG() << "Could not initialize training area plugin" << pi.pluginName << pi.fileName; + WARNING_LOG(m_logger) << "Could not initialize training area plugin" << pi.pluginName << pi.fileName; return false; } @@ -241,7 +241,7 @@ TetraIcd::ExerciseEquipmentAssignmentComplete MainHandler::exerciseEquipmentAssi const ProjectDataManagement::RadioGroup rg = radioGroups.value(it.second); if (rg.id() == 0) { - WARNING_LOG() << "Got a radio group id " << it.second << " for exercise " << it.first + WARNING_LOG(m_logger) << "Got a radio group id " << it.second << " for exercise " << it.first << " but could not find valid data for it - ignoring!"; continue; } @@ -316,7 +316,7 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState) m_ifcConnectionState.insert(name, connectionState); } - DEBUG_LOG() << "Publishing connection states: " << m_ifcConnectionState.size(); + DEBUG_LOG(m_logger) << "Publishing connection states: " << m_ifcConnectionState.size(); TrainingAreaBase::Connections connections; connections.id(1); @@ -329,7 +329,7 @@ void MainHandler::onConnectionState(const QString &name, bool connectionState) void MainHandler::onDirectMessage(const QByteArray &jsonMessage) { - DEBUG_LOG() << "Got direct message " << jsonMessage; + DEBUG_LOG(m_logger) << "Got direct message " << jsonMessage; WebSocketInterface::Messages::BiteDataMessage::BiteData biteData; QJsonObject obj = QJsonDocument::fromJson(jsonMessage).object(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.h index 728c9fd6e..588880b14 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/main_handler.h @@ -83,11 +83,13 @@ private Q_SLOTS: void onPositionChanged(int equipNo, const ParticipantManagement::ParticipantPosition &pos); private: + NGL::INGLLogger &m_logger; bool loadPlugin(const LtsPluginManager::PluginInstance &pi); QString getErrorString(const ParticipantManagement::BiteError &error) const; QString getCanDeviceName(int id) const; QString getSubDeviceName(int id) const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_dbHandler; std::shared_ptr m_rxHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.cpp index 789f4faf6..d0474d4ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.cpp @@ -9,10 +9,9 @@ namespace TrainingAreaBase { -PdmHandler::PdmHandler(MainHandler *mainHandler) - : m_initialized(false) - , m_mainHandler(mainHandler) -{} +PdmHandler::PdmHandler(MainHandler *mainHandler) : m_initialized(false) + , m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool PdmHandler::init() { @@ -56,7 +55,7 @@ bool PdmHandler::initializePdm() !m_dtcPdm->waitForHistoricalDataBuildingChargeEffect(20000) || !m_dtcPdm->waitForHistoricalDataVulnerabilityKind(20000)) { - ERROR_LOG() << "Can not read charge/gear types from PDM"; + ERROR_LOG(m_logger) << "Can not read charge/gear types from PDM"; return false; } m_chargeTypes = m_dtcPdm->chargeTypes(); @@ -71,7 +70,7 @@ bool PdmHandler::initializePdm() const int realTypeId = (k.taVulnerabilityKind() & 0x00FF0000) >> 16; const int fallbackTypeId = (k.taVulnerabilityKind() & 0xFF000000) >> 24; m_vulnerabilityKinds[realTasKindId] = k; - TRACE_LOG() << "realTasKindId: " << realTasKindId << ", realTypeId: " << realTypeId << ", fallbackTypeId: " << fallbackTypeId; + TRACE_LOG(m_logger) << "realTasKindId: " << realTasKindId << ", realTypeId: " << realTypeId << ", fallbackTypeId: " << fallbackTypeId; if (fallbackTypeId) m_vulnerabilityKindFallback[realTypeId] = fallbackTypeId; }; @@ -93,7 +92,7 @@ ProjectDataManagement::ChargeType PdmHandler::chargeTypeFromId(int chargeTypeId) auto it = m_chargeTypes.constFind(ctId); if (it == m_chargeTypes.cend()) { - WARNING_LOG() << "Could not find charge type with id " << chargeTypeId; + WARNING_LOG(m_logger) << "Could not find charge type with id " << chargeTypeId; return ProjectDataManagement::ChargeType(); } return it.value(); @@ -154,23 +153,23 @@ int PdmHandler::vulnerabilityKindId(int tasVulnerabilityKindId, int equipmentNum const int index = (tasVulnerabilityKindId & 0x0000FFFF); int fallBackTypeId = m_vulnerabilityKindFallback.value(typeId); - TRACE_LOG() << "Looking for fallback for typeId " << typeId << ": " << fallBackTypeId; + TRACE_LOG(m_logger) << "Looking for fallback for typeId " << typeId << ": " << fallBackTypeId; if (!fallBackTypeId) { fallBackTypeId = m_vulnerabilityKindFallback.value(0); - TRACE_LOG() << "None found - using default: " << fallBackTypeId; + TRACE_LOG(m_logger) << "None found - using default: " << fallBackTypeId; } tasVulnerabilityKindId = (fallBackTypeId << 16) | index; - TRACE_LOG() << "Searching for " << tasVulnerabilityKindId; + TRACE_LOG(m_logger) << "Searching for " << tasVulnerabilityKindId; it = m_vulnerabilityKinds.constFind(tasVulnerabilityKindId); if (it == m_vulnerabilityKinds.constEnd()) { - WARNING_LOG() << "Could not find vulnerability type with id " << typeId + WARNING_LOG(m_logger) << "Could not find vulnerability type with id " << typeId << " and index " << index << " for equipment " << equipmentNumber; return tasVulnerabilityKindId; } - DEBUG_LOG() << "vulnerability type with id " << typeId + DEBUG_LOG(m_logger) << "vulnerability type with id " << typeId << " and index " << index << " is using fallback typeId " << fallBackTypeId; } return it.value().taVulnerabilityKind(); @@ -229,7 +228,7 @@ int PdmHandler::chargeTypeIdFromGearAndChargeTasCode(int gearTasCode, int charge if (m_chargeTypes.contains(chargeTasCode)) return chargeTasCode; - WARNING_LOG() << "Got unmapped training area charge type id " + WARNING_LOG(m_logger) << "Got unmapped training area charge type id " << chargeTasCode << " for gear type " << gearTasCode; return (s_unknownMarker | chargeTasCode); @@ -251,7 +250,7 @@ int PdmHandler::gearTypeIdFromTasGearTasCode(int gearTasCode) return gearType.id(); } - WARNING_LOG() << "Got unmapped training area gear type id " + WARNING_LOG(m_logger) << "Got unmapped training area gear type id " << gearTasCode; return (s_unknownMarker | gearTasCode); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.h index 2d34266e7..52f9928c8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/pdm_handler.h @@ -46,6 +46,7 @@ public: public: bool initializePdm(); private: + NGL::INGLLogger &m_logger; bool m_initialized; std::shared_ptr m_dtcPdm; QMap m_chargeTypes; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.cpp index 1a5805e87..a3954bd6c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.cpp @@ -8,10 +8,9 @@ using namespace TrainingAreaBase; -PositionHandler::PositionHandler(MainHandler *mainHandler) - : QObject() - , m_mainHandler(mainHandler) -{} +PositionHandler::PositionHandler(MainHandler *mainHandler) : QObject() + , m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool PositionHandler::init() { @@ -31,18 +30,18 @@ bool PositionHandler::initCoordinateConversion() const const auto ex = m_mainHandler->exmHandler()->exercise(m_mainHandler->exerciseId()); if (ex.id() <= 0) { - ERROR_LOG() << "Can not retrieve exercise information for id " << m_mainHandler->exerciseId(); + ERROR_LOG(m_logger) << "Can not retrieve exercise information for id " << m_mainHandler->exerciseId(); return false; } if (!m_dtcAsm->waitForHistoricalDataTrainingArea(ddsTimeout)) { - ERROR_LOG() << "Error initializing AssetManagement DTC"; + ERROR_LOG(m_logger) << "Error initializing AssetManagement DTC"; return false; } const auto ta = m_dtcAsm->trainingArea(ex.trainingAreaId()); if (ta.id() <= 0) { - ERROR_LOG() << "Can not retrieve training are information for id " << ex.trainingAreaId(); + ERROR_LOG(m_logger) << "Can not retrieve training are information for id " << ex.trainingAreaId(); return false; } @@ -103,7 +102,7 @@ Core::GeoPosition PositionHandler::relativeToGeographic(const TetraIcd::Relative ret.lon(pos2d.lon()); ret.lat(pos2d.lat()); ret.z(p.offsetZ); - DEBUG_LOG() << "x/y -> lon/lat: " << p.offsetX << "," << p.offsetY + DEBUG_LOG(m_logger) << "x/y -> lon/lat: " << p.offsetX << "," << p.offsetY << " -> " << ret.lon() * LtsCoordTrans::rad2deg() << "," << ret.lat() * LtsCoordTrans::rad2deg(); return ret; } @@ -132,7 +131,7 @@ TetraIcd::RelativePosition PositionHandler::geographicToRelative(const Core::Geo { const QPointF rel(geographicToRelativePointF(p)); const TetraIcd::RelativePosition ret(qRound(rel.x()), qRound(rel.y()), p.z()); - DEBUG_LOG() << "lon/lat -> x/y: " << p.lon() * LtsCoordTrans::rad2deg() << "," << p.lat() * LtsCoordTrans::rad2deg() + DEBUG_LOG(m_logger) << "lon/lat -> x/y: " << p.lon() * LtsCoordTrans::rad2deg() << "," << p.lat() * LtsCoordTrans::rad2deg() << " -> " << ret.offsetX << "," << ret.offsetY; return ret; } @@ -159,7 +158,7 @@ double PositionHandler::speed (const TetraIcd::RelativePosition &relPos, const i QLineF line(QPointF(lastRelPosition.offsetX, lastRelPosition.offsetY), QPointF(relPos.offsetX, relPos.offsetY)); - DEBUG_LOG() << "POS alt=" << lastRelPosition.offsetX << "/" << lastRelPosition.offsetY + DEBUG_LOG(m_logger) << "POS alt=" << lastRelPosition.offsetX << "/" << lastRelPosition.offsetY << " POS neu=" << relPos.offsetX << "/" << relPos.offsetY << " distance= " << line.length() << " timeStamp=" << timeStamp diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.h index c0a4d1223..6453afe30 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/position_handler.h @@ -65,9 +65,11 @@ public: bool isInTrainingArea(const TetraIcd::RelativePosition &relPos) const; private: + NGL::INGLLogger &m_logger; bool initCoordinateConversion() const; private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; mutable std::shared_ptr m_dtcAsm; mutable LtsCoordTrans::UtmCoordinate m_utm2Geographic; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.cpp index 8313fe53c..616ef84bd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.cpp @@ -27,7 +27,7 @@ bool PpmHandler::init() if (!m_ppmDtc->enableEquipmentExerciseMapping() || !m_ppmDtc->enableParticipantPosition()) { - ERROR_LOG() << "Can not read equipment/exercise mappings from PPM"; + ERROR_LOG(m_logger) << "Can not read equipment/exercise mappings from PPM"; return false; } return true; @@ -57,7 +57,7 @@ void PpmHandler::onParticipantPositionChanged(const ParticipantManagement::Parti void PpmHandler::onEquipmentExerciseMappingChanged(const ParticipantManagement::EquipmentExerciseMapping &data, DataModification modType) { - DEBUG_LOG() << "EquipmentExerciseMappingChanged: " << data << ", " << modType; + DEBUG_LOG(m_logger) << "EquipmentExerciseMappingChanged: " << data << ", " << modType; switch (modType) { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.h index 5121df44c..9818f70e4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/ppm_handler.h @@ -31,6 +31,7 @@ private Q_SLOTS: void onEquipmentExerciseMappingChanged(const ParticipantManagement::EquipmentExerciseMapping &data, DataModification modType); void sendEquipmentExerciseAssignment(); private: + NGL::INGLLogger &m_logger; std::unordered_map> m_exerciseEquipmentAssignments; std::shared_ptr m_ppmDtc; MainHandler *m_mainHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.cpp index 44adce299..d7d8b4ecd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.cpp @@ -17,10 +17,9 @@ namespace TrainingAreaBase -AesStateHandler::AesStateHandler(MainHandler *mainHandler) - : m_dbInterface(mainHandler->dbHandler()->db()) - , m_exerciseId(mainHandler->exerciseId()) -{} +AesStateHandler::AesStateHandler(MainHandler *mainHandler) : m_dbInterface(mainHandler->dbHandler()->db()) + , m_exerciseId(mainHandler->exerciseId()), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} template<> @@ -30,7 +29,7 @@ void RecvFromDdsAes::txData(const TrainingAreaBase::TetraIcd::DusMineReactivatio m_sentAesTelegrams.push_back(new TrainingAreaBase::TetraIcd::DusMineReactivation(tele)); m_sentAesTelegramsAesIds.push_back(-1); m_checkOutdatedTelegramsTimer->start(); - DEBUG_LOG() << "Appending " << tele.type() << " to m_sentAesTelegrams"; + DEBUG_LOG(m_logger) << "Appending " << tele.type() << " to m_sentAesTelegrams"; } bool AesStateHandler::init() @@ -41,14 +40,14 @@ bool AesStateHandler::init() m_tetraId2ddsId[item.aesTetraId] = item.aesDdsId; m_ddsId2TetraId[item.aesDdsId] = item.aesTetraId; - DEBUG_LOG() << "AES internal DDS id: " << item.aesDdsId << " - tetra id: " << item.aesTetraId; + DEBUG_LOG(m_logger) << "AES internal DDS id: " << item.aesDdsId << " - tetra id: " << item.aesTetraId; if (item.isAvailableInTetra) m_aesInTetraAvailable += item.aesTetraId; }; if (!m_dbInterface->selectByExerciseId(cb, m_exerciseId)) { - ERROR_LOG() << "Error retrieving data from database!"; + ERROR_LOG(m_logger) << "Error retrieving data from database!"; return false; } @@ -72,7 +71,7 @@ int AesStateHandler::createAesTetraId(int aesDdsId, bool &alreadyExists) aes2Ta.exerciseId = m_exerciseId; if (!m_dbInterface->insert(aes2Ta)) { - WARNING_LOG() << "Unable to create a valid area effect simulation id for tetra!"; + WARNING_LOG(m_logger) << "Unable to create a valid area effect simulation id for tetra!"; return -1; } @@ -94,7 +93,7 @@ bool AesStateHandler::update(int aesDdsId, int aesTetraId, bool bSentToTetra) aes2Ta.exerciseId = m_exerciseId; if (!m_dbInterface->update(aes2Ta)) { - WARNING_LOG() << "Unable to update area effect simulation id for tetra in database!"; + WARNING_LOG(m_logger) << "Unable to update area effect simulation id for tetra in database!"; return false; } @@ -203,7 +202,7 @@ bool RecvFromDdsAes::init() return false; } - DEBUG_LOG() << "RecvFromDdsAes::init() successful"; + DEBUG_LOG(m_logger) << "RecvFromDdsAes::init() successful"; return true; } @@ -360,7 +359,7 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request) if (!bAlreadyExists) { - WARNING_LOG() << "Trying to send a SMArt single fire to training area but it was not created until now... !?"; + WARNING_LOG(m_logger) << "Trying to send a SMArt single fire to training area but it was not created until now... !?"; bool bOnlyNameChanged; dataChanged(data, bOnlyNameChanged); } @@ -376,7 +375,7 @@ bool RecvFromDdsAes::sendSingleFireSMArt(const SendCesHitRequest &request) template void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modType, TetraIcd::AreaEffectSimulationType aesType) { - DEBUG_LOG() << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id() + DEBUG_LOG(m_logger) << "RecvFromDdsAes::handleEffectSimulation(id=" << data.id() << ", modType: " << static_cast(modType) << ", type=" << static_cast(aesType) << ", name: " << data.name() @@ -390,7 +389,7 @@ void RecvFromDdsAes::handleEffectSimulation(const T &data, DataModification modT { if (m_mainHandler->pdmHandler()->isSmartChargeType(data.chargeStruct())) { - DEBUG_LOG() << "Do not send SMART Single/AreaFire to Tetra as broadcast, hits are send directly."; + DEBUG_LOG(m_logger) << "Do not send SMART Single/AreaFire to Tetra as broadcast, hits are send directly."; return; } } @@ -577,7 +576,7 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg const auto &mineArea = it->second; if (mineArea.isDus() || mineArea.isConcrete()) { - INFO_LOG() << "Not publishing mineArea single state for " << data.aesItemId() << " - is a DUS mineArea"; + INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - is a DUS mineArea"; return; } @@ -588,7 +587,7 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg case AreaEffectSimulation::AesEffectState::EsRemoved: case AreaEffectSimulation::AesEffectState::EsUnknown: { - INFO_LOG() << "Not publishing mineArea single state for " << data.aesItemId() << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId()); + INFO_LOG(m_logger) << "Not publishing mineArea single state for " << data.aesItemId() << " - with state " << AreaEffectSimulation::toString(mineArea.effectStateId()); return; } default: @@ -597,7 +596,7 @@ void RecvFromDdsAes::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg } else { - INFO_LOG() << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId(); + INFO_LOG(m_logger) << "Storing mineArea single state, as we dont have the corresponding mineArea yet aesId" << data.aesItemId(); m_temporarySingleMineState[data.aesItemId()] = data; return; } @@ -647,7 +646,7 @@ void RecvFromDdsAes::onDusMineStateChanged(const AreaEffectSimulation::DusMineSt if (!m_minesToSend.isEmpty()) m_sendDusMineReactivtionTimer->start(); else - INFO_LOG() << "Nothing changed in DusMineState of MineArea: " << data.id(); + INFO_LOG(m_logger) << "Nothing changed in DusMineState of MineArea: " << data.id(); } void RecvFromDdsAes::onSendDusMineReactivationTimeout() @@ -660,7 +659,7 @@ void RecvFromDdsAes::onSendDusMineReactivationTimeout() out.dusSerialNumbers.push_back(mineId); } m_minesToSend.clear(); - INFO_LOG() << "Reactivating " << out.dusSerialNumbers.size() << " mines"; + INFO_LOG(m_logger) << "Reactivating " << out.dusSerialNumbers.size() << " mines"; txData(out); } @@ -748,7 +747,7 @@ void RecvFromDdsAes::onEffectsChanged(const AreaEffectSimulation::Effects &data, const int aesTetraId = m_aesStateHandler->createAesTetraId(aesItemId, bAlreadyExists); - DEBUG_LOG() << "RecvFromDdsAes::onEffectsChanged(Effects, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::onEffectsChanged(Effects, " << aesTetraId << ")"; TetraIcd::CreateAreaExplosion cAes; @@ -801,7 +800,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::AirS sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(AirSupportImpact, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(AirSupportImpact, " << aesTetraId << ")"; TetraIcd::CreateSingleExplosion cAes; @@ -829,7 +828,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::BCCo sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::CContamination, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(BCContamination, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(BCContamination, " << aesTetraId << ")"; TetraIcd::CreateCContamination cAes; cAes.expansionFactor = pdm()->dtc()->expansionFactor(aes.chargeStruct().chargeTypeId(), @@ -876,7 +875,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, " << aesTetraId << ")"; TetraIcd::CreateAreaExplosion cAes; @@ -904,7 +903,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl const bool bIsLaserGuidable = m_mainHandler->pdmHandler()->isLaserGuidable(aes.chargeStruct()); - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation " << ", aes " << aes << ", bIsLaserGuidable " << bIsLaserGuidable; @@ -920,7 +919,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionArea, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionArea, " << aesTetraId << ")"; TetraIcd::CreateAreaExplosion cAes; @@ -969,7 +968,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Expl sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::ExplosionSingle, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionSingle, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(ExplosionSingle, " << aesTetraId << ")"; TetraIcd::CreateSingleExplosion cAes; @@ -995,7 +994,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::MineArea, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(MineArea, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(MineArea, " << aesTetraId << ")"; TetraIcd::CreateMineArea cAes; @@ -1025,20 +1024,20 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Mine const QPointF relStart = m_posHandler->geographicToRelativePointF(s.positionStart()); const QPointF relEnd = m_posHandler->geographicToRelativePointF(s.positionEnd()); const QLineF line({relStart.x(), relStart.y()}, {relEnd.x(), relEnd.y()}); - DEBUG_LOG() << "relStart: x: " << relStart.x() << ", y: " << relStart.y(); - DEBUG_LOG() << "relEnd: x: " << relEnd.x() << ", y: " << relEnd.y(); + DEBUG_LOG(m_logger) << "relStart: x: " << relStart.x() << ", y: " << relStart.y(); + DEBUG_LOG(m_logger) << "relEnd: x: " << relEnd.x() << ", y: " << relEnd.y(); QTransform trans; trans.rotate(0-line.angle()); const QPointF ofs = trans.map(QPointF(aes.width() / 2, 0)); - DEBUG_LOG() << "ofs: x: " << ofs.x() << ", y: " << ofs.y(); + DEBUG_LOG(m_logger) << "ofs: x: " << ofs.x() << ", y: " << ofs.y(); segment.relStart.offsetX = qRound(relStart.x() + ofs.y()); segment.relStart.offsetY = qRound(relStart.y() - ofs.x()); segment.relEnd.offsetX = qRound(relEnd.x() + ofs.y()); segment.relEnd.offsetY = qRound(relEnd.y() - ofs.x()); - DEBUG_LOG() << "start offset: x: " << segment.relStart.offsetX << ", y: " << segment.relStart.offsetY; - DEBUG_LOG() << "end offset: x: " << segment.relEnd.offsetX << ", y: " << segment.relEnd.offsetY; + DEBUG_LOG(m_logger) << "start offset: x: " << segment.relStart.offsetX << ", y: " << segment.relStart.offsetY; + DEBUG_LOG(m_logger) << "end offset: x: " << segment.relEnd.offsetX << ", y: " << segment.relEnd.offsetY; } cAes.segments.push_back(segment); } @@ -1056,7 +1055,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::NCon sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::NContamination, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(NContamination, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(NContamination, " << aesTetraId << ")"; TetraIcd::CreateNContamination cAes; @@ -1080,7 +1079,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Func sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::FunctionalArea, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(FunctionalArea, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(FunctionalArea, " << aesTetraId << ")"; TetraIcd::CreateFunctionalArea fAes; @@ -1106,7 +1105,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::Tech return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(TechnicalArea, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(TechnicalArea, " << aesTetraId << ")"; TetraIcd::TechnicalArea fAes; @@ -1128,7 +1127,7 @@ void RecvFromDdsAes::sendCreateEffectSimulation(const AreaEffectSimulation::DusS sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationType::DusSingleMineSimulator, aes.id()); return; } - DEBUG_LOG() << "RecvFromDdsAes::sendCreateEffectSimulation(DusSingleMine, " + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendCreateEffectSimulation(DusSingleMine, " << aesTetraId << ")"; TetraIcd::CreateDusSingleMine dAes; @@ -1157,10 +1156,10 @@ void RecvFromDdsAes::sendModifyEffectSimulationName(TetraIcd::AreaEffectSimulati if (aesTetraId == 0) { - WARNING_LOG() << "Trying to modify an effect simulation name but have no aes identification: " << name; + WARNING_LOG(m_logger) << "Trying to modify an effect simulation name but have no aes identification: " << name; return; } - DEBUG_LOG() << "RecvFromDdsAes::sendModifyEffectSimulationName(" << static_cast(aesType) + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendModifyEffectSimulationName(" << static_cast(aesType) << ", " << aesTetraId << ", " << name << ")"; TetraIcd::ModifyAreaEffectSimulationName mAes; @@ -1184,16 +1183,16 @@ void RecvFromDdsAes::sendRemoveEffectSimulation(TetraIcd::AreaEffectSimulationTy const int aesTetraId = m_aesStateHandler->getAesTetraId(aesDdsId); if (aesTetraId == 0) { - DEBUG_LOG() << "Could not find a valid tetra id for aes dds id " << aesDdsId; + DEBUG_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId; return; } if (!m_aesStateHandler->update(aesDdsId, aesTetraId, false)) { - WARNING_LOG() << "Could not update Aes state handler (" << aesDdsId + WARNING_LOG(m_logger) << "Could not update Aes state handler (" << aesDdsId << ", " << aesTetraId << ")"; } - DEBUG_LOG() << "RecvFromDdsAes::sendRemoveEffectSimulation(id=" << aesDdsId + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendRemoveEffectSimulation(id=" << aesDdsId << ", type=" << static_cast(aesType) << ", tetraId=" << aesTetraId << ")"; @@ -1222,15 +1221,15 @@ void RecvFromDdsAes::sendPauseEffectSimulation(int aesDdsId) const int aesTetraId = m_aesStateHandler->getAesTetraId(aesDdsId); if (aesTetraId == 0) { - DEBUG_LOG() << "Could not find a valid tetra id for aes dds id " << aesDdsId ; + DEBUG_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ; return; } if (!m_aesStateHandler->update(aesDdsId, aesTetraId, true)) { - WARNING_LOG() << "Could not update Aes state handler (" << aesDdsId + WARNING_LOG(m_logger) << "Could not update Aes state handler (" << aesDdsId << ", " << aesTetraId << ")"; } - DEBUG_LOG() << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId << ", tetraId=" << aesTetraId << ")"; TetraIcd::PauseEffectSimulation dAes; @@ -1254,15 +1253,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id()); if (aesTetraId == 0) { - DEBUG_LOG() << "Could not find a valid tetra id for aes dds id " << aesDdsId ; + DEBUG_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ; return; } if (!m_aesStateHandler->update(aesDdsId, aesTetraId, true)) { - WARNING_LOG() << "Could not update Aes state handler (" << aesDdsId + WARNING_LOG(m_logger) << "Could not update Aes state handler (" << aesDdsId << ", " << aesTetraId << ")"; } - DEBUG_LOG() << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId << ", tetraId=" << aesTetraId << ")"; TetraIcd::ResumeEffectSimulation dAes; @@ -1294,15 +1293,15 @@ void RecvFromDdsAes::sendResumeEffectSimulation(const AreaEffectSimulation::Expl const int aesTetraId = m_aesStateHandler->getAesTetraId(aes.id()); if (aesTetraId == 0) { - WARNING_LOG() << "Could not find a valid tetra id for aes dds id " << aesDdsId ; + WARNING_LOG(m_logger) << "Could not find a valid tetra id for aes dds id " << aesDdsId ; return; } if (!m_aesStateHandler->update(aesDdsId, aesTetraId, true)) { - WARNING_LOG() << "Could not update Aes state handler (" << aesDdsId + WARNING_LOG(m_logger) << "Could not update Aes state handler (" << aesDdsId << ", " << aesTetraId << ")"; } - DEBUG_LOG() << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId + DEBUG_LOG(m_logger) << "RecvFromDdsAes::sendPauseEffectSimulation(id=" << aesDdsId << ", tetraId=" << aesTetraId << ")"; TetraIcd::ResumeEffectSimulation dAes; @@ -1340,7 +1339,7 @@ void RecvFromDdsAes::onCheckOutdatedTelegrams() } if (!deactivatedAesIds.contains(aesId)) continue; - INFO_LOG() << "Removing tele " << tele->type() << " from aes tele stack"; + INFO_LOG(m_logger) << "Removing tele " << tele->type() << " from aes tele stack"; delete tele; m_sentAesTelegrams.removeAt(i); m_sentAesTelegramsAesIds.removeAt(i); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.h index c7e8ec6fd..af0c45305 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_aes.h @@ -166,7 +166,7 @@ private: if (it == cont.end()) { cont.emplace(std::make_pair(data.id(), std::move(dataTmp))); - DEBUG_LOG() << "new AES Item: " << data; + DEBUG_LOG(m_logger) << "new AES Item: " << data; return true; } @@ -178,7 +178,7 @@ private: if (it->second == dataTmp) { - DEBUG_LOG() << "nothing changed for AES Item: " << data; + DEBUG_LOG(m_logger) << "nothing changed for AES Item: " << data; return false; } @@ -190,7 +190,7 @@ private: std::swap(it->second, dataTmp); - DEBUG_LOG() << "changed AES Item: " << data; + DEBUG_LOG(m_logger) << "changed AES Item: " << data; return true; } bool dataChanged(const AreaEffectSimulation::AirSupportImpact ¤t, bool &onlyNameChanged) @@ -333,7 +333,7 @@ private: m_sentAesTelegrams.push_back(new T(tele)); m_sentAesTelegramsAesIds.push_back(tele.aesDdsId); m_checkOutdatedTelegramsTimer->start(); - DEBUG_LOG() << "Appending " << tele.type()<< " to m_sentAesTelegrams"; + DEBUG_LOG(m_logger) << "Appending " << tele.type()<< " to m_sentAesTelegrams"; } void onCheckOutdatedTelegrams(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.cpp index 8c848df67..0fe1123b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.cpp @@ -174,7 +174,7 @@ void RecvFromDdsFts::onSendEquipmentMessageRequest(const rti::core::SampleIdenti else { m_ftsTab->sendEquipmentMessageReply(cookie, fillFro(0, false)); - ERROR_LOG() << "Got SendEquipmentMessageRequest but neither message nor messageId is set!"; + ERROR_LOG(m_logger) << "Got SendEquipmentMessageRequest but neither message nor messageId is set!"; return; } bool bRet = true; @@ -248,7 +248,7 @@ void RecvFromDdsFts::onSendCesHitInformationRequest(const rti::core::SampleIdent void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, const SendCesHitRequest &request) { - DEBUG_LOG() << "onSendCesHitRequest: " << request.equipmentNumber() << " - " << request.effectTime() + DEBUG_LOG(m_logger) << "onSendCesHitRequest: " << request.equipmentNumber() << " - " << request.effectTime() << " request.chargeTypeId=" << request.chargeTypeId() << " request.eventType()=" << request.eventType() << " request.aesId()=" << request.aesId() @@ -312,7 +312,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie if ((request.eventType() == ProjectDataManagement::EventType::LeaveHazardDistance) || (request.eventType() == ProjectDataManagement::EventType::EnterHazardDistance)) { - INFO_LOG() << "HarzardArea: " << request.effectTime(); + INFO_LOG(m_logger) << "HarzardArea: " << request.effectTime(); data.reserve1 = request.mineId(); data.aesType = TetraIcd::AreaEffectSimulationType::DangerZoneExplosion; } @@ -338,7 +338,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie ) { data.remainEffectTasCodeDirect = calculateRemainEffectTasCode(ct.id(), request.remainEffectPercent()); - DEBUG_LOG() << "PDM::EventType = " << request.eventType() + DEBUG_LOG(m_logger) << "PDM::EventType = " << request.eventType() << " equipmentNumber=" << request.equipmentNumber() << " originatorEquipmentNumber=" << data.originatorEquipmentNumber << " chargeType=" << ct.id() @@ -361,7 +361,7 @@ void RecvFromDdsFts::onSendCesHitRequest(const rti::core::SampleIdentity &cookie AreaEffectSimulation::FunctionalArea fa = m_mainHandler->aesHandler()->dtcAes()->functionalArea(request.aesId()); - DEBUG_LOG() << "fa maintMode=" << fa.maintMode() + DEBUG_LOG(m_logger) << "fa maintMode=" << fa.maintMode() << " maintTime=" <sendUasWaypointReply(cookie, fillFro(request.equipmentNumber(), false)); return; } @@ -772,7 +772,7 @@ uint32_t RecvFromDdsFts::getVulnerabilityVitalityIndexFromVitalityAndVba(uint32_ vitality += 1; if (vitality > 11) { - ERROR_LOG() << "Cant convert Vitality!"; + ERROR_LOG(m_logger) << "Cant convert Vitality!"; return 0; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.h index dee43aba7..16ca89d8e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/recv_from_dds_fts.h @@ -156,6 +156,7 @@ public: void onSendExConfirmationReportRequest(const rti::core::SampleIdentity &cookie, const SendExConfirmationReportRequest &request) override; private: + NGL::INGLLogger &m_logger; static Core::FunctionReplyObject fillFro(int participantId, bool bSuccess); int calculateRemainEffectTasCode(int chargeTypeIdBase, int remainEffectPercent) const; uint32_t getVulnerabilityVitalityIndexFromVitalityAndVba(uint32_t vulnerabilityKind, uint32_t vitality); @@ -164,6 +165,7 @@ private: private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; std::shared_ptr m_ftsTab; std::shared_ptr m_txCallback; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.cpp index 5f75d7b4c..02f2b17a1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.cpp @@ -230,7 +230,7 @@ void SendToDds::rxData(const TetraIcd::StateChangeDirect &inData) if (Settings::laserRangeCode() == inData.chargeTypeId) { - DEBUG_LOG() << "laserRangeCode chargeTypeId=" << inData.chargeTypeId + DEBUG_LOG(m_logger) << "laserRangeCode chargeTypeId=" << inData.chargeTypeId << "vulnerabilityState=" << static_cast(inData.vulnerabilityState); return; } @@ -773,7 +773,7 @@ void SendToDds::rxData(const TetraIcd::SanitaryMaterialStockReport &inData) sanReport.qualification(static_cast(inData.qualification)); publish(sanReport); - DEBUG_LOG() << "SendToDds::rxData(const TetraIcd::SanitaryMaterialStockReport for " << sanReport.equipmentNumber(); + DEBUG_LOG(m_logger) << "SendToDds::rxData(const TetraIcd::SanitaryMaterialStockReport for " << sanReport.equipmentNumber(); if (sanReport.qualification() == TrainingAreaBase::Qualification::NotDefined) { @@ -812,7 +812,7 @@ void SendToDds::rxData(const TetraIcd::Sanitation &inData) sanitation.sanitationResult(static_cast(inData.sanitationResult)); sanitation.sanitationEvaluation(static_cast(inData.sanitationEvaluation)); publish(sanitation); - DEBUG_LOG() << "SendToDds::rxData(const TetraIcd::Sanitation for " << sanitation.equipmentNumber(); + DEBUG_LOG(m_logger) << "SendToDds::rxData(const TetraIcd::Sanitation for " << sanitation.equipmentNumber(); if (sanitation.qualification() == TrainingAreaBase::Qualification::NotDefined) { @@ -1062,7 +1062,7 @@ bool SendToDds::setPosition(T &data, else if (opsPos.opsId == 0) { bool changeReportSource = true; - DEBUG_LOG() << "ops == 0 so check for marked invalid to use last position!"; + DEBUG_LOG(m_logger) << "ops == 0 so check for marked invalid to use last position!"; if (PositionHandler::isPositionMarkedInvalid(relPos)) { @@ -1075,7 +1075,7 @@ bool SendToDds::setPosition(T &data, - DEBUG_LOG() << "ops == 0 got last Position its source is " << tabPos.reportingSource(); + DEBUG_LOG(m_logger) << "ops == 0 got last Position its source is " << tabPos.reportingSource(); if (tabPos.reportingSource() != Core::PositionReportingSource::Wls && tabPos.reportingSource() != Core::PositionReportingSource::Ops @@ -1084,14 +1084,14 @@ bool SendToDds::setPosition(T &data, else if (tabPos.reportingSource() == Core::PositionReportingSource::Ops || tabPos.reportingSource() == Core::PositionReportingSource::OpsTunnel) changeReportSource = false; - DEBUG_LOG() << "ops == 0 changeSource is " << changeReportSource ; + DEBUG_LOG(m_logger) << "ops == 0 changeSource is " << changeReportSource ; } else { if (!m_posHandler->isInTrainingArea(relPos)) { - DEBUG_LOG() << "bret = false"; + DEBUG_LOG(m_logger) << "bret = false"; bRet = false; } tabPos.position(m_posHandler->relativeToGeographic(relPos)); @@ -1101,15 +1101,15 @@ bool SendToDds::setPosition(T &data, TrainingAreaBase::TabPosition lastPosition = m_posHandler->lastPosition(data.equipmentNumber()); { - DEBUG_LOG() << "lastPosition.reportingSource=" << lastPosition.reportingSource(); + DEBUG_LOG(m_logger) << "lastPosition.reportingSource=" << lastPosition.reportingSource(); } if (lastPosition.reportingSource() == Core::PositionReportingSource::Ops && lastPosition.moutObjectId().is_set()) { - DEBUG_LOG() << "Check leave Building equipmentNumber=" << data.equipmentNumber(); - DEBUG_LOG() << "relPos=" << relPos.offsetX << "/" << relPos.offsetY; - DEBUG_LOG() << "posInExtendedBuildingFootprint"; + DEBUG_LOG(m_logger) << "Check leave Building equipmentNumber=" << data.equipmentNumber(); + DEBUG_LOG(m_logger) << "relPos=" << relPos.offsetX << "/" << relPos.offsetY; + DEBUG_LOG(m_logger) << "posInExtendedBuildingFootprint"; const Core::GeoPosition &position = tabPos.position(); int moutObjectId = lastPosition.moutObjectId().get(); const int lastMountPointTypeId = m_posHandler->lastMountPointTypeId(data.equipmentNumber()); @@ -1120,7 +1120,7 @@ bool SendToDds::setPosition(T &data, } else { - DEBUG_LOG() << "lastMountPointTypeId =" << m_posHandler->lastMountPointTypeId(data.equipmentNumber()); + DEBUG_LOG(m_logger) << "lastMountPointTypeId =" << m_posHandler->lastMountPointTypeId(data.equipmentNumber()); if ( m_posHandler->lastMountPointTypeId(data.equipmentNumber()) == InfrastructureManagement::MountingPointType_def::IndoorIPS) { @@ -1129,19 +1129,19 @@ bool SendToDds::setPosition(T &data, bool checkSpeed = !m_posHandler->isTimeToPerformSpeedCheckExceeded(data.equipmentNumber(), timeStamp, Settings::maxSpeedCheckTimeout()); - DEBUG_LOG() << "Check Speed speed=" << speed + DEBUG_LOG(m_logger) << "Check Speed speed=" << speed << " MaxSoldierSpeed=" << Settings::maxSoldierSpeed() << " checkSpeed=" << checkSpeed; if (checkSpeed && speed > Settings::maxSoldierSpeed()) { - DEBUG_LOG() << "Check Speed bRet = false"; + DEBUG_LOG(m_logger) << "Check Speed bRet = false"; bRet = false; moutCheck = false; } } else { - DEBUG_LOG() << "Kein Speed check!"; + DEBUG_LOG(m_logger) << "Kein Speed check!"; } } } @@ -1152,7 +1152,7 @@ bool SendToDds::setPosition(T &data, } else { - INFO_LOG() << "Valid OpsData: " << opsPos.opsId; + INFO_LOG(m_logger) << "Valid OpsData: " << opsPos.opsId; IsmHandler::OpsData opsData; if (ism()) @@ -1160,7 +1160,7 @@ bool SendToDds::setPosition(T &data, opsData = ism()->dataFromOpsCode(opsPos.opsId); - DEBUG_LOG() << "equipmentNumber=" << data.equipmentNumber() + DEBUG_LOG(m_logger) << "equipmentNumber=" << data.equipmentNumber() << " AssetId=" << opsData.assetId << " opsData.structureElementId=" << opsData.structureElementId << " opsData.mseId=" << opsData.mainStructureElementId @@ -1171,17 +1171,17 @@ bool SendToDds::setPosition(T &data, if (opsData.opsCode != opsPos.opsId) { - WARNING_LOG() << "found no position data for ops id " << opsPos.opsId; + WARNING_LOG(m_logger) << "found no position data for ops id " << opsPos.opsId; bRet = false; } else if (opsData.structureElementId == 0) { - WARNING_LOG() << "ops id " << opsPos.opsId << " is not mounted"; + WARNING_LOG(m_logger) << "ops id " << opsPos.opsId << " is not mounted"; bRet = false; } else { - DEBUG_LOG() << "ops id " << opsPos.opsId; + DEBUG_LOG(m_logger) << "ops id " << opsPos.opsId; tabPos.moutObjectId(opsData.mainStructureElementId); tabPos.moutRoomId(opsData.roomId); tabPos.position(opsData.position); @@ -1198,13 +1198,13 @@ bool SendToDds::setPosition(T &data, { if ( moutCheck ) { - DEBUG_LOG() << "POS = ungueltig"; + DEBUG_LOG(m_logger) << "POS = ungueltig"; tabPos.position().lon(nan("")); tabPos.position().lat(nan("")); } else { - DEBUG_LOG() << "POS = ungueltig => alte Pos mit aktueller Zeit verschicken"; + DEBUG_LOG(m_logger) << "POS = ungueltig => alte Pos mit aktueller Zeit verschicken"; TrainingAreaBase::TabPosition lastPosition = m_posHandler->lastPosition(data.equipmentNumber()); tabPos.position().lon(lastPosition.position().lon()); tabPos.position().lat(lastPosition.position().lat()); @@ -1218,12 +1218,12 @@ bool SendToDds::setPosition(T &data, else { - DEBUG_LOG() << "set last Position"; + DEBUG_LOG(m_logger) << "set last Position"; if (tabPos.reportingSource() == Core::PositionReportingSource::Ops) - DEBUG_LOG() << "ReportingSource=OPS"; + DEBUG_LOG(m_logger) << "ReportingSource=OPS"; else if (tabPos.reportingSource() == Core::PositionReportingSource::Gps) - DEBUG_LOG() << "ReportingSource=GPS"; - DEBUG_LOG() << "tabPos.reportingSource=" << tabPos.reportingSource() + DEBUG_LOG(m_logger) << "ReportingSource=GPS"; + DEBUG_LOG(m_logger) << "tabPos.reportingSource=" << tabPos.reportingSource() << " timeStamp=" << timeStamp; m_posHandler->setLastPosition(data.equipmentNumber(), tabPos); m_posHandler->setLastTime(data.equipmentNumber(), timeStamp); @@ -1248,7 +1248,7 @@ bool SendToDds::setPosition2d(T &data, if (!m_posHandler->isInTrainingArea(relPos)) bRet = false; - DEBUG_LOG() << "tabPos.reportingSource=" << tabPos.reportingSource(); + DEBUG_LOG(m_logger) << "tabPos.reportingSource=" << tabPos.reportingSource(); tabPos.position(m_posHandler->relativeToGeographic(relPos)); m_posHandler->setLastPosition(data.equipmentNumber(), tabPos); } @@ -1319,7 +1319,7 @@ void SendToDds::publish(const T &data) } catch (const std::exception &ex) { - WARNING_LOG() << "Could not send telegram: " << ex.what(); + WARNING_LOG(m_logger) << "Could not send telegram: " << ex.what(); } } @@ -1341,13 +1341,13 @@ void SendToDds::onEmergencyCallTimerTimeout(int issi) TrainingAreaBase::EmergencyCall emergCallData; emergCallData.equipmentNumber(issi); if (!m_mainHandler->ddsHandler()->emergencyCall()->remove(emergCallData)) - ERROR_LOG() << Q_FUNC_INFO << " removing of TrainingAreaBase::EmergencyCall failed, issi = " << issi; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " removing of TrainingAreaBase::EmergencyCall failed, issi = " << issi; } } void SendToDds::onPvSanUniqueIdMapping(int uniqueId, int equipNo, qint64 sampleTime) { - DEBUG_LOG() << Q_FUNC_INFO << "start pvSan mapping " << equipNo << " uniqueId " << uniqueId; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << "start pvSan mapping " << equipNo << " uniqueId " << uniqueId; if (m_uniqueId2EquipmentNumber.value(uniqueId) == equipNo) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.h index fcc9f6910..2f6c9a21d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/send_to_dds.h @@ -66,6 +66,7 @@ public: void rxData(const TetraIcd::UAVMissionStatus &inData) override; private: + NGL::INGLLogger &m_logger; template bool setPosition(T &data, const TetraIcd::AbsolutePosition &geoPos, @@ -92,6 +93,7 @@ private: void onPvSanUniqueIdMapping(int uniqueId, int equipNo, qint64 sampleTime); private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; std::shared_ptr m_dtsTab; const std::shared_ptr m_aesStateHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.cpp index 55a153d6b..3c769de01 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.cpp @@ -289,7 +289,7 @@ bool TxMixin::txDataToAll(const T &data) if (tx->txData(data)) bSent = true; else - WARNING_LOG() << "Can not sent broadcast telegram with id " << (int)data.id() << " to handler " << tx->name() + WARNING_LOG(m_logger) << "Can not sent broadcast telegram with id " << (int)data.id() << " to handler " << tx->name() << " but it was requested by this handler ..."; } } @@ -309,7 +309,7 @@ bool TxMixin::txDataToAll(const T &data) break; case HandleState::YesConsume: if (bConsumed || bSent) - WARNING_LOG() << "Handler " << tx->name() << " will consume telegram with id " << (int)data.id() + WARNING_LOG(m_logger) << "Handler " << tx->name() << " will consume telegram with id " << (int)data.id() << " and equipment number " << equipmentNumber << " but it was already consumed/sent!"; if (tx->txData(data)) @@ -323,7 +323,7 @@ bool TxMixin::txDataToAll(const T &data) break; case HandleState::YesShare: if (bConsumed) - WARNING_LOG() << "Handler " << tx->name() << " will share telegram with id " << (int)data.id() + WARNING_LOG(m_logger) << "Handler " << tx->name() << " will share telegram with id " << (int)data.id() << " and equipment number " << equipmentNumber << " but it was already consumed!"; if (tx->txData(data)) @@ -339,7 +339,7 @@ bool TxMixin::txDataToAll(const T &data) } if (!bSent) - WARNING_LOG() << "Could not sent telegram with id " << (int)data.id() << " and equipment number " << equipmentNumber + WARNING_LOG(m_logger) << "Could not sent telegram with id " << (int)data.id() << " and equipment number " << equipmentNumber << " - no handler found!"; return bSent; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.h index 3ab6855f2..2b12ff117 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBase/tx_mixin.h @@ -69,12 +69,14 @@ public: bool txData(const TrainingAreaBase::TetraIcd::ExFiredReport &) override ; bool txData(const TrainingAreaBase::TetraIcd::ExConfirmationReport &) override ; private: + NGL::INGLLogger &m_logger; bool txData(const TetraIcd::UAVPerformMission &data) override; bool txData(const TetraIcd::UAVChangeState &data) override; template bool txDataToAll(const T &data); private: + NGL::INGLLogger &m_logger; QVector> m_txHandler; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.cpp index c4e8c503e..c9652e544 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.cpp @@ -13,12 +13,11 @@ namespace TrainingAreaBaseOC { -TxDdlHandler::TxDdlHandler() - : m_state(DdlState::NotStarted) +TxDdlHandler::TxDdlHandler() : m_state(DdlState::NotStarted) , m_segmentToggle(0) , m_sentCnt(0) - , m_responseTimer(new QTimer(this)) -{ + , m_responseTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_responseTimer->setInterval(1000); m_responseTimer->setSingleShot(true); connect(m_responseTimer, &QTimer::timeout, this, &TxDdlHandler::sendAbortOrRestartTimeout); @@ -46,13 +45,13 @@ void TxDdlHandler::process(const QByteArray &data) { case 1: { - DEBUG_LOG() << "Segment download confirmation received"; + DEBUG_LOG(m_logger) << "Segment download confirmation received"; qint32 toggle = ((data[0] & 0x10) >> 4); if (m_segmentToggle != toggle) { - ERROR_LOG() << "Toggle bit of confirmation not equal to request"; + ERROR_LOG(m_logger) << "Toggle bit of confirmation not equal to request"; sendAbort(130); } @@ -62,14 +61,14 @@ void TxDdlHandler::process(const QByteArray &data) } case 3: { - DEBUG_LOG() << "Initiate download confirmation received"; + DEBUG_LOG(m_logger) << "Initiate download confirmation received"; if (m_dataToSend.isEmpty()) break; if (DdlState::Initiated != m_state) { - ERROR_LOG() << "Initiate download confirmation received but ddl wasn't startet yet."; + ERROR_LOG(m_logger) << "Initiate download confirmation received but ddl wasn't startet yet."; sendAbort(); break; } @@ -78,7 +77,7 @@ void TxDdlHandler::process(const QByteArray &data) } case 4: { - WARNING_LOG() << "Error during domain download"; + WARNING_LOG(m_logger) << "Error during domain download"; m_state = DdlState::NotStarted; if (m_dataToSend.isEmpty()) @@ -90,7 +89,7 @@ void TxDdlHandler::process(const QByteArray &data) } default: - ERROR_LOG() << "unknown scs value received: " << scs; + ERROR_LOG(m_logger) << "unknown scs value received: " << scs; break; } } @@ -115,13 +114,13 @@ void TxDdlHandler::initiateDomainDownload() { if (m_dataToSend.isEmpty()) { - ERROR_LOG() << "::initiateDomainDownload called, but no data to send available"; + ERROR_LOG(m_logger) << "::initiateDomainDownload called, but no data to send available"; return; } if (m_sentCnt >= s_maxResendCnt) { - ERROR_LOG() << "Maximum trys of resending DDL exceeded. "; + ERROR_LOG(m_logger) << "Maximum trys of resending DDL exceeded. "; m_dataToSend.removeFirst(); m_sentCnt = 0; startNextDomainDownload(); @@ -137,7 +136,7 @@ void TxDdlHandler::initiateDomainDownload() data[6] = ((dataSize >> 16) & 0xFF); data[7] = ((dataSize >> 24) & 0xFF); - DEBUG_LOG() << "Initiate DDL Req"; + DEBUG_LOG(m_logger) << "Initiate DDL Req"; m_state = DdlState::Initiated; m_sentCnt++; @@ -149,7 +148,7 @@ void TxDdlHandler::domainDownload() { if (m_dataToSend.isEmpty()) { - ERROR_LOG() << "::domainDownload called, but no data to send available"; + ERROR_LOG(m_logger) << "::domainDownload called, but no data to send available"; return; } @@ -202,7 +201,7 @@ void TxDdlHandler::domainDownload() m_dataToSend.first().offset = newOffset; - DEBUG_LOG() << "Segment DDL Req"; + DEBUG_LOG(m_logger) << "Segment DDL Req"; m_state = DdlState::Downloading; emit send(data); @@ -214,7 +213,7 @@ void TxDdlHandler::sendAbort(quint8 error) QByteArray data(8, '\0'); data[0] = 0x80; data[1] = error; - DEBUG_LOG() << "Abort DDL Req"; + DEBUG_LOG(m_logger) << "Abort DDL Req"; m_state = DdlState::NotStarted; m_dataToSend.first().offset = 0; @@ -235,7 +234,7 @@ void RxDdlHandler::process(const QByteArray &data) case 1: { - DEBUG_LOG() << "initiate download received"; + DEBUG_LOG(m_logger) << "initiate download received"; if (m_isMultiplexed) m_multiplexer = (((data[1] & 0xFF) << 16) | ((data[2] & 0xFF) << 8) | (data[3] & 0xFF)); @@ -251,10 +250,10 @@ void RxDdlHandler::process(const QByteArray &data) case 0: { - DEBUG_LOG() << "download segment received"; + DEBUG_LOG(m_logger) << "download segment received"; if (m_state == DdlState::NotStarted) { - WARNING_LOG() << "download segment and data m_state == DdlState::NotStarted, something went wrong!"; + WARNING_LOG(m_logger) << "download segment and data m_state == DdlState::NotStarted, something went wrong!"; sendDPConfirmation(4, 0); return; } @@ -284,14 +283,14 @@ void RxDdlHandler::process(const QByteArray &data) case 4: { - DEBUG_LOG() << "abort download received"; + DEBUG_LOG(m_logger) << "abort download received"; m_messageData.clear(); m_state = DdlState::NotStarted; break; } default: { - WARNING_LOG() << "Unknown ccs ID: " << ccs; + WARNING_LOG(m_logger) << "Unknown ccs ID: " << ccs; break; } } @@ -315,7 +314,7 @@ void RxDdlHandler::sendDPConfirmation(const quint32 ccs, const quint32 toggle, c else if (1 == toggle) data[0] = 0x30; else - WARNING_LOG() << "Unknown toggle state: " << toggle; + WARNING_LOG(m_logger) << "Unknown toggle state: " << toggle; m_state = DdlState::Downloading; } else if (4 == ccs) @@ -365,7 +364,7 @@ bool CanagHandler::init() if (!m_handlerAesData->init()) { - ERROR_LOG() << "Could not initialise HandlerAesData."; + ERROR_LOG(m_logger) << "Could not initialise HandlerAesData."; return false; } @@ -459,19 +458,19 @@ bool CanagHandler::txData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBas { case TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::OC: { - INFO_LOG() << "adding DDL CanId::CAN_ID_DATENVERKEHR_SRT_KOPPELRECHNER_TX"; + INFO_LOG(m_logger) << "adding DDL CanId::CAN_ID_DATENVERKEHR_SRT_KOPPELRECHNER_TX"; m_txDdlHandler[CanId::OcExconDataTx]->addData(LtsUtils::toQByteArray(data.payload)); break; } case TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type::FireSmokeMarker: { - INFO_LOG() << "adding DDL CanId::CAN_ID_DATENVERKEHR_DMF_KOPPELRECHNER_TX"; + INFO_LOG(m_logger) << "adding DDL CanId::CAN_ID_DATENVERKEHR_DMF_KOPPELRECHNER_TX"; m_txDdlHandler[CanId::FireSmokeMarkerExconDataTx]->addData(LtsUtils::toQByteArray(data.payload)); break; } default: { - ERROR_LOG() << "Tryed to send unhandled TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type " << static_cast(data.payloadType); + ERROR_LOG(m_logger) << "Tryed to send unhandled TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type " << static_cast(data.payloadType); return false; } } @@ -483,22 +482,22 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) { if (message.id() == 0) { - ERROR_LOG() << "Error while receiving data from sfm."; + ERROR_LOG(m_logger) << "Error while receiving data from sfm."; return; } - DEBUG_LOG() << "Received new CAN-Message with ID: " << message.id() << " RTR: " << message.rtr() << " data: " << message.payload().toHex(' '); + DEBUG_LOG(m_logger) << "Received new CAN-Message with ID: " << message.id() << " RTR: " << message.rtr() << " data: " << message.payload().toHex(' '); switch (message.id()) { case CanId::DemandDeviceId: { - INFO_LOG() << "Received CanId::DemandDeviceId"; + INFO_LOG(m_logger) << "Received CanId::DemandDeviceId"; m_deviceMessageTimer->start(); break; } case CanId::Time: { - DEBUG_LOG() << "Received CanId::Time"; + DEBUG_LOG(m_logger) << "Received CanId::Time"; QByteArray data = message.payload(); OcTelegrams::TimeSync outData; @@ -506,7 +505,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) LtsUtils::get4Byte(data, gpsTime); outData.gpsTimeMsec = gpsTime * 1000ULL; outData.timezone = data[4]; - DEBUG_LOG() << "Received " << gpsTime; + DEBUG_LOG(m_logger) << "Received " << gpsTime; sendSyncTime(gpsTime); m_rxHandler->rxData(outData); @@ -514,7 +513,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::EnterLeaveAes: { - INFO_LOG() << "Received CanId::EnterLeaveAes"; + INFO_LOG(m_logger) << "Received CanId::EnterLeaveAes"; QByteArray data = message.payload(); OcTelegrams::EnterLeaveAes outData; @@ -535,13 +534,13 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::ParameterOcRx: { - INFO_LOG() << "Received CanId::ParameterOcRx"; + INFO_LOG(m_logger) << "Received CanId::ParameterOcRx"; send(*m_messages[CanId::ParameterOcTx]); break; } case CanId::TechnicalStateSfm: { - INFO_LOG() << "Received CanId::TechnicalStateSfm"; + INFO_LOG(m_logger) << "Received CanId::TechnicalStateSfm"; QByteArray data = message.payload(); OcTelegrams::TechnicalStateSfm outData; @@ -566,7 +565,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::TechnicalStateOc: { - INFO_LOG() << "Received CanId::TechnicalStateOc"; + INFO_LOG(m_logger) << "Received CanId::TechnicalStateOc"; if (message.rtr()) send(*m_messages[CanId::TechnicalStateOc]); @@ -574,42 +573,42 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::ExconOcDataRx: { - INFO_LOG() << "Received CanId::ExconOcDataRx"; + INFO_LOG(m_logger) << "Received CanId::ExconOcDataRx"; QByteArray data = message.payload(); m_rxDdlHandler[CanId::ExconOcDataTx]->process(data); break; } case CanId::OcExconDataRx: { - INFO_LOG() << "Received CanId::OcExconDataRx"; + INFO_LOG(m_logger) << "Received CanId::OcExconDataRx"; QByteArray data = message.payload(); m_txDdlHandler[CanId::OcExconDataTx]->process(data); break; } case CanId::ExconFireSmokeMarkerDataRx: { - INFO_LOG() << "Received CanId::ExconFireSmokeMarkerDataRx"; + INFO_LOG(m_logger) << "Received CanId::ExconFireSmokeMarkerDataRx"; QByteArray data = message.payload(); m_rxDdlHandler[CanId::ExconFireSmokeMarkerDataTx]->process(data); break; } case CanId::FireSmokeMarkerExconDataRx: { - INFO_LOG() << "Received CanId::FireSmokeMarkerExconDataRx"; + INFO_LOG(m_logger) << "Received CanId::FireSmokeMarkerExconDataRx"; QByteArray data = message.payload(); m_txDdlHandler[CanId::FireSmokeMarkerExconDataTx]->process(data); break; } case CanId::AwesDataRx: { - INFO_LOG() << "Received CanId::AwesDataRx"; + INFO_LOG(m_logger) << "Received CanId::AwesDataRx"; QByteArray data = message.payload(); m_rxDdlHandler[CanId::AwesDataTx]->process(data); break; } case CanId::Position: { - INFO_LOG() << "Received CanId::Position"; + INFO_LOG(m_logger) << "Received CanId::Position"; QByteArray data = message.payload(); OcTelegrams::OwnPosition outData; @@ -626,7 +625,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::DisplayMessage: { - INFO_LOG() << "Received CanId::DisplayMessage"; + INFO_LOG(m_logger) << "Received CanId::DisplayMessage"; handleDisplayMessage(message); @@ -634,7 +633,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::SpecificsExercise: { - INFO_LOG() << "Received CanId::SpecificsExercise"; + INFO_LOG(m_logger) << "Received CanId::SpecificsExercise"; QByteArray data = message.payload(); OcTelegrams::SpecificsExercise outData; @@ -662,7 +661,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::SpecificsOc: { - INFO_LOG() << "Received CanId::SpecificsOc"; + INFO_LOG(m_logger) << "Received CanId::SpecificsOc"; if (message.rtr()) send(*m_messages[CanId::SpecificsOc]); @@ -670,7 +669,7 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::SpecificsEquipment: { - INFO_LOG() << "Received CanId::SpecificsEquipment"; + INFO_LOG(m_logger) << "Received CanId::SpecificsEquipment"; QByteArray data = message.payload(); OcTelegrams::SpecificsEquipment outData; @@ -695,13 +694,13 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) } case CanId::ParameterSfmRx: { - INFO_LOG() << "Received CanId::ParameterSfmRx"; + INFO_LOG(m_logger) << "Received CanId::ParameterSfmRx"; break; } case CanId::ConnectionTestSfmReply: { - INFO_LOG() << "Received CanId::TestConnectionSfmReply"; + INFO_LOG(m_logger) << "Received CanId::TestConnectionSfmReply"; if (!m_sfmConnectionEstablished) sendDemandDeviceId(); else @@ -710,21 +709,21 @@ void CanagHandler::handleSfmTelegram(const LtsUtils::SfmMessage &message) break; } default: - DEBUG_LOG() << "message id " << message.id() << " is not handled!"; + DEBUG_LOG(m_logger) << "message id " << message.id() << " is not handled!"; break; } } void CanagHandler::sendDemandDeviceId() { - INFO_LOG() << "Requesting Device ID."; + INFO_LOG(m_logger) << "Requesting Device ID."; send(*m_messages[CanId::DemandDeviceId]); m_deviceMessageTimer->start(); } void CanagHandler::sendDeviceMessage() { - INFO_LOG() << "Sending Device ID."; + INFO_LOG(m_logger) << "Sending Device ID."; send(*m_messages[CanId::DeviceId]); if (!m_technicalStateSfm.sfmConnected) demandInitialSfmData(); @@ -816,12 +815,12 @@ void CanagHandler::sendFreeText() void CanagHandler::sendSyncTime(uint32_t syncTimeSec) { - INFO_LOG() << "sendSyncTime " << syncTimeSec; + INFO_LOG(m_logger) << "sendSyncTime " << syncTimeSec; if (syncTimeSec > QDateTime::currentSecsSinceEpoch() - 3 && syncTimeSec < QDateTime::currentSecsSinceEpoch() + 3) { - DEBUG_LOG() << "PartitionTime is Still valid"; + DEBUG_LOG(m_logger) << "PartitionTime is Still valid"; return; } if (!m_syncSocket->isOpen()) @@ -831,7 +830,7 @@ void CanagHandler::sendSyncTime(uint32_t syncTimeSec) { m_syncSocket->write(QByteArray::number(syncTimeSec)); m_syncSocket->flush(); - DEBUG_LOG() << "Send: " << syncTimeSec << " " << QByteArray::number(syncTimeSec); + DEBUG_LOG(m_logger) << "Send: " << syncTimeSec << " " << QByteArray::number(syncTimeSec); } } @@ -839,13 +838,13 @@ void CanagHandler::send(const LtsUtils::SfmMessage &message) { - DEBUG_LOG() << "send message - " << message.id() << " RTR: " << message.rtr(); + DEBUG_LOG(m_logger) << "send message - " << message.id() << " RTR: " << message.rtr(); if (!message.payload().isEmpty()) - DEBUG_LOG() << " size: " << message.payload().size() << " data: " << message.payload().toHex(' '); + DEBUG_LOG(m_logger) << " size: " << message.payload().size() << " data: " << message.payload().toHex(' '); if (!m_connectionHandler->send(message)) - ERROR_LOG() << "Could not send message!"; + ERROR_LOG(m_logger) << "Could not send message!"; else emit sendMessage(message); } @@ -865,15 +864,15 @@ void CanagHandler::openSocket() m_syncSocket->connectToHost(Settings::hostName(), 13777); if (!m_syncSocket->waitForConnected()) - WARNING_LOG() << "Could not (re)open tcp destination " << m_syncSocket->peerName() << ":" << m_syncSocket->peerPort() << ", error: " << m_syncSocket->errorString(); + WARNING_LOG(m_logger) << "Could not (re)open tcp destination " << m_syncSocket->peerName() << ":" << m_syncSocket->peerPort() << ", error: " << m_syncSocket->errorString(); else { connect(m_syncSocket, &QTcpSocket::disconnected, this, [this] { - DEBUG_LOG() << "Disconnected from Host"; + DEBUG_LOG(m_logger) << "Disconnected from Host"; m_syncSocket->close(); }); - DEBUG_LOG() << "(re)open tcp destination " << m_syncSocket->peerName() << ":" << m_syncSocket->peerPort(); + DEBUG_LOG(m_logger) << "(re)open tcp destination " << m_syncSocket->peerName() << ":" << m_syncSocket->peerPort(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.h index fc63de1ef..7f7e2d29a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/canag_handler.h @@ -53,6 +53,8 @@ private slots: void sendAbortOrRestartTimeout(); private: + +NGL::INGLLogger &m_logger; const qint32 s_maxResendCnt = 5; struct DdlData diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler.h index 693cff9d2..00a2aa5db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler.h @@ -21,6 +21,7 @@ class ConnectionHandler : public ConnectionHandlerTcpTtci public: explicit ConnectionHandler(); +NGL::INGLLogger &m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.cpp index a66353226..24f0a7aca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.cpp @@ -10,10 +10,9 @@ namespace TrainingAreaBaseOC { -ConnectionHandlerSerial::ConnectionHandlerSerial() - : m_spQuerry(new LtsSerialPortQuerry::LtsSerialPortQuerry(this)) - , m_receiveTimeoutTimer(new QTimer(this)) -{ +ConnectionHandlerSerial::ConnectionHandlerSerial() : m_spQuerry(new LtsSerialPortQuerry::LtsSerialPortQuerry(this)) + , m_receiveTimeoutTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_spQuerry, &LtsSerialPortQuerry::LtsSerialPortQuerry::connectionEstablished, this, &ConnectionHandlerSerial::open); m_spQuerry->restartQuerry(); m_receiveTimeoutTimer->setInterval(5000); @@ -34,25 +33,25 @@ bool ConnectionHandlerSerial::send(const LtsUtils::SfmMessage &message) if (!m_serialPort->isOpen()) { - ERROR_LOG() << "Port is not opened!"; + ERROR_LOG(m_logger) << "Port is not opened!"; return false; } QByteArray data = LtsUtils::byteStreamFromSfmMessage(message); - DEBUG_LOG() << "Sending frame: " << data.toHex(' '); + DEBUG_LOG(m_logger) << "Sending frame: " << data.toHex(' '); const qint64 byteswritten = m_serialPort->write(data); m_serialPort->flush(); if (byteswritten == -1) { - ERROR_LOG() << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString(); + ERROR_LOG(m_logger) << "Failed to write data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString(); return false; } else if (byteswritten != data.size()) { - ERROR_LOG() << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString(); + ERROR_LOG(m_logger) << "Failed to write all data to port " << m_serialPort->portName() << " error: " << m_serialPort->errorString(); return false; } @@ -83,7 +82,7 @@ void ConnectionHandlerSerial::read() const QByteArray ba = m_serialPort->readAll(); m_currentDataRead.append(ba); - DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' '); + DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' '); int idxStart = -1; int idxEnd = -1; @@ -94,21 +93,21 @@ void ConnectionHandlerSerial::read() QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1); LtsUtils::SfmMessage sfmMsg; - DEBUG_LOG() << "Frame from sfm as binary " << message.toHex(); + DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex(); try { sfmMsg = LtsUtils::byteStreamToSfmMessage(message); } catch (const LtsUtils::ConversionError &ex) { - ERROR_LOG() << "Error converting QByteArray into LtsUtils::SfmMessage: " << ex.what(); - ERROR_LOG() << "Faulty Data from sfm as binary " << message.toHex(); + ERROR_LOG(m_logger) << "Error converting QByteArray into LtsUtils::SfmMessage: " << ex.what(); + ERROR_LOG(m_logger) << "Faulty Data from sfm as binary " << message.toHex(); m_currentDataRead = m_currentDataRead.mid(idxEnd + 1); continue; } - INFO_LOG() << "Decoded message from sfm Id: " << sfmMsg.id() << " RTR: " << sfmMsg.rtr() << " Data: " << sfmMsg.payload().toHex(); + INFO_LOG(m_logger) << "Decoded message from sfm Id: " << sfmMsg.id() << " RTR: " << sfmMsg.rtr() << " Data: " << sfmMsg.payload().toHex(); m_receiveTimeoutTimer->start(); @@ -118,7 +117,7 @@ void ConnectionHandlerSerial::read() } if (m_serialPort->bytesAvailable() > 0) - DEBUG_LOG() << "Still " << m_serialPort->bytesAvailable() << " available to be read"; + DEBUG_LOG(m_logger) << "Still " << m_serialPort->bytesAvailable() << " available to be read"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.h index 1b3486567..b69f63224 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_serial.h @@ -37,6 +37,7 @@ private slots: void read(); private: + NGL::INGLLogger &m_logger; LtsSerialPortQuerry::LtsSerialPortQuerry *m_spQuerry = nullptr; QSerialPort *m_serialPort = nullptr; QTimer *m_receiveTimeoutTimer = nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.cpp index 9f792baf4..f2ffe2aed 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.cpp @@ -10,9 +10,8 @@ namespace TrainingAreaBaseOC { -ConnectionHandlerTcp::ConnectionHandlerTcp() - : m_timer(new QTimer(this)) -{ +ConnectionHandlerTcp::ConnectionHandlerTcp() : m_timer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_timer->setInterval(5000); connect(m_timer, &QTimer::timeout, this, &ConnectionHandlerTcp::open); } @@ -44,25 +43,25 @@ bool ConnectionHandlerTcp::send(const LtsUtils::SfmMessage &message) if (!m_socket->isOpen()) { - ERROR_LOG() << "Port is not opened!"; + ERROR_LOG(m_logger) << "Port is not opened!"; return false; } QByteArray data = LtsUtils::byteStreamFromSfmMessage(message); - DEBUG_LOG() << "Sending frame: " << data.toHex(' '); + DEBUG_LOG(m_logger) << "Sending frame: " << data.toHex(' '); const qint64 byteswritten = m_socket->write(data); if (byteswritten == -1) { - ERROR_LOG() << "Failed to write data to port " << m_socket->peerPort() << " error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << "Failed to write data to port " << m_socket->peerPort() << " error: " << m_socket->errorString(); m_timer->start(); return false; } else if (byteswritten != data.size()) { - ERROR_LOG() << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << "Failed to write all data to port " << m_socket->peerPort() << " error: " << m_socket->errorString(); return false; } @@ -75,10 +74,10 @@ bool ConnectionHandlerTcp::open() m_socket->connectToHost(Settings::hostName(), Settings::port()); if (!m_socket->waitForConnected()) { - ERROR_LOG() << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString(); return false; } - INFO_LOG() << "(Re)openend tcp destination " << m_socket->peerName() << ":" << Settings::port(); + INFO_LOG(m_logger) << "(Re)openend tcp destination " << m_socket->peerName() << ":" << Settings::port(); return true; } @@ -97,7 +96,7 @@ void ConnectionHandlerTcp::read() const QByteArray ba = m_socket->readAll(); m_currentDataRead.append(ba); - DEBUG_LOG() << "Binary data from sfm: " << ba.toHex(' '); + DEBUG_LOG(m_logger) << "Binary data from sfm: " << ba.toHex(' '); int idxStart = -1; int idxEnd = -1; @@ -107,7 +106,7 @@ void ConnectionHandlerTcp::read() QByteArray message = m_currentDataRead.mid(idxStart, (idxEnd - idxStart) + 1); LtsUtils::SfmMessage sfmMsg; - DEBUG_LOG() << "Frame from sfm as binary " << message.toHex(); + DEBUG_LOG(m_logger) << "Frame from sfm as binary " << message.toHex(); try { @@ -115,11 +114,11 @@ void ConnectionHandlerTcp::read() } catch (const LtsUtils::ConversionError &ex) { - ERROR_LOG() << "Error converting QByteArray into LtsUtils::SfmMessage: " << ex.what(); - ERROR_LOG() << "Faulty Data from sfm as binary " << message.toHex(); + ERROR_LOG(m_logger) << "Error converting QByteArray into LtsUtils::SfmMessage: " << ex.what(); + ERROR_LOG(m_logger) << "Faulty Data from sfm as binary " << message.toHex(); } - INFO_LOG() << "Decoded message from sfm Id: " << sfmMsg.id() << " RTR: " << sfmMsg.rtr() << " Data: " << sfmMsg.payload().toHex(); + INFO_LOG(m_logger) << "Decoded message from sfm Id: " << sfmMsg.id() << " RTR: " << sfmMsg.rtr() << " Data: " << sfmMsg.payload().toHex(); m_currentDataRead = m_currentDataRead.mid(idxEnd + 1); @@ -127,12 +126,12 @@ void ConnectionHandlerTcp::read() } if (m_socket->bytesAvailable() > 0) - DEBUG_LOG() << "Still " << m_socket->bytesAvailable() << " available to be read"; + DEBUG_LOG(m_logger) << "Still " << m_socket->bytesAvailable() << " available to be read"; } void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error) { - DEBUG_LOG() << "Spontaneous error " << error << " doesn't have to be an error ..."; + DEBUG_LOG(m_logger) << "Spontaneous error " << error << " doesn't have to be an error ..."; const QString errStr(QStringLiteral("QTcpSocket::SocketError ") + QString::number(error) + QStringLiteral(" from tcp port ") + QString::number(m_socket->peerPort()) + @@ -144,20 +143,20 @@ void ConnectionHandlerTcp::handleError(QAbstractSocket::SocketError error) case QTcpSocket::SocketError::SocketAccessError: case QTcpSocket::SocketError::SocketResourceError: { - ERROR_LOG() << "Closing port trying to reopen it."; + ERROR_LOG(m_logger) << "Closing port trying to reopen it."; close(); m_timer->start(); Q_FALLTHROUGH(); } case QTcpSocket::SocketError::RemoteHostClosedError: { - ERROR_LOG() << "Host closed trying to reopen."; + ERROR_LOG(m_logger) << "Host closed trying to reopen."; m_timer->start(); break; } default: { - ERROR_LOG() << errStr; + ERROR_LOG(m_logger) << errStr; close(); m_timer->start(); break; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.h index 93534619a..1d42e8658 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp.h @@ -38,6 +38,7 @@ private slots: void handleError(QAbstractSocket::SocketError error); private: + NGL::INGLLogger &m_logger; QTcpSocket *m_socket = nullptr; QTimer *m_timer = nullptr; QByteArray m_currentDataRead; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.cpp index 1113425d9..27fa46c70 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.cpp @@ -13,15 +13,14 @@ using namespace NGL; namespace TrainingAreaBaseOC { -ConnectionHandlerTcpTtci::ConnectionHandlerTcpTtci() - : m_messageDataStart(true) +ConnectionHandlerTcpTtci::ConnectionHandlerTcpTtci() : m_messageDataStart(true) , m_wirkfeldDataStart(true) , m_wirkfeldMultiplex(0) , m_sendingData(false) , m_segmentToggle(0) , m_canDevice(new Device(this)) - , m_canChannel(new Channel(QLatin1Char('@'), true, this)) -{ + , m_canChannel(new Channel(QLatin1Char('@'), true, this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_canChannel, &Channel::dataAvailable, this, &ConnectionHandlerTcpTtci::slotReadCanFrame); connect(m_canChannel, &Channel::disconnectedFromEq, this, &ConnectionHandlerTcpTtci::disconnectedFromEq); } @@ -42,7 +41,7 @@ bool ConnectionHandlerTcpTtci::init() void ConnectionHandlerTcpTtci::initCanSocket() { - ERROR_LOG() << "InitCantSOcket"; + ERROR_LOG(m_logger) << "InitCantSOcket"; m_canChannel->setDevice(m_canDevice); m_canDevice->open(); @@ -53,10 +52,10 @@ bool ConnectionHandlerTcpTtci::findNextSyncByte(int &iCurReadPos) const { if (iCurReadPos == m_buffer.size()) { - DEBUG_LOG() << "No more data available"; + DEBUG_LOG(m_logger) << "No more data available"; return false; } - DEBUG_LOG() << "Searching for next sync byte, start at: " << iCurReadPos; + DEBUG_LOG(m_logger) << "Searching for next sync byte, start at: " << iCurReadPos; NGL::NGLLoggerHelper::hexDumpHelper(m_logger, NGL::LogLevel::Debug, m_buffer); while (iCurReadPos < m_buffer.size()) @@ -70,7 +69,7 @@ bool ConnectionHandlerTcpTtci::findNextSyncByte(int &iCurReadPos) const if (m_buffer.size() < 4 + iCurReadPos) { - DEBUG_LOG() << "Could not find sync byte in stream"; + DEBUG_LOG(m_logger) << "Could not find sync byte in stream"; return false; } return true; @@ -83,11 +82,11 @@ void ConnectionHandlerTcpTtci::slotReadCanFrame(const QByteArray &data) int iCurReadPos = 0; while (findNextSyncByte(iCurReadPos)) { - DEBUG_LOG() << "Found Sync byte at " << iCurReadPos; + DEBUG_LOG(m_logger) << "Found Sync byte at " << iCurReadPos; unsigned int len = (m_buffer.at(iCurReadPos + 1) & 0xF0) >> 4; - DEBUG_LOG() << "Payload size: " << len; + DEBUG_LOG(m_logger) << "Payload size: " << len; if (len > 8) { @@ -96,22 +95,22 @@ void ConnectionHandlerTcpTtci::slotReadCanFrame(const QByteArray &data) { case 9: - DEBUG_LOG() << "Read status data - skipping "; + DEBUG_LOG(m_logger) << "Read status data - skipping "; iCurReadPos += 4; break; case 11: - DEBUG_LOG() << "Read communication SFM - PAN - skipping "; + DEBUG_LOG(m_logger) << "Read communication SFM - PAN - skipping "; iCurReadPos += 5; break; case 12: - DEBUG_LOG() << "Read parameter request - skipping "; + DEBUG_LOG(m_logger) << "Read parameter request - skipping "; iCurReadPos += 5; break; default: - WARNING_LOG() << "Invalid payload size (" << len << " - skipping"; + WARNING_LOG(m_logger) << "Invalid payload size (" << len << " - skipping"; ++iCurReadPos; break; } @@ -124,7 +123,7 @@ void ConnectionHandlerTcpTtci::slotReadCanFrame(const QByteArray &data) int neededBytes = 4 + len + iCurReadPos; if (m_buffer.size() < neededBytes) { - INFO_LOG() << "To few bytes in buffer - waiting for more (want: " + INFO_LOG(m_logger) << "To few bytes in buffer - waiting for more (want: " << neededBytes << " have: " << m_buffer.size() << ")"; break; @@ -134,7 +133,7 @@ void ConnectionHandlerTcpTtci::slotReadCanFrame(const QByteArray &data) unsigned char id2 = m_buffer.at(iCurReadPos + 2); id = ((id << 8) + id2); bool rtr = ((m_buffer.at(iCurReadPos + 1) & 0x08) == 0x08); - DEBUG_LOG() << "CAN ID: " << id << " rtr: " << rtr; + DEBUG_LOG(m_logger) << "CAN ID: " << id << " rtr: " << rtr; unsigned char crc = 0; @@ -146,7 +145,7 @@ void ConnectionHandlerTcpTtci::slotReadCanFrame(const QByteArray &data) if (crc != crcSent) { - WARNING_LOG() << "CRC checksum missmatch (is: " << crcSent + WARNING_LOG(m_logger) << "CRC checksum missmatch (is: " << crcSent << " - calculated: " << crc << ") - skipping"; iCurReadPos++; continue; @@ -179,7 +178,7 @@ bool ConnectionHandlerTcpTtci::send(const LtsUtils::SfmMessage &message) if (message.payload().size() > 8) return false; - INFO_LOG() << "start write"; + INFO_LOG(m_logger) << "start write"; NGL::NGLLoggerHelper::hexDumpHelper(m_logger, NGL::LogLevel::Debug, message.payload()); QByteArray data(message.payload().size() + 4, Qt::Uninitialized); @@ -196,10 +195,10 @@ bool ConnectionHandlerTcpTtci::send(const LtsUtils::SfmMessage &message) crc += data.at(i); crc = ~crc; data[message.payload().size() + 3] = crc; - INFO_LOG() << "end write "; + INFO_LOG(m_logger) << "end write "; if (!m_canChannel->writeData(data)) - ERROR_LOG() << "Error writing data to can channel"; + ERROR_LOG(m_logger) << "Error writing data to can channel"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.h index 60cfce89b..943dd0c9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/connection_handler_tcp_ttci.h @@ -40,6 +40,7 @@ signals: void disconnectedFromEq(); private: + NGL::INGLLogger &m_logger; void initCanSocket(); void newDataAvailable(const QByteArray &); bool findNextSyncByte(int &iCurReadPos) const; @@ -49,6 +50,7 @@ private slots: private: + NGL::INGLLogger &m_logger; QByteArray m_messageData; bool m_messageDataStart; QByteArray m_wirkfeldData; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.cpp index 185e7cc86..a75a15563 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.cpp @@ -8,17 +8,16 @@ namespace TrainingAreaBaseOC { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Exercise, exerciseId)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -33,23 +32,23 @@ bool DdsHandler::init(const QStringList &qosFileList) m_dtsTaboc = Interface::Dts::create(m_ddsConnector); bRet &= m_dtsTaboc->enableAll(); - INFO_LOG() << "Dts TrainingAreaBaseOc initialised"; + INFO_LOG(m_logger) << "Dts TrainingAreaBaseOc initialised"; m_dtcTaboc = Interface::Dtc::create(m_ddsConnector); bRet &= m_dtsTaboc->enableSpecificsEquipment(); - INFO_LOG() << "Dtc TrainingAreaBaseOc initialised"; + INFO_LOG(m_logger) << "Dtc TrainingAreaBaseOc initialised"; m_ftsTaboc = Interface::Fts::create(m_ddsConnector); bRet &= m_ftsTaboc->enableAll(); - INFO_LOG() << "Fts TrainingAreaBaseOc initialised"; + INFO_LOG(m_logger) << "Fts TrainingAreaBaseOc initialised"; m_dtsTab = TrainingAreaBase::Interface::Dts::create(m_ddsConnector); bRet &= (m_dtsTab->enableOcData() && m_dtsTab->enableFireSmokeMarkerData()); - INFO_LOG() << "Dts TrainingAreaBase initialised"; + INFO_LOG(m_logger) << "Dts TrainingAreaBase initialised"; m_ftsTab = TrainingAreaBase::Interface::Fts::create(m_ddsConnector); bRet &= (m_ftsTab->enableSendOcData() && m_ftsTab->enableSendFireSmokeMarkerData()); - INFO_LOG() << "Fts TrainingAreaBase initialised"; + INFO_LOG(m_logger) << "Fts TrainingAreaBase initialised"; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.h index a2d1c877f..4409890e3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/dds_handler.h @@ -68,6 +68,7 @@ public: qint64 currentPartitionTime() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_dtcCore; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp index 2a30ba541..a28d403f0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/handler_aes_data.cpp @@ -41,7 +41,7 @@ bool HandlerAesData::init() if (!m_aesDtc->enableBCContamination() || !m_aesDtc->enableExplosionArea() || !m_aesDtc->enableExplosionSingle() || !m_aesDtc->enableFunctionalArea() || !m_aesDtc->enableNContamination() || !m_aesDtc->enableMineArea() || !m_aesDtc->enableExplosionCluster()) { - ERROR_LOG() << "Error enabling AES Data-Topics."; + ERROR_LOG(m_logger) << "Error enabling AES Data-Topics."; return false; } @@ -53,7 +53,7 @@ bool HandlerAesData::init() || !m_aesFtc->enableMineAreaRemove() || !m_aesFtc->enableExplosionClusterRemove() || !m_aesFtc->enableExplosionAreaPauseResume() || !m_aesFtc->enableMineAreaReferenceModify()) { - ERROR_LOG() << "Error enabling AES Function-Topics."; + ERROR_LOG(m_logger) << "Error enabling AES Function-Topics."; return false; } @@ -61,7 +61,7 @@ bool HandlerAesData::init() if (!m_pdmDtc->enableChargeType() || !m_pdmDtc->enableGearTypeChargeType() || !m_pdmDtc->enableGearType()) { - ERROR_LOG() << "Error enabling PDM Data-Topic."; + ERROR_LOG(m_logger) << "Error enabling PDM Data-Topic."; return false; } @@ -70,11 +70,11 @@ bool HandlerAesData::init() || !m_aesDtc->waitForHistoricalDataNContamination(10000) || !m_aesDtc->waitForHistoricalDataMineArea(10000) || !m_aesDtc->waitForHistoricalDataExplosionCluster(10000)) { - ERROR_LOG() << "Error waiting for historical data AES."; + ERROR_LOG(m_logger) << "Error waiting for historical data AES."; return false; } - DEBUG_LOG() << "Initialisation successful"; + DEBUG_LOG(m_logger) << "Initialisation successful"; return true; } @@ -125,7 +125,7 @@ void HandlerAesData::process(const QByteArray &data, int multiplexer) break; } default: - WARNING_LOG() << "Got unknown multiplexer."; + WARNING_LOG(m_logger) << "Got unknown multiplexer."; } } @@ -139,121 +139,121 @@ void HandlerAesData::specificsExercise(const OcTelegrams::SpecificsExercise &dat void HandlerAesData::onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Mine area modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Mine area modify failed: " << reply.translated(); else - DEBUG_LOG() << "Mine area modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Mine area modify successfull. Id: " << reply.id(); } void HandlerAesData::onNContaminationModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "N contamination modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "N contamination modify failed: " << reply.translated(); else - DEBUG_LOG() << "N contamination modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "N contamination modify successfull. Id: " << reply.id(); } void HandlerAesData::onFunctionalAreaModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Functional area modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Functional area modify failed: " << reply.translated(); else - DEBUG_LOG() << "Functional area modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Functional area modify successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionSingleModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Explosion single modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Explosion single modify failed: " << reply.translated(); else - DEBUG_LOG() << "Explosion single modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Explosion single modify successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionAreaModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Explosion area modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Explosion area modify failed: " << reply.translated(); else - DEBUG_LOG() << "Explosion area modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Explosion area modify successfull. Id: " << reply.id(); } void HandlerAesData::onBCContaminationModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "BC contamination modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "BC contamination modify failed: " << reply.translated(); else - DEBUG_LOG() << "BC contamination modify successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "BC contamination modify successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "ExplosionCluster modify failed: " << reply.translated(); + ERROR_LOG(m_logger) << "ExplosionCluster modify failed: " << reply.translated(); else - DEBUG_LOG() << "ExplosionCluster successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "ExplosionCluster successfull. Id: " << reply.id(); } void HandlerAesData::onMineAreaRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Mine area remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Mine area remove failed: " << reply.translated(); else - DEBUG_LOG() << "Mine area remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Mine area remove successfull. Id: " << reply.id(); } void HandlerAesData::onNContaminationRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "N contamination remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "N contamination remove failed: " << reply.translated(); else - DEBUG_LOG() << "N contamination remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "N contamination remove successfull. Id: " << reply.id(); } void HandlerAesData::onFunctionalAreaRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Functional area remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Functional area remove failed: " << reply.translated(); else - DEBUG_LOG() << "Functional area remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Functional area remove successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionSingleRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Explosion single remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Explosion single remove failed: " << reply.translated(); else - DEBUG_LOG() << "Explosion single remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Explosion single remove successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionAreaRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Explosion area remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Explosion area remove failed: " << reply.translated(); else - DEBUG_LOG() << "Explosion area remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Explosion area remove successfull. Id: " << reply.id(); } void HandlerAesData::onBCContaminationRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "BC contamination remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "BC contamination remove failed: " << reply.translated(); else - DEBUG_LOG() << "BC contamination remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "BC contamination remove successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionClusterRemoveReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "ExplosionCluster remove failed: " << reply.translated(); + ERROR_LOG(m_logger) << "ExplosionCluster remove failed: " << reply.translated(); else - DEBUG_LOG() << "ExplosionCluster remove successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "ExplosionCluster remove successfull. Id: " << reply.id(); } void HandlerAesData::onExplosionAreaPauseResumeReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - ERROR_LOG() << "Explosion area pause/resume failed: " << reply.translated(); + ERROR_LOG(m_logger) << "Explosion area pause/resume failed: " << reply.translated(); else - DEBUG_LOG() << "Explosion area pause/resume successfull. Id: " << reply.id(); + DEBUG_LOG(m_logger) << "Explosion area pause/resume successfull. Id: " << reply.id(); } template static inline void getBasicData(const QByteArray &data, size_t &pos, T &req, bool withoutEffectStart = false) @@ -300,8 +300,8 @@ static inline double mathToCompassAngle(int mathDegree) void HandlerAesData::bcContaminations(const QByteArray &data) { - INFO_LOG() << "Got new BC contamination data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new BC contamination data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->bCContaminations().keys(); @@ -340,7 +340,7 @@ void HandlerAesData::bcContaminations(const QByteArray &data) req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Biological, tmp)); LtsUtils::get1Byte(data, pos, tmp); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "BC contamination: " << req; aesToBeDeleted.removeAll(req.id()); req.id(req.id() * -1); @@ -354,7 +354,7 @@ void HandlerAesData::bcContaminations(const QByteArray &data) continue; if (m_aesDtc->bCContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved) { - DEBUG_LOG() << "Removing BC contamination id: " << id; + DEBUG_LOG(m_logger) << "Removing BC contamination id: " << id; m_aesFtc->bCContaminationRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -362,8 +362,8 @@ void HandlerAesData::bcContaminations(const QByteArray &data) void HandlerAesData::explosionAreas(const QByteArray &data) { - INFO_LOG() << "Got new explosion cluster data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new explosion cluster data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->explosionClusters().keys(); @@ -441,12 +441,12 @@ void HandlerAesData::explosionAreas(const QByteArray &data) LtsUtils::get3Byte(data, pos, tmp); } - DEBUG_LOG() << "New ExplosionClusterOcModifyRequest: " + DEBUG_LOG(m_logger) << "New ExplosionClusterOcModifyRequest: " << "\nid:" << req.id() << "\nname:" << req.name() << "\neffectStart:" << req.effectStart() << "\neffectDuration:" << req.effectDuration() << "\narea:" << req.area() << "\nmhpCount:" << req.mhpCount() << "\nmhpRotation:" << req.mhpRotation() << "\nimpactCount:" << req.impactCount() << "\nchargeTypeId:" << req.chargeStruct().chargeTypeId() << "\npartyId:" << req.partyId(); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion cluster: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion cluster: " << req; aesToBeDeleted.removeOne(req.id()); req.id(req.id() * -1); @@ -466,7 +466,7 @@ void HandlerAesData::explosionAreas(const QByteArray &data) || (exp.effectStateId().underlying() == AreaEffectSimulation::AesEffectState::EsPaused)))) { - DEBUG_LOG() << "Removing explosion cluster with id: " << id; + DEBUG_LOG(m_logger) << "Removing explosion cluster with id: " << id; m_aesFtc->explosionClusterRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -474,8 +474,8 @@ void HandlerAesData::explosionAreas(const QByteArray &data) void HandlerAesData::explosionSingles(const QByteArray &data) { - INFO_LOG() << "Got new explosion single data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new explosion single data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->explosionSingles().keys(); @@ -502,7 +502,7 @@ void HandlerAesData::explosionSingles(const QByteArray &data) req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Artillery, tmp)); if (req.chargeTypeId() == 0) req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Mortar, tmp)); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "explosion single: " << req; aesToBeDeleted.removeAll(req.id()); req.id(req.id() * -1); @@ -517,7 +517,7 @@ void HandlerAesData::explosionSingles(const QByteArray &data) if ((exp.effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved) && (exp.effectStart().is_set() && (exp.effectStart().get() > (m_dds->currentPartitionTime() + 5000)))) { - DEBUG_LOG() << "Removing explosion single id: " << id; + DEBUG_LOG(m_logger) << "Removing explosion single id: " << id; m_aesFtc->explosionSingleRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -525,8 +525,8 @@ void HandlerAesData::explosionSingles(const QByteArray &data) void HandlerAesData::functionalAreas(const QByteArray &data) { - INFO_LOG() << "Got functional area data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got functional area data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->functionalAreas().keys(); @@ -571,7 +571,7 @@ void HandlerAesData::functionalAreas(const QByteArray &data) req.medicTime(tmp * 10 * 60 * 1000); req.chargeTypeId(411); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "functional area: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "functional area: " << req; aesToBeDeleted.removeAll(req.id()); req.id(req.id() * -1); @@ -585,7 +585,7 @@ void HandlerAesData::functionalAreas(const QByteArray &data) continue; if (m_aesDtc->functionalArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved) { - DEBUG_LOG() << "Removing functional area id: " << id; + DEBUG_LOG(m_logger) << "Removing functional area id: " << id; m_aesFtc->functionalAreaRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -593,8 +593,8 @@ void HandlerAesData::functionalAreas(const QByteArray &data) void HandlerAesData::nContaminations(const QByteArray &data) { - INFO_LOG() << "Got new N contamination data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new N contamination data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->nContaminations().keys(); @@ -628,7 +628,7 @@ void HandlerAesData::nContaminations(const QByteArray &data) req.chargeTypeId(chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearClass_def::Nuclear, 1)); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "N contamination: " << req; aesToBeDeleted.removeAll(req.id()); req.id(req.id() * -1); @@ -642,7 +642,7 @@ void HandlerAesData::nContaminations(const QByteArray &data) continue; if (m_aesDtc->nContamination(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved) { - DEBUG_LOG() << "Removing N contamination id: " << id; + DEBUG_LOG(m_logger) << "Removing N contamination id: " << id; m_aesFtc->nContaminationRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -650,8 +650,8 @@ void HandlerAesData::nContaminations(const QByteArray &data) void HandlerAesData::mineAreas(const QByteArray &data) { - INFO_LOG() << "Got new mine area data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new mine area data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); QList aesToBeDeleted = m_aesDtc->mineAreas().keys(); @@ -700,7 +700,7 @@ void HandlerAesData::mineAreas(const QByteArray &data) req.isCenterLine(true); - DEBUG_LOG() << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "mine area: " << req; + DEBUG_LOG(m_logger) << (aesToBeDeleted.contains(req.id()) ? "Modifying " : "Creating ") << "mine area: " << req; aesToBeDeleted.removeAll(req.id()); req.id(req.id() * -1); @@ -715,7 +715,7 @@ void HandlerAesData::mineAreas(const QByteArray &data) continue; if (m_aesDtc->mineArea(id).effectStateId().underlying() > AreaEffectSimulation::AesEffectState::EsRemoved) { - DEBUG_LOG() << "Removing mine area id: " << id; + DEBUG_LOG(m_logger) << "Removing mine area id: " << id; m_aesFtc->mineAreaRemoveRequest(Core::RemoveElementRequest(id), this); } } @@ -723,8 +723,8 @@ void HandlerAesData::mineAreas(const QByteArray &data) void HandlerAesData::explosionAreasPause(const QByteArray &data) { - INFO_LOG() << "Got new explosion area pause data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new explosion area pause data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); size_t pos = 0; int cnt; @@ -734,7 +734,7 @@ void HandlerAesData::explosionAreasPause(const QByteArray &data) for (int i = 0; i < cnt; ++i) { LtsUtils::get2Byte(data, pos, id); - DEBUG_LOG() << "Pausing ID: " << id; + DEBUG_LOG(m_logger) << "Pausing ID: " << id; m_aesFtc->explosionAreaPauseResumeRequest(AreaEffectSimulation::ExplosionAreaPauseResumeRequest(id, false, dds::core::optional(), @@ -746,8 +746,8 @@ void HandlerAesData::explosionAreasPause(const QByteArray &data) void HandlerAesData::explosionAreasResume(const QByteArray &data) { - INFO_LOG() << "Got new explosion area resume data"; - DEBUG_LOG() << "Binary data: " << data.toHex(' '); + INFO_LOG(m_logger) << "Got new explosion area resume data"; + DEBUG_LOG(m_logger) << "Binary data: " << data.toHex(' '); size_t pos = 0; int cnt; @@ -766,7 +766,7 @@ void HandlerAesData::explosionAreasResume(const QByteArray &data) req.timeToResume(dds::core::optional(tmp * 1000)); LtsUtils::get2Byte(data, pos, tmp); req.remainingDuration(dds::core::optional(tmp)); - DEBUG_LOG() << "Resuming: " << req; + DEBUG_LOG(m_logger) << "Resuming: " << req; m_aesFtc->explosionAreaPauseResumeRequest(req, this); } } @@ -779,7 +779,7 @@ int HandlerAesData::chargeTypeIdFromChargeTasCode(ProjectDataManagement::GearCla { if (!m_pdmDtc->waitForHistoricalDataChargeType(20000)) { - ERROR_LOG() << "Can not read charge types from PDM"; + ERROR_LOG(m_logger) << "Can not read charge types from PDM"; QCoreApplication::exit(-1); return -1; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.cpp index 0d5582255..2a68effdb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.cpp @@ -9,8 +9,7 @@ namespace TrainingAreaBaseOC { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) +MainHandler::MainHandler(QObject *parent) : QObject(parent) , m_aesDtc(nullptr) , m_aesFtc(nullptr) , m_pdmDtc(nullptr) @@ -19,8 +18,8 @@ MainHandler::MainHandler(QObject *parent) , m_ddsHandler(nullptr) , m_rxHandler(nullptr) , m_ftsHandler(nullptr) - , m_websocketHandler(nullptr) -{} + , m_websocketHandler(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -40,28 +39,28 @@ bool MainHandler::init(int domainId, int exerciseId) m_ddsHandler = std::make_shared(domainId, exerciseId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Could not initialise DdsHandler."; + ERROR_LOG(m_logger) << "Could not initialise DdsHandler."; return false; } m_aesDtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsHandler->ddsConnector()); - DEBUG_LOG() << "Created AES Dtc"; + DEBUG_LOG(m_logger) << "Created AES Dtc"; m_aesFtc = AreaEffectSimulation::Interface::Ftc::create(m_ddsHandler->ddsConnector()); - DEBUG_LOG() << "Created AES Ftc"; + DEBUG_LOG(m_logger) << "Created AES Ftc"; m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsHandler->ddsConnector()); - DEBUG_LOG() << "Created PDM Dtc"; + DEBUG_LOG(m_logger) << "Created PDM Dtc"; m_connectionHandler = std::make_shared(); if (!m_connectionHandler->init()) { - ERROR_LOG() << "Could not initialise ConnectionHandler."; + ERROR_LOG(m_logger) << "Could not initialise ConnectionHandler."; return false; } @@ -73,7 +72,7 @@ bool MainHandler::init(int domainId, int exerciseId) if (!m_canagHandler->init()) { - ERROR_LOG() << "Could not initialise CanagHandler."; + ERROR_LOG(m_logger) << "Could not initialise CanagHandler."; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.h index 58b4aae0b..e54d3680f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/main_handler.h @@ -45,6 +45,7 @@ public: int exerciseId() const { return m_ddsHandler->ddsConnector()->getPartitionId(); } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_aesDtc; std::shared_ptr m_aesFtc; std::shared_ptr m_pdmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/recv_from_dds_fts.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/recv_from_dds_fts.h index 719d780d5..1204990c3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/recv_from_dds_fts.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/recv_from_dds_fts.h @@ -28,6 +28,8 @@ public: void onSendFireSmokeMarkerDataRequest(const rti::core::SampleIdentity &cookie, const TrainingAreaBase::SendFireSmokeMarkerDataRequest &request) override; private: + +NGL::INGLLogger &m_logger; static Core::FunctionReplyObject fillFro(bool bSuccess); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.cpp index e8d989fc4..1bef33174 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.cpp @@ -10,12 +10,11 @@ namespace TrainingAreaBaseOC { -SendToDds::SendToDds(MainHandler *mainHandler) - : m_dtsTaboc(mainHandler->dds()->dtsTaboc()) +SendToDds::SendToDds(MainHandler *mainHandler) : m_dtsTaboc(mainHandler->dds()->dtsTaboc()) , m_dtsTab(mainHandler->dds()->dtsTab()) , m_utmCoord(LtsCoordTrans::UtmCoordinate()) - , m_idToSend(1) -{} + , m_idToSend(1), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void SendToDds::rxData(const OcTelegrams::Display &inData) { @@ -162,7 +161,7 @@ void SendToDds::rxData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBase & } default: { - ERROR_LOG() << "Received unhandled TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type " << static_cast(inData.payloadType); + ERROR_LOG(m_logger) << "Received unhandled TrainingAreaBase::TetraIcd::OpaquePayloadDataBase::Type " << static_cast(inData.payloadType); break; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.h index 9776ddf28..e7a4fcd54 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/send_to_dds.h @@ -28,6 +28,7 @@ public: void rxData(const TrainingAreaBase::TetraIcd::OpaquePayloadDataBase &inData); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_dtsTaboc; std::shared_ptr m_dtsTab; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.cpp index 6ba339645..7afd58d7e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.cpp @@ -9,13 +9,12 @@ namespace TrainingAreaBaseOC { -Channel::Channel(QChar channel, bool bIsBinary, QObject *parent) - : QObject(parent) +Channel::Channel(QChar channel, bool bIsBinary, QObject *parent) : QObject(parent) , m_channel(channel) , m_bIsBinary(bIsBinary) , m_device(nullptr) - .getNGLLogger("SCTT.Channel")) -{} + .getNGLLogger("SCTT.Channel")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void Channel::setDevice(Device *dev) { @@ -34,7 +33,7 @@ bool Channel::writeData(const QByteArray &data) { if (!m_device || !m_device->isOpen()) { - WARNING_LOG() << "Error writing data - device is not open" ; + WARNING_LOG(m_logger) << "Error writing data - device is not open" ; return false; } @@ -61,7 +60,7 @@ void Channel::onDeviceDestroyed() void Channel::onDataAvailable(const QByteArray &data) { - TRACE_LOG() << "Data available from " + TRACE_LOG(m_logger) << "Data available from " << ", we are: " << m_channel << ", data: '" << data << "'" ; emit dataAvailable(data); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.h index ed5080007..6a4d894a1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_channel.h @@ -36,6 +36,8 @@ protected slots: void onDataAvailable(const QByteArray &data); protected: + +NGL::INGLLogger &m_logger; QChar m_channel; bool m_bIsBinary; Device *m_device; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.cpp index 79ee5c708..bdac57429 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.cpp @@ -10,15 +10,14 @@ namespace TrainingAreaBaseOC { -Device::Device(QObject *parent, bool tcpMode) - : QObject(parent) +Device::Device(QObject *parent, bool tcpMode) : QObject(parent) , m_spQuerry(new LtsSerialPortQuerry::LtsSerialPortQuerry(this)) , m_socket(new QTcpSocket(this)) , m_restartTimer(new QTimer(this)) , m_receiveTimeoutTimer(new QTimer(this)) , m_tcpMode(tcpMode) - .getNGLLogger("TTCI.Device")) -{ + .getNGLLogger("TTCI.Device")), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_spQuerry, &LtsSerialPortQuerry::LtsSerialPortQuerry::connectionEstablished, this, &Device::open); m_spQuerry->restartQuerry(); @@ -36,7 +35,7 @@ Device::~Device() void Device::reOpen() { - DEBUG_LOG() << "ConnectionHandlerSerial::reOpen"; + DEBUG_LOG(m_logger) << "ConnectionHandlerSerial::reOpen"; close(); QTimer::singleShot(2000, this, &Device::open); } @@ -52,19 +51,19 @@ bool Device::open() m_socket->connectToHost(Settings::hostName(), Settings::portTtci()); if (!m_socket->waitForConnected()) { - ERROR_LOG() << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString(); + ERROR_LOG(m_logger) << "Could not (re)open tcp destination " << m_socket->peerName() << ":" << m_socket->peerPort() << ", error: " << m_socket->errorString(); return false; } connect(m_socket, &QTcpSocket::readyRead, this, &Device::onDataAvailable); connect(m_socket, QOverload::of(&QAbstractSocket::error), this, &Device::handleError); connect(m_socket, &QTcpSocket::disconnected, this, &Device::open); - DEBUG_LOG() << "(Re)openend tcp destination " << m_socket->peerName() << ":" << Settings::portTtci(); + DEBUG_LOG(m_logger) << "(Re)openend tcp destination " << m_socket->peerName() << ":" << Settings::portTtci(); } else { m_serialPort = m_spQuerry->currentSerialPort(); - DEBUG_LOG() << "(Re)openend serial destination " << m_serialPort->portName() << ":"; + DEBUG_LOG(m_logger) << "(Re)openend serial destination " << m_serialPort->portName() << ":"; connect(m_serialPort, &QSerialPort::readyRead, this, &Device::onDataAvailable); @@ -79,7 +78,7 @@ bool Device::close() { if (m_socket->isOpen()) m_socket->close(); - DEBUG_LOG() << "Closing TCP Port"; + DEBUG_LOG(m_logger) << "Closing TCP Port"; delete m_socket; m_socket = nullptr; m_receiveTimeoutTimer->stop(); @@ -110,7 +109,7 @@ void Device::onDataAvailable() void Device::parseBuffer() { - DEBUG_LOG() << "Buffer - size: " << m_buffer.size() + DEBUG_LOG(m_logger) << "Buffer - size: " << m_buffer.size() << ", data: " << m_buffer.toHex() ; @@ -118,21 +117,21 @@ void Device::parseBuffer() int idxStart = -1; while ((idxStart = m_buffer.indexOf(0x02)) >= 0) { - TRACE_LOG() << "idxStart: " << idxStart ; + TRACE_LOG(m_logger) << "idxStart: " << idxStart ; int idxLen = idxStart + 1; if (idxLen >= m_buffer.size()) return; unsigned char len = static_cast(m_buffer.at(idxLen)); - TRACE_LOG() << "idxLen: " << idxLen + TRACE_LOG(m_logger) << "idxLen: " << idxLen << ", len: " << len << " = 0x" << QByteArray::number(len, 16); int idxCrc = idxLen + len + 1; int idxEnd = idxCrc + 1; if (idxEnd >= m_buffer.size()) return; - TRACE_LOG() << "idxCrc: " << idxCrc + TRACE_LOG(m_logger) << "idxCrc: " << idxCrc << ", idxEnd: " << idxEnd ; if (idxEnd >= m_buffer.size()) return; @@ -141,7 +140,7 @@ void Device::parseBuffer() if (m_buffer.at(idxEnd) != 0x03) { - WARNING_LOG() << "Could not find valid end marker - searching new start marker" + WARNING_LOG(m_logger) << "Could not find valid end marker - searching new start marker" ; m_buffer = m_buffer.mid(1); continue; @@ -149,12 +148,12 @@ void Device::parseBuffer() unsigned char crc = static_cast(m_buffer.at(idxCrc)); unsigned char crcCalc = calcChecksum(m_buffer.mid(idxStart, idxCrc - idxStart)); - TRACE_LOG() << "crc: " << crc + TRACE_LOG(m_logger) << "crc: " << crc << ", calculated: " << crcCalc ; if (crc != crcCalc) { - WARNING_LOG() << "Invalid checksum - is: " << crcCalc + WARNING_LOG(m_logger) << "Invalid checksum - is: " << crcCalc << " - should be: " << crc ; } @@ -163,15 +162,15 @@ void Device::parseBuffer() if (len == 255 || !m_payload.isEmpty()) { - DEBUG_LOG() << "telegram with more than 254 bytes ..." ; + DEBUG_LOG(m_logger) << "telegram with more than 254 bytes ..." ; if (len == 255 && m_payload.isEmpty()) - DEBUG_LOG() << "Remember the payload destination: " << destination ; + DEBUG_LOG(m_logger) << "Remember the payload destination: " << destination ; m_payload += payload; if (len != 255) { - DEBUG_LOG() << "destination: " << destination + DEBUG_LOG(m_logger) << "destination: " << destination << ", data: " << m_payload.toHex() ; emit dataAvailable(m_payload); m_payload.clear(); @@ -180,7 +179,7 @@ void Device::parseBuffer() else { - DEBUG_LOG() << "destination: " << destination + DEBUG_LOG(m_logger) << "destination: " << destination << ", data: " << payload.toHex() ; emit dataAvailable(payload); } @@ -197,7 +196,7 @@ bool Device::writeData(const QChar destination, const QByteArray &payload) if ((m_tcpMode && !m_socket->isOpen()) || (!m_tcpMode && !m_serialPort->isOpen())) return false; - DEBUG_LOG() << "Writing " << payload.size() + DEBUG_LOG(m_logger) << "Writing " << payload.size() << " Bytes to channel " << destination ; QByteArray data = payload; @@ -215,7 +214,7 @@ bool Device::writeData(const QChar destination, const QByteArray &payload) buf.append(calcChecksum(buf)); buf.append(0x03); - DEBUG_LOG() << "Writing: " << buf.toHex() ; + DEBUG_LOG(m_logger) << "Writing: " << buf.toHex() ; if (m_tcpMode) m_socket->write(buf); else @@ -245,7 +244,7 @@ unsigned char Device::calcChecksum(const QByteArray &checksumData) void Device::handleError(QAbstractSocket::SocketError error) { - DEBUG_LOG() << "Spontaneous error " << error << " doesn't have to be an error ..."; + DEBUG_LOG(m_logger) << "Spontaneous error " << error << " doesn't have to be an error ..."; const QString errStr(QStringLiteral("QTcpSocket::SocketError ") + QString::number(error) + QStringLiteral(" from tcp port ") + QString::number(m_socket->peerPort()) + @@ -257,20 +256,20 @@ void Device::handleError(QAbstractSocket::SocketError error) case QTcpSocket::SocketError::SocketAccessError: case QTcpSocket::SocketError::SocketResourceError: { - ERROR_LOG() << "Closing port trying to reopen it."; + ERROR_LOG(m_logger) << "Closing port trying to reopen it."; close(); m_restartTimer->start(); Q_FALLTHROUGH(); } case QTcpSocket::SocketError::RemoteHostClosedError: { - ERROR_LOG() << "Host closed trying to reopen."; + ERROR_LOG(m_logger) << "Host closed trying to reopen."; m_restartTimer->start(); break; } default: { - ERROR_LOG() << errStr; + ERROR_LOG(m_logger) << errStr; close(); m_restartTimer->start(); break; @@ -280,7 +279,7 @@ void Device::handleError(QAbstractSocket::SocketError error) void Device::handleSerialError(QSerialPort::SerialPortError error) { - DEBUG_LOG() << "Spontaneous error " << error << " doesn't have to be an error ..."; + DEBUG_LOG(m_logger) << "Spontaneous error " << error << " doesn't have to be an error ..."; const QString errStr(QStringLiteral("QSerialPort::SerialPortError ") + QString::number(error) + QStringLiteral(" error: ") + m_serialPort->errorString()); @@ -293,13 +292,13 @@ void Device::handleSerialError(QSerialPort::SerialPortError error) case QSerialPort::SerialPortError::PermissionError: case QSerialPort::SerialPortError::WriteError: { - WARNING_LOG() << "Closing port trying to reopen it."; + WARNING_LOG(m_logger) << "Closing port trying to reopen it."; m_restartTimer->start(); Q_FALLTHROUGH(); } default: { - WARNING_LOG() << errStr; + WARNING_LOG(m_logger) << errStr; m_restartTimer->start(); break; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.h index 37f534591..967c713cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/ttci_device.h @@ -44,6 +44,8 @@ public slots: void handleSerialError(QSerialPort::SerialPortError error); protected: + +NGL::INGLLogger &m_logger; void parseBuffer(); static unsigned char calcChecksum(const QByteArray &checksumData); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/websocket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/websocket_handler.cpp index 54130564e..de95ac2d5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/websocket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/TrainingAreaBaseOC/websocket_handler.cpp @@ -12,12 +12,11 @@ namespace TrainingAreaBaseOC { WebsocketHandler::WebsocketHandler(QObject *parent, int exerciseId, - const std::shared_ptr dtsTabOc, const std::shared_ptr dtcTabOc) - : QObject(parent) + const std::shared_ptr dtsTabOc, const std::shared_ptr dtcTabOc) : QObject(parent) , m_exerciseId(exerciseId) , m_dtsTaboc(dtsTabOc) - , m_dtcTaboc(dtcTabOc) -{ + , m_dtcTaboc(dtcTabOc), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_tryConnectionTimer = new QTimer(this); connect(m_tryConnectionTimer, &QTimer::timeout, this, &WebsocketHandler::onTryConnectionTimerTimeout); m_tryConnectionTimer->start(10 * 1000); @@ -131,12 +130,12 @@ void WebsocketHandler::onSendOwnPosition(const QString &message) QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8()); if (!doc.isObject()) { - WARNING_LOG() << "No Valid Object in " << message; + WARNING_LOG(m_logger) << "No Valid Object in " << message; return; } if (doc.object().value(QStringLiteral("data")).toObject().isEmpty()) { - WARNING_LOG() << "No Data Array in" << message; + WARNING_LOG(m_logger) << "No Data Array in" << message; return; } @@ -149,7 +148,7 @@ void WebsocketHandler::onSendOwnPosition(const QString &message) if (obj.contains(QStringLiteral("lon")) && obj.contains(QStringLiteral("lat"))) { - DEBUG_LOG() << "Got message with position"; + DEBUG_LOG(m_logger) << "Got message with position"; outData.position(Core::GeoPosition(obj.value(QStringLiteral("lon")).toDouble(),obj.value(QStringLiteral("lat")).toDouble(),obj.value(QStringLiteral("height")).toDouble())); outData.timeStamp(QDateTime::currentMSecsSinceEpoch()); if (obj.contains(QStringLiteral("buildingId")) && obj.contains(QStringLiteral("roomId")) ) @@ -168,32 +167,32 @@ void WebsocketHandler::onSendOwnPosition(const QString &message) void WebsocketHandler::connectToServer() { - DEBUG_LOG() << "Try connect to servicemanagement " << QUrl(QStringLiteral("ws://")+Settings::remoteServerHostname()+QStringLiteral(":")+ QString::number(7300)).toString(); + DEBUG_LOG(m_logger) << "Try connect to servicemanagement " << QUrl(QStringLiteral("ws://")+Settings::remoteServerHostname()+QStringLiteral(":")+ QString::number(7300)).toString(); m_socket->open(QUrl(QStringLiteral("ws://")+Settings::remoteServerHostname()+QStringLiteral(":")+ QString::number(7300))); } void WebsocketHandler::sendServicePortRequest() { m_socket->sendTextMessage(QStringLiteral("{\"type\": \"servicePortsInformationRequest\",\"uuid\": \"7777\"}")); - DEBUG_LOG() << "Wait For Services Reply"; + DEBUG_LOG(m_logger) << "Wait For Services Reply"; } void WebsocketHandler::parseServices(const QString &message) { m_tryConnectionTimer->stop(); - DEBUG_LOG() << "Received SERVICES MESSAGE: " << message; + DEBUG_LOG(m_logger) << "Received SERVICES MESSAGE: " << message; m_socket->close(); int exPort = -1; QJsonDocument doc = QJsonDocument::fromJson(message.toUtf8()); if (!doc.isObject()) { - WARNING_LOG() << "No Valid Object in " << message; + WARNING_LOG(m_logger) << "No Valid Object in " << message; return; } if (!doc.object().value(QStringLiteral("data")).isArray()) { - WARNING_LOG() << "No Data Array in" << message; + WARNING_LOG(m_logger) << "No Data Array in" << message; return; } @@ -227,7 +226,7 @@ void WebsocketHandler::parseServices(const QString &message) if (exPort > 0) { - DEBUG_LOG() << "Connect To ppm ON: " << exPort; + DEBUG_LOG(m_logger) << "Connect To ppm ON: " << exPort; connectToExPPM(exPort); m_state = WebSocketState::CONNECTTOPPM; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.cpp index a6be7f814..c437f92c9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.cpp @@ -28,7 +28,7 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS if (m_type == LtsWebSocket::JsonKeys::ERROR_()) { - ERROR_LOG() << "Error in message: " << message; + ERROR_LOG(m_logger) << "Error in message: " << message; return nullptr; } @@ -46,7 +46,7 @@ LtsWebSocket::AbstractClientMessage *ClientMessageFactory::createMessage(LtsWebS if (!result) { - ERROR_LOG() << "message: " << message; + ERROR_LOG(m_logger) << "message: " << message; Q_ASSERT(result); } @@ -114,7 +114,7 @@ DataManager::DataManager(const std::shared_ptr &wms2ecc, const st this, &DataManager::openWebSocket); m_messageFactory = new ClientMessageFactory(this); - DEBUG_LOG() << "WarehouseManagement/WmsServer = " << Settings::wmsServerName(); + DEBUG_LOG(m_logger) << "WarehouseManagement/WmsServer = " << Settings::wmsServerName(); } DataManager::~DataManager() @@ -154,7 +154,7 @@ void DataManager::openWebSocket() int port = NGL::Connections::port(NGL::Connections::eConnection::ZSLV); QString url = QStringLiteral("ws://") + Settings::wmsServerName() + QStringLiteral(":") + QString::number(port); wsSocket->open(QUrl::fromEncoded(url.toLocal8Bit())); - INFO_LOG() << "Trying to listen on " << url; + INFO_LOG(m_logger) << "Trying to listen on " << url; m_wsReconnectTimer->start(5000); } @@ -272,7 +272,7 @@ void DataManager::handleEquipmentTypes(const ::EquipmentTypes &eTypes) { const IWMS2ECC::equipTypeMap equipTypeMap = eTypes.getEquipmentTypes(); - INFO_LOG() << "equipTypeMap size: " << equipTypeMap.size(); + INFO_LOG(m_logger) << "equipTypeMap size: " << equipTypeMap.size(); ParticipantManagement::ModifyEquipmentTypeDataRequest request; request.deleteAll(true); auto &dataVec = request.data(); @@ -292,7 +292,7 @@ void DataManager::handleEquipmentTypes(const ::EquipmentTypes &eTypes) dataVec.push_back(std::move(pEt)); } - INFO_LOG() << "dataVec size: " << dataVec.size() << ", " << request; + INFO_LOG(m_logger) << "dataVec size: " << dataVec.size() << ", " << request; m_ddsHandler->ppmFtc()->modifyEquipmentTypeDataRequest(request, this); } @@ -300,9 +300,9 @@ void DataManager::handleEquipmentTypes(const ::EquipmentTypes &eTypes) void DataManager::onModifyEquipmentTypeDataReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Error while modifying equipmentType: " << replyObject.str(); + ERROR_LOG(m_logger) << "Error while modifying equipmentType: " << replyObject.str(); else - INFO_LOG() << "onModifyEquipmentTypeDataReply ok"; + INFO_LOG(m_logger) << "onModifyEquipmentTypeDataReply ok"; } void DataManager::newTextMessageFromClient(LtsWebSocket::ClientConnection *client, const QString &message) @@ -313,7 +313,7 @@ void DataManager::newTextMessageFromClient(LtsWebSocket::ClientConnection *clien clientMessage = m_messageFactory->createMessage(client, message); else { - WARNING_LOG() << "Could not parse incoming message: '" << message << "', error: " << result.errorString(); + WARNING_LOG(m_logger) << "Could not parse incoming message: '" << message << "', error: " << result.errorString(); clientMessage = new LtsWebSocket::InvalidMessage(client, QString(), QStringLiteral("Got message which is not JSON conform")); } @@ -330,7 +330,7 @@ void DataManager::onParticipantChanged(const ParticipantManagement::Participant if (!m_clientConnection || !m_wms2ecc) return; - DEBUG_LOG() << "partyId: " << data.partyId() << "participantId: " << data.id(); + DEBUG_LOG(m_logger) << "partyId: " << data.partyId() << "participantId: " << data.id(); IWMS2ECC::PlayerInfo pl = m_wms2ecc->convert(data, exerciseId); pl.playerId = (exerciseId* 1000000) + pl.playerId; m_clientConnection->addReply(new ParticipantUpdate(pl, modType)); @@ -341,7 +341,7 @@ void DataManager::onExerciseChanged(const ExerciseManagement::Exercise &data, Da if (!m_clientConnection) return; - INFO_LOG() << "IN onExerciseChanged: ExerciseUpdate: id = " << data.id(); + INFO_LOG(m_logger) << "IN onExerciseChanged: ExerciseUpdate: id = " << data.id(); IWMS2ECC::Exercise exeData = IWMS2ECC_Impl::convert(data); m_clientConnection->addReply(new ExerciseUpdate(exeData, modType)); @@ -355,9 +355,9 @@ void DataManager::onRegistrationReturnValue(int exerciseId, qint32 participantId void DataManager::registerParticipant(const Registration ®) { ParticipantManagement::ParticipantAssignState state = IWMS2ECC_Impl::convert(reg.getAssignment()); - INFO_LOG() << "ParticipantAssignState: " << state; + INFO_LOG(m_logger) << "ParticipantAssignState: " << state; - INFO_LOG() << "Registration: participant: " << reg.getPlayerId() << ", exerciseId: " << reg.getExerciseId(); + INFO_LOG(m_logger) << "Registration: participant: " << reg.getPlayerId() << ", exerciseId: " << reg.getExerciseId(); dds::core::optional equipNo; dds::core::optional identification; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.h index 363b46526..257719147 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/data_manager.h @@ -36,6 +36,8 @@ public: const QString &message); private: + +NGL::INGLLogger &m_logger; DataManager *m_dataManager; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.cpp index 1ce88c099..144aa8d8f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.cpp @@ -8,17 +8,16 @@ namespace WarehouseManagement { -DdsHandler::DdsHandler(int domainId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0)) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, 0)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -30,7 +29,7 @@ bool DdsHandler::init(const QStringList &qosFileList) m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector); bool bRet = m_exmDtc->enableExercise(); - INFO_LOG() << "Exm dtc initialised"; + INFO_LOG(m_logger) << "Exm dtc initialised"; m_ppmDtc = ParticipantManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_ppmDtc->enableType(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.h index 43ae0f61e..56be48c7a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler.h @@ -37,6 +37,7 @@ public: dds::domain::DomainParticipant getDomainParticipant() const { return m_ddsConnector->getDomainParticipant(); } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_exmDtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.cpp index e04257473..5009b6d12 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.cpp @@ -9,18 +9,17 @@ namespace WarehouseManagement { -DdsHandlerExercise::DdsHandlerExercise(const dds::domain::DomainParticipant &dp, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(dp, IDL::PartitionType::Exercise, exerciseId)) -{ +DdsHandlerExercise::DdsHandlerExercise(const dds::domain::DomainParticipant &dp, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(dp, IDL::PartitionType::Exercise, exerciseId)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_ddsConnector->setDomainParticipant(dp); - DEBUG_LOG() << "DdsHandlerExercise for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandlerExercise for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandlerExercise::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.h index c6bad1c45..798966fed 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/dds_handler_exercise.h @@ -38,6 +38,7 @@ public: } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; PpmDtc m_ppmDtc; PpmFtc m_ppmFtc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.cpp index c21d2da33..f1173cb3e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.cpp @@ -97,7 +97,7 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId, } req.participantId(participantId); - INFO_LOG() << "IN ::registerParticipant, ParticipantId: " << participantId + INFO_LOG(m_logger) << "IN ::registerParticipant, ParticipantId: " << participantId << ", equipNo: " << equipNo << ", assignState: " << assignState; m_ddsHandlerExercise->ppmFtc()->registerParticipantRequest(req, this); @@ -105,7 +105,7 @@ void ExerciseParticipantHandler::registerParticipant(qint32 participantId, void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantManagement::RegisterReply &reply) { - INFO_LOG() << "RegisterReply id " << reply.id() + INFO_LOG(m_logger) << "RegisterReply id " << reply.id() << " - registerReturnValue: " << reply.registerReturnValue() << " for exercise " << reply.exerciseId(); @@ -119,7 +119,7 @@ void ExerciseParticipantHandler::onRegisterParticipantReply(const ParticipantMan emit registrationReturnValue(reply.exerciseId(), reply.id(), reply.registerReturnValue()); if (fro.error()) - ERROR_LOG() << "Error: " << fro(); + ERROR_LOG(m_logger) << "Error: " << fro(); } void ExerciseParticipantHandler::participantAdded(const ParticipantManagement::Participant &participant) @@ -128,7 +128,7 @@ void ExerciseParticipantHandler::participantAdded(const ParticipantManagement::P if (!participant.equipmentNumber().is_set() || participant.equipmentNumber().get() == 0) { - INFO_LOG() << "New participant but no equipment number - ignoring"; + INFO_LOG(m_logger) << "New participant but no equipment number - ignoring"; return; } addParticipant(participant.id(), participant.equipmentNumber().get()); @@ -168,7 +168,7 @@ void ExerciseParticipantHandler::participantModified(const ParticipantManagement } if (participant.equipmentNumber().is_set()) { - INFO_LOG() << "Participant with id " << participant.id() << " changed its equipment number from " + INFO_LOG(m_logger) << "Participant with id " << participant.id() << " changed its equipment number from " << itEquipNumber.value() << " to " << participant.equipmentNumber().get(); } @@ -192,7 +192,7 @@ void ExerciseParticipantHandler::participantRemoved(const ParticipantManagement: if (itEquipNumber == m_participantId2EquipmentNumber.end()) { - INFO_LOG() << "Participant was removed but has no equipment number - ignoring"; + INFO_LOG(m_logger) << "Participant was removed but has no equipment number - ignoring"; return; } removeParticipant(itEquipNumber.key(), itEquipNumber.value()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.h index 8959ddb9b..faca2158c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercise_participant_handler.h @@ -39,6 +39,7 @@ Q_SIGNALS: void participantChanged(const ParticipantManagement::Participant&, DataModification modType, int exerciseId); private: + NGL::INGLLogger &m_logger; void participantAdded(const ParticipantManagement::Participant &participant); void participantModified(const ParticipantManagement::Participant &participant); void participantRemoved(const ParticipantManagement::Participant &participant); @@ -53,6 +54,7 @@ private Q_SLOTS: void onRegisterParticipantReply(const ParticipantManagement::RegisterReply &reply) override final; private: + NGL::INGLLogger &m_logger; int m_exerciseId; std::shared_ptr m_ddsHandlerExercise; ExercisesHandler *m_exercisesHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.cpp index ac42db03a..559c309e5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.cpp @@ -32,7 +32,7 @@ bool ExercisesHandler::init() QMap ExercisesHandler::getExercises() const { - INFO_LOG() << "IN getExercises"; + INFO_LOG(m_logger) << "IN getExercises"; m_ddsHandler->exmDtc()->waitForHistoricalDataExercise(); return m_ddsHandler->exmDtc()->exercises(); } @@ -62,7 +62,7 @@ ParticipantManagement::TypeClass ExercisesHandler::typeClassIdFromEquipmentTypeI ParticipantManagement::Party ExercisesHandler::getParty(int partyId, int exerciseId) const { - DEBUG_LOG() << "getParty: " << partyId << ", exId: " << exerciseId; + DEBUG_LOG(m_logger) << "getParty: " << partyId << ", exId: " << exerciseId; auto it = m_exerciseHandler.find(exerciseId); if (it == m_exerciseHandler.end()) return ParticipantManagement::Party(); @@ -150,7 +150,7 @@ bool ExercisesHandler::modifyEquipmentTypes(const std::vector ExercisesHandler::infoStructForEquipment(int equi void ExercisesHandler::exerciseAdded(int exerciseId) { - INFO_LOG() << "Exercise with id " << exerciseId << " created"; + INFO_LOG(m_logger) << "Exercise with id " << exerciseId << " created"; auto it = m_exerciseHandler.find(exerciseId); if (it != m_exerciseHandler.end()) { - WARNING_LOG() << "Exercise with id " << exerciseId + WARNING_LOG(m_logger) << "Exercise with id " << exerciseId << " added but it was already in our list - recreating handler"; delete it.value(); m_exerciseHandler.erase(it); @@ -215,7 +215,7 @@ void ExercisesHandler::exerciseAdded(int exerciseId) ExerciseParticipantHandler *exH = new ExerciseParticipantHandler(m_ddsHandler->getDomainParticipant(), exerciseId, this); if (!exH->init()) { - ERROR_LOG() << "Error initializing ExerciseHandler for exercise " << exerciseId; + ERROR_LOG(m_logger) << "Error initializing ExerciseHandler for exercise " << exerciseId; delete exH; return; } @@ -223,17 +223,17 @@ void ExercisesHandler::exerciseAdded(int exerciseId) this, &ExercisesHandler::registrationReturnValue); connect(exH, &ExerciseParticipantHandler::participantChanged, this, &ExercisesHandler::participantChanged); - INFO_LOG() << "Successfully created exercise handler for exercise " << exerciseId; + INFO_LOG(m_logger) << "Successfully created exercise handler for exercise " << exerciseId; m_exerciseHandler[exerciseId] = exH; } void ExercisesHandler::exerciseRemoved(int exerciseId) { - INFO_LOG() << "Exercise with id " << exerciseId << " removed"; + INFO_LOG(m_logger) << "Exercise with id " << exerciseId << " removed"; auto it = m_exerciseHandler.find(exerciseId); if (it == m_exerciseHandler.end()) { - WARNING_LOG() << "Exercise removed but it was not found in our internal map"; + WARNING_LOG(m_logger) << "Exercise removed but it was not found in our internal map"; return; } delete it.value(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.h index 1a6dbd932..31760ff2b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/exercises_handler.h @@ -70,6 +70,7 @@ Q_SIGNALS: void exerciseChanged(const ExerciseManagement::Exercise &data, DataModification modType); private: + NGL::INGLLogger &m_logger; void exerciseAdded(int exerciseId); void exerciseRemoved(int exerciseId); QMultiHash::iterator findParticipant(const ParticipantInfoStruct &pis); @@ -78,6 +79,7 @@ private Q_SLOTS: void onModifyEquipmentTypeDataReply(const Core::FunctionReplyObject &replyObject) override; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; QHash m_exerciseHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.cpp index 24107207e..162f4fbaa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.cpp @@ -54,7 +54,7 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::convert(const ParticipantManagement::Partici pi.exerciseId = exerciseId; pi.forceId = part.partyId(); - DEBUG_LOG() << "Force Id = " << pi.forceId; + DEBUG_LOG(m_logger) << "Force Id = " << pi.forceId; pi.info = QString::fromStdString(part.info()); pi.parentPlayerId = part.superiorId(); @@ -67,10 +67,10 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::convert(const ParticipantManagement::Partici { pi.equipTypeId = partType.equipmentTypeId(); pi.typeClassId = convert(partType.typeClass()); - TRACE_LOG() << "Found participant type with id " << part.typeId() << ", " << pi.typeClassId << ", " << pi.equipTypeId; + TRACE_LOG(m_logger) << "Found participant type with id " << part.typeId() << ", " << pi.typeClassId << ", " << pi.equipTypeId; } else - WARNING_LOG() << "Can not find participant type with id " << part.typeId(); + WARNING_LOG(m_logger) << "Can not find participant type with id " << part.typeId(); pi.typeId = part.typeId(); pi.isDeleted = part.isDeleted(); @@ -80,8 +80,8 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::convert(const ParticipantManagement::Partici pi.symbolColor = party.color(); - DEBUG_LOG() << "party.name: " << pi.forceName; - DEBUG_LOG() << "symbolColor: " << pi.symbolColor << ", playerId: " << pi.playerId << ", exerciseId: " << exerciseId; + DEBUG_LOG(m_logger) << "party.name: " << pi.forceName; + DEBUG_LOG(m_logger) << "symbolColor: " << pi.symbolColor << ", playerId: " << pi.playerId << ", exerciseId: " << exerciseId; return pi; @@ -97,7 +97,7 @@ IWMS2ECC::exerciseMap IWMS2ECC_Impl::getExercises() const retMap.insert(ex.id(), convert(ex)); } - INFO_LOG() << "IN getExercises, exMap.size(): " << exMap.size() + INFO_LOG(m_logger) << "IN getExercises, exMap.size(): " << exMap.size() << ", retMap.size: " << retMap.size(); return retMap; } @@ -131,12 +131,12 @@ QMap IWMS2ECC_Impl::getAllPlayers(int exerciseId) con QMap IWMS2ECC_Impl::getAllParticipants(int exerciseId) const { - INFO_LOG() << "IN getAllParticipants"; + INFO_LOG(m_logger) << "IN getAllParticipants"; QMap retMap; const QMap map = m_exercisesHandler->getParticipants(exerciseId); - INFO_LOG() << "getAllPlayers map.size() : " << map.size(); + INFO_LOG(m_logger) << "getAllPlayers map.size() : " << map.size(); for (const ParticipantManagement::Participant &exePart : map) { @@ -171,8 +171,8 @@ IWMS2ECC::RegisterReturnValue IWMS2ECC_Impl::registerPlayer(int playerId, int eq void IWMS2ECC_Impl::onRegistrationReturnValue(int exerciseId, qint32 participantId, ParticipantManagement::RegisterReturnValue retValue) { - INFO_LOG() << "IN onRegistrationReturnValue "; - INFO_LOG() << "exerciseId: " << exerciseId << ", participantId: " << participantId << ", retValue: " << retValue; + INFO_LOG(m_logger) << "IN onRegistrationReturnValue "; + INFO_LOG(m_logger) << "exerciseId: " << exerciseId << ", participantId: " << participantId << ", retValue: " << retValue; emit registrationReturnValue(exerciseId, participantId, convert(retValue)); } @@ -187,12 +187,12 @@ IWMS2ECC::UnregisterReturnValue IWMS2ECC_Impl::unregister(int equipNo, int exerc IWMS2ECC::PlayerInfo IWMS2ECC_Impl::getPlayerInfo(int playerId, int exerciseId) { - DEBUG_LOG() << "IN getPlayerInfo: " + DEBUG_LOG(m_logger) << "IN getPlayerInfo: " << " playerId = " << playerId << ", exerciseId = " << exerciseId; if (playerId <= 0 || exerciseId <= 0) { - WARNING_LOG() << "Invalid Player (0,0)"; + WARNING_LOG(m_logger) << "Invalid Player (0,0)"; IWMS2ECC::PlayerInfo pi; pi.playerState = NOT_FOUND; return pi; @@ -217,7 +217,7 @@ IWMS2ECC::PlayerInfo IWMS2ECC_Impl::getPlayerInfo(int playerId, int exerciseId) pi.playerState = FOUND; - INFO_LOG() << "Player (" << pi.playerId << "," << exerciseId << ") found: " + INFO_LOG(m_logger) << "Player (" << pi.playerId << "," << exerciseId << ") found: " << "AssignState: " << pi.assignState << ", forceName: " << pi.forceName; return pi; @@ -230,7 +230,7 @@ QMap IWMS2ECC_Impl::getEquipRequirements(int exerciseId) const const QMap map = m_exercisesHandler->getParticipants(exerciseId); - INFO_LOG() << "getAllPlayers map.size() : " << map.size(); + INFO_LOG(m_logger) << "getAllPlayers map.size() : " << map.size(); QMap reqPartTypes; @@ -250,17 +250,17 @@ QMap IWMS2ECC_Impl::getEquipRequirements(int exerciseId) const const ParticipantManagement::Type partType = m_exercisesHandler->participantType(typeId); if (partType.id() == typeId) { - DEBUG_LOG() << "Key: " << typeId; + DEBUG_LOG(m_logger) << "Key: " << typeId; ParticipantManagement::TypeClass typeClass = partType.typeClass(); int equipTypeId = partType.equipmentTypeId(); if (typeClass != ParticipantManagement::TypeClass_def::Unit && typeClass != ParticipantManagement::TypeClass_def::SupportUnit) { reqEquipTypes[equipTypeId] = cIt.value(); - DEBUG_LOG() << "equipTypeId: " << equipTypeId << ", amount: " << cIt.value(); + DEBUG_LOG(m_logger) << "equipTypeId: " << equipTypeId << ", amount: " << cIt.value(); } } else - WARNING_LOG() << "Can not find participant type with id " << typeId; + WARNING_LOG(m_logger) << "Can not find participant type with id " << typeId; } return reqEquipTypes; } @@ -408,7 +408,7 @@ bool IWMS2ECC_Impl::setEquipmentType(const EquipmentType &et) bool IWMS2ECC_Impl::setEquipmentTypes(const equipTypeMap &map) { - INFO_LOG() << "IN setEquipmentTypes: equipMap.size: " << map.size(); + INFO_LOG(m_logger) << "IN setEquipmentTypes: equipMap.size: " << map.size(); std::vector vEquipTypes; vEquipTypes.reserve(map.size()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.h index 939a5d547..8bf8a9110 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/interface_wms2ecc_impl.h @@ -54,6 +54,8 @@ Q_SIGNALS: void registrationReturnValue(int exerciseId, qint32 participantId, IWMS2ECC::RegisterReturnValue retValue); protected: + +NGL::INGLLogger &m_logger; QMap getAllParticipants(int exerciseId) const; QByteArray getSymbol(int symbolId, int exerciseId, const QColor &color, int role) const; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.cpp index 23995173b..5d9352f92 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.cpp @@ -6,9 +6,8 @@ namespace WarehouseManagement { -MainHandler::MainHandler() - : QObject() -{} +MainHandler::MainHandler() : QObject(), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.h index 7a0104468..f9d13e211 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WarehouseManagement/main_handler.h @@ -28,6 +28,8 @@ public: bool init(int domainId); private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_exercisesHandler; std::shared_ptr m_wms2ecc; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.cpp index 476ffcce9..f1b8df246 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.cpp @@ -8,17 +8,16 @@ namespace WirelessLocationSystem { -DdsHandler::DdsHandler(int domainId, int exerciseId) - : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, exerciseId)) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); +DdsHandler::DdsHandler(int domainId, int exerciseId) : m_ddsConnector(new DDSConnector::DdsConnector(domainId, IDL::PartitionType::Global, exerciseId)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.h index 5c04804c2..b15637c53 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/dds_handler.h @@ -31,6 +31,7 @@ public: } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.cpp index c7aab99b9..9dd977bd3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.cpp @@ -6,9 +6,8 @@ namespace WirelessLocationSystem { -IsmHandler::IsmHandler(QObject *parent) - : QObject(parent) -{} +IsmHandler::IsmHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} bool IsmHandler::init(MainHandler *mainHandler) { @@ -21,7 +20,7 @@ bool IsmHandler::init(MainHandler *mainHandler) if (!m_dtcIsm->enableMainStructureElement()) { - ERROR_LOG() << "Can not read data from ISM"; + ERROR_LOG(m_logger) << "Can not read data from ISM"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.h index 42c412c9e..08b8dc72d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/ism_handler.h @@ -31,6 +31,7 @@ private Q_SLOTS: private: + NGL::INGLLogger &m_logger; QHash m_mainStructureElements; QHash m_externalWlsId2MseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.cpp index 6ec328404..845e518f1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.cpp @@ -8,10 +8,9 @@ namespace WirelessLocationSystem { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) - , m_ddsHandler(nullptr) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent) + , m_ddsHandler(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.h index 8433097b8..58d99c19e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/main_handler.h @@ -46,6 +46,8 @@ public: } private: + +NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_wlsParticipantHandler; std::shared_ptr m_wlsHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.cpp index e49d77552..497338571 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.cpp @@ -21,11 +21,10 @@ namespace WirelessLocationSystem const char *exerciseIdProperty = "exerciseId"; -WebSocketHandler::WebSocketHandler(QObject *parent) - : QObject(parent) +WebSocketHandler::WebSocketHandler(QObject *parent) : QObject(parent) , m_webSocketServer(new QWebSocketServer(QStringLiteral("WLS"), QWebSocketServer::NonSecureMode, this)) - , m_basePoint(LtsCoordTrans::UtmCoordinate::fromMgrs(Settings::wlsMgrsBasePoint())) -{} + , m_basePoint(LtsCoordTrans::UtmCoordinate::fromMgrs(Settings::wlsMgrsBasePoint())), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} WebSocketHandler::~WebSocketHandler() {} @@ -37,7 +36,7 @@ bool WebSocketHandler::init(std::shared_ptr wlsHandler, { if (!m_webSocketServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Can not listen on port " << listenPort << " - aborting" << m_webSocketServer->errorString(); + WARNING_LOG(m_logger) << "Can not listen on port " << listenPort << " - aborting" << m_webSocketServer->errorString(); return false; } @@ -58,7 +57,7 @@ void WebSocketHandler::onNewConnection() if (ws == nullptr) return; - DEBUG_LOG() << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); + DEBUG_LOG(m_logger) << "New websocket connection from " << ws->peerAddress().toString() << ":" << ws->peerPort(); connect(ws, &QWebSocket::textMessageReceived, this, &WebSocketHandler::onTextMessageReceived); @@ -68,14 +67,14 @@ void WebSocketHandler::onNewConnection() connect(this, &WebSocketHandler::signalBroadcastMessage, ws, [this, ws](const QString &msg, int exerciseId) { - DEBUG_LOG() << "broadcast: exercise property is valid? " << ws->property(exerciseIdProperty).isValid() << " for " << ws->peerPort(); + DEBUG_LOG(m_logger) << "broadcast: exercise property is valid? " << ws->property(exerciseIdProperty).isValid() << " for " << ws->peerPort(); bool exerciseIdAvailable = false; int wsExerciseId = ws->property(exerciseIdProperty).toInt(&exerciseIdAvailable); if (exerciseIdAvailable && wsExerciseId != exerciseId) { - DEBUG_LOG() << "broadcast: websocket has " << wsExerciseId << ", but " << exerciseId << " was requested"; + DEBUG_LOG(m_logger) << "broadcast: websocket has " << wsExerciseId << ", but " << exerciseId << " was requested"; return; } @@ -102,7 +101,7 @@ void WebSocketHandler::sendTelegramInternal(const TrainingAreaBase::TetraIcd::Tr const QString jsonStr(QString::fromUtf8(QJsonDocument(obj).toJson(QJsonDocument::Compact))); - DEBUG_LOG() << "jsonStr: " << jsonStr; + DEBUG_LOG(m_logger) << "jsonStr: " << jsonStr; emit signalBroadcastMessage(jsonStr, exerciseId); } @@ -139,7 +138,7 @@ void WebSocketHandler::onTextMessageReceived(const QString &baJson) { using namespace TrainingAreaBase::TetraIcd; - TRACE_LOG() << "WebSocketHandler::onTextMessageReceived: " << baJson; + TRACE_LOG(m_logger) << "WebSocketHandler::onTextMessageReceived: " << baJson; QWebSocket *ws = qobject_cast(sender()); if (ws == nullptr) @@ -153,7 +152,7 @@ void WebSocketHandler::onTextMessageReceived(const QString &baJson) if (err.error != QJsonParseError::NoError) { - ERROR_LOG() << "received invalid json from websocket at " << err.offset << ": " << err.errorString(); + ERROR_LOG(m_logger) << "received invalid json from websocket at " << err.offset << ": " << err.errorString(); return; } @@ -172,7 +171,7 @@ void WebSocketHandler::onTextMessageReceived(const QString &baJson) const QJsonValue typeId(obj.value(QStringLiteral("typeId"))); if (!typeId.isDouble()) { - ERROR_LOG() << "Can not read type id: " << baJson; + ERROR_LOG(m_logger) << "Can not read type id: " << baJson; return; } @@ -191,7 +190,7 @@ void WebSocketHandler::onTextMessageReceived(const QString &baJson) { int exerciseId = ExerciseStateData::fromJson(data).exerciseId; ws->setProperty(exerciseIdProperty, exerciseId); - DEBUG_LOG() << "set exercise id " << exerciseId << " for ws with peer port " << ws->peerPort(); + DEBUG_LOG(m_logger) << "set exercise id " << exerciseId << " for ws with peer port " << ws->peerPort(); sendParticipantConnectionStates(exerciseId); break; } @@ -202,14 +201,14 @@ void WebSocketHandler::onTextMessageReceived(const QString &baJson) m_participantHandler->handleWlsBinarySfmData(WlsBinarySfmData::fromJson(data)); break; default: - WARNING_LOG() << "Handler for telegram Id " << typeId.toInt() + WARNING_LOG(m_logger) << "Handler for telegram Id " << typeId.toInt() << " not yet implemented (" << baJson << ")"; return; } } catch (const std::exception &e) { - WARNING_LOG() << "Could not parse json: " << e.what() << " (" << baJson << ")"; + WARNING_LOG(m_logger) << "Could not parse json: " << e.what() << " (" << baJson << ")"; return; } } @@ -271,16 +270,16 @@ void WebSocketHandler::setPosition(T &tele, const WlsParticipant *participant) void WebSocketHandler::sendPosition(const WlsParticipant *participant) { - INFO_LOG() << "sendPosition equipmentNumber=" << participant->equipmentNumber(); + INFO_LOG(m_logger) << "sendPosition equipmentNumber=" << participant->equipmentNumber(); if (!participant || !participant->positionIsValid() || participant->equipmentNumber() == 0) { - INFO_LOG() << "not send - participant is not yet fully initialized"; + INFO_LOG(m_logger) << "not send - participant is not yet fully initialized"; return; } if (participant->isGpsMode()) { - INFO_LOG() << "not send - participant is in gps mode"; + INFO_LOG(m_logger) << "not send - participant is in gps mode"; return; } TrainingAreaBase::TetraIcd::PositionReport posValue; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.h index 0b323e729..45f3b6b69 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/web_socket_handler.h @@ -62,6 +62,7 @@ signals: void signalBroadcastMessage(const QString &msg, int exerciseId); private: + NGL::INGLLogger &m_logger; template void setPosition(T &tele, const WlsParticipant *participant); void sendTelegramInternal(const TrainingAreaBase::TetraIcd::TrainingAreaTelegram *data, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.cpp index 1ea726e43..b562530a3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.cpp @@ -32,11 +32,10 @@ static inline QByteArray escapeData(const QByteArray &bufferData) return ret; } -WlsHandler::WlsHandler(QObject *parent) - : QObject(parent) -{ +WlsHandler::WlsHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { if (Settings::wlsMgrsBasePoint().size() <= 15) - WARNING_LOG() << "WLS basepoint is not defined precise enough: " << Settings::wlsMgrsBasePoint(); + WARNING_LOG(m_logger) << "WLS basepoint is not defined precise enough: " << Settings::wlsMgrsBasePoint(); } WlsHandler::~WlsHandler() @@ -50,14 +49,14 @@ bool WlsHandler::init(WlsParticipantHandler *participantHandler, { m_participantHandler = participantHandler; m_wsHandler = wsHandler; - INFO_LOG() << "WlsHandler::init"; + INFO_LOG(m_logger) << "WlsHandler::init"; delete m_tcpServer; m_tcpServer = new QTcpServer(this); connect(m_tcpServer, &QTcpServer::newConnection, this, &WlsHandler::onIncomingConnection); if (!m_tcpServer->listen(QHostAddress::Any, listenPort)) { - WARNING_LOG() << "Error listening on port " << listenPort; + WARNING_LOG(m_logger) << "Error listening on port " << listenPort; return false; } @@ -87,7 +86,7 @@ bool WlsHandler::sendWlsMessage(const QByteArray &tagId, WlsTelegramId telId, co auto itSocket = m_tcpSocketByTagId.constFind(tagId); if (itSocket == m_tcpSocketByTagId.constEnd()) { - ERROR_LOG() << "Can't find a TCP-socket for tag id: " << tagId; + ERROR_LOG(m_logger) << "Can't find a TCP-socket for tag id: " << tagId; return false; } @@ -112,7 +111,7 @@ bool WlsHandler::sendWlsMessage(const QByteArray &tagId, WlsTelegramId telId, co data.append(s_endMark); (*itSocket)->write(data); - DEBUG_LOG() << "Sending telegram to wls: " << escapeData(data); + DEBUG_LOG(m_logger) << "Sending telegram to wls: " << escapeData(data); } (*itSocket)->flush(); return true; @@ -120,7 +119,7 @@ bool WlsHandler::sendWlsMessage(const QByteArray &tagId, WlsTelegramId telId, co void WlsHandler::onIncomingConnection() { - INFO_LOG() << "WlsHandler::onIncomingConnection"; + INFO_LOG(m_logger) << "WlsHandler::onIncomingConnection"; QTcpSocket *tcpSocket = m_tcpServer->nextPendingConnection(); if (!tcpSocket) return; @@ -145,7 +144,7 @@ void WlsHandler::onIncomingData() return; auto &tcpBuffer = m_tcpSockets[s]; const QByteArray bufferData = tcpBuffer + s->readAll(); - TRACE_LOG() << "WlsHandler::onIncomingData bufferData='" << escapeData(bufferData) << "'"; + TRACE_LOG(m_logger) << "WlsHandler::onIncomingData bufferData='" << escapeData(bufferData) << "'"; tcpBuffer = parseBuffer(bufferData, s); @@ -156,7 +155,7 @@ void WlsHandler::onSocketDisconnected() QTcpSocket *s = qobject_cast(sender()); if (!s) return; - INFO_LOG() << "Socket disconnected"; + INFO_LOG(m_logger) << "Socket disconnected"; m_tcpSockets.remove(s); @@ -202,7 +201,7 @@ void WlsHandler::parseWlsTelegram(const QByteArray &baTele, QTcpSocket *socket) const WlsTelegramId telegramId = static_cast(parts.at(0).toInt()); const QDateTime timestamp = QDateTime::fromString(QString::fromUtf8(parts.at(1)), QStringLiteral("yyyy-MM-dd hh:mm:ss.zzz")); if (telegramId != WlsTelegramId::PlayerPosition) - DEBUG_LOG() << "Handling " << telegramId + DEBUG_LOG(m_logger) << "Handling " << telegramId << ", data: '" << escapeData(baTele) << "'"; bool bOk = true; switch (telegramId) @@ -220,11 +219,11 @@ void WlsHandler::parseWlsTelegram(const QByteArray &baTele, QTcpSocket *socket) bOk = handleDataPayloadMobileToHost(parts); break; case WlsTelegramId::PayloadHostToMobile: - WARNING_LOG() << "Protocol error - got a message which should not be sent from Wls (PayloadHostToMobile)"; + WARNING_LOG(m_logger) << "Protocol error - got a message which should not be sent from Wls (PayloadHostToMobile)"; break; } if (!bOk) - WARNING_LOG() << "Error handling telegram: '" << baTele << "'"; + WARNING_LOG(m_logger) << "Error handling telegram: '" << baTele << "'"; } bool WlsHandler::findNextSyncStartByte(const QByteArray &buffer, int &iCurReadPos) @@ -257,7 +256,7 @@ bool WlsHandler::handleVersionsinformation(const QList &data) { if (data.size() < 4) return false; - DEBUG_LOG() << "TX(WLS): Version = " << data.at(3); + DEBUG_LOG(m_logger) << "TX(WLS): Version = " << data.at(3); return true; } @@ -290,7 +289,7 @@ bool WlsHandler::handlePlayerPosition(const QList &data, const QDate pos.z += m_wlsZOffset; p->setPosition(pos, timestamp.toMSecsSinceEpoch()); - INFO_LOG() << p->getPlayerIdStr() << ": handlePlayerPosition" + INFO_LOG(m_logger) << p->getPlayerIdStr() << ": handlePlayerPosition" << " x=" << pos.x << ", y=" << pos.y << ", z=" << pos.z << ", wlsAreaId=" << pos.wlsAreaId << ", wlsBuildingId=" << pos.wlsBuildingId @@ -324,7 +323,7 @@ bool WlsHandler::handlePlayerState(const QList &data) p->voltage = voltage / 10.; - INFO_LOG() << p->getPlayerIdStr() << ": handlePlayerState" + INFO_LOG(m_logger) << p->getPlayerIdStr() << ": handlePlayerState" << " timeout=" << timeout << " ,tacticalState=" << tacticalState << " ,voltage=" << p->voltage; @@ -340,7 +339,7 @@ bool WlsHandler::checkPayloadIsHex(const QByteArray &payload) const (c < 'a' || c > 'f') && (c < 'A' || c > 'F')) { - WARNING_LOG() << "Payload data is not hex coded ..."; + WARNING_LOG(m_logger) << "Payload data is not hex coded ..."; return false; } } @@ -360,7 +359,7 @@ bool WlsHandler::handleDataPayloadMobileToHost(const QList &data) QSharedPointer msg = SfmMessageConverter::generateRxMessage(payload); if (!msg) { - WARNING_LOG() << "Can not convert payload to SfmMessage ... "; + WARNING_LOG(m_logger) << "Can not convert payload to SfmMessage ... "; return false; } @@ -387,7 +386,7 @@ bool WlsHandler::handleDataPayloadMobileToHost(const QList &data) case SfmMessage::MsgId::LicenseState: case SfmMessage::MsgId::TacticalState: default: - WARNING_LOG() << "RX(WLS): MessageID(" << static_cast(msg->getId()) << ")"; + WARNING_LOG(m_logger) << "RX(WLS): MessageID(" << static_cast(msg->getId()) << ")"; break; } return true; @@ -397,7 +396,7 @@ bool WlsHandler::handleDataPayloadMobileToHost(const QList &data) void WlsHandler::handlePayload(WlsParticipant *participant, const SfmMsgEquipmentId *sfmTele) { const int equipmentNumber = sfmTele->getEquipmentNumber(); - INFO_LOG() << participant->getPlayerIdStr() << ": handlePayload" + INFO_LOG(m_logger) << participant->getPlayerIdStr() << ": handlePayload" << " - new equipmentNumber = " << equipmentNumber; if (participant->equipmentNumber() == 0 || participant->equipmentNumber() != equipmentNumber) @@ -414,7 +413,7 @@ void WlsHandler::handlePayload(WlsParticipant *participant, const SfmMsgRequestG void WlsHandler::handlePayload(WlsParticipant *participant, const SfmMsgSfmRestart_rx *sfmTele) { - WARNING_LOG() << "Restart notification ... " << participant->tagId(); + WARNING_LOG(m_logger) << "Restart notification ... " << participant->tagId(); Q_UNUSED(sfmTele) participant->setWlsZone(-1); @@ -441,7 +440,7 @@ void WlsHandler::sendGpsMode(WlsParticipant *participant) return; SfmMsgGpsControl_tx msg; msg.setGpsOn(participant->isGpsMode()); - INFO_LOG() << participant->getPlayerIdStr() << ": sendGpsMode" + INFO_LOG(m_logger) << participant->getPlayerIdStr() << ": sendGpsMode" << " GpsMode = " << participant->isGpsMode(); sendWlsMessage(participant->tagId(), msg); } @@ -452,7 +451,7 @@ bool WlsHandler::parseDoubleCm(const QByteArray &data, double &num) const num = data.toDouble(&bOk); if (!bOk) { - WARNING_LOG() << "Error parsing floating point number '" << data << "'"; + WARNING_LOG(m_logger) << "Error parsing floating point number '" << data << "'"; return false; } num /= 100; @@ -465,7 +464,7 @@ bool WlsHandler::parseInteger(const QByteArray &data, int &num) const num = data.toInt(&bOk); if (!bOk) { - WARNING_LOG() << "Error parsing number '" << data << "'"; + WARNING_LOG(m_logger) << "Error parsing number '" << data << "'"; return false; } return true; @@ -493,7 +492,7 @@ WlsParticipant *WlsHandler::participantFromTagId(const QByteArray &tagId, bool b SfmMsgRequestEquipmentId_tx getEqId; - INFO_LOG() << "Requesting Equipment number for tag " << tagId; + INFO_LOG(m_logger) << "Requesting Equipment number for tag " << tagId; sendWlsMessage(tagId, getEqId); p->lastEquipmentNumberRequest = tNow; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.h index 24b16388b..b48d3cf0b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_handler.h @@ -17,6 +17,7 @@ class WlsHandler : public QObject { Q_OBJECT private: + NGL::INGLLogger &m_logger; enum class WlsTelegramId { VersionInformation = 0, @@ -53,6 +54,7 @@ private Q_SLOTS: void onIncomingData(); void onSocketDisconnected(); private: + NGL::INGLLogger &m_logger; QByteArray parseBuffer(const QByteArray &buffer, QTcpSocket *socket); void parseWlsTelegram(const QByteArray &baTele, QTcpSocket *socket); static bool findNextSyncStartByte(const QByteArray &buffer, int &iCurReadPos); @@ -74,6 +76,7 @@ private: WlsParticipant *participantFromTagId(const QByteArray &tagId, bool bAskForEqIdIfNew = true); private: + NGL::INGLLogger &m_logger; QTcpServer *m_tcpServer = nullptr; WlsParticipantHandler *m_participantHandler = nullptr; WebSocketHandler *m_wsHandler = nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.cpp index 592a0e534..4370ee9d5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.cpp @@ -14,10 +14,9 @@ static constexpr int s_maxWlsRetryCount = 3; namespace WirelessLocationSystem { -WlsParticipant::WlsParticipant(QObject *parent) - : QObject(parent) - , m_wlsTeleTimeoutTimer(new QTimer(this)) -{ +WlsParticipant::WlsParticipant(QObject *parent) : QObject(parent) + , m_wlsTeleTimeoutTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_wlsTeleTimeoutTimer->setSingleShot(true); m_wlsTeleTimeoutTimer->setTimerType(Qt::VeryCoarseTimer); m_wlsTeleTimeoutTimer->setInterval(s_dataCommunicationAliveTimeout); @@ -54,12 +53,12 @@ void WlsParticipant::setPosition(const RelativePosition &newPosition, if (tsCurrentPos == m_lastSeenPosition || (((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()) && comparePos(m_relativePosition, newPosition))) { - DEBUG_LOG() << "Check for pos Update"; - DEBUG_LOG() << "Is Outdated= " <<((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()); + DEBUG_LOG(m_logger) << "Check for pos Update"; + DEBUG_LOG(m_logger) << "Is Outdated= " <<((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()); if (((tsCurrentPos - m_lastSeenPosition) <= Settings::deadPosTimeout()) && comparePos(m_relativePosition, newPosition)) { - DEBUG_LOG() << "Same Position or not older than 5000msecs " << tsCurrentPos - m_lastSeenPosition; + DEBUG_LOG(m_logger) << "Same Position or not older than 5000msecs " << tsCurrentPos - m_lastSeenPosition; return; } const qint64 tsNow = QDateTime::currentMSecsSinceEpoch(); @@ -99,7 +98,7 @@ void WlsParticipant::checkGpsOnOffTimeoutTimer(qint64 tNow) if (m_lastSeenDataCommunication > tNow - s_maxWlsRetryCount * s_dataCommunicationAliveTimeout) return; - DEBUG_LOG() << getPlayerIdStr() << ": lastSeenDataCommunication: " + DEBUG_LOG(m_logger) << getPlayerIdStr() << ": lastSeenDataCommunication: " << m_lastSeenDataCommunication << ", now: " << (tNow - s_maxWlsRetryCount * s_dataCommunicationAliveTimeout) << " (" << tNow << "), " @@ -141,14 +140,14 @@ void WlsParticipant::setWlsZone(int newWlsZone) m_dataCommunication = (newWlsZone > 3) ? DataCommunication::On : DataCommunication::Off; - INFO_LOG() << getPlayerIdStr() << ": wlsZone old: " << m_wlsZone << ", new: " << newWlsZone + INFO_LOG(m_logger) << getPlayerIdStr() << ": wlsZone old: " << m_wlsZone << ", new: " << newWlsZone << ", new gps mode: " << m_gpsMode << ", new data comm mode: " << m_dataCommunication << ", " << this; } else { - INFO_LOG() << getPlayerIdStr() << ": Reset zone/data comunication status - sfm was restarted"; + INFO_LOG(m_logger) << getPlayerIdStr() << ": Reset zone/data comunication status - sfm was restarted"; m_gpsMode = GpsMode::On; m_dataCommunication = DataCommunication::Unknown; m_lastSeenPosition = -1; @@ -169,7 +168,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele) { if (!isRecvCounterCorrect(sfmTele->sendCounter())) { - WARNING_LOG() << "Got data telegram with counter " << int(sfmTele->sendCounter()) + WARNING_LOG(m_logger) << "Got data telegram with counter " << int(sfmTele->sendCounter()) << " last one was " << int(m_lastRecvCounter) << " - ignoring"; return false; } @@ -179,7 +178,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele) { if (m_sfmRxPayloadFragmentNumber + 1 != sfmTele->fragmentNumber()) { - WARNING_LOG() << getPlayerIdStr() << ": Missing a fragment (waiting for " + WARNING_LOG(m_logger) << getPlayerIdStr() << ": Missing a fragment (waiting for " << (m_sfmRxPayloadFragmentNumber + 1) << ", got " << sfmTele->fragmentNumber() << ")"; if (sfmTele->fragmentNumber() != 1) @@ -200,7 +199,7 @@ bool WlsParticipant::handleSfmRxData(const SfmMsgTetra_rx *sfmTele) { if (m_sfmRxPayloadFragmentNumber != 0) - WARNING_LOG() << getPlayerIdStr() + WARNING_LOG(m_logger) << getPlayerIdStr() << ": Got unfragmented telegram but currently waiting for next fragment of a fragmented telegram"; m_sfmRxPayloadFragmentNumber = 0; m_sfmRxPayloadData = sfmTele->payload(); @@ -265,7 +264,7 @@ void WlsParticipant::sendBinarySfmData(const std::vector &data) const QByteArray ba = LtsUtils::toQByteArray(data); if (!calcChunkCountAndLen(ba, chunkCount, chunkLen)) { - WARNING_LOG() << getPlayerIdStr() + WARNING_LOG(m_logger) << getPlayerIdStr() << ": Internal error calculating chunk size for payload size " << data.size(); return; } @@ -290,7 +289,7 @@ void WlsParticipant::handleWlsAck(const Acknowledge_rx *ack) if (ack->recvCounter() != m_nextSendCounter) { - WARNING_LOG() << "Got ack for telegram with counter " << int(ack->recvCounter()) + WARNING_LOG(m_logger) << "Got ack for telegram with counter " << int(ack->recvCounter()) << " but expected " << int(m_nextSendCounter) << " - ignoring"; return; } @@ -298,7 +297,7 @@ void WlsParticipant::handleWlsAck(const Acknowledge_rx *ack) { if (m_wlsQueue.isEmpty()) { - ERROR_LOG() << "got an ack but nothing was sent - something went terribly wrong - resetting send/recv counter"; + ERROR_LOG(m_logger) << "got an ack but nothing was sent - something went terribly wrong - resetting send/recv counter"; m_nextSendCounter = 0; m_lastRecvCounter = 0; return; @@ -343,7 +342,7 @@ void WlsParticipant::sendNextWlsTelegram(bool bIsResend) m_wlsQueue.clear(); return; } - WARNING_LOG() << getPlayerIdStr() + WARNING_LOG(m_logger) << getPlayerIdStr() << ": Trying to send a wls telegram but no data communication possible"; Q_ASSERT(false); @@ -364,14 +363,14 @@ void WlsParticipant::sendNextWlsTelegram(bool bIsResend) void WlsParticipant::onWlsTeleTimeout() { ++m_wlsTeleTimeoutCounter; - DEBUG_LOG() << getPlayerIdStr() + DEBUG_LOG(m_logger) << getPlayerIdStr() << ": Resend WLS connection to participant " << m_equipmentNumber << "(" << m_tagId << ")" << " m_wlsTeleTimeoutCounter =" << m_wlsTeleTimeoutCounter << " s_maxWlsRetryCount=" << s_maxWlsRetryCount; if (m_wlsTeleTimeoutCounter == s_maxWlsRetryCount) { - WARNING_LOG() << getPlayerIdStr() + WARNING_LOG(m_logger) << getPlayerIdStr() << ": Lost WLS connection to participant " << m_equipmentNumber << "(" << m_tagId << ")"; m_lastSeenDataCommunication = -1; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.h index 33c81764e..e353e9b94 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant.h @@ -102,6 +102,7 @@ public: return ret; } protected: + NGL::INGLLogger &m_logger; explicit WlsParticipant(QObject *parent = nullptr); public: void setPosition(const RelativePosition &newPosition, qint64 tsCurrentPos); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.cpp index 633ae42d5..039895ede 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.cpp @@ -10,10 +10,9 @@ namespace WirelessLocationSystem { -WlsParticipantHandler::WlsParticipantHandler(QObject *parent) - : QObject(parent) - , m_gpsOnOffTimeoutTimer(new QTimer(this)) -{ +WlsParticipantHandler::WlsParticipantHandler(QObject *parent) : QObject(parent) + , m_gpsOnOffTimeoutTimer(new QTimer(this)), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { connect(m_gpsOnOffTimeoutTimer, &QTimer::timeout, this, &WlsParticipantHandler::onGpsOnOffTimeoutTimer); m_gpsOnOffTimeoutTimer->setSingleShot(false); m_gpsOnOffTimeoutTimer->start(1000); @@ -94,7 +93,7 @@ void WlsParticipantHandler::handleWlsBinarySfmData(const TrainingAreaBase::Tetra WlsParticipant *p = m_participantsByEqId.value(data.header.equipmentNumber); if (!p) { - WARNING_LOG() << "Got binary sfm data for participant with eqId " << data.header.equipmentNumber + WARNING_LOG(m_logger) << "Got binary sfm data for participant with eqId " << data.header.equipmentNumber << " but could not find this participant!"; return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.h index 8f2da483a..b557deb88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Proxies/WirelessLocationSystem/wls_participant_handler.h @@ -39,6 +39,7 @@ public: private Q_SLOTS: void onGpsOnOffTimeoutTimer(); private: + NGL::INGLLogger &m_logger; WebSocketHandler *m_wsHandler = nullptr; WlsHandler *m_wlsHandler = nullptr; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.cpp index f05e97de3..b474774bc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.cpp @@ -44,7 +44,7 @@ AlmTests::~AlmTests() // ------------------------------------------------------------------ bool AlmTests::init(int domainId, int testId, int operatorId) { - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_operatorId = operatorId; @@ -73,7 +73,7 @@ bool AlmTests::init(int domainId, int testId, int operatorId) // ------------------------------------------------------------------ void AlmTests::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // Send FTC ConfigureAlarms and EEM Event { QTimer::singleShot(0, this, &AlmTests::tryConfigureAlarms); @@ -102,7 +102,7 @@ void AlmTests::startTest() // ------------------------------------------------------------------ void AlmTests::tryConfigureAlarms() { - INFO_LOG() << "trying to send createRequest Operator Message"; + INFO_LOG(m_logger) << "trying to send createRequest Operator Message"; std::vector alarms; alarms.resize(2); @@ -124,7 +124,7 @@ void AlmTests::tryConfigureAlarms() if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } } // tryConfigureAlarms @@ -132,7 +132,7 @@ void AlmTests::tryConfigureAlarms() // ------------------------------------------------------------------ void AlmTests::tryCreateParticipant() { - INFO_LOG() << "trying to create Participant index = " << m_participantIndex; + INFO_LOG(m_logger) << "trying to create Participant index = " << m_participantIndex; ParticipantManagement::Participant participant; switch (m_participantIndex) { @@ -153,10 +153,10 @@ void AlmTests::tryCreateParticipant() participant.partyId(5); break; } - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_dtsPpm->publish(participant)) { - ERROR_LOG() << "Error publish Participant"; + ERROR_LOG(m_logger) << "Error publish Participant"; failExit(); } m_participantIndex++; @@ -165,7 +165,7 @@ void AlmTests::tryCreateParticipant() // ------------------------------------------------------------------ void AlmTests::tryConfigureAlarmsList() { - INFO_LOG() << "trying to send createRequest Operator Message"; + INFO_LOG(m_logger) << "trying to send createRequest Operator Message"; std::vector alarms; alarms.resize(2); @@ -188,7 +188,7 @@ void AlmTests::tryConfigureAlarmsList() if (!m_ftcAlm->configureAlarmsRequest(ConfigureAlarmsRequest(alarms, m_operatorId, participantIds, globalEvent, remove), this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } } // tryConfigureAlarmsList @@ -196,7 +196,7 @@ void AlmTests::tryConfigureAlarmsList() // ------------------------------------------------------------------ void AlmTests::trySendEvent() { - INFO_LOG() << "trying to send ParticipantEvent"; + INFO_LOG(m_logger) << "trying to send ParticipantEvent"; ExerciseEventManagement::Event pe; @@ -215,10 +215,10 @@ void AlmTests::trySendEvent() QString properties = QString::fromUtf8(QJsonDocument(obj).toJson()); pe.properties(properties.toStdString()); - DEBUG_LOG() << "Publishing EEM Event"; + DEBUG_LOG(m_logger) << "Publishing EEM Event"; if (!m_dtsEem->publish(pe)) { - ERROR_LOG() << "Error publish EEM Event"; + ERROR_LOG(m_logger) << "Error publish EEM Event"; failExit(); } } @@ -226,10 +226,10 @@ void AlmTests::trySendEvent() // ------------------------------------------------------------------ void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "onConfigureAlarmsReply, error = " << replyObject.error(); + INFO_LOG(m_logger) << "onConfigureAlarmsReply, error = " << replyObject.error(); if (replyObject.error()) { - ERROR_LOG() << "Error ConfigureAlarms - aborting"; + ERROR_LOG(m_logger) << "Error ConfigureAlarms - aborting"; failExit(); } } // onConfigureAlarmsReply @@ -237,11 +237,11 @@ void AlmTests::onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObje // ------------------------------------------------------------------ void AlmTests::checkAlarm() { - INFO_LOG() << "checkAlarm"; + INFO_LOG(m_logger) << "checkAlarm"; m_dtcAlm->waitForHistoricalDataNotification(); qint32 id = 0; AlarmManagement::Notification notification = m_dtcAlm->notification(id); - INFO_LOG() << "Recived AlarmManagement::Notification: " << notification + INFO_LOG(m_logger) << "Recived AlarmManagement::Notification: " << notification << " testId: " << m_testId; switch (m_testId) @@ -249,12 +249,12 @@ void AlmTests::checkAlarm() case 1: case 2: case 3: - INFO_LOG() << "ExitSuccess"; + INFO_LOG(m_logger) << "ExitSuccess"; ExitSuccess(); break; default: // nothing - INFO_LOG() << "failExit"; + INFO_LOG(m_logger) << "failExit"; failExit(); break; } @@ -270,7 +270,7 @@ void AlmTests::failExit() // ------------------------------------------------------------------ void AlmTests::ExitSuccess() { - DEBUG_LOG() << "SUCCESS"; + DEBUG_LOG(m_logger) << "SUCCESS"; m_bTestsSuccessful = true; QTimer::singleShot(0, qApp, &QCoreApplication::quit); } // ExitSuccess diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.h index 8274e16a0..df00cd96b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/ModuleTests/alm_tests.h @@ -46,6 +46,7 @@ protected Q_SLOTS: void ExitSuccess(); protected: + NGL::INGLLogger &m_logger; void onConfigureAlarmsReply(const Core::FunctionReplyObject &replyObject) override final; private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.cpp index 44c084a53..03a81bb64 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.cpp @@ -16,14 +16,14 @@ namespace AlarmManagement DdsHandler::DdsHandler(const std::shared_ptr &ddsConnector) : m_ddsConnector(ddsConnector) { - DEBUG_LOG() << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << m_ddsConnector->getDomainId() << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -40,34 +40,34 @@ bool DdsHandler::init(const QStringList &qosFileList) m_dtsAlm = AlarmManagement::Interface::Dts::create(m_ddsConnector); bool bRet = m_dtsAlm->enableAll(); - INFO_LOG() << "Dts initialised"; + INFO_LOG(m_logger) << "Dts initialised"; m_dtcAlm = AlarmManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_dtcAlm->enableAcknowledgeSOSInAllExercises(); - INFO_LOG() << "Dts initialised"; + INFO_LOG(m_logger) << "Dts initialised"; m_ftsAlm = AlarmManagement::Interface::Fts::create(m_ddsConnector); bRet &= m_ftsAlm->enableAll(); - INFO_LOG() << "Fts initialised"; + INFO_LOG(m_logger) << "Fts initialised"; m_dtcEem = ExerciseEventManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_dtcEem->enableEvent(); - INFO_LOG() << "Dtc EEM initialised"; + INFO_LOG(m_logger) << "Dtc EEM initialised"; m_ftcMrk = MarkerManagement::Interface::Ftc::create(m_ddsConnector); bRet &= m_ftcMrk->enableMarkerModify(); - INFO_LOG() << "Ftc MRK initialised"; + INFO_LOG(m_logger) << "Ftc MRK initialised"; m_dtcPpm = ParticipantManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_dtcPpm->enableParticipant(); - INFO_LOG() << "Dtc PPM initialised"; + INFO_LOG(m_logger) << "Dtc PPM initialised"; m_exmDtc = ExerciseManagement::Interface::Dtc::create(m_ddsConnector); bRet &= m_exmDtc->enableExercise(); m_dtcTab = TrainingAreaBase::Interface::Dtc::create(m_ddsConnector); bRet &= m_dtcTab->enableEmergencyCall(); - INFO_LOG() << "Dtc TAB initialised"; + INFO_LOG(m_logger) << "Dtc TAB initialised"; m_dtsEmergencyCallPublisher = std::make_shared(m_ddsConnector->getDomainParticipant(), @@ -77,7 +77,7 @@ bool DdsHandler::init(const QStringList &qosFileList) m_dtsEmergencyCallPublisher->getDdsPublisher(), DDS::Helper::getShortTopicName(DDS::topic_type_name::value())); - INFO_LOG() << "Dtc TAB initialised"; + INFO_LOG(m_logger) << "Dtc TAB initialised"; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.h index 036a033fe..c730377a6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/dds_handler.h @@ -49,6 +49,7 @@ public: qint64 currentPartitionTime() const; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_dtcCore; std::shared_ptr m_topicLockMaster; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.cpp index 616a18af9..7b25b8e57 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.cpp @@ -51,7 +51,7 @@ HandlerConfigureAlarms::~HandlerConfigureAlarms() bool HandlerConfigureAlarms::init() { - INFO_LOG() << "Start HandlerConfigureAlarms."; + INFO_LOG(m_logger) << "Start HandlerConfigureAlarms."; auto dtcEem = m_mainHandler->dds()->dtcEem(); @@ -61,7 +61,7 @@ bool HandlerConfigureAlarms::init() // publish data from db-table 'alm_config' auto cb = [this](const Database::AlmConfig & data) { - DEBUG_LOG() << "restore AlarmConfig from DB data: id=" << data.id + DEBUG_LOG(m_logger) << "restore AlarmConfig from DB data: id=" << data.id << " operatorId=" << data.operatorId << " participantId=" << data.participantId.toInt() << " global=" << data.global @@ -75,7 +75,7 @@ bool HandlerConfigureAlarms::init() }; if (!m_mainHandler->db()->select(cb)) { - ERROR_LOG() << "Error reading data from database 'alm_config'!"; + ERROR_LOG(m_logger) << "Error reading data from database 'alm_config'!"; return false; } @@ -87,7 +87,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId, int participantId, int eventTypeId) { - DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size() + DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size() << " operatorId=" << operatorId << " participantId=" << participantId << " eventTypeId=" << eventTypeId; @@ -97,7 +97,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId, while (i.hasNext()) { i.next(); - DEBUG_LOG() << "key= " << i.key() << ": " + DEBUG_LOG(m_logger) << "key= " << i.key() << ": " << " operatorId=" << i.value().operatorId << " participantId=" << i.value().participantId.toInt() << " eventTypeId=" << i.value().eventTypeId.underlying(); @@ -106,7 +106,7 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId, && (eventTypeId == ProjectDataManagement::EventType_def::Unknown || eventTypeId == i.value().eventTypeId.underlying())) { const int key = i.key(); - DEBUG_LOG() << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId; + DEBUG_LOG(m_logger) << "found alarm to remove: " << key << ", eventTypeId: " << eventTypeId; m_mainHandler->db()->removeAlmConfig(key); m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key); m_alarms.remove(key); // is ok, QMapIterator work on a copy @@ -116,20 +116,20 @@ void HandlerConfigureAlarms::removeAlarmConfig(int operatorId, void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId) { - DEBUG_LOG() << "removeAlarmConfig m_alarms.size=" << m_alarms.size(); + DEBUG_LOG(m_logger) << "removeAlarmConfig m_alarms.size=" << m_alarms.size(); // Find Key QMapIterator i(m_alarms); while (i.hasNext()) { i.next(); - DEBUG_LOG() << "key= " << i.key() + DEBUG_LOG(m_logger) << "key= " << i.key() << " participantId=" << i.value().participantId.toInt(); if ((operatorId == i.value().operatorId) && (i.value().participantId.toInt()) == 0) { const int key = i.key(); - DEBUG_LOG() << "found alarm to remove: " << key; + DEBUG_LOG(m_logger) << "found alarm to remove: " << key; m_mainHandler->db()->removeAlmConfig(key); m_mainHandler->dds()->dtsAlm()->removeAlarmConfigByKey(key); m_alarms.remove(key); // is ok, QMapIterator work on a copy @@ -141,7 +141,7 @@ void HandlerConfigureAlarms::removeGlobalAlarmConfig(int operatorId) void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie, const ConfigureAlarmsRequest &request) { - DEBUG_LOG() << "onConfigureAlarmsRequest " << request; + DEBUG_LOG(m_logger) << "onConfigureAlarmsRequest " << request; if (request.participantIds().size() == 0) { Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database. There were no participants given.")); @@ -154,13 +154,13 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde // remove only this one Alarm, not all types of the participant for operator // in DB, // from DDS - DEBUG_LOG() << "request.remove()"; + DEBUG_LOG(m_logger) << "request.remove()"; if (request.participantIds().size() > 0 && request.alarms().size() > 0) { int participantId = request.participantIds()[0]; int eventTypeId = request.alarms()[0].eventTypeId().underlying(); - DEBUG_LOG() << "removeAlarmConfig(request.operatorId()=" << request.operatorId() + DEBUG_LOG(m_logger) << "removeAlarmConfig(request.operatorId()=" << request.operatorId() << " participantId=" << participantId << " eventTypeId=" << eventTypeId; removeAlarmConfig(request.operatorId(), participantId, eventTypeId); @@ -171,7 +171,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde // remove old configuration for (int participantId : request.participantIds()) { - DEBUG_LOG() << "remove old configuration participantId=" << participantId; + DEBUG_LOG(m_logger) << "remove old configuration participantId=" << participantId; removeAlarmConfig(request.operatorId(), participantId, 0); } if ( request.global()) @@ -181,10 +181,10 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde for (int participantId : request.participantIds()) { - DEBUG_LOG() << "participantId: " << participantId; + DEBUG_LOG(m_logger) << "participantId: " << participantId; for (const AlarmManagement::AlarmAction &action : request.alarms()) { - DEBUG_LOG() << "action: " << action; + DEBUG_LOG(m_logger) << "action: " << action; AlarmManagement::AlarmConfig almConfig; almConfig.operatorId(request.operatorId()); @@ -210,7 +210,7 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde Core::FunctionReplyObject ret(0, tr_lts("dds", "Error adding ConfigureAlarms to database.")); m_mainHandler->dds()->ftsAlm()->configureAlarmsReply(cookie, ret); } - DEBUG_LOG() << "m_dbAlmConfig.insert id=" << newConfig.id; + DEBUG_LOG(m_logger) << "m_dbAlmConfig.insert id=" << newConfig.id; almConfig.id(newConfig.id); m_alarms.insert(newConfig.id, newConfig); @@ -224,11 +224,11 @@ void HandlerConfigureAlarms::onConfigureAlarmsRequest(const rti::core::SampleIde //----------------------------------------------------------------------------- void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType) { - DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId(); + DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId(); if (modType == DataModification::eRemoved || modType == DataModification::eModified) return; - DEBUG_LOG() << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size(); + DEBUG_LOG(m_logger) << "onParticipantEventChanged verarbeiten m_alarms.size =" << m_alarms.size(); ExerciseEventManagement::Event eventDatalocal = eventData; @@ -248,7 +248,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event for (const Database::AlmConfig &alarm : std::as_const(m_alarms)) { { - /*DEBUG_LOG() << " alarmConfigItem.id=" << alarm.id + /*DEBUG_LOG(m_logger) << " alarmConfigItem.id=" << alarm.id << " alarmConfigItem.participantId=" << alarm.participantId << " alarmConfigItem.eventTypeId=" << alarm.eventTypeId << " eventDatalocal.eventTypeId()=" << eventDatalocal.eventTypeId().underlying() @@ -272,7 +272,7 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event bool allVulnerabilityStates = alarm.vulnerabilityState == -1; bool vulnerabilityCheck = vulnerabilityState == alarm.vulnerabilityState; bool globalAlarm = participantId == 0; - DEBUG_LOG() << " allVulnerabilityStates=" << allVulnerabilityStates + DEBUG_LOG(m_logger) << " allVulnerabilityStates=" << allVulnerabilityStates << " vulnerabilityCheck=" << vulnerabilityCheck << " participantId=" << participantId << " eventDatalocal.participantId()=" << eventDatalocal.participantId(); @@ -281,19 +281,19 @@ void HandlerConfigureAlarms::onEventChanged(const ExerciseEventManagement::Event { if (sentEventToOperator.contains(alarm.operatorId)) { - DEBUG_LOG() << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId; + DEBUG_LOG(m_logger) << "Event " << eventDatalocal.eventTypeId() << " already handled for Operator:" << alarm.operatorId; continue; } sentEventToOperator += alarm.operatorId; if (alarm.messageWindow) { - DEBUG_LOG() << "send Window to Operator:" << alarm.operatorId; + DEBUG_LOG(m_logger) << "send Window to Operator:" << alarm.operatorId; sendWindow(eventDatalocal, alarm); } if (alarm.setMarker) { - DEBUG_LOG() << "set Marker to Operator:" << alarm.operatorId; + DEBUG_LOG(m_logger) << "set Marker to Operator:" << alarm.operatorId; sendMarker(eventDatalocal, alarm); } } @@ -359,7 +359,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev { int defaultOffset = 10000; - DEBUG_LOG() << "eventProperties =" << eventData.properties(); + DEBUG_LOG(m_logger) << "eventProperties =" << eventData.properties(); QString contentStr; contentStr = QStringLiteral("Equip No.: "); @@ -376,7 +376,7 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev contentStr += eventObject.value(QStringLiteral("AesName")).toString(); contentStr += QStringLiteral(")"); } - DEBUG_LOG() << "contentStr=" << contentStr; + DEBUG_LOG(m_logger) << "contentStr=" << contentStr; const QByteArray contentArr = contentStr.toUtf8(); @@ -399,6 +399,6 @@ void HandlerConfigureAlarms::sendMarker(const ExerciseEventManagement::Event &ev void HandlerConfigureAlarms::onMarkerModifyReply(const Core::FunctionReplyObject &replyObject) { Q_UNUSED(replyObject); - INFO_LOG() << "************** onMarkerCreateReply"; + INFO_LOG(m_logger) << "************** onMarkerCreateReply"; } // end onMarkerCreateReply } // namespace AlarmManagement diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.h index 6ce7ad227..5a1d070bc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_configure_alarms.h @@ -48,6 +48,8 @@ private Q_SLOTS: void onEventChanged(const ExerciseEventManagement::Event &eventData, DataModification modType); private: // methods + +NGL::INGLLogger &m_logger; void onConfigureAlarmsRequest(const rti::core::SampleIdentity &cookie, const ConfigureAlarmsRequest &request) override; void sendWindow(const ExerciseEventManagement::Event &eventData, diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_emergency_call.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_emergency_call.cpp index 9c82ac41d..accaaf815 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_emergency_call.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_emergency_call.cpp @@ -34,7 +34,7 @@ HandlerEmergencyCall::~HandlerEmergencyCall() bool HandlerEmergencyCall::init() { - INFO_LOG() << "Start HandlerEmergencyCall."; + INFO_LOG(m_logger) << "Start HandlerEmergencyCall."; auto dtcTab = m_mainHandler->dds()->dtcTab(); @@ -48,7 +48,7 @@ bool HandlerEmergencyCall::init() bool bRet = true; auto cbEmergencyCall = [this, &bRet](const Database::AlmEmergencyCall &data) { - WARNING_LOG()<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id; + WARNING_LOG(m_logger)<<" ALM_EMERGENCY " << "Reading from DB AlmEmergencyCall with id = " << data.id; if (!this->isExerciseValidForEmergencyCall() && !data.expired) return; @@ -57,7 +57,7 @@ bool HandlerEmergencyCall::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); bRet = false; return; } @@ -67,7 +67,7 @@ bool HandlerEmergencyCall::init() if (!m_mainHandler->db()->select(cbEmergencyCall) || !bRet) { - ERROR_LOG() <<"Error reading data from database 'alm_emergency_call!"; + ERROR_LOG(m_logger) <<"Error reading data from database 'alm_emergency_call!"; return false; } @@ -95,21 +95,21 @@ bool HandlerEmergencyCall::createEmergencyCallObject(const AlarmManagement::AlmE if (ret.error()) { delete ifs; - ERROR_LOG()<< ret(); + ERROR_LOG(m_logger)<< ret(); return false; } - WARNING_LOG()<< "Entry createEmergencyCallObject in the DB id: "<getData().id<<" issi: "<getData().issi<<" expired: "<getData().expired; + WARNING_LOG(m_logger)<< "Entry createEmergencyCallObject in the DB id: "<getData().id<<" issi: "<getData().issi<<" expired: "<getData().expired; m_emergencyObjMap.insert(ifs->getId(), ifs); return true; } void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::SampleIdentity &cookie, const EmergencyCallAcknowledgeRequest &request) { - WARNING_LOG() << "[onEmergencyCallAcknowledgeRequest] request: " << request; + WARNING_LOG(m_logger) << "[onEmergencyCallAcknowledgeRequest] request: " << request; Core::FunctionReplyObject ret = emergencyCallAcknowledgeRequest(request); if (ret.error()) - WARNING_LOG()<< ret(); + WARNING_LOG(m_logger)<< ret(); if (request.expired()) { @@ -122,7 +122,7 @@ void HandlerEmergencyCall::onEmergencyCallAcknowledgeRequest(const rti::core::Sa ackInEx.operatorId(request.operatorId()); ackInEx.comment(request.comment()); ackInEx.expired(request.expired()); - WARNING_LOG() << "onEmergencyCallAcknowledgeRequest: issi: "<dds()->publishSOS()->write(ackInEx); } m_mainHandler->dds()->ftsAlm()->emergencyCallAcknowledgeReply(cookie,ret); @@ -145,17 +145,17 @@ Core::FunctionReplyObject HandlerEmergencyCall::emergencyCallAcknowledgeRequest( if (ifs == nullptr) { - WARNING_LOG()<<" Couldn't acknowledge SOS with issi: " <getData().expired) // if already expired do nothing { - WARNING_LOG() << "SOS Already expired do nothing"; + WARNING_LOG(m_logger) << "SOS Already expired do nothing"; return Core::FunctionReplyObject(ifs->getData().id); } - WARNING_LOG() << "emergencyCallAcknowledgeRequest: issi found!: "<state: "<getData().expired; + WARNING_LOG(m_logger) << "emergencyCallAcknowledgeRequest: issi found!: "<state: "<getData().expired; Database::AlmEmergencyCall newData(ifs->getData()); newData.expired = true; newData.issi = request.issi(); @@ -189,7 +189,7 @@ bool HandlerEmergencyCall::isNewEmergencyCall(const AlmEmergencyCall &newdata) && data.incomingTime == newdata.incomingTime() && !data.expired) { - WARNING_LOG()<<" SOS EXISTS and not yet quit! issi: "< m_configAlarmHandler; QMap m_emergencyObjMap; // Key = DangerAreaId diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.cpp index ab084fcc5..b7ca7c4cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.cpp @@ -11,10 +11,9 @@ using namespace AlarmManagement; -HandlerParticipant::HandlerParticipant(const std::shared_ptr &ddsHandler) - : QObject() - , m_ddsHandler(ddsHandler) -{ +HandlerParticipant::HandlerParticipant(const std::shared_ptr &ddsHandler) : QObject() + , m_ddsHandler(ddsHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } // end of ctor() //----------------------------------------------------------------------------- @@ -44,13 +43,13 @@ bool HandlerParticipant::init() if (!dtcPpm->enableParticipant()) { - ERROR_LOG() << "Could not initialize ParticipantManagement enableParticipant data topic client"; + ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableParticipant data topic client"; return false; } if (!dtcPpm->enableDynamicParticipantData()) { - ERROR_LOG() << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client"; + ERROR_LOG(m_logger) << "Could not initialize ParticipantManagement enableDynamicParticipant data topic client"; return false; } @@ -66,7 +65,7 @@ bool HandlerParticipant::init() if (participant.equipmentNumber().is_set()) { m_partId2EquipNoMap.insert(participant.id(), participant.equipmentNumber().get()); - DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get(); + DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << participant.id() << "EquimentNo=" << participant.equipmentNumber().get(); } else m_partId2EquipNoMap.insert(participant.id(), 0); @@ -86,13 +85,13 @@ bool HandlerParticipant::init() ParticipantManagement::StateInformation state = states[0]; int vulnerability = state.vulnerabilityState().underlying(); m_partId2VulnerabilityMap.insert(i.value().participantId(), vulnerability); - DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability; + DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << i.value().participantId() << "vulnerability=" << vulnerability; } else m_partId2VulnerabilityMap.insert(i.value().participantId(), -1); } - INFO_LOG() << "HandlerParticipant::init() finished. "; + INFO_LOG(m_logger) << "HandlerParticipant::init() finished. "; return true; } // end of init() //----------------------------------------------------------------------------- @@ -101,12 +100,12 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti { if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "onParticipantChanged - remove: " << data.id(); + DEBUG_LOG(m_logger) << "onParticipantChanged - remove: " << data.id(); m_participantHierarchy.remove(data.id()); } else { - DEBUG_LOG() << "onParticipantChanged:" << data; + DEBUG_LOG(m_logger) << "onParticipantChanged:" << data; m_participantHierarchy.insert(data.id(), AlarmManagement::HandlerParticipant::ParticipantHierarchy(data)); const int equipNo = data.equipmentNumber().is_set() ? data.equipmentNumber().get() : 0; @@ -117,13 +116,13 @@ void HandlerParticipant::onParticipantChanged(const ParticipantManagement::Parti void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType) { - DEBUG_LOG() << "onDynamicParticipant participantId=" << data.participantId(); + DEBUG_LOG(m_logger) << "onDynamicParticipant participantId=" << data.participantId(); if (modType == DataModification::eRemoved) { } else { - INFO_LOG() << "onDynamicParticipant()" + INFO_LOG(m_logger) << "onDynamicParticipant()" << " participantId: " << data.participantId(); if (data.stateHistory().size() > 0) { @@ -131,7 +130,7 @@ void HandlerParticipant::onDynamicParticipantChanged(const ParticipantManagement ParticipantManagement::StateInformation state = states[0]; int vulnerability = state.vulnerabilityState().underlying(); m_partId2VulnerabilityMap.insert(data.participantId(), vulnerability); - DEBUG_LOG() << "m_partId2EquipNoMap.insert participantId=" << data.participantId() + DEBUG_LOG(m_logger) << "m_partId2EquipNoMap.insert participantId=" << data.participantId() << " vulnerability=" << vulnerability; } else @@ -178,7 +177,7 @@ QVector HandlerParticipant::getRecursiveInferiorIds(const int participantId int HandlerParticipant::participantId2EquipNo(const int participantId) const { int ret = m_partId2EquipNoMap.value(participantId, 0); - INFO_LOG() << "participantId2EquipNo participantId=" << participantId + INFO_LOG(m_logger) << "participantId2EquipNo participantId=" << participantId << " EquipmentNumber=" << ret; return ret; } // end of participantId2EquipNo() @@ -186,7 +185,7 @@ int HandlerParticipant::participantId2EquipNo(const int participantId) const int HandlerParticipant::participantId2Vulnerability(const int participantId) const { int ret = m_partId2VulnerabilityMap.value(participantId, 0); - INFO_LOG() << "m_partId2VulnerabilityMap participantId=" << participantId + INFO_LOG(m_logger) << "m_partId2VulnerabilityMap participantId=" << participantId << " Vulnerability=" << ret; return ret; } // end of participantId2Vulnerability() diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.h index b317a37d4..9140ea27b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/handler_participant.h @@ -78,6 +78,8 @@ private Q_SLOTS: void onDynamicParticipantChanged(const ParticipantManagement::DynamicParticipantData &data, DataModification modType); private: // methoden + +NGL::INGLLogger &m_logger; QVector getInferiorParts(int participantId) const; private: // attributes diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.cpp index d3bd42f60..c5629db49 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.cpp @@ -19,7 +19,7 @@ using namespace AlarmManagement; Initialization::Initialization() : m_logger(getLogger("Initialization")) { - INFO_LOG() << "Initialization::Initialization"; + INFO_LOG(m_logger) << "Initialization::Initialization"; } // end of ctor() //----------------------------------------------------------------------------- @@ -32,32 +32,32 @@ Initialization::~Initialization() m_dbHandler = nullptr; m_ddsHandler = nullptr; - INFO_LOG() << "Initialization::~Initialization"; + INFO_LOG(m_logger) << "Initialization::~Initialization"; } // end of dtor() //----------------------------------------------------------------------------- bool Initialization::initialize(const std::shared_ptr &ddsConnector, const QSqlDatabase &sqlDb) { - INFO_LOG() << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId() + INFO_LOG(m_logger) << "Start AlarmManagement Initialization. domainId =" << ddsConnector->getDomainId() << " exerciseId=" << ddsConnector->getPartitionId(); // initialize DDS m_ddsHandler = std::make_shared(ddsConnector); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation DdsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DdsHandler failed."; return false; } - INFO_LOG() << "m_ddsHandler initialized. "; + INFO_LOG(m_logger) << "m_ddsHandler initialized. "; // initialize database m_dbHandler = std::make_shared(); if (!m_dbHandler->init(ddsConnector->getPartitionId(), sqlDb)) { - ERROR_LOG() << "Initialisation DbHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DbHandler failed."; return false; } - INFO_LOG() << "DbHandler initialized. "; + INFO_LOG(m_logger) << "DbHandler initialized. "; // create handlers @@ -65,7 +65,7 @@ bool Initialization::initialize(const std::shared_ptr(this); m_handlerEmergencyCall = std::make_shared(m_handlerConfigureAlarms, this); - DEBUG_LOG() << "initialize successfully finished"; + DEBUG_LOG(m_logger) << "initialize successfully finished"; return true; } // end of init() @@ -76,20 +76,20 @@ bool Initialization::loadFromDatabase() // initialize handlers if (!m_handlerParticipant || !m_handlerParticipant->init()) { - ERROR_LOG() << "Can not initialize Participant handler"; + ERROR_LOG(m_logger) << "Can not initialize Participant handler"; return false; } if (!m_handlerConfigureAlarms || !m_handlerConfigureAlarms->init()) { - ERROR_LOG() << "Can not initialize Alarm handler"; + ERROR_LOG(m_logger) << "Can not initialize Alarm handler"; return false; } if (!m_handlerEmergencyCall || !m_handlerEmergencyCall->init()) { - ERROR_LOG() << "Can not initialize EmergencyCall handler"; + ERROR_LOG(m_logger) << "Can not initialize EmergencyCall handler"; return false; } - DEBUG_LOG() << "loadFromDatabase successfully finished"; + DEBUG_LOG(m_logger) << "loadFromDatabase successfully finished"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.h index 6a17cc6b6..5250fec96 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/initialization.h @@ -45,6 +45,8 @@ public: std::shared_ptr hdlParticipant() const { return m_handlerParticipant; } private: // attributes + +NGL::INGLLogger &m_logger; std::shared_ptr m_ddsHandler; std::shared_ptr m_dbHandler; ///< Pointer to DB handler std::shared_ptr m_handlerConfigureAlarms; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.cpp index 3ecad7801..c78bcb2ed 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.cpp @@ -4,10 +4,9 @@ namespace AlarmManagement{ -ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent) - : QObject(parent) - , m_mainHandler(mainHandler) -{ +ObjectEmergencyCall::ObjectEmergencyCall(Initialization *mainHandler, QObject *parent) : QObject(parent) + , m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } ObjectEmergencyCall::~ObjectEmergencyCall() @@ -23,7 +22,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::createObject(const Database::AlmE { if (!m_mainHandler->db()->insert(m_data)) return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting Order into database.")); - WARNING_LOG() << "New EmergencyCall created Id: " << m_data.id; + WARNING_LOG(m_logger) << "New EmergencyCall created Id: " << m_data.id; } // Publish Data via DTS onPublishData(); @@ -40,7 +39,7 @@ Core::FunctionReplyObject ObjectEmergencyCall::updateObject(const Database::AlmE if (!m_mainHandler->db()->update(m_data)) return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Error updating EmergencyCall into database")); - DEBUG_LOG() << "Data changed for Changed Id: " << m_data.id; + DEBUG_LOG(m_logger) << "Data changed for Changed Id: " << m_data.id; // Publish Data via DTS onPublishData(); @@ -71,10 +70,10 @@ void ObjectEmergencyCall::onPublishData() ddsData.operatorId(m_data.operatorId); ddsData.comment(m_data.comment.toStdString()); - INFO_LOG() << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ..."; + INFO_LOG(m_logger) << "Publish AlmEmergencyCall-data to dds (" << m_data.id << ") ..."; if (!m_mainHandler->dds()->dtsAlm()->publish(ddsData)) - ERROR_LOG() << "Error publishing AlmEmergencyCall-data to dds"; + ERROR_LOG(m_logger) << "Error publishing AlmEmergencyCall-data to dds"; } }// namespace AlarmManagement diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.h index dc1e3ea45..ac4d1956c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AlarmManagement/object_emergency_call.h @@ -32,6 +32,7 @@ protected Q_SLOTS: void onPublishData(); private: + NGL::INGLLogger &m_logger; Initialization *m_mainHandler; Database::AlmEmergencyCall m_data; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp index 72a882dd8..357eb4db2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/EffectorFiringStrategy/abstract_firing_strategy.cpp @@ -26,23 +26,22 @@ namespace AreaEffectSimulation -AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent) - : QObject(parent) - , m_effector(parent) -{ - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; +AbstractFiringStrategy::AbstractFiringStrategy(ObjectEffector *parent) : QObject(parent) + , m_effector(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } AbstractFiringStrategy::~AbstractFiringStrategy() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } void AbstractFiringStrategy::calculateDispersionTrajectory() { - DEBUG_LOG() << "calculateDispersionTrajectory"; + DEBUG_LOG(m_logger) << "calculateDispersionTrajectory"; // 1. Neuen Zielpunkt berechnen const auto &intendendTrajectory = m_effector->intendendTrajectory(); @@ -50,7 +49,7 @@ void AbstractFiringStrategy::calculateDispersionTrajectory() // sanity check: if (intendendTrajectory.size() < 2) { - ERROR_LOG() << Q_FUNC_INFO + ERROR_LOG(m_logger) << Q_FUNC_INFO << " size of intendendTrajectory not sufficiant, size=" << intendendTrajectory.size(); return; } @@ -73,7 +72,7 @@ std::vector AbstractFiringStrategy::buildTrajecto // sanity check: if (relativeTrajectory.size() < 2) { - ERROR_LOG() << Q_FUNC_INFO + ERROR_LOG(m_logger) << Q_FUNC_INFO << " size of relativeTrajectory not sufficiant, size=" << relativeTrajectory.size(); return {}; } @@ -89,7 +88,7 @@ std::vector AbstractFiringStrategy::buildTrajecto // Aehnlich wie Lts/Proxies/TrainingAreaBase/Plugins/AdlerJson/aes_handler.cpp Zeile 365 for (const TrajectoryPoint &trajPntRelPos : std::as_const(relativeTrajectory)) { - DEBUG_LOG() << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<: + DEBUG_LOG(m_logger) << "Flugbahnpunkt: trajPntRelPos :" << trajPntRelPos; // benefit from operator<<: // // geographic offers nice feature to add an offset: // const QPointF &trajectoryAbsGeo = launchUtm.geographic(trajPntRelPos); @@ -104,7 +103,7 @@ std::vector AbstractFiringStrategy::buildTrajecto // Position des Participants mit der m_participantId const double zValue = effectorPositionGeo.z() + trajPntRelPos.position.z(); // trajPntRelPos.position.z() ist die Hoehe - DEBUG_LOG() << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo; + DEBUG_LOG(m_logger) << "trajPntAbsUtm :" << trajPntAbsUtm << ", trajPntAbsGeo :" << trajPntAbsGeo; geometry.emplace_back(Core::GeoPositionRelativeTime(trajPntAbsGeo.x(), trajPntAbsGeo.y(), zValue, trajPntRelPos.time)); } return geometry; @@ -115,7 +114,7 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std:: // sanity check: if (trajectoryGeometry.size() < 2) { - ERROR_LOG() << Q_FUNC_INFO + ERROR_LOG(m_logger) << Q_FUNC_INFO << " size of trajectoryGeometry not sufficiant, size=" << trajectoryGeometry.size(); return {}; } @@ -133,14 +132,14 @@ TrajectoryTimeAware AbstractFiringStrategy::buildTrajectoryTimeAware(const std:: int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajectoryTimeAware, const QJsonObject &properties) { - DEBUG_LOG() << "sendChargeEffect"; + DEBUG_LOG(m_logger) << "sendChargeEffect"; const auto &trajGeometry = trajectoryTimeAware.geometry(); // sanity check: if (trajGeometry.size() < 2) { - ERROR_LOG() << Q_FUNC_INFO + ERROR_LOG(m_logger) << Q_FUNC_INFO << " size of trajectoryTimeAware.geometry not sufficiant, size=" << trajGeometry.size(); return -1; } @@ -165,7 +164,7 @@ int AbstractFiringStrategy::sendChargeEffect(const TrajectoryTimeAware &trajecto chargeEffect.trajectoryTimeAware(trajectoryTimeAware); const auto &reply = m_effector->mainHandler()->chargeEffectHandler()->createChargeEffect(chargeEffect); - DEBUG_LOG() << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId(); + DEBUG_LOG(m_logger) << "reply.id=" << reply.id() << ", str:" << reply.str() << ", uniqueId:" << reply.uniqueId(); return reply.id(); } @@ -178,21 +177,21 @@ Core::GeoPosition AbstractFiringStrategy::participantPosition(int participantId) int32_t AbstractFiringStrategy::gearTypeId(int chargeTypeId, int participantId) { - DEBUG_LOG() << "getGearTypeId" + DEBUG_LOG(m_logger) << "getGearTypeId" << ", chargeTypeId:" << chargeTypeId << ", participantId:" << participantId; m_effector->mainHandler()->dds()->ppmDtc()->enableDynamicParticipantData(true); m_effector->mainHandler()->dds()->ppmDtc()->waitForHistoricalDataDynamicParticipantData(1000); const ParticipantManagement::DynamicParticipantData &dynamicParticipantData = m_effector->mainHandler()->dds()->ppmDtc()->dynamicParticipantData(participantId); - DEBUG_LOG() << "gearSize " << dynamicParticipantData.gear().size(); + DEBUG_LOG(m_logger) << "gearSize " << dynamicParticipantData.gear().size(); const auto& participantData_gear = dynamicParticipantData.gear(); for (const auto &gear : std::as_const(participantData_gear)) { - DEBUG_LOG() << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId; + DEBUG_LOG(m_logger) << "gear.chargeTypeId(): " << gear.chargeTypeId() << ", chargeTypeId:" << chargeTypeId; if (gear.chargeTypeId() == chargeTypeId) { - DEBUG_LOG() << "getGearTypeId return: " << gear.gearTypeId(); + DEBUG_LOG(m_logger) << "getGearTypeId return: " << gear.gearTypeId(); if (gear.gearTypeId() != 0) return gear.gearTypeId(); else diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp index 6852da00e..19ede9026 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.cpp @@ -83,7 +83,7 @@ ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId) this, [this]() { - DEBUG_LOG() << "Wirkfeldplanung"; + DEBUG_LOG(m_logger) << "Wirkfeldplanung"; doEffectClusterModifyRequest(); }); } @@ -91,28 +91,28 @@ ModuleTestEffectCluster::ModuleTestEffectCluster(int domainId, int exerciseId) void ModuleTestEffectCluster::onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onEffectClusterModifyReply: " << m_replyError << ", aesItemId=" << replyObject.id(); + DEBUG_LOG(m_logger) << " got reply - onEffectClusterModifyReply: " << m_replyError << ", aesItemId=" << replyObject.id(); m_aesItemId = replyObject.id(); if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onEffectClusterModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onEffectClusterModifyReply: " << replyObject.translated(); } void ModuleTestEffectCluster::onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onAcknowledgeExternalAesItemReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onAcknowledgeExternalAesItemReply: " << m_replyError; sendTabExFire(); // AES::EffectState von ES_Received -> ES_Created if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onAcknowledgeExternalAesItemReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onAcknowledgeExternalAesItemReply: " << replyObject.translated(); } void ModuleTestEffectCluster::onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onModifyPartyDataReply: " << m_replyError << " " << replyObject.additionalInfo(); + DEBUG_LOG(m_logger) << " got reply - onModifyPartyDataReply: " << m_replyError << " " << replyObject.additionalInfo(); if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onModifyPartyDataReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onModifyPartyDataReply: " << replyObject.translated(); if (!m_participantChangeRequestDone) { participantChangeRequest(); @@ -123,24 +123,24 @@ void ModuleTestEffectCluster::onModifyPartyDataReply(const Core::FunctionReplyOb void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " \n\ngot reply - onModifyParticipantDataReply error: " << m_replyError << ", additionalInfo: " << replyObject.additionalInfo(); + DEBUG_LOG(m_logger) << " \n\ngot reply - onModifyParticipantDataReply error: " << m_replyError << ", additionalInfo: " << replyObject.additionalInfo(); if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onModifyParticipantDataReply: " << replyObject.translated(); - DEBUG_LOG() << "onModifyParticipantDataReply => Set Participant Pos"; + ERROR_LOG(m_logger) << " got reply - onModifyParticipantDataReply: " << replyObject.translated(); + DEBUG_LOG(m_logger) << "onModifyParticipantDataReply => Set Participant Pos"; QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(replyObject.additionalInfo())).object().value(QLatin1String("participants")).toArray(); - DEBUG_LOG() << "available_in_exercise jsonDocument.size()=" << jsonArray.size(); + DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument.size()=" << jsonArray.size(); // ParticipantId aus dem Result bestimmen, keine Unit // Dieser einfache Test arbeitet mit einem Participant for (auto it = jsonArray.constBegin(); it != jsonArray.constEnd(); ++it) { int participantId = it->toInt(); - DEBUG_LOG() << "participantId=" << participantId; + DEBUG_LOG(m_logger) << "participantId=" << participantId; ParticipantManagement::Participant participant = m_ppmDtc->participant(participantId); if (m_ppmDtc->type(participant.typeId()).typeClass().underlying() != ParticipantManagement::TypeClass::Unit) { - DEBUG_LOG() << "m_participant1.id=" << participantId; + DEBUG_LOG(m_logger) << "m_participant1.id=" << participantId; m_participant1.id(participantId); // wichtig zum loeschen - DEBUG_LOG() << "m_participantId keine Unit=" << participantId; + DEBUG_LOG(m_logger) << "m_participantId keine Unit=" << participantId; setParticipantPos(participantId); setEquipmentGearCharge(participantId); @@ -150,7 +150,7 @@ void ModuleTestEffectCluster::onModifyParticipantDataReply(const Core::FunctionR } else { - DEBUG_LOG() << "m_participant0.id=" << participantId; + DEBUG_LOG(m_logger) << "m_participant0.id=" << participantId; m_participant0.id(participantId); // wichtig zum loeschen } } @@ -168,7 +168,7 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie if (aesItemView.aesItemId() != m_aesItemId) return; - DEBUG_LOG() << " got onAesItemViewChanged: " + DEBUG_LOG(m_logger) << " got onAesItemViewChanged: " << ", aesItemId=" << aesItemView.aesItemId() << ", aesType=" << aesType << ", effectStateId=" << aesItemView.effectStateId(); QCOMPARE(aesItemView.effectStateId(), m_effectStates[m_effectStateCounter]); @@ -176,14 +176,14 @@ void ModuleTestEffectCluster::onAesItemViewChanged(const AesItemView &aesItemVie if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsReceived) { - DEBUG_LOG() << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId(); + DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemView.aesItemId(); sendAcknowledgeExternalAesItemRequest(aesItemView.aesItemId()); } } void ModuleTestEffectCluster::sendTabExFire() { - DEBUG_LOG() << "sendTabExFire"; + DEBUG_LOG(m_logger) << "sendTabExFire"; TrainingAreaBase::EX_Fire exFire; exFire.effectorId(m_effectorId); // Kenner z.B B1 exFire.identifier(m_identifier.toStdString()); // Verein z.B 451100 @@ -199,16 +199,16 @@ void ModuleTestEffectCluster::onEffectsChanged(const Effects &effects, DataModif if (modType == DataModification::eRemoved) return; AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying(); - DEBUG_LOG() << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; ++m_counterDds.cntEffectClusterEffects; m_effects = effects; - DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects; + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects; } void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEffect, DataModification modType) { - DEBUG_LOG() << "onChargeEffectChanged state=" << chargeEffect.state(); + DEBUG_LOG(m_logger) << "onChargeEffectChanged state=" << chargeEffect.state(); if (modType == DataModification::eRemoved) return; if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsActivated) @@ -225,7 +225,7 @@ void ModuleTestEffectCluster::onChargeEffectChanged(const ChargeEffect &chargeEf } else if (chargeEffect.state() == AreaEffectSimulation::AesEffectState::EsExpired) participantDeleteRequest(); - DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects; + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects; } void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType) @@ -236,12 +236,12 @@ void ModuleTestEffectCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeA ++m_counterDds.cntTrajectory; - DEBUG_LOG() << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; + DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; } void ModuleTestEffectCluster::dumpCnt() { - DEBUG_LOG() << Q_FUNC_INFO << " Counter: " + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " Counter: " << " cntEffectCluster = " << m_counterDds.cntEffectCluster << ", cntAtEffectCluster = " << m_counterDds.cntAtEffectCluster << ", cntGunToTargetLine = " << m_counterDds.cntAtEffectClusterGunToTargetLine << ", cntClusterEffects = " << m_counterDds.cntEffectClusterEffects << ", cntTrajectory = " << m_counterDds.cntTrajectory; @@ -258,7 +258,7 @@ bool ModuleTestEffectCluster::waitForData(const std::function &func, int for (int i = 0; i < retryCount; ++i) { - TRACE_LOG() << " waitForData - i: " << i; + TRACE_LOG(m_logger) << " waitForData - i: " << i; if (func()) return true; QTest::qWait(1000); @@ -299,7 +299,7 @@ EffectCluster ModuleTestEffectCluster::getEcForTneVerification(const QString &ea QPointF bottomLeft(Polygons::centerPoint2BottomLeft(cp.geographic(), width, height, rot)); - DEBUG_LOG() << " bottomLeft" << bottomLeft; + DEBUG_LOG(m_logger) << " bottomLeft" << bottomLeft; eaData.area().cornerBottomLeft(Core::GeoPosition(bottomLeft.x(), bottomLeft.y(), 0.0)); eaData.area().height(height); @@ -359,23 +359,23 @@ std::vector ModuleTestEffectCluster::parseTr } } points.push_back(p); - DEBUG_LOG() << "Punkt gelesen: offsetY" << p.offsetX() << ", offsetY" << p.offsetY() << ", offsetZ" << p.offsetZ() << ", time=" << p.relativeTime(); + DEBUG_LOG(m_logger) << "Punkt gelesen: offsetY" << p.offsetX() << ", offsetY" << p.offsetY() << ", offsetZ" << p.offsetZ() << ", time=" << p.relativeTime(); } } if (xml.hasError()) { - DEBUG_LOG() << "XML Fehler:" << xml.errorString(); + DEBUG_LOG(m_logger) << "XML Fehler:" << xml.errorString(); } - DEBUG_LOG() << "file.close()"; + DEBUG_LOG(m_logger) << "file.close()"; file.close(); - DEBUG_LOG() << "return points"; + DEBUG_LOG(m_logger) << "return points"; return points; } int ModuleTestEffectCluster::sendAcknowledgeExternalAesItemRequest(int aesItemId) { - DEBUG_LOG() << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << "sendAcknowledgeExternalAesItemRequest aesItemId=" << aesItemId; int ret = m_aesFtc->acknowledgeExternalAesItemRequest(AcknowledgeExternalAesItemRequest(aesItemId), this); return ret; } @@ -387,9 +387,9 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() m_reference = dateTimeString; if (eaData.effectStart().is_set()) - INFO_LOG() << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); + INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); else - INFO_LOG() << " effectClusterModifyRequest with effectStart: not set "; + INFO_LOG(m_logger) << " effectClusterModifyRequest with effectStart: not set "; FlightCurve fc; // if (eaData.flightCurve().is_set()) @@ -439,7 +439,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() AreaEffectSimulation::EffectorData effector; effector.angleOfFall(0); effector.participantId(m_participant1.id()); // Participant - DEBUG_LOG() << "effector.participantId(m_participant1.id()=" << m_participant1.id(); + DEBUG_LOG(m_logger) << "effector.participantId(m_participant1.id()=" << m_participant1.id(); effector.flightTime(39526.3); effector.peakHeight(2002.0); @@ -454,26 +454,26 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() effector.mhpPosition(mhpPosition); effector.trajectoryRelative(trajectory); - DEBUG_LOG() << "effector"; + DEBUG_LOG(m_logger) << "effector"; std::vector effectors; effectors.push_back(effector); - DEBUG_LOG() << "Nach effector"; + DEBUG_LOG(m_logger) << "Nach effector"; eaData.id(0); eaData.effectSourceId(ProjectDataManagement::EffectSource::ES_ADLER); eaData.firePurposeId(2); eaData.partyId(4); eaData.participantId(m_participant0.id()); // Unit - DEBUG_LOG() << "eaData.participantId(m_participant0.id()=" << m_participant0.id(); + DEBUG_LOG(m_logger) << "eaData.participantId(m_participant0.id()=" << m_participant0.id(); eaData.externalId(7); eaData.effectMarkingInTa(1); eaData.name(dateTimeString.toStdString()); eaData.element(dateTimeString.toStdString()); - DEBUG_LOG() << "Vor send effectClusterModifyRequest"; + DEBUG_LOG(m_logger) << "Vor send effectClusterModifyRequest"; int ret = m_aesFtc->effectClusterModifyRequest(EffectClusterModifyRequest(eaData.id(), eaData.name(), @@ -493,7 +493,7 @@ int ModuleTestEffectCluster::doEffectClusterModifyRequest() eaData.effectMarkingInTa(), eaData.properties()), this); - DEBUG_LOG() << "send effectClusterModifyRequest ret=" << ret; + DEBUG_LOG(m_logger) << "send effectClusterModifyRequest ret=" << ret; return ret; } @@ -502,31 +502,31 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i // expected condition: if (!waitForData([this]() { return m_replyError == false; }, 1)) { - ERROR_LOG() << "Error on request" + ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber; return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared; }, durPrep)) { - ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated; }, durAct)) { - ERROR_LOG() << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired; }, durExp)) { - ERROR_LOG() << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } @@ -534,7 +534,7 @@ void ModuleTestEffectCluster::waitForEffectStates(int lineNumber, int durPrep, i void ModuleTestEffectCluster::disconnectFromParty() { - DEBUG_LOG() << "PPM::ModifyPartyDataRequest"; + DEBUG_LOG(m_logger) << "PPM::ModifyPartyDataRequest"; ParticipantManagement::Party party; @@ -559,14 +559,14 @@ void ModuleTestEffectCluster::disconnectFromParty() if (!m_ppmFtc->modifyPartyDataRequest(req, this)) { - ERROR_LOG() << "Error creating party data"; + ERROR_LOG(m_logger) << "Error creating party data"; // failExit(); } } void ModuleTestEffectCluster::connectToParty() { - DEBUG_LOG() << "PPM::ModifyPartyDataRequest"; + DEBUG_LOG(m_logger) << "PPM::ModifyPartyDataRequest"; ParticipantManagement::Party party; @@ -592,14 +592,14 @@ void ModuleTestEffectCluster::connectToParty() if (!m_ppmFtc->modifyPartyDataRequest(req, this)) { - ERROR_LOG() << "Error creating party data"; + ERROR_LOG(m_logger) << "Error creating party data"; // failExit(); } } void ModuleTestEffectCluster::participantChangeRequest() { - DEBUG_LOG() << "PPM::participantChangerequest"; + DEBUG_LOG(m_logger) << "PPM::participantChangerequest"; m_participant0.id(0); m_participant0.partyId(4); @@ -643,14 +643,14 @@ void ModuleTestEffectCluster::participantChangeRequest() req.data(data); if (!m_ppmFtc->modifyParticipantDataRequest(req, this)) { - ERROR_LOG() << "Error creating party data"; + ERROR_LOG(m_logger) << "Error creating party data"; // failExit(); } } void ModuleTestEffectCluster::participantDeleteRequest() { - DEBUG_LOG() << "PPM::participantDeleteRequest"; + DEBUG_LOG(m_logger) << "PPM::participantDeleteRequest"; m_participant0.isDeleted(true); @@ -664,14 +664,14 @@ void ModuleTestEffectCluster::participantDeleteRequest() req.data(data); if (!m_ppmFtc->modifyParticipantDataRequest(req, this)) { - ERROR_LOG() << "Error creating party data"; + ERROR_LOG(m_logger) << "Error creating party data"; // failExit(); } } void ModuleTestEffectCluster::setParticipantPos(int participantId) { - DEBUG_LOG() << "setupParticipants"; + DEBUG_LOG(m_logger) << "setupParticipants"; TrainingAreaBase::TabPosition position; Core::GeoPosition geoPos; TrainingAreaBase::EquipmentPosition pos; @@ -680,7 +680,7 @@ void ModuleTestEffectCluster::setParticipantPos(int participantId) geoPos.lat(0.91579597); geoPos.z(0.0); - DEBUG_LOG() << " initTestCase_data1 ..."; + DEBUG_LOG(m_logger) << " initTestCase_data1 ..."; pos.equipmentNumber(participantId * -1); // ParticipantId pos.sampleTime(QDateTime::currentMSecsSinceEpoch()); position.reportingSource(Core::PositionReportingSource::SetByOperator); @@ -691,7 +691,7 @@ void ModuleTestEffectCluster::setParticipantPos(int participantId) void ModuleTestEffectCluster::setEquipmentGearCharge(int participantId) { - DEBUG_LOG() << "setupEquipmentGearCharge"; + DEBUG_LOG(m_logger) << "setupEquipmentGearCharge"; TrainingAreaBase::EquipmentGearChargeState egs; TrainingAreaBase::GearCharge charge; std::vector charges; @@ -729,7 +729,7 @@ void ModuleTestEffectCluster::setEquipmentGearCharge(int participantId) void ModuleTestEffectCluster::onPartyChanged(const ParticipantManagement::Party &data, DataModification modType) { - DEBUG_LOG() << "onPartyChanged:" << data; + DEBUG_LOG(m_logger) << "onPartyChanged:" << data; // Remove Participant: if (modType == DataModification::eRemoved) { @@ -741,14 +741,14 @@ void ModuleTestEffectCluster::onPartyChanged(const ParticipantManagement::Party return; } - DEBUG_LOG() << "onPartyChanged id= " << data.id(); + DEBUG_LOG(m_logger) << "onPartyChanged id= " << data.id(); if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Connected) { - DEBUG_LOG() << "onPartyChanged saaConnectedState == connected"; + DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == connected"; } else if (m_ppmDtc->saaConnectedState(data.id()) == ParticipantManagement::ConnectState::Disconnected) { - DEBUG_LOG() << "onPartyChanged saaConnectedState == disconnected => connectToParty"; + DEBUG_LOG(m_logger) << "onPartyChanged saaConnectedState == disconnected => connectToParty"; connectToParty(); } } @@ -762,7 +762,7 @@ void ModuleTestEffectCluster::initTestCase() // DdsConnector // - DEBUG_LOG() << "DDSConnector: m_domainId " << m_domainId << ", m_exerciseId " << m_exerciseId; + DEBUG_LOG(m_logger) << "DDSConnector: m_domainId " << m_domainId << ", m_exerciseId " << m_exerciseId; QFile file(s_REQUEST_SPL_FILE); const bool bFileExists = file.exists(); @@ -774,14 +774,14 @@ void ModuleTestEffectCluster::initTestCase() QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!"); if (!bInit) { - ERROR_LOG() << " ERROR, ddsConnector.init failed!!"; + ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!"; return; } - INFO_LOG() << " ddsConnector.init successfull"; + INFO_LOG(m_logger) << " ddsConnector.init successfull"; // cmd m_ddsConnector->initPublisherSubscriber(); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; // // Aes @@ -802,12 +802,12 @@ void ModuleTestEffectCluster::initTestCase() m_aesDtc->enableAesItemView(); m_aesDtc->enableChargeEffect(); - DEBUG_LOG() << " waitForHistoricalDataAesItemView... "; + DEBUG_LOG(m_logger) << " waitForHistoricalDataAesItemView... "; m_aesDtc->waitForHistoricalDataAesItemView(2000); - DEBUG_LOG() << " waitForHistoricalDataAesItemView... Done"; + DEBUG_LOG(m_logger) << " waitForHistoricalDataAesItemView... Done"; QMap aesItemViewsCont = m_aesDtc->aesItemViews(); - DEBUG_LOG() << " aesItemViewsCont.size() " << aesItemViewsCont.size(); + DEBUG_LOG(m_logger) << " aesItemViewsCont.size() " << aesItemViewsCont.size(); // // PDM @@ -832,13 +832,13 @@ void ModuleTestEffectCluster::initTestCase() QVERIFY2(bRet, "ERROR, enableAll m_exmDtc failed!!"); m_exmDtc->waitForHistoricalDataExercise(2000); - DEBUG_LOG() << " waitForHistoricalDataExercise... Done"; + DEBUG_LOG(m_logger) << " waitForHistoricalDataExercise... Done"; const ExerciseManagement::Exercise &exercise = m_exmDtc->exercise(m_exerciseId); QVERIFY2(exercise.id() == m_exerciseId, "ERROR, exercise failed!!"); m_traingAreaId = exercise.trainingAreaId(); - DEBUG_LOG() << " ExerciseManagement" + DEBUG_LOG(m_logger) << " ExerciseManagement" << ", m_traingAreaId = " << m_traingAreaId; // // PPM ParticipantManagement @@ -861,7 +861,7 @@ void ModuleTestEffectCluster::initTestCase() bRet = bRet && m_tabDts->enableAll(); QVERIFY2(bRet, "ERROR, m_tabDts enableAll failed!!"); - DEBUG_LOG() << "disconnectFromParty"; + DEBUG_LOG(m_logger) << "disconnectFromParty"; disconnectFromParty(); // connectToParty(); @@ -896,9 +896,9 @@ void ModuleTestEffectCluster::cleanupTestCase() // finish last (dds) calls: waitForData([]() { return false; }, 10); - INFO_LOG() << " ddsConnector destroy..."; + INFO_LOG(m_logger) << " ddsConnector destroy..."; m_ddsConnector.reset(); - INFO_LOG() << " ddsConnector destroy...DONE"; + INFO_LOG(m_logger) << " ddsConnector destroy...DONE"; } int main(int argc, char *argv[]) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.h index 7f0950acb..f47e98626 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_EffectCluster/effect_cluster_module_test.h @@ -61,6 +61,8 @@ public: ModuleTestEffectCluster(int domainId, int exerciseId); protected: + +NGL::INGLLogger &m_logger; void onEffectClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; void onAcknowledgeExternalAesItemReply(const Core::FunctionReplyObject &replyObject) override; void onModifyPartyDataReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp index d0041e94f..9b52c4061 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.cpp @@ -102,65 +102,65 @@ ModuleTestExplosionCluster::ModuleTestExplosionCluster(int domainId, int exercis void ModuleTestExplosionCluster::onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onSetSimulatedParticipantFormationReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onSetSimulatedParticipantFormationReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onSetSimulatedParticipantFormationReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onSetSimulatedParticipantFormationReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onExplosionClusterModifyReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onExplosionClusterSingleEffectOnlyModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterSingleEffectOnlyModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onExplosionClusterOcModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onExplosionClusterOcModifyReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onExplosionClusterOcModifyReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterOcModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterOcModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onExplosionClusterPauseResumeReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onExplosionClusterPauseResumeReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onExplosionClusterPauseResumeReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onTargetPositionsModifyReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onTargetPositionsModifyReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onTargetPositionsModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onTargetPositionsModifyReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onSetBuildingStatesReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onSetBuildingStatesReply: " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onSetBuildingStatesReply: " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onSetBuildingStatesReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onSetBuildingStatesReply: " << replyObject.translated(); } void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluster &data, DataModification modType) @@ -177,7 +177,7 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste { long now = time(nullptr) * 1000; long diff = now - m_objectRequestedTimePointMsec; - DEBUG_LOG() << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() << ", OBJECT IS NOT Modifiable ANYMORE" << " ((diff = " << diff << ")"; } @@ -187,10 +187,10 @@ void ModuleTestExplosionCluster::onExplosionClusterChanged(const ExplosionCluste if (m_data.effectStart().is_set()) startTimeMsec = m_data.effectStart().get(); - DEBUG_LOG() << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_data: " << m_data.id() << ", state=" << m_data.effectStateId() << ", startTimeMsec=" << startTimeMsec << ", cntExplosionCluster=" << m_counterDds.cntExplosionCluster; - TRACE_LOG() << " got changed - m_data: " << m_data; + TRACE_LOG(m_logger) << " got changed - m_data: " << m_data; } void ModuleTestExplosionCluster::onBuildingStateChanged(const Buildings::BuildingState &bldgState, DataModification modType) @@ -198,7 +198,7 @@ void ModuleTestExplosionCluster::onBuildingStateChanged(const Buildings::Buildin if (modType == DataModification::eRemoved) return; -// DEBUG_LOG() << " got changed - BuildingState.id: " << bldgState.id() << ", data.damagePerc " << bldgState.damagePercent() << "m_bldgIdToFilter " << m_bldgIdToFilter; +// DEBUG_LOG(m_logger) << " got changed - BuildingState.id: " << bldgState.id() << ", data.damagePerc " << bldgState.damagePercent() << "m_bldgIdToFilter " << m_bldgIdToFilter; if (m_bldgIdToFilter == bldgState.id()) m_buildingStateVec.push_back(bldgState); @@ -210,7 +210,7 @@ void ModuleTestExplosionCluster::onAesItemViewChanged(const AesItemView &aesItem return; AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying(); - DEBUG_LOG() << " got onAesItemViewChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + DEBUG_LOG(m_logger) << " got onAesItemViewChanged - m_data: " << m_data.id() << ", aesType=" << aesType; switch (aesType) { case AreaEffectSimulation::AesType_def::AtExplosionCluster: @@ -233,11 +233,11 @@ void ModuleTestExplosionCluster::onEffectsChanged(const Effects &effects, DataMo if (modType == DataModification::eRemoved) return; AreaEffectSimulation::AesType_def::type aesType = effects.aesTypeId().underlying(); - DEBUG_LOG() << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_data: " << m_data.id() << ", aesType=" << aesType; ++m_counterDds.cntExplosionClusterEffects; m_effects = effects; - DEBUG_LOG() << " got onEffectsChanged - m_effects: " << m_effects; + DEBUG_LOG(m_logger) << " got onEffectsChanged - m_effects: " << m_effects; } void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTimeAware &data, DataModification modType) @@ -248,7 +248,7 @@ void ModuleTestExplosionCluster::onTrajectoryTimeAwareChanged(const TrajectoryTi ++m_counterDds.cntTrajectory; - DEBUG_LOG() << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; + DEBUG_LOG(m_logger) << " got TrajectoryTimeAwareChanged - data: " << data.id() << ", cntTrajectory=" << m_counterDds.cntTrajectory; } void ModuleTestExplosionCluster::dumpCnt() @@ -278,11 +278,11 @@ bool ModuleTestExplosionCluster::setFilterForBldgState(const QString &bldgName) const int bldgId = getBldgId(bldgName); if (bldgId<=0) { - ERROR_LOG() << " getBldgId failed for '" << bldgName << "'"; + ERROR_LOG(m_logger) << " getBldgId failed for '" << bldgName << "'"; return false; } m_bldgIdToFilter = bldgId; - INFO_LOG() << " setFilterForBldgState for '" << bldgName << "' to " << m_bldgIdToFilter; + INFO_LOG(m_logger) << " setFilterForBldgState for '" << bldgName << "' to " << m_bldgIdToFilter; return true; } @@ -307,13 +307,13 @@ bool ModuleTestExplosionCluster::checkSingleEffects(uint idx, const LtsCoordTran if (se.singleEffectTime() < 1000) { - ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": singleEffectTime failed, SingleEffect = " << se; + ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": singleEffectTime failed, SingleEffect = " << se; return false; } if (se.zPlacement() != zPlace) { - ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": zPlacement failed, SingleEffect = " << se; + ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": zPlacement failed, SingleEffect = " << se; return false; } @@ -322,9 +322,9 @@ bool ModuleTestExplosionCluster::checkSingleEffects(uint idx, const LtsCoordTran if (dist3D > maxDist3D) { - ERROR_LOG() << " bldg: " << context << ", idx = " << idx << ": position failed, dist3D = " << dist3D; - ERROR_LOG() << " idx = " << idx << ", Impact IST = " << ltsPos; - ERROR_LOG() << " idx = " << idx << ", Impact SHD = " << coord; + ERROR_LOG(m_logger) << " bldg: " << context << ", idx = " << idx << ": position failed, dist3D = " << dist3D; + ERROR_LOG(m_logger) << " idx = " << idx << ", Impact IST = " << ltsPos; + ERROR_LOG(m_logger) << " idx = " << idx << ", Impact SHD = " << coord; return false; } @@ -361,7 +361,7 @@ bool ModuleTestExplosionCluster::waitForData(const std::function &func, for (int i = 0; i < retryCount; ++i) { - TRACE_LOG() << " waitForData - i: " << i; + TRACE_LOG(m_logger) << " waitForData - i: " << i; if (func()) return true; QTest::qWait(100); @@ -636,9 +636,9 @@ ExplosionCluster ModuleTestExplosionCluster::getEcFor3101(const QString &eaName) int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionCluster &eaData) { if (eaData.effectStart().is_set()) - INFO_LOG() << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); + INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(eaData.effectStart().get()).toString(); else - INFO_LOG() << " explosionClusterModifyRequest with effectStart: not set "; + INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set "; FlightCurve fc; if (eaData.flightCurve().is_set()) @@ -686,9 +686,9 @@ int ModuleTestExplosionCluster::doExplosionClusterModifyRequest(const ExplosionC int ModuleTestExplosionCluster::doExplosionClusterSingleEffectOnlyModifyRequest(const ExplosionClusterSingleEffectOnlyRequest &request) { if (request.effectStart().is_set()) - INFO_LOG() << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart().get()).toString(); + INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: " << QDateTime::fromMSecsSinceEpoch(request.effectStart().get()).toString(); else - INFO_LOG() << " explosionClusterModifyRequest with effectStart: not set "; + INFO_LOG(m_logger) << " explosionClusterModifyRequest with effectStart: not set "; int ret = m_aesFtc->explosionClusterSingleEffectOnlyModifyRequest(request, this); return ret; @@ -711,32 +711,32 @@ void ModuleTestExplosionCluster::waitForEffectStates(int lineNumber, int durPrep // expected condition: if (!waitForData([this]() { return m_replyError == false; }, 1)) { - ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber; return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) { - ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) { - ERROR_LOG() << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) { - ERROR_LOG() << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of explosion cluster with id " << m_data.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -762,14 +762,14 @@ void ModuleTestExplosionCluster::setupParticipants() QPointF pos = utmPos.geographic(); req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); - INFO_LOG() << " setSimulatedPositionRequest ..."; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; m_ppmFtc->setSimulatedPositionRequest(req, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } @@ -782,14 +782,14 @@ void ModuleTestExplosionCluster::setupParticipants() QPointF pos = utmPos.geographic(); req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); - INFO_LOG() << " setSimulatedPositionRequest ..."; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; m_ppmFtc->setSimulatedPositionRequest(req, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } @@ -808,14 +808,14 @@ void ModuleTestExplosionCluster::setupParticipants() QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}")); req_SSPF.formation( prop.toStdString() ); - INFO_LOG() << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; + INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; m_replyError = true; m_ppmFtc->setSimulatedParticipantFormationRequest(req_SSPF, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } @@ -832,18 +832,18 @@ void ModuleTestExplosionCluster::setupParticipants() QString prop = QString(QStringLiteral("{\"angle\":0,\"distance\":25,\"distanceSets\":{\"Aufgelockert\":50,\"Geschlossen\":25},\"geometry\":\"line\"}")); req_SSPF.formation( prop.toStdString() ); - INFO_LOG() << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; + INFO_LOG(m_logger) << " SetSimulatedParticipantFormation ... req = " << req_SSPF ; m_replyError = true; m_ppmFtc->setSimulatedParticipantFormationRequest(req_SSPF, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } - INFO_LOG() << " setSimulatedPositionRequest ...DONE"; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ...DONE"; } bool ModuleTestExplosionCluster::checkParticipant_5() @@ -852,7 +852,7 @@ bool ModuleTestExplosionCluster::checkParticipant_5() const int partId = 5; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); - INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr; + INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76900 18000"); } @@ -863,7 +863,7 @@ bool ModuleTestExplosionCluster::checkParticipant_6() const int partId = 6; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); - INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr; + INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76000 19000"); } @@ -877,12 +877,12 @@ bool ModuleTestExplosionCluster::checkParticipant_89() const LtsUtils::QPoint3D ¢erCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger); if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x())) { - WARNING_LOG() << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; return false; } QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(centerCoordGeo.x(), centerCoordGeo.y()); - INFO_LOG() << " for unit with partId = '" << partId << "', we got position: " << mgrsStr; + INFO_LOG(m_logger) << " for unit with partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 50000 18000"); } @@ -896,12 +896,12 @@ bool ModuleTestExplosionCluster::checkParticipant_99() const LtsUtils::QPoint3D ¢erCoordGeo = Polygons::calculateFiringUnitCenterNonRecursive(m_ppmDtc, partId, singlePositionsOut_unused, m_logger); if (centerCoordGeo.isNull() || std::isnan(centerCoordGeo.x())) { - WARNING_LOG() << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; + WARNING_LOG(m_logger) << Q_FUNC_INFO << " calculateFiringUnitCenterNonRecursive failed, partId = " << partId; return false; } QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(centerCoordGeo.x(), centerCoordGeo.y()); - INFO_LOG() << " for unit with partId = '" << partId << "', we got position: " << mgrsStr; + INFO_LOG(m_logger) << " for unit with partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 01000 18000"); } @@ -954,7 +954,7 @@ void ModuleTestExplosionCluster::resetBldgs() for (int bldgId : std::as_const(bldgIds)) { const ProjectDataManagement::VulnerabilityState& bldgState = m_bldDtc->buildingState(bldgId).vulnerabilityState(); - INFO_LOG() << "resetBldgs: bldgId " << bldgId + INFO_LOG(m_logger) << "resetBldgs: bldgId " << bldgId << ", state= " << bldgState << ", bldgName= " << m_bldgIdToName[bldgId]; QVERIFY2(bldgState.underlying()==ProjectDataManagement::VulnerabilityState_def::CombatReady, "ERROR, bldgState failed!!"); @@ -1016,14 +1016,14 @@ void ModuleTestExplosionCluster::initTestCase() QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!"); if (!bInit) { - ERROR_LOG() << " ERROR, ddsConnector.init failed!!"; + ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!"; return; } - INFO_LOG() << " ddsConnector.init successfull"; + INFO_LOG(m_logger) << " ddsConnector.init successfull"; // cmd m_ddsConnector->initPublisherSubscriber(); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; // // Aes @@ -1215,16 +1215,16 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_00() double rot = 0; - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); rot = 1; - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); rot = 30; - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); rot = 60; - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); rot = -30; - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " rot " << rot << ", rotSfmOrg " << compassToMathAngleForSfm(rot) << ", rotSfmPlus90 " << compassToMathAngleForSfm(rot+90); } void ModuleTestExplosionCluster::test_TneVerificationBremen_01() @@ -1259,7 +1259,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!"); const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat()); - DEBUG_LOG() << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); + DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!"); // @@ -1269,19 +1269,19 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() const int simId = m_data.id(); AreaEffectSimulation::AesItemView itemView; - DEBUG_LOG() << " TNE VERIFICATION: simId = " << simId; + DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId; const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView); QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!"); QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!"); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; const double rot = m_data.area().rotation(); const double rotSfmOrg = compassToMathAngleForSfm(rot); const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90); - INFO_LOG() << " TNE VERIFICATION: CHECK:" + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " randomNumber = ????????" << ", width=" << m_data.area().width() << ", height=" << m_data.area().height() @@ -1295,7 +1295,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_01() for (const Core::GeoPosition &geoCoord : std::as_const(formRef)) { const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; } size_t i = 0; @@ -1358,7 +1358,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() QVERIFY2(mhPointsRef.size() == 1, "ERROR, mhPoints().size() failed!!"); const LtsCoordTrans::UtmCoordinate &mhpUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mhPointsRef.front().lon(), mhPointsRef.front().lat()); - DEBUG_LOG() << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); + DEBUG_LOG(m_logger) << " TNE VERIFICATION: mhpUtm = " << mhpUtm.mgrs(); QVERIFY2(distanceMeter(mhPointsRef.front(), LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32U MD 97000 78000"))) < 1, "ERROR, mhPointsRef failed!!"); // @@ -1368,19 +1368,19 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() const int simId = m_data.id(); AreaEffectSimulation::AesItemView itemView; - DEBUG_LOG() << " TNE VERIFICATION: simId = " << simId; + DEBUG_LOG(m_logger) << " TNE VERIFICATION: simId = " << simId; const bool bFound = m_aesDtc->aesItemViewFromEntityId(simId, AreaEffectSimulation::AesType::AtExplosionClusterSingleExplosions, itemView); QVERIFY2(bFound, "ERROR,aesItemViewFromEntityId failed!!"); QVERIFY2(itemView.aesItemId() == simId, "ERROR,aesItemViewFromEntityId failed!!"); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; const double rot = m_data.area().rotation(); const double rotSfmOrg = compassToMathAngleForSfm(rot); const double rotSfmPlus90 = compassToMathAngleForSfm(rot+90); - INFO_LOG() << " TNE VERIFICATION: CHECK:" + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " randomNumber = ????????" << ", width=" << m_data.area().width() << ", height=" << m_data.area().height() @@ -1394,7 +1394,7 @@ void ModuleTestExplosionCluster::test_TneVerificationBremen_02() for (const Core::GeoPosition &geoCoord : std::as_const(formRef)) { const LtsCoordTrans::UtmCoordinate &utm = LtsCoordTrans::UtmCoordinate::fromGeographic(geoCoord.lon(), geoCoord.lat()); - INFO_LOG() << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; + INFO_LOG(m_logger) << " TNE VERIFICATION: CHECK:" << " utm: " << utm.mgrs() << ", item=" << geoCoord; } size_t i = 0; @@ -1960,14 +1960,14 @@ void ModuleTestExplosionCluster::test_remove_effect_start() // expected condition: if (!waitForData([this]() { return m_replyError == false; }, 1)) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; if (!waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, 2)) { - ERROR_LOG() << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id(); + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of explosion cluster with id " << m_data.id(); return; } @@ -1991,15 +1991,15 @@ void ModuleTestExplosionCluster::test_remove_effect_start() } - INFO_LOG() << Q_FUNC_INFO << " waiting to make sure, that next step is never reached:"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting to make sure, that next step is never reached:"; if (waitForData([this]() { return m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, 60)) { - ERROR_LOG() << "Next step is accidentically reached of explosion cluster with id " << m_data.id(); + ERROR_LOG(m_logger) << "Next step is accidentically reached of explosion cluster with id " << m_data.id(); QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " object effectState: " << m_data.effectStateId(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " object effectState: " << m_data.effectStateId(); QVERIFY2(m_data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsCreated, "ERROR, ExplosionCluster in wrong state"); dumpCnt(); @@ -2298,7 +2298,7 @@ void ModuleTestExplosionCluster:: test_point_geometry_bldg_1104_single_effect_on const QPointF impactPointF(0.20256382834808495, 0.9161105453111705); request.impactPosition(Core::GeoPosition2D(impactPointF.x(), impactPointF.y())); - INFO_LOG() << Q_FUNC_INFO << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs(); + INFO_LOG(m_logger) << Q_FUNC_INFO << " requested impact position = " << LtsCoordTrans::UtmCoordinate::fromGeographic(impactPointF).mgrs(); request.chargeTypeId(371); request.externalId(815); @@ -2701,9 +2701,9 @@ void ModuleTestExplosionCluster::cleanupTestCase() // finish last (dds) calls: waitForData([]() { return false; }, 10); - INFO_LOG() << " ddsConnector destroy..."; + INFO_LOG(m_logger) << " ddsConnector destroy..."; m_ddsConnector.reset(); - INFO_LOG() << " ddsConnector destroy...DONE"; + INFO_LOG(m_logger) << " ddsConnector destroy...DONE"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.h index 076b7a6c0..71fcce2d1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_ExplosionCluster/explosion_cluster_module_test.h @@ -59,6 +59,8 @@ public: ModuleTestExplosionCluster(int domainId, int exerciseId); protected: + +NGL::INGLLogger &m_logger; void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override; void onSetSimulatedParticipantFormationReply(const Core::FunctionReplyObject &replyObject) override; void onExplosionClusterModifyReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp index 24ff43aa7..85762ca14 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.cpp @@ -596,7 +596,7 @@ bool ModuleTestLimits::waitForData(const std::function &func, int retry for (int i = 0; i < retryCount; ++i) { - TRACE_LOG() << " waitForData - i: " << i; + TRACE_LOG(m_logger) << " waitForData - i: " << i; if (func()) return true; QTest::qWait(100); @@ -860,14 +860,14 @@ void ModuleTestLimits::initTestCase() QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!"); if (!bInit) { - ERROR_LOG() << " ERROR, ddsConnector.init failed!!"; + ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!"; return; } - INFO_LOG() << " ddsConnector.init successfull"; + INFO_LOG(m_logger) << " ddsConnector.init successfull"; // cmd m_ddsConnector->initPublisherSubscriber(); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; // // Aes @@ -1126,9 +1126,9 @@ void ModuleTestLimits::cleanupTestCase() // finish last (dds) calls: waitForData([]() { return false; }, 10); - INFO_LOG() << " ddsConnector destroy..."; + INFO_LOG(m_logger) << " ddsConnector destroy..."; m_ddsConnector.reset(); - INFO_LOG() << " ddsConnector destroy...DONE"; + INFO_LOG(m_logger) << " ddsConnector destroy...DONE"; } /*! @@ -1147,14 +1147,14 @@ void ModuleTestLimits::setupParticipant() req.onlyOutdatedParticipants(false); req.position(Core::GeoPosition(m_partPos.lon(), m_partPos.lat(), 0.0)); - INFO_LOG() << " setSimulatedPositionRequest ..."; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; m_ppmFtc->setSimulatedPositionRequest(req, this); // expected condition: if (!waitForData([this]() { return !m_replyError; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } QVERIFY2(m_replyError == false, "ERROR, setupParticipant failed"); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.h index 86eb2a485..7879861ee 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_Limits/limits_module_test.h @@ -242,9 +242,9 @@ public: void onSetSimulatedPositionReply(const Core::FunctionReplyObject &reply) override { m_replyError = reply.error(); - DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError; if (!reply.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << reply.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << reply.translated(); } // ChargeAdministrationModifyReplyHandler interface diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp index 3f617f566..ee2c912a0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.cpp @@ -79,39 +79,39 @@ ModuleTestAesOthers::ModuleTestAesOthers(int domainId, int exerciseId) void ModuleTestAesOthers::onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onSetSimulatedPositionReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onSetSimulatedPositionReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onExplosionClusterModifyReply: " << replyObject.translated(); } void ModuleTestAesOthers::onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onBoobyTrapModifyReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onBoobyTrapModifyReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onBoobyTrapModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onBoobyTrapModifyReply: " << replyObject.translated(); } void ModuleTestAesOthers::onBoobyTrapRemoveReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << " got reply - onBoobyTrapRemoveReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onBoobyTrapRemoveReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onBoobyTrapRemoveReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onBoobyTrapRemoveReply: " << replyObject.translated(); } void ModuleTestAesOthers::onOffRouteMineModifyReply(const Core::FunctionReplyObject &replyObject) { m_replyError = replyObject.error(); - DEBUG_LOG() << " got reply - onOffRouteMineModifyReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onOffRouteMineModifyReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onOffRouteMineModifyReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onOffRouteMineModifyReply: " << replyObject.translated(); } void ModuleTestAesOthers::onOffRouteMineRemoveReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << " got reply - onOffRouteMineRemoveReply : " << m_replyError; + DEBUG_LOG(m_logger) << " got reply - onOffRouteMineRemoveReply : " << m_replyError; if (!replyObject.str().empty()) - ERROR_LOG() << " got reply - onOffRouteMineRemoveReply: " << replyObject.translated(); + ERROR_LOG(m_logger) << " got reply - onOffRouteMineRemoveReply: " << replyObject.translated(); } @@ -128,10 +128,10 @@ void ModuleTestAesOthers::boobyTrapChanged(const BoobyTrap &data, DataModificati if (m_dataBoobyTrap.effectStart().is_set()) startTimeMsec = m_dataBoobyTrap.effectStart().get(); - DEBUG_LOG() << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id() << ", state=" << m_dataBoobyTrap.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap.id() << ", state=" << m_dataBoobyTrap.effectStateId() << ", startTimeMsec=" << startTimeMsec << ", cntBoobyTrap=" << m_counterDds.cntBoobyTrap; - TRACE_LOG() << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap; + TRACE_LOG(m_logger) << " got changed - m_dataBoobyTrap: " << m_dataBoobyTrap; } void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModification modType) @@ -147,10 +147,10 @@ void ModuleTestAesOthers::offRouteMineChanged(const OffRouteMine &data, DataModi if (m_dataOffRouteMine.effectStart().is_set()) startTimeMsec = m_dataOffRouteMine.effectStart().get(); - DEBUG_LOG() << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id() << ", state=" << m_dataOffRouteMine.effectStateId() + DEBUG_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine.id() << ", state=" << m_dataOffRouteMine.effectStateId() << ", startTimeMsec=" << startTimeMsec << ", cntOffRouteMine=" << m_counterDds.cntOffRouteMine; - TRACE_LOG() << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine; + TRACE_LOG(m_logger) << " got changed - m_dataOffRouteMine: " << m_dataOffRouteMine; } @@ -160,7 +160,7 @@ void ModuleTestAesOthers::onAesItemViewChanged(const AesItemView &aesItemView, D return; AreaEffectSimulation::AesType_def::type aesType = aesItemView.aesTypeId().underlying(); - DEBUG_LOG() << " got onAesItemViewChanged, aesType=" << aesType; + DEBUG_LOG(m_logger) << " got onAesItemViewChanged, aesType=" << aesType; switch (aesType) { @@ -197,7 +197,7 @@ bool ModuleTestAesOthers::waitForData(const std::function &func, int re for (int i = 0; i < retryCount; ++i) { - DEBUG_LOG() << " waitForData - i: " << i; + DEBUG_LOG(m_logger) << " waitForData - i: " << i; if (func()) return true; QTest::qWait(100); @@ -210,23 +210,23 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int // expected condition: if (!waitForData([this]() { return m_replyError == false; }, 1)) { - ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber; return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) { - ERROR_LOG() << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) { - ERROR_LOG() << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataBoobyTrapr with id " << m_dataBoobyTrap.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -234,10 +234,10 @@ void ModuleTestAesOthers::waitForEffectStatesBT(int lineNumber, int durPrep, int if (durExp > 0) { - INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; if (!waitForData([this]() { return m_dataBoobyTrap.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) { - ERROR_LOG() << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataBoobyTrap with id " << m_dataBoobyTrap.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -250,23 +250,23 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in // expected condition: if (!waitForData([this]() { return m_replyError == false; }, 1)) { - ERROR_LOG() << "Error on request" << ", lineNumber = " << lineNumber; + ERROR_LOG(m_logger) << "Error on request" << ", lineNumber = " << lineNumber; return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsPrepared..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsPrepared..."; if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsPrepared;}, durPrep)) { - ERROR_LOG() << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsPrepared of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; } - INFO_LOG() << Q_FUNC_INFO << " waiting for EsActivated..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsActivated..."; if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated;}, durAct)) { - ERROR_LOG() << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsActivated of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -274,10 +274,10 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in if (durExp > 0) { - INFO_LOG() << Q_FUNC_INFO << " waiting for EsExpired..."; + INFO_LOG(m_logger) << Q_FUNC_INFO << " waiting for EsExpired..."; if (!waitForData([this]() { return m_dataOffRouteMine.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired;}, durExp)) { - ERROR_LOG() << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() + ERROR_LOG(m_logger) << "Timeout waiting for EsExpired of m_dataOffRouteMine with id " << m_dataOffRouteMine.id() << ", lineNumber = " << lineNumber; QVERIFY2(false, "ERROR, exit"); return; @@ -288,7 +288,7 @@ void ModuleTestAesOthers::waitForEffectStatesORM(int lineNumber, int durPrep, in void ModuleTestAesOthers::setupParticipants() { - INFO_LOG() << " setupParticipant ..."; + INFO_LOG(m_logger) << " setupParticipant ..."; QVERIFY2(m_ppmFtc, "ERROR, no m_ppmFtc"); @@ -304,18 +304,18 @@ void ModuleTestAesOthers::setupParticipants() QPointF pos = utmPos.geographic(); req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); - INFO_LOG() << " setSimulatedPositionRequest ..."; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; m_ppmFtc->setSimulatedPositionRequest(req, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } } - INFO_LOG() << " setSimulatedPositionRequest ...DONE"; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ...DONE"; } bool ModuleTestAesOthers::checkParticipant_18() @@ -324,7 +324,7 @@ bool ModuleTestAesOthers::checkParticipant_18() const int partId = 18; const ParticipantManagement::ParticipantPosition &pos = m_ppmDtc->participantPosition(partId); QString mgrsStr = LtsCoordTrans::mgrsFromGeographic(pos.pos().lon(), pos.pos().lat()); - INFO_LOG() << " for partId = '" << partId << "', we got position: " << mgrsStr; + INFO_LOG(m_logger) << " for partId = '" << partId << "', we got position: " << mgrsStr; return mgrsStr == QStringLiteral("32U PD 76900 18100"); } @@ -392,17 +392,17 @@ int ModuleTestAesOthers::doMoveParticipant(int participantId, const QString &new QPointF pos = utmPos.geographic(); req.position(Core::GeoPosition(pos.x(), pos.y(), 0.0)); - INFO_LOG() << " setSimulatedPositionRequest ..."; + INFO_LOG(m_logger) << " setSimulatedPositionRequest ..."; m_replyError = true; m_ppmFtc->setSimulatedPositionRequest(req, this); // expected condition: if (!waitForData([this]() { return m_replyError == false; })) { - ERROR_LOG() << "Error on request"; + ERROR_LOG(m_logger) << "Error on request"; } } - INFO_LOG() << " doMoveParticipant ...DONE"; + INFO_LOG(m_logger) << " doMoveParticipant ...DONE"; return true; } @@ -423,14 +423,14 @@ void ModuleTestAesOthers::initTestCase() QVERIFY2(bInit, "ERROR, ddsConnector.init failed!!"); if (!bInit) { - ERROR_LOG() << " ERROR, ddsConnector.init failed!!"; + ERROR_LOG(m_logger) << " ERROR, ddsConnector.init failed!!"; return; } - INFO_LOG() << " ddsConnector.init successfull"; + INFO_LOG(m_logger) << " ddsConnector.init successfull"; // cmd m_ddsConnector->initPublisherSubscriber(); - INFO_LOG() << " ddsConnector.initPublisherSubscriber done"; + INFO_LOG(m_logger) << " ddsConnector.initPublisherSubscriber done"; // // Aes @@ -610,7 +610,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name, return; } - INFO_LOG() << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId << ", name =" << name << "'" << ", impactCoord= " << impactCoord.mgrs() << ", rotationAngle = " << rotationAngle @@ -666,7 +666,7 @@ void ModuleTestAesOthers::test_boobyTrap_02_IMPL(const QString &name, // wait to let it disappear: waitForData([]() { return false; }, 15); - INFO_LOG() << Q_FUNC_INFO << " END" + INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << ", name =" << name << "'" << ", impactCoord= " << impactCoord.mgrs() << ", rotationAngle = " << rotationAngle @@ -713,7 +713,7 @@ void ModuleTestAesOthers::test_offRouteMine_02() return; } - INFO_LOG() << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; + INFO_LOG(m_logger) << Q_FUNC_INFO << " START, m_traingAreaId = " << m_traingAreaId; QVERIFY2(checkParticipant_18(), "ERROR, checkParticipant_5 failed!!"); @@ -767,7 +767,7 @@ void ModuleTestAesOthers::test_offRouteMine_02() // wait to let it disappear: waitForData([]() { return false; }, 15); - INFO_LOG() << Q_FUNC_INFO << " END" << ", name =" << orm.name() << "'"; + INFO_LOG(m_logger) << Q_FUNC_INFO << " END" << ", name =" << orm.name() << "'"; } void ModuleTestAesOthers::cleanupTestCase() @@ -775,9 +775,9 @@ void ModuleTestAesOthers::cleanupTestCase() // finish last (dds) calls: waitForData([]() { return false; }, 10); - INFO_LOG() << " ddsConnector destroy..."; + INFO_LOG(m_logger) << " ddsConnector destroy..."; m_ddsConnector.reset(); - INFO_LOG() << " ddsConnector destroy...DONE"; + INFO_LOG(m_logger) << " ddsConnector destroy...DONE"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.h index 504ac1af2..e6e95c287 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTest_others/aes_others_module_test.h @@ -54,6 +54,8 @@ public: ModuleTestAesOthers(int domainId, int exerciseId); protected: + +NGL::INGLLogger &m_logger; void onSetSimulatedPositionReply(const Core::FunctionReplyObject &replyObject) override; void onBoobyTrapModifyReply(const Core::FunctionReplyObject &replyObject) override; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.cpp index b1ff4c534..e0923ca03 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.cpp @@ -54,11 +54,11 @@ bool ConvertMineArea::init(int exerciseId) if (!ok) { - ERROR_LOG() << "Error opening db, exiting.."; + ERROR_LOG(m_logger) << "Error opening db, exiting.."; return false; } - ERROR_LOG() << "Database open"; + ERROR_LOG(m_logger) << "Database open"; return true; } @@ -81,15 +81,15 @@ bool ConvertMineArea::initDBInternal() QSqlDriver *driver = m_dbConnection.driver(); if (!driver) { - WARNING_LOG() << "No SQL driver loaded - no database available!"; + WARNING_LOG(m_logger) << "No SQL driver loaded - no database available!"; return false; } const QString driverName = m_dbConnection.driverName(); - DEBUG_LOG() << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName() + DEBUG_LOG(m_logger) << "Connected to database " << m_dbConnection.databaseName() << "@" << m_dbConnection.hostName() << ", schema: " << schemaName() << ", used driver: " << driverName; if (!m_dbConnection.isOpen()) { - WARNING_LOG() << "Database connection is no open - can not initialize database interface"; + WARNING_LOG(m_logger) << "Database connection is no open - can not initialize database interface"; return false; } if (driverName == QLatin1String("QSQLITE")) @@ -189,9 +189,9 @@ bool ConvertMineArea::tryConvertMineArea() data.endPosition = endPositionUtm.geographic(); - DEBUG_LOG() << "aesId: " << data.mineAreaId << ", id: " << data.id; - DEBUG_LOG() << "EndpositionUtm: x: " << endPositionUtm.x << ", y: " << endPositionUtm.y; - DEBUG_LOG() << "Geographic: x: " << data.endPosition.x() << " y: " << data.endPosition.y(); + DEBUG_LOG(m_logger) << "aesId: " << data.mineAreaId << ", id: " << data.id; + DEBUG_LOG(m_logger) << "EndpositionUtm: x: " << endPositionUtm.x << ", y: " << endPositionUtm.y; + DEBUG_LOG(m_logger) << "Geographic: x: " << data.endPosition.x() << " y: " << data.endPosition.y(); vecMineArea.append(data); } @@ -204,7 +204,7 @@ bool ConvertMineArea::tryConvertMineArea() if (!m_query->prepare(stmt3)) { m_lastError = m_query->lastError(); - ERROR_LOG() << "lastError: " << m_lastError.text(); + ERROR_LOG(m_logger) << "lastError: " << m_lastError.text(); return false; } for ( const Database::AesMineAreaSegment &mineAreaSegment : vecMineArea) @@ -216,7 +216,7 @@ bool ConvertMineArea::tryConvertMineArea() if (!m_query->exec(m_bEmitMessageOnError)) { m_lastError = m_query->lastError(); - ERROR_LOG() << "lastError: " << m_lastError.text(); + ERROR_LOG(m_logger) << "lastError: " << m_lastError.text(); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.h index 18a635fd5..6cf673d17 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_convert_mine_area.h @@ -47,6 +47,8 @@ public: QSqlError getLastError() const; private: + +NGL::INGLLogger &m_logger; QSqlDatabase m_dbConnection; NSqlQuery *m_query; QSqlError m_lastError; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp index 7db290ffc..2f40badbb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.cpp @@ -29,7 +29,7 @@ TestBase::TestBase(const char *loggerName, QObject *parent) bool TestBase::init(int domainId, int exerciseId, int testId) { - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; // initialize DDS @@ -38,15 +38,15 @@ bool TestBase::init(int domainId, int exerciseId, int testId) return false; m_ddsConnector->initPublisherSubscriber(); - INFO_LOG() << "init create ftc"; + INFO_LOG(m_logger) << "init create ftc"; m_ftc = AreaEffectSimulation::Interface::Ftc::create(m_ddsConnector); - INFO_LOG() << "init init ftc"; + INFO_LOG(m_logger) << "init init ftc"; bool bRet = m_ftc->enableAll(); m_dtc = AreaEffectSimulation::Interface::Dtc::create(m_ddsConnector); bRet = bRet && m_dtc->enableAll(); - INFO_LOG() << "init end - bRet = " << bRet; + INFO_LOG(m_logger) << "init end - bRet = " << bRet; return bRet; } @@ -67,27 +67,27 @@ bool TestBase::checkAesItem(const AreaEffectSimulation::AesItem &a, { if (a.name() != b.name()) { - WARNING_LOG() << "name does not match: " << a.name() << " - " << b.name(); + WARNING_LOG(m_logger) << "name does not match: " << a.name() << " - " << b.name(); return false; } if (a.effectStart() != b.effectStart()) { - WARNING_LOG() << "effectStart does not match: " << a.effectStart() << " - " << b.effectStart(); + WARNING_LOG(m_logger) << "effectStart does not match: " << a.effectStart() << " - " << b.effectStart(); return false; } if (a.chargeStruct().chargeTypeId() != b.chargeStruct().chargeTypeId()) { - WARNING_LOG() << "chargeTypeId does not match: " << a.chargeStruct().chargeTypeId() << " - " << b.chargeStruct().chargeTypeId(); + WARNING_LOG(m_logger) << "chargeTypeId does not match: " << a.chargeStruct().chargeTypeId() << " - " << b.chargeStruct().chargeTypeId(); return false; } if (a.partyId() != b.partyId()) { - WARNING_LOG() << "partyId does not match: " << a.partyId() << " - " << b.partyId(); + WARNING_LOG(m_logger) << "partyId does not match: " << a.partyId() << " - " << b.partyId(); return false; } if (a.participantId() != b.participantId()) { - WARNING_LOG() << "participantId does not match: " << a.participantId() << " - " << b.participantId(); + WARNING_LOG(m_logger) << "participantId does not match: " << a.participantId() << " - " << b.participantId(); return false; } return true; @@ -95,19 +95,19 @@ bool TestBase::checkAesItem(const AreaEffectSimulation::AesItem &a, void TestBase::failExit() { - ERROR_LOG() << "fail exit!"; + ERROR_LOG(m_logger) << "fail exit!"; m_bTestsSuccessful = false; QTimer::singleShot(0, qApp, &QCoreApplication::quit); } void TestBase::onAesCreateReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got create " << m_aesTypeName << " reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got create " << m_aesTypeName << " reply with id " << replyObject.id() << ", error = " << replyObject.error() << " and errorString = '" << replyObject.translated() << "'"; m_replyError = replyObject.error(); if (m_replyError && !m_bExpectedFailure) - ERROR_LOG() << "Got create " << m_aesTypeName << " reply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got create " << m_aesTypeName << " reply error: " << replyObject(); else m_expectedAesId = replyObject.id(); // only works as expected because reply is sent before publishing data occours } @@ -116,34 +116,34 @@ void TestBase::onAesModifyReply(const Core::FunctionReplyObject &replyObject) { if (m_expectedAesId != replyObject.id()) return; - INFO_LOG() << "Got modify " << m_aesTypeName << " reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got modify " << m_aesTypeName << " reply with id " << replyObject.id() << ", error = " << replyObject.error() << " and errorString = '" << replyObject.translated() << "'"; m_replyError = replyObject.error(); if (m_replyError && !m_bExpectedFailure) - ERROR_LOG() << "Got modify " << m_aesTypeName << " reply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got modify " << m_aesTypeName << " reply error: " << replyObject(); else m_expectedAesId = replyObject.id(); } void TestBase::onAesRemoveReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got remove " << m_aesTypeName << " reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply with id " << replyObject.id() << " and errorString " << replyObject.translated(); m_replyError = replyObject.error(); if (m_replyError && !m_bExpectedFailure) - ERROR_LOG() << "Got remove " << m_aesTypeName << " reply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply error: " << replyObject(); else m_expectedAesId = replyObject.id(); } void TestBase::onAesTriggerReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got trigger " << m_aesTypeName << " reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got trigger " << m_aesTypeName << " reply with id " << replyObject.id() << " and errorString " << replyObject.translated(); m_replyError = replyObject.error(); if (m_replyError && !m_bExpectedFailure) - ERROR_LOG() << "Got remove " << m_aesTypeName << " reply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got remove " << m_aesTypeName << " reply error: " << replyObject(); else m_expectedAesId = replyObject.id(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.h index edfd45d15..29c104f2c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/ModuleTests/aes_test_base.h @@ -46,17 +46,17 @@ protected: template void onAesChanged(const T &dataIn, DataModification modType, T &dataOut) { - INFO_LOG() << "Got " << m_aesTypeName << " with mod type " << (int)modType + INFO_LOG(m_logger) << "Got " << m_aesTypeName << " with mod type " << (int)modType << ", id: " << dataIn.id() << ", chargeType: " << dataIn.chargeStruct().chargeTypeId() << ", effectState: " << dataIn.effectStateId(); if (m_expectedAesId == dataIn.id()) { - DEBUG_LOG() << "Expected aes id - updating data for " << m_aesTypeName; + DEBUG_LOG(m_logger) << "Expected aes id - updating data for " << m_aesTypeName; dataOut = dataIn; } if (modType == DataModification::eRemoved && dataOut.id() == dataIn.id()) { - DEBUG_LOG() << "Removed " << m_aesTypeName << " with id " << dataIn.id(); + DEBUG_LOG(m_logger) << "Removed " << m_aesTypeName << " with id " << dataIn.id(); m_expectedAesId = dataIn.id(); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp index 729dcd3e4..559968a52 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.cpp @@ -83,8 +83,8 @@ void UnitTestTrajectory::test_duration() posEnd = LtsUtils::QPoint3D(10000, 0, 0); duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 28.55686245854129), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.80338497797008), "beta failed"); QVERIFY2(qFuzzyCompare(vOut, 377.1213082434484), "v failed"); @@ -93,8 +93,8 @@ void UnitTestTrajectory::test_duration() posEnd = LtsUtils::QPoint3D(10000, 0, 10); // ^^ duration = TrajectoryHelper::flightDurationSec(posStart, posEnd, heightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << posEnd << ", heightAbs " << heightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 28.48529092398576), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 21.75384726032234), "beta failed"); QVERIFY2(qFuzzyCompare(vOut, 377.9382777961657), "v failed"); @@ -130,8 +130,8 @@ void UnitTestTrajectory::test_calcDuration() double duration; duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", posEnd " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 4.515236409857309), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed"); @@ -149,15 +149,15 @@ void UnitTestTrajectory::test_calcDuration2() for (peakHeightAbs = 5; peakHeightAbs < 12; ++peakHeightAbs) { duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; } { // Low peakHeightAbs = 8; duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 2.554203427256403), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 17.74467162505693), "beta failed"); // 18.9 ?? @@ -167,14 +167,14 @@ void UnitTestTrajectory::test_calcDuration2() for (peakHeightAbs = 71; peakHeightAbs < 79; ++peakHeightAbs) { duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; } { // High peakHeightAbs = 73; duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] = " << std::setprecision(16) << duration << ", beta [deg] = " << betaOut * rad2deg() << ", v = " << vOut; QVERIFY2(qFuzzyCompare(duration, 7.715639359362986), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 71.09542415738834), "beta failed"); @@ -195,8 +195,8 @@ void UnitTestTrajectory::test_calcPeak() double peakHeightAbs; peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut); - INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW"; - INFO_LOG() << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW"; + INFO_LOG(m_logger) << " -> peakHeightAbs " << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(peakHeightAbs, 25), "peakHeight failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 45), "beta failed"); @@ -215,8 +215,8 @@ void UnitTestTrajectory::test_calcPeak2() double peakHeightAbs; peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut); - INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW"; - INFO_LOG() << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos << ", time " << time << " - LOW"; + INFO_LOG(m_logger) << " -> peakHeightAbs " << std::setprecision(16) << peakHeightAbs << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; // eightAbs 122.625, beta [deg] 78.47682271026333, v 50.0589902015612 (ctory/trajectory_unit_test.cpp:178) QVERIFY2(qFuzzyCompare(peakHeightAbs, 122.625), "peakHeight failed"); @@ -241,13 +241,13 @@ void UnitTestTrajectory::test_calcPeak3_continuity() const int flightDurationMax = 50; const int flightDurationIncrement = 1; - INFO_LOG() << "peakHeight with posStart " << posStart << ", posEnd " << endPos; + INFO_LOG(m_logger) << "peakHeight with posStart " << posStart << ", posEnd " << endPos; for (int curFD = flightDurationMin; curFD <= flightDurationMax; curFD += flightDurationIncrement) { double time = curFD; peakHeightAbs = TrajectoryHelper::peakHeightAbs(posStart, endPos, time, &betaOut, &vOut); - INFO_LOG() << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut; + INFO_LOG(m_logger) << " time=" << time << " -> peakHeightAbs=" << std::setprecision(5) << std::setw(10) << std::setfill(' ') << peakHeightAbs << ", beta [deg]=" << betaOut * rad2deg() << ", v=" << std::setw(5) << vOut; } // for } @@ -346,20 +346,20 @@ void UnitTestTrajectory::test_calcDuration_realistic40km() double duration; int peakHeightAbs; - INFO_LOG() << "Loop: START"; + INFO_LOG(m_logger) << "Loop: START"; for (peakHeightAbs = 500; peakHeightAbs <= 3000; peakHeightAbs+=250) { duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "Loop: flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; } - INFO_LOG() << "Loop: END"; + INFO_LOG(m_logger) << "Loop: END"; // Als realistisch stugen wir mal eine Geschwindigkeit von 1000m/s ein: peakHeightAbs = 2000; duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "explicit; flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 40.38550218769218 ), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 11.30993247402021), "beta failed"); @@ -380,8 +380,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances() // 1000m { duration1 = TrajectoryHelper::flightDurationSec(posStart, endPos1, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos1 << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration1 [sec] " << std::setprecision(16) << duration1 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration1, 10.01527884771829), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 26.19718605846828), "beta failed"); @@ -391,8 +391,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances() // 2000m { duration2 = TrajectoryHelper::flightDurationSec(posStart, endPos2, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos2 << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration2 [sec] " << std::setprecision(16) << duration2 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration2, 10.01527884771829), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 13.82033952701046), "beta failed"); @@ -403,8 +403,8 @@ void UnitTestTrajectory::test_calcDuration_differentDistances() // 2000m, 99m { duration3 = TrajectoryHelper::flightDurationSec(posStart, endPos3, peakHeightAbs, &betaOut, &vOut); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs; - INFO_LOG() << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos3 << ", peakHeight " << peakHeightAbs; + INFO_LOG(m_logger) << " -> duration3 [sec] " << std::setprecision(16) << duration3 << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration3, 7.219644478296471 ), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 10.05585466470648 ), "beta failed"); @@ -438,9 +438,9 @@ void UnitTestTrajectory::test_calcDuration_downToZero() peakHeightAbs = 123; duration = TrajectoryHelper::flightDurationSec(posStart, endPos, peakHeightAbs, &betaOut, &vOut, &reason); - INFO_LOG() << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; - INFO_LOG() << " -> reason '" << reason << "'"; - INFO_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + INFO_LOG(m_logger) << "flightDurationSec with posStart " << posStart << ", endPos " << endPos << ", peakHeightAbs " << peakHeightAbs; + INFO_LOG(m_logger) << " -> reason '" << reason << "'"; + INFO_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(duration, 7.347880052033394), "flightDurationSec failed"); QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), 14.18247037775737), "beta failed"); // 18.9 ?? @@ -509,7 +509,7 @@ void UnitTestTrajectory::test_realStartPoint() LtsUtils::QPoint3D realStartPoint = TrajectoryHelper::realStartPoint(apo, idealHit); - ERROR_LOG() << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint; + ERROR_LOG(m_logger) << " apo = " << apo << " idealHit = " << idealHit << " -> = realStartPoint =" << realStartPoint; QVERIFY2(qFuzzyCompare(realStartPoint, result), "realStartPoint failed"); // next step: @@ -517,8 +517,8 @@ void UnitTestTrajectory::test_realStartPoint() double duration; const double heightAbs = apo.z(); duration = TrajectoryHelper::flightDurationSec(realStartPoint, idealHit, heightAbs, &betaOut, &vOut); - ERROR_LOG() << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs; - ERROR_LOG() << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; + ERROR_LOG(m_logger) << "flightDurationSec with realStartPoint " << realStartPoint << ", idealHit " << idealHit << ", heightAbs " << heightAbs; + ERROR_LOG(m_logger) << " -> duration [sec] " << std::setprecision(16) << duration << ", beta [deg] " << betaOut * rad2deg() << ", v " << vOut; QVERIFY2(qFuzzyCompare(betaOut * rad2deg(), betaDeg), "flightDurationSec failed"); } @@ -581,18 +581,18 @@ void UnitTestTrajectory::test_generateTrajectoryBiedziak() // check Scheitelpunkt / Apogaeum { const auto &item35 = trajectoryOut[35]; - INFO_LOG() << "iqtem35 = " << item35; + INFO_LOG(m_logger) << "iqtem35 = " << item35; QVERIFY2(qFuzzyCompare(item35.z(), 148.044675655973), "TrajectoryGenerator::trajectoryOut failed"); } { // Hier ist der Scheitelpunkt: const auto &item36 = trajectoryOut[36]; - INFO_LOG() << "item36 = " << item36; + INFO_LOG(m_logger) << "item36 = " << item36; QVERIFY2(qFuzzyCompare(item36.z(), 148.087567297406), "TrajectoryGenerator::trajectoryOut failed"); } { const auto &item37 = trajectoryOut[37]; - INFO_LOG() << "item37 = " << item37; + INFO_LOG(m_logger) << "item37 = " << item37; QVERIFY2(qFuzzyCompare(item37.z(), 147.905786767084), "TrajectoryGenerator::trajectoryOut failed"); } } @@ -611,8 +611,8 @@ void UnitTestTrajectory::test_vulcano_beta_Abschusswinkel() const double betaRad = XY::calculateBetaRad(v0, height); const double betaDeg = betaRad * LtsCoordTrans::rad2deg(); - INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height; - INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg; + INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height; + INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg; QVERIFY2(qFuzzyCompare(betaDeg, 29.99727415506499), "calculateBetaRad failed"); } @@ -644,13 +644,13 @@ void UnitTestTrajectory::test_vulcano_apogaeumCosmos() const double betaRad = XY::calculateBetaRad(v0, height); const double betaDeg = betaRad * LtsCoordTrans::rad2deg(); - INFO_LOG() << "calculateBetaRad with v0 = " << v0 << ", height = " << height; - INFO_LOG() << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg; + INFO_LOG(m_logger) << "calculateBetaRad with v0 = " << v0 << ", height = " << height; + INFO_LOG(m_logger) << " -> betaRad = " << betaRad << ", betaDeg = " << betaDeg; const QPointF &apo = XY::calculateApogaeum(v0, betaRad); - INFO_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg; - INFO_LOG() << " -> apo " << apo; + INFO_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg; + INFO_LOG(m_logger) << " -> apo " << apo; QVERIFY2(qFuzzyCompare(apo.x(), 50 ), "calculateBetaRad/calculateApogaeum failed"); // 100m / 2.0 QVERIFY2(qFuzzyCompare(apo.y(), height), "calculateBetaRad/calculateApogaeum failed"); @@ -691,15 +691,15 @@ void UnitTestTrajectory::test_vulcano_apogaeum() const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad()); const QVector2D apoDiff(apo - expectedAPO); - DEBUG_LOG() << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg; - DEBUG_LOG() << " -> apo " << apo << " diff = "<< apoDiff.length(); + DEBUG_LOG(m_logger) << "calculateApogaeum with v0 = " << v0 << ", betaDeg = " << betaDeg; + DEBUG_LOG(m_logger) << " -> apo " << apo << " diff = "<< apoDiff.length(); QVERIFY2(apoDiff.length() < 1, "calculateApogaeum failed"); // und zurĂźck: const double calcBetaRad = XY::calculateBetaRad(v0, expectedAPO.y()); double betaDiff = fabs(calcBetaRad*LtsCoordTrans::rad2deg() - betaDeg); - DEBUG_LOG() << " zurĂźck: betaDiff = " << betaDiff; + DEBUG_LOG(m_logger) << " zurĂźck: betaDiff = " << betaDiff; QVERIFY2(betaDiff < 0.001, "calculateBetaRad failed"); } @@ -784,15 +784,15 @@ void UnitTestTrajectory::test_vulcano_tap() const QPointF &tapRelToImpact = XY::calculateTapRelToIdealHit(vFall, alphaDeg*LtsCoordTrans::deg2rad(), tapT); - INFO_LOG() << "calculateTapRelToIdealHit with vFall = " << vFall + INFO_LOG(m_logger) << "calculateTapRelToIdealHit with vFall = " << vFall << ", alphaDeg = " << alphaDeg << ", tapT = " << tapT; - INFO_LOG() << " -> tapRelToImpact " << tapRelToImpact + INFO_LOG(m_logger) << " -> tapRelToImpact " << tapRelToImpact << " , lenght = " << QVector2D(tapRelToImpact).length(); QVERIFY2((expectedLength - QVector2D(tapRelToImpact).length()) < 1, "calculateTapRelToIdealHit abs failed"); const QVector2D diff(tapRelToImpact - expectedTAP); - INFO_LOG() << " -> diff.QVector2D.length = " << diff.length(); + INFO_LOG(m_logger) << " -> diff.QVector2D.length = " << diff.length(); QVERIFY2(diff.length() < 0.1, "calculateTapRelToIdealHit rel failed"); } @@ -821,10 +821,10 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve() QFETCH(double, expectedDeltaTime); const QPointF &apo = XY::calculateApogaeum(v0, betaDeg*LtsCoordTrans::deg2rad()); - INFO_LOG() << ", apo " << apo; + INFO_LOG(m_logger) << ", apo " << apo; const QVector2D diff(apo - expectedAPO); - INFO_LOG() << ", diff " << diff.length(); + INFO_LOG(m_logger) << ", diff " << diff.length(); QVERIFY2(diff.length() < 0.1, "calculateApogaeum rel failed"); // @@ -839,7 +839,7 @@ void UnitTestTrajectory::test_vulcano_ballisticCurve() const QVector &phase1_bal = XY::generateBallisticCurveUntil(v0, betaDeg*LtsCoordTrans::deg2rad(), x_distancePhase1, secPerIntervall, &deltaXperStep_out, &secPerIntervall_out); - INFO_LOG() << "generateBallisticCurveUntil: " + INFO_LOG(m_logger) << "generateBallisticCurveUntil: " << ", phase1_bal.size() = " << phase1_bal.size() << ", phase1_bal.last() = " << std::setprecision(16) << phase1_bal.last() << ", deltaXperStep_out = " << std::setprecision(16) << deltaXperStep_out @@ -957,10 +957,10 @@ void UnitTestTrajectory::test_vulcano_trajectory() &reasonOut); if (!reasonOut.isEmpty()) - ERROR_LOG() << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'"; + ERROR_LOG(m_logger) << " trajectoryVulcano failed, reasonOut = '" << reasonOut << "'"; - INFO_LOG() << "trajectoryVulcano: " + INFO_LOG(m_logger) << "trajectoryVulcano: " << ", ret = " << ret << ", trajectoryOut.size() = " << trajectoryOut.size(); @@ -968,7 +968,7 @@ void UnitTestTrajectory::test_vulcano_trajectory() QVERIFY2(trajectoryOut.size() == expectedSize, "trajectoryVulcano2 failed"); // const QPoint3D &apo3D = trajectoryOut[40]; // more or less wellknown -// INFO_LOG() << "trajectoryVulcano: " +// INFO_LOG(m_logger) << "trajectoryVulcano: " // << ", ret = " << ret // << ", trajectoryOut.size() = " << trajectoryOut.size() // << ", apo3D = " << apo3D; @@ -976,7 +976,7 @@ void UnitTestTrajectory::test_vulcano_trajectory() // // recalculate to distance between apo and origin (on flat xy) // LtsUtils::QPoint3D apoToOrigin = apo3D - origin; // double xyDist = QVector2D(apoToOrigin.toPointF()).length(); -// INFO_LOG() << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist; +// INFO_LOG(m_logger) << " -> apoToOrigin.length = " << std::setprecision(16) << xyDist; // QVERIFY2(fabs( 12248.0 - xyDist ) < 1, "generateBallisticCurveUntil3 failed"); // QVERIFY2(fabs( 8127.0 + origin.z() - apo3D.z() ) < 1, "generateBallisticCurveUntil4 failed"); @@ -993,7 +993,7 @@ void UnitTestTrajectory::test_vulcano_trajectory() int i=0; for (auto &item : std::as_const(trajectoryOut)) - INFO_LOG() << "i = " << i++ << ", item " << item; + INFO_LOG(m_logger) << "i = " << i++ << ", item " << item; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.h index 684dbeef9..4649b13ab 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/UnitTest_Trajectory/trajectory_unit_test.h @@ -77,4 +77,6 @@ private Q_SLOTS: // void cleanup(); private: + +NGL::INGLLogger &m_logger; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.cpp index 5111218ba..2e368c544 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.cpp @@ -85,22 +85,22 @@ void TrajectoryGenerator::cleanup() void TrajectoryGenerator::initElevation(LtsElevation::LtsElevationManager *ltsElevationManager) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; m_ltsElevationManager = ltsElevationManager; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } LtsElevation::LtsElevationManager *TrajectoryGenerator::getElevationManager() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_ltsElevationManager; } bool TrajectoryGenerator::hasElevationManager() const { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return m_ltsElevationManager; } @@ -268,14 +268,14 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o CONT_T &trajectoryOut) { // use zone of impact: - INFO_LOG() << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y(); - INFO_LOG() << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y(); + INFO_LOG(m_logger) << " oPosition geo " << originatorPosition_geo.x() << " - " << originatorPosition_geo.y(); + INFO_LOG(m_logger) << " iPosition geo " << impactPosition_geo.x() << " - " << impactPosition_geo.y(); const LtsCoordTrans::UtmCoordinate &iPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(impactPosition_geo.toPointF()); const LtsCoordTrans::UtmCoordinate &oPosition = LtsCoordTrans::UtmCoordinate::fromGeographic(originatorPosition_geo.toPointF(), iPosition.zone); - INFO_LOG() << " oPosition " << oPosition.mgrs(); - INFO_LOG() << " iPosition " << iPosition.mgrs(); + INFO_LOG(m_logger) << " oPosition " << oPosition.mgrs(); + INFO_LOG(m_logger) << " iPosition " << iPosition.mgrs(); const double distance = sqrt(pow(iPosition.x - oPosition.x, 2.) + pow(iPosition.y - oPosition.y, 2.)); @@ -287,18 +287,18 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o oHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(originatorPosition_geo.x(), originatorPosition_geo.y()) : 0; if (oHeight < 300) oHeight = 100; - INFO_LOG() << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager..."; + INFO_LOG(m_logger) << " oPosition " << oPosition << " has no zValue provided (NaN), update via ltsElevationManager..."; } if (std::isnan(iHeight) && m_ltsElevationManager) { iHeight = m_ltsElevationManager ? m_ltsElevationManager->elevation(impactPosition_geo.x(), impactPosition_geo.y()) : 0; if (iHeight < 300) iHeight = 100; - INFO_LOG() << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. "; + INFO_LOG(m_logger) << " iPosition " << iPosition << " has no zValue provided (NaN), update via ltsElevationManager.. "; } - INFO_LOG() << " oPosition " << oPosition << " ; oHeight=" << oHeight; - INFO_LOG() << " iPosition " << iPosition << " ; iHeight=" << iHeight; + INFO_LOG(m_logger) << " oPosition " << oPosition << " ; oHeight=" << oHeight; + INFO_LOG(m_logger) << " iPosition " << iPosition << " ; iHeight=" << iHeight; // z-Values: const QVector &zValues = this->trajectoryBiedziak(distance, iHeight - oHeight, elevation_angle_degree); @@ -324,7 +324,7 @@ bool TrajectoryGenerator::generateTrajectoryBiedziak(const LtsUtils::QPoint3D &o p2D.x(), p2D.y(), oHeight + zValues[i]); // x, y, z } // for -//// DEBUG_LOG() << string4poly(geo); +//// DEBUG_LOG(m_logger) << string4poly(geo); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.h index f7064f0c9..143b8d9cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Trajectory/trajectory_generator.h @@ -89,6 +89,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject QString *reasonOut); protected: + NGL::INGLLogger &m_logger; /*! \name Ideal trajectory */ template bool generateTrajectoryBiedziak(const LtsUtils::QPoint3D &originatorPosition_geo, @@ -97,6 +98,7 @@ class TRAJECTORY_EXPORT TrajectoryGenerator : public QObject CONT_T &trajectoryOut); protected: + NGL::INGLLogger &m_logger; explicit TrajectoryGenerator(); public: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.cpp index e713ed0a7..0d7990464 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.cpp @@ -45,31 +45,31 @@ bool FireAutomaton::init(int32_t time, TimeType type, int32_t rounds, const QVec { if(m_state != State::Stopped && m_state != State::Uninitialized) { - ERROR_LOG() << " init failed - fire automaton must be in state unitialized or stopped."; + ERROR_LOG(m_logger) << " init failed - fire automaton must be in state unitialized or stopped."; return false; } if(time < 0) { - ERROR_LOG() << " init failed - time invalid."; + ERROR_LOG(m_logger) << " init failed - time invalid."; return false; } if(effectorIds.isEmpty()) { - ERROR_LOG() << " init failed - effector Ids invalid."; + ERROR_LOG(m_logger) << " init failed - effector Ids invalid."; return false; } if(rounds <= 0) { - ERROR_LOG() << " init failed - number of rounds invalid."; + ERROR_LOG(m_logger) << " init failed - number of rounds invalid."; return false; } if(pattern.isEmpty()) { - ERROR_LOG() << " init failed - invalid fire pattern."; + ERROR_LOG(m_logger) << " init failed - invalid fire pattern."; return false; } @@ -80,13 +80,13 @@ bool FireAutomaton::init(int32_t time, TimeType type, int32_t rounds, const QVec if(!readPattern(pattern)) { - ERROR_LOG() << " init failed - firing pattern invalid."; + ERROR_LOG(m_logger) << " init failed - firing pattern invalid."; return false; } if(!calculateSchedule(rounds)) { - ERROR_LOG() << " init failed - firing schedule invalid."; + ERROR_LOG(m_logger) << " init failed - firing schedule invalid."; return false; } @@ -166,7 +166,7 @@ bool FireAutomaton::start() { if(m_state != State::Stopped) { - ERROR_LOG() << " start failed - fire automaton must be in state stopped."; + ERROR_LOG(m_logger) << " start failed - fire automaton must be in state stopped."; return false; } @@ -187,7 +187,7 @@ bool FireAutomaton::resume() { if(m_state != State::Paused) { - ERROR_LOG() << " resume failed - fire automaton must be in state paused."; + ERROR_LOG(m_logger) << " resume failed - fire automaton must be in state paused."; return false; } @@ -207,7 +207,7 @@ bool FireAutomaton::pause() { if(m_state != State::Running) { - ERROR_LOG() << " pause failed - fire automaton must be in state running."; + ERROR_LOG(m_logger) << " pause failed - fire automaton must be in state running."; return false; } @@ -242,7 +242,7 @@ bool FireAutomaton::performStep() { if(m_state != State::Stopped && m_state != State::Stepping) { - ERROR_LOG() << " performStep failed - fire automaton must be in state stepping or stopped."; + ERROR_LOG(m_logger) << " performStep failed - fire automaton must be in state stepping or stopped."; return false; } @@ -278,7 +278,7 @@ bool FireAutomaton::readPattern(const QString& pattern) if(!patternElementFromString(element, patternElement)) { - WARNING_LOG() << " skipped invalid firing pattern elements."; + WARNING_LOG(m_logger) << " skipped invalid firing pattern elements."; continue; } @@ -290,7 +290,7 @@ bool FireAutomaton::readPattern(const QString& pattern) } else { - ERROR_LOG() << " a pattern may contain at most one fill element."; + ERROR_LOG(m_logger) << " a pattern may contain at most one fill element."; return false; } } @@ -300,7 +300,7 @@ bool FireAutomaton::readPattern(const QString& pattern) if(m_pattern.empty()) { - ERROR_LOG() << " error occured reading firing pattern."; + ERROR_LOG(m_logger) << " error occured reading firing pattern."; return false; } @@ -412,7 +412,7 @@ bool FireAutomaton::calculateSchedule(int32_t rounds) if(rounds > 0) { - ERROR_LOG() << " scheduling error - fire pattern does not provide sufficient slots to schedule all rounds. " << rounds; + ERROR_LOG(m_logger) << " scheduling error - fire pattern does not provide sufficient slots to schedule all rounds. " << rounds; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.h index f5e8e6db0..9e9a36fe3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/fire_automaton.h @@ -72,6 +72,7 @@ private slots: void nextTick(); private: + NGL::INGLLogger &m_logger; enum class PatternElement { All, AllFill, @@ -89,6 +90,7 @@ private: QVector getEffectorIds(int32_t tick) const; private: + NGL::INGLLogger &m_logger; QVector m_effectorIds; QVector m_pattern; QVector> m_schedule; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/firing_timer.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/firing_timer.cpp index 6b97a5ae7..e8b4f4e48 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/firing_timer.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/Utils/firing_timer.cpp @@ -132,18 +132,18 @@ FiringTimer::FiringTimer(const QString &debugInfo) { ++s_counter; d->m_debugInfo = debugInfo; - DEBUG_LOG() << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; - DEBUG_LOG() << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; } FiringTimer::~FiringTimer() { --s_counter; - DEBUG_LOG() << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " START, s_counter=" << s_counter << " this=" << this; QString debugInfoSave = d->m_debugInfo; delete d; - //DEBUG_LOG() << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; - DEBUG_LOG() << "debugInfo='" << debugInfoSave << "'" << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; + //DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; + DEBUG_LOG(m_logger) << "debugInfo='" << debugInfoSave << "'" << Q_FUNC_INFO << " END, s_counter=" << s_counter << " this=" << this; } void FiringTimer::setDebugInfo(const QString &debugInfo) @@ -153,14 +153,14 @@ void FiringTimer::setDebugInfo(const QString &debugInfo) void FiringTimer::reset() { - TRACE_LOG() << MY_Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; d->reset(); - TRACE_LOG() << MY_Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; } bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDurationMsec) { - TRACE_LOG() << MY_Q_FUNC_INFO << " START," + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START," << ", effectDurationMsec=" << effectDurationMsec << ", ammoCount=" << ammoCount << ", ammoFlightDurationMsec=" << ammoFlightDurationMsec; @@ -170,7 +170,7 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu d->m_ammoCount = ammoCount; d->m_ammoFlightDurationMsec = ammoFlightDurationMsec; d->m_intervallMsec = static_cast(d->m_effectDurationMsec) / d->m_ammoCount; // ensure float calculation - DEBUG_LOG() << MY_Q_FUNC_INFO << " m_intervallMsec " << d->m_intervallMsec; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " m_intervallMsec " << d->m_intervallMsec; d->m_firingTimer->stop(); d->m_firingTimer->setSingleShot(false); @@ -178,24 +178,24 @@ bool FiringTimer::init(long effectDurationMsec, int ammoCount, long ammoFlightDu connect(d->m_firingTimer, &QTimer::timeout, this, &FiringTimer::onFiringTimout, Qt::UniqueConnection); - TRACE_LOG() << MY_Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; return true; } bool FiringTimer::startFiring() { - TRACE_LOG() << MY_Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; if ((d->m_currentFiringMode != FiringMode::FM_Undefined) && (d->m_currentFiringMode != FiringMode::FM_Paused)) { - ERROR_LOG() << MY_Q_FUNC_INFO << " wrong firingMode, cur = " << (int)d->m_currentFiringMode; + ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode, cur = " << (int)d->m_currentFiringMode; return false; } if (remainingAmmoCount() <= 0) { - ERROR_LOG() << MY_Q_FUNC_INFO << " no ammo left" + ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left" << " (total ammoCount was: " << d->m_ammoCount << " cur firingMode = " << (int)d->m_currentFiringMode; return false; @@ -213,7 +213,7 @@ bool FiringTimer::startFiring() #endif // SUPPORT_STATE_CHANGE_DELAYED - DEBUG_LOG() << MY_Q_FUNC_INFO << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing with m_firedAmmoCount = " << d->m_firedAmmoCount; d->m_firingTimer->start(); d->m_currentFiringMode = FiringMode::FM_Active; @@ -227,7 +227,7 @@ bool FiringTimer::startFiring() d->m_pausedMsec += pausedElapsedMsec; d->m_etPaused->invalidate(); } - DEBUG_LOG() << MY_Q_FUNC_INFO << " start firing after [ms]: " << pausedElapsedMsec + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " start firing after [ms]: " << pausedElapsedMsec << ", m_activeMsec in total = " << d->m_activeMsec << ", m_pausedMsec in total = " << d->m_pausedMsec; @@ -256,7 +256,7 @@ bool FiringTimer::startFiring() // to fire at the beginning of the interval: onFiringTimout(); - TRACE_LOG() << MY_Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; return true; } @@ -270,17 +270,17 @@ bool FiringTimer::startFiringDelay(qint64 delayMsec) bool FiringTimer::pauseFiring() { - TRACE_LOG() << MY_Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; if (d->m_currentFiringMode != FiringMode::FM_Active) { - ERROR_LOG() << MY_Q_FUNC_INFO << " wrong firingMode"; + ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " wrong firingMode"; return false; } if (remainingAmmoCount() <= 0) { - ERROR_LOG() << MY_Q_FUNC_INFO << " no ammo left" + ERROR_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left" << " (total ammoCount was: " << d->m_ammoCount; return false; } @@ -293,7 +293,7 @@ bool FiringTimer::pauseFiring() #endif // SUPPORT_STATE_CHANGE_DELAYED - DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing at m_firedAmmoCount = " << d->m_firedAmmoCount; d->m_firingTimer->stop(); d->m_currentFiringMode = FiringMode::FM_Paused; d->m_etPaused->start(); @@ -305,14 +305,14 @@ bool FiringTimer::pauseFiring() const qint64 activeElapsedMsec = d->m_etActive->elapsed(); d->m_activeMsec += activeElapsedMsec; d->m_etActive->invalidate(); - DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec << ", m_activeMsec in total = " << d->m_activeMsec << ", m_pausedMsec in total = " << d->m_pausedMsec; QString log = QString(QStringLiteral("pauseFiring_at_%1")).arg(QDateTime::currentMSecsSinceEpoch()) ; d->m_logHistorie.append(log); - TRACE_LOG() << MY_Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; return true; } @@ -346,7 +346,7 @@ long FiringTimer::intervallMsec() const #ifdef SUPPORT_STATE_CHANGE_DELAYED void FiringTimer::emitStateChangeDelayed(AreaEffectSimulation::FiringTimer::CMD cmd, int firedAmmoCount) { - DEBUG_LOG() << MY_Q_FUNC_INFO << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " SUPPORT_STATE_CHANGE_DELAYED: " << cmd << ", firedAmmoCount = " << firedAmmoCount; emit stateChangeDelayedAsInt(static_cast(cmd), firedAmmoCount); } @@ -380,11 +380,11 @@ QString FiringTimer::toString(const CMD cmd) void FiringTimer::onFiringTimout() { - TRACE_LOG() << MY_Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; ++d->m_firedAmmoCount; - INFO_LOG() << MY_Q_FUNC_INFO << " emit firing with: " << d->m_firedAmmoCount + INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit firing with: " << d->m_firedAmmoCount << " of total ammoCount = " << d->m_ammoCount; emit firing(d->m_firedAmmoCount, d->m_ammoCount); @@ -396,7 +396,7 @@ void FiringTimer::onFiringTimout() int currentFiringNumber = d->m_firedAmmoCount; int totalFiringNumber = d->m_ammoCount; - DEBUG_LOG() << MY_Q_FUNC_INFO << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber; + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " XXXXXXXXX schedule 'emit impact' " << currentFiringNumber; QTimer::singleShot(d->m_ammoFlightDurationMsec, this, [this, currentFiringNumber, totalFiringNumber]() { @@ -408,7 +408,7 @@ void FiringTimer::onFiringTimout() } #endif // SUPPORT_STATE_CHANGE_DELAYED - INFO_LOG() << MY_Q_FUNC_INFO << " emit impact " << currentFiringNumber + INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " emit impact " << currentFiringNumber << " of total = " << totalFiringNumber; emit impact(currentFiringNumber, totalFiringNumber); @@ -430,7 +430,7 @@ void FiringTimer::onFiringTimout() if (d->m_firedAmmoCount >= d->m_ammoCount) { - INFO_LOG() << MY_Q_FUNC_INFO << " no ammo left, finishing firing" + INFO_LOG(m_logger) << MY_Q_FUNC_INFO << " no ammo left, finishing firing" << ", " << d->m_firedAmmoCount << " of total ammoCount = " << d->m_ammoCount << " are fired"; d->m_firingTimer->stop(); @@ -440,7 +440,7 @@ void FiringTimer::onFiringTimout() // !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !! - DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing after [ms]: " << activeElapsedMsec << ", m_activeMsec in total = " << d->m_activeMsec << ", m_pausedMsec in total = " << d->m_pausedMsec << " now FiringTimoutExpiredPlus ..."; @@ -465,12 +465,12 @@ void FiringTimer::onFiringTimout() d->m_firingTimer->start(); } - TRACE_LOG() << MY_Q_FUNC_INFO << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END" << ", m_firedAmmoCount " << d->m_firedAmmoCount; } void FiringTimer::onFiringTimoutExpiredPlus() { - TRACE_LOG() << MY_Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " START"; d->m_currentFiringMode = FiringMode::FM_ExpiredPlus; @@ -480,7 +480,7 @@ void FiringTimer::onFiringTimoutExpiredPlus() // !! Attention: do pauseFiring() WITHIN the intervall will reduce amount of time the firing is active !! - DEBUG_LOG() << MY_Q_FUNC_INFO << " stop firing2 after [ms]: " << activeElapsedMsec + DEBUG_LOG(m_logger) << MY_Q_FUNC_INFO << " stop firing2 after [ms]: " << activeElapsedMsec << ", m_activeMsec in total = " << d->m_activeMsec << ", m_pausedMsec in total = " << d->m_pausedMsec; @@ -488,7 +488,7 @@ void FiringTimer::onFiringTimoutExpiredPlus() emit firingFinishedPlus(); - TRACE_LOG() << MY_Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << MY_Q_FUNC_INFO << " END"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp index a56fdea6b..1ac12bb88 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.cpp @@ -18,12 +18,11 @@ namespace AreaEffectSimulation { -DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent) - : QObject(parent) +DdsHandler::DdsHandler(int domainId, int exerciseId, QObject *parent) : QObject(parent) , m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Exercise, exerciseId)) - , m_currentTimeMSec(-1) -{ - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + , m_currentTimeMSec(-1), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } DdsHandler::~DdsHandler() @@ -45,7 +44,7 @@ bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -84,7 +83,7 @@ bool DdsHandler::init(const QStringList &qosFileList) m_ddsDts = AreaEffectSimulation::Interface::Dts::create(m_ddsConnector); m_ddsFts = AreaEffectSimulation::Interface::Fts::create(m_ddsConnector); bRet &= m_ddsDts->enableAll(); - DEBUG_LOG() << "initialized Dts: " << bRet; + DEBUG_LOG(m_logger) << "initialized Dts: " << bRet; bRet &= m_ddsFts->enableAll(); bRet &= m_ddsFts->enableTargetPositionsModify(); @@ -95,7 +94,7 @@ bool DdsHandler::init(const QStringList &qosFileList) bRet &= m_ddsFts->enableAcknowledgeExternalAesItem(); bRet &= m_ddsFts->enableSetAesItemEffectorState(); - DEBUG_LOG() << "initialized Fts: " << bRet; + DEBUG_LOG(m_logger) << "initialized Fts: " << bRet; m_pdmDtc = ProjectDataManagement::Interface::Dtc::create(m_ddsConnector); m_pdmDtc->enableChargeType(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.h index ba0e3e711..fc8cdf106 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/dds_handler.h @@ -78,6 +78,7 @@ private slots: void onPartitionTimeChanged(const Core::PartitionTime ¤tTime); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_dtcCore; std::shared_ptr m_pacemaker; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp index cbda39cc4..3f418e802 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/effector_state_machine.cpp @@ -26,31 +26,31 @@ EffectorStateMachine::~EffectorStateMachine() { stopAllTimer(); } int EffectorStateMachine::intervalFire() { - DEBUG_LOG() << "intervalFire"; + DEBUG_LOG(m_logger) << "intervalFire"; return QRandomGenerator::global()->bounded(Settings::getEffectorIntervalFireMin(), Settings::getEffectorIntervalFireMax() + 1); } int EffectorStateMachine::intervalReportFired() { - DEBUG_LOG() << "intervalReportFired"; + DEBUG_LOG(m_logger) << "intervalReportFired"; return QRandomGenerator::global()->bounded(Settings::getEffectorIntervalReportFiredMin(), Settings::getEffectorIntervalReportFiredMax() + 1); } int EffectorStateMachine::intervalReportFireReadiness() { - DEBUG_LOG() << "intervalReportFireReadiness"; + DEBUG_LOG(m_logger) << "intervalReportFireReadiness"; return QRandomGenerator::global()->bounded(m_intervalReportFireReadinessMin, m_intervalReportFireReadinessMax + 1); } int EffectorStateMachine::intervalInitialFireReadiness() { - DEBUG_LOG() << "intervalInitialFireReadiness"; + DEBUG_LOG(m_logger) << "intervalInitialFireReadiness"; return QRandomGenerator::global()->bounded(Settings::getEffectorInitialReportFireReadinessMin(), Settings::getEffectorInitialReportFireReadinessMax() + 1); } void EffectorStateMachine::init() { - DEBUG_LOG() << "EffectorStateMachine::init"; + DEBUG_LOG(m_logger) << "EffectorStateMachine::init"; emit logMessage( QStringLiteral("intervalFire min=%1 max=%2, intervalReportFired min=%3 max=%4, intervalReportFireReadiness min=%5 max=%6 , initialFireReadiness min=%7 max=%8") .arg( @@ -109,7 +109,7 @@ QString EffectorStateMachine::getStateStr(AreaEffectSimulation::AesEffectorState bool EffectorStateMachine::overrideReportFireReadinessMinMax(int newMin, int newMax) { - DEBUG_LOG() << "Override ReadinessMinMax min: " << newMin << " max: " << newMax; + DEBUG_LOG(m_logger) << "Override ReadinessMinMax min: " << newMin << " max: " << newMax; m_intervalReportFireReadinessMin = newMin; m_intervalReportFireReadinessMax = newMax; @@ -118,7 +118,7 @@ bool EffectorStateMachine::overrideReportFireReadinessMinMax(int newMin, int new bool EffectorStateMachine::resetReportFireReadinessMinMax() { - DEBUG_LOG() << "Reset ReadinessMinMax min:" << Settings::getEffectorIntervalReportFireReadinessMin() + DEBUG_LOG(m_logger) << "Reset ReadinessMinMax min:" << Settings::getEffectorIntervalReportFireReadinessMin() << " max: " << Settings::getEffectorIntervalReportFireReadinessMax(); m_intervalReportFireReadinessMin = Settings::getEffectorIntervalReportFireReadinessMin(); @@ -156,7 +156,7 @@ bool EffectorStateMachine::reportNotFireReadiness() } QString timestamp = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss")); emit logMessage(QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr)); - DEBUG_LOG() << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr); + DEBUG_LOG(m_logger) << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr); emit signalNotReadyToFire(); return true; } @@ -199,7 +199,7 @@ bool EffectorStateMachine::reportFireReadiness() bool EffectorStateMachine::fireOrder() { - DEBUG_LOG() << "fireOrder"; + DEBUG_LOG(m_logger) << "fireOrder"; AreaEffectSimulation::AesEffectorState newState = AreaEffectSimulation::AesEffectorState::EsReceivedOrder; @@ -209,7 +209,7 @@ bool EffectorStateMachine::fireOrder() if (m_currentState == newState) { emit logMessage(QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr)); - DEBUG_LOG() << QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr); + DEBUG_LOG(m_logger) << QStringLiteral("Same State from %1 -> %2").arg(oldStateStr, newStateStr); return false; } @@ -220,7 +220,7 @@ bool EffectorStateMachine::fireOrder() if (Settings::getEffectorIntervalFireMin() >= 0) { emit logMessage(QStringLiteral("m_timerFire.start()")); - DEBUG_LOG() << QStringLiteral("m_timerFire.start()"); + DEBUG_LOG(m_logger) << QStringLiteral("m_timerFire.start()"); m_timerFire.setInterval(intervalFire()); m_timerFire.start(); } @@ -228,12 +228,12 @@ bool EffectorStateMachine::fireOrder() else { emit logMessage(QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr)); - DEBUG_LOG() << QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr); + DEBUG_LOG(m_logger) << QStringLiteral("No Statechange possible from %1 -> %2").arg(oldStateStr, newStateStr); return false; } QString timestamp = QDateTime::currentDateTime().toString(QStringLiteral("hh:mm:ss")); emit logMessage(QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr)); - DEBUG_LOG() << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr); + DEBUG_LOG(m_logger) << QStringLiteral("[%1] change effect state: %2 -> %3").arg(timestamp, oldStateStr, newStateStr); emit signalReceivedOrder(); return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp index 4bfaff874..3657d3a30 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.cpp @@ -37,7 +37,7 @@ bool HandlerChargeEffect::init() if (!m_mainHandler) { - ERROR_LOG() << QStringLiteral("Not possible to init HandlerChargeEffect --> No MainHandler present."); + ERROR_LOG(m_logger) << QStringLiteral("Not possible to init HandlerChargeEffect --> No MainHandler present."); return false; } @@ -46,7 +46,7 @@ bool HandlerChargeEffect::init() if (!m_mainHandler->db()->select(chargeEffectDbData)) { - ERROR_LOG() << QStringLiteral("Not possible to init HandlerChargeEffect --> Not possible to get database data."); + ERROR_LOG(m_logger) << QStringLiteral("Not possible to init HandlerChargeEffect --> Not possible to get database data."); return false; } @@ -82,7 +82,7 @@ void HandlerChargeEffect::onChargeEffectModifyRequest(const rti::core::SampleIde { if (!m_mainHandler) { - ERROR_LOG() << QStringLiteral("Not possible to process ChargeEffectModifyRequest --> No MainHandler present."); + ERROR_LOG(m_logger) << QStringLiteral("Not possible to process ChargeEffectModifyRequest --> No MainHandler present."); return; } @@ -117,13 +117,13 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId) if (chargeEffect == nullptr) { - ERROR_LOG() << "onChargeEffectExpired: got invalid chargeEffectId " << chargeEffectId; + ERROR_LOG(m_logger) << "onChargeEffectExpired: got invalid chargeEffectId " << chargeEffectId; return; } if (!chargeEffect->remove()) { - ERROR_LOG() << "onChargeEffectExpired: failed to remove ChargeEffect with id " << chargeEffectId; + ERROR_LOG(m_logger) << "onChargeEffectExpired: failed to remove ChargeEffect with id " << chargeEffectId; return; } @@ -135,7 +135,7 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId) const int trajId = m_trajObjIds.value(chargeEffectId, -1); if (!m_trajectoryHandler->remove(trajId)) { - ERROR_LOG() << "onChargeEffectExpired: failed to remove trajectory from chargeEffect id " << chargeEffectId; + ERROR_LOG(m_logger) << "onChargeEffectExpired: failed to remove trajectory from chargeEffect id " << chargeEffectId; return; } m_trajObjIds.remove(chargeEffectId); @@ -143,7 +143,7 @@ void HandlerChargeEffect::onChargeEffectFinished(qint32 chargeEffectId) void HandlerChargeEffect::onChargeEffectStateChanged(const int id, AesEffectState newState) { - DEBUG_LOG() << " [CHARGE EFFECT STATE] state changed !! id: " << id << " state: " << newState; + DEBUG_LOG(m_logger) << " [CHARGE EFFECT STATE] state changed !! id: " << id << " state: " << newState; if (id <= 0) return; @@ -165,8 +165,8 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf m_chargeEffects.insert(newChargeEffect->id(), newChargeEffect); // Create ChargeAdministration Entry for reports - DEBUG_LOG() << "newChargeEffect id: " << newChargeEffect->id(); - DEBUG_LOG() << "request.originatorTypeId: " << request.originatorTypeId(); + DEBUG_LOG(m_logger) << "newChargeEffect id: " << newChargeEffect->id(); + DEBUG_LOG(m_logger) << "request.originatorTypeId: " << request.originatorTypeId(); if (request.originatorTypeId() == ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation) { int amount = 1; @@ -185,7 +185,7 @@ Core::FunctionReplyObject HandlerChargeEffect::createChargeEffect(const ChargeEf { int trajId = m_trajectoryHandler->create(trajectoryData(newChargeEffect->id(), request.trajectoryTimeAware().get())); if (trajId < 0) - ERROR_LOG() << " Couldn't create trajectory for chargeEffect id: " << newChargeEffect->id(); + ERROR_LOG(m_logger) << " Couldn't create trajectory for chargeEffect id: " << newChargeEffect->id(); else m_trajObjIds.insert(newChargeEffect->id(), trajId); } @@ -233,7 +233,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf { reply.setStr("Not possible to update ChargeEffect --> No MainHandler present."); - ERROR_LOG() << reply.str(); + ERROR_LOG(m_logger) << reply.str(); return reply; } @@ -243,7 +243,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf reply.setStr("Not possible to update ChargeEffect --> Got invalid id."); - ERROR_LOG() << reply.str(); + ERROR_LOG(m_logger) << reply.str(); return reply; } @@ -257,7 +257,7 @@ Core::FunctionReplyObject HandlerChargeEffect::updateChargeEffect(const ChargeEf { // update failed should the trajectory be created again? reply.setStr("Not possible to update ChargeEffect --> Got invalid trajectory id."); - ERROR_LOG() << " Couldn't update trajectory: unknown chargeEffect id: " << chargeEffetObj->id(); + ERROR_LOG(m_logger) << " Couldn't update trajectory: unknown chargeEffect id: " << chargeEffetObj->id(); } return reply; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.h index 0c2736f1e..54fa3da8d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_charge_effect.h @@ -39,6 +39,8 @@ public: void onChargeEffectStateChanged(const int id, AesEffectState newState); private: // methods + +NGL::INGLLogger &m_logger; Core::FunctionReplyObject updateChargeEffect(const ChargeEffectModifyRequest &request); private: // attributes diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp index 357257c6d..8afb6760f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.cpp @@ -28,7 +28,7 @@ HandlerEffector::HandlerEffector(AreaEffectSimulation::MainHandler *mainhandler, bool HandlerEffector::init() { - DEBUG_LOG() << "HandlerEffector::init"; + DEBUG_LOG(m_logger) << "HandlerEffector::init"; connect(m_ppmDtc.get(), &ParticipantManagement::Interface::Dtc::participantChanged, this, &HandlerEffector::onParticipantChanged); @@ -48,7 +48,7 @@ void HandlerEffector::createEffector(int participantId) { if (m_effectors.contains(participantId)) return; - DEBUG_LOG()<<"createEffector participantId:" << participantId; + DEBUG_LOG(m_logger)<<"createEffector participantId:" << participantId; ObjectEffector* objectEffector = new ObjectEffector(m_mainHandler, this); objectEffector->init(participantId); @@ -58,17 +58,17 @@ void HandlerEffector::createEffector(int participantId) // TODO Wird aufgerufen, wenn zur Laufzeit ein Effektor geloescht wird. (Topic?) void HandlerEffector::deleteEffector(int participantId) { - DEBUG_LOG()<<"deleteEffector participantId:" << participantId; + DEBUG_LOG(m_logger)<<"deleteEffector participantId:" << participantId; delete m_effectors[participantId]; m_effectors.remove(participantId); } void HandlerEffector::onParticipantChanged(const ParticipantManagement::Participant &data, DataModification modType) { - //DEBUG_LOG()<<"onParticipantChanged participantId:" << data.id(); + //DEBUG_LOG(m_logger)<<"onParticipantChanged participantId:" << data.id(); if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "m_participantsOutsideMap.remove participantId: " << data.id(); + DEBUG_LOG(m_logger) << "m_participantsOutsideMap.remove participantId: " << data.id(); if (m_effectors.contains(data.id())) deleteEffector(data.id()); return; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.h index eaaed1df9..7186764ac 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_effector.h @@ -29,6 +29,8 @@ namespace AreaEffectSimulation ObjectEffector* getObjectEffector (int participantId) {return m_effectors.value(participantId);}; private: // methods + + NGL::INGLLogger &m_logger; void createEffector(int participantId); void deleteEffector(int participantId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.cpp index 418501465..166f07efd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.cpp @@ -36,21 +36,21 @@ HandlerTrajectory::HandlerTrajectory(MainHandler *mainHandler) HandlerTrajectory::~HandlerTrajectory() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; delete d; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } int HandlerTrajectory::create(const TrajectoryData &providedData) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; int newId = -1; auto *ifs = new ObjectTrajectory(d->m_mainHandler); if (!ifs) { - ERROR_LOG()<<" couldn't create ObjectTrajectory!"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + ERROR_LOG(m_logger)<<" couldn't create ObjectTrajectory!"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return -1; } @@ -66,17 +66,17 @@ int HandlerTrajectory::create(const TrajectoryData &providedData) ifs->publish(); } - TRACE_LOG() << Q_FUNC_INFO << " END, newId = " << newId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, newId = " << newId; return newId; } bool HandlerTrajectory::update(const TrajectoryData &providedData) { - TRACE_LOG() << Q_FUNC_INFO << " START, id = " << providedData.id; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << providedData.id; bool success = false; if (!providedData.isIdValid()) { - TRACE_LOG() << Q_FUNC_INFO << " END "; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END "; return false; } @@ -87,25 +87,25 @@ bool HandlerTrajectory::update(const TrajectoryData &providedData) success = true; } - TRACE_LOG() << Q_FUNC_INFO << " END, success = " << success; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, success = " << success; return success; } bool HandlerTrajectory::remove(const int trajId) { - TRACE_LOG() << Q_FUNC_INFO << " START, id = " << trajId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << trajId; if (trajId <= 0) { - ERROR_LOG() << " remove topic: got Invalid trajectory Id: "<m_objectMap[trajId]; if (!ifs->removeTopic()) { - ERROR_LOG() << "failed to remove trajectory with id " << trajId; + ERROR_LOG(m_logger) << "failed to remove trajectory with id " << trajId; return false; } @@ -113,13 +113,13 @@ bool HandlerTrajectory::remove(const int trajId) delete ifs; ifs = nullptr; - TRACE_LOG() << Q_FUNC_INFO << " END "; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END "; return true; } int HandlerTrajectory::createUpdate(const TrajectoryData &providedData) { - TRACE_LOG() << Q_FUNC_INFO << " START, id = " << providedData.id; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, id = " << providedData.id; int ret = -1; @@ -130,7 +130,7 @@ int HandlerTrajectory::createUpdate(const TrajectoryData &providedData) } else { ret = create(providedData); } - TRACE_LOG() << Q_FUNC_INFO << " END, id ret " << ret; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, id ret " << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.h index f359266e6..19f35e198 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/handler_trajectory.h @@ -35,6 +35,7 @@ public: int createUpdate(const TrajectoryData& providedData); private: + NGL::INGLLogger &m_logger; int count() const; class Private; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp index 98a02204a..59b146ee6 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.cpp @@ -46,9 +46,8 @@ namespace AreaEffectSimulation { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) -{ +MainHandler::MainHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { #if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0) QRandomGenerator(time(nullptr)); #else @@ -95,7 +94,7 @@ bool MainHandler::init(int domainId, int exerciseId) m_dbHandler = std::make_shared(); if(!m_dbHandler->init(exerciseId, Settings::settings())) { - ERROR_LOG() << "Initialisation DbHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DbHandler failed."; return false; } @@ -104,7 +103,7 @@ bool MainHandler::init(int domainId, int exerciseId) m_dbHandlerEx0 = std::make_shared(); if (!m_dbHandlerEx0->init(0, Settings::settings())) // need a second db connection due to username/password { - ERROR_LOG() << "Could not init DbHandler"; + ERROR_LOG(m_logger) << "Could not init DbHandler"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError, QStringLiteral("Could not init DbHandler")); return false; @@ -120,7 +119,7 @@ bool MainHandler::init(int domainId, int exerciseId) m_ddsHandler = std::make_shared(domainId, exerciseId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation DdsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation DdsHandler failed."; return false; } @@ -158,7 +157,7 @@ bool MainHandler::initAESHandler() // prepare some basics for HandlerExplosionCluster // - TrajectoryGenerator // - LtsElevationManager - DEBUG_LOG() << Q_FUNC_INFO << " ****** std::make_sharedexerciseId(); LtsElevation::LTS_ELEVATION_MANAGER_TYPE ltsElevationManager = LtsElevation::LtsElevationManager::createInstance(exerciseId, dds()->exmDtc(), @@ -176,7 +175,7 @@ bool MainHandler::initAESHandler() #ifndef Q_OS_WIN // GUEZE-2195 if (!ltsElevationManager) { - ERROR_LOG() << Q_FUNC_INFO << " LtsElevation::createInstance failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " LtsElevation::createInstance failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } @@ -188,7 +187,7 @@ bool MainHandler::initAESHandler() this->dds()->asmDtc()); if (!trajectoryGenerator) { - ERROR_LOG() << Q_FUNC_INFO << " TrajectoryGenerator::getInstance failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " TrajectoryGenerator::getInstance failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } @@ -196,7 +195,7 @@ bool MainHandler::initAESHandler() m_handlerExplosionCluster = std::make_shared(this); if (!m_handlerExplosionCluster->init()) return false; - DEBUG_LOG() << Q_FUNC_INFO << " ****** std::make_shared(this); if (!m_handlerFunctionalArea->init()) @@ -248,7 +247,7 @@ bool MainHandler::initAESHandler() m_handlerBorderline = std::make_shared(this); if (!m_handlerBorderline->init()) { - ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerBorderline failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerBorderline failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } @@ -257,7 +256,7 @@ bool MainHandler::initAESHandler() m_handlerGasPipe = std::make_shared(this); if (!m_handlerGasPipe->init()) { - ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerGasPipe failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerGasPipe failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } @@ -266,7 +265,7 @@ bool MainHandler::initAESHandler() m_handlerChargeEffect = std::make_shared(this); if (!m_handlerChargeEffect->init()) { - ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } @@ -279,7 +278,7 @@ bool MainHandler::initAESHandler() m_handlerEffector = std::make_shared(this); if (!m_handlerEffector->init()) { - ERROR_LOG() << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed."; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " Initialisation HandlerChargeEffect failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::inner_enum::StoppedError); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.h index f036d1432..aceb7a201 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/main_handler.h @@ -115,8 +115,10 @@ public: private: + NGL::INGLLogger &m_logger; bool initAESHandler(); private: + NGL::INGLLogger &m_logger; std::shared_ptr m_handlerAirSupportImpact; std::shared_ptr m_handlerExplosionSingle; std::shared_ptr m_handlerExplosionArea; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp index 4e2d3bf21..6189d0d36 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.cpp @@ -21,12 +21,11 @@ namespace AreaEffectSimulation static const int s_samePointDistance = 10; // 10m static const int s_smoothDistance = 10; // 10m static const int s_timeoutInterval = 10 * 60 * 1000; // 10min -MineCorridorCreator::MineCorridorCreator(int equipNo, ObjectMineCorridor *omc) - : m_timer(new QTimer(this)) +MineCorridorCreator::MineCorridorCreator(int equipNo, ObjectMineCorridor *omc) : m_timer(new QTimer(this)) , m_timeoutTimer(new QTimer(this)) , m_omc(omc) - , m_equipNo(equipNo) -{ + , m_equipNo(equipNo), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_timeoutTimer->setInterval(s_timeoutInterval); m_timeoutTimer->setSingleShot(true); connect(m_timeoutTimer, &QTimer::timeout, this, &MineCorridorCreator::timeout, Qt::QueuedConnection); @@ -54,7 +53,7 @@ void MineCorridorCreator::addPosition(const Core::GeoPosition2D &pos, qint64 ts) const auto utm = LtsCoordTrans::UtmCoordinate::fromGeographic(pos.lon(), pos.lat(), last.zone); if (isSamePoint(last, utm, s_samePointDistance)) { - DEBUG_LOG() << "got duplicated point (" << last.x << "/" << last.y + DEBUG_LOG(m_logger) << "got duplicated point (" << last.x << "/" << last.y << " - " << utm.x << "/" << utm.y << " from " << m_equipNo << " - ignoring"; return; } @@ -69,7 +68,7 @@ void MineCorridorCreator::creationFinished() if (m_sortedCorridorData.size() < 2) { - WARNING_LOG() << "To few points to create mine corridor for " << m_equipNo; + WARNING_LOG(m_logger) << "To few points to create mine corridor for " << m_equipNo; return; } checkCorridorData(true); @@ -94,13 +93,13 @@ static void outputCoords(NGL::INGLLogger &logger, NGL::LogLevel level, const std void MineCorridorCreator::checkCorridorData(bool bFinished) { - DEBUG_LOG() << "Checking corridor data (finished: " << bFinished << ") for equipment " << m_equipNo; + DEBUG_LOG(m_logger) << "Checking corridor data (finished: " << bFinished << ") for equipment " << m_equipNo; std::vector coords; coords.reserve(m_sortedCorridorData.size()); for (const auto &c : std::as_const(m_sortedCorridorData)) coords.push_back(c); const auto coordsSmoothed = ramerDouglasPeucker(coords, s_smoothDistance); - DEBUG_LOG() << "Calculated points:"; + DEBUG_LOG(m_logger) << "Calculated points:"; outputCoords(m_logger, NGL::LogLevel::Debug, coordsSmoothed); if (coordsSmoothed.size() < 2) return; @@ -108,7 +107,7 @@ void MineCorridorCreator::checkCorridorData(bool bFinished) segments.reserve(coordsSmoothed.size()); for (const LtsCoordTrans::UtmCoordinate &utm : coordsSmoothed) { - DEBUG_LOG() << "Mine Corridor calculated point: " << qRound(utm.x) << "/" << qRound(utm.y); + DEBUG_LOG(m_logger) << "Mine Corridor calculated point: " << qRound(utm.x) << "/" << qRound(utm.y); const QPointF geo(utm.geographic()); segments.emplace_back(Core::GeoPosition2D(geo.x(), geo.y())); } @@ -181,7 +180,7 @@ std::vector MineCorridorCreator::ramerDouglasPeuck // If max distance is greater than epsilon, recursively simplify if (dmax > epsilon) { - TRACE_LOG() << "Input points, split index = " << index; + TRACE_LOG(m_logger) << "Input points, split index = " << index; outputCoords(m_logger, NGL::LogLevel::Trace, pointList); // Recursive call const std::vector firstLine(pointList.begin(), pointList.begin() + index + 1); @@ -191,9 +190,9 @@ std::vector MineCorridorCreator::ramerDouglasPeuck out.erase(--out.end()); const auto recResults2 = ramerDouglasPeucker(lastLine, epsilon); - TRACE_LOG() << "Output points left:"; + TRACE_LOG(m_logger) << "Output points left:"; outputCoords(m_logger, NGL::LogLevel::Trace, out); - TRACE_LOG() << "Output points right:"; + TRACE_LOG(m_logger) << "Output points right:"; outputCoords(m_logger, NGL::LogLevel::Trace, recResults2); out.insert(out.end(), recResults2.begin(), recResults2.end()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.h index 35101c527..d6c01e603 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/mine_corridor_creator.h @@ -33,6 +33,7 @@ Q_SIGNALS: private Q_SLOTS: void onCheckCorridorData(); private: + NGL::INGLLogger &m_logger; void checkCorridorData(bool bFinished); static bool isSamePoint(const LtsCoordTrans::UtmCoordinate &p1, const LtsCoordTrans::UtmCoordinate &p2, double epsilon); static double perpendicularDistance(const LtsCoordTrans::UtmCoordinate &pt, @@ -41,6 +42,7 @@ private: std::vector ramerDouglasPeucker(const std::vector &pointList, double epsilon) const; private: + NGL::INGLLogger &m_logger; QMap m_sortedCorridorData; QTimer *m_timer; QTimer *m_timeoutTimer; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp index d82c2be4e..3fe84b313 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.cpp @@ -44,7 +44,7 @@ void ObjectBase::setEffectState(AesEffectState newState) Q_UNUSED(newState) m_publishDataTimer->start(); AesEffectState es = checkEnterNewState(); // can create loop because checkEnterNewState is calling trySwitchFoo() but it's ok - DEBUG_LOG() << id() << " New effect state is " << es; + DEBUG_LOG(m_logger) << id() << " New effect state is " << es; emit effectStateChanged(); } @@ -91,7 +91,7 @@ bool ObjectBase::isObjectInTrainingArea() const AesEffectState ObjectBase::checkEnterNewState() { - DEBUG_LOG() << id() << " checkEnterNewState - cur effect state is " << effectState(); + DEBUG_LOG(m_logger) << id() << " checkEnterNewState - cur effect state is " << effectState(); bool bNeedToPublishNewData = false; switch (effectState().underlying()) { @@ -147,13 +147,13 @@ AesEffectState ObjectBase::checkEnterNewState() { timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec() - flightDurationMsec(); - DEBUG_LOG() << id() << " timeUntilFiredMSec: " << timeToTickMsec; + DEBUG_LOG(m_logger) << id() << " timeUntilFiredMSec: " << timeToTickMsec; } else // setup EsAvtivated { timeToTickMsec = activationTime().toMSecsSinceEpoch() - partitionTimeMSec(); // time until activation - DEBUG_LOG() << id() << " timeUntilActivationMSec: " << timeToTickMsec + DEBUG_LOG(m_logger) << id() << " timeUntilActivationMSec: " << timeToTickMsec << " cur: " << partitionTimeMSec() << " activation: " << activationTime().toMSecsSinceEpoch(); } @@ -172,7 +172,7 @@ AesEffectState ObjectBase::checkEnterNewState() { if (!trySwitchToActivated()) { - WARNING_LOG() << id() << " Error switching to active ..."; + WARNING_LOG(m_logger) << id() << " Error switching to active ..."; QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing } } @@ -193,7 +193,7 @@ AesEffectState ObjectBase::checkEnterNewState() // start timer for done m_aesTriggerTimer->stop(); // if it is called directly by someone qint64 timeUntilFinishedMSec = endTime().toMSecsSinceEpoch() - partitionTimeMSec(); - DEBUG_LOG() << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec + DEBUG_LOG(m_logger) << id() << " timeUntilFinishedMSec: " << timeUntilFinishedMSec << " cur: " << partitionTimeMSec() << " activation: " << activationTime().toMSecsSinceEpoch(); if (timeUntilFinishedMSec > 0) @@ -208,7 +208,7 @@ AesEffectState ObjectBase::checkEnterNewState() { if (!trySwitchToExpired()) { - WARNING_LOG() << id() << " Error switching from active to expired ..."; + WARNING_LOG(m_logger) << id() << " Error switching from active to expired ..."; QTimer::singleShot(100, this, &ObjectBase::checkEnterNewState); // maybe some timing } } @@ -220,7 +220,7 @@ AesEffectState ObjectBase::checkEnterNewState() case AesEffectState::EsRemoved: break; default: - ERROR_LOG() << id() << " Unknown new state " << effectState(); + ERROR_LOG(m_logger) << id() << " Unknown new state " << effectState(); break; } if (bNeedToPublishNewData) @@ -239,7 +239,7 @@ bool ObjectBase::trySwitchToReceived() if (!isUsingEffectStateReceived()) return false; - DEBUG_LOG() << id() << " trySwitchToReceived succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToReceived succeeded"; setEffectState(AesEffectState::EsReceived); return true; } @@ -261,7 +261,7 @@ bool ObjectBase::trySwitchToCreated() isUsingEffectStateReceived()) return false; - DEBUG_LOG() << id() << " trySwitchToCreated succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToCreated succeeded"; setEffectState(AesEffectState::EsCreated); return true; } @@ -280,7 +280,7 @@ bool ObjectBase::trySwitchToPrepared() if (!isActivationTimeSet()) return false; - DEBUG_LOG() << id() << " trySwitchToPrepared succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToPrepared succeeded"; setEffectState(AesEffectState::EsPrepared); return true; } @@ -290,29 +290,29 @@ bool ObjectBase::trySwitchToFired() { if (effectState() != AesEffectState::EsPrepared) { - DEBUG_LOG() << id() << " trySwitchToFired failed - not prepared: " << effectState(); + DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not prepared: " << effectState(); return false; } if (aesType() != AesType::AtExplosionArea && aesType() != AesType::AtEffectCluster) { - DEBUG_LOG() << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType(); + DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - not AtExplosionArea: " << aesType(); return false; } if (!isFiringTimeReached()) { - DEBUG_LOG() << id() << " trySwitchToFired failed - firing time is not reached"; + DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - firing time is not reached"; return false; } if (isActivationTimeReached()) { - DEBUG_LOG() << id() << " trySwitchToFired failed - activation time already reached!"; + DEBUG_LOG(m_logger) << id() << " trySwitchToFired failed - activation time already reached!"; return false; } - DEBUG_LOG() << id() << " trySwitchToFired succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToFired succeeded"; setEffectState(AesEffectState::EsFired); return true; } @@ -324,17 +324,17 @@ bool ObjectBase::trySwitchToActivated() effectState() != AesEffectState::EsPaused && effectState() != AesEffectState::EsFired) { - DEBUG_LOG() << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState(); + DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - not prepared/fired/paused: " << effectState(); return false; } if (!isActivationTimeReached()) { - DEBUG_LOG() << id() << " trySwitchToActivated failed - activation time not reached: " + DEBUG_LOG(m_logger) << id() << " trySwitchToActivated failed - activation time not reached: " << isActivationTimeSet() << " - " << time(nullptr) << " - " << activationTime().toSecsSinceEpoch(); return false; } - DEBUG_LOG() << id() << " trySwitchToActivated succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToActivated succeeded"; setEffectState(AesEffectState::EsActivated); return true; } @@ -347,7 +347,7 @@ bool ObjectBase::trySwitchToPaused() if (!isPausingSupported()) return false; - DEBUG_LOG() << id() << " trySwitchToPaused succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToPaused succeeded"; setEffectState(AesEffectState::EsPaused); return true; } @@ -358,24 +358,24 @@ bool ObjectBase::trySwitchToExpired() if (effectState() != AesEffectState::EsActivated && effectState() != AesEffectState::EsPaused) { - DEBUG_LOG() << id() << " trySwitchToExpired failed - not active or paused: " << effectState(); + DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - not active or paused: " << effectState(); return false; } if (!isEndTimeReached()) { - DEBUG_LOG() << id() << " trySwitchToExpired failed - end time not reached: " + DEBUG_LOG(m_logger) << id() << " trySwitchToExpired failed - end time not reached: " << isEndTimeSet() << " - " << time(nullptr) << " - " << endTime().toSecsSinceEpoch(); return false; } - DEBUG_LOG() << id() << " trySwitchToExpired succeeded"; + DEBUG_LOG(m_logger) << id() << " trySwitchToExpired succeeded"; setEffectState(AesEffectState::EsExpired); return true; } bool ObjectBase::trySwitchToRemoved() { - DEBUG_LOG() << id() << " trySwitchToRemoved: " << effectState(); + DEBUG_LOG(m_logger) << id() << " trySwitchToRemoved: " << effectState(); switch (effectState().underlying()) { case AesEffectState::EsReceived: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h index eb0fb7ae6..e1b4556e7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_base.h @@ -204,7 +204,7 @@ template class ObjectBaseTmpl : public ObjectBase // check effect start for new elements if not OC if ((0 == m_data.id) && (isActivationTimeSet() && activationTime() < QDateTime::currentDateTimeUtc()) && !ignoreActivationTimeCheck) { - DEBUG_LOG() << "m_data.id : " << m_data.id << ", isActivationTimeSet :" << isActivationTimeSet() + DEBUG_LOG(m_logger) << "m_data.id : " << m_data.id << ", isActivationTimeSet :" << isActivationTimeSet() << ", activationTime :" << activationTime().toMSecsSinceEpoch() << ", ignoreActivationTimeCheck :" << ignoreActivationTimeCheck; // << ", QDateTime::currentDateTimeUtc() :" << QDateTime::currentDateTimeUtc().msecsTo(); return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Effect start is in the past.")); @@ -331,7 +331,7 @@ template class ObjectBaseTmpl : public ObjectBase void onPublishData() override { - DEBUG_LOG() << id() << " Publishing data for " << m_typeName << " with name '" << m_data.name << "'" + DEBUG_LOG(m_logger) << id() << " Publishing data for " << m_typeName << " with name '" << m_data.name << "'" << " isCentral=" << m_data.isCentral; ObjectBase::onPublishData(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.cpp index ff3faaa40..fb6155241 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.cpp @@ -53,7 +53,7 @@ Core::FunctionReplyObject ObjectChargeAdministration::updateObject(const Databas Core::FunctionReplyObject ObjectChargeAdministration::claimPlannedCharge(int count) { - DEBUG_LOG() << "claimPlannedCharge for id : " << m_data.chargeTypeId << ", count: " << count; + DEBUG_LOG(m_logger) << "claimPlannedCharge for id : " << m_data.chargeTypeId << ", count: " << count; // Works both directions, can "claim" negative count! if (m_data.amount - m_data.planned < count) @@ -81,11 +81,11 @@ Core::FunctionReplyObject ObjectChargeAdministration::consumeCharge(int count, b if (m_data.planned < count) { // consume what is possible - WARNING_LOG() << "Cannot consume " << count << ", consuming instead " << m_data.planned << " planned"; + WARNING_LOG(m_logger) << "Cannot consume " << count << ", consuming instead " << m_data.planned << " planned"; count = m_data.planned; } - DEBUG_LOG() << "consumeCharge for id : " << m_data.chargeTypeId << ", count: " << count; + DEBUG_LOG(m_logger) << "consumeCharge for id : " << m_data.chargeTypeId << ", count: " << count; if (wasPlanned && m_data.planned < count) return Core::FunctionReplyObject(m_data.id, tr_lts("dds", "Wanted to consume %1 planned charges, but only %2 had been planned.")).arg(count).arg(m_data.planned); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.h index 4aae4dbaf..b458f3401 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_administration.h @@ -32,6 +32,7 @@ class ObjectChargeAdministration final : public QObject void onPublishData(); protected: + NGL::INGLLogger &m_logger; private: MainHandler *m_mainHandler; Database::AesChargeAdministration m_data; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp index 8cc5a222a..d029edf87 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_charge_effect.cpp @@ -58,7 +58,7 @@ Core::FunctionReplyObject ObjectChargeEffect::create(const ChargeEffectModifyReq } if (reply.error()) - ERROR_LOG() << reply.str(); + ERROR_LOG(m_logger) << reply.str(); if (reply.id() == 0) reply.setId(m_data.id); return reply; @@ -96,7 +96,7 @@ Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyReq } if (reply.error()) - ERROR_LOG() << reply.str(); + ERROR_LOG(m_logger) << reply.str(); return reply; } @@ -111,13 +111,13 @@ Core::FunctionReplyObject ObjectChargeEffect::update(const ChargeEffectModifyReq void ObjectChargeEffect::updatedProperties(const Database::AesChargeEffect &dbData) { // update properties // "used": true/false - DEBUG_LOG()<<" !!! update charge effect when not EsPrepared !!! "; + DEBUG_LOG(m_logger)<<" !!! update charge effect when not EsPrepared !!! "; const QString tmpProps = m_data.properties; m_data.properties = dbData.properties; // update properties is allowed!! if (!m_mainHandler->db()->update(m_data)) { m_data.properties = tmpProps; - ERROR_LOG()<<" Couldn't update charge effect when not EsPrepared!!!"; + ERROR_LOG(m_logger)<<" Couldn't update charge effect when not EsPrepared!!!"; } } @@ -127,14 +127,14 @@ bool ObjectChargeEffect::remove() { if (!m_mainHandler) { - ERROR_LOG() << "Not possible to remove ChargeEffect --> No MainHandler present."; + ERROR_LOG(m_logger) << "Not possible to remove ChargeEffect --> No MainHandler present."; return false; } if (!m_mainHandler->dds()->dts()->removeChargeEffectByKey(m_data.id)) { - ERROR_LOG() << "Not possible to remove ChargeEffect --> Could not remove from DDS."; + ERROR_LOG(m_logger) << "Not possible to remove ChargeEffect --> Could not remove from DDS."; return false; } @@ -198,14 +198,14 @@ void ObjectChargeEffect::publish() { if (!m_mainHandler) { - ERROR_LOG() << QStringLiteral("Not possible to publish ChargeEffect --> Could not remove from DDS."); + ERROR_LOG(m_logger) << QStringLiteral("Not possible to publish ChargeEffect --> Could not remove from DDS."); return; } if (!m_mainHandler->dds()->dts()->publish(dataBaseToDataTopic(m_data))) { - ERROR_LOG() << QStringLiteral("Not possible to publish ChargeEffect --> DDS publish failed."); + ERROR_LOG(m_logger) << QStringLiteral("Not possible to publish ChargeEffect --> DDS publish failed."); return; } @@ -295,7 +295,7 @@ void ObjectChargeEffect::setNextState() if (oldState != m_state) m_stateChanged = true; - DEBUG_LOG() << "Switching from " << oldState << "to " << m_state; + DEBUG_LOG(m_logger) << "Switching from " << oldState << "to " << m_state; } //----------------------------------------------------------------------------- @@ -317,7 +317,7 @@ void ObjectChargeEffect::calculateInitEffectState() if (oldState != m_state) m_stateChanged = true; - DEBUG_LOG() << "Setting init state: " << m_state; + DEBUG_LOG(m_logger) << "Setting init state: " << m_state; } //----------------------------------------------------------------------------- @@ -330,7 +330,7 @@ void ObjectChargeEffect::startStateTimer() { qint64 timeToActivatedMsecs = m_data.effectStart.toMSecsSinceEpoch() - QDateTime::currentMSecsSinceEpoch(); - DEBUG_LOG() << "Time to Avtivated [ms]: " << timeToActivatedMsecs; + DEBUG_LOG(m_logger) << "Time to Avtivated [ms]: " << timeToActivatedMsecs; m_stateTimer->start(timeToActivatedMsecs); @@ -340,7 +340,7 @@ void ObjectChargeEffect::startStateTimer() { qint64 timeToExpiredMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration - QDateTime::currentMSecsSinceEpoch(); - DEBUG_LOG() << "Time to Expired [ms]: " << timeToExpiredMsecs; + DEBUG_LOG(m_logger) << "Time to Expired [ms]: " << timeToExpiredMsecs; m_stateTimer->start(timeToExpiredMsecs); @@ -350,7 +350,7 @@ void ObjectChargeEffect::startStateTimer() { qint64 timeToFinishMsecs = m_data.effectStart.toMSecsSinceEpoch() + m_data.effectDuration + s_afterglowMsecs - QDateTime::currentMSecsSinceEpoch(); - DEBUG_LOG() << "Time to finish/deletion [ms]: " << timeToFinishMsecs; + DEBUG_LOG(m_logger) << "Time to finish/deletion [ms]: " << timeToFinishMsecs; m_stateTimer->start(timeToFinishMsecs); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp index 643533225..13132470a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AreaEffectSimulation/object_effector.cpp @@ -65,7 +65,7 @@ EffectorData ObjectEffector::effectorData() const void ObjectEffector::assignAesItemRequest(int aesItemId) { - DEBUG_LOG() << "assignAesItemRequest aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << "assignAesItemRequest aesItemId=" << aesItemId; m_aesItemId = aesItemId; // Statemachine mit new anlegen if (m_effectorStateMachine) @@ -101,7 +101,7 @@ void ObjectEffector::assignAesItemRequest(int aesItemId) void ObjectEffector::deleteAssignmentAesItem() { - DEBUG_LOG() << "deleteAssignmentAesItem"; + DEBUG_LOG(m_logger) << "deleteAssignmentAesItem"; if (m_effectorStateMachine) { delete m_effectorStateMachine; @@ -119,7 +119,7 @@ bool ObjectEffector::reportFireReadinessRequest() // Feuerbereitschaft melden void ObjectEffector::fireOrderRequest() // Feuerbefehl erhalten { - DEBUG_LOG() << "fireOrderRequest"; + DEBUG_LOG(m_logger) << "fireOrderRequest"; if (!m_effectorStateMachine) return; @@ -128,7 +128,7 @@ void ObjectEffector::fireOrderRequest() // Feuerbefehl erhalten void ObjectEffector::fireRequest() // Feuern { - DEBUG_LOG() << "fireRequest"; + DEBUG_LOG(m_logger) << "fireRequest"; if (!m_effectorStateMachine) return; m_effectorStateMachine->fire(); @@ -136,7 +136,7 @@ void ObjectEffector::fireRequest() // Feuern bool ObjectEffector::reportFiredRequest() // Abgefeuert melden { - DEBUG_LOG() << "reportFiredRequest"; + DEBUG_LOG(m_logger) << "reportFiredRequest"; if (!m_effectorStateMachine) return false; return m_effectorStateMachine->reportFired(); @@ -144,7 +144,7 @@ bool ObjectEffector::reportFiredRequest() // Abgefeuert melden void ObjectEffector::reportEmptyChargeRequest(bool emptyCharge) // Munition leer { - DEBUG_LOG() << "reportEmptyChargeRequest"; + DEBUG_LOG(m_logger) << "reportEmptyChargeRequest"; if (!m_effectorStateMachine) return; m_effectorStateMachine->setEmptyCharge(emptyCharge); @@ -166,7 +166,7 @@ void ObjectEffector::resetReadynessTimer() void ObjectEffector::sendEffectorToDds() { // Effector Effector; - DEBUG_LOG() << "sendEffectorToDds NewState= " << m_effectorStateMachine->getCurrentStateStr() << ", participantId=" << m_participantId + DEBUG_LOG(m_logger) << "sendEffectorToDds NewState= " << m_effectorStateMachine->getCurrentStateStr() << ", participantId=" << m_participantId << ", aesItemId=" << m_aesItemId; AreaEffectSimulation::Effector effector; effector.id(m_participantId); @@ -178,11 +178,11 @@ void ObjectEffector::sendEffectorToDds() void ObjectEffector::onEffectorFired() { - DEBUG_LOG() << "onEffectorFired"; + DEBUG_LOG(m_logger) << "onEffectorFired"; if (m_firingStrategy == nullptr) { - ERROR_LOG() << "Not possible to fire. No firing strategy specified."; + ERROR_LOG(m_logger) << "Not possible to fire. No firing strategy specified."; return; } @@ -195,7 +195,7 @@ void ObjectEffector::onEffectorFired() // Input: SAA-Format, relativ zum Geschoss in metern und die Zeit relativ zur Abschusszeit void ObjectEffector::setIndendedTrajectory(const std::vector &geometryRelativeToLaunchOrigin) { - DEBUG_LOG() << "setTrajectory #points=" << geometryRelativeToLaunchOrigin.size(); + DEBUG_LOG(m_logger) << "setTrajectory #points=" << geometryRelativeToLaunchOrigin.size(); m_intendendTrajectory.clear(); for (const Core::RelativePositionRelativeTime &geoPosRelTime : geometryRelativeToLaunchOrigin) { @@ -209,7 +209,7 @@ void ObjectEffector::setIndendedTrajectory(const std::vectorinitPublisherSubscriber(); - DEBUG_LOG() << "create ftc"; + DEBUG_LOG(m_logger) << "create ftc"; m_ftc = AssetManagement::Interface::Ftc::create(m_ddsConnector); - DEBUG_LOG() << "init ftc"; + DEBUG_LOG(m_logger) << "init ftc"; bool bRet = m_ftc->enableAll(); - DEBUG_LOG() << "init end - bRet = " << bRet; + DEBUG_LOG(m_logger) << "init end - bRet = " << bRet; - DEBUG_LOG() << "Domain Id = " << domainId; - DEBUG_LOG() << "Training Area Id = " << trainingAreaId; - DEBUG_LOG() << "Test Id = " << testId; + DEBUG_LOG(m_logger) << "Domain Id = " << domainId; + DEBUG_LOG(m_logger) << "Training Area Id = " << trainingAreaId; + DEBUG_LOG(m_logger) << "Test Id = " << testId; if (!bRet) failExit(); @@ -74,7 +74,7 @@ bool AsmTests::init(int domainId, int trainingAreaId, int testId) // ------------------------------------------------------------------ void AsmTests::startTest() { - INFO_LOG() << "startTest"; + INFO_LOG(m_logger) << "startTest"; if (m_testId == 1) QTimer::singleShot(0, this, &AsmTests::tryCreate); else if (m_testId == 2) @@ -181,7 +181,7 @@ void AsmTests::setRequestData(AssetManagement::TrainingAreaModifyRequest &reques // ------------------------------------------------------------------ void AsmTests::tryCreate() { - INFO_LOG() << "trying to send ModifyRequest TrainingArea (create)"; + INFO_LOG(m_logger) << "trying to send ModifyRequest TrainingArea (create)"; AssetManagement::TrainingAreaModifyRequest request; @@ -189,7 +189,7 @@ void AsmTests::tryCreate() if (!m_ftc->trainingAreaModifyRequest(request, this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } @@ -201,13 +201,13 @@ void AsmTests::tryCreate() void AsmTests::tryModify() { AssetManagement::TrainingAreaModifyRequest request; - INFO_LOG() << "trying to send modify request for training Area Id = " << m_trainingAreaId; + INFO_LOG(m_logger) << "trying to send modify request for training Area Id = " << m_trainingAreaId; setRequestData(request, m_trainingAreaId); if (!m_ftc->trainingAreaModifyRequest(request, this)) { - ERROR_LOG() << "Error requesting modify data"; + ERROR_LOG(m_logger) << "Error requesting modify data"; failExit(); } @@ -218,10 +218,10 @@ void AsmTests::tryModify() // ------------------------------------------------------------------ void AsmTests::tryDelete() { - INFO_LOG() << "trying to send delete request for exercise Id = " << m_trainingAreaId; + INFO_LOG(m_logger) << "trying to send delete request for exercise Id = " << m_trainingAreaId; if (!m_ftc->trainingAreaRemoveRequest(TrainingAreaRemoveRequest(m_trainingAreaId), this)) { - ERROR_LOG() << "Error requesting delete data"; + ERROR_LOG(m_logger) << "Error requesting delete data"; failExit(); } @@ -232,7 +232,7 @@ void AsmTests::tryDelete() // ------------------------------------------------------------------ void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got modifyReply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got modifyReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); if (replyObject.error()) @@ -246,7 +246,7 @@ void AsmTests::onTrainingAreaModifyReply(const Core::FunctionReplyObject &replyO // ------------------------------------------------------------------ void AsmTests::onTrainingAreaRemoveReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "Got removeReply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); if (replyObject.error()) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/Messages/client_message.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/Messages/client_message.cpp index 789e06444..3d2f2900a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/Messages/client_message.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/Messages/client_message.cpp @@ -51,9 +51,8 @@ ClientMessage::ClientMessage(DataManager *dataManager, LtsWebSocket::ReplyHandle // ####### ClientMessage end ####### // ####### BaseDlRequest begin ####### -BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid) - : ClientMessage(dataManager, client, type, typeId, uuid) -{} +BaseDlRequest::BaseDlRequest(DataManager *dataManager, LtsWebSocket::ReplyHandler *client, const QString &type, const int typeId, const QString &uuid) : ClientMessage(dataManager, client, type, typeId, uuid), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} void BaseDlRequest::process() { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/websocket_interface_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/websocket_interface_handler.cpp index a09acc3d1..c8840af20 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/websocket_interface_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/WebSocketInterface/websocket_interface_handler.cpp @@ -36,7 +36,7 @@ bool WebSocketInterfaceHandler::init() { cleanup(); - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "... ok"; m_dataManager = new DataManager(m_mainHandler); @@ -44,16 +44,16 @@ bool WebSocketInterfaceHandler::init() m_webSocketServer = new LtsWebSocket::LtsWebSocketServer(m_messageFactory, this); - DEBUG_LOG() << "Initialising LtsWebSocketServer"; + DEBUG_LOG(m_logger) << "Initialising LtsWebSocketServer"; if (!m_webSocketServer->init(QStringLiteral("ASM"), Settings::getWebSocketServerPortRange(1))) { - ERROR_LOG() << "Failed to initialise LtsWebSocketServer"; + ERROR_LOG(m_logger) << "Failed to initialise LtsWebSocketServer"; return false; } - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "... ok"; - DEBUG_LOG() << "Connection signals and slots"; - DEBUG_LOG() << "... ok"; + DEBUG_LOG(m_logger) << "Connection signals and slots"; + DEBUG_LOG(m_logger) << "... ok"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.cpp index 5f62e3aaf..0465abc4e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.cpp @@ -16,14 +16,14 @@ namespace AssetManagement DdsHandler::DdsHandler(int domainId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Any)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } @@ -38,10 +38,10 @@ bool DdsHandler::init(const QStringList &qosFileList) m_ddsDts = AssetManagement::Interface::Dts::create(m_ddsConnector); m_ddsFts = AssetManagement::Interface::Fts::create(m_ddsConnector); bool bRet = m_ddsDts->enableAll(); - INFO_LOG() << "Dts initialised"; + INFO_LOG(m_logger) << "Dts initialised"; bRet &= m_ddsFts->enableAll(); - INFO_LOG() << "Fts initialised"; + INFO_LOG(m_logger) << "Fts initialised"; return bRet; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.h index 8c25ebfff..231554c1f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/dds_handler.h @@ -37,6 +37,7 @@ public: std::shared_ptr fts() const { return m_ddsFts; } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_topicLockMaster; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.cpp index a8cd8de32..7a84f741f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.cpp @@ -39,7 +39,7 @@ bool HandlerAsset::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); bRet = false; return; } @@ -47,11 +47,11 @@ bool HandlerAsset::init() }; if (!m_mainHandler->db()->select(cb) || !bRet) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } - DEBUG_LOG() << "m_objectAssetMap.size() = " << m_objectAssetMap.size(); + DEBUG_LOG(m_logger) << "m_objectAssetMap.size() = " << m_objectAssetMap.size(); return true; } @@ -62,7 +62,7 @@ void HandlerAsset::onAssetModifyRequest(const rti::core::SampleIdentity &cookie, { const auto ret = assetModifyRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->assetModifyReply(cookie, ret); } @@ -114,7 +114,7 @@ void HandlerAsset::onAssetRemoveRequest(const rti::core::SampleIdentity &cookie, ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else { // delete ObjectAsset diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.h index 61c29b779..fe1aa1c99 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_asset.h @@ -30,6 +30,7 @@ public: bool init(); private: + NGL::INGLLogger &m_logger; void onAssetModifyRequest(const rti::core::SampleIdentity &cookie, const Asset &request) override; Core::FunctionReplyObject assetModifyRequest(const Asset &request); @@ -37,6 +38,7 @@ private: const Core::RemoveElementRequest &request) override; private: + NGL::INGLLogger &m_logger; QHash m_objectAssetMap; MainHandler *m_mainHandler; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.cpp index aa521760c..1e0cf2ef8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.cpp @@ -45,11 +45,11 @@ bool HandlerLocation::init() }; if (!m_mainHandler->db()->select(cb)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } - DEBUG_LOG() << "#Locations published: " << iCnt; + DEBUG_LOG(m_logger) << "#Locations published: " << iCnt; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.h index 6b704eb9d..85b190944 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_location.h @@ -19,6 +19,7 @@ public: bool init(); private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.cpp index eef239171..3813cee11 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.cpp @@ -39,7 +39,7 @@ bool HandlerRelayInfo::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); bRet = false; return; } @@ -47,11 +47,11 @@ bool HandlerRelayInfo::init() }; if (!m_mainHandler->db()->select(cb) || !bRet) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } - DEBUG_LOG() << "m_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size(); + DEBUG_LOG(m_logger) << "m_objectRelayInfoMap.size() = " << m_objectRelayInfoMap.size(); return true; } @@ -62,7 +62,7 @@ void HandlerRelayInfo::onRelayInfoModifyRequest(const rti::core::SampleIdentity { const auto ret = relayInfoModifyRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->relayInfoModifyReply(cookie, ret); } @@ -114,7 +114,7 @@ void HandlerRelayInfo::onRelayInfoRemoveRequest(const rti::core::SampleIdentity ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else { // delete ObjectRelayInfo diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.h index 6409b2ae2..77466cacd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_relay_info.h @@ -30,6 +30,7 @@ public: bool init(); private: + NGL::INGLLogger &m_logger; void onRelayInfoModifyRequest(const rti::core::SampleIdentity &cookie, const RelayInfo &request) override; Core::FunctionReplyObject relayInfoModifyRequest(const RelayInfo &request); @@ -37,6 +38,7 @@ private: const Core::RemoveElementRequest &request) override; private: + NGL::INGLLogger &m_logger; QHash m_objectRelayInfoMap; MainHandler *m_mainHandler; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.cpp index 7e09858dc..084382386 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.cpp @@ -42,7 +42,7 @@ bool HandlerTrainingArea::init() QVector dataVecMD; if (!m_mainHandler->db()->select(dataVecMD)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } @@ -58,38 +58,38 @@ bool HandlerTrainingArea::init() { case AssetManagement::MapDescriptionType_def::Map2D: mapDescriptionSeq.map2D.insert(data.objOrder, data); - INFO_LOG() << "map2D.insert order =" << data.objOrder; + INFO_LOG(m_logger) << "map2D.insert order =" << data.objOrder; break; case AssetManagement::MapDescriptionType_def::Scene3D: mapDescriptionSeq.scene3D.insert(data.objOrder, data); - INFO_LOG() << "Scene3D.insert order =" << data.objOrder; + INFO_LOG(m_logger) << "Scene3D.insert order =" << data.objOrder; break; case AssetManagement::MapDescriptionType_def::Elevation: mapDescriptionSeq.elevation.insert(data.objOrder, data); - INFO_LOG() << "Elevation.insert order =" << data.objOrder; + INFO_LOG(m_logger) << "Elevation.insert order =" << data.objOrder; break; case AssetManagement::MapDescriptionType_def::SceneObj: mapDescriptionSeq.sceneObj.insert(data.objOrder, data); - INFO_LOG() << "sceneObj.insert order =" << data.objOrder; + INFO_LOG(m_logger) << "sceneObj.insert order =" << data.objOrder; break; } mapDescriptionSeqences.insert(data.trainingAreaId, mapDescriptionSeq); if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); return false; } m_objectMapDescriptionMap.insert(ifs->getId(), ifs); } - DEBUG_LOG() << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size(); + DEBUG_LOG(m_logger) << "m_objectMapDescriptionMap.size() = " << m_objectMapDescriptionMap.size(); QVector dataVec; // read all training areas from database if (!m_mainHandler->db()->select(dataVec)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } @@ -125,13 +125,13 @@ bool HandlerTrainingArea::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); return false; } m_objectTrainingAreaMap.insert(ifs->getId(), ifs); } - DEBUG_LOG() << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size(); + DEBUG_LOG(m_logger) << "m_objectTrainingAreaMap.size() = " << m_objectTrainingAreaMap.size(); return true; } @@ -139,16 +139,16 @@ bool HandlerTrainingArea::init() //---------------------------------------------------------------------------------------------- void HandlerTrainingArea::removeMapDescriptions(int trainingAreaId) { - INFO_LOG() << "removeMapDescriptions trainingAreaId = " << trainingAreaId + INFO_LOG(m_logger) << "removeMapDescriptions trainingAreaId = " << trainingAreaId << " m_objectMapDescriptionMap.size = " << m_objectMapDescriptionMap.size(); QMapIterator< int, ObjectMapDescription *> it(m_objectMapDescriptionMap); while ( it.hasNext()) { it.next(); - INFO_LOG() << "remove map description key = " << it.key(); + INFO_LOG(m_logger) << "remove map description key = " << it.key(); if ( it.value()->getData().trainingAreaId() == trainingAreaId) { - DEBUG_LOG() << "remove id= " << it.key(); + DEBUG_LOG(m_logger) << "remove id= " << it.key(); ObjectMapDescription *ifs = m_objectMapDescriptionMap.value(it.key()); @@ -165,7 +165,7 @@ void HandlerTrainingArea::onTrainingAreaModifyRequest(const rti::core::SampleIde { const auto ret = trainingAreaModifyRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->trainingAreaModifyReply(cookie, ret); } @@ -200,7 +200,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T } if (request.id() > 0) // Modify { - DEBUG_LOG() << "modify: delete old entries in map_description"; + DEBUG_LOG(m_logger) << "modify: delete old entries in map_description"; removeMapDescriptions(ifs->getId()); } @@ -215,7 +215,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T mdData.id(0); mdData.trainingAreaId(ifs->getId()); ret = md->createObject(mdData, i); - DEBUG_LOG() << "insert topographic entries in map_description" + DEBUG_LOG(m_logger) << "insert topographic entries in map_description" << " for training area id " << ifs->getId() << " mapTypeId=" << mdData.mapTypeId() << " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId(); @@ -240,7 +240,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T mdData.id(0); mdData.trainingAreaId(ifs->getId()); ret = md->createObject(mdData, i); - DEBUG_LOG() << "insert elevation entries in map_description" + DEBUG_LOG(m_logger) << "insert elevation entries in map_description" << " for training area id " << ifs->getId() << " mapTypeId=" << mdData.mapTypeId() << " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId(); @@ -265,7 +265,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T mdData.id(0); mdData.trainingAreaId(ifs->getId()); ret = md->createObject(mdData, i); - DEBUG_LOG() << "insert scene3D entries in map_description" + DEBUG_LOG(m_logger) << "insert scene3D entries in map_description" << " for training area id " << ifs->getId() << " mapTypeId=" << mdData.mapTypeId() << " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId(); @@ -290,7 +290,7 @@ Core::FunctionReplyObject HandlerTrainingArea::trainingAreaModifyRequest(const T mdData.id(0); mdData.trainingAreaId(ifs->getId()); ret = md->createObject(mdData, i); - DEBUG_LOG() << "insert sceneObjects entries in map_description" + DEBUG_LOG(m_logger) << "insert sceneObjects entries in map_description" << " for training area id " << ifs->getId() << " mapTypeId=" << mdData.mapTypeId() << " mapDescriptionTypeId=" << mdData.mapDescriptionTypeId(); @@ -335,7 +335,7 @@ void HandlerTrainingArea::onTrainingAreaRemoveRequest(const rti::core::SampleIde ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else { // delete ObjectTrainingArea @@ -356,7 +356,7 @@ void HandlerTrainingArea::onMapDescriptionModifyRequest(const rti::core::SampleI { const auto ret = mapDescriptionModifyRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_mainHandler->dds()->fts()->mapDescriptionModifyReply(cookie, ret); } @@ -393,7 +393,7 @@ void HandlerTrainingArea::onMapDescriptionRemoveRequest(const rti::core::SampleI ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else { // delete ObjectMapDescription diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.h index 14b3f52c4..a0241f8cc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_training_area.h @@ -45,6 +45,7 @@ public: bool init(); private: + NGL::INGLLogger &m_logger; void onTrainingAreaModifyRequest(const rti::core::SampleIdentity &cookie, const TrainingArea &request) override; Core::FunctionReplyObject trainingAreaModifyRequest(const TrainingArea &request); @@ -58,6 +59,7 @@ private: const Core::RemoveElementRequest &request) override; private: + NGL::INGLLogger &m_logger; QMap m_objectTrainingAreaMap; QMap m_objectMapDescriptionMap; MainHandler *m_mainHandler; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_workstation_logout.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_workstation_logout.h index 0fbfabff2..5586f75c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_workstation_logout.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/handler_workstation_logout.h @@ -34,6 +34,8 @@ public: void onWorkstationLogoutRequest(const rti::core::SampleIdentity &cookie, const WorkstationLogout &request) override final; private: + +NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; QMap m_logoutRequestMap; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.cpp index a920e4ba3..f70fcc6f2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.cpp @@ -21,8 +21,7 @@ namespace AssetManagement { -MainHandler::MainHandler(QObject *parent) - : QObject(parent) +MainHandler::MainHandler(QObject *parent) : QObject(parent) , m_handlerTrainingArea(nullptr) , m_handlerWorkstationLogout(nullptr) , m_handlerAsset(nullptr) @@ -30,8 +29,8 @@ MainHandler::MainHandler(QObject *parent) , m_handlerRelayInfo(nullptr) , m_ddsHandler(nullptr) , m_dbHandler(nullptr) - , m_handlerWebSocket(nullptr) -{} + , m_handlerWebSocket(nullptr), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() { @@ -52,29 +51,29 @@ bool MainHandler::init(int domainId) if (!m_dbHandler->init(0, Settings::settings())) { - ERROR_LOG() << "Initialisation dbHandler failed."; + ERROR_LOG(m_logger) << "Initialisation dbHandler failed."; return false; } - DEBUG_LOG() << "Initialisation dbHandler succesful."; + DEBUG_LOG(m_logger) << "Initialisation dbHandler succesful."; // initialize DDS m_ddsHandler = std::make_shared(domainId); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation ddsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation ddsHandler failed."; return false; } - DEBUG_LOG() << "Initialisation ddsHandler succesful."; + DEBUG_LOG(m_logger) << "Initialisation ddsHandler succesful."; // read project specific data from database // publish project specific data // initialize all handlers if (!initAsmHandler()) { - ERROR_LOG() << "Initialisation AsmHandler failed."; + ERROR_LOG(m_logger) << "Initialisation AsmHandler failed."; return false; } - DEBUG_LOG() << "Initialisation AsmHandler succesful."; + DEBUG_LOG(m_logger) << "Initialisation AsmHandler succesful."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::Running); @@ -83,73 +82,73 @@ bool MainHandler::init(int domainId) bool MainHandler::initAsmHandler() { - DEBUG_LOG() << "Start Initialisation AsmHandler"; + DEBUG_LOG(m_logger) << "Start Initialisation AsmHandler"; // TrainingArea m_handlerTrainingArea = std::make_shared(this); - DEBUG_LOG() << "Reset HandlerTrainingArea succesful."; + DEBUG_LOG(m_logger) << "Reset HandlerTrainingArea succesful."; if (!m_handlerTrainingArea->init()) { - ERROR_LOG() << "Initialisation of HandlerTrainingArea failed."; + ERROR_LOG(m_logger) << "Initialisation of HandlerTrainingArea failed."; return false; } - DEBUG_LOG() << "Initialisation HandlerTrainingArea succesful."; + DEBUG_LOG(m_logger) << "Initialisation HandlerTrainingArea succesful."; // WorkstationLogout m_handlerWorkstationLogout = std::make_shared(this); - DEBUG_LOG() << "Reset HandlerWorkstationLogout succesful."; + DEBUG_LOG(m_logger) << "Reset HandlerWorkstationLogout succesful."; if (!m_handlerWorkstationLogout->init()) { - ERROR_LOG() << "Initialisation of HandlerWorkstationLogout failed."; + ERROR_LOG(m_logger) << "Initialisation of HandlerWorkstationLogout failed."; return false; } - DEBUG_LOG() << "Initialisation HandlerWorkstationLogout succesful."; + DEBUG_LOG(m_logger) << "Initialisation HandlerWorkstationLogout succesful."; // Asset m_handlerAsset = std::make_shared(this); - DEBUG_LOG() << "Reset HandlerAsset succesful."; + DEBUG_LOG(m_logger) << "Reset HandlerAsset succesful."; if (!m_handlerAsset->init()) { - ERROR_LOG() << "Initialisation of HandlerAsset failed."; + ERROR_LOG(m_logger) << "Initialisation of HandlerAsset failed."; return false; } - DEBUG_LOG() << "Initialisation HandlerAsset succesful."; + DEBUG_LOG(m_logger) << "Initialisation HandlerAsset succesful."; // Location m_handlerLocation = std::make_shared(this); - DEBUG_LOG() << "Reset HandlerLocation succesful."; + DEBUG_LOG(m_logger) << "Reset HandlerLocation succesful."; if (!m_handlerLocation->init()) { - ERROR_LOG() << "Initialisation of HandlerLocation failed."; + ERROR_LOG(m_logger) << "Initialisation of HandlerLocation failed."; return false; } - DEBUG_LOG() << "Initialisation HandlerLocation succesful."; + DEBUG_LOG(m_logger) << "Initialisation HandlerLocation succesful."; // RelayInfo m_handlerRelayInfo = std::make_shared(this); - DEBUG_LOG() << "Reset HandlerRelayInfo succesful."; + DEBUG_LOG(m_logger) << "Reset HandlerRelayInfo succesful."; if (!m_handlerRelayInfo->init()) { - ERROR_LOG() << "Initialisation of HandlerRelayInfo failed."; + ERROR_LOG(m_logger) << "Initialisation of HandlerRelayInfo failed."; return false; } - DEBUG_LOG() << "Initialisation HandlerRelayInfo succesful."; + DEBUG_LOG(m_logger) << "Initialisation HandlerRelayInfo succesful."; // WebSocketServer m_handlerWebSocket = std::make_shared(this); - DEBUG_LOG() << "Reset WebSocketInterfaceHandler succesful."; + DEBUG_LOG(m_logger) << "Reset WebSocketInterfaceHandler succesful."; if (!m_handlerWebSocket->init()) { - ERROR_LOG() << "Initialisation WebSocketInterfaceHandler failed."; + ERROR_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler failed."; return false; } m_ddsHandler->pacemaker()->addPort(m_handlerWebSocket->serverWebSocketPort(), Core::PortType::WebSocketServer); - DEBUG_LOG() << "Initialisation WebSocketInterfaceHandler succesful."; + DEBUG_LOG(m_logger) << "Initialisation WebSocketInterfaceHandler succesful."; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.h index 4b7d72298..2c7a8d243 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/main_handler.h @@ -44,8 +44,10 @@ public: int exerciseId() const; private: + NGL::INGLLogger &m_logger; bool initAsmHandler(); private: + NGL::INGLLogger &m_logger; // std::shared_ptr m_handlerMapDesc; std::shared_ptr m_handlerTrainingArea; std::shared_ptr m_handlerWorkstationLogout; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.cpp index aa947464c..ffed73f8c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.cpp @@ -15,9 +15,8 @@ //------------------------------------------------------------------------------ namespace AssetManagement { -ObjectAsset::ObjectAsset(MainHandler *mainHandler) - : m_mainHandler(mainHandler) -{ +ObjectAsset::ObjectAsset(MainHandler *mainHandler) : m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------ @@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectAsset::createObject(const Asset &data) return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmAsset-data into database")); m_data.id(dbData.id); - DEBUG_LOG() << "New assetId: " << m_data.id(); + DEBUG_LOG(m_logger) << "New assetId: " << m_data.id(); } // Publish Data via DTS @@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectAsset::updateObject(const Asset &data) return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmAsset-data into database")); m_data = data; - DEBUG_LOG() << "Data changed for assetId: " << m_data.id(); + DEBUG_LOG(m_logger) << "Data changed for assetId: " << m_data.id(); // Publish Data via DTS onPublishData(); @@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectAsset::removeObject() //------------------------------------------------------------------------------ void ObjectAsset::onPublishData() { - INFO_LOG() << "Publish AsmAsset-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish AsmAsset-data to dds (" << m_data.id() << ") ..."; if (!m_mainHandler->dds()->dts()->publish(m_data)) - ERROR_LOG() << "Error publishing AsmAsset-data to dds"; + ERROR_LOG(m_logger) << "Error publishing AsmAsset-data to dds"; } // ------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.h index d4caf8503..e98f76941 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_asset.h @@ -47,6 +47,7 @@ public: static Asset toDdsData(const Database::AsmAsset &dbData); // db -> dds protected: + NGL::INGLLogger &m_logger; void onPublishData(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.cpp index 43ba4905f..114b5c900 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.cpp @@ -12,10 +12,9 @@ namespace AssetManagement { -ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler) - : m_mainHandler(mainHandler) - , m_order(-1) -{ +ObjectMapDescription::ObjectMapDescription(MainHandler *mainHandler) : m_mainHandler(mainHandler) + , m_order(-1), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } bool ObjectMapDescription::isValid() const @@ -38,7 +37,7 @@ Core::FunctionReplyObject ObjectMapDescription::createObject(const MapDescriptio return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmMapDescription-data into database")); m_data.id(dbData.id); - DEBUG_LOG() << "New MapDescription Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "New MapDescription Id: " << m_data.id(); } else if (order != m_order && m_order >= 0) { @@ -64,7 +63,7 @@ Core::FunctionReplyObject ObjectMapDescription::updateObject(const MapDescriptio return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmMapDescription-data into database")); m_data = data; - DEBUG_LOG() << "Data changed for MapDescription Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "Data changed for MapDescription Id: " << m_data.id(); return Core::FunctionReplyObject(m_data.id()); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.h index 13f9e98c7..938d3462e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_map_description.h @@ -38,6 +38,7 @@ public: static MapDescription toDdsData(const Database::AsmMapDescription &dbData); // db -> dds private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; MapDescription m_data; int m_order; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.cpp index 0c296c75a..64fd48941 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.cpp @@ -15,9 +15,8 @@ //------------------------------------------------------------------------------ namespace AssetManagement { -ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler) - : m_mainHandler(mainHandler) -{ +ObjectRelayInfo::ObjectRelayInfo(MainHandler *mainHandler) : m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------ @@ -54,7 +53,7 @@ Core::FunctionReplyObject ObjectRelayInfo::createObject(const RelayInfo &data) return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmEgcuRelayInfo-data into database")); m_data.id(dbData.id); - DEBUG_LOG() << "New relayInfo Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "New relayInfo Id: " << m_data.id(); } // Publish Data via DTS @@ -76,7 +75,7 @@ Core::FunctionReplyObject ObjectRelayInfo::updateObject(const RelayInfo &data) return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmEgcuRelayInfo-data into database")); m_data = data; - DEBUG_LOG() << "Data changed for relayInfo Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "Data changed for relayInfo Id: " << m_data.id(); // Publish Data via DTS onPublishData(); @@ -116,10 +115,10 @@ Core::FunctionReplyObject ObjectRelayInfo::removeObject() //------------------------------------------------------------------------------ void ObjectRelayInfo::onPublishData() { - INFO_LOG() << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish AsmEgcuRelayInfo-data to dds (" << m_data.id() << ") ..."; if (!m_mainHandler->dds()->dts()->publish(m_data)) - ERROR_LOG() << "Error publishing AsmEgcuRelayInfo-data to dds"; + ERROR_LOG(m_logger) << "Error publishing AsmEgcuRelayInfo-data to dds"; } // ------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.h index e212bc048..78b53f7d4 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_relay_info.h @@ -47,6 +47,7 @@ public: static RelayInfo toDdsData(const Database::AsmEgcuRelayInfo &dbData); // db -> dds protected: + NGL::INGLLogger &m_logger; void onPublishData(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.cpp index 5e724cec1..70c853a2c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.cpp @@ -14,9 +14,8 @@ //------------------------------------------------------------------------------ namespace AssetManagement { -ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler) - : m_mainHandler(mainHandler) -{ +ObjectTrainingArea::ObjectTrainingArea(MainHandler *mainHandler) : m_mainHandler(mainHandler), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------ @@ -53,7 +52,7 @@ Core::FunctionReplyObject ObjectTrainingArea::createObject(const TrainingArea &d return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AsmTrainingArea-data into database")); m_data.id(dbData.id); - DEBUG_LOG() << "New mapId: " << m_data.id(); + DEBUG_LOG(m_logger) << "New mapId: " << m_data.id(); } // Publish Data via DTS @@ -75,7 +74,7 @@ Core::FunctionReplyObject ObjectTrainingArea::updateObject(const TrainingArea &d return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating AsmTrainingArea-data into database")); m_data = data; - DEBUG_LOG() << "Data changed for mapId: " << m_data.id(); + DEBUG_LOG(m_logger) << "Data changed for mapId: " << m_data.id(); // Publish Data via DTS onPublishData(); @@ -115,10 +114,10 @@ Core::FunctionReplyObject ObjectTrainingArea::removeObject() //------------------------------------------------------------------------------ void ObjectTrainingArea::onPublishData() { - INFO_LOG() << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish AsmTrainingArea-data to dds (" << m_data.id() << ") ..."; if (!m_mainHandler->dds()->dts()->publish(m_data)) - ERROR_LOG() << "Error publishing AsmTrainingArea-data to dds"; + ERROR_LOG(m_logger) << "Error publishing AsmTrainingArea-data to dds"; } // ------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.h index b98e03520..e6d1c2c59 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AssetManagement/object_training_area.h @@ -46,6 +46,7 @@ public: static Database::AsmTrainingArea toDbData(const TrainingArea &ddsData); // dds -> db protected: + NGL::INGLLogger &m_logger; void onPublishData(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.cpp index 88a323e6f..c3873fa6c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.cpp @@ -36,7 +36,7 @@ AvmFtTests::~AvmFtTests() // ------------------------------------------------------------------------------ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId) { - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_menuStructId = menuId; @@ -47,14 +47,14 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId) return false; m_ddsConnector->initPublisherSubscriber(); - DEBUG_LOG() << "create ftc AVM"; + DEBUG_LOG(m_logger) << "create ftc AVM"; m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector); - DEBUG_LOG() << "init ftc AVM"; + DEBUG_LOG(m_logger) << "init ftc AVM"; bool bRet = m_ftc->enableAll(); - DEBUG_LOG() << "init end AVM - bRet = " << bRet; + DEBUG_LOG(m_logger) << "init end AVM - bRet = " << bRet; - DEBUG_LOG() << "Domain Id = " << domainId; - DEBUG_LOG() << "Test Id = " << testId; + DEBUG_LOG(m_logger) << "Domain Id = " << domainId; + DEBUG_LOG(m_logger) << "Test Id = " << testId; return bRet; } @@ -62,7 +62,7 @@ bool AvmFtTests::init(int domainId, int testId, int menuId, int mountingPointId) // ------------------------------------------------------------------------------ void AvmFtTests::startTest() { - INFO_LOG() << "startTest"; + INFO_LOG(m_logger) << "startTest"; if (m_testId <= 1) QTimer::singleShot(0, this, &AvmFtTests::tryCreate); else if (m_testId == 2) @@ -74,7 +74,7 @@ void AvmFtTests::startTest() // ------------------------------------------------------------------------------ void AvmFtTests::tryCreate() { - INFO_LOG() << "trying to send createMenuStructRequest"; + INFO_LOG(m_logger) << "trying to send createMenuStructRequest"; m_menuStructId = -2; ModifyMenuStructRequest request; @@ -101,7 +101,7 @@ void AvmFtTests::tryCreate() if (!m_ftc->modifyMenuStructRequest(request, this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } } @@ -109,7 +109,7 @@ void AvmFtTests::tryCreate() // ------------------------------------------------------------------------------ void AvmFtTests::tryModify() { - INFO_LOG() << "trying to send modify request for menuStructId = " << m_menuStructId; + INFO_LOG(m_logger) << "trying to send modify request for menuStructId = " << m_menuStructId; ModifyMenuStructRequest request; request.id(m_menuStructId); request.name("TestGlobalMenuModify"); @@ -134,7 +134,7 @@ void AvmFtTests::tryModify() if (!m_ftc->modifyMenuStructRequest(request, this)) { - ERROR_LOG() << "Error requesting modify data"; + ERROR_LOG(m_logger) << "Error requesting modify data"; failExit(); } } @@ -142,13 +142,13 @@ void AvmFtTests::tryModify() // ------------------------------------------------------------------------------ void AvmFtTests::tryDelete() { - INFO_LOG() << "trying to send delete request for menuStructId = " << m_menuStructId; + INFO_LOG(m_logger) << "trying to send delete request for menuStructId = " << m_menuStructId; RemoveMenuStructRequest request; request.id(m_menuStructId); if (!m_ftc->removeMenuStructRequest(request, this)) { - ERROR_LOG() << "Error requesting delete data"; + ERROR_LOG(m_logger) << "Error requesting delete data"; failExit(); } } @@ -167,15 +167,15 @@ void AvmFtTests::createMenuStructReply(const Core::FunctionReplyObject &replyObj { if (replyObject.error()) { - ERROR_LOG() << "Got onCreateMenuStructReply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got onCreateMenuStructReply error: " << replyObject(); failExit(); return; } - INFO_LOG() << "Got createReply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got createReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); m_menuStructId = replyObject.id(); - DEBUG_LOG() << "m_testId = " << m_testId; + DEBUG_LOG(m_logger) << "m_testId = " << m_testId; if(m_testId == 0) QTimer::singleShot(0, this, &AvmFtTests::tryModify); @@ -188,11 +188,11 @@ void AvmFtTests::modifyMenuStructReply(const Core::FunctionReplyObject &replyObj { if (replyObject.error()) { - ERROR_LOG() << "Got onModifyMenuStructReply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got onModifyMenuStructReply error: " << replyObject(); failExit(); return; } - INFO_LOG() << "Got modifyRequest with id " << replyObject.id() + INFO_LOG(m_logger) << "Got modifyRequest with id " << replyObject.id() << " and errorString " << replyObject.translated(); if(m_testId == 0) QTimer::singleShot(0, this, &AvmFtTests::tryDelete); @@ -205,11 +205,11 @@ void AvmFtTests::onRemoveMenuStructReply(const Core::FunctionReplyObject &replyO { if (replyObject.error()) { - ERROR_LOG() << "Got onRemoveMenuStructReply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got onRemoveMenuStructReply error: " << replyObject(); failExit(); return; } - INFO_LOG() << "Got removeReply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got removeReply with id " << replyObject.id() << " and errorString " << replyObject.translated(); QTimer::singleShot(0, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.h index fd81a9065..b845ead51 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_ft_tests.h @@ -50,6 +50,7 @@ protected Q_SLOTS: void tryModify(); void tryDelete(); protected: + NGL::INGLLogger &m_logger; void onModifyMenuStructReply(const Core::FunctionReplyObject &replyObject) override final; void createMenuStructReply(const Core::FunctionReplyObject &replyObject); void modifyMenuStructReply(const Core::FunctionReplyObject &replyObject); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_vca_tests.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_vca_tests.h index 842944e8c..bc7ea2208 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_vca_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/avm_vca_tests.h @@ -43,6 +43,8 @@ private slots: void test(); private: + +NGL::INGLLogger &m_logger; void create(); void modify(); void remove(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/mvs_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/mvs_tests.cpp index 13d623b16..57ea1a203 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/mvs_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ModuleTests/mvs_tests.cpp @@ -38,7 +38,7 @@ MvsTests::~MvsTests() //---------------------------------------------------------------------------------- bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int stationId, int exerciseId) { - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_teamId = teamId; @@ -52,18 +52,18 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st return false; m_ddsConnector->initPublisherSubscriber(); - DEBUG_LOG() << "create ftc MVS"; + DEBUG_LOG(m_logger) << "create ftc MVS"; m_ftc = AudioVideoManagement::Interface::Ftc::create(m_ddsConnector); - DEBUG_LOG() << "init ftc MVS"; + DEBUG_LOG(m_logger) << "init ftc MVS"; bool bRet = m_ftc->enableAll(); - DEBUG_LOG() << "init end MVS - bRet = " << bRet; + DEBUG_LOG(m_logger) << "init end MVS - bRet = " << bRet; - DEBUG_LOG() << "Domain Id = " << domainId; - DEBUG_LOG() << "Team Id = " << teamId; - DEBUG_LOG() << "Test Id = " << testId; - DEBUG_LOG() << "Receiver Id = " << receiverId; - DEBUG_LOG() << "Radio Station Id = " << stationId; - DEBUG_LOG() << "Exercise Id = " << exerciseId; + DEBUG_LOG(m_logger) << "Domain Id = " << domainId; + DEBUG_LOG(m_logger) << "Team Id = " << teamId; + DEBUG_LOG(m_logger) << "Test Id = " << testId; + DEBUG_LOG(m_logger) << "Receiver Id = " << receiverId; + DEBUG_LOG(m_logger) << "Radio Station Id = " << stationId; + DEBUG_LOG(m_logger) << "Exercise Id = " << exerciseId; return bRet; } @@ -71,7 +71,7 @@ bool MvsTests::init(int domainId, int testId, int teamId, int receiverId, int st //---------------------------------------------------------------------------------- void MvsTests::startTest() { - INFO_LOG() << "startTest"; + INFO_LOG(m_logger) << "startTest"; switch (m_testId) { // case 1: @@ -99,18 +99,18 @@ void MvsTests::startTest() tryModifyAvsVideoReceiver(); break; default: - ERROR_LOG() << "Unknown test case !"; + ERROR_LOG(m_logger) << "Unknown test case !"; failExit(); break; } - INFO_LOG() << "********* endTest **************"; + INFO_LOG(m_logger) << "********* endTest **************"; QTimer::singleShot(0, qApp, &QCoreApplication::quit); } //---------------------------------------------------------------------------------- //void MvsTests::tryCreateVideoTeam() //{ -// INFO_LOG() << "trying to send createRequest VideoTeam"; +// INFO_LOG(m_logger) << "trying to send createRequest VideoTeam"; // VideoTeamModifyRequest request; // request.id(0); @@ -125,7 +125,7 @@ void MvsTests::startTest() // if (!m_ftc->videoTeamModifyRequest(request, this)) // { -// INFO_LOG() << "Error requesting create data, as expected"; +// INFO_LOG(m_logger) << "Error requesting create data, as expected"; // successExit(); // } @@ -150,7 +150,7 @@ void MvsTests::tryModifyVideoTeam() if (!m_ftc->videoTeamModifyRequest(request, this)) { - ERROR_LOG() << "Error requesting modify data"; + ERROR_LOG(m_logger) << "Error requesting modify data"; failExit(); } @@ -166,7 +166,7 @@ void MvsTests::tryModifyVideoTeam() // if (!m_ftc->videoTeamRemoveRequest(request, this)) // { -// ERROR_LOG() << "Error requesting remove data"; +// ERROR_LOG(m_logger) << "Error requesting remove data"; // failExit(); // } @@ -176,7 +176,7 @@ void MvsTests::tryModifyVideoTeam() //---------------------------------------------------------------------------------- void MvsTests::tryCreateVideoReceiver() { - INFO_LOG() << "trying to send createRequest VideoReceiver"; + INFO_LOG(m_logger) << "trying to send createRequest VideoReceiver"; VideoReceiverModifyRequest request; request.id(0); @@ -189,7 +189,7 @@ void MvsTests::tryCreateVideoReceiver() if (!m_ftc->videoReceiverModifyRequest(request, this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } @@ -211,7 +211,7 @@ void MvsTests::tryModifyVideoReceiver() if (!m_ftc->videoReceiverModifyRequest(request, this)) { - ERROR_LOG() << "Error requesting modify data"; + ERROR_LOG(m_logger) << "Error requesting modify data"; failExit(); } @@ -229,7 +229,7 @@ void MvsTests::tryModifyAvsVideoReceiver() if (!m_ftc->videoReceiverModifyAvsRequest(request, this)) { - ERROR_LOG() << "Error requesting modify AVS data"; + ERROR_LOG(m_logger) << "Error requesting modify AVS data"; failExit(); } @@ -246,7 +246,7 @@ void MvsTests::tryModifyActiveVideoReceiver() if (!m_ftc->videoReceiverModifyActiveRequest(request, this)) { - ERROR_LOG() << "Error requesting modify active data"; + ERROR_LOG(m_logger) << "Error requesting modify active data"; failExit(); } @@ -263,7 +263,7 @@ void MvsTests::tryDeleteVideoReceiver() if (!m_ftc->videoReceiverRemoveRequest(request, this)) { - ERROR_LOG() << "Error requesting remove data"; + ERROR_LOG(m_logger) << "Error requesting remove data"; failExit(); } @@ -274,7 +274,7 @@ void MvsTests::tryDeleteVideoReceiver() //---------------------------------------------------------------------------------- void MvsTests::failExit() { - ERROR_LOG() << "FAIL EXIT !"; + ERROR_LOG(m_logger) << "FAIL EXIT !"; m_bTestsSuccessful = false; QTimer::singleShot(0, qApp, &QCoreApplication::quit); } @@ -282,7 +282,7 @@ void MvsTests::failExit() //---------------------------------------------------------------------------------- void MvsTests::successExit() { - INFO_LOG() << "SUCCES EXIT !"; + INFO_LOG(m_logger) << "SUCCES EXIT !"; m_bTestsSuccessful = true; QTimer::singleShot(0, qApp, &QCoreApplication::quit); } @@ -291,14 +291,14 @@ void MvsTests::successExit() //---------------------------------------------------------------------------------- void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "END (onVideoTeamModifyReply)"; + DEBUG_LOG(m_logger) << "END (onVideoTeamModifyReply)"; if (replyObject.error()) { - ERROR_LOG() << "Got onVideoTeamModifyReply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got onVideoTeamModifyReply error: " << replyObject(); QTimer::singleShot(0, qApp, SLOT(quit())); return; } - INFO_LOG() << "Got Reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id() << " and errorString " << replyObject.translated(); m_teamId = replyObject.id(); @@ -309,14 +309,14 @@ void MvsTests::onVideoTeamModifyReply(const Core::FunctionReplyObject &replyObje //---------------------------------------------------------------------------------- void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "END (onVideoReceiverModifyReply)"; + DEBUG_LOG(m_logger) << "END (onVideoReceiverModifyReply)"; if (replyObject.error()) { - ERROR_LOG() << "Got onVideoReceiverModifyReply error: " << replyObject(); + ERROR_LOG(m_logger) << "Got onVideoReceiverModifyReply error: " << replyObject(); QTimer::singleShot(0, qApp, SLOT(quit())); return; } - INFO_LOG() << "Got Reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id() << " and errorString " << replyObject.translated(); m_receiverId = replyObject.id(); @@ -327,7 +327,7 @@ void MvsTests::onVideoReceiverModifyReply(const Core::FunctionReplyObject &reply // ------------------------------------------------------------------------------ void MvsTests::onError(const QString &reason) { - ERROR_LOG() << "Got Reply error: " << reason; + ERROR_LOG(m_logger) << "Got Reply error: " << reason; failExit(); } @@ -339,7 +339,7 @@ void MvsTests::onReply(const Core::FunctionReplyObject &replyObject) onError(replyObject.translated()); return; } - INFO_LOG() << "Got Reply with id " << replyObject.id() + INFO_LOG(m_logger) << "Got Reply with id " << replyObject.id() << " and errorString " << replyObject.translated(); // QTimer::singleShot(0, qApp, SLOT(quit())); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/asset_assignment_manager.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/asset_assignment_manager.cpp index 50c726fdd..f5932e41d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/asset_assignment_manager.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/asset_assignment_manager.cpp @@ -373,7 +373,7 @@ bool AssetAssignmentManager::hasPendingModifications(int assetId) void AssetAssignmentManager::logPending() { - DEBUG_LOG() << "pending Mounts, Modifications (Asset), Unmounts, Removes: " + DEBUG_LOG(m_logger) << "pending Mounts, Modifications (Asset), Unmounts, Removes: " << m_pendingMounts.size() << ", " << m_pendingModifications.size() << ", " << m_pendingUnmounts.size() << ", " diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/audio_video_handler_impl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/audio_video_handler_impl.cpp index 801607652..966fe5174 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/audio_video_handler_impl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/audio_video_handler_impl.cpp @@ -323,7 +323,7 @@ void AudioVideoHandlerImpl::onAssetChanged(Asset *asset) { Q_ASSERT(m_isActive); Q_ASSERT(asset); - DEBUG_LOG() << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")"; + DEBUG_LOG(m_logger) << m_exContext << ": Asset changed: " << asset->data().name() << "(" << asset->data().id() << ")"; updateDeviceConfig(asset); } @@ -332,7 +332,7 @@ void AudioVideoHandlerImpl::onMountingPointChanged(MountingPoint *mountingPoint) { Q_ASSERT(m_isActive); Q_ASSERT(mountingPoint); - DEBUG_LOG() << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")"; + DEBUG_LOG(m_logger) << m_exContext << ": MountingPoint changed: " << mountingPoint->data().name() << "(" << mountingPoint->data().id() << ")"; updateDeviceConfig(mountingPoint->asset()); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/av_socket.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/av_socket.cpp index ddc4b272d..822cfbf40 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/av_socket.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/av_socket.cpp @@ -69,7 +69,7 @@ AVSocket::~AVSocket() void AVSocket::onDisconnected() { - // WARNING_LOG() << "Disconnected from A/V system (" + // WARNING_LOG(m_logger) << "Disconnected from A/V system (" // << getConnectionString() // << ") - trying to reconnect"; m_bSuccessfullyLoggedIn = false; @@ -80,7 +80,7 @@ void AVSocket::onError(QAbstractSocket::SocketError error) { if (!m_bErrorInTcpComWarnedOnce) { - ERROR_LOG() << "Error in tcp communication with A/V system (" + ERROR_LOG(m_logger) << "Error in tcp communication with A/V system (" << getConnectionString() << "): " << QVariant::fromValue(error).toString(); m_bErrorInTcpComWarnedOnce = true; @@ -123,7 +123,7 @@ bool AVSocket::sendInternal(const QByteArray &cmd) { if (!m_avsSocket || !m_avsSocket->isWritable()) { - WARNING_LOG() << "AVS not connected - can not send command '" + WARNING_LOG(m_logger) << "AVS not connected - can not send command '" << cmd << "'"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_comm.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_comm.cpp index 77952fa46..da6563aec 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_comm.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_comm.cpp @@ -602,7 +602,7 @@ void AvaComm::parseResponse(const QByteArray &line) } default: - DEBUG_LOG() << "Response not implemented: " << line; + DEBUG_LOG(m_logger) << "Response not implemented: " << line; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_control.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_control.cpp index 37c84d774..81e3c1b5d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_control.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_control.cpp @@ -288,13 +288,13 @@ void AvaControl::keepAlive() void AvaControl::onConnected() { m_connected = true; - DEBUG_LOG() << "connected"; + DEBUG_LOG(m_logger) << "connected"; } void AvaControl::onDisconnected() { m_connected = false; - DEBUG_LOG() << "disconnected"; + DEBUG_LOG(m_logger) << "disconnected"; m_queue.flush(); } @@ -303,12 +303,12 @@ void AvaControl::onTimeout() ICommand *cmd = m_queue.currentCommand(); if (cmd->canTimeout()) { - INFO_LOG() << "command '" << cmd->debug() << "' failed"; + INFO_LOG(m_logger) << "command '" << cmd->debug() << "' failed"; m_queue.done(); return; } - ERROR_LOG() << "command timed out"; + ERROR_LOG(m_logger) << "command timed out"; failed(cmd); } @@ -319,7 +319,7 @@ void AvaControl::queue(ICommand *cmd, LtsUtils::IConnection *connection) if (!m_connected) { - DEBUG_LOG() << "not connected -> dropping command"; + DEBUG_LOG(m_logger) << "not connected -> dropping command"; return; } @@ -449,7 +449,7 @@ void AvaControl::failed(AvaCommands::SetScript *cmd) void AvaControl::failed(ICommand *cmd) { - ERROR_LOG() << "command '" << cmd->debug() << "' failed"; + ERROR_LOG(m_logger) << "command '" << cmd->debug() << "' failed"; Q_ASSERT(cmd == m_queue.currentCommand()); auto cmdSetScript = dynamic_cast(cmd); if (cmdSetScript) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_session.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_session.cpp index 6b8ec55e7..2d6789782 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_session.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/ava_session.cpp @@ -64,7 +64,7 @@ void AvaSession::onConnected() m_established = true; if (m_keepAliveEnabled) m_keepAliveTimer.start(); - DEBUG_LOG() << "session established"; + DEBUG_LOG(m_logger) << "session established"; emit sessionEstablished(); } @@ -72,7 +72,7 @@ void AvaSession::onDisconnected() { m_keepAliveTimer.stop(); m_established = false; - DEBUG_LOG() << "disconnected"; + DEBUG_LOG(m_logger) << "disconnected"; emit disconnected(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/avs_command_queue.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/avs_command_queue.cpp index 1c125a0ea..dd2c49e03 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/avs_command_queue.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/avs_command_queue.cpp @@ -37,7 +37,7 @@ void AvsCommandQueue::queue(std::unique_ptr cmd, std::unique_ptrsend(); @@ -124,7 +124,7 @@ void AvsCommandQueue::tryReduce() if (!lastCommand.cmd->nullifies(current.cmd.get())) continue; - DEBUG_LOG() << "dropping command due to override"; + DEBUG_LOG(m_logger) << "dropping command due to override"; m_queue.erase(m_queue.begin() + i); return; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_handler.cpp index b817dd2f9..5da39d62a 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_handler.cpp @@ -126,7 +126,7 @@ public: Database::AvmDeviceConfig deviceConfig = m_handler->toDeviceConfig(config); bool status = m_db->insert(deviceConfig); if (!status) - ERROR_LOG() << "Error while inserting device config"; + ERROR_LOG(m_logger) << "Error while inserting device config"; m_cache.insert(config.id(), deviceConfig); emit m_handler->avDbReloadNeeded(); @@ -142,7 +142,7 @@ public: newDeviceConfig.id = oldDeviceConfig.id; bool status = m_db->update(newDeviceConfig); if (!status) - ERROR_LOG() << "Error while updating device config"; + ERROR_LOG(m_logger) << "Error while updating device config"; m_cache[config.id()] = newDeviceConfig; emit m_handler->avDbReloadNeeded(); @@ -168,7 +168,7 @@ public: bool status = m_db->removeAvmDeviceConfig(m_cache.value(configId).id); if (!status) - ERROR_LOG() << "Error while removing device config"; + ERROR_LOG(m_logger) << "Error while removing device config"; m_cache.remove(configId); emit m_handler->avDbReloadNeeded(); @@ -230,7 +230,7 @@ bool CnrHandler::init() if (!m_db->select(m_channels)) { - ERROR_LOG() << "Error while selecting cnr channels from db"; + ERROR_LOG(m_logger) << "Error while selecting cnr channels from db"; return false; } @@ -241,7 +241,7 @@ bool CnrHandler::init() QVector cnrConfigs; if (!m_db->select(cnrConfigs)) { - ERROR_LOG() << "Error while selecting CNR configs from db"; + ERROR_LOG(m_logger) << "Error while selecting CNR configs from db"; return false; } @@ -275,7 +275,7 @@ void CnrHandler::onRemoveCnrConfigRequest(const rti::core::SampleIdentity &cooki { auto ret = removeCnrConfig(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->removeCnrConfigReply(cookie, ret); } @@ -284,19 +284,19 @@ void CnrHandler::onModifyCnrConfigRequest(const rti::core::SampleIdentity &cooki { auto ret = (request.id() < 1 ? createCnrConfig(request) : modifyCnrConfig(request)); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyCnrConfigReply(cookie, ret); } void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString &hostname) { - DEBUG_LOG() << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'"; + DEBUG_LOG(m_logger) << "Adding radio station with id " << id << " (" << name << ") and hostname '" << hostname << "'"; auto it = m_cnrRadioStations.find(id); if (it != m_cnrRadioStations.end() && it.value() == hostname) return; if (hostname.isEmpty()) { - WARNING_LOG() << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!"; + WARNING_LOG(m_logger) << "Radio station with id " << id << " (" << name << ") has an empty hostname - ignoring!"; return; } m_cnrRadioStations[id] = hostname; @@ -305,7 +305,7 @@ void CnrHandler::onRadioStationAdded(int id, const QString &name, const QString void CnrHandler::onRadioStationRemoved(int id) { - DEBUG_LOG() << "Removing radio station with id " << id; + DEBUG_LOG(m_logger) << "Removing radio station with id " << id; auto it = m_cnrRadioStations.find(id); if (it == m_cnrRadioStations.end()) return; @@ -347,7 +347,7 @@ void CnrHandler::onDbDeleteAvmCnrConfig(const QVariant &id) if (!m_cache.contains(configId)) return; // the notification was a result of our own removal of the entry - DEBUG_LOG() << "DB deleted AvmCnrConfig with id: " << configId; + DEBUG_LOG(m_logger) << "DB deleted AvmCnrConfig with id: " << configId; removeCnrConfig(Core::RemoveElementRequest(configId)); } @@ -385,7 +385,7 @@ void CnrHandler::reevalutate() { auto reply = modifyCnrConfig(toRequest(cnrConfig)); if (reply.error()) - ERROR_LOG() << reply(); + ERROR_LOG(m_logger) << reply(); } trans.commit(); @@ -558,7 +558,7 @@ bool CnrHandler::isNameUnique(const std::string &name, const boost::optional &dbId) { - DEBUG_LOG() << "CreateCnrConfigRequest: " << request; + DEBUG_LOG(m_logger) << "CreateCnrConfigRequest: " << request; auto reply = validateRequest(request); if (reply.error()) @@ -586,7 +586,7 @@ Core::FunctionReplyObject CnrHandler::createCnrConfig(const ModifyCnrConfigReque Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigRequest &request) { - DEBUG_LOG() << "ModifyCnrConfigRequest: " << request; + DEBUG_LOG(m_logger) << "ModifyCnrConfigRequest: " << request; auto reply = validateRequest(request); if (reply.error()) @@ -630,7 +630,7 @@ Core::FunctionReplyObject CnrHandler::modifyCnrConfig(const ModifyCnrConfigReque Core::FunctionReplyObject CnrHandler::removeCnrConfig(const Core::RemoveElementRequest &request) { - DEBUG_LOG() << "RemoveCnrConfigRequest: " << request; + DEBUG_LOG(m_logger) << "RemoveCnrConfigRequest: " << request; int32_t configId = request.id(); Core::FunctionReplyObject reply(configId); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_tvc_profile_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_tvc_profile_handler.cpp index 3afa5813e..05f896622 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_tvc_profile_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/cnr_tvc_profile_handler.cpp @@ -144,7 +144,7 @@ bool CnrTvcProfileHandler::init() bool status = m_db->select(circuitContainersDb); if (!status) { - ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile'"; + ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile'"; return false; } @@ -174,7 +174,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c bool status = m_db->selectByContainerId(circuitsContentDb, circuitContainerDb.id); if (!status) { - ERROR_LOG() << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'"; + ERROR_LOG(m_logger) << "Error reading data from database 'avm.avm_cnr_tvc_profile_data'"; return false; } @@ -185,7 +185,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c { status = m_db->removeAvmCnrTvcProfileData(invalid.id); if (!status) - ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id; + ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile_data' with id " << invalid.id; auto newEnd = std::remove_if(circuitsContentDb.begin(), circuitsContentDb.end(), [&invalid] (const Database::AvmCnrTvcProfileData &circuit) { return circuit.id == invalid.id; }); circuitsContentDb.erase(newEnd, circuitsContentDb.end()); } @@ -198,7 +198,7 @@ bool CnrTvcProfileHandler::collectAndPublish(const Database::AvmCnrTvcProfile &c status = m_db->removeAvmCnrTvcProfile(circuitContainerDb.id); if (!status) { - ERROR_LOG() << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id; + ERROR_LOG(m_logger) << "Failed to remove from 'avm.avm_cnr_tvc_profile' with id " << circuitContainerDb.id; return false; } @@ -231,7 +231,7 @@ void CnrTvcProfileHandler::onModifyCnrTvcProfileRequest(const rti::core::SampleI rep = modifyProfile(request); if (rep.error()) - WARNING_LOG() << rep.str(); + WARNING_LOG(m_logger) << rep.str(); m_fts->modifyCnrTvcProfileReply(cookie, rep); } @@ -242,7 +242,7 @@ void CnrTvcProfileHandler::onRemoveCnrTvcProfileRequest(const rti::core::SampleI Core::FunctionReplyObject rep = removeProfile(request); if (rep.error()) - WARNING_LOG() << rep.str(); + WARNING_LOG(m_logger) << rep.str(); m_fts->removeCnrTvcProfileReply(cookie, rep); } @@ -361,7 +361,7 @@ void CnrTvcProfileHandler::addProfile(const CnrTvcProfile &profile) bool status = m_dts->publish(profile); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id()); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (create)").arg(profile.id()); } void CnrTvcProfileHandler::removeProfile(int64_t id) @@ -375,7 +375,7 @@ void CnrTvcProfileHandler::removeProfile(int64_t id) bool status = m_dts->removeCnrTvcProfileByKey(id); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' with id %1 (remove)").arg(id); } void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile) @@ -393,7 +393,7 @@ void CnrTvcProfileHandler::updateProfile(const CnrTvcProfile &profile) bool status = m_dts->publish(profile); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id()); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'CnrTvcProfile' data with id %1 (modify)").arg(profile.id()); } void CnrTvcProfileHandler::onCnrConfigChanged(const CnrConfig &cnrConfig) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.cpp index accfaa19b..b5bf1937c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.cpp @@ -27,14 +27,14 @@ namespace AudioVideoManagement DdsHandler::DdsHandler(int domainId) : m_ddsConnector(std::make_shared(domainId, IDL::PartitionType::Any)) { - DEBUG_LOG() << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); + DEBUG_LOG(m_logger) << "DdsHandler(" << domainId << ") for partition: " << m_ddsConnector->getDefaultPartition(); } bool DdsHandler::init(const QStringList &qosFileList) { if (!m_ddsConnector->init(qosFileList)) { - ERROR_LOG() << "Error initializing dds connections - aborting"; + ERROR_LOG(m_logger) << "Error initializing dds connections - aborting"; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.h index 59f5e8335..c7e3c8b8e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.h @@ -87,6 +87,7 @@ public: std::shared_ptr ddsConnector() const { return m_ddsConnector; } private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_pacemaker; std::shared_ptr m_topicLockMaster; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/default_av_menus.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/default_av_menus.cpp index bb683c619..d141b7e3d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/default_av_menus.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/default_av_menus.cpp @@ -70,14 +70,13 @@ bool isStreamOfInterest(const AudioVideoManagement::Stream &stream, bool isAudio namespace AudioVideoManagement { -DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc) - : m_context(context) +DefaultAvMenus::DefaultAvMenus(const ExerciseContext &context, Interface::Dts *dts, HandlerVideoTeam *handlerVideoTeams, InfrastructureManagement::Interface::Dtc *ismDtc) : m_context(context) , m_dts(dts) , m_videoTeamHandler(handlerVideoTeams) , m_ismDtc(ismDtc) , m_timer(new QTimer) - , m_isInitialized(false) -{ + , m_isInitialized(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { Q_ASSERT(dts); Q_ASSERT(ismDtc); if(!m_ismDtc->isMainStructureElementEnabled()) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise.h index f1dbfb1aa..c8ae4a231 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise.h @@ -69,6 +69,8 @@ signals: void assetUnassigned(Asset *asset); private: + +NGL::INGLLogger &m_logger; ExerciseContext m_context; std::map> m_assets; std::map> m_mountingPoints; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise_handler.cpp index a9750e731..350c1c2d2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercise_handler.cpp @@ -35,16 +35,15 @@ bool isActive(ExerciseManagement::ExerciseState state) namespace AudioVideoManagement { -ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId) - : QObject() +ExerciseHandler::ExerciseHandler(MainHandler *mainHandler, int exerciseId) : QObject() , m_exContext(exerciseId) , m_curExerciseState(ExerciseManagement::ExerciseState::Unknown) , m_curAVOperatingMode(AVControl::OperatingMode::Unknown) , m_mainHandler(mainHandler) , m_updateTimer(new QTimer(this)) , m_lastSeenTimer(new QTimer(this)) - , m_bWarnedOnce(false) -{ + , m_bWarnedOnce(false), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_updateTimer->setSingleShot(true); connect(m_updateTimer, &QTimer::timeout, this, &ExerciseHandler::onUpdateTimerTimeout); @@ -74,7 +73,7 @@ void ExerciseHandler::checkForRecordPlaybackSession() m_recordSession.type = avTypeRecordSession(); if (!db()->insert(m_recordSession)) { - ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting"; + ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting"; return; } emit avDbReloadNeeded(); @@ -88,7 +87,7 @@ void ExerciseHandler::checkForRecordPlaybackSession() m_replaySession.type = avTypePlaybackSession(); if (!db()->insert(m_replaySession)) { - ERROR_LOG() << m_exContext << " Error adding AvmDeviceConfig - aborting"; + ERROR_LOG(m_logger) << m_exContext << " Error adding AvmDeviceConfig - aborting"; return; } emit avDbReloadNeeded(); @@ -98,7 +97,7 @@ void ExerciseHandler::checkForRecordPlaybackSession() void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newState) { Q_ASSERT(newState != ExerciseManagement::ExerciseState::Unknown); - INFO_LOG() << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState; + INFO_LOG(m_logger) << m_exContext << ": state change: " << m_curExerciseState << " -> " << newState; if (m_curExerciseState == newState) return; @@ -120,12 +119,12 @@ void ExerciseHandler::setNewExerciseState(ExerciseManagement::ExerciseState newS { if (newIsActive) { - DEBUG_LOG() << m_exContext << " activated"; + DEBUG_LOG(m_logger) << m_exContext << " activated"; emit contextActivated(); } else { - DEBUG_LOG() << m_exContext << " deactivated"; + DEBUG_LOG(m_logger) << m_exContext << " deactivated"; emit contextDeactivated(); } } @@ -163,12 +162,12 @@ void ExerciseHandler::onUpdateTimerTimeout() if (m_curAVOperatingMode == desiredOperatingMode) return; - DEBUG_LOG() << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode; + DEBUG_LOG(m_logger) << "Context: " << m_exContext << " Try switching to " << desiredOperatingMode; if (!avControl()->setOperatingModeForContext(m_exContext, desiredOperatingMode)) { if (!m_bWarnedOnce) { - DEBUG_LOG() << "Context: " << m_exContext + DEBUG_LOG(m_logger) << "Context: " << m_exContext << " - could not change operating mode, maybe not yet connected to AVS - trying again in 5 seconds"; m_bWarnedOnce = true; } @@ -205,7 +204,7 @@ void ExerciseHandler::onLastSeenTimerTimeout() m_lastSeen.lastSeen.isNull() || m_lastSeen.lastSeen.addDays(1) < QDateTime::currentDateTimeUtc()) { - INFO_LOG() << "Exercise with id " << m_exContext.id() + INFO_LOG(m_logger) << "Exercise with id " << m_exContext.id() << " not seen since more than 1 day -> removing"; // not seen at all or not since more than 1 day -> remove setNewExerciseState(ExerciseManagement::ExerciseState::Terminated); @@ -224,13 +223,13 @@ void ExerciseHandler::onOperatingModeChanged(const ExerciseContext &context, if (desiredOperatingMode != om) { - DEBUG_LOG() << "Context: " << context << " Got " << om + DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om << " for " << comp << " but expected " << desiredOperatingMode; m_updateTimer->start(100); } else { - DEBUG_LOG() << "Context: " << context << " Got " << om + DEBUG_LOG(m_logger) << "Context: " << context << " Got " << om << " for " << comp << " which is the expected value"; m_updateTimer->stop(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.cpp index 50d86ad4e..39f003aeb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.cpp @@ -52,11 +52,10 @@ private: }; -ExercisesHandler::ExercisesHandler(MainHandler *mainHandler) - : m_mainHandler(mainHandler) +ExercisesHandler::ExercisesHandler(MainHandler *mainHandler) : m_mainHandler(mainHandler) , m_triggerAvUpdateTimer(new QTimer(this)) - , m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc())) -{ + , m_assetAssignmentManager(AssetAssignmentManager::create(mainHandler->ddsHandler()->ismDtc())), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { m_triggerAvUpdateTimer->setSingleShot(true); m_triggerAvUpdateTimer->setInterval(1000); connect(m_triggerAvUpdateTimer, &QTimer::timeout, @@ -98,7 +97,7 @@ bool ExercisesHandler::init() connect(exmDtc(), &ExerciseManagement::Interface::Dtc::exerciseChanged, this, &ExercisesHandler::onExerciseChanged); - DEBUG_LOG() << Q_FUNC_INFO << " done"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " done"; return true; } @@ -165,7 +164,7 @@ ExerciseHandler *ExercisesHandler::getOrCreateExerciseHandler(int exerciseId) ExerciseHandler *ExercisesHandler::createExerciseHandler(int exerciseId) { - DEBUG_LOG() << "Creating handler for exercise " << exerciseId; + DEBUG_LOG(m_logger) << "Creating handler for exercise " << exerciseId; ExerciseParts parts(m_mainHandler, m_assetAssignmentManager->exercise(exerciseId)); ExerciseHandler *exH = parts.exerciseHandler(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.h index 8016e1092..48f775153 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/exercises_handler.h @@ -78,6 +78,7 @@ public slots: void onAvDbReloadNeeded(); private: + NGL::INGLLogger &m_logger; void createExerciseHandlerFromLastSeen(const Database::AvmExerciseLastSeen &lastSeen); ExerciseHandler *getOrCreateExerciseHandler(int exerciseId); ExerciseHandler *createExerciseHandler(int exerciseId); @@ -92,6 +93,7 @@ private slots: void exerciseFinished(int exerciseId); private: + NGL::INGLLogger &m_logger; MainHandler *m_mainHandler; QTimer *m_triggerAvUpdateTimer; std::unique_ptr m_assetAssignmentManager; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_planning_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_planning_handler.cpp index 4bca54202..3ede1b0fa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_planning_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_planning_handler.cpp @@ -156,7 +156,7 @@ bool FrequencyPlanningHandler::init() QVector frequencyPlannings; if (!m_db->select(frequencyPlannings)) { - ERROR_LOG() << "Error while selecting frequency plannings from db"; + ERROR_LOG(m_logger) << "Error while selecting frequency plannings from db"; return false; } @@ -169,11 +169,11 @@ bool FrequencyPlanningHandler::init() m_activePlannings.insert(exerciseId, currentDbData); if (!m_dts->publish(ActiveFrequencyPlanning(exerciseId, currentDbData.frequencyPlanningId))) - ERROR_LOG() << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId; + ERROR_LOG(m_logger) << "Error while publishing ActiveFrequencyPlanning with ID " << exerciseId; }; if (!m_db->select(cbAfp)) { - ERROR_LOG() << "Error while selecting AvmActiveFrequencyPlannings from db"; + ERROR_LOG(m_logger) << "Error while selecting AvmActiveFrequencyPlannings from db"; return false; } @@ -185,7 +185,7 @@ void FrequencyPlanningHandler::onModifyFrequencyPlanningRequest(const rti::core: { auto ret = request.id() > 0 ? handleModify(request) : handleCreate(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyFrequencyPlanningReply(cookie, ret); } @@ -194,7 +194,7 @@ void FrequencyPlanningHandler::onRemoveFrequencyPlanningRequest(const rti::core: { auto ret = handleRemove(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->removeFrequencyPlanningReply(cookie, ret); } @@ -203,7 +203,7 @@ void FrequencyPlanningHandler::onModifyActiveFrequencyPlanningRequest(const rti: { auto ret = modifyActiveFrequencyPlanningRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyActiveFrequencyPlanningReply(cookie, ret); } @@ -212,7 +212,7 @@ void FrequencyPlanningHandler::onRemoveActiveFrequencyPlanningRequest(const rti: { auto ret = removeActiveFrequencyPlanningRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->removeActiveFrequencyPlanningReply(cookie, ret); } @@ -263,7 +263,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::handleCreate(const ModifyFre status = m_db->insert(dbEntry); if (!status) { - WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB"; + WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB"; break; } dbEntries.push_back(dbEntry); @@ -307,7 +307,7 @@ Q_ASSERT(request.id() > 0); status = m_db->insert(dbEntry); if (!status) { - WARNING_LOG() << "Failed to insert new FrequencyPlanningData into DB"; + WARNING_LOG(m_logger) << "Failed to insert new FrequencyPlanningData into DB"; break; } dbEntries.push_back(dbEntry); @@ -444,7 +444,7 @@ std::vector FrequencyPlanningHandler::insert Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlanningRequest(const ModifyActiveFrequencyPlanningRequest &request) { - DEBUG_LOG() << "ModifyActiveFrequencyPlanningRequest: " << request; + DEBUG_LOG(m_logger) << "ModifyActiveFrequencyPlanningRequest: " << request; Core::FunctionReplyObject reply = validateRequest(request); if (reply.error()) @@ -480,7 +480,7 @@ Core::FunctionReplyObject FrequencyPlanningHandler::modifyActiveFrequencyPlannin Core::FunctionReplyObject FrequencyPlanningHandler::removeActiveFrequencyPlanningRequest(const RemoveActiveFrequencyPlanningRequest &request) { - DEBUG_LOG() << "RemoveActiveFrequencyPlanningRequest: " << request; + DEBUG_LOG(m_logger) << "RemoveActiveFrequencyPlanningRequest: " << request; Core::FunctionReplyObject reply(request.exerciseId()); @@ -668,7 +668,7 @@ bool FrequencyPlanningHandler::collectAndPublish(const Database::AvmFrequencyPla bool status = m_db->selectByFrequencyPlanningId(dbEntries, planDb.id); if (!status) { - ERROR_LOG() << "Error selecting AvmFrequencyPlanningData from db"; + ERROR_LOG(m_logger) << "Error selecting AvmFrequencyPlanningData from db"; return false; } @@ -691,7 +691,7 @@ void FrequencyPlanningHandler::addPlan(const FrequencyPlanning &plan) bool status = m_dts->publish(plan); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id()); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (create)").arg(plan.id()); emit planningChanged(); } @@ -706,7 +706,7 @@ void FrequencyPlanningHandler::updatePlan(const FrequencyPlanning &plan) bool status = m_dts->publish(plan); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id()); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' data with id %1 (modify)").arg(plan.id()); emit planningChanged(); } @@ -720,7 +720,7 @@ void FrequencyPlanningHandler::removePlan(int32_t planId) bool status = m_dts->removeFrequencyPlanningByKey(planId); if (!status) - ERROR_LOG() << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId); + ERROR_LOG(m_logger) << QStringLiteral("Failed to publish 'FrequencyPlanning' with id %1 (remove)").arg(planId); emit planningChanged(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_set_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_set_handler.cpp index e54bc63d4..6d4a47d75 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_set_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/frequency_set_handler.cpp @@ -16,26 +16,25 @@ namespace AudioVideoManagement { -FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db) - : m_dts(dts) - , m_db(db) -{ +FrequencySetHandler::FrequencySetHandler(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts) + , m_db(db), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { Q_ASSERT(dts); Q_ASSERT(db); } bool FrequencySetHandler::init() { - DEBUG_LOG() << Q_FUNC_INFO; + DEBUG_LOG(m_logger) << Q_FUNC_INFO; QVector frequencySets; // Don't use select() with callback here as the callback (body of for-loop below) would use the DB, too. if (!m_db->select(frequencySets)) { - ERROR_LOG() << "Error while selecting frequency sets from db"; + ERROR_LOG(m_logger) << "Error while selecting frequency sets from db"; return false; } - DEBUG_LOG() << "Found " << frequencySets.size() << " Frequency Sets"; + DEBUG_LOG(m_logger) << "Found " << frequencySets.size() << " Frequency Sets"; for (const Database::AvmFrequencySet ¤tfrequencySet : std::as_const(frequencySets)) addFrequencySet(toDdsFrequencySet(currentfrequencySet)); @@ -66,7 +65,7 @@ FrequencySet FrequencySetHandler::toDdsFrequencySet(const Database::AvmFrequency }; m_db->selectByFrequencySetId(cb, result.id()); - DEBUG_LOG() << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries"; + DEBUG_LOG(m_logger) << "Frequency Set with ID " << dbData.id << " has " << result.data().size() << " data entries"; return result; } @@ -122,7 +121,7 @@ void FrequencySetHandler::addFrequencySet(const FrequencySet &frequencySet) m_frequencySetDatas.insert(frequencySet.id(), dataIds); if (!m_dts->publish(frequencySet)) - ERROR_LOG() << "Error while publishing Frequency Set with id " << frequencySet.id(); + ERROR_LOG(m_logger) << "Error while publishing Frequency Set with id " << frequencySet.id(); } } // namespace AudioVideoManagement diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_frequency_planning_status.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_frequency_planning_status.cpp index 5bc423fc6..ddda69dd7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_frequency_planning_status.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_frequency_planning_status.cpp @@ -76,7 +76,7 @@ bool HandlerFrequencyPlanningStatus::init() // read all HandlerFrequencyPlanningStatus Data from database if (!m_db->select(dataVec)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } @@ -89,7 +89,7 @@ bool HandlerFrequencyPlanningStatus::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); return false; } m_data.insert(ifs->getData().client(), ifs); @@ -101,10 +101,10 @@ bool HandlerFrequencyPlanningStatus::init() void HandlerFrequencyPlanningStatus::onModifyFrequencyPlanningStatusRequest(const rti::core::SampleIdentity &cookie, const ModifyFrequencyPlanningStatusRequest &request) { - DEBUG_LOG() << "onModifyFrequencyPlanningStatusRequest: " << request; + DEBUG_LOG(m_logger) << "onModifyFrequencyPlanningStatusRequest: " << request; auto ret = m_data.contains(request.client()) ? frequencyPlanningStatusModifyRequest(request) : frequencyPlanningStatusCreateRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyFrequencyPlanningStatusReply(cookie, ret); } @@ -132,7 +132,7 @@ void HandlerFrequencyPlanningStatus::onRemoveFrequencyPlanningStatusByClientRequ int client = ifs->getData().client(); ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else clients << client; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_menu_struct.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_menu_struct.cpp index 2228dbc17..9123e394e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_menu_struct.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_menu_struct.cpp @@ -222,10 +222,10 @@ QList HandlerMenuStruct::loadFromDb(bool &status) void HandlerMenuStruct::onModifyMenuStructRequest(const rti::core::SampleIdentity &cookie, const MenuStruct &request) { - DEBUG_LOG() << "onModifyMenuStructRequest: " << request; + DEBUG_LOG(m_logger) << "onModifyMenuStructRequest: " << request; auto ret = request.id() > 0 ? modifyMenuStructRequest(request) : createMenuStructRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyMenuStructReply(cookie, ret); } @@ -233,7 +233,7 @@ Core::FunctionReplyObject HandlerMenuStruct::createMenuStructRequest(const MenuS { ObjectMenuStruct *ifs = new ObjectMenuStruct(m_dts, m_db); - DEBUG_LOG() << "request.menuEntries.size() : " << request.menuEntries().size(); + DEBUG_LOG(m_logger) << "request.menuEntries.size() : " << request.menuEntries().size(); Core::FunctionReplyObject ret = ifs->createFromDds(request); if (ret.error()) @@ -263,7 +263,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit { Core::FunctionReplyObject ret; - INFO_LOG() << "onRemoveMenuStructRequest id = " << request.id(); + INFO_LOG(m_logger) << "onRemoveMenuStructRequest id = " << request.id(); ObjectMenuStruct *ifs = m_objMap.value(request.id()); if (ifs == nullptr) @@ -287,7 +287,7 @@ void HandlerMenuStruct::onRemoveMenuStructRequest(const rti::core::SampleIdentit void HandlerMenuStruct::onDbDeletedAvmMenuStruct(const QVariant &id_) { int id = id_.toInt(); - DEBUG_LOG() << "DB deleted AvmMenuStruct with id: " << id; + DEBUG_LOG(m_logger) << "DB deleted AvmMenuStruct with id: " << id; reload(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_receiver.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_receiver.cpp index 15584d520..16aa8d8a7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_receiver.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_receiver.cpp @@ -63,7 +63,7 @@ bool HandlerVideoReceiver::init() // read all VideoReceiver Data from database if (!m_db->select(dataVec)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return true; } @@ -76,13 +76,13 @@ bool HandlerVideoReceiver::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); return false; } m_videoReceiverObjMap.insert(ifs->getId(), ifs); } - DEBUG_LOG() << "m_videoReceiverObjMap.size() = " << m_videoReceiverObjMap.size(); + DEBUG_LOG(m_logger) << "m_videoReceiverObjMap.size() = " << m_videoReceiverObjMap.size(); m_httpRequestTimer.setInterval(std::chrono::milliseconds(20000).count()); m_httpRequestTimer.setSingleShot(false); @@ -99,10 +99,10 @@ bool HandlerVideoReceiver::init() void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleIdentity &cookie, const VideoReceiverModifyRequest &request) { - DEBUG_LOG() << "onVideoReceiverModifyRequest: " << request; + DEBUG_LOG(m_logger) << "onVideoReceiverModifyRequest: " << request; auto ret = request.id() > 0 ? videoReceiverModifyRequest(request) : videoReceiverCreateRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->videoReceiverModifyReply(cookie, ret); } @@ -110,10 +110,10 @@ void HandlerVideoReceiver::onVideoReceiverModifyRequest(const rti::core::SampleI void HandlerVideoReceiver::onVideoReceiverModifyActiveRequest(const rti::core::SampleIdentity &cookie, const VideoReceiverModifyActiveRequest &request) { - DEBUG_LOG() << "onVideoReceiverModifyActiveRequest"; + DEBUG_LOG(m_logger) << "onVideoReceiverModifyActiveRequest"; auto ret = videoReceiverModifyActiveRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); else // activate channel here activateChannel(request.id(), request.isActive()); @@ -126,7 +126,7 @@ void HandlerVideoReceiver::onVideoReceiverModifyAvsRequest(const rti::core::Samp { auto ret = videoReceiverModifyAvsRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->videoReceiverModifyAvsReply(cookie, ret); } @@ -176,7 +176,7 @@ VideoReceiver HandlerVideoReceiver::convertActive(const VideoReceiverModifyActiv //-------------------------------------------------------------------------------------------------- Core::FunctionReplyObject HandlerVideoReceiver::videoReceiverModifyRequest(const VideoReceiverModifyRequest &request) { - DEBUG_LOG() << "videoReceiverModifyRequest"; + DEBUG_LOG(m_logger) << "videoReceiverModifyRequest"; ObjectVideoReceiver *ifs = m_videoReceiverObjMap.value(request.id()); if (ifs == nullptr) return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Receiver with id %1 not found")).arg(request.id()); @@ -242,7 +242,7 @@ void HandlerVideoReceiver::onVideoReceiverRemoveRequest(const rti::core::SampleI ret = ifs->removeObject(); if (ret.error()) - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); else { // delete ObjectVideoReceiver @@ -268,13 +268,13 @@ void HandlerVideoReceiver::onGetStatus() ObjectVideoReceiver *objectVideoReceiver = i.value(); QString host = QString::fromStdString(objectVideoReceiver->getData().hostName()).toLower(); - DEBUG_LOG() << " streamName=" << objectVideoReceiver->getData().streamName() + DEBUG_LOG(m_logger) << " streamName=" << objectVideoReceiver->getData().streamName() << " hostName=" << host << " teamId=" << objectVideoReceiver->getData().teamId(); if ((objectVideoReceiver->getData().teamId() == 1) && (!m_receiver.contains(host))) { - DEBUG_LOG() << " onSendHttpRequest host=" << host << " key=" << i.key() + DEBUG_LOG(m_logger) << " onSendHttpRequest host=" << host << " key=" << i.key() << " id=" << objectVideoReceiver->getData().id(); m_receiver.insert(host, i.key()); onSendHttpRequest(i.key()); @@ -284,7 +284,7 @@ void HandlerVideoReceiver::onGetStatus() void HandlerVideoReceiver::onSendHttpRequest(const int key) { - INFO_LOG() << "onSendHttpRequest key=" << key; + INFO_LOG(m_logger) << "onSendHttpRequest key=" << key; //request = QStringLiteral("http://localhost/set_param?remuxBitrate=90.0"); //request = QStringLiteral("http://localhost/status.json"); @@ -297,7 +297,7 @@ void HandlerVideoReceiver::onSendHttpRequest(const int key) void HandlerVideoReceiver::startRequest(const QUrl &requestedUrl) { - INFO_LOG() << "startRequest:" << requestedUrl.toString(); + INFO_LOG(m_logger) << "startRequest:" << requestedUrl.toString(); m_httpRequestAborted = false; @@ -317,22 +317,22 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) const QByteArray replyData = reply->readAll(); - INFO_LOG() << "Answer = " << replyData + INFO_LOG(m_logger) << "Answer = " << replyData << " size = " << replyData.size() << " url=" << urlString << " host=" << host; m_receiver.remove(host); if (reply->error()) { - ERROR_LOG() << "Cannot connect to VideoReceiver"; - ERROR_LOG() << "reply->error: " << reply->errorString(); + ERROR_LOG(m_logger) << "Cannot connect to VideoReceiver"; + ERROR_LOG(m_logger) << "reply->error: " << reply->errorString(); reply->deleteLater(); return; } // Success - INFO_LOG() << "Connected to VideoReceiver "; + INFO_LOG(m_logger) << "Connected to VideoReceiver "; // Keine Antwort vom Receiver if (replyData.size() == 0) @@ -366,10 +366,10 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) const QJsonObject jsonObject = doc.object(); //QJsonDocument doc(jsonObject); //QStringList keyList = jsonObject.keys(); - //DEBUG_LOG() << "keyList.size()" << keyList.size() ; + //DEBUG_LOG(m_logger) << "keyList.size()" << keyList.size() ; //for (int i = 0; i < keyList.size(); ++i) - // DEBUG_LOG() << keyList.at(i).toLocal8Bit().constData() ; - //DEBUG_LOG() << doc.toJson(QJsonDocument::Indented); + // DEBUG_LOG(m_logger) << keyList.at(i).toLocal8Bit().constData() ; + //DEBUG_LOG(m_logger) << doc.toJson(QJsonDocument::Indented); ///////////////////// double snrA = 0; double snrB = 0; @@ -382,7 +382,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) int freqencyB = jsonObject[QStringLiteral("inputFrequency2")].toInt(); // 0 = Off, 1 = Channel1, 2 = Channel2, 3 = Channel1 + Channel2 int remuxInputMask = jsonObject[QStringLiteral("remuxInputMask")].toInt(); - INFO_LOG() << "lockstatusA = " << lockstatusA + INFO_LOG(m_logger) << "lockstatusA = " << lockstatusA << " lockstatusB = " << lockstatusB << " freqencyA=" << freqencyA << " freqencyB=" << freqencyB @@ -463,7 +463,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) double tmpLevel = ((-40 - powerLevelA) / 60) * 100; powerLevelA = 100.0 - tmpLevel; } - DEBUG_LOG() << "Channel 1: snrA=" << snrA + DEBUG_LOG(m_logger) << "Channel 1: snrA=" << snrA << " powerLevelA " << powerLevelA; // send Topic LTS_VideoReceiver @@ -531,7 +531,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) double tmpLevel = ((-40 - powerLevelB) / 60) * 100; powerLevelB = 100.0 - tmpLevel; } - DEBUG_LOG() << "Channel 2: snrB=" << snrB + DEBUG_LOG(m_logger) << "Channel 2: snrB=" << snrB << " powerLevelB " << powerLevelB; // Der Key von Receiver2 folgt immer dem von Receiver 1 updateObject(key + 1, powerLevelB, snrB, lockstatusB, freqencyB); @@ -545,7 +545,7 @@ void HandlerVideoReceiver::onHttpFinished(QNetworkReply *reply) { i.next(); ObjectVideoReceiver *objectVideoReceiver = i.value(); - DEBUG_LOG() << "key=" << i.key() + DEBUG_LOG(m_logger) << "key=" << i.key() << " : value.Id=" << objectVideoReceiver->getId() << " mse=" << objectVideoReceiver->getData().mainStructureElementId() << " streamName=" << objectVideoReceiver->getData().streamName() @@ -589,7 +589,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ int active2 = 0; int active = 0; int id = 0; - DEBUG_LOG() << "activateChannel channelId=" << channelId + DEBUG_LOG(m_logger) << "activateChannel channelId=" << channelId << " activate = " << activate << " hostname = " << hostName << " teamId = " << m_videoReceiverObjMap.value(channelId)->getData().teamId(); @@ -598,7 +598,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ if (!m_videoReceiverObjMap.contains(channelId)) { - ERROR_LOG() << "channelId " << channelId << " does not exist"; + ERROR_LOG(m_logger) << "channelId " << channelId << " does not exist"; return; } @@ -608,7 +608,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ active1 = activate; if (!m_videoReceiverObjMap.contains(id + 1)) { - ERROR_LOG() << "channelId " << id + 1 << " does not exist"; + ERROR_LOG(m_logger) << "channelId " << id + 1 << " does not exist"; return; } active2 = m_videoReceiverObjMap.value(id + 1)->getData().isActive(); @@ -622,7 +622,7 @@ void HandlerVideoReceiver::activateChannel(const int channelId, const bool activ active2 = activate; } active = active1 + active2 * 2; - DEBUG_LOG() << "activateChannel hostname=" << hostName + DEBUG_LOG(m_logger) << "activateChannel hostname=" << hostName << " active1=" << active1 << " active2=" << active2 << " active=" << active; @@ -642,7 +642,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM ObjectVideoReceiver *channel1 = m_videoReceiverObjMap.value(key); if (channel1 == nullptr ) { - ERROR_LOG() << "checkActiveState key=" << key + ERROR_LOG(m_logger) << "checkActiveState key=" << key << " remuxInputMask=" << remuxInputMask << " channel1 == nullptr"; return; } @@ -651,7 +651,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM ObjectVideoReceiver *channel2 = m_videoReceiverObjMap.value(key + 1); int channel2Active = channel2->getData().isActive(); int active = channel1Active + channel2Active * 2; - DEBUG_LOG() << "checkActiveState " + DEBUG_LOG(m_logger) << "checkActiveState " << " key=" << key << " active=" << active << " remuxInputMask=" << remuxInputMask @@ -663,7 +663,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM { bool activate = channel1Active; activateChannel(key, activate); - DEBUG_LOG() << "checkActiveState Send HTTP-Request activateChannel" + DEBUG_LOG(m_logger) << "checkActiveState Send HTTP-Request activateChannel" << " key=" << key << " activate=" << activate; } @@ -672,7 +672,7 @@ void HandlerVideoReceiver::checkActiveState(const int key, const int remuxInputM { bool activate = channel2Active; activateChannel(key + 1, activate); - DEBUG_LOG() << "checkActiveState Send HTTP-Request activateChannel" + DEBUG_LOG(m_logger) << "checkActiveState Send HTTP-Request activateChannel" << " key=" << key + 1 << " activate=" << activate << " channel2Active=" << channel2Active diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_team.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_team.cpp index 87c2a944b..0da276176 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_team.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/handler_video_team.cpp @@ -37,7 +37,7 @@ public: Database::AvmDeviceConfig deviceConfig = toDeviceConfig(videoTeam); if (!m_db->insert(deviceConfig)) - ERROR_LOG() << "Error while inserting device config into database"; + ERROR_LOG(m_logger) << "Error while inserting device config into database"; m_cache.insert(videoTeam.id(), deviceConfig); emit m_handler->avDbReloadNeeded(); @@ -53,7 +53,7 @@ public: deviceConfig.id = oldDeviceConfig.id; if (!m_db->update(deviceConfig)) - ERROR_LOG() << "Error while updating device config"; + ERROR_LOG(m_logger) << "Error while updating device config"; m_cache[videoTeam.id()] = deviceConfig; emit m_handler->avDbReloadNeeded(); @@ -73,7 +73,7 @@ public: Q_ASSERT(found != m_cache.end()); if (!m_db->removeAvmDeviceConfig(found->id)) - ERROR_LOG() << "Error while removing device config"; + ERROR_LOG(m_logger) << "Error while removing device config"; m_cache.erase(found); emit m_handler->avDbReloadNeeded(); @@ -137,7 +137,7 @@ bool HandlerVideoTeam::init() // read all VideoTeam Data from database if (!m_db->select(dataVec)) { - ERROR_LOG() << "Error reading data from database!"; + ERROR_LOG(m_logger) << "Error reading data from database!"; return false; } @@ -150,7 +150,7 @@ bool HandlerVideoTeam::init() if (ret.error()) { delete ifs; - ERROR_LOG() << ret(); + ERROR_LOG(m_logger) << ret(); return false; } m_videoTeamObjMap.insert(ifs->getId(), ifs); @@ -159,7 +159,7 @@ bool HandlerVideoTeam::init() m_deviceConfig->create(ddsData); } - DEBUG_LOG() << "m_VideoTeamObjMap.size() = " << m_videoTeamObjMap.size(); + DEBUG_LOG(m_logger) << "m_VideoTeamObjMap.size() = " << m_videoTeamObjMap.size(); return true; } @@ -176,10 +176,10 @@ QMap HandlerVideoTeam::videoTeams() const void HandlerVideoTeam::onVideoTeamModifyRequest(const rti::core::SampleIdentity &cookie, const VideoTeamModifyRequest &request) { - DEBUG_LOG() << "onVideoTeamModifyRequest: " << request; + DEBUG_LOG(m_logger) << "onVideoTeamModifyRequest: " << request; auto ret = request.id() > 0 ? videoTeamModifyRequest(request) : videoTeamCreateRequest(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->videoTeamModifyReply(cookie, ret); } @@ -232,7 +232,7 @@ Core::FunctionReplyObject HandlerVideoTeam::videoTeamModifyRequest(const VideoTe ObjectVideoTeam *ifs = m_videoTeamObjMap.value(request.id()); if (ifs == nullptr) return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Video Team with id %1 not found")).arg(request.id()); - DEBUG_LOG() << "on Modify Request" << request.streamName() << " ID: " << request.name() << " exId " << request.exerciseId(); + DEBUG_LOG(m_logger) << "on Modify Request" << request.streamName() << " ID: " << request.name() << " exId " << request.exerciseId(); VideoTeam ddsData = convert(request, ifs->getData()); if (needDeviceConfig(ddsData)) diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.cpp index e3a8ed5e9..e24993680 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.cpp @@ -36,9 +36,8 @@ using namespace AudioVideoManagement; -MainHandler::MainHandler(QObject *parent) - : QObject(parent) -{} +MainHandler::MainHandler(QObject *parent) : QObject(parent), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} MainHandler::~MainHandler() = default; @@ -48,7 +47,7 @@ bool MainHandler::init(int domainId) m_dbHandler.reset(new DbHandler()); if (!m_dbHandler->init(0, Settings::settings())) { - ERROR_LOG() << "Initialisation dbHandler failed."; + ERROR_LOG(m_logger) << "Initialisation dbHandler failed."; return false; } m_dbInterface = m_dbHandler->db(); @@ -57,7 +56,7 @@ bool MainHandler::init(int domainId) m_ddsHandler.reset(new DdsHandler(domainId)); if (!m_ddsHandler->init()) { - ERROR_LOG() << "Initialisation ddsHandler failed."; + ERROR_LOG(m_logger) << "Initialisation ddsHandler failed."; return false; } @@ -82,7 +81,7 @@ bool MainHandler::init(int domainId) connect(m_videoTeamHandler.get(), &HandlerVideoTeam::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded); if (!m_videoTeamHandler->init()) { - ERROR_LOG() << "Initialisation HandlerVideoTeam failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerVideoTeam failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -90,7 +89,7 @@ bool MainHandler::init(int domainId) m_frequencyPlanningStatusHandler.reset(new HandlerFrequencyPlanningStatus(m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get())); if (!m_frequencyPlanningStatusHandler->init()) { - ERROR_LOG() << "Initialisation HandlerFrequencyPlanningStatus failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerFrequencyPlanningStatus failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -108,7 +107,7 @@ bool MainHandler::init(int domainId) connect(m_tvcHandler.get(), &TvcHandler::avDbReloadNeeded, m_exHandler.get(), &ExercisesHandler::onAvDbReloadNeeded); if (!m_tvcHandler->init()) { - ERROR_LOG() << "Initialisation tvcHandler failed"; + ERROR_LOG(m_logger) << "Initialisation tvcHandler failed"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -116,7 +115,7 @@ bool MainHandler::init(int domainId) m_frequencySetHandler.reset(new FrequencySetHandler(m_ddsHandler->dts(), m_dbInterface.get())); if (!m_frequencySetHandler->init()) { - ERROR_LOG() << "Initialisation FrequencySetHandler failed"; + ERROR_LOG(m_logger) << "Initialisation FrequencySetHandler failed"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -130,14 +129,14 @@ bool MainHandler::init(int domainId) m_frequencyPlanningHandler->setCnrHandler(m_cnrHandler.get()); if (!m_frequencyPlanningHandler->init()) { - ERROR_LOG() << "Initialisation FrequencyPlanningHandler failed"; + ERROR_LOG(m_logger) << "Initialisation FrequencyPlanningHandler failed"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } if (!m_cnrHandler->init()) { - ERROR_LOG() << "Initialisation cnrHandler failed"; + ERROR_LOG(m_logger) << "Initialisation cnrHandler failed"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -145,7 +144,7 @@ bool MainHandler::init(int domainId) m_cnrTvcProfileHandler.reset(new CnrTvcProfileHandler(m_dbInterface.get(), m_ddsHandler->dts(), m_ddsHandler->fts(), m_cnrHandler.get(), m_tvcHandler.get())); if (!m_cnrTvcProfileHandler->init()) { - ERROR_LOG() << "Initialisation RadioCircuitsHandler failed"; + ERROR_LOG(m_logger) << "Initialisation RadioCircuitsHandler failed"; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -156,7 +155,7 @@ bool MainHandler::init(int domainId) m_videoReceiverHandler.reset(new HandlerVideoReceiver(this, m_ddsHandler->dts(), m_ddsHandler->fts(), m_dbInterface.get())); if (!m_videoReceiverHandler->init()) { - ERROR_LOG() << "Initialisation HandlerVideoReceiver failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerVideoReceiver failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } @@ -165,7 +164,7 @@ bool MainHandler::init(int domainId) if (!m_ddsHandler->enableDtcClients()) { - ERROR_LOG() << "Initialisation DTCs failed."; + ERROR_LOG(m_logger) << "Initialisation DTCs failed."; m_ddsHandler->pacemaker()->setNewState(Core::RunningState::StartingError); return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.h index 81b968638..ff32557b1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/main_handler.h @@ -61,6 +61,7 @@ public: CnrHandler *cnrHandler() { return m_cnrHandler.get(); } private: + NGL::INGLLogger &m_logger; std::unique_ptr m_ddsHandler; std::unique_ptr m_dbHandler; std::shared_ptr m_dbInterface; //!< just to make sure we own a reference to it; we can then simply forward a plain pointer to our clients diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_frequency_planning_status.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_frequency_planning_status.cpp index 71c60a2f9..c070760a2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_frequency_planning_status.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_frequency_planning_status.cpp @@ -13,10 +13,9 @@ namespace AudioVideoManagement { //------------------------------------------------------------------------------------------------------------- ObjectFrequencyPlanningStatus::ObjectFrequencyPlanningStatus(Interface::Dts *dts, - DatabaseInterface *db) - : m_dts(dts) - , m_db(db) -{ + DatabaseInterface *db) : m_dts(dts) + , m_db(db), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------------------------------------- @@ -62,7 +61,7 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::createObjectFromDDS(con return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database")); m_data.id() = dbData.id; - DEBUG_LOG() << "Data changed for VideoTeam Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << m_data.id(); // Publish Data via DTS onPublishData(); @@ -82,7 +81,7 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::updateObject(const Freq if (!m_db->update(dbData)) return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating FrequencyPlanningStatus into database")); - DEBUG_LOG() << "Data changed for FrequencyPlanningStatus Id: " << data.id(); + DEBUG_LOG(m_logger) << "Data changed for FrequencyPlanningStatus Id: " << data.id(); // Publish Data via DTS onPublishData(); @@ -104,10 +103,10 @@ Core::FunctionReplyObject ObjectFrequencyPlanningStatus::removeObject() //------------------------------------------------------------------------------------------------------------- void ObjectFrequencyPlanningStatus::onPublishData() { - INFO_LOG() << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id() << ") ..." << m_data.client() << ") ..."; + INFO_LOG(m_logger) << "Publish ObjectFrequencyPlanningStatus to dds (" << m_data.id() << ") ..." << m_data.client() << ") ..."; if (!m_dts->publish(m_data)) - ERROR_LOG() << "Error publishing ObjectFrequencyPlanningStatus to dds"; + ERROR_LOG(m_logger) << "Error publishing ObjectFrequencyPlanningStatus to dds"; } //------------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.cpp index 65da8b1d8..918058d9e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.cpp @@ -75,10 +75,9 @@ void checkHierarchy(const std::vector &entrie namespace AudioVideoManagement { -ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db) - : m_dts(dts) - , m_db(db) -{ +ObjectMenuStruct::ObjectMenuStruct(Interface::Dts *dts, DatabaseInterface *db) : m_dts(dts) + , m_db(db), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { Q_ASSERT(dts); Q_ASSERT(db); } @@ -127,10 +126,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove() { DBTransaction trans(m_db->database()); - INFO_LOG() << "menuEntries.size(): " << m_data.menuEntries().size(); + INFO_LOG(m_logger) << "menuEntries.size(): " << m_data.menuEntries().size(); for (const AudioVideoManagement::AvMenuEntry &me : m_data.menuEntries()) { - INFO_LOG() << "Remove entries with id/parentId: " << me.id(); + INFO_LOG(m_logger) << "Remove entries with id/parentId: " << me.id(); // no recursion needed, only 2 levels allowed if (me.isGroup()) if (!m_db->removeAvmMenuStructByParentId(me.id())) @@ -151,10 +150,10 @@ Core::FunctionReplyObject ObjectMenuStruct::remove() void ObjectMenuStruct::onPublishData() { - INFO_LOG() << "Publish MenuStruct-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish MenuStruct-data to dds (" << m_data.id() << ") ..."; if (!m_dts->publish(m_data)) - ERROR_LOG() << "Error publishing MenuStruct-data to dds"; + ERROR_LOG(m_logger) << "Error publishing MenuStruct-data to dds"; } @@ -198,7 +197,7 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat if (ret.error()) return ret; - DEBUG_LOG() << "old entries: " << m_data; + DEBUG_LOG(m_logger) << "old entries: " << m_data; for (const AvMenuEntry &me : oldEntries) { // new entries - ignore @@ -208,14 +207,14 @@ Core::FunctionReplyObject ObjectMenuStruct::insertUpdateDb(const MenuStruct &dat auto found = std::find_if(newEntries.begin(), newEntries.end(), [&me] (const AvMenuEntry &newEntry) { return me.id() == newEntry.id(); }); if (found == newEntries.end()) { - DEBUG_LOG() << "Menu Entry with id not found - was removed: " << me.id(); + DEBUG_LOG(m_logger) << "Menu Entry with id not found - was removed: " << me.id(); m_db->removeAvmMenuStruct(me.id()); } } m_data.menuEntries(newEntries); HandlerMenuStruct::sortEntries(m_data); - DEBUG_LOG() << "new entries: " << m_data; + DEBUG_LOG(m_logger) << "new entries: " << m_data; trans.commit(); return Core::FunctionReplyObject(m_data.id()); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.h b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.h index 3c0b97d3a..ff6cc33bb 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_menu_struct.h @@ -50,6 +50,7 @@ public: long getId() const { return m_data.id(); } private: + NGL::INGLLogger &m_logger; void onPublishData(); Core::FunctionReplyObject insertUpdateDb(const MenuStruct &data); @@ -59,6 +60,7 @@ private: std::vector &contToAdd); private: + NGL::INGLLogger &m_logger; Interface::Dts *m_dts; DatabaseInterface *m_db; MenuStruct m_data; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_receiver.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_receiver.cpp index c286bf306..3903115d1 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_receiver.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_receiver.cpp @@ -14,10 +14,9 @@ namespace AudioVideoManagement { //------------------------------------------------------------------------------------------------------------- ObjectVideoReceiver::ObjectVideoReceiver(Interface::Dts *dts, - DatabaseInterface *db) - : m_dts(dts) - , m_db(db) -{ + DatabaseInterface *db) : m_dts(dts) + , m_db(db), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------------------------------------- @@ -38,7 +37,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver return Core::FunctionReplyObject(0, tr_lts("dds", "Error inserting AvmVideoReceiver-data into database")); m_data.id(dbData.id); - DEBUG_LOG() << "New Id: " << m_data.id(); + DEBUG_LOG(m_logger) << "New Id: " << m_data.id(); } // Publish Data via DTS @@ -51,7 +50,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::createObject(const VideoReceiver Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver &data) { m_data = data; - DEBUG_LOG() << "ObjectVideoReceiver::updateObject id=" << data.id() + DEBUG_LOG(m_logger) << "ObjectVideoReceiver::updateObject id=" << data.id() << " isActive=" << data.isActive() << " hostName=" << data.hostName() << " isLocked=" << data.isLocked(); @@ -62,7 +61,7 @@ Core::FunctionReplyObject ObjectVideoReceiver::updateObject(const VideoReceiver return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoReceiver2 into database")); - DEBUG_LOG() << "Data changed for VideoReceiver Id: " << data.id(); + DEBUG_LOG(m_logger) << "Data changed for VideoReceiver Id: " << data.id(); // Publish Data via DTS onPublishData(); @@ -85,10 +84,10 @@ Core::FunctionReplyObject ObjectVideoReceiver::removeObject() //------------------------------------------------------------------------------------------------------------- void ObjectVideoReceiver::onPublishData() { - INFO_LOG() << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish MvsVideoReceiver-data to dds (" << m_data.id() << ") ..."; if (!m_dts->publish(m_data)) - ERROR_LOG() << "Error publishing MvsVideoReceiver-data to dds"; + ERROR_LOG(m_logger) << "Error publishing MvsVideoReceiver-data to dds"; } //------------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_team.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_team.cpp index 1d197deee..78d9b24ae 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_team.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/object_video_team.cpp @@ -13,10 +13,9 @@ namespace AudioVideoManagement { //------------------------------------------------------------------------------------------------------------- ObjectVideoTeam::ObjectVideoTeam(Interface::Dts *dts, - DatabaseInterface *db) - : m_dts(dts) - , m_db(db) -{ + DatabaseInterface *db) : m_dts(dts) + , m_db(db), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) { } //------------------------------------------------------------------------------------------------------------- @@ -49,7 +48,7 @@ Core::FunctionReplyObject ObjectVideoTeam::updateObject(const VideoTeam &data) if (!m_db->update(dbData)) return Core::FunctionReplyObject(data.id(), tr_lts("dds", "Error updating VideoTeam into database")); - DEBUG_LOG() << "Data changed for VideoTeam Id: " << data.id(); + DEBUG_LOG(m_logger) << "Data changed for VideoTeam Id: " << data.id(); // Publish Data via DTS onPublishData(); @@ -59,10 +58,10 @@ Core::FunctionReplyObject ObjectVideoTeam::updateObject(const VideoTeam &data) //------------------------------------------------------------------------------------------------------------- void ObjectVideoTeam::onPublishData() { - INFO_LOG() << "Publish AvmVideoTeam-data to dds (" << m_data.id() << ") ..."; + INFO_LOG(m_logger) << "Publish AvmVideoTeam-data to dds (" << m_data.id() << ") ..."; if (!m_dts->publish(m_data)) - ERROR_LOG() << "Error publishing AvmVideoTeam-data to dds"; + ERROR_LOG(m_logger) << "Error publishing AvmVideoTeam-data to dds"; } //------------------------------------------------------------------------------------------------------------- diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/tvc_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/tvc_handler.cpp index 64a81ba6f..1ba694a01 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/tvc_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/tvc_handler.cpp @@ -98,7 +98,7 @@ public: Database::AvmDeviceConfig deviceConfig = toDeviceConfig(config); if (!m_db->insert(deviceConfig)) - ERROR_LOG() << "Error while inserting device config into database"; + ERROR_LOG(m_logger) << "Error while inserting device config into database"; m_cache.insert(config.id(), deviceConfig); emit m_handler->avDbReloadNeeded(); @@ -114,7 +114,7 @@ public: deviceConfig.id = oldDeviceConfig.id; if (!m_db->update(deviceConfig)) - ERROR_LOG() << "Error while updating device config"; + ERROR_LOG(m_logger) << "Error while updating device config"; m_cache[config.id()] = deviceConfig; emit m_handler->avDbReloadNeeded(); @@ -140,7 +140,7 @@ public: Q_ASSERT(found != m_cache.end()); if (!m_db->removeAvmDeviceConfig(found->id)) - ERROR_LOG() << "Error while removing device config"; + ERROR_LOG(m_logger) << "Error while removing device config"; m_cache.erase(found); emit m_handler->avDbReloadNeeded(); @@ -196,7 +196,7 @@ bool TvcHandler::init() if (!m_db->select(m_channels)) { - ERROR_LOG() << "Error while selecting tetra channels from db"; + ERROR_LOG(m_logger) << "Error while selecting tetra channels from db"; return false; } @@ -207,7 +207,7 @@ bool TvcHandler::init() if (!m_db->select(tvcConfigs)) { - ERROR_LOG() << "Error while selecting TVC configs from db"; + ERROR_LOG(m_logger) << "Error while selecting TVC configs from db"; return false; } @@ -232,23 +232,23 @@ const TvcConfig &TvcHandler::config(int32_t id) const void TvcHandler::onModifyTvcConfigRequest(const rti::core::SampleIdentity &cookie, const ModifyTvcConfigRequest &request) { - DEBUG_LOG() << "onModifyTvcConfigRequest: " << request; + DEBUG_LOG(m_logger) << "onModifyTvcConfigRequest: " << request; Q_ASSERT(request.id() >= 0); auto ret = request.id() > 0 ? modifyTvcConfig(request) : createTvcConfig(request); if (ret.error()) - WARNING_LOG() << ret(); + WARNING_LOG(m_logger) << ret(); m_fts->modifyTvcConfigReply(cookie, ret); } void TvcHandler::onRemoveTvcConfigRequest(const rti::core::SampleIdentity &cookie, const Core::RemoveElementRequest &request) { - DEBUG_LOG() << "onRemoveTvcConfigRequest" << request; + DEBUG_LOG(m_logger) << "onRemoveTvcConfigRequest" << request; Core::FunctionReplyObject rep = removeTvcConfig(request); if (rep.error()) - WARNING_LOG() << rep.translated(); + WARNING_LOG(m_logger) << rep.translated(); m_fts->removeTvcConfigReply(cookie, rep); } @@ -481,7 +481,7 @@ void TvcHandler::onDbDeleteAvmTvcConfig(const QVariant &id) if (!m_cache.contains(configId)) return; // the notification was a result of our own removal of the entry - DEBUG_LOG() << "DB deleted AvmTvcConfig with id: " << configId; + DEBUG_LOG(m_logger) << "DB deleted AvmTvcConfig with id: " << configId; removeTvcConfig(Core::RemoveElementRequest(configId)); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_comm.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_comm.cpp index 028092359..915161e73 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_comm.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_comm.cpp @@ -64,7 +64,7 @@ void VdComm::vdSetScript(const QString &scriptName, AvaStreamType typ, int fileS static const QString cmd = QStringLiteral(R"(VDSetScript "%1" %2 %3 "%4" "%5" "%6")"); TRACE_LOG(m_loggerIO) << "New Export Script: '" << cmd << "'"; - TRACE_LOG() << "New Export Script: '" << cmd << "'"; + TRACE_LOG(m_logger) << "New Export Script: '" << cmd << "'"; m_avSocket.send(cmd.arg(scriptName).arg(static_cast(typ)).arg(QString::number(fileSplitting), streamList.join(QLatin1Char('\n')), exportedDirBaseName, absolutePath).toUtf8()); @@ -137,7 +137,7 @@ void VdComm::parseResponse(const QByteArray &line) break; default: - DEBUG_LOG() << "Response not implemented: " << line; + DEBUG_LOG(m_logger) << "Response not implemented: " << line; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_control.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_control.cpp index 794cac254..b4dafc043 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_control.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_control.cpp @@ -58,13 +58,13 @@ void VdControl::keepAlive() void VdControl::onConnected() { m_connected = true; - DEBUG_LOG() << "connected"; + DEBUG_LOG(m_logger) << "connected"; } void VdControl::onDisconnected() { m_connected = false; - DEBUG_LOG() << "disconnected"; + DEBUG_LOG(m_logger) << "disconnected"; m_queue.flush(); } @@ -73,12 +73,12 @@ void VdControl::onTimeout() ICommand *cmd = m_queue.currentCommand(); if (cmd->canTimeout()) { - INFO_LOG() << "command '" << cmd->debug() << "' failed"; + INFO_LOG(m_logger) << "command '" << cmd->debug() << "' failed"; m_queue.done(); return; } - ERROR_LOG() << "command timed out"; + ERROR_LOG(m_logger) << "command timed out"; failed(cmd); } @@ -97,7 +97,7 @@ void VdControl::queue(ICommand *cmd, LtsUtils::IConnection *connection) if (!m_connected) { - DEBUG_LOG() << "not connected -> dropping command"; + DEBUG_LOG(m_logger) << "not connected -> dropping command"; return; } @@ -127,7 +127,7 @@ void VdControl::done(AvaCommands::VdSetScript *cmd) void VdControl::failed(ICommand *cmd) { - ERROR_LOG() << "command '" << cmd->debug() << "' failed"; + ERROR_LOG(m_logger) << "command '" << cmd->debug() << "' failed"; Q_ASSERT(cmd == m_queue.currentCommand()); m_queue.flush(); m_comm->forceDisconnect(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_session.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_session.cpp index 9d2b612b5..d0fab325b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_session.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/vd_session.cpp @@ -36,7 +36,7 @@ void VdSession::onConnected() m_established = true; if (m_keepAliveEnabled) m_keepAliveTimer.start(); - DEBUG_LOG() << "session established"; + DEBUG_LOG(m_logger) << "session established"; emit sessionEstablished(); } @@ -44,7 +44,7 @@ void VdSession::onDisconnected() { m_keepAliveTimer.stop(); m_established = false; - DEBUG_LOG() << "disconnected"; + DEBUG_LOG(m_logger) << "disconnected"; emit disconnected(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.cpp index 15a23ee54..747ba4c06 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.cpp @@ -76,7 +76,7 @@ CesTests::CesTests(QObject *parent) bool CesTests::init(int domainId, int exerciseId, int testId, int roomId) { bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_roomId = roomId; @@ -96,7 +96,7 @@ bool CesTests::init(int domainId, int exerciseId, int testId, int roomId) bRet &= m_aesDts->enableBorderline(); bRet &= m_aesDts->enableDusMineState(); bRet &= m_aesDts->enableMineArea(); - DEBUG_LOG() << "AES Dts create interface bRet:" << bRet ; + DEBUG_LOG(m_logger) << "AES Dts create interface bRet:" << bRet ; m_ismDts = InfrastructureManagement::Interface::Dts::create(m_ddsConnector42); bRet &= m_ismDts->enableMainStructureElement(); @@ -141,7 +141,7 @@ bool CesTests::init(int domainId, int exerciseId, int testId, int roomId) void CesTests::startTest() { - INFO_LOG() << "startTest m_testId:" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId:" << m_testId; if (m_testId <= 1) // AES-Hit On Buildings area explosions { m_countHitOnBuildingReply = 0; @@ -464,7 +464,7 @@ void CesTests::tryCreateTriggeredExplosion() ti.bitfield().resize(1); ti.bitfield()[0] = 0; // 0 = Mine active - DEBUG_LOG() << "Publishing TriggeredExplosions: " << ti; + DEBUG_LOG(m_logger) << "Publishing TriggeredExplosions: " << ti; if (!m_aesDts->publish(ti)) failExit("Error publishing TriggeredExplosions"); } @@ -476,7 +476,7 @@ void CesTests::tryCreateExplosionArea() ea.participantId(m_originatorParticipantId); // In ddsview ea.effectStateId(AreaEffectSimulation::AesEffectState::inner_enum::EsPrepared); - DEBUG_LOG() << "Publishing ExplosionArea: " << ea; + DEBUG_LOG(m_logger) << "Publishing ExplosionArea: " << ea; if (!m_aesDts->publish(ea)) failExit("Error publishing ExplosionArea"); } @@ -505,7 +505,7 @@ void CesTests::tryCreateExplosionSinglePrepared() m_es.sampleTime(QDateTime::currentMSecsSinceEpoch()); m_es.chargeStruct().chargeTypeId(m_chargeTypeId); - DEBUG_LOG() << "Publishing ExplosionSingle: " << m_es; + DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es; if (!m_aesDts->publish(m_es)) failExit("Error publishing ExplosionSingle"); } @@ -521,14 +521,14 @@ void CesTests::tryCreateExplosionSingle() m_es.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); m_es.sampleTime(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "Publishing ExplosionSingle: " << m_es; + DEBUG_LOG(m_logger) << "Publishing ExplosionSingle: " << m_es; if (!m_aesDts->publish(m_es)) failExit("Error publishing ExplosionSingle"); } void CesTests::tryCreateAesItemView() { - INFO_LOG() << "trying to send AesItemView AtExplosionArea"; + INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionArea"; m_aiv = AreaEffectSimulation::AesItemView(); m_aiv.aesItemId(m_aesItemId); @@ -547,7 +547,7 @@ void CesTests::tryCreateAesItemView() setPos(m_aiv.form(), m_housePos.geographic(30, 30)); setPos(m_aiv.form(), m_housePos.geographic(30, -10)); - DEBUG_LOG() << "Publishing AesItemView: " << m_aiv; + DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv; if (!m_aesDts->publish(m_aiv)) failExit("Error publishing AesItemView"); } @@ -557,13 +557,13 @@ void CesTests::tryCreateChargeType() ProjectDataManagement::ChargeType ct; ct.id(m_chargeTypeId); ct.properties("{\"impactRadius\":5}"); - DEBUG_LOG() << "Publishing ChargeType: " << ct; + DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct; if (!m_pdmDts->publish(ct)) failExit("Error publishing ChargeType"); ct.id(40); // old charge type 10040 -> 40, hard-codded?! ct.properties("{\"impactRadius\":6}"); - DEBUG_LOG() << "Publishing ChargeType: " << ct; + DEBUG_LOG(m_logger) << "Publishing ChargeType: " << ct; if (!m_pdmDts->publish(ct)) failExit("Error publishing ChargeType"); } @@ -591,7 +591,7 @@ void CesTests::tryCreateAesItemViewSingleExplosions() setPos(m_aiv.form(), m_housePos.geographic(-10, 20)); setPos(m_aiv.form(), m_housePos.geographic(-10, 30)); - DEBUG_LOG() << "Publishing AesItemView: " << m_aiv; + DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv; if (!m_aesDts->publish(m_aiv)) failExit("Error publishing AesItemView"); } @@ -615,7 +615,7 @@ void CesTests::tryCreateAesItemViewBC(AreaEffectSimulation::AesEffectState desir setPos(m_aiv.form(), m_housePos.geographic(35, 35)); setPos(m_aiv.form(), m_housePos.geographic(35, 3)); - DEBUG_LOG() << "Publishing AesItemView: " << m_aiv; + DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv; if (!m_aesDts->publish(m_aiv)) failExit("Error publishing AesItemView"); } @@ -640,14 +640,14 @@ void CesTests::tryCreateAesItemViewSM() setPos(m_aiv.form(), m_housePos.geographic(35, 35)); setPos(m_aiv.form(), m_housePos.geographic(35, 3)); - DEBUG_LOG() << "Publishing AesItemView: " << m_aiv; + DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv; if (!m_aesDts->publish(m_aiv)) failExit("Error publishing AesItemView"); } void CesTests::tryCreateAesItemViewMA() { - INFO_LOG() << "trying to send AesItemView AtMineArea"; + INFO_LOG(m_logger) << "trying to send AesItemView AtMineArea"; m_aiv = AreaEffectSimulation::AesItemView(); m_aiv.aesItemId(m_aesItemId); @@ -667,7 +667,7 @@ void CesTests::tryCreateAesItemViewMA() setPos(m_aiv.form(), m_housePos.geographic(37, 37)); setPos(m_aiv.form(), m_housePos.geographic(37, 1)); - DEBUG_LOG() << "Publishing AesItemView: " << m_aiv; + DEBUG_LOG(m_logger) << "Publishing AesItemView: " << m_aiv; if (!m_aesDts->publish(m_aiv)) failExit("Error publishing AesItemView"); } @@ -689,7 +689,7 @@ void CesTests::tryCreateBorderline() setPos(bl.segments(), m_housePos.geographic(5, 3)); bl.isDeleted(false); - DEBUG_LOG() << "Publishing BorderLine: " << bl; + DEBUG_LOG(m_logger) << "Publishing BorderLine: " << bl; if (!m_aesDts->publish(bl)) failExit("Error publishing Borderline"); } @@ -708,7 +708,7 @@ void CesTests::tryCreateMainStructureElement() m_mse.angle(318.83); m_mse.modelId(1337); m_mse.externalWlsId(0); - DEBUG_LOG() << "Publishing MainStructureElement: " << m_mse; + DEBUG_LOG(m_logger) << "Publishing MainStructureElement: " << m_mse; if (!m_ismDts->publish(m_mse)) failExit("Error publishing MainStructureElement"); } @@ -739,7 +739,7 @@ void CesTests::tryCreateMainFootprint() elem.relPosition(Core::RelativePosition(0.0, 10.0, 0.0)); mf.elements().push_back(elem); - DEBUG_LOG() << "Publishing MainFootprint: " << mf; + DEBUG_LOG(m_logger) << "Publishing MainFootprint: " << mf; if (!m_ismDts->publish(mf)) failExit("Error publishing MainFootprint"); } @@ -758,7 +758,7 @@ void CesTests::tryCreateDynamicParticipantData() dp.sampleTime(si.stateTime()); - DEBUG_LOG() << "Publishing DynamicParticipantData: " << dp; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData: " << dp; if (!m_ppmDts->publish(dp)) failExit("Error publishing DynamicParticipantData"); } @@ -782,7 +782,7 @@ void CesTests::tryCreateParticipantPosition() pp.pos(pos); m_expectedPosition[pp.participantId()] = Core::GeoPosition2D(posF.x(), posF.y()); - DEBUG_LOG() << "Publishing ParticipantPosition: " << pp; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition: " << pp; if (!m_ppmDts->publish(pp)) failExit("Error publishing ParticipantPosition"); } @@ -812,7 +812,7 @@ void CesTests::tryCreateBuildingState() rs.remainingEffectPercent(60); bs.roomStates().push_back(rs); - DEBUG_LOG() << "Publishing BuildingState: " << bs; + DEBUG_LOG(m_logger) << "Publishing BuildingState: " << bs; if (!m_bldDts->publish(bs)) failExit("Error publishing BuildingState"); } @@ -833,7 +833,7 @@ void CesTests::onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &co // debug und co m_countHitOnBuildingReply++; - DEBUG_LOG() << "onSendCesHitOnBuildingRequest cnt = " << m_countHitOnBuildingReply << "\n" + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingRequest cnt = " << m_countHitOnBuildingReply << "\n" << " request: " << request << ", " << dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n"; @@ -889,7 +889,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, /* comes out with timeout on STTW if (request.effectTime() + 1000 < QDateTime::currentMSecsSinceEpoch()) { - DEBUG_LOG() << "onSendCesHitRequest from previous test - ignoring" + DEBUG_LOG(m_logger) << "onSendCesHitRequest from previous test - ignoring" << request.effectTime() << QDateTime::currentMSecsSinceEpoch(); return; @@ -897,7 +897,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, */ // debug und co const QDateTime dateTime(QDateTime::fromMSecsSinceEpoch(request.effectTime())); - DEBUG_LOG() << "onSendCesHitRequest" << "\n" + DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n" << " request: " << request << ", " << dateTime.toString(QStringLiteral("dd.MM.yy - hh:mm:ss.zzz")) << "\n"; if (request.remainEffectPercent()) @@ -924,7 +924,7 @@ void CesTests::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, // 3 x Enter if (request.remainEffectPercent() == 1) m_replyEnterFunctionalArea ++; - DEBUG_LOG()<< "m_replyEnterFunctionalArea=" << m_replyEnterFunctionalArea; + DEBUG_LOG(m_logger)<< "m_replyEnterFunctionalArea=" << m_replyEnterFunctionalArea; if (m_replyEnterFunctionalArea == 3) ExitSuccess(); break; @@ -968,7 +968,7 @@ void CesTests::checkParticipantEvent() return; } - DEBUG_LOG() << "Waiting for a participant event: " << expectedType; + DEBUG_LOG(m_logger) << "Waiting for a participant event: " << expectedType; bool bRet = false; for (int i = 0; i < 50; ++i) @@ -1012,7 +1012,7 @@ void CesTests::tryCreateParticipant() pt.isSimulated(false); pt.equipmentNumber(4711); - DEBUG_LOG() << "Publishing Participant:" << pt; + DEBUG_LOG(m_logger) << "Publishing Participant:" << pt; if (!m_ppmDts->publish(pt)) failExit("Error requesting create Participant"); } @@ -1020,7 +1020,7 @@ void CesTests::tryCreateParticipant() void CesTests::failExit(const char *reason) { - ERROR_LOG() << "FailExit: " << reason << " for test case = " << m_testId; + ERROR_LOG(m_logger) << "FailExit: " << reason << " for test case = " << m_testId; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } @@ -1029,7 +1029,7 @@ void CesTests::ExitSuccess() { if (!m_bTestsSuccessful) return; - INFO_LOG() << "ExitSuccess for test case = " << m_testId; + INFO_LOG(m_logger) << "ExitSuccess for test case = " << m_testId; m_bTestsSuccessful = true; QTimer::singleShot(50, qApp, QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.h index c02f54425..6cf10d6b2 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests.h @@ -77,6 +77,7 @@ protected Q_SLOTS: void testTimeout() { failExit("Test timeout"); } void ExitSuccess(); private: + NGL::INGLLogger &m_logger; void onSendCesHitOnBuildingRequest(const rti::core::SampleIdentity &cookie, const Buildings::SendCesHitOnBuildingRequest &request) override; void onSendCesHitRequest(const rti::core::SampleIdentity &cookie, @@ -94,6 +95,7 @@ private: // structs }; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_ddsConnector42; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.cpp index 11f4b9bbb..4e7f04170 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.cpp @@ -33,14 +33,13 @@ namespace CentralEffectSimulation { -CesTestsBlockedAreas::CesTestsBlockedAreas(QObject *parent) - : QObject(parent) +CesTestsBlockedAreas::CesTestsBlockedAreas(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) , m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) , m_testId(0) , m_participantIndex(0) - , m_DynamicParticipantIndex(0) -{} + , m_DynamicParticipantIndex(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsBlockedAreas::~CesTestsBlockedAreas() {} @@ -48,7 +47,7 @@ CesTestsBlockedAreas::~CesTestsBlockedAreas() bool CesTestsBlockedAreas::init(int domainId, int exerciseId, int testId) { bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_buildingId = 7; // ism_main_structure_element:id @@ -83,7 +82,7 @@ bool CesTestsBlockedAreas::init(int domainId, int exerciseId, int testId) void CesTestsBlockedAreas::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 Participant in BT56 { QTimer::singleShot(0, this, &CesTestsBlockedAreas::tryCreateParticipantPositionOutside); @@ -136,7 +135,7 @@ void CesTestsBlockedAreas::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(6000, this, &CesTestsBlockedAreas::failExit); @@ -158,10 +157,10 @@ void CesTestsBlockedAreas::tryCreateDynamicParticipantData() dp.sampleTime(esTime); m_DynamicParticipantIndex++; - DEBUG_LOG() << "Publishing DynamicParticipantData"; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData"; if (!m_ppmDts->publish(dp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -182,10 +181,10 @@ void CesTestsBlockedAreas::tryCreateParticipantPositionOutside() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -206,10 +205,10 @@ void CesTestsBlockedAreas::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -223,10 +222,10 @@ void CesTestsBlockedAreas::tryCreateParticipant() pt.id(m_participants[m_participantIndex].participantId); pt.equipmentNumber(m_participants[m_participantIndex].equipmentNumber); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } } @@ -248,10 +247,10 @@ void CesTestsBlockedAreas::tryCreateBuildingStateInit() bs.vulnerabilityState(ProjectDataManagement::VulnerabilityState::CombatReady); bs.sampleTime(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "Publishing BuildingState"; + DEBUG_LOG(m_logger) << "Publishing BuildingState"; if (!m_bldDts->publish(bs)) { - ERROR_LOG() << "Error requesting create BuildingState"; + ERROR_LOG(m_logger) << "Error requesting create BuildingState"; failExit(); } } @@ -278,30 +277,30 @@ void CesTestsBlockedAreas::tryCreateBuildingState() bs.roomStates()[0] = rs; bs.sampleTime(QDateTime::currentMSecsSinceEpoch()); - DEBUG_LOG() << "Publishing BuildingState"; + DEBUG_LOG(m_logger) << "Publishing BuildingState"; if (!m_bldDts->publish(bs)) { - ERROR_LOG() << "Error requesting create BuildingState"; + ERROR_LOG(m_logger) << "Error requesting create BuildingState"; failExit(); } } void CesTestsBlockedAreas::checkBuildingOwnership() { - INFO_LOG() << "checkBuildingOwnership"; + INFO_LOG(m_logger) << "checkBuildingOwnership"; ExitSuccess(); } void CesTestsBlockedAreas::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void CesTestsBlockedAreas::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(50, qApp, QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.h index 81391cbc0..653556a83 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_blocked_areas.h @@ -65,6 +65,7 @@ private: // structs }; private: + NGL::INGLLogger &m_logger; std::shared_ptr m_ddsConnector; std::shared_ptr m_ddsConnector42; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.cpp index ad865d3ad..98e0b0dbe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.cpp @@ -29,8 +29,7 @@ namespace CentralEffectSimulation { -CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent) - : QObject(parent) +CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) //, m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) , m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD9387781202"))) @@ -41,8 +40,8 @@ CesTestsBoobyTrap::CesTestsBoobyTrap(QObject *parent) , m_DynamicParticipantIndex(0) , m_aesItemId(5) , m_chargeTypeId(252) // Verdeckte Ladung - , m_countEventBoobyTrap(0) -{} + , m_countEventBoobyTrap(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsBoobyTrap::~CesTestsBoobyTrap() {} @@ -52,7 +51,7 @@ bool CesTestsBoobyTrap::init(int domainId, int exerciseId, int testId) bool bRet = true; int equipmentTypeIdVehicle = 27; int equipmentTypeIdSoldier = 55; // dds-Topic Participant-Management::Type - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; @@ -117,7 +116,7 @@ bool CesTestsBoobyTrap::init(int domainId, int exerciseId, int testId) void CesTestsBoobyTrap::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 SMART { m_explosionSingle = m_refPos.geographic(5, 5); @@ -132,7 +131,7 @@ void CesTestsBoobyTrap::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(8000, this, &CesTestsBoobyTrap::failExit); @@ -158,11 +157,11 @@ void CesTestsBoobyTrap::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition[" << m_participantIndex << "]" + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition[" << m_participantIndex << "]" << " pos=" << posF.x() << "/" << posF.y(); if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -170,7 +169,7 @@ void CesTestsBoobyTrap::tryCreateParticipantPosition() void CesTestsBoobyTrap::checkParticipantEvent() { - INFO_LOG() << "checkParicipantEvent"; + INFO_LOG(m_logger) << "checkParicipantEvent"; m_cesDtc->waitForHistoricalDataParticipantEvent(); switch (m_testId) @@ -178,7 +177,7 @@ void CesTestsBoobyTrap::checkParticipantEvent() case 1: if ( m_countEventBoobyTrap == 2) { - INFO_LOG() << "ExitSuccess"; + INFO_LOG(m_logger) << "ExitSuccess"; ExitSuccess(); } break; @@ -198,7 +197,7 @@ static void setPos(std::vector &cont, const QPointF &pos) void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrap() { - INFO_LOG() << "trying to send AesItemView tryCreateAesItemViewBoobyTrap"; + INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesItemViewBoobyTrap"; AreaEffectSimulation::AesItemView iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -221,17 +220,17 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrap() setPos(iv.form(), m_refPos.geographic( 10, 30)); setPos(iv.form(), m_refPos.geographic( 10, -10)); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create tryCreateAesItemViewBoobyTrap"; + ERROR_LOG(m_logger) << "Error requesting create tryCreateAesItemViewBoobyTrap"; failExit(); } } void CesTestsBoobyTrap::tryCreateAesBoobyTrap() { - INFO_LOG() << "trying to send AesItemView tryCreateAesBoobyTrap"; + INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesBoobyTrap"; AreaEffectSimulation::BoobyTrap iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -251,10 +250,10 @@ void CesTestsBoobyTrap::tryCreateAesBoobyTrap() iv.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create tryCreateBoobyTrap"; + ERROR_LOG(m_logger) << "Error requesting create tryCreateBoobyTrap"; failExit(); } } @@ -262,7 +261,7 @@ void CesTestsBoobyTrap::tryCreateAesBoobyTrap() void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary() { - INFO_LOG() << "trying to send AesItemView tryCreateAesItemViewBoobyTrapSecondary"; + INFO_LOG(m_logger) << "trying to send AesItemView tryCreateAesItemViewBoobyTrapSecondary"; AreaEffectSimulation::AesItemView iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -285,10 +284,10 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary() setPos(iv.form(), m_refPos.geographic( 50, 50)); setPos(iv.form(), m_refPos.geographic( 50, -20)); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create AesItemViewBoobyTrapSecondary"; + ERROR_LOG(m_logger) << "Error requesting create AesItemViewBoobyTrapSecondary"; failExit(); } } @@ -296,7 +295,7 @@ void CesTestsBoobyTrap::tryCreateAesItemViewBoobyTrapSecondary() void CesTestsBoobyTrap::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType) { - DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId() + DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId() << " eventType=" << eventData.eventTypeId() << " aesItemId=" << eventData.aesItemId(); if (modType == DataModification::eRemoved || @@ -305,7 +304,7 @@ void CesTestsBoobyTrap::onEventChanged(const CentralEffectSimulation::Participan if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitMine) { m_countEventBoobyTrap ++; - DEBUG_LOG() << "m_countEventBoobyTrap=" << m_countEventBoobyTrap + DEBUG_LOG(m_logger) << "m_countEventBoobyTrap=" << m_countEventBoobyTrap << " eventData.aesItemId()=" << eventData.aesItemId() << " eventData.participantId()=" << eventData.participantId(); } @@ -321,14 +320,14 @@ Core::FunctionReplyObject CesTestsBoobyTrap::fillFro(int participantId, bool bSu void CesTestsBoobyTrap::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(200, qApp, QCoreApplication::quit); } void CesTestsBoobyTrap::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.h index 733e566b1..3016ba5c0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_booby_trap.h @@ -54,6 +54,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: // methods void checkParticipantEvent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.cpp index 8f303b1b2..8fa176a9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.cpp @@ -29,8 +29,7 @@ namespace CentralEffectSimulation { -CesTestsGasPipe::CesTestsGasPipe(QObject *parent) - : QObject(parent) +CesTestsGasPipe::CesTestsGasPipe(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) , m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) , m_testId(0) @@ -40,8 +39,8 @@ CesTestsGasPipe::CesTestsGasPipe(QObject *parent) , m_DynamicParticipantIndex(0) , m_aesItemId(5) , m_chargeTypeId(374) // SMART - , m_countEventGasPipe(0) -{} + , m_countEventGasPipe(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsGasPipe::~CesTestsGasPipe() {} @@ -51,7 +50,7 @@ bool CesTestsGasPipe::init(int domainId, int exerciseId, int testId) bool bRet = true; int equipmentTypeIdVehicle = 35; int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; @@ -137,7 +136,7 @@ bool CesTestsGasPipe::init(int domainId, int exerciseId, int testId) void CesTestsGasPipe::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 SMART { m_explosionSingle = m_refPos.geographic(5, 5); @@ -162,7 +161,7 @@ void CesTestsGasPipe::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(8000, this, &CesTestsGasPipe::failExit); @@ -184,10 +183,10 @@ void CesTestsGasPipe::tryCreateDynamicParticipantData() dp.sampleTime(esTime); m_DynamicParticipantIndex++; - DEBUG_LOG() << "Publishing DynamicParticipantData"; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData"; if (!m_ppmDts->publish(dp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -211,10 +210,10 @@ void CesTestsGasPipe::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -228,10 +227,10 @@ void CesTestsGasPipe::tryCreateParticipant() pt.id(m_id); pt.equipmentNumber(m_equipmentNumber); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } m_id++; @@ -240,7 +239,7 @@ void CesTestsGasPipe::tryCreateParticipant() void CesTestsGasPipe::checkParticipantEvent() { - INFO_LOG() << "checkParicipantEvent"; + INFO_LOG(m_logger) << "checkParicipantEvent"; m_cesDtc->waitForHistoricalDataParticipantEvent(); switch (m_testId) @@ -273,10 +272,10 @@ void CesTestsGasPipe::tryCreateTypeVehicle() ty.name("HMMWV Utility"); - DEBUG_LOG() << "Publishing Type"; + DEBUG_LOG(m_logger) << "Publishing Type"; if (!m_ppmDts->publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -294,10 +293,10 @@ void CesTestsGasPipe::tryCreateTypeSoldier() ty.name("Soldier"); - DEBUG_LOG() << "Publishing Type"; + DEBUG_LOG(m_logger) << "Publishing Type"; if (!m_ppmDts->publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -308,7 +307,7 @@ static void setPos(std::vector &cont, const QPointF &pos) void CesTestsGasPipe::tryCreateAesItemViewGasPipe() { - INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions"; + INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions"; AreaEffectSimulation::AesItemView iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -331,30 +330,30 @@ void CesTestsGasPipe::tryCreateAesItemViewGasPipe() setPos(iv.form(), m_refPos.geographic( 10, 30)); setPos(iv.form(), m_refPos.geographic( 10, -10)); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions"; + ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions"; failExit(); } } void CesTestsGasPipe::tryCreateChargeType() { - DEBUG_LOG() << "Publishing ChargeType"; + DEBUG_LOG(m_logger) << "Publishing ChargeType"; ProjectDataManagement::ChargeType ct; ct.id(m_chargeTypeId); ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}"); if (!m_pdmDts->publish(ct)) { - ERROR_LOG() << "Error publish ChargeType"; + ERROR_LOG(m_logger) << "Error publish ChargeType"; failExit(); } } void CesTestsGasPipe::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType) { - DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId() + DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId() << " eventType=" << eventData.eventTypeId(); if (modType == DataModification::eRemoved || modType == DataModification::eModified) @@ -362,7 +361,7 @@ void CesTestsGasPipe::onEventChanged(const CentralEffectSimulation::ParticipantE if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitGasPipe) { m_countEventGasPipe ++; - DEBUG_LOG() << "m_countEventGasPipe=" << m_countEventGasPipe; + DEBUG_LOG(m_logger) << "m_countEventGasPipe=" << m_countEventGasPipe; } } @@ -376,14 +375,14 @@ Core::FunctionReplyObject CesTestsGasPipe::fillFro(int participantId, bool bSucc void CesTestsGasPipe::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void CesTestsGasPipe::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.h index 42332702a..3abbddd31 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_gas_pipe.h @@ -57,6 +57,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: // methods void checkParticipantEvent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.cpp index 84832d2dd..d93184909 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.cpp @@ -32,12 +32,11 @@ namespace CentralEffectSimulation { -CesTestsGeopairing::CesTestsGeopairing(QObject *parent) - : QObject(parent) +CesTestsGeopairing::CesTestsGeopairing(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) , m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) - , m_testId(0) -{} + , m_testId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsGeopairing::~CesTestsGeopairing() {} @@ -45,7 +44,7 @@ CesTestsGeopairing::~CesTestsGeopairing() bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId) { bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; @@ -80,7 +79,7 @@ bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId) void CesTestsGeopairing::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; switch (m_testId) { case 1: @@ -92,7 +91,7 @@ void CesTestsGeopairing::startTest() } case 2: { - INFO_LOG() << "Geopairing IGLA"; + INFO_LOG(m_logger) << "Geopairing IGLA"; QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData); QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition); QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition); @@ -102,7 +101,7 @@ void CesTestsGeopairing::startTest() } case 3: { - INFO_LOG() << "Geopairing IGLA Damage States"; + INFO_LOG(m_logger) << "Geopairing IGLA Damage States"; QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData); QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition); QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition); @@ -112,7 +111,7 @@ void CesTestsGeopairing::startTest() } case 4: // MK 19 { - INFO_LOG() << "Geopairing MK 19"; + INFO_LOG(m_logger) << "Geopairing MK 19"; QTimer::singleShot(0, this, &CesTestsGeopairing::tryCreateMeteoData); QTimer::singleShot(250, this, &CesTestsGeopairing::tryCreateSoldierPosition); QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition); @@ -122,7 +121,7 @@ void CesTestsGeopairing::startTest() } default: { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } } @@ -141,10 +140,10 @@ void CesTestsGeopairing::tryCreateMeteoData() md.windDirection(0.0); md.temperature(20.0); md.pressure(1013); - DEBUG_LOG() << "Publishing MeteoData"; + DEBUG_LOG(m_logger) << "Publishing MeteoData"; if (!m_mdmDts->publish(md)) { - ERROR_LOG() << "Error requesting create MeteoData"; + ERROR_LOG(m_logger) << "Error requesting create MeteoData"; failExit(); } } @@ -166,10 +165,10 @@ void CesTestsGeopairing::tryCreateSoldierPosition() pp.roomId(0); pp.sampleTime(posTime); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -191,10 +190,10 @@ void CesTestsGeopairing::tryCreateAircraftPosition() pp.roomId(0); pp.sampleTime(posTime); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -255,10 +254,10 @@ void CesTestsGeopairing::tryCreateGeopairingData() const Core::GeoPosition pos(Core::GeoPosition(posF.x(), posF.y(), 0)); gd.position(pos); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -343,10 +342,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLA() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -389,10 +388,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -401,12 +400,12 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19() void CesTestsGeopairing::checkGeopairing() { - INFO_LOG() << "checkMessageOnDds"; + INFO_LOG(m_logger) << "checkMessageOnDds"; m_aesDtc->waitForHistoricalDataExplosionSingle(); QMap < int ,AreaEffectSimulation::ExplosionSingle> explosionSingles = m_aesDtc->explosionSingles(); - INFO_LOG() << "explosionSingles.size()" << explosionSingles.size(); + INFO_LOG(m_logger) << "explosionSingles.size()" << explosionSingles.size(); AreaEffectSimulation::ExplosionSingle explosionSingle = explosionSingles.last(); - DEBUG_LOG() << "explosionSingle.lat=" << explosionSingle.impactPosition().lat() + DEBUG_LOG(m_logger) << "explosionSingle.lat=" << explosionSingle.impactPosition().lat() << " lon=" << explosionSingle.impactPosition().lon(); switch (m_testId) @@ -428,14 +427,14 @@ void CesTestsGeopairing::checkGeopairing() void CesTestsGeopairing::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, &QCoreApplication::quit); } void CesTestsGeopairing::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(50, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.h index b80045618..b282d3966 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing.h @@ -52,6 +52,8 @@ protected Q_SLOTS: private: // methods + +NGL::INGLLogger &m_logger; void checkParicipantEvent(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.cpp index fdc3cf8cc..efad21e21 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.cpp @@ -32,12 +32,11 @@ namespace CentralEffectSimulation { -CesTestsGeopairing::CesTestsGeopairing(QObject *parent) - : QObject(parent) +CesTestsGeopairing::CesTestsGeopairing(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) , m_housePos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) - , m_testId(0) -{} + , m_testId(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsGeopairing::~CesTestsGeopairing() {} @@ -45,7 +44,7 @@ CesTestsGeopairing::~CesTestsGeopairing() bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId) { bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; @@ -80,7 +79,7 @@ bool CesTestsGeopairing::init(int domainId, int exerciseId, int testId) void CesTestsGeopairing::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; switch (m_testId) { case 1: // Geopairing Mortar @@ -91,7 +90,7 @@ void CesTestsGeopairing::startTest() } case 2: // IGLA Target Detection { - INFO_LOG() << "Geopairing IGLA"; + INFO_LOG(m_logger) << "Geopairing IGLA"; //QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition); QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataIGLA); QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing); @@ -99,7 +98,7 @@ void CesTestsGeopairing::startTest() } case 3: // IGLA Target Fire { - INFO_LOG() << "Geopairing IGLA Target Fire"; + INFO_LOG(m_logger) << "Geopairing IGLA Target Fire"; QTimer::singleShot(500, this, &CesTestsGeopairing::tryCreateAircraftPosition); QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataIGLATarget); QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing); @@ -107,14 +106,14 @@ void CesTestsGeopairing::startTest() } case 4: // MK 19 { - INFO_LOG() << "Geopairing MK 19"; + INFO_LOG(m_logger) << "Geopairing MK 19"; QTimer::singleShot(750, this, &CesTestsGeopairing::tryCreateGeopairingDataMK19); QTimer::singleShot(1000, this, &CesTestsGeopairing::checkGeopairing); break; } default: { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } } @@ -139,10 +138,10 @@ void CesTestsGeopairing::tryCreateSoldierPosition() pp.roomId(0); pp.sampleTime(posTime); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -164,10 +163,10 @@ void CesTestsGeopairing::tryCreateAircraftPosition() pp.roomId(0); pp.sampleTime(posTime); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -211,10 +210,10 @@ void CesTestsGeopairing::tryCreateGeopairingData() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -258,10 +257,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLA() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -304,10 +303,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataIGLATarget() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -350,10 +349,10 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19() gd.position().lon(lon); gd.position().lat(lat); - DEBUG_LOG() << "Publishing GeopairingData"; + DEBUG_LOG(m_logger) << "Publishing GeopairingData"; if (!m_tabDts->publish(gd)) { - ERROR_LOG() << "Error requesting create GeopairingData"; + ERROR_LOG(m_logger) << "Error requesting create GeopairingData"; failExit(); } @@ -362,7 +361,7 @@ void CesTestsGeopairing::tryCreateGeopairingDataMK19() void CesTestsGeopairing::checkGeopairing() { - INFO_LOG() << "checkMessageOnDds"; + INFO_LOG(m_logger) << "checkMessageOnDds"; switch (m_testId) { @@ -370,9 +369,9 @@ void CesTestsGeopairing::checkGeopairing() { m_aesDtc->waitForHistoricalDataExplosionSingle(); QMap < int ,AreaEffectSimulation::ExplosionSingle> explosionSingles = m_aesDtc->explosionSingles(); - INFO_LOG() << "explosionSingles.size()" << explosionSingles.size(); + INFO_LOG(m_logger) << "explosionSingles.size()" << explosionSingles.size(); AreaEffectSimulation::ExplosionSingle explosionSingle = explosionSingles.last(); - DEBUG_LOG() << "explosionSingle.lat=" << explosionSingle.impactPosition().lat() + DEBUG_LOG(m_logger) << "explosionSingle.lat=" << explosionSingle.impactPosition().lat() << " lon=" << explosionSingle.impactPosition().lon(); if ( (explosionSingle.impactPosition().lat() > 0.9 && explosionSingle.impactPosition().lat() < 1.0) && (explosionSingle.impactPosition().lon() > 0.1 && explosionSingle.impactPosition().lon() < 0.2)) @@ -391,14 +390,14 @@ void CesTestsGeopairing::checkGeopairing() void CesTestsGeopairing::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, &QCoreApplication::quit); } void CesTestsGeopairing::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(50, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.h index b38dd8635..b1a46bb33 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_geo_pairing_bsp.h @@ -52,6 +52,8 @@ protected Q_SLOTS: private: // methods + +NGL::INGLLogger &m_logger; void checkParicipantEvent(); private: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.cpp index db47bf04a..5450ac4df 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.cpp @@ -68,8 +68,7 @@ namespace CentralEffectSimulation { -CesTestsMineAreas::CesTestsMineAreas(QObject *parent) - : QObject(parent) +CesTestsMineAreas::CesTestsMineAreas(QObject *parent) : QObject(parent) , m_bTestsSuccessful(true) , m_refPos(LtsCoordTrans::UtmCoordinate::fromMgrs(QStringLiteral("32UMD8000090000"))) , m_testId(0) @@ -79,8 +78,8 @@ CesTestsMineAreas::CesTestsMineAreas(QObject *parent) , m_DynamicParticipantIndex(0) , m_aesItemId(5) , m_chargeTypeId(374) // SMART - , m_countEventMineAreas(0) -{} + , m_countEventMineAreas(0), + m_logger(NGL::NGLLoggerBootstrap::getLogger()) {} CesTestsMineAreas::~CesTestsMineAreas() {} @@ -90,7 +89,7 @@ bool CesTestsMineAreas::init(int domainId, int exerciseId, int testId) bool bRet = true; int equipmentTypeIdVehicle = 35; int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; @@ -176,7 +175,7 @@ bool CesTestsMineAreas::init(int domainId, int exerciseId, int testId) void CesTestsMineAreas::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 SMART { m_explosionSingle = m_refPos.geographic(5, 5); @@ -201,7 +200,7 @@ void CesTestsMineAreas::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(8000, this, &CesTestsMineAreas::failExit); @@ -223,10 +222,10 @@ void CesTestsMineAreas::tryCreateDynamicParticipantData() dp.sampleTime(esTime); m_DynamicParticipantIndex++; - DEBUG_LOG() << "Publishing DynamicParticipantData"; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData"; if (!m_ppmDts->publish(dp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -250,10 +249,10 @@ void CesTestsMineAreas::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -267,10 +266,10 @@ void CesTestsMineAreas::tryCreateParticipant() pt.id(m_id); pt.equipmentNumber(m_equipmentNumber); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } m_id++; @@ -279,7 +278,7 @@ void CesTestsMineAreas::tryCreateParticipant() void CesTestsMineAreas::checkParticipantEvent() { - INFO_LOG() << "checkParicipantEvent"; + INFO_LOG(m_logger) << "checkParicipantEvent"; m_cesDtc->waitForHistoricalDataParticipantEvent(); switch (m_testId) @@ -312,10 +311,10 @@ void CesTestsMineAreas::tryCreateTypeVehicle() ty.name("HMMWV Utility"); - DEBUG_LOG() << "Publishing Type"; + DEBUG_LOG(m_logger) << "Publishing Type"; if (!m_ppmDts->publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -333,10 +332,10 @@ void CesTestsMineAreas::tryCreateTypeSoldier() ty.name("Soldier"); - DEBUG_LOG() << "Publishing Type"; + DEBUG_LOG(m_logger) << "Publishing Type"; if (!m_ppmDts->publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -347,7 +346,7 @@ static void setPos(std::vector &cont, const QPointF &pos) void CesTestsMineAreas::tryCreateAesItemViewMineArea() { - INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions"; + INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions"; AreaEffectSimulation::AesItemView iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -370,30 +369,30 @@ void CesTestsMineAreas::tryCreateAesItemViewMineArea() setPos(iv.form(), m_refPos.geographic( 10, 30)); setPos(iv.form(), m_refPos.geographic( 10, -10)); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions"; + ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions"; failExit(); } } void CesTestsMineAreas::tryCreateChargeType() { - DEBUG_LOG() << "Publishing ChargeType"; + DEBUG_LOG(m_logger) << "Publishing ChargeType"; ProjectDataManagement::ChargeType ct; ct.id(m_chargeTypeId); ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}"); if (!m_pdmDts->publish(ct)) { - ERROR_LOG() << "Error publish ChargeType"; + ERROR_LOG(m_logger) << "Error publish ChargeType"; failExit(); } } void CesTestsMineAreas::onEventChanged(const CentralEffectSimulation::ParticipantEvent &eventData, DataModification modType) { - DEBUG_LOG() << "onParticipantEventChanged participantId=" << eventData.participantId() + DEBUG_LOG(m_logger) << "onParticipantEventChanged participantId=" << eventData.participantId() << " eventType=" << eventData.eventTypeId(); if (modType == DataModification::eRemoved || modType == DataModification::eModified) @@ -401,7 +400,7 @@ void CesTestsMineAreas::onEventChanged(const CentralEffectSimulation::Participan if (eventData.eventTypeId() == ProjectDataManagement::EventType_def::HitGasPipe) { m_countEventMineAreas ++; - DEBUG_LOG() << "m_countEventMineAreas=" << m_countEventMineAreas; + DEBUG_LOG(m_logger) << "m_countEventMineAreas=" << m_countEventMineAreas; } } @@ -415,14 +414,14 @@ Core::FunctionReplyObject CesTestsMineAreas::fillFro(int participantId, bool bSu void CesTestsMineAreas::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void CesTestsMineAreas::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.h index e5eb81b9d..74f3611fd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_mine_areas.h @@ -57,6 +57,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: // methods void checkParticipantEvent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_ownership.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_ownership.cpp index 7910ffd82..f0cbfced9 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_ownership.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_ownership.cpp @@ -48,7 +48,7 @@ CesTestsOwnership::~CesTestsOwnership() bool CesTestsOwnership::init(int domainId, int exerciseId, int testId) { bool bRet = true; - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_buildingId = 7; // ism_main_structure_element:id @@ -111,7 +111,7 @@ bool CesTestsOwnership::init(int domainId, int exerciseId, int testId) void CesTestsOwnership::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 Participant in BT56 { QTimer::singleShot(0, this, &CesTestsOwnership::tryCreateParticipantPosition); @@ -168,7 +168,7 @@ void CesTestsOwnership::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(6000, this, &CesTestsOwnership::failExit); @@ -190,10 +190,10 @@ void CesTestsOwnership::tryCreateDynamicParticipantData() dp.sampleTime(esTime); m_DynamicParticipantIndex++; - DEBUG_LOG() << "Publishing DynamicParticipantData"; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData"; if (!m_ppmDts->publish(dp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -216,10 +216,10 @@ void CesTestsOwnership::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -233,10 +233,10 @@ void CesTestsOwnership::tryCreateParticipant() pt.id(m_participants[m_participantIndex].participantId); pt.equipmentNumber(m_participants[m_participantIndex].equipmentNumber); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } } @@ -245,32 +245,32 @@ void CesTestsOwnership::trySetOwnershipRequest() { int32_t partyId = 0; - DEBUG_LOG() << " request.buildingId() = " << m_buildingId + DEBUG_LOG(m_logger) << " request.buildingId() = " << m_buildingId << " request.partyId() = " << m_buildingId; if (!m_cesFtc->setOwnershipRequest(SetOwnershipRequest(m_buildingId, partyId), this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } } void CesTestsOwnership::onSetOwnershipReply(const Core::FunctionReplyObject &replyObject) { - INFO_LOG() << "onSetOwnershipReply() replyObject.id=" << replyObject.id(); + INFO_LOG(m_logger) << "onSetOwnershipReply() replyObject.id=" << replyObject.id(); } void CesTestsOwnership::checkBuildingOwnership() { - INFO_LOG() << "checkBuildingOwnership"; + INFO_LOG(m_logger) << "checkBuildingOwnership"; /* m_cesDtc->waitForHistoricalDataBuildingOwnership(); QMap < int ,CentralEffectSimulation::BuildingOwnership> buildingOwnership = m_cesDtc->buildingOwnerships(); - INFO_LOG() << "Recived ParicipantEvent BuildingOwnership:"<waitForHistoricalDataParticipantEvent(); CentralEffectSimulation::ParticipantEvent participantEvent0 = m_cesDtc->participantEvent(0); CentralEffectSimulation::ParticipantEvent participantEvent1 = m_cesDtc->participantEvent(1); - INFO_LOG() << "Recived ParicipantEvent equipmentNumber:" << participantEvent0.equipmentNumber() + INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:" << participantEvent0.equipmentNumber() << " eventType=" << participantEvent0.eventTypeId(); - INFO_LOG() << "Recived ParicipantEvent equipmentNumber:" << participantEvent1.equipmentNumber() + INFO_LOG(m_logger) << "Recived ParicipantEvent equipmentNumber:" << participantEvent1.equipmentNumber() << " eventType=" << participantEvent1.eventTypeId(); switch (m_testId) @@ -182,7 +182,7 @@ void cesTestsSimulatedMovement::trySimulatedMovementModifyRequest() if (!m_cesFtc->simulatedMovementModifyRequest(req, this)) { - ERROR_LOG() << "Error requesting create data"; + ERROR_LOG(m_logger) << "Error requesting create data"; failExit(); } @@ -195,7 +195,7 @@ void cesTestsSimulatedMovement::trySimulatedMovementRemoveRequest() if (!m_cesFtc->simulatedMovementRemoveRequest(SimulatedMovementRemoveRequest(id), this)) { - ERROR_LOG() << "Error requesting remove data"; + ERROR_LOG(m_logger) << "Error requesting remove data"; failExit(); } QTest::qWait(2000); @@ -210,10 +210,10 @@ void cesTestsSimulatedMovement::tryCreateParticipant() pt.id(m_participantId); pt.partyId(5); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } QTest::qWait(2000); @@ -222,25 +222,25 @@ void cesTestsSimulatedMovement::tryCreateParticipant() void cesTestsSimulatedMovement::onSimulatedMovementModifyReply(const Core::FunctionReplyObject &replyObject) { Q_UNUSED(replyObject); - INFO_LOG() << "onSimulatedMovementModifyReply()"; + INFO_LOG(m_logger) << "onSimulatedMovementModifyReply()"; } void cesTestsSimulatedMovement::onSimulatedMovementRemoveReply(const Core::FunctionReplyObject &replyObject) { Q_UNUSED(replyObject); - INFO_LOG() << "onSimulatedMovementRemoveReply()"; + INFO_LOG(m_logger) << "onSimulatedMovementRemoveReply()"; } void cesTestsSimulatedMovement::failExit() { - ERROR_LOG() << "FailExit"; + ERROR_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void cesTestsSimulatedMovement::ExitSuccess() { - INFO_LOG() << "ExitSuccess"; + INFO_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_simulated_movement.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_simulated_movement.h index 5f259a07e..61fc4b88d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_simulated_movement.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_simulated_movement.h @@ -50,6 +50,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: // methods void checkParticipantEvent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.cpp index b28eeb995..097292402 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.cpp @@ -53,7 +53,7 @@ bool CesTestsSmart::init(int domainId, int exerciseId, int testId) bool bRet = true; int equipmentTypeIdVehicle = 35; int equipmentTypeIdSoldier = 30; // dds-Topic Participant-Management::Type - INFO_LOG() << "init begin"; + INFO_LOG(m_logger) << "init begin"; m_testId = testId; m_buildingId = 0; // ism_main_structure_element:id @@ -141,7 +141,7 @@ bool CesTestsSmart::init(int domainId, int exerciseId, int testId) void CesTestsSmart::startTest() { - INFO_LOG() << "startTest m_testId=" << m_testId; + INFO_LOG(m_logger) << "startTest m_testId=" << m_testId; if (m_testId <= 1) // 1 SMART { m_explosionSingle = m_housePos.geographic(5, 5); @@ -163,7 +163,7 @@ void CesTestsSmart::startTest() } else { - ERROR_LOG() << "Unknown test id = " << m_testId; + ERROR_LOG(m_logger) << "Unknown test id = " << m_testId; failExit(); } QTimer::singleShot(8000, this, &CesTestsSmart::failExit); @@ -185,10 +185,10 @@ void CesTestsSmart::tryCreateDynamicParticipantData() dp.sampleTime(esTime); m_DynamicParticipantIndex++; - DEBUG_LOG() << "Publishing DynamicParticipantData"; + DEBUG_LOG(m_logger) << "Publishing DynamicParticipantData"; if (!m_ppmDts->publish(dp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -212,10 +212,10 @@ void CesTestsSmart::tryCreateParticipantPosition() pp.sampleTime(posTime); pp.pos(pos); - DEBUG_LOG() << "Publishing ParticipantPosition"; + DEBUG_LOG(m_logger) << "Publishing ParticipantPosition"; if (!m_ppmDts->publish(pp)) { - ERROR_LOG() << "Error requesting create ParticipantPosition"; + ERROR_LOG(m_logger) << "Error requesting create ParticipantPosition"; failExit(); } } @@ -229,17 +229,17 @@ void CesTestsSmart::tryCreateParticipant() pt.id(21); pt.equipmentNumber(61); - DEBUG_LOG() << "Publishing Participant"; + DEBUG_LOG(m_logger) << "Publishing Participant"; if (!m_ppmDts->publish(pt)) { - ERROR_LOG() << "Error requesting create Participant"; + ERROR_LOG(m_logger) << "Error requesting create Participant"; failExit(); } } void CesTestsSmart::checkParticipantEvent() { - INFO_LOG() << "checkParicipantEvent m_cesDtc->participantEvents().size() =" << m_cesDtc->participantEvents().size(); + INFO_LOG(m_logger) << "checkParicipantEvent m_cesDtc->participantEvents().size() =" << m_cesDtc->participantEvents().size(); m_cesDtc->waitForHistoricalDataParticipantEvent(); CentralEffectSimulation::ParticipantEvent participantEvent0 = m_cesDtc->participantEvent(0); CentralEffectSimulation::ParticipantEvent participantEvent1 = m_cesDtc->participantEvent(1); @@ -247,7 +247,7 @@ void CesTestsSmart::checkParticipantEvent() for ( int i = 0; i < m_cesDtc->participantEvents().size(); i++) { CentralEffectSimulation::ParticipantEvent participantEvent = m_cesDtc->participantEvent(i); - INFO_LOG() << "Recived ParicipantEvent equipmentNumber:"<publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -304,10 +304,10 @@ void CesTestsSmart::tryCreateTypeSoldier() ty.name("Soldier"); - DEBUG_LOG() << "Publishing Type"; + DEBUG_LOG(m_logger) << "Publishing Type"; if (!m_ppmDts->publish(ty)) { - ERROR_LOG() << "Error requesting create Type"; + ERROR_LOG(m_logger) << "Error requesting create Type"; failExit(); } } @@ -318,7 +318,7 @@ static void setPos(std::vector &cont, const QPointF &pos) void CesTestsSmart::tryCreateAesItemViewSingleExplosion() { - INFO_LOG() << "trying to send AesItemView AtExplosionAreaSingleExplosions"; + INFO_LOG(m_logger) << "trying to send AesItemView AtExplosionAreaSingleExplosions"; AreaEffectSimulation::AesItemView iv; iv.effectStateId(AreaEffectSimulation::AesEffectState_def::EsActivated); @@ -343,30 +343,30 @@ void CesTestsSmart::tryCreateAesItemViewSingleExplosion() setPos(iv.form(), m_housePos.geographic(-10, 20)); setPos(iv.form(), m_housePos.geographic(-10, 30)); - DEBUG_LOG() << "Publishing AesItemView"; + DEBUG_LOG(m_logger) << "Publishing AesItemView"; if (!m_aesDts->publish(iv)) { - ERROR_LOG() << "Error requesting create AesItemViewSingleExplosions"; + ERROR_LOG(m_logger) << "Error requesting create AesItemViewSingleExplosions"; failExit(); } } void CesTestsSmart::tryCreateChargeType() { - DEBUG_LOG() << "Publishing ChargeType"; + DEBUG_LOG(m_logger) << "Publishing ChargeType"; ProjectDataManagement::ChargeType ct; ct.id(m_chargeTypeId); ct.properties("{\"impactRadius\":25,\"impactEdgeLength\":50,\"isSmart\":true,\"searchRadius\":150}"); if (!m_pdmDts->publish(ct)) { - ERROR_LOG() << "Error publish ChargeType"; + ERROR_LOG(m_logger) << "Error publish ChargeType"; failExit(); } } void CesTestsSmart::tryCreatePrepareExplosionSingle() { - INFO_LOG() << "trying to send ExplosionSingle"; + INFO_LOG(m_logger) << "trying to send ExplosionSingle"; AreaEffectSimulation::ExplosionSingle es; const qint64 time = QDateTime::currentMSecsSinceEpoch(); const rti::core::int64 esTime = static_cast(time); @@ -382,17 +382,17 @@ void CesTestsSmart::tryCreatePrepareExplosionSingle() es.isCentral(true); es.effectStart ( QDateTime::currentMSecsSinceEpoch() + 2000); - DEBUG_LOG() << "Publishing ExplosionSingle"; + DEBUG_LOG(m_logger) << "Publishing ExplosionSingle"; if (!m_aesDts->publish(es)) { - ERROR_LOG() << "Error publish ExplosionArea"; + ERROR_LOG(m_logger) << "Error publish ExplosionArea"; failExit(); } } void CesTestsSmart::tryCreateExplosionSingle() { - INFO_LOG() << "trying to send ExplosionSingle"; + INFO_LOG(m_logger) << "trying to send ExplosionSingle"; AreaEffectSimulation::ExplosionSingle es; const qint64 time = QDateTime::currentMSecsSinceEpoch(); const rti::core::int64 esTime = static_cast(time); @@ -410,10 +410,10 @@ void CesTestsSmart::tryCreateExplosionSingle() es.sampleTime(esTime); es.chargeStruct().chargeTypeId(m_chargeTypeId); - DEBUG_LOG() << "Publishing ExplosionSingle"; + DEBUG_LOG(m_logger) << "Publishing ExplosionSingle"; if (!m_aesDts->publish(es)) { - ERROR_LOG() << "Error publish ExplosionArea"; + ERROR_LOG(m_logger) << "Error publish ExplosionArea"; failExit(); } } @@ -433,7 +433,7 @@ void CesTestsSmart::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, QDateTime dateTime; dateTime.setMSecsSinceEpoch(msecs); - DEBUG_LOG() << "onSendCesHitRequest" << "\n" + DEBUG_LOG(m_logger) << "onSendCesHitRequest" << "\n" << " request.aesId() = " << request.aesId() << "\n" << " request.chargeTypeId() = " << request.chargeTypeId() << "\n" << " request.equipmentNumber() = " << request.equipmentNumber() << "\n" @@ -448,14 +448,14 @@ void CesTestsSmart::onSendCesHitRequest(const rti::core::SampleIdentity &cookie, void CesTestsSmart::failExit() { - DEBUG_LOG() << "FailExit"; + DEBUG_LOG(m_logger) << "FailExit"; m_bTestsSuccessful = false; QTimer::singleShot(50, qApp, QCoreApplication::quit); } void CesTestsSmart::ExitSuccess() { - DEBUG_LOG() << "ExitSuccess"; + DEBUG_LOG(m_logger) << "ExitSuccess"; m_bTestsSuccessful = true; QTimer::singleShot(200, qApp, &QCoreApplication::quit); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.h index ca252d82f..0d050072f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/ModuleTests/ces_tests_smart.h @@ -59,6 +59,7 @@ protected Q_SLOTS: protected: + NGL::INGLLogger &m_logger; private: // methods void checkParticipantEvent(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/handler_artillerie_sound.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/handler_artillerie_sound.cpp index 4657b1c25..89af757b5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/handler_artillerie_sound.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/handler_artillerie_sound.cpp @@ -38,7 +38,7 @@ bool HandlerArtillerieSound::init() if (Settings::cesPlayArtillerieSounds()) { - DEBUG_LOG() << "init with Artillerie-Sounds"; + DEBUG_LOG(m_logger) << "init with Artillerie-Sounds"; auto dtcAes = m_ddsHandler->dtcAes(); dtcAes->enableExplosionSingle(); @@ -50,7 +50,7 @@ bool HandlerArtillerieSound::init() this, &HandlerArtillerieSound::onTechnicalAreaChanged); } else - DEBUG_LOG() << "init without Artillerie-Sounds"; + DEBUG_LOG(m_logger) << "init without Artillerie-Sounds"; return true; } // end of init() //----------------------------------------------------------------------------- @@ -68,7 +68,7 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove SingleExplosion"; + DEBUG_LOG(m_logger) << "Remove SingleExplosion"; m_explosionSingleState.remove(data.id()); return; } @@ -77,28 +77,28 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) && data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated) { - DEBUG_LOG() << "Handle SingleExplosion"; + DEBUG_LOG(m_logger) << "Handle SingleExplosion"; handleExplosion = true; } m_explosionSingleState.insert(data.id(), data.effectStateId()); - DEBUG_LOG() << "Got ExplosionSingle State=" << data.effectStateId() + DEBUG_LOG(m_logger) << "Got ExplosionSingle State=" << data.effectStateId() << " id=" << data.id(); if (handleExplosion) { - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated) HandlerArtillerieSound"; + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated) HandlerArtillerieSound"; auto assetPositions = m_handlerBuildingData->getAssetPositions(); /////////////////////////////////////////////////////////////////// /// Play Sound to each EGCU and OSGU volume depends on distance /////////////////////////////////////////////////////////////////// - INFO_LOG() << "printAssetPositions: "; + INFO_LOG(m_logger) << "printAssetPositions: "; QHashIterator i(assetPositions); while (i.hasNext()) { i.next(); - INFO_LOG() << "printAssetPositions: " + INFO_LOG(m_logger) << "printAssetPositions: " << i.key() << ": " << i.value().structureElementId << " type = " << i.value().mountingPointType << " hostname =" << i.value().hostname @@ -113,7 +113,7 @@ void HandlerArtillerieSound::onExplosionSingleChanged(const AreaEffectSimulation const qreal distanceThreshold = Settings::cesDistanceThreshold(); // [m] const qreal factor = Settings::cesFactor(); const qreal cesReduceFactor = Settings::cesReduceFactor(); - INFO_LOG() << "Distance to Explosion =" << distance + INFO_LOG(m_logger) << "Distance to Explosion =" << distance << " hostname =" << i.value().hostname << " distanceThreshold=" << distanceThreshold << " factor=" << factor; @@ -138,13 +138,13 @@ void HandlerArtillerieSound::playSound(QString &user, QString &passwd, const QSt url.setUrl(request); url.setUserName(user); url.setPassword(passwd); - DEBUG_LOG() << "startRequest: " << url.toString(); + DEBUG_LOG(m_logger) << "startRequest: " << url.toString(); startRequest(url); } void HandlerArtillerieSound::startRequest(const QUrl &requestedUrl) { - DEBUG_LOG() << "startRequest: " << requestedUrl.toString(); + DEBUG_LOG(m_logger) << "startRequest: " << requestedUrl.toString(); m_httpRequestAborted = false; auto reply = m_qnam.get(QNetworkRequest(requestedUrl)); connect(reply, &QNetworkReply::finished, this, &HandlerArtillerieSound::httpFinished); @@ -153,14 +153,14 @@ void HandlerArtillerieSound::startRequest(const QUrl &requestedUrl) void HandlerArtillerieSound::httpFinished() { - DEBUG_LOG() << "httpFinished"; + DEBUG_LOG(m_logger) << "httpFinished"; auto reply = qobject_cast(sender()); if (!reply) return; if (m_httpRequestAborted) { - ERROR_LOG() << "httpRequestAborted"; + ERROR_LOG(m_logger) << "httpRequestAborted"; reply->deleteLater(); return; } @@ -169,7 +169,7 @@ void HandlerArtillerieSound::httpFinished() { QNetworkRequest request = reply->request(); QUrl url = request.url(); - ERROR_LOG() << "reply->error: " << reply->errorString() + ERROR_LOG(m_logger) << "reply->error: " << reply->errorString() << " host=" << url.host() << " query='" << url.query() << "' '" << qUtf8Printable(url.toString()) << "'"; @@ -182,7 +182,7 @@ void HandlerArtillerieSound::httpFinished() //parse the reply JSON and display result in the UI const QByteArray json(reply->readAll()); - DEBUG_LOG() << "Sucess " << json; + DEBUG_LOG(m_logger) << "Sucess " << json; reply->deleteLater(); } @@ -199,7 +199,7 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation:: if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove TechnicalArea"; + DEBUG_LOG(m_logger) << "Remove TechnicalArea"; m_technicalAreas.remove(data.id()); return; } @@ -207,14 +207,14 @@ void HandlerArtillerieSound::onTechnicalAreaChanged(const AreaEffectSimulation:: { int zone = -1; m_technicalAreas.insert(data.id(), data); - DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id(); + DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound id=" << data.id(); QPointF cornerButtomLeft = CentralEffectSimulation::geographic2Utm(data.area().cornerBottomLeft(), &zone); qreal x = cornerButtomLeft.x() + data.area().width() / 2; qreal y = cornerButtomLeft.y() + data.area().height() / 2; QPointF center(x, y); - DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound cornerButtomLeft = " << cornerButtomLeft.x() << "/" << cornerButtomLeft.y() + DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound cornerButtomLeft = " << cornerButtomLeft.x() << "/" << cornerButtomLeft.y() << " zone=" << zone; - DEBUG_LOG() << "Handle TechnicalArea HandlerArtillerieSound center = " << center.x() << "/" << center.y() + DEBUG_LOG(m_logger) << "Handle TechnicalArea HandlerArtillerieSound center = " << center.x() << "/" << center.y() << " zone=" << zone; } } // onTechnicalAreaChanged diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.cpp index 9ffe87d4a..07bf3137c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.cpp @@ -61,7 +61,7 @@ bool CesArtillerySoundInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init()" + INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -74,11 +74,11 @@ bool CesArtillerySoundInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerArtillerieSound->init()) { - ERROR_LOG() << "Initialisation m_handlerArtillerieSound failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerArtillerieSound failed."; return false; } - INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init() return true"; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.h index 2492b1393..a3bc8af41 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ArtillerySound/plugin.h @@ -78,6 +78,7 @@ private Q_SLOTS: bool init(int domainId, int exerciseId) override; private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp; std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_participant_borderline.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_participant_borderline.cpp index 5e5a1c351..6eac69952 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_participant_borderline.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_participant_borderline.cpp @@ -25,7 +25,7 @@ HandlerParticipantBorderline::HandlerParticipantBorderline(const std::shared_ptr , m_handlerParticipant(participantHandler) , m_logger(CentralEffectSimulation::getLogger("Plugin.Basic.HandlerParticipantBorderline")) { - INFO_LOG() << "HandlerParticipantBorderline::HandlerParticipantBorderline"; + INFO_LOG(m_logger) << "HandlerParticipantBorderline::HandlerParticipantBorderline"; } // end of ctor() //----------------------------------------------------------------------------- @@ -37,7 +37,7 @@ HandlerParticipantBorderline::~HandlerParticipantBorderline() bool HandlerParticipantBorderline::init() { - INFO_LOG() << "HandlerParticipantBorderline::init"; + INFO_LOG(m_logger) << "HandlerParticipantBorderline::init"; auto dtcAes = m_ddsHandler->dtcAes(); dtcAes->waitForHistoricalDataBorderline(1000); @@ -59,7 +59,7 @@ bool HandlerParticipantBorderline::init() return false; } - INFO_LOG() << "HandlerParticipantBorderline::init() finished. "; + INFO_LOG(m_logger) << "HandlerParticipantBorderline::init() finished. "; return true; } // end of init() //----------------------------------------------------------------------------- @@ -69,7 +69,7 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio switch (modType) { case DataModification::eRemoved: - DEBUG_LOG() << " remove Borderline- data.id()=" << data.id(); + DEBUG_LOG(m_logger) << " remove Borderline- data.id()=" << data.id(); m_borderlines.remove(data.id()); break; case DataModification::eAdded: @@ -85,7 +85,7 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio case AreaEffectSimulation::AesEffectState_def::EsActivated: { BorderlineUtm borderline(data); - DEBUG_LOG() << "m_borderlines.insert id=" << data.id(); + DEBUG_LOG(m_logger) << "m_borderlines.insert id=" << data.id(); m_borderlines.insert(data.id(), borderline); break; } @@ -105,12 +105,12 @@ void HandlerParticipantBorderline::onBorderlineChanged(const AreaEffectSimulatio bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QLineF &linef) const { - DEBUG_LOG() << "line to check: " << CentralEffectSimulation::debug(linef.p1()) << " - " << CentralEffectSimulation::debug(linef.p2()); + DEBUG_LOG(m_logger) << "line to check: " << CentralEffectSimulation::debug(linef.p1()) << " - " << CentralEffectSimulation::debug(linef.p2()); QPointF a = polygonf.first(); for (const QPointF &b : polygonf) { const QLineF segment(a, b); - DEBUG_LOG() << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b); + DEBUG_LOG(m_logger) << "segment:" << CentralEffectSimulation::debug(a) << " - " << CentralEffectSimulation::debug(b); if (QLineF::BoundedIntersection == linef.intersect(segment, nullptr)) return true; a = b; @@ -122,14 +122,14 @@ bool HandlerParticipantBorderline::intersect(const QPolygonF &polygonf, const QL void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &partPos) { // Bounding Box von der Linie - DEBUG_LOG() << "ParicipantStep " + DEBUG_LOG(m_logger) << "ParicipantStep " << " participantId=" << partPos.participantId() << " participantTypeId=" << partPos.participantTypeId() << " Anzahl Borderlines=" << m_borderlines.size(); for (const BorderlineUtm &borderline : std::as_const(m_borderlines)) { - DEBUG_LOG() << "borderline id = " << borderline.id + DEBUG_LOG(m_logger) << "borderline id = " << borderline.id << ", Box bottomLeft = " << CentralEffectSimulation::debug(borderline.boundingBox.bottomLeft()) << ", topRight = " << CentralEffectSimulation::debug(borderline.boundingBox.topRight()); const QPolygonF utmStepPoly = m_handlerParticipant->getParticipantStep(partPos.participantId(), borderline.zone); @@ -139,7 +139,7 @@ void HandlerParticipantBorderline::onParticipantPositionChanged(const CentralEff // Intersection von Polygon und Line: Polygon = Borderline, Line from last Participant pos to actual participant pos const QLineF utmStep(utmStepPoly[0], utmStepPoly[1]); const bool result = intersect(borderline.points, utmStep); - DEBUG_LOG() << "result intersection = " << result; + DEBUG_LOG(m_logger) << "result intersection = " << result; if (result) { if (borderline.operatorId <= 0) @@ -175,7 +175,7 @@ void HandlerParticipantBorderline::sendParticipantEvent(const BorderlineUtm &bor return; CentralEffectSimulation::ParticipantEvent pe; - DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId() << " lat= " << participantPosition.pos().lat() << " lon= " << participantPosition.pos().lon() << " equipmentNumber=" << equipmentNumber diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_simulated_movement.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_simulated_movement.cpp index 508c66375..ee80a20b7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_simulated_movement.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/handler_simulated_movement.cpp @@ -52,18 +52,18 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb() QVector simMoveVec; if (!m_db->select(simMoveVec)) { - ERROR_LOG() << "Error reading data from database 'CesSimulatedMovement'"; + ERROR_LOG(m_logger) << "Error reading data from database 'CesSimulatedMovement'"; return false; } - DEBUG_LOG() << "loadSimulatedMovementFromDb size =" << simMoveVec.size(); + DEBUG_LOG(m_logger) << "loadSimulatedMovementFromDb size =" << simMoveVec.size(); QVector simMoveSegVec; if (!m_db->select(simMoveSegVec)) { - ERROR_LOG() << "Error reading data from database 'CesSimulatedMovementSegment'"; + ERROR_LOG(m_logger) << "Error reading data from database 'CesSimulatedMovementSegment'"; return false; } - DEBUG_LOG() << "loadSimulatedMovementSegmentsFromDb size =" << simMoveSegVec.size(); + DEBUG_LOG(m_logger) << "loadSimulatedMovementSegmentsFromDb size =" << simMoveSegVec.size(); // add to internal buffer for (const CentralEffectSimulation::Database::CesSimulatedMovement &data : std::as_const(simMoveVec)) @@ -75,7 +75,7 @@ bool HandlerSimulatedMovement::loadSimulatedMovementFromDb() request.participantId(data.participantId); request.repeat(data.repeat); request.nextPoint(data.nextpoint); - DEBUG_LOG() << "Loading SimulatedMovement: " << request; + DEBUG_LOG(m_logger) << "Loading SimulatedMovement: " << request; QMap segDbMap; // QMap to get it sorted for (const CentralEffectSimulation::Database::CesSimulatedMovementSegment &segData : std::as_const(simMoveSegVec)) @@ -115,7 +115,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe if (!m_db->insert(newSimulatedMovement)) return Core::FunctionReplyObject(0, tr_lts("dds", "Error adding 'CesSimulatedMovement' to database")); - DEBUG_LOG() << "newSimulatedMovement.id = " << newSimulatedMovement.id; + DEBUG_LOG(m_logger) << "newSimulatedMovement.id = " << newSimulatedMovement.id; CentralEffectSimulation::Database::CesSimulatedMovementSegment newSegment; newSegment.simulatedMovementId = newSimulatedMovement.id; @@ -134,7 +134,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::insertInDb(const CentralEffe trans.commit(); - DEBUG_LOG() << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id(); + DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id(); return Core::FunctionReplyObject(newSimulatedMovement.id); } // end of insertInDb @@ -143,7 +143,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect CentralEffectSimulation::Database::CesSimulatedMovement newSimulatedMovement(SimulationMovement::toDb(request)); if (!m_db->update(newSimulatedMovement)) return Core::FunctionReplyObject(0, tr_lts("dds", "Error update 'CesSimulatedMovement' to database")); - DEBUG_LOG() << "newSimulatedMovement.id = " << newSimulatedMovement.id; + DEBUG_LOG(m_logger) << "newSimulatedMovement.id = " << newSimulatedMovement.id; // First remove all participant-segments @@ -164,14 +164,14 @@ Core::FunctionReplyObject HandlerSimulatedMovement::updateDb(const CentralEffect ++newSegment.positionIndex; } - DEBUG_LOG() << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id(); + DEBUG_LOG(m_logger) << "newSimulatedMovement.id=" << newSimulatedMovement.id << " request.id=" << request.id(); return Core::FunctionReplyObject(newSimulatedMovement.id); } // end of updateDb Core::FunctionReplyObject HandlerSimulatedMovement::removeFromDb(const int32_t id) { - DEBUG_LOG() << "removeFromDb: id=" << id; + DEBUG_LOG(m_logger) << "removeFromDb: id=" << id; if (!m_db->removeCesSimulatedMovement(id)) return Core::FunctionReplyObject(0, tr_lts("dds", "Error remove 'CesSimulatedMovement' from database")); return Core::FunctionReplyObject(id); @@ -179,7 +179,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeFromDb(const int32_t i void HandlerSimulatedMovement::publishSimulatedMovement(const CentralEffectSimulation::SimulatedMovement &request) { - INFO_LOG() << "publishSimulatedMovement: " << request; + INFO_LOG(m_logger) << "publishSimulatedMovement: " << request; m_ddsHandler->dtsCes()->publish(request); } @@ -189,25 +189,25 @@ void HandlerSimulatedMovement::setParticipantAsSimulated(const int &participantI return; ParticipantManagement::SetAsSimulated req(participantId,isSimulated); if (!m_ddsHandler->ftcPpm()->setAsSimulatedRequest(req, this)) - ERROR_LOG() << "Error modify participant data participantId=" << participantId; + ERROR_LOG(m_logger) << "Error modify participant data participantId=" << participantId; } void HandlerSimulatedMovement::onModifyParticipantDataReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "onModifyParticipantDataReply: " << replyObject(); + WARNING_LOG(m_logger) << "onModifyParticipantDataReply: " << replyObject(); } void HandlerSimulatedMovement::onSetAsSimulatedReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "onSetAsSimulatedReply: " << replyObject(); + WARNING_LOG(m_logger) << "onSetAsSimulatedReply: " << replyObject(); } void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::SimulatedMovement &request) { - DEBUG_LOG() << "onSimulatedMovementModifyRequest: " << request; + DEBUG_LOG(m_logger) << "onSimulatedMovementModifyRequest: " << request; m_jumpToStart = request.jumpToStart(); // we allow a modify with requestId = 0 and participantId != 0 @@ -220,7 +220,7 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core: // New Route if (request.jumpToStart()) { - DEBUG_LOG() << "sm->setJump(true)"; + DEBUG_LOG(m_logger) << "sm->setJump(true)"; sm->setJump(true); } @@ -234,14 +234,14 @@ void HandlerSimulatedMovement::onSimulatedMovementModifyRequest(const rti::core: setParticipantAsSimulated(request.participantId(), true); - DEBUG_LOG() << "simulatedMovementModifyReply id=" << reply.id(); + DEBUG_LOG(m_logger) << "simulatedMovementModifyReply id=" << reply.id(); m_ddsHandler->ftsCes()->simulatedMovementModifyReply(cookie, reply); } // end onSimulatedMovementModifyRequest Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int32_t ddsId) { - DEBUG_LOG() << "removeSimulatedMovement with id " << ddsId << ", " << m_simulationMovements.size(); + DEBUG_LOG(m_logger) << "removeSimulatedMovement with id " << ddsId << ", " << m_simulationMovements.size(); if (ddsId <= 0) return Core::FunctionReplyObject(0, tr_lts("dds", "remove participant simulation ")); @@ -259,7 +259,7 @@ Core::FunctionReplyObject HandlerSimulatedMovement::removeSimulatedMovement(int3 m_simulationMovements.erase(it); } if (participantId == -1) - WARNING_LOG() << "Could not find movement simulation with id " << ddsId << ", " << m_simulationMovements.size(); + WARNING_LOG(m_logger) << "Could not find movement simulation with id " << ddsId << ", " << m_simulationMovements.size(); setParticipantAsSimulated(participantId, false); return reply; @@ -270,7 +270,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core: { Core::FunctionReplyObject reply = removeSimulatedMovement(request.id()); if (reply.error()) - WARNING_LOG() << reply(); + WARNING_LOG(m_logger) << reply(); m_ddsHandler->ftsCes()->simulatedMovementRemoveReply(cookie, reply); } // end onSimulatedMovementRemoveRequest @@ -278,7 +278,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveRequest(const rti::core: void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::SimulatedMovementRemoveByParticipantId &request) { - DEBUG_LOG() << "onSimulatedMovementRemoveByParticipantIdRequest: " << request; + DEBUG_LOG(m_logger) << "onSimulatedMovementRemoveByParticipantIdRequest: " << request; int id = 0; for (const SimulationMovement *simMovement : std::as_const(m_simulationMovements)) @@ -291,7 +291,7 @@ void HandlerSimulatedMovement::onSimulatedMovementRemoveByParticipantIdRequest(c } Core::FunctionReplyObject reply = removeSimulatedMovement(id); if (reply.error()) - WARNING_LOG() << reply(); + WARNING_LOG(m_logger) << reply(); m_ddsHandler->ftsCes()->simulatedMovementRemoveByParticipantIdReply(cookie, reply); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.cpp index 6731b0c62..c9dd8d69e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.cpp @@ -49,7 +49,7 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId) m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesBasicInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesBasicInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -63,7 +63,7 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerParticipantBorderline->init()) { - ERROR_LOG() << "Initialisation HandlerParticipantBorderline failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerParticipantBorderline failed."; return false; } @@ -75,11 +75,11 @@ bool CesBasicInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerSimulatedMovement->init()) { - ERROR_LOG() << "Initialisation m_handlerSimulatedMovement failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerSimulatedMovement failed."; return false; } - INFO_LOG() << "CentralEffectSimulationBasicInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CentralEffectSimulationBasicInterfaceImpl::init() return true"; return true; } @@ -87,8 +87,8 @@ QString CesBasicInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesBasicInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CesBasicInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CesBasicInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CesBasicInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CesBasicInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.h index 322bedd2e..4ea95f815 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/plugin.h @@ -63,6 +63,7 @@ private Q_SLOTS: bool init(int domainId, int exerciseId) override; private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr}; std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/simulation_movement.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/simulation_movement.cpp index ea0e02909..fe7c4fe59 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/simulation_movement.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Basic/simulation_movement.cpp @@ -43,7 +43,7 @@ SimulationMovement::SimulationMovement(const std::shared_ptrstart(10); // Service-Start } } @@ -101,7 +101,7 @@ void SimulationMovement::updateNextPointInDb() { if (m_simMovement.id() <= 0) { - WARNING_LOG() << "Internal error - id not set!"; + WARNING_LOG(m_logger) << "Internal error - id not set!"; return; } CentralEffectSimulation::Database::CesSimulatedMovement dbSim = toDb(m_simMovement); @@ -111,7 +111,7 @@ void SimulationMovement::updateNextPointInDb() void SimulationMovement::startNewSegment() { - DEBUG_LOG() << "simulate participantId = " << m_simMovement.participantId() + DEBUG_LOG(m_logger) << "simulate participantId = " << m_simMovement.participantId() << " m_nextPoint = " << m_simMovement.nextPoint(); m_moveTime = 1; @@ -123,31 +123,31 @@ void SimulationMovement::startNewSegment() if (pos.participantId() == m_simMovement.participantId()) { p1 = CentralEffectSimulation::geographic2Utm(pos.pos(), m_zone); - DEBUG_LOG() << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1); + DEBUG_LOG(m_logger) << "Next segment ParticipantPosition =" << CentralEffectSimulation::debug(p1); } else { if (m_simStart) // Wait for participantPosition { - INFO_LOG() << "Wait for participant position participantId =" << m_simMovement.participantId(); + INFO_LOG(m_logger) << "Wait for participant position participantId =" << m_simMovement.participantId(); m_segTimer->start(1000); return; } if (m_simMovement.nextPoint() > 0) { p1 = m_points.at(m_simMovement.participantId() - 1); - DEBUG_LOG() << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1); + DEBUG_LOG(m_logger) << "nextPoint>0 (" << m_simMovement.nextPoint() << ") ParticipantPosition =" << CentralEffectSimulation::debug(p1); } else { p1 = m_points.at(m_points.size() - 1); - DEBUG_LOG() << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1); + DEBUG_LOG(m_logger) << "nextPoint=" << m_simMovement.nextPoint() << " ParticipantPosition =" << CentralEffectSimulation::debug(p1); } } const QPointF &p2 = m_points.at(m_simMovement.nextPoint()); m_actSegment.setPoints(p1, p2); int curDelay = m_segDelay.at(m_simMovement.nextPoint()); - DEBUG_LOG() << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2) + DEBUG_LOG(m_logger) << "New Segment: p1 = " << CentralEffectSimulation::debug(p1) << " p2=" << CentralEffectSimulation::debug(p2) << " delay =" << curDelay; m_moveTimer->start(curDelay); } @@ -165,7 +165,7 @@ void SimulationMovement::startNewSegment() void SimulationMovement::setJump(bool jump) { - DEBUG_LOG() << "Jump"; + DEBUG_LOG(m_logger) << "Jump"; if (jump) { m_simMovement.nextPoint(1); @@ -175,13 +175,13 @@ void SimulationMovement::setJump(bool jump) m_moveTime = 1; m_simStart = false; publishNewPos(); - DEBUG_LOG() << "Jump done"; + DEBUG_LOG(m_logger) << "Jump done"; } } void SimulationMovement::publishSimulatedMovement() { - DEBUG_LOG() << " m_nextPoint= " << m_simMovement.nextPoint(); + DEBUG_LOG(m_logger) << " m_nextPoint= " << m_simMovement.nextPoint(); m_ddsHandler->dtsCes()->publish(m_simMovement); } @@ -195,7 +195,7 @@ void SimulationMovement::publishNewPos() utmPos.x = m_newPos.x(); utmPos.y = m_newPos.y(); const QPointF posGeo = utmPos.geographic(); - DEBUG_LOG() << "participantPos zone=" << utmPos.zone + DEBUG_LOG(m_logger) << "participantPos zone=" << utmPos.zone << " northp=" << utmPos.northp << " x=" << utmPos.x << " y=" << utmPos.y; @@ -213,10 +213,10 @@ void SimulationMovement::publishNewPos() void SimulationMovement::move() { - DEBUG_LOG() << "move"; + DEBUG_LOG(m_logger) << "move"; if (m_simMovement.nextPoint() < 0) { - DEBUG_LOG() << "move next point < 0"; + DEBUG_LOG(m_logger) << "move next point < 0"; return; } @@ -224,17 +224,17 @@ void SimulationMovement::move() const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(partPos.pos(), m_zone); if (partPos.participantId() != m_simMovement.participantId()) { - DEBUG_LOG() << "move no ParticipantId=" << m_simMovement.participantId(); + DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId(); m_moveTimer->start(1000); return; } if (!partPos.positionValid) { - DEBUG_LOG() << "move no ParticipantId=" << m_simMovement.participantId(); + DEBUG_LOG(m_logger) << "move no ParticipantId=" << m_simMovement.participantId(); m_moveTimer->start(1000); return; } - DEBUG_LOG() << " pos=" << CentralEffectSimulation::debug(participantPosUtm); + DEBUG_LOG(m_logger) << " pos=" << CentralEffectSimulation::debug(participantPosUtm); QLineF step = m_actSegment; if (m_simStart) @@ -242,7 +242,7 @@ void SimulationMovement::move() m_actSegment.setPoints(participantPosUtm, m_points.at(m_simMovement.nextPoint())); step = m_actSegment; - DEBUG_LOG() << "m_simStart set m_actSegment" + DEBUG_LOG(m_logger) << "m_simStart set m_actSegment" << " p1: " << CentralEffectSimulation::debug(m_actSegment.p1()) << " p2: " << CentralEffectSimulation::debug(m_actSegment.p2()); m_simStart = false; @@ -250,7 +250,7 @@ void SimulationMovement::move() if (m_segSpeed[m_simMovement.nextPoint()] <= 0.0) { - DEBUG_LOG() << "move next point < 0"; + DEBUG_LOG(m_logger) << "move next point < 0"; return; } @@ -261,7 +261,7 @@ void SimulationMovement::move() if (step.length() >= m_actSegment.length() + 0.1 || step.length() < 0.1) // 0.1 Magic Number but 10 cm distance to Point is arrived { - DEBUG_LOG() << "move ready step.length()=" << step.length() + DEBUG_LOG(m_logger) << "move ready step.length()=" << step.length() << " m_actSegment.length()=" << m_actSegment.length(); m_simMovement.nextPoint(m_simMovement.nextPoint() + 1); if (m_simMovement.nextPoint() >= m_points.size()) @@ -275,7 +275,7 @@ void SimulationMovement::move() } } updateNextPointInDb(); - DEBUG_LOG() << "ready move participantId = " << m_simMovement.participantId() + DEBUG_LOG(m_logger) << "ready move participantId = " << m_simMovement.participantId() << " m_nextPoint =" << m_simMovement.nextPoint() << " newPos =" << m_newPos.x() << "/" << m_newPos.y() << " m_moveTime=" << m_moveTime @@ -291,7 +291,7 @@ void SimulationMovement::move() return; } m_newPos = step.p2(); - DEBUG_LOG() << "move participantId = " << m_simMovement.participantId() + DEBUG_LOG(m_logger) << "move participantId = " << m_simMovement.participantId() << " m_nextPoint =" << m_simMovement.nextPoint() << " newPos =" << m_newPos.x() << "/" << m_newPos.y() << " m_moveTime=" << m_moveTime diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/ces_building_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/ces_building_model.cpp index f02f04d17..3b2f43829 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/ces_building_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/ces_building_model.cpp @@ -91,14 +91,14 @@ bool BuildingModel::init( ) { m_buildingId = buildingId; - TRACE_LOG() << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId; m_angle = mse.angle() * M_PI / 180.; m_refPosGeo = mse.geoPosition(); m_refPosUtm = LtsCoordTrans::UtmCoordinate::fromGeographic(mse.geoPosition().lon(), mse.geoPosition().lat()); m_refPos = {m_refPosUtm.x, m_refPosUtm.y, m_refPosGeo.z()}; - DEBUG_LOG() << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START, m_buildingId=" << m_buildingId << ", m_angle=" << m_angle << ", m_refPosGeo=" << m_refPosGeo << ", m_refPos=" << m_refPos; @@ -108,7 +108,7 @@ bool BuildingModel::init( m_footprint << QPointF(footprintElement.relPosition().offsetX(), footprintElement.relPosition().offsetY()); if (m_footprint.isEmpty()) { - ERROR_LOG() << "Error reading MainFootprint for building " << m_buildingId; + ERROR_LOG(m_logger) << "Error reading MainFootprint for building " << m_buildingId; return false; } // if m_boundingRect = m_footprint.boundingRect(); @@ -117,7 +117,7 @@ bool BuildingModel::init( // QByteArray array = qUncompress(QByteArray::fromRawData(reinterpret_cast(&data[0]), data.size())); if (!BuildingControlUnit::VWM::XmlReader::readBuilding(vmd, *this)) { - ERROR_LOG() << "Error reading VulnerabilityModelData for building " << m_buildingId; + ERROR_LOG(m_logger) << "Error reading VulnerabilityModelData for building " << m_buildingId; return false; } // if @@ -130,7 +130,7 @@ bool BuildingModel::init( if (point.z() > m_height) m_height = point.z(); - TRACE_LOG() << Q_FUNC_INFO << " END, m_buildingId=" << m_buildingId; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, m_buildingId=" << m_buildingId; return true; } @@ -141,7 +141,7 @@ bool BuildingModel::init( bool BuildingModel::hasIntersectionSimplified(const LtsUtils::QPoint3D &start, const LtsUtils::QPoint3D &end) const { - DEBUG_LOG() << Q_FUNC_INFO << " m_buildingId=" << m_buildingId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_buildingId=" << m_buildingId << ", start=" << start << ", end=" << end; // keep origin of QRect (topLeft) in mind: @@ -230,7 +230,7 @@ bool BuildingModel::hasIntersection(const LtsUtils::QPoint3D &start, const LtsUt bool bHasIntersection = BuildingControlUnit::VWM::Math::hasIntersection(start, end, rooms()); - DEBUG_LOG() << Q_FUNC_INFO << " m_buildingId=" << m_buildingId + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " m_buildingId=" << m_buildingId << ", start=" << start << ", end=" << end << ", rooms().size()" << rooms().size() << ", bHasIntersection=" << bHasIntersection; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_aes_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_aes_data.cpp index c490119e0..0c4831b2d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_aes_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_aes_data.cpp @@ -91,7 +91,7 @@ bool HandlerAesData::init() void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &data, DataModification modType) { - DEBUG_LOG() << "onBoobyTrapChanged" + DEBUG_LOG(m_logger) << "onBoobyTrapChanged" << " id=" << data.id() << " impactPosition=" << data.impactPosition() << " impactRadius=" << data.impactRadius() @@ -105,7 +105,7 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d if (!data.triggered()) return; - INFO_LOG() << "HandlerParticipantBoobyTrap::onBoobyTrapChanged" + INFO_LOG(m_logger) << "HandlerParticipantBoobyTrap::onBoobyTrapChanged" << " data.id=" << data.id() << " effectStateId=" << data.effectStateId(); @@ -114,7 +114,7 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d if ((m_ddsHandler->currentPartitionTime() - (data.effectStart().get() + data.effectDuration())) > 2000) { - INFO_LOG() << "onBoobyTrap outdated"; + INFO_LOG(m_logger) << "onBoobyTrap outdated"; return; } AreaEffectSimulation::AesItemView itemView; @@ -131,16 +131,16 @@ void HandlerAesData::onBoobyTrapChanged(const AreaEffectSimulation::BoobyTrap &d void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType) { - DEBUG_LOG() << "onAesItemViewChanged" + DEBUG_LOG(m_logger) << "onAesItemViewChanged" << " data.aesTypeId()=" << data.aesTypeId(); if (modType != DataModification::eAdded && modType != DataModification::eModified) return; - DEBUG_LOG() << "Got AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId(); if (data.effectStateId() == AreaEffectSimulation::AesEffectState::EsExpired) { - INFO_LOG() << "AesEffectState_def::EsExpired" + INFO_LOG(m_logger) << "AesEffectState_def::EsExpired" << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() << " effectStart=" << data.effectStart() << " diff = " << m_ddsHandler->currentPartitionTime() - data.effectStart() ; @@ -153,61 +153,61 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtOffRouteMineSecondary) { - DEBUG_LOG() << "AtOffRouteMineSecondary id=" << data.id() / 1000; + DEBUG_LOG(m_logger) << "AtOffRouteMineSecondary id=" << data.id() / 1000; auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int)(data.id() / 1000)); if (!offRouteMine.effectStart().is_set()) { - DEBUG_LOG() << "!offRouteMine.effectStart().is_set()"; + DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()"; return; } - DEBUG_LOG() << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() + DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() << " effectStart=" << offRouteMine.effectStart() << " effectDuration=" << offRouteMine.effectDuration() << " diff = " << m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart().get() + offRouteMine.effectDuration()) ; if ((m_ddsHandler->currentPartitionTime() - (offRouteMine.effectStart().get() + offRouteMine.effectDuration())) < 2000) { - DEBUG_LOG() << "AtBoobyTrapSecondary Mine wird ausgeloeset."; + DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset."; checkBuildingsHit(data); } else { - DEBUG_LOG() << "outdated return"; + DEBUG_LOG(m_logger) << "outdated return"; return; } } if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBoobyTrapSecondary) { - DEBUG_LOG() << "AtBoobyTrapSecondary id=" << data.id() / 1000; + DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary id=" << data.id() / 1000; //auto offRouteMine = m_ddsHandler->dtcAes()->offRouteMine((int) (data.id() / 1000)); auto boobyTrap = m_ddsHandler->dtcAes()->boobyTrap((int)(data.id() / 1000)); if (!boobyTrap.effectStart().is_set()) { - DEBUG_LOG() << "!offRouteMine.effectStart().is_set()"; + DEBUG_LOG(m_logger) << "!offRouteMine.effectStart().is_set()"; return; } - DEBUG_LOG() << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() + DEBUG_LOG(m_logger) << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() << " effectStart=" << boobyTrap.effectStart() << " effectDuration=" << boobyTrap.effectDuration() << " diff = " << m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart().get() + boobyTrap.effectDuration()) ; if ((m_ddsHandler->currentPartitionTime() - (boobyTrap.effectStart().get() + boobyTrap.effectDuration())) < 2000) { - DEBUG_LOG() << "AtBoobyTrapSecondary Mine wird ausgeloeset."; + DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary Mine wird ausgeloeset."; checkBuildingsHit(data); } else { - DEBUG_LOG() << "outdated return"; + DEBUG_LOG(m_logger) << "outdated return"; return; } } - DEBUG_LOG() << "removeStates data"; + DEBUG_LOG(m_logger) << "removeStates data"; removeStates(data); - DEBUG_LOG() << "m_aesItemViewsUtm remove id" << data.aesItemId(); + DEBUG_LOG(m_logger) << "m_aesItemViewsUtm remove id" << data.aesItemId(); m_aesItemViewsUtm.remove(data.aesItemId()); } } @@ -217,7 +217,7 @@ void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data) { if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea) return; - DEBUG_LOG() << "Remove aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId(); // remove State for each building for (CentralEffectSimulation::BitfieldStates &bfs : m_bitfieldStatesBld) bfs.remove(data.aesItemId()); @@ -228,7 +228,7 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char const int id) { const double impactRadius = m_ddsHandler->chargeTypeRadius(chargeStruct); - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)" + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)" << ", m_handlerBuildingData.getFootprints().size =" << m_handlerBuildingData->getFootprints().size(); QHash footprints = m_handlerBuildingData->getFootprints(); @@ -241,7 +241,7 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char const Core::GeoPosition2D impactPosition2D(impactPosition.lon(), impactPosition.lat()); if (inFootprint(impactPosition, footprint, impactRadius)) { - DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId + DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " chargeTypeId = " << chargeStruct.chargeTypeId() << " id = " << id << " currentPartitionTime = " << m_ddsHandler->currentPartitionTime() @@ -260,9 +260,9 @@ void HandlerAesData::calculateBuildingExplosion(const AreaEffectSimulation::Char m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this); } else - DEBUG_LOG() << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; - DEBUG_LOG() << "boundingBoxImpact.contains(footprint)"; + DEBUG_LOG(m_logger) << "boundingBoxImpact.contains(footprint)"; } // for @@ -275,7 +275,7 @@ void HandlerAesData::startTimer(int id, int msec) { // Timeout-Slot mit echtem SLOT connect(timer, &QTimer::timeout, this, &HandlerAesData::onStartTimeReached); timer->start(msec); - DEBUG_LOG() << "Timer " << id << " gestartet fuer " << msec << " ms."; + DEBUG_LOG(m_logger) << "Timer " << id << " gestartet fuer " << msec << " ms."; } void HandlerAesData::onStartTimeReached() @@ -288,7 +288,7 @@ void HandlerAesData::onStartTimeReached() if (!bOk) return; - DEBUG_LOG() << "Timer " << chargeEffectId << " ausgeloest!"; + DEBUG_LOG(m_logger) << "Timer " << chargeEffectId << " ausgeloest!"; // Timer stoppen und loeschen AreaEffectSimulation::ChargeEffect data = m_chargeEffects.value(chargeEffectId); @@ -300,12 +300,12 @@ void HandlerAesData::onStartTimeReached() void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEffect &data, DataModification modType) { - DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged"; + DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged"; if (modType == DataModification::eRemoved) return; const long long effectStart = data.effectStart(); - DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged" + DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged" << ", effectStart=" << effectStart << ", currentPartitionTime=" << m_ddsHandler->currentPartitionTime(); @@ -313,14 +313,14 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff // Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden if ( effectStart < m_ddsHandler->currentPartitionTime() - TIMEDIFFVALID ) { - DEBUG_LOG() << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden"; + DEBUG_LOG(m_logger) << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden"; return; } // Startzeit entspricht der aktuellen Zeit if ( effectStart > m_ddsHandler->currentPartitionTime() - TIMEDIFFVALID && effectStart < m_ddsHandler->currentPartitionTime() + data.effectDuration() ) { - DEBUG_LOG() << "Startzeit entspricht der aktuellen Zeit"; + DEBUG_LOG(m_logger) << "Startzeit entspricht der aktuellen Zeit"; AreaEffectSimulation::ChargeStruct chargeStruct; chargeStruct.chargeTypeId(data.chargeTypeId()); chargeStruct.igniterTypeId(data.igniterTypeId()); @@ -330,13 +330,13 @@ void HandlerAesData::onChargeEffectChanged(const AreaEffectSimulation::ChargeEff else if (effectStart > m_ddsHandler->currentPartitionTime() + data.effectDuration()) { // Start mit Timer - DEBUG_LOG() << "Startzeit in der Zukunft" + DEBUG_LOG(m_logger) << "Startzeit in der Zukunft" << ", id :" << data.id() << ", duration=" << effectStart - m_ddsHandler->currentPartitionTime(); m_chargeEffects.insert(data.id(), data); startTimer(data.id(), effectStart - m_ddsHandler->currentPartitionTime()); } - DEBUG_LOG() << "END onChargeEffectChanged"; + DEBUG_LOG(m_logger) << "END onChargeEffectChanged"; } @@ -352,7 +352,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove SingleExplosion"; + DEBUG_LOG(m_logger) << "Remove SingleExplosion"; m_explosionSingleState.remove(data.id()); return; } @@ -361,12 +361,12 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) && data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated) { - DEBUG_LOG() << "Handle SingleExplosion"; + DEBUG_LOG(m_logger) << "Handle SingleExplosion"; handleExplosion = true; } m_explosionSingleState.insert(data.id(), data.effectStateId()); - DEBUG_LOG() << "Got ExplosionSingle"; + DEBUG_LOG(m_logger) << "Got ExplosionSingle"; if (handleExplosion) { calculateBuildingExplosion(data.chargeStruct(), data.impactPosition(), data.id()); @@ -375,7 +375,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos void HandlerAesData::onAirSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType) { - DEBUG_LOG() << "Got onAirSupportImpactChanged()"; + DEBUG_LOG(m_logger) << "Got onAirSupportImpactChanged()"; AreaEffectSimulation::ExplosionSingle esData; esData.id(data.id()); esData.chargeStruct().chargeTypeId(data.chargeStruct().chargeTypeId()); @@ -390,20 +390,20 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg modType != DataModification::eModified) return; - DEBUG_LOG() << "Got TriggeredImpacts"; + DEBUG_LOG(m_logger) << "Got TriggeredImpacts"; preCalculateImpacts(data); } void HandlerAesData::onEffectsChanged(const AreaEffectSimulation::Effects &effects, DataModification modType) { - TRACE_LOG() << " Got Effects " << effects; + TRACE_LOG(m_logger) << " Got Effects " << effects; if (modType == DataModification::eRemoved) return; if (effects.aesTypeId().underlying() != AreaEffectSimulation::AesType_def::AtExplosionClusterSingleExplosions) return; - DEBUG_LOG() << " Got typechecked effects " << effects; + DEBUG_LOG(m_logger) << " Got typechecked effects " << effects; // calculate for every building of our exercise: const QHash &footprints = m_handlerBuildingData->getFootprints(); @@ -451,9 +451,9 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition, // if (m_logger.isDebugEnabled()) // { // const QPointF utmBuilding(CentralEffectSimulation::geographic2Utm(footPrint.geoPosition, footPrint.zone)); - // DEBUG_LOG() << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); + // DEBUG_LOG(m_logger) << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); // for (int i = 0; i < footPrint.polyUtm.length(); i++) - // DEBUG_LOG() << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); + // DEBUG_LOG(m_logger) << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); // } // Check, if hit direct on building @@ -472,7 +472,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm { if (data.id() <= 0) return; - DEBUG_LOG() << "preCalculateImpacts"; + DEBUG_LOG(m_logger) << "preCalculateImpacts"; // Find AES ItemView and set Bounding-Box of Aes-Field const int aesItemId = data.aesItemId(); @@ -485,7 +485,7 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm if (!dtcAes->aesItemViewFromEntityId(aesItemId, data.aesTypeId(), aesItemView)) { static long msgCnt = 0; - WARNING_LOG() << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available" + WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available" << " (cnt=" << ++msgCnt << ")"; return; } @@ -504,39 +504,39 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm void HandlerAesData::onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send hit on building to building service: " << replyObject() + WARNING_LOG(m_logger) << "Can not send hit on building to building service: " << replyObject() << ", m_handlerBuildingData.getFootprints().size()" << m_handlerBuildingData->getFootprints().size(); else - DEBUG_LOG() << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } void HandlerAesData::onSendCesHit3DonBuildingReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "m_handlerBuildingData.getFootprints() size " << m_handlerBuildingData->getFootprints().size(); + DEBUG_LOG(m_logger) << "m_handlerBuildingData.getFootprints() size " << m_handlerBuildingData->getFootprints().size(); if (replyObject.error()) - WARNING_LOG() << "Can not send hit3D on building to building service: " << replyObject() + WARNING_LOG(m_logger) << "Can not send hit3D on building to building service: " << replyObject() << ", m_handlerBuildingData.getFootprints().size()" << m_handlerBuildingData->getFootprints().size(); else - DEBUG_LOG() << "onSendCesHit3DonBuildingReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSendCesHit3DonBuildingReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - WARNING_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); + WARNING_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); else - DEBUG_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " successful"; + DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " successful"; } void HandlerAesData::onSetBuildingStatesReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - WARNING_LOG() << "onSetBuildingStatesReply for id " << reply.id() << " failed: " << reply.str(); + WARNING_LOG(m_logger) << "onSetBuildingStatesReply for id " << reply.id() << " failed: " << reply.str(); else - DEBUG_LOG() << "onSetBuildingStatesReply for id " << reply.id() << " successful"; + DEBUG_LOG(m_logger) << "onSetBuildingStatesReply for id " << reply.id() << " successful"; } // calculate impacts for one building @@ -560,26 +560,26 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac { bIsExplosionCluster = true; ignFuncBase = igniterFunctionBaseExplosionCluster(aesItemId); // assume that fuseType does not differ within a single ExplosionArea - DEBUG_LOG() << "Calculate, bIsExplosionCluster = " << bIsExplosionCluster + DEBUG_LOG(m_logger) << "Calculate, bIsExplosionCluster = " << bIsExplosionCluster << ", ignFuncBase = " << ignFuncBase; } else if (s_relevantTypes.contains(data.aesTypeId().underlying())) - DEBUG_LOG() << "Calculate"; + DEBUG_LOG(m_logger) << "Calculate"; else { - DEBUG_LOG() << "No Calculation"; + DEBUG_LOG(m_logger) << "No Calculation"; return; } if (aesItemId != aesItemView.aesItemId()) { - WARNING_LOG() << "mismatch: " + WARNING_LOG(m_logger) << "mismatch: " << ", TriggeredExplosions.aesItemId=" << data.aesItemId() << ", AesItemView.aesItemId=" << aesItemView.aesItemId(); return; } - DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " aesItemId " << aesItemId + DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " aesItemId " << aesItemId << ", bIsExplosionCluster = " << bIsExplosionCluster; // get position(s) of impact(s): @@ -587,7 +587,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac CentralEffectSimulation::BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId]; QSet &bitfieldState = bitfieldStates[aesItemId]; for (int i : std::as_const(bitfieldState)) - DEBUG_LOG() << "bitfieldState for " << aesItemId << ": " << i; + DEBUG_LOG(m_logger) << "bitfieldState for " << aesItemId << ": " << i; for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx) { @@ -600,7 +600,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac continue; const Core::GeoPosition &impactPosition = aesItemView.form()[bitFieldIdx]; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon() << " z=" << impactPosition.z() << " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition)); @@ -609,13 +609,13 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeStruct()); if (inFootprint(impactPosition, footprint, impactRadius)) { - DEBUG_LOG() << "In Footprint of mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "In Footprint of mseId = " << footprint.mseId; if (!bitfieldState.contains(bitFieldIdx)) { - DEBUG_LOG() << "m_bitfieldStates.insert(aesItemId=" << aesItemId << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; + DEBUG_LOG(m_logger) << "m_bitfieldStates.insert(aesItemId=" << aesItemId << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; bitfieldState.insert(bitFieldIdx); - DEBUG_LOG() << "sendCesHit mseId = " << footprint.mseId + DEBUG_LOG(m_logger) << "sendCesHit mseId = " << footprint.mseId << ", aesItemId=" << aesItemId << ", bitFieldIdx= " << bitFieldIdx << ", ignFuncBase = " << ignFuncBase; @@ -656,7 +656,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac detonationDistance, QStringLiteral("properties").toStdString()); - DEBUG_LOG() << "sendCesHit3DonBuildingRequest for aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "sendCesHit3DonBuildingRequest for aesItemId=" << aesItemId << " bitFieldIdx= " << bitFieldIdx << ", requestBld= " << requestBld; @@ -675,7 +675,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac Core::GeoPosition(impactPosition.lon(), impactPosition.lat(), 0.0), QStringLiteral("properties").toStdString()); - DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId << " bitFieldIdx= " << bitFieldIdx << ", impactPosition= " << impactPosition; @@ -684,7 +684,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac } else - DEBUG_LOG() << "NOT in Footprint of mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "NOT in Footprint of mseId = " << footprint.mseId; // if (inFootprint(impactPosition } // foreach Impact } // for (int32_t bitFieldId @@ -696,7 +696,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec return; const int aesItemId = effects.aesItemId(); - DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << aesItemId; + DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << aesItemId; const AreaEffectSimulation::ExplosionCluster &ec = m_ddsHandler->dtcAes()->explosionCluster(effects.aesItemId()); if (ec.id() != aesItemId) @@ -741,19 +741,19 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec QString mseIdAsStr; for (auto mseId : buildingIdsInBetween) mseIdAsStr += QString(QStringLiteral("_coveredByMseId_%1;")).arg(mseId); - DEBUG_LOG() << "findBuildingsBetween returns mseIdAsStr =" << mseIdAsStr; + DEBUG_LOG(m_logger) << "findBuildingsBetween returns mseIdAsStr =" << mseIdAsStr; const ProjectDataManagement::BuildingChargeEffect &bldgChargeEffect = m_ddsHandler->dtcPdm()->getBuildingChargeEffectByChargeTypeId(ec.chargeStruct().chargeTypeId()); if (bldgChargeEffect.id() <= 0) - ERROR_LOG() << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct().chargeTypeId(); + ERROR_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, chargeTypeId not found: =" << ec.chargeStruct().chargeTypeId(); qint32 destructiveFactor = bldgChargeEffect.destructiveFactor(); qint32 penetrationFactor = bldgChargeEffect.penetrationFactor(); if ((destructiveFactor <= 0) || (penetrationFactor <= 0)) - WARNING_LOG() << "getBuildingChargeEffectByChargeTypeId failed, destructiveFactor or penetrationFactor invalid" + WARNING_LOG(m_logger) << "getBuildingChargeEffectByChargeTypeId failed, destructiveFactor or penetrationFactor invalid" << ", destructiveFactor = " << destructiveFactor << ", penetrationFactor = " << penetrationFactor; @@ -784,7 +784,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec Core::GeoPosition(impactPositionGeo.lon(), impactPositionGeo.lat(), 0.0), properties.toStdString()); - DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << aesItemId << " bitFieldIdx= " << indexBitFieldIdx << ", impactPositionGeo= " << impactPositionGeo << ", chargeTypeId= " << ec.chargeStruct().chargeTypeId() @@ -831,7 +831,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::Effects &effec detonationDistance, properties.toStdString()); - DEBUG_LOG() << "SendCesHit3DonBuildingRequest for aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "SendCesHit3DonBuildingRequest for aesItemId=" << aesItemId << " bitFieldIdx= " << indexBitFieldIdx << ", impactPosition= " << impactPositionGeo << ", zPlacement= " << zPlacement @@ -851,9 +851,9 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView & const int exerciseId = m_ddsHandler->getExerciseId(); QPolygonF polyGeo; - DEBUG_LOG() << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "checkBuildingsHit " << ", aesItemId=" << data.aesItemId(); - DEBUG_LOG() << "AtBoobyTrapSecondary data.form().size()=" << data.form().size(); + DEBUG_LOG(m_logger) << "AtBoobyTrapSecondary data.form().size()=" << data.form().size(); // BoobyTrap polyGeo.reserve(data.form().size()); for (const auto &pointGeo : std::as_const(data.form())) @@ -861,7 +861,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView & QPointF point; point.setX(pointGeo.lon()); point.setY(pointGeo.lat()); - DEBUG_LOG() << "point= " << point.x() << "/" << point.y(); + DEBUG_LOG(m_logger) << "point= " << point.x() << "/" << point.y(); polyGeo.append(point); } @@ -869,13 +869,13 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView & bool isGroundLevel = true; const QVector &buildingIdsInside = m_ddsHandler->dtcIsm()->getBuildingByPolygon(exerciseId, polyGeo, completeEnclosed, isGroundLevel); - DEBUG_LOG() << "buildingsInside.size=" << buildingIdsInside.size() + DEBUG_LOG(m_logger) << "buildingsInside.size=" << buildingIdsInside.size() << " exerciseId=" << exerciseId; // only include buildings within the radius for (const int buildingId : std::as_const(buildingIdsInside)) { - DEBUG_LOG() << " BuildingId=" << buildingId; + DEBUG_LOG(m_logger) << " BuildingId=" << buildingId; Buildings::Building tmpBldg; tmpBldg.buildingId(buildingId); @@ -898,7 +898,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView & QPointF pointGeo = impactPosPoint.geographic(); impactPosition.lon(pointGeo.x()); impactPosition.lat(pointGeo.y()); - DEBUG_LOG() << "impactPosition lon/lat=" << impactPosition.lon() << "/" << impactPosition.lat() + DEBUG_LOG(m_logger) << "impactPosition lon/lat=" << impactPosition.lon() << "/" << impactPosition.lat() << " impactPosPoint.zone" << impactPosPoint.zone << " impactPosPoint=" << impactPosPoint.x << "/" << impactPosPoint.y << " topRight=" << topRight.x << "/" << topRight.y @@ -916,7 +916,7 @@ void HandlerAesData::checkBuildingsHit(const AreaEffectSimulation::AesItemView & QStringLiteral("properties").toStdString()); - DEBUG_LOG() << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId() + DEBUG_LOG(m_logger) << "sendCesHitOnBuildingRequest for aesItemId=" << data.aesItemId() << ", impactPosition= " << impactPosition; m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this); } @@ -934,7 +934,7 @@ QVector HandlerAesData::findBuildingsBetween(const LtsCoordTrans::LtsCoordi const LtsCoordTrans::LtsCoordinate targetFootprintPos = LtsCoordTrans::LtsCoordinate::fromUtm(targetFootprint.polyUtm.first(), targetFootprint.zone, 0.0); - DEBUG_LOG() << "findBuildingsBetween" << " START impactPosition " << impactPositionUTM.mgrs() + DEBUG_LOG(m_logger) << "findBuildingsBetween" << " START impactPosition " << impactPositionUTM.mgrs() << ", maybe effected mseId is = " << targetFootprint.mseId << " with targetFootprintPos = " << targetFootprintPos.utmCoordinate().mgrs(); @@ -976,14 +976,14 @@ QVector HandlerAesData::findBuildingsBetween(const LtsCoordTrans::LtsCoordi const bool intersects = impactToFootprintLineMetric.intersects(footprintToCheck.polyUtm); #endif - DEBUG_LOG() << "findBuildingsBetween" + DEBUG_LOG(m_logger) << "findBuildingsBetween" << " to mseId " << footprintToCheck.mseId << " with curFpTargetPos " << impactPosition.utmCoordinate().mgrs() << " -> intersects = " << intersects; if (intersects) { - DEBUG_LOG() << "findBuildingsBetween" + DEBUG_LOG(m_logger) << "findBuildingsBetween" << " regarding impactPosition " << impactPositionUTM.mgrs() << " and mseId " << targetFootprint.mseId << " is concealed/covered by footpriont of mseId = " << footprintToCheck.mseId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_building_model.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_building_model.cpp index 0392cd23f..4bce41b92 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_building_model.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_building_model.cpp @@ -52,19 +52,19 @@ HandlerBuildingModel::HandlerBuildingModel( , m_aesDataHandler(aesDataHandler) , m_logger(CentralEffectSimulation::getLogger("Plugin.Buildings.HandlerBuildingModel")) { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } HandlerBuildingModel::~HandlerBuildingModel() { - TRACE_LOG() << Q_FUNC_INFO << " START"; - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; } bool HandlerBuildingModel::init() { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; std::shared_ptr dtcIsm = m_ddsHandler->dtcIsm(); dtcIsm->waitForHistoricalDataMainStructureElement(1000); @@ -77,16 +77,16 @@ bool HandlerBuildingModel::init() onMainStructureElementChanged(data, DataModification::eAdded); }); - INFO_LOG() << "HandlerBuildingModel is running." + INFO_LOG(m_logger) << "HandlerBuildingModel is running." << ", m_buildingModels.size() = " << m_buildingModels.size(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return true; } HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingModel::getLineBuildingIntersection( const std::vector &line, const std::string &requestIdOpt) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest; newRequest.line(line); @@ -105,13 +105,13 @@ HandlerBuildingModelInterface::LineBuildingIntersectionResult HandlerBuildingMod result.errorParams = reply.errorParams(); result.intersection = reply.intersection(); - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return result; } HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel::getLineBuildingIntersects(const std::vector &line, const std::string &requestIdOpt) { - TRACE_LOG() << Q_FUNC_INFO << " START"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " START"; CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest; newRequest.line(line); @@ -130,7 +130,7 @@ HandlerBuildingModelInterface::LineBuildingIntersectsResult HandlerBuildingModel result.errorParams = reply.errorParams(); result.intersects = ! std::isnan(reply.intersection().lat()); // ! std::isnan - TRACE_LOG() << Q_FUNC_INFO << " END"; + TRACE_LOG(m_logger) << Q_FUNC_INFO << " END"; return result; } @@ -138,7 +138,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan { const int mseBldgId = data.id(); - TRACE_LOG() << "MainStructureElement === " << data; + TRACE_LOG(m_logger) << "MainStructureElement === " << data; // Always delete m_buildingModels-entry BuildingModel *buildingModelPtr = m_buildingModels.value((mseBldgId)); @@ -147,7 +147,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "Building not added or modified id=" << mseBldgId; + DEBUG_LOG(m_logger) << "Building not added or modified id=" << mseBldgId; return; } @@ -163,7 +163,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan const Core::GeoPosition &geoPos = data.geoPosition(); if (qFuzzyIsNull(geoPos.z())) { - INFO_LOG() << "BuildingId " << mseBldgId + INFO_LOG(m_logger) << "BuildingId " << mseBldgId << " kann Ăźbersprungen werden, da von Hand importiert." << ", name: '" << data.name() << "'" << ", name: '" << data.description() << "'"; @@ -175,17 +175,17 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan const int exerciseId = m_ddsHandler->getExerciseId(); if (m_ddsHandler->dtcIsm()->isElementAssignedToExercise(data, exerciseId)) { - DEBUG_LOG() << "BuildingId " << mseBldgId + DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId << ", in Exercise"; } else { - DEBUG_LOG() << "BuildingId " << mseBldgId + DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId << ", not in Exercise"; return; } - DEBUG_LOG() << "HandlerBuildingData::onMainStructureElementChanged() id=" << mseBldgId + DEBUG_LOG(m_logger) << "HandlerBuildingData::onMainStructureElementChanged() id=" << mseBldgId << " properties=" << data.properties(); @@ -195,7 +195,7 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan // InfrastructureManagement::VulnerabilityModelData vulnerabilityModelDataEle; QByteArray vulnerabilityModelData = m_ddsHandler->dtcIsm()->getVulnerabilityModelData(data.id()); - TRACE_LOG() << "vulnerabilityModelData=" << vulnerabilityModelData + TRACE_LOG(m_logger) << "vulnerabilityModelData=" << vulnerabilityModelData << " id=" << data.id(); @@ -211,27 +211,27 @@ void HandlerBuildingModel::onMainStructureElementChanged(const InfrastructureMan // } // for // if (id == -1) // { -// WARNING_LOG() << "Missing VulnerabilityModelData for building " << mseBldgId << ". Skip building."; +// WARNING_LOG(m_logger) << "Missing VulnerabilityModelData for building " << mseBldgId << ". Skip building."; // return; // } // if const InfrastructureManagement::MainFootprint &mainFootprint = m_ddsHandler->dtcIsm()->getFootprintsByExerciseId(exerciseId).value(mseBldgId); - DEBUG_LOG() << "BuildingId " << mseBldgId; + DEBUG_LOG(m_logger) << "BuildingId " << mseBldgId; BuildingModel *buildingModel = new BuildingModel(this); const InfrastructureManagement::MainStructureElement &mse = data; if (!buildingModel->init(mainFootprint, mse, vulnerabilityModelData, mseBldgId)) { - WARNING_LOG() << "Initializing BuildingModel failed for building " << mseBldgId << ". Skipping building."; + WARNING_LOG(m_logger) << "Initializing BuildingModel failed for building " << mseBldgId << ". Skipping building."; return; } // if - INFO_LOG() << "Inserting BuildingModel for building " << mseBldgId; + INFO_LOG(m_logger) << "Inserting BuildingModel for building " << mseBldgId; m_buildingModels.insert(mseBldgId, buildingModel); - INFO_LOG() << "onMainStructureElementChanged: " + INFO_LOG(m_logger) << "onMainStructureElementChanged: " << ", m_buildingModels.size() = " << m_buildingModels.size(); } @@ -245,7 +245,7 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core: const CentralEffectSimulation::GetLineBuildingIntersectionRequest &request) { const int exerciseId = m_ddsHandler->getExerciseId(); - DEBUG_LOG() << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"; + DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectionRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"; const bool justForLineOfSight = false; const CentralEffectSimulation::GetLineBuildingIntersectionReply &reply = getLineBuildingIntersectionInternal(request, justForLineOfSight); @@ -253,14 +253,14 @@ void HandlerBuildingModel::onGetLineBuildingIntersectionRequest(const rti::core: // sendReply m_ddsHandler->ftsCes()->getLineBuildingIntersectionReply(cookie, reply); - DEBUG_LOG() << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId() << "'"; + DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectionRequest, request '" << request.requestId() << "'"; } void HandlerBuildingModel::onGetLineBuildingIntersectsRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::GetLineBuildingIntersectsRequest &request) { const int exerciseId = m_ddsHandler->getExerciseId(); - DEBUG_LOG() << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"; + DEBUG_LOG(m_logger) << "START onGetLineBuildingIntersectsRequest" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'"; CentralEffectSimulation::GetLineBuildingIntersectionRequest newRequest; @@ -280,7 +280,7 @@ void HandlerBuildingModel::onGetLineBuildingIntersectsRequest(const rti::core::S m_ddsHandler->ftsCes()->getLineBuildingIntersectsReply(cookie, newReply); - DEBUG_LOG() << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId() << "'"; + DEBUG_LOG(m_logger) << "END onGetLineBuildingIntersectsRequest, request '" << request.requestId() << "'"; } @@ -301,7 +301,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: const int exerciseId = m_ddsHandler->getExerciseId(); - DEBUG_LOG() << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'" + DEBUG_LOG(m_logger) << "START getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'" << ", request.line().size() = " << request.line().size(); CentralEffectSimulation::GetLineBuildingIntersectionReply reply; @@ -315,7 +315,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: if (polylineRef.size() < 2) { reply.errorString("insufficiant number of points"); - WARNING_LOG() << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'" + WARNING_LOG(m_logger) << "getLineBuildingIntersectionInternal" << ", exerciseId = " << exerciseId << ", request '" << request.requestId() << "'" << ", error: '" << reply.errorString() << "'"; return reply; } @@ -332,9 +332,9 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: if (m_logger.isDebugEnabled()) { - DEBUG_LOG() << "relevantBuildings.size=" << relevantBuildings.size(); + DEBUG_LOG(m_logger) << "relevantBuildings.size=" << relevantBuildings.size(); for (const int bldgId : std::as_const(relevantBuildings)) - DEBUG_LOG() << "relevantBuilding: bldgId = " << bldgId; + DEBUG_LOG(m_logger) << "relevantBuilding: bldgId = " << bldgId; } @@ -364,7 +364,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: const Core::GeoPosition &segStart = polylineRef[lineSegmentIdx]; const Core::GeoPosition &segEnd = polylineRef[lineSegmentIdx + 1]; - DEBUG_LOG() << " lineSegmentIdx=" << lineSegmentIdx + DEBUG_LOG(m_logger) << " lineSegmentIdx=" << lineSegmentIdx << ", start=" << segStart << " , end=" << segEnd; @@ -375,11 +375,11 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: BuildingModel *buildingModel = m_buildingModels.value(bldgId, nullptr); if (!buildingModel) { - WARNING_LOG() << " buildingModel not found, bldgId=" << bldgId; + WARNING_LOG(m_logger) << " buildingModel not found, bldgId=" << bldgId; continue; } - DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << " , HEIGHT = " << buildingModel-> height(); @@ -391,7 +391,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: // if buildingState is not found, assume intact: if (/*(buildingState.id() == bldgId) && */(buildingState.damagePercent() >= 80)) { - WARNING_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + WARNING_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << ", lineSegmentIdx=" << lineSegmentIdx << ", damagePercent > 80% (" << buildingState.damagePercent() << ")"; continue; @@ -436,29 +436,29 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: const LtsUtils::QPoint3D &relStart = buildingModel->fromGeographic(segStart); // lift / lift_zValueToIfNegative const LtsUtils::QPoint3D &relEnd = buildingModel->fromGeographic(segEnd); // lift / lift_zValueToIfNegative - DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << ", lineSegmentIdx=" << lineSegmentIdx; - DEBUG_LOG() << " segStart=" << segStart << " relStart=" << relStart; - DEBUG_LOG() << " segEnd =" << segEnd << " relEnd=" << relEnd; + DEBUG_LOG(m_logger) << " segStart=" << segStart << " relStart=" << relStart; + DEBUG_LOG(m_logger) << " segEnd =" << segEnd << " relEnd=" << relEnd; if (!buildingModel->hasIntersectionSimplified(relStart, relEnd)) // check height and footprint continue; - DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << ", lineSegmentIdx=" << lineSegmentIdx << ", hasIntersectionSimplified was true"; const Core::GeoPosition &intersection = buildingModel->intersection(relStart, relEnd); // assume intersection and calculate - DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << ", lineSegmentIdx=" << lineSegmentIdx << ", intersection = " << intersection; if (!BuildingModel::isValid(intersection)) // no intersection continue; - DEBUG_LOG() << " buildingModel->buildingId=" << buildingModel->buildingId() + DEBUG_LOG(m_logger) << " buildingModel->buildingId=" << buildingModel->buildingId() << ", lineSegmentIdx=" << lineSegmentIdx << ", has valid intersection = " << intersection; if (buildingIdOut) @@ -468,7 +468,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: if (justForLineOfSight) { reply.intersection(intersection); - DEBUG_LOG() << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId() << "'"; + DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, return due to justForLineOfSight " << request.requestId() << "'"; return reply; } // : justForLineOfSight @@ -477,9 +477,9 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: if (dist < distance) // new intersection is closer than the last one { if (buildingId == -1) // first intersection found - DEBUG_LOG() << "Building " << buildingModel->buildingId() << " was hit."; + DEBUG_LOG(m_logger) << "Building " << buildingModel->buildingId() << " was hit."; else // this building "covers" the last one found - DEBUG_LOG() << "Building " << buildingModel->buildingId() << " was hit prior to building " << buildingId << "."; + DEBUG_LOG(m_logger) << "Building " << buildingModel->buildingId() << " was hit prior to building " << buildingId << "."; buildingId = buildingModel->buildingId(); distance = dist; reply.intersection(intersection); @@ -491,7 +491,7 @@ CentralEffectSimulation::GetLineBuildingIntersectionReply HandlerBuildingModel:: } // for (const int bldgId : std::as_const(relevantBuildings)) } // for(lineIt = polylineRef.begin(); lineIt != polylineRef.end()-1; ++lineIt) - DEBUG_LOG() << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'" + DEBUG_LOG(m_logger) << "END getLineBuildingIntersectionInternal, request '" << request.requestId() << "'" << " buildingIdOut=" << *buildingIdOut; return reply; @@ -506,10 +506,10 @@ void HandlerBuildingModel::onDetonationLocationRequest( const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::DetonationLocationRequest &request ) { - DEBUG_LOG() << "Received DetonationLocationRequest for aesId: " << request.id(); + DEBUG_LOG(m_logger) << "Received DetonationLocationRequest for aesId: " << request.id(); const CentralEffectSimulation::DetonationLocationReply reply = handleDetonationLocationRequest(request); if (!reply.errorString().empty()) - WARNING_LOG() << "DetonationLocationRequest for aesId " << request.id() << " failed: " << reply.errorString(); + WARNING_LOG(m_logger) << "DetonationLocationRequest for aesId " << request.id() << " failed: " << reply.errorString(); // if m_ddsHandler->ftsCes()->detonationLocationReply(cookie, reply); } @@ -517,7 +517,7 @@ void HandlerBuildingModel::onDetonationLocationRequest( CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDetonationLocationRequest(const CentralEffectSimulation::DetonationLocationRequest &request) const { const int exerciseId = m_ddsHandler->getExerciseId(); - DEBUG_LOG() << " handleDetonationLocationRequest request=" << request + DEBUG_LOG(m_logger) << " handleDetonationLocationRequest request=" << request << ", m_buildingModels.size() = " << m_buildingModels.size(); // AES:: // ExplosionCluster most likely has serveral impacts and therefore several trajectories. @@ -542,7 +542,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet if (reqTrajRef.size() < 2) { - ERROR_LOG() << " handleDetonationLocationRequest request.trajectory() invalid, size =" << reqTrajRef.size(); + ERROR_LOG(m_logger) << " handleDetonationLocationRequest request.trajectory() invalid, size =" << reqTrajRef.size(); return reply; } @@ -572,17 +572,17 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet const bool bHasBuildingIntersection = BuildingModel::isValid(bldgIntersectionCoord.geoPosition()); if (bHasBuildingIntersection) { - DEBUG_LOG() << "RESULT: Trajectory: hasBuildingIntersection YES, at: " << bldgIntersectionCoord.mgrs() + DEBUG_LOG(m_logger) << "RESULT: Trajectory: hasBuildingIntersection YES, at: " << bldgIntersectionCoord.mgrs() << " buildingId=" << buildingId; } else { - DEBUG_LOG() << "RESULT: Trajectory: hasBuildingIntersection NO"; + DEBUG_LOG(m_logger) << "RESULT: Trajectory: hasBuildingIntersection NO"; const bool bIsInTrainingOrCentralArea = true; if (bIsInTrainingOrCentralArea) { - DEBUG_LOG() << "RESULT: integrate free area..."; + DEBUG_LOG(m_logger) << "RESULT: integrate free area..."; // free area and FuseType_def::IfbDelay: // We can´t move the detonation point _below_ the surface. @@ -610,13 +610,13 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet { if (!bHasBuildingIntersection) { - DEBUG_LOG() << "detonationLocation on ground" << detonationLocation.geoPosition() + DEBUG_LOG(m_logger) << "detonationLocation on ground" << detonationLocation.geoPosition() << std::fixed << std::setprecision(3) << ", heightOverElevation = " << detonationLocation.heightOverElevation(); Q_ASSERT_X(std::fabs(detonationLocation.heightOverElevation()) < 1.0, "handleDetonationLocationRequest", "heightOverElevation is to high"); } - DEBUG_LOG() << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection + DEBUG_LOG(m_logger) << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection << ", igniterFunctionBase: " << ignFuncBase << ", detonationDistance: " << detonationDistance << ", reqTrajRef.size():" << reqTrajRef.size() << " back: " << reqTrajRef.back() @@ -632,7 +632,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet // instead of backtrackTrajectory(), use simply resize and push_back(bldgIntersectionCoord) std::vector trajectoryCopy = reqTrajRef; - DEBUG_LOG() << "validSizeOfOriginalTraj is below zero: " << validSizeOfOriginalTraj << ", exerciseId " << exerciseId << ", buildingId=" << buildingId; + DEBUG_LOG(m_logger) << "validSizeOfOriginalTraj is below zero: " << validSizeOfOriginalTraj << ", exerciseId " << exerciseId << ", buildingId=" << buildingId; // in case of hasBuildingIntersection if (validSizeOfOriginalTraj > 0) @@ -644,7 +644,7 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet // adjust detonationLocation by taking detonationDistance (!= 0) into account: detonationLocation = LtsCoordTrans::LtsCoordinate(calculateDetonationLocation(trajectoryCopy, detonationDistance)); - DEBUG_LOG() << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection + DEBUG_LOG(m_logger) << "Trajectory bAdjusted/bHasBuildingIntersection: " << bHasBuildingIntersection << ", igniterFunctionBase: " << ignFuncBase << ", detonationDistance: " << detonationDistance << ", trajectoryCopy.size()=" << trajectoryCopy.size() << " back: " << trajectoryCopy.back() @@ -661,12 +661,12 @@ CentralEffectSimulation::DetonationLocationReply HandlerBuildingModel::handleDet Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::vector &trajectoryGeometry, double detonationDistance) const { - DEBUG_LOG() << Q_FUNC_INFO << " START"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " START"; const int geometrySize = trajectoryGeometry.size(); if (geometrySize < 3) { - ERROR_LOG() << Q_FUNC_INFO << ", trajectoryGeometry not sufficiant"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << ", trajectoryGeometry not sufficiant"; return {}; } @@ -683,7 +683,7 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v QVector3D flightVec = segEnd - segStart; - INFO_LOG() << "flightVec1 " + INFO_LOG(m_logger) << "flightVec1 " << ", utm1 " << utm1 << " , z " << p1.z() << ", utm2 " << utm2 << " , z " << p2.z() << ", flightVec " << flightVec; @@ -721,7 +721,7 @@ Core::GeoPosition HandlerBuildingModel::calculateDetonationLocation(const std::v const QPointF &pointDeto = utmDeto.geographic(); Core::GeoPosition geoPosDeto(pointDeto.x(), pointDeto.y(), detonationLoc.z()); - DEBUG_LOG() << "flightVec2 " + DEBUG_LOG(m_logger) << "flightVec2 " << ", utm1 " << utm1 << " , z " << p1.z() << ", utm2 " << utm2 << " , z " << p2.z() << ", flightVec " << flightVec @@ -774,7 +774,7 @@ Core::GeoPosition HandlerBuildingModel::backtrackTrajectory(const std::vectordtcIsm(); - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; loadOwnershipsFromDb(); connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newOutdoorPosition, @@ -83,7 +83,7 @@ bool HandlerBuildingOwnership::init() void HandlerBuildingOwnership::onSetOwnershipRequest(const rti::core::SampleIdentity &cookie, const CentralEffectSimulation::SetOwnershipRequest &request) { - INFO_LOG() << "onSetOwnershipRequest: " << request; + INFO_LOG(m_logger) << "onSetOwnershipRequest: " << request; // remove Ownership, if partyId == 0 if (request.partyId() == 0) @@ -103,7 +103,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS { const int participantId = partPos.participantId(); - INFO_LOG() << "BuildingOwnership onParticipantPositionChanged participantId=" << participantId + INFO_LOG(m_logger) << "BuildingOwnership onParticipantPositionChanged participantId=" << participantId << " vulnerabilityState=" << partPos.vulnerabilityState << " buildingId=" << partPos.buildingId() << " notfightMode=" << partPos.notfightMode; @@ -121,7 +121,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS int newOwnership = calculateOwnershipByParticipantId(participantId); checkAndSendOwnership(newOwnership, floorId); - INFO_LOG() << "END BuildingOwnership onParticipantPositionChanged participantId=" << participantId + INFO_LOG(m_logger) << "END BuildingOwnership onParticipantPositionChanged participantId=" << participantId << " vulnerabilityState=" << partPos.vulnerabilityState; } // end of onParticipantPositionChanged() @@ -131,7 +131,7 @@ void HandlerBuildingOwnership::onParticipantPositionChanged(const CentralEffectS // /////////////////////////////////// void HandlerBuildingOwnership::onMainStructureElementChanged(const InfrastructureManagement::MainStructureElement &data, DataModification modType) { - INFO_LOG() << "onMainStructureElementChanged id=" << data.id() + INFO_LOG(m_logger) << "onMainStructureElementChanged id=" << data.id() << " modelId =" << data.modelId(); if (modType == DataModification::eRemoved || data.modelId() <= 0) { @@ -140,7 +140,7 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur } QJsonArray jsonArray = QJsonDocument::fromJson(QByteArray::fromStdString(data.properties())).object().value(QLatin1String("available_in_exercise")).toArray(); - DEBUG_LOG() << "available_in_exercise jsonDocument.size()=" << jsonArray.size(); + DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument.size()=" << jsonArray.size(); QVector result; result.reserve(jsonArray.size()); @@ -154,11 +154,11 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur for (auto it = jsonArray.constBegin(); it != jsonArray.constEnd(); ++it) { - DEBUG_LOG() << "available_in_exercise jsonDocument=" << it->toInt(); + DEBUG_LOG(m_logger) << "available_in_exercise jsonDocument=" << it->toInt(); if (m_ddsHandler->getExerciseId() != it->toInt()) continue; - DEBUG_LOG() << "Got MainStructureElement" + DEBUG_LOG(m_logger) << "Got MainStructureElement" << " data.id()=" << data.id() << " data.modelId=" << data.modelId(); if (!m_buildingOwnership.contains(data.id())) @@ -176,7 +176,7 @@ void HandlerBuildingOwnership::onMainStructureElementChanged(const Infrastructur void HandlerBuildingOwnership::onParticipantLeavesBuilding(const int participantId) { - INFO_LOG() << "BuildingOwnership onParticipantLeavesBuilding participantId=" << participantId; + INFO_LOG(m_logger) << "BuildingOwnership onParticipantLeavesBuilding participantId=" << participantId; auto it = m_participantFloor.find(participantId); if (it == m_participantFloor.end()) return; @@ -184,26 +184,26 @@ void HandlerBuildingOwnership::onParticipantLeavesBuilding(const int participant const int floorId = it.value(); const int newOwnership = calculateOwnershipByFloorId(floorId); - DEBUG_LOG() << "newOwnership=" << newOwnership; + DEBUG_LOG(m_logger) << "newOwnership=" << newOwnership; if (newOwnership > 0) checkAndSendOwnership(newOwnership, floorId); } // end of onParticipantLeavesBuilding() int HandlerBuildingOwnership::calculateOwnershipByParticipantId(const int participantId) { - INFO_LOG() << "BuildingOwnership calculateOwnershipByParticipantId participantId=" << participantId; + INFO_LOG(m_logger) << "BuildingOwnership calculateOwnershipByParticipantId participantId=" << participantId; CentralEffectSimulation::HandlerParticipant::CesParticipantData partPos = m_handlerParticipant->position(participantId); return calculateOwnershipByFloorId(m_handlerBuildingData->getFloorIdFromRoomId(partPos.roomId())); } int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId) { - INFO_LOG() << "BuildingOwnership calculateOwnershipByFloorId floorId=" << floorId; + INFO_LOG(m_logger) << "BuildingOwnership calculateOwnershipByFloorId floorId=" << floorId; int ownership = -1; if (floorId == -1) return ownership; - DEBUG_LOG() << "calculateOwnership floorId = " << floorId; + DEBUG_LOG(m_logger) << "calculateOwnership floorId = " << floorId; QHash partyCount; // key = Party, value= Count of Participants; // Suche alle Participants in der Etage @@ -235,7 +235,7 @@ int HandlerBuildingOwnership::calculateOwnershipByFloorId(const int floorId) int HandlerBuildingOwnership::getOwnership(int buildingId, int floorId) const { - INFO_LOG() << "BuildingOwnership getOwnership buildingId=" << buildingId + INFO_LOG(m_logger) << "BuildingOwnership getOwnership buildingId=" << buildingId << " floorId=" << floorId; auto itBldg = m_buildingOwnership.find(buildingId); if (itBldg == m_buildingOwnership.end()) @@ -251,18 +251,18 @@ int HandlerBuildingOwnership::getOwnership(int buildingId, int floorId) const void HandlerBuildingOwnership::checkAndSendOwnership(const int newOwnership, const int floorId) { - INFO_LOG() << "BuildingOwnership checkAndSendOwnership"; + INFO_LOG(m_logger) << "BuildingOwnership checkAndSendOwnership"; if (floorId < 0) // outside building return; const int buildingId = m_handlerBuildingData->getBuildingIdFromFloorId(floorId); if (buildingId < 0) { - WARNING_LOG() << "Could not find building for floor with id " << floorId << " - ignoring"; + WARNING_LOG(m_logger) << "Could not find building for floor with id " << floorId << " - ignoring"; return; } // prĂźfe, ob sich die Farbe geändert hat. const int oldOwnership = getOwnership(buildingId, floorId); - DEBUG_LOG() << "checkAndSendOwnership buildingId = " + DEBUG_LOG(m_logger) << "checkAndSendOwnership buildingId = " << buildingId << " floorId=" << floorId << " oldOwnership=" << oldOwnership @@ -273,23 +273,23 @@ void HandlerBuildingOwnership::checkAndSendOwnership(const int newOwnership, con saveBuildingOwnership(floorId, newOwnership, buildingId); // und Meldung verschicken. sendBuildingOwnership(buildingId); - DEBUG_LOG() << "new Building Ownership"; + DEBUG_LOG(m_logger) << "new Building Ownership"; } } void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::BuildingOwnership *bo) { - INFO_LOG() << "BuildingOwnership updateOwnerships"; + INFO_LOG(m_logger) << "BuildingOwnership updateOwnerships"; QMap ownershipMap; const QVector floors = m_handlerBuildingData->getFloorsFromBuilding(bo->buildingId()); - DEBUG_LOG() << "updateOwnerships floors.size= " << floors.size(); + DEBUG_LOG(m_logger) << "updateOwnerships floors.size= " << floors.size(); for (const int floorId : floors) ownershipMap[floorId] = 0; for (const CentralEffectSimulation::Ownership &ownership : bo->ownerships()) { - DEBUG_LOG() << "updateOwnerships floorId=" << ownership.floorId() << ": " << ownership.partyId(); + DEBUG_LOG(m_logger) << "updateOwnerships floorId=" << ownership.floorId() << ": " << ownership.partyId(); ownershipMap[ownership.floorId()] = ownership.partyId(); } @@ -299,7 +299,7 @@ void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::Buildin CentralEffectSimulation::Ownership ownership; for (auto it = ownershipMap.cbegin(); it != ownershipMap.cend(); ++it) { - DEBUG_LOG() << it.key() << ": " << it.value(); + DEBUG_LOG(m_logger) << it.key() << ": " << it.value(); ownership.floorId(it.key()); ownership.partyId(it.value()); bo->ownerships().push_back(ownership); @@ -308,7 +308,7 @@ void HandlerBuildingOwnership::updateOwnerships(CentralEffectSimulation::Buildin } void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, int buildingId) { - INFO_LOG() << "saveBuildingOwnership floorId: " << floorId + INFO_LOG(m_logger) << "saveBuildingOwnership floorId: " << floorId << ", partyId: " << partyId << ", buildingId: " << buildingId; @@ -349,7 +349,7 @@ void HandlerBuildingOwnership::saveBuildingOwnership(int floorId, int partyId, i void HandlerBuildingOwnership::sendBuildingOwnership(int buildingId) { - INFO_LOG() << "sendBuildingOwnership for building: " << buildingId; + INFO_LOG(m_logger) << "sendBuildingOwnership for building: " << buildingId; CentralEffectSimulation::BuildingOwnership bo = m_buildingOwnership.value(buildingId); bo.buildingId(buildingId); bo.sampleTime(QDateTime::currentMSecsSinceEpoch()); @@ -363,7 +363,7 @@ void HandlerBuildingOwnership::sendBuildingOwnership(int buildingId) /// bool HandlerBuildingOwnership::loadOwnershipsFromDb() { - INFO_LOG() << "HandlerBuildingOwnership::loadOwnershipsFromDb "; + INFO_LOG(m_logger) << "HandlerBuildingOwnership::loadOwnershipsFromDb "; m_buildingOwnership.clear(); auto cbBo = [this](const CentralEffectSimulation::Database::CesOwnership & bo) { @@ -371,7 +371,7 @@ bool HandlerBuildingOwnership::loadOwnershipsFromDb() }; if (!m_db->select(cbBo)) { - ERROR_LOG() << "Error reading data from database 'CesOwnership'"; + ERROR_LOG(m_logger) << "Error reading data from database 'CesOwnership'"; return false; } return true; @@ -379,7 +379,7 @@ bool HandlerBuildingOwnership::loadOwnershipsFromDb() void HandlerBuildingOwnership::removeFromDbBuildingId(const int buildingId) { - INFO_LOG() << "HandlerBuildingOwnership::removeFromDbBuildingId buildingId: " << buildingId; + INFO_LOG(m_logger) << "HandlerBuildingOwnership::removeFromDbBuildingId buildingId: " << buildingId; m_db->removeCesOwnershipByBuildingId(buildingId); } @@ -389,7 +389,7 @@ void HandlerBuildingOwnership::insertInDb(const CentralEffectSimulation::Buildin DBTransaction trans(m_db->database()); removeFromDbBuildingId(bo.buildingId()); - INFO_LOG() << "insertInDb buildingId: " << bo.buildingId() + INFO_LOG(m_logger) << "insertInDb buildingId: " << bo.buildingId() << ", bo.ownerships().size(): " << bo.ownerships().size(); CentralEffectSimulation::Database::CesOwnership newOwnership; newOwnership.buildingId = bo.buildingId(); @@ -398,10 +398,10 @@ void HandlerBuildingOwnership::insertInDb(const CentralEffectSimulation::Buildin newOwnership.id = 0; newOwnership.floorId = ownership.floorId(); newOwnership.partyId = ownership.partyId(); - DEBUG_LOG() << "ownership: floorId = " << newOwnership.floorId + DEBUG_LOG(m_logger) << "ownership: floorId = " << newOwnership.floorId << " partyId = " << newOwnership.partyId; if (!m_db->insert(newOwnership)) - ERROR_LOG() << "Error adding 'CesOwnership' to database " + ERROR_LOG(m_logger) << "Error adding 'CesOwnership' to database " << " buildingId =" << newOwnership.buildingId << " floorId = " << newOwnership.floorId << " partyId = " << newOwnership.partyId; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_contamination.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_contamination.cpp index d72b265a2..d8cb12c5d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_contamination.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/handler_contamination.cpp @@ -102,7 +102,7 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI modType != DataModification::eModified) return; - DEBUG_LOG() << "Got AesItemView: " << data.effectStateId() + DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId() << " data.aesItemId()" << data.aesItemId() << " data.aesTypeId()" << data.aesTypeId(); switch (data.effectStateId().underlying()) @@ -116,21 +116,21 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI { chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen - DEBUG_LOG() << "AtNContamination: chargeHeight=" << chargeHeight + DEBUG_LOG(m_logger) << "AtNContamination: chargeHeight=" << chargeHeight << " chargeDepression=" << chargeDepression; } else { chargeHeight = m_aesBCContaminations.value(data.aesItemId()).upperOffset(); chargeDepression = m_aesBCContaminations.value(data.aesItemId()).lowerOffset(); - DEBUG_LOG() << "BCContaminations: chargeHeight=" << chargeHeight + DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight << " chargeDepression=" << chargeDepression; } if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination) { - DEBUG_LOG() << "return1: AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "return1: AesItemView: " << data.effectStateId(); return; } @@ -139,11 +139,11 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI if (volatilityType != ProjectDataManagement::VolatilityType_def::Resident && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination) { - DEBUG_LOG() << "return2: AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "return2: AesItemView: " << data.effectStateId(); return; } - DEBUG_LOG() << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "HandlerContamination::onAesItemViewChanged data.aesItemId=" << data.aesItemId(); auto dtcIsm = m_ddsHandler->dtcIsm(); // Form in UTM-Polygon wandeln int exerciseId = m_ddsHandler->getExerciseId(); @@ -156,7 +156,7 @@ void HandlerContamination::onAesItemViewChanged(const AreaEffectSimulation::AesI bool completeEnclosed = true; bool isGroundLevel = false; const QVector &buildingIds = dtcIsm.get()->getBuildingByPolygon(exerciseId, polygonGeo, completeEnclosed, isGroundLevel); - DEBUG_LOG() << "buildingIds.size=" << buildingIds.size(); + DEBUG_LOG(m_logger) << "buildingIds.size=" << buildingIds.size(); for (int buildingId : std::as_const(buildingIds)) { calculateBuilding(buildingId, data, chargeHeight, chargeDepression); @@ -181,7 +181,7 @@ void HandlerContamination::calculateBuilding(int buildingId, if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtBCContamination && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination) { - DEBUG_LOG() << "return: NO BC-Contamination AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "return: NO BC-Contamination AesItemView: " << data.effectStateId(); return; } @@ -190,27 +190,27 @@ void HandlerContamination::calculateBuilding(int buildingId, && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtNContamination) return; - DEBUG_LOG() << "buildingId=" << buildingId; + DEBUG_LOG(m_logger) << "buildingId=" << buildingId; effectedRooms.clear(); effectedFloors = getEffectedFloors(buildingId, chargeHeight, chargeDepression); for (int effectedFloor : std::as_const(effectedFloors)) effectedRooms += dtcIsm.get()->getRoomIdsFromFloorId(buildingId, effectedFloor); if (!effectedRooms.empty()) { - DEBUG_LOG() << "effectedRooms.size=" << effectedRooms.size(); + DEBUG_LOG(m_logger) << "effectedRooms.size=" << effectedRooms.size(); ProjectDataManagement::VulnerabilityState vulnerabilityState = ProjectDataManagement::VulnerabilityState::CombatReady; // [GUEZE-2752] N-Contamination: Only Contamionation inside Range1 if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination && !isInsideRange1(buildingId, data.aesItemId())) { - DEBUG_LOG() << "!isInsideRange1 buildingId=" << buildingId; + DEBUG_LOG(m_logger) << "!isInsideRange1 buildingId=" << buildingId; return; } if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtBCContamination && !isInsideBCContamination(buildingId, data.aesItemId())) { - DEBUG_LOG() << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return"; + DEBUG_LOG(m_logger) << "AtBCContamination !isInsideRange buildingId=" << buildingId << "return"; return; } if (data.aesTypeId() == AreaEffectSimulation::AesType_def::AtNContamination @@ -220,15 +220,15 @@ void HandlerContamination::calculateBuilding(int buildingId, // Only actual explosion not old N-Fields if ( m_ddsHandler->dtcCore()->partitionTime().timeStamp() < (data.effectStart() + TIME_2_SECONDS)) { - DEBUG_LOG() << "VulnerabilityState=CatastrophicKill"; + DEBUG_LOG(m_logger) << "VulnerabilityState=CatastrophicKill"; vulnerabilityState = ProjectDataManagement::VulnerabilityState::CatastrophicKill; } } - DEBUG_LOG() << "setBuildingContaminationStateRequest buildingId=" << buildingId + DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest buildingId=" << buildingId << " data.aesTypeId()=" << data.aesTypeId() << " isInsideInnerCircle(buildingId, data.aesItemId()=" << isInsideInnerCircle(buildingId, data.aesItemId()); { - DEBUG_LOG() << "isInsideInnerCircle buildingId=" << buildingId; + DEBUG_LOG(m_logger) << "isInsideInnerCircle buildingId=" << buildingId; setBuildingContaminationStateRequest(buildingId, data.aesItemId(), vulnerabilityState, effectedRooms); } } @@ -244,7 +244,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState && modType != DataModification::eModified) return; - INFO_LOG() << "onBuildingStateChanged" + INFO_LOG(m_logger) << "onBuildingStateChanged" << " id=" << data.id() << " aesId=" << data.aesId() << " contaminationStates().size=" << data.contaminationStates().size(); @@ -260,7 +260,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState { if (aesItemView.effectStateId() == AreaEffectSimulation::AesEffectState::EsActivated) { - DEBUG_LOG() << "Wirkfeld aesItemView.id()=" << aesItemView.id() + DEBUG_LOG(m_logger) << "Wirkfeld aesItemView.id()=" << aesItemView.id() << " aesItemView.aesItemId()=" << aesItemView.aesItemId() << " fuer Gebaeude " << data.id() << " neu berechnen"; @@ -271,7 +271,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState { chargeHeight = 500.0; // Alle Stockwerke beruecksichtigen chargeDepression = -1000.0; // Alle Kellerraeume beruecksichtigen - DEBUG_LOG() << "AtNContamination: chargeHeight=" << chargeHeight + DEBUG_LOG(m_logger) << "AtNContamination: chargeHeight=" << chargeHeight << " chargeDepression=" << chargeDepression; } else @@ -280,12 +280,12 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState { chargeHeight = m_aesBCContaminations.value(aesItemView.aesItemId()).upperOffset(); chargeDepression = m_aesBCContaminations.value(aesItemView.aesItemId()).lowerOffset(); - DEBUG_LOG() << "BCContaminations: chargeHeight=" << chargeHeight + DEBUG_LOG(m_logger) << "BCContaminations: chargeHeight=" << chargeHeight << " chargeDepression=" << chargeDepression; } else { - DEBUG_LOG() << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId(); + DEBUG_LOG(m_logger) << "BCContaminations: m_aesBCContaminations not contains:"<< aesItemView.aesItemId(); } } @@ -304,7 +304,7 @@ void HandlerContamination::onBuildingStateChanged(const Buildings::BuildingState if (buildingIds.contains(data.id() )) calculateBuilding(data.id(), aesItemView, chargeHeight, chargeDepression); else - DEBUG_LOG() << "Building not in Area BuildingId=" << data.id(); + DEBUG_LOG(m_logger) << "Building not in Area BuildingId=" << data.id(); } } } @@ -321,7 +321,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId, contaminationState.vulnerabilityState(vulnerabilityState); // contaminationState.vulne - DEBUG_LOG() << "setBuildingContaminationStateRequest" + DEBUG_LOG(m_logger) << "setBuildingContaminationStateRequest" << " buildingId=" << buildingId << " aesId=" << aesId << " vulnerabilityState=" << vulnerabilityState @@ -331,7 +331,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId, { contaminationState.rooms()[i] = rooms[i]; contaminationState.vulnerabilityState(vulnerabilityState); - DEBUG_LOG() << " room[" << i << "]=" << rooms[i]; + DEBUG_LOG(m_logger) << " room[" << i << "]=" << rooms[i]; } Buildings::SetBuildingContaminationStateRequest requestContamination( @@ -341,7 +341,7 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId, // Senden, wenn fuer das Gebaeude noch keine Contamination vorhanden ist. if (!m_contaminationState.contains(buildingId)) { - DEBUG_LOG() << "Neue Kontamination BuildingId=" << buildingId + DEBUG_LOG(m_logger) << "Neue Kontamination BuildingId=" << buildingId << " requestContamination aesId=" << requestContamination.contaminationState().aesId(); m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this); @@ -352,19 +352,19 @@ void HandlerContamination::setBuildingContaminationStateRequest(int buildingId, Buildings::SetBuildingContaminationStateRequest lastRequestContamination = m_contaminationState.value(buildingId); if (lastRequestContamination != requestContamination) { - DEBUG_LOG() << "Änderung der Kontamination BuildingId=" << buildingId + DEBUG_LOG(m_logger) << "Änderung der Kontamination BuildingId=" << buildingId << " aesId=" << requestContamination.contaminationState().aesId(); m_ddsHandler->ftcBld()->setBuildingContaminationStateRequest(requestContamination, this); m_contaminationState.insert(buildingId, requestContamination); return; } - DEBUG_LOG() << "Keine Änderung der Kontamination BuildingId=" << buildingId; + DEBUG_LOG(m_logger) << "Keine Änderung der Kontamination BuildingId=" << buildingId; } QVector HandlerContamination::getEffectedFloors(const int buildingId, const int chargeHeight, const int depression) { auto dtcIsm = m_ddsHandler->dtcIsm(); - DEBUG_LOG() << "Contaminated-Building=" << buildingId + DEBUG_LOG(m_logger) << "Contaminated-Building=" << buildingId << " chargeHeight=" << chargeHeight << " depression=" << depression; @@ -374,17 +374,17 @@ QVector HandlerContamination::getEffectedFloors(const int buildingId, const for (int floorId : std::as_const(floorIds)) { double halfFloorHeight = dtcIsm->getHalfFloorHeight(buildingId, floorId); - DEBUG_LOG() << " floorId=" << floorId + DEBUG_LOG(m_logger) << " floorId=" << floorId << " halfFloorHeight=" << halfFloorHeight << " chargeHeight=" << chargeHeight << " depression=" << depression; if (depression < 0) // Kellerraeme beruecksichtigen { if (halfFloorHeight > depression) - DEBUG_LOG() << "Checke Obergrenze"; + DEBUG_LOG(m_logger) << "Checke Obergrenze"; else { - DEBUG_LOG() << "halfFloorHeight > depression floorId=" << floorId << " continue"; + DEBUG_LOG(m_logger) << "halfFloorHeight > depression floorId=" << floorId << " continue"; continue; } } @@ -392,7 +392,7 @@ QVector HandlerContamination::getEffectedFloors(const int buildingId, const { if (halfFloorHeight < 0) // Kellerraeume nicht beruecksichtigen { - DEBUG_LOG() << "depression ist nicht < 0" + DEBUG_LOG(m_logger) << "depression ist nicht < 0" << " Kelleretagen nicht beruecksichtigen floorId=" << floorId << " continue"; continue; } @@ -407,9 +407,9 @@ QVector HandlerContamination::getEffectedFloors(const int buildingId, const void HandlerContamination::onSetBuildingContaminationStateReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send ContaminationStates on building to building service: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send ContaminationStates on building to building service: " << replyObject(); else - DEBUG_LOG() << "onSetBuildingContaminationStateReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSetBuildingContaminationStateReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } @@ -429,27 +429,27 @@ bool HandlerContamination::isInsideInnerCircle(int buildingId, int aesId) InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId); AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId); - DEBUG_LOG() << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner() + DEBUG_LOG(m_logger) << "isInsideInnerCircle borderLengthInner=" << nContamination.borderLengthInner() << " borderLengthOuter=" << nContamination.borderLengthOuter() << " impactRadius=" << nContamination.impactRadius(); int zone = -1; const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone); - DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() + DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() << " zone=" << zone; const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone); - DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); + DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm); if (squareDistance < nContamination.impactRadius() * nContamination.impactRadius()) { - DEBUG_LOG() << "isInsideInnerCircle return true"; + DEBUG_LOG(m_logger) << "isInsideInnerCircle return true"; return true; } else { - DEBUG_LOG() << "isInsideInnerCircle return false"; + DEBUG_LOG(m_logger) << "isInsideInnerCircle return false"; return false; } } @@ -462,25 +462,25 @@ bool HandlerContamination::isInsideBCContamination(int buildingId, int aesId) //AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId); AreaEffectSimulation::BCContamination bcContamination = m_ddsHandler->dtcAes()->bCContamination(aesId); - DEBUG_LOG() << " impactRadius=" << bcContamination.impactRadius(); + DEBUG_LOG(m_logger) << " impactRadius=" << bcContamination.impactRadius(); int zone = -1; const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(bcContamination.impactPosition(), zone); - DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() + DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() << " zone=" << zone; const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone); - DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); + DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm); if (squareDistance < bcContamination.impactRadius() * bcContamination.impactRadius()) { - DEBUG_LOG() << "isInsideInnerCircle return true"; + DEBUG_LOG(m_logger) << "isInsideInnerCircle return true"; return true; } else { - DEBUG_LOG() << "isInsideInnerCircle return false"; + DEBUG_LOG(m_logger) << "isInsideInnerCircle return false"; return false; } } @@ -492,27 +492,27 @@ bool HandlerContamination::isInsideRange1(int buildingId, int aesId) InfrastructureManagement::MainStructureElement mse = m_ddsHandler->dtcIsm()->mainStructureElement(buildingId); AreaEffectSimulation::NContamination nContamination = m_ddsHandler->dtcAes()->nContamination(aesId); - DEBUG_LOG() << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner() + DEBUG_LOG(m_logger) << "isInsideRange1 borderLengthInner=" << nContamination.borderLengthInner() << " borderLengthOuter=" << nContamination.borderLengthOuter() << " impactRadius=" << nContamination.impactRadius(); int zone = -1; const QPointF impactPositionUtm = CentralEffectSimulation::geographic2Utm(nContamination.impactPosition(), zone); - DEBUG_LOG() << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() + DEBUG_LOG(m_logger) << "impactPositionUtm=" << impactPositionUtm.x() << "/" << impactPositionUtm.y() << " zone=" << zone; const QPointF buildingPositionUtm = CentralEffectSimulation::geographic2Utm(mse.geoPosition(), zone); - DEBUG_LOG() << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); + DEBUG_LOG(m_logger) << "buildingPositionUtm=" << buildingPositionUtm.x() << "/" << buildingPositionUtm.y(); double squareDistance = CentralEffectSimulation::getSquareDistance(impactPositionUtm, buildingPositionUtm); if (squareDistance < nContamination.borderLengthInner() * nContamination.borderLengthInner()) { - DEBUG_LOG() << "isInsideRange1 return true"; + DEBUG_LOG(m_logger) << "isInsideRange1 return true"; return true; } else { - DEBUG_LOG() << "isInsideRange1 return false"; + DEBUG_LOG(m_logger) << "isInsideRange1 return false"; return false; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.cpp index 6d15214ae..67628f464 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.cpp @@ -53,13 +53,13 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesBuildingsInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesBuildingsInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; // initialize handlerBuildingOwnership - INFO_LOG() << "initialize handlerBuildingOwnership ----------------------------"; + INFO_LOG(m_logger) << "initialize handlerBuildingOwnership ----------------------------"; m_handlerBuildingOwnership = std::make_shared(m_ddsHandler, m_handlerParticipant, m_handlerBuildingData, @@ -69,47 +69,47 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerBuildingOwnership->init()) { - ERROR_LOG() << "Initialisation m_handlerBuildingOwnership failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerBuildingOwnership failed."; return false; } - INFO_LOG() << "end initialize handlerBuildingOwnership ----------------------------"; + INFO_LOG(m_logger) << "end initialize handlerBuildingOwnership ----------------------------"; // initialize handlerAesData - INFO_LOG() << "initialize handlerAesData ----------------------------"; + INFO_LOG(m_logger) << "initialize handlerAesData ----------------------------"; m_handlerAesData = std::make_shared(m_ddsHandler, m_handlerBuildingData, this); if (!m_handlerAesData->init()) { - ERROR_LOG() << "Initialisation m_handlerAesData failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerAesData failed."; return false; } - INFO_LOG() << "end initialize HandlerAesData ----------------------------"; + INFO_LOG(m_logger) << "end initialize HandlerAesData ----------------------------"; // initialize handlerAesData - INFO_LOG() << "initialize handlerContaminations ----------------------------"; + INFO_LOG(m_logger) << "initialize handlerContaminations ----------------------------"; m_handlerContaminations = std::make_shared(m_ddsHandler, this); if (!m_handlerContaminations->init()) { - ERROR_LOG() << "Initialisation m_handlerContaminations failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerContaminations failed."; return false; } - INFO_LOG() << "end initialize HandlerContaminations ----------------------------"; + INFO_LOG(m_logger) << "end initialize HandlerContaminations ----------------------------"; // initialize handlerBuildingModel - INFO_LOG() << "initialize handlerBuildingModel ----------------------------"; + INFO_LOG(m_logger) << "initialize handlerBuildingModel ----------------------------"; m_handlerBuildingModel = std::make_shared(m_ddsHandler, m_handlerAesData, this); if (!m_handlerBuildingModel->init()) { - ERROR_LOG() << "Initialisation m_handlerBuildingModel failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerBuildingModel failed."; return false; } - INFO_LOG() << "end initialize handlerBuildingModel ----------------------------"; + INFO_LOG(m_logger) << "end initialize handlerBuildingModel ----------------------------"; // Maybe not all MainStructureElements are processed yet. @@ -121,20 +121,20 @@ bool CesBuildingsInterfaceImpl::init(int domainId, int exerciseId) std::shared_ptr proxyBuilding = m_mainHandler->proxyBuilding(); if (proxyBuilding) { - INFO_LOG() << "set_handlerBuildingModel ----------------------------"; + INFO_LOG(m_logger) << "set_handlerBuildingModel ----------------------------"; proxyBuilding->set_handlerBuildingModel(m_handlerBuildingModel); } }); - INFO_LOG() << "CesBuildingsInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CesBuildingsInterfaceImpl::init() return true"; return true; } QString CesBuildingsInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CentralEffectSimulationBuildingOwnershipInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.h index 93fa09a5a..c381be325 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Buildings/plugin.h @@ -64,6 +64,7 @@ private Q_SLOTS: bool init(int domainId, int exerciseId) override; private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr}; std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.cpp index 754b4e207..49d45f663 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.cpp @@ -115,7 +115,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie modType != DataModification::eModified) return; - DEBUG_LOG() << "Got AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId(); switch (data.effectStateId().underlying()) { case AreaEffectSimulation::AesEffectState_def::EsUnknown: @@ -141,7 +141,7 @@ void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data) { if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea) return; - DEBUG_LOG() << "Remove aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId(); // remove State for each building for (BitfieldStates &bfs : m_bitfieldStatesBld) bfs.remove(data.aesItemId()); @@ -159,7 +159,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove SingleExplosion"; + DEBUG_LOG(m_logger) << "Remove SingleExplosion"; m_explosionSingleState.remove(data.id()); return; } @@ -167,17 +167,17 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared && data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated) { - DEBUG_LOG() << "Handle SingleExplosion"; + DEBUG_LOG(m_logger) << "Handle SingleExplosion"; handleExplosion = true; } m_explosionSingleState.insert(data.id(), data.effectStateId()); - DEBUG_LOG() << "Got ExplosionSingle"; + DEBUG_LOG(m_logger) << "Got ExplosionSingle"; if (handleExplosion) { const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId()); - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)"; + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)"; // Bounding-Box-Check // QMap m_footprints; @@ -200,7 +200,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos const Core::GeoPosition2D impactPosition(data.impactPosition().lon(), data.impactPosition().lat()); if (inFootprint(impactPosition, impactRadius, footprint)) { - DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId + DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " chargeTypeId = " << data.chargeTypeId() << " id = " << data.id() << " currentPartitionTime = " << m_ddsHandler->currentPartitionTime() @@ -216,9 +216,9 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this); } else - DEBUG_LOG() << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; - DEBUG_LOG() << "boundingBoxImpact.contains(footprint)"; + DEBUG_LOG(m_logger) << "boundingBoxImpact.contains(footprint)"; } } // for } @@ -226,7 +226,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos void HandlerAesData::onAirSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType) { - DEBUG_LOG() << "Got onAirSupportImpactChanged()"; + DEBUG_LOG(m_logger) << "Got onAirSupportImpactChanged()"; AreaEffectSimulation::ExplosionSingle esData; esData.id(data.id()); esData.chargeTypeId(data.chargeTypeId()); @@ -241,7 +241,7 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg modType != DataModification::eModified) return; - DEBUG_LOG() << "Got TriggeredImpacts"; + DEBUG_LOG(m_logger) << "Got TriggeredImpacts"; preCalculateImpacts(data); } @@ -254,7 +254,7 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main { case DataModification::eAdded: case DataModification::eModified: - DEBUG_LOG() << "Got MainFootprint (Building)"; + DEBUG_LOG(m_logger) << "Got MainFootprint (Building)"; calculateFootprint(data); break; case DataModification::eRemoved: @@ -269,8 +269,8 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main void HandlerAesData::calculateFootprint(const InfrastructureManagement::MainFootprint &mainFootprint) { - DEBUG_LOG() << "Footprint: " << mainFootprint.id() << ": " << mainFootprint; - DEBUG_LOG() << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); + DEBUG_LOG(m_logger) << "Footprint: " << mainFootprint.id() << ": " << mainFootprint; + DEBUG_LOG(m_logger) << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); // If poly is Empty continue with next Footprint if (mainFootprint.elements().size() <= 0) @@ -318,9 +318,9 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition, const d if (m_logger.isDebugEnabled()) { const QPointF utmBuilding(CentralEffectSimulation::geographic2Utm(footPrint.geoPosition, footPrint.zone)); - DEBUG_LOG() << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); + DEBUG_LOG(m_logger) << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); for (int i = 0; i < footPrint.polyUtm.length(); i++) - DEBUG_LOG() << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); + DEBUG_LOG(m_logger) << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); } // Check, if hit direct on building @@ -339,14 +339,14 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm { if (data.id() <= 0) return; - DEBUG_LOG() << "preCalculateImpacts"; + DEBUG_LOG(m_logger) << "preCalculateImpacts"; // Find AES ItemView and set Bounding-Box of Aes-Field // Search corresponding itemView and get boundingBox data in UTM const bool bFound = m_aesItemViews.contains(data.aesItemId()); if (!bFound) { - WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId(); + WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId(); return; } // Bounding-Box-Check @@ -362,18 +362,18 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm void HandlerAesData::onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send hit on building to building service: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send hit on building to building service: " << replyObject(); else - DEBUG_LOG() << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - WARNING_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); + WARNING_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); else - DEBUG_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " successful"; + DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " successful"; } // calculate impacts for one building @@ -385,14 +385,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac case AreaEffectSimulation::AesType_def::AtExplosionArea: case AreaEffectSimulation::AesType_def::AtExplosionSingle: case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions: - DEBUG_LOG() << "Calculate"; + DEBUG_LOG(m_logger) << "Calculate"; break; default: - DEBUG_LOG() << "No Calculation"; + DEBUG_LOG(m_logger) << "No Calculation"; return; } - DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId(); + DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId(); // get position(s) of impact(s): @@ -401,14 +401,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac auto it = m_aesItemViews.constFind(data.aesItemId()); if (it == m_aesItemViews.constEnd()) { - WARNING_LOG() << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"; + WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"; return; } BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId]; QSet &bitfieldState = bitfieldStates[data.aesItemId()]; for (int i : std::as_const(bitfieldState)) - DEBUG_LOG() << "bitfieldState for " << data.aesItemId() << ": " << i; + DEBUG_LOG(m_logger) << "bitfieldState for " << data.aesItemId() << ": " << i; const AreaEffectSimulation::AesItemView &aesItemView = *it; for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx) @@ -422,7 +422,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac continue; const Core::GeoPosition2D &impactPosition = aesItemView.form()[bitFieldIdx]; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon() << " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition)); @@ -431,14 +431,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeTypeId()); if (inFootprint(impactPosition, impactRadius, footprint)) { - DEBUG_LOG() << "In Footprint mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "In Footprint mseId = " << footprint.mseId; if (!bitfieldState.contains(bitFieldIdx)) { bitfieldState.insert(bitFieldIdx); - DEBUG_LOG() << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; + DEBUG_LOG(m_logger) << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; - DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ; + DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ; Buildings::SendCesHitOnBuildingRequest requestBld( footprint.mseId, aesItemView.chargeTypeId(), diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.h index 375f4ad00..9093e8dcf 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_aes_data.h @@ -55,6 +55,7 @@ public: AreaEffectSimulation::AesItemView itemView(const int &aesId) const { return m_aesItemViews.value(aesId); } protected: + NGL::INGLLogger &m_logger; void onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject) override final; void onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.cpp index 55a438848..7bb800033 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.cpp @@ -86,7 +86,7 @@ bool HandlerParticipantArea::init() { auto dtcAes = m_ddsHandler->dtcAes(); - DEBUG_LOG() << "Settings::calculateCentralAes() =" << Settings::calculateCentralAes(); + DEBUG_LOG(m_logger) << "Settings::calculateCentralAes() =" << Settings::calculateCentralAes(); dtcAes->enableBCContamination(); connect(dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::bCContaminationChanged, @@ -193,28 +193,28 @@ bool HandlerParticipantArea::init() return false; } - INFO_LOG() << "HandlerParticipantArea::init() finished."; + INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished."; return true; } // end of init() //----------------------------------------------------------------------------- void HandlerParticipantArea::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); if (replyObject.error()) - WARNING_LOG() << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject(); // Send next Request, if available if (!m_sendCesHitRequestQueue.isEmpty()) { - DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); + DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); m_sendCesHitRequestQueue.dequeue(); // Send next Message if (!m_sendCesHitRequestQueue.isEmpty()) { const auto &hr = m_sendCesHitRequestQueue.head(); - DEBUG_LOG() << "sendCesHitRequest: " << hr; + DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr; m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this); } } @@ -248,12 +248,12 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae if (m_ddsHandler->isSmartChargeType(data.chargeTypeId())) { - DEBUG_LOG() << "isSmartType = TRUE"; + DEBUG_LOG(m_logger) << "isSmartType = TRUE"; return; } const int aesItemId = data.aesItemId(); - DEBUG_LOG() << "Got AesItemView id: " << aesItemId + DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId << ", type: " << data.aesTypeId() << ", effectState: " << data.effectStateId() << ", modType: " << modType; @@ -278,7 +278,7 @@ void HandlerParticipantArea::onAesItemViewChanged(const AreaEffectSimulation::Ae const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId(); const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId()); - DEBUG_LOG() << "impactRadius=" << impactRadius; + DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius; switch (effectState.underlying()) { case AreaEffectSimulation::AesEffectState_def::EsPrepared: @@ -356,7 +356,7 @@ void HandlerParticipantArea::onDusSingleMineChanged(const AreaEffectSimulation:: { case AreaEffectSimulation::AesEffectState_def::EsActivated: { - //DEBUG_LOG() << "Got onDusSingleMineChanged data.id()=" << data.id(); + //DEBUG_LOG(m_logger) << "Got onDusSingleMineChanged data.id()=" << data.id(); CentralEffectSimulation::AesItemViewUtm itemView; itemView.aesItemId = data.id(); itemView.chargeTypeId = data.chargeTypeId(); @@ -448,7 +448,7 @@ void HandlerParticipantArea::onNContaminationChanged(const AreaEffectSimulation: void HandlerParticipantArea::calculateBcContamination(const CentralEffectSimulation::AesItemViewUtm &itemView) { - DEBUG_LOG() << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId; + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateBcContamination aesItemId =" << itemView.aesItemId; const auto participantsMap = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap) { @@ -460,7 +460,7 @@ void HandlerParticipantArea::calculateBcContamination(const CentralEffectSimulat void HandlerParticipantArea::calculateFunctionArea(const CentralEffectSimulation::AesItemViewUtm &itemView) { - DEBUG_LOG() << "HandlerParticipantArea::calculateFunctionArea aesItemId =" << itemView.aesItemId; + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateFunctionArea aesItemId =" << itemView.aesItemId; const auto partPosMap = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap) { @@ -473,7 +473,7 @@ void HandlerParticipantArea::calculateFunctionArea(const CentralEffectSimulation void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId) { CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(aesItemId); - DEBUG_LOG() << "delete " << itemView.aesItemId << ", aesItemId: " << aesItemId; + DEBUG_LOG(m_logger) << "delete " << itemView.aesItemId << ", aesItemId: " << aesItemId; const auto partPosMap = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : partPosMap) @@ -488,7 +488,7 @@ void HandlerParticipantArea::deleteFunctionalArea(const int aesItemId) } else sendParticipantEvent(itemView, participantPos, ProjectDataManagement::EventType_def::LeaveDangerArea); - DEBUG_LOG() << "Participant inside id=" << participantPos.participantId(); + DEBUG_LOG(m_logger) << "Participant inside id=" << participantPos.participantId(); } // for all Participants } // deleteFunctionalArea @@ -497,10 +497,10 @@ void HandlerParticipantArea::calculateAesParticipant(const CentralEffectSimulati if (m_handlerParticipant->isOutdated(participantPos)) return; - DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPos.participantId(); + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPos.participantId(); for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews)) { - DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; + DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; switch (itemView.aesTypeId.underlying()) { case AreaEffectSimulation::AesType_def::AtMineArea: @@ -542,7 +542,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae bool bOutOfBounds = false; for (const auto &itPos : itemView.formMines) { - DEBUG_LOG() << "participantPositionUtm: " << CentralEffectSimulation::debug(participantPosUtmPoint) + DEBUG_LOG(m_logger) << "participantPositionUtm: " << CentralEffectSimulation::debug(participantPosUtmPoint) << ", MinePosUtm: " << CentralEffectSimulation::debug(itPos); // Check, if mine is active // already triggered (bit is already 0) @@ -558,7 +558,7 @@ bool HandlerParticipantArea::inMineRadiusCheck(const CentralEffectSimulation::Ae // Check, if participant is inside danger-radius of the mine if (inCircle(itPos, impactRadius, participantPosUtmPoint)) { - DEBUG_LOG() << "Mine Hit for aesItemId: " << itemView.aesItemId + DEBUG_LOG(m_logger) << "Mine Hit for aesItemId: " << itemView.aesItemId << ", mineIdx: " << mineIdx << ", participantId: " << participantPosition.participantId(); sendEffectTypeEvent(itemView, participantPosition, EffectType::EffectiveMineRangeEnter, mineIdx, -1); @@ -590,11 +590,11 @@ bool HandlerParticipantArea::inBoundingBoxCheck(const CentralEffectSimulation::A const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone); if (boundingBoxImpact.contains(participantPosUtmPoint)) { - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " inside AesItemView:" << itemView.aesItemId; return true; } - TRACE_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " outside AesItemView:" << itemView.aesItemId; return false; } @@ -613,7 +613,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV itemView.boundingBoxTopRight); const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone); const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantPosition.pos(), itemView.zone); - DEBUG_LOG() << "inFormCheck start, paricipantId: " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId << ", aesTypeId: " << itemView.aesTypeId << ", form.size: " << itemView.form.size() @@ -622,7 +622,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV if (boundingBoxImpact.contains(participantPosUtmPoint) && itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill)) { - DEBUG_LOG() << "inside AES form, paricipantId: " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId; switch (itemView.aesTypeId.underlying()) { @@ -646,7 +646,7 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV sendEffectTypeEvent(itemView, participantPosition, effectTypeForNContaminationArea(itemView, participantPosUtmPoint, participantPosition.sampleTime()), -1, -1); break; default: - INFO_LOG() << "inFormCheck Unhandled AES-Type" << itemView.aesTypeId; + INFO_LOG(m_logger) << "inFormCheck Unhandled AES-Type" << itemView.aesTypeId; break; } return true; @@ -680,10 +680,10 @@ bool HandlerParticipantArea::inFormCheck(const CentralEffectSimulation::AesItemV #if 0 if (m_logger.isDebugEnabled()) { - DEBUG_LOG() << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId; - DEBUG_LOG() << "ParticipantPos = " << debug(participantPosUtmPoint); + DEBUG_LOG(m_logger) << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId; + DEBUG_LOG(m_logger) << "ParticipantPos = " << debug(participantPosUtmPoint); for (const auto &itPos : itemView.form) - DEBUG_LOG() << "itemView =" << debug(itPos); + DEBUG_LOG(m_logger) << "itemView =" << debug(itPos); } #endif return false; @@ -696,7 +696,7 @@ void HandlerParticipantArea::onTriggeredImpactsChanged(const AreaEffectSimulatio modType != DataModification::eModified) return; - DEBUG_LOG() << "Got TriggeredImpacts: " << data; + DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data; switch (data.aesTypeId().underlying()) { case AreaEffectSimulation::AesType_def::AtExplosionArea: @@ -723,7 +723,7 @@ void HandlerParticipantArea::onExplosionAreaChanged(const AreaEffectSimulation:: modType != DataModification::eModified) return; - DEBUG_LOG() << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId(); + DEBUG_LOG(m_logger) << "Got ExplosionArea, m_aesItemId2partIdMap.insert " << data.id() << " / " << data.participantId(); if (data.participantId().is_set()) m_aesItemId2partIdMap.insert(data.id(), data.participantId().get()); else @@ -738,7 +738,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation if (m_ddsHandler->isSmartChargeType(data.chargeTypeId())) { - DEBUG_LOG() << "isSmartType = TRUE"; + DEBUG_LOG(m_logger) << "isSmartType = TRUE"; return; } @@ -748,7 +748,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove SingleExplosion"; + DEBUG_LOG(m_logger) << "Remove SingleExplosion"; m_explosionSingleStates.remove(data.id()); return; } @@ -757,7 +757,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation m_explosionSingleStates.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsFired) && data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated) { - DEBUG_LOG() << "Handle SingleExplosion"; + DEBUG_LOG(m_logger) << "Handle SingleExplosion"; handleExplosion = true; } m_explosionSingleStates.insert(data.id(), data.effectStateId()); @@ -765,10 +765,10 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation if (!handleExplosion) return; - DEBUG_LOG() << "isSmartType = " << m_ddsHandler->isSmartChargeType(data.chargeTypeId()); + DEBUG_LOG(m_logger) << "isSmartType = " << m_ddsHandler->isSmartChargeType(data.chargeTypeId()); if (m_ddsHandler->isSmartChargeType(data.chargeTypeId())) { - DEBUG_LOG() << "isSmartType = TRUE"; + DEBUG_LOG(m_logger) << "isSmartType = TRUE"; } else { @@ -776,7 +776,7 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation const QPointF impactPos(CentralEffectSimulation::geographic2Utm(data.impactPosition(), &impactPosZone)); const CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(data.id()); const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId()); - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)"; + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)"; const auto participantPositions = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition : participantPositions) { @@ -787,16 +787,16 @@ void HandlerParticipantArea::onExplosionSingleChanged(const AreaEffectSimulation continue; const QPointF participantPosUtm = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), impactPosZone); - DEBUG_LOG() << "impact pos: " << CentralEffectSimulation::debug(impactPos) + DEBUG_LOG(m_logger) << "impact pos: " << CentralEffectSimulation::debug(impactPos) << " with radius " << impactRadius << " and participant position " << CentralEffectSimulation::debug(participantPosUtm); if (inCircle(impactPos, impactRadius, participantPosUtm)) { - DEBUG_LOG() << "participantId = " << participantPosition.participantId() << " inCircle = true"; + DEBUG_LOG(m_logger) << "participantId = " << participantPosition.participantId() << " inCircle = true"; sendEffectTypeEvent(itemView, participantPosition, EffectType::ExplosionSingle, -1, QDateTime::currentMSecsSinceEpoch()); } else - DEBUG_LOG() << "participantId = " << participantPosition.participantId() << " inCircle = false"; + DEBUG_LOG(m_logger) << "participantId = " << participantPosition.participantId() << " inCircle = false"; } } } // onExplosionSingleChanged @@ -808,7 +808,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) // EsExpired? EsError? EsUnknown? { - DEBUG_LOG() << "Remove ExplosionSingleCentral with aesId = " << data.id(); + DEBUG_LOG(m_logger) << "Remove ExplosionSingleCentral with aesId = " << data.id(); m_explosionSingleCentralStates.remove(data.id()); return; } // if @@ -822,7 +822,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim } // if m_explosionSingleCentralStates.insert(data.id(), data.effectStateId()); - DEBUG_LOG() << "Handle ExplosionSingleCentral with aesId = " << data.id(); + DEBUG_LOG(m_logger) << "Handle ExplosionSingleCentral with aesId = " << data.id(); // pre-calculate geometric data const AreaEffectSimulation::AesItemView &itemView = m_handlerAesData->itemView(data.id()); @@ -857,7 +857,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim const BuildingModel *buildingModel = it.value(); if (buildingModel->hasIntersection(centerGeo, participantPosition.lastGeoPosition)) { - DEBUG_LOG() << "Participant " << participantPosition.participantId() << " is covered by building " << it.key(); + DEBUG_LOG(m_logger) << "Participant " << participantPosition.participantId() << " is covered by building " << it.key(); isCovered = true; break; } // if @@ -866,7 +866,7 @@ void HandlerParticipantArea::onExplosionSingleCentralChanged(const AreaEffectSim if (isCovered) continue; - DEBUG_LOG() << "Participant " << participantPosition.participantId() << " is hit"; + DEBUG_LOG(m_logger) << "Participant " << participantPosition.participantId() << " is hit"; sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(), effectType, -1); } // for } @@ -877,7 +877,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge auto it = m_aesItemViews.find(data.aesItemId()); if (it == m_aesItemViews.end()) { - WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId(); + WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId(); return; } CentralEffectSimulation::AesItemViewUtm &aesItemView = *it; @@ -904,7 +904,7 @@ void HandlerParticipantArea::calculateImpacts(const AreaEffectSimulation::Trigge // already checked (bit is already 0) if (!LtsUtils::BitArray::testBit(aesItemView.handledImpacts, bitFieldIdx)) continue; - DEBUG_LOG() << "New impact at idx " << bitFieldIdx; + DEBUG_LOG(m_logger) << "New impact at idx " << bitFieldIdx; bitsToCheck += bitFieldIdx; } @@ -933,7 +933,7 @@ void HandlerParticipantArea::calculateImpacts(const CentralEffectSimulation::Aes { const bool bIsSmartChargeType = m_ddsHandler->isSmartChargeType(itemView.chargeTypeId); - DEBUG_LOG() << "calculateImpacts, isSMart: " << bIsSmartChargeType; + DEBUG_LOG(m_logger) << "calculateImpacts, isSMart: " << bIsSmartChargeType; // get radius of munition const double impactRadius = m_ddsHandler->chargeTypeRadius(itemView.chargeTypeId); @@ -970,30 +970,30 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae if (remaining < 0) return; - DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes() + DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes() << " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea() << " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeTypeId) << " participantId=" << participantPosition.participantId(); if (!m_ddsHandler->isSmartChargeType(itemView.chargeTypeId)) { - DEBUG_LOG() << "don't sendCesHitRequest Smart Type return"; + DEBUG_LOG(m_logger) << "don't sendCesHitRequest Smart Type return"; return; } const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() << " equipNo = " << equipNo << " aesItemId =" << itemView.aesItemId; // participantPosition.participantPosition == 0 -> send to all if (participantPosition.participantId() != 0 && equipNo <= 0) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ; return; } if (participantPosition.participantId() != 0 && participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } @@ -1018,14 +1018,14 @@ void HandlerParticipantArea::sendCesHitRequest(const CentralEffectSimulation::Ae itemView.partyId, // originPartyId mineFieldBitIndex ); - DEBUG_LOG() << " participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId << " legacyChargeTypeId=" << legacyChargeTypeId; m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } } @@ -1041,26 +1041,26 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt int32_t legacyChargeTypeId = 0; legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeTypeId()); - DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes() + DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << std::boolalpha << Settings::calculateCentralAes() << " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea() << " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeTypeId()) << " participantId=" << participantPosition.participantId(); const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() << " equipNo = " << equipmentNumber << " aesItemId =" << itemView.aesItemId(); // participantPosition.participantPosition == 0 -> send to all if (participantPosition.participantId() != 0 && equipmentNumber <= 0) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ; return; } // if if (participantPosition.participantId() != 0 && participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } // if @@ -1074,13 +1074,13 @@ void HandlerParticipantArea::sendCesHitRequest(const AreaEffectSimulation::AesIt equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber, remaining, pos, effectTime, itemView.partyId().get(), mineFieldBitIndex ); - DEBUG_LOG() << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId() + DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeTypeId() << " legacyChargeTypeId=" << legacyChargeTypeId; m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } // if } @@ -1099,7 +1099,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation: typeClass == ParticipantManagement::TypeClass_def::Vessel || typeClass == ParticipantManagement::TypeClass_def::Unknown) { - DEBUG_LOG() << "Participant with id " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "Participant with id " << participantPosition.participantId() << " has invalid typeClass: " << typeClass << " eventType: " << eventType; return; @@ -1108,7 +1108,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation: if (!eventMustBeSend(itemView.aesItemId, participantPosition.participantId(), eventType)) { - DEBUG_LOG() << "Not sending Event " << eventType << " for participant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantPosition.participantId() << " and aes " << itemView.aesItemId << " - already sent"; return; } @@ -1125,7 +1125,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation: calculateAes = true; else { - DEBUG_LOG() << "!participantPosition.insideWlsArea()"; + DEBUG_LOG(m_logger) << "!participantPosition.insideWlsArea()"; calculateAes = false; } } @@ -1138,19 +1138,19 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation: || eventType == ProjectDataManagement::EventType_def::HitMine || eventType == ProjectDataManagement::EventType_def::HitN)) { - DEBUG_LOG() << "send hit events only with central AES Simulation participant=" << participantPosition.participantId(); + DEBUG_LOG(m_logger) << "send hit events only with central AES Simulation participant=" << participantPosition.participantId(); return; } int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); if (equipmentNumber <= 0) { - WARNING_LOG() << "Not sending Event " << eventType << " for participant " << participantPosition.participantId() + WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantPosition.participantId() << " - participant has no equipment number"; return; } - DEBUG_LOG() << "sendParticipantEvent" << eventType + DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType << " participantId=" << participantPosition.participantId() << " AesItemId=" << itemView.aesItemId; @@ -1182,7 +1182,7 @@ void HandlerParticipantArea::sendParticipantEvent(const CentralEffectSimulation: else pe.friendlyFire(false); - INFO_LOG() << "sendParticipantEvent: " << pe + INFO_LOG(m_logger) << "sendParticipantEvent: " << pe << ", currentMSecsSinceEpoch = " << QDateTime::currentMSecsSinceEpoch() << ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime(); m_ddsHandler->dtsCes()->publish(pe); @@ -1208,7 +1208,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation:: case Settings::AES_CALCUALTION_ONLY_IN_WLS_AREA: if (!participantPosition.insideWlsArea()) { - DEBUG_LOG() << "!participantPosition.insideWlsArea()"; + DEBUG_LOG(m_logger) << "!participantPosition.insideWlsArea()"; return; } } @@ -1229,7 +1229,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation:: effectType, mineFieldBitIndex, participantPosition.insideBuilding())) { - DEBUG_LOG() << "Not sending EffectType event " << toString(effectType) + DEBUG_LOG(m_logger) << "Not sending EffectType event " << toString(effectType) << ", participant: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId << mfb @@ -1237,7 +1237,7 @@ void HandlerParticipantArea::sendEffectTypeEvent(const CentralEffectSimulation:: return; } const int ctasEffectType = static_cast(effectType) & 0xffff; - DEBUG_LOG() << "Sending EffectType event " << toString(effectType) + DEBUG_LOG(m_logger) << "Sending EffectType event " << toString(effectType) << ", participant: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId << mfb @@ -1259,7 +1259,7 @@ bool HandlerParticipantArea::eventMustBeSend(int aesItemId, // - only send event if it was not already sent if (activeEvents.contains(eventType)) { - DEBUG_LOG() << "activeEvents=" << eventType; + DEBUG_LOG(m_logger) << "activeEvents=" << eventType; return false; } @@ -1309,7 +1309,7 @@ bool HandlerParticipantArea::effectTypeMustBeSend(int aesItemId, // - only send event if it was not already sent if (activeEffects.contains(effectType)) { - DEBUG_LOG() << "effectTypeStates already contains aesItemId " << aesItemId; + DEBUG_LOG(m_logger) << "effectTypeStates already contains aesItemId " << aesItemId; return false; } activeEffects += effectType; @@ -1416,7 +1416,7 @@ bool HandlerParticipantArea::inCircle(const QPointF ¢erUtm, const double rad { double squareDist = CentralEffectSimulation::getSquareDistance(centerUtm, pointUtm); double squareRadius = radius * radius; - DEBUG_LOG() << "squareDist: " << squareDist << ", squareRadius: " << squareRadius; + DEBUG_LOG(m_logger) << "squareDist: " << squareDist << ", squareRadius: " << squareRadius; return (squareDist < squareRadius); } // inCircle @@ -1465,7 +1465,7 @@ EffectType HandlerParticipantArea::effectTypeForNContaminationArea(const Central if (squareDist <= pow(itemView.radials.at(0), 2)) { // 5s delay - DEBUG_LOG() << "partPosSampleTime: " << partPosSampleTime + DEBUG_LOG(m_logger) << "partPosSampleTime: " << partPosSampleTime << ", itemView.effectStart: " << itemView.effectStart; if (partPosSampleTime < itemView.effectStart + 5000) return EffectType::NContaminationDetonation; @@ -1499,12 +1499,12 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId) const auto effectTypLeave = leaveEffectTypeForAesType(aiv.aesTypeId); if (effectTypLeave != EffectType::Unknown) { - DEBUG_LOG() << "aesItemViewRemoved, leaveEffectType: " << toString(effectTypLeave); + DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEffectType: " << toString(effectTypLeave); auto it = m_effectTypeStates.find(aesItemId); if (it != m_effectTypeStates.end()) { const QHash> &participants = it.value(); - DEBUG_LOG() << "aesItemViewRemoved, sending leave events to " << participants.size() + DEBUG_LOG(m_logger) << "aesItemViewRemoved, sending leave events to " << participants.size() << " participants"; for (auto itP = participants.begin(); itP != participants.end(); ++ itP) sendEffectTypeEvent(aiv, m_handlerParticipant->position(itP.key()), effectTypLeave, -1, -1); @@ -1513,12 +1513,12 @@ void HandlerParticipantArea::aesItemViewRemoved(int aesItemId) const auto eventTypeLeave = leaveEventTypeForAesType(aiv.aesTypeId); if (eventTypeLeave != ProjectDataManagement::EventType::Unknown) { - DEBUG_LOG() << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave; + DEBUG_LOG(m_logger) << "aesItemViewRemoved, leaveEventType: " << eventTypeLeave; auto it = m_eventStates.find(aesItemId); if (it != m_eventStates.end()) { const QHash> &participants = it.value(); - DEBUG_LOG() << "aesItemViewRemoved, sending leave events to " << participants.size() + DEBUG_LOG(m_logger) << "aesItemViewRemoved, sending leave events to " << participants.size() << " participants"; for (auto itP = participants.begin(); itP != participants.end(); ++ itP) sendParticipantEvent(aiv, m_handlerParticipant->position(itP.key()), eventTypeLeave); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.h index 7badc72dd..8080ffd3e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/handler_participant_area.h @@ -70,6 +70,7 @@ public: bool init(); protected: + NGL::INGLLogger &m_logger; void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final; private Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.cpp index d2381b5e4..a7456cc5c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.cpp @@ -58,7 +58,7 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId) m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init()" + INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -69,15 +69,15 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerAesData->init()) { - ERROR_LOG() << "Initialisation HandlerAesData failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerAesData failed."; return false; } - INFO_LOG() << "initialize HandlerBuildingModel ----------------------------"; + INFO_LOG(m_logger) << "initialize HandlerBuildingModel ----------------------------"; m_handlerBuildingModel = std::make_shared(m_ddsHandler, m_handlerAesData, this); if (!m_handlerBuildingModel->init()) { - ERROR_LOG() << "Initialisation HandlerBuildingModel failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerBuildingModel failed."; return false; } // if @@ -91,11 +91,11 @@ bool Ces2DInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerParticipantArea->init()) { - ERROR_LOG() << "Initialisation HandlerParticipantArea failed."; + ERROR_LOG(m_logger) << "Initialisation HandlerParticipantArea failed."; return false; } - INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::init() return true"; return true; } @@ -103,8 +103,8 @@ QString Ces2DInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CentralEffectSimulation2DInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CentralEffectSimulation2DInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CentralEffectSimulation2DInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CentralEffectSimulation2DInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CentralEffectSimulation2DInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.h index b94223509..20e8b7597 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Ces2D/plugin.h @@ -65,6 +65,7 @@ private Q_SLOTS: bool init(int domainId, int exerciseId) override; private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp; std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ECHO/echoplugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ECHO/echoplugin.h index 93aff6286..de7062963 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ECHO/echoplugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/ECHO/echoplugin.h @@ -45,6 +45,7 @@ public: private Q_SLOTS: private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp; }; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_explosions.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_explosions.cpp index 2d4c9f6f3..8a2eca970 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_explosions.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_explosions.cpp @@ -53,7 +53,7 @@ HandlerExplosions::~HandlerExplosions() //----------------------------------------------------------------------------- bool HandlerExplosions::init() { - DEBUG_LOG() << "HandlerExplosions::init()"; + DEBUG_LOG(m_logger) << "HandlerExplosions::init()"; auto dtcAes = m_ddsHandler->dtcAes(); auto ftcTab = m_ddsHandler->ftcTab(); auto dtcCes = m_ddsHandler->dtsCes(); @@ -95,9 +95,9 @@ bool HandlerExplosions::init() void HandlerExplosions::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send CesHitRequest: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send CesHitRequest: " << replyObject(); else - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } @@ -127,7 +127,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct()); bool isCentral = false; - DEBUG_LOG() << "onAesItemViewChanged 1 " + DEBUG_LOG(m_logger) << "onAesItemViewChanged 1 " << ", aesItemId=" << aesItemId << ", aesTypeId=" << aesTypeId << ", chargeTypeId=" << chargeTypeId @@ -142,7 +142,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem { const AreaEffectSimulation::ExplosionSingle &explosionSingle = m_ddsHandler->dtcAes()->explosionSingle(aesItemId); isCentral = explosionSingle.isCentral(); - DEBUG_LOG() << "ExplosionSingle"; + DEBUG_LOG(m_logger) << "ExplosionSingle"; break; } case AreaEffectSimulation::AesType::AtExplosionArea: @@ -150,24 +150,24 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem { const AreaEffectSimulation::ExplosionArea &explosionArea = m_ddsHandler->dtcAes()->explosionArea(aesItemId); isCentral = explosionArea.isCentral(); - DEBUG_LOG() << "explosionArea"; + DEBUG_LOG(m_logger) << "explosionArea"; break; } case AreaEffectSimulation::AesType::AtExplosionCluster: { const AreaEffectSimulation::ExplosionCluster &explosionCluster = m_ddsHandler->dtcAes()->explosionCluster(aesItemId); isCentral = explosionCluster.isCentral() || m_ddsHandler->isLaserGuidable(explosionCluster.chargeStruct()); - DEBUG_LOG() << "explosionCluster"; + DEBUG_LOG(m_logger) << "explosionCluster"; break; } default: - DEBUG_LOG() << "default, data.aesTypeId=" << aesTypeId; + DEBUG_LOG(m_logger) << "default, data.aesTypeId=" << aesTypeId; } // switch // skip SMART if (m_ddsHandler->isSmartChargeType(data.chargeStruct())) { - DEBUG_LOG() << " S M A R T return onAesItemViewChanged"; + DEBUG_LOG(m_logger) << " S M A R T return onAesItemViewChanged"; return; } // if @@ -178,7 +178,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem // just for isCentral == true // - DEBUG_LOG() << "onAesItemViewChanged 2 aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "onAesItemViewChanged 2 aesItemId=" << aesItemId << " isCentral=" << isCentral; const bool isSupplyTruck = false; @@ -190,7 +190,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem isSupplyTruck); // default for useHazardDistance, hazardDistance - DEBUG_LOG() << "onAesItemViewChanged 3" + DEBUG_LOG(m_logger) << "onAesItemViewChanged 3" << ", aesItemId=" << aesItemId << ", aesTypeId=" << aesTypeId << ", chargeTypeId=" << chargeTypeId @@ -206,7 +206,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem case AreaEffectSimulation::AesEffectState_def::EsExpired: case AreaEffectSimulation::AesEffectState_def::EsRemoved: { - DEBUG_LOG() << " remove aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << " remove aesItemId=" << data.aesItemId(); // do some cleanup: m_handledImpactsStorage.removeAesItem(aesItemId); Q_FALLTHROUGH(); @@ -233,7 +233,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem // jetzt sollte m_enteredHazardDistanceStore eigentlich bereinigt sein: const int remaingPartIdsInArea = m_enteredHazardDistanceStore.allParticipantIdsOfArea(aesItemId).size(); - DEBUG_LOG() << " remaingParticipantIdsInArea=" << remaingPartIdsInArea; + DEBUG_LOG(m_logger) << " remaingParticipantIdsInArea=" << remaingPartIdsInArea; Q_ASSERT(remaingPartIdsInArea == 0); m_enteredHazardDistanceStore.removeArea(aesItemId); @@ -242,7 +242,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem // cleanup: if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsPaused) { - DEBUG_LOG() << "Expired, remove aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "Expired, remove aesItemId=" << aesItemId << ", m_aesItemViewsUtm.remove(" << aesItemId << ")"; m_aesItemViewsUtm.remove(aesItemId); m_aesItemViewsImpactsUtm.remove(aesItemId); @@ -256,11 +256,11 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem case AreaEffectSimulation::AesEffectState_def::EsFired: case AreaEffectSimulation::AesEffectState_def::EsActivated: { - DEBUG_LOG() << "Got AesItemView: " << data.effectStateId() + DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId() << " aesItemId=" << aesItemId << " isCentral=" << isCentral; - DEBUG_LOG() << "insert AesItemView: " << data.effectStateId() + DEBUG_LOG(m_logger) << "insert AesItemView: " << data.effectStateId() << " aesItemViewUtm.effectStateId=" << aesItemViewUtm.effectStateId << " chargeTypeId" << aesItemViewUtm.chargeStruct.chargeTypeId(); @@ -277,7 +277,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem data.chargeStruct().igniterTypeId(), data.chargeStruct().igniterFunctionId()); - DEBUG_LOG() << "+++++++++++ ExplosionCluster: hazardDistance=" << hazardDistance + DEBUG_LOG(m_logger) << "+++++++++++ ExplosionCluster: hazardDistance=" << hazardDistance << ", impactRadius =" << impactRadius; aesItemViewUtm.hazardDistance_meter = hazardDistance; aesItemViewUtm.hazardDistanceForm = ExpandPolygon::bufferUtmPolygon(aesItemViewUtm.form, aesItemViewUtm.zone, hazardDistance); @@ -289,7 +289,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem else { m_aesItemViewsUtm.insert(aesItemId, aesItemViewUtm); - DEBUG_LOG() << "m_aesItemViewsUtm.insert aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << "m_aesItemViewsUtm.insert aesItemId=" << aesItemId; } // @@ -308,7 +308,7 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem const int numberOfParametrizedObjects = checkPartEnterLeaveArea(m_aesItemViewsUtm.constBegin(), m_aesItemViewsUtm.constEnd(), // parametrize a single item participantPositions.constBegin(), participantPositions.constEnd()); - DEBUG_LOG() << "++++++++ checkPartEnterLeaveArea checkPartEnterLeaveAreaNumber=" << numberOfParametrizedObjects; + DEBUG_LOG(m_logger) << "++++++++ checkPartEnterLeaveArea checkPartEnterLeaveAreaNumber=" << numberOfParametrizedObjects; } } // if (aesItemViewUtm.effectStart == AreaEffectSimulation::AesEffectState::EsActivated) break; @@ -321,11 +321,11 @@ void HandlerExplosions::onAesItemViewChanged(const AreaEffectSimulation::AesItem void HandlerExplosions::onTriggeredImpactsChanged(const AreaEffectSimulation::TriggeredImpacts &data, DataModification modType) { - DEBUG_LOG() << "onTriggeredImpactsChanged"; + DEBUG_LOG(m_logger) << "onTriggeredImpactsChanged"; if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "Got TriggeredImpacts: " << data + DEBUG_LOG(m_logger) << "Got TriggeredImpacts: " << data << " bitfield().size=" << data.bitfield().size(); switch (data.aesTypeId().underlying()) { @@ -357,10 +357,10 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect { if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number continue; - DEBUG_LOG() << "pPos.participantId=" << pPos.participantId(); + DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId(); if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) continue; - DEBUG_LOG() << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; + DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; if (pPos.insideBuilding()) continue; @@ -374,7 +374,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect if (inCircle(impactPositionUtm, impactRadius, participantPosUtm)) { - DEBUG_LOG() << "Teilnehmer getroffen => Send CesHitRequest "; + DEBUG_LOG(m_logger) << "Teilnehmer getroffen => Send CesHitRequest "; TrainingAreaBase::TabPosition tabPosition; TrainingAreaBase::SendCesHitRequest requestTab; @@ -395,7 +395,7 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect requestTab.originatorEquipmentNumber(part.equipmentNumber().get()); else { - WARNING_LOG() << "Sending CesHitRequest without EquipNo, using negative ParticipantID : " << data.originatorId(); + WARNING_LOG(m_logger) << "Sending CesHitRequest without EquipNo, using negative ParticipantID : " << data.originatorId(); requestTab.originatorEquipmentNumber(-data.originatorId()); } } @@ -412,13 +412,13 @@ void HandlerExplosions::calculateImpact(const AreaEffectSimulation::ChargeEffect requestTab.mineId(0); requestTab.partyId(originator.partyId()); - DEBUG_LOG() << " participantId=" << pPos.participantId() + DEBUG_LOG(m_logger) << " participantId=" << pPos.participantId() << ", chargeTypeId=" << data.chargeTypeId() << ", m_sendCesHitRequestQueue.size()=" << m_sendCesHitRequestQueue.size() << ", duration=" << data.effectDuration() << " \n" << requestTab; - DEBUG_LOG() << "ftcTab->SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "ftcTab->SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } @@ -432,7 +432,7 @@ void HandlerExplosions::startTimer(int id, int msec) { // Timeout-Slot mit echtem SLOT connect(timer, &QTimer::timeout, this, &HandlerExplosions::onStartTimeReached); timer->start(msec); - DEBUG_LOG() << "Timer " << id << " gestartet fuer " << msec << " ms."; + DEBUG_LOG(m_logger) << "Timer " << id << " gestartet fuer " << msec << " ms."; } void HandlerExplosions::onStartTimeReached() @@ -445,7 +445,7 @@ void HandlerExplosions::onStartTimeReached() if (!bOk) return; - DEBUG_LOG() << "Timer " << chargeEffectId << " ausgeloest!"; + DEBUG_LOG(m_logger) << "Timer " << chargeEffectId << " ausgeloest!"; // Timer stoppen und loeschen AreaEffectSimulation::ChargeEffect data = m_chargeEffects.value(chargeEffectId); @@ -457,12 +457,12 @@ void HandlerExplosions::onStartTimeReached() void HandlerExplosions::onChargeEffectChanged(const AreaEffectSimulation::ChargeEffect &data, DataModification modType) { - DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged"; + DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged"; if (modType == DataModification::eRemoved) return; const long long effectStart = data.effectStart(); - DEBUG_LOG() << "HandlerExplosions::onChargeEffectChanged" + DEBUG_LOG(m_logger) << "HandlerExplosions::onChargeEffectChanged" << ", effectStart=" << effectStart << ", currentPartitionTime=" << m_ddsHandler->currentPartitionTime(); @@ -470,48 +470,48 @@ void HandlerExplosions::onChargeEffectChanged(const AreaEffectSimulation::Charge // Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden if ( effectStart < m_ddsHandler->currentPartitionTime() - 3000 ) { - DEBUG_LOG() << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden"; + DEBUG_LOG(m_logger) << "Startzeit in der Vergangenheit: aktuelle Zeit - 3 Sekunden"; return; } // Startzeit entspricht der aktuellen Zeit if ( effectStart > m_ddsHandler->currentPartitionTime() - 3000 && effectStart < m_ddsHandler->currentPartitionTime() + data.effectDuration() ) { - DEBUG_LOG() << "Startzeit entspricht der aktuellen Zeit"; + DEBUG_LOG(m_logger) << "Startzeit entspricht der aktuellen Zeit"; calculateImpact(data); } // Startzeit in der Zukunft: else if (effectStart > m_ddsHandler->currentPartitionTime() + data.effectDuration()) { // Start mit Timer - DEBUG_LOG() << "Startzeit in der Zukunft" + DEBUG_LOG(m_logger) << "Startzeit in der Zukunft" << ", id :" << data.id() << ", duration=" << effectStart - m_ddsHandler->currentPartitionTime(); m_chargeEffects.insert(data.id(), data); startTimer(data.id(), effectStart - m_ddsHandler->currentPartitionTime()); } - DEBUG_LOG() << "END onChargeEffectChanged"; + DEBUG_LOG(m_logger) << "END onChargeEffectChanged"; } void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType) { - DEBUG_LOG() << "\n onExplosionSingleChanged id=" << data.id() + DEBUG_LOG(m_logger) << "\n onExplosionSingleChanged id=" << data.id() << " AesEffectState=" << data.effectStateId(); if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "onExplosionSingleChanged 1"; + DEBUG_LOG(m_logger) << "onExplosionSingleChanged 1"; if (data.effectStateId() != AreaEffectSimulation::AesEffectState_def::EsActivated) return; - DEBUG_LOG() << "onExplosionSingleChanged" + DEBUG_LOG(m_logger) << "onExplosionSingleChanged" << " isCentral=" << data.isCentral(); if (!data.isCentral()) return; - DEBUG_LOG() << "onExplosionSingle Activated isCentral=" << data.isCentral() + DEBUG_LOG(m_logger) << "onExplosionSingle Activated isCentral=" << data.isCentral() << " id=" << data.id(); // get access to the aesItemViewUtm storing the data for bbox check: @@ -521,7 +521,7 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp else if (m_aesItemViewsImpactsUtm.contains(data.id())) aesItemViewUtm = m_aesItemViewsImpactsUtm.value(data.id()); else - ERROR_LOG() << "Kein AesItemViewUtm "; + ERROR_LOG(m_logger) << "Kein AesItemViewUtm "; // Now call calculateImpacts() (createEvent if in circle...) const auto &participantPositions = m_handlerParticipant->positions(); @@ -534,7 +534,7 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp if (m_ddsHandler->isSmartChargeType(data.chargeStruct())) { - DEBUG_LOG() << " S M A R T " + DEBUG_LOG(m_logger) << " S M A R T " << " aesItemId=" << aesItemViewUtm.aesItemId << " chargeTypeId=" << data.chargeStruct().chargeTypeId() << " partyId=" << aesItemViewUtm.partyId @@ -547,18 +547,18 @@ void HandlerExplosions::onExplosionSingleChanged(const AreaEffectSimulation::Exp { if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number continue; - DEBUG_LOG() << "pPos.participantId=" << pPos.participantId(); + DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId(); if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) continue; - DEBUG_LOG() << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; + DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; if (pPos.insideBuilding()) continue; - DEBUG_LOG() << "pPos.insideBuilding=" << pPos.insideBuilding(); + DEBUG_LOG(m_logger) << "pPos.insideBuilding=" << pPos.insideBuilding(); if (!inBoundingBoxCheck(aesItemViewUtm, pPos)) continue; - DEBUG_LOG() << "calculateImpacts zone=" << aesItemViewUtm.zone; + DEBUG_LOG(m_logger) << "calculateImpacts zone=" << aesItemViewUtm.zone; const Core::GeoPosition impactPosition3D(data.impactPosition().lon(), data.impactPosition().lat(), 0.0); Options options; @@ -594,14 +594,14 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef { if (m_ddsHandler->isSmartChargeType(aesItem.chargeStruct())) { - DEBUG_LOG() << "Calculate SMART"; + DEBUG_LOG(m_logger) << "Calculate SMART"; calculateSmartEffect(effects); return; } } else { - DEBUG_LOG() << "No aesItem found for effect aesItemId=" << effects.aesItemId(); + DEBUG_LOG(m_logger) << "No aesItem found for effect aesItemId=" << effects.aesItemId(); } // get access to the aesItemViewUtm storing the data for bbox check: @@ -611,7 +611,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef // AesItem will be created _BEOFRE_ effects (Topic Effects) could be published: if (aesItemViewUtm.aesItemId != aesItemId) { - DEBUG_LOG() << "aesItemViewUtm (with extent) not found for aesItemId =" << aesItemId + DEBUG_LOG(m_logger) << "aesItemViewUtm (with extent) not found for aesItemId =" << aesItemId << " perhaps the field is not central, expired or SMART return onEffectsChanged"; return; } @@ -623,7 +623,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef const int chargeTypeId = aesItemViewUtm.chargeStruct.chargeTypeId(); const ProjectDataManagement::GearClass &gearClass = m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(chargeTypeId); - DEBUG_LOG() << "onEffectsChanged, aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "onEffectsChanged, aesItemId=" << aesItemId << ", chargeTypeId = " << chargeTypeId << ", gearClass = " << gearClass; @@ -653,7 +653,7 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef // now triggeredEffectsLtsCoord stores the (new) GeoPositions to be calculated: - DEBUG_LOG() << "Effects of aesItemId =" << aesItemId + DEBUG_LOG(m_logger) << "Effects of aesItemId =" << aesItemId << ", number of new SingleEffects (in this timeslot) = " << triggeredEffectsLtsCoord.size(); // Now call calculateImpacts() (createEvent if in circle...) @@ -664,27 +664,27 @@ void HandlerExplosions::onEffectsChanged(const AreaEffectSimulation::Effects &ef continue; if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number continue; - DEBUG_LOG() << "pPos.participantId=" << pPos.participantId() + DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId() << ", vulnerabilityState=" << pPos.vulnerabilityState; if (pPos.insideBuilding()) continue; - DEBUG_LOG() << "pPos.insideBuilding=" << pPos.insideBuilding(); + DEBUG_LOG(m_logger) << "pPos.insideBuilding=" << pPos.insideBuilding(); // skip inBoundingBoxCheck for ExplosionCluster since impacts could be OUTSIDE of bbox (intersection with bldg) // if (!inBoundingBoxCheck(aesItemViewUtm, pPos)) // continue; - DEBUG_LOG() << "calculateImpactsEffect for participantId " << pPos.participantId() + DEBUG_LOG(m_logger) << "calculateImpactsEffect for participantId " << pPos.participantId() << " Pos=" << pPos.ltsCoordinate().toString() << " ...."; // both: BLDG_LOS, ELEVATION_LOS Options options = EXECUTE_BLDG_LOS_CALC | EXECUTE_ELEVATION_LOS_CALC; calculateImpactsEffect(aesItemViewUtm, triggeredEffectsLtsCoord, pPos, options); - DEBUG_LOG() << "calculateImpactsEffect for participantId " << pPos.participantId() << " DONE"; + DEBUG_LOG(m_logger) << "calculateImpactsEffect for participantId " << pPos.participantId() << " DONE"; } // for const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos - INFO_LOG() << " onEffectsChanged took [ms] " << timer.elapsed(); + INFO_LOG(m_logger) << " onEffectsChanged took [ms] " << timer.elapsed(); } // [GUEZE-2257]3D Wirksim - Gefaehrdungsabstand Zentral @@ -692,7 +692,7 @@ void HandlerExplosions::onNewParticipantCesPosition(const CentralEffectSimulatio { if (m_aesItemViewsUtm.empty()) { - TRACE_LOG() << "++++++++ onNewParticipantOutdoorPosition participantId=" << participantData.participantId() + TRACE_LOG(m_logger) << "++++++++ onNewParticipantOutdoorPosition participantId=" << participantData.participantId() << ", m_aesItemViewsUtm.size=" << m_aesItemViewsUtm.size(); return; } @@ -709,7 +709,7 @@ void HandlerExplosions::onNewParticipantCesPosition(const CentralEffectSimulatio const int numberOfParametrizedObjects = checkPartEnterLeaveArea(m_aesItemViewsUtm.constBegin(), m_aesItemViewsUtm.constEnd(), curPartIt, curPartIt + 1); // parametrize a single item - DEBUG_LOG() << "++++++++ checkPartEnterLeaveArea checkPartEnterLeaveAreaNumber=" << numberOfParametrizedObjects; + DEBUG_LOG(m_logger) << "++++++++ checkPartEnterLeaveArea checkPartEnterLeaveAreaNumber=" << numberOfParametrizedObjects; } int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER currentAreaIt, @@ -717,7 +717,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr HandlerParticipant::POSITIONS_CONST_ITER currentParticipantIt, const HandlerParticipant::POSITIONS_CONST_ITER &endingParticipantIt) { - DEBUG_LOG() << "checkPartEnterLeaveArea..."; + DEBUG_LOG(m_logger) << "checkPartEnterLeaveArea..."; int numberOfParametrizedObjects = 0; @@ -758,12 +758,12 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr // // if (participantData.insideBuilding()) // { - // DEBUG_LOG() << "Participant:" << participantData.participantId() << " inside Building"; + // DEBUG_LOG(m_logger) << "Participant:" << participantData.participantId() << " inside Building"; // continue; // } const QPointF &posUtm = participantData.ltsCoordinate().toUtm(zoneInOut); - DEBUG_LOG() << "Check, if participant with id = " << participantId + DEBUG_LOG(m_logger) << "Check, if participant with id = " << participantId << " is inside hazardDistanceForm: " << ", hasHazardDistance=" << curAivUtmArea.hasHazardDistance() << ", hazardDistance=" << curAivUtmArea.hazardDistance_meter @@ -773,10 +773,10 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr if (m_logger.isDebugEnabled()) { for (int i = 0; i < curAivUtmArea.form.size(); ++i) - DEBUG_LOG() << "form[" << i << "]=" << curAivUtmArea.form[i].x() << "/" << curAivUtmArea.form[i].y(); + DEBUG_LOG(m_logger) << "form[" << i << "]=" << curAivUtmArea.form[i].x() << "/" << curAivUtmArea.form[i].y(); if (m_logger.isTraceEnabled()) for (int i = 0; i < curAivUtmArea.hazardDistanceForm.size(); ++i) - TRACE_LOG() << "hazardDistanceForm[" << i << "]=" << curAivUtmArea.hazardDistanceForm[i].x() << "/" << curAivUtmArea.hazardDistanceForm[i].y(); + TRACE_LOG(m_logger) << "hazardDistanceForm[" << i << "]=" << curAivUtmArea.hazardDistanceForm[i].x() << "/" << curAivUtmArea.hazardDistanceForm[i].y(); } // Laut ICD GUEZSB60_ICD-0052_Zentrale_Tne.doc Wirkfeldtyp Gefahrenbereich Steilfeuer @@ -792,7 +792,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr const bool bRealInHazardDistance = participantIsInsideHazardDistance && !participantIsInsideForm; const bool bWasRealInHazardDistance = m_enteredHazardDistanceStore.hasParticipantAlreadyEnteredArea(participantId, curAivUtmArea.aesItemId); - DEBUG_LOG() << "participantId = " << participantId + DEBUG_LOG(m_logger) << "participantId = " << participantId << ", participantIsInsideHazardDistance = " << participantIsInsideHazardDistance << ", participantIsInsideForm = " << participantIsInsideForm << ", bRealInHazardDistance = " << bRealInHazardDistance @@ -810,7 +810,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr if (bRealInHazardDistance) { // part is ENTERING - DEBUG_LOG() << "Send HazardDistanceMessage to participant (ENTERING)..."; + DEBUG_LOG(m_logger) << "Send HazardDistanceMessage to participant (ENTERING)..."; sendEnterHazardDistance(participantId, curAivUtmArea.aesItemId); } @@ -836,7 +836,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr if (participantIsInsideForm) remaining = 1; - DEBUG_LOG() << "Send HazardDistanceMessage to participant (LEAVING)... remaining =" << remaining; + DEBUG_LOG(m_logger) << "Send HazardDistanceMessage to participant (LEAVING)... remaining =" << remaining; sendLeaveHazardDistance(participantData.participantId(), curAivUtmArea.aesItemId, remaining); } } // if (bWasRealInHazardDistance != bRealInHazardDistance) @@ -850,7 +850,7 @@ int HandlerExplosions::checkPartEnterLeaveArea(AES_ITEM_VIEW_UTM_CONST_ITER curr void HandlerExplosions::onRestoreRadioReadinessChanged(const int participantId) { - DEBUG_LOG() << "HandlerExplosions::onRestoreRadioReadinessChanged participantId=" << participantId; + DEBUG_LOG(m_logger) << "HandlerExplosions::onRestoreRadioReadinessChanged participantId=" << participantId; m_enteredHazardDistanceStore.removeParticipant(participantId); } @@ -858,14 +858,14 @@ void HandlerExplosions::onRestoreRadioReadinessChanged(const int participantId) bool HandlerExplosions::inBoundingBoxCheck(const CentralEffectSimulation::AesItemViewUtm &itemViewUtm, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition) { - DEBUG_LOG() << "inBoundingBoxCheck 1" + DEBUG_LOG(m_logger) << "inBoundingBoxCheck 1" << ", aesItemId=" << itemViewUtm.aesItemId << ", effectStateId=" << itemViewUtm.effectStateId; if ((itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated) && (itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsPrepared) && (itemViewUtm.effectStateId != AreaEffectSimulation::AesEffectState_def::EsFired)) return false; - DEBUG_LOG() << "inBoundingBoxCheck 2"; + DEBUG_LOG(m_logger) << "inBoundingBoxCheck 2"; // QRectF(topLeft, bottomRight) -> no need to normalize, QRectF:contains() handles it correct @@ -875,11 +875,11 @@ bool HandlerExplosions::inBoundingBoxCheck(const CentralEffectSimulation::AesIte const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemViewUtm.zone); if (boundingBoxImpact.contains(participantPosUtmPoint)) { - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " inside AesItemView:" << itemViewUtm.aesItemId; return true; } - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " outside AesItemView:" << itemViewUtm.aesItemId; return false; } // END inBoundingBoxCheck @@ -888,7 +888,7 @@ bool HandlerExplosions::inBoundingBoxCheck(const CentralEffectSimulation::AesIte // Nach der Umstellung auf 3D-WS wird der Einschlag von SMART aus dem DDS-Topic AES::Effects genommen. void HandlerExplosions::calculateSmartEffect(const AreaEffectSimulation::Effects &effects) { - DEBUG_LOG() << "calculateSmartEffect"; + DEBUG_LOG(m_logger) << "calculateSmartEffect"; AreaEffectSimulation::AesItem aesItem; bool itemAvailable = m_ddsHandler->dtcAes()->aesItemFromId(effects.aesItemId(), aesItem); @@ -896,7 +896,7 @@ void HandlerExplosions::calculateSmartEffect(const AreaEffectSimulation::Effects { for (const AreaEffectSimulation::SingleEffect &se : std::as_const(effects.singleEffects())) { - DEBUG_LOG() << Q_FUNC_INFO << " ---> singleEffect=" << se + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " ---> singleEffect=" << se << ", aesItem= " << aesItem; calculateSmartExplosion(effects.aesItemId(), aesItem.chargeStruct(), @@ -907,7 +907,7 @@ void HandlerExplosions::calculateSmartEffect(const AreaEffectSimulation::Effects } // if else { - WARNING_LOG() << "No aesItem found for effect aesItemId=" << effects.aesItemId(); + WARNING_LOG(m_logger) << "No aesItem found for effect aesItemId=" << effects.aesItemId(); } // else } // END calculateSmartEffect @@ -917,7 +917,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, const Core::GeoPosition2D &impactPosition, qint64 impactTime) { - DEBUG_LOG() << "calculateSmartExplosion " + DEBUG_LOG(m_logger) << "calculateSmartExplosion " << " partyId=" << partyId; if (partyId == 0) return; @@ -927,11 +927,11 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, QVector vehiclesInSmartExplosion; - DEBUG_LOG() << "calculateSmartExplosion chargeTypeId=" << chargeStruct.chargeTypeId(); + DEBUG_LOG(m_logger) << "calculateSmartExplosion chargeTypeId=" << chargeStruct.chargeTypeId(); // Insert all Vehicles inside of explosion-Radius in list vehiclesInSmartExplosion const double searchRadius = m_ddsHandler->searchRadius(chargeStruct); // where the smart munition should search for targets const double impactRadius = m_ddsHandler->chargeTypeRadius(chargeStruct); // the real explosion area radius - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)"; + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)"; bool bHumanFound = false; const auto &participantPositions = m_handlerParticipant->positions(); @@ -943,7 +943,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), impactPosZone); ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId()); - DEBUG_LOG() << "participant id=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "participant id=" << participantPosition.participantId() << " participantTypeId=" << participantPosition.participantTypeId() << " partyType =" << participantPosition.partyId() << " typeClass=" << typeClass; @@ -957,10 +957,10 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, typeClass != ParticipantManagement::TypeClass_def::WeaponSystem) continue; - DEBUG_LOG() << "participantPosition.timestamp =" << participantPosition.sampleTime() + DEBUG_LOG(m_logger) << "participantPosition.timestamp =" << participantPosition.sampleTime() << " effectTime = " << m_ddsHandler->currentPartitionTime(); - DEBUG_LOG() << "Vehicle => calculate SMART participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "Vehicle => calculate SMART participantId=" << participantPosition.participantId() << " ImpactPos=" << CentralEffectSimulation::debug(impactPos) << " searchRadius=" << searchRadius << " participantPosition=" << CentralEffectSimulation::debug(participantPosUtmPoint); @@ -969,7 +969,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, ParticipantDistance oneEntry; oneEntry.squareDistance = CentralEffectSimulation::getSquareDistance(impactPos, participantPosUtmPoint); oneEntry.participantPosition = participantPosition; - DEBUG_LOG() << "squareDistance = " << oneEntry.squareDistance + DEBUG_LOG(m_logger) << "squareDistance = " << oneEntry.squareDistance << " append participantId=" << participantPosition.participantId(); vehiclesInSmartExplosion.append(std::move(oneEntry)); } @@ -978,10 +978,10 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, CentralEffectSimulation::AesItemViewUtm itemViewUtm = m_aesItemViewsImpactsUtm.value(aesItemId); itemViewUtm.chargeStruct = chargeStruct; // SingleExplosion: no Entry itemViewUtm.aesItemId = aesItemId; - DEBUG_LOG() << "aesItemViewUtm itemView.chargeTypeId =" << itemViewUtm.chargeStruct.chargeTypeId(); + DEBUG_LOG(m_logger) << "aesItemViewUtm itemView.chargeTypeId =" << itemViewUtm.chargeStruct.chargeTypeId(); if (vehiclesInSmartExplosion.size() == 0) { - DEBUG_LOG() << "size=0"; + DEBUG_LOG(m_logger) << "size=0"; if (bHumanFound) { CentralEffectSimulation::HandlerParticipant::CesParticipantData pos; @@ -993,7 +993,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, } else if (vehiclesInSmartExplosion.size() == 1) { - DEBUG_LOG() << "size=1"; + DEBUG_LOG(m_logger) << "size=1"; // send two single fire to the same vehicle sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime , 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent sendCesHitRequest( itemViewUtm, vehiclesInSmartExplosion.first().participantPosition, impactTime + 1000, 100, ProjectDataManagement::EventType_def::HitEffectSimulation); // 100 Percent @@ -1002,7 +1002,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, } else { - DEBUG_LOG() << "size=" << vehiclesInSmartExplosion.size(); + DEBUG_LOG(m_logger) << "size=" << vehiclesInSmartExplosion.size(); // send single fire to the two nearest vehicles // sort the list by the distance @@ -1024,7 +1024,7 @@ void HandlerExplosions::calculateSmartExplosion(const int32_t aesItemId, // Check for all participants wheter he is in the explosion area void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredImpacts &data) { - DEBUG_LOG() << "calculateImpacts m_aesItemViewsImpactsUtm.size " << m_aesItemViewsImpactsUtm.size(); + DEBUG_LOG(m_logger) << "calculateImpacts m_aesItemViewsImpactsUtm.size " << m_aesItemViewsImpactsUtm.size(); // older then 10sec? ignore if (data.sampleTime() < m_ddsHandler->currentPartitionTime() - 10 * 1000) @@ -1032,7 +1032,7 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm if (!m_aesItemViewsImpactsUtm.contains(data.aesItemId())) { - DEBUG_LOG() << "calculateImpacts no aesItemId " << data.aesItemId(); + DEBUG_LOG(m_logger) << "calculateImpacts no aesItemId " << data.aesItemId(); return; } @@ -1043,13 +1043,13 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm aesItemViewUtm = m_aesItemViewsImpactsUtm.value(static_cast(data.aesItemId())); else aesItemViewUtm = m_aesItemViewsUtm.value(static_cast(data.aesItemId())); - DEBUG_LOG() << "m_aesItemViewsUtm.insert aesItemId=" << aesItemViewUtm.aesItemId; + DEBUG_LOG(m_logger) << "m_aesItemViewsUtm.insert aesItemId=" << aesItemViewUtm.aesItemId; const bool bIsSmartChargeType = m_ddsHandler->isSmartChargeType(aesItemViewUtm.chargeStruct); - DEBUG_LOG() << "calculateImpacts, isSMart: " << bIsSmartChargeType; + DEBUG_LOG(m_logger) << "calculateImpacts, isSMart: " << bIsSmartChargeType; - DEBUG_LOG() << "XXXXXXXXXXXX calculateImpacts1 " << data.aesItemId(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXXX calculateImpacts1 " << data.aesItemId(); QVector bitsToCheck; for (int bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx) @@ -1062,14 +1062,14 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm continue; bitsToCheck += bitFieldIdx; - DEBUG_LOG() << "bitsToCheck+=" << bitFieldIdx; + DEBUG_LOG(m_logger) << "bitsToCheck+=" << bitFieldIdx; // update storage ('remember') m_handledImpactsStorage.setIndexProcessed(data.aesItemId(), bitFieldIdx); if (bIsSmartChargeType) { - DEBUG_LOG() << "XXXXXXXXXXXX SMART"; + DEBUG_LOG(m_logger) << "XXXXXXXXXXXX SMART"; calculateSmartExplosion(aesItemViewUtm.aesItemId, aesItemViewUtm.chargeStruct, aesItemViewUtm.partyId, aesItemViewUtm.formGeo[bitFieldIdx], m_ddsHandler->currentPartitionTime()); } } @@ -1082,14 +1082,14 @@ void HandlerExplosions::calculateImpacts(const AreaEffectSimulation::TriggeredIm { if (m_handlerParticipant->isOutdated(pPos)) // Participant Position is not valid Todo Magic Number continue; - DEBUG_LOG() << "pPos.participantId=" << pPos.participantId(); + DEBUG_LOG(m_logger) << "pPos.participantId=" << pPos.participantId(); if (pPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) continue; - DEBUG_LOG() << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; + DEBUG_LOG(m_logger) << "pPos.vulnerabilityState=" << pPos.vulnerabilityState; if (pPos.insideBuilding()) continue; - DEBUG_LOG() << "pPos.insideBuilding=" << pPos.insideBuilding(); - DEBUG_LOG() << "calculateImpacts"; + DEBUG_LOG(m_logger) << "pPos.insideBuilding=" << pPos.insideBuilding(); + DEBUG_LOG(m_logger) << "calculateImpacts"; calculateImpacts(aesItemViewUtm, bitsToCheck, pPos); } @@ -1100,13 +1100,13 @@ void HandlerExplosions::calculateImpacts(const CentralEffectSimulation::AesItemV const QVector &impactsToCheck, const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition) { - DEBUG_LOG() << "calculateImpacts"; + DEBUG_LOG(m_logger) << "calculateImpacts"; // get radius of munition const double impactRadius = m_ddsHandler->chargeTypeRadius(itemView.chargeStruct); const QPointF &participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone); - DEBUG_LOG() << "XXXXXXXXXXXX calculateImpacts2a impactsToCheck.size " << impactsToCheck.size(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXXX calculateImpacts2a impactsToCheck.size " << impactsToCheck.size(); for (int bitFieldIdx : std::as_const(impactsToCheck)) { @@ -1116,7 +1116,7 @@ void HandlerExplosions::calculateImpacts(const CentralEffectSimulation::AesItemV // get position of impact to corresponding bit const QPointF &impactPos = itemView.form.value(bitFieldIdx); - DEBUG_LOG() << "XXXXXXXXXXXX calculateImpacts2b check impactPos: x= " << impactPos.x() << " y=" << impactPos.y(); + DEBUG_LOG(m_logger) << "XXXXXXXXXXXX calculateImpacts2b check impactPos: x= " << impactPos.x() << " y=" << impactPos.y(); if (inCircle(impactPos, impactRadius, participantPosUtmPoint)) sendEffectTypeEvent(itemView, participantPosition, EffectType::ExplosionArea, m_ddsHandler->currentPartitionTime()); @@ -1132,7 +1132,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae const LtsCoordinate &partLtsCoordinate = participantPosition.ltsCoordinate(); // WITH zValue const int participantId = participantPosition.participantId(); - INFO_LOG() << "calculateImpactsEffect" << " START" + INFO_LOG(m_logger) << "calculateImpactsEffect" << " START" << ", participantId = " << participantId << ", participantPosition.ltsCoordinate = '" << participantPosition.ltsCoordinate().toString() << "'" << ", triggeredEffectsLtsCoord.size() = " << triggeredEffectsLtsCoord.size() @@ -1149,7 +1149,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae const bool bIsAirSupport = (gearClass.underlying() == ProjectDataManagement::GearClass_def::AirSupport); const QVector &rangesInMeter = chargeRanges(itemView.chargeStruct); - DEBUG_LOG() << "calculateImpactsEffect" << " chargeRanges:" + DEBUG_LOG(m_logger) << "calculateImpactsEffect" << " chargeRanges:" << ", chargeTypeId = " << itemView.chargeStruct.chargeTypeId() << ", gearClass = " << gearClass << ", bIsAirSupport = " << bIsAirSupport @@ -1164,7 +1164,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae LtsCoordinate shiftedParticipantLtsCoord = partLtsCoordinate; // WITH zValue shiftedParticipantLtsCoord.rz() += 1.0; // shift 1.0m - DEBUG_LOG() << "shiftedParticipantLtsCoord = " << shiftedParticipantLtsCoord.toString(true); + DEBUG_LOG(m_logger) << "shiftedParticipantLtsCoord = " << shiftedParticipantLtsCoord.toString(true); for (const LtsCoordinate &newTriggeredImpactLtsCoord : std::as_const(triggeredEffectsLtsCoord)) { @@ -1175,7 +1175,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae if (planarDistancePartToImpact > rangesInMeter.back()) continue; - DEBUG_LOG() << " planarDistancePartToImpact = " << planarDistancePartToImpact + DEBUG_LOG(m_logger) << " planarDistancePartToImpact = " << planarDistancePartToImpact << ", bIsAirSupport = " << bIsAirSupport; // Wir heben pauschal um 1.0m an, um leichte Bodenunebenheiten zu kompensieren: @@ -1195,7 +1195,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae int effect = 3; const RANGE mostInnerRange = getMostInnerRange(planarDistancePartToImpact, itemView.chargeStruct, effect); - DEBUG_LOG() << "getMostInnerRange, participantId=" << participantId + DEBUG_LOG(m_logger) << "getMostInnerRange, participantId=" << participantId << ", planarDistancePartToImpact=" << planarDistancePartToImpact << " -> RANGE=" << toString(mostInnerRange); @@ -1204,7 +1204,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae case RANGE::HAZARD_DISTANCE: { effect = 3; // hazardDistance - DEBUG_LOG() << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect; + DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect; sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(), effect, ProjectDataManagement::EventType_def::EnterHazardDistance); } @@ -1220,23 +1220,23 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae lineOfSightOptions, bLOS, m_proxyBuilding); - INFO_LOG() << " lineOfSight_elevationAndBuilding " + INFO_LOG(m_logger) << " lineOfSight_elevationAndBuilding " << ", success=" << success << ", shiftedNewTriggeredImpact = " << shiftedNewTriggeredImpact.toString(true); // check LOS / LineOfSight - DEBUG_LOG() << "calculateImpactsEffect" << " check LOS / LineOfSight bLOS=" << bLOS + DEBUG_LOG(m_logger) << "calculateImpactsEffect" << " check LOS / LineOfSight bLOS=" << bLOS << " participantId=" << participantId; if (bLOS) { - DEBUG_LOG() << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect; + DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << ", effect=" << effect; sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(), effect, ProjectDataManagement::EventType_def::AirSupport); // AirSupport for both: LETHAL_RADIUS, NONLETHAL_RADIUS } #ifdef GUEZE_3136_IMPLEMENTED else { - DEBUG_LOG() << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << " (Verdeckung -> EnterHazardDistance)"; + DEBUG_LOG(m_logger) << "Sende CES Hit Request: participantId=" << participantId << ", RANGE=" << toString(mostInnerRange) << " (Verdeckung -> EnterHazardDistance)"; sendCesHitRequest(itemView, participantPosition, QDateTime::currentMSecsSinceEpoch(), effect, ProjectDataManagement::EventType_def::EnterHazardDistance); } @@ -1256,7 +1256,7 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae { QElapsedTimer timer; - DEBUG_LOG() << "calculateImpactsEffect" << " vor lineOfSightOptions start"; + DEBUG_LOG(m_logger) << "calculateImpactsEffect" << " vor lineOfSightOptions start"; if (m_logger.isInfoEnabled()) timer.start(); @@ -1268,15 +1268,15 @@ void HandlerExplosions::calculateImpactsEffect(const CentralEffectSimulation::Ae lineOfSightOptions, bLOS, m_proxyBuilding); - INFO_LOG() << " lineOfSight_elevationAndBuilding took [ms] " << timer.elapsed() + INFO_LOG(m_logger) << " lineOfSight_elevationAndBuilding took [ms] " << timer.elapsed() << ", success=" << success; // check LOS / LineOfSight - DEBUG_LOG() << "calculateImpactsEffect" << " check LOS / LineOfSight bLOS=" << bLOS + DEBUG_LOG(m_logger) << "calculateImpactsEffect" << " check LOS / LineOfSight bLOS=" << bLOS << " participantId=" << participantId; if (bLOS) { - INFO_LOG() << "calculateImpactsEffect 3 participantId = " << participantId + INFO_LOG(m_logger) << "calculateImpactsEffect 3 participantId = " << participantId << " -> bInCircle and given LOS -> sendEffectTypeEvent ..."; sendEffectTypeEvent(itemView, participantPosition, EffectType::ExplosionArea, m_ddsHandler->currentPartitionTime()); } @@ -1293,7 +1293,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul { const LtsCoordTrans::LtsCoordinate &partLtsCoordinate = participantPosition.ltsCoordinate(); // WITH zValue - INFO_LOG() << Q_FUNC_INFO << " START" + INFO_LOG(m_logger) << Q_FUNC_INFO << " START" << " participantId = " << participantPosition.participantId() << " participantPosition.ltsCoordinate = '" << participantPosition.ltsCoordinate().toString() << "'" << ", triggeredEffectsGeoPos.size() = " << triggeredEffectsGeoPos.size() @@ -1302,7 +1302,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul << ", -> partLtsCoordinate " << partLtsCoordinate << ", lineOfSightOptions " << lineOfSightOptions; - INFO_LOG() << Q_FUNC_INFO << participantPosition; + INFO_LOG(m_logger) << Q_FUNC_INFO << participantPosition; if (triggeredEffectsGeoPos.empty()) return; @@ -1310,7 +1310,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul if (static_cast(triggeredEffectsGeoPos.size()) != triggeredEffectsUtmPos.size()) return; - DEBUG_LOG() << "calculateImpactsEffect, triggeredEffectsUtmPos.size: " << triggeredEffectsGeoPos.size() + DEBUG_LOG(m_logger) << "calculateImpactsEffect, triggeredEffectsUtmPos.size: " << triggeredEffectsGeoPos.size() << " participantPosition = " << participantPosition; @@ -1324,11 +1324,11 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul participantPositionGeoPos.z() += 0.5; // shift 0.5m const QPointF &participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPositionGeoPos, itemView.zone); - DEBUG_LOG() << " participantPositionGeoPos=" << participantPositionGeoPos.lon() << "/" << participantPositionGeoPos.lat() + DEBUG_LOG(m_logger) << " participantPositionGeoPos=" << participantPositionGeoPos.lon() << "/" << participantPositionGeoPos.lat() << " itemView.zone=" << itemView.zone << " participantPosUtmPoint=" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y(); - DEBUG_LOG() << "calculateImpactsEffect 1 triggeredEffectsUtmPos.size " << triggeredEffectsUtmPos.size(); + DEBUG_LOG(m_logger) << "calculateImpactsEffect 1 triggeredEffectsUtmPos.size " << triggeredEffectsUtmPos.size(); int idx = -1; for (const QPointF &newTriggeredImpactUtm : std::as_const(triggeredEffectsUtmPos)) @@ -1337,7 +1337,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul const bool bInCircle = inCircle(newTriggeredImpactUtm, impactRadius, participantPosUtmPoint); - DEBUG_LOG() << "calculateImpactsEffect 2a check impactPos: x= " << newTriggeredImpactUtm.x() << " y=" << newTriggeredImpactUtm.y() + DEBUG_LOG(m_logger) << "calculateImpactsEffect 2a check impactPos: x= " << newTriggeredImpactUtm.x() << " y=" << newTriggeredImpactUtm.y() << " participantPosUtmPoint=" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y() << " impactRadius=" << impactRadius << ", inCircle = " << bInCircle @@ -1345,7 +1345,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul if (!bInCircle) { - DEBUG_LOG() << "Not in Circle => continue"; + DEBUG_LOG(m_logger) << "Not in Circle => continue"; continue; } @@ -1353,7 +1353,7 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul const int exerciseId = m_ddsHandler->getExerciseId(); QElapsedTimer timer; - DEBUG_LOG() << Q_FUNC_INFO << " vor lineOfSightOptions start"; + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " vor lineOfSightOptions start"; if (m_logger.isInfoEnabled()) timer.start(); @@ -1364,15 +1364,15 @@ void HandlerExplosions::calculateImpactsEffect_outdated(const CentralEffectSimul lineOfSightOptions, bLOS, m_proxyBuilding); - INFO_LOG() << " lineOfSight_elevationAndBuilding took [ms] " << timer.elapsed() + INFO_LOG(m_logger) << " lineOfSight_elevationAndBuilding took [ms] " << timer.elapsed() << " success=" << success; // check LOS / LineOfSight - DEBUG_LOG() << Q_FUNC_INFO << " check LOS / LineOfSight bLOS=" << bLOS + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " check LOS / LineOfSight bLOS=" << bLOS << " participantId=" << participantPosition.participantId(); if (bLOS) { - INFO_LOG() << "calculateImpactsEffect 3 participantId = " << participantPosition.participantId() + INFO_LOG(m_logger) << "calculateImpactsEffect 3 participantId = " << participantPosition.participantId() << " -> bInCircle and given LOS -> sendEffectTypeEvent ..."; sendEffectTypeEvent(itemView, participantPosition, EffectType::ExplosionArea, m_ddsHandler->currentPartitionTime()); } @@ -1385,7 +1385,7 @@ bool HandlerExplosions::inCircle(const QPointF ¢erUtm, const double radius, { double squareDist = getSquareDistance(centerUtm, pointUtm); double squareRadius = radius * radius; - DEBUG_LOG() << "squareDist: " << squareDist << ", squareRadius: " << squareRadius + DEBUG_LOG(m_logger) << "squareDist: " << squareDist << ", squareRadius: " << squareRadius << " radius=" << radius << " inCircle=" << (squareDist < squareRadius) << " centerUtm=" << centerUtm.x() << "/" << centerUtm.y() @@ -1396,7 +1396,7 @@ bool HandlerExplosions::inCircle(const QPointF ¢erUtm, const double radius, QVector HandlerExplosions::chargeRanges(const AreaEffectSimulation::ChargeStruct &chargeStruct) const { const ProjectDataManagement::GearClass &gearClass = m_ddsHandler->dtcPdm()->gearClassFromChargeTypeId(chargeStruct.chargeTypeId()); - DEBUG_LOG() << "chargeTypeId = " << chargeStruct.chargeTypeId() << ", gearClass = " << gearClass; + DEBUG_LOG(m_logger) << "chargeTypeId = " << chargeStruct.chargeTypeId() << ", gearClass = " << gearClass; if (gearClass.underlying() == ProjectDataManagement::GearClass_def::AirSupport) { @@ -1502,7 +1502,7 @@ void HandlerExplosions::sendEffectTypeEvent(const CentralEffectSimulation::AesIt const int ctasEffectType = static_cast(effectType) & 0xffff; const int participantId = participantPosition.participantId(); - DEBUG_LOG() << "Sending EffectType event " << ctasEffectType + DEBUG_LOG(m_logger) << "Sending EffectType event " << ctasEffectType << ", participant: " << participantId << ", aesItemId: " << itemView.aesItemId << ", ctasEffectType: " << ctasEffectType; @@ -1529,7 +1529,7 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem if (remaining < 0) return; - DEBUG_LOG() << "sendCesHitRequest" + DEBUG_LOG(m_logger) << "sendCesHitRequest" << " participantId=" << participantPosition.participantId() << " remaining=" << remaining << " eventType=" << eventType @@ -1542,20 +1542,20 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() << " equipNo = " << equipNo << " aesItemId =" << itemView.aesItemId; // participantPosition.participantPosition == 0 -> send to all if ((participantPosition.participantId() != 0) && (equipNo <= 0)) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ; return; } if (participantPosition.participantId() != 0 && participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } @@ -1597,13 +1597,13 @@ void HandlerExplosions::sendCesHitRequest(const CentralEffectSimulation::AesItem itemView.partyId, // originPartyId duration ); - DEBUG_LOG() << " participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << ", chargeTypeId=" << itemView.chargeStruct.chargeTypeId() << ", legacyChargeTypeId=" << legacyChargeTypeId << ", m_sendCesHitRequestQueue.size()=" << m_sendCesHitRequestQueue.size() << ", duration=" << duration; - DEBUG_LOG() << "ftcTab->SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "ftcTab->SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); if (!m_ddsHandler->isSmartChargeType(itemView.chargeStruct)) sendParticipantEvent(m_aesItemViewsUtm.value(itemView.aesItemId), participantPosition, ProjectDataManagement::EventType_def::HitEffectSimulation); @@ -1617,7 +1617,7 @@ double HandlerExplosions::getSquareDistance(const QPointF ¢erUtm, const QPoi void HandlerExplosions::on_newHazardInfo(int participantId, int aesId) { - DEBUG_LOG() << "HandlerFunctionalAreas::on_HazardFinished participantId=" << participantId + DEBUG_LOG(m_logger) << "HandlerFunctionalAreas::on_HazardFinished participantId=" << participantId << " aesId =" << aesId << " TODO: Nach Start des Wirkfeldes mĂźssen Teilnehmer alle 30 Sekunden bis Ablauf des Wirkfelds darĂźber informiert werden, dass sie sich im Gefährdungsabstand befinden"; @@ -1625,9 +1625,9 @@ void HandlerExplosions::on_newHazardInfo(int participantId, int aesId) void HandlerExplosions::sendEnterHazardDistance(const int participantId, const int aesItemId) { - DEBUG_LOG() << "sendEnterHazardDistance: participantId=" << participantId + DEBUG_LOG(m_logger) << "sendEnterHazardDistance: participantId=" << participantId << " aesItemId=" << aesItemId; - DEBUG_LOG() << "sendCesHitRequest"; + DEBUG_LOG(m_logger) << "sendCesHitRequest"; const int ctasEffectType = 0; const CentralEffectSimulation::HandlerParticipant::CesParticipantData &cesParticipantData = m_handlerParticipant->position(participantId); @@ -1644,9 +1644,9 @@ void HandlerExplosions::sendEnterHazardDistance(const int participantId, const i void HandlerExplosions::sendLeaveHazardDistance(const int participantId, const int aesItemId, const int remaining) { - DEBUG_LOG() << "sendLeaveHazardDistance: participantId=" << participantId + DEBUG_LOG(m_logger) << "sendLeaveHazardDistance: participantId=" << participantId << " aesItemId=" << aesItemId; - DEBUG_LOG() << "sendCesHitRequest" + DEBUG_LOG(m_logger) << "sendCesHitRequest" << " aesItemId=" << aesItemId; const int ctasEffectType = remaining; @@ -1667,7 +1667,7 @@ void HandlerExplosions::sendParticipantEvent(const CentralEffectSimulation::AesI const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPosition, const ProjectDataManagement::EventType eventType) { - DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId(); + DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId(); ParticipantManagement::TypeClass typeClass = m_handlerParticipant->typeClassFromTypeId(participantPosition.participantTypeId()); if (typeClass == ParticipantManagement::TypeClass_def::Unit || @@ -1675,12 +1675,12 @@ void HandlerExplosions::sendParticipantEvent(const CentralEffectSimulation::AesI typeClass == ParticipantManagement::TypeClass_def::SupportEntity || typeClass == ParticipantManagement::TypeClass_def::Unknown) return; - DEBUG_LOG() << " sendParticipantEvent participantId=" << participantPosition.participantId(); + DEBUG_LOG(m_logger) << " sendParticipantEvent participantId=" << participantPosition.participantId(); int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); if (equipmentNumber <= 0) return; - DEBUG_LOG() << " sendParticipantEvent participantId=" << participantPosition.participantId(); + DEBUG_LOG(m_logger) << " sendParticipantEvent participantId=" << participantPosition.participantId(); //const AreaEffectSimulation::OffRouteMine &of = m_ddsHandler->dtcAes()->offRouteMine(offRouteItem.aesItemId); const AreaEffectSimulation::ExplosionCluster &explosionCluster = m_ddsHandler->dtcAes()->explosionCluster(item.aesItemId); @@ -1688,7 +1688,7 @@ void HandlerExplosions::sendParticipantEvent(const CentralEffectSimulation::AesI CentralEffectSimulation::ParticipantEvent pe; - DEBUG_LOG() << " sendParticipantEvent participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << " sendParticipantEvent participantId=" << participantPosition.participantId() << " lat= " << participantPosition.pos().lat() << " lon= " << participantPosition.pos().lon() << " equipmentNumber=" << equipmentNumber diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_vulcano.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_vulcano.cpp index 59625146a..993cc7d9c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_vulcano.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/handler_vulcano.cpp @@ -65,7 +65,7 @@ bool HandlerVulcano::init() float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg(); float vulcanoAlphaDeg = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg(); - DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg + DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg << " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg << " vulcanoAlphaDeg=" << vulcanoAlphaDeg; @@ -77,9 +77,9 @@ bool HandlerVulcano::init() void HandlerVulcano::onTargetPositionsModifyReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send TargetPositionsRequest: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send TargetPositionsRequest: " << replyObject(); else - DEBUG_LOG() << "TargetPositionsRequest for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "TargetPositionsRequest for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } @@ -97,7 +97,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo if (!data.effectStart().is_set()) { - DEBUG_LOG() << "No effectStart"; + DEBUG_LOG(m_logger) << "No effectStart"; return; } @@ -113,13 +113,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo const AreaEffectSimulation::FlightCurve &fcData = data.flightCurve().get(); const AreaEffectSimulation::LaserGuiding &lgData = data.laserGuiding().get(); - DEBUG_LOG() << "\n onExplosionClusterChanged id=" << data.id() + DEBUG_LOG(m_logger) << "\n onExplosionClusterChanged id=" << data.id() << " AesEffectState=" << data.effectStateId() << " lcPrf=" << lgData.lcAttack() << " originalEffectDuration=" << data.originalEffectDuration() << " effectStart=" << data.effectStart(); - DEBUG_LOG() << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")" + DEBUG_LOG(m_logger) << "m_prfToAesId.insert(" << lgData.lcAttack() << ", " << data.id() << ")" << " tapTimepoint=" << lgData.tapTime() << " currentPartitionTime=" << m_ddsHandler->currentPartitionTime() << " Timer interval =" << lgData.tapTime() - m_ddsHandler->currentPartitionTime(); @@ -142,7 +142,7 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo long long calculatedFlightDurationMSec = fcData.calculatedFlightDuration(); long long currentPartitionTime = m_ddsHandler->currentPartitionTime(); const int timerTimeout = effectStart - calculatedFlightDurationMSec - currentPartitionTime; - DEBUG_LOG() << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout; + DEBUG_LOG(m_logger) << "Timer started mit Abflugzeit des Vulcano=" << timerTimeout; if (timerTimeout >= 0) timer->start(timerTimeout); } @@ -151,13 +151,13 @@ void HandlerVulcano::onExplosionClusterChanged(const AreaEffectSimulation::Explo void HandlerVulcano::onFiringTimeTimeout() { - DEBUG_LOG() << "++++++++++++++ onFiringTimeTimeout"; + DEBUG_LOG(m_logger) << "++++++++++++++ onFiringTimeTimeout"; QTimer *t = qobject_cast(sender()); int aesId = t->property("aesId").toInt(); delete m_aesTimers.value(aesId); m_aesTimers.remove(aesId); - DEBUG_LOG() << "onTimerTimeout aesId=" << aesId; + DEBUG_LOG(m_logger) << "onTimerTimeout aesId=" << aesId; const auto &myEC = m_explosionCluster.value(aesId); if (myEC.id() != aesId) return; @@ -168,7 +168,7 @@ void HandlerVulcano::onFiringTimeTimeout() //auto dtcPpm = m_ddsHandler->dtcPpm(); //auto participantId = dtcPpm.get()->getParticipantFromPrf(prf); //auto dpd = dtcPpm.get()->dynamicParticipantData(participantId); - //DEBUG_LOG() << "onTimerTimeout participantId=" << participantId; + //DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId; QTimer *timer = new QTimer(this); timer->setSingleShot(true); QObject::connect(timer, &QTimer::timeout, @@ -186,7 +186,7 @@ void HandlerVulcano::onFiringTimeTimeout() const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId); if (trajectoryTimeAware.geometry().size() < 2) { - DEBUG_LOG() << "return"; + DEBUG_LOG(m_logger) << "return"; return; } @@ -215,7 +215,7 @@ void HandlerVulcano::onFiringTimeTimeout() int absTimeAtTap = myEC.effectStart().get() - timeDiffTapToExplosion; // Und die ist in wieviel Sekunden? int relTimeToTap = absTimeAtTap - m_ddsHandler->currentPartitionTime(); - DEBUG_LOG() << "timer->start timeout= " << relTimeToTap + DEBUG_LOG(m_logger) << "timer->start timeout= " << relTimeToTap << " calculatedFlightDurationMSec= " << calculatedFlightDurationMSec; if (relTimeToTap >= 0) timer->start(relTimeToTap); @@ -228,7 +228,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() delete m_aesTimers.value(aesId); m_aesTimers.remove(aesId); - DEBUG_LOG() << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId; + DEBUG_LOG(m_logger) << "++++++++++++++ onTrajectoryTimeAwareTimeout aesId=" << aesId; const auto &myEC = m_explosionCluster.value(aesId); if (myEC.id() != aesId) return; @@ -243,7 +243,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() auto participantId = dtcPpm->getParticipantFromPrf(prf); auto dpd = dtcPpm->dynamicParticipantData(participantId); const auto &designationsVec = dpd.designations(); - DEBUG_LOG() << "onTimerTimeout participantId=" << participantId; + DEBUG_LOG(m_logger) << "onTimerTimeout participantId=" << participantId; for (const auto &designation : std::as_const(designationsVec)) { @@ -252,15 +252,15 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() const AreaEffectSimulation::TrajectoryTimeAware &trajectoryTimeAware = firstTrajectoryTimeAwareFromAesId(aesId); const std::vector &trajGeometry = trajectoryTimeAware.geometry(); - DEBUG_LOG() << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size(); - DEBUG_LOG() << "Designation code=" << designation.code() + DEBUG_LOG(m_logger) << "trajectoryTimeAware.geometry().size()=" << trajGeometry.size(); + DEBUG_LOG(m_logger) << "Designation code=" << designation.code() << " prf=" << prf << " outputPower=" << designation.outputPower() << " designation.spotlocation=" << designation.spotLocation().lon() << "/" << designation.spotLocation().lat(); if (trajGeometry.size() < 2) { - DEBUG_LOG() << "return"; + DEBUG_LOG(m_logger) << "return"; return; } @@ -274,23 +274,23 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() const QPointF &pointToTestPt = CentralEffectSimulation::geographic2Utm(pointToTestGeo, &zone); const QVector3D top(topPt.x(), topPt.y(), topGeo.z()); - DEBUG_LOG() << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone; + DEBUG_LOG(m_logger) << "top=" << top.x() << "/" << top.y() << "/" << top.z() << " zone=" << zone; const QVector3D bottom(bottomPt.x(), bottomPt.y(), bottomGeo.z()); - DEBUG_LOG() << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone; + DEBUG_LOG(m_logger) << "bottom=" << bottom.x() << "/" << bottom.y() << "/" << bottom.z() << " zone=" << zone; const QVector3D pointToTest(pointToTestPt.x(), pointToTestPt.y(), designation.spotLocation().z()); - DEBUG_LOG() << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone; + DEBUG_LOG(m_logger) << "pointToTest=" << pointToTest.x() << "/" << pointToTest.y() << "/" << pointToTest.z() << " zone=" << zone; float vulcanoViewAngleDeg = CesExplosions::Settings::vulcanoViewAngleDeg(); float vulcanoAttackAngleDeg = CesExplosions::Settings::vulcanoAttackAngleDeg(); - DEBUG_LOG() << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg + DEBUG_LOG(m_logger) << "vulcanoViewAngleDeg=" << vulcanoViewAngleDeg << " vulcanoAttackAngleDeg=" << vulcanoAttackAngleDeg; if (! isInCone(top, bottom, vulcanoAttackAngleDeg, pointToTest)) { - DEBUG_LOG() << "Punkt ist ausserhalb des Attack Angles. "; + DEBUG_LOG(m_logger) << "Punkt ist ausserhalb des Attack Angles. "; return; } @@ -304,14 +304,14 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() double angle = CesExplosions::Settings::vulcanoMaximumDesignationAngleDeg(); - DEBUG_LOG() << "isInAngle fe=" << fe.x() << "/" << fe.y() + DEBUG_LOG(m_logger) << "isInAngle fe=" << fe.x() << "/" << fe.y() << ", lp=" << lp.x() << "/" << lp.y() << ", observer=" << observer.x() << "/" << observer.y() << ", angle=" << angle << ", zone=" << zone; if (! isInCone(lp, fe, angle, observer)) { - DEBUG_LOG() << "Keine neue Vulcano-Pos: Winkel ist zu gross. "; + DEBUG_LOG(m_logger) << "Keine neue Vulcano-Pos: Winkel ist zu gross. "; return; } @@ -322,7 +322,7 @@ void HandlerVulcano::onTrajectoryTimeAwareTimeout() AreaEffectSimulation::TargetPositionsModifyRequest posModify; posModify.aesItemId(aesId); posModify.positions().push_back(designation.spotLocation()); - DEBUG_LOG() << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z() + DEBUG_LOG(m_logger) << "targetPositionsModifyRequest z=" << posModify.positions().at(0).z() << " designation.z=" << designation.spotLocation().z() << " PosVulcano=" << posVulcano.lon() << "/" << posVulcano.lat(); m_ddsHandler->ftcAes()->targetPositionsModifyRequest(posModify, this); @@ -339,7 +339,7 @@ AreaEffectSimulation::TrajectoryTimeAware HandlerVulcano::firstTrajectoryTimeAwa ProjectDataManagement::StateChangeOriginator::AreaEffectSimulation); if (trajectories.empty()) { - DEBUG_LOG() << "no trajectories found for originatorId/aesItemId " << aesId; + DEBUG_LOG(m_logger) << "no trajectories found for originatorId/aesItemId " << aesId; return {}; } Q_ASSERT_X(trajectories.size() == 1, __FUNCTION__, "For Vulcano there should be just one trajectory"); @@ -356,14 +356,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long const qint64 relTime = timeParam - trajectoryTimeAwareValue.trajectoryStartTime(); //trajectoryTimeAwareValue = trajectoryTimeAware(aesId); - DEBUG_LOG() << " getTrajectoryPosFromTime aesId=" << aesId + DEBUG_LOG(m_logger) << " getTrajectoryPosFromTime aesId=" << aesId << " trajectoryTimeAwareValue.id=" << trajectoryTimeAwareValue.id() << " time=" << timeParam << " trajectoryStartTime=" << trajectoryTimeAwareValue.trajectoryStartTime() << " relTime=" << relTime; if (trajectoryTimeAwareValue.geometry().empty()) { - DEBUG_LOG() << "getTrajectoryPosFromTime no pos available"; + DEBUG_LOG(m_logger) << "getTrajectoryPosFromTime no pos available"; return {}; } @@ -371,7 +371,7 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long int i = 0; for (const auto &point : std::as_const(trajectoryTimeAwareValue.geometry())) { - DEBUG_LOG() << "time=" << point.relativeTime(); + DEBUG_LOG(m_logger) << "time=" << point.relativeTime(); if ( (point.relativeTime() > relTime) && (i > 0)) { // Beachte: Geschwindigkeit wird _NICHT_ beruecksichtigt @@ -382,14 +382,14 @@ Core::GeoPosition HandlerVulcano::getTrajectoryPosFromTime(int aesId, long long // result.z() = trajectoryTimeAwareValue.geometry()[i -1].z(); // and take benefits from downcasting result = geoPosRelTime; // implicit downcast :-) - DEBUG_LOG() << "found i=" << i + DEBUG_LOG(m_logger) << "found i=" << i << " result=" << result.lat() << "/" << result.lon() << "/" << result.z(); return result; } ++i; } // for result = trajectoryTimeAwareValue.geometry().back(); - DEBUG_LOG() << " return last point result=" + DEBUG_LOG(m_logger) << " return last point result=" << " result=" << result.lat() << "/" << result.lon() << "/" << result.z(); return result; @@ -400,14 +400,14 @@ void HandlerVulcano::onDynamicParticipantChanged(const ParticipantManagement::Dy if (modType == DataModification::eRemoved) return; - DEBUG_LOG() << "onDynamicParticipantChanged" + DEBUG_LOG(m_logger) << "onDynamicParticipantChanged" << data.participantId() << data.designations().size(); if (data.designations().size() > 0) { for (const ParticipantManagement::LaserDesignation &designation : std::as_const(data.designations())) { - DEBUG_LOG() << "gearId=" << designation.gearId() + DEBUG_LOG(m_logger) << "gearId=" << designation.gearId() << " code=" << designation.code() << " z=" << designation.spotLocation().z() << " outputPower=" << designation.outputPower(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/plugin.cpp index 40ec57097..fefa6e50b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Explosions/plugin.cpp @@ -36,7 +36,7 @@ CesExplosionInterfaceImpl::CesExplosionInterfaceImpl(CentralEffectSimulation::Pl , m_logger(CentralEffectSimulation::getLogger("Plugin.Explosions.HandlerExplosions")) { Q_UNUSED(settings) - DEBUG_LOG() << "CesExplosionInterfaceImpl"; + DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl"; } CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl() @@ -48,11 +48,11 @@ CesExplosionInterfaceImpl::~CesExplosionInterfaceImpl() bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId) { - DEBUG_LOG() << "CesExplosionInterfaceImpl init"; + DEBUG_LOG(m_logger) << "CesExplosionInterfaceImpl init"; m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesExplosionsInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -66,22 +66,22 @@ bool CesExplosionInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerExplosions->init()) { - ERROR_LOG() << "Initialisation m_handlerExplosions failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerExplosions failed."; return false; } - INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true"; // initialize handlerVulcano m_handlerVulcano = std::make_shared(m_ddsHandler, this); if (!m_handlerVulcano->init()) { - ERROR_LOG() << "Initialisation m_handlerVulcano failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerVulcano failed."; return false; } - INFO_LOG() << "CesExplosionsInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::init() return true"; return true; } @@ -90,8 +90,8 @@ QString CesExplosionInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesExplosionsInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CesExplosionsInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CesExplosionsInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CesExplosionsInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.cpp index 69b677b9f..a8c227811 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.cpp @@ -111,28 +111,28 @@ bool HandlerFunctionalAreas::init() return false; } - INFO_LOG() << "HandlerParticipantArea::init() finished."; + INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished."; return true; } // end of init() //----------------------------------------------------------------------------- void HandlerFunctionalAreas::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); if (replyObject.error()) - WARNING_LOG() << "Can not send enter/leave Area to participant in training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send enter/leave Area to participant in training area: " << replyObject(); // Send next Request, if available if (!m_sendCesHitRequestQueue.isEmpty()) { - DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); + DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); m_sendCesHitRequestQueue.dequeue(); // Send next Message if (!m_sendCesHitRequestQueue.isEmpty()) { const auto &hr = m_sendCesHitRequestQueue.head(); - DEBUG_LOG() << "sendCesHitRequest: " << hr; + DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr; m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this); } } @@ -140,21 +140,21 @@ void HandlerFunctionalAreas::onSendCesHitReply(const Core::FunctionReplyObject & void HandlerFunctionalAreas::onDemandInitReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onDemandInitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onDemandInitReply for id " << replyObject.id() << " success= " << replyObject.error(); if (replyObject.error()) - WARNING_LOG() << "Can not send Init to participant in training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send Init to participant in training area: " << replyObject(); // Send next Request, if available if (!m_sendInitRequestQueue.isEmpty()) { - DEBUG_LOG() << "m_sendInitRequestQueue.size()=" << m_sendInitRequestQueue.size(); + DEBUG_LOG(m_logger) << "m_sendInitRequestQueue.size()=" << m_sendInitRequestQueue.size(); m_sendInitRequestQueue.dequeue(); // Send next Message if (!m_sendInitRequestQueue.isEmpty()) { const auto &hr = m_sendInitRequestQueue.head(); - DEBUG_LOG() << "demandInitRequest: " << hr; + DEBUG_LOG(m_logger) << "demandInitRequest: " << hr; m_ddsHandler->ftcTab()->demandInitRequest(hr, this); } } @@ -174,7 +174,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae if (!fa.isCentral()) { - DEBUG_LOG() << " !isCentral" + DEBUG_LOG(m_logger) << " !isCentral" " Got AesItemView id: " << aesItemId << ", type: " << data.aesTypeId() << ", effectState: " << data.effectStateId() @@ -185,7 +185,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae return; } - DEBUG_LOG() << "Got AesItemView id: " << aesItemId + DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId << ", type: " << data.aesTypeId() << ", effectState: " << data.effectStateId() << ", modType: " << modType; @@ -200,7 +200,7 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae bool isSupplyTruck = false; if (fa.supplyMode() == AreaEffectSimulation::AesOperatingMode_def::OmWaitingTime) { - DEBUG_LOG() << "isSupplyTruck = true"; + DEBUG_LOG(m_logger) << "isSupplyTruck = true"; isSupplyTruck = true; } auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], 0, isSupplyTruck)); @@ -219,16 +219,16 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae polygon.append(point); } enclosedBuildings = m_handlerBuildingData->polygonEncloseBuildings(polygon); - DEBUG_LOG() << "enclosedBuildings.size=" << enclosedBuildings.size(); + DEBUG_LOG(m_logger) << "enclosedBuildings.size=" << enclosedBuildings.size(); // local memory for the results, so that the polygonEncloseBuildings method is only run once for each effective field // and not for each position report m_aesPolygonEncloseBuilding.insert(data.aesItemId(), enclosedBuildings); - DEBUG_LOG() << "insert enclosedBuildings.size=" << enclosedBuildings.size(); + DEBUG_LOG(m_logger) << "insert enclosedBuildings.size=" << enclosedBuildings.size(); } calculateFunctionalArea(aesItemViewUtm); m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm); - DEBUG_LOG() << "insert Functiona Area AesItemView id: " << aesItemId + DEBUG_LOG(m_logger) << "insert Functiona Area AesItemView id: " << aesItemId << ", type: " << data.aesTypeId(); break; } // case EsActivated @@ -248,14 +248,14 @@ void HandlerFunctionalAreas::onAesItemViewChanged(const AreaEffectSimulation::Ae void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulation::AesItemViewUtm &itemView) { bool inForm = false; - DEBUG_LOG() << "HandlerParticipantArea::calculateFunctionalArea aesItemId =" << itemView.aesItemId; + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateFunctionalArea aesItemId =" << itemView.aesItemId; const auto participantsMap = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos : participantsMap) { if (m_handlerParticipant->isOutdated(participantPos)) continue; - DEBUG_LOG() << "participant id= " << participantPos.participantId() + DEBUG_LOG(m_logger) << "participant id= " << participantPos.participantId() << " buildingId=" << participantPos.buildingId(); if ( participantPos.buildingId() ==0 ) @@ -269,14 +269,14 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati { inForm = true; m_handlerParticipant->setNotfightMode(participantPos.participantId(), true); - DEBUG_LOG() << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId() + DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId() << " aesId=" << itemView.aesItemId << " in Form = true"; break; } else { - DEBUG_LOG() << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId() + DEBUG_LOG(m_logger) << "!m_aesPolygonEncloseBuilding buildingId=" << participantPos.buildingId() << " aesId=" << itemView.aesItemId << " in Form = false"; } @@ -290,7 +290,7 @@ void HandlerFunctionalAreas::calculateFunctionalArea(const CentralEffectSimulati void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData) { - DEBUG_LOG() << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId(); + DEBUG_LOG(m_logger) << "++++++++ onNewParticipantPosition participantId=" << participantData.participantId(); if (m_handlerParticipant->isOutdated(participantData)) return; @@ -298,14 +298,14 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId()); if (equipmentNumber <= 0) { - DEBUG_LOG() << "equipmentNumber <=0"; + DEBUG_LOG(m_logger) << "equipmentNumber <=0"; return; } - DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId(); + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId(); for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews)) { - DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; + DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; switch (itemView.aesTypeId.underlying()) { case AreaEffectSimulation::AesType_def::AtFunctionalArea: @@ -315,7 +315,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat /// Die Teilnehmer der Partei des Wirkfeldes werden nicht berĂźcksichtig. /// AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId); - DEBUG_LOG() << "functionalArea Typ=" << functionalArea.functionalAreaTypeId() + DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId() << " itemView.partyId=" << itemView.partyId << " participantData.partyId=" << participantData.partyId() << " insideBuilding=" << participantData.insideBuilding(); @@ -333,7 +333,7 @@ void HandlerFunctionalAreas::onNewParticipantPosition(const CentralEffectSimulat void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantData) { - DEBUG_LOG() << "New Indoor Position paticipantId=" << participantData.participantId(); + DEBUG_LOG(m_logger) << "New Indoor Position paticipantId=" << participantData.participantId(); if (m_handlerParticipant->isOutdated(participantData)) return; @@ -341,14 +341,14 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId()); if (equipmentNumber <= 0) { - DEBUG_LOG() << "equipmentNumber <=0"; + DEBUG_LOG(m_logger) << "equipmentNumber <=0"; return; } - DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId(); + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantData.participantId(); for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews)) { - DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; + DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId; switch (itemView.aesTypeId.underlying()) { case AreaEffectSimulation::AesType_def::AtFunctionalArea: @@ -358,7 +358,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS /// Die Teilnehmer der Partei des Wirkfeldes werden nicht berĂźcksichtig. /// AreaEffectSimulation::FunctionalArea functionalArea = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId); - DEBUG_LOG() << "functionalArea Typ=" << functionalArea.functionalAreaTypeId() + DEBUG_LOG(m_logger) << "functionalArea Typ=" << functionalArea.functionalAreaTypeId() << " itemView.partyId=" << itemView.partyId << " participantData.partyId=" << participantData.partyId() << " insideBuilding=" << participantData.insideBuilding(); @@ -366,7 +366,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS if ( (itemView.partyId == participantData.partyId()) && (functionalArea.functionalAreaTypeId() == 8)) // Funktionsraum Nicht Kampffaehig [GUEZE-2256] { - DEBUG_LOG() << "Position mit Funktionsraum Nicht Kampffähig hat die Partei des Wirkfeldes => nicht beruecksichtigen"; + DEBUG_LOG(m_logger) << "Position mit Funktionsraum Nicht Kampffähig hat die Partei des Wirkfeldes => nicht beruecksichtigen"; continue; } } @@ -396,7 +396,7 @@ void HandlerFunctionalAreas::onNewIndoorParticipantPosition(const CentralEffectS void HandlerFunctionalAreas::onRestoreRadioReadinessChanged(const int participantId) { - DEBUG_LOG() << "HandlerArtillery::onRestoreRadioReadinessChanged participantId=" << participantId; + DEBUG_LOG(m_logger) << "HandlerArtillery::onRestoreRadioReadinessChanged participantId=" << participantId; m_supplyTimers.remove(participantId); removeParticipant(participantId); } @@ -417,11 +417,11 @@ bool HandlerFunctionalAreas::inBoundingBoxCheck(const CentralEffectSimulation::A const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone); if (boundingBoxImpact.contains(participantPosUtmPoint)) { - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId() << " inside AesItemView:" << itemView.aesItemId; return true; } - TRACE_LOG() << "inBoundingBoxCheck Paricipant " << participantData.participantId() + TRACE_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantData.participantId() << " outside AesItemView:" << itemView.aesItemId; return false; } @@ -437,7 +437,7 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV itemView.boundingBoxTopRight); const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantData.pos(), itemView.zone); const QString participantPosMgrs = CentralEffectSimulation::geographic2mgrs(participantData.pos(), itemView.zone); - DEBUG_LOG() << "inFormCheck start, paricipantId: " << participantData.participantId() + DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantData.participantId() << ", aesItemId: " << itemView.aesItemId << ", aesTypeId: " << itemView.aesTypeId << ", form.size: " << itemView.form.size() @@ -446,7 +446,7 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV if (boundingBox.contains(participantPosUtmPoint) && itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill)) { - DEBUG_LOG() << "inside AES form, paricipantId: " << participantData.participantId() + DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantData.participantId() << ", aesItemId: " << itemView.aesItemId; return true; } // if inside @@ -456,10 +456,10 @@ bool HandlerFunctionalAreas::inFormCheck(const CentralEffectSimulation::AesItemV #if 0 if (m_logger.isDebugEnabled()) { - DEBUG_LOG() << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId; - DEBUG_LOG() << "ParticipantPos = " << debug(participantPosUtmPoint); + DEBUG_LOG(m_logger) << "inFormCheck: Paricipant " << participantPosition.participantId << " outside AesItemView " << itemView.aesItemId; + DEBUG_LOG(m_logger) << "ParticipantPos = " << debug(participantPosUtmPoint); for (const auto &itPos : itemView.form) - DEBUG_LOG() << "itemView =" << debug(itPos); + DEBUG_LOG(m_logger) << "itemView =" << debug(itPos); } #endif return false; @@ -478,12 +478,12 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae switch (eventType.underlying()) { case ProjectDataManagement::EventType_def::EnterFunctionalArea: - DEBUG_LOG() << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId; + DEBUG_LOG(m_logger) << "-------------- EnterFunctionalArea itemView =" << itemView.aesItemId; remaining = 1; break; case ProjectDataManagement::EventType_def::LeaveFunctionalArea: remaining = 0; - DEBUG_LOG() << "-------------- LeaveFunctionalArea itemView =" << itemView.aesItemId; + DEBUG_LOG(m_logger) << "-------------- LeaveFunctionalArea itemView =" << itemView.aesItemId; break; default: return; @@ -492,26 +492,26 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae if (remaining < 0) return; - DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" + DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea() << " isSmartChargeType=" << std::boolalpha << m_ddsHandler->isSmartChargeType(itemView.chargeStruct) << " participantId=" << participantData.participantId(); const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId() << " equipNo = " << equipNo << " aesItemId =" << itemView.aesItemId; // participantPosition.participantPosition == 0 -> send to all if (participantData.participantId() != 0 && equipNo <= 0) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0"; return; } if (participantData.participantId() != 0 && participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } @@ -550,14 +550,14 @@ void HandlerFunctionalAreas::sendCesHitRequest(const CentralEffectSimulation::Ae itemView.partyId, // originPartyId mineId ); - DEBUG_LOG() << " participantId=" << participantData.participantId() + DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId() << " chargeTypeId=" << itemView.chargeStruct.chargeTypeId(); m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } } @@ -576,7 +576,7 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation: typeClass == ParticipantManagement::TypeClass_def::Vessel || typeClass == ParticipantManagement::TypeClass_def::Unknown) { - DEBUG_LOG() << "Participant with id " << participantData.participantId() + DEBUG_LOG(m_logger) << "Participant with id " << participantData.participantId() << " has invalid typeClass: " << typeClass << " eventType: " << eventType; return; @@ -585,12 +585,12 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation: int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantData.participantId()); if (equipmentNumber <= 0) { - WARNING_LOG() << "Not sending Event " << eventType << " for participant " << participantData.participantId() + WARNING_LOG(m_logger) << "Not sending Event " << eventType << " for participant " << participantData.participantId() << " - participant has no equipment number"; return; } - DEBUG_LOG() << "sendParticipantEvent" << eventType + DEBUG_LOG(m_logger) << "sendParticipantEvent" << eventType << " participantId=" << participantData.participantId() << " AesItemId=" << itemView.aesItemId; @@ -610,7 +610,7 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation: pe.position(participantData.pos()); pe.friendlyFire(false); - INFO_LOG() << "sendParticipantEvent: " << pe + INFO_LOG(m_logger) << "sendParticipantEvent: " << pe << ", currentMSecsSinceEpoch = " << QDateTime::currentMSecsSinceEpoch() << ", time difference = " << QDateTime::currentMSecsSinceEpoch() - pe.eventTime(); m_ddsHandler->dtsCes()->publish(pe); @@ -622,17 +622,17 @@ void HandlerFunctionalAreas::sendParticipantEvent(const CentralEffectSimulation: void HandlerFunctionalAreas::aesItemViewRemoved(int aesItemId) { - DEBUG_LOG() << "aesItemViewRemoved aesItemId=" << aesItemId + DEBUG_LOG(m_logger) << "aesItemViewRemoved aesItemId=" << aesItemId << " m_cesEnterLeaveFunctionalArea.size=" << m_cesEnterLeaveFunctionalArea.size() << " m_aesItemViews.size=" << m_aesItemViews.size(); QHashIterator, EnterLeaveType> i(m_cesEnterLeaveFunctionalArea); while (i.hasNext()) { i.next(); - DEBUG_LOG() << "Key: itemId=" << i.key().first << " participantId=" << i.key().second + DEBUG_LOG(m_logger) << "Key: itemId=" << i.key().first << " participantId=" << i.key().second << " EnterLeaveType=" << i.value().eventType; if (i.key().first == aesItemId ) { - DEBUG_LOG() << " EnterLeaveType=" << i.value().eventType; + DEBUG_LOG(m_logger) << " EnterLeaveType=" << i.value().eventType; CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(i.key().first); sendEnterLeave(itemView, i.key().second, false); m_cesEnterLeaveFunctionalArea.remove(i.key()); @@ -644,16 +644,16 @@ void HandlerFunctionalAreas::aesItemViewRemoved(int aesItemId) void HandlerFunctionalAreas::removeParticipant(int participantId) { - DEBUG_LOG() << "removeParticipant participantId=" << participantId + DEBUG_LOG(m_logger) << "removeParticipant participantId=" << participantId << " m_cesEnterLeaveFunctionalArea.size=" << m_cesEnterLeaveFunctionalArea.size(); QHashIterator, EnterLeaveType> i(m_cesEnterLeaveFunctionalArea); while (i.hasNext()) { i.next(); - DEBUG_LOG() << "Key: itemId=" << i.key().first << " participantId=" << i.key().second + DEBUG_LOG(m_logger) << "Key: itemId=" << i.key().first << " participantId=" << i.key().second << " EnterLeaveType=" << i.value().eventType; if (i.key().second == participantId ) { - DEBUG_LOG() << " EnterLeaveType=" << i.value().eventType; + DEBUG_LOG(m_logger) << " EnterLeaveType=" << i.value().eventType; CentralEffectSimulation::AesItemViewUtm itemView = m_aesItemViews.value(i.key().first); //sendEnterLeave(itemView, i.key().second, false); m_cesEnterLeaveFunctionalArea.remove(i.key()); @@ -670,7 +670,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt if (m_cesEnterLeaveFunctionalArea.contains(key)) lastEnterLeaveType = m_cesEnterLeaveFunctionalArea.value(key); - DEBUG_LOG() << "HandlerFunctionalAreas::sendEnterLeave " + DEBUG_LOG(m_logger) << "HandlerFunctionalAreas::sendEnterLeave " << " aesItemId=" << itemView.aesItemId << " participantId=" << participantId << " inForm=" << inForm; @@ -684,7 +684,7 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId); if (!lastEnterLeaveType.isAlreadySupplied) { - DEBUG_LOG() << "sendEnterLeave.startSupplyTimer" + DEBUG_LOG(m_logger) << "sendEnterLeave.startSupplyTimer" " m_cesEnterLeaveFunctionalArea.insert" << " aesItemId=" << key.first << " participantId=" << key.second @@ -699,10 +699,10 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt enterLeaveType.eventType = ProjectDataManagement::EventType_def::LeaveFunctionalArea; if (itemView.isSupplyTruck && lastEnterLeaveType.eventType == ProjectDataManagement::EventType_def::EnterFunctionalArea) { - DEBUG_LOG() << "sendEnterLeave.stopSupplyTimer"; + DEBUG_LOG(m_logger) << "sendEnterLeave.stopSupplyTimer"; enterLeaveType.isAlreadySupplied = false; stopSupplyTimer(participantId); - DEBUG_LOG() << "sendEnterLeave.startSupplyTimer" + DEBUG_LOG(m_logger) << "sendEnterLeave.startSupplyTimer" " m_cesEnterLeaveFunctionalArea.insert" << " aesItemId=" << key.first << " participantId=" << key.second @@ -718,16 +718,16 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt sendParticipantEvent(itemView, cesParticipantData, enterLeaveType.eventType); const AreaEffectSimulation::FunctionalArea &fa = m_ddsHandler->dtcAes()->functionalArea(itemView.aesItemId); - DEBUG_LOG() << "fa.isCentral()=" << fa.isCentral() + DEBUG_LOG(m_logger) << "fa.isCentral()=" << fa.isCentral() << " isSupplyTruck=" << itemView.isSupplyTruck << " eventType=" << m_cesEnterLeaveFunctionalArea.value(key).eventType << " isAlreadySupplied=" << enterLeaveType.isAlreadySupplied; if (fa.isCentral() && !itemView.isSupplyTruck) { - DEBUG_LOG() << "sendCesHitRequest"; + DEBUG_LOG(m_logger) << "sendCesHitRequest"; sendCesHitRequest(itemView, cesParticipantData, enterLeaveType.eventType); } - DEBUG_LOG() << " m_cesEnterLeaveFunctionalArea.insert" + DEBUG_LOG(m_logger) << " m_cesEnterLeaveFunctionalArea.insert" << " aesItemId=" << key.first << " participantId=" << key.second << " enterLeaveType=" << enterLeaveType.eventType; @@ -738,21 +738,21 @@ void HandlerFunctionalAreas::sendEnterLeave(const CentralEffectSimulation::AesIt void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long time) { - DEBUG_LOG() << "startSupplyTimer=" + DEBUG_LOG(m_logger) << "startSupplyTimer=" << " participantId=" << participantId << " aesId=" << aesId << " time=" << time << " ST participant" << m_aesItemViews[aesId].participantId; if (participantId == m_aesItemViews[aesId].participantId) { - DEBUG_LOG() << "No supply for SupplyTruck"; + DEBUG_LOG(m_logger) << "No supply for SupplyTruck"; return; } if (m_supplyTimers.contains(participantId)) { if (m_supplyTimers[participantId]->isActive()) { - DEBUG_LOG() << "SupplyTimer isActive"; + DEBUG_LOG(m_logger) << "SupplyTimer isActive"; return; } else @@ -760,7 +760,7 @@ void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long } SupplyTimer *supplyTimer = new SupplyTimer(participantId, aesId, time); - DEBUG_LOG() << "supplyTimer->startTimer();"; + DEBUG_LOG(m_logger) << "supplyTimer->startTimer();"; QObject::connect(supplyTimer, &SupplyTimer::timeToEffectTimeout, this, &HandlerFunctionalAreas::on_supplyFinished); m_supplyTimers.insert(participantId, supplyTimer); @@ -769,7 +769,7 @@ void HandlerFunctionalAreas::startSupplyTimer(int participantId, int aesId, long void HandlerFunctionalAreas::stopSupplyTimer(int participantId) { - DEBUG_LOG() << "stopSupplyTimer=" + DEBUG_LOG(m_logger) << "stopSupplyTimer=" << "participantId=" << participantId; if (m_supplyTimers.contains(participantId)) { @@ -781,7 +781,7 @@ void HandlerFunctionalAreas::stopSupplyTimer(int participantId) void HandlerFunctionalAreas::on_supplyFinished(int participantId, int aesId) { - DEBUG_LOG() << "HandlerFunctionalAreas::on_supplyFinished participantId=" << participantId + DEBUG_LOG(m_logger) << "HandlerFunctionalAreas::on_supplyFinished participantId=" << participantId << " aesId =" << aesId; sendInitSupplyToTab(participantId, @@ -802,7 +802,7 @@ void HandlerFunctionalAreas::sendInitSupplyToTab(int participantId, int aesId) bool resetVulnerabilityState = false; bool restockSanitationMaterial = false; - DEBUG_LOG() << "sendInitSupplyToTab" + DEBUG_LOG(m_logger) << "sendInitSupplyToTab" << " participantId=" << participantId << " aesId=" << aesId; TrainingAreaBase::DemandInitRequest demandInitRequest( @@ -818,7 +818,7 @@ void HandlerFunctionalAreas::sendInitSupplyToTab(int participantId, int aesId) m_sendInitRequestQueue.enqueue(demandInitRequest); if (m_sendInitRequestQueue.size() == 1) { - DEBUG_LOG() << "sendInitSupply: " << demandInitRequest; + DEBUG_LOG(m_logger) << "sendInitSupply: " << demandInitRequest; m_ddsHandler->ftcTab()->demandInitRequest(demandInitRequest, this); } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.h index 762073d15..304f8f9db 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/handler_functional_area.h @@ -78,6 +78,8 @@ public: bool init(); protected: + +NGL::INGLLogger &m_logger; void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final; void onDemandInitReply(const Core::FunctionReplyObject &replyObject) override final; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/plugin.cpp index b1a5b87da..7a5bc267e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/FunctionalAreas/plugin.cpp @@ -48,7 +48,7 @@ bool CES_FUNCTIONAL_AREAInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::init()" + INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -62,11 +62,11 @@ bool CES_FUNCTIONAL_AREAInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerFunctionalAreas->init()) { - ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed."; return false; } - INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::init() return true"; return true; } @@ -74,8 +74,8 @@ QString CES_FUNCTIONAL_AREAInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CES_FUNCTIONAL_AREAInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CES_FUNCTIONAL_AREAInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.cpp index a5017491e..af2bc6d2e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.cpp @@ -73,7 +73,7 @@ void HandlerAesData::onAesItemViewChanged(const AreaEffectSimulation::AesItemVie modType != DataModification::eModified) return; - DEBUG_LOG() << "Got AesItemView: " << data.effectStateId(); + DEBUG_LOG(m_logger) << "Got AesItemView: " << data.effectStateId(); switch (data.effectStateId().underlying()) { case AreaEffectSimulation::AesEffectState_def::EsUnknown: @@ -98,7 +98,7 @@ void HandlerAesData::removeStates(const AreaEffectSimulation::AesItemView &data) { if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtExplosionArea) return; - DEBUG_LOG() << "Remove aesItemId=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "Remove aesItemId=" << data.aesItemId(); } // end removeStates void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::ExplosionSingle &data, DataModification modType) @@ -113,7 +113,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsRemoved) { - DEBUG_LOG() << "Remove SingleExplosion"; + DEBUG_LOG(m_logger) << "Remove SingleExplosion"; m_explosionSingleState.remove(data.id()); return; } @@ -121,17 +121,17 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos if (m_explosionSingleState.value(data.id()) == AreaEffectSimulation::AesEffectState_def::EsPrepared && data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsActivated) { - DEBUG_LOG() << "Handle SingleExplosion"; + DEBUG_LOG(m_logger) << "Handle SingleExplosion"; handleExplosion = true; } m_explosionSingleState.insert(data.id(), data.effectStateId()); - DEBUG_LOG() << "Got ExplosionSingle"; + DEBUG_LOG(m_logger) << "Got ExplosionSingle"; if (handleExplosion) { const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeTypeId()); - DEBUG_LOG() << "Handle ExplosionSingle (EsActivated)"; + DEBUG_LOG(m_logger) << "Handle ExplosionSingle (EsActivated)"; // Bounding-Box-Check // QMap m_footprints; @@ -154,7 +154,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos const Core::GeoPosition2D impactPosition(data.impactPosition().lon(), data.impactPosition().lat()); if (inFootprint(impactPosition, impactRadius, footprint)) { - DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId + DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " chargeTypeId = " << data.chargeTypeId() << " id = " << data.id() << " currentPartitionTime = " << m_ddsHandler->currentPartitionTime() @@ -170,9 +170,9 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos m_ddsHandler->ftcBld()->sendCesHitOnBuildingRequest(requestBld, this); } else - DEBUG_LOG() << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "Not sendCESHitOnBuilding mseId = " << footprint.mseId; - DEBUG_LOG() << "boundingBoxImpact.contains(footprint)"; + DEBUG_LOG(m_logger) << "boundingBoxImpact.contains(footprint)"; } } // for } @@ -180,7 +180,7 @@ void HandlerAesData::onExplosionSingleChanged(const AreaEffectSimulation::Explos void HandlerAesData::onAirSupportImpactChanged(const AreaEffectSimulation::AirSupportImpact &data, DataModification modType) { - DEBUG_LOG() << "Got onAirSupportImpactChanged()"; + DEBUG_LOG(m_logger) << "Got onAirSupportImpactChanged()"; AreaEffectSimulation::ExplosionSingle esData; esData.id(data.id()); esData.chargeTypeId(data.chargeTypeId()); @@ -195,7 +195,7 @@ void HandlerAesData::onTriggeredImpactsChanged(const AreaEffectSimulation::Trigg modType != DataModification::eModified) return; - DEBUG_LOG() << "Got TriggeredImpacts"; + DEBUG_LOG(m_logger) << "Got TriggeredImpacts"; preCalculateImpacts(data); } @@ -208,7 +208,7 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main { case DataModification::eAdded: case DataModification::eModified: - DEBUG_LOG() << "Got MainFootprint (Building)"; + DEBUG_LOG(m_logger) << "Got MainFootprint (Building)"; calculateFootprint(data); break; case DataModification::eRemoved: @@ -223,8 +223,8 @@ void HandlerAesData::onMainFootprintChanged(const InfrastructureManagement::Main void HandlerAesData::calculateFootprint(const InfrastructureManagement::MainFootprint &mainFootprint) { - DEBUG_LOG() << "Footprint: " << mainFootprint.id() << ": " << mainFootprint; - DEBUG_LOG() << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); + DEBUG_LOG(m_logger) << "Footprint: " << mainFootprint.id() << ": " << mainFootprint; + DEBUG_LOG(m_logger) << "Footprint: " << " mainFootprint.elements().size()=" << mainFootprint.elements().size(); // If poly is Empty continue with next Footprint if (mainFootprint.elements().size() <= 0) @@ -272,9 +272,9 @@ bool HandlerAesData::inFootprint(const Core::GeoPosition2D &geoPosition, const d if (m_logger.isDebugEnabled()) { const QPointF utmBuilding(CentralEffectSimulation::geographic2Utm(footPrint.geoPosition, footPrint.zone)); - DEBUG_LOG() << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); + DEBUG_LOG(m_logger) << "Impact (x/y)=" << CentralEffectSimulation::debug(impact - utmBuilding); for (int i = 0; i < footPrint.polyUtm.length(); i++) - DEBUG_LOG() << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); + DEBUG_LOG(m_logger) << " poly (x/y)=" << CentralEffectSimulation::debug(footPrint.polyUtm[i] - utmBuilding); } // Check, if hit direct on building @@ -293,14 +293,14 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm { if (data.id() <= 0) return; - DEBUG_LOG() << "preCalculateImpacts"; + DEBUG_LOG(m_logger) << "preCalculateImpacts"; // Find AES ItemView and set Bounding-Box of Aes-Field // Search corresponding itemView and get boundingBox data in UTM const bool bFound = m_aesItemViews.contains(data.aesItemId()); if (!bFound) { - WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId(); + WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId(); return; } // Bounding-Box-Check @@ -316,18 +316,18 @@ void HandlerAesData::preCalculateImpacts(const AreaEffectSimulation::TriggeredIm void HandlerAesData::onSendCesHitOnBuildingReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send hit on building to building service: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send hit on building to building service: " << replyObject(); else - DEBUG_LOG() << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" + DEBUG_LOG(m_logger) << "onSendCesHitOnBuildingReply for id " << replyObject.id() << " success\n" << " replyObject.str() = " << replyObject.str(); } void HandlerAesData::onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) { if (reply.error()) - WARNING_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); + WARNING_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " failed: " << reply.str(); else - DEBUG_LOG() << "onSendCesHitInformationReply for id " << reply.id() << " successful"; + DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << reply.id() << " successful"; } // calculate impacts for one building @@ -339,14 +339,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac case AreaEffectSimulation::AesType_def::AtExplosionArea: case AreaEffectSimulation::AesType_def::AtExplosionSingle: case AreaEffectSimulation::AesType_def::AtExplosionAreaSingleExplosions: - DEBUG_LOG() << "Calculate"; + DEBUG_LOG(m_logger) << "Calculate"; break; default: - DEBUG_LOG() << "No Calculation"; + DEBUG_LOG(m_logger) << "No Calculation"; return; } - DEBUG_LOG() << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId(); + DEBUG_LOG(m_logger) << "calculateImpacts mseId=" << footprint.mseId << " data.aesItemId() " << data.aesItemId(); // get position(s) of impact(s): @@ -355,14 +355,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac auto it = m_aesItemViews.constFind(data.aesItemId()); if (it == m_aesItemViews.constEnd()) { - WARNING_LOG() << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"; + WARNING_LOG(m_logger) << "TriggeredExplosions.aesItemId=" << data.aesItemId() << " No aesItemView available"; return; } BitfieldStates &bitfieldStates = m_bitfieldStatesBld[footprint.mseId]; QSet &bitfieldState = bitfieldStates[data.aesItemId()]; for (int i : std::as_const(bitfieldState)) - DEBUG_LOG() << "bitfieldState for " << data.aesItemId() << ": " << i; + DEBUG_LOG(m_logger) << "bitfieldState for " << data.aesItemId() << ": " << i; const AreaEffectSimulation::AesItemView &aesItemView = *it; for (int32_t bitFieldIdx = 0; bitFieldIdx < data.impactCount(); ++bitFieldIdx) @@ -376,7 +376,7 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac continue; const Core::GeoPosition2D &impactPosition = aesItemView.form()[bitFieldIdx]; - DEBUG_LOG() << Q_FUNC_INFO + DEBUG_LOG(m_logger) << Q_FUNC_INFO << " impactPosition: lat/lon" << impactPosition.lat() << "/" << impactPosition.lon() << " UTM=" << CentralEffectSimulation::debug(CentralEffectSimulation::geographic2Utm(impactPosition)); @@ -385,14 +385,14 @@ void HandlerAesData::calculateImpacts(const AreaEffectSimulation::TriggeredImpac const double impactRadius = m_ddsHandler->chargeTypeRadius(aesItemView.chargeTypeId()); if (inFootprint(impactPosition, impactRadius, footprint)) { - DEBUG_LOG() << "In Footprint mseId = " << footprint.mseId; + DEBUG_LOG(m_logger) << "In Footprint mseId = " << footprint.mseId; if (!bitfieldState.contains(bitFieldIdx)) { bitfieldState.insert(bitFieldIdx); - DEBUG_LOG() << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; + DEBUG_LOG(m_logger) << "m_bitfieldStates.insert(data.aesItemId()=" << data.aesItemId() << ", bitfieldState)" << " bitFieldIdx=" << bitFieldIdx; - DEBUG_LOG() << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ; + DEBUG_LOG(m_logger) << "ftc sendCESHitOnBuilding mseId = " << footprint.mseId << " bitFieldIdx= " << bitFieldIdx ; Buildings::SendCesHitOnBuildingRequest requestBld( footprint.mseId, aesItemView.chargeTypeId(), diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.h index dc74cd74d..be0cf6b2c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_aes_data.h @@ -50,6 +50,7 @@ public: AreaEffectSimulation::AesItemView itemView(const int &aesId) const { return m_aesItemViews.value(aesId); } protected: + NGL::INGLLogger &m_logger; void onSendCesHitInformationReply(const Core::FunctionReplyObject &reply) override final; private slots: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_participant_gas_pipe.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_participant_gas_pipe.cpp index 129758ec7..5c11c43aa 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_participant_gas_pipe.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/handler_participant_gas_pipe.cpp @@ -41,7 +41,7 @@ HandlerParticipantGasPipe::~HandlerParticipantGasPipe() bool HandlerParticipantGasPipe::init() { - INFO_LOG() << "HandlerParticipantGasPipe::init"; + INFO_LOG(m_logger) << "HandlerParticipantGasPipe::init"; auto dtcAes = m_ddsHandler->dtcAes(); dtcAes->waitForHistoricalDataGasPipe(2000); @@ -68,7 +68,7 @@ bool HandlerParticipantGasPipe::init() return false; } - INFO_LOG() << "HandlerParticipantGasPipe::init() finished. "; + INFO_LOG(m_logger) << "HandlerParticipantGasPipe::init() finished. "; return true; } // end of init() //----------------------------------------------------------------------------- @@ -78,14 +78,14 @@ bool HandlerParticipantGasPipe::init() // /////////////////////////////////// void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation::AesItemView &data, DataModification modType) { - INFO_LOG() << "HandlerParticipantGasPipe::onAesItemViewChanged"; + INFO_LOG(m_logger) << "HandlerParticipantGasPipe::onAesItemViewChanged"; // if (data.aesTypeId() != AreaEffectSimulation::AesType_def::AtGasPipe) return; const int aesItemId = data.aesItemId(); - DEBUG_LOG() << "Got AesItemView id: " << aesItemId + DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId << ", type: " << data.aesTypeId() << ", effectState: " << data.effectStateId() << ", modType: " << modType; @@ -110,14 +110,14 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation: const CentralEffectSimulation::AesItemViewUtm gasPipeUtm = CentralEffectSimulation::AesItemViewUtm::create(data, prevData, impactRadius); m_gasPipes.insert(data.aesItemId(), gasPipeUtm); - DEBUG_LOG() << "Check each participant"; + DEBUG_LOG(m_logger) << "Check each participant"; // Check each participant const auto partPosMap = m_handlerParticipant->positions(); for (const auto &participantPos : partPosMap) { if (m_handlerParticipant->isOutdated(participantPos)) { - DEBUG_LOG() << "isOutdated participantId=" << participantPos.participantId(); + DEBUG_LOG(m_logger) << "isOutdated participantId=" << participantPos.participantId(); continue; } const CentralEffectSimulation::AesItemViewUtm gasPipe = m_gasPipes.value(data.aesItemId()); @@ -127,7 +127,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation: } default: { - DEBUG_LOG() << "remove GasPipe"; + DEBUG_LOG(m_logger) << "remove GasPipe"; m_gasPipes.remove(aesItemId); } } @@ -140,7 +140,7 @@ void HandlerParticipantGasPipe::onAesItemViewChanged(const AreaEffectSimulation: void HandlerParticipantGasPipe::onGasPipeChanged(const AreaEffectSimulation::GasPipe &data, DataModification modType) { - INFO_LOG() << "HandlerParticipantGasPipe::onGasPipeChanged id=" << data.id(); + INFO_LOG(m_logger) << "HandlerParticipantGasPipe::onGasPipeChanged id=" << data.id(); if (modType == DataModification::eRemoved) { return; @@ -149,7 +149,7 @@ void HandlerParticipantGasPipe::onGasPipeChanged(const AreaEffectSimulation::Gas bool HandlerParticipantGasPipe::insideGasPipeArea(const QPolygonF &polygonf, const QPointF &participantPos) const { - DEBUG_LOG() << "pos to check: " << CentralEffectSimulation::debug(participantPos) ; + DEBUG_LOG(m_logger) << "pos to check: " << CentralEffectSimulation::debug(participantPos) ; return polygonf.containsPoint(participantPos, Qt::OddEvenFill); } @@ -159,10 +159,10 @@ void HandlerParticipantGasPipe::calculateGasPipeParticipant(const CentralEffectS //const AesItemViewUtm gasPipe = m_gasPipes.value(itemView.aesItemId()); const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), gasPipe.zone); - DEBUG_LOG() << "calculateGasPipeParticipant itemView.id=" << gasPipe.aesItemId + DEBUG_LOG(m_logger) << "calculateGasPipeParticipant itemView.id=" << gasPipe.aesItemId << " participantId=" << participantPosition.participantId(); - DEBUG_LOG() << "gasPipe id = " << gasPipe.aesItemId + DEBUG_LOG(m_logger) << "gasPipe id = " << gasPipe.aesItemId << ", Box bottomLeft = " << CentralEffectSimulation::debug(gasPipe.boundingBoxBottomLeft) << ", topRight = " << CentralEffectSimulation::debug(gasPipe.boundingBoxTopRight); @@ -177,16 +177,16 @@ void HandlerParticipantGasPipe::calculateGasPipeParticipant(const CentralEffectS }); if (!boundingBoxGasPipe.containsPoint(partPosGeo, Qt::OddEvenFill)) { - DEBUG_LOG() << "not in boundingBox"; + DEBUG_LOG(m_logger) << "not in boundingBox"; return; } const bool result = insideGasPipeArea(gasPipe.form, partPosGeo); - DEBUG_LOG() << "result gasPipe Explosion = " << result; + DEBUG_LOG(m_logger) << "result gasPipe Explosion = " << result; if (result) { - DEBUG_LOG() << "sendParticipantEvent"; + DEBUG_LOG(m_logger) << "sendParticipantEvent"; sendParticipantEvent(gasPipe, participantPosition, ProjectDataManagement::EventType_def::HitGasPipe); - DEBUG_LOG() << "sendParticipantHit"; + DEBUG_LOG(m_logger) << "sendParticipantHit"; sendParticipantHit(gasPipe, participantPosition, ProjectDataManagement::EventType_def::HitGasPipe); } } @@ -195,7 +195,7 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect { bool result = false; // Bounding Box von der Linie - DEBUG_LOG() << "ParicipantPos " + DEBUG_LOG(m_logger) << "ParicipantPos " << " participantId=" << partPos.participantId() << " participantTypeId=" << partPos.participantTypeId() << " participantPos: lat=" << partPos.pos().lat() @@ -209,14 +209,14 @@ void HandlerParticipantGasPipe::onParticipantPositionChanged(const CentralEffect const QPointF partPosGeo = CentralEffectSimulation::geographic2Utm(partPos.pos(), gasPipe.zone); - DEBUG_LOG() << "gasPipe id = " << gasPipe.aesItemId + DEBUG_LOG(m_logger) << "gasPipe id = " << gasPipe.aesItemId << ", Box bottomLeft = " << CentralEffectSimulation::debug(gasPipe.boundingBoxBottomLeft) << ", topRight = " << CentralEffectSimulation::debug(gasPipe.boundingBoxTopRight); // if (!m_gasPipes.value(gasPipe.aesItemId).containsPoint(partPosGeo, Qt::OddEvenFill)) // continue; result = insideGasPipeArea(gasPipe.form, partPosGeo); - DEBUG_LOG() << "result gasPipe Explosion = " << result<< gasPipe.aesItemId; + DEBUG_LOG(m_logger) << "result gasPipe Explosion = " << result<< gasPipe.aesItemId; if (result) sendParticipantEvent(gasPipe, partPos, ProjectDataManagement::EventType_def::HitGasPipe); } @@ -249,7 +249,7 @@ void HandlerParticipantGasPipe::sendParticipantEvent(const CentralEffectSimulati const AreaEffectSimulation::GasPipe &gp = m_ddsHandler->dtcAes()->gasPipe(gasPipe.aesItemId); CentralEffectSimulation::ParticipantEvent pe; - DEBUG_LOG() << "sendParticipantEvent participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "sendParticipantEvent participantId=" << participantPosition.participantId() << " lat= " << participantPosition.pos().lat() << " lon= " << participantPosition.pos().lon() << " equipmentNumber=" << equipmentNumber @@ -278,7 +278,7 @@ void HandlerParticipantGasPipe::sendParticipantHit(const CentralEffectSimulation const int participantId = participantPosition.participantId(); const int originatorEquipNo = 0; - DEBUG_LOG() << "sendParticipantHit participantId=" << participantId + DEBUG_LOG(m_logger) << "sendParticipantHit participantId=" << participantId << " equipmentNumber=" << equipNo; Core::GeoPosition position; @@ -310,9 +310,9 @@ void HandlerParticipantGasPipe::sendParticipantHit(const CentralEffectSimulation void HandlerParticipantGasPipe::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { //if (replyObject.error()) - // WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject(); + // WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject(); //else - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success"; } void HandlerParticipantGasPipe::sendFtcCesHitRequestTimeout() @@ -320,7 +320,7 @@ void HandlerParticipantGasPipe::sendFtcCesHitRequestTimeout() auto ftcTab = m_ddsHandler->ftcTab(); for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap)) { - DEBUG_LOG() << "sendFtcCesHitRequestTimeout: " << hr; + DEBUG_LOG(m_logger) << "sendFtcCesHitRequestTimeout: " << hr; ftcTab->sendCesHitRequest(hr, this); } m_requestMap.clear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/plugin.cpp index 411affe28..7e1b31c82 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GasPipes/plugin.cpp @@ -49,7 +49,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesGasPipesInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -62,7 +62,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId) // if (!m_handlerParticipantBoobyTrap->init()) // { - // ERROR_LOG() << "Initialisation m_handlerParticipantBoobyTrap failed."; + // ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantBoobyTrap failed."; // return false; // } @@ -74,7 +74,7 @@ bool CesGasPipesInterfaceImpl::init(int domainId, int exerciseId) // if (!m_handlerParticipantOffRouteMine->init()) // { - // ERROR_LOG() << "Initialisation m_handlerParticipantOffRouteMine failed."; + // ERROR_LOG(m_logger) << "Initialisation m_handlerParticipantOffRouteMine failed."; // return false; // } @@ -85,8 +85,8 @@ QString CesGasPipesInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesGasPipesInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CesGasPipesInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CesGasPipesInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CesGasPipesInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CesGasPipesInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/BallisticService.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/BallisticService.cpp index 5dd320074..e9f94b282 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/BallisticService.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/BallisticService.cpp @@ -54,11 +54,11 @@ bool BallisticService::init(const QString &a_configPath, m_configFile = a_configFile; m_ammunitionFile = a_ammunitionFile; - INFO_LOG() << "init"; + INFO_LOG(m_logger) << "init"; m_ammuConfig = N_ConfigSystem::AmmuConfig::getInstance(); QString FileName = a_configPath + QLatin1Char('/') + a_ammunitionFile; - INFO_LOG() << "FileName=" << FileName; + INFO_LOG(m_logger) << "FileName=" << FileName; m_ammuConfig->initFilename(FileName); @@ -74,15 +74,15 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter { if (!m_Initialized) { - ERROR_LOG() << "Class is not initialized" ; + ERROR_LOG(m_logger) << "Class is not initialized" ; return false; } Ammunition *configuredAmmunition; E_TypeOfImpl e_impl = e_ImplBase; - DEBUG_LOG() << "Target Interface Pointer : " << app_interface ; - DEBUG_LOG() << "Searching in available ammunitions for " << a_ammuName ; + DEBUG_LOG(m_logger) << "Target Interface Pointer : " << app_interface ; + DEBUG_LOG(m_logger) << "Searching in available ammunitions for " << a_ammuName ; //iterate over all Ammunition nodes and find the corresponding Ammunition name bool bAmmunitionFound = false; @@ -95,7 +95,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter //find ammunition configuredAmmunition = &ammunition; - DEBUG_LOG() << "Ammunition found: " << configuredAmmunition->m_AmmunInfo.m_Name ; + DEBUG_LOG(m_logger) << "Ammunition found: " << configuredAmmunition->m_AmmunInfo.m_Name ; if (configuredAmmunition->m_AmmunInfo.m_Name == a_ammuName) { @@ -118,7 +118,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter e_impl = e_ImplBase; else { - ERROR_LOG() << "Configured Algorithm not known :" + ERROR_LOG(m_logger) << "Configured Algorithm not known :" << configuredAmmunition->m_AmmunInfo.m_Algorithm; return false; } @@ -128,7 +128,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter if (!bAmmunitionFound) { - ERROR_LOG() << "Desired ammunition was not found :" << a_ammuName ; + ERROR_LOG(m_logger) << "Desired ammunition was not found :" << a_ammuName ; return false; } @@ -162,7 +162,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter p_firecontrol = new FireControlRungeKuttaSimple; break; default: - ERROR_LOG() << "Implementation does not exist: " << e_impl ; + ERROR_LOG(m_logger) << "Implementation does not exist: " << e_impl ; *app_interface = nullptr; return false; } @@ -198,7 +198,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter p_trajectorybase = new TrajectoryRungeKuttaSimple; break; default: - ERROR_LOG() << "Implementation does not exist: " << e_impl ; + ERROR_LOG(m_logger) << "Implementation does not exist: " << e_impl ; *app_interface = nullptr; return false; } @@ -208,7 +208,7 @@ bool BallisticService::createInterfaceOf(IUnknown **app_interface, E_TypeOfInter break; } default: - ERROR_LOG() << "Interface does not exist: " << a_typeInterface ; + ERROR_LOG(m_logger) << "Interface does not exist: " << a_typeInterface ; *app_interface = nullptr; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/FireControlBase.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/FireControlBase.cpp index bd6ccd1e4..6c11775ab 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/FireControlBase.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/FireControlBase.cpp @@ -63,7 +63,7 @@ bool FireControlBase::init(const Ammunition &a_ammunition) if (a_ammunition.m_StandardParams.m_Valid) { - TRACE_LOG() << "FireControlBase::init : initialising StandardParams..." ; + TRACE_LOG(m_logger) << "FireControlBase::init : initialising StandardParams..." ; m_InitialAmmuVelocityV0constX1 = a_ammunition.m_StandardParams.m_Speed.m_V0ConstX1; m_InitialAmmuVelocityV0constX0 = a_ammunition.m_StandardParams.m_Speed.m_V0ConstX0; @@ -76,14 +76,14 @@ bool FireControlBase::init(const Ammunition &a_ammunition) m_Initialized = true; - TRACE_LOG() << "m_InitialAmmuVelocityV0constX1 : " << m_InitialAmmuVelocityV0constX1 ; - TRACE_LOG() << "m_InitialAmmuVelocityV0constX0 : " << m_InitialAmmuVelocityV0constX0 ; - TRACE_LOG() << "m_CrossWindConstX3 : " << m_CrossWindConstX3 ; - TRACE_LOG() << "m_CrossWindConstX2 : " << m_CrossWindConstX2 ; - TRACE_LOG() << "m_CrossWindConstX1 : " << m_CrossWindConstX1 ; - TRACE_LOG() << "m_CrossWindConstX0 : " << m_CrossWindConstX0 ; + TRACE_LOG(m_logger) << "m_InitialAmmuVelocityV0constX1 : " << m_InitialAmmuVelocityV0constX1 ; + TRACE_LOG(m_logger) << "m_InitialAmmuVelocityV0constX0 : " << m_InitialAmmuVelocityV0constX0 ; + TRACE_LOG(m_logger) << "m_CrossWindConstX3 : " << m_CrossWindConstX3 ; + TRACE_LOG(m_logger) << "m_CrossWindConstX2 : " << m_CrossWindConstX2 ; + TRACE_LOG(m_logger) << "m_CrossWindConstX1 : " << m_CrossWindConstX1 ; + TRACE_LOG(m_logger) << "m_CrossWindConstX0 : " << m_CrossWindConstX0 ; - TRACE_LOG() << "FireControlBase::init : initialized successfully!" ; + TRACE_LOG(m_logger) << "FireControlBase::init : initialized successfully!" ; return true; } @@ -101,13 +101,13 @@ Float64 FireControlBase::getFlightTime(const Float64 a_distance, if (!m_Initialized) { - WARNING_LOG() << "The class is not initialized" ; + WARNING_LOG(m_logger) << "The class is not initialized" ; return 0.0; } if (a_distance < 1.0 || a_initialAmmuVelocity < 1.0) { - ERROR_LOG() << "The parameters are not correct" ; + ERROR_LOG(m_logger) << "The parameters are not correct" ; return 0.0; } @@ -133,7 +133,7 @@ Float64 FireControlBase::getFireAngle(const Float64 a_distance, const Float64 a_ if (!m_Initialized) { - WARNING_LOG() << "The class is not initialized" ; + WARNING_LOG(m_logger) << "The class is not initialized" ; return 0.0; } @@ -143,7 +143,7 @@ Float64 FireControlBase::getFireAngle(const Float64 a_distance, const Float64 a_ (a_terrainAngle > M_PI_2) || (a_terrainAngle < -M_PI_2)) { - ERROR_LOG() << "The parameters are not correct" ; + ERROR_LOG(m_logger) << "The parameters are not correct" ; return 0.0; } @@ -168,7 +168,7 @@ N_Types::Radian64 FireControlBase::getCrossWindCorrection(const Float64 a_crossW if (!m_Initialized) { - ERROR_LOG() << "The class is not initialized" ; + ERROR_LOG(m_logger) << "The class is not initialized" ; return 0.0; } @@ -177,7 +177,7 @@ N_Types::Radian64 FireControlBase::getCrossWindCorrection(const Float64 a_crossW m_CrossWindConstX1 == 0 && m_CrossWindConstX0 == 0) { - WARNING_LOG() << "The class uses probably not initialized parameters" ; + WARNING_LOG(m_logger) << "The class uses probably not initialized parameters" ; return 0.0; } @@ -206,7 +206,7 @@ Float64 FireControlBase::getAirDensity(const Float64 a_atmosphericPressure, cons if ((a_atmosphericPressure <= 1.0) || (a_airTemperature <= -N_SST::ZERO_CELSIUS_IN_KELVIN)) { - ERROR_LOG() << "The parameters are not correct, Pressure=" << a_atmosphericPressure << ", Temp=" << a_airTemperature ; + ERROR_LOG(m_logger) << "The parameters are not correct, Pressure=" << a_atmosphericPressure << ", Temp=" << a_airTemperature ; return 1.0; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/TrajectoryBase.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/TrajectoryBase.cpp index 5664ac3d9..e32c4390f 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/TrajectoryBase.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/FW_Ballistic/TrajectoryBase.cpp @@ -70,16 +70,16 @@ bool TrajectoryBase::init(const N_Types::Coord3 &a_gunPos, const N_Types::Angle3 if (m_Deviation != 0) { - INFO_LOG() << "Deviation taken into account: " << m_Deviation ; + INFO_LOG(m_logger) << "Deviation taken into account: " << m_Deviation ; Float64 l_deviationRandomized = m_Deviation * (Float64)(rand() % 100) / 100.0; - INFO_LOG() << "l_deviationRandomized = " << l_deviationRandomized ; + INFO_LOG(m_logger) << "l_deviationRandomized = " << l_deviationRandomized ; N_Types::Coord3 o_dev(l_deviationRandomized, 1000.0, 0.0); - //INFO_LOG() << "o_dev = " << o_dev ; + //INFO_LOG(m_logger) << "o_dev = " << o_dev ; Float64 l_angleRandomized = rand() % 360; - INFO_LOG() << "l_angleRandomized = " << l_angleRandomized ; + INFO_LOG(m_logger) << "l_angleRandomized = " << l_angleRandomized ; N_Types::Radian64 l_angleRad; l_angleRad.setDegree(l_angleRandomized); @@ -90,7 +90,7 @@ bool TrajectoryBase::init(const N_Types::Coord3 &a_gunPos, const N_Types::Angle3 o_angle.m_H = o_dev.getPolar3().getAzimuth(); o_angle.m_P = o_dev.getPolar3().getElevation(); - //INFO_LOG() << "o_angle = " << o_angle << END_LOG + //INFO_LOG(m_logger) << "o_angle = " << o_angle << END_LOG m_GunAngle = m_GunAngle + o_angle; } @@ -115,13 +115,13 @@ bool TrajectoryBase::move(const Float64 a_deltaTime) { if (!m_Initialized) { - WARNING_LOG() << "The class is not initialized" ; + WARNING_LOG(m_logger) << "The class is not initialized" ; return false; } if (!m_Active) { - ERROR_LOG() << "Call init(gunPos, gunAngle, ...) first" ; + ERROR_LOG(m_logger) << "Call init(gunPos, gunAngle, ...) first" ; return false; } @@ -161,7 +161,7 @@ bool TrajectoryBase::init(const Ammunition &a_ammunition) { m_Initialized = false; - TRACE_LOG() << "TrajectoryBase::init : initialising..." ; + TRACE_LOG(m_logger) << "TrajectoryBase::init : initialising..." ; m_TimeOutCycles = a_ammunition.m_AmmunInfo.m_TimeOut / 1000.0; m_TimeOut = m_TimeOutCycles; @@ -178,9 +178,9 @@ bool TrajectoryBase::init(const Ammunition &a_ammunition) m_IsDetonateOnImpact = true; } - TRACE_LOG() << "TrajectoryBase::init : initialized successfully!" ; + TRACE_LOG(m_logger) << "TrajectoryBase::init : initialized successfully!" ; - TRACE_LOG() << "m_TimeOutCycles : " << m_TimeOutCycles ; + TRACE_LOG(m_logger) << "m_TimeOutCycles : " << m_TimeOutCycles ; m_Initialized = true; return true; @@ -246,7 +246,7 @@ void TrajectoryBase::setVelAccelOrientTimeOut() if (m_TimeOut < 0) { - INFO_LOG() << "Bullet timed out : " << m_TimeOutCycles ; + INFO_LOG(m_logger) << "Bullet timed out : " << m_TimeOutCycles ; m_Active = false; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.cpp index 60684689e..c377fbf9d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.cpp @@ -30,7 +30,7 @@ GeoConfig *GeoConfig::getInstance() bool GeoConfig::initFilename(const QString &fileName) { // const QFileInfo qFileInfo(fileName); -// INFO_LOG() << Q_FUNC_INFO << " START, GeoConfig::absoluteFilePath ='" << qFileInfo.absoluteFilePath() << "'"; +// INFO_LOG(m_logger) << Q_FUNC_INFO << " START, GeoConfig::absoluteFilePath ='" << qFileInfo.absoluteFilePath() << "'"; // AmmunitionMap ConfigSettings::initFilename(fileName); @@ -41,7 +41,7 @@ bool GeoConfig::initFilename(const QString &fileName) const QStringList &filePaths_rough_to_fine = elevationName.split(QStringLiteral(";")); -// INFO_LOG() << Q_FUNC_INFO << " use following file(s) for ElevationMap: '" << elevationName << "'"; +// INFO_LOG(m_logger) << Q_FUNC_INFO << " use following file(s) for ElevationMap: '" << elevationName << "'"; if (!m_elevationMapManager) { @@ -49,7 +49,7 @@ bool GeoConfig::initFilename(const QString &fileName) m_elevationMapManager->init(filePaths_rough_to_fine); } -// TRACE_LOG() << Q_FUNC_INFO << " END, filename ='" << fileName << "'"; +// TRACE_LOG(m_logger) << Q_FUNC_INFO << " END, filename ='" << fileName << "'"; return true; } @@ -78,9 +78,9 @@ void GeoConfig::initializeAmmu() QVector l_charges = getFloatVector(QStringLiteral("ChargeMap"), s_ammu_group); m_ChargeMap[i] = l_charges; -// INFO_LOG() << "Store ChargeMap Entry: " << " i=" << i << " s_ammu_group = '" << s_ammu_group << "'"; +// INFO_LOG(m_logger) << "Store ChargeMap Entry: " << " i=" << i << " s_ammu_group = '" << s_ammu_group << "'"; // for (int j = 0; j < l_charges.size(); j++) -// INFO_LOG() << j << " = " << l_charges[j]; +// INFO_LOG(m_logger) << j << " = " << l_charges[j]; } } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.h index a3d77caf0..45b5830e3 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GBL_ConfigSystem/geoconfig.h @@ -37,6 +37,7 @@ namespace N_ConfigSystem class GeoConfig: public ConfigSettings { private: + NGL::INGLLogger &m_logger; explicit GeoConfig(); ~GeoConfig(); public: @@ -48,6 +49,7 @@ public: double getElevation(const double lon, const double lat) const; private: + NGL::INGLLogger &m_logger; friend class CesGeoPairing::HandlerGeoPairing; // for initFilename bool initFilename(const QString &fileName); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairing/GeoPairing.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairing/GeoPairing.cpp index 1adaa9505..5cb8da5e8 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairing/GeoPairing.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairing/GeoPairing.cpp @@ -33,34 +33,34 @@ GeoPairing::GeoPairing(const std::shared_ptr &bal m_ballisticService(ballisticService) , m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairing")) { - INFO_LOG() << "konfigPath = " << ballisticService->getConfigPath() ; + INFO_LOG(m_logger) << "konfigPath = " << ballisticService->getConfigPath() ; const QString s_configPath = ballisticService->getConfigPath(); - INFO_LOG() << "GeoPairing Config location : " << s_configPath ; + INFO_LOG(m_logger) << "GeoPairing Config location : " << s_configPath ; GeoPairingImpl *l_impl = new GeoPairingImplDted; - INFO_LOG() << "--> Installing GeoPairingImplDted..." ; + INFO_LOG(m_logger) << "--> Installing GeoPairingImplDted..." ; GeoPairingImplFactory::setImpl(l_impl); readAmmunitionIni(); // initialize the GeoPairing implementation if (!GeoPairingImplFactory::initialize(s_configPath)) { - ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!" ; + ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!" ; l_impl = new GeoPairingImplBalistic(); - INFO_LOG() << "--> Installing GeoPairingImplBalistic..."; + INFO_LOG(m_logger) << "--> Installing GeoPairingImplBalistic..."; GeoPairingImplFactory::setImpl(l_impl); if (!GeoPairingImplFactory::initialize(s_configPath)) { - ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!" ; + ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!" ; abort(); } else - INFO_LOG() << "GeoPairingImplBalistic correctly initialized" ; + INFO_LOG(m_logger) << "GeoPairingImplBalistic correctly initialized" ; } else - INFO_LOG() << "GeoPairingImplDted correctly initialized" ; + INFO_LOG(m_logger) << "GeoPairingImplDted correctly initialized" ; #ifdef _PSEUDO_TARGETS_ // initial lat long position @@ -110,24 +110,24 @@ GeoPairing::GeoPairing(const std::shared_ptr &bal #endif - INFO_LOG() << "Initialization finished"; + INFO_LOG(m_logger) << "Initialization finished"; } void GeoPairing::calculateAirFire(const QByteArray &transparentData, const QHash &aircrafts) { - INFO_LOG() << "calculateAirFire (IGLA)..." ; + INFO_LOG(m_logger) << "calculateAirFire (IGLA)..." ; GeoPairingDataFireReport l_Report; if (!l_Report.parse(transparentData)) { - WARNING_LOG() << "Error: Couldn't parse Fire Report" ; + WARNING_LOG(m_logger) << "Error: Couldn't parse Fire Report" ; return; } if (aircrafts.size() == 0) { - INFO_LOG() << "No Aircraft available"; + INFO_LOG(m_logger) << "No Aircraft available"; return; } @@ -139,7 +139,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, SInt32 vulnerabilityState = i.value().vulnerabilityState.underlying(); Float64 lat = i.value().pos().lat() * 180 / M_PI; Float64 lon = i.value().pos().lon() * 180 / M_PI; - DEBUG_LOG() << "GeoPairing::calculateAirFire" + DEBUG_LOG(m_logger) << "GeoPairing::calculateAirFire" << "\nl_Updater->update : " << i.key() << "\n: participantId=" << i.value().participantId() << "\n participantTypeId= " << i.value().participantTypeId() @@ -164,7 +164,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, l_SensorData.FireTime = m_Time; l_SensorData.WeaponElevation = 0; - INFO_LOG() << "--> IGLA : Report Target Fire (createSensorData)" + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (createSensorData)" << "\nl_SensorData.WeaponPositionLat = " << l_SensorData.WeaponPositionLat << "\nl_SensorData.WeaponPositionLong = " << l_SensorData.WeaponPositionLong << "\nl_SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth @@ -173,11 +173,11 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, ; SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData); - INFO_LOG() << "createSensorData -> SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth + INFO_LOG(m_logger) << "createSensorData -> SensorData.WeaponAzimuth=" << l_SensorData.WeaponAzimuth << "\nl_SensorData.WeaponElevation=" << l_SensorData.WeaponElevation; if (l_DeviceID == -1) { - ERROR_LOG() << "Couldn't create SensorData" ; + ERROR_LOG(m_logger) << "Couldn't create SensorData" ; return; } @@ -189,14 +189,14 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, if (l_Report.m_DeviceID == PAN_GP_REQUEST_IGLA) { - INFO_LOG() << " -> IGLA : Request Target Detection " ; + INFO_LOG(m_logger) << " -> IGLA : Request Target Detection " ; QScopedPointer l_Cache(GeoPairingImplFactory::createAirTargetCache(m_equipmentNumber)); int l_TargetPlayerId = 0; uint64_t l_ImpactTime = 0; - INFO_LOG() << "-> IGLA : Request Target Detection -> searchAirTarget (vor dem aufruf)" + INFO_LOG(m_logger) << "-> IGLA : Request Target Detection -> searchAirTarget (vor dem aufruf)" << "\nl_Elevation = " << l_Elevation << "\nl_Azimuth = " << l_Azimuth ; @@ -204,7 +204,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, bool l_TargetFound = searchAirTarget(l_Elevation, l_Azimuth, l_TargetPlayerId, l_ImpactTime); - INFO_LOG() << "-> IGLA : Request Target Detection -> searchAirTarget (nach dem aufruf)" + INFO_LOG(m_logger) << "-> IGLA : Request Target Detection -> searchAirTarget (nach dem aufruf)" << "\nl_TargetFound = " << l_TargetFound << "\nl_TargetPlayerId = " << l_TargetPlayerId << "\nl_ImpactTime = " << l_ImpactTime @@ -213,7 +213,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, bool l_CachedTrackingState = l_Cache->getLatestTrackState(l_TargetPlayerId); UInt32 l_CachedTrackingTime = l_Cache->getLatestTrackTime(l_TargetPlayerId); - INFO_LOG() << "-> IGLA : Retrieved Target Detection Results from Cache" + INFO_LOG(m_logger) << "-> IGLA : Retrieved Target Detection Results from Cache" << "\nl_CachedTrackingState = " << l_CachedTrackingState << "\nl_CachedTrackingTime = " << l_CachedTrackingTime ; @@ -239,26 +239,26 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, m_reportTarget.send = true; // Richtung Gefechtsfeld - INFO_LOG() << "<-- EC : Report Target Detection " ; - INFO_LOG() << "Target Found : " << l_TargetFound ; + INFO_LOG(m_logger) << "<-- EC : Report Target Detection " ; + INFO_LOG(m_logger) << "Target Found : " << l_TargetFound ; //m_geoPairingData->sendData(m_PlayerId, l_SendData.data(), l_SendData.size() ); l_Cache->storeLatestTrackState(l_TargetPlayerId, m_Time, l_TargetFound); } } - INFO_LOG() << "\n\nPAN_GP_REPORT_IGLA m_DeviceID=" << l_Report.m_DeviceID + INFO_LOG(m_logger) << "\n\nPAN_GP_REPORT_IGLA m_DeviceID=" << l_Report.m_DeviceID << " PAN_GP_REPORT_IGLA=" << PAN_GP_REPORT_IGLA; if (l_Report.m_DeviceID == PAN_GP_REPORT_IGLA) { - INFO_LOG() << "--> IGLA : Report Target Fire " ; + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire " ; int l_TargetPlayerId = 0; UInt64 l_ImpactTime = 0; QScopedPointer l_Tracker(GeoPairingImplFactory::createAirTargetTracker()); - INFO_LOG() << "--> IGLA : Report Target Fire (l_Tracker->setPosition)" + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (l_Tracker->setPosition)" << "\nm_PositionLat = " << m_PositionLat << "\nm_PositionLon = " << m_PositionLon << "\nm_PositionHeight = " << m_PositionHeight @@ -266,12 +266,12 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, l_Tracker->setPosition(m_PositionLat, m_PositionLon, m_PositionHeight); - INFO_LOG() << "--> IGLA : Report Target Fire (setTime)" + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (setTime)" << "\nm_Time = " << m_Time ; l_Tracker->setTime(m_Time); - INFO_LOG() << "--> IGLA : Report Target Fire (vor l_Tracker->track)" + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (vor l_Tracker->track)" << "\nl_Azimuth = " << l_Azimuth << "\nl_Elevation = " << l_Elevation << "\nl_TargetPlayerId = " << l_TargetPlayerId @@ -280,7 +280,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, bool l_TargetFound = l_Tracker->track(l_Azimuth, l_Elevation, l_TargetPlayerId, l_ImpactTime); - INFO_LOG() << "--> IGLA : Report Target Fire (nach l_Tracker->track)" + INFO_LOG(m_logger) << "--> IGLA : Report Target Fire (nach l_Tracker->track)" << "\nl_TargetFound = " << l_TargetFound ; if (l_TargetFound) @@ -295,17 +295,17 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, { //m_surfaceToAir->fire(l_TargetPlayerId, l_ImpactTime, l_AmmunitionType, m_PlayerId, true); m_fireToAircraft.hit = true; - INFO_LOG() << "Air Target " << l_TargetPlayerId << " in reach and hit" ; + INFO_LOG(m_logger) << "Air Target " << l_TargetPlayerId << " in reach and hit" ; } else { //m_surfaceToAir->fire(l_TargetPlayerId, l_ImpactTime, l_AmmunitionType, m_PlayerId, false); m_fireToAircraft.hit = false; - INFO_LOG() << "Air Target " << l_TargetPlayerId << " in reach, but not hit" ; + INFO_LOG(m_logger) << "Air Target " << l_TargetPlayerId << " in reach, but not hit" ; } } else - INFO_LOG() << "No Air Target withing reach..." ; + INFO_LOG(m_logger) << "No Air Target withing reach..." ; } } @@ -314,7 +314,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData, void GeoPairing::calculateAreaFire(const QByteArray &transparentData, const std::shared_ptr &ballisticService) { - INFO_LOG() << "calculateAreaFire (MK19)..." ; + INFO_LOG(m_logger) << "calculateAreaFire (MK19)..." ; // Prepare SensorData for Implementation GeoPairingImplSensorData l_SensorData; @@ -325,20 +325,20 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData, GeoPairingDataFireReport l_Report; if (!l_Report.parse(transparentData)) { - ERROR_LOG() << "Error: Couldn't parse Fire Report" ; + ERROR_LOG(m_logger) << "Error: Couldn't parse Fire Report" ; return; } SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData); if (l_DeviceID == -1) { - ERROR_LOG() << "Couldn't create SensorData" ; + ERROR_LOG(m_logger) << "Couldn't create SensorData" ; return; } QScopedPointer l_FiredBullet(GeoPairingImplFactory::createFiredBullet(l_SensorData)); if (l_FiredBullet == nullptr) { - ERROR_LOG() << "Error: Couldn't create FiredBullet object" ; + ERROR_LOG(m_logger) << "Error: Couldn't create FiredBullet object" ; return; } @@ -353,7 +353,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData, GeoPairingImplImpactData *l_ImpactData = l_FiredBullet->getImpactData(); if (l_ImpactData == nullptr) { - ERROR_LOG() << "Error: Couldn't create ImpactData object" ; + ERROR_LOG(m_logger) << "Error: Couldn't create ImpactData object" ; return; } @@ -364,15 +364,15 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData, case MK19Type_m385: l_AmmunitionType = N_Ballistic::MK19_M385; l_AmmunitionTypeOSAG = N_Ballistic::MK19_M385_OSAG; - INFO_LOG() << "Wirkfeld Ammunition MK19_M385" ; + INFO_LOG(m_logger) << "Wirkfeld Ammunition MK19_M385" ; break; case MK19Type_m430: l_AmmunitionType = N_Ballistic::MK19_M430; l_AmmunitionTypeOSAG = N_Ballistic::MK19_M430_OSAG; - INFO_LOG() << "Wirkfeld Ammunition MK19_M430" ; + INFO_LOG(m_logger) << "Wirkfeld Ammunition MK19_M430" ; break; default: - ERROR_LOG() << "Default Ammunition. Must not be called : " << l_SensorData.AmmunitionType ; + ERROR_LOG(m_logger) << "Default Ammunition. Must not be called : " << l_SensorData.AmmunitionType ; return; } @@ -417,7 +417,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData, m_areaFireToCtas.ammunitionTypeOSAG = l_AmmunitionTypeOSAG; m_areaFireToCtas.hit = true; - INFO_LOG() << "calculateAreaFire m_equipmentNumber=" << m_equipmentNumber + INFO_LOG(m_logger) << "calculateAreaFire m_equipmentNumber=" << m_equipmentNumber << " ImpactTime=" << l_ImpactData->ImpactTime << " ImpactPositionLat=" << l_ImpactData->ImpactPositionLat << " ImpactPositionLong=" << l_ImpactData->ImpactPositionLong @@ -431,7 +431,7 @@ void GeoPairing::calculateAreaFire(const QByteArray &transparentData, void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const std::shared_ptr &ballisticService) { - INFO_LOG() << "calculateSingleFire ..." ; + INFO_LOG(m_logger) << "calculateSingleFire ..." ; ElevationError error_elevation = ElevationError::NoError; int error_charge = 0; @@ -446,10 +446,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st l_SensorData.IgnitionType = -1; // Unknown SInt32 l_DeviceID = GeoPairingImplFactory::createSensorData(&l_SensorData, transparentData, error_mun); - INFO_LOG() << "l_DeviceID=" << l_DeviceID; + INFO_LOG(m_logger) << "l_DeviceID=" << l_DeviceID; if (l_DeviceID == -1) { - ERROR_LOG() << "Couldn't create SensorData" ; + ERROR_LOG(m_logger) << "Couldn't create SensorData" ; return; } @@ -463,7 +463,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st QString pfadQstr = CesGeoPairing::Settings::cesGeopairingIniPath() + QStringLiteral("/"); std::string pfad = pfadQstr.toStdString(); std::string munart; - INFO_LOG() << "Vor switch AmmunitionType=" << l_SensorData.AmmunitionType + INFO_LOG(m_logger) << "Vor switch AmmunitionType=" << l_SensorData.AmmunitionType << " ChargeType=" << l_SensorData.ChargeType; // Ammunition HE-M1 @@ -471,7 +471,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st { case HE_M1A2: { - INFO_LOG() << "HE_M1A2"; + INFO_LOG(m_logger) << "HE_M1A2"; switch (l_SensorData.ChargeType) { case 0: @@ -497,32 +497,32 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st case M60mm_m385: case M60mm_m430: { - INFO_LOG() << "M60mm_m385 M60mm_m430"; + INFO_LOG(m_logger) << "M60mm_m385 M60mm_m430"; switch (l_SensorData.IgnitionType) // ChargeType = Ladung... { // Todo: Umbenennen und ggf. Zuordnung korrigieren case 0: - INFO_LOG() << "Moerser-60mm-Lad1"; + INFO_LOG(m_logger) << "Moerser-60mm-Lad1"; munart = "Moerser-60mm-Lad1"; break; case 1: - INFO_LOG() << "Moerser-60mm-Lad2"; + INFO_LOG(m_logger) << "Moerser-60mm-Lad2"; munart = "Moerser-60mm-Lad2"; break; case 2: - INFO_LOG() << "Moerser-60mm-Lad3"; + INFO_LOG(m_logger) << "Moerser-60mm-Lad3"; munart = "Moerser-60mm-Lad3"; break; case 3: - INFO_LOG() << "Moerser-60mm-Lad4"; + INFO_LOG(m_logger) << "Moerser-60mm-Lad4"; munart = "Moerser-60mm-Lad4"; break; case 4: - INFO_LOG() << "Moerser-60mm-Lad5"; + INFO_LOG(m_logger) << "Moerser-60mm-Lad5"; munart = "Moerser-60mm-Lad5"; break; case 5: - INFO_LOG() << "Moerser-60mm-La6"; + INFO_LOG(m_logger) << "Moerser-60mm-La6"; munart = "Moerser-60mm-Lad6"; break; default: @@ -532,7 +532,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st } case VLAP_M9703: { - INFO_LOG() << "VLAP_M9703"; + INFO_LOG(m_logger) << "VLAP_M9703"; // Sonderfall Ammunition VLAP-M64. Da hier nur 5 x M64 Incr als Ladung vorhanden ist. // Sollten wir eine andere Ladung aus dem Gefechtsfeld bekommen, dann Munition HE M1A2 benutzen switch (l_SensorData.ChargeType) @@ -610,7 +610,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st } if (munart.empty()) { - WARNING_LOG() << "No valid charge type " << l_SensorData.ChargeType << + WARNING_LOG(m_logger) << "No valid charge type " << l_SensorData.ChargeType << " for ammunition " << l_SensorData.AmmunitionType << " (internal ids!)" ; munart = "HE-M1-M64Base-TableE"; @@ -618,7 +618,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st } std::string suffix = ".sus"; - DEBUG_LOG() << "schusstafel pfad=" << pfad + DEBUG_LOG(m_logger) << "schusstafel pfad=" << pfad << " munart=" << munart << " suffix=" << suffix; Schusstafel schusstafel(pfad, munart, suffix); @@ -647,10 +647,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st double elevationGrad = l_SensorData.WeaponElevation.getDegree(); if (elevationGrad <= 0.0) { - INFO_LOG() << "Elevation ist <= 0 Grad. Entfernung wird auf 50% des ersten Wertes aus der Schusstafel festgesetzt" ; + INFO_LOG(m_logger) << "Elevation ist <= 0 Grad. Entfernung wird auf 50% des ersten Wertes aus der Schusstafel festgesetzt" ; // Dazu aus der minimal moeglichen Elevation die Entfernung bestimmen und halbieren float minEval = mun.minEleval * MILRAD; - DEBUG_LOG() << "schusstafel tafelName=" << tafelName + DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName << " minEval=" << minEval << "zielhoehenwinkel=" << zielhoehenwinkel; @@ -661,10 +661,10 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st } else if (elevationGrad >= 90.0) { - INFO_LOG() << "Elevation ist >= 90 Grad. Entfernung wird auf den letzten Wert aus der Schusstafel festgesetzt" ; + INFO_LOG(m_logger) << "Elevation ist >= 90 Grad. Entfernung wird auf den letzten Wert aus der Schusstafel festgesetzt" ; // Dazu aus der maximal moeglichen Elevation die Entfernung bestimmen double maxEval = mun.maxEleval * MILRAD; - DEBUG_LOG() << "schusstafel tafelName=" << tafelName + DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName << " maxEval=" << maxEval << "zielhoehenwinkel=" << zielhoehenwinkel; schusstafel.ST_artillerie(tafelName, maxEval, zielhoehenwinkel, &entfernung1, &aufsatz1, &flugzeit1, &drift1, @@ -672,14 +672,14 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st } else { - DEBUG_LOG() << "schusstafel tafelName=" << tafelName + DEBUG_LOG(m_logger) << "schusstafel tafelName=" << tafelName << " arg_wert=" << arg_wert << "zielhoehenwinkel=" << zielhoehenwinkel; schusstafel.ST_artillerie(tafelName, arg_wert, zielhoehenwinkel, &entfernung1, &aufsatz1, &flugzeit1, &drift1, &entfernung2, &aufsatz2, &flugzeit2, &drift2); } - INFO_LOG() << "Schusstafel " << munart << ".sus: " + INFO_LOG(m_logger) << "Schusstafel " << munart << ".sus: " << "Entfernung [m]: " << entfernung1 << " Elevation [mil]: " << evalMil << " Drift [grad]: " << drift1 * 180 / M_PI @@ -691,14 +691,14 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st else { // != G5G6 && != M109 - INFO_LOG() << "calculate(ballisticService)"; + INFO_LOG(m_logger) << "calculate(ballisticService)"; l_FiredBullet->calculate(ballisticService); } GeoPairingImplImpactData *l_ImpactData = l_FiredBullet->getImpactData(); if (!l_ImpactData) { - ERROR_LOG() << "No impact Data available"; + ERROR_LOG(m_logger) << "No impact Data available"; return; } @@ -794,7 +794,7 @@ void GeoPairing::calculateSingleFire(const QByteArray &transparentData, const st // l_DeviceID); QString latStr = QString::number(l_ImpactData->ImpactPositionLat, 'f', 8); QString lonStr = QString::number(l_ImpactData->ImpactPositionLong, 'f', 8); - INFO_LOG() << "calculateSingleFire m_equipmentNumber=" << m_equipmentNumber + INFO_LOG(m_logger) << "calculateSingleFire m_equipmentNumber=" << m_equipmentNumber << " ImpactTime=" << l_ImpactData->ImpactTime << " ImpactPositionLat=" << latStr << " ImpactPositionLong=" << lonStr @@ -830,20 +830,20 @@ bool GeoPairing::geoPairingData(const std::shared_ptr E3 : Firing Report " ; + INFO_LOG(m_logger) << "--> E3 : Firing Report " ; switch (l_DeviceID) { @@ -874,7 +874,7 @@ bool GeoPairing::geoPairingData(const std::shared_ptr Unknown DeviceID " << l_DeviceID << " used !" ; + WARNING_LOG(m_logger) << "--> Unknown DeviceID " << l_DeviceID << " used !" ; return false; } } else { - WARNING_LOG() << "--> Unknown MessageID used ! " ; + WARNING_LOG(m_logger) << "--> Unknown MessageID used ! " ; return false; } @@ -913,7 +913,7 @@ void GeoPairing::setMeteo(double winddirection, double windspeed, double tempera bool GeoPairing::searchAirTarget(double a_elevation, double azimuth, int &playerId, uint64_t &impactTime) { - INFO_LOG() << "searchAirTarget (IGLA)..." ; + INFO_LOG(m_logger) << "searchAirTarget (IGLA)..." ; QScopedPointer l_Tracker(GeoPairingImplFactory::createAirTargetTracker()); @@ -936,25 +936,25 @@ void GeoPairing::readAmmunitionIni() //Zu erst holen wir uns alle WaffenTypen const QVector typesList = ammuConfig->getIntegerVector(QStringLiteral("WeaponRestriction"), QStringLiteral("Types")); - DEBUG_LOG() << "typesList.size=" << typesList.size(); + DEBUG_LOG(m_logger) << "typesList.size=" << typesList.size(); //Wir holen uns alle Munitionen die in Frage kommen heraus // evtl mit Liste? const QVector ammoList = ammuConfig->getIntegerVector(QStringLiteral("WeaponRestriction"), QStringLiteral("AmmoList")); - DEBUG_LOG() << "ammoList=" << ammoList.size(); + DEBUG_LOG(m_logger) << "ammoList=" << ammoList.size(); for (int ammo : ammoList) { - DEBUG_LOG() << "ammoListValue=" << ammo; + DEBUG_LOG(m_logger) << "ammoListValue=" << ammo; QString eleGroup = QStringLiteral("Ammunition") + QStringLiteral("P") + QString::number(ammo) + QStringLiteral("/CWParams"); const QVector minElevataion = ammuConfig->getFloatVector(eleGroup, QStringLiteral("ElevMin")); - DEBUG_LOG() << "ammo = " << ammo << " minElevataion.size() =" << minElevataion.size() + DEBUG_LOG(m_logger) << "ammo = " << ammo << " minElevataion.size() =" << minElevataion.size() << " " << eleGroup << "/" << QStringLiteral("ElevMin"); const QVector maxElevataion = ammuConfig->getFloatVector(eleGroup, QStringLiteral("ElevMax")); - DEBUG_LOG() << "ammo = " << ammo << " maxElevataion.size() =" << maxElevataion.size() << eleGroup << "/" << QStringLiteral("ElevMax"); + DEBUG_LOG(m_logger) << "ammo = " << ammo << " maxElevataion.size() =" << maxElevataion.size() << eleGroup << "/" << QStringLiteral("ElevMax"); if (minElevataion.size() != maxElevataion.size()) { - DEBUG_LOG() << "Invalid Ammunition Config for : Ammunition" << ammo ; + DEBUG_LOG(m_logger) << "Invalid Ammunition Config for : Ammunition" << ammo ; continue; } // Get Allowd fpr all Types @@ -966,9 +966,9 @@ void GeoPairing::readAmmunitionIni() { QString alloweKey = QStringLiteral("Allowed") + QString::number(weaponTypeId); const QMap allowed = ammuConfig->getBoolMap(eleGroup, alloweKey); - DEBUG_LOG() << "alloweKey allowed.size() =" << allowed.size() << " " << eleGroup << "/" << alloweKey; + DEBUG_LOG(m_logger) << "alloweKey allowed.size() =" << allowed.size() << " " << eleGroup << "/" << alloweKey; allowedCombi.insert(weaponTypeId, allowed); - //DEBUG_LOG() << "allowedCombi.insert(" << weaponTypeId <<", " << allowed << ")"; + //DEBUG_LOG(m_logger) << "allowedCombi.insert(" << weaponTypeId <<", " << allowed << ")"; } for (int j = 0; j < minElevataion.size(); j++) @@ -983,13 +983,13 @@ void GeoPairing::readAmmunitionIni() //hier holen wir nur den erlaubtstatus fĂźr die jeweilige ChargeElevation und packen sie in die //Map des ChargeType allowedCombiForCharge.insert(weaponTypeId, allowedCombi.value(weaponTypeId).value(j)); - DEBUG_LOG() << "allowedCombiForCharge.insert(" << weaponTypeId << ", " << allowedCombi.value(weaponTypeId).value(j) << ")"; + DEBUG_LOG(m_logger) << "allowedCombiForCharge.insert(" << weaponTypeId << ", " << allowedCombi.value(weaponTypeId).value(j) << ")"; } GeoPCharge geoPCharge = GeoPCharge(_chargeId, _minEleval, _maxEleval, allowedCombiForCharge); mun.insert(j, geoPCharge); } m_geoPMunMap.insert(ammo, mun); } - DEBUG_LOG() << "m_geoPMunMap.size=" << m_geoPMunMap.size(); + DEBUG_LOG(m_logger) << "m_geoPMunMap.size=" << m_geoPMunMap.size(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingDataBase.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingDataBase.cpp index 9b86bf91d..c0830ef4c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingDataBase.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingDataBase.cpp @@ -35,20 +35,20 @@ bool GeoPairingDataBase::parse(const QByteArray& a_transparentData) if (a_transparentData.size() < m_Size) { - ERROR_LOG() << "Size of transparent Data not valid :" << a_transparentData.size() + ERROR_LOG(m_logger) << "Size of transparent Data not valid :" << a_transparentData.size() << " instead of " << m_Size; return false; } m_MessageID = a_transparentData[startMessageId]; int messageId = m_MessageID; - INFO_LOG() << "Header -> MessageID : " << messageId; + INFO_LOG(m_logger) << "Header -> MessageID : " << messageId; UInt8 deviceId; deviceId = a_transparentData[startDevice]; m_DeviceID = static_cast(deviceId); - INFO_LOG() << "Header -> DeviceID : " << m_DeviceID; + INFO_LOG(m_logger) << "Header -> DeviceID : " << m_DeviceID; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImpl.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImpl.cpp index 2128c3c00..705352019 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImpl.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImpl.cpp @@ -84,23 +84,23 @@ GeoPairingImplAirTargetCache *GeoPairingImpl::createAirTargetCache(UInt32 a_play // --------------------------------------------------------------- SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, const QByteArray& a_transparendData, int &isDefault) { - INFO_LOG() << "createSensorData"; + INFO_LOG(m_logger) << "createSensorData"; if (!m_Initialized) { - ERROR_LOG() << "Implementation not initialized"; + ERROR_LOG(m_logger) << "Implementation not initialized"; return -1; } if (!a_sensorData) { - ERROR_LOG() << "SensorData Object argument not valid"; + ERROR_LOG(m_logger) << "SensorData Object argument not valid"; return -1; } GeoPairingDataFireReport l_Report; if (!l_Report.parse(a_transparendData)) { - ERROR_LOG() << "Couldn't parse FireReport"; + ERROR_LOG(m_logger) << "Couldn't parse FireReport"; return -1; } @@ -141,9 +141,9 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, if (date.isValid()) { - INFO_LOG() << "GeoMagneticField DateRecord = " << l_DateRecord; - INFO_LOG() << "GeoMagneticField Declination = " << l_Declination; - INFO_LOG() << "GeoMagneticField ChangePerYear = " << l_ChangePerYear; + INFO_LOG(m_logger) << "GeoMagneticField DateRecord = " << l_DateRecord; + INFO_LOG(m_logger) << "GeoMagneticField Declination = " << l_Declination; + INFO_LOG(m_logger) << "GeoMagneticField ChangePerYear = " << l_ChangePerYear; time_t l_TimeNow = time(nullptr); struct tm l_TimeInfo; @@ -157,42 +157,42 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, int l_SecondsPerYear = 365 * 24 * 3600; int l_Years = l_TimeDiff / l_SecondsPerYear; // number of years since DateRecords - DEBUG_LOG() << "GeoMagneticField Years since DateRecord : " << l_Years; + DEBUG_LOG(m_logger) << "GeoMagneticField Years since DateRecord : " << l_Years; l_GeoMagneticCorrection = l_Declination + (l_Years * l_ChangePerYear); - INFO_LOG() << "GeoMagneticField Azimuth correction [degrees]: " << l_GeoMagneticCorrection; + INFO_LOG(m_logger) << "GeoMagneticField Azimuth correction [degrees]: " << l_GeoMagneticCorrection; l_GeoMagneticCorrection *= N_SST::PI_OVER_180; l_Azimuth += l_GeoMagneticCorrection; } } - INFO_LOG() << "createSensorData"; + INFO_LOG(m_logger) << "createSensorData"; if (l_Report.m_DeviceID == PAN_GP_REPORT_MORTAR) { int l_AmmunitionField = PAN_AMMU_INDEX(l_Report.m_Ammunition); - INFO_LOG() << "createSensorData PAN_GP_REPORT_MORTAR l_AmmunitionField=" << +l_AmmunitionField + INFO_LOG(m_logger) << "createSensorData PAN_GP_REPORT_MORTAR l_AmmunitionField=" << +l_AmmunitionField << " l_Report.m_Ammunition=" << +l_Report.m_Ammunition << " l_Report.m_Ammunition & 0x03=" << +(l_Report.m_Ammunition & 0x03); switch (l_Report.m_Ammunition & 0x03) { case 1: a_sensorData->AmmunitionType = MortarType1; - INFO_LOG() << "Using Mortar Ammunition 1"; + INFO_LOG(m_logger) << "Using Mortar Ammunition 1"; break; case 2: a_sensorData->AmmunitionType = MortarType2; - INFO_LOG() << "Using Mortar Ammunition 2"; + INFO_LOG(m_logger) << "Using Mortar Ammunition 2"; break; default: a_sensorData->AmmunitionType = MortarType1; - ERROR_LOG() << "Ammunition value means 'reserved' : " + ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : " << l_AmmunitionField; return -1; } a_sensorData->IgnitionType = (l_Report.m_Ammunition >> 3) & 0x07; - INFO_LOG() << "a_sensorData->IgnitionType= " << a_sensorData->IgnitionType; + INFO_LOG(m_logger) << "a_sensorData->IgnitionType= " << a_sensorData->IgnitionType; } else if ((l_Report.m_DeviceID == PAN_GP_REPORT_G5_G6) || (l_Report.m_DeviceID == PAN_GP_REPORT_M109)) { @@ -202,38 +202,38 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, case 1: a_sensorData->AmmunitionType = HE_M1A2; a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion; - INFO_LOG() << "Using HE_M1A2 Percussion"; + INFO_LOG(m_logger) << "Using HE_M1A2 Percussion"; break; case 2: a_sensorData->AmmunitionType = HE_M1A2; a_sensorData->IgnitionTypeG5G6 = IgnitionTypeProximity; - INFO_LOG() << "Using HE_M1A2 Proximity"; + INFO_LOG(m_logger) << "Using HE_M1A2 Proximity"; break; case 3: a_sensorData->AmmunitionType = VLAP_M9703; a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion; - INFO_LOG() << "Using VLAP_M9703 Percussion"; + INFO_LOG(m_logger) << "Using VLAP_M9703 Percussion"; break; case 4: a_sensorData->AmmunitionType = VLAP_M9703; a_sensorData->IgnitionTypeG5G6 = IgnitionTypeProximity; - INFO_LOG() << "Using VLAP_M9703 Proximity"; + INFO_LOG(m_logger) << "Using VLAP_M9703 Proximity"; break; case 5: a_sensorData->AmmunitionType = SMK_BE_M2; a_sensorData->IgnitionTypeG5G6 = IgnitionTypeTime; - INFO_LOG() << "Using SMK_BE_M2 Time"; + INFO_LOG(m_logger) << "Using SMK_BE_M2 Time"; break; case 6: a_sensorData->AmmunitionType = CLUSTER_HEHC_M9609; a_sensorData->IgnitionTypeG5G6 = IgnitionTypeTime; - INFO_LOG() << "Using CLUSTER_HEHC_M9609 Time"; + INFO_LOG(m_logger) << "Using CLUSTER_HEHC_M9609 Time"; break; default: a_sensorData->AmmunitionType = HE_M1A2; a_sensorData->IgnitionTypeG5G6 = IgnitionTypePercussion; isDefault = 1; - ERROR_LOG() << "Ammunition value means 'reserved' : " << l_AmmunitionField; + ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : " << l_AmmunitionField; return -1; } } @@ -277,15 +277,15 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, { case 1: a_sensorData->AmmunitionType = MK19Type_m385; - INFO_LOG() << "Using MK19 Ammunition 1 (m385)"; + INFO_LOG(m_logger) << "Using MK19 Ammunition 1 (m385)"; break; case 2: a_sensorData->AmmunitionType = MK19Type_m430; - INFO_LOG() << "Using MK19 Ammunition 2 (m430)"; + INFO_LOG(m_logger) << "Using MK19 Ammunition 2 (m430)"; break; default: a_sensorData->AmmunitionType = MK19Type_m385; - ERROR_LOG() << "Ammunition value means 'reserved' : " << l_AmmunitionField; + ERROR_LOG(m_logger) << "Ammunition value means 'reserved' : " << l_AmmunitionField; return -1; } } @@ -293,11 +293,11 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, l_Report.m_DeviceID == PAN_GP_REQUEST_IGLA) { a_sensorData->AmmunitionType = AmmunitionTypeUnknown; // irrelevant - INFO_LOG() << "Using IGLA Ammunition 1"; + INFO_LOG(m_logger) << "Using IGLA Ammunition 1"; } else { - ERROR_LOG() << "Couldn't create sensorData for DeviceID : " << l_Report.m_DeviceID; + ERROR_LOG(m_logger) << "Couldn't create sensorData for DeviceID : " << l_Report.m_DeviceID; return -1; } @@ -306,7 +306,7 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, a_sensorData->WeaponElevation = l_Elevation; a_sensorData->WeaponTemperature = l_Report.m_Temperature; - INFO_LOG() << "a_sensorData->ChargeType=" << a_sensorData->ChargeType + INFO_LOG(m_logger) << "a_sensorData->ChargeType=" << a_sensorData->ChargeType << " l_Report.m_Ammunition=" << l_Report.m_Ammunition << " l_Report.m_DeviceID=" << l_Report.m_DeviceID; @@ -329,7 +329,7 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, // a_sensorData->ChargeType = 382; // else // a_sensorData->ChargeType = 385; - INFO_LOG() << "PAN_GP_REPORT_MORTAR: l_Report.m_Ammunition" << l_Report.m_Ammunition + INFO_LOG(m_logger) << "PAN_GP_REPORT_MORTAR: l_Report.m_Ammunition" << l_Report.m_Ammunition << " a_sensorData->ChargeType=" << a_sensorData->ChargeType; } else if ((l_Report.m_DeviceID != PAN_GP_REPORT_G5_G6) && (l_Report.m_DeviceID != PAN_GP_REPORT_M109)) @@ -339,47 +339,47 @@ SInt32 GeoPairingImpl::createSensorData(GeoPairingImplSensorData *a_sensorData, a_sensorData->IgnitionType = l_Report.m_TimeToDetonate; else a_sensorData->IgnitionType = 0; - INFO_LOG() << "if a_sensorData->ChargeType=" << a_sensorData->ChargeType; + INFO_LOG(m_logger) << "if a_sensorData->ChargeType=" << a_sensorData->ChargeType; } else { - INFO_LOG() << "else a_sensorData->ChargeType=" << a_sensorData->ChargeType; + INFO_LOG(m_logger) << "else a_sensorData->ChargeType=" << a_sensorData->ChargeType; SInt32 ch = PAN_AMMU_CHARGE_G5_G6(l_Report.m_Ammunition); if (ch == 1) // M64 Base { a_sensorData->ChargeType = 0; - INFO_LOG() << "Using Charge M64 Base"; + INFO_LOG(m_logger) << "Using Charge M64 Base"; } else if (ch == 3) // 3 x M64 Incr { a_sensorData->ChargeType = 1; - INFO_LOG() << "Using Charge M64 INCR x 3"; + INFO_LOG(m_logger) << "Using Charge M64 INCR x 3"; } else if (ch == 4) // 4 x M64 Incr { a_sensorData->ChargeType = 2; - INFO_LOG() << "Using Charge M64 INCR x 4"; + INFO_LOG(m_logger) << "Using Charge M64 INCR x 4"; } else if (ch == 5) // 5 x M64 Incr { a_sensorData->ChargeType = 3; - INFO_LOG() << "Using Charge M64 INCR x 5"; + INFO_LOG(m_logger) << "Using Charge M64 INCR x 5"; } else if (ch == 6) // 5 x M64 Incr + Base Bleed { a_sensorData->ChargeType = 4; - INFO_LOG() << "Using Charge M64 INCR x 5 + Base Bleed"; + INFO_LOG(m_logger) << "Using Charge M64 INCR x 5 + Base Bleed"; } else { a_sensorData->ChargeType = 0; isDefault = 1; - WARNING_LOG() << "Unknown Charge Type. Using Charge M64 Base"; + WARNING_LOG(m_logger) << "Unknown Charge Type. Using Charge M64 Base"; } } - INFO_LOG() << "a_sensorData->ChargeType=" << a_sensorData->ChargeType; + INFO_LOG(m_logger) << "a_sensorData->ChargeType=" << a_sensorData->ChargeType; return l_Report.m_DeviceID; } @@ -391,16 +391,16 @@ void GeoPairingImpl::setMeteoData(const GeoPairingImplMeteoData &a_meteoData) { if (!m_Initialized) { - ERROR_LOG() << "Implementation not initialized"; + ERROR_LOG(m_logger) << "Implementation not initialized"; return; } m_MeteoData = a_meteoData; - INFO_LOG() << "---------- Setting Meteo Data ------------"; - INFO_LOG() << "AirPressure : " << m_MeteoData.AirPressure; - INFO_LOG() << "Temperature : " << m_MeteoData.Temperature; - INFO_LOG() << "WindDirection : " << m_MeteoData.WindDirection; - INFO_LOG() << "WindSpeed : " << m_MeteoData.WindSpeed; + INFO_LOG(m_logger) << "---------- Setting Meteo Data ------------"; + INFO_LOG(m_logger) << "AirPressure : " << m_MeteoData.AirPressure; + INFO_LOG(m_logger) << "Temperature : " << m_MeteoData.Temperature; + INFO_LOG(m_logger) << "WindDirection : " << m_MeteoData.WindDirection; + INFO_LOG(m_logger) << "WindSpeed : " << m_MeteoData.WindSpeed; } } // namespace N_GeoPairingImpl diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTarget.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTarget.cpp index d8d236ee6..92ed4ad38 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTarget.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTarget.cpp @@ -29,7 +29,7 @@ GeoPairingImplAirTarget::GeoPairingImplAirTarget(SInt32 a_playerID) : m_PlayerID(a_playerID), m_logger(CesGeoPairing::getLogger("Plugin.GeoPairing.GeoPairingImplAirTarget")) { - INFO_LOG() << "Constructor : PlayerID " << m_PlayerID; + INFO_LOG(m_logger) << "Constructor : PlayerID " << m_PlayerID; } @@ -40,13 +40,13 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po { if (a_positionTime <= m_PositionTime) { - INFO_LOG() << "No new position info for Player " << m_PlayerID + INFO_LOG(m_logger) << "No new position info for Player " << m_PlayerID << ", abandon update. PositionTime = " << a_positionTime; return false; } - INFO_LOG() << "Set new Position for Player " << m_PlayerID; + INFO_LOG(m_logger) << "Set new Position for Player " << m_PlayerID; N_Math::GeoCoord l_NewPositionUtm; l_NewPositionUtm.setLlPositionDegree(a_positionLat, a_positionLon, a_positionAlt); @@ -56,28 +56,28 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po if (m_PositionTime > 0) { UInt32 l_TimeDiff = a_positionTime - m_PositionTime; - INFO_LOG() << "l_TimeDiff [s]: " << l_TimeDiff; + INFO_LOG(m_logger) << "l_TimeDiff [s]: " << l_TimeDiff; // when new position time is more current than existing one if (l_TimeDiff > 0) { N_Types::Vec3 l_NewDirection = l_NewPosition - m_Position; Float64 l_Distance = l_NewDirection.magnitude(); - INFO_LOG() << "l_Distance [m]: " << l_Distance; + INFO_LOG(m_logger) << "l_Distance [m]: " << l_Distance; l_NewDirection /= l_Distance; m_Direction = l_NewDirection; - INFO_LOG() << "m_Direction : " << m_Direction; + INFO_LOG(m_logger) << "m_Direction : " << m_Direction; m_Speed = l_Distance / l_TimeDiff; - INFO_LOG() << "m_Speed [m/s]: " << m_Speed; + INFO_LOG(m_logger) << "m_Speed [m/s]: " << m_Speed; } } m_Position = l_NewPosition; - INFO_LOG() << "m_Position : " << m_Position; + INFO_LOG(m_logger) << "m_Position : " << m_Position; m_PositionTime = a_positionTime; - INFO_LOG() << "m_PositionTime : " << m_PositionTime; + INFO_LOG(m_logger) << "m_PositionTime : " << m_PositionTime; return true; } @@ -87,7 +87,7 @@ bool GeoPairingImplAirTarget::updatePosition(Float64 a_positionLat, Float64 a_po // --------------------------------------------------------------- void GeoPairingImplAirTarget::updateState(SInt32 a_state) { - INFO_LOG() << "Set new State for Player " + INFO_LOG(m_logger) << "Set new State for Player " << m_PlayerID << " : " << a_state; m_State = a_state; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetCache.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetCache.cpp index 15d025945..70c330a5b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetCache.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetCache.cpp @@ -66,20 +66,20 @@ GeoPairingImplAirTargetCacheData *GeoPairingImplAirTargetCache::getLatestCacheDa { if (m_CacheData == nullptr) { - ERROR_LOG() << "No global Cache pointer present!"; + ERROR_LOG(m_logger) << "No global Cache pointer present!"; return nullptr; } if (m_CacheData->empty()) { - INFO_LOG() << "Global Cache empty"; + INFO_LOG(m_logger) << "Global Cache empty"; return nullptr; } CacheType::iterator it = m_CacheData->find(m_PlayerID); if (it == m_CacheData->end()) { - INFO_LOG() << "No Cache present for Player " << m_PlayerID + INFO_LOG(m_logger) << "No Cache present for Player " << m_PlayerID << " tracking Target " << a_targetID; return nullptr; } @@ -88,14 +88,14 @@ GeoPairingImplAirTargetCacheData *GeoPairingImplAirTargetCache::getLatestCacheDa if (l_Cache->empty()) { - INFO_LOG() << "Cache for Player " << m_PlayerID << " is empty"; + INFO_LOG(m_logger) << "Cache for Player " << m_PlayerID << " is empty"; return nullptr; } CacheDataType::iterator itC = l_Cache->find(a_targetID); if (itC == l_Cache->end()) { - INFO_LOG() << "Target " << a_targetID + INFO_LOG(m_logger) << "Target " << a_targetID << " not found in Cache of Player " << m_PlayerID; return nullptr; @@ -112,7 +112,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt { if (m_CacheData == nullptr) { - ERROR_LOG() << "No global Cache pointer present!"; + ERROR_LOG(m_logger) << "No global Cache pointer present!"; return false; } @@ -120,7 +120,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt if (it == m_CacheData->end()) { (*m_CacheData)[m_PlayerID] = new CacheDataType(); - INFO_LOG() << "Create new Cache for Player " << m_PlayerID; + INFO_LOG(m_logger) << "Create new Cache for Player " << m_PlayerID; } CacheDataType *l_Cache = (*m_CacheData)[m_PlayerID]; @@ -131,7 +131,7 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt { l_CacheData = new GeoPairingImplAirTargetCacheData(); (*l_Cache)[a_targetID] = l_CacheData; - INFO_LOG() << "Create new CacheObject for Target " + INFO_LOG(m_logger) << "Create new CacheObject for Target " << a_targetID << " in Cache of Player " << m_PlayerID; } @@ -141,10 +141,10 @@ bool GeoPairingImplAirTargetCache::storeLatestTrackState(SInt32 a_targetID, UInt l_CacheData->m_TrackTime = a_trackingTime; l_CacheData->m_TrackState = a_trackingState; - INFO_LOG() << "Stored Tracking Time and State for Target " + INFO_LOG(m_logger) << "Stored Tracking Time and State for Target " << a_targetID << " in Cache of Player " << m_PlayerID; - INFO_LOG() << "-> Cached Time : " << a_trackingTime + INFO_LOG(m_logger) << "-> Cached Time : " << a_trackingTime << " State : " << a_trackingState; return true; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetTracker.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetTracker.cpp index a41adcf3d..62c8de535 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetTracker.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetTracker.cpp @@ -30,7 +30,7 @@ GeoPairingImplAirTargetTracker::GeoPairingImplAirTargetTracker(std::vectorsize() + INFO_LOG(m_logger) << "Construct Tracker for " << a_listTargets->size() << " air targets"; } @@ -45,7 +45,7 @@ void GeoPairingImplAirTargetTracker::setPosition(Float64 a_positionLat, N_Types::Coord3 l_Position(l_PositionUtm.utmEasting(), l_PositionUtm.utmNorthing(), l_PositionUtm.height()); - INFO_LOG() << "Tracker position : " << l_Position; + INFO_LOG(m_logger) << "Tracker position : " << l_Position; m_Position = l_Position; } @@ -57,7 +57,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, { if (m_List->size() == 0) { - INFO_LOG() << "No air targets to track"; + INFO_LOG(m_logger) << "No air targets to track"; return false; } @@ -77,7 +77,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, l_sensorAngle.m_H.setDegree(-a_azimuth); l_sensorAngle.m_P.setDegree(a_elevation); - INFO_LOG() << "Tracking angle : " << l_sensorAngle; + INFO_LOG(m_logger) << "Tracking angle : " << l_sensorAngle; N_Types::Radian64 l_ClosestAzimuth; N_Types::Radian64 l_ClosestElevation; @@ -85,7 +85,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, UInt64 l_ClosestPlayerImpactTime = 0; Float64 l_ClosestPlayerDistance = 0; - INFO_LOG() << "Iterating through air targets, Count : " + INFO_LOG(m_logger) << "Iterating through air targets, Count : " << m_List->size(); for (const auto l_Target : *m_List) { @@ -94,7 +94,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, // Float64 l_TargetSpeed = l_Target->m_Speed; UInt64 l_TargetPosTime = l_Target->m_PositionTime; - INFO_LOG() << "Position of air target " + INFO_LOG(m_logger) << "Position of air target " << l_Target->m_PlayerID << " @ " << l_TargetPosTime << " s : " << l_targetPos; @@ -104,7 +104,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, /* if (l_TimeDiff != 0) { N_Types::Vec3 l_PosDiff = l_TargetDir * (l_TargetSpeed * l_TimeDiff); - INFO_LOG() << "l_PosDiff = " << l_PosDiff; + INFO_LOG(m_logger) << "l_PosDiff = " << l_PosDiff; l_targetPos.m_X += l_PosDiff.m_X; l_targetPos.m_Y += l_PosDiff.m_Y; @@ -114,7 +114,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, // instead of position interpolation we checkout the time difference if (abs(l_TimeDiff) > 2) { - WARNING_LOG() << "l_TimeDiff differs by more that 2 s ! m_Time = " + WARNING_LOG(m_logger) << "l_TimeDiff differs by more that 2 s ! m_Time = " << m_Time << " l_TargetPosTime = " << l_TargetPosTime ; } @@ -123,30 +123,30 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, N_Types::Polar3 l_LinePolar = l_LineVector.getPolar3(); N_Types::Angle3 l_LineAngle(l_LinePolar.m_Azimuth, l_LinePolar.m_Elevation, 0); - INFO_LOG() << "Line of sight angle to air target : " << l_LineAngle; + INFO_LOG(m_logger) << "Line of sight angle to air target : " << l_LineAngle; N_Types::Radian64 l_AzimuthDiff = fabs(l_sensorAngle.m_H - l_LineAngle.m_H); - DEBUG_LOG() << "l_AzimuthDiff=" << l_AzimuthDiff + DEBUG_LOG(m_logger) << "l_AzimuthDiff=" << l_AzimuthDiff << " l_sensorAngle.m_H=" << l_sensorAngle.m_H << " l_LineAngle.m_H=" << l_LineAngle.m_H; N_Types::Radian64 l_ElevationDiff = fabs(l_sensorAngle.m_P - l_LineAngle.m_P); - INFO_LOG() << "l_AzimuthDiff : " + INFO_LOG(m_logger) << "l_AzimuthDiff : " << l_AzimuthDiff.getDegree() << " [Grad] " << l_AzimuthDiff << " [rad] "; - INFO_LOG() << "l_AzimuthWindow : " + INFO_LOG(m_logger) << "l_AzimuthWindow : " << l_AzimuthWindow.getDegree() << " [Grad] " << l_AzimuthWindow << " [rad] "; - INFO_LOG() << "l_ElevationDiff : " + INFO_LOG(m_logger) << "l_ElevationDiff : " << l_ElevationDiff.getDegree() << " [Grad] " << l_ElevationDiff << " [rad] "; - INFO_LOG() << "l_ElevationWindow : " + INFO_LOG(m_logger) << "l_ElevationWindow : " << l_ElevationWindow.getDegree() << " [Grad] " << l_ElevationWindow << " [rad] "; if (fabs(l_AzimuthDiff) > l_AzimuthWindow || fabs(l_ElevationDiff) > l_ElevationWindow) { - INFO_LOG() << "-> air target " << l_Target->m_PlayerID + INFO_LOG(m_logger) << "-> air target " << l_Target->m_PlayerID << " is NOT in window" << " fabs(l_AzimuthDiff)=" << fabs(l_AzimuthDiff) << " l_AzimuthWindow=" << l_AzimuthWindow @@ -160,7 +160,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, if (l_TimeOfFlight > l_TimeRange) { - INFO_LOG() << "-> Target flight time " << l_TimeOfFlight + INFO_LOG(m_logger) << "-> Target flight time " << l_TimeOfFlight << " exceeding max time of " << l_TimeRange ; continue; @@ -168,7 +168,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, if (l_ClosestPlayerId == 0) // as long as no reference { - INFO_LOG() << "=> air target " << l_Target->m_PlayerID + INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID << " is in window"; l_ClosestAzimuth = l_AzimuthDiff; l_ClosestElevation = l_ElevationDiff; @@ -182,7 +182,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, { if (l_TargetDistance < l_ClosestPlayerDistance) { - INFO_LOG() << "=> air target " << l_Target->m_PlayerID + INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID << " is in window"; l_ClosestAzimuth = l_AzimuthDiff; l_ClosestElevation = l_ElevationDiff; @@ -192,7 +192,7 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, } else { - INFO_LOG() << "=> air target " << l_Target->m_PlayerID + INFO_LOG(m_logger) << "=> air target " << l_Target->m_PlayerID << " is in window, but ID " << l_ClosestPlayerId << " is closer"; } @@ -202,16 +202,16 @@ bool GeoPairingImplAirTargetTracker::track(Float64 a_azimuth, if (l_ClosestPlayerId == 0) { - INFO_LOG() << "No air target was within window..."; + INFO_LOG(m_logger) << "No air target was within window..."; return false; } a_playerId = l_ClosestPlayerId; a_impactTime = l_ClosestPlayerImpactTime; - INFO_LOG() << "a_impactTime = " << a_impactTime; - INFO_LOG() << "l_TimeOfFlight = " << a_impactTime - m_Time; - INFO_LOG() << "Closest air target in window: " << a_playerId; + INFO_LOG(m_logger) << "a_impactTime = " << a_impactTime; + INFO_LOG(m_logger) << "l_TimeOfFlight = " << a_impactTime - m_Time; + INFO_LOG(m_logger) << "Closest air target in window: " << a_playerId; return true; } @@ -225,11 +225,11 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, { if (m_List->size() == 0) { - ERROR_LOG() << "No air targets to track, strange at this point!"; + ERROR_LOG(m_logger) << "No air targets to track, strange at this point!"; return false; } - INFO_LOG() << "Searching for air target, Count : " << m_List->size(); + INFO_LOG(m_logger) << "Searching for air target, Count : " << m_List->size(); GeoPairingImplAirTarget *l_HitTarget = nullptr; for (const auto l_Target : *m_List) @@ -243,7 +243,7 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, if (l_HitTarget == nullptr) { - ERROR_LOG() << "No air targets found with ID " << a_targetId; + ERROR_LOG(m_logger) << "No air targets found with ID " << a_targetId; return false; } @@ -252,11 +252,11 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, N_Types::Vec3 l_Line = l_targetPos - m_Position; Float64 l_OriginalDistance = l_Line.magnitude(); - INFO_LOG() << "l_OriginalDistance = " << l_OriginalDistance; + INFO_LOG(m_logger) << "l_OriginalDistance = " << l_OriginalDistance; l_Line = (l_TargetDir + l_targetPos) - m_Position; Float64 l_DirectionDistance = l_Line.magnitude(); - INFO_LOG() << "l_DirectionDistance = " << l_DirectionDistance; + INFO_LOG(m_logger) << "l_DirectionDistance = " << l_DirectionDistance; const bool l_FliesTowardsMe = l_DirectionDistance < l_OriginalDistance; @@ -273,14 +273,14 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, if (l_OriginalDistance > l_DistanceRange) { - INFO_LOG() << "--> Target " << a_targetId << " distance " + INFO_LOG(m_logger) << "--> Target " << a_targetId << " distance " << l_OriginalDistance << " beyond max distance of " << l_DistanceRange; return false; } if (l_targetPos.m_Z > l_FlightHeightMax) { - INFO_LOG() << "--> Target " << a_targetId << " flying on height = " + INFO_LOG(m_logger) << "--> Target " << a_targetId << " flying on height = " << l_targetPos.m_Z << ", max Height for IGLA is " << l_FlightHeightMax; return false; @@ -289,44 +289,44 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, Float64 l_Probability = l_ModeAutoProbability; if (!a_modeAuto) l_Probability = l_ModeManuProbability; - INFO_LOG() << "Basic Probability = " << l_Probability + INFO_LOG(m_logger) << "Basic Probability = " << l_Probability << (a_modeAuto ? " (auto)" : " (manual)"); /* if (l_FliesTowardsMe == a_changeOverPoint) { - INFO_LOG() << "Wrong COP Factor applied"; + INFO_LOG(m_logger) << "Wrong COP Factor applied"; l_Probability *= l_WrongCOPFactor; } */ if (a_changeOverPoint) - INFO_LOG() << "Depart Button pressed"; + INFO_LOG(m_logger) << "Depart Button pressed"; else - INFO_LOG() << "Depart Button released"; + INFO_LOG(m_logger) << "Depart Button released"; - INFO_LOG() << "l_FliesTowardsMe = " << l_FliesTowardsMe; + INFO_LOG(m_logger) << "l_FliesTowardsMe = " << l_FliesTowardsMe; // Wenn der Depart Button nicht gedrueckt ist, und das Ziel vom Schuetzen wegfliegt. if (!l_FliesTowardsMe && !a_changeOverPoint) { - INFO_LOG() << "Wrong COP Factor applied"; + INFO_LOG(m_logger) << "Wrong COP Factor applied"; l_Probability *= l_WrongCOPFactor; } if (l_HitTarget->m_IRJammer) { - INFO_LOG() << "IR Jammer Factor applied"; + INFO_LOG(m_logger) << "IR Jammer Factor applied"; l_Probability *= l_IRJammerFactor; } Float64 l_Random = (rand() % 100) / 100.0; if (l_Random > l_Probability) { - INFO_LOG() << "--> Target " << a_targetId << " not hit, Probability = " + INFO_LOG(m_logger) << "--> Target " << a_targetId << " not hit, Probability = " << l_Probability << ", Randomizer = " << l_Random; return false; } - INFO_LOG() << "==> Target " << a_targetId << " hit, Probability = " + INFO_LOG(m_logger) << "==> Target " << a_targetId << " hit, Probability = " << l_Probability << ", Randomizer = " << l_Random; return true; } @@ -337,7 +337,7 @@ bool GeoPairingImplAirTargetTracker::hitCheck(SInt32 a_targetId, void GeoPairingImplAirTargetTracker::setTime(UInt64 a_time) { m_Time = a_time; - INFO_LOG() << "Set new tracker reference time : " << m_Time; + INFO_LOG(m_logger) << "Set new tracker reference time : " << m_Time; } } // namespace N_GeoPairingImpl diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetUpdater.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetUpdater.cpp index 525ad2601..2cb2c3048 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetUpdater.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplAirTargetUpdater.cpp @@ -21,7 +21,7 @@ namespace N_GeoPairingImpl GeoPairingImplAirTargetUpdater::~GeoPairingImplAirTargetUpdater() { - INFO_LOG() << "Number of updated air targets : " << m_UpdateCount; + INFO_LOG(m_logger) << "Number of updated air targets : " << m_UpdateCount; } @@ -32,7 +32,7 @@ GeoPairingImplAirTargetUpdater::GeoPairingImplAirTargetUpdater(std::vectorsize() + INFO_LOG(m_logger) << "Construct Updater for " << a_listTargets->size() << " air targets"; } @@ -57,7 +57,7 @@ void GeoPairingImplAirTargetUpdater::update(SInt32 a_playerID, Float64 a_positio // create new air target if (l_PlayerAirTarget == nullptr) { - INFO_LOG() << "Creating a new air target object for Player " + INFO_LOG(m_logger) << "Creating a new air target object for Player " << a_playerID; l_PlayerAirTarget = new GeoPairingImplAirTarget(a_playerID); m_List->push_back(l_PlayerAirTarget); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplFiredBullet.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplFiredBullet.cpp index 98b507b33..aa635c627 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplFiredBullet.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/GeoPairingImpl/GeoPairingImplFiredBullet.cpp @@ -90,21 +90,21 @@ GeoPairingImplFiredBullet::GeoPairingImplFiredBullet(const GeoPairingImplSensorD : m_SensorData(a_sensorData) , m_logger(CesGeoPairing::getLogger(loggerName ? loggerName : "Plugin.GeoPairing.GeoPairingImplFiredBullet")) { - INFO_LOG() << "---------- Setting Sensor Data ------------"; - INFO_LOG() << "WeaponPositionLat : " << m_SensorData.WeaponPositionLat; - INFO_LOG() << "WeaponPositionLong : " << m_SensorData.WeaponPositionLong; - INFO_LOG() << "WeaponPositionHeight : " << m_SensorData.WeaponPositionHeight; - INFO_LOG() << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")" ; - INFO_LOG() << "WeaponAzimuthMin : " << m_SensorData.WeaponAzimuthMin << " (" << m_SensorData.WeaponAzimuthMin.getDegree() << ")" ; - INFO_LOG() << "WeaponAzimuthMax : " << m_SensorData.WeaponAzimuthMax << " (" << m_SensorData.WeaponAzimuthMax.getDegree() << ")" ; - INFO_LOG() << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ; - INFO_LOG() << "WeaponElevationMin : " << m_SensorData.WeaponElevationMin << " (" << m_SensorData.WeaponElevationMin.getDegree() << ")" ; - INFO_LOG() << "WeaponElevationMax : " << m_SensorData.WeaponElevationMax << " (" << m_SensorData.WeaponElevationMax.getDegree() << ")" ; - INFO_LOG() << "WeaponTemperature : " << m_SensorData.WeaponTemperature; - INFO_LOG() << "AmmunitionType : " << m_SensorData.AmmunitionType; - INFO_LOG() << "ChargeType : " << m_SensorData.ChargeType; - INFO_LOG() << "IgnitionType : " << m_SensorData.IgnitionType; - INFO_LOG() << "FireTime : " << m_SensorData.FireTime; + INFO_LOG(m_logger) << "---------- Setting Sensor Data ------------"; + INFO_LOG(m_logger) << "WeaponPositionLat : " << m_SensorData.WeaponPositionLat; + INFO_LOG(m_logger) << "WeaponPositionLong : " << m_SensorData.WeaponPositionLong; + INFO_LOG(m_logger) << "WeaponPositionHeight : " << m_SensorData.WeaponPositionHeight; + INFO_LOG(m_logger) << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponAzimuthMin : " << m_SensorData.WeaponAzimuthMin << " (" << m_SensorData.WeaponAzimuthMin.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponAzimuthMax : " << m_SensorData.WeaponAzimuthMax << " (" << m_SensorData.WeaponAzimuthMax.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponElevationMin : " << m_SensorData.WeaponElevationMin << " (" << m_SensorData.WeaponElevationMin.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponElevationMax : " << m_SensorData.WeaponElevationMax << " (" << m_SensorData.WeaponElevationMax.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponTemperature : " << m_SensorData.WeaponTemperature; + INFO_LOG(m_logger) << "AmmunitionType : " << m_SensorData.AmmunitionType; + INFO_LOG(m_logger) << "ChargeType : " << m_SensorData.ChargeType; + INFO_LOG(m_logger) << "IgnitionType : " << m_SensorData.IgnitionType; + INFO_LOG(m_logger) << "FireTime : " << m_SensorData.FireTime; } // --------------------------------------------------------------- @@ -115,7 +115,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con { Q_UNUSED(ballisticService) // why? - INFO_LOG() << "----------- Calculating Impact -----------"; + INFO_LOG(m_logger) << "----------- Calculating Impact -----------"; N_Math::GeoCoord o_sensorUtm; @@ -126,7 +126,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con N_Types::Coord3 o_sensorPos(o_sensorUtm.utmEasting(), o_sensorUtm.utmNorthing(), o_sensorUtm.height()); - INFO_LOG() << "o_sensorPos : " << o_sensorPos; + INFO_LOG(m_logger) << "o_sensorPos : " << o_sensorPos; GeoPairingImplTrajectoryData::TrajectoryPoint tpSensor; tpSensor.m_X = o_sensorPos.m_X; @@ -138,18 +138,18 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con N_Types::Angle3 o_sensorAngle(m_SensorData.WeaponAzimuth, m_SensorData.WeaponElevation, 0); - INFO_LOG() << "o_sensorAngle : " << o_sensorAngle; + INFO_LOG(m_logger) << "o_sensorAngle : " << o_sensorAngle; // calculate a faked shot Float64 d_shootingDistance = 500.0 + (m_SensorData.AmmunitionType * 200) ; - INFO_LOG() << "d_shootingDistance : " << d_shootingDistance; + INFO_LOG(m_logger) << "d_shootingDistance : " << d_shootingDistance; N_Types::Coord3 o_shot(0, d_shootingDistance, 0); - INFO_LOG() << "o_shot : " << o_shot; + INFO_LOG(m_logger) << "o_shot : " << o_shot; o_shot = o_shot.rotate(o_sensorAngle); o_sensorPos += o_shot; - INFO_LOG() << "o_shot : " << o_shot; - INFO_LOG() << "impact : " << o_sensorPos; + INFO_LOG(m_logger) << "o_shot : " << o_shot; + INFO_LOG(m_logger) << "impact : " << o_sensorPos; N_Math::GeoCoord o_impactUtm; o_impactUtm.setTotalUtmPosition(o_sensorPos.m_X, o_sensorPos.m_Y, o_sensorPos.m_Z, @@ -165,7 +165,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculate(con if (m_logger.isInfoEnabled()) { for (const auto &tp : m_TrajectoryData.m_Points) - INFO_LOG() << tp.m_X << " " << tp.m_Y << " " << tp.m_Z << " " << tp.m_H; + INFO_LOG(m_logger) << tp.m_X << " " << tp.m_Y << " " << tp.m_Z << " " << tp.m_H; } m_ImpactData.AmmunitionType = m_SensorData.AmmunitionType; @@ -181,7 +181,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6 double drift, double flugzeit) { - INFO_LOG() << "----------- Calculating Impact -----------"; + INFO_LOG(m_logger) << "----------- Calculating Impact -----------"; Float64 xOutMgrs = 0.0; @@ -207,7 +207,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6 xOutMgrs += xOut; yOutMgrs += yOut; LtsCoordTrans::UtmCoordinate tm2(utm.zone, xOutMgrs, yOutMgrs ); - INFO_LOG() << "NEW POS " << tm2.geographic().x() << " " << tm2.geographic().y() ; + INFO_LOG(m_logger) << "NEW POS " << tm2.geographic().x() << " " << tm2.geographic().y() ; //LtsCoordTrans::MGRS2LonLat(xOutMgrs, yOutMgrs, xOutLon, yOutLat); LtsCoordTrans::geocentric2LonLatAlt(xOutMgrs, yOutMgrs, 0.0, xOutLon, yOutLat, zOutAlt); @@ -218,7 +218,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateG5G6 m_ImpactData.ImpactPositionLong = tm2.geographic().x() * (180 / M_PI); m_ImpactData.ImpactPositionHeight = 0; - INFO_LOG() << "m_SensorData.WeaponPositionLong=" << m_SensorData.WeaponPositionLong + INFO_LOG(m_logger) << "m_SensorData.WeaponPositionLong=" << m_SensorData.WeaponPositionLong << " m_SensorData.WeaponPositionLat=" << m_SensorData.WeaponPositionLat << "\n entfernung=" << entfernung << "\n utm.x=" << utm.x @@ -245,7 +245,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv double &a_lengthField, double &a_duration, double &a_heading) { - INFO_LOG() << "----------- Calculating Salve -----------"; + INFO_LOG(m_logger) << "----------- Calculating Salve -----------"; if (a_nbrRounds < 1) return GeoPairingImplFiredBullet::e_OUTOFRANGE; @@ -259,7 +259,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv N_Types::Coord3 l_sensorPos(l_sensorUtm.utmEasting(), l_sensorUtm.utmNorthing(), l_sensorUtm.height()); - INFO_LOG() << "l_sensorPos : " << l_sensorPos; + INFO_LOG(m_logger) << "l_sensorPos : " << l_sensorPos; Float64 l_TopPos = 0, l_BottomPos = 0, l_LeftPos = 0, l_RightPos = 0, l_BelowPos = 0, l_AbovePos = 0; @@ -272,7 +272,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv for (int i = 0; i < a_nbrRounds; i++) { - INFO_LOG() << "========== Calculating Round " << i + 1 << " of " << a_nbrRounds << " ============="; + INFO_LOG(m_logger) << "========== Calculating Round " << i + 1 << " of " << a_nbrRounds << " ============="; prepareSensorData(); if (calculate( ballisticService) != e_OK) @@ -287,7 +287,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv l_impactUtm.utmNorthing(), l_impactUtm.height()); - INFO_LOG() << "l_impactPos : " << l_impactPos; + INFO_LOG(m_logger) << "l_impactPos : " << l_impactPos; l_avgImpactPos += l_impactPos; l_avgImpactCount++; @@ -314,18 +314,18 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv } } - INFO_LOG() << "========== Summarize Impact Data =========="; + INFO_LOG(m_logger) << "========== Summarize Impact Data =========="; a_widthField = l_RightPos - l_LeftPos; a_lengthField = l_TopPos - l_BottomPos; - INFO_LOG() << "a_widthField = " << a_widthField; - INFO_LOG() << "a_lengthField = " << a_lengthField; + INFO_LOG(m_logger) << "a_widthField = " << a_widthField; + INFO_LOG(m_logger) << "a_lengthField = " << a_lengthField; // calculate average impact pos for this salve N_Types::Coord3 l_ImpactPos = l_avgImpactPos / std::max(1, l_avgImpactCount); - INFO_LOG() << "l_ImpactPos (Avg) : " << l_ImpactPos; + INFO_LOG(m_logger) << "l_ImpactPos (Avg) : " << l_ImpactPos; N_Math::GeoCoord l_impactUtm; l_impactUtm.setTotalUtmPosition(l_ImpactPos.m_X, l_ImpactPos.m_Y, l_ImpactPos.m_Z, @@ -344,10 +344,10 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv Float64 l_RoundsPerMinute = l_config->getFloat(s_MK19, s_RoundsPerMinute, 350); a_duration = 60 * a_nbrRounds / l_RoundsPerMinute; - INFO_LOG() << "a_duration = " << a_duration; + INFO_LOG(m_logger) << "a_duration = " << a_duration; Float64 l_Distance = l_ImpactPos.length(l_sensorPos); - INFO_LOG() << "l_Distance = " << l_Distance; + INFO_LOG(m_logger) << "l_Distance = " << l_Distance; N_Types::Radian64 l_AvgHeading = m_SensorData.WeaponAzimuthMax - m_SensorData.WeaponAzimuthMin; l_AvgHeading /= 2.0; @@ -355,7 +355,7 @@ GeoPairingImplFiredBullet::E_CalcResult GeoPairingImplFiredBullet::calculateSalv l_AvgHeading += M_PI_2; // rotate 90deg from east a_heading = l_AvgHeading.getZeroTo360(); - INFO_LOG() << "a_heading [deg ] = " << a_heading; + INFO_LOG(m_logger) << "a_heading [deg ] = " << a_heading; return e_OK; @@ -369,16 +369,16 @@ GeoPairingImplImpactData *GeoPairingImplFiredBullet::getImpactData() { if (m_ImpactData.ImpactTime == 0) { - ERROR_LOG() << "Impact Data not yet calculated"; + ERROR_LOG(m_logger) << "Impact Data not yet calculated"; return nullptr; } - INFO_LOG() << "---------- Getting Impact Data ------------"; - INFO_LOG() << "ImpactPositionLat : " << m_ImpactData.ImpactPositionLat; - INFO_LOG() << "ImpactPositionLong : " << m_ImpactData.ImpactPositionLong; - INFO_LOG() << "ImpactPositionHeight : " << m_ImpactData.ImpactPositionHeight; - INFO_LOG() << "ImpactTime : " << m_ImpactData.ImpactTime; - INFO_LOG() << "AmmunitionType : " << m_ImpactData.AmmunitionType; + INFO_LOG(m_logger) << "---------- Getting Impact Data ------------"; + INFO_LOG(m_logger) << "ImpactPositionLat : " << m_ImpactData.ImpactPositionLat; + INFO_LOG(m_logger) << "ImpactPositionLong : " << m_ImpactData.ImpactPositionLong; + INFO_LOG(m_logger) << "ImpactPositionHeight : " << m_ImpactData.ImpactPositionHeight; + INFO_LOG(m_logger) << "ImpactTime : " << m_ImpactData.ImpactTime; + INFO_LOG(m_logger) << "AmmunitionType : " << m_ImpactData.AmmunitionType; return &m_ImpactData; } @@ -391,7 +391,7 @@ GeoPairingImplTrajectoryData *GeoPairingImplFiredBullet::getTrajectoryData() { if (m_ImpactData.ImpactTime == 0) { - ERROR_LOG() << "Impact Data not yet calculated"; + ERROR_LOG(m_logger) << "Impact Data not yet calculated"; return nullptr; } @@ -406,11 +406,11 @@ void GeoPairingImplFiredBullet::setMeteoData(const GeoPairingImplMeteoData &a_me { m_MeteoData = a_meteoData; - INFO_LOG() << "---------- Setting Meteo Data ------------"; - INFO_LOG() << "AirPressure : " << m_MeteoData.AirPressure; - INFO_LOG() << "Temperature : " << m_MeteoData.Temperature; - INFO_LOG() << "WindDirection : " << m_MeteoData.WindDirection; - INFO_LOG() << "WindSpeed : " << m_MeteoData.WindSpeed; + INFO_LOG(m_logger) << "---------- Setting Meteo Data ------------"; + INFO_LOG(m_logger) << "AirPressure : " << m_MeteoData.AirPressure; + INFO_LOG(m_logger) << "Temperature : " << m_MeteoData.Temperature; + INFO_LOG(m_logger) << "WindDirection : " << m_MeteoData.WindDirection; + INFO_LOG(m_logger) << "WindSpeed : " << m_MeteoData.WindSpeed; } // --------------------------------------------------------------- @@ -422,22 +422,22 @@ void GeoPairingImplFiredBullet::prepareSensorData() if (!m_SensorData.UseMinMax) return; - INFO_LOG() << "----------- Prepare Sensor Angles -----------"; + INFO_LOG(m_logger) << "----------- Prepare Sensor Angles -----------"; N_Types::Radian64 l_AzimuthMin = m_SensorData.WeaponAzimuthMin; N_Types::Radian64 l_AzimuthMax = m_SensorData.WeaponAzimuthMax; - INFO_LOG() << "WeaponAzimuthMin [deg] = " << m_SensorData.WeaponAzimuthMin.getDegree(); - INFO_LOG() << "WeaponAzimuthMax [deg] = " << m_SensorData.WeaponAzimuthMax.getDegree(); - INFO_LOG() << "WeaponElevationMin [deg] = " << m_SensorData.WeaponElevationMin.getDegree(); - INFO_LOG() << "WeaponElevationMax [deg] = " << m_SensorData.WeaponElevationMax.getDegree(); + INFO_LOG(m_logger) << "WeaponAzimuthMin [deg] = " << m_SensorData.WeaponAzimuthMin.getDegree(); + INFO_LOG(m_logger) << "WeaponAzimuthMax [deg] = " << m_SensorData.WeaponAzimuthMax.getDegree(); + INFO_LOG(m_logger) << "WeaponElevationMin [deg] = " << m_SensorData.WeaponElevationMin.getDegree(); + INFO_LOG(m_logger) << "WeaponElevationMax [deg] = " << m_SensorData.WeaponElevationMax.getDegree(); N_Types::Radian64 l_AzimuthDelta = fabs(l_AzimuthMax - l_AzimuthMin); // test the +/- 180 deg limit case if (l_AzimuthDelta > M_PI) { - INFO_LOG() << "Take short circle path"; + INFO_LOG(m_logger) << "Take short circle path"; l_AzimuthDelta -= M_PI; } @@ -447,10 +447,10 @@ void GeoPairingImplFiredBullet::prepareSensorData() m_SensorData.WeaponElevation = m_SensorData.WeaponElevationMin + (drand48() * l_DeltaElevation); m_SensorData.WeaponAzimuth = m_SensorData.WeaponAzimuthMin + (drand48() * l_DeltaAzimuth); - INFO_LOG() << "l_DeltaElevation : " << l_DeltaElevation << " (" << l_DeltaElevation.getDegree() << ")"; - INFO_LOG() << "l_DeltaAzimuth : " << l_DeltaAzimuth << " (" << l_DeltaAzimuth.getDegree() << ")"; - INFO_LOG() << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ; - INFO_LOG() << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")"; + INFO_LOG(m_logger) << "l_DeltaElevation : " << l_DeltaElevation << " (" << l_DeltaElevation.getDegree() << ")"; + INFO_LOG(m_logger) << "l_DeltaAzimuth : " << l_DeltaAzimuth << " (" << l_DeltaAzimuth.getDegree() << ")"; + INFO_LOG(m_logger) << "WeaponElevation : " << m_SensorData.WeaponElevation << " (" << m_SensorData.WeaponElevation.getDegree() << ")" ; + INFO_LOG(m_logger) << "WeaponAzimuth : " << m_SensorData.WeaponAzimuth << " (" << m_SensorData.WeaponAzimuth.getDegree() << ")"; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.cpp index 8a6ebe106..49fce096b 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.cpp @@ -53,38 +53,38 @@ HandlerGeoPairing::HandlerGeoPairing(const std::shared_ptrenableSendCesHit(); connect(m_timer, &QTimer::timeout, this, &HandlerGeoPairing::sendFtcCesHitRequestTimeout); - INFO_LOG() << "configPath = " << m_ballisticService->getConfigPath(); - INFO_LOG() << "configFile = " << m_ballisticService->getConfigFile(); - INFO_LOG() << "ammunitionFile = " << m_ballisticService->getAmmunitionFile(); + INFO_LOG(m_logger) << "configPath = " << m_ballisticService->getConfigPath(); + INFO_LOG(m_logger) << "configFile = " << m_ballisticService->getConfigFile(); + INFO_LOG(m_logger) << "ammunitionFile = " << m_ballisticService->getAmmunitionFile(); const QString s_configFile = Settings::cesGeopairingIniPath() + QStringLiteral("/") + Settings::cesGeopairingIniFile(); - INFO_LOG() << "GeoPairing Config location : " << s_configFile; + INFO_LOG(m_logger) << "GeoPairing Config location : " << s_configFile; N_GeoPairingImpl::GeoPairingImpl *l_impl = new N_GeoPairingImpl::GeoPairingImplDted; - INFO_LOG() << "--> Installing GeoPairingImplDted..."; + INFO_LOG(m_logger) << "--> Installing GeoPairingImplDted..."; N_GeoPairingImpl::GeoPairingImplFactory::setImpl(l_impl); // initialize the GeoPairing implementation if (!N_GeoPairingImpl::GeoPairingImplFactory::initialize(Settings::cesGeopairingIniPath())) { - ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!"; + ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplDted!"; l_impl = new N_GeoPairingImpl::GeoPairingImplBalistic(); - INFO_LOG() << "--> Installing GeoPairingImplBalistic..."; + INFO_LOG(m_logger) << "--> Installing GeoPairingImplBalistic..."; N_GeoPairingImpl::GeoPairingImplFactory::setImpl(l_impl); if (!N_GeoPairingImpl::GeoPairingImplFactory::initialize(s_configFile)) { - ERROR_LOG() << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!"; + ERROR_LOG(m_logger) << "Couldn't initialize GeoPairingImplFactory with GeoPairingImplBalistic!"; abort(); } else - INFO_LOG() << "GeoPairingImplBalistic correctly initialized"; + INFO_LOG(m_logger) << "GeoPairingImplBalistic correctly initialized"; } else - INFO_LOG() << "GeoPairingImplDted correctly initialized"; + INFO_LOG(m_logger) << "GeoPairingImplDted correctly initialized"; - INFO_LOG() << "Initialization finished"; + INFO_LOG(m_logger) << "Initialization finished"; } // end of ctor() //----------------------------------------------------------------------------- @@ -96,7 +96,7 @@ HandlerGeoPairing::~HandlerGeoPairing() bool HandlerGeoPairing::init() { - DEBUG_LOG() << "init"; + DEBUG_LOG(m_logger) << "init"; auto dtcTab = m_ddsHandlerAes->dtcTab(); auto dtcMdm = m_ddsHandlerAes->dtcMdm(); @@ -111,12 +111,12 @@ bool HandlerGeoPairing::init() // create GeoConfig for this process && initFilename, just one time, just here GeoConfig *o_config = GeoConfig::getInstance(); const QString &fileName = Settings::cesGeopairingIniPath() + QStringLiteral("/") + Settings::cesGeopairingIniFile(); - DEBUG_LOG() << "fileName= " << fileName; + DEBUG_LOG(m_logger) << "fileName= " << fileName; if (!o_config || !o_config->initFilename(fileName)) { // Fehlerfall: const QFileInfo qFileInfo(fileName); - ERROR_LOG() << Q_FUNC_INFO << " initFilename failed: '" << qFileInfo.absoluteFilePath() << "'"; + ERROR_LOG(m_logger) << Q_FUNC_INFO << " initFilename failed: '" << qFileInfo.absoluteFilePath() << "'"; return false; } @@ -127,7 +127,7 @@ bool HandlerGeoPairing::init() QString s_filter = o_config->getString(s_group, s_keyOfEntries, s_ammunition); - DEBUG_LOG() << "s_group=" << s_group + DEBUG_LOG(m_logger) << "s_group=" << s_group << " n_numberOfAmmunitions=" << n_numberOfAmmunitions << " s_keyOfEntries=" << s_keyOfEntries << " s_ammunition=" << s_ammunition @@ -139,7 +139,7 @@ bool HandlerGeoPairing::init() QString s_ammu_group = s_filter + QString::number(i + 1); QString s_unknown = QStringLiteral(""); QString s_ammu_value = o_config->getString(s_group, s_ammu_group, s_unknown); - DEBUG_LOG() << "s_ammu_value=" << s_ammu_value + DEBUG_LOG(m_logger) << "s_ammu_value=" << s_ammu_value << " s_group=" << s_group << " s_ammu_group=" << s_ammu_group; } @@ -151,33 +151,33 @@ bool HandlerGeoPairing::init() void HandlerGeoPairing::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send hit on participant to training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send hit on participant to training area: " << replyObject(); else - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success"; } void HandlerGeoPairing::onSendCesHitInformationReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send hit information on participant to training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send hit information on participant to training area: " << replyObject(); else - DEBUG_LOG() << "onSendCesHitInformationReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onSendCesHitInformationReply for id " << replyObject.id() << " success"; } void HandlerGeoPairing::onExplosionSingleModifyReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send ExplosionSingleModify: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send ExplosionSingleModify: " << replyObject(); else - DEBUG_LOG() << "onExplosionSingleModifyReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onExplosionSingleModifyReply for id " << replyObject.id() << " success"; } void HandlerGeoPairing::onExplosionAreaModifyReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send ExplosionAreaModify: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send ExplosionAreaModify: " << replyObject(); else - DEBUG_LOG() << "onExplosionAreaModifyReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onExplosionAreaModifyReply for id " << replyObject.id() << " success"; } // /////////////////////////////////// @@ -187,13 +187,13 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData { if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "onMeteoDataChanged eRemoved"; + DEBUG_LOG(m_logger) << "onMeteoDataChanged eRemoved"; return; } m_meteoData = data; - DEBUG_LOG() << "Got onMeteoDataChanged " + DEBUG_LOG(m_logger) << "Got onMeteoDataChanged " << " id=" << m_meteoData.id() << " windSpeed=" << m_meteoData.windSpeed() << " windDirection=" << m_meteoData.windDirection() @@ -208,11 +208,11 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData //{ // if (modType == DataModification::eRemoved) // { -// DEBUG_LOG() << "onGeoPairingDataChanged eRemoved"; +// DEBUG_LOG(m_logger) << "onGeoPairingDataChanged eRemoved"; // return; // } // m_geoPairingPtr = new GeoPairing(m_ballisticService); -// DEBUG_LOG() << "Got onGeoPairingDataChanged " +// DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged " // << " equipmentNumber=" << data.equipmentNumber() // << " position lat=" << data.position().lat() // << " lon=" << data.position().lon() @@ -236,7 +236,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData // while (i.hasNext()) // { // i.next(); -// DEBUG_LOG() << i.key() << ": participantId=" << i.value().participantId() +// DEBUG_LOG(m_logger) << i.key() << ": participantId=" << i.value().participantId() // << " participantTypeId= " << i.value().participantTypeId(); // } @@ -276,7 +276,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData // if (areaFireToCtas.hit) // { -// INFO_LOG() << "AreaFireToCtas" +// INFO_LOG(m_logger) << "AreaFireToCtas" // << " playerId=" << areaFireToCtas.playerId // << " impactTime=" << areaFireToCtas.impactTime // << " duration=" << areaFireToCtas.duration @@ -319,7 +319,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData // if (fireToAircaft.hit) // { // TrainingAreaBase::SendCesHitInformation chi; -// INFO_LOG() << "send CesHitInformation to Ctas " +// INFO_LOG(m_logger) << "send CesHitInformation to Ctas " // << " equipmentNumberGunner: " << fireToAircaft.equipmentNumberGunner // << " participantIdTarget: " << fireToAircaft.participantIdTarget // << " impactTime: " << fireToAircaft.impactTime @@ -348,7 +348,7 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData // gpd.equipmentNumber(data.equipmentNumber()); // gpd.participantId(participantId); // gpd.payload(LtsUtils::convert>(reportTarget.sendData)); -// INFO_LOG() << " send Geopairing-Data to Ctas" +// INFO_LOG(m_logger) << " send Geopairing-Data to Ctas" // << " equipmentNumber: " << data.equipmentNumber() // << " playerId: " << reportTarget.playerId // << " participantId: " << participantId @@ -361,17 +361,17 @@ void HandlerGeoPairing::onMeteoDataChanged(const MeteoDataManagement::MeteoData void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::GeopairingData &data, DataModification modType) { - DEBUG_LOG() << "Got onGeoPairingDataChanged "; + DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged "; if (modType == DataModification::eRemoved) { - DEBUG_LOG() << "onGeoPairingDataChanged eRemoved"; + DEBUG_LOG(m_logger) << "onGeoPairingDataChanged eRemoved"; return; } unsigned char msgType = 0xE3; if (static_cast(data.payload().at(0)) != msgType) { - DEBUG_LOG() << "data.payload().at(0) != msgType"; + DEBUG_LOG(m_logger) << "data.payload().at(0) != msgType"; return; } @@ -464,7 +464,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi v0 = Settings::moerserLoad_6(); - DEBUG_LOG() << "Got onGeoPairingDataChanged " + DEBUG_LOG(m_logger) << "Got onGeoPairingDataChanged " << "\nequipmentNumber=" << data.equipmentNumber() << "\nposition lat=" << data.position().lat() << "/" << data.position().lon() @@ -487,7 +487,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi //QPointF distVector = calculateDistVector ( rw, azimut/10.0); QPointF explosionPosUtm = calculateExplosionPosUtm(rw, azimut / 10.0, posUtm); - DEBUG_LOG() << "Result: rw=" << rw + DEBUG_LOG(m_logger) << "Result: rw=" << rw << " v0=" << v0 << "\n t1=" << t1 << "\n explosionPosUtm=" << explosionPosUtm.x() << "/" << explosionPosUtm.y(); @@ -511,7 +511,7 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi explosionSingleModifyRequest.partyId(partyId); - DEBUG_LOG() << "impactTime=" << data.sampleTime() + DEBUG_LOG(m_logger) << "impactTime=" << data.sampleTime() << " name=" << name << " m_ddsHandler->currentPartitionTime=" << m_ddsHandlerAes->currentPartitionTime() << " participantId=" << participantId << " " << participantId @@ -519,21 +519,21 @@ void HandlerGeoPairing::onGeoPairingDataChanged(const TrainingAreaBase::Geopairi if (impactTime > m_ddsHandlerAes->currentPartitionTime()) { - DEBUG_LOG() << "Send explosionSingleModifyRequest"; + DEBUG_LOG(m_logger) << "Send explosionSingleModifyRequest"; auto ftcAes = m_ddsHandlerAes->ftcAes(); ftcAes->explosionSingleModifyRequest(explosionSingleModifyRequest, this); } else - DEBUG_LOG() << "NOT Send explosionSingleModifyRequest impactTime is in the past"; + DEBUG_LOG(m_logger) << "NOT Send explosionSingleModifyRequest impactTime is in the past"; } void HandlerGeoPairing::onSendGeopairingDataReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - WARNING_LOG() << "Can not send GeopPairing Data participant : " << replyObject(); + WARNING_LOG(m_logger) << "Can not send GeopPairing Data participant : " << replyObject(); else - DEBUG_LOG() << "onSendGeopairingDataReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "onSendGeopairingDataReply for id " << replyObject.id() << " success"; } void HandlerGeoPairing::sendFtcCesHitRequestTimeout() @@ -541,7 +541,7 @@ void HandlerGeoPairing::sendFtcCesHitRequestTimeout() auto ftcTab = m_ddsHandlerAes->ftcTab(); for (const TrainingAreaBase::SendCesHitRequest &hr : std::as_const(m_requestMap)) { - DEBUG_LOG() << "sendFtcCesHitRequest: " << hr; + DEBUG_LOG(m_logger) << "sendFtcCesHitRequest: " << hr; ftcTab->sendCesHitRequest(hr, this); } m_requestMap.clear(); diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.h index 314b9e1f6..1e695a6fe 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/handler_geopairing.h @@ -42,6 +42,7 @@ public: eElevationBelowZero = 3 }; private: +NGL::INGLLogger &m_logger; struct GeoPCharge { diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.cpp index cb0c4e72e..10fe12150 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.cpp @@ -47,7 +47,7 @@ bool CesGeoPairingInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesGeoPairingInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -66,11 +66,11 @@ bool CesGeoPairingInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerGeoPairing->init()) { - ERROR_LOG() << "Initialisation m_handlerGeoPairing failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerGeoPairing failed."; return false; } - INFO_LOG() << "CesGeoPairingInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::init() return true"; return true; } @@ -78,8 +78,8 @@ QString CesGeoPairingInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesGeoPairingInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CesGeoPairingInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CesGeoPairingInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CesGeoPairingInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CesGeoPairingInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.h index 91ea98a3f..0963025f7 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/GeoPairing/plugin.h @@ -63,6 +63,7 @@ private Q_SLOTS: bool init(int domainId, int exerciseId) override; private: +NGL::INGLLogger &m_logger; private: CentralEffectSimulation::Plugin::DataProvider *m_pdp{nullptr}; std::shared_ptr m_ddsConnector; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.cpp index f62cdacc2..a49f101ce 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.cpp @@ -71,14 +71,14 @@ bool HandlerJamming::init() this, &HandlerJamming::onParticipantGearEventChanged); - DEBUG_LOG() << "HandlerJamming::init() finished."; + DEBUG_LOG(m_logger) << "HandlerJamming::init() finished."; return true; } // end of init() //----------------------------------------------------------------------------- void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement::ParticipantGearEvent &data, DataModification modType) { - ERROR_LOG() << "onParticipantGearEventChanged << modType=" << modType + ERROR_LOG(m_logger) << "onParticipantGearEventChanged << modType=" << modType << " originatorId=" << data.participantId() << " chargeTypeId=" << data.charge().chargeTypeId() << " gearTypeId=" << data.charge().gearTypeId() @@ -94,34 +94,34 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement:: double radius = m_ddsHandler->dtcPdm()->getMaxRange(data.charge().chargeTypeId(), data.charge().gearTypeId()); // int radius = 15; - DEBUG_LOG() << "Radius=" << radius; + DEBUG_LOG(m_logger) << "Radius=" << radius; for ( int uasId : uasIds) { - DEBUG_LOG() << "uasId=" << uasId; + DEBUG_LOG(m_logger) << "uasId=" << uasId; CentralEffectSimulation::HandlerParticipant::CesParticipantData cesParticipantData = m_handlerParticipant->position(uasId); if (!cesParticipantData.positionValid) { - DEBUG_LOG() << "continue !positionValid participantId=" << uasId; + DEBUG_LOG(m_logger) << "continue !positionValid participantId=" << uasId; continue; } if (LtsUtils::isPositionTimeOutdated(QDateTime::currentMSecsSinceEpoch(), cesParticipantData.sampleTime())) { - DEBUG_LOG() << "continue positionTime outdated participantId=" << uasId; + DEBUG_LOG(m_logger) << "continue positionTime outdated participantId=" << uasId; continue; } long distance = m_handlerParticipant->getDistance(data.participantId(), uasId); - DEBUG_LOG() << "distance = " << distance; + DEBUG_LOG(m_logger) << "distance = " << distance; if ( distance < radius) { - DEBUG_LOG() << " Send Jamming to TAB and destroy uasId"; + DEBUG_LOG(m_logger) << " Send Jamming to TAB and destroy uasId"; //sendCesHitRequest(data.charge().chargeTypeId(), data.participantId(),cesParticipantData); if (cesParticipantData.vulnerabilityState != ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) jammedUasIds.append(uasId); } else - DEBUG_LOG() << "Not in Radius distance=" << distance + DEBUG_LOG(m_logger) << "Not in Radius distance=" << distance << " radius=" << radius; } // [ETB UASETBUAS-33] Equal distribution of jamming failures @@ -133,7 +133,7 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement:: { // search for an id from the list with an algorithm that contains an equal distribution jammedUasId = jammedUasIds.at(QRandomGenerator::global()->bounded(jammedUasIds.size() - 1)); - DEBUG_LOG() << "jammedUasId=" << jammedUasId + DEBUG_LOG(m_logger) << "jammedUasId=" << jammedUasId << " jammedUasIds.size()=" << jammedUasIds.size(); } @@ -145,21 +145,21 @@ void HandlerJamming::onParticipantGearEventChanged(const ParticipantManagement:: void HandlerJamming::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); if (replyObject.error()) - WARNING_LOG() << "Can not send enter/leave Area to participant in training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send enter/leave Area to participant in training area: " << replyObject(); // Send next Request, if available if (!m_sendCesHitRequestQueue.isEmpty()) { - DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); + DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); m_sendCesHitRequestQueue.dequeue(); // Send next Message if (!m_sendCesHitRequestQueue.isEmpty()) { const auto &hr = m_sendCesHitRequestQueue.head(); - DEBUG_LOG() << "sendCesHitRequest: " << hr; + DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr; m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this); } } @@ -182,20 +182,20 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId, if (remaining < 0) return; - DEBUG_LOG() << "sendCesHitRequest Settings::calculateCentralAes=" + DEBUG_LOG(m_logger) << "sendCesHitRequest Settings::calculateCentralAes=" << " insideWlsArea=" << std::boolalpha << participantData.insideWlsArea() << " participantId=" << participantData.participantId(); const int equipNo = m_ddsHandler->participantId2EquipNo(participantData.participantId()); const int originatorEquimentNumber = m_ddsHandler->participantId2EquipNo(originatorId); const int originatorPartyId = m_handlerParticipant->getParticipantPosition(originatorId).partyId(); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantData.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantData.participantId() << " equipNo = " << equipNo << " chargeTypeId =" << chargeTypeId; if (participantData.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId == 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId == 0 CatastrophicKill)"; return; } @@ -220,13 +220,13 @@ void HandlerJamming::sendCesHitRequest(const int chargeTypeId, originatorPartyId, // originPartyId mineId ); - DEBUG_LOG() << " participantId=" << participantData.participantId() + DEBUG_LOG(m_logger) << " participantId=" << participantData.participantId() << " chargeTypeId=" << chargeTypeId; m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } } // sendCesHitRequest diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.h b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.h index 1ec78b94f..c13b68038 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.h +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/handler_jamming.h @@ -57,6 +57,7 @@ public: bool init(); protected: + NGL::INGLLogger &m_logger; void onSendCesHitReply(const Core::FunctionReplyObject &replyObject) override final; private Q_SLOTS: diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/plugin.cpp index 58d74a6f7..b6be3987c 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/Jamming/plugin.cpp @@ -48,7 +48,7 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CES_JammingInterfaceImpl::init()" + INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -62,11 +62,11 @@ bool CES_JammingInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerJamming->init()) { - ERROR_LOG() << "Initialisation m_handlerFunctionalArea failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerFunctionalArea failed."; return false; } - INFO_LOG() << "CES_JammingInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::init() return true"; return true; } @@ -74,8 +74,8 @@ QString CES_JammingInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CES_JammingInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CES_JammingInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CES_JammingInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CES_JammingInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/handler_mine_areas.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/handler_mine_areas.cpp index 36009b5f9..6857ae483 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/handler_mine_areas.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/handler_mine_areas.cpp @@ -70,7 +70,7 @@ HandlerMineAreas::HandlerMineAreas(const std::shared_ptrwaitForHistoricalDataMineArea(2000); dtcAes->waitForHistoricalDataMineCorridor(2000); - DEBUG_LOG() << "HandlerMineAreas::init"; + DEBUG_LOG(m_logger) << "HandlerMineAreas::init"; dtcAes->enableTriggeredImpacts(); connect(dtcAes.get(), &AreaEffectSimulation::Interface::Dtc::triggeredImpactsChanged, @@ -109,7 +109,7 @@ bool HandlerMineAreas::init() this, &HandlerMineAreas::onAesItemViewChanged); - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); // Get 'static' data for all onAesItemView { auto cb = [this](const AreaEffectSimulation::AesItemView & aiv) @@ -119,7 +119,7 @@ bool HandlerMineAreas::init() if (!dtcAes->aesItemViews(cb)) return false; } - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newOutdoorPosition, this, &HandlerMineAreas::onNewOutdoorPosition); @@ -127,28 +127,28 @@ bool HandlerMineAreas::init() connect(m_handlerParticipant.get(), &CentralEffectSimulation::HandlerParticipant::newParticipantState, this, &HandlerMineAreas::onNewParticipantState); - INFO_LOG() << "HandlerParticipantArea::init() finished."; + INFO_LOG(m_logger) << "HandlerParticipantArea::init() finished."; return true; } // end of init() //----------------------------------------------------------------------------- void HandlerMineAreas::onSendCesHitReply(const Core::FunctionReplyObject &replyObject) { - DEBUG_LOG() << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); + DEBUG_LOG(m_logger) << "onSendCesHitReply for id " << replyObject.id() << " success= " << replyObject.error(); if (replyObject.error()) - WARNING_LOG() << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject(); + WARNING_LOG(m_logger) << "Can not send enter/leave FunctionsArea to participant in training area: " << replyObject(); // Send next Request, if available if (!m_sendCesHitRequestQueue.isEmpty()) { - DEBUG_LOG() << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); + DEBUG_LOG(m_logger) << "m_sendCesAreaActionRequestQueue.size()=" << m_sendCesHitRequestQueue.size(); m_sendCesHitRequestQueue.dequeue(); // Send next Message if (!m_sendCesHitRequestQueue.isEmpty()) { const auto &hr = m_sendCesHitRequestQueue.head(); - DEBUG_LOG() << "sendCesHitRequest: " << hr; + DEBUG_LOG(m_logger) << "sendCesHitRequest: " << hr; m_ddsHandler->ftcTab()->sendCesHitRequest(hr, this); } } @@ -157,9 +157,9 @@ void HandlerMineAreas::onSendCesHitReply(const Core::FunctionReplyObject &replyO void HandlerMineAreas::onMineTriggeredReply(const Core::FunctionReplyObject &replyObject) { if (replyObject.error()) - ERROR_LOG() << "Can not send MineTriggerReply: " << replyObject(); + ERROR_LOG(m_logger) << "Can not send MineTriggerReply: " << replyObject(); else - DEBUG_LOG() << "MineTriggerReply for id " << replyObject.id() << " success"; + DEBUG_LOG(m_logger) << "MineTriggerReply for id " << replyObject.id() << " success"; } // /////////////////////////////////// // A E S (AreaEffectSimulation) @@ -170,12 +170,12 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineArea && data.aesTypeId() != AreaEffectSimulation::AesType_def::AtMineCorridor) { - DEBUG_LOG() << "AesItemView return"; + DEBUG_LOG(m_logger) << "AesItemView return"; return; } const AreaEffectSimulation::MineArea &ma = m_ddsHandler->dtcAes()->mineArea(data.aesItemId()); - DEBUG_LOG() << "aesItemId=" << data.aesItemId() + DEBUG_LOG(m_logger) << "aesItemId=" << data.aesItemId() << " chargeTypeId=" << data.chargeStruct().chargeTypeId() << " isCentral=" << ma.isCentral(); @@ -186,29 +186,29 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV if (data.effectStateId() == AreaEffectSimulation::AesEffectState_def::EsExpired) { - DEBUG_LOG() << "AesItemView expired return id=" << data.aesItemId(); + DEBUG_LOG(m_logger) << "AesItemView expired return id=" << data.aesItemId(); aesItemViewRemoved(data.aesItemId()); return; } if (m_ddsHandler->isDus(data.chargeStruct())) { - DEBUG_LOG() << "isDus aesItemId=" << data.aesItemId() + DEBUG_LOG(m_logger) << "isDus aesItemId=" << data.aesItemId() << " chargeTypeId=" << data.chargeStruct().chargeTypeId() << " do not consider"; return; } const int aesItemId = data.aesItemId(); - DEBUG_LOG() << "Got AesItemView id: " << aesItemId + DEBUG_LOG(m_logger) << "Got AesItemView id: " << aesItemId << ", type: " << data.aesTypeId() << ", effectState: " << data.effectStateId() << ", modType: " << modType; - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); if (modType == DataModification::eRemoved) { - DEBUG_LOG() << " aesItemViewRemoved aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << " aesItemViewRemoved aesItemId=" << aesItemId; aesItemViewRemoved(aesItemId); return; } @@ -217,15 +217,15 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV { if (!m_aesItemViews.contains(aesItemId)) { - DEBUG_LOG() << " !m_aesItemViews.contains aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << " !m_aesItemViews.contains aesItemId=" << aesItemId; return; } // build Polygon Mines: - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); auto &formMines = m_aesItemViews[data.aesItemId()].formMines; - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); int &zone = m_aesItemViews[data.aesItemId()].zone; - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); formMines.clear(); formMines.reserve(data.form().size()); for (const Core::GeoPosition2D &pointGeo : data.form()) @@ -235,7 +235,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV const AreaEffectSimulation::AesEffectState &effectState = data.effectStateId(); const double impactRadius = m_ddsHandler->chargeTypeRadius(data.chargeStruct()); - DEBUG_LOG() << "impactRadius=" << impactRadius; + DEBUG_LOG(m_logger) << "impactRadius=" << impactRadius; switch (effectState.underlying()) { case AreaEffectSimulation::AesEffectState_def::EsPrepared: @@ -246,10 +246,10 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV { const auto aesItemViewUtm(CentralEffectSimulation::AesItemViewUtm::create(data, m_aesItemViews[data.aesItemId()], impactRadius)); - DEBUG_LOG() << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId() + DEBUG_LOG(m_logger) << "EsActivated m_aesItemViews.insert data.aesItemId()= " << data.aesItemId() << " m_aesItemViews.size=" << m_aesItemViews.size(); m_aesItemViews.insert(data.aesItemId(), aesItemViewUtm); - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); printAesItemViews(); break; @@ -266,7 +266,7 @@ void HandlerMineAreas::onAesItemViewChanged(const AreaEffectSimulation::AesItemV // do nothing break; } // switch effectStateId - DEBUG_LOG() << " m_aesItemViews.size=" << m_aesItemViews.size(); + DEBUG_LOG(m_logger) << " m_aesItemViews.size=" << m_aesItemViews.size(); printAesItemViews(); } // onAesItemViewChanged @@ -279,7 +279,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl if (m_handlerParticipant->getEquipmentNumber(participantPosition.participantId()) == 0) { - DEBUG_LOG() << "Not handle position: participant has no equipment number"; + DEBUG_LOG(m_logger) << "Not handle position: participant has no equipment number"; return; } @@ -292,7 +292,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl typeClass == ParticipantManagement::TypeClass_def::Vessel || typeClass == ParticipantManagement::TypeClass_def::Unknown) { - DEBUG_LOG() << "return New Position Participant with id " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "return New Position Participant with id " << participantPosition.participantId() << " has invalid typeClass: " << typeClass; return; } @@ -300,7 +300,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); if (equipmentNumber <= 0) { - TRACE_LOG() << "return New Position - participant has no equipment number" + TRACE_LOG(m_logger) << "return New Position - participant has no equipment number" << " participantId=" << participantPosition.participantId() << " typeClass=" << typeClass; return; @@ -308,21 +308,21 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl if (participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "New Position CatastrophicKill return"; + DEBUG_LOG(m_logger) << "New Position CatastrophicKill return"; return; } if (m_mineLists.contains(participantPosition.participantId())) { - DEBUG_LOG() << "Naechste Mine schicken ohne Bounding-Box-Check... return" + DEBUG_LOG(m_logger) << "Naechste Mine schicken ohne Bounding-Box-Check... return" << " Anzahl Minen in Liste:" << m_mineLists[participantPosition.participantId()].size() << " cesMaxPeriodForCashedMines=" << Settings::cesPeriodStoredMinesOutdated(); - //DEBUG_LOG() << "Settings::cesMaxPeriodForCashedMines() =" << Settings::cesMaxPeriodForCashedMines(); + //DEBUG_LOG(m_logger) << "Settings::cesMaxPeriodForCashedMines() =" << Settings::cesMaxPeriodForCashedMines(); if ((m_mineLists[participantPosition.participantId()].size() > 0) && (QDateTime::currentMSecsSinceEpoch() - m_mineLists[participantPosition.participantId()][0].time < Settings::cesPeriodStoredMinesOutdated())) { - DEBUG_LOG() << "Send Stored mines"; + DEBUG_LOG(m_logger) << "Send Stored mines"; // Search mine with the next no distance int distance = m_mineLists[participantPosition.participantId()][0].distance; int index = 0; @@ -344,7 +344,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl sendEffectTypeEvent(m_aesItemViews[aesItemId], participantPosition, EffectType::EffectiveMineRangeEnter, mineIndex - 1, -1); CentralEffectSimulation::HandlerParticipant::CesParticipantData minePosition = participantPosition; // TODO convert minePos to geographic and set minePosGeo - // DEBUG_LOG() << "minePosGeo lat=" << minePosGeo.lat() + // DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat() // << " lon=" << minePosGeo.lon() // << " z=" << minePosGeo.z(); sendParticipantEvent(m_aesItemViews[aesItemId], minePosition, ProjectDataManagement::EventType_def::HitMine); @@ -360,7 +360,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl } else { - DEBUG_LOG() << "Stored mines are outdated!" + DEBUG_LOG(m_logger) << "Stored mines are outdated!" << " actTime=" << QDateTime::currentMSecsSinceEpoch() << " Settings::cesPeriodStoredMinesOutdated()=" << Settings::cesPeriodStoredMinesOutdated(); m_mineLists[participantPosition.participantId()].clear(); @@ -369,7 +369,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl } - DEBUG_LOG() << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "HandlerParticipantArea::calculateAesParticipant paricipantId: " << participantPosition.participantId() << " m_aesItemViews.size=" << m_aesItemViews.size(); // const QVector utmStepPoly = m_handlerParticipant->getParticipantStep(participantPos.participantId(), m_zone); @@ -377,7 +377,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl for (const CentralEffectSimulation::AesItemViewUtm &itemView : std::as_const(m_aesItemViews)) { int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct); - DEBUG_LOG() << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId + DEBUG_LOG(m_logger) << " itemView: " << itemView.aesItemId << ", " << itemView.aesTypeId << " remainingTasCode=" << remaining; if (itemView.effectStateId != AreaEffectSimulation::AesEffectState_def::EsActivated) @@ -385,7 +385,7 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl if (typeClass == ParticipantManagement::TypeClass_def::Human && remaining > 50) { - DEBUG_LOG() << "ParticipantManagement::TypeClass_def::Human && remaining > 50 continue"; + DEBUG_LOG(m_logger) << "ParticipantManagement::TypeClass_def::Human && remaining > 50 continue"; continue; } @@ -402,31 +402,31 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl bool intersectsBoundingBox = intersectsBoundingBoxCheck(itemView, participantPosition.participantId()); if (!intersectsBoundingBox) { - DEBUG_LOG() << "Continue nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", " + DEBUG_LOG(m_logger) << "Continue nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", " << " paricipantId=" << participantPosition.participantId(); continue; } } - DEBUG_LOG() << "Weiter nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", " + DEBUG_LOG(m_logger) << "Weiter nach Bounding BoxCheck itemView: " << itemView.aesItemId << ", " << " paricipantId=" << participantPosition.participantId(); bool inFormCheckResult = inFormCheck(itemView, participantPosition); if (!inFormCheckResult) { - DEBUG_LOG() << "!inForm"; + DEBUG_LOG(m_logger) << "!inForm"; if (!intersectFormCheck(itemView, participantPosition.participantId())) { - DEBUG_LOG() << "!intersectForm continue"; + DEBUG_LOG(m_logger) << "!intersectForm continue"; continue; } } - DEBUG_LOG() << "Weiter nach inFormCheck und intersectFormCheck"; + DEBUG_LOG(m_logger) << "Weiter nach inFormCheck und intersectFormCheck"; sendParticipantEventEnterLeave(itemView, participantPosition, inFormCheckResult); - DEBUG_LOG() << "intersectMineRadiusCheck "; + DEBUG_LOG(m_logger) << "intersectMineRadiusCheck "; if (intersectMineRadiusCheck(itemView, participantPosition)) { - DEBUG_LOG() << "intersectMineRadiusCheck=true return"; + DEBUG_LOG(m_logger) << "intersectMineRadiusCheck=true return"; return; } } // if AtMineArea @@ -435,17 +435,17 @@ void HandlerMineAreas::onNewOutdoorPosition(const CentralEffectSimulation::Handl void HandlerMineAreas::onNewParticipantState(const CentralEffectSimulation::HandlerParticipant::CesParticipantData &participantPos) { - DEBUG_LOG() << "onNewParticipantState "; + DEBUG_LOG(m_logger) << "onNewParticipantState "; if (participantPos.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CombatReady) { - DEBUG_LOG() << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId()); + DEBUG_LOG(m_logger) << "m_mineLists.contains(participantPos.participantId():" << m_mineLists.contains(participantPos.participantId()); if (m_mineLists.contains(participantPos.participantId())) { - DEBUG_LOG() << "onNewParticipantState CombatReady, loesche Minenliste Eintrag"; + DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste Eintrag"; m_mineLists[participantPos.participantId()].clear(); m_mineLists.remove(participantPos.participantId()); } - DEBUG_LOG() << "onNewParticipantState CombatReady, loesche Minenliste"; + DEBUG_LOG(m_logger) << "onNewParticipantState CombatReady, loesche Minenliste"; } } @@ -468,7 +468,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantPosition.participantId(), itemView.zone); for (const auto &itPos : itemView.formMines) { - DEBUG_LOG() << " itemId=" << itemView.aesItemId + DEBUG_LOG(m_logger) << " itemId=" << itemView.aesItemId << " chargeTypeId=" << itemView.chargeStruct.chargeTypeId() << ", MinePosUtm: " << CentralEffectSimulation::debug(itPos) << " utmStep:" << utmStep[0].x() << utmStep[0].y() @@ -481,7 +481,7 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A if (!LtsUtils::BitArray::testBit(triggeredImpact.bitfield(), bitFieldIdx)) { ++bitFieldIdx; - DEBUG_LOG() << "Mine is active continue bitFieldIdx=" << bitFieldIdx; + DEBUG_LOG(m_logger) << "Mine is active continue bitFieldIdx=" << bitFieldIdx; continue; } } @@ -491,10 +491,10 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A // Check, if participant is inside danger-radius of the mine distance = crossCircle(itPos, impactRadius, participantPosition.participantId(), itemView.zone); - DEBUG_LOG() << "distance=" << distance; + DEBUG_LOG(m_logger) << "distance=" << distance; if (distance < 0.0) { - DEBUG_LOG() << "distance < 0.0 continue"; + DEBUG_LOG(m_logger) << "distance < 0.0 continue"; ++bitFieldIdx; continue; } @@ -509,12 +509,12 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A mineListItem.time = QDateTime::currentMSecsSinceEpoch(); m_mineLists[participantPosition.participantId()].append(mineListItem); mineListIndex++; - DEBUG_LOG() << " m_mineLists[" << participantPosition.participantId() + DEBUG_LOG(m_logger) << " m_mineLists[" << participantPosition.participantId() << "].length=" << m_mineLists[participantPosition.participantId()].length(); if (distance < lastDistance) { - DEBUG_LOG() << " distance < lastDistance crossCircle for aesItemId: " << itemView.aesItemId + DEBUG_LOG(m_logger) << " distance < lastDistance crossCircle for aesItemId: " << itemView.aesItemId << ", mineIdx: " << mineIdx << ", impactRadius:" << impactRadius << ", participantId: " << participantPosition.participantId() @@ -528,19 +528,19 @@ bool HandlerMineAreas::intersectMineRadiusCheck(const CentralEffectSimulation::A bitFieldIdx++; } // for each mine - DEBUG_LOG() << "End of for-loop participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "End of for-loop participantId=" << participantPosition.participantId() << " mineIndex=" << mineIndex << " lastDistance=" << lastDistance; if (lastDistance > 0) { - DEBUG_LOG() << "sendEffectTypeEvent participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << "sendEffectTypeEvent participantId=" << participantPosition.participantId() << " mineIndex=" << mineIndex; // TODO Minenposition fuer den Event nehmen und nicht die Participant-Position sendFtcMineTrigger(itemView.aesItemId, mineIndex - 1); sendEffectTypeEvent(itemView, participantPosition, EffectType::EffectiveMineRangeEnter, mineIndex - 1, -1); CentralEffectSimulation::HandlerParticipant::CesParticipantData minePosition = participantPosition; // TODO convert minePos to geographic and set minePosGeo - // DEBUG_LOG() << "minePosGeo lat=" << minePosGeo.lat() + // DEBUG_LOG(m_logger) << "minePosGeo lat=" << minePosGeo.lat() // << " lon=" << minePosGeo.lon() // << " z=" << minePosGeo.z(); sendParticipantEvent(itemView, minePosition, ProjectDataManagement::EventType_def::HitMine); @@ -555,17 +555,17 @@ bool HandlerMineAreas::intersectsBoundingBoxCheck(const CentralEffectSimulation: const int participantId) { bool result = false; - DEBUG_LOG() << "intersectsBoundingBoxCheck participantId=" << participantId + DEBUG_LOG(m_logger) << "intersectsBoundingBoxCheck participantId=" << participantId << " itemViewId=" << itemView.aesItemId << " zone=" << itemView.zone; const QPolygonF stepPoly = m_handlerParticipant->getParticipantStep(participantId, itemView.zone); if (stepPoly.size() < 2) return false; - DEBUG_LOG() << "utmStep von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y() + DEBUG_LOG(m_logger) << "utmStep von=" << stepPoly.at(0).x() << "/" << stepPoly.at(0).y() << " bis=" << stepPoly.at(1).x() << "/" << stepPoly.at(1).y() << " zone=" << itemView.zone; - DEBUG_LOG() << "ItemView Bounding Box BottomLeft=" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y() + DEBUG_LOG(m_logger) << "ItemView Bounding Box BottomLeft=" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y() << " boundingBoxTopRight=" << itemView.boundingBoxTopRight.x() << "/" << itemView.boundingBoxTopRight.y(); #if QT_VERSION < QT_VERSION_CHECK(5,10,0) @@ -573,7 +573,7 @@ bool HandlerMineAreas::intersectsBoundingBoxCheck(const CentralEffectSimulation: #else result = itemView.boundingBox.intersects(stepPoly); #endif - DEBUG_LOG() << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result; + DEBUG_LOG(m_logger) << "HandlerMineAreas::intersectsBoundingBoxCheck result =" << result; return result; } @@ -594,7 +594,7 @@ bool HandlerMineAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItem QPointF boundingBoxBottomLeft = QPointF(boundingBoxBottomLeftX, boundingBoxBottomLeftY); QPointF boundingBoxTopRight = QPointF(boundingBoxTopRightX, boundingBoxTopRightY); - DEBUG_LOG() << " impactRadius=" << impactRadius + DEBUG_LOG(m_logger) << " impactRadius=" << impactRadius << " itemView.boundingBoxBottomLeft" << itemView.boundingBoxBottomLeft.x() << "/" << itemView.boundingBoxBottomLeft.y() << " itemView.boundingBoxTopRight" << itemView.boundingBoxTopRight.x() << "/" << itemView.boundingBoxTopRight.y() << " boundingBoxBottomLeft=" << boundingBoxBottomLeft.x() << "/" << boundingBoxBottomLeft.y() @@ -608,11 +608,11 @@ bool HandlerMineAreas::inBoundingBoxCheck(const CentralEffectSimulation::AesItem const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone); if (boundingBoxImpact.contains(participantPosUtmPoint)) { - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " inside AesItemView:" << itemView.aesItemId << " return true"; return true; } - DEBUG_LOG() << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inBoundingBoxCheck Paricipant " << participantPosition.participantId() << " outside AesItemView:" << itemView.aesItemId << " return false"; return false; } @@ -623,14 +623,14 @@ bool HandlerMineAreas::inFormCheck(const CentralEffectSimulation::AesItemViewUtm { const QPointF participantPosUtmPoint = CentralEffectSimulation::geographic2Utm(participantPosition.pos(), itemView.zone); - DEBUG_LOG() << "inFormCheck start, paricipantId: " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inFormCheck start, paricipantId: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId << ", aesTypeId: " << itemView.aesTypeId << ", form.size: " << itemView.form.size(); if (itemView.form.containsPoint(participantPosUtmPoint, Qt::FillRule::OddEvenFill)) { - DEBUG_LOG() << "inside AES form, paricipantId: " << participantPosition.participantId() + DEBUG_LOG(m_logger) << "inside AES form, paricipantId: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId; return true; } // if inside @@ -644,7 +644,7 @@ bool HandlerMineAreas::intersectFormCheck(const CentralEffectSimulation::AesItem { const QPolygonF utmStep = m_handlerParticipant->getParticipantStep(participantId, itemView.zone); - DEBUG_LOG() << "intersectFormCheck start, paricipantId: " << participantId + DEBUG_LOG(m_logger) << "intersectFormCheck start, paricipantId: " << participantId << ", aesItemId: " << itemView.aesItemId << ", aesTypeId: " << itemView.aesTypeId << ", form.size: " << itemView.form.size(); @@ -655,7 +655,7 @@ bool HandlerMineAreas::intersectFormCheck(const CentralEffectSimulation::AesItem if (itemView.form.intersects(utmStep)) #endif { - DEBUG_LOG() << "intersect AES form, paricipantId: " << participantId + DEBUG_LOG(m_logger) << "intersect AES form, paricipantId: " << participantId << ", aesItemId: " << itemView.aesItemId; return true; } // if inside @@ -669,7 +669,7 @@ void HandlerMineAreas::onTriggeredImpactsChanged(const AreaEffectSimulation::Tri modType != DataModification::eModified) return; - DEBUG_LOG() << "Got TriggeredImpacts: "; + DEBUG_LOG(m_logger) << "Got TriggeredImpacts: "; switch (data.aesTypeId().underlying()) { case AreaEffectSimulation::AesType_def::AtExplosionArea: @@ -702,7 +702,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp auto it = m_aesItemViews.find(data.aesItemId()); if (it == m_aesItemViews.end()) { - WARNING_LOG() << "Could not find item view for aes with id " << data.aesItemId(); + WARNING_LOG(m_logger) << "Could not find item view for aes with id " << data.aesItemId(); return; } CentralEffectSimulation::AesItemViewUtm &aesItemView = *it; @@ -729,7 +729,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp // already checked (bit is already 0) if (!LtsUtils::BitArray::testBit(aesItemView.handledImpacts, bitFieldIdx)) continue; - DEBUG_LOG() << "New impact at idx " << bitFieldIdx; + DEBUG_LOG(m_logger) << "New impact at idx " << bitFieldIdx; bitsToCheck += bitFieldIdx; } @@ -740,7 +740,7 @@ void HandlerMineAreas::calculateImpacts(const AreaEffectSimulation::TriggeredImp const auto participantPositions = m_handlerParticipant->positions(); for (const CentralEffectSimulation::HandlerParticipant::CesParticipantData &pPos : participantPositions) { - DEBUG_LOG() << "pos participantId=" << pPos.participantId() + DEBUG_LOG(m_logger) << "pos participantId=" << pPos.participantId() << " buildingId=" << pPos.buildingId() << " insideBuilding=" << pPos.insideBuilding() << " positionValid=" << pPos.positionValid; @@ -787,24 +787,24 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV { int remaining = m_ddsHandler->remainingTasCode(itemView.chargeStruct); - DEBUG_LOG() << "sendCesHitRequest " + DEBUG_LOG(m_logger) << "sendCesHitRequest " << " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea() << " participantId=" << participantPosition.participantId(); const int equipNo = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() << " equipNo = " << equipNo << " aesItemId =" << itemView.aesItemId; // participantPosition.participantPosition == 0 -> send to all if (participantPosition.participantId() != 0 && equipNo <= 0) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ; return; } if (participantPosition.participantId() != 0 && participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } @@ -831,13 +831,13 @@ void HandlerMineAreas::sendCesHitRequest(const CentralEffectSimulation::AesItemV itemView.partyId, // originPartyId mineFieldBitIndex ); - DEBUG_LOG() << " participantId=" << participantPosition.participantId() + DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct.chargeTypeId(); m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } } @@ -851,25 +851,25 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView int32_t legacyChargeTypeId = 0; legacyChargeTypeId = m_ddsHandler->getLegacyIdFromChargeTypeId(itemView.chargeStruct()); - DEBUG_LOG() << "sendCesHitRequest" + DEBUG_LOG(m_logger) << "sendCesHitRequest" << " insideWlsArea=" << std::boolalpha << participantPosition.insideWlsArea() << " participantId=" << participantPosition.participantId(); const int equipmentNumber = m_ddsHandler->participantId2EquipNo(participantPosition.participantId()); - DEBUG_LOG() << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() + DEBUG_LOG(m_logger) << " ftc sendCESHit to Participant participantId = " << participantPosition.participantId() << " equipNo = " << equipmentNumber << " aesItemId =" << itemView.aesItemId(); // participantPosition.participantPosition == 0 -> send to all if (participantPosition.participantId() != 0 && equipmentNumber <= 0) { - DEBUG_LOG() << "participantPosition.participantId != 0 && equipNo <= 0" ; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 && equipNo <= 0" ; return; } // if if (participantPosition.participantId() != 0 && participantPosition.vulnerabilityState == ProjectDataManagement::VulnerabilityState_def::CatastrophicKill) { - DEBUG_LOG() << "participantPosition.participantId != 0 CatastrophicKill)"; + DEBUG_LOG(m_logger) << "participantPosition.participantId != 0 CatastrophicKill)"; return; } // if @@ -885,13 +885,13 @@ void HandlerMineAreas::sendCesHitRequest(const AreaEffectSimulation::AesItemView equipmentNumber, participantPosition.participantId(), legacyChargeTypeId, itemView.aesItemId(), originatorEquipmentNumber, remaining, pos, effectTime, eventType, itemView.partyId().get(), mineFieldBitIndex ); - DEBUG_LOG() << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().chargeTypeId() + DEBUG_LOG(m_logger) << " participantId=" << participantPosition.participantId() << " chargeTypeId=" << itemView.chargeStruct().chargeTypeId() << " legacyChargeTypeId=" << legacyChargeTypeId; m_sendCesHitRequestQueue.enqueue(requestTab); if (m_sendCesHitRequestQueue.size() == 1) { - DEBUG_LOG() << "SendCesHitRequest: " << requestTab; + DEBUG_LOG(m_logger) << "SendCesHitRequest: " << requestTab; m_ddsHandler->ftcTab()->sendCesHitRequest(requestTab, this); } // if } @@ -938,7 +938,7 @@ void HandlerMineAreas::sendParticipantEvent(const CentralEffectSimulation::AesIt { - DEBUG_LOG() << "sendParticipantEvent " << itemView.aesItemId + DEBUG_LOG(m_logger) << "sendParticipantEvent " << itemView.aesItemId << " participantId=" << participantPosition.participantId() << " eventType=" << eventType << " pos=" << participantPosition.pos().lat() @@ -977,7 +977,7 @@ void HandlerMineAreas::sendFtcMineTrigger(int aesItemId, int mineIndex) tr.mineAreaId(aesItemId); tr.mineId(mineIndex); tr.chargeTypeId(ma.chargeStruct().chargeTypeId()); - DEBUG_LOG() << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId() + DEBUG_LOG(m_logger) << "send sendFtcMineTrigger: aesItemId=" << tr.mineAreaId() << " MineIndex=" << tr.mineId(); ftcAes->mineTriggeredRequest(tr, this); } @@ -988,7 +988,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte int mineFieldBitIndex, qint64 effectTime) { - DEBUG_LOG() << "sendEffectTypeEvent aesItemId=" << itemView.aesItemId + DEBUG_LOG(m_logger) << "sendEffectTypeEvent aesItemId=" << itemView.aesItemId << " participantId=" << participantPosition.participantId() << " effectType=" << effectTime << " mineFieldBitIndex=" << mineFieldBitIndex; @@ -1000,7 +1000,7 @@ void HandlerMineAreas::sendEffectTypeEvent(const CentralEffectSimulation::AesIte if (mineFieldBitIndex >= 0) mfb = ", mineFieldBitIndex: " + QByteArray::number(mineFieldBitIndex); const int ctasEffectType = static_cast(effectType) & 0xffff; - DEBUG_LOG() << "Sending EffectType event " << toString(effectType) + DEBUG_LOG(m_logger) << "Sending EffectType event " << toString(effectType) << ", participant: " << participantPosition.participantId() << ", aesItemId: " << itemView.aesItemId << mfb @@ -1039,7 +1039,7 @@ qreal HandlerMineAreas::crossCircle(const QPointF ¢erUtm, const double radiu QLineF line; line.setP1(stepPoly[0]); line.setP2(centerUtm); - DEBUG_LOG() << "crossCircle distance =" << line.length(); + DEBUG_LOG(m_logger) << "crossCircle distance =" << line.length(); return line.length(); } return result; @@ -1051,13 +1051,13 @@ bool HandlerMineAreas::inCircle(const QPointF ¢erUtm, const double radius, c { double squareDist = CentralEffectSimulation::getSquareDistance(centerUtm, pointUtm); double squareRadius = radius * radius; - DEBUG_LOG() << "squareDist: " << squareDist << ", squareRadius: " << squareRadius; + DEBUG_LOG(m_logger) << "squareDist: " << squareDist << ", squareRadius: " << squareRadius; return (squareDist < squareRadius); } // inCircle void HandlerMineAreas::aesItemViewRemoved(int aesItemId) { - DEBUG_LOG() << "HandlerMineAreas::aesItemViewRemoved aesItemId=" << aesItemId; + DEBUG_LOG(m_logger) << "HandlerMineAreas::aesItemViewRemoved aesItemId=" << aesItemId; m_effectTypeStates.remove(aesItemId); m_effectTypeBitFieldIndexes.remove(aesItemId); @@ -1072,7 +1072,7 @@ void HandlerMineAreas::printAesItemViews() while (i.hasNext()) { i.next(); - DEBUG_LOG() << "printAesItemViews key=" << i.key() << ": " + DEBUG_LOG(m_logger) << "printAesItemViews key=" << i.key() << ": " << " aesItemId=" << i.value().aesItemId << " aesTypeId=" << i.value().aesTypeId; } @@ -1088,7 +1088,7 @@ bool HandlerMineAreas::inExtededFormCheck(const CentralEffectSimulation::AesItem /////////////////////////////////////////////////////////// // Check whether the position is within an expanded form // /////////////////////////////////////////////////////////// - DEBUG_LOG() << "itemView.form.size=" << itemView.form.size(); + DEBUG_LOG(m_logger) << "itemView.form.size=" << itemView.form.size(); for (int i = 0; i < itemView.form.size() ; i++) { int nextPoint = i + 1; @@ -1098,17 +1098,17 @@ bool HandlerMineAreas::inExtededFormCheck(const CentralEffectSimulation::AesItem const QPointF l1(itemView.form[i].x(), itemView.form[i].y()); const QPointF l2(itemView.form[nextPoint].x(), itemView.form[nextPoint].y()); double distancePointLineValue = distancePointLine(participantPosUtmPoint, l1, l2); - DEBUG_LOG() << "distancePointLineValue=" << distancePointLineValue + DEBUG_LOG(m_logger) << "distancePointLineValue=" << distancePointLineValue << " ParticipantPos =" << participantPosUtmPoint.x() << "/" << participantPosUtmPoint.y() << " Line=" << l1.x() << "/" << l1.y() << " " << l2.x() << "/" << l2.y(); if (distancePointLineValue < distance) { - DEBUG_LOG() << "posInExtendedForm return true"; + DEBUG_LOG(m_logger) << "posInExtendedForm return true"; return true; } } - DEBUG_LOG() << "posInExtendedForm return false"; + DEBUG_LOG(m_logger) << "posInExtendedForm return false"; return false; } @@ -1126,7 +1126,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1, qreal length2 = pToP2.length(); if (length1 < length2) { - DEBUG_LOG() << "a distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "a distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << length1 @@ -1135,7 +1135,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1, } else { - DEBUG_LOG() << "b distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "b distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << length2 @@ -1149,7 +1149,7 @@ double HandlerMineAreas::distancePointLine(const QPointF &p, const QPointF &l1, /* double distance = sqrt(squareLen(p, intersectPnt)); - DEBUG_LOG() << "c distancePointLine p=" << p.x() << "/" << p.y() + DEBUG_LOG(m_logger) << "c distancePointLine p=" << p.x() << "/" << p.y() << " line: p1=" << l1.x() << "/" << l1.y() << " p2=" << l2.x() << "/" << l2.y() << " distance=" << distance; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/plugin.cpp index c9d6aa97d..5ada233dd 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineAreas/plugin.cpp @@ -48,7 +48,7 @@ bool CesMineAreasInterfaceImpl::init(int domainId, int exerciseId) { m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "CesMineAreasInterfaceImpl::init()" + INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; @@ -59,11 +59,11 @@ bool CesMineAreasInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerMineAreas->init()) { - ERROR_LOG() << "Initialisation handlerMineAreas failed."; + ERROR_LOG(m_logger) << "Initialisation handlerMineAreas failed."; return false; } - INFO_LOG() << "CesMineAreasInterfaceImpl::init() return true"; + INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::init() return true"; return true; } @@ -71,8 +71,8 @@ QString CesMineAreasInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> CesMineAreasInterfaceImpl::echo").arg(message)); - INFO_LOG() << "CesMineAreasInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: CesMineAreasInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "CesMineAreasInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: CesMineAreasInterfaceImpl::echo return:" << ret; return ret; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/handler_mine_laying_artillery.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/handler_mine_laying_artillery.cpp index ace9a753e..cabf4d7ca 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/handler_mine_laying_artillery.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/handler_mine_laying_artillery.cpp @@ -23,16 +23,16 @@ HandlerMineLayingArtillery::HandlerMineLayingArtillery(const std::shared_ptrsetInterval(500); } -HandlerMineLayingArtillery::~HandlerMineLayingArtillery() { INFO_LOG() << "HandlerMineLayingArtillery::~HandlerMineLayingArtillery"; } +HandlerMineLayingArtillery::~HandlerMineLayingArtillery() { INFO_LOG(m_logger) << "HandlerMineLayingArtillery::~HandlerMineLayingArtillery"; } bool HandlerMineLayingArtillery::init() { - INFO_LOG() << "HandlerMineLayingArtillery::init"; + INFO_LOG(m_logger) << "HandlerMineLayingArtillery::init"; m_dtcAes = m_ddsHandler->dtcAes(); m_ftcAes = m_ddsHandler->ftcAes(); @@ -87,7 +87,7 @@ std::vector HandlerMineLayingArtillery::calculat const double armingTimeOffset = mineLayingPattern[QStringLiteral("armingTimeOffset")].toDouble(); const double armingJitter = mineLayingPattern[QStringLiteral("armingJitter")].toDouble(); - DEBUG_LOG() << "[calculateImpacts] ## \n\tappearanceTimeOffset: " << appearanceTimeOffset << "\n\tappearanceJitter: " << appearanceJitter << "\n\tarmingTimeOffset: " << armingTimeOffset<<"\n\ttime: "< HandlerMineLayingArtillery::calculat const double appearenceTime = time + appearanceTimeOffset + QRandomGenerator::global()->bounded(0, appearanceJitter * 2) - appearanceJitter; const double armingTime = time + armingTimeOffset + QRandomGenerator::global()->bounded(0, armingJitter * 2) - armingJitter; - DEBUG_LOG() <<"[calculateImpacts] patternCount: "< HandlerMineLayingArtillery::calculat transformedImpacts.push_back(mineData); } - DEBUG_LOG()<<"[calculateImpacts] ### pattern patterCount: "<< patternCounter <<" patternsArray.size(): "<effectCluster(chargeEffect.originatorId()); - DEBUG_LOG()<<" [onChargeEffectChanged] effectClusterId: "<mineAreaReferenceModifyRequest(request); - DEBUG_LOG()<<"[onChargeEffectChanged] ****** mineAreaReferenceModifyRequest \n\tret id: "<< ret + DEBUG_LOG(m_logger)<<"[onChargeEffectChanged] ****** mineAreaReferenceModifyRequest \n\tret id: "<< ret << "\n\tchargeTypeId: " << chargeTypeId << "\n\tchargeEffectId: " << chargeEffectId << "\n\ttrajectoryId: " << trajectory.id() << "\n\tangle: " << angle << "\n\ttimeFromLastTrajectoryPointAbsolute: " << timeFromLastTrajectoryPointAbsolute; diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/plugin.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/plugin.cpp index 4af715cf8..a95886ca5 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/plugin.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MineLayingArtillery/plugin.cpp @@ -35,8 +35,8 @@ MineLayingArtilleryPluginInterfaceImpl::MineLayingArtilleryPluginInterfaceImpl(C QString MineLayingArtilleryPluginInterfaceImpl::echo(const QString &message) { QString ret(QStringLiteral("<<<< %1 >>>> MineLayingArtilleryPluginInterfaceImpl::echo").arg(message)); - INFO_LOG() << "MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret; - DEBUG_LOG() << "DEBUG: MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret; + INFO_LOG(m_logger) << "MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret; + DEBUG_LOG(m_logger) << "DEBUG: MineLayingArtilleryPluginInterfaceImpl::echo return:" << ret; return ret; } @@ -45,7 +45,7 @@ bool MineLayingArtilleryPluginInterfaceImpl::init(int domainId, int exerciseId) m_domainId = domainId; m_exerciseId = exerciseId; - INFO_LOG() << "MineLayingArtilleryPluginInterfaceImpl::init()" + INFO_LOG(m_logger) << "MineLayingArtilleryPluginInterfaceImpl::init()" << " m_domainId=" << m_domainId << " m_exerciseId=" << m_exerciseId; // initialize handlerMineLayingArtillery @@ -53,7 +53,7 @@ bool MineLayingArtilleryPluginInterfaceImpl::init(int domainId, int exerciseId) if (!m_handlerMineLayingArtillery->init()) { - ERROR_LOG() << "Initialisation m_handlerMineLayingArtillery failed."; + ERROR_LOG(m_logger) << "Initialisation m_handlerMineLayingArtillery failed."; return false; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MissionPlan/ces_mission_plan_handler.cpp b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MissionPlan/ces_mission_plan_handler.cpp index 11f801eba..c8660b765 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MissionPlan/ces_mission_plan_handler.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/Services/CentralEffectSimulation/Plugins/MissionPlan/ces_mission_plan_handler.cpp @@ -65,7 +65,7 @@ bool CesMissionPlanHandler::init() this, &CesMissionPlanHandler::onMissionPlanChanged); - DEBUG_LOG() << " -- MissionPlanHandler::init() finished."; + DEBUG_LOG(m_logger) << " -- MissionPlanHandler::init() finished."; return true; } @@ -80,11 +80,11 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M } // check if mission start is in the future before proceeding.. - DEBUG_LOG()<<" -- [updateMissionPlanList] new missionPlan : "<currentPartitionTime()) { - WARNING_LOG() << " -- updateMissionPlanList mission startTime ("<currentPartitionTime(); return; } @@ -96,7 +96,7 @@ void CesMissionPlanHandler::updateMissionPlanList(const ParticipantManagement::M const int planId = obj->planId(); std::function onDeleteObj = [this, planId]() { - DEBUG_LOG()<<" -- remove ces mission object from container planId: "< m_ddsHandler->currentPartitionTime()) { const int time = m_missionPlan.missionStart() - m_ddsHandler->currentPartitionTime(); - // DEBUG_LOG()<<" -- [CesMissionPlanObject] start mission after << "<