Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Plugins/Timeline/Gui/EventTimeline/tln_legend.cpp
T
torstenandCopilot b774f4035c Qt6 Migration: DDS-Stubs, Logger-Fixes, Export-Header Korrekturen
- NGL_ADD_LIBRARY2: 87 CMakeLists.txt konvertiert für Export-Header Generierung
- 44 Export-Header Include-Pfade korrigiert (_export.h)
- 81 DDS-Stub-Header generiert (*_dtc.h, *_fts.h, *_dts.h, *_ftc.h)
- INGLLogger: Duplikat gelöscht, m_logger Member entfernt, variadische Makros
- Q_FUNC_INFO Redefinition behoben (Qt6 definiert bereits)
- FATAL_LOG Makro hinzugefügt
- InfrastructureManagement DDS-Stubs (ism.hpp, ism_enums.hpp, ism_ftc.h)
- FilterManagement DDS-Stubs (flt_ftc.h, flt_dts.h)
- AreaEffectSimulation DDS-Stubs (aes.hpp, aes_enums.hpp)
- SymbolAppearance Klasse vollständig definiert mit content() Methode
- BuildingComponentFilter Klasse definiert mit Copy-Konstruktor
- Ftc Factory: nullptr Return (abstract class)
- AesFilter Klasse in aes.hpp hinzugefügt
- Dtc Klasse in ppm.hpp mit participantChanged Signal
- AesType Enum: alle 15 At* Werte definiert
- AesEffectState_def: EsReceived hinzugefügt
- DataModification Enum: eAdded/eModified/eRemoved
- function_reply_object.h → core_types.h Include-Pfad (72 Dateien)
- Enum-Class-Streaming Template-Operator in INGLLogger.h
- ism_mounting_point.h: QImage → QtGui/QImage, QGuiApplication/QScreen
- ism_data_plugin_interface.h: QSet Include, Include-Reihenfolge
- QRegExp → QRegularExpression in tpm_js_parser.cpp
- .underlying() Aufrufe zu direktem Enum-Vergleich korrigiert
- Include-Pfade: aes.hpp in symbol_appearance_settings_impl.h und aes_display_filter_impl.h

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-19 06:06:24 +02:00

187 lines
5.6 KiB
C++
Executable File

