Close Schusstafel + KDChart plugin floors: cesPluginGeoPairing/OreOnlineReportsGuiPlugin in GROUP12 (presence-gated), image bakes KDChart

DDS member fixes (GeoPairing, OnlineReports charts/dialogs); FindKDChart/FindSchusstafel find-module wiring
This commit is contained in:
berrux-dev committed 2026-10-22 13:16:23 +02:00
1 parent e067c21b0d
commit fb3e91ea4b
9 files changed
+160 -45

No files matched your search

@@ -84,17 +84,17 @@ void DetailedChartModel::onDynamicParticipantDataChanged(const ParticipantManage
{
Q_UNUSED(modType);
const ParticipantManagement::StateInformation &stateInfo = m_config.ppmDtc->youngestStateInformation(data.stateHistory());
const ParticipantManagement::StateInformation &stateInfo = m_config.ppmDtc->youngestStateInformation(data.stateHistory);
if (!m_config.participantIds.contains(data.participantId()) ||
stateInfo.vulnerabilityState() > ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
if (!m_config.participantIds.contains(data.participantId) ||
stateInfo.vulnerabilityState > ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
return;
for (auto it = m_participantStates.begin(); it != m_participantStates.end(); ++it)
it.value() -= data.participantId();
it.value() -= data.participantId;
m_participantStates[stateInfo.vulnerabilityState()] += data.participantId();
m_participantStates[stateInfo.vulnerabilityState] += data.participantId;
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
}
@@ -113,7 +113,7 @@ DetailedChartModel::DetailedChartModel(const AbstractChartModel::ChartConfig &co
auto cb = [this](const ParticipantManagement::DynamicParticipantData & data)
{
if (!m_config.participantIds.contains(data.participantId()))
if (!m_config.participantIds.contains(data.participantId))
return;
onDynamicParticipantDataChanged(data, DataModification::eAdded);
};
@@ -56,18 +56,18 @@ void SimpleChartModel::onDynamicParticipantDataChanged(const ParticipantManageme
{
Q_UNUSED(modType);
if (!m_config.participantIds.contains(data.participantId()))
if (!m_config.participantIds.contains(data.participantId))
return;
const ParticipantManagement::StateInformation &stateInfo = m_config.ppmDtc->youngestStateInformation(data.stateHistory());
const ParticipantManagement::StateInformation &stateInfo = m_config.ppmDtc->youngestStateInformation(data.stateHistory);
DEBUG_LOG(m_logger) << "Participant id = " << data.participantId();
DEBUG_LOG(m_logger) << "State Info Vulnerability = " << stateInfo.vulnerabilityState();
DEBUG_LOG(m_logger) << "Participant id = " << data.participantId;
DEBUG_LOG(m_logger) << "State Info Vulnerability = " << static_cast<int>(stateInfo.vulnerabilityState);
if (stateInfo.vulnerabilityState() < ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
setCombatReady(data.participantId());
if (stateInfo.vulnerabilityState < ProjectDataManagement::VulnerabilityState::VulnerabilityState_CatastrophicKill)
setCombatReady(data.participantId);
else
setKilled(data.participantId());
setKilled(data.participantId);
emit dataChanged(index(0, 0), index(rowCount() - 1, columnCount() - 1));
}
@@ -76,7 +76,7 @@ SimpleChartModel::SimpleChartModel(const AbstractChartModel::ChartConfig &config
, m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger()) {
auto cb = [this](const ParticipantManagement::DynamicParticipantData & data)
{
if (!m_config.participantIds.contains(data.participantId()))
if (!m_config.participantIds.contains(data.participantId))
return;
onDynamicParticipantDataChanged(data, DataModification::eAdded);
};
@@ -160,10 +160,10 @@ bool CreateReportDialog::apply()
{
ParticipantManagement::ParticipantData data = m_participantModel->getParticipantData(index);
if (data.id() != 0 &&
data.equipmentNumber().has_value() &&
typeIds.contains(data.typeId()))
participantIds.insert(data.id());
if (data.id != 0 &&
data.equipmentNumber.has_value() &&
typeIds.contains(data.typeId))
participantIds.insert(data.id);
}
@@ -54,7 +54,7 @@ ReportDialog::ReportDialog(const AbstractChartModel::ChartConfig &config, QWidge
for (int32_t participantId :config.participantIds)
{
ParticipantManagement::Participant participant = config.ppmDtc->participant(participantId);
ParticipantManagement::TypeClass typeClass = config.ppmDtc->type(participant.typeId()).typeClass();
ParticipantManagement::TypeClass typeClass = config.ppmDtc->type(participant.typeId).typeClass;
participantIdsByTypeClass[typeClass] += participantId;
}
@@ -22,7 +22,7 @@ bool TypeModel::init()
{
m_ppmDtc->types([this](const ParticipantManagement::Type &type)
{
if (m_ppmDtc->isTypeInUse(type.id()))
if (m_ppmDtc->isTypeInUse(type.id))
insertRow(type);
});
@@ -33,7 +33,7 @@ int TypeModel::getTypeId(const QModelIndex &index) const
{
if (!indexIsValid(index))
return -1;
return m_vecData.at(index.row()).id();
return m_vecData.at(index.row()).id;
}
QVariant TypeModel::data(const QModelIndex &index, int role) const
@@ -46,9 +46,9 @@ QVariant TypeModel::data(const QModelIndex &index, int role) const
switch (index.column())
{
case 0:
return ParticipantManagement::toString(entry.typeClass());
return ParticipantManagement::toString(entry.typeClass);
case 1:
return QString::fromStdString(entry.name());
return QString::fromStdString(entry.name);
}
return QVariant();
}
@@ -56,8 +56,8 @@ QVariant TypeModel::data(const QModelIndex &index, int role) const
bool TypeModel::isFiltered(const ParticipantManagement::Type &data, DataModification modType) const
{
Q_UNUSED(modType);
return (data.typeClass() == ParticipantManagement::TypeClass::Unit ||
data.typeClass() == ParticipantManagement::TypeClass::SupportUnit);
return (data.typeClass == ParticipantManagement::TypeClass::Unit ||
data.typeClass == ParticipantManagement::TypeClass::SupportUnit);
}
}
@@ -136,24 +136,24 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
while (i.hasNext())
{
i.next();
SInt32 vulnerabilityState = i.value().vulnerabilityState;
Float64 lat = i.value().pos().lat() * 180 / M_PI;
Float64 lon = i.value().pos().lon() * 180 / M_PI;
SInt32 vulnerabilityState = static_cast<SInt32>(i.value().vulnerabilityState);
Float64 lat = i.value().pos.lat * 180 / M_PI;
Float64 lon = i.value().pos.lon * 180 / M_PI;
DEBUG_LOG(m_logger) << "GeoPairing::calculateAirFire"
<< "\nl_Updater->update : " << i.key()
<< "\n: participantId=" << i.value().participantId()
<< "\n participantTypeId= " << i.value().participantTypeId()
<< "\n: participantId=" << i.value().participantId
<< "\n participantTypeId= " << i.value().participantTypeId
<< "\n pos lat=" << lat
<< "\n lon=" << lon
<< "\n alt=" << i.value().pos().z()
<< "\n posTime=" << i.value().sampleTime()
<< "\n alt=" << i.value().pos.z
<< "\n posTime=" << i.value().sampleTime
<< "\n state=" << i.value().vulnerabilityState
<< "\n state (SInt32)=" << vulnerabilityState;
l_Updater->update(i.value().participantId(),
l_Updater->update(i.value().participantId,
lat,
lon,
i.value().pos().z(),
i.value().sampleTime() / 1000, //s
i.value().pos.z,
i.value().sampleTime / 1000, //s
vulnerabilityState);
}
@@ -225,7 +225,7 @@ void GeoPairing::calculateAirFire(const QByteArray &transparentData,
if (l_TargetFound != l_CachedTrackingState || l_TimeoutPassed)
{
// prepare response for player
m_reportTarget.playerId = i.value().participantId();
m_reportTarget.playerId = i.value().participantId;
m_reportTarget.sendData.clear();
m_reportTarget.sendData.append(0xEB); // Report Target Detection
@@ -843,11 +843,11 @@ bool GeoPairing::geoPairingData(const std::shared_ptr<N_Ballistic::BallisticServ
while (i.hasNext())
{
i.next();
DEBUG_LOG(m_logger) << i.key() << ": participantId=" << i.value().participantId()
<< " participantTypeId= " << i.value().participantTypeId()
<< " pos lat=" << i.value().pos().lat()
<< " pos lon=" << i.value().pos().lon()
<< " z=" << i.value().pos().z();
DEBUG_LOG(m_logger) << i.key() << ": participantId=" << i.value().participantId
<< " participantTypeId= " << i.value().participantTypeId
<< " pos lat=" << i.value().pos.lat
<< " pos lon=" << i.value().pos.lon
<< " z=" << i.value().pos.z;
}
@@ -24,7 +24,9 @@ IF(KDCHART_INCLUDE_DIRS AND KDCHART_LIBRARY)
ELSE()
FIND_PATH(KDCHART_INCLUDE_DIRS KDChart/kdchart_export.h)
FIND_LIBRARY(KDCHART_LIBRARY NAMES kdchart)
# KDChart's Qt6 builds install the lib as libkdchart-qt6.so (OUTPUT_NAME
# kdchart${_LIBRARY_QTID}); Qt5 builds (legacy env) use libkdchart.so.
FIND_LIBRARY(KDCHART_LIBRARY NAMES kdchart kdchart-qt6)
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(KDChart DEFAULT_MSG KDCHART_LIBRARY KDCHART_INCLUDE_DIRS)
@@ -25,16 +25,32 @@
# Prebuilt Schusstafel package (Schusstafel.h + libSchusstafel.{so,a}); see the
# external/ symlink pattern used by FindArcGIS (${CMAKE_SOURCE_DIR}/external,
# /workspace/external in the build container).
SET(_SCHUSSTAFEL_HINTS
"${CMAKE_SOURCE_DIR}/external/Schusstafel"
"/workspace/external/Schusstafel"
)
IF(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
SET(SCHUSSTAFEL_FOUND TRUE)
ELSE(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
FIND_PATH(SCHUSSTAFEL_INCLUDE_DIR Schusstafel.h)
FIND_LIBRARY_WITH_DEBUG(SCHUSSTAFEL_LIBRARY WIN32_DEBUG_POSTFIX d NAMES Schusstafel libSchusstafel)
FIND_PATH(SCHUSSTAFEL_INCLUDE_DIR Schusstafel.h HINTS ${_SCHUSSTAFEL_HINTS})
FIND_LIBRARY_WITH_DEBUG(SCHUSSTAFEL_LIBRARY WIN32_DEBUG_POSTFIX d NAMES Schusstafel libSchusstafel HINTS ${_SCHUSSTAFEL_HINTS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Schusstafel DEFAULT_MSG SCHUSSTAFEL_LIBRARY SCHUSSTAFEL_INCLUDE_DIR)
MARK_AS_ADVANCED(SCHUSSTAFEL_INCLUDE_DIR SCHUSSTAFEL_LIBRARY)
ENDIF(SCHUSSTAFEL_INCLUDE_DIR AND SCHUSSTAFEL_LIBRARY)
# Imported target consumed by cesPluginGeoPairing ($<TARGET_EXISTS:Schusstafel::Schusstafel>):
# carries the include dir for #include <Schusstafel.h> and the lib for the ST_* symbols.
IF(SCHUSSTAFEL_FOUND AND NOT TARGET Schusstafel::Schusstafel)
ADD_LIBRARY(Schusstafel::Schusstafel UNKNOWN IMPORTED)
SET_PROPERTY(TARGET Schusstafel::Schusstafel PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SCHUSSTAFEL_INCLUDE_DIR}")
SET_PROPERTY(TARGET Schusstafel::Schusstafel PROPERTY IMPORTED_LOCATION "${SCHUSSTAFEL_LIBRARY}")
ENDIF()
@@ -680,6 +680,31 @@ RUN apt-get install -y -qq libkdreports-dev 2>/dev/null || \
# includes resolve through the default /usr/local/include search path.
RUN ln -sfn KDReports-qt6 /usr/local/include/KDReports
# KDChart (KDAB, MIT) from source: FindKDChart RETURN()s without it, which skips
# OreOnlineReportsGuiPlugin (app requirement iid ore.onlinereports). The legacy
# env had a KDChart 2.6.0 Qt5 RPM; the Qt6 build needs a Qt6-compatible release.
# Pinned to the verified kdchart-3.0.0 tag (KDChart_QT6=true; needs the
# Gui/Widgets/PrintSupport/Svg Qt6 components above). ECM
# (extra-cmake-modules) is required: KDChart plain-include()s ECMGeneratePriFile
# for Qt > 6.2 and never find_package(ECM)s.
RUN apt-get update -qq && \
apt-get install -y -qq extra-cmake-modules && \
rm -rf /var/lib/apt/lists/* && \
git clone --depth 1 --branch kdchart-3.0.0 https://github.com/KDAB/KDChart.git /tmp/KDChart && \
cmake -S /tmp/KDChart -B /tmp/KDChart/build \
-DKDChart_QT6=true -DKDChart_EXAMPLES=false -DKDChart_TESTS=false -DKDChart_DOCS=false \
-DCMAKE_PREFIX_PATH=${QT_BASE_DIR}/${QT_VERSION}/${QT_ARCH_DIR} \
-DCMAKE_MODULE_PATH=/usr/share/ECM/modules \
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local && \
cmake --build /tmp/KDChart/build -j$(nproc) && \
cmake --install /tmp/KDChart/build && \
ldconfig && \
rm -rf /tmp/KDChart
# KDChart's Qt6 build installs headers under KDChart-qt6 (same -qt6 suffix
# pattern as KDReports); legacy sources include the <KDChart/...> prefix.
RUN ln -sfn KDChart-qt6 /usr/local/include/KDChart
CMD ["/bin/bash"]
EOF
@@ -1185,7 +1210,14 @@ GROUP11_TARGETS=(
# without these the app reports "App Requirements check failed" at startup.
# Plugin outputs land in build4/lib, the directory the loader scans.
# Excluded (environmental floors, not migration regressions):
# cesPluginGeoPairing - needs the external Schusstafel.h header (missing)
# cesPluginGeoPairing - needs the external Schusstafel package (prebuilt
# Schusstafel.h + libSchusstafel.so) at
# external/Schusstafel (see resolve_schusstafel); it is
# built when the package is present
# OreOnlineReportsGuiPlugin - needs KDChart (open-source, KDAB) under
# /usr/local; built from github.com/KDAB/KDChart tag
# kdchart-3.0.0 with -DKDChart_QT6=true (see
# resolve_kdchart), built when present
# BldInfoGuiPlugin - links BuildingViewerCommon (dtEntity/OSG SDK absent)
# BdvViewerGuiPlugin - links BuildingViewerCommon (same floor; CMake skips its
# subdirectory when BuildingViewerCommon is not built)
@@ -1297,6 +1329,7 @@ GROUP12_TARGETS=(
OpmLoginGuiPlugin
OpmOverviewGuiPlugin
OpmSettingsGuiPlugin
OreOnlineReportsGuiPlugin
OscDataPlugin
OscParticipantInfoGuiPlugin
OscSystemGuiPlugin
@@ -1381,6 +1414,7 @@ GROUP12_TARGETS=(
cesPluginCES_NBC
cesPluginCesBuildings
cesPluginExplosions
cesPluginGeoPairing
cesPluginMineAreas
cesPluginMineLayingArtillery
cesPluginParticipantBuildings
@@ -1528,6 +1562,7 @@ BUILD_AAR="${BUILD_AAR:-ON}"
BUILD_RTI="${BUILD_RTI:-ON}"
BUILD_GRANTLEE="${BUILD_GRANTLEE:-ON}"
BUILD_ARCGIS="${BUILD_ARCGIS:-OFF}"
WITH_SCHUSSTAFEL="${WITH_SCHUSSTAFEL:-ON}"
BUILD_GROUP1="${BUILD_GROUP1:-ON}"
BUILD_GROUP2="${BUILD_GROUP2:-ON}"
BUILD_GROUP3="${BUILD_GROUP3:-ON}"
@@ -1679,6 +1714,43 @@ resolve_xmlpatterns() {
resolve_xmlpatterns
# Schusstafel is a prebuilt external package (Schusstafel.h +
# libSchusstafel.so) provided at external/Schusstafel, mirroring the ArcGIS
# symlink pattern. cesPluginGeoPairing #includes Schusstafel.h unconditionally,
# so without the package WITH_SCHUSSTAFEL stays OFF and the target is dropped
# from Group 12 (environmental floor, not a migration regression).
resolve_schusstafel() {
WITH_SCHUSSTAFEL_EFFECTIVE="${WITH_SCHUSSTAFEL}"
if [[ "${WITH_SCHUSSTAFEL_EFFECTIVE}" == "ON" ]]; then
if ls /workspace/external/Schusstafel/Schusstafel.h >/dev/null 2>&1; then
log_info "Schusstafel present at /workspace/external/Schusstafel - cesPluginGeoPairing will be built"
else
log_warn "Schusstafel not present at /workspace/external/Schusstafel - keeping WITH_SCHUSSTAFEL OFF (cesPluginGeoPairing stays unbuilt)"
WITH_SCHUSSTAFEL_EFFECTIVE=OFF
fi
fi
}
# KDChart (KDAB, MIT) is an open-source Qt charts extension, installed under
# /usr/local (header KDChart/kdchart_export.h + libkdchart.so; FindKDChart
# searches /usr/local by default). The legacy env had a KDChart 2.6.0 Qt5 RPM;
# the Qt6 build needs a Qt6-compatible release (e.g. github.com/KDAB/KDChart
# tag kdchart-3.0.0 with -DKDChart_QT6=true). OreOnlineReportsGuiPlugin's
# CMake RETURN()s when KDChart is absent, so without it the plugin (iid
# ore.onlinereports) stays unbuilt - environmental floor.
resolve_kdchart() {
KDCHART_PRESENT=OFF
if [[ -f /usr/local/include/KDChart/kdchart_export.h ]]; then
KDCHART_PRESENT=ON
log_info "KDChart present at /usr/local - OreOnlineReportsGuiPlugin will be built"
else
log_warn "KDChart not present at /usr/local - OreOnlineReportsGuiPlugin stays unbuilt (legacy KDChart 2.6.0 was a Qt5 RPM; build a Qt6-compatible release from source to close this floor)"
fi
}
resolve_schusstafel
resolve_kdchart
cd /workspace/qt-migration-legatus/qt6-after/qt6-migrated-legatus
rm -rf build4
@@ -1704,6 +1776,7 @@ cmake .. \
-DBUILD_PLUGINS_PARTICIPANT_ORG_CHART="${BUILD_WEBENGINE_PLUGINS}" \
-DBUILD_PLUGINS_MSDL="${BUILD_XMLPATTERNS_EFFECTIVE}" \
-DBUILD_PLUGINS_SAAB="${BUILD_XMLPATTERNS_EFFECTIVE}" \
-DWITH_SCHUSSTAFEL="${WITH_SCHUSSTAFEL_EFFECTIVE}" \
${CMAKE_BUILD_FLAGS:-} \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_BUILD_TYPE=Release \
@@ -1722,6 +1795,30 @@ read -r -a GROUP10_ARRAY <<< "${GROUP10_TARGETS}"
read -r -a GROUP11_ARRAY <<< "${GROUP11_TARGETS}"
read -r -a GROUP12_ARRAY <<< "${GROUP12_TARGETS}"
# cesPluginGeoPairing #includes Schusstafel.h unconditionally - drop it from
# Group 12 when the Schusstafel package is unavailable (environmental floor).
if [[ "${WITH_SCHUSSTAFEL_EFFECTIVE}" != "ON" ]]; then
_GROUP12_ARRAY=()
for _t in "${GROUP12_ARRAY[@]}"; do
if [[ "${_t}" != "cesPluginGeoPairing" ]]; then
_GROUP12_ARRAY+=("${_t}")
fi
done
GROUP12_ARRAY=("${_GROUP12_ARRAY[@]}")
fi
# OreOnlineReportsGuiPlugin RETURN()s at configure when KDChart is absent -
# drop it from Group 12 in that case (environmental floor, see resolve_kdchart).
if [[ "${KDCHART_PRESENT}" != "ON" ]]; then
_GROUP12_ARRAY=()
for _t in "${GROUP12_ARRAY[@]}"; do
if [[ "${_t}" != "OreOnlineReportsGuiPlugin" ]]; then
_GROUP12_ARRAY+=("${_t}")
fi
done
GROUP12_ARRAY=("${_GROUP12_ARRAY[@]}")
fi
if [[ "${TESTS_ONLY}" != "ON" ]]; then
if [[ "${BUILD_VIEWER_ONLY}" == "ON" ]]; then
log_info "BUILD_VIEWER_ONLY enabled - skipping Groups 1-4, building only Viewer module targets"