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>
122 lines
4.4 KiB
C++
122 lines
4.4 KiB
C++
/**
|
|
* @RDE_HEADER@
|
|
* Handler for all exercise objects
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hanna E. Rathje, SLSE, 2015-09-03
|
|
*/
|
|
#pragma once
|
|
|
|
#include <QObject>
|
|
#include <QQueue>
|
|
#include <QHash>
|
|
#include <QCache>
|
|
#include <QSize>
|
|
|
|
#include <DBAdministration/exercise_table_generator.h>
|
|
#include "dds_handler.h"
|
|
#include <ExerciseManagement/exm_db.h>
|
|
#include "logger.h"
|
|
|
|
class QTimer;
|
|
namespace ExerciseManagement
|
|
{
|
|
class MainHandler;
|
|
class ObjectExercise;
|
|
class HandlerExercise final : public QObject
|
|
, protected Interface::Fts::ExerciseCreateRequestHandler
|
|
, protected Interface::Fts::ExerciseModifyRequestHandler
|
|
, protected Interface::Fts::ExerciseRemoveRequestHandler
|
|
, protected Interface::Fts::ExerciseImageModifyRequestHandler
|
|
, protected Interface::Fts::GetExerciseImageRequestHandler
|
|
, protected ServiceManagement::Interface::Ftc::StartGroupReplyHandler
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit HandlerExercise(MainHandler *mainHandler,
|
|
const std::shared_ptr<DdsHandler> &ddsHandler,
|
|
const std::shared_ptr<DatabaseInterface> &db,
|
|
const std::shared_ptr<DBAdministration::ExerciseTableGenerator> &exTableGenerator,
|
|
QObject *parent = nullptr);
|
|
~HandlerExercise();
|
|
|
|
bool init();
|
|
ObjectExercise *getExerciseById(qint32 id) const;
|
|
const QHash<int, ObjectExercise*> &getExerciseMap() const { return m_exeObjMap; }
|
|
|
|
bool startGroupRequest(const ServiceManagement::GroupRequest &req);
|
|
|
|
|
|
// class ImageKey
|
|
// {
|
|
// public:
|
|
// ImageKey(const QSize &size = QSize(0, 0), bool lowBandwith = false)
|
|
// : m_lowBandwidth(lowBandwith)
|
|
// , m_size(size)
|
|
// {}
|
|
// bool m_lowBandwidth { false };
|
|
// QSize m_size;
|
|
|
|
// bool operator<(const ImageKey &o) const
|
|
// {
|
|
// if (m_size.height() != o.m_size.height())
|
|
// return m_size.height() < o.m_size.height();
|
|
// if (m_size.width() != o.m_size.width())
|
|
// return m_size.width() < o.m_size.width();
|
|
// return m_lowBandwidth < o.m_lowBandwidth;
|
|
// }
|
|
|
|
// bool operator==(const ImageKey &o) const
|
|
// {
|
|
// return (m_size == o.m_size && m_lowBandwidth == o.m_lowBandwidth);
|
|
// }
|
|
// };
|
|
private:
|
|
void onStartNextExercise();
|
|
private:
|
|
/**
|
|
* @brief HandlerExercise::hasError
|
|
* checks if there is an error in the replyObject and, if given, deletes
|
|
* the ifs pointer and logs the error
|
|
* @param replyObject
|
|
* @param ifs
|
|
* @return
|
|
*/
|
|
bool hasError(const Core::FunctionReplyObject &replyObject, ObjectExercise *ifs) const;
|
|
|
|
void onExerciseCreateRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExerciseCreateRequest &request) override final;
|
|
Core::FunctionReplyObject exerciseCreateRequest(const ExerciseCreateRequest &request);
|
|
void onExerciseModifyRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExerciseModifyRequest &request) override final;
|
|
Core::FunctionReplyObject exerciseModifyRequest(const ExerciseModifyRequest &request);
|
|
// void onExerciseChangeStateRequest(const rti::core::SampleIdentity &cookie,
|
|
// const ExerciseChangeStateRequest &request) override final;
|
|
void onExerciseRemoveRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExerciseRemoveRequest &request) override final;
|
|
void onExerciseImageModifyRequest(const rti::core::SampleIdentity &cookie,
|
|
const ExerciseImageModifyRequest &request) override final;
|
|
void onGetExerciseImageRequest(const rti::core::SampleIdentity &cookie,
|
|
const GetExerciseImageRequest &request) override final;
|
|
|
|
void onStartGroupReply(const Core::FunctionReplyObject &replyObject) override final;
|
|
|
|
bool checkEquipmentNumbersOnAllExercises(int exerciseIdToBeStarted, QString &mesgOut);
|
|
|
|
QStringList doubleChannels(int exerciseAId, int exerciseBId) const;
|
|
|
|
private:
|
|
QHash<int, ObjectExercise*> m_exeObjMap;
|
|
MainHandler *m_mainHandler;
|
|
std::shared_ptr<DdsHandler> m_ddsHandler;
|
|
std::shared_ptr<DatabaseInterface>m_db;
|
|
std::shared_ptr<DBAdministration::ExerciseTableGenerator> m_exTblGen;
|
|
QTimer *m_startupExerciseTimer;
|
|
QQueue<int> m_exercisesToStart;
|
|
//QCache<ImageKey, QByteArray> m_imageCache;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|
|
}
|