#include "tln_legend.h"
#include "ui_tln_legend.h"
#include "EventTypes/BiteMessage/tln_bite_message_item.h"
#include "EventTypes/Block/tln_block_item.h"
#include "EventTypes/CameraVideo/tln_camera_video_item.h"
#include "EventTypes/CrossBorderline/tln_cross_borderline_item.h"
#include "EventTypes/FireEvent/tln_fire_event_item.h"
#include "EventTypes/Hit/tln_hit_item.h"
#include "EventTypes/HitBuilding/tln_hit_building_item.h"
#include "EventTypes/HitEffectSimulation/tln_hit_effect_simulation_item.h"
#include "EventTypes/Manipulation/tln_manipulation_item.h"
#include "EventTypes/Marker/tln_marker_item.h"
#include "EventTypes/RadioCnr/tln_radio_cnr_item.h"
#include "EventTypes/RadioTvc/tln_radio_tvc_item.h"
#include "EventTypes/WeaponAssignment/tln_weapon_assignment_item.h"
#include <LtsUtilsSettings/settings.h>
#include <QLabel>
#include <QImage>
#include <QPixmap>
#include <QPainter>
namespace Timeline
{
QVector<EventType> TimelineLegend::possibleEvents()
{
QVector<EventType> ret({
EventType::Hit,
EventType::WeaponAssignment,
EventType::BiteMessage,
EventType::FireEvent,
EventType::HitBuilding,
EventType::Manipulation,
EventType::CameraVideo,
EventType::RadioCnr,
EventType::RadioTvc,
EventType::HitEffectSimulation,
EventType::CrossBorderline,
EventType::Marker,
EventType::Block
});
LtsUtils::ProjectSettings *settings = LtsUtils::ProjectSettings::getInstance();
if (settings->value(QStringLiteral("tln"), QStringLiteral("showEffectSimulationEvents")).toBool())
{
ret += EventType::MineArea;
ret += EventType::DangerArea;
ret += EventType::FunctionalArea;
ret += EventType::MineCorridor;
ret += EventType::Borderline;
if (settings->value(QStringLiteral("aes"), QStringLiteral("enableNuclearContaminations")).toBool())
ret += EventType::NContamination;
if (settings->value(QStringLiteral("aes"), QStringLiteral("enableNuclearContaminations")).toBool() ||
settings->value(QStringLiteral("aes"), QStringLiteral("enableNuclearContaminations")).toBool())
ret += EventType::BCContamination;
}
if (settings->value(QStringLiteral("tln"), QStringLiteral("showEnterLeaveEvents")).toBool())
{
ret += EventType::EnterDangerArea;
ret += EventType::LeaveDangerArea;
ret += EventType::EnterMineArea;
ret += EventType::LeaveMineArea;
ret += EventType::EnterFunctionalArea;
ret += EventType::LeaveFunctionalArea;
if (settings->value(QStringLiteral("aes"), QStringLiteral("enableNuclearContaminations")).toBool())
{
ret += EventType::EnterNuclear;
ret += EventType::LeaveNuclear;
}
}
if (settings->value(QStringLiteral("aes"), QStringLiteral("enableGasPipes")).toBool())
{
ret += EventType::GasPipe;
}
const bool showPvSan = LtsUtils::ProjectSettings::isFunctionEnabled(QStringLiteral("ParticipantInformation"), QStringLiteral("HasPvSan"));
if (showPvSan)
ret += EventType::Sanitation;
return ret;
}
TimelineLegend::TimelineLegend(QWidget *parent)
: LtsWidgets::LtsDialog(parent, LtsWidgets::ButtonCombination::CloseOnly)
, m_ui(new Ui::TimelineLegend)
{
m_ui->setupUi(this);
EventTypes eventTypes = possibleEvents();
std::sort(eventTypes.begin(), eventTypes.end(), [](EventType left, EventType right)
{
if (left == EventType::Marker)
return true;
else if (right == EventType::Marker)
return false;
int categoryLeft = eventTypeCategory(left);
int categoryRight = eventTypeCategory(right);
if (categoryLeft != categoryRight)
return categoryLeft < categoryRight;
return eventTypeString(left) < eventTypeString(right);
});
int row = 1;
for (EventType eventType : eventTypes)
{
QLabel *pixmapContainerLabel = new QLabel;
switch (eventType)
{
case EventType::Marker:
pixmapContainerLabel->setPixmap(MarkerItem::pixmap);
break;
case EventType::Block:
pixmapContainerLabel->setPixmap(BlockItem::pixmap);
break;
case EventType::Hit:
pixmapContainerLabel->setPixmap(HitItem::pixmap);
break;
case EventType::WeaponAssignment:
pixmapContainerLabel->setPixmap(WeaponAssignmentItem::pixmap);
break;
case EventType::BiteMessage:
pixmapContainerLabel->setPixmap(BiteMessageItem::pixmap);
break;
case EventType::FireEvent:
pixmapContainerLabel->setPixmap(FireEventItem::pixmap);
break;
case EventType::HitBuilding:
pixmapContainerLabel->setPixmap(HitBuildingItem::pixmap);
break;
case EventType::Manipulation:
pixmapContainerLabel->setPixmap(ManipulationItem::pixmap);
break;
case EventType::CameraVideo:
pixmapContainerLabel->setPixmap(CameraVideoItem::pixmap);
break;
case EventType::RadioCnr:
pixmapContainerLabel->setPixmap(RadioCnrItem::pixmap);
break;
case EventType::RadioTvc:
pixmapContainerLabel->setPixmap(RadioTvcItem::pixmap);
break;
case EventType::HitEffectSimulation:
pixmapContainerLabel->setPixmap(HitEffectSimulationItem::pixmap);
break;
case EventType::CrossBorderline:
pixmapContainerLabel->setPixmap(CrossBorderlineItem::pixmap);
break;
default:
continue;
}
m_ui->gridLayout->addWidget(pixmapContainerLabel, row, 0);
m_ui->gridLayout->addWidget(new QLabel(eventTypeString(eventType)), row, 1);
m_ui->gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding), row, 2);
++row;
}
m_ui->gridLayout->addItem(new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding), row, 0);
}
TimelineLegend::~TimelineLegend()
{
delete m_ui;
}
void TimelineLegend::retranslate()
{
translate(m_ui, tr("Timeline Legend"));
}
}