Files
qt-migration-legatus/qt5-before/dlbo/Lts/Services/AudioVideoManagement/frequency_planning_handler.h
T
torstenandCopilot 7173785915 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>
2026-09-15 18:20:26 +00:00

123 lines
5.3 KiB
C++

/**
* FrequencyPlanningHandler
* $Id: combat_net_radio_handler.h 34915 2017-08-18 07:26:31Z baeuerle_h $
* $HeadURL: svn://slssvn/TDS/branches/product/devel/trunk/Lts/Services/AudioVideoManagement/combat_net_radio_handler.h $
* $Author: baeuerle_h $
* Created by Hannes Baeuerle, SLSE, 2017-07-25
*/
#pragma once
#include <avm_fts.h>
#include <avm_db.h>
#include <avm.hpp>
#include <logger.h>
#include <QtCore/QObject>
#include <QMap>
#include <vector>
namespace AudioVideoManagement
{
namespace Interface
{
class Dts;
}
class FrequencySetHandler;
class ActiveExercises;
class CnrHandler;
class FrequencyPlanningHandler
: public QObject
, protected Interface::Fts::ModifyFrequencyPlanningRequestHandler
, protected Interface::Fts::RemoveFrequencyPlanningRequestHandler
, protected Interface::Fts::ModifyActiveFrequencyPlanningRequestHandler
, protected Interface::Fts::RemoveActiveFrequencyPlanningRequestHandler
{
Q_OBJECT
public:
explicit FrequencyPlanningHandler(Interface::Dts *dts, Interface::Fts *fts, DatabaseInterface *db, FrequencySetHandler *frequencySetHandler, ActiveExercises *activeExercises);
~FrequencyPlanningHandler() override;
/**
* The cnrHandler is not given via constructor as the CnrHandler itself has a dependency to the FrequencyPlanningHandler.
*/
void setCnrHandler(CnrHandler *cnrHandler);
bool init();
void onModifyFrequencyPlanningRequest(const rti::core::SampleIdentity &cookie,
const ModifyFrequencyPlanningRequest &request) override;
void onRemoveFrequencyPlanningRequest(const rti::core::SampleIdentity &cookie,
const Core::RemoveElementRequest &request) override;
void onModifyActiveFrequencyPlanningRequest(const rti::core::SampleIdentity &cookie,
const ModifyActiveFrequencyPlanningRequest &request) override;
void onRemoveActiveFrequencyPlanningRequest(const rti::core::SampleIdentity &cookie,
const RemoveActiveFrequencyPlanningRequest &request) override;
bool hasActivePlan(int32_t exerciseId) const;
/**
* Check whether the given Exercise's active FrequencyPlan references the given CnrConfig.
* Returns false in case the Exercise does not have an active FrequencyPlan.
*/
bool isReferencedByActivePlan(int32_t exerciseId, int32_t cnrConfigId) const;
signals:
/**
* Signal that a FrequencyPlan was added, removed or changed or when the active FrequencyPlan for a given Exercise changed.
* The CnrHandler connects to this signal as changes in the FrequencyPlans affect which CnrConfigs are active.
*/
void planningChanged();
private slots:
void onCnrConfigRemoved(int cnrConfigId);
private:
Core::FunctionReplyObject handleCreate(const ModifyFrequencyPlanningRequest &request);
Core::FunctionReplyObject handleModify(const ModifyFrequencyPlanningRequest &request);
Core::FunctionReplyObject handleRemove(const Core::RemoveElementRequest &request);
Core::FunctionReplyObject validateRequest(const ModifyFrequencyPlanningRequest &request) const;
Core::FunctionReplyObject validateModifyRequest(const ModifyFrequencyPlanningRequest &request) const;
Core::FunctionReplyObject validateRequest(const Core::RemoveElementRequest &request) const;
std::vector<Database::AvmFrequencyPlanningData> insert(const std::vector<AudioVideoManagement::FrequencyPlanningData>& ddsEntries, qint64 planId, bool &status);
Core::FunctionReplyObject modifyActiveFrequencyPlanningRequest(const ModifyActiveFrequencyPlanningRequest &request);
Core::FunctionReplyObject removeActiveFrequencyPlanningRequest(const RemoveActiveFrequencyPlanningRequest &request);
Core::FunctionReplyObject validateRequest(const ModifyActiveFrequencyPlanningRequest &request) const;
Core::FunctionReplyObject testActivation(const std::vector<FrequencyPlanningData> &entries, const std::vector<int> &activePlans, int requestId) const;
std::vector<int> otherActiveExercises(int withoutThisExercise) const;
std::vector<int> otherActivePlans(int withoutThisExercise) const;
std::vector<int> takenGlobalCnrConfigs(const std::vector<int> &plans) const;
QSet<int> takenFrequencySetEntries(const std::vector<int> &plans) const;
bool hasSameFrequencySet(const FrequencyPlanning &plan1, const FrequencyPlanning &plan2) const;
bool collectAndPublish(const Database::AvmFrequencyPlanning &planDb, bool isReload = false);
void addPlan(const FrequencyPlanning &plan);
void updatePlan(const FrequencyPlanning &plan);
void removePlan(int32_t planId);
void onDbDeletedFrequencyPlanningData(const QVariant &planId);
private:
Interface::Dts *m_dts;
Interface::Fts *m_fts;
DatabaseInterface *m_db;
FrequencySetHandler *m_frequencySetHandler;
ActiveExercises *m_activeExercises;
CnrHandler *m_cnrHandler{nullptr};
QMap<int32_t, FrequencyPlanning> m_cache;
QMap<qint64, Database::AvmActiveFrequencyPlanning> m_activePlannings; // exerciseId -> AvmActiveFrequencyPlanning
LOGGER_T &m_logger;
};
} // namespace AudioVideoManagement