Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkIGTLDeviceCommandWidget Class Reference

An object of this class offers an UI to send OpenIGTLink commands. More...

#include <QmitkIGTLDeviceCommandWidget.h>

Inheritance diagram for QmitkIGTLDeviceCommandWidget:
Collaboration diagram for QmitkIGTLDeviceCommandWidget:

Signals

void AdaptGUIToStateSignal ()
 used for thread seperation, the worker thread must not call AdaptGUIToState directly QT signals are thread safe and seperate the threads More...
 

Public Member Functions

void Initialize (mitk::IGTLDevice::Pointer device)
 Initializes the widget with the given device. More...
 
 QmitkIGTLDeviceCommandWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 
 ~QmitkIGTLDeviceCommandWidget ()
 

Static Public Attributes

static const std::string VIEW_ID
 

Protected Slots

void OnCommandChanged (const QString &curCommand)
 
void OnSendCommand ()
 
void OnLostConnection ()
 Is called when the current device received a message. More...
 
void OnNewConnection ()
 Is called when the current device connected to another device. More...
 
void AdaptGUIToState ()
 Adapts the GUI to the state of the device. More...
 

Protected Member Functions

void OnDeviceStateChanged ()
 Calls AdaptGUIToState() More...
 
void FillCommandsComboBox ()
 Fills the commands combo box with available commands. More...
 
virtual void CreateConnections ()
 Creation of the connections. More...
 
virtual void CreateQtPartControl (QWidget *parent)
 
void DisableSourceControls ()
 
void EnableSourceControls ()
 

Protected Attributes

Ui::QmitkIGTLDeviceCommandWidgetControls * m_Controls
 
mitk::IGTLDevice::Pointer m_IGTLDevice
 holds the OpenIGTLink device More...
 
igtl::MessageBase::Pointer m_CurrentCommand
 
bool m_IsClient
 flag to indicate if the IGTL device is a client or a server More...
 
unsigned long m_MessageReceivedObserverTag
 
unsigned long m_CommandReceivedObserverTag
 
unsigned long m_LostConnectionObserverTag
 
unsigned long m_NewConnectionObserverTag
 
unsigned long m_StateModifiedObserverTag
 

Detailed Description

An object of this class offers an UI to send OpenIGTLink commands.

Documentation:

Definition at line 42 of file QmitkIGTLDeviceCommandWidget.h.

Constructor & Destructor Documentation

QmitkIGTLDeviceCommandWidget::QmitkIGTLDeviceCommandWidget ( QWidget *  parent = 0,
Qt::WindowFlags  f = 0 
)

Definition at line 43 of file QmitkIGTLDeviceCommandWidget.cpp.

References CreateQtPartControl(), m_Controls, and m_IGTLDevice.

QmitkIGTLDeviceCommandWidget::~QmitkIGTLDeviceCommandWidget ( )

Member Function Documentation

void QmitkIGTLDeviceCommandWidget::AdaptGUIToState ( )
protectedslot
void QmitkIGTLDeviceCommandWidget::AdaptGUIToStateSignal ( )
signal

used for thread seperation, the worker thread must not call AdaptGUIToState directly QT signals are thread safe and seperate the threads

Referenced by CreateConnections(), OnDeviceStateChanged(), OnLostConnection(), and OnNewConnection().

void QmitkIGTLDeviceCommandWidget::CreateConnections ( )
protectedvirtual

Creation of the connections.

Definition at line 76 of file QmitkIGTLDeviceCommandWidget.cpp.

References AdaptGUIToState(), AdaptGUIToStateSignal(), m_Controls, OnCommandChanged(), and OnSendCommand().

Referenced by CreateQtPartControl().

void QmitkIGTLDeviceCommandWidget::CreateQtPartControl ( QWidget *  parent)
protectedvirtual

Definition at line 62 of file QmitkIGTLDeviceCommandWidget.cpp.

References CreateConnections(), and m_Controls.

Referenced by QmitkIGTLDeviceCommandWidget().

void QmitkIGTLDeviceCommandWidget::DisableSourceControls ( )
protected

Definition at line 215 of file QmitkIGTLDeviceCommandWidget.cpp.

References m_Controls.

Referenced by AdaptGUIToState(), and Initialize().

void QmitkIGTLDeviceCommandWidget::EnableSourceControls ( )
protected
void QmitkIGTLDeviceCommandWidget::FillCommandsComboBox ( )
protected

Fills the commands combo box with available commands.

