Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkIGTLDeviceSourceManagementWidget.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkIGTLDeviceSourceManagementWidget_h
14 #define QmitkIGTLDeviceSourceManagementWidget_h
15 
16 //QT headers
17 #include <QWidget>
18 #include <QTimer>
19 
20 //mitk headers
21 #include "MitkOpenIGTLinkUIExports.h"
22 #include "mitkIGTLDeviceSource.h"
23 #include "mitkIGTLClient.h"
24 #include "mitkDataStorage.h"
25 
26 //itk
27 #include <itkCommand.h>
28 
29 //ui header
30 #include "ui_QmitkIGTLDeviceSourceManagementWidgetControls.h"
31 
39 class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceSourceManagementWidget : public QWidget
40 {
41  Q_OBJECT
42 
43  public:
44  static const std::string VIEW_ID;
45 
53  void LoadSource(mitk::IGTLDeviceSource::Pointer sourceToLoad);
54 
55  QmitkIGTLDeviceSourceManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
57 
58 
59  protected slots:
60  void OnSendMessage();
61 
65  void OnMessageReceived();
66 
70  void OnCommandReceived();
71 
76  void OnLostConnection();
77 
81  void OnNewConnection();
85  void AdaptGUIToState();
86 
87  signals:
92  void AdaptGUIToStateSignal();
93 
94  protected:
98  void OnDeviceStateChanged();
99 
101  void FillCommandsComboBox();
102 
104  virtual void CreateConnections();
105 
106  virtual void CreateQtPartControl(QWidget *parent);
107 
108  Ui::QmitkIGTLDeviceSourceManagementWidgetControls* m_Controls;
109 
111  mitk::IGTLDevice::Pointer m_IGTLDevice;
112 
114  mitk::IGTLDeviceSource::Pointer m_IGTLDeviceSource;
115 
118 
124 
125  //############## private help methods #######################
126  void DisableSourceControls();
127 };
128 #endif
QmitkIGTLDeviceSourceManagementWidget::VIEW_ID
static const std::string VIEW_ID
Definition: QmitkIGTLDeviceSourceManagementWidget.h:44
QmitkIGTLDeviceSourceManagementWidget::m_CommandReceivedObserverTag
unsigned long m_CommandReceivedObserverTag
Definition: QmitkIGTLDeviceSourceManagementWidget.h:120
QmitkIGTLDeviceSourceManagementWidget
An object of this class offers an UI to manage OpenIGTLink Device Sources and OpenIGTLink Devices.
Definition: QmitkIGTLDeviceSourceManagementWidget.h:39
mitkDataStorage.h
QmitkIGTLDeviceSourceManagementWidget::m_IGTLDeviceSource
mitk::IGTLDeviceSource::Pointer m_IGTLDeviceSource
holds the IGTLDeviceSource we are working with.
Definition: QmitkIGTLDeviceSourceManagementWidget.h:114
QmitkIGTLDeviceSourceManagementWidget::m_IGTLDevice
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
Definition: QmitkIGTLDeviceSourceManagementWidget.h:111
mitkIGTLClient.h
QmitkIGTLDeviceSourceManagementWidget::m_LostConnectionObserverTag
unsigned long m_LostConnectionObserverTag
Definition: QmitkIGTLDeviceSourceManagementWidget.h:121
QmitkIGTLDeviceSourceManagementWidget::m_MessageReceivedObserverTag
unsigned long m_MessageReceivedObserverTag
Definition: QmitkIGTLDeviceSourceManagementWidget.h:119
QmitkIGTLDeviceSourceManagementWidget::m_StateModifiedObserverTag
unsigned long m_StateModifiedObserverTag
Definition: QmitkIGTLDeviceSourceManagementWidget.h:123
QmitkIGTLDeviceSourceManagementWidget::m_IsClient
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
Definition: QmitkIGTLDeviceSourceManagementWidget.h:117
QmitkIGTLDeviceSourceManagementWidget::m_Controls
Ui::QmitkIGTLDeviceSourceManagementWidgetControls * m_Controls
Definition: QmitkIGTLDeviceSourceManagementWidget.h:108
QmitkIGTLDeviceSourceManagementWidget::m_NewConnectionObserverTag
unsigned long m_NewConnectionObserverTag
Definition: QmitkIGTLDeviceSourceManagementWidget.h:122
mitkIGTLDeviceSource.h