Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
QmitkIGTLDeviceCommandWidget.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 QmitkIGTLDeviceCommandWidget_h
14 #define QmitkIGTLDeviceCommandWidget_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_QmitkIGTLDeviceCommandWidgetControls.h"
31 
38 class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceCommandWidget : public QWidget
39 {
40  Q_OBJECT
41 
42  public:
43  static const std::string VIEW_ID;
44 
55  void Initialize(mitk::IGTLDevice::Pointer device);
56 
57  QmitkIGTLDeviceCommandWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
58  ~QmitkIGTLDeviceCommandWidget() override;
59 
60 
61  protected slots:
62  void OnCommandChanged(const QString& curCommand);
63 
64  void OnSendCommand();
65 
67  //* \brief Is called when the current device received a message
68  //*/
69  //void OnMessageReceived();
70 
72  //* \brief Is called when the current device received a command
73  //*/
74  //void OnCommandReceived();
75 
80  void OnLostConnection();
81 
85  void OnNewConnection();
86 
90  void AdaptGUIToState();
91 
92  signals:
97  void AdaptGUIToStateSignal();
98 
99  protected:
100 
104  void OnDeviceStateChanged();
105 
107  void FillCommandsComboBox();
108 
110  virtual void CreateConnections();
111 
112  virtual void CreateQtPartControl(QWidget *parent);
113 
114  Ui::QmitkIGTLDeviceCommandWidgetControls* m_Controls;
115 
117  mitk::IGTLDevice::Pointer m_IGTLDevice;
118 
119  igtl::MessageBase::Pointer m_CurrentCommand;
120 
121 
124 
130 
131  //############## private help methods #######################
132  void DisableSourceControls();
133  void EnableSourceControls();
134 };
135 #endif
QmitkIGTLDeviceCommandWidget
An object of this class offers an UI to send OpenIGTLink commands.
Definition: QmitkIGTLDeviceCommandWidget.h:38
QmitkIGTLDeviceCommandWidget::m_MessageReceivedObserverTag
unsigned long m_MessageReceivedObserverTag
Definition: QmitkIGTLDeviceCommandWidget.h:125
mitkDataStorage.h
QmitkIGTLDeviceCommandWidget::VIEW_ID
static const std::string VIEW_ID
Definition: QmitkIGTLDeviceCommandWidget.h:43
mitkIGTLClient.h
QmitkIGTLDeviceCommandWidget::m_StateModifiedObserverTag
unsigned long m_StateModifiedObserverTag
Definition: QmitkIGTLDeviceCommandWidget.h:129
QmitkIGTLDeviceCommandWidget::m_IGTLDevice
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
Definition: QmitkIGTLDeviceCommandWidget.h:117
QmitkIGTLDeviceCommandWidget::m_CurrentCommand
igtl::MessageBase::Pointer m_CurrentCommand
Definition: QmitkIGTLDeviceCommandWidget.h:119
QmitkIGTLDeviceCommandWidget::m_NewConnectionObserverTag
unsigned long m_NewConnectionObserverTag
Definition: QmitkIGTLDeviceCommandWidget.h:128
QmitkIGTLDeviceCommandWidget::m_CommandReceivedObserverTag
unsigned long m_CommandReceivedObserverTag
Definition: QmitkIGTLDeviceCommandWidget.h:126
QmitkIGTLDeviceCommandWidget::m_LostConnectionObserverTag
unsigned long m_LostConnectionObserverTag
Definition: QmitkIGTLDeviceCommandWidget.h:127
QmitkIGTLDeviceCommandWidget::m_IsClient
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
Definition: QmitkIGTLDeviceCommandWidget.h:123
QmitkIGTLDeviceCommandWidget::m_Controls
Ui::QmitkIGTLDeviceCommandWidgetControls * m_Controls
Definition: QmitkIGTLDeviceCommandWidget.h:114
mitkIGTLDeviceSource.h