123 lines
3.5 KiB
C++
Executable File
123 lines
3.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* ParticipantManagement - ParticipantConfigDialog
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Christian Ehrlicher, SLSE, 2016-06-13
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "participant_config_model.h"
|
|
|
|
#include <set>
|
|
|
|
//Lts
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsWidgets/lts_frameless_dialog.h>
|
|
#include <LtsUtilsGuiDds/request_helper.h>
|
|
#include <LtsSession/lts_session.h>
|
|
|
|
//ParticipantManagement
|
|
#include <ParticipantManagement/logger.h>
|
|
|
|
//DDS
|
|
#include <PluginInterfaces/gui_plugin_interface.h>
|
|
#include <ParticipantManagement/ppm_dtc.h>
|
|
#include <ParticipantManagement/ppm_ftc.h>
|
|
#include <Plugins/ProjectDataManagement/pdm_gui_plugin_interface.h>
|
|
#include <Plugins/ParticipantManagement/ppm_gui_combobox_plugin_interface.h>
|
|
|
|
//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<Interface::Dtc> &dtc,
|
|
const std::shared_ptr<Interface::Ftc> &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<int> getParticipantIds() const;
|
|
QVector<int> 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<ParticipantManagement::Interface::Dtc> m_dtc;
|
|
std::shared_ptr<ParticipantManagement::Interface::Ftc> m_ftc;
|
|
std::shared_ptr<ProjectDataManagement::ForeignGuiInterface> m_pdmGuiIfc;
|
|
std::shared_ptr<ParticipantManagement::ForeignGuiComboboxInterface> 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
|