diff --git a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.H b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.H index 0eb6bcb92f..8cbb928b3c 100644 --- a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.H +++ b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.H @@ -1,98 +1,98 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef _QmitkUSNewVideoDeviceWidget_H_INCLUDED #define _QmitkUSNewVideoDeviceWidget_H_INCLUDED #include "mitkUSUIExports.h" #include "ui_QmitkUSNewVideoDeviceWidgetControls.h" #include "mitkUSDeviceService.h" //QT headers #include #include //mitk header /** * @brief TODO * * @ingroup USUI */ class MitkUSUI_EXPORT QmitkUSNewVideoDeviceWidget :public QWidget { //this is needed for all Qt objects that should have a MOC object (everything that derives from QObject) Q_OBJECT public: static const std::string VIEW_ID; QmitkUSNewVideoDeviceWidget(QWidget* p = 0, Qt::WindowFlags f1 = 0); virtual ~QmitkUSNewVideoDeviceWidget(); void Initialize(mitk::USDeviceService::Pointer deviceService); /* @brief This method is part of the widget an needs not to be called seperately. */ virtual void CreateQtPartControl(QWidget *parent); /* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/ virtual void CreateConnections(); signals: /* \brief Sent, when the user clicks "Activate Device" */ void USDeviceActivated(); public slots: /* \brief Should be called from the Implementing bundle whenever changes to the DeviceService happen */ - void OnDeviceServiceUpdated(); + //void OnDeviceServiceUpdated(); protected slots: /* \brief Called, when the Button Activate Device was clicked */ void OnClickedActivateDevice(); /* \brief Called, when the Button Disconnect Device was clicked */ void OnClickedDisconnectDevice(); protected: Ui::QmitkUSNewVideoDeviceWidgetControls* m_Controls; ///< member holding the UI elements of this widget /* \brief Constrcuts a ListItem from the given devie for display in the list of active devices */ QListWidgetItem* ConstructItemFromDevice(mitk::USDevice::Pointer device); private: mitk::USDeviceService::Pointer m_DeviceService; }; #endif // _QmitkUSNewVideoDeviceWidget_H_INCLUDED diff --git a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.cpp b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.cpp index 493d22a06b..884155fbc3 100644 --- a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.cpp +++ b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.cpp @@ -1,104 +1,93 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ //#define _USE_MATH_DEFINES #include //QT headers //mitk headers //itk headers const std::string QmitkUSNewVideoDeviceWidget::VIEW_ID = "org.mitk.views.QmitkUSNewVideoDeviceWidget"; QmitkUSNewVideoDeviceWidget::QmitkUSNewVideoDeviceWidget(QWidget* parent, Qt::WindowFlags f): QWidget(parent, f) { m_Controls = NULL; CreateQtPartControl(this); } QmitkUSNewVideoDeviceWidget::~QmitkUSNewVideoDeviceWidget() { } //////////////////// INITIALIZATION ///////////////////// void QmitkUSNewVideoDeviceWidget::Initialize (mitk::USDeviceService::Pointer deviceService){ m_DeviceService = deviceService; } void QmitkUSNewVideoDeviceWidget::CreateQtPartControl(QWidget *parent) { if (!m_Controls) { // create GUI widgets m_Controls = new Ui::QmitkUSNewVideoDeviceWidgetControls; m_Controls->setupUi(parent); this->CreateConnections(); } } void QmitkUSNewVideoDeviceWidget::CreateConnections() { if ( m_Controls ) { - connect( m_Controls->m_BtnActivate, SIGNAL(clicked()), this, SLOT(OnClickedActivateDevice()) ); - connect( m_Controls->m_BtnDisconnect, SIGNAL(clicked()), this, SLOT(OnClickedDisconnectDevice()) ); + //connect( m_Controls->m_BtnActivate, SIGNAL(clicked()), this, SLOT(OnClickedActivateDevice()) ); + // connect( m_Controls->m_BtnDisconnect, SIGNAL(clicked()), this, SLOT(OnClickedDisconnectDevice()) ); } } ///////////// Methods & Slots Handling Direct Interaction ///////////////// void QmitkUSNewVideoDeviceWidget::OnClickedActivateDevice(){ MITK_INFO << "Activated Device"; } void QmitkUSNewVideoDeviceWidget::OnClickedDisconnectDevice(){ MITK_INFO << "Disconnected Device"; } ///////////////// Methods & Slots Handling Logic ////////////////////////// -void QmitkUSNewVideoDeviceWidget::OnDeviceServiceUpdated(){ - // Empty ListWidget - m_Controls->m_ConnectedDevices->clear(); - // get active Devices - std::vector devices = m_DeviceService->GetActiveDevices(); - for(std::vector::iterator it = devices.begin(); it != devices.end(); ++it) { - QListWidgetItem *newItem = ConstructItemFromDevice(it->GetPointer()); - m_Controls->m_ConnectedDevices->addItem(newItem); - } -} - /////////////////////// HOUSEHOLDING CODE ///////////////////////////////// QListWidgetItem* QmitkUSNewVideoDeviceWidget::ConstructItemFromDevice(mitk::USDevice::Pointer device){ QListWidgetItem *result = new QListWidgetItem; std::string text = device->GetDeviceManufacturer() + "|" + device->GetDeviceModel(); result->setText(text.c_str()); return result; } \ No newline at end of file diff --git a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidgetControls.ui b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidgetControls.ui new file mode 100644 index 0000000000..d6768a3441 --- /dev/null +++ b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidgetControls.ui @@ -0,0 +1,91 @@ + + + QmitkUSNewVideoDeviceWidgetControls + + + + 0 + 0 + 405 + 242 + + + + + 0 + 0 + + + + QmitkUSNewVideoDeviceWidget + + + + + + Add Device + + + + + + + Metadata + + + + + + Manufacturer + + + + + + + + + + Model + + + + + + + + + + Probe + + + + + + + + + + Zoom + + + + + + + + + + + + + Calibration + + + + + + + + +