MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkNDIAbstractDeviceWidget.cpp
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
14
15#include <QThread>
16
17const std::string QmitkNDIAbstractDeviceWidget::VIEW_ID = "org.mitk.views.NDIAbstractDeviceWidget";
18
22 , m_ScanPortsWorkerThread(new QThread())
23{
24}
25
31
37
38void QmitkNDIAbstractDeviceWidget::CreateConnections()
39{
40 //slots for the worker thread
41 connect(m_ScanPortsWorker, SIGNAL(PortsScanned(int, QString, int)), this, SLOT(AutoScanPortsFinished(int, QString, int)));
42 connect(m_ScanPortsWorkerThread, SIGNAL(started()), m_ScanPortsWorker, SLOT(ScanPortsThreadFunc()));
43}
44
46{
47 this->setEnabled(false);
48 AddOutput("<br>Scanning...");
50}
51
52void QmitkNDIAbstractDeviceWidget::AutoScanPortsFinished(int Port, QString result, int PortType)
53{
55#ifdef WIN32
56 if (PortType != -1) { MITK_WARN << "Port type is specified although this should not be the case for Windows. Ignoring port type."; }
57#else //linux systems
58 SetPortTypeToGUI(PortType);
59#endif
61 AddOutput(result.toStdString());
62 this->setEnabled(true);
63}
Abstract class to configure a tracking device. Inherited widgets should be registered in the Microser...
PERSISTENCE_GET_SERVICE_METHOD_MACRO void InitializeSuperclassWidget()
void AddOutput(std::string s) override=0
Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget)
void PortsScanned(int Port, QString result, int PortType)
QmitkNDIAbstractDeviceWidget(QWidget *parent=nullptr, Qt::WindowFlags f={})
QmitkTrackingDeviceConfigurationWidgetScanPortsWorker * m_ScanPortsWorker
virtual void SetPortValueToGUI(int portValue)=0
void AutoScanPortsFinished(int Port, QString result, int PortType)
virtual void SetPortTypeToGUI(int portType)=0