91 lines
2.5 KiB
C++
Executable File
91 lines
2.5 KiB
C++
Executable File
/**
|
|
* @RDE_HEADER@
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
*/
|
|
#pragma once
|
|
|
|
#include "WebSocket/pws_web_socket_client.h"
|
|
|
|
#include <QWebSocket>
|
|
|
|
#include <LtsWidgets/lts_dialog.h>
|
|
#include <LtsProjectionWorkstation/logger.h>
|
|
|
|
#include <LtsProjectionWorkstation/WebSocket/messages.h>
|
|
#include <LtsProjectionWorkstation/WebSocket/message_factory.h>
|
|
|
|
#include <Plugins/OperatorManagement/opm_settings_gui_plugin_interface.h>
|
|
#include <Plugins/OperatorManagement/Data/opm_data_plugin.h>
|
|
#include <Plugins/AssetManagement/Data/asm_data_plugin.h>
|
|
|
|
namespace Ui { class ControlDialog; }
|
|
namespace LtsSession { class LtsSession; }
|
|
|
|
namespace ProjectionWorkstation
|
|
{
|
|
|
|
class VncViewerDialog;
|
|
class ControlDialog : public LtsWidgets::LtsDialog, public LtsProjectionWorkstation::AbstractMessageHandler
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ControlDialog(const QString &menuGroup, QWidget *parent = nullptr);
|
|
~ControlDialog();
|
|
|
|
// AbstractMessageHandler interface
|
|
void handleMessage(LtsWebSocket::AbstractClientMessage *message) override final;
|
|
|
|
// LtsDialog interface
|
|
void retranslate() override final;
|
|
|
|
bool init(LtsSession::LtsSession *session,
|
|
const std::shared_ptr<OperatorManagement::Interface::Dtc> &opmDtc,
|
|
const std::shared_ptr<OperatorManagement::ForeignSettingsGuiInterface> &opmIfc,
|
|
const std::shared_ptr<AssetManagement::Interface::Dtc> &asmDtc, int exerciseId);
|
|
|
|
protected:
|
|
// LtsDialog interface
|
|
void aboutToClose() override final;
|
|
void initWebSocketHandler();
|
|
|
|
private slots:
|
|
void slotOnConnectClicked();
|
|
void slotOnLogoutClicked();
|
|
|
|
void slotOnWebSocketConnected();
|
|
void slotOnVncDisconnected();
|
|
void slotOnWebSocketDisconnected();
|
|
void slotOnWebSocketError();
|
|
void slotOnWebSocketSslError();
|
|
|
|
void slotCbxWorkstationsChanged();
|
|
|
|
void fillCombobox();
|
|
private:
|
|
|
|
void updateConnectButton();
|
|
void closeViewers();
|
|
|
|
Ui::ControlDialog *m_ui;
|
|
LtsProjectionWorkstation::LOGGER_T m_logger;
|
|
LtsProjectionWorkstation::MessageFactory *m_messageFactory;
|
|
QVector<VncViewerDialog *> m_viewers;
|
|
WebSocketClient *m_webSocketClient;
|
|
LtsSession::LtsSession *m_session;
|
|
QHostAddress m_host;
|
|
QString m_menuGroup;
|
|
int m_exerciseId;
|
|
int m_locationId;
|
|
bool m_isConnected;
|
|
|
|
std::shared_ptr<OperatorManagement::Interface::Dtc> m_opmDtc;
|
|
std::shared_ptr<OperatorManagement::ForeignSettingsGuiInterface> m_opmIfc;
|
|
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
|
|
|
|
};
|
|
|
|
} // ProjectionWorkstation
|