/** * @RDE_HEADER@ * ConfigCnr * $Id$ * $HeadURL$ * $Author$ * Created by Christian Fröbel, NLE, 2019-08-05 */ #pragma once #include "WebSocketInterface/Messages/reply_message.h" #include "logger.h" #include #include #include namespace AudioVideoManagement { namespace Interface { class Dtc; } class ActiveFrequencyPlanning; class FrequencyPlanning; class CnrConfig; } namespace InfrastructureManagement { namespace Interface { class Dtc; } } enum class DataModification; namespace CombatNetRadio { /** * Will be constructed for each active Exercise in order to build the corresponding data * for the Exercise's active FrequencyPlanning. * The associated Exercise need not have an active FrequencyPlanning. * * @author Christian Fröbel */ class ConfigCnr : public QObject { Q_OBJECT public: explicit ConfigCnr(int exerciseId, AudioVideoManagement::Interface::Dtc *avmDtc, InfrastructureManagement::Interface::Dtc *ismDtc); bool hasActiveFrequencyPlanning() const { return !m_configCnrData.radioCircuit.empty(); } /** Must only be called when hasActiveFrequencyPlanning() == true. */ const WebSocketInterface::Messages::ConfigCnrMessage::ConfigCnrData &data() const; signals: void changed(); private: void buildConfigCnrData(); boost::optional activePlan() const; void onActiveFrequencyPlanningChanged(const AudioVideoManagement::ActiveFrequencyPlanning &data, DataModification modType); void onFrequencyPlanningChanged(const AudioVideoManagement::FrequencyPlanning &data, DataModification modType); void onCnrConfigChanged(const AudioVideoManagement::CnrConfig &data, DataModification modType); bool isInActiveFrequencyPlanning(const AudioVideoManagement::CnrConfig &data); int m_exerciseId; AudioVideoManagement::Interface::Dtc *m_avmDtc; InfrastructureManagement::Interface::Dtc *m_ismDtc; WebSocketInterface::Messages::ConfigCnrMessage::ConfigCnrData m_configCnrData; QTimer m_timer; LOGGER_T m_logger; LOGGER_T m_loggerJson; }; } // namespace CombatNetRadio