MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkToFDeviceGeneration.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
13// Qmitk
15
16// Qt
17#include <QString>
18#include <QStringList>
19#include <QMessageBox>
20
23#include <mitkToFCameraDevice.h>
24
25
27
28#include <QmitkServiceListWidget.h>
29
30
31const std::string QmitkToFDeviceGeneration::VIEW_ID = "org.mitk.views.tofgeneration";
32
37
41
45
47 {
48 // create GUI widgets from the Qt Designer's .ui file
49 m_Controls.setupUi( parent );
50
51 //CreateDevice-Button
52 connect( (QObject*)(m_Controls.m_CreateDevice), SIGNAL(clicked()), this, SLOT(OnToFCameraConnected()) );
53
54 //Initializing the ServiceListWidget with DeviceFactories and Devices on start-uo
55 std::string empty= "";
56 m_Controls.m_DeviceFactoryServiceListWidget->Initialize<mitk::IToFDeviceFactory>("ToFFactoryName", empty);
57 m_Controls.m_ConnectedDeviceServiceListWidget->Initialize<mitk::ToFCameraDevice>("ToFDeviceName", empty);
58 }
59
60//Creating a Device
62{
63 if (m_Controls.m_DeviceFactoryServiceListWidget->GetIsServiceSelected() )
64 {
65 MITK_INFO << m_Controls.m_DeviceFactoryServiceListWidget->GetSelectedService<mitk::IToFDeviceFactory>()->GetFactoryName();
66
67
68 mitk::IToFDeviceFactory* factory = m_Controls.m_DeviceFactoryServiceListWidget->GetSelectedService<mitk::IToFDeviceFactory>();
69 dynamic_cast<mitk::AbstractToFDeviceFactory*>(factory)->ConnectToFDevice(); // This line should be copied to the DeviceActivator to produce a device on startr up
70 }
71 else
72 {
73 QMessageBox::warning(nullptr, "Warning", QString("No Device Factory selected. Unable to create a Device!\nPlease select an other Factory!"));
74 }
75
76}
Ui::QmitkToFDeviceGenerationControls m_Controls
static const std::string VIEW_ID
void CreateQtPartControl(QWidget *parent) override
void OnToFCameraConnected()
Slot called when the "Create Device" button of the ConnectionWidget is pressed.
Virtual interface and base class for all Time-of-Flight devices.
Virtual interface and base class for all Time-of-Flight device factories. The basic interface is in t...
This is the base of class for all ToFDeviceFactories.