Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
An object of this class offers an UI to send OpenIGTLink commands.
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
Ui::QmitkIGTLDeviceCommandWidgetControls * m_Controls
igtl::MessageBase::Pointer m_CurrentCommand