diff --git a/Plugins/PluginList.cmake b/Plugins/PluginList.cmake index 94822bc5c7..f3316ce4d6 100644 --- a/Plugins/PluginList.cmake +++ b/Plugins/PluginList.cmake @@ -1,116 +1,115 @@ # Plug-ins must be ordered according to their dependencies set(MITK_PLUGINS org.blueberry.core.runtime:ON org.blueberry.core.expressions:OFF org.blueberry.core.commands:OFF org.blueberry.core.jobs:OFF org.blueberry.ui.qt:OFF org.blueberry.ui.qt.help:ON org.blueberry.ui.qt.log:ON org.blueberry.ui.qt.objectinspector:OFF #org.blueberry.test:ON #org.blueberry.uitest:ON #Testing/org.blueberry.core.runtime.tests:ON #Testing/org.blueberry.osgi.tests:ON org.mitk.core.services:ON org.mitk.gui.common:ON org.mitk.planarfigure:ON org.mitk.core.ext:OFF org.mitk.core.jobs:OFF org.mitk.gui.qt.application:ON org.mitk.gui.qt.coreapplication:OFF org.mitk.gui.qt.ext:OFF org.mitk.gui.qt.extapplication:OFF org.mitk.gui.qt.common:ON org.mitk.gui.qt.stdmultiwidgeteditor:ON org.mitk.gui.qt.common.legacy:OFF org.mitk.gui.qt.cmdlinemodules:OFF org.mitk.gui.qt.chartExample:OFF org.mitk.gui.qt.diffusionimagingapp:OFF org.mitk.gui.qt.datamanager:ON org.mitk.gui.qt.datamanagerlight:OFF org.mitk.gui.qt.datastorageviewertest:OFF org.mitk.gui.qt.properties:ON org.mitk.gui.qt.basicimageprocessing:OFF org.mitk.gui.qt.dicom:OFF org.mitk.gui.qt.dicominspector:OFF org.mitk.gui.qt.diffusionimaging:OFF org.mitk.gui.qt.diffusionimaging.connectomics:OFF org.mitk.gui.qt.diffusionimaging.denoising:OFF org.mitk.gui.qt.diffusionimaging.fiberfox:OFF org.mitk.gui.qt.diffusionimaging.fiberprocessing:OFF org.mitk.gui.qt.diffusionimaging.ivim:OFF org.mitk.gui.qt.diffusionimaging.odfpeaks:OFF org.mitk.gui.qt.diffusionimaging.partialvolume:OFF org.mitk.gui.qt.diffusionimaging.preprocessing:OFF org.mitk.gui.qt.diffusionimaging.reconstruction:OFF org.mitk.gui.qt.diffusionimaging.registration:OFF org.mitk.gui.qt.diffusionimaging.tractography:OFF org.mitk.gui.qt.diffusionimaging.python:OFF org.mitk.gui.qt.dosevisualization:OFF org.mitk.gui.qt.geometrytools:OFF org.mitk.gui.qt.igtexamples:OFF org.mitk.gui.qt.igttracking:OFF org.mitk.gui.qt.lasercontrol:OFF org.mitk.gui.qt.openigtlink:OFF org.mitk.gui.qt.imagecropper:OFF org.mitk.gui.qt.imagenavigator:ON org.mitk.gui.qt.viewnavigator:OFF org.mitk.gui.qt.materialeditor:OFF org.mitk.gui.qt.measurementtoolbox:OFF org.mitk.gui.qt.moviemaker:OFF org.mitk.gui.qt.pointsetinteraction:OFF org.mitk.gui.qt.pointsetinteractionmultispectrum:OFF org.mitk.gui.qt.python:OFF org.mitk.gui.qt.remeshing:OFF org.mitk.gui.qt.segmentation:OFF org.mitk.gui.qt.aicpregistration:OFF org.mitk.gui.qt.renderwindowmanager:OFF org.mitk.gui.qt.semanticrelations:OFF org.mitk.gui.qt.toftutorial:OFF org.mitk.gui.qt.tofutil:OFF org.mitk.gui.qt.tubegraph:OFF org.mitk.gui.qt.ugvisualization:OFF org.mitk.gui.qt.photoacoustics.pausviewer:OFF org.mitk.gui.qt.photoacoustics.pausmotioncompensation:OFF org.mitk.gui.qt.photoacoustics.imageprocessing:OFF org.mitk.gui.qt.photoacoustics.simulation:OFF org.mitk.gui.qt.photoacoustics.spectralunmixing:OFF org.mitk.gui.qt.ultrasound:OFF org.mitk.gui.qt.volumevisualization:OFF org.mitk.gui.qt.eventrecorder:OFF org.mitk.gui.qt.xnat:OFF org.mitk.gui.qt.igt.app.echotrack:OFF org.mitk.gui.qt.spectrocamrecorder:OFF org.mitk.gui.qt.classificationsegmentation:OFF org.mitk.gui.qt.overlaymanager:OFF org.mitk.gui.qt.igt.app.hummelprotocolmeasurements:OFF org.mitk.gui.qt.multilabelsegmentation:OFF org.mitk.matchpoint.core.helper:OFF org.mitk.gui.qt.matchpoint.algorithm.browser:OFF org.mitk.gui.qt.matchpoint.algorithm.control:OFF org.mitk.gui.qt.matchpoint.algorithm.batch:OFF org.mitk.gui.qt.matchpoint.mapper:OFF org.mitk.gui.qt.matchpoint.framereg:OFF org.mitk.gui.qt.matchpoint.visualizer:OFF org.mitk.gui.qt.matchpoint.evaluator:OFF org.mitk.gui.qt.matchpoint.manipulator:OFF org.mitk.gui.qt.preprocessing.resampling:OFF org.mitk.gui.qt.radiomics:OFF org.mitk.gui.qt.cest:OFF org.mitk.gui.qt.fit.demo:OFF org.mitk.gui.qt.fit.inspector:OFF org.mitk.gui.qt.fit.genericfitting:OFF org.mitk.gui.qt.pharmacokinetics.mri:OFF org.mitk.gui.qt.pharmacokinetics.pet:OFF org.mitk.gui.qt.pharmacokinetics.simulation:OFF org.mitk.gui.qt.pharmacokinetics.curvedescriptor:OFF org.mitk.gui.qt.pharmacokinetics.concentration.mri:OFF - org.mitk.gui.qt.cpprestexample:OFF ) diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/CMakeLists.txt b/Plugins/org.mitk.gui.qt.cpprestexample/CMakeLists.txt deleted file mode 100644 index 0c6bb48d51..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -project(org_mitk_gui_qt_cpprestexample) - -mitk_create_plugin( - EXPORT_DIRECTIVE THREAD_EXPORT - EXPORTED_INCLUDE_SUFFIXES src - MODULE_DEPENDS PRIVATE MitkQtWidgets MitkCppRestSdkQt -) diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/files.cmake b/Plugins/org.mitk.gui.qt.cpprestexample/files.cmake deleted file mode 100644 index 8807afe94a..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/files.cmake +++ /dev/null @@ -1,25 +0,0 @@ -set(CPP_FILES - src/internal/PluginActivator.cpp - src/internal/QmitkClientView.cpp - src/internal/QmitkServerView.cpp -) - -set(UI_FILES - src/internal/QmitkClientView.ui - src/internal/QmitkServerView.ui -) - -set(MOC_H_FILES - src/internal/PluginActivator.h - src/internal/QmitkClientView.h - src/internal/QmitkServerView.h -) - -set(CACHED_RESOURCE_FILES - resources/ClientIcon.svg - resources/ServerIcon.svg - plugin.xml -) - -set(QRC_FILES -) diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/manifest_headers.cmake b/Plugins/org.mitk.gui.qt.cpprestexample/manifest_headers.cmake deleted file mode 100644 index 532e8236c2..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/manifest_headers.cmake +++ /dev/null @@ -1,5 +0,0 @@ -set(Plugin-Name "CppRestExample Plugin") -set(Plugin-Version "1.0") -set(Plugin-Vendor "CAMIC") -set(Plugin-ContactAddress "https://mitk.org") -set(Require-Plugin org.mitk.gui.qt.common) diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/plugin.xml b/Plugins/org.mitk.gui.qt.cpprestexample/plugin.xml deleted file mode 100644 index 359a53fbba..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/plugin.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.png b/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.png deleted file mode 100644 index 67039a6cfb..0000000000 Binary files a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.png and /dev/null differ diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.svg b/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.svg deleted file mode 100644 index cc8f386bb1..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ClientIcon.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ServerIcon.svg b/Plugins/org.mitk.gui.qt.cpprestexample/resources/ServerIcon.svg deleted file mode 100644 index 60961ebd98..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/resources/ServerIcon.svg +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.cpp b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.cpp deleted file mode 100644 index fe688d1185..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/*=================================================================== - -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. - -===================================================================*/ - -#include "PluginActivator.h" -#include "QmitkClientView.h" -#include "QmitkServerView.h" - -void PluginActivator::start(ctkPluginContext* context) -{ - BERRY_REGISTER_EXTENSION_CLASS(QmitkClientView, context) - BERRY_REGISTER_EXTENSION_CLASS(QmitkServerView, context) -} - -void PluginActivator::stop(ctkPluginContext*) -{ -} diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.h b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.h deleted file mode 100644 index 4a8cacfbb5..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/PluginActivator.h +++ /dev/null @@ -1,33 +0,0 @@ -/*=================================================================== - -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 PluginActivator_h -#define PluginActivator_h - -#include - -class PluginActivator : public QObject, public ctkPluginActivator -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_exampleplugin") - Q_INTERFACES(ctkPluginActivator) - -public: - void start(ctkPluginContext* context); - void stop(ctkPluginContext* context); -}; - -#endif diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.cpp b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.cpp deleted file mode 100644 index 8f08f3c3a4..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.cpp +++ /dev/null @@ -1,269 +0,0 @@ -/*=================================================================== - -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. - -===================================================================*/ - -#include "QmitkClientView.h" - -#include - -#include "cpprest/json.h" -#include -#include -#include -#include -#include -#include - -const std::string QmitkClientView::VIEW_ID = "org.mitk.views.clientview"; - -QmitkClientView::QmitkClientView() : m_Ui(new Ui::QmitkClientView) -{ -} - -QmitkClientView::~QmitkClientView() -{ - delete m_Ui; -} - -void QmitkClientView::CreateQtPartControl(QWidget *parent) -{ - m_Ui->setupUi(parent); - - connect(m_Ui->getMultiplePushButton, &QPushButton::clicked, this, &QmitkClientView::OnGetMultipleButtonClicked); - connect(m_Ui->getSinglePushButton, &QPushButton::clicked, this, &QmitkClientView::OnGetSingleButtonClicked); - connect(m_Ui->getSavePushButton, &QPushButton::clicked, this, &QmitkClientView::OnGetSaveButtonClicked); - connect(m_Ui->putPushButton, &QPushButton::clicked, this, &QmitkClientView::OnPutButtonClicked); - connect(m_Ui->postPushButton, &QPushButton::clicked, this, &QmitkClientView::OnPostButtonClicked); - connect(this, &QmitkClientView::UpdateProgressBar, this, &QmitkClientView::OnUpdateProgressBar); - connect(this, SIGNAL(UpdateLabel(QString)), this, SLOT(OnUpdateLabel(QString))); - m_Ui->progressBar->setValue(0); -} - -void QmitkClientView::OnUpdateProgressBar() -{ - m_Ui->progressBar->setValue(m_Ui->progressBar->value() + 5); -} - -void QmitkClientView::OnUpdateLabel(QString text) -{ - m_Ui->responseLabel->setText(text); -} - -void QmitkClientView::SetFocus() {} - -void QmitkClientView::OnGetMultipleButtonClicked() -{ - m_Ui->progressBar->setValue(0); - m_Ui->getMultiplePushButton->setDisabled(true); - //Get microservice - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - //Create multiple tasks e.g. as shown below - std::vector> tasks; - for (int i = 0; i < 20; i++) - { - pplx::task singleTask = managerService->SendRequest(L"http://193.174.48.78:8090/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113654.2.70.1.97144850941324808603541273584489321943/series/1.2.840.113654.2.70.1.15771179684190906938515254678965278540/instances") - .then([=](pplx::task resultTask) { - //Do something when a single task is done - try - { - resultTask.get(); - emit UpdateProgressBar(); - } - catch (const mitk::Exception &exception) - { - MITK_ERROR << exception.what(); - return; - } - }); - tasks.emplace_back(singleTask); - } - //Create a joinTask which includes all tasks you've created - auto joinTask = pplx::when_all(begin(tasks), end(tasks)); - //Run asynchonously - joinTask.then([=](pplx::task resultTask) { - //Do something when all tasks are finished - try - { - resultTask.get(); - emit UpdateLabel("All tasks finished"); - } - catch (const mitk::Exception &exception) - { - MITK_ERROR << exception.what(); - return; - } - }); - m_Ui->responseLabel->setText("Waiting for change"); - } - } - m_Ui->getMultiplePushButton->setEnabled(true); -} - -void QmitkClientView::OnGetSingleButtonClicked() -{ - m_Ui->putPushButton->setDisabled(true); - //Get the micorservice - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - //Call the send request method which starts the actual request - managerService - ->SendRequest(L"http://193.174.48.78:8090/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113654.2.70.1.97144850941324808603541273584489321943/series/1.2.840.113654.2.70.1.15771179684190906938515254678965278540/instances") - .then([=](pplx::task resultTask)/*It is important to use task-based continuation*/ { - try - { - //Get the result of the request - //This will throw an exception if the ascendent task threw an exception (e.g. invalid URI) - web::json::value result = resultTask.get(); - //Do something with the result (e.g. convert it to a QSrting to update an UI element) - utility::string_t stringT = result.to_string(); - std::string stringStd(stringT.begin(), stringT.end()); - QString stringQ = QString::fromStdString(stringStd); - //Note: if you want to update your UI, do this by using signals and slots. - //The UI can't be updated from a Thread different to the Qt main thread - emit UpdateLabel(stringQ); - } - catch (const mitk::Exception &exception) - { - //Exceptions from ascendent tasks are catched here - MITK_ERROR << exception.what(); - return; - } - }); - } - } - m_Ui->putPushButton->setEnabled(true); -} - -void QmitkClientView::OnGetSaveButtonClicked() -{ - m_Ui->putPushButton->setDisabled(true); - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - managerService - ->SendRequest(L"http://193.174.48.78:8090/dcm4chee-arc/aets/DCM4CHEE/rs/studies/1.2.840.113654.2.70.1.97144850941324808603541273584489321943/series/1.2.840.113654.2.70.1.15771179684190906938515254678965278540/instances", mitk::IRESTManager::RequestType::Get, NULL,L"FileStream.txt") - .then([=](pplx::task resultTask) { - try - { - web::json::value result = resultTask.get(); - utility::string_t stringT = result.to_string(); - std::string stringStd(stringT.begin(), stringT.end()); - QString stringQ = QString::fromStdString(stringStd); - emit UpdateLabel(stringQ); - } - catch (const mitk::Exception &exception) - { - MITK_ERROR << exception.what(); - return; - } - }); - m_Ui->responseLabel->setText("Waiting for change"); - } - } - m_Ui->putPushButton->setEnabled(true); -} - -void QmitkClientView::OnPutButtonClicked() -{ - m_Ui->putPushButton->setDisabled(true); - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - web::json::value data; - data[L"userId"] = web::json::value(1); - data[L"id"] = web::json::value(1); - data[L"title"] = web::json::value(U("this is a changed title")); - data[L"body"] = web::json::value(U("and the body is changed as well")); - managerService->SendRequest( - L"https://jsonplaceholder.typicode.com/posts/1", mitk::IRESTManager::RequestType::Put, &data) - .then([=](pplx::task resultTask) { - try - { - web::json::value result = resultTask.get(); - utility::string_t stringT = result.to_string(); - std::string stringStd(stringT.begin(), stringT.end()); - QString stringQ = QString::fromStdString(stringStd); - emit UpdateLabel(stringQ); - } - catch (const mitk::Exception &exception) - { - MITK_ERROR << exception.what(); - return; - } - }); - } - } - m_Ui->putPushButton->setEnabled(true); -} - -void QmitkClientView::OnPostButtonClicked() -{ - m_Ui->postPushButton->setDisabled(true); - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - web::json::value data; - data[L"userId"] = web::json::value(1); - data[L"title"] = web::json::value(U("this is a new title")); - data[L"body"] = web::json::value(U("this is a new body")); - managerService - ->SendRequest(L"https://jsonplaceholder.typicode.com/posts", mitk::IRESTManager::RequestType::Post, &data) - .then([=](pplx::task resultTask) { - try - { - web::json::value result = resultTask.get(); - utility::string_t stringT = result.to_string(); - std::string stringStd(stringT.begin(), stringT.end()); - QString stringQ = QString::fromStdString(stringStd); - emit UpdateLabel(stringQ); - } - catch (const mitk::Exception &exception) - { - MITK_ERROR << exception.what(); - return; - } - }); - } - } - m_Ui->postPushButton->setEnabled(true); -} diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.h b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.h deleted file mode 100644 index 15ccb1c4aa..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.h +++ /dev/null @@ -1,62 +0,0 @@ -/*=================================================================== - -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 QmitkClientView_h -#define QmitkClientView_h - -#include -#include "cpprest/uri.h" -#include -namespace Ui -{ - class QmitkClientView; -} - -namespace mitk -{ - class RESTManager; -} - -class QmitkClientView : public QmitkAbstractView -{ - Q_OBJECT - -public: - static const std::string VIEW_ID; - - QmitkClientView(); - ~QmitkClientView() override; - - void CreateQtPartControl(QWidget *parent) override; - -signals: - void UpdateProgressBar(); - void UpdateLabel(QString); -private slots: - void OnGetMultipleButtonClicked(); - void OnGetSingleButtonClicked(); - void OnGetSaveButtonClicked(); - void OnPutButtonClicked(); - void OnPostButtonClicked(); - void OnUpdateProgressBar(); - void OnUpdateLabel(QString text); - -private: - void SetFocus() override; - Ui::QmitkClientView *m_Ui; -}; - -#endif diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.ui b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.ui deleted file mode 100644 index 37ca54a216..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkClientView.ui +++ /dev/null @@ -1,93 +0,0 @@ - - - QmitkClientView - - - - 0 - 0 - 253 - 265 - - - - Client View - - - - - - - - - GET (single tasks) - - - - - - - GET (multiple tasks) - - - - - - - GET and Save to File - - - - - - - PUT - - - - - - - POST - - - - - - - 24 - - - - - - - This label changes after request - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 220 - - - - - - - - - - diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.cpp b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.cpp deleted file mode 100644 index aa602c5c00..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.cpp +++ /dev/null @@ -1,146 +0,0 @@ -/*=================================================================== - -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. - -===================================================================*/ - -#include "QmitkServerView.h" - -#include - -#include -#include -#include -#include -#include -#include - -const std::string QmitkServerView::VIEW_ID = "org.mitk.views.serverview"; - -QmitkServerView::QmitkServerView() - : m_Ui(new Ui::QmitkServerView) -{ -} - -web::json::value QmitkServerView::Notify(const web::uri &uri, const web::json::value &data) -{ - MITK_INFO << "Observer: Data in observer"; - return data.at(U("key 1")); -} - -QmitkServerView::~QmitkServerView() -{ - delete m_Ui; -} - -void QmitkServerView::CreateQtPartControl(QWidget* parent) -{ - m_Ui->setupUi(parent); - - connect(m_Ui->stopAllPushButton, &QPushButton::clicked, this, &QmitkServerView::OnStopAllButtonClicked); - - connect(m_Ui->testListenCheckBox, &QCheckBox::clicked, this, &QmitkServerView::OnTestListenCheckBoxClicked); - connect(m_Ui->exampleListenCheckBox, &QCheckBox::clicked, this, &QmitkServerView::OnExampleListenCheckBoxClicked); - connect(m_Ui->port8090CheckBox, &QCheckBox::clicked, this, &QmitkServerView::OnPort8090ListenCheckBoxClicked); - - connect(m_Ui->stopAllPushButton, &QPushButton::clicked, this, &QmitkServerView::OnStopAllButtonClicked); -} - -void QmitkServerView::SetFocus() -{ -} - - -void QmitkServerView::StartListening(web::uri uri) -{ - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - managerService->ReceiveRequest(uri, this); - } - } -} - -void QmitkServerView::StopListening(web::uri uri) -{ - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - managerService->HandleDeleteObserver(this,uri); - } - } -} - -void QmitkServerView::OnStopAllButtonClicked() -{ - us::ModuleContext *context = us::ModuleRegistry::GetModule(1)->GetModuleContext(); - - auto managerRef = context->GetServiceReference(); - if (managerRef) - { - auto managerService = context->GetService(managerRef); - if (managerService) - { - managerService->HandleDeleteObserver(this); - } - } - m_Ui->testListenCheckBox->setChecked(false); - m_Ui->exampleListenCheckBox->setChecked(false); - m_Ui->port8090CheckBox->setChecked(false); -} - -void QmitkServerView::OnTestListenCheckBoxClicked() -{ - if (m_Ui->testListenCheckBox->isChecked()) - { - StartListening(L"http://localhost:8080/test"); - } - else - { - StopListening(L"http://localhost:8080/test"); - } -} - -void QmitkServerView::OnExampleListenCheckBoxClicked() -{ - if (m_Ui->exampleListenCheckBox->isChecked()) - { - StartListening(L"http://localhost:8080/example"); - } - else - { - StopListening(L"http://localhost:8080/example"); - } -} - -void QmitkServerView::OnPort8090ListenCheckBoxClicked() -{ - if (m_Ui->port8090CheckBox->isChecked()) - { - StartListening(L"http://localhost:8090"); - } - else - { - StopListening(L"http://localhost:8090"); - } -} diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.h b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.h deleted file mode 100644 index e46846662c..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.h +++ /dev/null @@ -1,60 +0,0 @@ -/*=================================================================== - -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 QmitkServerView_h -#define QmitkServerView_h - -#include -#include -#include "cpprest/uri.h" - -namespace Ui -{ - class QmitkServerView; -} - -namespace mitk -{ - class RESTManager; -} - -class QmitkServerView : public QmitkAbstractView, public mitk::IRESTObserver -{ - Q_OBJECT - -public: - static const std::string VIEW_ID; - - QmitkServerView(); - ~QmitkServerView() override; - - void CreateQtPartControl(QWidget *parent) override; - web::json::value Notify(const web::uri &uri, const web::json::value &data) override; - -private slots: - void OnStopAllButtonClicked(); - void OnTestListenCheckBoxClicked(); - void OnExampleListenCheckBoxClicked(); - void OnPort8090ListenCheckBoxClicked(); - -private: - void SetFocus() override; - void StartListening(web::uri); - void StopListening(web::uri); - Ui::QmitkServerView *m_Ui; -}; - -#endif diff --git a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.ui b/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.ui deleted file mode 100644 index e5f4e1a6bf..0000000000 --- a/Plugins/org.mitk.gui.qt.cpprestexample/src/internal/QmitkServerView.ui +++ /dev/null @@ -1,76 +0,0 @@ - - - QmitkServerView - - - - 0 - 0 - 253 - 206 - - - - Server View - - - - - - http://localhost:8080/test - - - - - - - http://localhost:8080/example - - - - - - - http://localhost:8090 - - - - - - - Stop Listening all - - - - - - - - - - true - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 220 - - - - - - - - - -