/** * @RDE_HEADER@ * ParticipantManagement - ParticipantConfigDialog * $Id$ * $HeadURL$ * $Author$ * Created by Christian Ehrlicher, SLSE, 2016-06-13 */ #pragma once #include "participant_config_model.h" #include //Lts #include #include #include #include //ParticipantManagement #include //DDS #include #include #include #include #include //Qt namespace Ui { class ParticipantConfigDialog; } namespace ParticipantManagement { // -------------------------------------------------------- // ParticipantConfigDialog // -------------------------------------------------------- class ParticipantConfigDialog : public LtsWidgets::LtsDialog , protected ParticipantManagement::Interface::Ftc::ModifyStateReplyHandler , protected ParticipantManagement::Interface::Ftc::InitParticipantReplyHandler , protected ParticipantManagement::Interface::Ftc::SendMessageReplyHandler , protected ParticipantManagement::Interface::Ftc::SetParticipantModeReplyHandler { Q_OBJECT public: enum DialogType { Config, Message, ConfigMulti, MessageMulti }; explicit ParticipantConfigDialog(int ddsId, DialogType type, QWidget *parent = nullptr); ~ParticipantConfigDialog(); bool init(LtsSession::LtsSession *session, const std::shared_ptr &dtc, const std::shared_ptr &ftc); private: void onModifyStateReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onInitParticipantReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onSendMessageReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void onSetParticipantModeReply(const Core::FunctionReplyObject &replyObject) override final { m_requestHelper->requestReply(replyObject); } void fillCbx(); void fillVitalityCbx(); void checkPendingTopics(); void setCbxForInitEnabled(bool enabled); void fillCbxWithActualValue(); void retranslate() override; private slots: void onStateAreaChanged(); void onTextChanged(); void onModeChanged(); void slotPartyChanged(); void onSelectionChanged(); private: bool apply() override final; void changeLabelText(QLabel *label, int value); std::set getParticipantIds() const; QVector getParticipantIds(const QModelIndex &parent) const; DialogType m_dialogType; int m_ddsId; TypeClass m_typeClass; ParticipantConfigModel *m_model; int m_maxChars; int m_eqId; std::shared_ptr m_dtc; std::shared_ptr m_ftc; std::shared_ptr m_pdmGuiIfc; std::shared_ptr m_ppmCbxIfc; bool m_stateChanged; bool m_modeChanged; bool m_sendTextMessage; QString m_windowTitle; LtsUtils::RequestHelper *m_requestHelper; static int s_preselectedParty; Ui::ParticipantConfigDialog *m_ui; bool m_isTarget; LOGGER_T m_logger; }; } // namespace ParticipantInfo