MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkIGTLDeviceSetupConnectionWidget.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13#ifndef QmitkIGTLDeviceSetupConnectionWidget_h
14#define QmitkIGTLDeviceSetupConnectionWidget_h
15
16//QT headers
17#include <QWidget>
18#include <QTimer>
19
20//mitk headers
21#include "MitkOpenIGTLinkUIExports.h"
23#include "mitkIGTLClient.h"
24#include "mitkDataStorage.h"
25
26//itk
27#include <itkCommand.h>
28
29//ui header
30#include "ui_QmitkIGTLDeviceSetupConnectionWidgetControls.h"
31
39class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceSetupConnectionWidget : public QWidget
40{
41 Q_OBJECT
42
43 public:
44 static const std::string VIEW_ID;
45
56 void Initialize(mitk::IGTLDevice::Pointer device);
57
58 QmitkIGTLDeviceSetupConnectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
60
61// /**
62// * \brief Is called when the current device received a message
63// */
64// void OnMessageReceived(itk::Object* caller, const itk::EventObject&);
65
66// /**
67// * \brief Is called when the current device received a command
68// */
69// void OnCommandReceived(itk::Object* caller, const itk::EventObject&);
70
75 void OnLostConnection();
76
80 void OnNewConnection();
81
85 void OnMessageReceived();
86
90 void OnMessageSent();
91
95 void OnCommandReceived();
96
97 protected slots:
98
99 void OnConnect();
100 void OnPortChanged();
101 void OnHostnameChanged();
102 void OnUpdateFPSLabel();
103
107 void OnLogMessageDetailsCheckBoxClicked();
108
112 void OnBufferIncomingMessages(int state);
113
119 void OnBufferOutgoingMessages(int state);
120
124 void AdaptGUIToState();
125
126 signals:
132
133 protected:
137 void OnDeviceStateChanged();
138
140 virtual void CreateConnections();
141
142 virtual void CreateQtPartControl(QWidget *parent);
143
144 Ui::QmitkIGTLDeviceSetupConnectionWidgetControls* m_Controls;
145
147 mitk::IGTLDevice::Pointer m_IGTLDevice;
148
151
158
165
172
175
176 //############## private help methods #######################
177 void DisableSourceControls();
178// void EnableSourceControls();
179 void RemoveObserver();
180};
181#endif
An object of this class offers an UI to setup the connection of an OpenIGTLink device.
bool m_IsClient
flag to indicate if the IGTL device is a client or a server
QTimer m_FPSCalculationTimer
the timer used to calculate the frames per second
mitk::IGTLDevice::Pointer m_IGTLDevice
holds the OpenIGTLink device
unsigned int m_NumSentFramesSinceLastUpdate
the number of sent frames (messages) since the last fps calculation update
void AdaptGUIToStateSignal()
used for thread seperation, the worker thread must not call AdaptGUIToState directly....
Ui::QmitkIGTLDeviceSetupConnectionWidgetControls * m_Controls
unsigned int m_NumReceivedFramesSinceLastUpdate
the number of received frames (messages) since the last fps calculation update