Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKIGTLDeviceCommandWIDGET_H
18 #define QMITKIGTLDeviceCommandWIDGET_H
19 
20 //QT headers
21 #include <QWidget>
22 #include <QTimer>
23 
24 //mitk headers
25 #include "MitkOpenIGTLinkUIExports.h"
26 #include "mitkIGTLDeviceSource.h"
27 #include "mitkIGTLClient.h"
28 #include "mitkDataStorage.h"
29 
30 //itk
31 #include <itkCommand.h>
32 
33 //ui header
34 #include "ui_QmitkIGTLDeviceCommandWidgetControls.h"
35 
42 class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceCommandWidget : public QWidget
43 {
44  Q_OBJECT
45 
46  public:
47  static const std::string VIEW_ID;
48 
59  void Initialize(mitk::IGTLDevice::Pointer device);
60 
61  QmitkIGTLDeviceCommandWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
63 
64 
65  protected slots:
66  void OnCommandChanged(const QString& curCommand);
67 
68  void OnSendCommand();
69 
71  //* \brief Is called when the current device received a message
72  //*/
73  //void OnMessageReceived();
74 
76  //* \brief Is called when the current device received a command
77  //*/
78  //void OnCommandReceived();
79 
84  void OnLostConnection();
85 
89  void OnNewConnection();
90 
94  void AdaptGUIToState();
95 
96  signals:
101  void AdaptGUIToStateSignal();
102 
103  protected:
104 
108  void OnDeviceStateChanged();
109 
111  void FillCommandsComboBox();
112 
114  virtual void CreateConnections();
115 
116  virtual void CreateQtPartControl(QWidget *parent);
117 
118  Ui::QmitkIGTLDeviceCommandWidgetControls* m_Controls;
119 
122 
124 
125 
128 
134 
135  //############## private help methods #######################
136  void DisableSourceControls();
137  void EnableSourceControls();
138 };
139 #endif
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
itk::SmartPointer< Self > Pointer
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