MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkTrackingDeviceConfigurationWidget.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 QmitkTrackingDeviceConfigurationWidget_h
14#define QmitkTrackingDeviceConfigurationWidget_h
15
16#include <QWidget>
17#include <QThread>
18#include "MitkIGTUIExports.h"
19#include "ui_QmitkTrackingDeviceConfigurationWidgetControls.h"
22
23
40class MITKIGTUI_EXPORT QmitkTrackingDeviceConfigurationWidget : public QWidget
41{
42 Q_OBJECT
43
44public:
45 static const std::string VIEW_ID;
46
47 QmitkTrackingDeviceConfigurationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = {});
49
50 /* @return Returns the current configurated tracking device. If the user didn't finished the
51 * configuration process or if there is an error during configuration nullptr is returned.
52 */
53 mitk::TrackingDevice::Pointer GetTrackingDevice();
54
59 void OnToolStorageChanged();
60
61signals:
62
63 /* @brief This signal is sent if the tracking device was changed. */
65
66public slots:
71 void OnConnected(bool _success);
76 void OnDisconnected(bool _success);
77
82 void OnStartTracking(bool _success);
87 void OnStopTracking(bool _success);
88
89protected:
90
92 virtual void CreateConnections();
93
94 virtual void CreateQtPartControl(QWidget *parent);
95
96 Ui::QmitkTrackingDeviceConfigurationWidgetControls* m_Controls;
97
98 // key is port name (e.g. "COM1", "/dev/ttyS0"), value will be filled with the type of tracking device at this port
99 typedef QMap<QString, mitk::TrackingDeviceType> PortDeviceMap;
100
101 //######################### internal help methods #######################################
102 void ResetOutput();
103 void AddOutput(std::string s);
104
105 void StoreUISettings();
106 void LoadUISettings();
107
108 /* @brief This method is called when the user clicks on "Refresh Selection" (m_RefreshTrackingDeviceCollection).
109 It then sets the correct widget for the selected tracking device.*/
110 void RefreshTrackingDeviceCollection();
111
112 protected slots:
113 /* @brief This method is called when the user changes the selection of the trackingdevice (m_trackingDeviceChooser).
114 It then sets the correct widget for the selected tracking device.*/
115 void TrackingDeviceChanged();
116
117private:
118 PERSISTENCE_GET_SERVICE_METHOD_MACRO
119
120 std::string GetCurrentDeviceName(void) const;
121
122 QmitkAbstractTrackingDeviceWidget* GetWidget(const std::string& deviceName) const;
123
127 std::map<std::string, int> m_DeviceToWidgetIndexMap;
128
129};
130
131#endif
Abstract class to configure a tracking device. Inherited widgets should be registered in the Microser...
An object of this class offers an UI to configurate a tracking device. If the user finished the confi...
Ui::QmitkTrackingDeviceConfigurationWidgetControls * m_Controls
QMap< QString, mitk::TrackingDeviceType > PortDeviceMap