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>
104 lines
3.6 KiB
C++
104 lines
3.6 KiB
C++
/**
|
|
* TrainingVoiceCommunicationHandler - reads TetraChannel and TvcConfig data from the database and publishes the data to dds,
|
|
* reacts to TvcConfig related Function topics
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Hannes Baeuerle, SLSE, 2017-07-25
|
|
*/
|
|
#pragma once
|
|
|
|
#include <avm_fts.h>
|
|
#include <avm_db.h>
|
|
#include "logger.h"
|
|
#include <QtCore/QObject>
|
|
#include <QVector>
|
|
#include <QMap>
|
|
#include <boost/optional.hpp>
|
|
#include <functional>
|
|
#include <memory>
|
|
|
|
namespace AudioVideoManagement
|
|
{
|
|
|
|
namespace Interface
|
|
{
|
|
class Dts;
|
|
class Fts;
|
|
}
|
|
|
|
class ExerciseContext;
|
|
class ActiveExercises;
|
|
|
|
class TvcHandler final
|
|
: public QObject
|
|
, protected Interface::Fts::ModifyTvcConfigRequestHandler
|
|
, protected Interface::Fts::RemoveTvcConfigRequestHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
TvcHandler(Interface::Dts *dts, Interface::Fts *fts, DatabaseInterface *db, ActiveExercises *activeExercises);
|
|
~TvcHandler();
|
|
|
|
bool init();
|
|
|
|
bool hasConfig(int32_t id) const;
|
|
const TvcConfig &config(int32_t id) const;
|
|
|
|
signals:
|
|
/** Signalled after device_config modifications. */
|
|
void avDbReloadNeeded();
|
|
|
|
/** Only emitted on change, i.e. not on create or remove. */
|
|
void tvcConfigChanged(const TvcConfig &tvcConfig);
|
|
|
|
protected:
|
|
void onModifyTvcConfigRequest(const rti::core::SampleIdentity &cookie,
|
|
const ModifyTvcConfigRequest &request) override;
|
|
void onRemoveTvcConfigRequest(const rti::core::SampleIdentity &cookie,
|
|
const Core::RemoveElementRequest &request) override;
|
|
|
|
private:
|
|
Database::AvmDeviceConfig toDeviceConfig(const TvcConfig &tvcConfig) const;
|
|
|
|
bool isValidChannel(int64_t channelId) const;
|
|
bool isFreeChannel(const ModifyTvcConfigRequest &request) const;
|
|
bool isFreeChannel(int32_t channelId, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId = boost::none) const;
|
|
|
|
bool isNameUnique(const ModifyTvcConfigRequest &request) const;
|
|
bool isNameUnique(const std::string &name, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId = boost::none) const;
|
|
|
|
Core::FunctionReplyObject createTvcConfig(const ModifyTvcConfigRequest &request, const boost::optional<int32_t> &dbId = boost::none);
|
|
Core::FunctionReplyObject modifyTvcConfig(const ModifyTvcConfigRequest &request);
|
|
Core::FunctionReplyObject removeTvcConfig(const Core::RemoveElementRequest &request);
|
|
|
|
Database::AvmTvcChannel channelById(int32_t id) const;
|
|
|
|
private slots:
|
|
void onContextActivated(const ExerciseContext &context);
|
|
void onContextDeactivated(const ExerciseContext &context);
|
|
|
|
void onDbDeleteAvmTvcConfig(const QVariant &id);
|
|
|
|
private:
|
|
bool isActiveExercise(int exerciseId) const;
|
|
Core::FunctionReplyObject validateRequest(const ModifyTvcConfigRequest &request);
|
|
bool checkConstraint(const std::function<bool (const TvcConfig &)> &constraint, const boost::optional<int> &exerciseId, const boost::optional<int32_t> &excludeId) const;
|
|
QString exerciseList(const TvcConfig &config) const;
|
|
bool needDeviceConfig(const TvcConfig &config) const;
|
|
|
|
class DeviceConfig;
|
|
|
|
Interface::Dts *m_dts;
|
|
Interface::Fts *m_fts;
|
|
DatabaseInterface *m_db;
|
|
ActiveExercises *m_activeExercises;
|
|
QMap<int32_t, TvcConfig> m_cache; // <TvcConfig::id, TvcConfig>
|
|
QVector<Database::AvmTvcChannel> m_channels;
|
|
LOGGER_T &m_logger;
|
|
std::unique_ptr<DeviceConfig> m_deviceConfig;
|
|
};
|
|
|
|
} // namespace AudioVideoManagement
|