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>
98 lines
2.9 KiB
C++
98 lines
2.9 KiB
C++
/**
|
|
* Handle the mapping real aircraft <-> nasat configuration
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, NLSE, 2018-08-16
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QHash>
|
|
#include <GuezNasat/gna.hpp>
|
|
#include <ParticipantManagement/ppm_dtc_types.h>
|
|
#include "guez_nasat_telegrams.h"
|
|
#include "logger.h"
|
|
|
|
namespace GuezNasat
|
|
{
|
|
class Initialization;
|
|
class Participant2Dds;
|
|
|
|
struct NasatAircraftParticipantEx final
|
|
{
|
|
NasatAircraftParticipantEx();
|
|
explicit NasatAircraftParticipantEx(const NasatAircraftParticipant &nap,
|
|
const std::shared_ptr<Participant2Dds> &publisher);
|
|
~NasatAircraftParticipantEx();
|
|
|
|
std::shared_ptr<Participant2Dds> publisher() const { return m_publisher; }
|
|
|
|
int exerciseId() const { return m_nap.exerciseId(); }
|
|
int partyId() const;
|
|
int participantId() const { return m_nap.participantId(); }
|
|
const NasatAircraftParticipant &participant() const { return m_nap; }
|
|
|
|
Q_DISABLE_COPY(NasatAircraftParticipantEx)
|
|
private:
|
|
NasatAircraftParticipant m_nap;
|
|
std::shared_ptr<Participant2Dds> m_publisher;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
|
|
struct ExerciseParticipantKey
|
|
{
|
|
int exerciseId = 0;
|
|
int participantId = 0;
|
|
ExerciseParticipantKey() = default;
|
|
ExerciseParticipantKey(int e, int p)
|
|
: exerciseId(e), participantId(p) {}
|
|
bool operator ==(const ExerciseParticipantKey &o) const
|
|
{
|
|
return exerciseId == o.exerciseId && participantId == o.participantId;
|
|
}
|
|
};
|
|
inline uint qHash(ExerciseParticipantKey key, uint seed = 0)
|
|
{
|
|
return ::qHash((key.exerciseId << 16) + key.participantId, seed);
|
|
}
|
|
|
|
class HandlerParticipant : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit HandlerParticipant(Initialization *mainHandler);
|
|
~HandlerParticipant();
|
|
|
|
bool init() const { return true; }
|
|
|
|
// QHash<ExerciseParticipantKey, NasatAircraftParticipantEx>
|
|
QHash<ExerciseParticipantKey, NasatAircraftParticipantEx*> participantsForNasatId(int nasatId) const;
|
|
|
|
void onNasatAircraftParticipantCreated(const NasatAircraftParticipant &nap);
|
|
void onNasatAircraftParticipantRemoved(const NasatAircraftParticipant &nap);
|
|
|
|
Core::GeoPosition nasatPosition(int nasatId) const;
|
|
|
|
Q_SIGNALS:
|
|
void nasatAircraftParticipantRemoved(const NasatAircraftParticipant &nap);
|
|
|
|
public Q_SLOTS:
|
|
void onNasatPosition(const NasatPosition &position);
|
|
void onNasatAircraftPosition(int nasatId, const Core::GeoPosition &pos, qint64 ts);
|
|
void onNasatIdChanged(int oldNasatId, int newNasatId);
|
|
|
|
private:
|
|
void createNasatAircraftParticipant(const NasatAircraftParticipant &nap, int nasatId);
|
|
|
|
// QHash<nasatId, QHash<ExerciseParticipantKey, NasatAircraftParticipantEx>>
|
|
QHash<int, QHash<ExerciseParticipantKey, NasatAircraftParticipantEx*>> m_activePublisher;
|
|
|
|
// NasatId/AircraftId , GeoPosition
|
|
QHash<int, Core::GeoPosition> m_lastNasatPositionsAsCoreGeoposition;
|
|
Initialization *m_mainHandler;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
} // namespace GuezNasat
|