Definition at line 276 of file QmitkIGTLDeviceCommandWidget.cpp.

References m_Controls, and m_IGTLDevice.

Referenced by Initialize().

void QmitkIGTLDeviceCommandWidget::Initialize ( mitk::IGTLDevice::Pointer  device)

Initializes the widget with the given device.

The old device is dropped, so be careful, if the source is not saved somewhere else it might be lost. You might want to ask the user if he wants to save the changes before calling this method.

Parameters
deviceThe widget will be initialized corresponding to the state of this device.

Definition at line 143 of file QmitkIGTLDeviceCommandWidget.cpp.

References AdaptGUIToState(), DisableSourceControls(), FillCommandsComboBox(), m_CommandReceivedObserverTag, m_IGTLDevice, m_IsClient, m_LostConnectionObserverTag, m_MessageReceivedObserverTag, m_NewConnectionObserverTag, m_StateModifiedObserverTag, mitk::New(), OnDeviceStateChanged(), OnLostConnection(), and OnNewConnection().

void QmitkIGTLDeviceCommandWidget::OnCommandChanged ( const QString &  curCommand)
protectedslot

Definition at line 247 of file QmitkIGTLDeviceCommandWidget.cpp.

References m_Controls, m_CurrentCommand, and m_IGTLDevice.

Referenced by CreateConnections().

void QmitkIGTLDeviceCommandWidget::OnDeviceStateChanged ( )
protected

Calls AdaptGUIToState()

Definition at line 93 of file QmitkIGTLDeviceCommandWidget.cpp.

References AdaptGUIToStateSignal().

Referenced by Initialize().

void QmitkIGTLDeviceCommandWidget::OnLostConnection ( )
protectedslot

Is called when the current device received a message.

Is called when the current device received a command Is called when the current device lost a connection to one of its sockets

Definition at line 261 of file QmitkIGTLDeviceCommandWidget.cpp.

References AdaptGUIToStateSignal().

Referenced by Initialize().

void QmitkIGTLDeviceCommandWidget::OnNewConnection ( )
protectedslot

Is called when the current device connected to another device.

Definition at line 270 of file QmitkIGTLDeviceCommandWidget.cpp.

References AdaptGUIToStateSignal().

Referenced by Initialize().

void QmitkIGTLDeviceCommandWidget::OnSendCommand ( )
protectedslot

Definition at line 225 of file QmitkIGTLDeviceCommandWidget.cpp.

References m_Controls, m_CurrentCommand, and m_IGTLDevice.

Referenced by CreateConnections().

Member Data Documentation

unsigned long QmitkIGTLDeviceCommandWidget::m_CommandReceivedObserverTag
protected

Definition at line 130 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize(), and ~QmitkIGTLDeviceCommandWidget().

Ui::QmitkIGTLDeviceCommandWidgetControls* QmitkIGTLDeviceCommandWidget::m_Controls
protected
igtl::MessageBase::Pointer QmitkIGTLDeviceCommandWidget::m_CurrentCommand
protected

Definition at line 123 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by OnCommandChanged(), and OnSendCommand().

mitk::IGTLDevice::Pointer QmitkIGTLDeviceCommandWidget::m_IGTLDevice
protected
bool QmitkIGTLDeviceCommandWidget::m_IsClient
protected

flag to indicate if the IGTL device is a client or a server

Definition at line 127 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize().

unsigned long QmitkIGTLDeviceCommandWidget::m_LostConnectionObserverTag
protected

Definition at line 131 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize(), and ~QmitkIGTLDeviceCommandWidget().

unsigned long QmitkIGTLDeviceCommandWidget::m_MessageReceivedObserverTag
protected

Definition at line 129 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize(), and ~QmitkIGTLDeviceCommandWidget().

unsigned long QmitkIGTLDeviceCommandWidget::m_NewConnectionObserverTag
protected

Definition at line 132 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize(), and ~QmitkIGTLDeviceCommandWidget().

unsigned long QmitkIGTLDeviceCommandWidget::m_StateModifiedObserverTag
protected

Definition at line 133 of file QmitkIGTLDeviceCommandWidget.h.

Referenced by Initialize(), and ~QmitkIGTLDeviceCommandWidget().

const std::string QmitkIGTLDeviceCommandWidget::VIEW_ID
static

Definition at line 47 of file QmitkIGTLDeviceCommandWidget.h.


The documentation for this class was generated from the following files: