Mercurial > hg > orthanc-stone
changeset 81:8677d95753f8 wasm
switching to Oracle in SDL samples
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 24 May 2017 22:54:09 +0200 |
parents | f40a78cc7070 |
children | cee8f308a4bc |
files | Applications/BasicApplicationContext.cpp Applications/BasicApplicationContext.h Applications/IBasicApplication.cpp CMakeLists.txt |
diffstat | 4 files changed, 32 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/Applications/BasicApplicationContext.cpp Wed May 24 22:33:20 2017 +0200 +++ b/Applications/BasicApplicationContext.cpp Wed May 24 22:54:09 2017 +0200 @@ -41,8 +41,9 @@ } - BasicApplicationContext::BasicApplicationContext(OrthancSynchronousWebService& orthanc) : - orthanc_(orthanc), + BasicApplicationContext::BasicApplicationContext(Orthanc::WebServiceParameters& orthanc) : + oracle_(viewportMutex_, 4), // Use 4 threads to download + webService_(oracle_, orthanc), stopped_(true), updateDelay_(100) // By default, 100ms between each refresh of the content { @@ -82,7 +83,7 @@ bool isProgressiveDownload, size_t downloadThreadCount) { - std::auto_ptr<VolumeImage> volume + /*std::auto_ptr<VolumeImage> volume (new VolumeImage(new OrthancSeriesLoader(GetWebService().GetConnection(), series))); if (isProgressiveDownload) @@ -99,19 +100,23 @@ VolumeImage& result = *volume; volumes_.push_back(volume.release()); - return result; + return result;*/ + + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } DicomStructureSet& BasicApplicationContext::AddStructureSet(const std::string& instance) { - std::auto_ptr<DicomStructureSet> structureSet + /*std::auto_ptr<DicomStructureSet> structureSet (new DicomStructureSet(GetWebService().GetConnection(), instance)); DicomStructureSet& result = *structureSet; structureSets_.push_back(structureSet.release()); - return result; + return result;*/ + + throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); } @@ -130,6 +135,8 @@ void BasicApplicationContext::Start() { + oracle_.Start(); + for (Volumes::iterator it = volumes_.begin(); it != volumes_.end(); ++it) { assert(*it != NULL); @@ -160,5 +167,7 @@ assert(*it != NULL); (*it)->Stop(); } + + oracle_.Stop(); } }
--- a/Applications/BasicApplicationContext.h Wed May 24 22:33:20 2017 +0200 +++ b/Applications/BasicApplicationContext.h Wed May 24 22:54:09 2017 +0200 @@ -26,6 +26,7 @@ #include "../../Framework/Widgets/IWorldSceneInteractor.h" #include "../../Framework/Toolbox/DicomStructureSet.h" #include "../../Framework/Toolbox/OrthancSynchronousWebService.h" +#include "../../Platforms/Generic/OracleWebService.h" #include <list> #include <boost/thread.hpp> @@ -41,7 +42,8 @@ static void UpdateThread(BasicApplicationContext* that); - OrthancSynchronousWebService& orthanc_; + Oracle oracle_; + OracleWebService webService_; boost::mutex viewportMutex_; WidgetViewport viewport_; Volumes volumes_; @@ -72,15 +74,15 @@ }; - BasicApplicationContext(OrthancSynchronousWebService& orthanc); + BasicApplicationContext(Orthanc::WebServiceParameters& orthanc); ~BasicApplicationContext(); IWidget& SetCentralWidget(IWidget* widget); // Takes ownership - OrthancSynchronousWebService& GetWebService() + IWebService& GetWebService() { - return orthanc_; + return webService_; } VolumeImage& AddSeriesVolume(const std::string& series,
--- a/Applications/IBasicApplication.cpp Wed May 24 22:33:20 2017 +0200 +++ b/Applications/IBasicApplication.cpp Wed May 24 22:54:09 2017 +0200 @@ -197,12 +197,15 @@ } LOG(WARNING) << "URL to the Orthanc REST API: " << webService.GetUrl(); - OrthancSynchronousWebService orthanc(webService); + + { + OrthancSynchronousWebService orthanc(webService); - if (!MessagingToolbox::CheckOrthancVersion(orthanc.GetConnection())) - { - LOG(ERROR) << "Your version of Orthanc is incompatible with Orthanc Stone, please upgrade"; - throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); + if (!MessagingToolbox::CheckOrthancVersion(orthanc.GetConnection())) + { + LOG(ERROR) << "Your version of Orthanc is incompatible with Orthanc Stone, please upgrade"; + throw Orthanc::OrthancException(Orthanc::ErrorCode_NetworkProtocol); + } } @@ -213,7 +216,7 @@ LOG(WARNING) << "Creating the widgets of the application"; LogStatusBar statusBar; - BasicApplicationContext context(orthanc); + BasicApplicationContext context(webService); application.Initialize(context, statusBar, parameters);
--- a/CMakeLists.txt Wed May 24 22:33:20 2017 +0200 +++ b/CMakeLists.txt Wed May 24 22:54:09 2017 +0200 @@ -34,9 +34,9 @@ BuildSample(OrthancStoneEmpty 1) BuildSample(OrthancStoneTestPattern 2) BuildSample(OrthancStoneSingleFrame 3) -BuildSample(OrthancStoneSingleVolume 4) +#BuildSample(OrthancStoneSingleVolume 4) BuildSample(OrthancStoneBasicPetCtFusion 5) -BuildSample(OrthancStoneSynchronizedSeries 6) +#BuildSample(OrthancStoneSynchronizedSeries 6) BuildSample(OrthancStoneLayoutPetCtFusion 7)