Qt6 Migration: Complete migration with DDS/RTI support and build validation

Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-09-15 18:20:26 +00:00
1 parent f23384bb68
commit 7173785915
18662 files changed
+4115092 -5435

No files matched your search

@@ -5,14 +5,6 @@
# Created by Mike Wille, SLSE, 2016-05-05
#
# Make ${Qt6_Widgets} optional
if(QT6_GUI_AVAILABLE AND TARGET Qt6::Widgets)
set(Qt6_Widgets ${Qt6_Widgets})
else()
set(Qt6_Widgets "")
endif()
SET(participant_info_gui_SRCS
participant_info_gui_plugin.cpp
participant_info_gui_plugin.h
@@ -83,34 +75,34 @@ NGL_WRAP_UI(participant_info_gui_SRCS
)
NGL_ADD_LIBRARY(WS PpmParticipantInfoGuiPlugin MODULE ${participant_info_gui_SRCS})
if(QT6_GUI_AVAILABLE)
NGL_TARGET_LINK_LIBRARIES(PpmParticipantInfoGuiPlugin
NGLLogger
LtsNotification
ngltools
nglwidgets
LtsCoordTrans
FltAesGuiPluginInterface
PpmCommon
PpmParticipantInfoGuiPluginInterface
PpmDataPluginInterface
PdmDataPluginInterface
svcTgtClient
PdmGuiPluginInterface
${Qt6_Widgets}
LtsWidgets
LtsSession
LtsSessionData
LtsUtilsSettings
SituationMapGuiPluginInterface
LtsUtilsGuiDds
LtsUtilsSettings
AsbDataPluginInterface
AesDataPluginInterface
LtsDataView
IsmDataPluginInterface
)
endif()
NGL_TARGET_LINK_LIBRARIES(PpmParticipantInfoGuiPlugin
NGLLogger
LtsNotification
ngltools
nglwidgets
LtsCoordTrans
FltAesGuiPluginInterface
PpmCommon
PpmParticipantInfoGuiPluginInterface
PpmDataPluginInterface
PdmDataPluginInterface
svcTgtClient
PdmGuiPluginInterface
Qt5::Widgets
LtsWidgets
LtsSession
LtsSessionData
LtsUtilsSettings
SituationMapGuiPluginInterface
LtsUtilsGuiDds
LtsUtilsSettings
AsbDataPluginInterface
AesDataPluginInterface
LtsDataView
IsmDataPluginInterface
LtsPluginLoader
GuiElementInterface
)
NGL_INSTALL_TARGET(PpmParticipantInfoGuiPlugin)
@@ -1,5 +1,11 @@
/**
* @RDE_HEADER@
* ParticipantManagement - ParticipantInfoDialog
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-06-01
*/
#include "participant_info_dialog.h"
#include "ui_participant_info_dialog.h"
@@ -25,18 +31,20 @@
#include <LtsCoordTrans/lts_coord_trans.h>
#include <ngltools/ngltools_dtg.h>
#include <LtsSession/lts_session_data.h>
#include <LtsUtils/LtsUtilsCore/outdated_position.h>
#include <LtsUtilsCore/outdated_position.h>
#include <LtsUtilsSettings/settings.h>
#include <LtsPluginManager/lts_plugin_loader.h>
#include <AreaEffectSimulation/Utils/polygons.h>
#include <Services/AreaEffectSimulation/Utils/polygons.h>
#include <ParticipantManagement/participant_info_gui_element_interface.h>
#include <QtCore/QJsonDocument>
#include <QJsonDocument>
#include <QTableWidgetItem>
#include <QtWidgets/QToolButton>
#include <QtGui/QTransform>
#include <QtWidgets/QMenu>
#include <QtGui/QColor>
#include <QtWidgets/QLabel>
#include <QToolButton>
#include <QTransform>
#include <QMenu>
#include <QColor>
#include <QLabel>
namespace ParticipantManagement
{
@@ -60,6 +68,7 @@ ParticipantInfoDialog::ParticipantInfoDialog(int participantId, const QString &m
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_ui(new Ui::ParticipantInfoDialog)
, m_isTarget(false)
, m_logger(getLogger("ParticipantInfoDialog"))
{
m_ui->setupUi(this);
m_oldSpacerSize.first = m_ui->vsBottom->maximumSize().width();
@@ -88,7 +97,7 @@ ParticipantInfoDialog::ParticipantInfoDialog(int participantId, const QString &m
connect(m_ui->pbUnlockUas, &QToolButton::clicked, this, &ParticipantInfoDialog::onUnlockUAS);
//hide first:
m_ui->twGear->hide();
m_ui->lblInfo->hide();
m_ui->lblInfoText->hide();
@@ -164,7 +173,7 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session,
connect(m_dtc.get(), &Interface::Dtc::partyChanged,
this, &ParticipantInfoDialog::updateCurrentIcon, Qt::UniqueConnection);
// to handle race condition between DynamicParticipantData and DusMineState:
connect(m_aesDtc.get(), &AreaEffectSimulation::Interface::Dtc::dusMineStateChanged,
this, &ParticipantInfoDialog::updateCurrentIcon, Qt::UniqueConnection);
@@ -191,19 +200,20 @@ bool ParticipantInfoDialog::init(LtsSession::LtsSession *session,
return setUiValues();
}
// private
bool ParticipantInfoDialog::setUiValues()
{
/* NOTE: This is a hide-all-you-don't-need concept. Everything is shown,
* so everything you don't want to show up must be hidden.
* Plus, once hidden, widgets must not be shown again. */
DEBUG_LOG(m_logger) << "------------------setUiValues-----------------";
if (!m_dtc || !m_ftc || m_participant.id() < 0)
return false;
// m_showPvSan = LtsUtils::ProjectSettings::isFunctionEnabled(QStringLiteral("ParticipantInformation"),
// QStringLiteral("HasPvSan"));
m_ui->pbTarget->setVisible(false);
@@ -211,18 +221,18 @@ bool ParticipantInfoDialog::setUiValues()
m_ui->pbSetInjury->setVisible(false);
m_ui->pbSetSanitation->setVisible(false);
//hide findOnMap if no interface available
m_ui->pbFindOnMap->setVisible(m_sitMapGuiIfc != nullptr);
m_ui->pbMovementTrack->setVisible(m_sitMapGuiIfc != nullptr);
m_ui->tbNbc->setVisible(false);
m_ui->tbNbc->setVisible(false); //show only if visible
// m_participant.id() was given within ctor
const Participant participantData = m_dtc->participant(m_participant.id());
const Type type = m_dtc->type(participantData.typeId());
m_typeClass = type.typeClass();
// uas stuff
const bool isUas = m_dtc->isTypeUas(participantData.typeId());
DEBUG_LOG(m_logger) << "------------------UAS-----------------"
<< " isTypeUas" << isUas
@@ -241,23 +251,23 @@ bool ParticipantInfoDialog::setUiValues()
m_ftc->enableModifyUasState();
}
// participant might not even be linked to a uas (which isn't even obvious for the operator), so in that case default texts would be shown
m_ui->lblBatteryStatus->setText(QStringLiteral("-"));
m_ui->lblOperatingMode->setText(QStringLiteral("-"));
onUasChanged(uas);
// hide all widgets (and labels) that are not available for uas:
m_ui->pbBite->setVisible(false);
m_ui->pbMessage->setVisible(false);
// these are not supported yet, therefore hidden:
m_ui->lblBatteryStatus->setVisible(false);
m_ui->lbBatteryStatus->setVisible(false);
}
else
else // not a uas
{
// hide all uas specific widgets (and labels):
m_ui->lblBatteryStatus->setVisible(false);
m_ui->lbBatteryStatus->setVisible(false);
m_ui->lblOperatingMode->setVisible(false);
@@ -267,9 +277,9 @@ bool ParticipantInfoDialog::setUiValues()
if (m_typeClass != TypeClass::Human)
m_ui->lbKind->setText(tr("Damage Type:"));
m_ui->lbKind->setText(tr("Damage Type:")); // translates "Beschaedigungs" for non-Humans.
else
m_ui->lbKind->setText(tr("Kind:"));
m_ui->lbKind->setText(tr("Kind:")); // translates "Verwundung" for Humans.
bool bUpdateDynamicParticipantData = true;
switch (m_typeClass.underlying())
@@ -301,7 +311,7 @@ bool ParticipantInfoDialog::setUiValues()
const int32_t participantId = m_participant.id();
m_ui->pbMovementTrack->setChecked(m_sitMapGuiIfc->isMovementTrackEnabled(participantId));
// set MovementTrackCallback:
std::function<void(const QVector<int32_t> &activeSimIds)> onMovementTrackChangedFunc = [this, participantId](const QVector<int32_t> &activeSimIds)
{
bool checkedNew = activeSimIds.contains(participantId);
@@ -326,7 +336,7 @@ bool ParticipantInfoDialog::setUiValues()
m_symbolAppearanceSettings->addChangedCallback(this);
}
//a unit never has a history
m_ui->pbHistory->hide();
m_ui->lblEquipNr->hide();
m_ui->lbEquipNr->hide();
@@ -348,7 +358,7 @@ bool ParticipantInfoDialog::setUiValues()
}
case TypeClass::Vessel:
case TypeClass::Unknown:
ERROR_LOG(m_logger) << Q_FUNC_INFO << m_typeClass;
ERROR_LOG(m_logger) << LOGFUNCTION << m_typeClass;
return false;
}
@@ -376,7 +386,7 @@ bool ParticipantInfoDialog::setUiValues()
m_typeClass != TypeClass::Unit &&
m_typeClass != TypeClass::SupportUnit);
//other connects
connect(m_dtc.get(), &Interface::Dtc::typeChanged,
this, &ParticipantInfoDialog::onTypeChanged, Qt::UniqueConnection);
connect(m_dtc.get(), &Interface::Dtc::dynamicParticipantDataChanged,
@@ -384,9 +394,9 @@ bool ParticipantInfoDialog::setUiValues()
connect(m_session, &LtsSession::LtsSession::partitionTimeChanged,
this, &ParticipantInfoDialog::onPartitionTimeChanged, Qt::UniqueConnection);
if (m_session->app() == LtsAppDescriptor::App::OC)
if (m_session->app() == LtsAppDescriptor::App::OC) // is the plugin loaded by the OC-App?
{
// hide several unused Buttons
m_ui->pbBite->hide();
m_ui->pbHistory->hide();
m_ui->pbMessage->hide();
@@ -395,7 +405,7 @@ bool ParticipantInfoDialog::setUiValues()
m_ui->pbSetSanitation->hide();
}
if (m_session->isReplayPartition())
if (m_session->isReplayPartition()) // is replay?
{
m_ui->pbSetStatus->hide();
m_ui->pbMessage->hide();
@@ -421,8 +431,8 @@ bool ParticipantInfoDialog::setUiValues()
m_isTarget = (eqType.wmsTypeClass() == WmsTypeClass::TargetHuman ||
eqType.wmsTypeClass() == WmsTypeClass::TargetVehicle);
// m_isTarget = 1;
// initTargetConfigL400(/*m_isTarget*/ true);
initTargetConfig(m_isTarget);
m_ui->twGear->setColumnHidden(0, m_isTarget);
@@ -460,20 +470,50 @@ bool ParticipantInfoDialog::setUiValues()
setOnlineHelpFilename(QStringLiteral("Info_Dialog-Unit"));
break;
case TypeClass::Unknown:
ERROR_LOG(m_logger) << Q_FUNC_INFO << m_typeClass;
ERROR_LOG(m_logger) << LOGFUNCTION << m_typeClass;
}
#if LTS_DEBUG
//-- start Test Gui Elment plugin
auto cb = [this](const LtsPluginManager::PluginInstance &pi) { return loadGuiElementPLugin(pi);};
LtsPluginManager::LtsPluginLoader::getInstance()->loadPlugins(LtsPluginManager::PluginType::GUI_ELEMENT,
cb,
QStringList());
//-- end Test Gui Element plugin
#endif
return true;
}
bool ParticipantInfoDialog::loadGuiElementPLugin(const LtsPluginManager::PluginInstance &pi)
{
WARNING_LOG(m_logger)<<">>>> GUI Element pluginName: "<<pi.fileName;
GuiElementInterface *guiElement = qobject_cast<GuiElementInterface *>(pi.plugin);
if (guiElement->pluginName() == QStringLiteral("KeyValueGuiElement_XY"))
{
if (!guiElement->init(m_session, m_participant.id()))
return false;
m_ui->gridLayout_2->addWidget(guiElement->createGuiElement(this));
return true;
}
return false;
}
//SLOTS
void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicParticipantData &data, DataModification modType)
{
if (data.participantId() != m_participant.id() && data.participantId() != 0)
return;
// Do not continue on modType == DataModification::eRemove
// otherwise for example the icon would look bad (clover with black on black...)
if (modType == DataModification::eRemoved)
{
if (m_ui->lblIcon != nullptr)
@@ -484,7 +524,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
if (m_ui->lblIcon != nullptr)
m_ui->lblIcon->setEnabled(true);
//Current State
qWarning() << "stateHistory count" << data.stateHistory().size();
bool contaminationListIsEmpty = true;
if (!data.stateHistory().empty())
@@ -493,9 +533,9 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries :
ProjectDataManagement::VulnerabilityClass_def::VehicleDamages;
//#define FAKE_HISTORY
#ifdef FAKE_HISTORY
// fake history, where all sis have the same stateTime
std::vector<ParticipantManagement::StateInformation> history;
if (!data.stateHistory().empty())
@@ -513,9 +553,9 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
const auto &history = data.stateHistory();
#endif
StateInformation lastState = m_dtc->youngestStateInformation(history );;
//LasState is the last "real" state, that has a VBG <=8 (Castastrophic)
//It's not the last state received, as there can be other state changes like Sanitation, or NearMiss
StateInformation lastState = m_dtc->youngestStateInformation(history/*, true*/ /* debug */);;
StateInformation youngestState;
youngestState.stateTime(0);
for (const StateInformation &si : history)
@@ -529,14 +569,14 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
// const bool showPvSan = LtsUtils::ProjectSettings::isFunctionEnabled(QStringLiteral("ParticipantInformation"),
// QStringLiteral("HasPvSan"));
m_ui->lblStatus->setText(ProjectDataManagement::toString(lastState.vulnerabilityState(), vc));
//vitality
DEBUG_LOG(m_logger)<<" >>> last state: "<<lastState.vitality() << "last kind: " <<lastState.vulnerabilityKindId();
m_ui->lblVitality->setText(QString::number(lastState.vitality()) + QStringLiteral("%"));
// Set Contamination
const int NCONTAMINATION = 0x4000;
const int BCONTAMINATION = 0x8000;
const int CCONTAMINATION = 0x10000;
@@ -582,24 +622,24 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
m_ui->lblContamination->setText(contaminationList.join(QStringLiteral("+")));
if (lastState.vulnerabilityKindId() == 459286 && !((lastState.vulnerabilityBits() >> 7) & 1))
// VBA
//AG 40 HACK!
if (lastState.vulnerabilityKindId() == 459286 && !((lastState.vulnerabilityBits() >> 7) & 1)) // VBG7 NOT set in history bits, but kind id still implying that VBG7 is still active
m_ui->lblKind->setText(QLatin1String("-"));
else
m_ui->lblKind->setText(m_pdmDtc->trVulnerabilityKindName(lastState.vulnerabilityKindId(), vc));
if (m_showPvSan && vc == ProjectDataManagement::VulnerabilityClass_def::SoldierInjuries )
{
if (lastState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady )
if (lastState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady ) //Maybe there is some side effect to this like
//if (data.stateHistory().size() == 1 && lastState.vulnerabilityState() == ProjectDataManagement::VulnerabilityState::CombatReady)
{
QPalette pal = QApplication::palette(m_ui->lbKind);
m_ui->lblKind->setPalette(pal);
// m_ui->lblVitality->setText(QString::number(100) + QStringLiteral("%")); fixed in PPM-Service
}
else
{
setSanitationLabelColor(data.stateHistory().at(data.stateHistory().size()-1).sanitationResult());
setSanitationLabelColor(/*m_dtc->proceduresDone(data.stateHistory())*/data.stateHistory().at(data.stateHistory().size()-1).sanitationResult());
}
}
}
@@ -618,7 +658,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
DEBUG_LOG(m_logger)<< "setBackgroundColor ="<< data.manipulation().size();
setBackgroundColor(m_ui->lblEquipNr, Qt::red, data.manipulation().size());
// Special Sensor State
if (!data.specialSensorDataState())
{
m_ui->stackSpecialSensor->hide();
@@ -628,8 +668,13 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
{
if (m_typeClass == TypeClass_def::Aircraft)
{
/*
CTC_Apache_Sensor_DiffCorrections = 0x01, // Has GPS Differential Corrections
CTC_Apache_Sensor_RadarJammer = 0x02, // APR 39
CTC_Apache_Sensor_IRJammer = 0x04, // ALQ 144
CTC_Apache_Sensor_RadarDetector = 0x08, // ALQ 136
CTC_Apache_Sensor_LaserSensor = 0x10 // AVR2A
*/
m_ui->stackSpecialSensor->setCurrentWidget(m_ui->stackPageAircraft);
m_ui->ledRadarJammer->setStatus(data.specialSensorDataState() & 0x02);
@@ -646,11 +691,25 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
m_ui->stackSpecialSensor->show();
}
// Gear Tabelle für Steilfeuer allgemein verstecken //[GUEZE-2871]
bool showForArtillery = true;
/*
#ifndef LTS_DEBUG
const Participant participantData = m_dtc->participant(m_participant.id());
const Type type = m_dtc->type(participantData.typeId());
const QString jsData = QString::fromStdString(type.properties()).trimmed();
DEBUG_LOG(m_logger)<<">>> >>> properties: "<<jsData<<" /// typeId: "<<type.id();
if(!jsData.isEmpty())
{
const QJsonObject &typObj = QJsonDocument::fromJson(QByteArray::fromStdString(jsData.toStdString())).object();
if (!typObj.isEmpty() && typObj[QStringLiteral("isArtillery")].toBool(false))
{
showForArtillery = false;
}
}
#endif
*/
//Gear
if (data.gear().size() == 0 )
{
m_gearList.clear();
@@ -665,7 +724,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
{
m_gearList = data.gear();
std::vector<GearInformation> tmpGearList = m_gearList;
std::sort(tmpGearList.begin(), tmpGearList.end(), &compareGear);
std::sort(tmpGearList.begin(), tmpGearList.end(), &compareGear); //sort
m_ui->twGear->show();
m_ui->pbGearRanges->show();
@@ -682,7 +741,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
for (const GearInformation &gearInfo : tmpGearList)
{
QTableWidgetItem *item = nullptr;
if (gearInfo.chargeTypeId() == 0)
if (gearInfo.chargeTypeId() == 0) //chargTypeId 0 is near miss code
{
rowCount--;
continue;
@@ -693,8 +752,8 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
item = new QTableWidgetItem(tr("Unknown gear id %1").arg(gearTypeId & ~unknownTasId));
else if (gearTypeId == 0)
{
// Hack for old systems which neither send gearTasCode/gearType nor gearSerialNumber/gearId
// 1 = Wanne, 2 = Turm
switch (gearInfo.gearId())
{
case 1:
@@ -717,27 +776,27 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
{
item->setIcon(QIcon(QLatin1String("icon:service.svg")));
}
// If it's the same gearId, don't set the item, but make a row span to the one(s) before.
int rowStart = row - 1;
while (rowStart >= 0)
{
QTableWidgetItem *oldItem = m_ui->twGear->item(rowStart, 0);
if (oldItem == nullptr)
QTableWidgetItem *oldItem = m_ui->twGear->item(rowStart, 0); //Item above
if (oldItem == nullptr)// not set due to rowSpan...
break;
if (oldItem->data(Qt::UserRole).toInt() != gearInfo.gearId() ||
oldItem->text() != item->text())
if (oldItem->data(Qt::UserRole).toInt() != gearInfo.gearId() || // Different gearId
oldItem->text() != item->text()) // Different Text (if gearId not set...)
break;
--rowStart;
}
if (rowStart + 1 < row)
{
m_ui->twGear->setItem(row, 0, item);
m_ui->twGear->setItem(row, 0, item); //Need to be set, because of the check above
m_ui->twGear->setSpan(rowStart + 1, 0, row - rowStart, 1);
}
else
m_ui->twGear->setItem(row, 0, item);
if (gearInfo.chargeTypeId() != 0 && gearInfo.chargeTypeId() != -1)
if (gearInfo.chargeTypeId() != 0 && gearInfo.chargeTypeId() != -1) // hat Charge (and ignore only chargecounts)
{
int chargeTypeId = gearInfo.chargeTypeId();
if ((chargeTypeId & unknownTasId) == unknownTasId)
@@ -750,12 +809,12 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
item->setToolTip(m_pdmDtc->trChargeTypeName(chargeTypeId, true));
}
m_ui->twGear->setItem(row, 1, item);
//ressourceCount
//: Blank in this case refers to blank ammunition used for training
// Chris didn't wanted the chargeCounting Flag like: If they don't make it right why should we do it?
// presevred old mode so just in case..
//UAE wepaons don't send needed telegrams.. so let's hack again..
// in order to avoid the faulty SALTs let's hope they never send remaining ammunition below 100...
#ifdef GUEZ_MODE
item = new QTableWidgetItem((gearInfo.remain() < 0) ? tr("N/A", "Blank Ammunition") : QString::number(gearInfo.remain()));
#else
@@ -780,13 +839,13 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
}
m_ui->twGear->setRowCount(rowCount);
m_ui->twGear->resizeColumnsToContents();
// Avoid shrinking last column (2): It'll auto-stretch afterwards
m_ui->twGear->horizontalHeader()->resizeSection(2, 42);
m_ui->twGear->setColumnHidden(0, m_isTarget);
m_ui->twGear->setColumnHidden(1, m_isTarget);
}
} //end Gear
if (!showForArtillery)
{
m_ui->twGear->hide();
@@ -797,7 +856,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
DEBUG_LOG(m_logger) << "### data.participantId(): " << data.participantId();
DEBUG_LOG(m_logger) << "### data.sampleTime(): " << data.sampleTime();
//sanMat
if (data.sanitationMaterialStock().size() == 0)
{
m_sanMatStock.clear();
@@ -817,7 +876,7 @@ void ParticipantInfoDialog::onDynamicParticipantDataChanged(const DynamicPartici
m_sanMatStock = data.sanitationMaterialStock();
std::vector<SanitationMaterial> tmpSanMatStock = m_sanMatStock;
std::sort(tmpSanMatStock.begin(), tmpSanMatStock.end(), &compareSanMat);
std::sort(tmpSanMatStock.begin(), tmpSanMatStock.end(), &compareSanMat); //sort
m_ui->twSanMat->clearContents();
@@ -942,7 +1001,7 @@ void ParticipantInfoDialog::showSpecialSensorData(int specialSensorData)
if ((specialSensorData & (1 << 11)) != 0)
strSpecialSensorData += QStringLiteral(" F");
if (specialSensorDataState == 66)
if (specialSensorDataState == 66) // CSF Spürbetrieb
{
const int type = (specialSensorData >> 12) & 0x0F;
strSpecialSensorData += QLatin1Char(' ');
@@ -974,7 +1033,7 @@ void ParticipantInfoDialog::showSpecialSensorData(int specialSensorData)
default:
break;
}
if (type == 4)
if (type == 4) // CSF
{
const int nbcType = (specialSensorData >> 16) & 0x03;
strSpecialSensorData += QLatin1Char(' ');
@@ -1023,7 +1082,7 @@ void ParticipantInfoDialog::onPositionChanged(const ParticipantPosition &positio
{
if (room.id() == position.roomId())
{
// In the case of external OPS transmitters, the building name was output twice
if ( room.structureElementTypeId() != InfrastructureManagement::StructureElementType_def::Room )
continue;
roomName = QString::fromStdString(room.displayName());
@@ -1060,7 +1119,7 @@ void ParticipantInfoDialog::onPositionChanged(const ParticipantPosition &positio
connect(m_ui->pbMounted, &QToolButton::clicked, this, &ParticipantInfoDialog::onMountedParticipants);
}
// hide button when both are not set
if (!position.mountedOn().is_set() && !position.mountedParticipants().is_set())
m_ui->pbMounted->hide();
@@ -1112,8 +1171,8 @@ void ParticipantInfoDialog::onParticipantChanged(const Participant &participant,
if (participant.id() != m_participant.id())
return;
// Do not continue on modType == DataModification::eRemove
// otherwise for example the icon would look bad (clover with black on black...)
if (modType == DataModification::eRemoved)
return;
@@ -1121,7 +1180,7 @@ void ParticipantInfoDialog::onParticipantChanged(const Participant &participant,
{
m_ui->lblType->setText(ParticipantManagement::trTypeName(m_dtc->type(participant.typeId()).name()));
TypeClass typeClass = m_dtc->type(participant.typeId()).typeClass();
// If TypeClass changes, close window. Shouldn't ever happen, but for initialization.
if (m_typeClass != TypeClass_def::Unknown && m_typeClass != typeClass)
{
m_buttonBox->getButton(LtsWidgets::DialogButton::Close)->click();
@@ -1146,7 +1205,7 @@ void ParticipantInfoDialog::onParticipantChanged(const Participant &participant,
m_ui->lblEquipNr->setToolTip(QString::number(m_participant.id()));
#endif
//hide Info if not exists
m_ui->lblInfoText->setText(QString::fromStdString(m_participant.info()));
m_ui->lblInfoText->setVisible(m_participant.info().size() > 0);
m_ui->lblInfo->setVisible(m_participant.info().size() > 0);
@@ -1222,8 +1281,8 @@ void ParticipantInfoDialog::setSanitationLabelColor(SanitationResult proceduresD
void ParticipantInfoDialog::setKindVisible(bool bVisible)
{
// const bool showVulnerabilityKindProject = LtsUtils::ProjectSettings::isFunctionEnabled(QStringLiteral("ParticipantInformation"),
// QStringLiteral("ShowVulnerabilityKind"));
if (!m_showVulnerabilityKindProject)
bVisible = false;
@@ -1231,8 +1290,12 @@ void ParticipantInfoDialog::setKindVisible(bool bVisible)
m_ui->lbKind->setVisible(bVisible);
}
/*!
* \brief ParticipantInfoDialog::setBottomSpacerVisibility
* \param isOneListActive
* \details If Weapon Table or/and SanMat table is visible -> Hide Bottom Spacer
* \author Niklas Schmidt
*/
void ParticipantInfoDialog::setBottomSpacerVisibility(bool isOneListActive)
{
@@ -1300,7 +1363,7 @@ void ParticipantInfoDialog::setBackgroundColor(QWidget *w, Qt::GlobalColor col
}
else
{
// reset to default palette
w->setPalette(QApplication::palette(w));
w->setAutoFillBackground(false);
}
@@ -1338,14 +1401,14 @@ void ParticipantInfoDialog::onOpenHistory()
if (!m_aesDtc)
return;
// {
// ParticipantTargetConfigurationDialog* diag = new ParticipantTargetConfigurationDialog(this);
// if (diag->init(m_participant.id(), m_dtc, m_ftc, /*m_pdmDtc,*/ m_sitMapGuiIfc))
// addDialog(diag, m_menuGroup, QStringLiteral("ParticipantHistory") + QString::number(m_participant.id()), LtsWidgets::LayoutArea::eDialogTab);
// else
// delete diag;
// }
// return;
ParticipantHistoryDialog *diag = new ParticipantHistoryDialog(this);
@@ -1431,9 +1494,9 @@ void ParticipantInfoDialog::onGearRanges()
m_sitMapGuiIfc->enableGearRanges(m_participant.id(), m_ui->pbGearRanges->isChecked());
}
///////////////////////////////////////////////
/// Target
///////////////////////////////////////////////
bool ParticipantInfoDialog::initTargetConfig(bool bShow)
{
if (bShow)
@@ -1443,13 +1506,13 @@ bool ParticipantInfoDialog::initTargetConfig(bool bShow)
m_ui->pbSetInjury->hide();
m_ui->pbSetSanitation->hide();
// Combobox Weapon:
// TODO woher kommen die Waffen?
m_ui->cbTargetWeapon->addItem(QStringLiteral("AK47"), 1);
m_ui->cbTargetWeapon->addItem(QStringLiteral("Pistol"), 5);
m_ui->cbTargetWeapon->addItem(QStringLiteral("Shotgun"), 7);
// Combobox Mode:
m_ui->cbTargetMode->addItem(TargetManagement::toString(TargetManagement::Mode_def::Deactivated),
TargetManagement::Mode_def::Deactivated);
m_ui->cbTargetMode->addItem(TargetManagement::toString(TargetManagement::Mode_def::ShootBack),
@@ -1515,7 +1578,7 @@ void ParticipantInfoDialog::onTargetConfig()
return m_tgtFtc->configureTargetRequest(request, this);
};
m_requestHelper->startSingleRequest(cb);
}
} // end of onTargetConfig
void ParticipantInfoDialog::onTargetConfigChanged(const TargetManagement::TargetConfig &data, DataModification modType)
{
@@ -1532,7 +1595,7 @@ void ParticipantInfoDialog::onTargetConfigChanged(const TargetManagement::Target
m_ui->cbTargetWeapon->setVisible(true);
m_ui->cbTargetMode->setCurrentIndex(m_ui->cbTargetMode->findData(data.mode().underlying()));
m_ui->cbTargetWeapon->setCurrentIndex(m_ui->cbTargetWeapon->findData(data.weapon()));
}
} // end of onTargetConfigChanged
void ParticipantInfoDialog::onTargetModeChangeed()
{
@@ -1577,7 +1640,7 @@ void ParticipantInfoDialog::onTargetWeaponChanged()
void ParticipantInfoDialog::onOpenTargetConfigurationL400()
{
// ParticipantTargetConfigurationDialog -> L400
ParticipantTargetConfigurationDialog* diag = new ParticipantTargetConfigurationDialog(this);
if (diag->init(m_participant.id(), m_dtc, m_ftc, m_sitMapGuiIfc))
addDialog(diag, m_menuGroup, QStringLiteral("TargetConfigurationL400") + QString::number(m_participant.id()), LtsWidgets::LayoutArea::eDialogTab);
@@ -1606,12 +1669,12 @@ void ParticipantInfoDialog::onContextMenuRequested(const QPoint &position)
actions << restockNowAction;
}
// if (m_pdmDtc->canSetDefaults(gear.gearTypeId()))
// {
// QAction *restockDefaultsAction = new QAction(tr("Restock Defaults"), this);
// connect(restockDefaultsAction, &QAction::triggered, this, [=](){ onRestockDefaults(gear.gearId(), gear.gearTypeId()); });
// actions << restockDefaultsAction;
// }
if (actions.isEmpty())
return;
@@ -1641,25 +1704,25 @@ void ParticipantInfoDialog::onRestockDefaults(int gearId, int gearTypeId)
void ParticipantInfoDialog::onUasChanged(const UAS &uas)
{
// check if changed uas is this uas, on this participant, in this exercise
if (uas.id() != m_uasId || uas.exerciseId() != m_session->exerciseId() || uas.participantId() != m_participant.id())
{
return;
}
// set text & text color for uas operating mode
const QString operatingMode(ProjectDataManagement::toString(uas.uasState()));
static const QString textHtml { QStringLiteral("<font color='%1'>%2</font>") };
switch (uas.uasState().underlying())
{
case ProjectDataManagement::UasState::UasState_Auto:
case ProjectDataManagement::UasState::Auto:
{
m_ui->lblOperatingMode->setText(textHtml.arg(QStringLiteral("green")).arg(operatingMode));
break;
}
case ProjectDataManagement::UasState::UasState_Manual:
case ProjectDataManagement::UasState::Manual:
{
m_ui->lblOperatingMode->setText(textHtml.arg(QStringLiteral("orange")).arg(operatingMode));
break;
@@ -1700,4 +1763,4 @@ void ParticipantInfoDialog::onUnlockUAS()
m_requestHelper->startSingleRequest(cb);
}
}
} // namespace ParticipantManagement
@@ -1,23 +1,29 @@
/**
* @RDE_HEADER@
* HMI Plugin for ParticipantManagement - TlnInfoDialog
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Ehrlicher, SLSE, 2016-02-29
*/
#pragma once
//Lts
#include <LtsWidgets/lts_dialog.h>
#include <LtsSession/lts_session.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <LtsUtilsGuiDds/request_helper.h>
#include <AdvancedSymbology/asb_data_plugin_interface.h>
//Asb
#include <Plugins/AdvancedSymbology/asb_data_plugin_interface.h>
//ParticipantManagement
#include <ParticipantManagement/logger.h>
#include <ParticipantManagement/ppm_participant_info_gui_plugin_interface.h>
#include <ParticipantManagement/ppm.hpp>
//DDS
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm_ftc.h>
#include <ProjectDataManagement/pdm_data_plugin_interface.h>
@@ -26,18 +32,18 @@
#include <FilterManagement/flt_participant_plugin_interface.h>
#include <FilterManagement/flt_symbol_appearance_settings.h>
//SituationMap
#include <Plugins/SituationMapPlugin/situation_map_gui_plugin_interface.h>
#include <SituationMapPlugin/situation_map_gui_plugin_interface.h>
//AES
#include <AreaEffectSimulation/aes_data_plugin_interface.h>
// TargetManagement
#include <TargetManagement/tgt_dtc.h>
#include <TargetManagement/tgt_ftc.h>
#include <TargetManagement/tgt_ftc_types.h>
//Qt
namespace Ui
{
@@ -54,9 +60,9 @@ namespace ParticipantManagement
class ParticipantInfoLtdGearComponent;
// --------------------------------------------------------
// ParticipantInfoDialog
// --------------------------------------------------------
class ParticipantInfoDialog final : public LtsWidgets::LtsDialog
, protected FilterManagement::SymbolAppearanceSettings::SettingsChangedCallback
, protected TargetManagement::Interface::Ftc::ConfigureTargetReplyHandler
@@ -85,7 +91,6 @@ signals:
private:
NGL::INGLLogger &m_logger;
void retranslate() override;
bool setUiValues();
static void setBackgroundColor(QWidget *w, Qt::GlobalColor color, bool bSetColor);
@@ -101,10 +106,11 @@ private:
void setMessageVisible(bool bVisible);
void onSymbolAppearanceSettingsChanged(FilterManagement::SymbolAppearanceSettings::Part part) override;
QString approachingAngle(const QPointF &centerPoint, double direction, double distance, int mseId) const;
// Target (Qatar?)
bool initTargetConfig(bool bShow);
// Target (L400)
bool initTargetConfigL400(bool bShow);
bool loadGuiElementPLugin(const LtsPluginManager::PluginInstance &pi);
private Q_SLOTS:
@@ -137,19 +143,18 @@ private Q_SLOTS:
void onRestockDefaults(int gearId,int gearTypeId);
void onRestockNow(int gearId,int gearTypeId);
// Target (Qatar?)
void onTargetConfig();
void onTargetConfigChanged(const TargetManagement::TargetConfig &data, DataModification modType);
void onTargetModeChangeed();
void onTargetWeaponChanged();
// Target (L400)
void onOpenTargetConfigurationL400();
private:
NGL::INGLLogger &m_logger;
Participant m_participant;
int m_uasId;
int m_uasId; // Needed to release uas again.
qint64 m_lastPositionMSec;
TypeClass m_typeClass;
std::vector<GearInformation> m_gearList;
@@ -181,5 +186,6 @@ private:
bool m_isTarget;
bool m_showPvSan{false};
bool m_showVulnerabilityKindProject{false};
LOGGER_T m_logger;
};
}
} // namespace ParticipantInfo
@@ -1,20 +1,26 @@
/**
* @RDE_HEADER@
* ParticipantManagement - Party Edit Dialog
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-11-11
*/
#include "ppm_party_edit.h"
#include "NGLLogger/INGLLogger.h"
#include "ui_ppm_party_edit.h"
#include <QtWidgets/QColorDialog>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonArray>
#include <QtWidgets/QMessageBox>
#include <QColorDialog>
#include <QJsonDocument>
#include <QJsonArray>
#include <QMessageBox>
#include <ParticipantManagement/ppm_translation.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
#include <Plugins/ParticipantManagement/ppm_data_plugin_interface.h>
#include <LtsUtilsSettings/settings.h>
#include <LtsSession/lts_session_data.h>
#include <AreaEffectSimulation/aes_operator_rights.h>
#include <Services/AreaEffectSimulation/aes_operator_rights.h>
namespace ParticipantManagement
{
@@ -34,20 +40,21 @@ PartyEdit::PartyEdit(QWidget *parent)
, m_requestHelper(new LtsUtils::RequestHelper(this))
, m_session(nullptr)
, m_ui(new Ui::PartyEdit)
, m_logger(getLogger("PartyEdit"))
{
m_ui->setupUi(this);
}
} // end of ctor()
//-----------------------------------------------------------------------------
PartyEdit::~PartyEdit()
{
delete m_ui;
}
} // end of dtor()
//-----------------------------------------------------------------------------
void PartyEdit::retranslate()
{
translate(m_ui, m_dtc->party(m_partyId), tr("Party"));
translate(m_ui, m_dtc->party(m_partyId), trPartyName(m_dtc->party(m_partyId).name()), tr("Party"));
m_ppmGuiCbxIfc->fillRoleComboBox(m_ui->cbRole);
m_ppmGuiCbxIfc->fillHlaForceIdentifierComboBox(m_ui->cbHlaForceIdentifier);
}
@@ -88,7 +95,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
m_ppmGuiCbxIfc->fillRoleComboBox(m_ui->cbRole);
m_ppmGuiCbxIfc->fillHlaForceIdentifierComboBox(m_ui->cbHlaForceIdentifier);
if (m_partyId >= 0)
if (m_partyId >= 0) // pool has id 0 so is a valid party
{
const Party &party = m_dtc->party(m_partyId);
if(party.id() >= 0)
@@ -107,7 +114,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
m_ui->cbHlaForceIdentifier->hide();
}
// Could be filled programmatically later
m_ui->cbAdlerNotification->setProperty("Notification", NotificationManagement::NotificationType::AdlerNotification);
m_ui->cbCombatOrder->setProperty("Notification", NotificationManagement::NotificationType::CombatOrder);
@@ -132,7 +139,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
connect(m_ui->tbResetAdlerConnection, &QToolButton::clicked, this, &PartyEdit::onResetAdlerConnectionClicked);
connect(m_dtc.get(), &ParticipantManagement::Interface::Dtc::partyChanged, this, &PartyEdit::onPartyChanged);
// check Notifications
notificationCheck();
setOnlineHelpFilename(QStringLiteral("Situation-Parties"));
@@ -140,7 +147,7 @@ bool PartyEdit::init(int partyId, LtsSession::LtsSession *session)
return true;
}
//slots
bool PartyEdit::apply()
{
if (!m_partiallyUnchangeable)
@@ -253,7 +260,7 @@ void PartyEdit::onPartyChanged(const Party &data, DataModification modType)
}
//private
void PartyEdit::setData(const Party &party)
{
@@ -269,7 +276,7 @@ void PartyEdit::setData(const Party &party)
void PartyEdit::setColorToButton(QToolButton *button, const QColor &color)
{
button->setStyleSheet(QStringLiteral("QToolButton{ background: %1; }").arg(color.name()));
button->setStyleSheet(QStringLiteral("QToolButton{ background: %1; }").arg(color.name())); // TODO: muss das sein?
}
void PartyEdit::fillJsonSuppressNotifications( QJsonArray &notif, NotificationManagement::NotificationType notifType)
@@ -381,8 +388,8 @@ void PartyEdit::notificationCheck()
m_ui->cbAdlerNotification->setCheckState(Qt::Checked);
m_ui->cbCombatOrder->setCheckState(Qt::Checked);
// Here add another NotificationType, everything else will happen automatically
// CheckBox insert in Ui
const QList<NotificationManagement::NotificationType> notifTypes { NotificationManagement::NotificationType_def::AdlerNotification,
NotificationManagement::NotificationType_def::CombatOrder};
@@ -407,11 +414,11 @@ void PartyEdit::notificationCheck()
void PartyEdit::modifyPartyProperties()
{
DEBUG_LOG(m_logger) << Q_FUNC_INFO;
DEBUG_LOG(m_logger) << LOGFUNCTION;
ParticipantManagement::Party requestParty;
requestParty = m_dtc->party(m_partyId);
// Get properties and then update them
const QJsonObject &origObj = QJsonDocument::fromJson(requestParty.properties().c_str()).object();
QJsonObject adlerPropertiesObj = origObj[QStringLiteral("Adler")].toObject();
adlerPropertiesObj[QStringLiteral("saaConnectedState")] = ParticipantManagement::ConnectState::Disconnecting;
@@ -1,20 +1,26 @@
/**
* @RDE_HEADER@
* HMI Plugin for ParticipantManagement - Party Overview Model
* $Id$
* $HeadURL$
* $Author$
* Created by Patric Karwat, SLSE, 2016-11-11
*/
#include "ppm_party_model.h"
#include <OperatorManagement/opm_data_plugin_interface.h>
#include <ParticipantManagement/ppm_data_plugin_interface.h>
#include <LtsSession/lts_session_data.h>
#include <ParticipantManagement/ppm_translation.h>
#include <QtGui/QColor>
#include <QtCore/QJsonDocument>
#include <QtCore/QJsonObject>
#include <QColor>
#include <QJsonDocument>
#include <QJsonObject>
namespace ParticipantManagement
{
//---------------------------------
// PartyModel
//---------------------------------
PartyModel::PartyModel(QObject *parent)
: LtsWidgets::LtsAbstractTableModel<ParticipantManagement::Party>({tr("Id"),
tr("Name"),
@@ -27,6 +33,7 @@ PartyModel::PartyModel(QObject *parent)
tr("Szenar Name")},
parent)
, m_ppmDtc(nullptr)
, m_logger(getLogger("PartyModel"))
{}
bool PartyModel::initModel(LtsSession::LtsSession *session)
@@ -49,7 +56,7 @@ bool PartyModel::initModel(LtsSession::LtsSession *session)
m_operatorId = LtsSessionData::LtsSessionData::getInstance()->getOperatorId();
m_ppmDtc->partys([this](const ParticipantManagement::Party &party)
{
if (hasParty(party))
if (hasParty(party)) // opm_operator_exercise -> visible_parties
insertRow(party);
});
return true;
@@ -98,14 +105,11 @@ QVariant PartyModel::data(const QModelIndex &index, int role) const
QString connectState;
switch (status.underlying())
{
case ParticipantManagement::ConnectState::Connected:
connectState = tr("Connected");
break;
case ParticipantManagement::ConnectState::NoHeartbeat:
connectState = tr("No Heartbeat");
case ParticipantManagement::ConnectState::Undefined:
connectState = QStringLiteral("");
break;
default:
connectState = QStringLiteral("");
connectState = ParticipantManagement::toString(status);
break;
}
return connectState;
@@ -150,7 +154,7 @@ bool PartyModel::hasParty(const Party &party) const
{
if (exerciseParties.exerciseId() != m_session->exerciseId())
continue;
if (!exerciseParties.visibleParties().is_set())
if (!exerciseParties.visibleParties().is_set()) //has_value not support on windows yet so we need depricated is_set
return false;
for (const auto &partyId : exerciseParties.visibleParties().get())
if (partyId == party.id())
@@ -167,7 +171,7 @@ bool PartyModel::isPartyHidden(const Party &party) const
{
if (exerciseParties.exerciseId() != m_session->exerciseId())
continue;
if (!exerciseParties.hiddenParties().is_set())
if (!exerciseParties.hiddenParties().is_set()) //has_value not support on windows yet so we need depricated is_set
return false;
for (const auto &partyId : exerciseParties.hiddenParties().get())
if (partyId == party.id())
@@ -176,4 +180,4 @@ bool PartyModel::isPartyHidden(const Party &party) const
}
return false;
}
}
} // namespace ParticipantManagement